diff --git a/.editorconfig b/.editorconfig index 398a042e..cbde0b15 100644 --- a/.editorconfig +++ b/.editorconfig @@ -6,7 +6,6 @@ root = true # All Files [*] charset = utf-8 -end_of_line = crlf indent_style = space indent_size = 4 insert_final_newline = false diff --git a/.gitattributes b/.gitattributes index dfdb8b77..aea4768c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,10 @@ +# Set default behavior to automatically normalize line endings. +* text=auto + +# shell files should always be LF *.sh text eol=lf + +# Unity files +*.asset text eol=lf +*.meta text eol=lf +*.asmdef text eol=lf diff --git a/.gitignore b/.gitignore index b414983b..8b75980d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,222 +1,232 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. - -# User-specific files -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -build/ -bld/ -[Bb]in/ -[Oo]bj/ - -# Visual Studio 2015 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUNIT -*.VisualState.xml -TestResult.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# DNX -project.lock.json -artifacts/ - -*_i.c -*_p.c -*_i.h -*.ilk -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opensdf -*.sdf -*.cachefile - -# Visual Studio profiler -*.psess -*.vsp -*.vspx - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# JustCode is a .NET coding add-in -.JustCode - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# TODO: Comment the next line if you want to checkin your web deploy settings -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# NuGet Packages -*.nupkg -# The packages folder can be ignored because of Package Restore -**/packages/* -# except build/, which is used as an MSBuild target. -!**/packages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/packages/repositories.config - -# Windows Azure Build Output -csx/ -*.build.csdef - -# Windows Store app package directory -AppPackages/ - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!*.[Cc]ache/ - -# Others -ClientBin/ -[Ss]tyle[Cc]op.* -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.pfx -*.publishsettings -node_modules/ -orleans.codegen.cs - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm - -# SQL Server files -*.mdf -*.ldf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings - -# Microsoft Fakes -FakesAssemblies/ - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# LLVM extracted file -ext/llvm/win64_debug/ -ext/llvm/win64_release/ -ext/llvm/macos/ -*.idea -.DS_Store +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +bin +bin.meta +Library +[Ll]ogs +[Tt]emp +obj +obj.meta +# User-specific files +*.csproj.user +*.suo +*.user +*.userosscache +*.sln.docstates +.vs +*.VC.* + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +build/ +bld/ +[Bb]in/ +[Oo]bj/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +#**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config + +# Windows Azure Build Output +csx/ +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +!*CodeGen~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# LLVM extracted file +ext/llvm/win64_debug/ +ext/llvm/win64_release/ +ext/llvm/macos/ +*.idea +.DS_Store diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100755 index 77089510..00000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,21 +0,0 @@ -variables: - GIT_SUBMODULE_STRATEGY: recursive - -stages: - - build_package - -build_package:mac: - stage: build_package - tags: - - mac - only: - - tags - script: - - cd src/ - - npm version $CI_COMMIT_TAG - - npm pack . - - tar xzvf com.unity.mathematics-$CI_COMMIT_TAG.tgz - - cd .. - - python Tools/CI/validation.py --package-path src/package - - cd src/ - - npm publish com.unity.mathematics-$CI_COMMIT_TAG.tgz diff --git a/.yamato/upm-ci.yml b/.yamato/upm-ci.yml new file mode 100644 index 00000000..27b41405 --- /dev/null +++ b/.yamato/upm-ci.yml @@ -0,0 +1,192 @@ +build_platforms: + - name: windows + type: Unity::VM + image: package-ci/win10:v4 + flavor: b1.large + - name: linux + image: package-ci/ubuntu-22.04:v4 + type: Unity::VM + flavor: b1.large + - name: macOS + image: package-ci/macos-13:v4 + type: Unity::VM::osx + flavor: b1.large + +upmci_platforms: + - name: windows + type: Unity::VM + image: package-ci/win10:v4 + flavor: b1.large + - name: linux + image: package-ci/ubuntu-22.04:v4 + type: Unity::VM + flavor: b1.large + - name: macOS + image: package-ci/macos-13:v4 + type: Unity::VM::osx + flavor: b1.large + +validate_editor_versions: + - version: "6000.0" + display_name: "6000.0" + - version: "6000.3" + display_name: "6000.3" + +package_tests_editor_versions: + - version: "6000.0" + display_name: "6000.0" + - version: "6000.3" + display_name: "6000.3" +--- + +{% for platform in upmci_platforms %} +{% for editor in package_tests_editor_versions %} +package_tests_{{platform.name}}_{{editor.display_name}}: + name: Package tests {{platform.name}} {{editor.display_name}} + agent: + image: {{platform.image}} + type: {{platform.type}} + flavor: {{platform.flavor}} + commands: + - npm install upm-ci-utils@stable --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm -g + - upm-ci package pack --package-path src/ + - upm-ci package test --type package-tests --package-path src/ --unity-version {{ editor.version }} + artifacts: + test_results: + paths: + - "upm-ci~/**/*" +{% endfor %} +{% endfor %} + +package_tests_all: + name: Package tests all + dependencies: + {% for platform in upmci_platforms %} + {% for editor in package_tests_editor_versions %} + - .yamato/upm-ci.yml#package_tests_{{platform.name}}_{{editor.display_name}} + {% endfor %} + {% endfor %} + +package_tests_minimal: + name: Package tests minimal + dependencies: + {% for platform in upmci_platforms %} + - .yamato/upm-ci.yml#package_tests_{{platform.name}}_6000.3 + {% endfor %} + +validate_package_minimal: + name: Validate Package Linux Minimal + agent: + image: package-ci/ubuntu-22.04:v4 + type: Unity::VM + flavor: b1.large + commands: + - npm install upm-ci-utils@stable --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm -g + - upm-ci package pack --package-path src/ + - upm-ci package test --package-path src/ --unity-version 6000.3 + artifacts: + packages: + paths: + - "upm-ci~/packages/**/*" + test_results: + paths: + - "upm-ci~/**/*" + +{% for platform in upmci_platforms %} +{% for editor in validate_editor_versions %} +validate_package_{{platform.name}}_{{editor.display_name}}: + name: Validate package {{platform.name}} {{editor.display_name}} + agent: + image: {{platform.image}} + type: {{platform.type}} + flavor: {{platform.flavor}} + commands: + - npm install upm-ci-utils@stable --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm -g + - upm-ci package pack --package-path src/ + - upm-ci package test --package-path src/ --unity-version {{ editor.version }} + artifacts: + packages_{{platform.name}}_{{editor.display_name}}: + paths: + - "upm-ci~/packages/**/*" + results_{{platform.name}}_{{editor.display_name}}: + paths: + - "upm-ci~/**/*" +{% endfor %} +{% endfor %} + +validate_package_all: + name: Validate package all + dependencies: + {% for platform in upmci_platforms %} + {% for editor in validate_editor_versions %} + - .yamato/upm-ci.yml#validate_package_{{platform.name}}_{{editor.display_name}} + {% endfor %} + {% endfor %} + +publish: + name: Publish + agent: + type: Unity::VM + image: package-ci/win10:v4 + flavor: b1.large + variables: + UPMCI_ENABLE_PACKAGE_SIGNING: 1 + commands: + - npm install upm-ci-utils@stable --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm -g + - upm-ci package publish --package-path src/ + artifacts: + packages: + paths: + - "upm-ci~/packages/**/*" + dependencies: + {% for platform in build_platforms %} + {% for editor in validate_editor_versions %} + - .yamato/upm-ci.yml#validate_package_{{platform.name}}_{{editor.display_name}} + {% endfor %} + {% endfor %} + - .yamato/upm-ci.yml#package_tests_minimal + +promote: + name: Promote + agent: + type: Unity::VM + image: package-ci/win10:v4 + flavor: b1.large + variables: + UPMCI_PROMOTION: 1 + commands: + - npm install upm-ci-utils@stable --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm -g + - upm-ci package promote --package-path src/ + artifacts: + packages: + paths: + - "upm-ci~/packages/**/*" + dependencies: + - .yamato/upm-ci.yml#publish + +publish_ci: + name: all Publish Pipeline + triggers: + tags: + only: + - /^\d+\.\d+\.\d+(-preview(\.\d+)?)?$/ + dependencies: + - .yamato/upm-ci.yml#publish + +nightly_ci: + name: all Nightly Pipeline + triggers: + recurring: + - branch: master + frequency: daily + dependencies: + - .yamato/upm-ci.yml#validate_package_all + +commit_ci: + name: Commit CI pipeline + triggers: + branches: + only: + - "/.*/" + dependencies: + - .yamato/upm-ci.yml#package_tests_minimal diff --git a/LICENSE.md b/LICENSE.md index 4c2154cc..0c7f3fac 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,30 +1,4 @@ -Unity Companion License (“License”) -Software Copyright © 2017 Unity Technologies ApS - -Unity Technologies ApS (“Unity”) grants to you a worldwide, non-exclusive, no-charge, and royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute the software that is made available under this License (“Software”), subject to the following terms and conditions: - -1. Unity Companion Use Only. Exercise of the license granted herein is limited to exercise for the creation, use, and/or distribution of applications, software, or other content pursuant to a valid Unity content authoring and rendering engine software license (“Engine License”). That means while use of the Software is not limited to use in the software licensed under the Engine License, the Software may not be used for any purpose other than the creation, use, and/or distribution of Engine License-dependent applications, software, or other content. No other exercise of the license granted herein is permitted, and in no event may the Software be used for competitive analysis or to develop a competing product or service. - -2. No Modification of Engine License. Neither this License nor any exercise of the license granted herein modifies the Engine License in any way. - -3. Ownership & Grant Back to You. +com.unity.mathematics copyright © 2023 Unity Technologies ApS -3.1 You own your content. In this License, “derivative works” means derivatives of the Software itself--works derived only from the Software by you under this License (for example, modifying the code of the Software itself to improve its efficacy); “derivative works” of the Software do not include, for example, games, apps, or content that you create using the Software. You keep all right, title, and interest to your own content. - -3.2 Unity owns its content. While you keep all right, title, and interest to your own content per the above, as between Unity and you, Unity will own all right, title, and interest to all intellectual property rights (including patent, trademark, and copyright) in the Software and derivative works of the Software, and you hereby assign and agree to assign all such rights in those derivative works to Unity. - -3.3 You have a license to those derivative works. Subject to this License, Unity grants to you the same worldwide, non-exclusive, no-charge, and royalty-free copyright license to derivative works of the Software you create as is granted to you for the Software under this License. - -4. Trademarks. You are not granted any right or license under this License to use any trademarks, service marks, trade names, products names, or branding of Unity or its affiliates (“Trademarks”). Descriptive uses of Trademarks are permitted; see, for example, Unity’s Branding Usage Guidelines at https://unity3d.com/public-relations/brand. - -5. Notices & Third-Party Rights. This License, including the copyright notice associated with the Software, must be provided in all substantial portions of the Software and derivative works thereof (or, if that is impracticable, in any other location where such notices are customarily placed). Further, if the Software is accompanied by a Unity “third-party notices” or similar file, you acknowledge and agree that software identified in that file is governed by those separate license terms. - -6. DISCLAIMER, LIMITATION OF LIABILITY. THE SOFTWARE AND ANY DERIVATIVE WORKS THEREOF IS PROVIDED ON AN "AS IS" BASIS, AND IS PROVIDED WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND/OR NONINFRINGEMENT. IN NO EVENT SHALL ANY COPYRIGHT HOLDER OR AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES (WHETHER DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL, INCLUDING PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, LOSS OF USE, DATA, OR PROFITS, AND BUSINESS INTERRUPTION), OR OTHER LIABILITY WHATSOEVER, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM OR OUT OF, OR IN CONNECTION WITH, THE SOFTWARE OR ANY DERIVATIVE WORKS THEREOF OR THE USE OF OR OTHER DEALINGS IN SAME, EVEN WHERE ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -7. USE IS ACCEPTANCE and License Versions. Your receipt and use of the Software constitutes your acceptance of this License and its terms and conditions. Software released by Unity under this License may be modified or updated and the License with it; upon any such modification or update, you will comply with the terms of the updated License for any use of any of the Software under the updated License. - -8. Use in Compliance with Law and Termination. Your exercise of the license granted herein will at all times be in compliance with applicable law and will not infringe any proprietary rights (including intellectual property rights); this License will terminate immediately on any breach by you of this License. - -9. Severability. If any provision of this License is held to be unenforceable or invalid, that provision will be enforced to the maximum extent possible and the other provisions will remain in full force and effect. - -10. Governing Law and Venue. This License is governed by and construed in accordance with the laws of Denmark, except for its conflict of laws rules; the United Nations Convention on Contracts for the International Sale of Goods will not apply. If you reside (or your principal place of business is) within the United States, you and Unity agree to submit to the personal and exclusive jurisdiction of and venue in the state and federal courts located in San Francisco County, California concerning any dispute arising out of this License (“Dispute”). If you reside (or your principal place of business is) outside the United States, you and Unity agree to submit to the personal and exclusive jurisdiction of and venue in the courts located in Copenhagen, Denmark concerning any Dispute. \ No newline at end of file +Licensed under the Unity Companion License for Unity-dependent projects (see https://unity3d.com/legal/licenses/unity_companion_license). +Unless expressly provided otherwise, the Software under this license is made available strictly on an “AS IS” BASIS WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. Please review the license for details on these and other terms and conditions. diff --git a/Tools/CI/ValidatePackage.cs b/Tools/CI/ValidatePackage.cs new file mode 100644 index 00000000..3a1aa104 --- /dev/null +++ b/Tools/CI/ValidatePackage.cs @@ -0,0 +1,92 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text.RegularExpressions; +using Unity.Properties.Serialization; +using UnityEditor; +using UnityEditor.PackageManager.ValidationSuite; +using UnityEngine; + +public class ValidatePackage +{ + static List failuresWhitelist = new List{};// "Restricted File Type Validation", "Tests Validation" }; + + [MenuItem("Window/Validate Mathematics")] + public static void ValidateMathematics() + { + ValidateInternal("../package"); + } + + static void FilterWhitelistedFailures(string report) + { + var reportLines = report.Split(new string[] {"\r\n\r\n"}, StringSplitOptions.RemoveEmptyEntries); + Array.Copy(reportLines, 2, reportLines, 0, reportLines.Length - 2); + Regex regex = new Regex($"(\\w+)[ -]+\"([\\w\\s]+)\"\\s+(.*)"); + + var issues = string.Empty; + + foreach (var line in reportLines) + { + var match = regex.Match(line); + if (match.Success) + { + var status = match.Groups[1].Captures[0].Value; + if (status != "Failed") + continue; + var check = match.Groups[2].Captures[0].Value; + var data = match.Groups[3].Captures[0].Value; + + if (status == "Failed" && failuresWhitelist.Contains(check)) + continue; + + issues += line + "\r\n"; + } + } + + if (issues != string.Empty) + { + throw new Exception(issues); + } + } + + public static void ValidateInternal(string packagePath) + { + var packageManifest = Path.Combine(packagePath, "package.json"); + if (!File.Exists(packageManifest)) + throw new Exception($"File package.json not found in {packagePath}"); + + object dict; + if (!Json.TryDeserializeObject(File.ReadAllText(packageManifest), out dict)) + throw new Exception($"Invalid package.json file in {packageManifest}"); + + Json.TryGetValue((IDictionary)dict, "name", out string name); + Json.TryGetValue((IDictionary)dict, "version", out string version); + + var result = ValidationSuite.ValidatePackage($"{name}@{version}", ValidationType.Publishing); + if (!result) + FilterWhitelistedFailures(ValidationSuite.GetValidationSuiteReport(name, version)); + } + + public static void Validate() + { + var arguments = Environment.GetCommandLineArgs(); + var executeMethodIndex = 0; + while (executeMethodIndex < arguments.Length) + { + if (arguments[executeMethodIndex] == "-executeMethod") + break; + executeMethodIndex++; + } + + // Need to advance by 2 elements because the format is -executeMethod Builders.Build + // n.b.: executeMethodIndex is the index of -executeMethod + var targetIndex = executeMethodIndex + 2; + if (targetIndex >= arguments.Length || arguments[targetIndex].StartsWith("-")) + throw new Exception("Wrong argument. To execute this method run unity with the parameter -executeMethod ValidatePackage.Validate "); + + var packagePath = arguments[targetIndex]; + ValidateInternal(packagePath); + } +} diff --git a/Tools/CI/get_unity_launcher.py b/Tools/CI/get_unity_launcher.py new file mode 100644 index 00000000..628cc089 --- /dev/null +++ b/Tools/CI/get_unity_launcher.py @@ -0,0 +1,43 @@ +import os +import sys + +import utils + +artifactory_api_url = "https://artifactory.eu-cph-1.unityops.net" +artifactory_api_repository = "core-automation" +artifactory_download_url = "https://bfartifactory.bf.unity3d.com/artifactory/ie-generic-core-automation" +bokken_artifactory_cache_url = "http://172.28.214.140/" +build_version = '2018.2.*&latest=true' + +def download_unity_launcher(type): + if not os.path.exists(".tmp"): + os.mkdir(".tmp") + download_url = artifactory_download_url + if 'USE_UBERBUCKET' in os.environ: + download_url = bokken_artifactory_cache_url + utils.download_url("%s/tools/unity-launcher/UnityLauncher.%s.zip" % (download_url, type), + ".tmp/UnityLauncher.%s.zip" % type) + + +def extract_unity_launcher(type): + utils.extract_zip(".tmp/UnityLauncher.%s.zip" % type, + ".UnityLauncher.%s" % type) + current_os = utils.get_current_os() + if current_os == "macOS": + os.chmod('.UnityLauncher.{0}/osx.10.12-x64/publish/UnityLauncher.{0}'.format(type), 0755) + elif current_os == "linux": + os.chmod('.UnityLauncher.{0}/linux-x64/publish/UnityLauncher.{0}'.format(type), 0755) + + +def prepare_unity_launcher(run_type): + + download_unity_launcher(run_type) + extract_unity_launcher(run_type) + +def main(): + prepare_unity_launcher("Editor") + return + + +if __name__ == "__main__": + main() diff --git a/Tools/CI/utils.py b/Tools/CI/utils.py new file mode 100644 index 00000000..91c2f91e --- /dev/null +++ b/Tools/CI/utils.py @@ -0,0 +1,108 @@ +import json +import os +import shutil +import tarfile +import zipfile +import subprocess + +import requests + +import sys + +target_os = sys.platform + +def get_current_os(): + p = sys.platform + if p == "darwin": + return "macOS" + if p == "win32": + return "windows" + return "linux" + + +def get_target_os(): + if target_os != sys.platform: + return target_os + + return get_current_os() + + +def set_target_os(target): + global target_os + target_os = target + +def get_url_json(url): + print " Getting json from {0}".format(url) + import urllib2 + response = urllib2.urlopen(url) + return json.loads(response.read()) + + +def extract_tarball(download_path, extract_path): + print " Extracting %s into %s" % (download_path, extract_path) + tar = tarfile.open(download_path, "r:gz") + tar.extractall(extract_path) + tar.close() + + +def download_url(url, filename): + print " Downloading %s to %s" % (url, filename) + + r = requests.get(url, stream=True) + with open(filename, 'wb') as f: + shutil.copyfileobj(r.raw, f) + + +def extract_zip(archive, destination): + print " Extracting %s into %s" % (archive, destination) + import zipfile + if get_current_os() == "windows": + zip_ref = ZipfileLongWindowsPaths(archive, 'r') + else: + zip_ref = zipfile.ZipFile(archive, 'r') + zip_ref.extractall(destination) + zip_ref.close() + + +def winapi_path(dos_path, encoding=None): + path = os.path.abspath(dos_path) + + if path.startswith("\\\\"): + path = "\\\\?\\UNC\\" + path[2:] + else: + path = "\\\\?\\" + path + + return path + + +def npm_cmd(cmd, registry): + registry_cmd = '' + if registry: + registry_cmd = "--registry {0}".format(registry) + + formatted_cmd = 'npm {0} {1}'.format(cmd, registry_cmd) + + print " Running: {0}".format(formatted_cmd) + return subprocess.check_output(formatted_cmd, shell=True, stderr=subprocess.STDOUT) + + +def git_cmd(cmd, print_command=True): + formatted_cmd = "git {0}".format(cmd) + if print_command: + print " Running: {0}".format(formatted_cmd) + return subprocess.check_output(formatted_cmd, shell=True, stderr=subprocess.STDOUT) + + +def git_cmd_code_only(cmd, print_command=True): + formatted_cmd = "git {0}".format(cmd) + if print_command: + print " Running: {0}".format(formatted_cmd) + with open(os.devnull, 'w') as devnull: + return subprocess.call(formatted_cmd, shell=True, stderr=devnull, stdout=devnull) + + +class ZipfileLongWindowsPaths(zipfile.ZipFile): + + def _extract_member(self, member, targetpath, pwd): + targetpath = winapi_path(targetpath) + return zipfile.ZipFile._extract_member(self, member, targetpath, pwd) diff --git a/Tools/CI/validation.py b/Tools/CI/validation.py index 32bfda49..b1064b0e 100644 --- a/Tools/CI/validation.py +++ b/Tools/CI/validation.py @@ -1,6 +1,8 @@ import argparse +import datetime import os - +import json +import re args = None @@ -17,21 +19,63 @@ def should_ignore(path): return False -def check_metafiles_in_package(package_folder): - root_files = list_files_and_directories_in_folder(package_folder) +def check_metafiles_in_package(package_path): + if not os.path.exists(package_path): + raise Exception("The package specified {0} does not exist.".format(package_path)) + root_files = list_files_and_directories_in_folder(package_path) + success = True for file in root_files: if should_ignore(file): continue - if os.path.isdir(file): - check_metafiles_in_package(file) - + combined_path = os.path.join(package_path, file) + if os.path.isdir(combined_path): + success = check_metafiles_in_package(combined_path) & success + if file.endswith("meta") and file[:-5] not in root_files: + print '{0} is a dangling meta file. Please remove it'.format( + combined_path, package_path) + success = False if not file.endswith("meta") and not file + ".meta" in root_files: - raise Exception( - 'Missing {0}.meta in package {1}. Packages require every file and directory to have a meta file associated.'.format( - file, package_folder)) + print "{0} doesn't have a meta file. Please add one".format( + combined_path, package_path) + success = False + return success + + +def check_changelog(package_path): + changelog_path = os.path.join(package_path, "changelog.md") + if not os.path.exists(changelog_path): + raise Exception("Please provide a changelog file for this package.") + + with open(changelog_path) as f: + text = f.read().splitlines() + + text = filter(None, text) + + if text[0] != "# Changelog": + raise Exception("Bad Format in changelog file. Check whether the document starts with '# Changelog'.") + + if args.commit_tag not in text[1]: + raise Exception("Update the changelog listing the latest changes for the version {0} of the package.".format(args.commit_tag)) - return True + if text[1].strip() != "## [{0}] - {1}".format(args.commit_tag, datetime.datetime.today().strftime('%Y-%m-%d')): + raise Exception("The changelog may contain a temporary list of changes. Please specify the version as [{0}] - {1}".format(args.commit_tag, datetime.datetime.today().strftime('%Y-%m-%d'))) + + if not text[2].startswith('- '): + raise Exception("Add at least one item to the list of changes for the version {0}. Please note that the list is " + "required to be a bulletpoint list (each item needs to start with '- '.".format(args.commit_tag)) + + +def check_version(package_path): + tag_version = args.commit_tag + json_path = os.path.join(package_path, 'package.json') + if not os.path.exists(json_path): + raise Exception("This is not a valid npm package. File package.json is missing") + with open(json_path, 'r') as f: + package_version = json.load(f)['version'] + if not tag_version == package_version: + raise Exception("The tag {0} specified does not match with the package tag {1}. " + "Did you update the version in {2}?".format(tag_version, package_version, package_path)) def main(): @@ -39,18 +83,27 @@ def main(): if not check_metafiles_in_package(package): raise Exception + check_version(package) + + check_changelog(package) + + def parse_argument_list(): - parser = argparse.ArgumentParser(description="A tool which performs sanity checks against the packages and demo " - "that are going to be tested published in the next CI steps.") + parser = argparse.ArgumentParser(description="A tool which performs sanity checks against the package that is going " + "to be published in the current CI step.") parser.add_argument('--package-path', action='append', required=True, help="Path to where the package exists. It should be a folder " - "where there exists a package.json") + "where a package.json file exists") + + parser.add_argument('--commit-tag', required=True, help="Version of the package to publish. ") return parser.parse_args() if __name__ == "__main__": args = parse_argument_list() + # Remove `exp.` prefix from commit_tag + args.commit_tag = re.sub(r'^exp\.(.*)', r'\1', args.commit_tag) main() diff --git a/src/Unity.Mathematics.Tests.meta b/Unity.Mathematics.TestProject/Assets/Editor.meta similarity index 77% rename from src/Unity.Mathematics.Tests.meta rename to Unity.Mathematics.TestProject/Assets/Editor.meta index b0295219..82f780e0 100644 --- a/src/Unity.Mathematics.Tests.meta +++ b/Unity.Mathematics.TestProject/Assets/Editor.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 36a5670344b674b5e95df7d94b8bed4c +guid: 588187392e96849709260514bfd9e6b0 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Unity.Mathematics.TestProject/Assets/Editor/file b/Unity.Mathematics.TestProject/Assets/Editor/file new file mode 100644 index 00000000..e69de29b diff --git a/Unity.Mathematics.TestProject/Assets/Editor/file.meta b/Unity.Mathematics.TestProject/Assets/Editor/file.meta new file mode 100644 index 00000000..c7119c67 --- /dev/null +++ b/Unity.Mathematics.TestProject/Assets/Editor/file.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 2b2df153a95b04a6c8428e078e11bf56 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Documentation.meta b/Unity.Mathematics.TestProject/Assets/Scenes.meta similarity index 77% rename from src/Documentation.meta rename to Unity.Mathematics.TestProject/Assets/Scenes.meta index aeebb148..fa5ebb44 100644 --- a/src/Documentation.meta +++ b/Unity.Mathematics.TestProject/Assets/Scenes.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: c4a084f777a7f4b4c9da558fc79d91f8 +guid: a30e3c04236694376aff84de78862f24 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Unity.Mathematics.TestProject/Assets/Scenes/SampleScene.unity b/Unity.Mathematics.TestProject/Assets/Scenes/SampleScene.unity new file mode 100644 index 00000000..b819a102 --- /dev/null +++ b/Unity.Mathematics.TestProject/Assets/Scenes/SampleScene.unity @@ -0,0 +1,350 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 705507994} + m_IndirectSpecularColor: {r: 0.44402242, g: 0.49316543, b: 0.5722324, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 0 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 1 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 500 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 2 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 0 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 4890085278179872738, guid: 20c8488ac153b4f45944c2d7c85a094e, + type: 2} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &206998647 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 206998649} + m_Layer: 0 + m_Name: GameObject + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &206998649 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 206998647} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &705507993 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 705507995} + - component: {fileID: 705507994} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &705507994 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 705507993} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 1 + m_Shape: 0 + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 1 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &705507995 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 705507993} + serializedVersion: 2 + m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} + m_LocalPosition: {x: 0, y: 3, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!1 &963194225 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 963194228} + - component: {fileID: 963194227} + - component: {fileID: 963194226} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &963194226 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 963194225} + m_Enabled: 1 +--- !u!20 &963194227 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 963194225} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_FocalLength: 50 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &963194228 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 963194225} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 963194228} + - {fileID: 705507995} + - {fileID: 206998649} diff --git a/Unity.Mathematics.TestProject/Assets/Scenes/SampleScene.unity.meta b/Unity.Mathematics.TestProject/Assets/Scenes/SampleScene.unity.meta new file mode 100644 index 00000000..952bd1e9 --- /dev/null +++ b/Unity.Mathematics.TestProject/Assets/Scenes/SampleScene.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9fc0d4010bbf28b4594072e72b8655ab +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity.Mathematics.TestProject/Assets/Scenes/SampleSceneSettings.lighting b/Unity.Mathematics.TestProject/Assets/Scenes/SampleSceneSettings.lighting new file mode 100644 index 00000000..e595ed65 --- /dev/null +++ b/Unity.Mathematics.TestProject/Assets/Scenes/SampleSceneSettings.lighting @@ -0,0 +1,66 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!850595691 &4890085278179872738 +LightingSettings: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: SampleSceneSettings + serializedVersion: 6 + m_GIWorkflowMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 1 + m_RealtimeEnvironmentLighting: 1 + m_BounceScale: 1 + m_AlbedoBoost: 1 + m_IndirectOutputScale: 1 + m_UsingShadowmask: 1 + m_BakeBackend: 1 + m_LightmapMaxSize: 1024 + m_BakeResolution: 40 + m_Padding: 2 + m_LightmapCompression: 3 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAO: 0 + m_MixedBakeMode: 2 + m_LightmapsBakeMode: 1 + m_FilterMode: 1 + m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0} + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_RealtimeResolution: 2 + m_ForceWhiteAlbedo: 0 + m_ForceUpdates: 0 + m_FinalGather: 0 + m_FinalGatherRayCount: 256 + m_FinalGatherFiltering: 1 + m_PVRCulling: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVREnvironmentSampleCount: 512 + m_PVREnvironmentReferencePointCount: 2048 + m_LightProbeSampleCountMultiplier: 4 + m_PVRBounces: 2 + m_PVRMinBounces: 2 + m_PVREnvironmentImportanceSampling: 0 + m_PVRFilteringMode: 2 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_PVRTiledBaking: 0 + m_NumRaysToShootPerTexel: -1 + m_RespectSceneVisibilityWhenBakingGI: 0 diff --git a/Unity.Mathematics.TestProject/Assets/Scenes/SampleSceneSettings.lighting.meta b/Unity.Mathematics.TestProject/Assets/Scenes/SampleSceneSettings.lighting.meta new file mode 100644 index 00000000..daa2a351 --- /dev/null +++ b/Unity.Mathematics.TestProject/Assets/Scenes/SampleSceneSettings.lighting.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 20c8488ac153b4f45944c2d7c85a094e +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 4890085278179872738 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity.Mathematics.TestProject/Packages/manifest.json b/Unity.Mathematics.TestProject/Packages/manifest.json new file mode 100644 index 00000000..932cc93d --- /dev/null +++ b/Unity.Mathematics.TestProject/Packages/manifest.json @@ -0,0 +1,17 @@ +{ + "dependencies": { + "com.unity.ai.navigation": "2.0.0", + "com.unity.burst": "1.8.11", + "com.unity.ide.rider": "3.0.27", + "com.unity.ide.visualstudio": "2.0.22", + "com.unity.mathematics": "file:../../src", + "com.unity.package-validation-suite": "0.62.0-preview", + "com.unity.properties": "2.1.0-exp.3", + "com.unity.test-framework": "1.3.9", + "com.unity.test-framework.performance": "3.0.3", + "com.unity.modules.accessibility": "1.0.0" + }, + "testables": [ + "com.unity.mathematics" + ] +} diff --git a/Unity.Mathematics.TestProject/ProjectSettings/AudioManager.asset b/Unity.Mathematics.TestProject/ProjectSettings/AudioManager.asset new file mode 100644 index 00000000..27287fec --- /dev/null +++ b/Unity.Mathematics.TestProject/ProjectSettings/AudioManager.asset @@ -0,0 +1,19 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!11 &1 +AudioManager: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Volume: 1 + Rolloff Scale: 1 + Doppler Factor: 1 + Default Speaker Mode: 2 + m_SampleRate: 0 + m_DSPBufferSize: 1024 + m_VirtualVoiceCount: 512 + m_RealVoiceCount: 32 + m_SpatializerPlugin: + m_AmbisonicDecoderPlugin: + m_DisableAudio: 0 + m_VirtualizeEffects: 1 + m_RequestedDSPBufferSize: 0 diff --git a/Unity.Mathematics.TestProject/ProjectSettings/ClusterInputManager.asset b/Unity.Mathematics.TestProject/ProjectSettings/ClusterInputManager.asset new file mode 100644 index 00000000..e7886b26 --- /dev/null +++ b/Unity.Mathematics.TestProject/ProjectSettings/ClusterInputManager.asset @@ -0,0 +1,6 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!236 &1 +ClusterInputManager: + m_ObjectHideFlags: 0 + m_Inputs: [] diff --git a/Unity.Mathematics.TestProject/ProjectSettings/DynamicsManager.asset b/Unity.Mathematics.TestProject/ProjectSettings/DynamicsManager.asset new file mode 100644 index 00000000..1596c423 --- /dev/null +++ b/Unity.Mathematics.TestProject/ProjectSettings/DynamicsManager.asset @@ -0,0 +1,36 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!55 &1 +PhysicsManager: + m_ObjectHideFlags: 0 + serializedVersion: 13 + m_Gravity: {x: 0, y: -9.81, z: 0} + m_DefaultMaterial: {fileID: 0} + m_BounceThreshold: 2 + m_SleepThreshold: 0.005 + m_DefaultContactOffset: 0.01 + m_DefaultSolverIterations: 6 + m_DefaultSolverVelocityIterations: 1 + m_QueriesHitBackfaces: 0 + m_QueriesHitTriggers: 1 + m_EnableAdaptiveForce: 0 + m_ClothInterCollisionDistance: 0.1 + m_ClothInterCollisionStiffness: 0.2 + m_ContactsGeneration: 1 + m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + m_AutoSimulation: 1 + m_AutoSyncTransforms: 0 + m_ReuseCollisionCallbacks: 0 + m_ClothInterCollisionSettingsToggle: 0 + m_ClothGravity: {x: 0, y: -9.81, z: 0} + m_ContactPairsMode: 0 + m_BroadphaseType: 0 + m_WorldBounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 250, y: 250, z: 250} + m_WorldSubdivisions: 8 + m_FrictionType: 0 + m_EnableEnhancedDeterminism: 0 + m_EnableUnifiedHeightmaps: 1 + m_SolverType: 0 + m_DefaultMaxAngularSpeed: 50 diff --git a/Unity.Mathematics.TestProject/ProjectSettings/EditorBuildSettings.asset b/Unity.Mathematics.TestProject/ProjectSettings/EditorBuildSettings.asset new file mode 100644 index 00000000..40917b05 --- /dev/null +++ b/Unity.Mathematics.TestProject/ProjectSettings/EditorBuildSettings.asset @@ -0,0 +1,11 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1045 &1 +EditorBuildSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Scenes: + - enabled: 1 + path: Assets/Scenes/SampleScene.unity + guid: 9fc0d4010bbf28b4594072e72b8655ab + m_configObjects: {} diff --git a/Unity.Mathematics.TestProject/ProjectSettings/EditorSettings.asset b/Unity.Mathematics.TestProject/ProjectSettings/EditorSettings.asset new file mode 100644 index 00000000..4af553a7 --- /dev/null +++ b/Unity.Mathematics.TestProject/ProjectSettings/EditorSettings.asset @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!159 &1 +EditorSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_ExternalVersionControlSupport: Hidden Meta Files + m_SerializationMode: 2 + m_LineEndingsForNewScripts: 2 + m_DefaultBehaviorMode: 0 + m_PrefabRegularEnvironment: {fileID: 0} + m_PrefabUIEnvironment: {fileID: 0} + m_SpritePackerMode: 0 + m_SpritePackerPaddingPower: 1 + m_EtcTextureCompressorBehavior: 1 + m_EtcTextureFastCompressor: 1 + m_EtcTextureNormalCompressor: 2 + m_EtcTextureBestCompressor: 4 + m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref + m_ProjectGenerationRootNamespace: + m_CollabEditorSettings: + inProgressEnabled: 1 + m_EnableTextureStreamingInEditMode: 1 + m_EnableTextureStreamingInPlayMode: 1 + m_AsyncShaderCompilation: 1 + m_EnterPlayModeOptionsEnabled: 0 + m_EnterPlayModeOptions: 3 + m_ShowLightmapResolutionOverlay: 1 + m_UseLegacyProbeSampleCount: 1 + m_AssetPipelineMode: 1 + m_CacheServerMode: 0 + m_CacheServerEndpoint: + m_CacheServerNamespacePrefix: default + m_CacheServerEnableDownload: 1 + m_CacheServerEnableUpload: 1 diff --git a/Unity.Mathematics.TestProject/ProjectSettings/GraphicsSettings.asset b/Unity.Mathematics.TestProject/ProjectSettings/GraphicsSettings.asset new file mode 100644 index 00000000..bea55798 --- /dev/null +++ b/Unity.Mathematics.TestProject/ProjectSettings/GraphicsSettings.asset @@ -0,0 +1,68 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!30 &1 +GraphicsSettings: + m_ObjectHideFlags: 0 + serializedVersion: 13 + m_Deferred: + m_Mode: 1 + m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} + m_DeferredReflections: + m_Mode: 1 + m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} + m_ScreenSpaceShadows: + m_Mode: 1 + m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} + m_LegacyDeferred: + m_Mode: 1 + m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} + m_DepthNormals: + m_Mode: 1 + m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} + m_MotionVectors: + m_Mode: 1 + m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} + m_LightHalo: + m_Mode: 1 + m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} + m_LensFlare: + m_Mode: 1 + m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} + m_AlwaysIncludedShaders: + - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 10783, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 16001, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 16003, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0} + m_PreloadedShaders: [] + m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, + type: 0} + m_CustomRenderPipeline: {fileID: 0} + m_TransparencySortMode: 0 + m_TransparencySortAxis: {x: 0, y: 0, z: 1} + m_DefaultRenderingPath: 1 + m_DefaultMobileRenderingPath: 1 + m_TierSettings: [] + m_LightmapStripping: 0 + m_FogStripping: 0 + m_InstancingStripping: 0 + m_LightmapKeepPlain: 1 + m_LightmapKeepDirCombined: 1 + m_LightmapKeepDynamicPlain: 1 + m_LightmapKeepDynamicDirCombined: 1 + m_LightmapKeepShadowMask: 1 + m_LightmapKeepSubtractive: 1 + m_FogKeepLinear: 1 + m_FogKeepExp: 1 + m_FogKeepExp2: 1 + m_AlbedoSwatchInfos: [] + m_LightsUseLinearIntensity: 0 + m_LightsUseColorTemperature: 0 + m_LogWhenShaderIsCompiled: 0 + m_AllowEnlightenSupportForUpgradedProject: 0 diff --git a/Unity.Mathematics.TestProject/ProjectSettings/InputManager.asset b/Unity.Mathematics.TestProject/ProjectSettings/InputManager.asset new file mode 100644 index 00000000..17c8f538 --- /dev/null +++ b/Unity.Mathematics.TestProject/ProjectSettings/InputManager.asset @@ -0,0 +1,295 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!13 &1 +InputManager: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Axes: + - serializedVersion: 3 + m_Name: Horizontal + descriptiveName: + descriptiveNegativeName: + negativeButton: left + positiveButton: right + altNegativeButton: a + altPositiveButton: d + gravity: 3 + dead: 0.001 + sensitivity: 3 + snap: 1 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Vertical + descriptiveName: + descriptiveNegativeName: + negativeButton: down + positiveButton: up + altNegativeButton: s + altPositiveButton: w + gravity: 3 + dead: 0.001 + sensitivity: 3 + snap: 1 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire1 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: left ctrl + altNegativeButton: + altPositiveButton: mouse 0 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire2 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: left alt + altNegativeButton: + altPositiveButton: mouse 1 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire3 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: left shift + altNegativeButton: + altPositiveButton: mouse 2 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Jump + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: space + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Mouse X + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0 + sensitivity: 0.1 + snap: 0 + invert: 0 + type: 1 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Mouse Y + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0 + sensitivity: 0.1 + snap: 0 + invert: 0 + type: 1 + axis: 1 + joyNum: 0 + - serializedVersion: 3 + m_Name: Mouse ScrollWheel + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0 + sensitivity: 0.1 + snap: 0 + invert: 0 + type: 1 + axis: 2 + joyNum: 0 + - serializedVersion: 3 + m_Name: Horizontal + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0.19 + sensitivity: 1 + snap: 0 + invert: 0 + type: 2 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Vertical + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0.19 + sensitivity: 1 + snap: 0 + invert: 1 + type: 2 + axis: 1 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire1 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 0 + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire2 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 1 + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire3 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 2 + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Jump + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 3 + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Submit + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: return + altNegativeButton: + altPositiveButton: joystick button 0 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Submit + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: enter + altNegativeButton: + altPositiveButton: space + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Cancel + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: escape + altNegativeButton: + altPositiveButton: joystick button 1 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 diff --git a/Unity.Mathematics.TestProject/ProjectSettings/NavMeshAreas.asset b/Unity.Mathematics.TestProject/ProjectSettings/NavMeshAreas.asset new file mode 100644 index 00000000..3b0b7c3d --- /dev/null +++ b/Unity.Mathematics.TestProject/ProjectSettings/NavMeshAreas.asset @@ -0,0 +1,91 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!126 &1 +NavMeshProjectSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + areas: + - name: Walkable + cost: 1 + - name: Not Walkable + cost: 1 + - name: Jump + cost: 2 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + m_LastAgentTypeID: -887442657 + m_Settings: + - serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.75 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 + m_SettingNames: + - Humanoid diff --git a/Unity.Mathematics.TestProject/ProjectSettings/Physics2DSettings.asset b/Unity.Mathematics.TestProject/ProjectSettings/Physics2DSettings.asset new file mode 100644 index 00000000..6c5cf8a0 --- /dev/null +++ b/Unity.Mathematics.TestProject/ProjectSettings/Physics2DSettings.asset @@ -0,0 +1,56 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!19 &1 +Physics2DSettings: + m_ObjectHideFlags: 0 + serializedVersion: 4 + m_Gravity: {x: 0, y: -9.81} + m_DefaultMaterial: {fileID: 0} + m_VelocityIterations: 8 + m_PositionIterations: 3 + m_VelocityThreshold: 1 + m_MaxLinearCorrection: 0.2 + m_MaxAngularCorrection: 8 + m_MaxTranslationSpeed: 100 + m_MaxRotationSpeed: 360 + m_BaumgarteScale: 0.2 + m_BaumgarteTimeOfImpactScale: 0.75 + m_TimeToSleep: 0.5 + m_LinearSleepTolerance: 0.01 + m_AngularSleepTolerance: 2 + m_DefaultContactOffset: 0.01 + m_JobOptions: + serializedVersion: 2 + useMultithreading: 0 + useConsistencySorting: 0 + m_InterpolationPosesPerJob: 100 + m_NewContactsPerJob: 30 + m_CollideContactsPerJob: 100 + m_ClearFlagsPerJob: 200 + m_ClearBodyForcesPerJob: 200 + m_SyncDiscreteFixturesPerJob: 50 + m_SyncContinuousFixturesPerJob: 50 + m_FindNearestContactsPerJob: 100 + m_UpdateTriggerContactsPerJob: 100 + m_IslandSolverCostThreshold: 100 + m_IslandSolverBodyCostScale: 1 + m_IslandSolverContactCostScale: 10 + m_IslandSolverJointCostScale: 10 + m_IslandSolverBodiesPerJob: 50 + m_IslandSolverContactsPerJob: 50 + m_AutoSimulation: 1 + m_QueriesHitTriggers: 1 + m_QueriesStartInColliders: 1 + m_CallbacksOnDisable: 1 + m_ReuseCollisionCallbacks: 0 + m_AutoSyncTransforms: 0 + m_AlwaysShowColliders: 0 + m_ShowColliderSleep: 1 + m_ShowColliderContacts: 0 + m_ShowColliderAABB: 0 + m_ContactArrowScale: 0.2 + m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} + m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} + m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} + m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} + m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff diff --git a/Unity.Mathematics.TestProject/ProjectSettings/PresetManager.asset b/Unity.Mathematics.TestProject/ProjectSettings/PresetManager.asset new file mode 100644 index 00000000..67a94dae --- /dev/null +++ b/Unity.Mathematics.TestProject/ProjectSettings/PresetManager.asset @@ -0,0 +1,7 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1386491679 &1 +PresetManager: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_DefaultPresets: {} diff --git a/Unity.Mathematics.TestProject/ProjectSettings/ProjectSettings.asset b/Unity.Mathematics.TestProject/ProjectSettings/ProjectSettings.asset new file mode 100644 index 00000000..9eb3e0b5 --- /dev/null +++ b/Unity.Mathematics.TestProject/ProjectSettings/ProjectSettings.asset @@ -0,0 +1,836 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!129 &1 +PlayerSettings: + m_ObjectHideFlags: 0 + serializedVersion: 26 + productGUID: 50c0163089a174a7ab9f46f0020a809f + AndroidProfiler: 0 + AndroidFilterTouchesWhenObscured: 0 + AndroidEnableSustainedPerformanceMode: 0 + defaultScreenOrientation: 4 + targetDevice: 2 + useOnDemandResources: 0 + accelerometerFrequency: 60 + companyName: DefaultCompany + productName: Unity.Mathematics.TestProject + defaultCursor: {fileID: 0} + cursorHotspot: {x: 0, y: 0} + m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} + m_ShowUnitySplashScreen: 1 + m_ShowUnitySplashLogo: 1 + m_SplashScreenOverlayOpacity: 1 + m_SplashScreenAnimation: 1 + m_SplashScreenLogoStyle: 1 + m_SplashScreenDrawMode: 0 + m_SplashScreenBackgroundAnimationZoom: 1 + m_SplashScreenLogoAnimationZoom: 1 + m_SplashScreenBackgroundLandscapeAspect: 1 + m_SplashScreenBackgroundPortraitAspect: 1 + m_SplashScreenBackgroundLandscapeUvs: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + m_SplashScreenBackgroundPortraitUvs: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + m_SplashScreenLogos: [] + m_VirtualRealitySplashScreen: {fileID: 0} + m_HolographicTrackingLossScreen: {fileID: 0} + defaultScreenWidth: 1024 + defaultScreenHeight: 768 + defaultScreenWidthWeb: 960 + defaultScreenHeightWeb: 600 + m_StereoRenderingPath: 0 + m_ActiveColorSpace: 0 + m_SpriteBatchVertexThreshold: 300 + m_MTRendering: 1 + mipStripping: 0 + numberOfMipsStripped: 0 + numberOfMipsStrippedPerMipmapLimitGroup: {} + m_StackTraceTypes: 010000000100000001000000010000000100000001000000 + iosShowActivityIndicatorOnLoading: -1 + androidShowActivityIndicatorOnLoading: -1 + iosUseCustomAppBackgroundBehavior: 0 + allowedAutorotateToPortrait: 1 + allowedAutorotateToPortraitUpsideDown: 1 + allowedAutorotateToLandscapeRight: 1 + allowedAutorotateToLandscapeLeft: 1 + useOSAutorotation: 1 + use32BitDisplayBuffer: 1 + preserveFramebufferAlpha: 0 + disableDepthAndStencilBuffers: 0 + androidStartInFullscreen: 1 + androidRenderOutsideSafeArea: 1 + androidUseSwappy: 0 + androidBlitType: 0 + androidResizableWindow: 0 + androidDefaultWindowWidth: 1920 + androidDefaultWindowHeight: 1080 + androidMinimumWindowWidth: 400 + androidMinimumWindowHeight: 300 + androidFullscreenMode: 1 + defaultIsNativeResolution: 1 + macRetinaSupport: 1 + runInBackground: 1 + captureSingleScreen: 0 + muteOtherAudioSources: 0 + Prepare IOS For Recording: 0 + Force IOS Speakers When Recording: 0 + deferSystemGesturesMode: 0 + hideHomeButton: 0 + submitAnalytics: 1 + usePlayerLog: 1 + bakeCollisionMeshes: 0 + forceSingleInstance: 0 + useFlipModelSwapchain: 1 + resizableWindow: 0 + useMacAppStoreValidation: 0 + macAppStoreCategory: public.app-category.games + gpuSkinning: 1 + xboxPIXTextureCapture: 0 + xboxEnableAvatar: 0 + xboxEnableKinect: 0 + xboxEnableKinectAutoTracking: 0 + xboxEnableFitness: 0 + visibleInBackground: 1 + allowFullscreenSwitch: 1 + fullscreenMode: 1 + xboxSpeechDB: 0 + xboxEnableHeadOrientation: 0 + xboxEnableGuest: 0 + xboxEnablePIXSampling: 0 + metalFramebufferOnly: 0 + xboxOneResolution: 0 + xboxOneSResolution: 0 + xboxOneXResolution: 3 + xboxOneMonoLoggingLevel: 0 + xboxOneLoggingLevel: 1 + xboxOneDisableEsram: 0 + xboxOneEnableTypeOptimization: 0 + xboxOnePresentImmediateThreshold: 0 + switchQueueCommandMemory: 0 + switchQueueControlMemory: 16384 + switchQueueComputeMemory: 262144 + switchNVNShaderPoolsGranularity: 33554432 + switchNVNDefaultPoolsGranularity: 16777216 + switchNVNOtherPoolsGranularity: 16777216 + switchGpuScratchPoolGranularity: 2097152 + switchAllowGpuScratchShrinking: 0 + switchNVNMaxPublicTextureIDCount: 0 + switchNVNMaxPublicSamplerIDCount: 0 + switchNVNGraphicsFirmwareMemory: 32 + stadiaPresentMode: 0 + stadiaTargetFramerate: 0 + vulkanNumSwapchainBuffers: 3 + vulkanEnableSetSRGBWrite: 0 + vulkanEnablePreTransform: 0 + vulkanEnableLateAcquireNextImage: 0 + vulkanEnableCommandBufferRecycling: 1 + loadStoreDebugModeEnabled: 0 + bundleVersion: 0.1 + preloadedAssets: [] + metroInputSource: 0 + wsaTransparentSwapchain: 0 + m_HolographicPauseOnTrackingLoss: 1 + xboxOneDisableKinectGpuReservation: 0 + xboxOneEnable7thCore: 0 + vrSettings: + enable360StereoCapture: 0 + isWsaHolographicRemotingEnabled: 0 + enableFrameTimingStats: 0 + enableOpenGLProfilerGPURecorders: 1 + useHDRDisplay: 0 + hdrBitDepth: 0 + m_ColorGamuts: 00000000 + targetPixelDensity: 30 + resolutionScalingMode: 0 + resetResolutionOnWindowResize: 0 + androidSupportedAspectRatio: 1 + androidMaxAspectRatio: 2.1 + applicationIdentifier: + Android: com.UnityTestRunner.UnityTestRunner + buildNumber: + Standalone: 0 + VisionOS: 0 + iPhone: 0 + tvOS: 0 + overrideDefaultApplicationIdentifier: 1 + AndroidBundleVersionCode: 1 + AndroidMinSdkVersion: 22 + AndroidTargetSdkVersion: 0 + AndroidPreferredInstallLocation: 1 + aotOptions: + stripEngineCode: 1 + iPhoneStrippingLevel: 0 + iPhoneScriptCallOptimization: 0 + ForceInternetPermission: 0 + ForceSDCardPermission: 0 + CreateWallpaper: 0 + APKExpansionFiles: 0 + keepLoadedShadersAlive: 0 + StripUnusedMeshComponents: 1 + strictShaderVariantMatching: 0 + VertexChannelCompressionMask: 4054 + iPhoneSdkVersion: 988 + iOSTargetOSVersionString: 12.0 + tvOSSdkVersion: 0 + tvOSRequireExtendedGameController: 0 + tvOSTargetOSVersionString: 12.0 + VisionOSSdkVersion: 0 + VisionOSTargetOSVersionString: 1.0 + uIPrerenderedIcon: 0 + uIRequiresPersistentWiFi: 0 + uIRequiresFullScreen: 1 + uIStatusBarHidden: 1 + uIExitOnSuspend: 0 + uIStatusBarStyle: 0 + appleTVSplashScreen: {fileID: 0} + appleTVSplashScreen2x: {fileID: 0} + tvOSSmallIconLayers: [] + tvOSSmallIconLayers2x: [] + tvOSLargeIconLayers: [] + tvOSLargeIconLayers2x: [] + tvOSTopShelfImageLayers: [] + tvOSTopShelfImageLayers2x: [] + tvOSTopShelfImageWideLayers: [] + tvOSTopShelfImageWideLayers2x: [] + iOSLaunchScreenType: 0 + iOSLaunchScreenPortrait: {fileID: 0} + iOSLaunchScreenLandscape: {fileID: 0} + iOSLaunchScreenBackgroundColor: + serializedVersion: 2 + rgba: 0 + iOSLaunchScreenFillPct: 100 + iOSLaunchScreenSize: 100 + iOSLaunchScreenCustomXibPath: + iOSLaunchScreeniPadType: 0 + iOSLaunchScreeniPadImage: {fileID: 0} + iOSLaunchScreeniPadBackgroundColor: + serializedVersion: 2 + rgba: 0 + iOSLaunchScreeniPadFillPct: 100 + iOSLaunchScreeniPadSize: 100 + iOSLaunchScreeniPadCustomXibPath: + iOSLaunchScreenCustomStoryboardPath: + iOSLaunchScreeniPadCustomStoryboardPath: + iOSDeviceRequirements: [] + iOSURLSchemes: [] + macOSURLSchemes: [] + iOSBackgroundModes: 0 + iOSMetalForceHardShadows: 0 + metalEditorSupport: 1 + metalAPIValidation: 1 + iOSRenderExtraFrameOnPause: 0 + iosCopyPluginsCodeInsteadOfSymlink: 0 + appleDeveloperTeamID: + iOSManualSigningProvisioningProfileID: + tvOSManualSigningProvisioningProfileID: + VisionOSManualSigningProvisioningProfileID: + iOSManualSigningProvisioningProfileType: 0 + tvOSManualSigningProvisioningProfileType: 0 + VisionOSManualSigningProvisioningProfileType: 0 + appleEnableAutomaticSigning: 0 + iOSRequireARKit: 0 + iOSAutomaticallyDetectAndAddCapabilities: 1 + appleEnableProMotion: 0 + shaderPrecisionModel: 0 + clonedFromGUID: c0afd0d1d80e3634a9dac47e8a0426ea + templatePackageId: com.unity.template.3d@1.0.11 + templateDefaultScene: Assets/Scenes/SampleScene.unity + useCustomMainManifest: 0 + useCustomLauncherManifest: 0 + useCustomMainGradleTemplate: 0 + useCustomLauncherGradleManifest: 0 + useCustomBaseGradleTemplate: 0 + useCustomGradlePropertiesTemplate: 0 + useCustomGradleSettingsTemplate: 0 + useCustomProguardFile: 0 + AndroidTargetArchitectures: 1 + AndroidTargetDevices: 0 + AndroidSplashScreenScale: 0 + androidSplashScreen: {fileID: 0} + AndroidKeystoreName: '{inproject}: ' + AndroidKeyaliasName: + AndroidEnableArmv9SecurityFeatures: 0 + AndroidBuildApkPerCpuArchitecture: 0 + AndroidTVCompatibility: 0 + AndroidIsGame: 1 + AndroidEnableTango: 0 + androidEnableBanner: 1 + androidUseLowAccuracyLocation: 0 + androidUseCustomKeystore: 0 + m_AndroidBanners: + - width: 320 + height: 180 + banner: {fileID: 0} + androidGamepadSupportLevel: 0 + chromeosInputEmulation: 1 + AndroidMinifyRelease: 0 + AndroidMinifyDebug: 0 + AndroidValidateAppBundleSize: 1 + AndroidAppBundleSizeToValidate: 100 + m_BuildTargetIcons: [] + m_BuildTargetPlatformIcons: + - m_BuildTarget: Android + m_Icons: + - m_Textures: [] + m_Width: 432 + m_Height: 432 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 324 + m_Height: 324 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 216 + m_Height: 216 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 162 + m_Height: 162 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 108 + m_Height: 108 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 81 + m_Height: 81 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 192 + m_Height: 192 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 144 + m_Height: 144 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 96 + m_Height: 96 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 72 + m_Height: 72 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 48 + m_Height: 48 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 36 + m_Height: 36 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 192 + m_Height: 192 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 144 + m_Height: 144 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 96 + m_Height: 96 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 72 + m_Height: 72 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 48 + m_Height: 48 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 36 + m_Height: 36 + m_Kind: 1 + m_SubKind: + m_BuildTargetBatching: + - m_BuildTarget: Standalone + m_StaticBatching: 1 + m_DynamicBatching: 0 + - m_BuildTarget: tvOS + m_StaticBatching: 1 + m_DynamicBatching: 0 + - m_BuildTarget: Android + m_StaticBatching: 1 + m_DynamicBatching: 0 + - m_BuildTarget: iPhone + m_StaticBatching: 1 + m_DynamicBatching: 0 + - m_BuildTarget: WebGL + m_StaticBatching: 0 + m_DynamicBatching: 0 + m_BuildTargetShaderSettings: [] + m_BuildTargetGraphicsJobs: + - m_BuildTarget: MacStandaloneSupport + m_GraphicsJobs: 0 + - m_BuildTarget: Switch + m_GraphicsJobs: 0 + - m_BuildTarget: MetroSupport + m_GraphicsJobs: 0 + - m_BuildTarget: AppleTVSupport + m_GraphicsJobs: 0 + - m_BuildTarget: BJMSupport + m_GraphicsJobs: 0 + - m_BuildTarget: LinuxStandaloneSupport + m_GraphicsJobs: 0 + - m_BuildTarget: PS4Player + m_GraphicsJobs: 0 + - m_BuildTarget: iOSSupport + m_GraphicsJobs: 0 + - m_BuildTarget: WindowsStandaloneSupport + m_GraphicsJobs: 0 + - m_BuildTarget: XboxOnePlayer + m_GraphicsJobs: 0 + - m_BuildTarget: LuminSupport + m_GraphicsJobs: 0 + - m_BuildTarget: AndroidPlayer + m_GraphicsJobs: 0 + - m_BuildTarget: WebGLSupport + m_GraphicsJobs: 0 + m_BuildTargetGraphicsJobMode: + - m_BuildTarget: PS4Player + m_GraphicsJobMode: 0 + - m_BuildTarget: XboxOnePlayer + m_GraphicsJobMode: 0 + m_BuildTargetGraphicsAPIs: + - m_BuildTarget: AndroidPlayer + m_APIs: 150000000b000000 + m_Automatic: 1 + - m_BuildTarget: iOSSupport + m_APIs: 10000000 + m_Automatic: 1 + - m_BuildTarget: AppleTVSupport + m_APIs: 10000000 + m_Automatic: 1 + - m_BuildTarget: WebGLSupport + m_APIs: 0b000000 + m_Automatic: 1 + m_BuildTargetVRSettings: + - m_BuildTarget: Standalone + m_Enabled: 0 + m_Devices: + - Oculus + - OpenVR + m_DefaultShaderChunkSizeInMB: 16 + m_DefaultShaderChunkCount: 0 + openGLRequireES31: 0 + openGLRequireES31AEP: 0 + openGLRequireES32: 0 + m_TemplateCustomTags: {} + mobileMTRendering: + Android: 1 + iPhone: 1 + tvOS: 1 + m_BuildTargetGroupLightmapEncodingQuality: [] + m_BuildTargetGroupHDRCubemapEncodingQuality: [] + m_BuildTargetGroupLightmapSettings: [] + m_BuildTargetGroupLoadStoreDebugModeSettings: [] + m_BuildTargetNormalMapEncoding: [] + m_BuildTargetDefaultTextureCompressionFormat: [] + playModeTestRunnerEnabled: 0 + runPlayModeTestAsEditModeTest: 0 + actionOnDotNetUnhandledException: 1 + enableInternalProfiler: 0 + logObjCUncaughtExceptions: 1 + enableCrashReportAPI: 0 + cameraUsageDescription: + locationUsageDescription: + microphoneUsageDescription: + bluetoothUsageDescription: + macOSTargetOSVersion: 10.13.0 + switchNMETAOverride: + switchNetLibKey: + switchSocketMemoryPoolSize: 6144 + switchSocketAllocatorPoolSize: 128 + switchSocketConcurrencyLimit: 14 + switchScreenResolutionBehavior: 2 + switchUseCPUProfiler: 0 + switchUseGOLDLinker: 0 + switchLTOSetting: 0 + switchApplicationID: 0x01004b9000490000 + switchNSODependencies: + switchCompilerFlags: + switchTitleNames_0: + switchTitleNames_1: + switchTitleNames_2: + switchTitleNames_3: + switchTitleNames_4: + switchTitleNames_5: + switchTitleNames_6: + switchTitleNames_7: + switchTitleNames_8: + switchTitleNames_9: + switchTitleNames_10: + switchTitleNames_11: + switchTitleNames_12: + switchTitleNames_13: + switchTitleNames_14: + switchTitleNames_15: + switchPublisherNames_0: + switchPublisherNames_1: + switchPublisherNames_2: + switchPublisherNames_3: + switchPublisherNames_4: + switchPublisherNames_5: + switchPublisherNames_6: + switchPublisherNames_7: + switchPublisherNames_8: + switchPublisherNames_9: + switchPublisherNames_10: + switchPublisherNames_11: + switchPublisherNames_12: + switchPublisherNames_13: + switchPublisherNames_14: + switchPublisherNames_15: + switchIcons_0: {fileID: 0} + switchIcons_1: {fileID: 0} + switchIcons_2: {fileID: 0} + switchIcons_3: {fileID: 0} + switchIcons_4: {fileID: 0} + switchIcons_5: {fileID: 0} + switchIcons_6: {fileID: 0} + switchIcons_7: {fileID: 0} + switchIcons_8: {fileID: 0} + switchIcons_9: {fileID: 0} + switchIcons_10: {fileID: 0} + switchIcons_11: {fileID: 0} + switchIcons_12: {fileID: 0} + switchIcons_13: {fileID: 0} + switchIcons_14: {fileID: 0} + switchIcons_15: {fileID: 0} + switchSmallIcons_0: {fileID: 0} + switchSmallIcons_1: {fileID: 0} + switchSmallIcons_2: {fileID: 0} + switchSmallIcons_3: {fileID: 0} + switchSmallIcons_4: {fileID: 0} + switchSmallIcons_5: {fileID: 0} + switchSmallIcons_6: {fileID: 0} + switchSmallIcons_7: {fileID: 0} + switchSmallIcons_8: {fileID: 0} + switchSmallIcons_9: {fileID: 0} + switchSmallIcons_10: {fileID: 0} + switchSmallIcons_11: {fileID: 0} + switchSmallIcons_12: {fileID: 0} + switchSmallIcons_13: {fileID: 0} + switchSmallIcons_14: {fileID: 0} + switchSmallIcons_15: {fileID: 0} + switchManualHTML: + switchAccessibleURLs: + switchLegalInformation: + switchMainThreadStackSize: 1048576 + switchPresenceGroupId: + switchLogoHandling: 0 + switchReleaseVersion: 0 + switchDisplayVersion: 1.0.0 + switchStartupUserAccount: 0 + switchSupportedLanguagesMask: 0 + switchLogoType: 0 + switchApplicationErrorCodeCategory: + switchUserAccountSaveDataSize: 0 + switchUserAccountSaveDataJournalSize: 0 + switchApplicationAttribute: 0 + switchCardSpecSize: -1 + switchCardSpecClock: -1 + switchRatingsMask: 0 + switchRatingsInt_0: 0 + switchRatingsInt_1: 0 + switchRatingsInt_2: 0 + switchRatingsInt_3: 0 + switchRatingsInt_4: 0 + switchRatingsInt_5: 0 + switchRatingsInt_6: 0 + switchRatingsInt_7: 0 + switchRatingsInt_8: 0 + switchRatingsInt_9: 0 + switchRatingsInt_10: 0 + switchRatingsInt_11: 0 + switchRatingsInt_12: 0 + switchLocalCommunicationIds_0: + switchLocalCommunicationIds_1: + switchLocalCommunicationIds_2: + switchLocalCommunicationIds_3: + switchLocalCommunicationIds_4: + switchLocalCommunicationIds_5: + switchLocalCommunicationIds_6: + switchLocalCommunicationIds_7: + switchParentalControl: 0 + switchAllowsScreenshot: 1 + switchAllowsVideoCapturing: 1 + switchAllowsRuntimeAddOnContentInstall: 0 + switchDataLossConfirmation: 0 + switchUserAccountLockEnabled: 0 + switchSystemResourceMemory: 16777216 + switchSupportedNpadStyles: 3 + switchNativeFsCacheSize: 32 + switchIsHoldTypeHorizontal: 0 + switchSupportedNpadCount: 8 + switchEnableTouchScreen: 1 + switchSocketConfigEnabled: 0 + switchTcpInitialSendBufferSize: 32 + switchTcpInitialReceiveBufferSize: 64 + switchTcpAutoSendBufferSizeMax: 256 + switchTcpAutoReceiveBufferSizeMax: 256 + switchUdpSendBufferSize: 9 + switchUdpReceiveBufferSize: 42 + switchSocketBufferEfficiency: 4 + switchSocketInitializeEnabled: 1 + switchNetworkInterfaceManagerInitializeEnabled: 1 + switchPlayerConnectionEnabled: 1 + switchUseNewStyleFilepaths: 1 + switchUseLegacyFmodPriorities: 0 + switchUseMicroSleepForYield: 1 + switchEnableRamDiskSupport: 0 + switchMicroSleepForYieldTime: 25 + switchRamDiskSpaceSize: 12 + ps4NPAgeRating: 12 + ps4NPTitleSecret: + ps4NPTrophyPackPath: + ps4ParentalLevel: 11 + ps4ContentID: ED1633-NPXX51362_00-0000000000000000 + ps4Category: 0 + ps4MasterVersion: 01.00 + ps4AppVersion: 01.00 + ps4AppType: 0 + ps4ParamSfxPath: + ps4VideoOutPixelFormat: 0 + ps4VideoOutInitialWidth: 1920 + ps4VideoOutBaseModeInitialWidth: 1920 + ps4VideoOutReprojectionRate: 60 + ps4PronunciationXMLPath: + ps4PronunciationSIGPath: + ps4BackgroundImagePath: + ps4StartupImagePath: + ps4StartupImagesFolder: + ps4IconImagesFolder: + ps4SaveDataImagePath: + ps4SdkOverride: + ps4BGMPath: + ps4ShareFilePath: + ps4ShareOverlayImagePath: + ps4PrivacyGuardImagePath: + ps4ExtraSceSysFile: + ps4NPtitleDatPath: + ps4RemotePlayKeyAssignment: -1 + ps4RemotePlayKeyMappingDir: + ps4PlayTogetherPlayerCount: 0 + ps4EnterButtonAssignment: 1 + ps4ApplicationParam1: 0 + ps4ApplicationParam2: 0 + ps4ApplicationParam3: 0 + ps4ApplicationParam4: 0 + ps4DownloadDataSize: 0 + ps4GarlicHeapSize: 2048 + ps4ProGarlicHeapSize: 2560 + playerPrefsMaxSize: 32768 + ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ + ps4pnSessions: 1 + ps4pnPresence: 1 + ps4pnFriends: 1 + ps4pnGameCustomData: 1 + playerPrefsSupport: 0 + enableApplicationExit: 0 + resetTempFolder: 1 + restrictedAudioUsageRights: 0 + ps4UseResolutionFallback: 0 + ps4ReprojectionSupport: 0 + ps4UseAudio3dBackend: 0 + ps4UseLowGarlicFragmentationMode: 1 + ps4SocialScreenEnabled: 0 + ps4ScriptOptimizationLevel: 0 + ps4Audio3dVirtualSpeakerCount: 14 + ps4attribCpuUsage: 0 + ps4PatchPkgPath: + ps4PatchLatestPkgPath: + ps4PatchChangeinfoPath: + ps4PatchDayOne: 0 + ps4attribUserManagement: 0 + ps4attribMoveSupport: 0 + ps4attrib3DSupport: 0 + ps4attribShareSupport: 0 + ps4attribExclusiveVR: 0 + ps4disableAutoHideSplash: 0 + ps4videoRecordingFeaturesUsed: 0 + ps4contentSearchFeaturesUsed: 0 + ps4CompatibilityPS5: 0 + ps4AllowPS5Detection: 0 + ps4GPU800MHz: 1 + ps4attribEyeToEyeDistanceSettingVR: 0 + ps4IncludedModules: [] + ps4attribVROutputEnabled: 0 + monoEnv: + splashScreenBackgroundSourceLandscape: {fileID: 0} + splashScreenBackgroundSourcePortrait: {fileID: 0} + blurSplashScreenBackground: 1 + spritePackerPolicy: + webGLMemorySize: 16 + webGLExceptionSupport: 1 + webGLNameFilesAsHashes: 0 + webGLShowDiagnostics: 0 + webGLDataCaching: 1 + webGLDebugSymbols: 0 + webGLEmscriptenArgs: + webGLModulesDirectory: + webGLTemplate: APPLICATION:Default + webGLAnalyzeBuildSize: 0 + webGLUseEmbeddedResources: 0 + webGLCompressionFormat: 1 + webGLWasmArithmeticExceptions: 0 + webGLLinkerTarget: 1 + webGLThreadsSupport: 0 + webGLDecompressionFallback: 0 + webGLInitialMemorySize: 32 + webGLMaximumMemorySize: 2048 + webGLMemoryGrowthMode: 2 + webGLMemoryLinearGrowthStep: 16 + webGLMemoryGeometricGrowthStep: 0.2 + webGLMemoryGeometricGrowthCap: 96 + webGLPowerPreference: 2 + scriptingDefineSymbols: {} + additionalCompilerArguments: {} + platformArchitecture: {} + scriptingBackend: + Android: 1 + Standalone: 1 + il2cppCompilerConfiguration: {} + il2cppCodeGeneration: {} + managedStrippingLevel: + Android: 1 + EmbeddedLinux: 1 + GameCoreScarlett: 1 + GameCoreXboxOne: 1 + Nintendo Switch: 1 + PS4: 1 + PS5: 1 + QNX: 1 + Stadia: 1 + VisionOS: 1 + WebGL: 1 + Windows Store Apps: 1 + XboxOne: 1 + iPhone: 1 + tvOS: 1 + incrementalIl2cppBuild: {} + suppressCommonWarnings: 1 + allowUnsafeCode: 1 + useDeterministicCompilation: 1 + additionalIl2CppArgs: + scriptingRuntimeVersion: 1 + gcIncremental: 0 + gcWBarrierValidation: 0 + apiCompatibilityLevelPerPlatform: {} + m_RenderingPath: 1 + m_MobileRenderingPath: 1 + metroPackageName: Template_3D + metroPackageVersion: + metroCertificatePath: + metroCertificatePassword: + metroCertificateSubject: + metroCertificateIssuer: + metroCertificateNotAfter: 0000000000000000 + metroApplicationDescription: Template_3D + wsaImages: {} + metroTileShortName: + metroTileShowName: 0 + metroMediumTileShowName: 0 + metroLargeTileShowName: 0 + metroWideTileShowName: 0 + metroSupportStreamingInstall: 0 + metroLastRequiredScene: 0 + metroDefaultTileSize: 1 + metroTileForegroundText: 2 + metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0} + metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, + a: 1} + metroSplashScreenUseBackgroundColor: 0 + platformCapabilities: {} + metroTargetDeviceFamilies: {} + metroFTAName: + metroFTAFileTypes: [] + metroProtocolName: + vcxProjDefaultLanguage: + XboxOneProductId: + XboxOneUpdateKey: + XboxOneSandboxId: + XboxOneContentId: + XboxOneTitleId: + XboxOneSCId: + XboxOneGameOsOverridePath: + XboxOnePackagingOverridePath: + XboxOneAppManifestOverridePath: + XboxOneVersion: 1.0.0.0 + XboxOnePackageEncryption: 0 + XboxOnePackageUpdateGranularity: 2 + XboxOneDescription: + XboxOneLanguage: + - enus + XboxOneCapability: [] + XboxOneGameRating: {} + XboxOneIsContentPackage: 0 + XboxOneEnhancedXboxCompatibilityMode: 0 + XboxOneEnableGPUVariability: 0 + XboxOneSockets: {} + XboxOneSplashScreen: {fileID: 0} + XboxOneAllowedProductIds: [] + XboxOnePersistentLocalStorageSize: 0 + XboxOneXTitleMemory: 8 + XboxOneOverrideIdentityName: + XboxOneOverrideIdentityPublisher: + vrEditorSettings: {} + cloudServicesEnabled: + UNet: 1 + luminIcon: + m_Name: + m_ModelFolderPath: + m_PortalFolderPath: + luminCert: + m_CertPath: + m_SignPackage: 1 + luminIsChannelApp: 0 + luminVersion: + m_VersionCode: 1 + m_VersionName: + hmiPlayerDataPath: + hmiForceSRGBBlit: 1 + embeddedLinuxEnableGamepadInput: 1 + hmiLogStartupTiming: 0 + hmiCpuConfiguration: + apiCompatibilityLevel: 6 + activeInputHandler: 0 + windowsGamepadBackendHint: 0 + cloudProjectId: + framebufferDepthMemorylessMode: 0 + qualitySettingsNames: [] + projectName: + organizationId: + cloudEnabled: 0 + legacyClampBlendShapeWeights: 1 + hmiLoadingImage: {fileID: 0} + platformRequiresReadableAssets: 0 + virtualTexturingSupportEnabled: 0 + insecureHttpOption: 0 diff --git a/Unity.Mathematics.TestProject/ProjectSettings/ProjectVersion.txt b/Unity.Mathematics.TestProject/ProjectSettings/ProjectVersion.txt new file mode 100644 index 00000000..78a77889 --- /dev/null +++ b/Unity.Mathematics.TestProject/ProjectSettings/ProjectVersion.txt @@ -0,0 +1,2 @@ +m_EditorVersion: 2022.3.7f1 +m_EditorVersionWithRevision: 2022.3.7f1 (b16b3b16c7a0) diff --git a/Unity.Mathematics.TestProject/ProjectSettings/QualitySettings.asset b/Unity.Mathematics.TestProject/ProjectSettings/QualitySettings.asset new file mode 100644 index 00000000..d24eb10c --- /dev/null +++ b/Unity.Mathematics.TestProject/ProjectSettings/QualitySettings.asset @@ -0,0 +1,236 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!47 &1 +QualitySettings: + m_ObjectHideFlags: 0 + serializedVersion: 5 + m_CurrentQuality: 5 + m_QualitySettings: + - serializedVersion: 2 + name: Very Low + pixelLightCount: 0 + shadows: 0 + shadowResolution: 0 + shadowProjection: 1 + shadowCascades: 1 + shadowDistance: 15 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 0 + skinWeights: 1 + textureQuality: 1 + anisotropicTextures: 0 + antiAliasing: 0 + softParticles: 0 + softVegetation: 0 + realtimeReflectionProbes: 0 + billboardsFaceCameraPosition: 0 + vSyncCount: 0 + lodBias: 0.3 + maximumLODLevel: 0 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 + particleRaycastBudget: 4 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 16 + asyncUploadPersistentBuffer: 1 + resolutionScalingFixedDPIFactor: 1 + customRenderPipeline: {fileID: 0} + excludedTargetPlatforms: [] + - serializedVersion: 2 + name: Low + pixelLightCount: 0 + shadows: 0 + shadowResolution: 0 + shadowProjection: 1 + shadowCascades: 1 + shadowDistance: 20 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 0 + skinWeights: 2 + textureQuality: 0 + anisotropicTextures: 0 + antiAliasing: 0 + softParticles: 0 + softVegetation: 0 + realtimeReflectionProbes: 0 + billboardsFaceCameraPosition: 0 + vSyncCount: 0 + lodBias: 0.4 + maximumLODLevel: 0 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 + particleRaycastBudget: 16 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 16 + asyncUploadPersistentBuffer: 1 + resolutionScalingFixedDPIFactor: 1 + customRenderPipeline: {fileID: 0} + excludedTargetPlatforms: [] + - serializedVersion: 2 + name: Medium + pixelLightCount: 1 + shadows: 1 + shadowResolution: 0 + shadowProjection: 1 + shadowCascades: 1 + shadowDistance: 20 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 0 + skinWeights: 2 + textureQuality: 0 + anisotropicTextures: 1 + antiAliasing: 0 + softParticles: 0 + softVegetation: 0 + realtimeReflectionProbes: 0 + billboardsFaceCameraPosition: 0 + vSyncCount: 1 + lodBias: 0.7 + maximumLODLevel: 0 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 + particleRaycastBudget: 64 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 16 + asyncUploadPersistentBuffer: 1 + resolutionScalingFixedDPIFactor: 1 + customRenderPipeline: {fileID: 0} + excludedTargetPlatforms: [] + - serializedVersion: 2 + name: High + pixelLightCount: 2 + shadows: 2 + shadowResolution: 1 + shadowProjection: 1 + shadowCascades: 2 + shadowDistance: 40 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 1 + skinWeights: 2 + textureQuality: 0 + anisotropicTextures: 1 + antiAliasing: 0 + softParticles: 0 + softVegetation: 1 + realtimeReflectionProbes: 1 + billboardsFaceCameraPosition: 1 + vSyncCount: 1 + lodBias: 1 + maximumLODLevel: 0 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 + particleRaycastBudget: 256 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 16 + asyncUploadPersistentBuffer: 1 + resolutionScalingFixedDPIFactor: 1 + customRenderPipeline: {fileID: 0} + excludedTargetPlatforms: [] + - serializedVersion: 2 + name: Very High + pixelLightCount: 3 + shadows: 2 + shadowResolution: 2 + shadowProjection: 1 + shadowCascades: 2 + shadowDistance: 70 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 1 + skinWeights: 4 + textureQuality: 0 + anisotropicTextures: 2 + antiAliasing: 2 + softParticles: 1 + softVegetation: 1 + realtimeReflectionProbes: 1 + billboardsFaceCameraPosition: 1 + vSyncCount: 1 + lodBias: 1.5 + maximumLODLevel: 0 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 + particleRaycastBudget: 1024 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 16 + asyncUploadPersistentBuffer: 1 + resolutionScalingFixedDPIFactor: 1 + customRenderPipeline: {fileID: 0} + excludedTargetPlatforms: [] + - serializedVersion: 2 + name: Ultra + pixelLightCount: 4 + shadows: 2 + shadowResolution: 2 + shadowProjection: 1 + shadowCascades: 4 + shadowDistance: 150 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 1 + skinWeights: 255 + textureQuality: 0 + anisotropicTextures: 2 + antiAliasing: 2 + softParticles: 1 + softVegetation: 1 + realtimeReflectionProbes: 1 + billboardsFaceCameraPosition: 1 + vSyncCount: 1 + lodBias: 2 + maximumLODLevel: 0 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 + particleRaycastBudget: 4096 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 16 + asyncUploadPersistentBuffer: 1 + resolutionScalingFixedDPIFactor: 1 + customRenderPipeline: {fileID: 0} + excludedTargetPlatforms: [] + m_PerPlatformDefaultQuality: + Android: 2 + Lumin: 5 + Nintendo Switch: 5 + PS4: 5 + Stadia: 5 + Standalone: 5 + WebGL: 3 + Windows Store Apps: 5 + XboxOne: 5 + iPhone: 2 + tvOS: 2 diff --git a/Unity.Mathematics.TestProject/ProjectSettings/TagManager.asset b/Unity.Mathematics.TestProject/ProjectSettings/TagManager.asset new file mode 100644 index 00000000..1c92a784 --- /dev/null +++ b/Unity.Mathematics.TestProject/ProjectSettings/TagManager.asset @@ -0,0 +1,43 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!78 &1 +TagManager: + serializedVersion: 2 + tags: [] + layers: + - Default + - TransparentFX + - Ignore Raycast + - + - Water + - UI + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + m_SortingLayers: + - name: Default + uniqueID: 0 + locked: 0 diff --git a/Unity.Mathematics.TestProject/ProjectSettings/TimeManager.asset b/Unity.Mathematics.TestProject/ProjectSettings/TimeManager.asset new file mode 100644 index 00000000..558a017e --- /dev/null +++ b/Unity.Mathematics.TestProject/ProjectSettings/TimeManager.asset @@ -0,0 +1,9 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!5 &1 +TimeManager: + m_ObjectHideFlags: 0 + Fixed Timestep: 0.02 + Maximum Allowed Timestep: 0.33333334 + m_TimeScale: 1 + Maximum Particle Timestep: 0.03 diff --git a/Unity.Mathematics.TestProject/ProjectSettings/UnityConnectSettings.asset b/Unity.Mathematics.TestProject/ProjectSettings/UnityConnectSettings.asset new file mode 100644 index 00000000..a88bee0f --- /dev/null +++ b/Unity.Mathematics.TestProject/ProjectSettings/UnityConnectSettings.asset @@ -0,0 +1,36 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!310 &1 +UnityConnectSettings: + m_ObjectHideFlags: 0 + serializedVersion: 1 + m_Enabled: 0 + m_TestMode: 0 + m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events + m_EventUrl: https://cdp.cloud.unity3d.com/v1/events + m_ConfigUrl: https://config.uca.cloud.unity3d.com + m_DashboardUrl: https://dashboard.unity3d.com + m_TestInitMode: 0 + CrashReportingSettings: + m_EventUrl: https://perf-events.cloud.unity3d.com + m_Enabled: 0 + m_LogBufferSize: 10 + m_CaptureEditorExceptions: 1 + UnityPurchasingSettings: + m_Enabled: 0 + m_TestMode: 0 + UnityAnalyticsSettings: + m_Enabled: 0 + m_TestMode: 0 + m_InitializeOnStartup: 1 + m_PackageRequiringCoreStatsPresent: 0 + UnityAdsSettings: + m_Enabled: 0 + m_InitializeOnStartup: 1 + m_TestMode: 0 + m_IosGameId: + m_AndroidGameId: + m_GameIds: {} + m_GameId: + PerformanceReportingSettings: + m_Enabled: 0 diff --git a/Unity.Mathematics.TestProject/ProjectSettings/VFXManager.asset b/Unity.Mathematics.TestProject/ProjectSettings/VFXManager.asset new file mode 100644 index 00000000..3a95c98b --- /dev/null +++ b/Unity.Mathematics.TestProject/ProjectSettings/VFXManager.asset @@ -0,0 +1,12 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!937362698 &1 +VFXManager: + m_ObjectHideFlags: 0 + m_IndirectShader: {fileID: 0} + m_CopyBufferShader: {fileID: 0} + m_SortShader: {fileID: 0} + m_StripUpdateShader: {fileID: 0} + m_RenderPipeSettingsPath: + m_FixedTimeStep: 0.016666668 + m_MaxDeltaTime: 0.05 diff --git a/Unity.Mathematics.TestProject/ProjectSettings/XRSettings.asset b/Unity.Mathematics.TestProject/ProjectSettings/XRSettings.asset new file mode 100644 index 00000000..482590c1 --- /dev/null +++ b/Unity.Mathematics.TestProject/ProjectSettings/XRSettings.asset @@ -0,0 +1,10 @@ +{ + "m_SettingKeys": [ + "VR Device Disabled", + "VR Device User Alert" + ], + "m_SettingValues": [ + "False", + "False" + ] +} \ No newline at end of file diff --git a/doc/readme.md b/doc/readme.md new file mode 100644 index 00000000..b2cbf2a3 --- /dev/null +++ b/doc/readme.md @@ -0,0 +1,67 @@ +Document written by Rune Stubbe, December 14th 2018 + +Pseudorandom notes on Unity.Mathematics +============================================== +Differences between Mathematics and HLSL +----------------------------------------- +Unity.Mathematics tries to follow familiar HLSL conventions whenever possible. Formulas and computations are generally more succintly expressed in a HLSL-like syntax with swizzles and free function than the traditional C# Unity Math library. Unity.Mathematics is not HLSL, but is in most instances trivially portable. The large common subset allows for code to directly shared between the two in many cases. +Due to inherent limitations in C# and for consistency reasons there are some notable differences between Unity.Mathematics and HLSL. +1. Type conversion rules: +HLSL will implicitly perform narrowing conversions. This could for instance be a float2 assigned directly to an int2/bool2. +C# requires explict casts to perform these kinds of potentially lossy conversions. We have chosen to follow the C# conventions here for consistency with how the conversions already function with C#'s builtin types int/float/etc. +2. Floating point literals: +In HLSL the default floating point literal precision is float, while it is double in C#. The `1.5` float literal in HLSL corresponds to `1.5f` in C# and the likewise the double literal `3.2L` in HLSL corresponds to `3.2` in C#. +3. Half precision floating point: `half`/`halfN` are supported in Mathematics, but only as storage types that implicitly convert to `float`/`double` types and can be explicitly converted to from these types. No arithmetic operation are defined on them as opposed to the HLSL types. We chose to do this as these operations would involve implicit conversion to and from `half`. These operations would be expensive and we believe that expensive operations should not happen implicitly. +4. Implicit truncation: +HLSL allows you to assign a float4 to a float2. As long as the source has at least as many components as the destination, the assignment is allowed. Any additional components are truncated away. We consider this behavior counter intuitive and error prone, so Unity.Mathematics does not try to mimic this behavior. +Unity.Mathematics aims to be a lean core library without domain specific features such as collision detection primitives, color space conversions, etc. Within these constraints, we decided to make the following additions. +1. Named constructors for matrix types: +A lot of game code is centered around manipulating transforms. To ease this work we have added a number of constructors and conversions between various transform representations and added a number of named constructors for constructing various transforms for Rotation, Translation, Scaling, Orthographic/Perspective projections, LookAt transforms, etc. +2. A `quaternion` type: +Considering how ubiquitous quaternions are in games, it seems appropriate to provide a good standard implementation in core mathematics. Whenever possible `quaternion` is a drop in replacement for `float3x3`. `mul` is also defined for `quaternion` just as for `float3x3`, `quaternion` can be used to initialize matrices and `quaternion` defines the same set of named constructors as the equivalent `float3x3` type. +3. Various additional utility functions: +`inverse`/`fastinverse` for inverting a matrix or quaternion. Horizontal operations `csum`/`cmin`/`cmax`. `compress` for left packing a vector using a boolean mask. Squared length/distance functions `lengthsq/distancesq`. `orthonormalize` functions, and many others. +4. Random Number Generator: `Random`. Basic PRNG with support for drawing uniformly random values of the basic scalar and vector types. It also has functions for generating uniformly random directions and rotation. The generator is based on the xor-shift algorithm. This algorithm was chosen primarily because it has a small state and unlike most PRNGs doesn't require integer multiplication, which is a problematic operation on lower-tier vector instruction sets. +5. `RigidTransform` (quaternion + position) and Cellular/Perlin Noise: The current math library includes these, but while useful, they would would probably find a better home somewhere outside the core mathematics library. + +Generated code +-------------- +Unity.Mathematics has a high degree of regularity that is not easily expressed in ordinary C# code. Constructors, conversion operators, arithmetic operators, swizzles, ToString-methods, Hash functions, etc. of the many vector and matrix type variants are all distinct, but all follow the same basic structure. To avoid the error prone process of writing and maintaining the many variants, we generate the code for these regular functions using the C# program **Unity.Mathematics.CodeGen**. The resulting generated files are easily recognizable by their *.gen.cs extension. To get test coverage of these functions, the corresponding tests are also generated by this program. + +Tests +--- + +Unity.Mathematics includes thousands of unit tests to cover methods and operator overloads for the vector, matrix and quaternion types that can be found in the **Unity.Mathematics.Tests** project. +The tests aim to exercise the entire set of Unity.Mathematics features using a combination of generated and manual tests. As Unity.Mathematics is intended to be used with the Burst compiler, we also include most of these tests as part of the Burst compiler tests in the **Burst.Compiler.IL.Tests** project. All shared tests between the two are in the `Tests/Shared` folder. A few tests have had to be omitted as the testing code it self uses unburstable code. + +Floating point precision and floating point overflow/underflow +-------------------------------------------------------------- + +Floating point precision in C# guarantees a minimum, but not a maximum precision. float might be evaluated as double (which mono likes to do) or double might be evaluated using extended precision (80bits). The precision is not even guaranteed to be consistent on a specific platform or even a concrete program. It might vary depending on how the JIT decides to optimize a particular piece of code! +Anecdotely it seems these two otherwise semantically identical pieces of code can behave differently because of JIT optimization decisions (x86): +1. Constants in array +```C# +var a = new double[2] = { -2.5e160, 1.2e160 }; +double d = System.Math.Sqrt(a[0] * a[0] + a[1] * a[1]); +System.Console.WriteLine("" + d); // Debug Build: Infinity, Release Build: 2.86356e160. +``` +2. Constants in local variables +```C# +double a = -2.6e160; +double b = -1.2e160; +double d = System.Math.Sqrt(a * a + b * b); +System.Console.WriteLine("" + d); // Debug Build: Infinity, Release Build: Infinity. +``` +You would expect the result to always be Infinity as the intermediate value inside the Sqrt (8.2e320) is outside the valid double precision range. But depending on the platform, whether optimizations are enabled and surprisingly even whether or not the constants come from a local variable or array, this might produce a finite value. Seemingly this happens because it might decide to perform the calculation in extended precision. +This behavior is specified in the C# specification (9.3.7) where it states: "Floating-point operations may be performed with higher precision than the result type of the operation.". +Due to this inconsistency, we have to avoid floating point overflow behavior, as it is simple not guaranteed even using Microsoft's own runtime! + +Signed zeros +------------- + +According to the C# specification section 9.3.7 C# supports and distinguishes between positive and negative floating point zeros. In practice we have found this not to be the case on our current Linux Mono environment, where seemingly negative zeroes are initialized as positive zeros. We should investigate this further at some point, but so far the affected tests are simply disabled in Linux using the `[WindowsOnlyAttribute]`. + +Known issues +------------ + +1. In order for code to be burstable we have to define all class-like objects as structs, but unlike classes there is no way to enforce that a struct gets initialized in any particular way. Just declaring a struct will give the user a zero-initialized instance. One instance where this limitation is very apparent is with `Random`. There is no way for us to guarantee that the user doesn't accidentally declare a zero-initialized instance. Such an instance has the unfortunate property that it will be stuck perpetually generating nothing but zeros. This is by the nature of the xor-shift algorithm, but it seems unnecessarily error-prone. While we could work around the problem by internally remapping the seed space, it would incur some unnecessary additional overhead and it seems this problem is likely to arise in other class-like objects implemented with structs. diff --git a/readme.md b/readme.md index e36492bb..992642fc 100644 --- a/readme.md +++ b/readme.md @@ -1,41 +1,39 @@ # Unity.Mathematics -A prototype of a C# math library providing vector types and math functions with a shader like syntax. Used by the `burst` compiler to compile C#/IL to highly efficient native code. +A C# math library providing vector types and math functions with a shader like +syntax. Used by the Burst compiler to compile C#/IL to highly efficient +native code. The main goal of this library is to provide a friendly Math API familiar to SIMD and graphic/shaders developers, using the well known `float4`, `float3` types...etc. with all intrinsics functions provided by a static class `math` that can be imported easily into your C# program with `using static Unity.Mathematics.math`. -In addition to this, the `burst` compiler is able to recognize these types and provide the optimized SIMD type for the running CPU on all supported platforms (x64, ARMv7a...etc.) +In addition to this, the Burst compiler is able to recognize these types and provide the optimized SIMD type for the running CPU on all supported platforms (x64, ARMv7a...etc.) -> NOTICE: The API is a work in progress and we may introduce breaking changes (API and underlying behavior) +NOTICE: The API is a work in progress and we may introduce breaking changes (API and underlying behavior) ## Usage You can use this library in your Unity game by using the Package Manager and referencing the package `com.unity.mathematics`. See the forum [Welcome](https://forum.unity.com/threads/welcome.522627) page for more details. ```C# -using Unity.Mathematics; using static Unity.Mathematics.math; - -var v1 = new float3(1,2,3); -var v2 = new float3(4,5,6); -v1 = normalize(v1); -v2 = normalize(v2); -var v3 = dot(v1, v2); +namespace MyNamespace +{ + using Unity.Mathematics; + + ... + var v1 = float3(1,2,3); + var v2 = float3(4,5,6); + v1 = normalize(v1); + v2 = normalize(v2); + var v3 = dot(v1, v2); + ... +} ``` ## Building Open the `src\Unity.Mathematics.sln` under Visual Studio 2015 or MonoDevelop and compile in Debug\Release. -## Known issues - -- [ ] Remove `bool1` to `bool` (temporarily required by burst at some point, but this should no longer be required) -- [ ] Lots of tests are missing. So far it was mainly a playground for prototyping the API -- [ ] Complete the library (quaternions, matrices...etc.) -- [ ] Provide double precision types -- [ ] Provide static readonly values once the support for static is done in burst -- [ ] Add the documentation on how to use this API - ## Contributing We don't yet accept PR on this repository. See the FAQ below. @@ -57,7 +55,17 @@ After years of feedback and experience with the previous API, we believe that pr ### Why not using `System.Numerics.Vectors`? Mainly for the reason mentioned above, `System.Numerics.Vectors` is in many ways similar to our previous Vector library (more object oriented than graphics programming oriented). -Also the fact that our `burst` compiler is able to recognize a lot more patterns for SIMD types and math intrinsics makes it easier to work with a dedicated API that reflects this ability. +Also the fact that our Burst compiler is able to recognize a lot more patterns for SIMD types and math intrinsics makes it easier to work with a dedicated API that reflects this ability. + +### Naming convention + +In C# `int` and `float` are considered builtin types. Burst extends this set of bultin types to also include vectors, matrices and quaternions. These types are bultin in the sense that Burst knows about them and is be able to generate better code using these types than what would be possible with equivalent code using custom types. + +To signify that these types are bultin their type names are in all lower case. The operators on these bultin types found in `Unity.Mathematics.math` are considered intrinsics and are thus always in lower case. + +There are no plans to extend the set of intrinsic types beyond the current set of vectors (`typeN`), matrices (`typeNxN`) and quaternions (`quaternion`). + +This convention has the added benefit of making the library highly compatible with shader code and makes porting or sharing code between the two almost frictionless. ### Why can't we send a PR yet? @@ -65,6 +73,7 @@ We are working on providing a Contributor License Agreement (CLA) with a sign-ov ## Licensing -Unity Companion License (“License”) Software Copyright © 2017 Unity Technologies ApS +Unity Companion License (“License”) Software Copyright © 2019 Unity Technologies ApS For licensing details see [LICENSE.md](LICENSE.md) + diff --git a/src/.npmignore b/src/.npmignore index 0d787c0f..e2e54865 100755 --- a/src/.npmignore +++ b/src/.npmignore @@ -1,16 +1,25 @@ -artifacts/** -build/** -Documentation/ApiDocs/** -.DS_Store -.npmrc -.npmignore -.gitignore -QAReport.md -QAReport.md.meta -Unity.Mathematics.CodeGen -Unity.Mathematics.Shaders -*.sln -*.db -**/*.csproj -**/Properties -**/packages.config +packages +artifacts/** +build/** +Documentation/ApiDocs/** +.DS_Store +.npmrc +.npmignore +.gitignore +QAReport.md +QAReport.md.meta +Unity.Mathematics.CodeGen* +Unity.Mathematics.PerformanceTests* +*.sln* +*.db* +**/*.csproj* +**/packages.config* +**/bin +**/obj + +upm-ci~/** +.Editor/** +.yamato/** +*.zip* +TestRunnerOptions.json +.idea/** \ No newline at end of file diff --git a/src/CHANGELOG.md b/src/CHANGELOG.md index e69de29b..595ffd52 100755 --- a/src/CHANGELOG.md +++ b/src/CHANGELOG.md @@ -0,0 +1,112 @@ +# Changelog + +## [Unreleased] +* Added a documentation remark for Random NextFloat and NextDouble methods with a min and max parameter. + +## [1.3.2] - 2024-01-11 + +### Fixed +* Fixed `math.hash` crash when using IL2CPP builds on Arm 32 bit devices. +* Fixed obsolete method usage warnings for `MatrixDrawer.CanCacheInspectorGUI` and `PrimitiveVectorDrawer.CanCacheInspectorGUI` in UNITY_2023_2_OR_NEWER. +* Updated minimum editor version to 2021.3 + +## [1.3.1] - 2023-07-12 + +### Added +* Added `math.square` to compute the square (x * x). +* Added `math.orthonormal_basis` to compute an orthonormal basis from a single unit length vector. +* Added `math.sign` for int, int2, int3 and int4. +* Added `math.chgsign` for float, float2, float3, and float4. +* Added `math.Euler` to convert a quaternion to Euler angles. +* Added `math.angle` to compute the angle between two unit quaternions. +* Added `math.rotation` to extract a quaternion rotation from a float3x3 (that may have scale). +* Added `math.mulScale` to scale columns of a float3x3 with scaling coefficients in a float3. +* Added `math.scaleMul` to scale rows of a float3x3 with scaling coefficients in a float3. +* Added `AffineTransform` type. +* Added `PI2`, `PIHALF`, `TAU`, `TODEGREES` and `TORADIANS` constants. + +### Changed +* `asfloat(uint)`, `asuint(float)`, `asint(float)` and other related methods are now faster in mono without Burst. Other methods which use these will see a performance improvement. +* Modified `quaternion.nlerp` to be branchless. +* More descriptive parameter names for many methods in `math` class. +* Made `Il2CppEagerStaticClassConstructionAttribute` internal to avoid conflicts with other definitions outside of the package. + +## [1.2.6] - 2022-02-11 + +### Changed +* Made Il2CppEagerStaticClassConstructionAttribute internal to avoid conflicts with other definitions outside of the package. + +## [1.2.5] - 2021-11-01 + +### Fixed +* Fixed property drawing when manually drawing a property that was hidden with [HideInInspector]. + +## [1.2.4] - 2021-09-22 + +### Added +* Added `[Il2CppEagerStaticClassConstruction]` to Unity.Mathematics types to run static constructors at startup. This improves IL2CPP performance slightly for types that have static constructors. + +### Changed +* License file updated to satisfy Unity's package validation tests. +* Changed noise documentation in comments to xmldoc comments. + +### Fixed +* Fixed Equals(object) override which did not check type before casting. This could cause exceptions to be thrown when the object did not match the expected type. +* Fixed incorrect `math.tzcnt` documentation which mentioned leading zero counts instead of trailing zero counts. +* Fixed `float2x2.Rotate` documentation to mention radians instead of degrees. +* Fixed documentation for methods and properties that were previously undocumented. + +## [1.2.1] - 2020-08-06 + +### Fixed +* Fixed warnings for meta files existing even though the files they represent did not exist. + +### Internal (Not ready for production) + +## [1.2.0] - 2020-08-03 + +### Added +* Added `[MethodImpl(MethodImplOptions.AggressiveInlining)]` to many static functions to improve IL2CPP performance. +* Added `compress()` that accepts a `float4` and `uint4`. +* Added `math.project()` and `math.projectsafe()` for vector projection. +* Added `math.EPSILON`, `math.INFINITY`, `math.NAN` and their double counterparts. +* Added `[Serializable]` to `RigidTransform`. +* Added `math.ceillog2()`. +* Added `math.floorlog2()`. +* Added `math.down()`, `math.forward()`, etc for Cartesian coordinate axes that match UnityEngine Vector3 equivalents. +* Added `math.ispow2()`. +* Added `half.MinValueAsHalf` and `half.MaxValueAsHalf` to avoid having to explicitly convert from float. +* Added a `float3x3` constructor which takes a `float4x4` as input. +* Added `[Serializable]` to half types. +* Added some performance tests which can be run from the Unity test project. +* Added `Random.CreateFromIndex()` to assist in creating Random instances from loop indices. + +### Fixed +* Fixed documentation bug where `quaternion.RotateX/Y/Z` referred to a `float4x4` instead of quaternion. +* Fixed code generation bugs which could cause Windows and Mac to generate different test code. +* Fixed some test asserts which used NaNs and signed zeros which failed in IL2CPP builds. +* Updated documentation for `math.countbits()` to include equivalent names on Intel and ARM architectures to aid in discoverability. + +### Internal (Not ready for production) +* Added `Unity.Mathematics.Geometry.Plane` to represent planes in 3D space. +* Added more `MinMaxAABB` functionality from `Unity.Physics.Aabb`. +* Added `Unity.Mathematics.Geometry.Math` to hold static functions like AABB transformations. +* Added `MinMaxAABB`. + +## [1.1.0] - 2019-07-08 + +- Release stable version + +## [1.1.0-preview.1] - 2019-06-27 + +- Add new math.bitmask to return a bit mask from a bool4 + +## [1.0.1] - 2019-04-15 + +- Release stable version +- Modify all math constants (e.g `math.PI`) to provide float constant by default instead of double. Use for example `math.PI_DBL` to get the previous double constant. + +## [1.0.0-preview.1] - 2019-02-28 + +- Fixed bug where modifications on prefabs could not be reverted for vector properties when using context menu in Inspector. +- Fixed structure of the package for internal validation diff --git a/src/Documentation/mathematics.md b/src/Documentation/mathematics.md deleted file mode 100755 index 9ddcced3..00000000 --- a/src/Documentation/mathematics.md +++ /dev/null @@ -1,3 +0,0 @@ -Unity's C# SIMD math library providing vector types and math functions with a shader like syntax. - -This package is still in experimental phase. diff --git a/src/Documentation~/4x4-matrices.md b/src/Documentation~/4x4-matrices.md new file mode 100644 index 00000000..266ec670 --- /dev/null +++ b/src/Documentation~/4x4-matrices.md @@ -0,0 +1,48 @@ +# 4×4 matrices + +To create a 4×4 transformation matrix, use the constructors in [`float4x4`](xref:Unity.Mathematics.float4x4) to assign one value to all elements of the matrix, or individually set all 16 elements directly: + + +```c# +// Unity Mathematics example +void Build4x4UnityMathematics() +{ + var c0 = new float4(1.0f, 0.0f, 0.0f, 0.0f); + var c1 = new float4(0.0f, 1.0f, 0.0f, 0.0f); + var c2 = new float4(0.0f, 0.0f, 1.0f, 0.0f); + var c3 = new float4(0.0f, 0.0f, 0.0f, 1.0f); + var m = new float4x4(c0, c1, c2, c3); +} +``` + +## Multiplying a 4×4 matrix + +Unity Mathematics and `UnityEngine` define the `*` operator differently. The `*` operator for [`float4x4`](xref:Unity.Mathematics.float4x4) implements componentwise multiplication. If you multiply a `float4x4` of all 1s with 0.5 on the diagonal, you get back the half identity because the upper and lower triangles of the matrix are multiplied by the respective zero entries from `f4x4_HalfIdentity`: + +```c# +// Unity Mathematics example +void OperatorMultiply4x4UnityMathematics() +{ + float4x4 result = f4x4_Ones * f4x4_HalfIdentity; + // result: + // 0.5, 0.0, 0.0, 0.0, + // 0.0, 0.5, 0.0, 0.0, + // 0.0, 0.0, 0.5, 0.0, + // 0.0, 0.0, 0.0, 0.5 +} +``` + +## Multiplying a 4×4 matrix and a 4D vector + +Use the [`math.mul`](xref:Unity.Mathematics.math.mul*) method to multiply a 4×4 matrix and a 4D vector. If you supply a `float4x4` as the first parameter and a `float4` as the second, it performs a 4×4 matrix multiplication with a 4×1 column vector, which returns a 4×1 column vector as a `float4`. + +`math.mul` can also multiply a 1×4 row vector by a 4×4 matrix to produce a 1×4 row vector by taking a `float4` as the first parameter and a `float4×4` as the second. Unity Mathematics stores the row vector in a `float4` and it isn't treated as a separate type. + +```c# +// Unity Mathematics example +void Multiply4x4AndVector4UnityMathematics() +{ + float4 result1 = math.mul(f4x4, f4); // 4x4 * 4x1 = 4x1 + float4 result2 = math.mul(f4, f4x4); // 1x4 * 4x4 = 1x4 +} +``` \ No newline at end of file diff --git a/src/Documentation~/TableOfContents.md b/src/Documentation~/TableOfContents.md new file mode 100644 index 00000000..1dc7d3b2 --- /dev/null +++ b/src/Documentation~/TableOfContents.md @@ -0,0 +1,8 @@ +* [Unity Mathematics](index.md) +* [Compatibility with Mathf](compatibility.md) +* [Getting started](getting-started.md) +* Common operations + * [4×4 matrices](4x4-matrices.md) + * [Vector multiplication](vector-multiplication.md) + * [Quaternion multiplication](quaternion-multiplication.md) + * [Random numbers](random-numbers.md) diff --git a/src/Documentation~/compatibility.md b/src/Documentation~/compatibility.md new file mode 100644 index 00000000..9113e0a4 --- /dev/null +++ b/src/Documentation~/compatibility.md @@ -0,0 +1,17 @@ +# Compatibility with `UnityEngine` mathematics + +If you want to Burst-compile your project, it's best practice to use the Unity Mathematics package by default and only use `Mathf` when necessary. Unity Mathematics isn't implemented in the same way as the [`UnityEngine.Mathf`](https://docs.unity3d.com/ScriptReference/Mathf.html) struct in the core Unity engine. Because of this, if your application relies on the specific behaviors of `Mathf`, you'll have to reimplement them to get similar behavior in Unity Mathematics. + +>[!IMPORTANT] +>For performance reasons, if your project uses the Mono compiler, you should continue to use the mathematical operations in `Mathf`, rather than Unity Mathematics. + +You can use both `Mathf` and Unity Mathematics methods in your project, but it might impact on the performance of your application because the conversions between the `UnityEngine` and `Unity.Mathematics` types such as `Vector3` to `float3` and vice-versa are performance-intensive. + +## Porting `UnityEngine` code to `Unity.Mathematics` + +If you want to migrate code from `UnityEngine` to `Unity.Mathematics`, you need to make the following changes first: + +* Update `UnityEngine` types to `Unity.Mathematics` types. For example, [`Vector4`](https://docs.unity3d.com/ScriptReference/Vector4.html) to [`float4`](xref:Unity.Mathematics.float4), and [`Quaternion`](https://docs.unity3d.com/ScriptReference/Quaternion.html) to [`quaternion`](xref:Unity.Mathematics.quaternion). These examples aren't exhaustive: see the [Scripting API reference](https://docs.unity3d.com/Packages/com.unity.mathematics@latest/index.html?subfolder=/api/index.html) for the full list of Unity Mathematics types available. +* Update any operators involved in matrices or vectors. For example, the `Matrix4x4` multiplication operator implements matrix multiplication, but the `float4x4` multiplication operator implements componentwise multiplication. +* Degrees to radians +* How your code generates random numbers. `Random` in `Unity.Mathematics` works differently to [`Random`](https://docs.unity3d.com/ScriptReference/Random.html) in `UnityEngine`. You can completely control random number generation with `Random` in `Unity.Mathematics`, and it's instanced, rather than static. It's also exclusive with its upper bound, which is important to bear in mind if you want to convert `UnityEngine` code which is sensitive to the bounds. For more information, see the documentation on [Random numbers](random-numbers.md). diff --git a/src/Documentation~/filter.yml b/src/Documentation~/filter.yml new file mode 100644 index 00000000..a101da86 --- /dev/null +++ b/src/Documentation~/filter.yml @@ -0,0 +1,13 @@ +apiRules: + - exclude: + uidRegex: Tests$ + type: Namespace + - exclude: + uidRegex: ^Unity\..*\.Tests\..*$ + type: Namespace + - exclude: + uidRegex: Unity\.Mathematics\.Shaders$ + type: Namespace + - exclude: + uidRegex: Unity\.IL2CPP\.CompilerServices$ + type: Namespace \ No newline at end of file diff --git a/src/Documentation~/getting-started.md b/src/Documentation~/getting-started.md new file mode 100644 index 00000000..7ed246e5 --- /dev/null +++ b/src/Documentation~/getting-started.md @@ -0,0 +1,29 @@ +# Getting started + +To use Unity Mathematics, add `using Unity.Mathematics` to your code: + +```C# +using static Unity.Mathematics.math; +namespace MyNamespace +{ + using Unity.Mathematics; + + ... + var v1 = float3(1,2,3); + var v2 = float3(4,5,6); + v1 = normalize(v1); + v2 = normalize(v2); + var v3 = dot(v1, v2); + ... +} +``` + +## Naming convention + +In C# `int` and `float` are built-in types. The Burst compiler extends this set of built-in types to also include vectors, matrices, and quaternions. These types are built-in because the Burst compiler already has implementations of these types, and so can use them to generate better code than for custom types. + +To signify that these types are built-in their type names are in all lower case. The operators on these built-in types in [`Unity.Mathematics.math`](xref:Unity.Mathematics.math) are intrinsics and are always in lower case. + +There are no plans to extend the set of intrinsic types beyond the current set of vectors (`typeN`), matrices (`typeNxN`) and quaternions (`quaternion`). + +This convention has the added benefit of making the library highly compatible with shader code and makes porting or sharing code between the two almost frictionless. diff --git a/src/Documentation~/index.md b/src/Documentation~/index.md new file mode 100644 index 00000000..0b61abb2 --- /dev/null +++ b/src/Documentation~/index.md @@ -0,0 +1,30 @@ +# Unity Mathematics + +Unity Mathematics is a C# math library that provides vector types and math functions that have a shader-like +syntax, similar to [SIMD](https://en.wikipedia.org/wiki/Single_instruction,_multiple_data) or [HLSL](https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl). The [Burst compiler](https://docs.unity3d.com/Packages/com.unity.burst@latest) uses Unity Mathematics to compile C#/IL code into highly efficient native code. + +It implements the following vector and matrix types: + +* floatN, quaternion +* float3×3, float4×4 + +Plus elementary functions: +* min, max, fabs, etc. +* sin, cos, sqrt, normalize, dot, cross, etc. + +## Installation + +You can install the Mathematics package through Unity's Package Manager. For more information, see the Unity User Manual documentation on [Adding and removing packages](https://docs.unity3d.com/Manual/upm-ui-actions.html). + +>[!IMPORTANT] +>From Unity 6.5, Unity Mathematics is a built-in module of the core Editor and Engine and its APIs are available to user code by default in the `Unity.Mathematics` namespace, with no package installation required. Accordingly, from Unity 6.5 the Unity Mathematics API documentation is part of the [core Scripting API reference](https://docs.unity3d.com/ScriptReference/Unity.Mathematics.math.html), and the user manual is integrated with [the core Unity user manual](https://docs.unity3d.com/Manual/unity-mathematics.html). + +### Editor config + +Unity Mathematics uses [editorconfig](http://editorconfig.org/) to keep files formatted for EOL and spaces. + +Your IDE should have support for `editorconfig`. If it doesn't, you can get the extension for it here: + +* [VS2015/VS2017 EditorConfig extension](https://marketplace.visualstudio.com/items?itemName=EditorConfigTeam.EditorConfig) +* [Visual Studio Code EditorConfig extension](https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig) +* [SublimeText EditorConfig extension](https://github.com/sindresorhus/editorconfig-sublime) diff --git a/src/Documentation~/projectMetadata.json b/src/Documentation~/projectMetadata.json new file mode 100644 index 00000000..11f3f1c8 --- /dev/null +++ b/src/Documentation~/projectMetadata.json @@ -0,0 +1,5 @@ +{ + "useMemberPages": true, + "hideGlobalNamespace": false, + "symbolDefines":"" +} diff --git a/src/Documentation~/quaternion-multiplication.md b/src/Documentation~/quaternion-multiplication.md new file mode 100644 index 00000000..d6f70f4d --- /dev/null +++ b/src/Documentation~/quaternion-multiplication.md @@ -0,0 +1,17 @@ +# Quaternion multiplication + +To rotate a quaternion, use the [`AxisAngle`](xref:Unity.Mathematics.quaternion.AxisAngle*) method. You need to specify the axis of rotation and the angle of rotation, in that order. All are in radians rather than degrees. `math.mul` multiplies the quaternion, just as with [matrices](4x4-matrices.md) and vectors. + +```c# +// Unity Mathematics example +void QuaternionMultiplicationUnityMathematics() +{ + var axis = new float3(0.0f, 1.0f, 0.0f); + var q = quaternion.AxisAngle(axis,math.radians(45.0f)); + var orientation = quaternion.Euler( + math.radians(45.0f), + math.radians(90.0f), + math.radians(180.0f)); + var result = math.mul(q, orientation); +} +``` diff --git a/src/Documentation~/random-numbers.md b/src/Documentation~/random-numbers.md new file mode 100644 index 00000000..5a09e9d9 --- /dev/null +++ b/src/Documentation~/random-numbers.md @@ -0,0 +1,21 @@ +## Random numbers + +To generate random numbers, you must create and manage the random number generator state yourself with the [`Random`](xref:Unity.Mathematics.Random) struct. You can control the random number generator state explicitly, which is useful if you're using parallel code, or if you want to make sure that one source of random numbers is seeded differently than another source. You can also have as many `Random` instances as you like. + +Once you set up the state, use [`NextFloat`](xref:Unity.Mathematics.Random.NextFloat) to get random floats. By default it returns random numbers between `[0, 1)`, exclusive: + +```c# +// Unity Mathematics example +void RandomNumberUnityMathematics() +{ + // Choose some non-zero seed and set up the random number generator state. + uint seed = 1; + Unity.Mathematics.Random rng = new Unity.Mathematics.Random(seed); + + // [0, 1) exclusive + float randomFloat1 = rng.NextFloat(); + + // [-5, 5) exclusive + float randomFloat2 = rng.NextFloat(-5.0f, 5.0f); +} +``` diff --git a/src/Documentation~/vector-multiplication.md b/src/Documentation~/vector-multiplication.md new file mode 100644 index 00000000..123fe6bb --- /dev/null +++ b/src/Documentation~/vector-multiplication.md @@ -0,0 +1,16 @@ +# Vector multiplication + +To multiply vectors, use the `*`: + +```c# +// Unity Mathematics example +void ComponentwiseVectorMultiplyUnityMathematics() +{ + var v0 = new float4(2.0f, 4.0f, 6.0f, 8.0f); + var v1 = new float4(1.0f, -1.0f, 1.0f, -1.0f); + var result = v0 * v1; + // result == new float4(2.0f, -4.0f, 6.0f, -8.0f). +} +``` + +This is a common way of writing [SIMD](https://en.wikipedia.org/wiki/Single_instruction,_multiple_data) code, which applies a single instruction to multiple data elements. Other operators such as addition, subtraction, and division work in the same way. \ No newline at end of file diff --git a/src/LICENSE.md b/src/LICENSE.md index 4c2154cc..1f5c0f44 100755 --- a/src/LICENSE.md +++ b/src/LICENSE.md @@ -1,30 +1,4 @@ -Unity Companion License (“License”) -Software Copyright © 2017 Unity Technologies ApS - -Unity Technologies ApS (“Unity”) grants to you a worldwide, non-exclusive, no-charge, and royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute the software that is made available under this License (“Software”), subject to the following terms and conditions: - -1. Unity Companion Use Only. Exercise of the license granted herein is limited to exercise for the creation, use, and/or distribution of applications, software, or other content pursuant to a valid Unity content authoring and rendering engine software license (“Engine License”). That means while use of the Software is not limited to use in the software licensed under the Engine License, the Software may not be used for any purpose other than the creation, use, and/or distribution of Engine License-dependent applications, software, or other content. No other exercise of the license granted herein is permitted, and in no event may the Software be used for competitive analysis or to develop a competing product or service. - -2. No Modification of Engine License. Neither this License nor any exercise of the license granted herein modifies the Engine License in any way. - -3. Ownership & Grant Back to You. +com.unity.mathematics copyright © 2023 Unity Technologies ApS -3.1 You own your content. In this License, “derivative works” means derivatives of the Software itself--works derived only from the Software by you under this License (for example, modifying the code of the Software itself to improve its efficacy); “derivative works” of the Software do not include, for example, games, apps, or content that you create using the Software. You keep all right, title, and interest to your own content. - -3.2 Unity owns its content. While you keep all right, title, and interest to your own content per the above, as between Unity and you, Unity will own all right, title, and interest to all intellectual property rights (including patent, trademark, and copyright) in the Software and derivative works of the Software, and you hereby assign and agree to assign all such rights in those derivative works to Unity. - -3.3 You have a license to those derivative works. Subject to this License, Unity grants to you the same worldwide, non-exclusive, no-charge, and royalty-free copyright license to derivative works of the Software you create as is granted to you for the Software under this License. - -4. Trademarks. You are not granted any right or license under this License to use any trademarks, service marks, trade names, products names, or branding of Unity or its affiliates (“Trademarks”). Descriptive uses of Trademarks are permitted; see, for example, Unity’s Branding Usage Guidelines at https://unity3d.com/public-relations/brand. - -5. Notices & Third-Party Rights. This License, including the copyright notice associated with the Software, must be provided in all substantial portions of the Software and derivative works thereof (or, if that is impracticable, in any other location where such notices are customarily placed). Further, if the Software is accompanied by a Unity “third-party notices” or similar file, you acknowledge and agree that software identified in that file is governed by those separate license terms. - -6. DISCLAIMER, LIMITATION OF LIABILITY. THE SOFTWARE AND ANY DERIVATIVE WORKS THEREOF IS PROVIDED ON AN "AS IS" BASIS, AND IS PROVIDED WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND/OR NONINFRINGEMENT. IN NO EVENT SHALL ANY COPYRIGHT HOLDER OR AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES (WHETHER DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL, INCLUDING PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, LOSS OF USE, DATA, OR PROFITS, AND BUSINESS INTERRUPTION), OR OTHER LIABILITY WHATSOEVER, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM OR OUT OF, OR IN CONNECTION WITH, THE SOFTWARE OR ANY DERIVATIVE WORKS THEREOF OR THE USE OF OR OTHER DEALINGS IN SAME, EVEN WHERE ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -7. USE IS ACCEPTANCE and License Versions. Your receipt and use of the Software constitutes your acceptance of this License and its terms and conditions. Software released by Unity under this License may be modified or updated and the License with it; upon any such modification or update, you will comply with the terms of the updated License for any use of any of the Software under the updated License. - -8. Use in Compliance with Law and Termination. Your exercise of the license granted herein will at all times be in compliance with applicable law and will not infringe any proprietary rights (including intellectual property rights); this License will terminate immediately on any breach by you of this License. - -9. Severability. If any provision of this License is held to be unenforceable or invalid, that provision will be enforced to the maximum extent possible and the other provisions will remain in full force and effect. - -10. Governing Law and Venue. This License is governed by and construed in accordance with the laws of Denmark, except for its conflict of laws rules; the United Nations Convention on Contracts for the International Sale of Goods will not apply. If you reside (or your principal place of business is) within the United States, you and Unity agree to submit to the personal and exclusive jurisdiction of and venue in the state and federal courts located in San Francisco County, California concerning any dispute arising out of this License (“Dispute”). If you reside (or your principal place of business is) outside the United States, you and Unity agree to submit to the personal and exclusive jurisdiction of and venue in the courts located in Copenhagen, Denmark concerning any Dispute. \ No newline at end of file +Licensed under the Unity Companion License for Unity-dependent projects (see https://unity3d.com/legal/licenses/unity_companion_license). +Unless expressly provided otherwise, the Software under this license is made available strictly on an “AS IS” BASIS WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. Please review the license for details on these and other terms and conditions. \ No newline at end of file diff --git a/src/Tests.meta b/src/Tests.meta new file mode 100644 index 00000000..d34a2374 --- /dev/null +++ b/src/Tests.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e3503cbca3a6645cb8298d5cecf03cec +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Properties.meta b/src/Tests/Properties.meta new file mode 100644 index 00000000..66de0404 --- /dev/null +++ b/src/Tests/Properties.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 749a3b666b115be46b00490e7232fb1b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics.Tests/Properties/AssemblyInfo.cs b/src/Tests/Properties/AssemblyInfo.cs similarity index 90% rename from src/Unity.Mathematics.Tests/Properties/AssemblyInfo.cs rename to src/Tests/Properties/AssemblyInfo.cs index 7334e024..b4fed52a 100644 --- a/src/Unity.Mathematics.Tests/Properties/AssemblyInfo.cs +++ b/src/Tests/Properties/AssemblyInfo.cs @@ -1,8 +1,9 @@ -using System.Reflection; +#if !UNITY_DOTSPLAYER +using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Unity.Mathematics.Tests")] @@ -14,8 +15,8 @@ [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] @@ -25,12 +26,13 @@ // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // -// You can specify all the values or you can default the Build and Revision Numbers +// You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] +#endif \ No newline at end of file diff --git a/src/Unity.Mathematics.Tests/TestBool2.cs.meta b/src/Tests/Properties/AssemblyInfo.cs.meta similarity index 83% rename from src/Unity.Mathematics.Tests/TestBool2.cs.meta rename to src/Tests/Properties/AssemblyInfo.cs.meta index 040d1362..9ee864fc 100644 --- a/src/Unity.Mathematics.Tests/TestBool2.cs.meta +++ b/src/Tests/Properties/AssemblyInfo.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 16eda9d1f74e73044b0f7a65964db4eb +guid: 3addb854f833b56428975a1966f78424 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/src/Tests/TestCompilerAttribute.cs b/src/Tests/TestCompilerAttribute.cs new file mode 100644 index 00000000..c947e6ec --- /dev/null +++ b/src/Tests/TestCompilerAttribute.cs @@ -0,0 +1,19 @@ +using System; +using NUnit.Framework; +using NUnit.Framework.Interfaces; + +namespace Burst.Compiler.IL.Tests +{ + [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] + public class WindowsOnlyAttribute : Attribute + { + public WindowsOnlyAttribute(string reason) + { + } + } + + [AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = false)] + public sealed class TestCompilerAttribute : TestCaseAttribute, ITestBuilder + { + } +} diff --git a/src/Unity.Mathematics.Tests/TestBool3.cs.meta b/src/Tests/TestCompilerAttribute.cs.meta similarity index 83% rename from src/Unity.Mathematics.Tests/TestBool3.cs.meta rename to src/Tests/TestCompilerAttribute.cs.meta index 88abbd87..48e087e1 100644 --- a/src/Unity.Mathematics.Tests/TestBool3.cs.meta +++ b/src/Tests/TestCompilerAttribute.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: c9b58e9f68e180f4f9c3d05bc60bc20f +guid: 5b16d5a4bfd93114385ecd01f00a6914 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/src/Tests/Tests.meta b/src/Tests/Tests.meta new file mode 100644 index 00000000..a145b33d --- /dev/null +++ b/src/Tests/Tests.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bccfda2dc5ad3b84eb3a644147ea0010 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared.meta b/src/Tests/Tests/Shared.meta new file mode 100644 index 00000000..10cf1f26 --- /dev/null +++ b/src/Tests/Tests/Shared.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1d6d62c94d82bf748b95682fa88ef3b9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestAffineTransform.cs b/src/Tests/Tests/Shared/TestAffineTransform.cs new file mode 100644 index 00000000..b663fd65 --- /dev/null +++ b/src/Tests/Tests/Shared/TestAffineTransform.cs @@ -0,0 +1,173 @@ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + class TestAffineTransform + { + [TestCompiler] + public static void affine_transform_construct_from_float3x3() + { + const float tolerance = 1e-6f; + + float3x3 m3x3 = TestMatrix.test3x3_zyx; + AffineTransform tx = AffineTransform(m3x3); + + float3x3 testM3x3 = float3x3(tx); + + TestUtils.AreEqual(m3x3, testM3x3, tolerance); + } + + [TestCompiler] + public static void affine_transform_construct_from_float3x4() + { + const float tolerance = 1e-6f; + + float3x4 m3x4 = float3x4(TestMatrix.test3x3_zyx.c0, TestMatrix.test3x3_zyx.c1, TestMatrix.test3x3_zyx.c2, float3(1f, 2f, 3f)); + AffineTransform tx = AffineTransform(m3x4); + + float3x4 testM3x4 = float3x4(tx); + + TestUtils.AreEqual(m3x4, testM3x4, tolerance); + } + + [TestCompiler] + public static void affine_transform_construct_from_float4x4() + { + const float tolerance = 1e-6f; + + float4x4 m4x4 = TestMatrix.test4x4_zyx; + AffineTransform tx = AffineTransform(m4x4); + + float4x4 testM4x4 = float4x4(tx); + + TestUtils.AreEqual(m4x4, testM4x4, tolerance); + } + + [TestCompiler] + public static void affine_transform_construct_from_RigidTransform() + { + const float tolerance = 1e-6f; + + RigidTransform r = RigidTransform(TestMatrix.test4x4_xyz); + AffineTransform tx = AffineTransform(r); + + TestUtils.AreEqual(math.float3x3(r.rot), tx.rs, tolerance); + TestUtils.AreEqual(r.pos, tx.t, tolerance); + } + + [TestCompiler] + public static void affine_transform_inverse() + { + const float tolerance = 1e-6f; + + var tx = AffineTransform(float3(5f, 6f, 7f), normalize(math.float4(1f, 2f, 3f, 4f)), float3(2f, 3f, 4f)); + var invTx = inverse(tx); + + TestUtils.AreEqual(float4x4.identity, mul(tx, invTx), tolerance); + } + + [TestCompiler] + public static void affine_transform_inverse_zero_rs_returns_zero() + { + const float tolerance = 1e-30f; + + var tx = AffineTransform(float3(5f, 6f, 7f), normalize(float4(1f, 2f, 3f, 4f)), float3.zero); + var invTx = inverse(tx); + + TestUtils.AreEqual(float3x4.zero, invTx, tolerance); + } + + [TestCompiler] + public static void affine_transform_inverse_pico_scale() + { + // slightly larger tolerance (vs 1e-6f) for PS4 + const float tolerance = 2e-6f; + + var tx = AffineTransform(float3(5f, 6f, 7f), normalize(float4(1f, 2f, 3f, 4f)), float3(1e-12f, 1e-12f, 1e-12f)); + var invTx = inverse(tx); + + TestUtils.AreEqual(float4x4.identity, mul(tx, invTx), tolerance); + } + + [TestCompiler] + public static void affine_transform_inverse_singular() + { + // it needs a bit larger tolerance for singular + // since it uses the svd iterative solver + const float tolerance = 1e-1f; + + var tx = AffineTransform(float3(5f, 6f, 7f), normalize(float4(1f, 2f, 3f, 4f)), float3(0f, 3f, 4f)); + var invTx = inverse(tx); + + // pseudo inverse penrose #1 test + var testTx = mul(mul(tx, invTx), tx); + TestUtils.AreEqual(float4x4(tx), float4x4(testTx), tolerance); + } + + [TestCompiler] + public static void affine_transform_decompose() + { + const float tolerance = 1e-6f; + + var tx = AffineTransform(float3(5f, 6f, 7f), normalize(float4(1f, 2f, 3f, 4f)), float3(2f, 3f, 4f)); + decompose(tx, out var t, out var r, out var s); + + // Recompose matrix + var testTx = AffineTransform(t, r, s); + TestUtils.AreEqual(float4x4(tx), float4x4(testTx), tolerance); + } + + [TestCompiler] + public static void affine_transform_mul_vector() + { + float4x4 m = TestMatrix.test4x4_xyz; + AffineTransform tx = AffineTransform(m); + + float3 vector = float3(1.1f, -2.2f, 3.5f); + + float4 mvector0 = mul(m, float4(vector, 0f)); + float4 txvector0 = mul(tx, float4(vector, 0f)); + TestUtils.AreEqual(mvector0, txvector0, 0.0001f); + + float4 mvector1 = mul(m, float4(vector, 1f)); + float4 txvector1 = mul(tx, float4(vector, 1f)); + TestUtils.AreEqual(mvector1, txvector1, 0.0001f); + } + + [TestCompiler] + public static void affine_transform_rotate_vector() + { + float3x3 m = TestMatrix.test3x3_xyz; + AffineTransform tx = AffineTransform(m); + + float3 vector = float3(1.1f, -2.2f, 3.5f); + + float3 mvector0 = mul(m, vector); + float3 txvector0 = rotate(tx, vector); + TestUtils.AreEqual(mvector0, txvector0, 0.0001f); + } + + [TestCompiler] + public static void affine_transform_transform_point() + { + float4x4 m = float4x4(TestMatrix.test3x3_zyx, float3(1f, 2f, 3f)); + AffineTransform tx = AffineTransform(m); + + float3 pt = float3(1.1f, -2.2f, 3.5f); + + float3 mPt0 = transform(m, pt); + float3 txPt0 = transform(tx, pt); + TestUtils.AreEqual(mPt0, txPt0, 0.0001f); + } + + [TestCompiler] + public static void affine_transform_zero() + { + TestUtils.AreEqual(float3x3.zero, AffineTransform.zero.rs); + TestUtils.AreEqual(float3.zero, AffineTransform.zero.t); + } + } +} diff --git a/src/Unity.Mathematics.Tests/TestBool1.cs.meta b/src/Tests/Tests/Shared/TestAffineTransform.cs.meta similarity index 83% rename from src/Unity.Mathematics.Tests/TestBool1.cs.meta rename to src/Tests/Tests/Shared/TestAffineTransform.cs.meta index 9ca32d2f..01d27e82 100644 --- a/src/Unity.Mathematics.Tests/TestBool1.cs.meta +++ b/src/Tests/Tests/Shared/TestAffineTransform.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 8810c9cc2e89190479e291a13c8e8d9b +guid: 534e18de5e70ccf468bf46c917dfdac4 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/src/Tests/Tests/Shared/TestBitmanipulation.cs b/src/Tests/Tests/Shared/TestBitmanipulation.cs new file mode 100644 index 00000000..517d8d67 --- /dev/null +++ b/src/Tests/Tests/Shared/TestBitmanipulation.cs @@ -0,0 +1,547 @@ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestBitmanipulation + { + [TestCompiler] + public static void bitmask_bool4() + { + TestUtils.AreEqual(bitmask(new bool4(false, false, false, false)), 0b0000); + TestUtils.AreEqual(bitmask(new bool4(true, false, false, false)), 0b0001); + TestUtils.AreEqual(bitmask(new bool4(false, true, false, false)), 0b0010); + TestUtils.AreEqual(bitmask(new bool4(false, false, true, false)), 0b0100); + TestUtils.AreEqual(bitmask(new bool4(false, false, false, true)), 0b1000); + + TestUtils.AreEqual(bitmask(new bool4(true, true, true, true)), 0b1111); + TestUtils.AreEqual(bitmask(new bool4(false, true, true, true)), 0b1110); + TestUtils.AreEqual(bitmask(new bool4(true, false, true, true)), 0b1101); + TestUtils.AreEqual(bitmask(new bool4(true, true, false, true)), 0b1011); + TestUtils.AreEqual(bitmask(new bool4(true, true, true, false)), 0b0111); + } + + [TestCompiler] + public static void countbits_int1() + { + TestUtils.AreEqual(12, countbits( 0x01234567)); + TestUtils.AreEqual(16, countbits( 0x456789AB)); + TestUtils.AreEqual(21, countbits(-0x01234567)); + TestUtils.AreEqual(17, countbits(-0x456789AB)); + TestUtils.AreEqual(32, countbits(-1)); + } + + [TestCompiler] + public static void countbits_int2() + { + TestUtils.AreEqual(int2(0, 12), countbits(int2(0, 0x01234567))); + TestUtils.AreEqual(int2(16, 21), countbits(int2(0x456789AB, -0x01234567))); + TestUtils.AreEqual(int2(17, 32), countbits(int2(-0x456789AB, -1))); + } + + [TestCompiler] + public static void countbits_int3() + { + TestUtils.AreEqual(int3(0, 12, 16), countbits(int3(0, 0x01234567, 0x456789AB))); + TestUtils.AreEqual(int3(21, 17, 32), countbits(int3(-0x01234567, -0x456789AB, -1))); + } + + [TestCompiler] + public static void countbits_int4() + { + TestUtils.AreEqual(int4(0, 12, 16, 21), countbits(int4(0, 0x01234567, 0x456789AB, -0x01234567))); + TestUtils.AreEqual(int4(17, 32, 30, 29), countbits(int4(-0x456789AB, -1, -7, -15))); + } + + [TestCompiler] + public static void countbits_uint() + { + TestUtils.AreEqual(0, countbits(0u)); + TestUtils.AreEqual(12, countbits(0x01234567u)); + TestUtils.AreEqual(16, countbits(0x456789ABu)); + TestUtils.AreEqual(20, countbits(0x89ABCDEFu)); + TestUtils.AreEqual(16, countbits(0xCDEF0123u)); + TestUtils.AreEqual(32, countbits(0xFFFFFFFFu)); + } + + [TestCompiler] + public static void countbits_uint2() + { + TestUtils.AreEqual(int2(0, 12), countbits(uint2(0, 0x01234567))); + TestUtils.AreEqual(int2(16, 20), countbits(uint2(0x456789AB, 0x89ABCDEFu))); + TestUtils.AreEqual(int2(16, 32), countbits(uint2(0xCDEF0123u, 0xFFFFFFFFu))); + } + + [TestCompiler] + public static void countbits_uint3() + { + TestUtils.AreEqual(int3(0, 12, 16), countbits(uint3(0, 0x01234567, 0x456789AB))); + TestUtils.AreEqual(int3(20, 16, 32), countbits(uint3(0x89ABCDEFu, 0xCDEF0123u, 0xFFFFFFFFu))); + } + + [TestCompiler] + public static void countbits_uint4() + { + TestUtils.AreEqual(int4(0, 12, 16, 20), countbits(uint4(0, 0x01234567, 0x456789AB, 0x89ABCDEFu))); + TestUtils.AreEqual(int4(16, 32, 30, 29), countbits(uint4(0xCDEF0123u, 0xFFFFFFFFu, 0xFFFFFFF5u, 0xFFFFFFF1u))); + } + + [TestCompiler] + public static void countbits_long() + { + TestUtils.AreEqual(0, countbits(0L)); + TestUtils.AreEqual(32, countbits(0x0123456789ABCDEFL)); + TestUtils.AreEqual(33, countbits(-0x0123456789ABCDEFL)); + TestUtils.AreEqual(64, countbits(-1L)); + } + + [TestCompiler] + public static void countbits_ulong() + { + TestUtils.AreEqual(0, countbits(0UL)); + TestUtils.AreEqual(32, countbits(0x0123456789ABCDEFUL)); + TestUtils.AreEqual(32, countbits(0x89ABCDEF01234567UL)); + TestUtils.AreEqual(64, countbits(0xFFFFFFFFFFFFFFFFUL)); + } + + [TestCompiler] + public static void lzcnt_int() + { + TestUtils.AreEqual(32, lzcnt(0)); + TestUtils.AreEqual(31, lzcnt(1)); + TestUtils.AreEqual(30, lzcnt(2)); + TestUtils.AreEqual(30, lzcnt(3)); + TestUtils.AreEqual(17, lzcnt(0x5321)); + TestUtils.AreEqual(5, lzcnt(0x04435321)); + TestUtils.AreEqual(0, lzcnt(-1)); + TestUtils.AreEqual(0, lzcnt(-2147483648)); + } + + [TestCompiler] + public static void lzcnt_int2() + { + TestUtils.AreEqual(int2(32, 31), lzcnt(int2(0, 1))); + TestUtils.AreEqual(int2(30, 30), lzcnt(int2(2, 3))); + TestUtils.AreEqual(int2(17, 5), lzcnt(int2(0x5321, 0x04435321))); + TestUtils.AreEqual(int2(0, 0), lzcnt(int2(-1, -2147483648))); + } + + [TestCompiler] + public static void lzcnt_int3() + { + TestUtils.AreEqual(int3(32, 31, 30), lzcnt(int3(0, 1, 2))); + TestUtils.AreEqual(int3(30, 17, 5), lzcnt(int3(3, 0x5321, 0x04435321))); + TestUtils.AreEqual(int3(0, 0, 27), lzcnt(int3(-1, -2147483648, 17))); + } + + [TestCompiler] + public static void lzcnt_int4() + { + TestUtils.AreEqual(int4(32, 31, 30, 30), lzcnt(int4(0, 1, 2, 3))); + TestUtils.AreEqual(int4(17, 5, 0, 0), lzcnt(int4(0x5321, 0x04435321, -1, -2147483648))); + } + + [TestCompiler] + public static void lzcnt_uint() + { + TestUtils.AreEqual(32, lzcnt(0u)); + TestUtils.AreEqual(31, lzcnt(1u)); + TestUtils.AreEqual(30, lzcnt(2u)); + TestUtils.AreEqual(30, lzcnt(3u)); + TestUtils.AreEqual(17, lzcnt(0x5321u)); + TestUtils.AreEqual(5, lzcnt(0x04435321u)); + TestUtils.AreEqual(0, lzcnt(0x84435320u)); + TestUtils.AreEqual(0, lzcnt(0xFFFFFFFFu)); + } + + [TestCompiler] + public static void lzcnt_uint2() + { + TestUtils.AreEqual(int2(32, 31), lzcnt(uint2(0u, 1u))); + TestUtils.AreEqual(int2(30, 30), lzcnt(uint2(2u, 3u))); + TestUtils.AreEqual(int2(17, 5), lzcnt(uint2(0x5321u, 0x04435321u))); + TestUtils.AreEqual(int2(0, 0), lzcnt(uint2(0x84435320u, 0xFFFFFFFFu))); + } + + [TestCompiler] + public static void lzcnt_uint3() + { + TestUtils.AreEqual(int3(32, 31, 30), lzcnt(uint3(0u, 1u, 2u))); + TestUtils.AreEqual(int3(30, 17, 5), lzcnt(uint3(3u, 0x5321u, 0x04435321u))); + TestUtils.AreEqual(int3(0, 0, 27), lzcnt(uint3(0x84435320u, 0xFFFFFFFFu, 17))); + } + + [TestCompiler] + public static void lzcnt_uint4() + { + TestUtils.AreEqual(int2(32, 31), lzcnt(uint2(0u, 1u))); + TestUtils.AreEqual(int2(30, 30), lzcnt(uint2(2u, 3u))); + TestUtils.AreEqual(int2(17, 5), lzcnt(uint2(0x5321u, 0x04435321u))); + TestUtils.AreEqual(int2(0, 0), lzcnt(uint2(0x84435320u, 0xFFFFFFFFu))); + } + + [TestCompiler] + public static void lzcnt_long() + { + TestUtils.AreEqual(64, lzcnt(0L)); + TestUtils.AreEqual(63, lzcnt(1L)); + TestUtils.AreEqual(35, lzcnt(0x1FFF1234L)); + TestUtils.AreEqual(31, lzcnt(0x1FFFF1234L)); + TestUtils.AreEqual(19, lzcnt(0x1FFFFFFF1234L)); + TestUtils.AreEqual(0, lzcnt(-1L)); + TestUtils.AreEqual(0, lzcnt(-9223372036854775808L)); + } + + [TestCompiler] + public static void lzcnt_ulong() + { + TestUtils.AreEqual(64, lzcnt(0UL)); + TestUtils.AreEqual(63, lzcnt(1UL)); + TestUtils.AreEqual(35, lzcnt(0x1FFF1234UL)); + TestUtils.AreEqual(31, lzcnt(0x1FFFF1234UL)); + TestUtils.AreEqual(19, lzcnt(0x1FFFFFFF1234UL)); + TestUtils.AreEqual(0, lzcnt(0xFFFFFFFFFFFFFFFFUL)); + TestUtils.AreEqual(0, lzcnt(0x8000000000000000UL)); + } + + [TestCompiler] + public static void tzcnt_int() + { + TestUtils.AreEqual(32, tzcnt(0)); + TestUtils.AreEqual(0, tzcnt(1)); + TestUtils.AreEqual(1, tzcnt(2)); + TestUtils.AreEqual(0, tzcnt(3)); + TestUtils.AreEqual(4, tzcnt(0x53210)); + TestUtils.AreEqual(17, tzcnt(0x44420000)); + TestUtils.AreEqual(1, tzcnt(-2)); + TestUtils.AreEqual(0, tzcnt(-2147483647)); + TestUtils.AreEqual(31, tzcnt(-2147483648)); + } + + [TestCompiler] + public static void tzcnt_int2() + { + TestUtils.AreEqual(int2(32, 0), tzcnt(int2(0, 1))); + TestUtils.AreEqual(int2(1, 0), tzcnt(int2(2, 3))); + TestUtils.AreEqual(int2(4, 17), tzcnt(int2(0x53210, 0x44420000))); + TestUtils.AreEqual(int2(1, 0), tzcnt(int2(-2, -2147483647))); + TestUtils.AreEqual(int2(31, 2), tzcnt(int2(-2147483648, 20))); + } + + [TestCompiler] + public static void tzcnt_int3() + { + TestUtils.AreEqual(int3(32, 0, 1), tzcnt(int3(0, 1, 2))); + TestUtils.AreEqual(int3(0, 4, 17), tzcnt(int3(3, 0x53210, 0x44420000))); + TestUtils.AreEqual(int3(1, 0, 31), tzcnt(int3(-2, -2147483647, -2147483648))); + } + + [TestCompiler] + public static void tzcnt_int4() + { + TestUtils.AreEqual(int4(32, 0, 1, 0), tzcnt(int4(0, 1, 2, 3))); + TestUtils.AreEqual(int4(4, 17, 1, 0), tzcnt(int4(0x53210, 0x44420000, -2, -2147483647))); + TestUtils.AreEqual(int4(31, 2, 2, 3), tzcnt(int4(-2147483648, 20, 4132, -8))); + } + + [TestCompiler] + public static void tzcnt_uint() + { + TestUtils.AreEqual(32, tzcnt(0u)); + TestUtils.AreEqual(0, tzcnt(1u)); + TestUtils.AreEqual(1, tzcnt(2u)); + TestUtils.AreEqual(0, tzcnt(3u)); + TestUtils.AreEqual(4, tzcnt(0x53210u)); + TestUtils.AreEqual(17, tzcnt(0x44420000u)); + TestUtils.AreEqual(1, tzcnt(0xFFFFFFFEu)); + TestUtils.AreEqual(0, tzcnt(0x80000001u)); + TestUtils.AreEqual(31, tzcnt(0x80000000u)); + } + + [TestCompiler] + public static void tzcnt_uint2() + { + TestUtils.AreEqual(int2(32, 0), tzcnt(uint2(0u, 1u))); + TestUtils.AreEqual(int2(1, 0), tzcnt(uint2(2u, 3u))); + TestUtils.AreEqual(int2(4, 17), tzcnt(uint2(0x53210u, 0x44420000u))); + TestUtils.AreEqual(int2(1, 0), tzcnt(uint2(0xFFFFFFFEu, 0x80000001u))); + TestUtils.AreEqual(int2(31, 2), tzcnt(uint2(0x80000000u, 20u))); + } + + [TestCompiler] + public static void tzcnt_uint3() + { + TestUtils.AreEqual(int3(32, 0, 1), tzcnt(uint3(0u, 1u, 2u))); + TestUtils.AreEqual(int3(0, 4, 17), tzcnt(uint3(3u, 0x53210u, 0x44420000u))); + TestUtils.AreEqual(int3(1, 0, 31), tzcnt(uint3(0xFFFFFFFEu, 0x80000001u, 0x80000000u))); + } + + [TestCompiler] + public static void tzcnt_uint4() + { + TestUtils.AreEqual(int4(32, 0, 1, 0), tzcnt(uint4(0u, 1u, 2u, 3u))); + TestUtils.AreEqual(int4(4, 17, 1, 0), tzcnt(uint4(0x53210u, 0x44420000u, 0xFFFFFFFE, 0x80000001u))); + TestUtils.AreEqual(int4(31, 2, 2, 3), tzcnt(uint4(0x80000000u, 20u, 4132u, 0xFFFFFFF8u))); + } + + [TestCompiler] + public static void tzcnt_long() + { + TestUtils.AreEqual(64, tzcnt(0L)); + TestUtils.AreEqual(0, tzcnt(1L)); + TestUtils.AreEqual(1, tzcnt(2L)); + TestUtils.AreEqual(17, tzcnt(0x44420000L)); + TestUtils.AreEqual(33, tzcnt(0x444200000000L)); + TestUtils.AreEqual(63, tzcnt(-9223372036854775808L)); + TestUtils.AreEqual(0, tzcnt(-9223372036854775807L)); + } + + [TestCompiler] + public static void tzcnt_ulong() + { + TestUtils.AreEqual(64, tzcnt(0UL)); + TestUtils.AreEqual(0, tzcnt(1UL)); + TestUtils.AreEqual(1, tzcnt(2UL)); + TestUtils.AreEqual(17, tzcnt(0x44420000UL)); + TestUtils.AreEqual(33, tzcnt(0x444200000000UL)); + TestUtils.AreEqual(63, tzcnt(0x8000000000000000UL)); + TestUtils.AreEqual(0, tzcnt(0x8000000000000001UL)); + } + + [TestCompiler] + public static void reversebits_int() + { + TestUtils.AreEqual(0x03521609, reversebits(-1872213312)); + TestUtils.AreEqual(0x5f5b0648, reversebits(0x1260dafa)); + TestUtils.AreEqual(0x4bbafd8d, reversebits(-1312858670)); + TestUtils.AreEqual(0x48d9c42e, reversebits(0x74239b12)); + } + + [TestCompiler] + public static void reversebits_int2() + { + TestUtils.AreEqual(int2(0x03521609, 0x5f5b0648), reversebits(int2(-1872213312, 0x1260dafa))); + TestUtils.AreEqual(int2(0x4bbafd8d, 0x48d9c42e), reversebits(int2(-1312858670, 0x74239b12))); + } + + [TestCompiler] + public static void reversebits_int3() + { + TestUtils.AreEqual(int3(0x03521609, 0x5f5b0648, 0x4bbafd8d), reversebits(int3(-1872213312, 0x1260dafa, -1312858670))); + TestUtils.AreEqual(int3(0x48d9c42e, 0, -1), reversebits(int3(0x74239b12, 0, -1))); + } + + [TestCompiler] + public static void reversebits_int4() + { + TestUtils.AreEqual(int4(0x03521609, 0x5f5b0648, 0x4bbafd8d, 0x48d9c42e), reversebits(int4(-1872213312, 0x1260dafa, -1312858670, 0x74239b12))); + } + + [TestCompiler] + public static void reversebits_uint() + { + TestUtils.AreEqual(0x03521609u, reversebits(0x90684ac0u)); + TestUtils.AreEqual(0x5f5b0648u, reversebits(0x1260dafau)); + TestUtils.AreEqual(0x4bbafd8du, reversebits(0xb1bf5dd2u)); + TestUtils.AreEqual(0x48d9c42eu, reversebits(0x74239b12u)); + } + + [TestCompiler] + public static void reversebits_uint2() + { + TestUtils.AreEqual(uint2(0x03521609u, 0x5f5b0648u), reversebits(uint2(0x90684ac0u, 0x1260dafau))); + TestUtils.AreEqual(uint2(0x4bbafd8du, 0x48d9c42eu), reversebits(uint2(0xb1bf5dd2u, 0x74239b12u))); + } + + [TestCompiler] + public static void reversebits_uint3() + { + TestUtils.AreEqual(uint3(0x03521609u, 0x5f5b0648u, 0x4bbafd8du), reversebits(uint3(0x90684ac0u, 0x1260dafau, 0xb1bf5dd2u))); + TestUtils.AreEqual(uint3(0x48d9c42eu, 0u, 0xFFFFFFFF), reversebits(uint3(0x74239b12u, 0u, 0xFFFFFFFF))); + } + + [TestCompiler] + public static void reversebits_uint4() + { + TestUtils.AreEqual(uint4(0x03521609u, 0x5f5b0648u, 0x4bbafd8du, 0x48d9c42eu), reversebits(uint4(0x90684ac0u, 0x1260dafau, 0xb1bf5dd2u, 0x74239b12u))); + } + + [TestCompiler] + public static void reversebits_long() + { + TestUtils.AreEqual(0x4bbafd8d5f5b0648L, reversebits(0x1260dafab1bf5dd2L)); + } + + [TestCompiler] + public static void reversebits_ulong() + { + TestUtils.AreEqual(0x4bbafd8d5f5b0648ul, reversebits(0x1260dafab1bf5dd2ul)); + } + + [TestCompiler] + public static void rol_int() + { + TestUtils.AreEqual(-1933184920, rol(219257022, 11)); + TestUtils.AreEqual(-2048170741, rol(-1586446996, 11)); + TestUtils.AreEqual(-1152739462, rol(-279484078, 11)); + TestUtils.AreEqual(661621977, rol(-1692078607, 11)); + } + + [TestCompiler] + public static void rol_int2() + { + TestUtils.AreEqual(int2(-1933184920, -2048170741), rol(int2(219257022, -1586446996), 11)); + TestUtils.AreEqual(int2(-1152739462, 661621977), rol(int2(-279484078, -1692078607), 11)); + } + + [TestCompiler] + public static void rol_int3() + { + TestUtils.AreEqual(int3(-1933184920, -2048170741, -1152739462), rol(int3(219257022, -1586446996, -279484078), 11)); + } + + + [TestCompiler] + public static void rol_int4() + { + TestUtils.AreEqual(int4(-1933184920, -2048170741, -1152739462, 661621977), rol(int4(219257022, -1586446996, -279484078, -1692078607), 11)); + } + + [TestCompiler] + public static void rol_uint() + { + TestUtils.AreEqual(2361782376u, rol(219257022u, 11)); + TestUtils.AreEqual(2246796555u, rol(2708520300u, 11)); + TestUtils.AreEqual(3142227834u, rol(4015483218u, 11)); + TestUtils.AreEqual(661621977u, rol(2602888689u, 11)); + } + + [TestCompiler] + public static void rol_uint2() + { + TestUtils.AreEqual(uint2(2361782376u, 2246796555u), rol(uint2(219257022u, 2708520300u), 11)); + TestUtils.AreEqual(uint2(3142227834u, 661621977u), rol(uint2(4015483218u, 2602888689u), 11)); + } + + [TestCompiler] + public static void rol_uint3() + { + TestUtils.AreEqual(uint3(2361782376u, 2246796555u, 3142227834u), rol(uint3(219257022u, 2708520300u, 4015483218u), 11)); + } + + [TestCompiler] + public static void rol_uint4() + { + TestUtils.AreEqual(uint4(2361782376u, 2246796555u, 3142227834u, 661621977u), rol(uint4(219257022u, 2708520300u, 4015483218u, 2602888689u), 11)); + } + + + [TestCompiler] + public static void rol_long() + { + TestUtils.AreEqual(4769317691753349395L, rol(6894885722123239465L, 37)); + TestUtils.AreEqual(7702732954299909421L, rol(9017875690541231318L, 37)); + TestUtils.AreEqual(4304137451269976409L, rol(-6252342588442027279L, 37)); + TestUtils.AreEqual(-5493728106787075631L, rol(2788577329702376155L, 37)); + } + + [TestCompiler] + public static void rol_ulong() + { + TestUtils.AreEqual(4769317691753349395UL, rol(6894885722123239465UL, 37)); + TestUtils.AreEqual(7702732954299909421UL, rol(9017875690541231318UL, 37)); + TestUtils.AreEqual(4304137451269976409UL, rol(12194401485267524337UL, 37)); + TestUtils.AreEqual(12953015966922475985UL, rol(2788577329702376155UL, 37)); + } + + + [TestCompiler] + public static void ror_int() + { + TestUtils.AreEqual(87245360, ror(-1710129111, 11)); + TestUtils.AreEqual(-259445220, ror(1232136068, 11)); + TestUtils.AreEqual(-1697813787, ror(1800875222, 11)); + TestUtils.AreEqual(-232831845, ror(-98246768, 11)); + } + + [TestCompiler] + public static void ror_int2() + { + TestUtils.AreEqual(int2(87245360, -259445220), ror(int2(-1710129111, 1232136068), 11)); + TestUtils.AreEqual(int2(-1697813787, -232831845), ror(int2(1800875222, -98246768), 11)); + } + + [TestCompiler] + public static void ror_int3() + { + TestUtils.AreEqual(int3(87245360, -259445220, -1697813787), ror(int3(-1710129111, 1232136068, 1800875222), 11)); + } + + [TestCompiler] + public static void ror_int4() + { + TestUtils.AreEqual(int4(87245360, -259445220, -1697813787, -232831845), ror(int4(-1710129111, 1232136068, 1800875222, -98246768), 11)); + } + + + [TestCompiler] + public static void ror_uint() + { + TestUtils.AreEqual(87245360u, ror(2584838185u, 11)); + TestUtils.AreEqual(4035522076u, ror(1232136068u, 11)); + TestUtils.AreEqual(2597153509u, ror(1800875222u, 11)); + TestUtils.AreEqual(4062135451u, ror(4196720528u, 11)); + } + + [TestCompiler] + public static void ror_uint2() + { + TestUtils.AreEqual(uint2(87245360u, 4035522076u), ror(uint2(2584838185u, 1232136068u), 11)); + TestUtils.AreEqual(uint2(2597153509u, 4062135451u), ror(uint2(1800875222u, 4196720528u), 11)); + } + + [TestCompiler] + public static void ror_uint3() + { + TestUtils.AreEqual(uint3(87245360u, 4035522076u, 2597153509u), ror(uint3(2584838185u, 1232136068u, 1800875222u), 11)); + } + + [TestCompiler] + public static void ror_uint4() + { + TestUtils.AreEqual(uint4(87245360u, 4035522076u, 2597153509u, 4062135451u), ror(uint4(2584838185u, 1232136068u, 1800875222u, 4196720528u), 11)); + } + + [TestCompiler] + public static void ror_long() + { + TestUtils.AreEqual(4958617126915898480L, ror(6894885722123239465L, 37)); + TestUtils.AreEqual(5429856151504760689L, ror(9017875690541231318L, 37)); + TestUtils.AreEqual(6219170745001040316L, ror(-6252342588442027279L, 37)); + TestUtils.AreEqual(8389344736564320290L, ror(2788577329702376155L, 37)); + } + + [TestCompiler] + public static void ror_ulong() + { + TestUtils.AreEqual(4958617126915898480UL, ror(6894885722123239465UL, 37)); + TestUtils.AreEqual(5429856151504760689UL, ror(9017875690541231318UL, 37)); + TestUtils.AreEqual(6219170745001040316UL, ror(12194401485267524337UL, 37)); + TestUtils.AreEqual(8389344736564320290UL, ror(2788577329702376155UL, 37)); + } + + + } + + + class Assert2 + { + public static void AreEqual(object a, object b) + { + + } + } + +} diff --git a/src/Unity.Mathematics.Tests/TestBool4.cs.meta b/src/Tests/Tests/Shared/TestBitmanipulation.cs.meta similarity index 83% rename from src/Unity.Mathematics.Tests/TestBool4.cs.meta rename to src/Tests/Tests/Shared/TestBitmanipulation.cs.meta index 06a7f0c2..458cb420 100644 --- a/src/Unity.Mathematics.Tests/TestBool4.cs.meta +++ b/src/Tests/Tests/Shared/TestBitmanipulation.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: fa8d54b5e0ff5514d892ffcd4950b893 +guid: e5e8e2bd97f047f4aa27c8449c8844a2 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/src/Tests/Tests/Shared/TestBool2.gen.cs b/src/Tests/Tests/Shared/TestBool2.gen.cs new file mode 100644 index 00000000..11c32ff2 --- /dev/null +++ b/src/Tests/Tests/Shared/TestBool2.gen.cs @@ -0,0 +1,439 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestBool2 + { + [TestCompiler] + public static void bool2_constructor() + { + bool2 a = new bool2(false, true); + TestUtils.AreEqual(false, a.x); + TestUtils.AreEqual(true, a.y); + } + + [TestCompiler] + public static void bool2_scalar_constructor() + { + bool2 a = new bool2(true); + TestUtils.AreEqual(true, a.x); + TestUtils.AreEqual(true, a.y); + } + + [TestCompiler] + public static void bool2_static_constructor() + { + bool2 a = bool2(false, true); + TestUtils.AreEqual(false, a.x); + TestUtils.AreEqual(true, a.y); + } + + [TestCompiler] + public static void bool2_static_scalar_constructor() + { + bool2 a = bool2(true); + TestUtils.AreEqual(true, a.x); + TestUtils.AreEqual(true, a.y); + } + + [TestCompiler] + public static void bool2_operator_equal_wide_wide() + { + bool2 a0 = bool2(true, false); + bool2 b0 = bool2(true, false); + bool2 r0 = bool2(true, true); + TestUtils.AreEqual(r0, a0 == b0); + + bool2 a1 = bool2(true, false); + bool2 b1 = bool2(false, false); + bool2 r1 = bool2(false, true); + TestUtils.AreEqual(r1, a1 == b1); + + bool2 a2 = bool2(false, true); + bool2 b2 = bool2(true, false); + bool2 r2 = bool2(false, false); + TestUtils.AreEqual(r2, a2 == b2); + + bool2 a3 = bool2(false, false); + bool2 b3 = bool2(false, true); + bool2 r3 = bool2(true, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void bool2_operator_equal_wide_scalar() + { + bool2 a0 = bool2(false, true); + bool b0 = (true); + bool2 r0 = bool2(false, true); + TestUtils.AreEqual(r0, a0 == b0); + + bool2 a1 = bool2(false, false); + bool b1 = (false); + bool2 r1 = bool2(true, true); + TestUtils.AreEqual(r1, a1 == b1); + + bool2 a2 = bool2(false, false); + bool b2 = (true); + bool2 r2 = bool2(false, false); + TestUtils.AreEqual(r2, a2 == b2); + + bool2 a3 = bool2(false, true); + bool b3 = (false); + bool2 r3 = bool2(true, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void bool2_operator_equal_scalar_wide() + { + bool a0 = (false); + bool2 b0 = bool2(true, false); + bool2 r0 = bool2(false, true); + TestUtils.AreEqual(r0, a0 == b0); + + bool a1 = (true); + bool2 b1 = bool2(false, false); + bool2 r1 = bool2(false, false); + TestUtils.AreEqual(r1, a1 == b1); + + bool a2 = (true); + bool2 b2 = bool2(false, false); + bool2 r2 = bool2(false, false); + TestUtils.AreEqual(r2, a2 == b2); + + bool a3 = (true); + bool2 b3 = bool2(false, true); + bool2 r3 = bool2(false, true); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void bool2_operator_not_equal_wide_wide() + { + bool2 a0 = bool2(true, true); + bool2 b0 = bool2(true, false); + bool2 r0 = bool2(false, true); + TestUtils.AreEqual(r0, a0 != b0); + + bool2 a1 = bool2(true, false); + bool2 b1 = bool2(false, false); + bool2 r1 = bool2(true, false); + TestUtils.AreEqual(r1, a1 != b1); + + bool2 a2 = bool2(false, true); + bool2 b2 = bool2(true, false); + bool2 r2 = bool2(true, true); + TestUtils.AreEqual(r2, a2 != b2); + + bool2 a3 = bool2(false, false); + bool2 b3 = bool2(false, false); + bool2 r3 = bool2(false, false); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void bool2_operator_not_equal_wide_scalar() + { + bool2 a0 = bool2(false, true); + bool b0 = (false); + bool2 r0 = bool2(false, true); + TestUtils.AreEqual(r0, a0 != b0); + + bool2 a1 = bool2(false, true); + bool b1 = (true); + bool2 r1 = bool2(true, false); + TestUtils.AreEqual(r1, a1 != b1); + + bool2 a2 = bool2(false, false); + bool b2 = (false); + bool2 r2 = bool2(false, false); + TestUtils.AreEqual(r2, a2 != b2); + + bool2 a3 = bool2(false, false); + bool b3 = (false); + bool2 r3 = bool2(false, false); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void bool2_operator_not_equal_scalar_wide() + { + bool a0 = (true); + bool2 b0 = bool2(false, false); + bool2 r0 = bool2(true, true); + TestUtils.AreEqual(r0, a0 != b0); + + bool a1 = (true); + bool2 b1 = bool2(false, false); + bool2 r1 = bool2(true, true); + TestUtils.AreEqual(r1, a1 != b1); + + bool a2 = (false); + bool2 b2 = bool2(true, true); + bool2 r2 = bool2(true, true); + TestUtils.AreEqual(r2, a2 != b2); + + bool a3 = (true); + bool2 b3 = bool2(false, false); + bool2 r3 = bool2(true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void bool2_operator_bitwise_and_wide_wide() + { + bool2 a0 = bool2(false, false); + bool2 b0 = bool2(false, false); + bool2 r0 = bool2(false, false); + TestUtils.AreEqual(r0, a0 & b0); + + bool2 a1 = bool2(true, true); + bool2 b1 = bool2(true, false); + bool2 r1 = bool2(true, false); + TestUtils.AreEqual(r1, a1 & b1); + + bool2 a2 = bool2(false, false); + bool2 b2 = bool2(true, true); + bool2 r2 = bool2(false, false); + TestUtils.AreEqual(r2, a2 & b2); + + bool2 a3 = bool2(true, true); + bool2 b3 = bool2(false, false); + bool2 r3 = bool2(false, false); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void bool2_operator_bitwise_and_wide_scalar() + { + bool2 a0 = bool2(true, false); + bool b0 = (true); + bool2 r0 = bool2(true, false); + TestUtils.AreEqual(r0, a0 & b0); + + bool2 a1 = bool2(false, true); + bool b1 = (true); + bool2 r1 = bool2(false, true); + TestUtils.AreEqual(r1, a1 & b1); + + bool2 a2 = bool2(false, false); + bool b2 = (false); + bool2 r2 = bool2(false, false); + TestUtils.AreEqual(r2, a2 & b2); + + bool2 a3 = bool2(false, true); + bool b3 = (false); + bool2 r3 = bool2(false, false); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void bool2_operator_bitwise_and_scalar_wide() + { + bool a0 = (false); + bool2 b0 = bool2(false, false); + bool2 r0 = bool2(false, false); + TestUtils.AreEqual(r0, a0 & b0); + + bool a1 = (true); + bool2 b1 = bool2(true, true); + bool2 r1 = bool2(true, true); + TestUtils.AreEqual(r1, a1 & b1); + + bool a2 = (false); + bool2 b2 = bool2(true, false); + bool2 r2 = bool2(false, false); + TestUtils.AreEqual(r2, a2 & b2); + + bool a3 = (false); + bool2 b3 = bool2(false, true); + bool2 r3 = bool2(false, false); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void bool2_operator_bitwise_or_wide_wide() + { + bool2 a0 = bool2(true, true); + bool2 b0 = bool2(false, false); + bool2 r0 = bool2(true, true); + TestUtils.AreEqual(r0, a0 | b0); + + bool2 a1 = bool2(true, false); + bool2 b1 = bool2(false, false); + bool2 r1 = bool2(true, false); + TestUtils.AreEqual(r1, a1 | b1); + + bool2 a2 = bool2(true, false); + bool2 b2 = bool2(true, true); + bool2 r2 = bool2(true, true); + TestUtils.AreEqual(r2, a2 | b2); + + bool2 a3 = bool2(true, true); + bool2 b3 = bool2(true, false); + bool2 r3 = bool2(true, true); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void bool2_operator_bitwise_or_wide_scalar() + { + bool2 a0 = bool2(true, true); + bool b0 = (true); + bool2 r0 = bool2(true, true); + TestUtils.AreEqual(r0, a0 | b0); + + bool2 a1 = bool2(false, true); + bool b1 = (true); + bool2 r1 = bool2(true, true); + TestUtils.AreEqual(r1, a1 | b1); + + bool2 a2 = bool2(true, false); + bool b2 = (true); + bool2 r2 = bool2(true, true); + TestUtils.AreEqual(r2, a2 | b2); + + bool2 a3 = bool2(true, false); + bool b3 = (false); + bool2 r3 = bool2(true, false); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void bool2_operator_bitwise_or_scalar_wide() + { + bool a0 = (true); + bool2 b0 = bool2(true, true); + bool2 r0 = bool2(true, true); + TestUtils.AreEqual(r0, a0 | b0); + + bool a1 = (false); + bool2 b1 = bool2(false, true); + bool2 r1 = bool2(false, true); + TestUtils.AreEqual(r1, a1 | b1); + + bool a2 = (true); + bool2 b2 = bool2(true, false); + bool2 r2 = bool2(true, true); + TestUtils.AreEqual(r2, a2 | b2); + + bool a3 = (false); + bool2 b3 = bool2(true, true); + bool2 r3 = bool2(true, true); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void bool2_operator_bitwise_xor_wide_wide() + { + bool2 a0 = bool2(true, false); + bool2 b0 = bool2(true, true); + bool2 r0 = bool2(false, true); + TestUtils.AreEqual(r0, a0 ^ b0); + + bool2 a1 = bool2(false, true); + bool2 b1 = bool2(false, true); + bool2 r1 = bool2(false, false); + TestUtils.AreEqual(r1, a1 ^ b1); + + bool2 a2 = bool2(false, false); + bool2 b2 = bool2(false, true); + bool2 r2 = bool2(false, true); + TestUtils.AreEqual(r2, a2 ^ b2); + + bool2 a3 = bool2(false, true); + bool2 b3 = bool2(false, true); + bool2 r3 = bool2(false, false); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void bool2_operator_bitwise_xor_wide_scalar() + { + bool2 a0 = bool2(false, false); + bool b0 = (false); + bool2 r0 = bool2(false, false); + TestUtils.AreEqual(r0, a0 ^ b0); + + bool2 a1 = bool2(true, false); + bool b1 = (true); + bool2 r1 = bool2(false, true); + TestUtils.AreEqual(r1, a1 ^ b1); + + bool2 a2 = bool2(false, false); + bool b2 = (false); + bool2 r2 = bool2(false, false); + TestUtils.AreEqual(r2, a2 ^ b2); + + bool2 a3 = bool2(false, false); + bool b3 = (false); + bool2 r3 = bool2(false, false); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void bool2_operator_bitwise_xor_scalar_wide() + { + bool a0 = (true); + bool2 b0 = bool2(true, false); + bool2 r0 = bool2(false, true); + TestUtils.AreEqual(r0, a0 ^ b0); + + bool a1 = (true); + bool2 b1 = bool2(true, false); + bool2 r1 = bool2(false, true); + TestUtils.AreEqual(r1, a1 ^ b1); + + bool a2 = (true); + bool2 b2 = bool2(true, false); + bool2 r2 = bool2(false, true); + TestUtils.AreEqual(r2, a2 ^ b2); + + bool a3 = (false); + bool2 b3 = bool2(true, true); + bool2 r3 = bool2(true, true); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void bool2_operator_logical_not() + { + bool2 a0 = bool2(true, true); + bool2 r0 = bool2(false, false); + TestUtils.AreEqual(r0, !a0); + + bool2 a1 = bool2(false, true); + bool2 r1 = bool2(true, false); + TestUtils.AreEqual(r1, !a1); + + bool2 a2 = bool2(false, false); + bool2 r2 = bool2(true, true); + TestUtils.AreEqual(r2, !a2); + + bool2 a3 = bool2(true, false); + bool2 r3 = bool2(false, true); + TestUtils.AreEqual(r3, !a3); + } + + [TestCase /* For player builds */] + public static void bool2_EqualsObjectOverride() + { + TestUtils.IsFalse(new bool2().Equals((object)new int())); + TestUtils.IsTrue(new bool2().Equals((object)new bool2())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestBool2.gen.cs.meta b/src/Tests/Tests/Shared/TestBool2.gen.cs.meta new file mode 100644 index 00000000..19502cb8 --- /dev/null +++ b/src/Tests/Tests/Shared/TestBool2.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fc335ab357eef1346a23bc792570d94e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestBool2x2.gen.cs b/src/Tests/Tests/Shared/TestBool2x2.gen.cs new file mode 100644 index 00000000..1646031c --- /dev/null +++ b/src/Tests/Tests/Shared/TestBool2x2.gen.cs @@ -0,0 +1,407 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestBool2x2 + { + [TestCompiler] + public static void bool2x2_operator_equal_wide_wide() + { + bool2x2 a0 = bool2x2(true, false, true, false); + bool2x2 b0 = bool2x2(true, false, false, false); + bool2x2 r0 = bool2x2(true, true, false, true); + TestUtils.AreEqual(r0, a0 == b0); + + bool2x2 a1 = bool2x2(false, true, false, false); + bool2x2 b1 = bool2x2(true, false, false, true); + bool2x2 r1 = bool2x2(false, false, true, false); + TestUtils.AreEqual(r1, a1 == b1); + + bool2x2 a2 = bool2x2(true, false, true, false); + bool2x2 b2 = bool2x2(false, false, false, false); + bool2x2 r2 = bool2x2(false, true, false, true); + TestUtils.AreEqual(r2, a2 == b2); + + bool2x2 a3 = bool2x2(true, true, false, true); + bool2x2 b3 = bool2x2(true, false, false, false); + bool2x2 r3 = bool2x2(true, false, true, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void bool2x2_operator_equal_wide_scalar() + { + bool2x2 a0 = bool2x2(false, true, false, false); + bool b0 = (true); + bool2x2 r0 = bool2x2(false, true, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + bool2x2 a1 = bool2x2(false, true, false, false); + bool b1 = (false); + bool2x2 r1 = bool2x2(true, false, true, true); + TestUtils.AreEqual(r1, a1 == b1); + + bool2x2 a2 = bool2x2(false, true, false, true); + bool b2 = (true); + bool2x2 r2 = bool2x2(false, true, false, true); + TestUtils.AreEqual(r2, a2 == b2); + + bool2x2 a3 = bool2x2(false, false, false, false); + bool b3 = (true); + bool2x2 r3 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void bool2x2_operator_equal_scalar_wide() + { + bool a0 = (false); + bool2x2 b0 = bool2x2(true, false, true, false); + bool2x2 r0 = bool2x2(false, true, false, true); + TestUtils.AreEqual(r0, a0 == b0); + + bool a1 = (false); + bool2x2 b1 = bool2x2(true, false, false, true); + bool2x2 r1 = bool2x2(false, true, true, false); + TestUtils.AreEqual(r1, a1 == b1); + + bool a2 = (false); + bool2x2 b2 = bool2x2(true, true, false, true); + bool2x2 r2 = bool2x2(false, false, true, false); + TestUtils.AreEqual(r2, a2 == b2); + + bool a3 = (false); + bool2x2 b3 = bool2x2(true, true, true, false); + bool2x2 r3 = bool2x2(false, false, false, true); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void bool2x2_operator_not_equal_wide_wide() + { + bool2x2 a0 = bool2x2(true, true, true, false); + bool2x2 b0 = bool2x2(true, false, false, false); + bool2x2 r0 = bool2x2(false, true, true, false); + TestUtils.AreEqual(r0, a0 != b0); + + bool2x2 a1 = bool2x2(false, true, false, false); + bool2x2 b1 = bool2x2(true, false, false, false); + bool2x2 r1 = bool2x2(true, true, false, false); + TestUtils.AreEqual(r1, a1 != b1); + + bool2x2 a2 = bool2x2(false, false, true, true); + bool2x2 b2 = bool2x2(false, true, true, true); + bool2x2 r2 = bool2x2(false, true, false, false); + TestUtils.AreEqual(r2, a2 != b2); + + bool2x2 a3 = bool2x2(true, true, true, true); + bool2x2 b3 = bool2x2(false, false, true, true); + bool2x2 r3 = bool2x2(true, true, false, false); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void bool2x2_operator_not_equal_wide_scalar() + { + bool2x2 a0 = bool2x2(false, true, false, true); + bool b0 = (false); + bool2x2 r0 = bool2x2(false, true, false, true); + TestUtils.AreEqual(r0, a0 != b0); + + bool2x2 a1 = bool2x2(true, false, false, false); + bool b1 = (false); + bool2x2 r1 = bool2x2(true, false, false, false); + TestUtils.AreEqual(r1, a1 != b1); + + bool2x2 a2 = bool2x2(false, false, false, true); + bool b2 = (false); + bool2x2 r2 = bool2x2(false, false, false, true); + TestUtils.AreEqual(r2, a2 != b2); + + bool2x2 a3 = bool2x2(false, false, false, true); + bool b3 = (false); + bool2x2 r3 = bool2x2(false, false, false, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void bool2x2_operator_not_equal_scalar_wide() + { + bool a0 = (true); + bool2x2 b0 = bool2x2(false, false, true, false); + bool2x2 r0 = bool2x2(true, true, false, true); + TestUtils.AreEqual(r0, a0 != b0); + + bool a1 = (false); + bool2x2 b1 = bool2x2(false, true, true, true); + bool2x2 r1 = bool2x2(false, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + bool a2 = (false); + bool2x2 b2 = bool2x2(false, false, false, false); + bool2x2 r2 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r2, a2 != b2); + + bool a3 = (true); + bool2x2 b3 = bool2x2(false, false, true, false); + bool2x2 r3 = bool2x2(true, true, false, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void bool2x2_operator_bitwise_and_wide_wide() + { + bool2x2 a0 = bool2x2(false, false, true, true); + bool2x2 b0 = bool2x2(false, false, true, false); + bool2x2 r0 = bool2x2(false, false, true, false); + TestUtils.AreEqual(r0, a0 & b0); + + bool2x2 a1 = bool2x2(false, false, true, true); + bool2x2 b1 = bool2x2(true, true, false, false); + bool2x2 r1 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r1, a1 & b1); + + bool2x2 a2 = bool2x2(true, false, true, true); + bool2x2 b2 = bool2x2(true, true, false, false); + bool2x2 r2 = bool2x2(true, false, false, false); + TestUtils.AreEqual(r2, a2 & b2); + + bool2x2 a3 = bool2x2(true, true, false, false); + bool2x2 b3 = bool2x2(false, false, true, false); + bool2x2 r3 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void bool2x2_operator_bitwise_and_wide_scalar() + { + bool2x2 a0 = bool2x2(true, false, false, true); + bool b0 = (true); + bool2x2 r0 = bool2x2(true, false, false, true); + TestUtils.AreEqual(r0, a0 & b0); + + bool2x2 a1 = bool2x2(true, false, false, false); + bool b1 = (false); + bool2x2 r1 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r1, a1 & b1); + + bool2x2 a2 = bool2x2(false, true, true, false); + bool b2 = (true); + bool2x2 r2 = bool2x2(false, true, true, false); + TestUtils.AreEqual(r2, a2 & b2); + + bool2x2 a3 = bool2x2(false, true, true, false); + bool b3 = (true); + bool2x2 r3 = bool2x2(false, true, true, false); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void bool2x2_operator_bitwise_and_scalar_wide() + { + bool a0 = (false); + bool2x2 b0 = bool2x2(false, false, true, true); + bool2x2 r0 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r0, a0 & b0); + + bool a1 = (true); + bool2x2 b1 = bool2x2(false, true, false, false); + bool2x2 r1 = bool2x2(false, true, false, false); + TestUtils.AreEqual(r1, a1 & b1); + + bool a2 = (false); + bool2x2 b2 = bool2x2(true, false, false, false); + bool2x2 r2 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r2, a2 & b2); + + bool a3 = (true); + bool2x2 b3 = bool2x2(true, true, true, false); + bool2x2 r3 = bool2x2(true, true, true, false); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void bool2x2_operator_bitwise_or_wide_wide() + { + bool2x2 a0 = bool2x2(true, true, true, false); + bool2x2 b0 = bool2x2(false, false, false, false); + bool2x2 r0 = bool2x2(true, true, true, false); + TestUtils.AreEqual(r0, a0 | b0); + + bool2x2 a1 = bool2x2(true, false, true, true); + bool2x2 b1 = bool2x2(true, true, true, false); + bool2x2 r1 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r1, a1 | b1); + + bool2x2 a2 = bool2x2(false, true, true, true); + bool2x2 b2 = bool2x2(false, true, false, false); + bool2x2 r2 = bool2x2(false, true, true, true); + TestUtils.AreEqual(r2, a2 | b2); + + bool2x2 a3 = bool2x2(true, true, true, false); + bool2x2 b3 = bool2x2(true, true, true, true); + bool2x2 r3 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void bool2x2_operator_bitwise_or_wide_scalar() + { + bool2x2 a0 = bool2x2(true, true, false, true); + bool b0 = (true); + bool2x2 r0 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r0, a0 | b0); + + bool2x2 a1 = bool2x2(true, true, false, true); + bool b1 = (true); + bool2x2 r1 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r1, a1 | b1); + + bool2x2 a2 = bool2x2(false, true, false, false); + bool b2 = (false); + bool2x2 r2 = bool2x2(false, true, false, false); + TestUtils.AreEqual(r2, a2 | b2); + + bool2x2 a3 = bool2x2(true, true, true, true); + bool b3 = (false); + bool2x2 r3 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void bool2x2_operator_bitwise_or_scalar_wide() + { + bool a0 = (true); + bool2x2 b0 = bool2x2(true, true, false, false); + bool2x2 r0 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r0, a0 | b0); + + bool a1 = (true); + bool2x2 b1 = bool2x2(true, true, false, false); + bool2x2 r1 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r1, a1 | b1); + + bool a2 = (true); + bool2x2 b2 = bool2x2(true, false, true, true); + bool2x2 r2 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r2, a2 | b2); + + bool a3 = (false); + bool2x2 b3 = bool2x2(false, false, false, true); + bool2x2 r3 = bool2x2(false, false, false, true); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void bool2x2_operator_bitwise_xor_wide_wide() + { + bool2x2 a0 = bool2x2(true, false, false, true); + bool2x2 b0 = bool2x2(true, true, false, true); + bool2x2 r0 = bool2x2(false, true, false, false); + TestUtils.AreEqual(r0, a0 ^ b0); + + bool2x2 a1 = bool2x2(false, false, false, true); + bool2x2 b1 = bool2x2(false, true, false, true); + bool2x2 r1 = bool2x2(false, true, false, false); + TestUtils.AreEqual(r1, a1 ^ b1); + + bool2x2 a2 = bool2x2(false, false, true, true); + bool2x2 b2 = bool2x2(false, false, false, true); + bool2x2 r2 = bool2x2(false, false, true, false); + TestUtils.AreEqual(r2, a2 ^ b2); + + bool2x2 a3 = bool2x2(false, false, true, false); + bool2x2 b3 = bool2x2(false, false, true, true); + bool2x2 r3 = bool2x2(false, false, false, true); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void bool2x2_operator_bitwise_xor_wide_scalar() + { + bool2x2 a0 = bool2x2(false, false, true, true); + bool b0 = (false); + bool2x2 r0 = bool2x2(false, false, true, true); + TestUtils.AreEqual(r0, a0 ^ b0); + + bool2x2 a1 = bool2x2(false, false, false, false); + bool b1 = (false); + bool2x2 r1 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r1, a1 ^ b1); + + bool2x2 a2 = bool2x2(false, true, false, true); + bool b2 = (false); + bool2x2 r2 = bool2x2(false, true, false, true); + TestUtils.AreEqual(r2, a2 ^ b2); + + bool2x2 a3 = bool2x2(true, true, false, true); + bool b3 = (true); + bool2x2 r3 = bool2x2(false, false, true, false); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void bool2x2_operator_bitwise_xor_scalar_wide() + { + bool a0 = (true); + bool2x2 b0 = bool2x2(true, false, true, true); + bool2x2 r0 = bool2x2(false, true, false, false); + TestUtils.AreEqual(r0, a0 ^ b0); + + bool a1 = (false); + bool2x2 b1 = bool2x2(true, true, false, false); + bool2x2 r1 = bool2x2(true, true, false, false); + TestUtils.AreEqual(r1, a1 ^ b1); + + bool a2 = (true); + bool2x2 b2 = bool2x2(true, false, false, true); + bool2x2 r2 = bool2x2(false, true, true, false); + TestUtils.AreEqual(r2, a2 ^ b2); + + bool a3 = (false); + bool2x2 b3 = bool2x2(true, true, false, true); + bool2x2 r3 = bool2x2(true, true, false, true); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void bool2x2_operator_logical_not() + { + bool2x2 a0 = bool2x2(true, true, false, false); + bool2x2 r0 = bool2x2(false, false, true, true); + TestUtils.AreEqual(r0, !a0); + + bool2x2 a1 = bool2x2(true, true, false, true); + bool2x2 r1 = bool2x2(false, false, true, false); + TestUtils.AreEqual(r1, !a1); + + bool2x2 a2 = bool2x2(false, false, false, true); + bool2x2 r2 = bool2x2(true, true, true, false); + TestUtils.AreEqual(r2, !a2); + + bool2x2 a3 = bool2x2(true, false, true, true); + bool2x2 r3 = bool2x2(false, true, false, false); + TestUtils.AreEqual(r3, !a3); + } + + [TestCase /* For player builds */] + public static void bool2x2_EqualsObjectOverride() + { + TestUtils.IsFalse(new bool2x2().Equals((object)new int())); + TestUtils.IsTrue(new bool2x2().Equals((object)new bool2x2())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestBool2x2.gen.cs.meta b/src/Tests/Tests/Shared/TestBool2x2.gen.cs.meta new file mode 100644 index 00000000..4006bb93 --- /dev/null +++ b/src/Tests/Tests/Shared/TestBool2x2.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8ffa916172073c14499f3e88e1ddaccc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestBool2x3.gen.cs b/src/Tests/Tests/Shared/TestBool2x3.gen.cs new file mode 100644 index 00000000..8157a008 --- /dev/null +++ b/src/Tests/Tests/Shared/TestBool2x3.gen.cs @@ -0,0 +1,407 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestBool2x3 + { + [TestCompiler] + public static void bool2x3_operator_equal_wide_wide() + { + bool2x3 a0 = bool2x3(true, false, true, false, false, true); + bool2x3 b0 = bool2x3(true, false, false, false, true, false); + bool2x3 r0 = bool2x3(true, true, false, true, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + bool2x3 a1 = bool2x3(false, false, true, false, true, false); + bool2x3 b1 = bool2x3(false, true, false, false, false, false); + bool2x3 r1 = bool2x3(true, false, false, true, false, true); + TestUtils.AreEqual(r1, a1 == b1); + + bool2x3 a2 = bool2x3(true, true, false, true, true, false); + bool2x3 b2 = bool2x3(true, false, false, false, true, false); + bool2x3 r2 = bool2x3(true, false, true, false, true, true); + TestUtils.AreEqual(r2, a2 == b2); + + bool2x3 a3 = bool2x3(false, true, true, true, false, true); + bool2x3 b3 = bool2x3(false, true, false, true, false, true); + bool2x3 r3 = bool2x3(true, true, false, true, true, true); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void bool2x3_operator_equal_wide_scalar() + { + bool2x3 a0 = bool2x3(false, true, false, false, false, false); + bool b0 = (true); + bool2x3 r0 = bool2x3(false, true, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + bool2x3 a1 = bool2x3(true, false, false, true, true, false); + bool b1 = (false); + bool2x3 r1 = bool2x3(false, true, true, false, false, true); + TestUtils.AreEqual(r1, a1 == b1); + + bool2x3 a2 = bool2x3(true, true, false, false, false, true); + bool b2 = (false); + bool2x3 r2 = bool2x3(false, false, true, true, true, false); + TestUtils.AreEqual(r2, a2 == b2); + + bool2x3 a3 = bool2x3(false, false, false, false, false, false); + bool b3 = (false); + bool2x3 r3 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void bool2x3_operator_equal_scalar_wide() + { + bool a0 = (false); + bool2x3 b0 = bool2x3(true, false, true, false, false, true); + bool2x3 r0 = bool2x3(false, true, false, true, true, false); + TestUtils.AreEqual(r0, a0 == b0); + + bool a1 = (false); + bool2x3 b1 = bool2x3(false, true, false, true, true, false); + bool2x3 r1 = bool2x3(true, false, true, false, false, true); + TestUtils.AreEqual(r1, a1 == b1); + + bool a2 = (true); + bool2x3 b2 = bool2x3(false, true, true, true, false, false); + bool2x3 r2 = bool2x3(false, true, true, true, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + bool a3 = (true); + bool2x3 b3 = bool2x3(false, true, true, false, true, true); + bool2x3 r3 = bool2x3(false, true, true, false, true, true); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void bool2x3_operator_not_equal_wide_wide() + { + bool2x3 a0 = bool2x3(true, true, true, false, false, true); + bool2x3 b0 = bool2x3(true, false, false, false, true, false); + bool2x3 r0 = bool2x3(false, true, true, false, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + bool2x3 a1 = bool2x3(false, false, false, false, true, true); + bool2x3 b1 = bool2x3(false, false, false, true, true, true); + bool2x3 r1 = bool2x3(false, false, false, true, false, false); + TestUtils.AreEqual(r1, a1 != b1); + + bool2x3 a2 = bool2x3(true, true, true, true, true, true); + bool2x3 b2 = bool2x3(false, false, true, true, true, false); + bool2x3 r2 = bool2x3(true, true, false, false, false, true); + TestUtils.AreEqual(r2, a2 != b2); + + bool2x3 a3 = bool2x3(false, true, false, true, true, true); + bool2x3 b3 = bool2x3(true, true, false, false, true, false); + bool2x3 r3 = bool2x3(true, false, false, true, false, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void bool2x3_operator_not_equal_wide_scalar() + { + bool2x3 a0 = bool2x3(false, true, false, true, true, false); + bool b0 = (false); + bool2x3 r0 = bool2x3(false, true, false, true, true, false); + TestUtils.AreEqual(r0, a0 != b0); + + bool2x3 a1 = bool2x3(false, false, false, false, false, false); + bool b1 = (false); + bool2x3 r1 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 != b1); + + bool2x3 a2 = bool2x3(true, false, false, false, true, true); + bool b2 = (false); + bool2x3 r2 = bool2x3(true, false, false, false, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + bool2x3 a3 = bool2x3(false, true, true, true, true, true); + bool b3 = (true); + bool2x3 r3 = bool2x3(true, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void bool2x3_operator_not_equal_scalar_wide() + { + bool a0 = (true); + bool2x3 b0 = bool2x3(false, false, true, false, false, false); + bool2x3 r0 = bool2x3(true, true, false, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + bool a1 = (true); + bool2x3 b1 = bool2x3(true, true, false, false, false, false); + bool2x3 r1 = bool2x3(false, false, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + bool a2 = (false); + bool2x3 b2 = bool2x3(true, false, false, true, false, false); + bool2x3 r2 = bool2x3(true, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 != b2); + + bool a3 = (false); + bool2x3 b3 = bool2x3(true, true, false, false, true, false); + bool2x3 r3 = bool2x3(true, true, false, false, true, false); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void bool2x3_operator_bitwise_and_wide_wide() + { + bool2x3 a0 = bool2x3(false, false, true, true, false, false); + bool2x3 b0 = bool2x3(false, false, true, false, true, true); + bool2x3 r0 = bool2x3(false, false, true, false, false, false); + TestUtils.AreEqual(r0, a0 & b0); + + bool2x3 a1 = bool2x3(true, true, true, false, true, true); + bool2x3 b1 = bool2x3(false, false, true, true, false, false); + bool2x3 r1 = bool2x3(false, false, true, false, false, false); + TestUtils.AreEqual(r1, a1 & b1); + + bool2x3 a2 = bool2x3(true, true, false, false, true, true); + bool2x3 b2 = bool2x3(false, false, true, false, true, false); + bool2x3 r2 = bool2x3(false, false, false, false, true, false); + TestUtils.AreEqual(r2, a2 & b2); + + bool2x3 a3 = bool2x3(true, false, true, true, false, true); + bool2x3 b3 = bool2x3(true, true, true, true, true, true); + bool2x3 r3 = bool2x3(true, false, true, true, false, true); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void bool2x3_operator_bitwise_and_wide_scalar() + { + bool2x3 a0 = bool2x3(true, false, false, true, true, false); + bool b0 = (true); + bool2x3 r0 = bool2x3(true, false, false, true, true, false); + TestUtils.AreEqual(r0, a0 & b0); + + bool2x3 a1 = bool2x3(false, false, false, true, true, true); + bool b1 = (false); + bool2x3 r1 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 & b1); + + bool2x3 a2 = bool2x3(false, true, true, true, false, true); + bool b2 = (false); + bool2x3 r2 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 & b2); + + bool2x3 a3 = bool2x3(false, true, true, false, false, false); + bool b3 = (true); + bool2x3 r3 = bool2x3(false, true, true, false, false, false); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void bool2x3_operator_bitwise_and_scalar_wide() + { + bool a0 = (false); + bool2x3 b0 = bool2x3(false, false, true, true, true, false); + bool2x3 r0 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 & b0); + + bool a1 = (true); + bool2x3 b1 = bool2x3(false, false, false, true, false, false); + bool2x3 r1 = bool2x3(false, false, false, true, false, false); + TestUtils.AreEqual(r1, a1 & b1); + + bool a2 = (false); + bool2x3 b2 = bool2x3(true, true, true, true, false, true); + bool2x3 r2 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 & b2); + + bool a3 = (true); + bool2x3 b3 = bool2x3(true, true, true, false, true, false); + bool2x3 r3 = bool2x3(true, true, true, false, true, false); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void bool2x3_operator_bitwise_or_wide_wide() + { + bool2x3 a0 = bool2x3(true, true, true, false, true, false); + bool2x3 b0 = bool2x3(false, false, false, false, true, true); + bool2x3 r0 = bool2x3(true, true, true, false, true, true); + TestUtils.AreEqual(r0, a0 | b0); + + bool2x3 a1 = bool2x3(true, true, false, true, true, true); + bool2x3 b1 = bool2x3(true, false, false, true, false, false); + bool2x3 r1 = bool2x3(true, true, false, true, true, true); + TestUtils.AreEqual(r1, a1 | b1); + + bool2x3 a2 = bool2x3(true, true, true, false, true, true); + bool2x3 b2 = bool2x3(true, true, true, true, true, true); + bool2x3 r2 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 | b2); + + bool2x3 a3 = bool2x3(false, true, true, false, true, false); + bool2x3 b3 = bool2x3(false, true, true, true, false, true); + bool2x3 r3 = bool2x3(false, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void bool2x3_operator_bitwise_or_wide_scalar() + { + bool2x3 a0 = bool2x3(true, true, false, true, true, true); + bool b0 = (true); + bool2x3 r0 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 | b0); + + bool2x3 a1 = bool2x3(true, true, false, false, true, false); + bool b1 = (false); + bool2x3 r1 = bool2x3(true, true, false, false, true, false); + TestUtils.AreEqual(r1, a1 | b1); + + bool2x3 a2 = bool2x3(false, false, true, true, true, true); + bool b2 = (true); + bool2x3 r2 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 | b2); + + bool2x3 a3 = bool2x3(true, true, true, false, true, false); + bool b3 = (true); + bool2x3 r3 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void bool2x3_operator_bitwise_or_scalar_wide() + { + bool a0 = (true); + bool2x3 b0 = bool2x3(true, true, false, false, true, true); + bool2x3 r0 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 | b0); + + bool a1 = (true); + bool2x3 b1 = bool2x3(false, false, true, true, false, true); + bool2x3 r1 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 | b1); + + bool a2 = (true); + bool2x3 b2 = bool2x3(false, false, false, false, true, true); + bool2x3 r2 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 | b2); + + bool a3 = (true); + bool2x3 b3 = bool2x3(true, true, false, true, false, true); + bool2x3 r3 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void bool2x3_operator_bitwise_xor_wide_wide() + { + bool2x3 a0 = bool2x3(true, false, false, true, false, false); + bool2x3 b0 = bool2x3(true, true, false, true, false, true); + bool2x3 r0 = bool2x3(false, true, false, false, false, true); + TestUtils.AreEqual(r0, a0 ^ b0); + + bool2x3 a1 = bool2x3(false, true, false, false, true, true); + bool2x3 b1 = bool2x3(false, true, false, false, false, true); + bool2x3 r1 = bool2x3(false, false, false, false, true, false); + TestUtils.AreEqual(r1, a1 ^ b1); + + bool2x3 a2 = bool2x3(false, false, true, false, true, false); + bool2x3 b2 = bool2x3(false, false, true, true, false, false); + bool2x3 r2 = bool2x3(false, false, false, true, true, false); + TestUtils.AreEqual(r2, a2 ^ b2); + + bool2x3 a3 = bool2x3(false, false, true, false, true, false); + bool2x3 b3 = bool2x3(false, false, false, true, false, false); + bool2x3 r3 = bool2x3(false, false, true, true, true, false); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void bool2x3_operator_bitwise_xor_wide_scalar() + { + bool2x3 a0 = bool2x3(false, false, true, true, false, false); + bool b0 = (false); + bool2x3 r0 = bool2x3(false, false, true, true, false, false); + TestUtils.AreEqual(r0, a0 ^ b0); + + bool2x3 a1 = bool2x3(false, false, false, false, true, false); + bool b1 = (false); + bool2x3 r1 = bool2x3(false, false, false, false, true, false); + TestUtils.AreEqual(r1, a1 ^ b1); + + bool2x3 a2 = bool2x3(true, true, true, false, true, false); + bool b2 = (true); + bool2x3 r2 = bool2x3(false, false, false, true, false, true); + TestUtils.AreEqual(r2, a2 ^ b2); + + bool2x3 a3 = bool2x3(false, false, false, false, true, false); + bool b3 = (true); + bool2x3 r3 = bool2x3(true, true, true, true, false, true); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void bool2x3_operator_bitwise_xor_scalar_wide() + { + bool a0 = (true); + bool2x3 b0 = bool2x3(true, false, true, true, false, true); + bool2x3 r0 = bool2x3(false, true, false, false, true, false); + TestUtils.AreEqual(r0, a0 ^ b0); + + bool a1 = (true); + bool2x3 b1 = bool2x3(false, false, true, true, false, false); + bool2x3 r1 = bool2x3(true, true, false, false, true, true); + TestUtils.AreEqual(r1, a1 ^ b1); + + bool a2 = (true); + bool2x3 b2 = bool2x3(false, true, true, false, true, true); + bool2x3 r2 = bool2x3(true, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 ^ b2); + + bool a3 = (true); + bool2x3 b3 = bool2x3(false, false, false, true, true, true); + bool2x3 r3 = bool2x3(true, true, true, false, false, false); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void bool2x3_operator_logical_not() + { + bool2x3 a0 = bool2x3(true, true, false, false, true, false); + bool2x3 r0 = bool2x3(false, false, true, true, false, true); + TestUtils.AreEqual(r0, !a0); + + bool2x3 a1 = bool2x3(true, true, false, false, false, false); + bool2x3 r1 = bool2x3(false, false, true, true, true, true); + TestUtils.AreEqual(r1, !a1); + + bool2x3 a2 = bool2x3(true, false, false, true, true, true); + bool2x3 r2 = bool2x3(false, true, true, false, false, false); + TestUtils.AreEqual(r2, !a2); + + bool2x3 a3 = bool2x3(false, true, true, false, false, false); + bool2x3 r3 = bool2x3(true, false, false, true, true, true); + TestUtils.AreEqual(r3, !a3); + } + + [TestCase /* For player builds */] + public static void bool2x3_EqualsObjectOverride() + { + TestUtils.IsFalse(new bool2x3().Equals((object)new int())); + TestUtils.IsTrue(new bool2x3().Equals((object)new bool2x3())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestBool2x3.gen.cs.meta b/src/Tests/Tests/Shared/TestBool2x3.gen.cs.meta new file mode 100644 index 00000000..f7b3ffb5 --- /dev/null +++ b/src/Tests/Tests/Shared/TestBool2x3.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a058a163908539c4d9aa34e925e16c84 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestBool2x4.gen.cs b/src/Tests/Tests/Shared/TestBool2x4.gen.cs new file mode 100644 index 00000000..fdfdb454 --- /dev/null +++ b/src/Tests/Tests/Shared/TestBool2x4.gen.cs @@ -0,0 +1,407 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestBool2x4 + { + [TestCompiler] + public static void bool2x4_operator_equal_wide_wide() + { + bool2x4 a0 = bool2x4(true, false, true, false, false, true, false, false); + bool2x4 b0 = bool2x4(true, false, false, false, true, false, false, true); + bool2x4 r0 = bool2x4(true, true, false, true, false, false, true, false); + TestUtils.AreEqual(r0, a0 == b0); + + bool2x4 a1 = bool2x4(true, false, true, false, true, true, false, true); + bool2x4 b1 = bool2x4(false, false, false, false, true, false, false, false); + bool2x4 r1 = bool2x4(false, true, false, true, true, false, true, false); + TestUtils.AreEqual(r1, a1 == b1); + + bool2x4 a2 = bool2x4(true, false, false, true, true, true, false, true); + bool2x4 b2 = bool2x4(true, false, false, true, false, true, false, true); + bool2x4 r2 = bool2x4(true, true, true, true, false, true, true, true); + TestUtils.AreEqual(r2, a2 == b2); + + bool2x4 a3 = bool2x4(true, true, false, true, true, true, false, true); + bool2x4 b3 = bool2x4(true, true, true, true, true, false, false, false); + bool2x4 r3 = bool2x4(true, true, false, true, true, false, true, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void bool2x4_operator_equal_wide_scalar() + { + bool2x4 a0 = bool2x4(false, true, false, false, false, false, true, false); + bool b0 = (true); + bool2x4 r0 = bool2x4(false, true, false, false, false, false, true, false); + TestUtils.AreEqual(r0, a0 == b0); + + bool2x4 a1 = bool2x4(false, true, true, false, true, false, true, false); + bool b1 = (false); + bool2x4 r1 = bool2x4(true, false, false, true, false, true, false, true); + TestUtils.AreEqual(r1, a1 == b1); + + bool2x4 a2 = bool2x4(false, true, false, false, false, false, false, false); + bool b2 = (false); + bool2x4 r2 = bool2x4(true, false, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 == b2); + + bool2x4 a3 = bool2x4(false, false, false, false, false, true, true, false); + bool b3 = (false); + bool2x4 r3 = bool2x4(true, true, true, true, true, false, false, true); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void bool2x4_operator_equal_scalar_wide() + { + bool a0 = (false); + bool2x4 b0 = bool2x4(true, false, true, false, false, true, false, false); + bool2x4 r0 = bool2x4(false, true, false, true, true, false, true, true); + TestUtils.AreEqual(r0, a0 == b0); + + bool a1 = (true); + bool2x4 b1 = bool2x4(false, true, true, false, true, false, true, true); + bool2x4 r1 = bool2x4(false, true, true, false, true, false, true, true); + TestUtils.AreEqual(r1, a1 == b1); + + bool a2 = (true); + bool2x4 b2 = bool2x4(false, false, true, false, true, true, false, true); + bool2x4 r2 = bool2x4(false, false, true, false, true, true, false, true); + TestUtils.AreEqual(r2, a2 == b2); + + bool a3 = (true); + bool2x4 b3 = bool2x4(true, true, true, true, false, true, true, false); + bool2x4 r3 = bool2x4(true, true, true, true, false, true, true, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void bool2x4_operator_not_equal_wide_wide() + { + bool2x4 a0 = bool2x4(true, true, true, false, false, true, false, false); + bool2x4 b0 = bool2x4(true, false, false, false, true, false, false, false); + bool2x4 r0 = bool2x4(false, true, true, false, true, true, false, false); + TestUtils.AreEqual(r0, a0 != b0); + + bool2x4 a1 = bool2x4(false, false, true, true, true, true, true, true); + bool2x4 b1 = bool2x4(false, true, true, true, false, false, true, true); + bool2x4 r1 = bool2x4(false, true, false, false, true, true, false, false); + TestUtils.AreEqual(r1, a1 != b1); + + bool2x4 a2 = bool2x4(true, true, false, true, false, true, true, true); + bool2x4 b2 = bool2x4(true, false, true, true, false, false, true, false); + bool2x4 r2 = bool2x4(false, true, true, false, false, true, false, true); + TestUtils.AreEqual(r2, a2 != b2); + + bool2x4 a3 = bool2x4(true, false, false, true, false, true, true, true); + bool2x4 b3 = bool2x4(false, false, true, false, true, false, true, false); + bool2x4 r3 = bool2x4(true, false, true, true, true, true, false, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void bool2x4_operator_not_equal_wide_scalar() + { + bool2x4 a0 = bool2x4(false, true, false, true, true, false, false, false); + bool b0 = (false); + bool2x4 r0 = bool2x4(false, true, false, true, true, false, false, false); + TestUtils.AreEqual(r0, a0 != b0); + + bool2x4 a1 = bool2x4(false, false, false, false, true, false, false, false); + bool b1 = (false); + bool2x4 r1 = bool2x4(false, false, false, false, true, false, false, false); + TestUtils.AreEqual(r1, a1 != b1); + + bool2x4 a2 = bool2x4(false, true, false, true, true, true, true, true); + bool b2 = (true); + bool2x4 r2 = bool2x4(true, false, true, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 != b2); + + bool2x4 a3 = bool2x4(true, true, true, true, false, false, true, false); + bool b3 = (false); + bool2x4 r3 = bool2x4(true, true, true, true, false, false, true, false); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void bool2x4_operator_not_equal_scalar_wide() + { + bool a0 = (true); + bool2x4 b0 = bool2x4(false, false, true, false, false, false, true, true); + bool2x4 r0 = bool2x4(true, true, false, true, true, true, false, false); + TestUtils.AreEqual(r0, a0 != b0); + + bool a1 = (true); + bool2x4 b1 = bool2x4(false, false, false, false, false, true, false, false); + bool2x4 r1 = bool2x4(true, true, true, true, true, false, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + bool a2 = (true); + bool2x4 b2 = bool2x4(false, false, false, true, true, false, false, true); + bool2x4 r2 = bool2x4(true, true, true, false, false, true, true, false); + TestUtils.AreEqual(r2, a2 != b2); + + bool a3 = (false); + bool2x4 b3 = bool2x4(false, true, true, false, true, false, false, true); + bool2x4 r3 = bool2x4(false, true, true, false, true, false, false, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void bool2x4_operator_bitwise_and_wide_wide() + { + bool2x4 a0 = bool2x4(false, false, true, true, false, false, true, true); + bool2x4 b0 = bool2x4(false, false, true, false, true, true, false, false); + bool2x4 r0 = bool2x4(false, false, true, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 & b0); + + bool2x4 a1 = bool2x4(true, false, true, true, true, true, false, false); + bool2x4 b1 = bool2x4(true, true, false, false, false, false, true, false); + bool2x4 r1 = bool2x4(true, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 & b1); + + bool2x4 a2 = bool2x4(true, true, true, false, true, true, false, true); + bool2x4 b2 = bool2x4(true, false, true, true, true, true, true, true); + bool2x4 r2 = bool2x4(true, false, true, false, true, true, false, true); + TestUtils.AreEqual(r2, a2 & b2); + + bool2x4 a3 = bool2x4(true, false, true, true, true, false, false, true); + bool2x4 b3 = bool2x4(true, true, true, false, false, false, true, false); + bool2x4 r3 = bool2x4(true, false, true, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void bool2x4_operator_bitwise_and_wide_scalar() + { + bool2x4 a0 = bool2x4(true, false, false, true, true, false, false, false); + bool b0 = (true); + bool2x4 r0 = bool2x4(true, false, false, true, true, false, false, false); + TestUtils.AreEqual(r0, a0 & b0); + + bool2x4 a1 = bool2x4(false, true, true, true, false, false, true, true); + bool b1 = (false); + bool2x4 r1 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 & b1); + + bool2x4 a2 = bool2x4(true, true, false, true, true, true, false, false); + bool b2 = (false); + bool2x4 r2 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 & b2); + + bool2x4 a3 = bool2x4(false, false, true, false, true, false, false, false); + bool b3 = (false); + bool2x4 r3 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void bool2x4_operator_bitwise_and_scalar_wide() + { + bool a0 = (false); + bool2x4 b0 = bool2x4(false, false, true, true, true, false, true, false); + bool2x4 r0 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 & b0); + + bool a1 = (false); + bool2x4 b1 = bool2x4(false, true, false, false, false, true, true, true); + bool2x4 r1 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 & b1); + + bool a2 = (true); + bool2x4 b2 = bool2x4(false, true, true, true, true, true, false, true); + bool2x4 r2 = bool2x4(false, true, true, true, true, true, false, true); + TestUtils.AreEqual(r2, a2 & b2); + + bool a3 = (false); + bool2x4 b3 = bool2x4(true, false, false, false, true, true, true, true); + bool2x4 r3 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void bool2x4_operator_bitwise_or_wide_wide() + { + bool2x4 a0 = bool2x4(true, true, true, false, true, false, true, true); + bool2x4 b0 = bool2x4(false, false, false, false, true, true, true, false); + bool2x4 r0 = bool2x4(true, true, true, false, true, true, true, true); + TestUtils.AreEqual(r0, a0 | b0); + + bool2x4 a1 = bool2x4(false, true, true, true, true, true, true, false); + bool2x4 b1 = bool2x4(false, true, false, false, true, true, true, true); + bool2x4 r1 = bool2x4(false, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 | b1); + + bool2x4 a2 = bool2x4(true, true, false, true, true, false, true, false); + bool2x4 b2 = bool2x4(true, true, false, true, true, true, false, true); + bool2x4 r2 = bool2x4(true, true, false, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 | b2); + + bool2x4 a3 = bool2x4(true, true, false, true, false, false, false, false); + bool2x4 b3 = bool2x4(false, true, false, false, true, true, true, true); + bool2x4 r3 = bool2x4(true, true, false, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void bool2x4_operator_bitwise_or_wide_scalar() + { + bool2x4 a0 = bool2x4(true, true, false, true, true, true, true, false); + bool b0 = (true); + bool2x4 r0 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 | b0); + + bool2x4 a1 = bool2x4(true, false, true, false, false, true, false, true); + bool b1 = (false); + bool2x4 r1 = bool2x4(true, false, true, false, false, true, false, true); + TestUtils.AreEqual(r1, a1 | b1); + + bool2x4 a2 = bool2x4(true, true, true, true, true, true, false, true); + bool b2 = (true); + bool2x4 r2 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 | b2); + + bool2x4 a3 = bool2x4(false, false, true, true, true, true, true, true); + bool b3 = (false); + bool2x4 r3 = bool2x4(false, false, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void bool2x4_operator_bitwise_or_scalar_wide() + { + bool a0 = (true); + bool2x4 b0 = bool2x4(true, true, false, false, true, true, true, false); + bool2x4 r0 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 | b0); + + bool a1 = (false); + bool2x4 b1 = bool2x4(true, true, false, true, true, false, false, false); + bool2x4 r1 = bool2x4(true, true, false, true, true, false, false, false); + TestUtils.AreEqual(r1, a1 | b1); + + bool a2 = (false); + bool2x4 b2 = bool2x4(true, true, true, true, true, false, true, false); + bool2x4 r2 = bool2x4(true, true, true, true, true, false, true, false); + TestUtils.AreEqual(r2, a2 | b2); + + bool a3 = (true); + bool2x4 b3 = bool2x4(true, false, true, true, false, true, true, false); + bool2x4 r3 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void bool2x4_operator_bitwise_xor_wide_wide() + { + bool2x4 a0 = bool2x4(true, false, false, true, false, false, false, true); + bool2x4 b0 = bool2x4(true, true, false, true, false, true, false, true); + bool2x4 r0 = bool2x4(false, true, false, false, false, true, false, false); + TestUtils.AreEqual(r0, a0 ^ b0); + + bool2x4 a1 = bool2x4(false, false, true, true, false, false, true, false); + bool2x4 b1 = bool2x4(false, false, false, true, false, false, true, true); + bool2x4 r1 = bool2x4(false, false, true, false, false, false, false, true); + TestUtils.AreEqual(r1, a1 ^ b1); + + bool2x4 a2 = bool2x4(true, false, false, false, true, false, true, false); + bool2x4 b2 = bool2x4(false, false, false, false, false, true, false, false); + bool2x4 r2 = bool2x4(true, false, false, false, true, true, true, false); + TestUtils.AreEqual(r2, a2 ^ b2); + + bool2x4 a3 = bool2x4(true, false, false, false, true, true, true, true); + bool2x4 b3 = bool2x4(false, true, false, true, true, false, false, true); + bool2x4 r3 = bool2x4(true, true, false, true, false, true, true, false); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void bool2x4_operator_bitwise_xor_wide_scalar() + { + bool2x4 a0 = bool2x4(false, false, true, true, false, false, false, false); + bool b0 = (false); + bool2x4 r0 = bool2x4(false, false, true, true, false, false, false, false); + TestUtils.AreEqual(r0, a0 ^ b0); + + bool2x4 a1 = bool2x4(false, false, true, false, true, true, true, true); + bool b1 = (false); + bool2x4 r1 = bool2x4(false, false, true, false, true, true, true, true); + TestUtils.AreEqual(r1, a1 ^ b1); + + bool2x4 a2 = bool2x4(false, false, false, true, false, false, false, true); + bool b2 = (true); + bool2x4 r2 = bool2x4(true, true, true, false, true, true, true, false); + TestUtils.AreEqual(r2, a2 ^ b2); + + bool2x4 a3 = bool2x4(false, true, true, true, false, true, false, false); + bool b3 = (true); + bool2x4 r3 = bool2x4(true, false, false, false, true, false, true, true); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void bool2x4_operator_bitwise_xor_scalar_wide() + { + bool a0 = (true); + bool2x4 b0 = bool2x4(true, false, true, true, false, true, true, false); + bool2x4 r0 = bool2x4(false, true, false, false, true, false, false, true); + TestUtils.AreEqual(r0, a0 ^ b0); + + bool a1 = (false); + bool2x4 b1 = bool2x4(true, true, false, false, true, false, true, true); + bool2x4 r1 = bool2x4(true, true, false, false, true, false, true, true); + TestUtils.AreEqual(r1, a1 ^ b1); + + bool a2 = (false); + bool2x4 b2 = bool2x4(true, true, true, false, false, false, true, true); + bool2x4 r2 = bool2x4(true, true, true, false, false, false, true, true); + TestUtils.AreEqual(r2, a2 ^ b2); + + bool a3 = (true); + bool2x4 b3 = bool2x4(false, false, false, true, true, false, true, false); + bool2x4 r3 = bool2x4(true, true, true, false, false, true, false, true); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void bool2x4_operator_logical_not() + { + bool2x4 a0 = bool2x4(true, true, false, false, true, false, true, false); + bool2x4 r0 = bool2x4(false, false, true, true, false, true, false, true); + TestUtils.AreEqual(r0, !a0); + + bool2x4 a1 = bool2x4(true, false, false, false, true, true, false, false); + bool2x4 r1 = bool2x4(false, true, true, true, false, false, true, true); + TestUtils.AreEqual(r1, !a1); + + bool2x4 a2 = bool2x4(true, true, false, true, true, true, false, false); + bool2x4 r2 = bool2x4(false, false, true, false, false, false, true, true); + TestUtils.AreEqual(r2, !a2); + + bool2x4 a3 = bool2x4(false, false, true, false, false, true, true, false); + bool2x4 r3 = bool2x4(true, true, false, true, true, false, false, true); + TestUtils.AreEqual(r3, !a3); + } + + [TestCase /* For player builds */] + public static void bool2x4_EqualsObjectOverride() + { + TestUtils.IsFalse(new bool2x4().Equals((object)new int())); + TestUtils.IsTrue(new bool2x4().Equals((object)new bool2x4())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestBool2x4.gen.cs.meta b/src/Tests/Tests/Shared/TestBool2x4.gen.cs.meta new file mode 100644 index 00000000..96b1e80a --- /dev/null +++ b/src/Tests/Tests/Shared/TestBool2x4.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fa56fbe206d514b43a4f21c1ecd2a9bd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestBool3.gen.cs b/src/Tests/Tests/Shared/TestBool3.gen.cs new file mode 100644 index 00000000..ee345f1e --- /dev/null +++ b/src/Tests/Tests/Shared/TestBool3.gen.cs @@ -0,0 +1,443 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestBool3 + { + [TestCompiler] + public static void bool3_constructor() + { + bool3 a = new bool3(false, true, false); + TestUtils.AreEqual(false, a.x); + TestUtils.AreEqual(true, a.y); + TestUtils.AreEqual(false, a.z); + } + + [TestCompiler] + public static void bool3_scalar_constructor() + { + bool3 a = new bool3(true); + TestUtils.AreEqual(true, a.x); + TestUtils.AreEqual(true, a.y); + TestUtils.AreEqual(true, a.z); + } + + [TestCompiler] + public static void bool3_static_constructor() + { + bool3 a = bool3(false, true, false); + TestUtils.AreEqual(false, a.x); + TestUtils.AreEqual(true, a.y); + TestUtils.AreEqual(false, a.z); + } + + [TestCompiler] + public static void bool3_static_scalar_constructor() + { + bool3 a = bool3(true); + TestUtils.AreEqual(true, a.x); + TestUtils.AreEqual(true, a.y); + TestUtils.AreEqual(true, a.z); + } + + [TestCompiler] + public static void bool3_operator_equal_wide_wide() + { + bool3 a0 = bool3(true, false, true); + bool3 b0 = bool3(true, false, false); + bool3 r0 = bool3(true, true, false); + TestUtils.AreEqual(r0, a0 == b0); + + bool3 a1 = bool3(false, false, true); + bool3 b1 = bool3(false, true, false); + bool3 r1 = bool3(true, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + bool3 a2 = bool3(false, false, true); + bool3 b2 = bool3(false, true, false); + bool3 r2 = bool3(true, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + bool3 a3 = bool3(false, true, false); + bool3 b3 = bool3(false, false, false); + bool3 r3 = bool3(true, false, true); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void bool3_operator_equal_wide_scalar() + { + bool3 a0 = bool3(false, true, false); + bool b0 = (true); + bool3 r0 = bool3(false, true, false); + TestUtils.AreEqual(r0, a0 == b0); + + bool3 a1 = bool3(false, false, true); + bool b1 = (false); + bool3 r1 = bool3(true, true, false); + TestUtils.AreEqual(r1, a1 == b1); + + bool3 a2 = bool3(false, false, true); + bool b2 = (false); + bool3 r2 = bool3(true, true, false); + TestUtils.AreEqual(r2, a2 == b2); + + bool3 a3 = bool3(true, true, false); + bool b3 = (false); + bool3 r3 = bool3(false, false, true); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void bool3_operator_equal_scalar_wide() + { + bool a0 = (false); + bool3 b0 = bool3(true, false, true); + bool3 r0 = bool3(false, true, false); + TestUtils.AreEqual(r0, a0 == b0); + + bool a1 = (false); + bool3 b1 = bool3(false, true, false); + bool3 r1 = bool3(true, false, true); + TestUtils.AreEqual(r1, a1 == b1); + + bool a2 = (false); + bool3 b2 = bool3(true, false, true); + bool3 r2 = bool3(false, true, false); + TestUtils.AreEqual(r2, a2 == b2); + + bool a3 = (true); + bool3 b3 = bool3(false, true, false); + bool3 r3 = bool3(false, true, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void bool3_operator_not_equal_wide_wide() + { + bool3 a0 = bool3(true, true, true); + bool3 b0 = bool3(true, false, false); + bool3 r0 = bool3(false, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + bool3 a1 = bool3(false, false, true); + bool3 b1 = bool3(false, true, false); + bool3 r1 = bool3(false, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + bool3 a2 = bool3(false, false, false); + bool3 b2 = bool3(false, false, false); + bool3 r2 = bool3(false, false, false); + TestUtils.AreEqual(r2, a2 != b2); + + bool3 a3 = bool3(false, true, true); + bool3 b3 = bool3(true, true, true); + bool3 r3 = bool3(true, false, false); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void bool3_operator_not_equal_wide_scalar() + { + bool3 a0 = bool3(false, true, false); + bool b0 = (false); + bool3 r0 = bool3(false, true, false); + TestUtils.AreEqual(r0, a0 != b0); + + bool3 a1 = bool3(true, false, false); + bool b1 = (true); + bool3 r1 = bool3(false, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + bool3 a2 = bool3(false, false, false); + bool b2 = (false); + bool3 r2 = bool3(false, false, false); + TestUtils.AreEqual(r2, a2 != b2); + + bool3 a3 = bool3(false, true, false); + bool b3 = (false); + bool3 r3 = bool3(false, true, false); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void bool3_operator_not_equal_scalar_wide() + { + bool a0 = (true); + bool3 b0 = bool3(false, false, true); + bool3 r0 = bool3(true, true, false); + TestUtils.AreEqual(r0, a0 != b0); + + bool a1 = (false); + bool3 b1 = bool3(false, false, true); + bool3 r1 = bool3(false, false, true); + TestUtils.AreEqual(r1, a1 != b1); + + bool a2 = (true); + bool3 b2 = bool3(true, false, false); + bool3 r2 = bool3(false, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + bool a3 = (false); + bool3 b3 = bool3(false, false, true); + bool3 r3 = bool3(false, false, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void bool3_operator_bitwise_and_wide_wide() + { + bool3 a0 = bool3(false, false, true); + bool3 b0 = bool3(false, false, true); + bool3 r0 = bool3(false, false, true); + TestUtils.AreEqual(r0, a0 & b0); + + bool3 a1 = bool3(true, false, false); + bool3 b1 = bool3(false, true, true); + bool3 r1 = bool3(false, false, false); + TestUtils.AreEqual(r1, a1 & b1); + + bool3 a2 = bool3(true, true, true); + bool3 b2 = bool3(false, false, true); + bool3 r2 = bool3(false, false, true); + TestUtils.AreEqual(r2, a2 & b2); + + bool3 a3 = bool3(false, true, true); + bool3 b3 = bool3(true, false, false); + bool3 r3 = bool3(false, false, false); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void bool3_operator_bitwise_and_wide_scalar() + { + bool3 a0 = bool3(true, false, false); + bool b0 = (true); + bool3 r0 = bool3(true, false, false); + TestUtils.AreEqual(r0, a0 & b0); + + bool3 a1 = bool3(true, false, false); + bool b1 = (true); + bool3 r1 = bool3(true, false, false); + TestUtils.AreEqual(r1, a1 & b1); + + bool3 a2 = bool3(false, false, true); + bool b2 = (false); + bool3 r2 = bool3(false, false, false); + TestUtils.AreEqual(r2, a2 & b2); + + bool3 a3 = bool3(true, false, false); + bool b3 = (true); + bool3 r3 = bool3(true, false, false); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void bool3_operator_bitwise_and_scalar_wide() + { + bool a0 = (false); + bool3 b0 = bool3(false, false, true); + bool3 r0 = bool3(false, false, false); + TestUtils.AreEqual(r0, a0 & b0); + + bool a1 = (true); + bool3 b1 = bool3(true, false, true); + bool3 r1 = bool3(true, false, true); + TestUtils.AreEqual(r1, a1 & b1); + + bool a2 = (false); + bool3 b2 = bool3(false, false, true); + bool3 r2 = bool3(false, false, false); + TestUtils.AreEqual(r2, a2 & b2); + + bool a3 = (false); + bool3 b3 = bool3(false, false, true); + bool3 r3 = bool3(false, false, false); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void bool3_operator_bitwise_or_wide_wide() + { + bool3 a0 = bool3(true, true, true); + bool3 b0 = bool3(false, false, false); + bool3 r0 = bool3(true, true, true); + TestUtils.AreEqual(r0, a0 | b0); + + bool3 a1 = bool3(false, true, false); + bool3 b1 = bool3(false, true, true); + bool3 r1 = bool3(false, true, true); + TestUtils.AreEqual(r1, a1 | b1); + + bool3 a2 = bool3(true, true, false); + bool3 b2 = bool3(true, false, false); + bool3 r2 = bool3(true, true, false); + TestUtils.AreEqual(r2, a2 | b2); + + bool3 a3 = bool3(true, true, true); + bool3 b3 = bool3(true, false, false); + bool3 r3 = bool3(true, true, true); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void bool3_operator_bitwise_or_wide_scalar() + { + bool3 a0 = bool3(true, true, false); + bool b0 = (true); + bool3 r0 = bool3(true, true, true); + TestUtils.AreEqual(r0, a0 | b0); + + bool3 a1 = bool3(true, true, true); + bool b1 = (true); + bool3 r1 = bool3(true, true, true); + TestUtils.AreEqual(r1, a1 | b1); + + bool3 a2 = bool3(false, false, false); + bool b2 = (true); + bool3 r2 = bool3(true, true, true); + TestUtils.AreEqual(r2, a2 | b2); + + bool3 a3 = bool3(true, false, true); + bool b3 = (false); + bool3 r3 = bool3(true, false, true); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void bool3_operator_bitwise_or_scalar_wide() + { + bool a0 = (true); + bool3 b0 = bool3(true, true, false); + bool3 r0 = bool3(true, true, true); + TestUtils.AreEqual(r0, a0 | b0); + + bool a1 = (false); + bool3 b1 = bool3(true, true, true); + bool3 r1 = bool3(true, true, true); + TestUtils.AreEqual(r1, a1 | b1); + + bool a2 = (false); + bool3 b2 = bool3(false, true, true); + bool3 r2 = bool3(false, true, true); + TestUtils.AreEqual(r2, a2 | b2); + + bool a3 = (false); + bool3 b3 = bool3(true, true, false); + bool3 r3 = bool3(true, true, false); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void bool3_operator_bitwise_xor_wide_wide() + { + bool3 a0 = bool3(true, false, false); + bool3 b0 = bool3(true, true, false); + bool3 r0 = bool3(false, true, false); + TestUtils.AreEqual(r0, a0 ^ b0); + + bool3 a1 = bool3(true, false, false); + bool3 b1 = bool3(true, false, true); + bool3 r1 = bool3(false, false, true); + TestUtils.AreEqual(r1, a1 ^ b1); + + bool3 a2 = bool3(false, true, false); + bool3 b2 = bool3(false, true, false); + bool3 r2 = bool3(false, false, false); + TestUtils.AreEqual(r2, a2 ^ b2); + + bool3 a3 = bool3(false, true, true); + bool3 b3 = bool3(false, false, true); + bool3 r3 = bool3(false, true, false); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void bool3_operator_bitwise_xor_wide_scalar() + { + bool3 a0 = bool3(false, false, true); + bool b0 = (false); + bool3 r0 = bool3(false, false, true); + TestUtils.AreEqual(r0, a0 ^ b0); + + bool3 a1 = bool3(true, false, false); + bool b1 = (false); + bool3 r1 = bool3(true, false, false); + TestUtils.AreEqual(r1, a1 ^ b1); + + bool3 a2 = bool3(false, false, false); + bool b2 = (false); + bool3 r2 = bool3(false, false, false); + TestUtils.AreEqual(r2, a2 ^ b2); + + bool3 a3 = bool3(true, true, true); + bool b3 = (false); + bool3 r3 = bool3(true, true, true); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void bool3_operator_bitwise_xor_scalar_wide() + { + bool a0 = (true); + bool3 b0 = bool3(true, false, true); + bool3 r0 = bool3(false, true, false); + TestUtils.AreEqual(r0, a0 ^ b0); + + bool a1 = (true); + bool3 b1 = bool3(false, true, true); + bool3 r1 = bool3(true, false, false); + TestUtils.AreEqual(r1, a1 ^ b1); + + bool a2 = (false); + bool3 b2 = bool3(false, true, true); + bool3 r2 = bool3(false, true, true); + TestUtils.AreEqual(r2, a2 ^ b2); + + bool a3 = (false); + bool3 b3 = bool3(false, true, false); + bool3 r3 = bool3(false, true, false); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void bool3_operator_logical_not() + { + bool3 a0 = bool3(true, true, false); + bool3 r0 = bool3(false, false, true); + TestUtils.AreEqual(r0, !a0); + + bool3 a1 = bool3(false, false, true); + bool3 r1 = bool3(true, true, false); + TestUtils.AreEqual(r1, !a1); + + bool3 a2 = bool3(false, false, false); + bool3 r2 = bool3(true, true, true); + TestUtils.AreEqual(r2, !a2); + + bool3 a3 = bool3(false, true, true); + bool3 r3 = bool3(true, false, false); + TestUtils.AreEqual(r3, !a3); + } + + [TestCase /* For player builds */] + public static void bool3_EqualsObjectOverride() + { + TestUtils.IsFalse(new bool3().Equals((object)new int())); + TestUtils.IsTrue(new bool3().Equals((object)new bool3())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestBool3.gen.cs.meta b/src/Tests/Tests/Shared/TestBool3.gen.cs.meta new file mode 100644 index 00000000..32e56c8e --- /dev/null +++ b/src/Tests/Tests/Shared/TestBool3.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d208b4e1c03551a499e9169aac737e5b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestBool3x2.gen.cs b/src/Tests/Tests/Shared/TestBool3x2.gen.cs new file mode 100644 index 00000000..816c30fd --- /dev/null +++ b/src/Tests/Tests/Shared/TestBool3x2.gen.cs @@ -0,0 +1,407 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestBool3x2 + { + [TestCompiler] + public static void bool3x2_operator_equal_wide_wide() + { + bool3x2 a0 = bool3x2(true, false, true, false, false, true); + bool3x2 b0 = bool3x2(true, false, false, false, true, false); + bool3x2 r0 = bool3x2(true, true, false, true, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + bool3x2 a1 = bool3x2(false, false, true, false, true, false); + bool3x2 b1 = bool3x2(false, true, false, false, false, false); + bool3x2 r1 = bool3x2(true, false, false, true, false, true); + TestUtils.AreEqual(r1, a1 == b1); + + bool3x2 a2 = bool3x2(true, true, false, true, true, false); + bool3x2 b2 = bool3x2(true, false, false, false, true, false); + bool3x2 r2 = bool3x2(true, false, true, false, true, true); + TestUtils.AreEqual(r2, a2 == b2); + + bool3x2 a3 = bool3x2(false, true, true, true, false, true); + bool3x2 b3 = bool3x2(false, true, false, true, false, true); + bool3x2 r3 = bool3x2(true, true, false, true, true, true); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void bool3x2_operator_equal_wide_scalar() + { + bool3x2 a0 = bool3x2(false, true, false, false, false, false); + bool b0 = (true); + bool3x2 r0 = bool3x2(false, true, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + bool3x2 a1 = bool3x2(true, false, false, true, true, false); + bool b1 = (false); + bool3x2 r1 = bool3x2(false, true, true, false, false, true); + TestUtils.AreEqual(r1, a1 == b1); + + bool3x2 a2 = bool3x2(true, true, false, false, false, true); + bool b2 = (false); + bool3x2 r2 = bool3x2(false, false, true, true, true, false); + TestUtils.AreEqual(r2, a2 == b2); + + bool3x2 a3 = bool3x2(false, false, false, false, false, false); + bool b3 = (false); + bool3x2 r3 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void bool3x2_operator_equal_scalar_wide() + { + bool a0 = (false); + bool3x2 b0 = bool3x2(true, false, true, false, false, true); + bool3x2 r0 = bool3x2(false, true, false, true, true, false); + TestUtils.AreEqual(r0, a0 == b0); + + bool a1 = (false); + bool3x2 b1 = bool3x2(false, true, false, true, true, false); + bool3x2 r1 = bool3x2(true, false, true, false, false, true); + TestUtils.AreEqual(r1, a1 == b1); + + bool a2 = (true); + bool3x2 b2 = bool3x2(false, true, true, true, false, false); + bool3x2 r2 = bool3x2(false, true, true, true, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + bool a3 = (true); + bool3x2 b3 = bool3x2(false, true, true, false, true, true); + bool3x2 r3 = bool3x2(false, true, true, false, true, true); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void bool3x2_operator_not_equal_wide_wide() + { + bool3x2 a0 = bool3x2(true, true, true, false, false, true); + bool3x2 b0 = bool3x2(true, false, false, false, true, false); + bool3x2 r0 = bool3x2(false, true, true, false, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + bool3x2 a1 = bool3x2(false, false, false, false, true, true); + bool3x2 b1 = bool3x2(false, false, false, true, true, true); + bool3x2 r1 = bool3x2(false, false, false, true, false, false); + TestUtils.AreEqual(r1, a1 != b1); + + bool3x2 a2 = bool3x2(true, true, true, true, true, true); + bool3x2 b2 = bool3x2(false, false, true, true, true, false); + bool3x2 r2 = bool3x2(true, true, false, false, false, true); + TestUtils.AreEqual(r2, a2 != b2); + + bool3x2 a3 = bool3x2(false, true, false, true, true, true); + bool3x2 b3 = bool3x2(true, true, false, false, true, false); + bool3x2 r3 = bool3x2(true, false, false, true, false, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void bool3x2_operator_not_equal_wide_scalar() + { + bool3x2 a0 = bool3x2(false, true, false, true, true, false); + bool b0 = (false); + bool3x2 r0 = bool3x2(false, true, false, true, true, false); + TestUtils.AreEqual(r0, a0 != b0); + + bool3x2 a1 = bool3x2(false, false, false, false, false, false); + bool b1 = (false); + bool3x2 r1 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 != b1); + + bool3x2 a2 = bool3x2(true, false, false, false, true, true); + bool b2 = (false); + bool3x2 r2 = bool3x2(true, false, false, false, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + bool3x2 a3 = bool3x2(false, true, true, true, true, true); + bool b3 = (true); + bool3x2 r3 = bool3x2(true, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void bool3x2_operator_not_equal_scalar_wide() + { + bool a0 = (true); + bool3x2 b0 = bool3x2(false, false, true, false, false, false); + bool3x2 r0 = bool3x2(true, true, false, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + bool a1 = (true); + bool3x2 b1 = bool3x2(true, true, false, false, false, false); + bool3x2 r1 = bool3x2(false, false, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + bool a2 = (false); + bool3x2 b2 = bool3x2(true, false, false, true, false, false); + bool3x2 r2 = bool3x2(true, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 != b2); + + bool a3 = (false); + bool3x2 b3 = bool3x2(true, true, false, false, true, false); + bool3x2 r3 = bool3x2(true, true, false, false, true, false); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void bool3x2_operator_bitwise_and_wide_wide() + { + bool3x2 a0 = bool3x2(false, false, true, true, false, false); + bool3x2 b0 = bool3x2(false, false, true, false, true, true); + bool3x2 r0 = bool3x2(false, false, true, false, false, false); + TestUtils.AreEqual(r0, a0 & b0); + + bool3x2 a1 = bool3x2(true, true, true, false, true, true); + bool3x2 b1 = bool3x2(false, false, true, true, false, false); + bool3x2 r1 = bool3x2(false, false, true, false, false, false); + TestUtils.AreEqual(r1, a1 & b1); + + bool3x2 a2 = bool3x2(true, true, false, false, true, true); + bool3x2 b2 = bool3x2(false, false, true, false, true, false); + bool3x2 r2 = bool3x2(false, false, false, false, true, false); + TestUtils.AreEqual(r2, a2 & b2); + + bool3x2 a3 = bool3x2(true, false, true, true, false, true); + bool3x2 b3 = bool3x2(true, true, true, true, true, true); + bool3x2 r3 = bool3x2(true, false, true, true, false, true); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void bool3x2_operator_bitwise_and_wide_scalar() + { + bool3x2 a0 = bool3x2(true, false, false, true, true, false); + bool b0 = (true); + bool3x2 r0 = bool3x2(true, false, false, true, true, false); + TestUtils.AreEqual(r0, a0 & b0); + + bool3x2 a1 = bool3x2(false, false, false, true, true, true); + bool b1 = (false); + bool3x2 r1 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 & b1); + + bool3x2 a2 = bool3x2(false, true, true, true, false, true); + bool b2 = (false); + bool3x2 r2 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 & b2); + + bool3x2 a3 = bool3x2(false, true, true, false, false, false); + bool b3 = (true); + bool3x2 r3 = bool3x2(false, true, true, false, false, false); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void bool3x2_operator_bitwise_and_scalar_wide() + { + bool a0 = (false); + bool3x2 b0 = bool3x2(false, false, true, true, true, false); + bool3x2 r0 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 & b0); + + bool a1 = (true); + bool3x2 b1 = bool3x2(false, false, false, true, false, false); + bool3x2 r1 = bool3x2(false, false, false, true, false, false); + TestUtils.AreEqual(r1, a1 & b1); + + bool a2 = (false); + bool3x2 b2 = bool3x2(true, true, true, true, false, true); + bool3x2 r2 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 & b2); + + bool a3 = (true); + bool3x2 b3 = bool3x2(true, true, true, false, true, false); + bool3x2 r3 = bool3x2(true, true, true, false, true, false); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void bool3x2_operator_bitwise_or_wide_wide() + { + bool3x2 a0 = bool3x2(true, true, true, false, true, false); + bool3x2 b0 = bool3x2(false, false, false, false, true, true); + bool3x2 r0 = bool3x2(true, true, true, false, true, true); + TestUtils.AreEqual(r0, a0 | b0); + + bool3x2 a1 = bool3x2(true, true, false, true, true, true); + bool3x2 b1 = bool3x2(true, false, false, true, false, false); + bool3x2 r1 = bool3x2(true, true, false, true, true, true); + TestUtils.AreEqual(r1, a1 | b1); + + bool3x2 a2 = bool3x2(true, true, true, false, true, true); + bool3x2 b2 = bool3x2(true, true, true, true, true, true); + bool3x2 r2 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 | b2); + + bool3x2 a3 = bool3x2(false, true, true, false, true, false); + bool3x2 b3 = bool3x2(false, true, true, true, false, true); + bool3x2 r3 = bool3x2(false, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void bool3x2_operator_bitwise_or_wide_scalar() + { + bool3x2 a0 = bool3x2(true, true, false, true, true, true); + bool b0 = (true); + bool3x2 r0 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 | b0); + + bool3x2 a1 = bool3x2(true, true, false, false, true, false); + bool b1 = (false); + bool3x2 r1 = bool3x2(true, true, false, false, true, false); + TestUtils.AreEqual(r1, a1 | b1); + + bool3x2 a2 = bool3x2(false, false, true, true, true, true); + bool b2 = (true); + bool3x2 r2 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 | b2); + + bool3x2 a3 = bool3x2(true, true, true, false, true, false); + bool b3 = (true); + bool3x2 r3 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void bool3x2_operator_bitwise_or_scalar_wide() + { + bool a0 = (true); + bool3x2 b0 = bool3x2(true, true, false, false, true, true); + bool3x2 r0 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 | b0); + + bool a1 = (true); + bool3x2 b1 = bool3x2(false, false, true, true, false, true); + bool3x2 r1 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 | b1); + + bool a2 = (true); + bool3x2 b2 = bool3x2(false, false, false, false, true, true); + bool3x2 r2 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 | b2); + + bool a3 = (true); + bool3x2 b3 = bool3x2(true, true, false, true, false, true); + bool3x2 r3 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void bool3x2_operator_bitwise_xor_wide_wide() + { + bool3x2 a0 = bool3x2(true, false, false, true, false, false); + bool3x2 b0 = bool3x2(true, true, false, true, false, true); + bool3x2 r0 = bool3x2(false, true, false, false, false, true); + TestUtils.AreEqual(r0, a0 ^ b0); + + bool3x2 a1 = bool3x2(false, true, false, false, true, true); + bool3x2 b1 = bool3x2(false, true, false, false, false, true); + bool3x2 r1 = bool3x2(false, false, false, false, true, false); + TestUtils.AreEqual(r1, a1 ^ b1); + + bool3x2 a2 = bool3x2(false, false, true, false, true, false); + bool3x2 b2 = bool3x2(false, false, true, true, false, false); + bool3x2 r2 = bool3x2(false, false, false, true, true, false); + TestUtils.AreEqual(r2, a2 ^ b2); + + bool3x2 a3 = bool3x2(false, false, true, false, true, false); + bool3x2 b3 = bool3x2(false, false, false, true, false, false); + bool3x2 r3 = bool3x2(false, false, true, true, true, false); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void bool3x2_operator_bitwise_xor_wide_scalar() + { + bool3x2 a0 = bool3x2(false, false, true, true, false, false); + bool b0 = (false); + bool3x2 r0 = bool3x2(false, false, true, true, false, false); + TestUtils.AreEqual(r0, a0 ^ b0); + + bool3x2 a1 = bool3x2(false, false, false, false, true, false); + bool b1 = (false); + bool3x2 r1 = bool3x2(false, false, false, false, true, false); + TestUtils.AreEqual(r1, a1 ^ b1); + + bool3x2 a2 = bool3x2(true, true, true, false, true, false); + bool b2 = (true); + bool3x2 r2 = bool3x2(false, false, false, true, false, true); + TestUtils.AreEqual(r2, a2 ^ b2); + + bool3x2 a3 = bool3x2(false, false, false, false, true, false); + bool b3 = (true); + bool3x2 r3 = bool3x2(true, true, true, true, false, true); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void bool3x2_operator_bitwise_xor_scalar_wide() + { + bool a0 = (true); + bool3x2 b0 = bool3x2(true, false, true, true, false, true); + bool3x2 r0 = bool3x2(false, true, false, false, true, false); + TestUtils.AreEqual(r0, a0 ^ b0); + + bool a1 = (true); + bool3x2 b1 = bool3x2(false, false, true, true, false, false); + bool3x2 r1 = bool3x2(true, true, false, false, true, true); + TestUtils.AreEqual(r1, a1 ^ b1); + + bool a2 = (true); + bool3x2 b2 = bool3x2(false, true, true, false, true, true); + bool3x2 r2 = bool3x2(true, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 ^ b2); + + bool a3 = (true); + bool3x2 b3 = bool3x2(false, false, false, true, true, true); + bool3x2 r3 = bool3x2(true, true, true, false, false, false); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void bool3x2_operator_logical_not() + { + bool3x2 a0 = bool3x2(true, true, false, false, true, false); + bool3x2 r0 = bool3x2(false, false, true, true, false, true); + TestUtils.AreEqual(r0, !a0); + + bool3x2 a1 = bool3x2(true, true, false, false, false, false); + bool3x2 r1 = bool3x2(false, false, true, true, true, true); + TestUtils.AreEqual(r1, !a1); + + bool3x2 a2 = bool3x2(true, false, false, true, true, true); + bool3x2 r2 = bool3x2(false, true, true, false, false, false); + TestUtils.AreEqual(r2, !a2); + + bool3x2 a3 = bool3x2(false, true, true, false, false, false); + bool3x2 r3 = bool3x2(true, false, false, true, true, true); + TestUtils.AreEqual(r3, !a3); + } + + [TestCase /* For player builds */] + public static void bool3x2_EqualsObjectOverride() + { + TestUtils.IsFalse(new bool3x2().Equals((object)new int())); + TestUtils.IsTrue(new bool3x2().Equals((object)new bool3x2())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestBool3x2.gen.cs.meta b/src/Tests/Tests/Shared/TestBool3x2.gen.cs.meta new file mode 100644 index 00000000..f8b84ee7 --- /dev/null +++ b/src/Tests/Tests/Shared/TestBool3x2.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2bbc879646b3ce649a77073d236979fc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestBool3x3.gen.cs b/src/Tests/Tests/Shared/TestBool3x3.gen.cs new file mode 100644 index 00000000..6c5b1b9b --- /dev/null +++ b/src/Tests/Tests/Shared/TestBool3x3.gen.cs @@ -0,0 +1,407 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestBool3x3 + { + [TestCompiler] + public static void bool3x3_operator_equal_wide_wide() + { + bool3x3 a0 = bool3x3(true, false, true, false, false, true, false, false, true); + bool3x3 b0 = bool3x3(true, false, false, false, true, false, false, true, false); + bool3x3 r0 = bool3x3(true, true, false, true, false, false, true, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + bool3x3 a1 = bool3x3(false, true, false, true, true, false, true, true, false); + bool3x3 b1 = bool3x3(false, false, false, true, false, false, false, true, false); + bool3x3 r1 = bool3x3(true, false, true, true, false, true, false, true, true); + TestUtils.AreEqual(r1, a1 == b1); + + bool3x3 a2 = bool3x3(false, true, true, true, false, true, true, true, false); + bool3x3 b2 = bool3x3(false, true, false, true, false, true, true, true, true); + bool3x3 r2 = bool3x3(true, true, false, true, true, true, true, true, false); + TestUtils.AreEqual(r2, a2 == b2); + + bool3x3 a3 = bool3x3(true, true, true, false, true, false, true, false, true); + bool3x3 b3 = bool3x3(true, true, false, false, false, false, true, false, false); + bool3x3 r3 = bool3x3(true, true, false, true, false, true, true, true, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void bool3x3_operator_equal_wide_scalar() + { + bool3x3 a0 = bool3x3(false, true, false, false, false, false, true, false, false); + bool b0 = (true); + bool3x3 r0 = bool3x3(false, true, false, false, false, false, true, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + bool3x3 a1 = bool3x3(false, true, false, true, false, true, false, false, false); + bool b1 = (true); + bool3x3 r1 = bool3x3(false, true, false, true, false, true, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + bool3x3 a2 = bool3x3(true, false, false, false, false, false, false, false, false); + bool b2 = (false); + bool3x3 r2 = bool3x3(false, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 == b2); + + bool3x3 a3 = bool3x3(false, false, true, true, false, false, false, false, true); + bool b3 = (false); + bool3x3 r3 = bool3x3(true, true, false, false, true, true, true, true, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void bool3x3_operator_equal_scalar_wide() + { + bool a0 = (false); + bool3x3 b0 = bool3x3(true, false, true, false, false, true, false, false, true); + bool3x3 r0 = bool3x3(false, true, false, true, true, false, true, true, false); + TestUtils.AreEqual(r0, a0 == b0); + + bool a1 = (false); + bool3x3 b1 = bool3x3(true, true, false, true, false, true, true, true, false); + bool3x3 r1 = bool3x3(false, false, true, false, true, false, false, false, true); + TestUtils.AreEqual(r1, a1 == b1); + + bool a2 = (false); + bool3x3 b2 = bool3x3(true, false, true, true, false, true, true, true, true); + bool3x3 r2 = bool3x3(false, true, false, false, true, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + bool a3 = (true); + bool3x3 b3 = bool3x3(true, false, true, true, false, false, false, true, true); + bool3x3 r3 = bool3x3(true, false, true, true, false, false, false, true, true); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void bool3x3_operator_not_equal_wide_wide() + { + bool3x3 a0 = bool3x3(true, true, true, false, false, true, false, false, false); + bool3x3 b0 = bool3x3(true, false, false, false, true, false, false, false, false); + bool3x3 r0 = bool3x3(false, true, true, false, true, true, false, false, false); + TestUtils.AreEqual(r0, a0 != b0); + + bool3x3 a1 = bool3x3(false, true, true, true, true, true, true, true, true); + bool3x3 b1 = bool3x3(true, true, true, false, false, true, true, true, false); + bool3x3 r1 = bool3x3(true, false, false, true, true, false, false, false, true); + TestUtils.AreEqual(r1, a1 != b1); + + bool3x3 a2 = bool3x3(false, true, false, true, true, true, true, false, false); + bool3x3 b2 = bool3x3(true, true, false, false, true, false, false, false, true); + bool3x3 r2 = bool3x3(true, false, false, true, false, true, true, false, true); + TestUtils.AreEqual(r2, a2 != b2); + + bool3x3 a3 = bool3x3(true, false, true, true, true, true, true, false, true); + bool3x3 b3 = bool3x3(false, true, false, true, false, false, false, false, false); + bool3x3 r3 = bool3x3(true, true, true, false, true, true, true, false, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void bool3x3_operator_not_equal_wide_scalar() + { + bool3x3 a0 = bool3x3(false, true, false, true, true, false, false, false, false); + bool b0 = (false); + bool3x3 r0 = bool3x3(false, true, false, true, true, false, false, false, false); + TestUtils.AreEqual(r0, a0 != b0); + + bool3x3 a1 = bool3x3(false, false, false, true, false, false, false, false, true); + bool b1 = (false); + bool3x3 r1 = bool3x3(false, false, false, true, false, false, false, false, true); + TestUtils.AreEqual(r1, a1 != b1); + + bool3x3 a2 = bool3x3(true, true, true, true, true, true, true, false, true); + bool b2 = (false); + bool3x3 r2 = bool3x3(true, true, true, true, true, true, true, false, true); + TestUtils.AreEqual(r2, a2 != b2); + + bool3x3 a3 = bool3x3(true, false, false, true, false, true, false, true, false); + bool b3 = (true); + bool3x3 r3 = bool3x3(false, true, true, false, true, false, true, false, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void bool3x3_operator_not_equal_scalar_wide() + { + bool a0 = (true); + bool3x3 b0 = bool3x3(false, false, true, false, false, false, true, true, true); + bool3x3 r0 = bool3x3(true, true, false, true, true, true, false, false, false); + TestUtils.AreEqual(r0, a0 != b0); + + bool a1 = (false); + bool3x3 b1 = bool3x3(false, false, false, false, true, false, false, true, false); + bool3x3 r1 = bool3x3(false, false, false, false, true, false, false, true, false); + TestUtils.AreEqual(r1, a1 != b1); + + bool a2 = (false); + bool3x3 b2 = bool3x3(false, true, true, false, false, true, false, false, true); + bool3x3 r2 = bool3x3(false, true, true, false, false, true, false, false, true); + TestUtils.AreEqual(r2, a2 != b2); + + bool a3 = (true); + bool3x3 b3 = bool3x3(false, true, false, false, true, true, true, true, true); + bool3x3 r3 = bool3x3(true, false, true, true, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void bool3x3_operator_bitwise_and_wide_wide() + { + bool3x3 a0 = bool3x3(false, false, true, true, false, false, true, true, true); + bool3x3 b0 = bool3x3(false, false, true, false, true, true, false, false, true); + bool3x3 r0 = bool3x3(false, false, true, false, false, false, false, false, true); + TestUtils.AreEqual(r0, a0 & b0); + + bool3x3 a1 = bool3x3(false, true, true, true, true, false, false, true, true); + bool3x3 b1 = bool3x3(true, false, false, false, false, true, false, true, false); + bool3x3 r1 = bool3x3(false, false, false, false, false, false, false, true, false); + TestUtils.AreEqual(r1, a1 & b1); + + bool3x3 a2 = bool3x3(true, false, true, true, false, true, true, false, true); + bool3x3 b2 = bool3x3(true, true, true, true, true, true, true, true, true); + bool3x3 r2 = bool3x3(true, false, true, true, false, true, true, false, true); + TestUtils.AreEqual(r2, a2 & b2); + + bool3x3 a3 = bool3x3(true, true, false, false, true, true, false, false, true); + bool3x3 b3 = bool3x3(false, false, false, true, false, false, true, true, true); + bool3x3 r3 = bool3x3(false, false, false, false, false, false, false, false, true); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void bool3x3_operator_bitwise_and_wide_scalar() + { + bool3x3 a0 = bool3x3(true, false, false, true, true, false, false, false, false); + bool b0 = (true); + bool3x3 r0 = bool3x3(true, false, false, true, true, false, false, false, false); + TestUtils.AreEqual(r0, a0 & b0); + + bool3x3 a1 = bool3x3(false, true, true, false, false, true, true, true, false); + bool b1 = (true); + bool3x3 r1 = bool3x3(false, true, true, false, false, true, true, true, false); + TestUtils.AreEqual(r1, a1 & b1); + + bool3x3 a2 = bool3x3(true, true, true, true, false, false, false, false, false); + bool b2 = (false); + bool3x3 r2 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 & b2); + + bool3x3 a3 = bool3x3(true, true, false, false, false, false, true, false, true); + bool b3 = (false); + bool3x3 r3 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void bool3x3_operator_bitwise_and_scalar_wide() + { + bool a0 = (false); + bool3x3 b0 = bool3x3(false, false, true, true, true, false, true, false, false); + bool3x3 r0 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 & b0); + + bool a1 = (false); + bool3x3 b1 = bool3x3(true, false, false, false, true, true, true, true, false); + bool3x3 r1 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 & b1); + + bool a2 = (true); + bool3x3 b2 = bool3x3(true, true, true, true, false, true, false, true, false); + bool3x3 r2 = bool3x3(true, true, true, true, false, true, false, true, false); + TestUtils.AreEqual(r2, a2 & b2); + + bool a3 = (false); + bool3x3 b3 = bool3x3(false, true, true, true, true, true, false, true, false); + bool3x3 r3 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void bool3x3_operator_bitwise_or_wide_wide() + { + bool3x3 a0 = bool3x3(true, true, true, false, true, false, true, true, false); + bool3x3 b0 = bool3x3(false, false, false, false, true, true, true, false, false); + bool3x3 r0 = bool3x3(true, true, true, false, true, true, true, true, false); + TestUtils.AreEqual(r0, a0 | b0); + + bool3x3 a1 = bool3x3(true, true, true, true, true, true, false, true, true); + bool3x3 b1 = bool3x3(true, false, false, true, true, true, true, true, true); + bool3x3 r1 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 | b1); + + bool3x3 a2 = bool3x3(false, true, true, false, true, false, true, true, false); + bool3x3 b2 = bool3x3(false, true, true, true, false, true, false, true, false); + bool3x3 r2 = bool3x3(false, true, true, true, true, true, true, true, false); + TestUtils.AreEqual(r2, a2 | b2); + + bool3x3 a3 = bool3x3(true, false, false, false, false, false, false, true, true); + bool3x3 b3 = bool3x3(false, true, true, true, true, false, false, false, true); + bool3x3 r3 = bool3x3(true, true, true, true, true, false, false, true, true); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void bool3x3_operator_bitwise_or_wide_scalar() + { + bool3x3 a0 = bool3x3(true, true, false, true, true, true, true, false, true); + bool b0 = (true); + bool3x3 r0 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 | b0); + + bool3x3 a1 = bool3x3(false, true, false, false, true, false, true, true, true); + bool b1 = (false); + bool3x3 r1 = bool3x3(false, true, false, false, true, false, true, true, true); + TestUtils.AreEqual(r1, a1 | b1); + + bool3x3 a2 = bool3x3(true, true, true, true, false, true, false, false, false); + bool b2 = (true); + bool3x3 r2 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 | b2); + + bool3x3 a3 = bool3x3(true, true, true, true, true, false, true, false, false); + bool b3 = (true); + bool3x3 r3 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void bool3x3_operator_bitwise_or_scalar_wide() + { + bool a0 = (true); + bool3x3 b0 = bool3x3(true, true, false, false, true, true, true, false, false); + bool3x3 r0 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 | b0); + + bool a1 = (true); + bool3x3 b1 = bool3x3(true, false, true, true, false, false, false, false, true); + bool3x3 r1 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 | b1); + + bool a2 = (true); + bool3x3 b2 = bool3x3(true, true, true, false, true, false, true, true, false); + bool3x3 r2 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 | b2); + + bool a3 = (true); + bool3x3 b3 = bool3x3(true, false, true, true, false, false, true, true, true); + bool3x3 r3 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void bool3x3_operator_bitwise_xor_wide_wide() + { + bool3x3 a0 = bool3x3(true, false, false, true, false, false, false, true, false); + bool3x3 b0 = bool3x3(true, true, false, true, false, true, false, true, false); + bool3x3 r0 = bool3x3(false, true, false, false, false, true, false, false, false); + TestUtils.AreEqual(r0, a0 ^ b0); + + bool3x3 a1 = bool3x3(false, true, true, false, false, true, false, true, false); + bool3x3 b1 = bool3x3(false, false, true, false, false, true, true, false, false); + bool3x3 r1 = bool3x3(false, true, false, false, false, false, true, true, false); + TestUtils.AreEqual(r1, a1 ^ b1); + + bool3x3 a2 = bool3x3(false, false, true, false, true, false, true, false, false); + bool3x3 b2 = bool3x3(false, false, false, true, false, false, false, true, false); + bool3x3 r2 = bool3x3(false, false, true, true, true, false, true, true, false); + TestUtils.AreEqual(r2, a2 ^ b2); + + bool3x3 a3 = bool3x3(false, true, true, true, true, true, true, false, false); + bool3x3 b3 = bool3x3(true, true, false, false, true, false, true, true, false); + bool3x3 r3 = bool3x3(true, false, true, true, false, true, false, true, false); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void bool3x3_operator_bitwise_xor_wide_scalar() + { + bool3x3 a0 = bool3x3(false, false, true, true, false, false, false, false, false); + bool b0 = (false); + bool3x3 r0 = bool3x3(false, false, true, true, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 ^ b0); + + bool3x3 a1 = bool3x3(false, true, false, true, true, true, true, false, true); + bool b1 = (false); + bool3x3 r1 = bool3x3(false, true, false, true, true, true, true, false, true); + TestUtils.AreEqual(r1, a1 ^ b1); + + bool3x3 a2 = bool3x3(false, true, false, false, false, true, false, true, true); + bool b2 = (false); + bool3x3 r2 = bool3x3(false, true, false, false, false, true, false, true, true); + TestUtils.AreEqual(r2, a2 ^ b2); + + bool3x3 a3 = bool3x3(true, false, true, false, false, true, true, false, true); + bool b3 = (true); + bool3x3 r3 = bool3x3(false, true, false, true, true, false, false, true, false); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void bool3x3_operator_bitwise_xor_scalar_wide() + { + bool a0 = (true); + bool3x3 b0 = bool3x3(true, false, true, true, false, true, true, false, false); + bool3x3 r0 = bool3x3(false, true, false, false, true, false, false, true, true); + TestUtils.AreEqual(r0, a0 ^ b0); + + bool a1 = (true); + bool3x3 b1 = bool3x3(true, false, false, true, false, true, true, false, true); + bool3x3 r1 = bool3x3(false, true, true, false, true, false, false, true, false); + TestUtils.AreEqual(r1, a1 ^ b1); + + bool a2 = (true); + bool3x3 b2 = bool3x3(true, false, false, false, true, true, true, false, false); + bool3x3 r2 = bool3x3(false, true, true, true, false, false, false, true, true); + TestUtils.AreEqual(r2, a2 ^ b2); + + bool a3 = (false); + bool3x3 b3 = bool3x3(true, true, false, true, false, false, true, true, true); + bool3x3 r3 = bool3x3(true, true, false, true, false, false, true, true, true); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void bool3x3_operator_logical_not() + { + bool3x3 a0 = bool3x3(true, true, false, false, true, false, true, false, true); + bool3x3 r0 = bool3x3(false, false, true, true, false, true, false, true, false); + TestUtils.AreEqual(r0, !a0); + + bool3x3 a1 = bool3x3(false, false, false, true, true, false, false, true, true); + bool3x3 r1 = bool3x3(true, true, true, false, false, true, true, false, false); + TestUtils.AreEqual(r1, !a1); + + bool3x3 a2 = bool3x3(true, true, true, true, false, false, false, true, false); + bool3x3 r2 = bool3x3(false, false, false, false, true, true, true, false, true); + TestUtils.AreEqual(r2, !a2); + + bool3x3 a3 = bool3x3(true, false, true, true, false, true, false, false, false); + bool3x3 r3 = bool3x3(false, true, false, false, true, false, true, true, true); + TestUtils.AreEqual(r3, !a3); + } + + [TestCase /* For player builds */] + public static void bool3x3_EqualsObjectOverride() + { + TestUtils.IsFalse(new bool3x3().Equals((object)new int())); + TestUtils.IsTrue(new bool3x3().Equals((object)new bool3x3())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestBool3x3.gen.cs.meta b/src/Tests/Tests/Shared/TestBool3x3.gen.cs.meta new file mode 100644 index 00000000..070d4642 --- /dev/null +++ b/src/Tests/Tests/Shared/TestBool3x3.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 16fef77cdd788b54983aea9d37b2efb1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestBool3x4.gen.cs b/src/Tests/Tests/Shared/TestBool3x4.gen.cs new file mode 100644 index 00000000..8d7d6245 --- /dev/null +++ b/src/Tests/Tests/Shared/TestBool3x4.gen.cs @@ -0,0 +1,407 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestBool3x4 + { + [TestCompiler] + public static void bool3x4_operator_equal_wide_wide() + { + bool3x4 a0 = bool3x4(true, false, true, false, false, true, false, false, true, false, true, false); + bool3x4 b0 = bool3x4(true, false, false, false, true, false, false, true, false, false, false, false); + bool3x4 r0 = bool3x4(true, true, false, true, false, false, true, false, false, true, false, true); + TestUtils.AreEqual(r0, a0 == b0); + + bool3x4 a1 = bool3x4(true, true, false, true, true, false, false, true, true, true, false, true); + bool3x4 b1 = bool3x4(true, false, false, false, true, false, false, true, false, true, false, true); + bool3x4 r1 = bool3x4(true, false, true, false, true, true, true, true, false, true, true, true); + TestUtils.AreEqual(r1, a1 == b1); + + bool3x4 a2 = bool3x4(true, true, false, true, true, true, false, true, false, true, false, true); + bool3x4 b2 = bool3x4(true, true, true, true, true, false, false, false, false, true, false, false); + bool3x4 r2 = bool3x4(true, true, false, true, true, false, true, false, true, true, true, false); + TestUtils.AreEqual(r2, a2 == b2); + + bool3x4 a3 = bool3x4(false, true, true, false, true, false, false, false, false, true, true, false); + bool3x4 b3 = bool3x4(true, true, false, true, false, false, false, true, true, true, true, false); + bool3x4 r3 = bool3x4(false, true, false, false, false, true, true, false, false, true, true, true); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void bool3x4_operator_equal_wide_scalar() + { + bool3x4 a0 = bool3x4(false, true, false, false, false, false, true, false, false, false, true, true); + bool b0 = (true); + bool3x4 r0 = bool3x4(false, true, false, false, false, false, true, false, false, false, true, true); + TestUtils.AreEqual(r0, a0 == b0); + + bool3x4 a1 = bool3x4(false, false, true, false, false, false, true, false, false, false, false, false); + bool b1 = (true); + bool3x4 r1 = bool3x4(false, false, true, false, false, false, true, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + bool3x4 a2 = bool3x4(false, false, false, false, false, false, true, true, false, false, false, false); + bool b2 = (false); + bool3x4 r2 = bool3x4(true, true, true, true, true, true, false, false, true, true, true, true); + TestUtils.AreEqual(r2, a2 == b2); + + bool3x4 a3 = bool3x4(true, false, true, true, false, false, true, false, true, true, false, false); + bool b3 = (true); + bool3x4 r3 = bool3x4(true, false, true, true, false, false, true, false, true, true, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void bool3x4_operator_equal_scalar_wide() + { + bool a0 = (false); + bool3x4 b0 = bool3x4(true, false, true, false, false, true, false, false, true, false, true, true); + bool3x4 r0 = bool3x4(false, true, false, true, true, false, true, true, false, true, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + bool a1 = (false); + bool3x4 b1 = bool3x4(true, false, true, true, true, false, false, true, false, true, true, false); + bool3x4 r1 = bool3x4(false, true, false, false, false, true, true, false, true, false, false, true); + TestUtils.AreEqual(r1, a1 == b1); + + bool a2 = (true); + bool3x4 b2 = bool3x4(true, true, true, true, true, false, true, true, false, false, false, true); + bool3x4 r2 = bool3x4(true, true, true, true, true, false, true, true, false, false, false, true); + TestUtils.AreEqual(r2, a2 == b2); + + bool a3 = (true); + bool3x4 b3 = bool3x4(true, false, true, true, true, false, false, true, false, true, true, false); + bool3x4 r3 = bool3x4(true, false, true, true, true, false, false, true, false, true, true, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void bool3x4_operator_not_equal_wide_wide() + { + bool3x4 a0 = bool3x4(true, true, true, false, false, true, false, false, false, false, true, true); + bool3x4 b0 = bool3x4(true, false, false, false, true, false, false, false, false, true, true, true); + bool3x4 r0 = bool3x4(false, true, true, false, true, true, false, false, false, true, false, false); + TestUtils.AreEqual(r0, a0 != b0); + + bool3x4 a1 = bool3x4(true, true, true, true, true, true, false, true, false, true, true, true); + bool3x4 b1 = bool3x4(false, false, true, true, true, false, true, true, false, false, true, false); + bool3x4 r1 = bool3x4(true, true, false, false, false, true, true, false, false, true, false, true); + TestUtils.AreEqual(r1, a1 != b1); + + bool3x4 a2 = bool3x4(true, false, false, true, false, true, true, true, true, true, false, true); + bool3x4 b2 = bool3x4(false, false, true, false, true, false, true, false, false, false, false, false); + bool3x4 r2 = bool3x4(true, false, true, true, true, true, false, true, true, true, false, true); + TestUtils.AreEqual(r2, a2 != b2); + + bool3x4 a3 = bool3x4(true, true, true, false, true, true, true, false, true, false, false, false); + bool3x4 b3 = bool3x4(false, true, false, true, false, true, false, false, false, true, false, false); + bool3x4 r3 = bool3x4(true, false, true, true, true, false, true, false, true, true, false, false); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void bool3x4_operator_not_equal_wide_scalar() + { + bool3x4 a0 = bool3x4(false, true, false, true, true, false, false, false, false, false, false, false); + bool b0 = (false); + bool3x4 r0 = bool3x4(false, true, false, true, true, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 != b0); + + bool3x4 a1 = bool3x4(false, false, false, false, false, true, true, false, true, true, true, true); + bool b1 = (true); + bool3x4 r1 = bool3x4(true, true, true, true, true, false, false, true, false, false, false, false); + TestUtils.AreEqual(r1, a1 != b1); + + bool3x4 a2 = bool3x4(true, false, true, true, true, false, false, true, false, true, false, true); + bool b2 = (true); + bool3x4 r2 = bool3x4(false, true, false, false, false, true, true, false, true, false, true, false); + TestUtils.AreEqual(r2, a2 != b2); + + bool3x4 a3 = bool3x4(false, false, true, true, true, false, false, true, false, true, false, true); + bool b3 = (false); + bool3x4 r3 = bool3x4(false, false, true, true, true, false, false, true, false, true, false, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void bool3x4_operator_not_equal_scalar_wide() + { + bool a0 = (true); + bool3x4 b0 = bool3x4(false, false, true, false, false, false, true, true, true, false, false, false); + bool3x4 r0 = bool3x4(true, true, false, true, true, true, false, false, false, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + bool a1 = (false); + bool3x4 b1 = bool3x4(false, true, false, false, true, false, false, false, true, true, false, false); + bool3x4 r1 = bool3x4(false, true, false, false, true, false, false, false, true, true, false, false); + TestUtils.AreEqual(r1, a1 != b1); + + bool a2 = (true); + bool3x4 b2 = bool3x4(false, false, true, true, false, true, false, false, true, true, true, true); + bool3x4 r2 = bool3x4(true, true, false, false, true, false, true, true, false, false, false, false); + TestUtils.AreEqual(r2, a2 != b2); + + bool a3 = (true); + bool3x4 b3 = bool3x4(true, true, true, false, false, true, true, false, false, false, true, true); + bool3x4 r3 = bool3x4(false, false, false, true, true, false, false, true, true, true, false, false); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void bool3x4_operator_bitwise_and_wide_wide() + { + bool3x4 a0 = bool3x4(false, false, true, true, false, false, true, true, true, false, true, true); + bool3x4 b0 = bool3x4(false, false, true, false, true, true, false, false, true, true, false, false); + bool3x4 r0 = bool3x4(false, false, true, false, false, false, false, false, true, false, false, false); + TestUtils.AreEqual(r0, a0 & b0); + + bool3x4 a1 = bool3x4(true, true, false, false, true, true, true, false, true, true, false, true); + bool3x4 b1 = bool3x4(false, false, true, false, true, false, true, true, true, true, true, true); + bool3x4 r1 = bool3x4(false, false, false, false, true, false, true, false, true, true, false, true); + TestUtils.AreEqual(r1, a1 & b1); + + bool3x4 a2 = bool3x4(true, false, true, true, true, false, false, true, true, false, false, true); + bool3x4 b2 = bool3x4(true, true, true, false, false, false, true, false, false, true, true, true); + bool3x4 r2 = bool3x4(true, false, true, false, false, false, false, false, false, false, false, true); + TestUtils.AreEqual(r2, a2 & b2); + + bool3x4 a3 = bool3x4(true, false, true, false, false, false, true, false, false, true, false, true); + bool3x4 b3 = bool3x4(false, true, true, false, true, true, false, false, false, true, true, true); + bool3x4 r3 = bool3x4(false, false, true, false, false, false, false, false, false, true, false, true); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void bool3x4_operator_bitwise_and_wide_scalar() + { + bool3x4 a0 = bool3x4(true, false, false, true, true, false, false, false, false, false, true, true); + bool b0 = (true); + bool3x4 r0 = bool3x4(true, false, false, true, true, false, false, false, false, false, true, true); + TestUtils.AreEqual(r0, a0 & b0); + + bool3x4 a1 = bool3x4(true, false, true, true, true, false, true, false, true, true, true, false); + bool b1 = (false); + bool3x4 r1 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 & b1); + + bool3x4 a2 = bool3x4(false, false, false, true, false, true, false, false, false, false, true, false); + bool b2 = (false); + bool3x4 r2 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 & b2); + + bool3x4 a3 = bool3x4(true, true, false, false, true, false, true, false, true, false, true, false); + bool b3 = (false); + bool3x4 r3 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void bool3x4_operator_bitwise_and_scalar_wide() + { + bool a0 = (false); + bool3x4 b0 = bool3x4(false, false, true, true, true, false, true, false, false, false, true, false); + bool3x4 r0 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 & b0); + + bool a1 = (false); + bool3x4 b1 = bool3x4(false, true, true, true, true, false, true, true, true, true, true, false); + bool3x4 r1 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 & b1); + + bool a2 = (true); + bool3x4 b2 = bool3x4(false, true, false, false, false, true, true, true, true, true, false, true); + bool3x4 r2 = bool3x4(false, true, false, false, false, true, true, true, true, true, false, true); + TestUtils.AreEqual(r2, a2 & b2); + + bool a3 = (false); + bool3x4 b3 = bool3x4(false, true, true, true, false, true, true, true, true, true, false, false); + bool3x4 r3 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void bool3x4_operator_bitwise_or_wide_wide() + { + bool3x4 a0 = bool3x4(true, true, true, false, true, false, true, true, false, true, true, true); + bool3x4 b0 = bool3x4(false, false, false, false, true, true, true, false, false, true, false, false); + bool3x4 r0 = bool3x4(true, true, true, false, true, true, true, true, false, true, true, true); + TestUtils.AreEqual(r0, a0 | b0); + + bool3x4 a1 = bool3x4(true, true, true, false, true, true, false, true, true, false, true, false); + bool3x4 b1 = bool3x4(true, true, true, true, true, true, false, true, true, true, false, true); + bool3x4 r1 = bool3x4(true, true, true, true, true, true, false, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 | b1); + + bool3x4 a2 = bool3x4(true, true, false, true, false, false, false, false, false, false, true, true); + bool3x4 b2 = bool3x4(false, true, false, false, true, true, true, true, false, false, false, true); + bool3x4 r2 = bool3x4(true, true, false, true, true, true, true, true, false, false, true, true); + TestUtils.AreEqual(r2, a2 | b2); + + bool3x4 a3 = bool3x4(true, false, false, false, false, true, false, false, true, false, true, false); + bool3x4 b3 = bool3x4(false, false, false, true, false, false, true, true, true, true, true, false); + bool3x4 r3 = bool3x4(true, false, false, true, false, true, true, true, true, true, true, false); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void bool3x4_operator_bitwise_or_wide_scalar() + { + bool3x4 a0 = bool3x4(true, true, false, true, true, true, true, false, true, false, false, true); + bool b0 = (true); + bool3x4 r0 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 | b0); + + bool3x4 a1 = bool3x4(false, true, false, true, true, true, true, true, true, true, true, false); + bool b1 = (false); + bool3x4 r1 = bool3x4(false, true, false, true, true, true, true, true, true, true, true, false); + TestUtils.AreEqual(r1, a1 | b1); + + bool3x4 a2 = bool3x4(true, false, false, true, true, true, true, true, true, false, true, false); + bool b2 = (false); + bool3x4 r2 = bool3x4(true, false, false, true, true, true, true, true, true, false, true, false); + TestUtils.AreEqual(r2, a2 | b2); + + bool3x4 a3 = bool3x4(false, false, true, false, true, true, false, true, true, false, true, false); + bool b3 = (true); + bool3x4 r3 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void bool3x4_operator_bitwise_or_scalar_wide() + { + bool a0 = (true); + bool3x4 b0 = bool3x4(true, true, false, false, true, true, true, false, false, true, true, false); + bool3x4 r0 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 | b0); + + bool a1 = (true); + bool3x4 b1 = bool3x4(true, false, false, false, false, true, true, true, true, true, false, true); + bool3x4 r1 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 | b1); + + bool a2 = (false); + bool3x4 b2 = bool3x4(true, true, false, true, true, false, true, true, false, false, true, true); + bool3x4 r2 = bool3x4(true, true, false, true, true, false, true, true, false, false, true, true); + TestUtils.AreEqual(r2, a2 | b2); + + bool a3 = (true); + bool3x4 b3 = bool3x4(false, false, false, false, false, false, true, true, false, true, true, true); + bool3x4 r3 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void bool3x4_operator_bitwise_xor_wide_wide() + { + bool3x4 a0 = bool3x4(true, false, false, true, false, false, false, true, false, false, true, true); + bool3x4 b0 = bool3x4(true, true, false, true, false, true, false, true, false, false, false, true); + bool3x4 r0 = bool3x4(false, true, false, false, false, true, false, false, false, false, true, false); + TestUtils.AreEqual(r0, a0 ^ b0); + + bool3x4 a1 = bool3x4(false, false, true, false, true, false, false, false, true, false, true, false); + bool3x4 b1 = bool3x4(false, false, true, true, false, false, false, false, false, true, false, false); + bool3x4 r1 = bool3x4(false, false, false, true, true, false, false, false, true, true, true, false); + TestUtils.AreEqual(r1, a1 ^ b1); + + bool3x4 a2 = bool3x4(true, false, false, false, true, true, true, true, true, true, false, false); + bool3x4 b2 = bool3x4(false, true, false, true, true, false, false, true, false, true, true, false); + bool3x4 r2 = bool3x4(true, true, false, true, false, true, true, false, true, false, true, false); + TestUtils.AreEqual(r2, a2 ^ b2); + + bool3x4 a3 = bool3x4(true, true, true, true, true, true, false, true, false, false, true, true); + bool3x4 b3 = bool3x4(true, false, false, false, false, true, false, true, false, true, true, true); + bool3x4 r3 = bool3x4(false, true, true, true, true, false, false, false, false, true, false, false); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void bool3x4_operator_bitwise_xor_wide_scalar() + { + bool3x4 a0 = bool3x4(false, false, true, true, false, false, false, false, false, false, false, true); + bool b0 = (false); + bool3x4 r0 = bool3x4(false, false, true, true, false, false, false, false, false, false, false, true); + TestUtils.AreEqual(r0, a0 ^ b0); + + bool3x4 a1 = bool3x4(false, true, true, true, false, true, false, false, true, false, false, false); + bool b1 = (true); + bool3x4 r1 = bool3x4(true, false, false, false, true, false, true, true, false, true, true, true); + TestUtils.AreEqual(r1, a1 ^ b1); + + bool3x4 a2 = bool3x4(true, true, true, true, true, false, true, false, false, true, true, false); + bool b2 = (false); + bool3x4 r2 = bool3x4(true, true, true, true, true, false, true, false, false, true, true, false); + TestUtils.AreEqual(r2, a2 ^ b2); + + bool3x4 a3 = bool3x4(true, false, false, true, false, true, false, false, true, true, false, true); + bool b3 = (true); + bool3x4 r3 = bool3x4(false, true, true, false, true, false, true, true, false, false, true, false); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void bool3x4_operator_bitwise_xor_scalar_wide() + { + bool a0 = (true); + bool3x4 b0 = bool3x4(true, false, true, true, false, true, true, false, false, true, true, false); + bool3x4 r0 = bool3x4(false, true, false, false, true, false, false, true, true, false, false, true); + TestUtils.AreEqual(r0, a0 ^ b0); + + bool a1 = (false); + bool3x4 b1 = bool3x4(true, false, true, true, false, true, true, true, false, false, false, true); + bool3x4 r1 = bool3x4(true, false, true, true, false, true, true, true, false, false, false, true); + TestUtils.AreEqual(r1, a1 ^ b1); + + bool a2 = (true); + bool3x4 b2 = bool3x4(true, false, false, false, true, true, false, true, false, false, true, true); + bool3x4 r2 = bool3x4(false, true, true, true, false, false, true, false, true, true, false, false); + TestUtils.AreEqual(r2, a2 ^ b2); + + bool a3 = (true); + bool3x4 b3 = bool3x4(true, false, false, false, true, false, false, false, true, true, false, false); + bool3x4 r3 = bool3x4(false, true, true, true, false, true, true, true, false, false, true, true); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void bool3x4_operator_logical_not() + { + bool3x4 a0 = bool3x4(true, true, false, false, true, false, true, false, true, false, false, false); + bool3x4 r0 = bool3x4(false, false, true, true, false, true, false, true, false, true, true, true); + TestUtils.AreEqual(r0, !a0); + + bool3x4 a1 = bool3x4(false, true, false, false, true, true, true, false, true, true, true, false); + bool3x4 r1 = bool3x4(true, false, true, true, false, false, false, true, false, false, false, true); + TestUtils.AreEqual(r1, !a1); + + bool3x4 a2 = bool3x4(false, true, false, true, false, false, true, true, false, true, false, false); + bool3x4 r2 = bool3x4(true, false, true, false, true, true, false, false, true, false, true, true); + TestUtils.AreEqual(r2, !a2); + + bool3x4 a3 = bool3x4(false, true, true, false, false, true, false, true, false, true, false, true); + bool3x4 r3 = bool3x4(true, false, false, true, true, false, true, false, true, false, true, false); + TestUtils.AreEqual(r3, !a3); + } + + [TestCase /* For player builds */] + public static void bool3x4_EqualsObjectOverride() + { + TestUtils.IsFalse(new bool3x4().Equals((object)new int())); + TestUtils.IsTrue(new bool3x4().Equals((object)new bool3x4())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestBool3x4.gen.cs.meta b/src/Tests/Tests/Shared/TestBool3x4.gen.cs.meta new file mode 100644 index 00000000..3a709170 --- /dev/null +++ b/src/Tests/Tests/Shared/TestBool3x4.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ce96cd62cfbd7e24c9173437069a42ad +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestBool4.gen.cs b/src/Tests/Tests/Shared/TestBool4.gen.cs new file mode 100644 index 00000000..c2c8be05 --- /dev/null +++ b/src/Tests/Tests/Shared/TestBool4.gen.cs @@ -0,0 +1,447 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestBool4 + { + [TestCompiler] + public static void bool4_constructor() + { + bool4 a = new bool4(false, true, false, true); + TestUtils.AreEqual(false, a.x); + TestUtils.AreEqual(true, a.y); + TestUtils.AreEqual(false, a.z); + TestUtils.AreEqual(true, a.w); + } + + [TestCompiler] + public static void bool4_scalar_constructor() + { + bool4 a = new bool4(true); + TestUtils.AreEqual(true, a.x); + TestUtils.AreEqual(true, a.y); + TestUtils.AreEqual(true, a.z); + TestUtils.AreEqual(true, a.w); + } + + [TestCompiler] + public static void bool4_static_constructor() + { + bool4 a = bool4(false, true, false, true); + TestUtils.AreEqual(false, a.x); + TestUtils.AreEqual(true, a.y); + TestUtils.AreEqual(false, a.z); + TestUtils.AreEqual(true, a.w); + } + + [TestCompiler] + public static void bool4_static_scalar_constructor() + { + bool4 a = bool4(true); + TestUtils.AreEqual(true, a.x); + TestUtils.AreEqual(true, a.y); + TestUtils.AreEqual(true, a.z); + TestUtils.AreEqual(true, a.w); + } + + [TestCompiler] + public static void bool4_operator_equal_wide_wide() + { + bool4 a0 = bool4(true, false, true, false); + bool4 b0 = bool4(true, false, false, false); + bool4 r0 = bool4(true, true, false, true); + TestUtils.AreEqual(r0, a0 == b0); + + bool4 a1 = bool4(false, true, false, false); + bool4 b1 = bool4(true, false, false, true); + bool4 r1 = bool4(false, false, true, false); + TestUtils.AreEqual(r1, a1 == b1); + + bool4 a2 = bool4(true, false, true, false); + bool4 b2 = bool4(false, false, false, false); + bool4 r2 = bool4(false, true, false, true); + TestUtils.AreEqual(r2, a2 == b2); + + bool4 a3 = bool4(true, true, false, true); + bool4 b3 = bool4(true, false, false, false); + bool4 r3 = bool4(true, false, true, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void bool4_operator_equal_wide_scalar() + { + bool4 a0 = bool4(false, true, false, false); + bool b0 = (true); + bool4 r0 = bool4(false, true, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + bool4 a1 = bool4(false, true, false, false); + bool b1 = (false); + bool4 r1 = bool4(true, false, true, true); + TestUtils.AreEqual(r1, a1 == b1); + + bool4 a2 = bool4(false, true, false, true); + bool b2 = (true); + bool4 r2 = bool4(false, true, false, true); + TestUtils.AreEqual(r2, a2 == b2); + + bool4 a3 = bool4(false, false, false, false); + bool b3 = (true); + bool4 r3 = bool4(false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void bool4_operator_equal_scalar_wide() + { + bool a0 = (false); + bool4 b0 = bool4(true, false, true, false); + bool4 r0 = bool4(false, true, false, true); + TestUtils.AreEqual(r0, a0 == b0); + + bool a1 = (false); + bool4 b1 = bool4(true, false, false, true); + bool4 r1 = bool4(false, true, true, false); + TestUtils.AreEqual(r1, a1 == b1); + + bool a2 = (false); + bool4 b2 = bool4(true, true, false, true); + bool4 r2 = bool4(false, false, true, false); + TestUtils.AreEqual(r2, a2 == b2); + + bool a3 = (false); + bool4 b3 = bool4(true, true, true, false); + bool4 r3 = bool4(false, false, false, true); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void bool4_operator_not_equal_wide_wide() + { + bool4 a0 = bool4(true, true, true, false); + bool4 b0 = bool4(true, false, false, false); + bool4 r0 = bool4(false, true, true, false); + TestUtils.AreEqual(r0, a0 != b0); + + bool4 a1 = bool4(false, true, false, false); + bool4 b1 = bool4(true, false, false, false); + bool4 r1 = bool4(true, true, false, false); + TestUtils.AreEqual(r1, a1 != b1); + + bool4 a2 = bool4(false, false, true, true); + bool4 b2 = bool4(false, true, true, true); + bool4 r2 = bool4(false, true, false, false); + TestUtils.AreEqual(r2, a2 != b2); + + bool4 a3 = bool4(true, true, true, true); + bool4 b3 = bool4(false, false, true, true); + bool4 r3 = bool4(true, true, false, false); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void bool4_operator_not_equal_wide_scalar() + { + bool4 a0 = bool4(false, true, false, true); + bool b0 = (false); + bool4 r0 = bool4(false, true, false, true); + TestUtils.AreEqual(r0, a0 != b0); + + bool4 a1 = bool4(true, false, false, false); + bool b1 = (false); + bool4 r1 = bool4(true, false, false, false); + TestUtils.AreEqual(r1, a1 != b1); + + bool4 a2 = bool4(false, false, false, true); + bool b2 = (false); + bool4 r2 = bool4(false, false, false, true); + TestUtils.AreEqual(r2, a2 != b2); + + bool4 a3 = bool4(false, false, false, true); + bool b3 = (false); + bool4 r3 = bool4(false, false, false, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void bool4_operator_not_equal_scalar_wide() + { + bool a0 = (true); + bool4 b0 = bool4(false, false, true, false); + bool4 r0 = bool4(true, true, false, true); + TestUtils.AreEqual(r0, a0 != b0); + + bool a1 = (false); + bool4 b1 = bool4(false, true, true, true); + bool4 r1 = bool4(false, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + bool a2 = (false); + bool4 b2 = bool4(false, false, false, false); + bool4 r2 = bool4(false, false, false, false); + TestUtils.AreEqual(r2, a2 != b2); + + bool a3 = (true); + bool4 b3 = bool4(false, false, true, false); + bool4 r3 = bool4(true, true, false, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void bool4_operator_bitwise_and_wide_wide() + { + bool4 a0 = bool4(false, false, true, true); + bool4 b0 = bool4(false, false, true, false); + bool4 r0 = bool4(false, false, true, false); + TestUtils.AreEqual(r0, a0 & b0); + + bool4 a1 = bool4(false, false, true, true); + bool4 b1 = bool4(true, true, false, false); + bool4 r1 = bool4(false, false, false, false); + TestUtils.AreEqual(r1, a1 & b1); + + bool4 a2 = bool4(true, false, true, true); + bool4 b2 = bool4(true, true, false, false); + bool4 r2 = bool4(true, false, false, false); + TestUtils.AreEqual(r2, a2 & b2); + + bool4 a3 = bool4(true, true, false, false); + bool4 b3 = bool4(false, false, true, false); + bool4 r3 = bool4(false, false, false, false); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void bool4_operator_bitwise_and_wide_scalar() + { + bool4 a0 = bool4(true, false, false, true); + bool b0 = (true); + bool4 r0 = bool4(true, false, false, true); + TestUtils.AreEqual(r0, a0 & b0); + + bool4 a1 = bool4(true, false, false, false); + bool b1 = (false); + bool4 r1 = bool4(false, false, false, false); + TestUtils.AreEqual(r1, a1 & b1); + + bool4 a2 = bool4(false, true, true, false); + bool b2 = (true); + bool4 r2 = bool4(false, true, true, false); + TestUtils.AreEqual(r2, a2 & b2); + + bool4 a3 = bool4(false, true, true, false); + bool b3 = (true); + bool4 r3 = bool4(false, true, true, false); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void bool4_operator_bitwise_and_scalar_wide() + { + bool a0 = (false); + bool4 b0 = bool4(false, false, true, true); + bool4 r0 = bool4(false, false, false, false); + TestUtils.AreEqual(r0, a0 & b0); + + bool a1 = (true); + bool4 b1 = bool4(false, true, false, false); + bool4 r1 = bool4(false, true, false, false); + TestUtils.AreEqual(r1, a1 & b1); + + bool a2 = (false); + bool4 b2 = bool4(true, false, false, false); + bool4 r2 = bool4(false, false, false, false); + TestUtils.AreEqual(r2, a2 & b2); + + bool a3 = (true); + bool4 b3 = bool4(true, true, true, false); + bool4 r3 = bool4(true, true, true, false); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void bool4_operator_bitwise_or_wide_wide() + { + bool4 a0 = bool4(true, true, true, false); + bool4 b0 = bool4(false, false, false, false); + bool4 r0 = bool4(true, true, true, false); + TestUtils.AreEqual(r0, a0 | b0); + + bool4 a1 = bool4(true, false, true, true); + bool4 b1 = bool4(true, true, true, false); + bool4 r1 = bool4(true, true, true, true); + TestUtils.AreEqual(r1, a1 | b1); + + bool4 a2 = bool4(false, true, true, true); + bool4 b2 = bool4(false, true, false, false); + bool4 r2 = bool4(false, true, true, true); + TestUtils.AreEqual(r2, a2 | b2); + + bool4 a3 = bool4(true, true, true, false); + bool4 b3 = bool4(true, true, true, true); + bool4 r3 = bool4(true, true, true, true); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void bool4_operator_bitwise_or_wide_scalar() + { + bool4 a0 = bool4(true, true, false, true); + bool b0 = (true); + bool4 r0 = bool4(true, true, true, true); + TestUtils.AreEqual(r0, a0 | b0); + + bool4 a1 = bool4(true, true, false, true); + bool b1 = (true); + bool4 r1 = bool4(true, true, true, true); + TestUtils.AreEqual(r1, a1 | b1); + + bool4 a2 = bool4(false, true, false, false); + bool b2 = (false); + bool4 r2 = bool4(false, true, false, false); + TestUtils.AreEqual(r2, a2 | b2); + + bool4 a3 = bool4(true, true, true, true); + bool b3 = (false); + bool4 r3 = bool4(true, true, true, true); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void bool4_operator_bitwise_or_scalar_wide() + { + bool a0 = (true); + bool4 b0 = bool4(true, true, false, false); + bool4 r0 = bool4(true, true, true, true); + TestUtils.AreEqual(r0, a0 | b0); + + bool a1 = (true); + bool4 b1 = bool4(true, true, false, false); + bool4 r1 = bool4(true, true, true, true); + TestUtils.AreEqual(r1, a1 | b1); + + bool a2 = (true); + bool4 b2 = bool4(true, false, true, true); + bool4 r2 = bool4(true, true, true, true); + TestUtils.AreEqual(r2, a2 | b2); + + bool a3 = (false); + bool4 b3 = bool4(false, false, false, true); + bool4 r3 = bool4(false, false, false, true); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void bool4_operator_bitwise_xor_wide_wide() + { + bool4 a0 = bool4(true, false, false, true); + bool4 b0 = bool4(true, true, false, true); + bool4 r0 = bool4(false, true, false, false); + TestUtils.AreEqual(r0, a0 ^ b0); + + bool4 a1 = bool4(false, false, false, true); + bool4 b1 = bool4(false, true, false, true); + bool4 r1 = bool4(false, true, false, false); + TestUtils.AreEqual(r1, a1 ^ b1); + + bool4 a2 = bool4(false, false, true, true); + bool4 b2 = bool4(false, false, false, true); + bool4 r2 = bool4(false, false, true, false); + TestUtils.AreEqual(r2, a2 ^ b2); + + bool4 a3 = bool4(false, false, true, false); + bool4 b3 = bool4(false, false, true, true); + bool4 r3 = bool4(false, false, false, true); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void bool4_operator_bitwise_xor_wide_scalar() + { + bool4 a0 = bool4(false, false, true, true); + bool b0 = (false); + bool4 r0 = bool4(false, false, true, true); + TestUtils.AreEqual(r0, a0 ^ b0); + + bool4 a1 = bool4(false, false, false, false); + bool b1 = (false); + bool4 r1 = bool4(false, false, false, false); + TestUtils.AreEqual(r1, a1 ^ b1); + + bool4 a2 = bool4(false, true, false, true); + bool b2 = (false); + bool4 r2 = bool4(false, true, false, true); + TestUtils.AreEqual(r2, a2 ^ b2); + + bool4 a3 = bool4(true, true, false, true); + bool b3 = (true); + bool4 r3 = bool4(false, false, true, false); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void bool4_operator_bitwise_xor_scalar_wide() + { + bool a0 = (true); + bool4 b0 = bool4(true, false, true, true); + bool4 r0 = bool4(false, true, false, false); + TestUtils.AreEqual(r0, a0 ^ b0); + + bool a1 = (false); + bool4 b1 = bool4(true, true, false, false); + bool4 r1 = bool4(true, true, false, false); + TestUtils.AreEqual(r1, a1 ^ b1); + + bool a2 = (true); + bool4 b2 = bool4(true, false, false, true); + bool4 r2 = bool4(false, true, true, false); + TestUtils.AreEqual(r2, a2 ^ b2); + + bool a3 = (false); + bool4 b3 = bool4(true, true, false, true); + bool4 r3 = bool4(true, true, false, true); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void bool4_operator_logical_not() + { + bool4 a0 = bool4(true, true, false, false); + bool4 r0 = bool4(false, false, true, true); + TestUtils.AreEqual(r0, !a0); + + bool4 a1 = bool4(true, true, false, true); + bool4 r1 = bool4(false, false, true, false); + TestUtils.AreEqual(r1, !a1); + + bool4 a2 = bool4(false, false, false, true); + bool4 r2 = bool4(true, true, true, false); + TestUtils.AreEqual(r2, !a2); + + bool4 a3 = bool4(true, false, true, true); + bool4 r3 = bool4(false, true, false, false); + TestUtils.AreEqual(r3, !a3); + } + + [TestCase /* For player builds */] + public static void bool4_EqualsObjectOverride() + { + TestUtils.IsFalse(new bool4().Equals((object)new int())); + TestUtils.IsTrue(new bool4().Equals((object)new bool4())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestBool4.gen.cs.meta b/src/Tests/Tests/Shared/TestBool4.gen.cs.meta new file mode 100644 index 00000000..0cecba96 --- /dev/null +++ b/src/Tests/Tests/Shared/TestBool4.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 33a8df9e636ae004ba204e2a6b925b42 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestBool4x2.gen.cs b/src/Tests/Tests/Shared/TestBool4x2.gen.cs new file mode 100644 index 00000000..40511294 --- /dev/null +++ b/src/Tests/Tests/Shared/TestBool4x2.gen.cs @@ -0,0 +1,407 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestBool4x2 + { + [TestCompiler] + public static void bool4x2_operator_equal_wide_wide() + { + bool4x2 a0 = bool4x2(true, false, true, false, false, true, false, false); + bool4x2 b0 = bool4x2(true, false, false, false, true, false, false, true); + bool4x2 r0 = bool4x2(true, true, false, true, false, false, true, false); + TestUtils.AreEqual(r0, a0 == b0); + + bool4x2 a1 = bool4x2(true, false, true, false, true, true, false, true); + bool4x2 b1 = bool4x2(false, false, false, false, true, false, false, false); + bool4x2 r1 = bool4x2(false, true, false, true, true, false, true, false); + TestUtils.AreEqual(r1, a1 == b1); + + bool4x2 a2 = bool4x2(true, false, false, true, true, true, false, true); + bool4x2 b2 = bool4x2(true, false, false, true, false, true, false, true); + bool4x2 r2 = bool4x2(true, true, true, true, false, true, true, true); + TestUtils.AreEqual(r2, a2 == b2); + + bool4x2 a3 = bool4x2(true, true, false, true, true, true, false, true); + bool4x2 b3 = bool4x2(true, true, true, true, true, false, false, false); + bool4x2 r3 = bool4x2(true, true, false, true, true, false, true, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void bool4x2_operator_equal_wide_scalar() + { + bool4x2 a0 = bool4x2(false, true, false, false, false, false, true, false); + bool b0 = (true); + bool4x2 r0 = bool4x2(false, true, false, false, false, false, true, false); + TestUtils.AreEqual(r0, a0 == b0); + + bool4x2 a1 = bool4x2(false, true, true, false, true, false, true, false); + bool b1 = (false); + bool4x2 r1 = bool4x2(true, false, false, true, false, true, false, true); + TestUtils.AreEqual(r1, a1 == b1); + + bool4x2 a2 = bool4x2(false, true, false, false, false, false, false, false); + bool b2 = (false); + bool4x2 r2 = bool4x2(true, false, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 == b2); + + bool4x2 a3 = bool4x2(false, false, false, false, false, true, true, false); + bool b3 = (false); + bool4x2 r3 = bool4x2(true, true, true, true, true, false, false, true); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void bool4x2_operator_equal_scalar_wide() + { + bool a0 = (false); + bool4x2 b0 = bool4x2(true, false, true, false, false, true, false, false); + bool4x2 r0 = bool4x2(false, true, false, true, true, false, true, true); + TestUtils.AreEqual(r0, a0 == b0); + + bool a1 = (true); + bool4x2 b1 = bool4x2(false, true, true, false, true, false, true, true); + bool4x2 r1 = bool4x2(false, true, true, false, true, false, true, true); + TestUtils.AreEqual(r1, a1 == b1); + + bool a2 = (true); + bool4x2 b2 = bool4x2(false, false, true, false, true, true, false, true); + bool4x2 r2 = bool4x2(false, false, true, false, true, true, false, true); + TestUtils.AreEqual(r2, a2 == b2); + + bool a3 = (true); + bool4x2 b3 = bool4x2(true, true, true, true, false, true, true, false); + bool4x2 r3 = bool4x2(true, true, true, true, false, true, true, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void bool4x2_operator_not_equal_wide_wide() + { + bool4x2 a0 = bool4x2(true, true, true, false, false, true, false, false); + bool4x2 b0 = bool4x2(true, false, false, false, true, false, false, false); + bool4x2 r0 = bool4x2(false, true, true, false, true, true, false, false); + TestUtils.AreEqual(r0, a0 != b0); + + bool4x2 a1 = bool4x2(false, false, true, true, true, true, true, true); + bool4x2 b1 = bool4x2(false, true, true, true, false, false, true, true); + bool4x2 r1 = bool4x2(false, true, false, false, true, true, false, false); + TestUtils.AreEqual(r1, a1 != b1); + + bool4x2 a2 = bool4x2(true, true, false, true, false, true, true, true); + bool4x2 b2 = bool4x2(true, false, true, true, false, false, true, false); + bool4x2 r2 = bool4x2(false, true, true, false, false, true, false, true); + TestUtils.AreEqual(r2, a2 != b2); + + bool4x2 a3 = bool4x2(true, false, false, true, false, true, true, true); + bool4x2 b3 = bool4x2(false, false, true, false, true, false, true, false); + bool4x2 r3 = bool4x2(true, false, true, true, true, true, false, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void bool4x2_operator_not_equal_wide_scalar() + { + bool4x2 a0 = bool4x2(false, true, false, true, true, false, false, false); + bool b0 = (false); + bool4x2 r0 = bool4x2(false, true, false, true, true, false, false, false); + TestUtils.AreEqual(r0, a0 != b0); + + bool4x2 a1 = bool4x2(false, false, false, false, true, false, false, false); + bool b1 = (false); + bool4x2 r1 = bool4x2(false, false, false, false, true, false, false, false); + TestUtils.AreEqual(r1, a1 != b1); + + bool4x2 a2 = bool4x2(false, true, false, true, true, true, true, true); + bool b2 = (true); + bool4x2 r2 = bool4x2(true, false, true, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 != b2); + + bool4x2 a3 = bool4x2(true, true, true, true, false, false, true, false); + bool b3 = (false); + bool4x2 r3 = bool4x2(true, true, true, true, false, false, true, false); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void bool4x2_operator_not_equal_scalar_wide() + { + bool a0 = (true); + bool4x2 b0 = bool4x2(false, false, true, false, false, false, true, true); + bool4x2 r0 = bool4x2(true, true, false, true, true, true, false, false); + TestUtils.AreEqual(r0, a0 != b0); + + bool a1 = (true); + bool4x2 b1 = bool4x2(false, false, false, false, false, true, false, false); + bool4x2 r1 = bool4x2(true, true, true, true, true, false, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + bool a2 = (true); + bool4x2 b2 = bool4x2(false, false, false, true, true, false, false, true); + bool4x2 r2 = bool4x2(true, true, true, false, false, true, true, false); + TestUtils.AreEqual(r2, a2 != b2); + + bool a3 = (false); + bool4x2 b3 = bool4x2(false, true, true, false, true, false, false, true); + bool4x2 r3 = bool4x2(false, true, true, false, true, false, false, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void bool4x2_operator_bitwise_and_wide_wide() + { + bool4x2 a0 = bool4x2(false, false, true, true, false, false, true, true); + bool4x2 b0 = bool4x2(false, false, true, false, true, true, false, false); + bool4x2 r0 = bool4x2(false, false, true, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 & b0); + + bool4x2 a1 = bool4x2(true, false, true, true, true, true, false, false); + bool4x2 b1 = bool4x2(true, true, false, false, false, false, true, false); + bool4x2 r1 = bool4x2(true, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 & b1); + + bool4x2 a2 = bool4x2(true, true, true, false, true, true, false, true); + bool4x2 b2 = bool4x2(true, false, true, true, true, true, true, true); + bool4x2 r2 = bool4x2(true, false, true, false, true, true, false, true); + TestUtils.AreEqual(r2, a2 & b2); + + bool4x2 a3 = bool4x2(true, false, true, true, true, false, false, true); + bool4x2 b3 = bool4x2(true, true, true, false, false, false, true, false); + bool4x2 r3 = bool4x2(true, false, true, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void bool4x2_operator_bitwise_and_wide_scalar() + { + bool4x2 a0 = bool4x2(true, false, false, true, true, false, false, false); + bool b0 = (true); + bool4x2 r0 = bool4x2(true, false, false, true, true, false, false, false); + TestUtils.AreEqual(r0, a0 & b0); + + bool4x2 a1 = bool4x2(false, true, true, true, false, false, true, true); + bool b1 = (false); + bool4x2 r1 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 & b1); + + bool4x2 a2 = bool4x2(true, true, false, true, true, true, false, false); + bool b2 = (false); + bool4x2 r2 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 & b2); + + bool4x2 a3 = bool4x2(false, false, true, false, true, false, false, false); + bool b3 = (false); + bool4x2 r3 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void bool4x2_operator_bitwise_and_scalar_wide() + { + bool a0 = (false); + bool4x2 b0 = bool4x2(false, false, true, true, true, false, true, false); + bool4x2 r0 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 & b0); + + bool a1 = (false); + bool4x2 b1 = bool4x2(false, true, false, false, false, true, true, true); + bool4x2 r1 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 & b1); + + bool a2 = (true); + bool4x2 b2 = bool4x2(false, true, true, true, true, true, false, true); + bool4x2 r2 = bool4x2(false, true, true, true, true, true, false, true); + TestUtils.AreEqual(r2, a2 & b2); + + bool a3 = (false); + bool4x2 b3 = bool4x2(true, false, false, false, true, true, true, true); + bool4x2 r3 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void bool4x2_operator_bitwise_or_wide_wide() + { + bool4x2 a0 = bool4x2(true, true, true, false, true, false, true, true); + bool4x2 b0 = bool4x2(false, false, false, false, true, true, true, false); + bool4x2 r0 = bool4x2(true, true, true, false, true, true, true, true); + TestUtils.AreEqual(r0, a0 | b0); + + bool4x2 a1 = bool4x2(false, true, true, true, true, true, true, false); + bool4x2 b1 = bool4x2(false, true, false, false, true, true, true, true); + bool4x2 r1 = bool4x2(false, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 | b1); + + bool4x2 a2 = bool4x2(true, true, false, true, true, false, true, false); + bool4x2 b2 = bool4x2(true, true, false, true, true, true, false, true); + bool4x2 r2 = bool4x2(true, true, false, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 | b2); + + bool4x2 a3 = bool4x2(true, true, false, true, false, false, false, false); + bool4x2 b3 = bool4x2(false, true, false, false, true, true, true, true); + bool4x2 r3 = bool4x2(true, true, false, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void bool4x2_operator_bitwise_or_wide_scalar() + { + bool4x2 a0 = bool4x2(true, true, false, true, true, true, true, false); + bool b0 = (true); + bool4x2 r0 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 | b0); + + bool4x2 a1 = bool4x2(true, false, true, false, false, true, false, true); + bool b1 = (false); + bool4x2 r1 = bool4x2(true, false, true, false, false, true, false, true); + TestUtils.AreEqual(r1, a1 | b1); + + bool4x2 a2 = bool4x2(true, true, true, true, true, true, false, true); + bool b2 = (true); + bool4x2 r2 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 | b2); + + bool4x2 a3 = bool4x2(false, false, true, true, true, true, true, true); + bool b3 = (false); + bool4x2 r3 = bool4x2(false, false, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void bool4x2_operator_bitwise_or_scalar_wide() + { + bool a0 = (true); + bool4x2 b0 = bool4x2(true, true, false, false, true, true, true, false); + bool4x2 r0 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 | b0); + + bool a1 = (false); + bool4x2 b1 = bool4x2(true, true, false, true, true, false, false, false); + bool4x2 r1 = bool4x2(true, true, false, true, true, false, false, false); + TestUtils.AreEqual(r1, a1 | b1); + + bool a2 = (false); + bool4x2 b2 = bool4x2(true, true, true, true, true, false, true, false); + bool4x2 r2 = bool4x2(true, true, true, true, true, false, true, false); + TestUtils.AreEqual(r2, a2 | b2); + + bool a3 = (true); + bool4x2 b3 = bool4x2(true, false, true, true, false, true, true, false); + bool4x2 r3 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void bool4x2_operator_bitwise_xor_wide_wide() + { + bool4x2 a0 = bool4x2(true, false, false, true, false, false, false, true); + bool4x2 b0 = bool4x2(true, true, false, true, false, true, false, true); + bool4x2 r0 = bool4x2(false, true, false, false, false, true, false, false); + TestUtils.AreEqual(r0, a0 ^ b0); + + bool4x2 a1 = bool4x2(false, false, true, true, false, false, true, false); + bool4x2 b1 = bool4x2(false, false, false, true, false, false, true, true); + bool4x2 r1 = bool4x2(false, false, true, false, false, false, false, true); + TestUtils.AreEqual(r1, a1 ^ b1); + + bool4x2 a2 = bool4x2(true, false, false, false, true, false, true, false); + bool4x2 b2 = bool4x2(false, false, false, false, false, true, false, false); + bool4x2 r2 = bool4x2(true, false, false, false, true, true, true, false); + TestUtils.AreEqual(r2, a2 ^ b2); + + bool4x2 a3 = bool4x2(true, false, false, false, true, true, true, true); + bool4x2 b3 = bool4x2(false, true, false, true, true, false, false, true); + bool4x2 r3 = bool4x2(true, true, false, true, false, true, true, false); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void bool4x2_operator_bitwise_xor_wide_scalar() + { + bool4x2 a0 = bool4x2(false, false, true, true, false, false, false, false); + bool b0 = (false); + bool4x2 r0 = bool4x2(false, false, true, true, false, false, false, false); + TestUtils.AreEqual(r0, a0 ^ b0); + + bool4x2 a1 = bool4x2(false, false, true, false, true, true, true, true); + bool b1 = (false); + bool4x2 r1 = bool4x2(false, false, true, false, true, true, true, true); + TestUtils.AreEqual(r1, a1 ^ b1); + + bool4x2 a2 = bool4x2(false, false, false, true, false, false, false, true); + bool b2 = (true); + bool4x2 r2 = bool4x2(true, true, true, false, true, true, true, false); + TestUtils.AreEqual(r2, a2 ^ b2); + + bool4x2 a3 = bool4x2(false, true, true, true, false, true, false, false); + bool b3 = (true); + bool4x2 r3 = bool4x2(true, false, false, false, true, false, true, true); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void bool4x2_operator_bitwise_xor_scalar_wide() + { + bool a0 = (true); + bool4x2 b0 = bool4x2(true, false, true, true, false, true, true, false); + bool4x2 r0 = bool4x2(false, true, false, false, true, false, false, true); + TestUtils.AreEqual(r0, a0 ^ b0); + + bool a1 = (false); + bool4x2 b1 = bool4x2(true, true, false, false, true, false, true, true); + bool4x2 r1 = bool4x2(true, true, false, false, true, false, true, true); + TestUtils.AreEqual(r1, a1 ^ b1); + + bool a2 = (false); + bool4x2 b2 = bool4x2(true, true, true, false, false, false, true, true); + bool4x2 r2 = bool4x2(true, true, true, false, false, false, true, true); + TestUtils.AreEqual(r2, a2 ^ b2); + + bool a3 = (true); + bool4x2 b3 = bool4x2(false, false, false, true, true, false, true, false); + bool4x2 r3 = bool4x2(true, true, true, false, false, true, false, true); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void bool4x2_operator_logical_not() + { + bool4x2 a0 = bool4x2(true, true, false, false, true, false, true, false); + bool4x2 r0 = bool4x2(false, false, true, true, false, true, false, true); + TestUtils.AreEqual(r0, !a0); + + bool4x2 a1 = bool4x2(true, false, false, false, true, true, false, false); + bool4x2 r1 = bool4x2(false, true, true, true, false, false, true, true); + TestUtils.AreEqual(r1, !a1); + + bool4x2 a2 = bool4x2(true, true, false, true, true, true, false, false); + bool4x2 r2 = bool4x2(false, false, true, false, false, false, true, true); + TestUtils.AreEqual(r2, !a2); + + bool4x2 a3 = bool4x2(false, false, true, false, false, true, true, false); + bool4x2 r3 = bool4x2(true, true, false, true, true, false, false, true); + TestUtils.AreEqual(r3, !a3); + } + + [TestCase /* For player builds */] + public static void bool4x2_EqualsObjectOverride() + { + TestUtils.IsFalse(new bool4x2().Equals((object)new int())); + TestUtils.IsTrue(new bool4x2().Equals((object)new bool4x2())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestBool4x2.gen.cs.meta b/src/Tests/Tests/Shared/TestBool4x2.gen.cs.meta new file mode 100644 index 00000000..1893ebc0 --- /dev/null +++ b/src/Tests/Tests/Shared/TestBool4x2.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c7ec685ec2ccae14a851a50b1bcbebfa +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestBool4x3.gen.cs b/src/Tests/Tests/Shared/TestBool4x3.gen.cs new file mode 100644 index 00000000..ea0d9fe2 --- /dev/null +++ b/src/Tests/Tests/Shared/TestBool4x3.gen.cs @@ -0,0 +1,407 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestBool4x3 + { + [TestCompiler] + public static void bool4x3_operator_equal_wide_wide() + { + bool4x3 a0 = bool4x3(true, false, true, false, false, true, false, false, true, false, true, false); + bool4x3 b0 = bool4x3(true, false, false, false, true, false, false, true, false, false, false, false); + bool4x3 r0 = bool4x3(true, true, false, true, false, false, true, false, false, true, false, true); + TestUtils.AreEqual(r0, a0 == b0); + + bool4x3 a1 = bool4x3(true, true, false, true, true, false, false, true, true, true, false, true); + bool4x3 b1 = bool4x3(true, false, false, false, true, false, false, true, false, true, false, true); + bool4x3 r1 = bool4x3(true, false, true, false, true, true, true, true, false, true, true, true); + TestUtils.AreEqual(r1, a1 == b1); + + bool4x3 a2 = bool4x3(true, true, false, true, true, true, false, true, false, true, false, true); + bool4x3 b2 = bool4x3(true, true, true, true, true, false, false, false, false, true, false, false); + bool4x3 r2 = bool4x3(true, true, false, true, true, false, true, false, true, true, true, false); + TestUtils.AreEqual(r2, a2 == b2); + + bool4x3 a3 = bool4x3(false, true, true, false, true, false, false, false, false, true, true, false); + bool4x3 b3 = bool4x3(true, true, false, true, false, false, false, true, true, true, true, false); + bool4x3 r3 = bool4x3(false, true, false, false, false, true, true, false, false, true, true, true); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void bool4x3_operator_equal_wide_scalar() + { + bool4x3 a0 = bool4x3(false, true, false, false, false, false, true, false, false, false, true, true); + bool b0 = (true); + bool4x3 r0 = bool4x3(false, true, false, false, false, false, true, false, false, false, true, true); + TestUtils.AreEqual(r0, a0 == b0); + + bool4x3 a1 = bool4x3(false, false, true, false, false, false, true, false, false, false, false, false); + bool b1 = (true); + bool4x3 r1 = bool4x3(false, false, true, false, false, false, true, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + bool4x3 a2 = bool4x3(false, false, false, false, false, false, true, true, false, false, false, false); + bool b2 = (false); + bool4x3 r2 = bool4x3(true, true, true, true, true, true, false, false, true, true, true, true); + TestUtils.AreEqual(r2, a2 == b2); + + bool4x3 a3 = bool4x3(true, false, true, true, false, false, true, false, true, true, false, false); + bool b3 = (true); + bool4x3 r3 = bool4x3(true, false, true, true, false, false, true, false, true, true, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void bool4x3_operator_equal_scalar_wide() + { + bool a0 = (false); + bool4x3 b0 = bool4x3(true, false, true, false, false, true, false, false, true, false, true, true); + bool4x3 r0 = bool4x3(false, true, false, true, true, false, true, true, false, true, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + bool a1 = (false); + bool4x3 b1 = bool4x3(true, false, true, true, true, false, false, true, false, true, true, false); + bool4x3 r1 = bool4x3(false, true, false, false, false, true, true, false, true, false, false, true); + TestUtils.AreEqual(r1, a1 == b1); + + bool a2 = (true); + bool4x3 b2 = bool4x3(true, true, true, true, true, false, true, true, false, false, false, true); + bool4x3 r2 = bool4x3(true, true, true, true, true, false, true, true, false, false, false, true); + TestUtils.AreEqual(r2, a2 == b2); + + bool a3 = (true); + bool4x3 b3 = bool4x3(true, false, true, true, true, false, false, true, false, true, true, false); + bool4x3 r3 = bool4x3(true, false, true, true, true, false, false, true, false, true, true, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void bool4x3_operator_not_equal_wide_wide() + { + bool4x3 a0 = bool4x3(true, true, true, false, false, true, false, false, false, false, true, true); + bool4x3 b0 = bool4x3(true, false, false, false, true, false, false, false, false, true, true, true); + bool4x3 r0 = bool4x3(false, true, true, false, true, true, false, false, false, true, false, false); + TestUtils.AreEqual(r0, a0 != b0); + + bool4x3 a1 = bool4x3(true, true, true, true, true, true, false, true, false, true, true, true); + bool4x3 b1 = bool4x3(false, false, true, true, true, false, true, true, false, false, true, false); + bool4x3 r1 = bool4x3(true, true, false, false, false, true, true, false, false, true, false, true); + TestUtils.AreEqual(r1, a1 != b1); + + bool4x3 a2 = bool4x3(true, false, false, true, false, true, true, true, true, true, false, true); + bool4x3 b2 = bool4x3(false, false, true, false, true, false, true, false, false, false, false, false); + bool4x3 r2 = bool4x3(true, false, true, true, true, true, false, true, true, true, false, true); + TestUtils.AreEqual(r2, a2 != b2); + + bool4x3 a3 = bool4x3(true, true, true, false, true, true, true, false, true, false, false, false); + bool4x3 b3 = bool4x3(false, true, false, true, false, true, false, false, false, true, false, false); + bool4x3 r3 = bool4x3(true, false, true, true, true, false, true, false, true, true, false, false); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void bool4x3_operator_not_equal_wide_scalar() + { + bool4x3 a0 = bool4x3(false, true, false, true, true, false, false, false, false, false, false, false); + bool b0 = (false); + bool4x3 r0 = bool4x3(false, true, false, true, true, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 != b0); + + bool4x3 a1 = bool4x3(false, false, false, false, false, true, true, false, true, true, true, true); + bool b1 = (true); + bool4x3 r1 = bool4x3(true, true, true, true, true, false, false, true, false, false, false, false); + TestUtils.AreEqual(r1, a1 != b1); + + bool4x3 a2 = bool4x3(true, false, true, true, true, false, false, true, false, true, false, true); + bool b2 = (true); + bool4x3 r2 = bool4x3(false, true, false, false, false, true, true, false, true, false, true, false); + TestUtils.AreEqual(r2, a2 != b2); + + bool4x3 a3 = bool4x3(false, false, true, true, true, false, false, true, false, true, false, true); + bool b3 = (false); + bool4x3 r3 = bool4x3(false, false, true, true, true, false, false, true, false, true, false, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void bool4x3_operator_not_equal_scalar_wide() + { + bool a0 = (true); + bool4x3 b0 = bool4x3(false, false, true, false, false, false, true, true, true, false, false, false); + bool4x3 r0 = bool4x3(true, true, false, true, true, true, false, false, false, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + bool a1 = (false); + bool4x3 b1 = bool4x3(false, true, false, false, true, false, false, false, true, true, false, false); + bool4x3 r1 = bool4x3(false, true, false, false, true, false, false, false, true, true, false, false); + TestUtils.AreEqual(r1, a1 != b1); + + bool a2 = (true); + bool4x3 b2 = bool4x3(false, false, true, true, false, true, false, false, true, true, true, true); + bool4x3 r2 = bool4x3(true, true, false, false, true, false, true, true, false, false, false, false); + TestUtils.AreEqual(r2, a2 != b2); + + bool a3 = (true); + bool4x3 b3 = bool4x3(true, true, true, false, false, true, true, false, false, false, true, true); + bool4x3 r3 = bool4x3(false, false, false, true, true, false, false, true, true, true, false, false); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void bool4x3_operator_bitwise_and_wide_wide() + { + bool4x3 a0 = bool4x3(false, false, true, true, false, false, true, true, true, false, true, true); + bool4x3 b0 = bool4x3(false, false, true, false, true, true, false, false, true, true, false, false); + bool4x3 r0 = bool4x3(false, false, true, false, false, false, false, false, true, false, false, false); + TestUtils.AreEqual(r0, a0 & b0); + + bool4x3 a1 = bool4x3(true, true, false, false, true, true, true, false, true, true, false, true); + bool4x3 b1 = bool4x3(false, false, true, false, true, false, true, true, true, true, true, true); + bool4x3 r1 = bool4x3(false, false, false, false, true, false, true, false, true, true, false, true); + TestUtils.AreEqual(r1, a1 & b1); + + bool4x3 a2 = bool4x3(true, false, true, true, true, false, false, true, true, false, false, true); + bool4x3 b2 = bool4x3(true, true, true, false, false, false, true, false, false, true, true, true); + bool4x3 r2 = bool4x3(true, false, true, false, false, false, false, false, false, false, false, true); + TestUtils.AreEqual(r2, a2 & b2); + + bool4x3 a3 = bool4x3(true, false, true, false, false, false, true, false, false, true, false, true); + bool4x3 b3 = bool4x3(false, true, true, false, true, true, false, false, false, true, true, true); + bool4x3 r3 = bool4x3(false, false, true, false, false, false, false, false, false, true, false, true); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void bool4x3_operator_bitwise_and_wide_scalar() + { + bool4x3 a0 = bool4x3(true, false, false, true, true, false, false, false, false, false, true, true); + bool b0 = (true); + bool4x3 r0 = bool4x3(true, false, false, true, true, false, false, false, false, false, true, true); + TestUtils.AreEqual(r0, a0 & b0); + + bool4x3 a1 = bool4x3(true, false, true, true, true, false, true, false, true, true, true, false); + bool b1 = (false); + bool4x3 r1 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 & b1); + + bool4x3 a2 = bool4x3(false, false, false, true, false, true, false, false, false, false, true, false); + bool b2 = (false); + bool4x3 r2 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 & b2); + + bool4x3 a3 = bool4x3(true, true, false, false, true, false, true, false, true, false, true, false); + bool b3 = (false); + bool4x3 r3 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void bool4x3_operator_bitwise_and_scalar_wide() + { + bool a0 = (false); + bool4x3 b0 = bool4x3(false, false, true, true, true, false, true, false, false, false, true, false); + bool4x3 r0 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 & b0); + + bool a1 = (false); + bool4x3 b1 = bool4x3(false, true, true, true, true, false, true, true, true, true, true, false); + bool4x3 r1 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 & b1); + + bool a2 = (true); + bool4x3 b2 = bool4x3(false, true, false, false, false, true, true, true, true, true, false, true); + bool4x3 r2 = bool4x3(false, true, false, false, false, true, true, true, true, true, false, true); + TestUtils.AreEqual(r2, a2 & b2); + + bool a3 = (false); + bool4x3 b3 = bool4x3(false, true, true, true, false, true, true, true, true, true, false, false); + bool4x3 r3 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void bool4x3_operator_bitwise_or_wide_wide() + { + bool4x3 a0 = bool4x3(true, true, true, false, true, false, true, true, false, true, true, true); + bool4x3 b0 = bool4x3(false, false, false, false, true, true, true, false, false, true, false, false); + bool4x3 r0 = bool4x3(true, true, true, false, true, true, true, true, false, true, true, true); + TestUtils.AreEqual(r0, a0 | b0); + + bool4x3 a1 = bool4x3(true, true, true, false, true, true, false, true, true, false, true, false); + bool4x3 b1 = bool4x3(true, true, true, true, true, true, false, true, true, true, false, true); + bool4x3 r1 = bool4x3(true, true, true, true, true, true, false, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 | b1); + + bool4x3 a2 = bool4x3(true, true, false, true, false, false, false, false, false, false, true, true); + bool4x3 b2 = bool4x3(false, true, false, false, true, true, true, true, false, false, false, true); + bool4x3 r2 = bool4x3(true, true, false, true, true, true, true, true, false, false, true, true); + TestUtils.AreEqual(r2, a2 | b2); + + bool4x3 a3 = bool4x3(true, false, false, false, false, true, false, false, true, false, true, false); + bool4x3 b3 = bool4x3(false, false, false, true, false, false, true, true, true, true, true, false); + bool4x3 r3 = bool4x3(true, false, false, true, false, true, true, true, true, true, true, false); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void bool4x3_operator_bitwise_or_wide_scalar() + { + bool4x3 a0 = bool4x3(true, true, false, true, true, true, true, false, true, false, false, true); + bool b0 = (true); + bool4x3 r0 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 | b0); + + bool4x3 a1 = bool4x3(false, true, false, true, true, true, true, true, true, true, true, false); + bool b1 = (false); + bool4x3 r1 = bool4x3(false, true, false, true, true, true, true, true, true, true, true, false); + TestUtils.AreEqual(r1, a1 | b1); + + bool4x3 a2 = bool4x3(true, false, false, true, true, true, true, true, true, false, true, false); + bool b2 = (false); + bool4x3 r2 = bool4x3(true, false, false, true, true, true, true, true, true, false, true, false); + TestUtils.AreEqual(r2, a2 | b2); + + bool4x3 a3 = bool4x3(false, false, true, false, true, true, false, true, true, false, true, false); + bool b3 = (true); + bool4x3 r3 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void bool4x3_operator_bitwise_or_scalar_wide() + { + bool a0 = (true); + bool4x3 b0 = bool4x3(true, true, false, false, true, true, true, false, false, true, true, false); + bool4x3 r0 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 | b0); + + bool a1 = (true); + bool4x3 b1 = bool4x3(true, false, false, false, false, true, true, true, true, true, false, true); + bool4x3 r1 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 | b1); + + bool a2 = (false); + bool4x3 b2 = bool4x3(true, true, false, true, true, false, true, true, false, false, true, true); + bool4x3 r2 = bool4x3(true, true, false, true, true, false, true, true, false, false, true, true); + TestUtils.AreEqual(r2, a2 | b2); + + bool a3 = (true); + bool4x3 b3 = bool4x3(false, false, false, false, false, false, true, true, false, true, true, true); + bool4x3 r3 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void bool4x3_operator_bitwise_xor_wide_wide() + { + bool4x3 a0 = bool4x3(true, false, false, true, false, false, false, true, false, false, true, true); + bool4x3 b0 = bool4x3(true, true, false, true, false, true, false, true, false, false, false, true); + bool4x3 r0 = bool4x3(false, true, false, false, false, true, false, false, false, false, true, false); + TestUtils.AreEqual(r0, a0 ^ b0); + + bool4x3 a1 = bool4x3(false, false, true, false, true, false, false, false, true, false, true, false); + bool4x3 b1 = bool4x3(false, false, true, true, false, false, false, false, false, true, false, false); + bool4x3 r1 = bool4x3(false, false, false, true, true, false, false, false, true, true, true, false); + TestUtils.AreEqual(r1, a1 ^ b1); + + bool4x3 a2 = bool4x3(true, false, false, false, true, true, true, true, true, true, false, false); + bool4x3 b2 = bool4x3(false, true, false, true, true, false, false, true, false, true, true, false); + bool4x3 r2 = bool4x3(true, true, false, true, false, true, true, false, true, false, true, false); + TestUtils.AreEqual(r2, a2 ^ b2); + + bool4x3 a3 = bool4x3(true, true, true, true, true, true, false, true, false, false, true, true); + bool4x3 b3 = bool4x3(true, false, false, false, false, true, false, true, false, true, true, true); + bool4x3 r3 = bool4x3(false, true, true, true, true, false, false, false, false, true, false, false); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void bool4x3_operator_bitwise_xor_wide_scalar() + { + bool4x3 a0 = bool4x3(false, false, true, true, false, false, false, false, false, false, false, true); + bool b0 = (false); + bool4x3 r0 = bool4x3(false, false, true, true, false, false, false, false, false, false, false, true); + TestUtils.AreEqual(r0, a0 ^ b0); + + bool4x3 a1 = bool4x3(false, true, true, true, false, true, false, false, true, false, false, false); + bool b1 = (true); + bool4x3 r1 = bool4x3(true, false, false, false, true, false, true, true, false, true, true, true); + TestUtils.AreEqual(r1, a1 ^ b1); + + bool4x3 a2 = bool4x3(true, true, true, true, true, false, true, false, false, true, true, false); + bool b2 = (false); + bool4x3 r2 = bool4x3(true, true, true, true, true, false, true, false, false, true, true, false); + TestUtils.AreEqual(r2, a2 ^ b2); + + bool4x3 a3 = bool4x3(true, false, false, true, false, true, false, false, true, true, false, true); + bool b3 = (true); + bool4x3 r3 = bool4x3(false, true, true, false, true, false, true, true, false, false, true, false); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void bool4x3_operator_bitwise_xor_scalar_wide() + { + bool a0 = (true); + bool4x3 b0 = bool4x3(true, false, true, true, false, true, true, false, false, true, true, false); + bool4x3 r0 = bool4x3(false, true, false, false, true, false, false, true, true, false, false, true); + TestUtils.AreEqual(r0, a0 ^ b0); + + bool a1 = (false); + bool4x3 b1 = bool4x3(true, false, true, true, false, true, true, true, false, false, false, true); + bool4x3 r1 = bool4x3(true, false, true, true, false, true, true, true, false, false, false, true); + TestUtils.AreEqual(r1, a1 ^ b1); + + bool a2 = (true); + bool4x3 b2 = bool4x3(true, false, false, false, true, true, false, true, false, false, true, true); + bool4x3 r2 = bool4x3(false, true, true, true, false, false, true, false, true, true, false, false); + TestUtils.AreEqual(r2, a2 ^ b2); + + bool a3 = (true); + bool4x3 b3 = bool4x3(true, false, false, false, true, false, false, false, true, true, false, false); + bool4x3 r3 = bool4x3(false, true, true, true, false, true, true, true, false, false, true, true); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void bool4x3_operator_logical_not() + { + bool4x3 a0 = bool4x3(true, true, false, false, true, false, true, false, true, false, false, false); + bool4x3 r0 = bool4x3(false, false, true, true, false, true, false, true, false, true, true, true); + TestUtils.AreEqual(r0, !a0); + + bool4x3 a1 = bool4x3(false, true, false, false, true, true, true, false, true, true, true, false); + bool4x3 r1 = bool4x3(true, false, true, true, false, false, false, true, false, false, false, true); + TestUtils.AreEqual(r1, !a1); + + bool4x3 a2 = bool4x3(false, true, false, true, false, false, true, true, false, true, false, false); + bool4x3 r2 = bool4x3(true, false, true, false, true, true, false, false, true, false, true, true); + TestUtils.AreEqual(r2, !a2); + + bool4x3 a3 = bool4x3(false, true, true, false, false, true, false, true, false, true, false, true); + bool4x3 r3 = bool4x3(true, false, false, true, true, false, true, false, true, false, true, false); + TestUtils.AreEqual(r3, !a3); + } + + [TestCase /* For player builds */] + public static void bool4x3_EqualsObjectOverride() + { + TestUtils.IsFalse(new bool4x3().Equals((object)new int())); + TestUtils.IsTrue(new bool4x3().Equals((object)new bool4x3())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestBool4x3.gen.cs.meta b/src/Tests/Tests/Shared/TestBool4x3.gen.cs.meta new file mode 100644 index 00000000..95824aa2 --- /dev/null +++ b/src/Tests/Tests/Shared/TestBool4x3.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 58c624ce115ab234d9a595288af4c5e0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestBool4x4.gen.cs b/src/Tests/Tests/Shared/TestBool4x4.gen.cs new file mode 100644 index 00000000..11b5e424 --- /dev/null +++ b/src/Tests/Tests/Shared/TestBool4x4.gen.cs @@ -0,0 +1,407 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestBool4x4 + { + [TestCompiler] + public static void bool4x4_operator_equal_wide_wide() + { + bool4x4 a0 = bool4x4(true, false, true, false, false, true, false, false, true, false, true, false, true, true, false, true); + bool4x4 b0 = bool4x4(true, false, false, false, true, false, false, true, false, false, false, false, true, false, false, false); + bool4x4 r0 = bool4x4(true, true, false, true, false, false, true, false, false, true, false, true, true, false, true, false); + TestUtils.AreEqual(r0, a0 == b0); + + bool4x4 a1 = bool4x4(true, false, false, true, true, true, false, true, true, true, false, true, true, true, false, true); + bool4x4 b1 = bool4x4(true, false, false, true, false, true, false, true, true, true, true, true, true, false, false, false); + bool4x4 r1 = bool4x4(true, true, true, true, false, true, true, true, true, true, false, true, true, false, true, false); + TestUtils.AreEqual(r1, a1 == b1); + + bool4x4 a2 = bool4x4(false, true, false, true, false, true, true, false, true, false, false, false, false, true, true, false); + bool4x4 b2 = bool4x4(false, true, false, false, true, true, false, true, false, false, false, true, true, true, true, false); + bool4x4 r2 = bool4x4(true, true, true, false, false, true, false, false, false, true, true, false, false, true, true, true); + TestUtils.AreEqual(r2, a2 == b2); + + bool4x4 a3 = bool4x4(false, true, false, false, false, true, false, true, false, false, false, true, false, false, false, false); + bool4x4 b3 = bool4x4(false, true, false, true, true, false, false, false, false, true, true, false, false, false, true, false); + bool4x4 r3 = bool4x4(true, true, true, false, false, false, true, false, true, false, false, false, true, true, false, true); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void bool4x4_operator_equal_wide_scalar() + { + bool4x4 a0 = bool4x4(false, true, false, false, false, false, true, false, false, false, true, true, false, true, false, true); + bool b0 = (true); + bool4x4 r0 = bool4x4(false, true, false, false, false, false, true, false, false, false, true, true, false, true, false, true); + TestUtils.AreEqual(r0, a0 == b0); + + bool4x4 a1 = bool4x4(false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, true); + bool b1 = (false); + bool4x4 r1 = bool4x4(true, true, false, true, true, true, true, true, true, true, true, true, true, true, true, false); + TestUtils.AreEqual(r1, a1 == b1); + + bool4x4 a2 = bool4x4(true, false, false, false, true, true, false, true, true, false, false, true, false, true, true, false); + bool b2 = (false); + bool4x4 r2 = bool4x4(false, true, true, true, false, false, true, false, false, true, true, false, true, false, false, true); + TestUtils.AreEqual(r2, a2 == b2); + + bool4x4 a3 = bool4x4(false, false, true, false, true, true, true, false, true, false, true, false, false, false, false, false); + bool b3 = (true); + bool4x4 r3 = bool4x4(false, false, true, false, true, true, true, false, true, false, true, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void bool4x4_operator_equal_scalar_wide() + { + bool a0 = (false); + bool4x4 b0 = bool4x4(true, false, true, false, false, true, false, false, true, false, true, true, false, true, false, true); + bool4x4 r0 = bool4x4(false, true, false, true, true, false, true, true, false, true, false, false, true, false, true, false); + TestUtils.AreEqual(r0, a0 == b0); + + bool a1 = (true); + bool4x4 b1 = bool4x4(true, false, false, true, false, true, true, false, true, true, true, true, true, true, false, true); + bool4x4 r1 = bool4x4(true, false, false, true, false, true, true, false, true, true, true, true, true, true, false, true); + TestUtils.AreEqual(r1, a1 == b1); + + bool a2 = (true); + bool4x4 b2 = bool4x4(false, false, false, true, true, true, false, true, true, true, false, false, true, false, true, true); + bool4x4 r2 = bool4x4(false, false, false, true, true, true, false, true, true, true, false, false, true, false, true, true); + TestUtils.AreEqual(r2, a2 == b2); + + bool a3 = (false); + bool4x4 b3 = bool4x4(false, false, false, true, true, true, true, false, false, true, false, true, false, false, false, false); + bool4x4 r3 = bool4x4(true, true, true, false, false, false, false, true, true, false, true, false, true, true, true, true); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void bool4x4_operator_not_equal_wide_wide() + { + bool4x4 a0 = bool4x4(true, true, true, false, false, true, false, false, false, false, true, true, true, true, true, true); + bool4x4 b0 = bool4x4(true, false, false, false, true, false, false, false, false, true, true, true, false, false, true, true); + bool4x4 r0 = bool4x4(false, true, true, false, true, true, false, false, false, true, false, false, true, true, false, false); + TestUtils.AreEqual(r0, a0 != b0); + + bool4x4 a1 = bool4x4(true, true, false, true, false, true, true, true, true, false, false, true, false, true, true, true); + bool4x4 b1 = bool4x4(true, false, true, true, false, false, true, false, false, false, true, false, true, false, true, false); + bool4x4 r1 = bool4x4(false, true, true, false, false, true, false, true, true, false, true, true, true, true, false, true); + TestUtils.AreEqual(r1, a1 != b1); + + bool4x4 a2 = bool4x4(true, true, false, true, true, true, true, false, true, true, true, false, true, false, false, false); + bool4x4 b2 = bool4x4(false, false, false, false, false, true, false, true, false, true, false, false, false, true, false, false); + bool4x4 r2 = bool4x4(true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, false); + TestUtils.AreEqual(r2, a2 != b2); + + bool4x4 a3 = bool4x4(true, false, false, true, false, true, true, true, true, true, false, false, true, false, false, false); + bool4x4 b3 = bool4x4(true, true, true, false, true, false, false, true, false, false, false, true, true, false, false, false); + bool4x4 r3 = bool4x4(false, true, true, true, true, true, true, false, true, true, false, true, false, false, false, false); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void bool4x4_operator_not_equal_wide_scalar() + { + bool4x4 a0 = bool4x4(false, true, false, true, true, false, false, false, false, false, false, false, false, true, false, false); + bool b0 = (false); + bool4x4 r0 = bool4x4(false, true, false, true, true, false, false, false, false, false, false, false, false, true, false, false); + TestUtils.AreEqual(r0, a0 != b0); + + bool4x4 a1 = bool4x4(false, true, true, false, true, true, true, true, true, true, false, true, true, true, false, false); + bool b1 = (false); + bool4x4 r1 = bool4x4(false, true, true, false, true, true, true, true, true, true, false, true, true, true, false, false); + TestUtils.AreEqual(r1, a1 != b1); + + bool4x4 a2 = bool4x4(true, true, false, true, false, false, false, true, true, true, false, false, true, false, true, false); + bool b2 = (false); + bool4x4 r2 = bool4x4(true, true, false, true, false, false, false, true, true, true, false, false, true, false, true, false); + TestUtils.AreEqual(r2, a2 != b2); + + bool4x4 a3 = bool4x4(true, true, false, false, true, true, false, false, false, false, false, true, false, false, false, true); + bool b3 = (true); + bool4x4 r3 = bool4x4(false, false, true, true, false, false, true, true, true, true, true, false, true, true, true, false); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void bool4x4_operator_not_equal_scalar_wide() + { + bool a0 = (true); + bool4x4 b0 = bool4x4(false, false, true, false, false, false, true, true, true, false, false, false, false, false, true, false); + bool4x4 r0 = bool4x4(true, true, false, true, true, true, false, false, false, true, true, true, true, true, false, true); + TestUtils.AreEqual(r0, a0 != b0); + + bool a1 = (false); + bool4x4 b1 = bool4x4(true, false, false, false, true, true, false, false, true, false, false, true, true, false, true, false); + bool4x4 r1 = bool4x4(true, false, false, false, true, true, false, false, true, false, false, true, true, false, true, false); + TestUtils.AreEqual(r1, a1 != b1); + + bool a2 = (false); + bool4x4 b2 = bool4x4(true, true, true, true, true, true, true, true, false, false, true, true, false, false, false, true); + bool4x4 r2 = bool4x4(true, true, true, true, true, true, true, true, false, false, true, true, false, false, false, true); + TestUtils.AreEqual(r2, a2 != b2); + + bool a3 = (true); + bool4x4 b3 = bool4x4(false, true, false, false, true, true, false, true, false, true, true, false, true, true, true, true); + bool4x4 r3 = bool4x4(true, false, true, true, false, false, true, false, true, false, false, true, false, false, false, false); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void bool4x4_operator_bitwise_and_wide_wide() + { + bool4x4 a0 = bool4x4(false, false, true, true, false, false, true, true, true, false, true, true, true, true, false, false); + bool4x4 b0 = bool4x4(false, false, true, false, true, true, false, false, true, true, false, false, false, false, true, false); + bool4x4 r0 = bool4x4(false, false, true, false, false, false, false, false, true, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 & b0); + + bool4x4 a1 = bool4x4(true, true, true, false, true, true, false, true, true, false, true, true, true, false, false, true); + bool4x4 b1 = bool4x4(true, false, true, true, true, true, true, true, true, true, true, false, false, false, true, false); + bool4x4 r1 = bool4x4(true, false, true, false, true, true, false, true, true, false, true, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 & b1); + + bool4x4 a2 = bool4x4(true, false, false, true, true, false, true, false, false, false, true, false, false, true, false, true); + bool4x4 b2 = bool4x4(false, true, true, true, false, true, true, false, true, true, false, false, false, true, true, true); + bool4x4 r2 = bool4x4(false, false, false, true, false, false, true, false, false, false, false, false, false, true, false, true); + TestUtils.AreEqual(r2, a2 & b2); + + bool4x4 a3 = bool4x4(false, false, true, true, false, false, false, false, false, true, false, true, false, false, true, true); + bool4x4 b3 = bool4x4(false, true, false, false, false, true, true, false, false, false, false, false, true, false, false, true); + bool4x4 r3 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void bool4x4_operator_bitwise_and_wide_scalar() + { + bool4x4 a0 = bool4x4(true, false, false, true, true, false, false, false, false, false, true, true, true, false, false, true); + bool b0 = (true); + bool4x4 r0 = bool4x4(true, false, false, true, true, false, false, false, false, false, true, true, true, false, false, true); + TestUtils.AreEqual(r0, a0 & b0); + + bool4x4 a1 = bool4x4(true, false, true, false, true, true, true, false, false, false, false, false, true, false, true, false); + bool b1 = (true); + bool4x4 r1 = bool4x4(true, false, true, false, true, true, true, false, false, false, false, false, true, false, true, false); + TestUtils.AreEqual(r1, a1 & b1); + + bool4x4 a2 = bool4x4(false, false, true, false, true, false, true, false, false, true, false, true, false, true, false, true); + bool b2 = (false); + bool4x4 r2 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 & b2); + + bool4x4 a3 = bool4x4(false, false, true, false, true, false, false, false, false, true, false, false, true, true, true, true); + bool b3 = (true); + bool4x4 r3 = bool4x4(false, false, true, false, true, false, false, false, false, true, false, false, true, true, true, true); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void bool4x4_operator_bitwise_and_scalar_wide() + { + bool a0 = (false); + bool4x4 b0 = bool4x4(false, false, true, true, true, false, true, false, false, false, true, false, false, false, true, true); + bool4x4 r0 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 & b0); + + bool a1 = (true); + bool4x4 b1 = bool4x4(true, false, true, true, true, true, true, false, true, false, true, false, false, false, true, true); + bool4x4 r1 = bool4x4(true, false, true, true, true, true, true, false, true, false, true, false, false, false, true, true); + TestUtils.AreEqual(r1, a1 & b1); + + bool a2 = (true); + bool4x4 b2 = bool4x4(true, true, false, true, false, false, true, true, true, false, true, true, true, true, true, false); + bool4x4 r2 = bool4x4(true, true, false, true, false, false, true, true, true, false, true, true, true, true, true, false); + TestUtils.AreEqual(r2, a2 & b2); + + bool a3 = (false); + bool4x4 b3 = bool4x4(true, true, false, true, true, true, false, true, false, false, true, true, true, false, false, true); + bool4x4 r3 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void bool4x4_operator_bitwise_or_wide_wide() + { + bool4x4 a0 = bool4x4(true, true, true, false, true, false, true, true, false, true, true, true, true, true, true, false); + bool4x4 b0 = bool4x4(false, false, false, false, true, true, true, false, false, true, false, false, true, true, true, true); + bool4x4 r0 = bool4x4(true, true, true, false, true, true, true, true, false, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 | b0); + + bool4x4 a1 = bool4x4(true, true, false, true, true, false, true, false, true, true, false, true, false, false, false, false); + bool4x4 b1 = bool4x4(true, true, false, true, true, true, false, true, false, true, false, false, true, true, true, true); + bool4x4 r1 = bool4x4(true, true, false, true, true, true, true, true, true, true, false, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 | b1); + + bool4x4 a2 = bool4x4(false, false, true, true, true, false, false, false, false, true, false, false, true, false, true, false); + bool4x4 b2 = bool4x4(false, false, false, true, false, false, false, true, false, false, true, true, true, true, true, false); + bool4x4 r2 = bool4x4(false, false, true, true, true, false, false, true, false, true, true, true, true, true, true, false); + TestUtils.AreEqual(r2, a2 | b2); + + bool4x4 a3 = bool4x4(false, false, false, true, false, false, false, false, true, false, true, false, true, true, true, false); + bool4x4 b3 = bool4x4(true, true, false, true, true, false, true, false, true, true, false, true, false, false, false, false); + bool4x4 r3 = bool4x4(true, true, false, true, true, false, true, false, true, true, true, true, true, true, true, false); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void bool4x4_operator_bitwise_or_wide_scalar() + { + bool4x4 a0 = bool4x4(true, true, false, true, true, true, true, false, true, false, false, true, false, false, true, false); + bool b0 = (true); + bool4x4 r0 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 | b0); + + bool4x4 a1 = bool4x4(true, true, true, true, true, true, true, false, true, false, false, false, true, true, true, true); + bool b1 = (true); + bool4x4 r1 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 | b1); + + bool4x4 a2 = bool4x4(true, false, true, false, false, true, false, true, false, true, true, false, true, true, false, true); + bool b2 = (true); + bool4x4 r2 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 | b2); + + bool4x4 a3 = bool4x4(false, true, true, true, true, true, false, false, false, true, true, false, false, true, true, false); + bool b3 = (true); + bool4x4 r3 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void bool4x4_operator_bitwise_or_scalar_wide() + { + bool a0 = (true); + bool4x4 b0 = bool4x4(true, true, false, false, true, true, true, false, false, true, true, false, true, true, false, false); + bool4x4 r0 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 | b0); + + bool a1 = (false); + bool4x4 b1 = bool4x4(false, true, true, true, true, true, false, true, false, true, true, false, true, true, false, true); + bool4x4 r1 = bool4x4(false, true, true, true, true, true, false, true, false, true, true, false, true, true, false, true); + TestUtils.AreEqual(r1, a1 | b1); + + bool a2 = (true); + bool4x4 b2 = bool4x4(false, false, true, true, true, false, false, false, false, false, false, true, true, false, true, true); + bool4x4 r2 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 | b2); + + bool a3 = (true); + bool4x4 b3 = bool4x4(true, true, false, false, false, true, true, true, true, false, true, false, false, true, true, true); + bool4x4 r3 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void bool4x4_operator_bitwise_xor_wide_wide() + { + bool4x4 a0 = bool4x4(true, false, false, true, false, false, false, true, false, false, true, true, false, false, true, false); + bool4x4 b0 = bool4x4(true, true, false, true, false, true, false, true, false, false, false, true, false, false, true, true); + bool4x4 r0 = bool4x4(false, true, false, false, false, true, false, false, false, false, true, false, false, false, false, true); + TestUtils.AreEqual(r0, a0 ^ b0); + + bool4x4 a1 = bool4x4(true, false, false, false, true, false, true, false, true, false, false, false, true, true, true, true); + bool4x4 b1 = bool4x4(false, false, false, false, false, true, false, false, false, true, false, true, true, false, false, true); + bool4x4 r1 = bool4x4(true, false, false, false, true, true, true, false, true, true, false, true, false, true, true, false); + TestUtils.AreEqual(r1, a1 ^ b1); + + bool4x4 a2 = bool4x4(true, true, false, false, true, true, true, true, true, true, false, true, false, false, true, true); + bool4x4 b2 = bool4x4(false, true, true, false, true, false, false, false, false, true, false, true, false, true, true, true); + bool4x4 r2 = bool4x4(true, false, true, false, false, true, true, true, true, false, false, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 ^ b2); + + bool4x4 a3 = bool4x4(true, true, false, false, true, true, true, false, true, false, true, false, true, true, true, true); + bool4x4 b3 = bool4x4(true, false, true, false, false, false, false, true, true, false, false, true, false, true, true, true); + bool4x4 r3 = bool4x4(false, true, true, false, true, true, true, true, false, false, true, true, true, false, false, false); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void bool4x4_operator_bitwise_xor_wide_scalar() + { + bool4x4 a0 = bool4x4(false, false, true, true, false, false, false, false, false, false, false, true, false, true, true, true); + bool b0 = (false); + bool4x4 r0 = bool4x4(false, false, true, true, false, false, false, false, false, false, false, true, false, true, true, true); + TestUtils.AreEqual(r0, a0 ^ b0); + + bool4x4 a1 = bool4x4(true, true, false, false, true, false, false, false, true, false, true, true, true, true, false, true); + bool b1 = (false); + bool4x4 r1 = bool4x4(true, true, false, false, true, false, false, false, true, false, true, true, true, true, false, true); + TestUtils.AreEqual(r1, a1 ^ b1); + + bool4x4 a2 = bool4x4(false, true, true, false, true, true, false, false, true, false, true, false, false, true, true, false); + bool b2 = (false); + bool4x4 r2 = bool4x4(false, true, true, false, true, true, false, false, true, false, true, false, false, true, true, false); + TestUtils.AreEqual(r2, a2 ^ b2); + + bool4x4 a3 = bool4x4(true, true, true, false, true, true, true, true, true, true, true, true, false, true, false, false); + bool b3 = (true); + bool4x4 r3 = bool4x4(false, false, false, true, false, false, false, false, false, false, false, false, true, false, true, true); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void bool4x4_operator_bitwise_xor_scalar_wide() + { + bool a0 = (true); + bool4x4 b0 = bool4x4(true, false, true, true, false, true, true, false, false, true, true, false, false, true, false, true); + bool4x4 r0 = bool4x4(false, true, false, false, true, false, false, true, true, false, false, true, true, false, true, false); + TestUtils.AreEqual(r0, a0 ^ b0); + + bool a1 = (true); + bool4x4 b1 = bool4x4(false, true, true, true, false, false, false, true, true, true, false, false, false, true, true, false); + bool4x4 r1 = bool4x4(true, false, false, false, true, true, true, false, false, false, true, true, true, false, false, true); + TestUtils.AreEqual(r1, a1 ^ b1); + + bool a2 = (true); + bool4x4 b2 = bool4x4(false, false, true, true, true, true, false, false, false, true, false, false, false, true, true, false); + bool4x4 r2 = bool4x4(true, true, false, false, false, false, true, true, true, false, true, true, true, false, false, true); + TestUtils.AreEqual(r2, a2 ^ b2); + + bool a3 = (false); + bool4x4 b3 = bool4x4(false, true, true, true, true, true, true, true, true, true, false, false, true, false, true, false); + bool4x4 r3 = bool4x4(false, true, true, true, true, true, true, true, true, true, false, false, true, false, true, false); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void bool4x4_operator_logical_not() + { + bool4x4 a0 = bool4x4(true, true, false, false, true, false, true, false, true, false, false, false, false, true, true, false); + bool4x4 r0 = bool4x4(false, false, true, true, false, true, false, true, false, true, true, true, true, false, false, true); + TestUtils.AreEqual(r0, !a0); + + bool4x4 a1 = bool4x4(false, true, true, false, true, true, true, false, false, false, true, false, true, false, false, true); + bool4x4 r1 = bool4x4(true, false, false, true, false, false, false, true, true, true, false, true, false, true, true, false); + TestUtils.AreEqual(r1, !a1); + + bool4x4 a2 = bool4x4(true, true, false, false, false, true, true, true, false, false, true, false, true, false, true, false); + bool4x4 r2 = bool4x4(false, false, true, true, true, false, false, false, true, true, false, true, false, true, false, true); + TestUtils.AreEqual(r2, !a2); + + bool4x4 a3 = bool4x4(true, false, false, false, false, false, true, true, false, true, false, false, false, false, false, true); + bool4x4 r3 = bool4x4(false, true, true, true, true, true, false, false, true, false, true, true, true, true, true, false); + TestUtils.AreEqual(r3, !a3); + } + + [TestCase /* For player builds */] + public static void bool4x4_EqualsObjectOverride() + { + TestUtils.IsFalse(new bool4x4().Equals((object)new int())); + TestUtils.IsTrue(new bool4x4().Equals((object)new bool4x4())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestBool4x4.gen.cs.meta b/src/Tests/Tests/Shared/TestBool4x4.gen.cs.meta new file mode 100644 index 00000000..65dfed00 --- /dev/null +++ b/src/Tests/Tests/Shared/TestBool4x4.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0d44f89a4f95a124b9fc8296247d76d9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestDouble2.gen.cs b/src/Tests/Tests/Shared/TestDouble2.gen.cs new file mode 100644 index 00000000..f07b51f5 --- /dev/null +++ b/src/Tests/Tests/Shared/TestDouble2.gen.cs @@ -0,0 +1,1062 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestDouble2 + { + [TestCompiler] + public static void double2_zero() + { + TestUtils.AreEqual(0.0, double2.zero.x); + TestUtils.AreEqual(0.0, double2.zero.y); + } + + [TestCompiler] + public static void double2_constructor() + { + double2 a = new double2(1, 2); + TestUtils.AreEqual(1, a.x); + TestUtils.AreEqual(2, a.y); + } + + [TestCompiler] + public static void double2_scalar_constructor() + { + double2 a = new double2(17.0); + TestUtils.AreEqual(17.0, a.x); + TestUtils.AreEqual(17.0, a.y); + } + + [TestCompiler] + public static void double2_static_constructor() + { + double2 a = double2(1, 2); + TestUtils.AreEqual(1, a.x); + TestUtils.AreEqual(2, a.y); + } + + [TestCompiler] + public static void double2_static_scalar_constructor() + { + double2 a = double2(17.0); + TestUtils.AreEqual(17.0, a.x); + TestUtils.AreEqual(17.0, a.y); + } + + [TestCompiler] + public static void double2_operator_equal_wide_wide() + { + double2 a0 = double2(492.15758275061728, -495.20632027797694); + double2 b0 = double2(192.56880888369346, -235.61102472786376); + bool2 r0 = bool2(false, false); + TestUtils.AreEqual(r0, a0 == b0); + + double2 a1 = double2(227.45765195947968, -147.37405950733182); + double2 b1 = double2(-254.04311740307281, -412.62472052715009); + bool2 r1 = bool2(false, false); + TestUtils.AreEqual(r1, a1 == b1); + + double2 a2 = double2(-222.68201909897942, 64.093720704360749); + double2 b2 = double2(471.90480945627428, -6.4727852374654162); + bool2 r2 = bool2(false, false); + TestUtils.AreEqual(r2, a2 == b2); + + double2 a3 = double2(-23.890404473939157, -16.8197190839889); + double2 b3 = double2(-339.10237447316865, 488.1875700839737); + bool2 r3 = bool2(false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void double2_operator_equal_wide_scalar() + { + double2 a0 = double2(-303.2300766926399, 451.52631327674089); + double b0 = (123.5445759871717); + bool2 r0 = bool2(false, false); + TestUtils.AreEqual(r0, a0 == b0); + + double2 a1 = double2(-253.65587413201848, -500.6910920090466); + double b1 = (-105.20363502632995); + bool2 r1 = bool2(false, false); + TestUtils.AreEqual(r1, a1 == b1); + + double2 a2 = double2(-426.19248338518315, -59.558379439431405); + double b2 = (159.87609656149334); + bool2 r2 = bool2(false, false); + TestUtils.AreEqual(r2, a2 == b2); + + double2 a3 = double2(-57.477391031327386, 406.51375861024189); + double b3 = (-182.04973968400139); + bool2 r3 = bool2(false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void double2_operator_equal_scalar_wide() + { + double a0 = (-253.39728534100453); + double2 b0 = double2(19.952187785856495, -185.79199346610903); + bool2 r0 = bool2(false, false); + TestUtils.AreEqual(r0, a0 == b0); + + double a1 = (407.8136052600172); + double2 b1 = double2(-87.2766969610363, -206.27469382354741); + bool2 r1 = bool2(false, false); + TestUtils.AreEqual(r1, a1 == b1); + + double a2 = (160.503138855334); + double2 b2 = double2(-274.77081478516141, -2.6315281403397535); + bool2 r2 = bool2(false, false); + TestUtils.AreEqual(r2, a2 == b2); + + double a3 = (448.35453602688131); + double2 b3 = double2(-410.03524251004461, 247.32901465489022); + bool2 r3 = bool2(false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void double2_operator_not_equal_wide_wide() + { + double2 a0 = double2(430.8425316432689, 104.69001798736394); + double2 b0 = double2(210.02470622305975, -55.203330304102678); + bool2 r0 = bool2(true, true); + TestUtils.AreEqual(r0, a0 != b0); + + double2 a1 = double2(225.80243478799355, -310.57017841496048); + double2 b1 = double2(-269.92533672504373, -234.54673372700194); + bool2 r1 = bool2(true, true); + TestUtils.AreEqual(r1, a1 != b1); + + double2 a2 = double2(-418.61945815506363, 304.12820281839379); + double2 b2 = double2(25.917412054686565, -63.726991444699024); + bool2 r2 = bool2(true, true); + TestUtils.AreEqual(r2, a2 != b2); + + double2 a3 = double2(-509.32682561749908, -160.53807719076895); + double2 b3 = double2(-484.55371092471933, -425.333599050219); + bool2 r3 = bool2(true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void double2_operator_not_equal_wide_scalar() + { + double2 a0 = double2(-16.914588697680529, 168.83411486858233); + double b0 = (-145.37277109239847); + bool2 r0 = bool2(true, true); + TestUtils.AreEqual(r0, a0 != b0); + + double2 a1 = double2(-462.71352145760949, 214.50161443208424); + double b1 = (130.30776959765137); + bool2 r1 = bool2(true, true); + TestUtils.AreEqual(r1, a1 != b1); + + double2 a2 = double2(-440.26328178879959, -169.09985860115842); + double b2 = (-197.12796053529155); + bool2 r2 = bool2(true, true); + TestUtils.AreEqual(r2, a2 != b2); + + double2 a3 = double2(-386.61117595555783, -270.26885593601912); + double b3 = (-281.02101362916687); + bool2 r3 = bool2(true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void double2_operator_not_equal_scalar_wide() + { + double a0 = (275.79582823244664); + double2 b0 = double2(-57.196896341255353, -382.4325279586169); + bool2 r0 = bool2(true, true); + TestUtils.AreEqual(r0, a0 != b0); + + double a1 = (97.820359990848374); + double2 b1 = double2(-161.46364529499022, -458.39563367254829); + bool2 r1 = bool2(true, true); + TestUtils.AreEqual(r1, a1 != b1); + + double a2 = (-499.61786364932448); + double2 b2 = double2(327.92217818271467, 367.57121699283425); + bool2 r2 = bool2(true, true); + TestUtils.AreEqual(r2, a2 != b2); + + double a3 = (59.7863667289663); + double2 b3 = double2(-209.58068118318016, -62.580453186566217); + bool2 r3 = bool2(true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void double2_operator_less_wide_wide() + { + double2 a0 = double2(196.84256825076534, 336.40979997087732); + double2 b0 = double2(-465.34502313348696, -256.15239751346053); + bool2 r0 = bool2(false, false); + TestUtils.AreEqual(r0, a0 < b0); + + double2 a1 = double2(251.96372115424072, 257.65591466503963); + double2 b1 = double2(-314.814018634527, 364.56673662949663); + bool2 r1 = bool2(false, true); + TestUtils.AreEqual(r1, a1 < b1); + + double2 a2 = double2(430.04588647840819, -62.419644146421774); + double2 b2 = double2(100.21050290959442, 182.56098636545289); + bool2 r2 = bool2(false, true); + TestUtils.AreEqual(r2, a2 < b2); + + double2 a3 = double2(8.8392293494376872, -333.81671563434259); + double2 b3 = double2(3.116978885194726, -259.43047893207074); + bool2 r3 = bool2(false, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void double2_operator_less_wide_scalar() + { + double2 a0 = double2(-132.05731708000292, -192.46500477216438); + double b0 = (-156.01021845452965); + bool2 r0 = bool2(false, true); + TestUtils.AreEqual(r0, a0 < b0); + + double2 a1 = double2(-66.834607870706634, -360.28242199508588); + double b1 = (-379.01750081545561); + bool2 r1 = bool2(false, false); + TestUtils.AreEqual(r1, a1 < b1); + + double2 a2 = double2(20.927834282129879, 437.34587522845061); + double b2 = (-158.24074537970159); + bool2 r2 = bool2(false, false); + TestUtils.AreEqual(r2, a2 < b2); + + double2 a3 = double2(-20.452607402788772, 307.48418607725023); + double b3 = (225.29148517609178); + bool2 r3 = bool2(true, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void double2_operator_less_scalar_wide() + { + double a0 = (-423.117411095238); + double2 b0 = double2(385.09483617595151, -123.93348532725753); + bool2 r0 = bool2(true, true); + TestUtils.AreEqual(r0, a0 < b0); + + double a1 = (86.376572887588509); + double2 b1 = double2(133.44217378154497, 161.45794947513286); + bool2 r1 = bool2(true, true); + TestUtils.AreEqual(r1, a1 < b1); + + double a2 = (229.75426660746064); + double2 b2 = double2(222.57159934871436, 315.53116360098647); + bool2 r2 = bool2(false, true); + TestUtils.AreEqual(r2, a2 < b2); + + double a3 = (-447.20351883731945); + double2 b3 = double2(271.83385790131695, -393.60531324595462); + bool2 r3 = bool2(true, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void double2_operator_greater_wide_wide() + { + double2 a0 = double2(483.50140141113729, 310.81563415695712); + double2 b0 = double2(-471.39802454011425, -371.98528617060992); + bool2 r0 = bool2(true, true); + TestUtils.AreEqual(r0, a0 > b0); + + double2 a1 = double2(106.9661896726891, 295.73526038589671); + double2 b1 = double2(36.900723236101044, -316.76360407320954); + bool2 r1 = bool2(true, true); + TestUtils.AreEqual(r1, a1 > b1); + + double2 a2 = double2(116.95757179938141, -478.29977653841479); + double2 b2 = double2(19.683055648432628, 207.3091381561519); + bool2 r2 = bool2(true, false); + TestUtils.AreEqual(r2, a2 > b2); + + double2 a3 = double2(-14.897393471979228, -33.817441717636484); + double2 b3 = double2(362.79748861994483, 324.95341816775192); + bool2 r3 = bool2(false, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void double2_operator_greater_wide_scalar() + { + double2 a0 = double2(64.317918092160426, -397.70346445483318); + double b0 = (305.85991992888034); + bool2 r0 = bool2(false, false); + TestUtils.AreEqual(r0, a0 > b0); + + double2 a1 = double2(431.87690826499693, 246.26305233978803); + double b1 = (85.702980796668157); + bool2 r1 = bool2(true, true); + TestUtils.AreEqual(r1, a1 > b1); + + double2 a2 = double2(197.49155602114809, 280.81334818564972); + double b2 = (286.1994608781298); + bool2 r2 = bool2(false, false); + TestUtils.AreEqual(r2, a2 > b2); + + double2 a3 = double2(-405.78459210218148, -241.80727326209063); + double b3 = (171.56538661362856); + bool2 r3 = bool2(false, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void double2_operator_greater_scalar_wide() + { + double a0 = (-282.67049635698572); + double2 b0 = double2(358.09997360692353, -72.5964134077525); + bool2 r0 = bool2(false, false); + TestUtils.AreEqual(r0, a0 > b0); + + double a1 = (-232.16380106292843); + double2 b1 = double2(-60.706723956720282, 75.156642710397364); + bool2 r1 = bool2(false, false); + TestUtils.AreEqual(r1, a1 > b1); + + double a2 = (150.88350040786133); + double2 b2 = double2(339.53917924479538, -498.19602965665797); + bool2 r2 = bool2(false, true); + TestUtils.AreEqual(r2, a2 > b2); + + double a3 = (459.74610326241054); + double2 b3 = double2(-227.96872316485678, 335.86213485145106); + bool2 r3 = bool2(true, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void double2_operator_less_equal_wide_wide() + { + double2 a0 = double2(-438.52313753521219, 210.48942837980087); + double2 b0 = double2(-474.8141498392514, 304.3710555063426); + bool2 r0 = bool2(false, true); + TestUtils.AreEqual(r0, a0 <= b0); + + double2 a1 = double2(4.8773329280677444, -137.29793817237857); + double2 b1 = double2(234.8241737982371, -390.48543209139513); + bool2 r1 = bool2(true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + double2 a2 = double2(156.09410174009111, -363.92412035722475); + double2 b2 = double2(-297.17535295019638, -326.29239121372461); + bool2 r2 = bool2(false, true); + TestUtils.AreEqual(r2, a2 <= b2); + + double2 a3 = double2(-97.948485181642923, 437.29539009430232); + double2 b3 = double2(107.2538764976216, -413.13107342884462); + bool2 r3 = bool2(true, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void double2_operator_less_equal_wide_scalar() + { + double2 a0 = double2(193.4958237118534, 168.91555197952107); + double b0 = (443.85054299042122); + bool2 r0 = bool2(true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + double2 a1 = double2(-313.9930695565385, 18.503590830836288); + double b1 = (81.826965131716292); + bool2 r1 = bool2(true, true); + TestUtils.AreEqual(r1, a1 <= b1); + + double2 a2 = double2(-0.35819602029312136, -463.81641242644582); + double b2 = (241.36115776810846); + bool2 r2 = bool2(true, true); + TestUtils.AreEqual(r2, a2 <= b2); + + double2 a3 = double2(-1.3577692515020203, 398.9919504593089); + double b3 = (-268.89945591096739); + bool2 r3 = bool2(false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void double2_operator_less_equal_scalar_wide() + { + double a0 = (393.60626644343427); + double2 b0 = double2(-75.688363825757222, -44.2638714519627); + bool2 r0 = bool2(false, false); + TestUtils.AreEqual(r0, a0 <= b0); + + double a1 = (125.86491566797019); + double2 b1 = double2(191.96488174794467, 13.543054825413492); + bool2 r1 = bool2(true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + double a2 = (-197.0519259893577); + double2 b2 = double2(-423.945100743298, -330.04861680141119); + bool2 r2 = bool2(false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + double a3 = (420.16553779140372); + double2 b3 = double2(105.54730777887039, 174.82126363311954); + bool2 r3 = bool2(false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void double2_operator_greater_equal_wide_wide() + { + double2 a0 = double2(-507.92858409692, 504.49748181947393); + double2 b0 = double2(-81.346509732933043, 297.66615047010885); + bool2 r0 = bool2(false, true); + TestUtils.AreEqual(r0, a0 >= b0); + + double2 a1 = double2(-385.43449205226938, -262.32340944107784); + double2 b1 = double2(171.06540616371922, -431.03805538222105); + bool2 r1 = bool2(false, true); + TestUtils.AreEqual(r1, a1 >= b1); + + double2 a2 = double2(-37.550928848586466, -111.59527759980193); + double2 b2 = double2(-6.859075311040101, 319.72570362674333); + bool2 r2 = bool2(false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + double2 a3 = double2(-463.70202157632542, 387.44885772627265); + double2 b3 = double2(254.079170106947, 396.5724000393285); + bool2 r3 = bool2(false, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void double2_operator_greater_equal_wide_scalar() + { + double2 a0 = double2(465.15218732559686, -424.8860745024337); + double b0 = (-5.5998842742293391); + bool2 r0 = bool2(true, false); + TestUtils.AreEqual(r0, a0 >= b0); + + double2 a1 = double2(-209.22109685150025, -302.26910533675414); + double b1 = (58.779852656079356); + bool2 r1 = bool2(false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + double2 a2 = double2(140.12558252183976, -344.55997316192838); + double b2 = (16.353385694489475); + bool2 r2 = bool2(true, false); + TestUtils.AreEqual(r2, a2 >= b2); + + double2 a3 = double2(393.27804846003562, 441.0115565923096); + double b3 = (-315.70155086913218); + bool2 r3 = bool2(true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void double2_operator_greater_equal_scalar_wide() + { + double a0 = (374.82703393270594); + double2 b0 = double2(-1.609757185731894, 338.61524049314448); + bool2 r0 = bool2(true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + double a1 = (-116.18140392945213); + double2 b1 = double2(-332.15732375353451, -355.9793509710484); + bool2 r1 = bool2(true, true); + TestUtils.AreEqual(r1, a1 >= b1); + + double a2 = (-468.90144107719021); + double2 b2 = double2(38.579884785497484, -332.34754697063357); + bool2 r2 = bool2(false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + double a3 = (2.8901150240051265); + double2 b3 = double2(467.77776477661814, 121.40638762405445); + bool2 r3 = bool2(false, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void double2_operator_add_wide_wide() + { + double2 a0 = double2(506.12905263627374, -501.77980803967444); + double2 b0 = double2(-28.757987751047096, -337.135153689019); + double2 r0 = double2(477.37106488522664, -838.91496172869347); + TestUtils.AreEqual(r0, a0 + b0); + + double2 a1 = double2(420.08479638587903, -186.03206476291274); + double2 b1 = double2(-340.676816860529, 152.31202633320913); + double2 r1 = double2(79.407979525350015, -33.720038429703607); + TestUtils.AreEqual(r1, a1 + b1); + + double2 a2 = double2(-9.3123953385801883, 328.51179686585056); + double2 b2 = double2(423.66745420157326, 90.374096674087468); + double2 r2 = double2(414.35505886299308, 418.885893539938); + TestUtils.AreEqual(r2, a2 + b2); + + double2 a3 = double2(424.34407659263536, 87.791079800478656); + double2 b3 = double2(376.18866246574964, 1.7671887882831925); + double2 r3 = double2(800.532739058385, 89.558268588761848); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void double2_operator_add_wide_scalar() + { + double2 a0 = double2(-194.51420387742769, 338.54838696985894); + double b0 = (124.121678171736); + double2 r0 = double2(-70.3925257056917, 462.67006514159493); + TestUtils.AreEqual(r0, a0 + b0); + + double2 a1 = double2(246.97140252169754, -45.724677822424439); + double b1 = (100.51093797595752); + double2 r1 = double2(347.48234049765506, 54.786260153533078); + TestUtils.AreEqual(r1, a1 + b1); + + double2 a2 = double2(-478.11131094308166, 60.37435224483454); + double b2 = (30.916145577522116); + double2 r2 = double2(-447.19516536555955, 91.290497822356656); + TestUtils.AreEqual(r2, a2 + b2); + + double2 a3 = double2(-242.1187475855084, 6.7993848355483806); + double b3 = (82.50134495762245); + double2 r3 = double2(-159.61740262788595, 89.300729793170831); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void double2_operator_add_scalar_wide() + { + double a0 = (-340.35468284243473); + double2 b0 = double2(511.36225652665007, -146.21663791789518); + double2 r0 = double2(171.00757368421534, -486.57132076032991); + TestUtils.AreEqual(r0, a0 + b0); + + double a1 = (-106.21042661844308); + double2 b1 = double2(-363.45024960276214, 199.08958325120136); + double2 r1 = double2(-469.66067622120522, 92.879156632758281); + TestUtils.AreEqual(r1, a1 + b1); + + double a2 = (-27.108407271610758); + double2 b2 = double2(419.84900041103788, 284.95503748811552); + double2 r2 = double2(392.74059313942712, 257.84663021650476); + TestUtils.AreEqual(r2, a2 + b2); + + double a3 = (-164.92418129971446); + double2 b3 = double2(-249.19032561461921, 150.92817718858282); + double2 r3 = double2(-414.11450691433367, -13.99600411113164); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void double2_operator_sub_wide_wide() + { + double2 a0 = double2(160.4922617229131, 11.223957305412682); + double2 b0 = double2(115.46876078260539, -130.98230630298252); + double2 r0 = double2(45.023500940307713, 142.2062636083952); + TestUtils.AreEqual(r0, a0 - b0); + + double2 a1 = double2(359.20010607279846, -498.22830485656311); + double2 b1 = double2(241.54083716196044, 9.9870860623135513); + double2 r1 = double2(117.65926891083802, -508.21539091887666); + TestUtils.AreEqual(r1, a1 - b1); + + double2 a2 = double2(-355.25362913462038, -94.534852787170053); + double2 b2 = double2(419.89512582304656, 59.124466208333388); + double2 r2 = double2(-775.14875495766694, -153.65931899550344); + TestUtils.AreEqual(r2, a2 - b2); + + double2 a3 = double2(-410.46404786150163, -401.38464398001537); + double2 b3 = double2(-402.38163847587145, -75.370143687059226); + double2 r3 = double2(-8.0824093856301715, -326.01450029295614); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void double2_operator_sub_wide_scalar() + { + double2 a0 = double2(207.38960108877609, 248.45773684627272); + double b0 = (-36.112476604111691); + double2 r0 = double2(243.50207769288778, 284.57021345038441); + TestUtils.AreEqual(r0, a0 - b0); + + double2 a1 = double2(-384.82393211164697, -374.81156152058929); + double b1 = (-205.34476122881506); + double2 r1 = double2(-179.47917088283191, -169.46680029177423); + TestUtils.AreEqual(r1, a1 - b1); + + double2 a2 = double2(191.64204820973896, -44.96160151667965); + double b2 = (18.856238135535364); + double2 r2 = double2(172.7858100742036, -63.817839652215014); + TestUtils.AreEqual(r2, a2 - b2); + + double2 a3 = double2(480.85798738936796, -366.86545269883493); + double b3 = (16.338193185784917); + double2 r3 = double2(464.51979420358305, -383.20364588461985); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void double2_operator_sub_scalar_wide() + { + double a0 = (-86.008225719448262); + double2 b0 = double2(466.42511413359318, 298.48694219183506); + double2 r0 = double2(-552.43333985304139, -384.49516791128332); + TestUtils.AreEqual(r0, a0 - b0); + + double a1 = (-300.95010652251085); + double2 b1 = double2(315.38003006362362, -381.09218543632522); + double2 r1 = double2(-616.33013658613447, 80.142078913814373); + TestUtils.AreEqual(r1, a1 - b1); + + double a2 = (-125.00837546447684); + double2 b2 = double2(58.466194418476107, 214.74609361158036); + double2 r2 = double2(-183.47456988295295, -339.75446907605721); + TestUtils.AreEqual(r2, a2 - b2); + + double a3 = (-257.54942739082009); + double2 b3 = double2(480.22459505508868, -443.35507723472784); + double2 r3 = double2(-737.77402244590871, 185.80564984390776); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void double2_operator_mul_wide_wide() + { + double2 a0 = double2(-482.71381710596097, -407.29348559272171); + double2 b0 = double2(-236.36788355389979, 260.72759139757954); + double2 r0 = double2(114098.04331156026, -106192.64949051509); + TestUtils.AreEqual(r0, a0 * b0); + + double2 a1 = double2(137.70058995937029, 208.54113278563182); + double2 b1 = double2(-416.38629718142852, -364.49561541364324); + double2 r1 = double2(-57336.638772880389, -76012.328533757158); + TestUtils.AreEqual(r1, a1 * b1); + + double2 a2 = double2(194.296573967811, -484.24241684574747); + double2 b2 = double2(-253.14750897751537, -369.20287220981106); + double2 r2 = double2(-49185.69370281692, 178783.69114527057); + TestUtils.AreEqual(r2, a2 * b2); + + double2 a3 = double2(183.98730739578014, -241.33547770294149); + double2 b3 = double2(193.54791531038836, 169.08491976982214); + double2 r3 = double2(35610.359790024842, -40806.189885013562); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void double2_operator_mul_wide_scalar() + { + double2 a0 = double2(-96.318821236639678, -277.14229239017811); + double b0 = (-301.20720424373042); + double2 r0 = double2(29011.922860739887, 83477.255068544036); + TestUtils.AreEqual(r0, a0 * b0); + + double2 a1 = double2(-239.93690191951436, 255.85810172551226); + double b1 = (509.53140544776409); + double2 r1 = double2(-122255.38685383248, 130367.73816739726); + TestUtils.AreEqual(r1, a1 * b1); + + double2 a2 = double2(215.73149667295229, -389.24327367788334); + double b2 = (-455.50827500573746); + double2 r2 = double2(-98267.481913902491, 177303.53215059882); + TestUtils.AreEqual(r2, a2 * b2); + + double2 a3 = double2(-338.29248658674419, 243.75734459783757); + double b3 = (53.796284939067618); + double2 r3 = double2(-18198.879001166202, 13113.239565975766); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void double2_operator_mul_scalar_wide() + { + double a0 = (37.432166355397612); + double2 b0 = double2(96.747546479454058, 492.18539427788244); + double2 r0 = double2(3621.4702542954869, 18423.565556306661); + TestUtils.AreEqual(r0, a0 * b0); + + double a1 = (-274.05458534604617); + double2 b1 = double2(-452.87096926796761, 420.85330434369541); + double2 r1 = double2(124111.36569799489, -115336.77781342482); + TestUtils.AreEqual(r1, a1 * b1); + + double a2 = (102.18292694081686); + double2 b2 = double2(-114.94887762654054, -351.12003843445336); + double2 r2 = double2(-11745.812764441689, -35878.473234804551); + TestUtils.AreEqual(r2, a2 * b2); + + double a3 = (-464.66496799172131); + double2 b3 = double2(444.08484646495663, 447.10525605040846); + double2 r3 = double2(-206350.67096824755, -207754.14949159342); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void double2_operator_div_wide_wide() + { + double2 a0 = double2(-353.13144390337703, -102.79985456485292); + double2 b0 = double2(-178.73954805114283, -302.09628381491467); + double2 r0 = double2(1.97567604793504, 0.34028837848212429); + TestUtils.AreEqual(r0, a0 / b0); + + double2 a1 = double2(51.319128298814917, -191.87167868012176); + double2 b1 = double2(-199.40583739029518, 278.85077561012042); + double2 r1 = double2(-0.25736021056579439, -0.68808013268139567); + TestUtils.AreEqual(r1, a1 / b1); + + double2 a2 = double2(8.0418245829836223, -128.73764210973758); + double2 b2 = double2(502.33758782890516, -361.48483078623417); + double2 r2 = double2(0.016008805189634039, 0.35613566917796119); + TestUtils.AreEqual(r2, a2 / b2); + + double2 a3 = double2(-136.05959779399427, -370.4710053738537); + double2 b3 = double2(353.121059820578, -38.894930142394685); + double2 r3 = double2(-0.3853058151307277, 9.5249176182488586); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void double2_operator_div_wide_scalar() + { + double2 a0 = double2(171.34242184988341, 0.10338377957384637); + double b0 = (171.79682191265601); + double2 r0 = double2(0.99735501473360411, 0.00060177934855167557); + TestUtils.AreEqual(r0, a0 / b0); + + double2 a1 = double2(57.888263967767443, 95.6696842162263); + double b1 = (-256.13074529177078); + double2 r1 = double2(-0.22601060213143936, -0.37351893895925842); + TestUtils.AreEqual(r1, a1 / b1); + + double2 a2 = double2(-290.38690461329509, -79.7448890580539); + double b2 = (-127.44869118903239); + double2 r2 = double2(2.2784612529491741, 0.6257019065011501); + TestUtils.AreEqual(r2, a2 / b2); + + double2 a3 = double2(146.46688110496234, 58.686315802245531); + double b3 = (-499.84355687529012); + double2 r3 = double2(-0.29302544584265894, -0.11740936738109768); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void double2_operator_div_scalar_wide() + { + double a0 = (-264.44250095283729); + double2 b0 = double2(105.58908157497137, -142.34910137129441); + double2 r0 = double2(-2.5044492954044237, 1.85770404172122); + TestUtils.AreEqual(r0, a0 / b0); + + double a1 = (-288.94890679463231); + double2 b1 = double2(39.644133824689334, -363.99138396046658); + double2 r1 = double2(-7.2885665272041447, 0.79383446841701977); + TestUtils.AreEqual(r1, a1 / b1); + + double a2 = (-149.71822006521666); + double2 b2 = double2(-395.72912306139671, 258.71868693955184); + double2 r2 = double2(0.37833510687053507, -0.57869117162069339); + TestUtils.AreEqual(r2, a2 / b2); + + double a3 = (-9.6662514254759344); + double2 b3 = double2(117.72553282497711, -331.38655797177296); + double2 r3 = double2(-0.082108368452634473, 0.029169111398595994); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void double2_operator_mod_wide_wide() + { + double2 a0 = double2(-388.81249422059045, 181.68118842955732); + double2 b0 = double2(436.94417187056695, 58.940049437312382); + double2 r0 = double2(-388.81249422059045, 4.8610401176201776); + TestUtils.AreEqual(r0, a0 % b0); + + double2 a1 = double2(-167.07872470052854, 432.82015319951813); + double2 b1 = double2(-201.11623368091705, 279.2893537391393); + double2 r1 = double2(-167.07872470052854, 153.53079946037883); + TestUtils.AreEqual(r1, a1 % b1); + + double2 a2 = double2(-258.43895995730486, -170.11079629236406); + double2 b2 = double2(-397.07975954426445, 377.89994758083481); + double2 r2 = double2(-258.43895995730486, -170.11079629236406); + TestUtils.AreEqual(r2, a2 % b2); + + double2 a3 = double2(283.318293464984, 122.71651297561664); + double2 b3 = double2(174.69386657266591, -228.17652736798698); + double2 r3 = double2(108.62442689231807, 122.71651297561664); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void double2_operator_mod_wide_scalar() + { + double2 a0 = double2(-244.49962889612635, -211.81931958525411); + double b0 = (39.634963769295723); + double2 r0 = double2(-6.6898462803520147, -13.644500738775491); + TestUtils.AreEqual(r0, a0 % b0); + + double2 a1 = double2(-145.92677576184587, 155.47946436492703); + double b1 = (-304.91822090042672); + double2 r1 = double2(-145.92677576184587, 155.47946436492703); + TestUtils.AreEqual(r1, a1 % b1); + + double2 a2 = double2(-133.90778428591221, -226.53575311719243); + double b2 = (281.30965412841624); + double2 r2 = double2(-133.90778428591221, -226.53575311719243); + TestUtils.AreEqual(r2, a2 % b2); + + double2 a3 = double2(335.16613046041039, 319.47152033423606); + double b3 = (101.70649032560482); + double2 r3 = double2(30.046659483595931, 14.352049357421606); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void double2_operator_mod_scalar_wide() + { + double a0 = (-66.945025236785909); + double2 b0 = double2(-249.77609479137516, -396.07375664081133); + double2 r0 = double2(-66.945025236785909, -66.945025236785909); + TestUtils.AreEqual(r0, a0 % b0); + + double a1 = (386.49204582091977); + double2 b1 = double2(168.93948109864232, -199.4182442163202); + double2 r1 = double2(48.613083623635134, 187.07380160459957); + TestUtils.AreEqual(r1, a1 % b1); + + double a2 = (261.7517141130528); + double2 b2 = double2(16.127438791155555, 257.66814744550186); + double2 r2 = double2(3.7126934545639187, 4.08356666755094); + TestUtils.AreEqual(r2, a2 % b2); + + double a3 = (-75.788451945310669); + double2 b3 = double2(170.95630439136005, -242.85828005655588); + double2 r3 = double2(-75.788451945310669, -75.788451945310669); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void double2_operator_plus() + { + double2 a0 = double2(-418.82956357432045, -405.79894823851015); + double2 r0 = double2(-418.82956357432045, -405.79894823851015); + TestUtils.AreEqual(r0, +a0); + + double2 a1 = double2(-34.041791216489742, -459.83910129025537); + double2 r1 = double2(-34.041791216489742, -459.83910129025537); + TestUtils.AreEqual(r1, +a1); + + double2 a2 = double2(210.8614223985287, -373.015422279488); + double2 r2 = double2(210.8614223985287, -373.015422279488); + TestUtils.AreEqual(r2, +a2); + + double2 a3 = double2(-386.059833944803, -418.64524932328857); + double2 r3 = double2(-386.059833944803, -418.64524932328857); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void double2_operator_neg() + { + double2 a0 = double2(148.46174890755753, -467.12267873581624); + double2 r0 = double2(-148.46174890755753, 467.12267873581624); + TestUtils.AreEqual(r0, -a0); + + double2 a1 = double2(132.04719954917539, 473.7010145009034); + double2 r1 = double2(-132.04719954917539, -473.7010145009034); + TestUtils.AreEqual(r1, -a1); + + double2 a2 = double2(-407.99109024926605, -382.98981803608581); + double2 r2 = double2(407.99109024926605, 382.98981803608581); + TestUtils.AreEqual(r2, -a2); + + double2 a3 = double2(-299.09338893512887, 407.70980305583669); + double2 r3 = double2(299.09338893512887, -407.70980305583669); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void double2_operator_prefix_inc() + { + double2 a0 = double2(-139.84208137348389, -56.743654039103376); + double2 r0 = double2(-138.84208137348389, -55.743654039103376); + TestUtils.AreEqual(r0, ++a0); + + double2 a1 = double2(-381.955324589254, -222.89634452708827); + double2 r1 = double2(-380.955324589254, -221.89634452708827); + TestUtils.AreEqual(r1, ++a1); + + double2 a2 = double2(210.31986556310198, -300.19410218866267); + double2 r2 = double2(211.31986556310198, -299.19410218866267); + TestUtils.AreEqual(r2, ++a2); + + double2 a3 = double2(362.21273939787068, 130.90919429199266); + double2 r3 = double2(363.21273939787068, 131.90919429199266); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void double2_operator_postfix_inc() + { + double2 a0 = double2(-396.6697396695007, 511.20749378167443); + double2 r0 = double2(-396.6697396695007, 511.20749378167443); + TestUtils.AreEqual(r0, a0++); + + double2 a1 = double2(249.11127030528678, -259.49027669592306); + double2 r1 = double2(249.11127030528678, -259.49027669592306); + TestUtils.AreEqual(r1, a1++); + + double2 a2 = double2(278.00817764830219, 66.719732554033271); + double2 r2 = double2(278.00817764830219, 66.719732554033271); + TestUtils.AreEqual(r2, a2++); + + double2 a3 = double2(167.85212691493894, -326.10758486674524); + double2 r3 = double2(167.85212691493894, -326.10758486674524); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void double2_operator_prefix_dec() + { + double2 a0 = double2(123.12869626056806, 256.8437465433235); + double2 r0 = double2(122.12869626056806, 255.8437465433235); + TestUtils.AreEqual(r0, --a0); + + double2 a1 = double2(156.33078844674435, 325.86799755965728); + double2 r1 = double2(155.33078844674435, 324.86799755965728); + TestUtils.AreEqual(r1, --a1); + + double2 a2 = double2(392.01561731473339, -236.2252043393558); + double2 r2 = double2(391.01561731473339, -237.2252043393558); + TestUtils.AreEqual(r2, --a2); + + double2 a3 = double2(125.10963517292851, 45.536655685648611); + double2 r3 = double2(124.10963517292851, 44.536655685648611); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void double2_operator_postfix_dec() + { + double2 a0 = double2(379.68831723727669, 302.69287814884115); + double2 r0 = double2(379.68831723727669, 302.69287814884115); + TestUtils.AreEqual(r0, a0--); + + double2 a1 = double2(-176.07134040448409, 470.56758401848731); + double2 r1 = double2(-176.07134040448409, 470.56758401848731); + TestUtils.AreEqual(r1, a1--); + + double2 a2 = double2(-402.92594666170231, 355.26110069605568); + double2 r2 = double2(-402.92594666170231, 355.26110069605568); + TestUtils.AreEqual(r2, a2--); + + double2 a3 = double2(-27.889220489137415, 156.14034969924967); + double2 r3 = double2(-27.889220489137415, 156.14034969924967); + TestUtils.AreEqual(r3, a3--); + } + + [TestCompiler] + public static void double2_shuffle_result_1() + { + double2 a = double2(0, 1); + double2 b = double2(2, 3); + + TestUtils.AreEqual((0), shuffle(a, b, ShuffleComponent.LeftX)); + TestUtils.AreEqual((1), shuffle(a, b, ShuffleComponent.LeftY)); + TestUtils.AreEqual((2), shuffle(a, b, ShuffleComponent.RightX)); + TestUtils.AreEqual((3), shuffle(a, b, ShuffleComponent.RightY)); + } + + [TestCompiler] + public static void double2_shuffle_result_2() + { + double2 a = double2(0, 1); + double2 b = double2(2, 3); + + TestUtils.AreEqual(double2(0, 0), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.LeftX)); + TestUtils.AreEqual(double2(1, 0), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.LeftX)); + TestUtils.AreEqual(double2(2, 0), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftX)); + TestUtils.AreEqual(double2(3, 0), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftX)); + TestUtils.AreEqual(double2(0, 1), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.LeftY)); + TestUtils.AreEqual(double2(1, 1), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.LeftY)); + TestUtils.AreEqual(double2(2, 1), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftY)); + TestUtils.AreEqual(double2(3, 1), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftY)); + TestUtils.AreEqual(double2(0, 2), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.RightX)); + TestUtils.AreEqual(double2(1, 2), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.RightX)); + TestUtils.AreEqual(double2(2, 2), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightX)); + TestUtils.AreEqual(double2(3, 2), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightX)); + TestUtils.AreEqual(double2(0, 3), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.RightY)); + TestUtils.AreEqual(double2(1, 3), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.RightY)); + TestUtils.AreEqual(double2(2, 3), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightY)); + TestUtils.AreEqual(double2(3, 3), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightY)); + } + + [TestCompiler] + public static void double2_shuffle_result_3() + { + double2 a = double2(0, 1); + double2 b = double2(2, 3); + + TestUtils.AreEqual(double3(2, 3, 3), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightY, ShuffleComponent.RightY)); + TestUtils.AreEqual(double3(2, 0, 2), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftX, ShuffleComponent.RightX)); + TestUtils.AreEqual(double3(3, 1, 3), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftY, ShuffleComponent.RightY)); + TestUtils.AreEqual(double3(1, 1, 1), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.LeftY, ShuffleComponent.LeftY)); + TestUtils.AreEqual(double3(2, 1, 3), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftY, ShuffleComponent.RightY)); + TestUtils.AreEqual(double3(0, 3, 3), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.RightY, ShuffleComponent.RightY)); + TestUtils.AreEqual(double3(2, 1, 3), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftY, ShuffleComponent.RightY)); + TestUtils.AreEqual(double3(3, 3, 0), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightY, ShuffleComponent.LeftX)); + TestUtils.AreEqual(double3(2, 2, 3), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightX, ShuffleComponent.RightY)); + TestUtils.AreEqual(double3(2, 2, 0), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightX, ShuffleComponent.LeftX)); + TestUtils.AreEqual(double3(0, 1, 1), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.LeftY, ShuffleComponent.LeftY)); + TestUtils.AreEqual(double3(3, 2, 3), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightX, ShuffleComponent.RightY)); + TestUtils.AreEqual(double3(0, 1, 1), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.LeftY, ShuffleComponent.LeftY)); + TestUtils.AreEqual(double3(3, 2, 2), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightX, ShuffleComponent.RightX)); + TestUtils.AreEqual(double3(0, 1, 3), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.LeftY, ShuffleComponent.RightY)); + TestUtils.AreEqual(double3(3, 1, 1), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftY, ShuffleComponent.LeftY)); + } + + [TestCompiler] + public static void double2_shuffle_result_4() + { + double2 a = double2(0, 1); + double2 b = double2(2, 3); + + TestUtils.AreEqual(double4(0, 0, 1, 2), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.LeftX, ShuffleComponent.LeftY, ShuffleComponent.RightX)); + TestUtils.AreEqual(double4(2, 1, 0, 3), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftY, ShuffleComponent.LeftX, ShuffleComponent.RightY)); + TestUtils.AreEqual(double4(3, 2, 3, 2), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightX, ShuffleComponent.RightY, ShuffleComponent.RightX)); + TestUtils.AreEqual(double4(2, 0, 3, 3), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftX, ShuffleComponent.RightY, ShuffleComponent.RightY)); + TestUtils.AreEqual(double4(0, 3, 0, 2), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.RightY, ShuffleComponent.LeftX, ShuffleComponent.RightX)); + TestUtils.AreEqual(double4(3, 0, 3, 1), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftX, ShuffleComponent.RightY, ShuffleComponent.LeftY)); + TestUtils.AreEqual(double4(2, 2, 3, 0), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightX, ShuffleComponent.RightY, ShuffleComponent.LeftX)); + TestUtils.AreEqual(double4(2, 2, 0, 3), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightX, ShuffleComponent.LeftX, ShuffleComponent.RightY)); + TestUtils.AreEqual(double4(0, 1, 2, 1), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.LeftY, ShuffleComponent.RightX, ShuffleComponent.LeftY)); + TestUtils.AreEqual(double4(2, 1, 3, 3), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftY, ShuffleComponent.RightY, ShuffleComponent.RightY)); + TestUtils.AreEqual(double4(3, 3, 3, 1), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightY, ShuffleComponent.RightY, ShuffleComponent.LeftY)); + TestUtils.AreEqual(double4(2, 2, 1, 1), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightX, ShuffleComponent.LeftY, ShuffleComponent.LeftY)); + TestUtils.AreEqual(double4(3, 0, 0, 0), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftX, ShuffleComponent.LeftX, ShuffleComponent.LeftX)); + TestUtils.AreEqual(double4(2, 2, 2, 3), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightX, ShuffleComponent.RightX, ShuffleComponent.RightY)); + TestUtils.AreEqual(double4(0, 3, 0, 3), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.RightY, ShuffleComponent.LeftX, ShuffleComponent.RightY)); + TestUtils.AreEqual(double4(2, 0, 0, 0), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftX, ShuffleComponent.LeftX, ShuffleComponent.LeftX)); + } + + [TestCase /* For player builds */] + public static void double2_EqualsObjectOverride() + { + TestUtils.IsFalse(new double2().Equals((object)new int())); + TestUtils.IsTrue(new double2().Equals((object)new double2())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestDouble2.gen.cs.meta b/src/Tests/Tests/Shared/TestDouble2.gen.cs.meta new file mode 100644 index 00000000..d496ffc2 --- /dev/null +++ b/src/Tests/Tests/Shared/TestDouble2.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: aad8a485c4a133942b50e482a663b6a3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestDouble2x2.gen.cs b/src/Tests/Tests/Shared/TestDouble2x2.gen.cs new file mode 100644 index 00000000..5b035267 --- /dev/null +++ b/src/Tests/Tests/Shared/TestDouble2x2.gen.cs @@ -0,0 +1,957 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestDouble2x2 + { + [TestCompiler] + public static void double2x2_zero() + { + TestUtils.AreEqual(0.0, double2x2.zero.c0.x); + TestUtils.AreEqual(0.0, double2x2.zero.c0.y); + TestUtils.AreEqual(0.0, double2x2.zero.c1.x); + TestUtils.AreEqual(0.0, double2x2.zero.c1.y); + } + + [TestCompiler] + public static void double2x2_identity() + { + TestUtils.AreEqual(1.0, double2x2.identity.c0.x); + TestUtils.AreEqual(0.0, double2x2.identity.c0.y); + TestUtils.AreEqual(0.0, double2x2.identity.c1.x); + TestUtils.AreEqual(1.0, double2x2.identity.c1.y); + } + + [TestCompiler] + public static void double2x2_operator_equal_wide_wide() + { + double2x2 a0 = double2x2(492.15758275061728, -495.20632027797694, 227.45765195947968, -147.37405950733182); + double2x2 b0 = double2x2(192.56880888369346, -235.61102472786376, -254.04311740307281, -412.62472052715009); + bool2x2 r0 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + double2x2 a1 = double2x2(-222.68201909897942, 64.093720704360749, -23.890404473939157, -16.8197190839889); + double2x2 b1 = double2x2(471.90480945627428, -6.4727852374654162, -339.10237447316865, 488.1875700839737); + bool2x2 r1 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + double2x2 a2 = double2x2(163.23210890741655, -165.27101071424363, 470.87767980568003, -423.94255967808078); + double2x2 b2 = double2x2(-379.5965842584132, -308.41700258311675, -82.333374300195544, -102.92108087563935); + bool2x2 r2 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + double2x2 a3 = double2x2(109.63436918595539, 462.69031283943468, -335.38147727371262, 357.23446934168896); + double2x2 b3 = double2x2(226.51573835430463, -356.90132896830391, -362.91277544708589, -427.89843746083716); + bool2x2 r3 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void double2x2_operator_equal_wide_scalar() + { + double2x2 a0 = double2x2(-303.2300766926399, 451.52631327674089, -253.65587413201848, -105.20363502632995); + double b0 = (123.5445759871717); + bool2x2 r0 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + double2x2 a1 = double2x2(-500.6910920090466, 159.87609656149334, -59.558379439431405, -57.477391031327386); + double b1 = (-426.19248338518315); + bool2x2 r1 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + double2x2 a2 = double2x2(-182.04973968400139, 370.88599866017978, -172.03530629539642, 455.40001198993991); + double b2 = (406.51375861024189); + bool2x2 r2 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + double2x2 a3 = double2x2(-11.338988547836891, -27.150561106927, -325.97606507221985, -290.35904254129116); + double b3 = (363.93823044557973); + bool2x2 r3 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void double2x2_operator_equal_scalar_wide() + { + double a0 = (-253.39728534100453); + double2x2 b0 = double2x2(19.952187785856495, -185.79199346610903, 407.8136052600172, -87.2766969610363); + bool2x2 r0 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + double a1 = (-206.27469382354741); + double2x2 b1 = double2x2(160.503138855334, -274.77081478516141, -2.6315281403397535, 448.35453602688131); + bool2x2 r1 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + double a2 = (-410.03524251004461); + double2x2 b2 = double2x2(247.32901465489022, 355.53915350303942, -298.06671180299793, 414.10151429385951); + bool2x2 r2 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + double a3 = (-481.30262707234482); + double2x2 b3 = double2x2(196.55074438664633, 34.60100008668428, 113.76156645350227, -386.45337861890596); + bool2x2 r3 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void double2x2_operator_not_equal_wide_wide() + { + double2x2 a0 = double2x2(430.8425316432689, 104.69001798736394, 225.80243478799355, -310.57017841496048); + double2x2 b0 = double2x2(210.02470622305975, -55.203330304102678, -269.92533672504373, -234.54673372700194); + bool2x2 r0 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + double2x2 a1 = double2x2(-418.61945815506363, 304.12820281839379, -509.32682561749908, -160.53807719076895); + double2x2 b1 = double2x2(25.917412054686565, -63.726991444699024, -484.55371092471933, -425.333599050219); + bool2x2 r1 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + double2x2 a2 = double2x2(-203.30197606016975, -505.76325368590807, 162.17220623892365, 1.1561973100324394); + double2x2 b2 = double2x2(-53.274394775402925, 328.1944192984115, 15.963139303011417, 461.71412417931208); + bool2x2 r2 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + double2x2 a3 = double2x2(65.662074358045174, 102.78780250567377, 172.93008120960098, 26.621009123800832); + double2x2 b3 = double2x2(-113.36304455313973, -240.07297264787974, 495.11916970420589, 203.5583661550462); + bool2x2 r3 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void double2x2_operator_not_equal_wide_scalar() + { + double2x2 a0 = double2x2(-16.914588697680529, 168.83411486858233, -462.71352145760949, 130.30776959765137); + double b0 = (-145.37277109239847); + bool2x2 r0 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + double2x2 a1 = double2x2(214.50161443208424, -197.12796053529155, -169.09985860115842, -386.61117595555783); + double b1 = (-440.26328178879959); + bool2x2 r1 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + double2x2 a2 = double2x2(-281.02101362916687, -403.96372313236992, -269.80570877241234, 299.65422763473089); + double b2 = (-270.26885593601912); + bool2x2 r2 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + double2x2 a3 = double2x2(-71.750904831919286, -457.36312100727258, -13.519590622521719, 273.87305773136814); + double b3 = (-432.75573917513515); + bool2x2 r3 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void double2x2_operator_not_equal_scalar_wide() + { + double a0 = (275.79582823244664); + double2x2 b0 = double2x2(-57.196896341255353, -382.4325279586169, 97.820359990848374, -161.46364529499022); + bool2x2 r0 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + double a1 = (-458.39563367254829); + double2x2 b1 = double2x2(-499.61786364932448, 327.92217818271467, 367.57121699283425, 59.7863667289663); + bool2x2 r1 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + double a2 = (-209.58068118318016); + double2x2 b2 = double2x2(-62.580453186566217, -479.97497604786184, -49.494519495169868, -114.68521338081229); + bool2x2 r2 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + double a3 = (109.93924599044919); + double2x2 b3 = double2x2(-176.28482755286842, -347.48529903380449, 85.540928165214609, -356.65954868712441); + bool2x2 r3 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void double2x2_operator_less_wide_wide() + { + double2x2 a0 = double2x2(196.84256825076534, 336.40979997087732, 251.96372115424072, 257.65591466503963); + double2x2 b0 = double2x2(-465.34502313348696, -256.15239751346053, -314.814018634527, 364.56673662949663); + bool2x2 r0 = bool2x2(false, false, false, true); + TestUtils.AreEqual(r0, a0 < b0); + + double2x2 a1 = double2x2(430.04588647840819, -62.419644146421774, 8.8392293494376872, -333.81671563434259); + double2x2 b1 = double2x2(100.21050290959442, 182.56098636545289, 3.116978885194726, -259.43047893207074); + bool2x2 r1 = bool2x2(false, true, false, true); + TestUtils.AreEqual(r1, a1 < b1); + + double2x2 a2 = double2x2(164.67880662003472, -350.94487516532877, 3.84143662631584, 125.40972024081725); + double2x2 b2 = double2x2(-437.33490749696966, -456.0437321402336, -394.2559718537405, 401.91369099259077); + bool2x2 r2 = bool2x2(false, false, false, true); + TestUtils.AreEqual(r2, a2 < b2); + + double2x2 a3 = double2x2(-111.12994127680076, 70.005523475820951, 448.19828173527412, -419.98711200244122); + double2x2 b3 = double2x2(313.43916454605721, 121.28668194696616, -28.012290729215522, -282.96589697663012); + bool2x2 r3 = bool2x2(true, true, false, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void double2x2_operator_less_wide_scalar() + { + double2x2 a0 = double2x2(-132.05731708000292, -192.46500477216438, -66.834607870706634, -379.01750081545561); + double b0 = (-156.01021845452965); + bool2x2 r0 = bool2x2(false, true, false, true); + TestUtils.AreEqual(r0, a0 < b0); + + double2x2 a1 = double2x2(-360.28242199508588, -158.24074537970159, 437.34587522845061, -20.452607402788772); + double b1 = (20.927834282129879); + bool2x2 r1 = bool2x2(true, true, false, true); + TestUtils.AreEqual(r1, a1 < b1); + + double2x2 a2 = double2x2(225.29148517609178, 274.01523292903562, 373.54965584983563, 398.52368301829495); + double b2 = (307.48418607725023); + bool2x2 r2 = bool2x2(true, true, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + double2x2 a3 = double2x2(105.0301654827922, 109.67008810381878, -108.853174498702, -44.971252223929014); + double b3 = (-58.010895994496934); + bool2x2 r3 = bool2x2(false, false, true, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void double2x2_operator_less_scalar_wide() + { + double a0 = (-423.117411095238); + double2x2 b0 = double2x2(385.09483617595151, -123.93348532725753, 86.376572887588509, 133.44217378154497); + bool2x2 r0 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r0, a0 < b0); + + double a1 = (161.45794947513286); + double2x2 b1 = double2x2(229.75426660746064, 222.57159934871436, 315.53116360098647, -447.20351883731945); + bool2x2 r1 = bool2x2(true, true, true, false); + TestUtils.AreEqual(r1, a1 < b1); + + double a2 = (271.83385790131695); + double2x2 b2 = double2x2(-393.60531324595462, 317.48689737798964, -164.6051085761772, -282.87605370342544); + bool2x2 r2 = bool2x2(false, true, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + double a3 = (296.97953071118309); + double2x2 b3 = double2x2(-254.40115582868509, 365.61562054493265, -441.98425671178114, -131.42866021554391); + bool2x2 r3 = bool2x2(false, true, false, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void double2x2_operator_greater_wide_wide() + { + double2x2 a0 = double2x2(483.50140141113729, 310.81563415695712, 106.9661896726891, 295.73526038589671); + double2x2 b0 = double2x2(-471.39802454011425, -371.98528617060992, 36.900723236101044, -316.76360407320954); + bool2x2 r0 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r0, a0 > b0); + + double2x2 a1 = double2x2(116.95757179938141, -478.29977653841479, -14.897393471979228, -33.817441717636484); + double2x2 b1 = double2x2(19.683055648432628, 207.3091381561519, 362.79748861994483, 324.95341816775192); + bool2x2 r1 = bool2x2(true, false, false, false); + TestUtils.AreEqual(r1, a1 > b1); + + double2x2 a2 = double2x2(-24.740548383789417, 319.78262701620474, -120.15856581561201, -289.00857962714906); + double2x2 b2 = double2x2(340.94807140014507, 25.986035120666997, -114.2111352021858, 240.80346428640348); + bool2x2 r2 = bool2x2(false, true, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + double2x2 a3 = double2x2(455.85146662958505, 144.70691139283917, 63.931990891663304, -285.68304099034663); + double2x2 b3 = double2x2(273.42244757033063, 325.51576224226312, 27.341068995809678, 64.479532510265472); + bool2x2 r3 = bool2x2(true, false, true, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void double2x2_operator_greater_wide_scalar() + { + double2x2 a0 = double2x2(64.317918092160426, -397.70346445483318, 431.87690826499693, 85.702980796668157); + double b0 = (305.85991992888034); + bool2x2 r0 = bool2x2(false, false, true, false); + TestUtils.AreEqual(r0, a0 > b0); + + double2x2 a1 = double2x2(246.26305233978803, 286.1994608781298, 280.81334818564972, -405.78459210218148); + double b1 = (197.49155602114809); + bool2x2 r1 = bool2x2(true, true, true, false); + TestUtils.AreEqual(r1, a1 > b1); + + double2x2 a2 = double2x2(171.56538661362856, 333.57817498481745, 370.27919524269146, -413.70138116073861); + double b2 = (-241.80727326209063); + bool2x2 r2 = bool2x2(true, true, true, false); + TestUtils.AreEqual(r2, a2 > b2); + + double2x2 a3 = double2x2(-356.5923551789449, 396.64532608382649, 467.22205541432936, -240.0134228393498); + double b3 = (-353.03129522550444); + bool2x2 r3 = bool2x2(false, true, true, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void double2x2_operator_greater_scalar_wide() + { + double a0 = (-282.67049635698572); + double2x2 b0 = double2x2(358.09997360692353, -72.5964134077525, -232.16380106292843, -60.706723956720282); + bool2x2 r0 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + double a1 = (75.156642710397364); + double2x2 b1 = double2x2(150.88350040786133, 339.53917924479538, -498.19602965665797, 459.74610326241054); + bool2x2 r1 = bool2x2(false, false, true, false); + TestUtils.AreEqual(r1, a1 > b1); + + double a2 = (-227.96872316485678); + double2x2 b2 = double2x2(335.86213485145106, 76.178844248959308, 296.85993899817572, 177.49000390688423); + bool2x2 r2 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + double a3 = (-281.20120657663847); + double2x2 b3 = double2x2(244.72285162877427, 137.32857257562159, -385.33824724021287, 443.16345879210326); + bool2x2 r3 = bool2x2(false, false, true, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void double2x2_operator_less_equal_wide_wide() + { + double2x2 a0 = double2x2(-438.52313753521219, 210.48942837980087, 4.8773329280677444, -137.29793817237857); + double2x2 b0 = double2x2(-474.8141498392514, 304.3710555063426, 234.8241737982371, -390.48543209139513); + bool2x2 r0 = bool2x2(false, true, true, false); + TestUtils.AreEqual(r0, a0 <= b0); + + double2x2 a1 = double2x2(156.09410174009111, -363.92412035722475, -97.948485181642923, 437.29539009430232); + double2x2 b1 = double2x2(-297.17535295019638, -326.29239121372461, 107.2538764976216, -413.13107342884462); + bool2x2 r1 = bool2x2(false, true, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + double2x2 a2 = double2x2(458.53029153241323, -294.06474675520542, 23.622613679441884, -34.284056441059363); + double2x2 b2 = double2x2(67.094432623635271, 470.07522724106684, -84.499104777583455, 392.78422683886447); + bool2x2 r2 = bool2x2(false, true, false, true); + TestUtils.AreEqual(r2, a2 <= b2); + + double2x2 a3 = double2x2(149.736484835733, -418.8866781754823, -197.50252899783783, -88.2055118494693); + double2x2 b3 = double2x2(-263.53175485484849, 369.30090039284005, -333.32529298091555, 238.41347443238533); + bool2x2 r3 = bool2x2(false, true, false, true); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void double2x2_operator_less_equal_wide_scalar() + { + double2x2 a0 = double2x2(193.4958237118534, 168.91555197952107, -313.9930695565385, 81.826965131716292); + double b0 = (443.85054299042122); + bool2x2 r0 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + double2x2 a1 = double2x2(18.503590830836288, 241.36115776810846, -463.81641242644582, -1.3577692515020203); + double b1 = (-0.35819602029312136); + bool2x2 r1 = bool2x2(false, false, true, true); + TestUtils.AreEqual(r1, a1 <= b1); + + double2x2 a2 = double2x2(-268.89945591096739, -471.253072242836, -264.93778264938749, 82.258299150624453); + double b2 = (398.9919504593089); + bool2x2 r2 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r2, a2 <= b2); + + double2x2 a3 = double2x2(11.246050124636895, 426.48223157715154, 56.319978501796754, -196.28791126808522); + double b3 = (424.7040156911612); + bool2x2 r3 = bool2x2(true, false, true, true); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void double2x2_operator_less_equal_scalar_wide() + { + double a0 = (393.60626644343427); + double2x2 b0 = double2x2(-75.688363825757222, -44.2638714519627, 125.86491566797019, 191.96488174794467); + bool2x2 r0 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r0, a0 <= b0); + + double a1 = (13.543054825413492); + double2x2 b1 = double2x2(-197.0519259893577, -423.945100743298, -330.04861680141119, 420.16553779140372); + bool2x2 r1 = bool2x2(false, false, false, true); + TestUtils.AreEqual(r1, a1 <= b1); + + double a2 = (105.54730777887039); + double2x2 b2 = double2x2(174.82126363311954, 296.71757831085358, -469.70041845259277, 123.26718979853536); + bool2x2 r2 = bool2x2(true, true, false, true); + TestUtils.AreEqual(r2, a2 <= b2); + + double a3 = (112.9969695140594); + double2x2 b3 = double2x2(495.14339493920249, -488.65789364681478, 388.53941148730894, -493.24077080806751); + bool2x2 r3 = bool2x2(true, false, true, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void double2x2_operator_greater_equal_wide_wide() + { + double2x2 a0 = double2x2(-507.92858409692, 504.49748181947393, -385.43449205226938, -262.32340944107784); + double2x2 b0 = double2x2(-81.346509732933043, 297.66615047010885, 171.06540616371922, -431.03805538222105); + bool2x2 r0 = bool2x2(false, true, false, true); + TestUtils.AreEqual(r0, a0 >= b0); + + double2x2 a1 = double2x2(-37.550928848586466, -111.59527759980193, -463.70202157632542, 387.44885772627265); + double2x2 b1 = double2x2(-6.859075311040101, 319.72570362674333, 254.079170106947, 396.5724000393285); + bool2x2 r1 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + double2x2 a2 = double2x2(456.96878573716094, -211.01015506079892, 182.41135391146474, -53.596053863687473); + double2x2 b2 = double2x2(178.83927615864172, -447.06336304501787, 288.49268569075161, 474.88929460704765); + bool2x2 r2 = bool2x2(true, true, false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + double2x2 a3 = double2x2(-309.57021608463032, -136.02249127999994, 280.73629082401112, -96.9958942388165); + double2x2 b3 = double2x2(-321.75022831640683, -395.97722048125104, -158.69246037243516, 391.48869318118727); + bool2x2 r3 = bool2x2(true, true, true, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void double2x2_operator_greater_equal_wide_scalar() + { + double2x2 a0 = double2x2(465.15218732559686, -424.8860745024337, -209.22109685150025, 58.779852656079356); + double b0 = (-5.5998842742293391); + bool2x2 r0 = bool2x2(true, false, false, true); + TestUtils.AreEqual(r0, a0 >= b0); + + double2x2 a1 = double2x2(-302.26910533675414, 16.353385694489475, -344.55997316192838, 393.27804846003562); + double b1 = (140.12558252183976); + bool2x2 r1 = bool2x2(false, false, false, true); + TestUtils.AreEqual(r1, a1 >= b1); + + double2x2 a2 = double2x2(-315.70155086913218, -509.78156757251435, -36.994287269652943, 494.82028865014217); + double b2 = (441.0115565923096); + bool2x2 r2 = bool2x2(false, false, false, true); + TestUtils.AreEqual(r2, a2 >= b2); + + double2x2 a3 = double2x2(-164.97393830352183, -123.8137477020797, 215.65121779947128, 104.99569730879534); + double b3 = (-466.12009046325466); + bool2x2 r3 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void double2x2_operator_greater_equal_scalar_wide() + { + double a0 = (374.82703393270594); + double2x2 b0 = double2x2(-1.609757185731894, 338.61524049314448, -116.18140392945213, -332.15732375353451); + bool2x2 r0 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + double a1 = (-355.9793509710484); + double2x2 b1 = double2x2(-468.90144107719021, 38.579884785497484, -332.34754697063357, 2.8901150240051265); + bool2x2 r1 = bool2x2(true, false, false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + double a2 = (467.77776477661814); + double2x2 b2 = double2x2(121.40638762405445, -305.02337303060267, -58.428812292604164, -226.51955209789776); + bool2x2 r2 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r2, a2 >= b2); + + double a3 = (-47.020994446715804); + double2x2 b3 = double2x2(305.3026770582901, -427.40123315686418, 92.263649745035764, -497.17853736187266); + bool2x2 r3 = bool2x2(false, true, false, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void double2x2_operator_add_wide_wide() + { + double2x2 a0 = double2x2(506.12905263627374, -501.77980803967444, 420.08479638587903, -186.03206476291274); + double2x2 b0 = double2x2(-28.757987751047096, -337.135153689019, -340.676816860529, 152.31202633320913); + double2x2 r0 = double2x2(477.37106488522664, -838.91496172869347, 79.407979525350015, -33.720038429703607); + TestUtils.AreEqual(r0, a0 + b0); + + double2x2 a1 = double2x2(-9.3123953385801883, 328.51179686585056, 424.34407659263536, 87.791079800478656); + double2x2 b1 = double2x2(423.66745420157326, 90.374096674087468, 376.18866246574964, 1.7671887882831925); + double2x2 r1 = double2x2(414.35505886299308, 418.885893539938, 800.532739058385, 89.558268588761848); + TestUtils.AreEqual(r1, a1 + b1); + + double2x2 a2 = double2x2(462.41368148402012, -46.178705952213477, 401.17006296718966, -454.12414643453627); + double2x2 b2 = double2x2(-120.18586045139745, -279.62936628965167, -344.66710273580026, 242.8391956029642); + double2x2 r2 = double2x2(342.22782103262267, -325.80807224186515, 56.502960231389409, -211.28495083157208); + TestUtils.AreEqual(r2, a2 + b2); + + double2x2 a3 = double2x2(69.195687564646732, -177.95734485329939, 299.60415544156183, 340.7048587001417); + double2x2 b3 = double2x2(418.5930504363929, -23.312797318823982, -95.099945827899489, 147.92812568877275); + double2x2 r3 = double2x2(487.78873800103963, -201.27014217212337, 204.50420961366234, 488.63298438891445); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void double2x2_operator_add_wide_scalar() + { + double2x2 a0 = double2x2(-194.51420387742769, 338.54838696985894, 246.97140252169754, 100.51093797595752); + double b0 = (124.121678171736); + double2x2 r0 = double2x2(-70.3925257056917, 462.67006514159493, 371.09308069343354, 224.63261614769351); + TestUtils.AreEqual(r0, a0 + b0); + + double2x2 a1 = double2x2(-45.724677822424439, 30.916145577522116, 60.37435224483454, -242.1187475855084); + double b1 = (-478.11131094308166); + double2x2 r1 = double2x2(-523.835988765506, -447.19516536555955, -417.73695869824712, -720.23005852859); + TestUtils.AreEqual(r1, a1 + b1); + + double2x2 a2 = double2x2(82.50134495762245, -484.69981287638649, -188.26501068298938, -213.52673087526426); + double b2 = (6.7993848355483806); + double2x2 r2 = double2x2(89.300729793170831, -477.90042804083811, -181.465625847441, -206.72734603971588); + TestUtils.AreEqual(r2, a2 + b2); + + double2x2 a3 = double2x2(-267.78430688929944, 198.53359684652355, 187.53610023648298, -424.92567582844089); + double b3 = (189.25996669999324); + double2x2 r3 = double2x2(-78.5243401893062, 387.79356354651679, 376.79606693647622, -235.66570912844765); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void double2x2_operator_add_scalar_wide() + { + double a0 = (-340.35468284243473); + double2x2 b0 = double2x2(511.36225652665007, -146.21663791789518, -106.21042661844308, -363.45024960276214); + double2x2 r0 = double2x2(171.00757368421534, -486.57132076032991, -446.56510946087781, -703.80493244519687); + TestUtils.AreEqual(r0, a0 + b0); + + double a1 = (199.08958325120136); + double2x2 b1 = double2x2(-27.108407271610758, 419.84900041103788, 284.95503748811552, -164.92418129971446); + double2x2 r1 = double2x2(171.9811759795906, 618.93858366223924, 484.04462073931688, 34.1654019514869); + TestUtils.AreEqual(r1, a1 + b1); + + double a2 = (-249.19032561461921); + double2x2 b2 = double2x2(150.92817718858282, 298.17509784278229, -457.15341803857751, 424.71807094324288); + double2x2 r2 = double2x2(-98.26214842603639, 48.984772228163081, -706.34374365319673, 175.52774532862367); + TestUtils.AreEqual(r2, a2 + b2); + + double a3 = (-301.85750283946163); + double2x2 b3 = double2x2(230.28885208363124, -423.58759351428023, -67.060037882560891, 68.7241366229598); + double2x2 r3 = double2x2(-71.56865075583039, -725.44509635374186, -368.91754072202252, -233.13336621650183); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void double2x2_operator_sub_wide_wide() + { + double2x2 a0 = double2x2(160.4922617229131, 11.223957305412682, 359.20010607279846, -498.22830485656311); + double2x2 b0 = double2x2(115.46876078260539, -130.98230630298252, 241.54083716196044, 9.9870860623135513); + double2x2 r0 = double2x2(45.023500940307713, 142.2062636083952, 117.65926891083802, -508.21539091887666); + TestUtils.AreEqual(r0, a0 - b0); + + double2x2 a1 = double2x2(-355.25362913462038, -94.534852787170053, -410.46404786150163, -401.38464398001537); + double2x2 b1 = double2x2(419.89512582304656, 59.124466208333388, -402.38163847587145, -75.370143687059226); + double2x2 r1 = double2x2(-775.14875495766694, -153.65931899550344, -8.0824093856301715, -326.01450029295614); + TestUtils.AreEqual(r1, a1 - b1); + + double2x2 a2 = double2x2(317.70681944382693, 447.0604133303558, -489.07414482956477, -230.00838218909149); + double2x2 b2 = double2x2(320.97960796997859, -73.908757482612884, -31.444742455819949, -389.25194734579509); + double2x2 r2 = double2x2(-3.2727885261516576, 520.96917081296874, -457.62940237374482, 159.2435651567036); + TestUtils.AreEqual(r2, a2 - b2); + + double2x2 a3 = double2x2(24.875419389864192, 366.61447136784648, -107.3741567634857, -219.0081404275299); + double2x2 b3 = double2x2(-375.02884000122026, 259.18275821357167, 276.648654351313, -453.06919905779381); + double2x2 r3 = double2x2(399.90425939108445, 107.4317131542748, -384.02281111479869, 234.06105863026391); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void double2x2_operator_sub_wide_scalar() + { + double2x2 a0 = double2x2(207.38960108877609, 248.45773684627272, -384.82393211164697, -205.34476122881506); + double b0 = (-36.112476604111691); + double2x2 r0 = double2x2(243.50207769288778, 284.57021345038441, -348.71145550753528, -169.23228462470337); + TestUtils.AreEqual(r0, a0 - b0); + + double2x2 a1 = double2x2(-374.81156152058929, 18.856238135535364, -44.96160151667965, 480.85798738936796); + double b1 = (191.64204820973896); + double2x2 r1 = double2x2(-566.45360973032825, -172.7858100742036, -236.60364972641861, 289.215939179629); + TestUtils.AreEqual(r1, a1 - b1); + + double2x2 a2 = double2x2(16.338193185784917, -35.523088233323335, 349.39776460705218, 439.07729336203886); + double b2 = (-366.86545269883493); + double2x2 r2 = double2x2(383.20364588461985, 331.34236446551159, 716.26321730588711, 805.94274606087379); + TestUtils.AreEqual(r2, a2 - b2); + + double2x2 a3 = double2x2(490.2222661870635, -384.84940952102158, 189.05188545447402, 55.602777745389744); + double b3 = (195.02405104181923); + double2x2 r3 = double2x2(295.19821514524426, -579.87346056284082, -5.9721655873452164, -139.42127329642949); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void double2x2_operator_sub_scalar_wide() + { + double a0 = (-86.008225719448262); + double2x2 b0 = double2x2(466.42511413359318, 298.48694219183506, -300.95010652251085, 315.38003006362362); + double2x2 r0 = double2x2(-552.43333985304139, -384.49516791128332, 214.94188080306259, -401.38825578307188); + TestUtils.AreEqual(r0, a0 - b0); + + double a1 = (-381.09218543632522); + double2x2 b1 = double2x2(-125.00837546447684, 58.466194418476107, 214.74609361158036, -257.54942739082009); + double2x2 r1 = double2x2(-256.08380997184838, -439.55837985480133, -595.83827904790564, -123.54275804550514); + TestUtils.AreEqual(r1, a1 - b1); + + double a2 = (480.22459505508868); + double2x2 b2 = double2x2(-443.35507723472784, 260.79503858312728, 29.681931747906788, 139.85773164586055); + double2x2 r2 = double2x2(923.57967228981647, 219.4295564719614, 450.5426633071819, 340.36686340922813); + TestUtils.AreEqual(r2, a2 - b2); + + double a3 = (-247.78996216868512); + double2x2 b3 = double2x2(-248.4662297929014, 91.445112509394562, 86.384162704639266, 373.81828206303453); + double2x2 r3 = double2x2(0.67626762421627973, -339.23507467807968, -334.17412487332439, -621.60824423171971); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void double2x2_operator_mul_wide_wide() + { + double2x2 a0 = double2x2(-482.71381710596097, -407.29348559272171, 137.70058995937029, 208.54113278563182); + double2x2 b0 = double2x2(-236.36788355389979, 260.72759139757954, -416.38629718142852, -364.49561541364324); + double2x2 r0 = double2x2(114098.04331156026, -106192.64949051509, -57336.638772880389, -76012.328533757158); + TestUtils.AreEqual(r0, a0 * b0); + + double2x2 a1 = double2x2(194.296573967811, -484.24241684574747, 183.98730739578014, -241.33547770294149); + double2x2 b1 = double2x2(-253.14750897751537, -369.20287220981106, 193.54791531038836, 169.08491976982214); + double2x2 r1 = double2x2(-49185.69370281692, 178783.69114527057, 35610.359790024842, -40806.189885013562); + TestUtils.AreEqual(r1, a1 * b1); + + double2x2 a2 = double2x2(45.868758938214114, 363.32610266438041, -328.11893692990714, -471.02307413100408); + double2x2 b2 = double2x2(201.96966442930034, 249.45608317547294, -308.19319810913555, -385.57964843585137); + double2x2 r2 = double2x2(9264.0978505395742, 90633.9064860661, 101124.02453259782, 181616.91132860651); + TestUtils.AreEqual(r2, a2 * b2); + + double2x2 a3 = double2x2(-262.68257415605831, -379.26274674910246, -374.09058182970182, 481.44738720424812); + double2x2 b3 = double2x2(-183.27959522198864, 22.275629292370581, -265.52144229855458, -95.677454277722859); + double2x2 r3 = double2x2(48144.355863192381, -8448.3163509892329, 99329.070837727879, -46063.660376363579); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void double2x2_operator_mul_wide_scalar() + { + double2x2 a0 = double2x2(-96.318821236639678, -277.14229239017811, -239.93690191951436, 509.53140544776409); + double b0 = (-301.20720424373042); + double2x2 r0 = double2x2(29011.922860739887, 83477.255068544036, 72270.723422079071, -153474.5301092997); + TestUtils.AreEqual(r0, a0 * b0); + + double2x2 a1 = double2x2(255.85810172551226, -455.50827500573746, -389.24327367788334, -338.29248658674419); + double b1 = (215.73149667295229); + double2x2 r1 = double2x2(55196.651221145235, -98267.481913902491, -83972.034000409345, -72980.344444572955); + TestUtils.AreEqual(r1, a1 * b1); + + double2x2 a2 = double2x2(53.796284939067618, 135.35469991311186, -207.35010275959507, -383.93960946795517); + double b2 = (243.75734459783757); + double2x2 r2 = double2x2(13113.239565975766, 32993.702229657305, -50543.11045076765, -93588.099689839524); + TestUtils.AreEqual(r2, a2 * b2); + + double2x2 a3 = double2x2(-31.425238862366086, 260.38388049806645, 176.86755927692525, 25.672123205695357); + double b3 = (42.676120539510634); + double2x2 r3 = double2x2(-1341.1072816732492, 11112.173870681016, 7548.021279231104, 1095.5866244314232); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void double2x2_operator_mul_scalar_wide() + { + double a0 = (37.432166355397612); + double2x2 b0 = double2x2(96.747546479454058, 492.18539427788244, -274.05458534604617, -452.87096926796761); + double2x2 r0 = double2x2(3621.4702542954869, 18423.565556306661, -10258.456829132712, -16951.941459168724); + TestUtils.AreEqual(r0, a0 * b0); + + double a1 = (420.85330434369541); + double2x2 b1 = double2x2(102.18292694081686, -114.94887762654054, -351.12003843445336, -464.66496799172131); + double2x2 r1 = double2x2(43004.022450553188, -48376.614979728663, -147770.02839642504, -195555.78719207339); + TestUtils.AreEqual(r1, a1 * b1); + + double a2 = (444.08484646495663); + double2x2 b2 = double2x2(447.10525605040846, 130.82935124767448, -321.41334191030512, 445.30131861441828); + double2x2 r2 = double2x2(198552.66898682076, 58099.332361933404, -142734.79459402646, 197751.56770752667); + TestUtils.AreEqual(r2, a2 * b2); + + double a3 = (478.24357317306271); + double2x2 b3 = double2x2(358.57170622356784, -144.89011222910608, -438.89383741789209, -3.536441089369589); + double2x2 r3 = double2x2(171484.61402312081, -69292.764989893767, -209898.15705036998, -1691.2802228961507); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void double2x2_operator_div_wide_wide() + { + double2x2 a0 = double2x2(-353.13144390337703, -102.79985456485292, 51.319128298814917, -191.87167868012176); + double2x2 b0 = double2x2(-178.73954805114283, -302.09628381491467, -199.40583739029518, 278.85077561012042); + double2x2 r0 = double2x2(1.97567604793504, 0.34028837848212429, -0.25736021056579439, -0.68808013268139567); + TestUtils.AreEqual(r0, a0 / b0); + + double2x2 a1 = double2x2(8.0418245829836223, -128.73764210973758, -136.05959779399427, -370.4710053738537); + double2x2 b1 = double2x2(502.33758782890516, -361.48483078623417, 353.121059820578, -38.894930142394685); + double2x2 r1 = double2x2(0.016008805189634039, 0.35613566917796119, -0.3853058151307277, 9.5249176182488586); + TestUtils.AreEqual(r1, a1 / b1); + + double2x2 a2 = double2x2(-237.69456326109105, -432.54687496300176, 200.26549181727012, 361.44157068871039); + double2x2 b2 = double2x2(-75.764737402910725, -195.21784719974636, -405.03399224068687, -394.2300085473014); + double2x2 r2 = double2x2(3.1372716570909582, 2.2157137842034547, -0.49444119667433889, -0.9168291678773689); + TestUtils.AreEqual(r2, a2 / b2); + + double2x2 a3 = double2x2(-416.22613234828509, -450.01919362042992, -273.49744594911925, -286.90817011841955); + double2x2 b3 = double2x2(-375.82771342612227, -121.24548655433836, 447.623344391409, 338.28628007429018); + double2x2 r3 = double2x2(1.1074918572499153, 3.7116366671409717, -0.61099906735420106, -0.84812239519560884); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void double2x2_operator_div_wide_scalar() + { + double2x2 a0 = double2x2(171.34242184988341, 0.10338377957384637, 57.888263967767443, -256.13074529177078); + double b0 = (171.79682191265601); + double2x2 r0 = double2x2(0.99735501473360411, 0.00060177934855167557, 0.33695771157628673, -1.4908933846400916); + TestUtils.AreEqual(r0, a0 / b0); + + double2x2 a1 = double2x2(95.6696842162263, -127.44869118903239, -79.7448890580539, 146.46688110496234); + double b1 = (-290.38690461329509); + double2x2 r1 = double2x2(-0.32945591793689361, 0.43889269510536072, 0.27461599607685222, -0.50438528314494968); + TestUtils.AreEqual(r1, a1 / b1); + + double2x2 a2 = double2x2(-499.84355687529012, -453.20579859856787, -205.03382143985192, 481.73814247629514); + double b2 = (58.686315802245531); + double2x2 r2 = double2x2(-8.5172079733136776, -7.7225123506769311, -3.4937245358995028, 8.2086962844899229); + TestUtils.AreEqual(r2, a2 / b2); + + double2x2 a3 = double2x2(464.47907159499778, -158.50557930697948, -289.5822156824089, 494.12860535743118); + double b3 = (-293.46349753693841); + double2x2 r3 = double2x2(-1.5827490488370997, 0.54012025562745947, 0.9867742261402, -1.683782172245238); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void double2x2_operator_div_scalar_wide() + { + double a0 = (-264.44250095283729); + double2x2 b0 = double2x2(105.58908157497137, -142.34910137129441, -288.94890679463231, 39.644133824689334); + double2x2 r0 = double2x2(-2.5044492954044237, 1.85770404172122, 0.915187753732487, -6.670406827961755); + TestUtils.AreEqual(r0, a0 / b0); + + double a1 = (-363.99138396046658); + double2x2 b1 = double2x2(-149.71822006521666, -395.72912306139671, 258.71868693955184, -9.6662514254759344); + double2x2 r1 = double2x2(2.4311762710103912, 0.91979933431382543, -1.4069002446874319, 37.655898645585339); + TestUtils.AreEqual(r1, a1 / b1); + + double a2 = (117.72553282497711); + double2x2 b2 = double2x2(-331.38655797177296, -509.98602676297821, 427.8964666928614, 467.61712882836218); + double2x2 r2 = double2x2(-0.35525138239012338, -0.23084070277810059, 0.275126209232008, 0.25175624579866063); + TestUtils.AreEqual(r2, a2 / b2); + + double a3 = (-407.12461943511136); + double2x2 b3 = double2x2(252.69070994699871, 444.59937664708093, -88.313306134340053, 199.95503411067421); + double2x2 r3 = double2x2(-1.6111578439923842, -0.91571117914158318, 4.6100031496477243, -2.0360808681104259); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void double2x2_operator_mod_wide_wide() + { + double2x2 a0 = double2x2(-388.81249422059045, 181.68118842955732, -167.07872470052854, 432.82015319951813); + double2x2 b0 = double2x2(436.94417187056695, 58.940049437312382, -201.11623368091705, 279.2893537391393); + double2x2 r0 = double2x2(-388.81249422059045, 4.8610401176201776, -167.07872470052854, 153.53079946037883); + TestUtils.AreEqual(r0, a0 % b0); + + double2x2 a1 = double2x2(-258.43895995730486, -170.11079629236406, 283.318293464984, 122.71651297561664); + double2x2 b1 = double2x2(-397.07975954426445, 377.89994758083481, 174.69386657266591, -228.17652736798698); + double2x2 r1 = double2x2(-258.43895995730486, -170.11079629236406, 108.62442689231807, 122.71651297561664); + TestUtils.AreEqual(r1, a1 % b1); + + double2x2 a2 = double2x2(335.27101413126616, -503.60851668920765, 191.02251848532933, 289.74269379756538); + double2x2 b2 = double2x2(-317.06019106370405, -417.48011107811709, -249.9759434433542, -397.57157177364991); + double2x2 r2 = double2x2(18.210823067562103, -86.128405611090557, 191.02251848532933, 289.74269379756538); + TestUtils.AreEqual(r2, a2 % b2); + + double2x2 a3 = double2x2(-124.03371745163281, 259.27395761165485, -274.35845030208975, -140.03080398404541); + double2x2 b3 = double2x2(-358.74544947163452, -198.1592100589346, 208.73709378425826, -12.119406944196385); + double2x2 r3 = double2x2(-124.03371745163281, 61.114747552720246, -65.621356517831487, -6.7173275978851734); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void double2x2_operator_mod_wide_scalar() + { + double2x2 a0 = double2x2(-244.49962889612635, -211.81931958525411, -145.92677576184587, -304.91822090042672); + double b0 = (39.634963769295723); + double2x2 r0 = double2x2(-6.6898462803520147, -13.644500738775491, -27.021884453958705, -27.473474515356656); + TestUtils.AreEqual(r0, a0 % b0); + + double2x2 a1 = double2x2(155.47946436492703, 281.30965412841624, -226.53575311719243, 335.16613046041039); + double b1 = (-133.90778428591221); + double2x2 r1 = double2x2(21.571680079014811, 13.494085556591813, -92.627968831280214, 67.350561888585958); + TestUtils.AreEqual(r1, a1 % b1); + + double2x2 a2 = double2x2(101.70649032560482, -285.40231646476423, -355.84685985923136, 259.37800061860025); + double b2 = (319.47152033423606); + double2x2 r2 = double2x2(101.70649032560482, -285.40231646476423, -36.3753395249953, 259.37800061860025); + TestUtils.AreEqual(r2, a2 % b2); + + double2x2 a3 = double2x2(-330.87193957477433, -102.68343811048356, -172.14173921017988, 206.41684517935698); + double b3 = (-284.34358109363518); + double2x2 r3 = double2x2(-46.528358481139151, -102.68343811048356, -172.14173921017988, 206.41684517935698); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void double2x2_operator_mod_scalar_wide() + { + double a0 = (-66.945025236785909); + double2x2 b0 = double2x2(-249.77609479137516, -396.07375664081133, 386.49204582091977, 168.93948109864232); + double2x2 r0 = double2x2(-66.945025236785909, -66.945025236785909, -66.945025236785909, -66.945025236785909); + TestUtils.AreEqual(r0, a0 % b0); + + double a1 = (-199.4182442163202); + double2x2 b1 = double2x2(261.7517141130528, 16.127438791155555, 257.66814744550186, -75.788451945310669); + double2x2 r1 = double2x2(-199.4182442163202, -5.8889787224535439, -199.4182442163202, -47.841340325698866); + TestUtils.AreEqual(r1, a1 % b1); + + double a2 = (170.95630439136005); + double2x2 b2 = double2x2(-242.85828005655588, 425.94531913564788, 303.27240409668184, 3.033060790520608); + double2x2 r2 = double2x2(170.95630439136005, 170.95630439136005, 170.95630439136005, 1.1049001222060042); + TestUtils.AreEqual(r2, a2 % b2); + + double a3 = (-505.74352788633831); + double2x2 b3 = double2x2(461.95706126743789, 205.97275672013529, 270.04063642678807, -47.480711720642034); + double2x2 r3 = double2x2(-43.78646661890042, -93.798014446067725, -235.70289145955024, -30.936410679917969); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void double2x2_operator_plus() + { + double2x2 a0 = double2x2(-418.82956357432045, -405.79894823851015, -34.041791216489742, 236.99924456188421); + double2x2 r0 = double2x2(-418.82956357432045, -405.79894823851015, -34.041791216489742, 236.99924456188421); + TestUtils.AreEqual(r0, +a0); + + double2x2 a1 = double2x2(-459.83910129025537, 293.74197902052754, -373.015422279488, -386.059833944803); + double2x2 r1 = double2x2(-459.83910129025537, 293.74197902052754, -373.015422279488, -386.059833944803); + TestUtils.AreEqual(r1, +a1); + + double2x2 a2 = double2x2(4.9544198536101476, 504.47483062393724, -170.74650843941907, 439.55937572920664); + double2x2 r2 = double2x2(4.9544198536101476, 504.47483062393724, -170.74650843941907, 439.55937572920664); + TestUtils.AreEqual(r2, +a2); + + double2x2 a3 = double2x2(-478.74939916969714, 421.40964742256779, -258.5960806620289, 447.86609122150867); + double2x2 r3 = double2x2(-478.74939916969714, 421.40964742256779, -258.5960806620289, 447.86609122150867); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void double2x2_operator_neg() + { + double2x2 a0 = double2x2(148.46174890755753, -467.12267873581624, 132.04719954917539, 183.52262290917463); + double2x2 r0 = double2x2(-148.46174890755753, 467.12267873581624, -132.04719954917539, -183.52262290917463); + TestUtils.AreEqual(r0, -a0); + + double2x2 a1 = double2x2(473.7010145009034, -54.958759571872065, -382.98981803608581, -299.09338893512887); + double2x2 r1 = double2x2(-473.7010145009034, 54.958759571872065, 382.98981803608581, 299.09338893512887); + TestUtils.AreEqual(r1, -a1); + + double2x2 a2 = double2x2(-383.01406377508027, 168.73550351370852, 466.44152829909763, 171.90249474900895); + double2x2 r2 = double2x2(383.01406377508027, -168.73550351370852, -466.44152829909763, -171.90249474900895); + TestUtils.AreEqual(r2, -a2); + + double2x2 a3 = double2x2(-280.55831564616335, 318.69633522569029, -39.91539694737429, 140.34000284054321); + double2x2 r3 = double2x2(280.55831564616335, -318.69633522569029, 39.91539694737429, -140.34000284054321); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void double2x2_operator_prefix_inc() + { + double2x2 a0 = double2x2(-139.84208137348389, -56.743654039103376, -381.955324589254, 509.79634380237962); + double2x2 r0 = double2x2(-138.84208137348389, -55.743654039103376, -380.955324589254, 510.79634380237962); + TestUtils.AreEqual(r0, ++a0); + + double2x2 a1 = double2x2(-222.89634452708827, -392.73151058365193, -300.19410218866267, 362.21273939787068); + double2x2 r1 = double2x2(-221.89634452708827, -391.73151058365193, -299.19410218866267, 363.21273939787068); + TestUtils.AreEqual(r1, ++a1); + + double2x2 a2 = double2x2(401.614830919362, -450.23016402229212, 243.54693114177644, 46.19202735190845); + double2x2 r2 = double2x2(402.614830919362, -449.23016402229212, 244.54693114177644, 47.19202735190845); + TestUtils.AreEqual(r2, ++a2); + + double2x2 a3 = double2x2(-41.497298975241051, 154.35656530892311, -281.23327435237974, 200.70599922943211); + double2x2 r3 = double2x2(-40.497298975241051, 155.35656530892311, -280.23327435237974, 201.70599922943211); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void double2x2_operator_postfix_inc() + { + double2x2 a0 = double2x2(-396.6697396695007, 511.20749378167443, 249.11127030528678, -128.81731301584153); + double2x2 r0 = double2x2(-396.6697396695007, 511.20749378167443, 249.11127030528678, -128.81731301584153); + TestUtils.AreEqual(r0, a0++); + + double2x2 a1 = double2x2(-259.49027669592306, -81.393423356764686, 66.719732554033271, 167.85212691493894); + double2x2 r1 = double2x2(-259.49027669592306, -81.393423356764686, 66.719732554033271, 167.85212691493894); + TestUtils.AreEqual(r1, a1++); + + double2x2 a2 = double2x2(147.94395048354932, 41.033564825092185, 128.5304239394751, 73.155582223625629); + double2x2 r2 = double2x2(147.94395048354932, 41.033564825092185, 128.5304239394751, 73.155582223625629); + TestUtils.AreEqual(r2, a2++); + + double2x2 a3 = double2x2(-60.132380275117384, -296.93783797739906, 267.29380071689081, 446.22930714405572); + double2x2 r3 = double2x2(-60.132380275117384, -296.93783797739906, 267.29380071689081, 446.22930714405572); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void double2x2_operator_prefix_dec() + { + double2x2 a0 = double2x2(123.12869626056806, 256.8437465433235, 156.33078844674435, 461.73742530389563); + double2x2 r0 = double2x2(122.12869626056806, 255.8437465433235, 155.33078844674435, 460.73742530389563); + TestUtils.AreEqual(r0, --a0); + + double2x2 a1 = double2x2(325.86799755965728, 187.87412580655609, -236.2252043393558, 125.10963517292851); + double2x2 r1 = double2x2(324.86799755965728, 186.87412580655609, -237.2252043393558, 124.10963517292851); + TestUtils.AreEqual(r1, --a1); + + double2x2 a2 = double2x2(469.8447313112415, 376.04684680329956, -363.07547991493504, -22.028951416736902); + double2x2 r2 = double2x2(468.8447313112415, 375.04684680329956, -364.07547991493504, -23.028951416736902); + TestUtils.AreEqual(r2, --a2); + + double2x2 a3 = double2x2(248.79012667797042, 168.26565011230559, -190.284744112885, 166.9455474200405); + double2x2 r3 = double2x2(247.79012667797042, 167.26565011230559, -191.284744112885, 165.9455474200405); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void double2x2_operator_postfix_dec() + { + double2x2 a0 = double2x2(379.68831723727669, 302.69287814884115, -176.07134040448409, -291.25267066212962); + double2x2 r0 = double2x2(379.68831723727669, 302.69287814884115, -176.07134040448409, -291.25267066212962); + TestUtils.AreEqual(r0, a0--); + + double2x2 a1 = double2x2(470.56758401848731, -63.655158787805192, 355.26110069605568, -27.889220489137415); + double2x2 r1 = double2x2(470.56758401848731, -63.655158787805192, 355.26110069605568, -27.889220489137415); + TestUtils.AreEqual(r1, a1--); + + double2x2 a2 = double2x2(-100.76183824462902, 479.94519613680677, -200.30429491787419, -445.0269393609031); + double2x2 r2 = double2x2(-100.76183824462902, 479.94519613680677, -200.30429491787419, -445.0269393609031); + TestUtils.AreEqual(r2, a2--); + + double2x2 a3 = double2x2(407.42034907239508, 48.0602071509046, -209.66798100698179, -38.435048836485976); + double2x2 r3 = double2x2(407.42034907239508, 48.0602071509046, -209.66798100698179, -38.435048836485976); + TestUtils.AreEqual(r3, a3--); + } + + [TestCase /* For player builds */] + public static void double2x2_EqualsObjectOverride() + { + TestUtils.IsFalse(new double2x2().Equals((object)new int())); + TestUtils.IsTrue(new double2x2().Equals((object)new double2x2())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestDouble2x2.gen.cs.meta b/src/Tests/Tests/Shared/TestDouble2x2.gen.cs.meta new file mode 100644 index 00000000..0aee2fe4 --- /dev/null +++ b/src/Tests/Tests/Shared/TestDouble2x2.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: eb8a44886606504469cf3329b4993591 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestDouble2x3.gen.cs b/src/Tests/Tests/Shared/TestDouble2x3.gen.cs new file mode 100644 index 00000000..0b5cb5cf --- /dev/null +++ b/src/Tests/Tests/Shared/TestDouble2x3.gen.cs @@ -0,0 +1,950 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestDouble2x3 + { + [TestCompiler] + public static void double2x3_zero() + { + TestUtils.AreEqual(0.0, double2x3.zero.c0.x); + TestUtils.AreEqual(0.0, double2x3.zero.c0.y); + TestUtils.AreEqual(0.0, double2x3.zero.c1.x); + TestUtils.AreEqual(0.0, double2x3.zero.c1.y); + TestUtils.AreEqual(0.0, double2x3.zero.c2.x); + TestUtils.AreEqual(0.0, double2x3.zero.c2.y); + } + + [TestCompiler] + public static void double2x3_operator_equal_wide_wide() + { + double2x3 a0 = double2x3(492.15758275061728, -495.20632027797694, 227.45765195947968, -147.37405950733182, -222.68201909897942, 64.093720704360749); + double2x3 b0 = double2x3(192.56880888369346, -235.61102472786376, -254.04311740307281, -412.62472052715009, 471.90480945627428, -6.4727852374654162); + bool2x3 r0 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + double2x3 a1 = double2x3(-23.890404473939157, -16.8197190839889, 163.23210890741655, -165.27101071424363, 470.87767980568003, -423.94255967808078); + double2x3 b1 = double2x3(-339.10237447316865, 488.1875700839737, -379.5965842584132, -308.41700258311675, -82.333374300195544, -102.92108087563935); + bool2x3 r1 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + double2x3 a2 = double2x3(109.63436918595539, 462.69031283943468, -335.38147727371262, 357.23446934168896, 1.5455777652308598, -347.38824741327585); + double2x3 b2 = double2x3(226.51573835430463, -356.90132896830391, -362.91277544708589, -427.89843746083716, 466.65013978753711, -102.79904680270658); + bool2x3 r2 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + double2x3 a3 = double2x3(-114.47217302884542, 435.84865804940864, 194.23808607563285, 138.76554710174241, -467.34914205379278, 370.43337767684523); + double2x3 b3 = double2x3(-43.355954428834821, 85.045664111639212, -91.127054972167628, 422.19208856215334, -477.43130873024057, 1.8770024785198984); + bool2x3 r3 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void double2x3_operator_equal_wide_scalar() + { + double2x3 a0 = double2x3(-303.2300766926399, 451.52631327674089, -253.65587413201848, -105.20363502632995, -500.6910920090466, -426.19248338518315); + double b0 = (123.5445759871717); + bool2x3 r0 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + double2x3 a1 = double2x3(159.87609656149334, -57.477391031327386, -182.04973968400139, 406.51375861024189, 370.88599866017978, -172.03530629539642); + double b1 = (-59.558379439431405); + bool2x3 r1 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + double2x3 a2 = double2x3(455.40001198993991, 363.93823044557973, -27.150561106927, -325.97606507221985, -290.35904254129116, 180.19686635779067); + double b2 = (-11.338988547836891); + bool2x3 r2 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + double2x3 a3 = double2x3(-374.12832015293105, -126.54608899287234, -197.2617896521752, -227.15933357326281, -479.8991937487848, -439.77767750237962); + double b3 = (-439.35894295170851); + bool2x3 r3 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void double2x3_operator_equal_scalar_wide() + { + double a0 = (-253.39728534100453); + double2x3 b0 = double2x3(19.952187785856495, -185.79199346610903, 407.8136052600172, -87.2766969610363, -206.27469382354741, 160.503138855334); + bool2x3 r0 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + double a1 = (-274.77081478516141); + double2x3 b1 = double2x3(-2.6315281403397535, 448.35453602688131, -410.03524251004461, 247.32901465489022, 355.53915350303942, -298.06671180299793); + bool2x3 r1 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + double a2 = (414.10151429385951); + double2x3 b2 = double2x3(-481.30262707234482, 196.55074438664633, 34.60100008668428, 113.76156645350227, -386.45337861890596, -124.49174672201821); + bool2x3 r2 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + double a3 = (243.8866447153905); + double2x3 b3 = double2x3(-492.6181826501238, 145.424413033493, 421.55070968230757, -95.409988209330493, 336.80928746648567, 209.58380589707929); + bool2x3 r3 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void double2x3_operator_not_equal_wide_wide() + { + double2x3 a0 = double2x3(430.8425316432689, 104.69001798736394, 225.80243478799355, -310.57017841496048, -418.61945815506363, 304.12820281839379); + double2x3 b0 = double2x3(210.02470622305975, -55.203330304102678, -269.92533672504373, -234.54673372700194, 25.917412054686565, -63.726991444699024); + bool2x3 r0 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + double2x3 a1 = double2x3(-509.32682561749908, -160.53807719076895, -203.30197606016975, -505.76325368590807, 162.17220623892365, 1.1561973100324394); + double2x3 b1 = double2x3(-484.55371092471933, -425.333599050219, -53.274394775402925, 328.1944192984115, 15.963139303011417, 461.71412417931208); + bool2x3 r1 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + double2x3 a2 = double2x3(65.662074358045174, 102.78780250567377, 172.93008120960098, 26.621009123800832, 235.12595259171258, 128.54198533321824); + double2x3 b2 = double2x3(-113.36304455313973, -240.07297264787974, 495.11916970420589, 203.5583661550462, 340.49345103860526, -241.90719448863865); + bool2x3 r2 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + double2x3 a3 = double2x3(-354.99697630246959, 334.35948220564023, -495.83200692377613, 468.30740163675853, 458.37094733601941, 299.93733300824522); + double2x3 b3 = double2x3(459.56982896270688, 213.0737384357833, -384.7828506831, -255.07233846144396, 477.66343115161328, -248.03662621604121); + bool2x3 r3 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void double2x3_operator_not_equal_wide_scalar() + { + double2x3 a0 = double2x3(-16.914588697680529, 168.83411486858233, -462.71352145760949, 130.30776959765137, 214.50161443208424, -440.26328178879959); + double b0 = (-145.37277109239847); + bool2x3 r0 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + double2x3 a1 = double2x3(-197.12796053529155, -386.61117595555783, -281.02101362916687, -270.26885593601912, -403.96372313236992, -269.80570877241234); + double b1 = (-169.09985860115842); + bool2x3 r1 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + double2x3 a2 = double2x3(299.65422763473089, -432.75573917513515, -457.36312100727258, -13.519590622521719, 273.87305773136814, 185.042454567292); + double b2 = (-71.750904831919286); + bool2x3 r2 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + double2x3 a3 = double2x3(-482.53069351731364, 511.73495578753523, 230.50753628020527, 100.27476768394683, 129.68240863163135, 321.17879048044733); + double b3 = (116.39514427836764); + bool2x3 r3 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void double2x3_operator_not_equal_scalar_wide() + { + double a0 = (275.79582823244664); + double2x3 b0 = double2x3(-57.196896341255353, -382.4325279586169, 97.820359990848374, -161.46364529499022, -458.39563367254829, -499.61786364932448); + bool2x3 r0 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + double a1 = (327.92217818271467); + double2x3 b1 = double2x3(367.57121699283425, 59.7863667289663, -209.58068118318016, -62.580453186566217, -479.97497604786184, -49.494519495169868); + bool2x3 r1 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + double a2 = (-114.68521338081229); + double2x3 b2 = double2x3(109.93924599044919, -176.28482755286842, -347.48529903380449, 85.540928165214609, -356.65954868712441, -104.24357490625397); + bool2x3 r2 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + double a3 = (-133.54918605347592); + double2x3 b3 = double2x3(243.53971135036079, 13.141311890045813, -379.98594754747393, -41.281226892620907, 87.911684792447659, -339.07727996403224); + bool2x3 r3 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void double2x3_operator_less_wide_wide() + { + double2x3 a0 = double2x3(196.84256825076534, 336.40979997087732, 251.96372115424072, 257.65591466503963, 430.04588647840819, -62.419644146421774); + double2x3 b0 = double2x3(-465.34502313348696, -256.15239751346053, -314.814018634527, 364.56673662949663, 100.21050290959442, 182.56098636545289); + bool2x3 r0 = bool2x3(false, false, false, true, false, true); + TestUtils.AreEqual(r0, a0 < b0); + + double2x3 a1 = double2x3(8.8392293494376872, -333.81671563434259, 164.67880662003472, -350.94487516532877, 3.84143662631584, 125.40972024081725); + double2x3 b1 = double2x3(3.116978885194726, -259.43047893207074, -437.33490749696966, -456.0437321402336, -394.2559718537405, 401.91369099259077); + bool2x3 r1 = bool2x3(false, true, false, false, false, true); + TestUtils.AreEqual(r1, a1 < b1); + + double2x3 a2 = double2x3(-111.12994127680076, 70.005523475820951, 448.19828173527412, -419.98711200244122, -258.30166757213965, -34.832201735504043); + double2x3 b2 = double2x3(313.43916454605721, 121.28668194696616, -28.012290729215522, -282.96589697663012, 330.06440631023816, 124.09937077579059); + bool2x3 r2 = bool2x3(true, true, false, true, true, true); + TestUtils.AreEqual(r2, a2 < b2); + + double2x3 a3 = double2x3(-69.859397682295821, 67.767227442826766, -139.77729207825723, 385.43464130229995, 133.707390609061, 506.18837117878184); + double2x3 b3 = double2x3(-183.69031700104955, 373.0607623406969, 109.75094013556418, -203.57134232463841, 45.6486556742567, -360.95226280808089); + bool2x3 r3 = bool2x3(false, true, true, false, false, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void double2x3_operator_less_wide_scalar() + { + double2x3 a0 = double2x3(-132.05731708000292, -192.46500477216438, -66.834607870706634, -379.01750081545561, -360.28242199508588, 20.927834282129879); + double b0 = (-156.01021845452965); + bool2x3 r0 = bool2x3(false, true, false, true, true, false); + TestUtils.AreEqual(r0, a0 < b0); + + double2x3 a1 = double2x3(-158.24074537970159, -20.452607402788772, 225.29148517609178, 307.48418607725023, 274.01523292903562, 373.54965584983563); + double b1 = (437.34587522845061); + bool2x3 r1 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 < b1); + + double2x3 a2 = double2x3(398.52368301829495, -58.010895994496934, 109.67008810381878, -108.853174498702, -44.971252223929014, 140.42607147080173); + double b2 = (105.0301654827922); + bool2x3 r2 = bool2x3(false, true, false, true, true, false); + TestUtils.AreEqual(r2, a2 < b2); + + double2x3 a3 = double2x3(-500.08827638071415, -197.50074610370245, -7.27149987559369, -432.99049898283113, 62.158315449095426, -72.254720959931035); + double b3 = (172.10334857371788); + bool2x3 r3 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void double2x3_operator_less_scalar_wide() + { + double a0 = (-423.117411095238); + double2x3 b0 = double2x3(385.09483617595151, -123.93348532725753, 86.376572887588509, 133.44217378154497, 161.45794947513286, 229.75426660746064); + bool2x3 r0 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 < b0); + + double a1 = (222.57159934871436); + double2x3 b1 = double2x3(315.53116360098647, -447.20351883731945, 271.83385790131695, -393.60531324595462, 317.48689737798964, -164.6051085761772); + bool2x3 r1 = bool2x3(true, false, true, false, true, false); + TestUtils.AreEqual(r1, a1 < b1); + + double a2 = (-282.87605370342544); + double2x3 b2 = double2x3(296.97953071118309, -254.40115582868509, 365.61562054493265, -441.98425671178114, -131.42866021554391, 442.62897631275882); + bool2x3 r2 = bool2x3(true, true, true, false, true, true); + TestUtils.AreEqual(r2, a2 < b2); + + double a3 = (-29.792842163607872); + double2x3 b3 = double2x3(-138.37379533535511, 9.2169721169476588, -226.7305482489665, 171.02944310523083, 376.62522595777421, -462.58872697436658); + bool2x3 r3 = bool2x3(false, true, false, true, true, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void double2x3_operator_greater_wide_wide() + { + double2x3 a0 = double2x3(483.50140141113729, 310.81563415695712, 106.9661896726891, 295.73526038589671, 116.95757179938141, -478.29977653841479); + double2x3 b0 = double2x3(-471.39802454011425, -371.98528617060992, 36.900723236101044, -316.76360407320954, 19.683055648432628, 207.3091381561519); + bool2x3 r0 = bool2x3(true, true, true, true, true, false); + TestUtils.AreEqual(r0, a0 > b0); + + double2x3 a1 = double2x3(-14.897393471979228, -33.817441717636484, -24.740548383789417, 319.78262701620474, -120.15856581561201, -289.00857962714906); + double2x3 b1 = double2x3(362.79748861994483, 324.95341816775192, 340.94807140014507, 25.986035120666997, -114.2111352021858, 240.80346428640348); + bool2x3 r1 = bool2x3(false, false, false, true, false, false); + TestUtils.AreEqual(r1, a1 > b1); + + double2x3 a2 = double2x3(455.85146662958505, 144.70691139283917, 63.931990891663304, -285.68304099034663, -502.0907201720824, -337.19446412529538); + double2x3 b2 = double2x3(273.42244757033063, 325.51576224226312, 27.341068995809678, 64.479532510265472, 200.94836983501375, 100.12266998184964); + bool2x3 r2 = bool2x3(true, false, true, false, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + double2x3 a3 = double2x3(474.31734274063137, -507.14510679018923, -133.56559735795742, -443.10913654934109, -464.34137056038776, -68.361549647693323); + double2x3 b3 = double2x3(-79.00710896356361, -315.137945560337, -122.98542815213347, -163.77920229908972, -492.56600617457462, -90.797273439726439); + bool2x3 r3 = bool2x3(true, false, false, false, true, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void double2x3_operator_greater_wide_scalar() + { + double2x3 a0 = double2x3(64.317918092160426, -397.70346445483318, 431.87690826499693, 85.702980796668157, 246.26305233978803, 197.49155602114809); + double b0 = (305.85991992888034); + bool2x3 r0 = bool2x3(false, false, true, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + double2x3 a1 = double2x3(286.1994608781298, -405.78459210218148, 171.56538661362856, -241.80727326209063, 333.57817498481745, 370.27919524269146); + double b1 = (280.81334818564972); + bool2x3 r1 = bool2x3(true, false, false, false, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + double2x3 a2 = double2x3(-413.70138116073861, -353.03129522550444, 396.64532608382649, 467.22205541432936, -240.0134228393498, 502.91505193287276); + double b2 = (-356.5923551789449); + bool2x3 r2 = bool2x3(false, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 > b2); + + double2x3 a3 = double2x3(315.46759024051369, 281.23064554912537, 428.79219909608, 245.15306460352292, -279.17542494422543, -453.86309668694764); + double b3 = (-259.28970134411458); + bool2x3 r3 = bool2x3(true, true, true, true, false, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void double2x3_operator_greater_scalar_wide() + { + double a0 = (-282.67049635698572); + double2x3 b0 = double2x3(358.09997360692353, -72.5964134077525, -232.16380106292843, -60.706723956720282, 75.156642710397364, 150.88350040786133); + bool2x3 r0 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + double a1 = (339.53917924479538); + double2x3 b1 = double2x3(-498.19602965665797, 459.74610326241054, -227.96872316485678, 335.86213485145106, 76.178844248959308, 296.85993899817572); + bool2x3 r1 = bool2x3(true, false, true, true, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + double a2 = (177.49000390688423); + double2x3 b2 = double2x3(-281.20120657663847, 244.72285162877427, 137.32857257562159, -385.33824724021287, 443.16345879210326, -353.56254141105455); + bool2x3 r2 = bool2x3(true, false, true, true, false, true); + TestUtils.AreEqual(r2, a2 > b2); + + double a3 = (26.040673983302327); + double2x3 b3 = double2x3(-331.7939499969566, -43.691963454565041, 20.949428806523542, -211.17984423934473, 227.42171894173214, -84.7797711290325); + bool2x3 r3 = bool2x3(true, true, true, true, false, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void double2x3_operator_less_equal_wide_wide() + { + double2x3 a0 = double2x3(-438.52313753521219, 210.48942837980087, 4.8773329280677444, -137.29793817237857, 156.09410174009111, -363.92412035722475); + double2x3 b0 = double2x3(-474.8141498392514, 304.3710555063426, 234.8241737982371, -390.48543209139513, -297.17535295019638, -326.29239121372461); + bool2x3 r0 = bool2x3(false, true, true, false, false, true); + TestUtils.AreEqual(r0, a0 <= b0); + + double2x3 a1 = double2x3(-97.948485181642923, 437.29539009430232, 458.53029153241323, -294.06474675520542, 23.622613679441884, -34.284056441059363); + double2x3 b1 = double2x3(107.2538764976216, -413.13107342884462, 67.094432623635271, 470.07522724106684, -84.499104777583455, 392.78422683886447); + bool2x3 r1 = bool2x3(true, false, false, true, false, true); + TestUtils.AreEqual(r1, a1 <= b1); + + double2x3 a2 = double2x3(149.736484835733, -418.8866781754823, -197.50252899783783, -88.2055118494693, -376.71814292330208, 341.62712899857536); + double2x3 b2 = double2x3(-263.53175485484849, 369.30090039284005, -333.32529298091555, 238.41347443238533, 486.24259279959028, 279.65021408705513); + bool2x3 r2 = bool2x3(false, true, false, true, true, false); + TestUtils.AreEqual(r2, a2 <= b2); + + double2x3 a3 = double2x3(-83.309179106405566, -107.49073295830317, 319.46688833807912, 205.35738501574724, 345.56372968552807, 395.32190746596177); + double2x3 b3 = double2x3(236.05201803709008, 132.75898248178839, 66.294708998079727, 183.00210699020056, 200.13055071613314, 339.043800750302); + bool2x3 r3 = bool2x3(true, true, false, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void double2x3_operator_less_equal_wide_scalar() + { + double2x3 a0 = double2x3(193.4958237118534, 168.91555197952107, -313.9930695565385, 81.826965131716292, 18.503590830836288, -0.35819602029312136); + double b0 = (443.85054299042122); + bool2x3 r0 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + double2x3 a1 = double2x3(241.36115776810846, -1.3577692515020203, -268.89945591096739, 398.9919504593089, -471.253072242836, -264.93778264938749); + double b1 = (-463.81641242644582); + bool2x3 r1 = bool2x3(false, false, false, false, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + double2x3 a2 = double2x3(82.258299150624453, 424.7040156911612, 426.48223157715154, 56.319978501796754, -196.28791126808522, 31.901173844887467); + double b2 = (11.246050124636895); + bool2x3 r2 = bool2x3(false, false, false, false, true, false); + TestUtils.AreEqual(r2, a2 <= b2); + + double2x3 a3 = double2x3(-152.2575724833913, -37.104814785115821, -47.144214413661587, 333.6230348710078, -274.80387438219225, 358.67627804292192); + double b3 = (-437.92645975478297); + bool2x3 r3 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void double2x3_operator_less_equal_scalar_wide() + { + double a0 = (393.60626644343427); + double2x3 b0 = double2x3(-75.688363825757222, -44.2638714519627, 125.86491566797019, 191.96488174794467, 13.543054825413492, -197.0519259893577); + bool2x3 r0 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 <= b0); + + double a1 = (-423.945100743298); + double2x3 b1 = double2x3(-330.04861680141119, 420.16553779140372, 105.54730777887039, 174.82126363311954, 296.71757831085358, -469.70041845259277); + bool2x3 r1 = bool2x3(true, true, true, true, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + double a2 = (123.26718979853536); + double2x3 b2 = double2x3(112.9969695140594, 495.14339493920249, -488.65789364681478, 388.53941148730894, -493.24077080806751, 16.451064832718657); + bool2x3 r2 = bool2x3(false, true, false, true, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + double a3 = (-387.6516336815672); + double2x3 b3 = double2x3(-229.1773127192526, -373.01533930982248, -391.142134610164, 90.994149488859875, -178.39613517485378, -69.621067317957568); + bool2x3 r3 = bool2x3(true, true, false, true, true, true); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void double2x3_operator_greater_equal_wide_wide() + { + double2x3 a0 = double2x3(-507.92858409692, 504.49748181947393, -385.43449205226938, -262.32340944107784, -37.550928848586466, -111.59527759980193); + double2x3 b0 = double2x3(-81.346509732933043, 297.66615047010885, 171.06540616371922, -431.03805538222105, -6.859075311040101, 319.72570362674333); + bool2x3 r0 = bool2x3(false, true, false, true, false, false); + TestUtils.AreEqual(r0, a0 >= b0); + + double2x3 a1 = double2x3(-463.70202157632542, 387.44885772627265, 456.96878573716094, -211.01015506079892, 182.41135391146474, -53.596053863687473); + double2x3 b1 = double2x3(254.079170106947, 396.5724000393285, 178.83927615864172, -447.06336304501787, 288.49268569075161, 474.88929460704765); + bool2x3 r1 = bool2x3(false, false, true, true, false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + double2x3 a2 = double2x3(-309.57021608463032, -136.02249127999994, 280.73629082401112, -96.9958942388165, -174.05950673579213, 88.9019382413951); + double2x3 b2 = double2x3(-321.75022831640683, -395.97722048125104, -158.69246037243516, 391.48869318118727, -368.10924141859135, 89.1238043723273); + bool2x3 r2 = bool2x3(true, true, true, false, true, false); + TestUtils.AreEqual(r2, a2 >= b2); + + double2x3 a3 = double2x3(43.816040774721728, -446.07842585354967, 16.645595796706857, 409.83252043734888, -191.32987245886113, 222.99782548798146); + double2x3 b3 = double2x3(-510.27932214656812, -486.92979525352354, -81.215552606254619, 274.21882046117389, -212.88155494112596, 288.99530591117); + bool2x3 r3 = bool2x3(true, true, true, true, true, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void double2x3_operator_greater_equal_wide_scalar() + { + double2x3 a0 = double2x3(465.15218732559686, -424.8860745024337, -209.22109685150025, 58.779852656079356, -302.26910533675414, 140.12558252183976); + double b0 = (-5.5998842742293391); + bool2x3 r0 = bool2x3(true, false, false, true, false, true); + TestUtils.AreEqual(r0, a0 >= b0); + + double2x3 a1 = double2x3(16.353385694489475, 393.27804846003562, -315.70155086913218, 441.0115565923096, -509.78156757251435, -36.994287269652943); + double b1 = (-344.55997316192838); + bool2x3 r1 = bool2x3(true, true, true, true, false, true); + TestUtils.AreEqual(r1, a1 >= b1); + + double2x3 a2 = double2x3(494.82028865014217, -466.12009046325466, -123.8137477020797, 215.65121779947128, 104.99569730879534, 314.34603014325069); + double b2 = (-164.97393830352183); + bool2x3 r2 = bool2x3(true, false, true, true, true, true); + TestUtils.AreEqual(r2, a2 >= b2); + + double2x3 a3 = double2x3(190.51609882643265, -23.836435567511444, 143.04935962662535, -264.91997945724052, -169.70222457205051, 329.70751610850334); + double b3 = (-83.111429014760745); + bool2x3 r3 = bool2x3(true, true, true, false, false, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void double2x3_operator_greater_equal_scalar_wide() + { + double a0 = (374.82703393270594); + double2x3 b0 = double2x3(-1.609757185731894, 338.61524049314448, -116.18140392945213, -332.15732375353451, -355.9793509710484, -468.90144107719021); + bool2x3 r0 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + double a1 = (38.579884785497484); + double2x3 b1 = double2x3(-332.34754697063357, 2.8901150240051265, 467.77776477661814, 121.40638762405445, -305.02337303060267, -58.428812292604164); + bool2x3 r1 = bool2x3(true, true, false, false, true, true); + TestUtils.AreEqual(r1, a1 >= b1); + + double a2 = (-226.51955209789776); + double2x3 b2 = double2x3(-47.020994446715804, 305.3026770582901, -427.40123315686418, 92.263649745035764, -497.17853736187266, -408.62564225151465); + bool2x3 r2 = bool2x3(false, false, true, false, true, true); + TestUtils.AreEqual(r2, a2 >= b2); + + double a3 = (-455.23049113491106); + double2x3 b3 = double2x3(396.42608637196292, -469.29488561548987, -485.7540130493017, -182.34619268325446, -291.54536284671417, 278.740809331993); + bool2x3 r3 = bool2x3(false, true, true, false, false, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void double2x3_operator_add_wide_wide() + { + double2x3 a0 = double2x3(506.12905263627374, -501.77980803967444, 420.08479638587903, -186.03206476291274, -9.3123953385801883, 328.51179686585056); + double2x3 b0 = double2x3(-28.757987751047096, -337.135153689019, -340.676816860529, 152.31202633320913, 423.66745420157326, 90.374096674087468); + double2x3 r0 = double2x3(477.37106488522664, -838.91496172869347, 79.407979525350015, -33.720038429703607, 414.35505886299308, 418.885893539938); + TestUtils.AreEqual(r0, a0 + b0); + + double2x3 a1 = double2x3(424.34407659263536, 87.791079800478656, 462.41368148402012, -46.178705952213477, 401.17006296718966, -454.12414643453627); + double2x3 b1 = double2x3(376.18866246574964, 1.7671887882831925, -120.18586045139745, -279.62936628965167, -344.66710273580026, 242.8391956029642); + double2x3 r1 = double2x3(800.532739058385, 89.558268588761848, 342.22782103262267, -325.80807224186515, 56.502960231389409, -211.28495083157208); + TestUtils.AreEqual(r1, a1 + b1); + + double2x3 a2 = double2x3(69.195687564646732, -177.95734485329939, 299.60415544156183, 340.7048587001417, 219.91602740991675, -321.90838232725321); + double2x3 b2 = double2x3(418.5930504363929, -23.312797318823982, -95.099945827899489, 147.92812568877275, 331.03287926830023, -82.502564230236487); + double2x3 r2 = double2x3(487.78873800103963, -201.27014217212337, 204.50420961366234, 488.63298438891445, 550.948906678217, -404.41094655748969); + TestUtils.AreEqual(r2, a2 + b2); + + double2x3 a3 = double2x3(286.35534037573041, -333.41949311523672, -118.93216973120911, 68.607509406566351, 23.190902005504313, -205.57787547147734); + double2x3 b3 = double2x3(279.44956291813844, 342.6227215931857, -300.35853185335105, -209.69408736456842, 446.55942150883345, -351.98918955027557); + double2x3 r3 = double2x3(565.80490329386885, 9.2032284779489828, -419.29070158456017, -141.08657795800207, 469.75032351433777, -557.56706502175291); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void double2x3_operator_add_wide_scalar() + { + double2x3 a0 = double2x3(-194.51420387742769, 338.54838696985894, 246.97140252169754, 100.51093797595752, -45.724677822424439, -478.11131094308166); + double b0 = (124.121678171736); + double2x3 r0 = double2x3(-70.3925257056917, 462.67006514159493, 371.09308069343354, 224.63261614769351, 78.397000349311554, -353.98963277134567); + TestUtils.AreEqual(r0, a0 + b0); + + double2x3 a1 = double2x3(30.916145577522116, -242.1187475855084, 82.50134495762245, 6.7993848355483806, -484.69981287638649, -188.26501068298938); + double b1 = (60.37435224483454); + double2x3 r1 = double2x3(91.290497822356656, -181.74439534067386, 142.875697202457, 67.173737080382921, -424.32546063155195, -127.89065843815484); + TestUtils.AreEqual(r1, a1 + b1); + + double2x3 a2 = double2x3(-213.52673087526426, 189.25996669999324, 198.53359684652355, 187.53610023648298, -424.92567582844089, 302.10236730338181); + double b2 = (-267.78430688929944); + double2x3 r2 = double2x3(-481.31103776456371, -78.5243401893062, -69.250710042775893, -80.248206652816464, -692.70998271774033, 34.318060414082368); + TestUtils.AreEqual(r2, a2 + b2); + + double2x3 a3 = double2x3(300.39907970111778, -200.16134295247559, 31.37822701007974, 362.52213518811493, -423.98885961248953, 432.41331907380993); + double b3 = (124.02158909850823); + double2x3 r3 = double2x3(424.420668799626, -76.139753853967363, 155.39981610858797, 486.54372428662316, -299.9672705139813, 556.43490817231816); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void double2x3_operator_add_scalar_wide() + { + double a0 = (-340.35468284243473); + double2x3 b0 = double2x3(511.36225652665007, -146.21663791789518, -106.21042661844308, -363.45024960276214, 199.08958325120136, -27.108407271610758); + double2x3 r0 = double2x3(171.00757368421534, -486.57132076032991, -446.56510946087781, -703.80493244519687, -141.26509959123337, -367.46309011404549); + TestUtils.AreEqual(r0, a0 + b0); + + double a1 = (419.84900041103788); + double2x3 b1 = double2x3(284.95503748811552, -164.92418129971446, -249.19032561461921, 150.92817718858282, 298.17509784278229, -457.15341803857751); + double2x3 r1 = double2x3(704.8040378991534, 254.92481911132342, 170.65867479641867, 570.7771775996207, 718.02409825382017, -37.304417627539635); + TestUtils.AreEqual(r1, a1 + b1); + + double a2 = (424.71807094324288); + double2x3 b2 = double2x3(-301.85750283946163, 230.28885208363124, -423.58759351428023, -67.060037882560891, 68.7241366229598, -164.02241833695325); + double2x3 r2 = double2x3(122.86056810378125, 655.00692302687412, 1.1304774289626494, 357.658033060682, 493.44220756620268, 260.69565260628963); + TestUtils.AreEqual(r2, a2 + b2); + + double a3 = (318.93515339444161); + double2x3 b3 = double2x3(7.8045504129512437, 187.69836029210046, -3.6569664495331153, -446.0830535581722, -209.28724227160552, -38.212905186327589); + double2x3 r3 = double2x3(326.73970380739286, 506.63351368654207, 315.2781869449085, -127.14790016373058, 109.64791112283609, 280.722248208114); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void double2x3_operator_sub_wide_wide() + { + double2x3 a0 = double2x3(160.4922617229131, 11.223957305412682, 359.20010607279846, -498.22830485656311, -355.25362913462038, -94.534852787170053); + double2x3 b0 = double2x3(115.46876078260539, -130.98230630298252, 241.54083716196044, 9.9870860623135513, 419.89512582304656, 59.124466208333388); + double2x3 r0 = double2x3(45.023500940307713, 142.2062636083952, 117.65926891083802, -508.21539091887666, -775.14875495766694, -153.65931899550344); + TestUtils.AreEqual(r0, a0 - b0); + + double2x3 a1 = double2x3(-410.46404786150163, -401.38464398001537, 317.70681944382693, 447.0604133303558, -489.07414482956477, -230.00838218909149); + double2x3 b1 = double2x3(-402.38163847587145, -75.370143687059226, 320.97960796997859, -73.908757482612884, -31.444742455819949, -389.25194734579509); + double2x3 r1 = double2x3(-8.0824093856301715, -326.01450029295614, -3.2727885261516576, 520.96917081296874, -457.62940237374482, 159.2435651567036); + TestUtils.AreEqual(r1, a1 - b1); + + double2x3 a2 = double2x3(24.875419389864192, 366.61447136784648, -107.3741567634857, -219.0081404275299, 473.90756891384137, 259.63620793988753); + double2x3 b2 = double2x3(-375.02884000122026, 259.18275821357167, 276.648654351313, -453.06919905779381, -272.57653225240136, -191.14805301984217); + double2x3 r2 = double2x3(399.90425939108445, 107.4317131542748, -384.02281111479869, 234.06105863026391, 746.48410116624268, 450.78426095972969); + TestUtils.AreEqual(r2, a2 - b2); + + double2x3 a3 = double2x3(-360.119631219711, 7.8096120393879573, 437.42847439154446, -59.1991718091067, 418.74433322378638, 183.14215072576985); + double2x3 b3 = double2x3(87.136884968325944, 430.02477594373033, 343.65711538105143, 121.02942067060133, -354.1881703595576, 249.05200373802893); + double2x3 r3 = double2x3(-447.25651618803693, -422.21516390434238, 93.771359010493029, -180.22859247970803, 772.932503583344, -65.909853012259077); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void double2x3_operator_sub_wide_scalar() + { + double2x3 a0 = double2x3(207.38960108877609, 248.45773684627272, -384.82393211164697, -205.34476122881506, -374.81156152058929, 191.64204820973896); + double b0 = (-36.112476604111691); + double2x3 r0 = double2x3(243.50207769288778, 284.57021345038441, -348.71145550753528, -169.23228462470337, -338.6990849164776, 227.75452481385065); + TestUtils.AreEqual(r0, a0 - b0); + + double2x3 a1 = double2x3(18.856238135535364, 480.85798738936796, 16.338193185784917, -366.86545269883493, -35.523088233323335, 349.39776460705218); + double b1 = (-44.96160151667965); + double2x3 r1 = double2x3(63.817839652215014, 525.81958890604756, 61.299794702464567, -321.90385118215528, 9.4385132833563148, 394.35936612373183); + TestUtils.AreEqual(r1, a1 - b1); + + double2x3 a2 = double2x3(439.07729336203886, 195.02405104181923, -384.84940952102158, 189.05188545447402, 55.602777745389744, -54.931482579061537); + double b2 = (490.2222661870635); + double2x3 r2 = double2x3(-51.144972825024638, -295.19821514524426, -875.07167570808508, -301.17038073258948, -434.61948844167375, -545.15374876612509); + TestUtils.AreEqual(r2, a2 - b2); + + double2x3 a3 = double2x3(53.088051582261983, -273.80670917863335, 256.88723695319482, 297.17363156805447, 101.82901363346218, 136.60794765157993); + double b3 = (316.80250730961677); + double2x3 r3 = double2x3(-263.71445572735479, -590.60921648825013, -59.915270356421956, -19.628875741562297, -214.97349367615459, -180.19455965803684); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void double2x3_operator_sub_scalar_wide() + { + double a0 = (-86.008225719448262); + double2x3 b0 = double2x3(466.42511413359318, 298.48694219183506, -300.95010652251085, 315.38003006362362, -381.09218543632522, -125.00837546447684); + double2x3 r0 = double2x3(-552.43333985304139, -384.49516791128332, 214.94188080306259, -401.38825578307188, 295.08395971687696, 39.00014974502858); + TestUtils.AreEqual(r0, a0 - b0); + + double a1 = (58.466194418476107); + double2x3 b1 = double2x3(214.74609361158036, -257.54942739082009, 480.22459505508868, -443.35507723472784, 260.79503858312728, 29.681931747906788); + double2x3 r1 = double2x3(-156.27989919310426, 316.01562180929619, -421.75840063661258, 501.82127165320395, -202.32884416465117, 28.784262670569319); + TestUtils.AreEqual(r1, a1 - b1); + + double a2 = (139.85773164586055); + double2x3 b2 = double2x3(-247.78996216868512, -248.4662297929014, 91.445112509394562, 86.384162704639266, 373.81828206303453, 260.41195428576873); + double2x3 r2 = double2x3(387.64769381454568, 388.32396143876196, 48.412619136465992, 53.473568941221288, -233.96055041717398, -120.55422263990818); + TestUtils.AreEqual(r2, a2 - b2); + + double a3 = (114.35393171867076); + double2x3 b3 = double2x3(-464.40545318294573, -109.74146156652898, -311.67535057276268, 107.86401586787031, -258.7951592219971, 14.097560173877355); + double2x3 r3 = double2x3(578.7593849016165, 224.09539328519975, 426.02928229143345, 6.4899158508004575, 373.14909094066786, 100.25637154479341); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void double2x3_operator_mul_wide_wide() + { + double2x3 a0 = double2x3(-482.71381710596097, -407.29348559272171, 137.70058995937029, 208.54113278563182, 194.296573967811, -484.24241684574747); + double2x3 b0 = double2x3(-236.36788355389979, 260.72759139757954, -416.38629718142852, -364.49561541364324, -253.14750897751537, -369.20287220981106); + double2x3 r0 = double2x3(114098.04331156026, -106192.64949051509, -57336.638772880389, -76012.328533757158, -49185.69370281692, 178783.69114527057); + TestUtils.AreEqual(r0, a0 * b0); + + double2x3 a1 = double2x3(183.98730739578014, -241.33547770294149, 45.868758938214114, 363.32610266438041, -328.11893692990714, -471.02307413100408); + double2x3 b1 = double2x3(193.54791531038836, 169.08491976982214, 201.96966442930034, 249.45608317547294, -308.19319810913555, -385.57964843585137); + double2x3 r1 = double2x3(35610.359790024842, -40806.189885013562, 9264.0978505395742, 90633.9064860661, 101124.02453259782, 181616.91132860651); + TestUtils.AreEqual(r1, a1 * b1); + + double2x3 a2 = double2x3(-262.68257415605831, -379.26274674910246, -374.09058182970182, 481.44738720424812, 104.62807397946165, 412.93539948618752); + double2x3 b2 = double2x3(-183.27959522198864, 22.275629292370581, -265.52144229855458, -95.677454277722859, 133.25437146669924, 148.31146080247663); + double2x3 r2 = double2x3(48144.355863192381, -8448.3163509892329, 99329.070837727879, -46063.660376363579, 13942.148235904471, 61243.052314850727); + TestUtils.AreEqual(r2, a2 * b2); + + double2x3 a3 = double2x3(477.87724731763694, 20.377821216535722, 291.99596299417124, -138.48832399141429, -393.46498483860165, 9.36312318284206); + double2x3 b3 = double2x3(249.284127113076, 500.00547503866505, -19.331578978957396, -36.691062705913112, 30.5238278054278, -401.36701054189678); + double2x3 r3 = double2x3(119127.21246477668, 10189.022177626932, -5644.7430201585421, 5081.2837796057929, -12010.057444678736, -3758.048761232847); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void double2x3_operator_mul_wide_scalar() + { + double2x3 a0 = double2x3(-96.318821236639678, -277.14229239017811, -239.93690191951436, 509.53140544776409, 255.85810172551226, 215.73149667295229); + double b0 = (-301.20720424373042); + double2x3 r0 = double2x3(29011.922860739887, 83477.255068544036, 72270.723422079071, -153474.5301092997, -77066.303503849529, -64979.880980175592); + TestUtils.AreEqual(r0, a0 * b0); + + double2x3 a1 = double2x3(-455.50827500573746, -338.29248658674419, 53.796284939067618, 243.75734459783757, 135.35469991311186, -207.35010275959507); + double b1 = (-389.24327367788334); + double2x3 r1 = double2x3(177303.53215059882, 131678.07493965575, -20939.842061390889, -94880.9067942902, -52685.906501867168, 80709.6327955903); + TestUtils.AreEqual(r1, a1 * b1); + + double2x3 a2 = double2x3(-383.93960946795517, 42.676120539510634, 260.38388049806645, 176.86755927692525, 25.672123205695357, -290.50059689697838); + double b2 = (-31.425238862366086); + double2x3 r2 = double2x3(12065.393936254042, -1341.1072816732492, -8182.625640561525, -5558.1052972810685, -806.752603843068, 9129.05064714747); + TestUtils.AreEqual(r2, a2 * b2); + + double2x3 a3 = double2x3(207.09101805793637, -208.4020064847553, 370.94506400215676, -341.59844247512444, 10.270311121954705, -176.88876565587185); + double b3 = (-156.52330858843555); + double2x3 r3 = double2x3(-32414.571325375655, 32619.7715714625, -58061.548722166561, 53468.118424862856, -1607.5430770409582, 27687.214852581492); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void double2x3_operator_mul_scalar_wide() + { + double a0 = (37.432166355397612); + double2x3 b0 = double2x3(96.747546479454058, 492.18539427788244, -274.05458534604617, -452.87096926796761, 420.85330434369541, 102.18292694081686); + double2x3 r0 = double2x3(3621.4702542954869, 18423.565556306661, -10258.456829132712, -16951.941459168724, 15753.450899411988, 3824.9283199300971); + TestUtils.AreEqual(r0, a0 * b0); + + double a1 = (-114.94887762654054); + double2x3 b1 = double2x3(-351.12003843445336, -464.66496799172131, 444.08484646495663, 447.10525605040846, 130.82935124767448, -321.41334191030512); + double2x3 r1 = double2x3(40360.854330228191, 53412.716543020746, -51047.054672101345, -51394.247363921473, -15038.687086528622, 36946.1029067851); + TestUtils.AreEqual(r1, a1 * b1); + + double a2 = (445.30131861441828); + double2x3 b2 = double2x3(478.24357317306271, 358.57170622356784, -144.89011222910608, -438.89383741789209, -3.536441089369589, -471.80755470311624); + double2x3 r2 = double2x3(212962.49375283587, 159672.45359917657, -64519.758029811986, -195440.00453392946, -1574.7818802984877, -210096.52624154196); + TestUtils.AreEqual(r2, a2 * b2); + + double a3 = (-42.560401697904069); + double2x3 b3 = double2x3(119.91104155402218, 271.9000023677479, 239.6840079946835, 487.44143389511919, -79.188288010278825, -112.92564468873928); + double2x3 r3 = double2x3(-5103.4620965532513, -11572.173322432418, -10201.047660817379, -20745.703230778625, 3370.2853474867875, 4806.1607999475309); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void double2x3_operator_div_wide_wide() + { + double2x3 a0 = double2x3(-353.13144390337703, -102.79985456485292, 51.319128298814917, -191.87167868012176, 8.0418245829836223, -128.73764210973758); + double2x3 b0 = double2x3(-178.73954805114283, -302.09628381491467, -199.40583739029518, 278.85077561012042, 502.33758782890516, -361.48483078623417); + double2x3 r0 = double2x3(1.97567604793504, 0.34028837848212429, -0.25736021056579439, -0.68808013268139567, 0.016008805189634039, 0.35613566917796119); + TestUtils.AreEqual(r0, a0 / b0); + + double2x3 a1 = double2x3(-136.05959779399427, -370.4710053738537, -237.69456326109105, -432.54687496300176, 200.26549181727012, 361.44157068871039); + double2x3 b1 = double2x3(353.121059820578, -38.894930142394685, -75.764737402910725, -195.21784719974636, -405.03399224068687, -394.2300085473014); + double2x3 r1 = double2x3(-0.3853058151307277, 9.5249176182488586, 3.1372716570909582, 2.2157137842034547, -0.49444119667433889, -0.9168291678773689); + TestUtils.AreEqual(r1, a1 / b1); + + double2x3 a2 = double2x3(-416.22613234828509, -450.01919362042992, -273.49744594911925, -286.90817011841955, -314.25606241554772, 177.76210340194507); + double2x3 b2 = double2x3(-375.82771342612227, -121.24548655433836, 447.623344391409, 338.28628007429018, -405.54420752336466, -431.16893526127978); + double2x3 r2 = double2x3(1.1074918572499153, 3.7116366671409717, -0.61099906735420106, -0.84812239519560884, 0.77489964493560781, -0.41227947763496636); + TestUtils.AreEqual(r2, a2 / b2); + + double2x3 a3 = double2x3(97.626988217992221, -68.107280047660367, -386.45074027890837, 263.69934690357161, -297.0270885420158, -501.77703046322659); + double2x3 b3 = double2x3(296.20513095343722, 437.939790691221, 39.21061684527001, 331.2897075765253, -310.61955156485533, 207.26946959610541); + double2x3 r3 = double2x3(0.32959249525403717, -0.15551745124635385, -9.855767936625206, 0.79597808465769837, 0.95624080018671487, -2.420892143165184); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void double2x3_operator_div_wide_scalar() + { + double2x3 a0 = double2x3(171.34242184988341, 0.10338377957384637, 57.888263967767443, -256.13074529177078, 95.6696842162263, -290.38690461329509); + double b0 = (171.79682191265601); + double2x3 r0 = double2x3(0.99735501473360411, 0.00060177934855167557, 0.33695771157628673, -1.4908933846400916, 0.55687691513214455, -1.6902926455818372); + TestUtils.AreEqual(r0, a0 / b0); + + double2x3 a1 = double2x3(-127.44869118903239, 146.46688110496234, -499.84355687529012, 58.686315802245531, -453.20579859856787, -205.03382143985192); + double b1 = (-79.7448890580539); + double2x3 r1 = double2x3(1.5982051350808244, -1.8366930198916591, 6.2680325069034382, -0.73592573135968842, 5.6831955496061468, 2.5711217842511296); + TestUtils.AreEqual(r1, a1 / b1); + + double2x3 a2 = double2x3(481.73814247629514, -293.46349753693841, -158.50557930697948, -289.5822156824089, 494.12860535743118, 203.58342680874443); + double b2 = (464.47907159499778); + double2x3 r2 = double2x3(1.0371579085835463, -0.631812099798597, -0.34125451285174013, -0.62345589584477534, 1.0638339498497067, 0.4383048435522599); + TestUtils.AreEqual(r2, a2 / b2); + + double2x3 a3 = double2x3(180.97040160976837, 460.84470603468117, 490.95625924084163, -280.47805536933151, -320.24387112271222, 192.41448912043802); + double b3 = (259.11918723728468); + double2x3 r3 = double2x3(0.69840602519352346, 1.778504752767186, 1.8947120993832676, -1.082428740070444, -1.2358940861814818, 0.7425713671455646); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void double2x3_operator_div_scalar_wide() + { + double a0 = (-264.44250095283729); + double2x3 b0 = double2x3(105.58908157497137, -142.34910137129441, -288.94890679463231, 39.644133824689334, -363.99138396046658, -149.71822006521666); + double2x3 r0 = double2x3(-2.5044492954044237, 1.85770404172122, 0.915187753732487, -6.670406827961755, 0.72650758398599513, 1.7662679988958405); + TestUtils.AreEqual(r0, a0 / b0); + + double a1 = (-395.72912306139671); + double2x3 b1 = double2x3(258.71868693955184, -9.6662514254759344, 117.72553282497711, -331.38655797177296, -509.98602676297821, 427.8964666928614); + double2x3 r1 = double2x3(-1.5295730190291843, 40.939254075104124, -3.3614553577746666, 1.1941616626921372, 0.77596071714591563, -0.92482447008716717); + TestUtils.AreEqual(r1, a1 / b1); + + double a2 = (467.61712882836218); + double2x3 b2 = double2x3(-407.12461943511136, 252.69070994699871, 444.59937664708093, -88.313306134340053, 199.95503411067421, -218.34692607556792); + double2x3 r2 = double2x3(-1.1485847490067898, 1.8505513278523131, 1.0517718948570469, -5.2949793105586425, 2.33861143285614, -2.1416245111988621); + TestUtils.AreEqual(r2, a2 / b2); + + double a3 = (-13.417186028052697); + double2x3 b3 = double2x3(-296.13107575854804, 0.561349630617201, -289.29929865957206, 196.21833929615946, 334.73346845001606, -282.39273203648293); + double2x3 r3 = double2x3(0.045308267609821762, -23.901656465508974, 0.04637821830270366, -0.068378858348207977, -0.04008319242823552, 0.04751250477055232); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void double2x3_operator_mod_wide_wide() + { + double2x3 a0 = double2x3(-388.81249422059045, 181.68118842955732, -167.07872470052854, 432.82015319951813, -258.43895995730486, -170.11079629236406); + double2x3 b0 = double2x3(436.94417187056695, 58.940049437312382, -201.11623368091705, 279.2893537391393, -397.07975954426445, 377.89994758083481); + double2x3 r0 = double2x3(-388.81249422059045, 4.8610401176201776, -167.07872470052854, 153.53079946037883, -258.43895995730486, -170.11079629236406); + TestUtils.AreEqual(r0, a0 % b0); + + double2x3 a1 = double2x3(283.318293464984, 122.71651297561664, 335.27101413126616, -503.60851668920765, 191.02251848532933, 289.74269379756538); + double2x3 b1 = double2x3(174.69386657266591, -228.17652736798698, -317.06019106370405, -417.48011107811709, -249.9759434433542, -397.57157177364991); + double2x3 r1 = double2x3(108.62442689231807, 122.71651297561664, 18.210823067562103, -86.128405611090557, 191.02251848532933, 289.74269379756538); + TestUtils.AreEqual(r1, a1 % b1); + + double2x3 a2 = double2x3(-124.03371745163281, 259.27395761165485, -274.35845030208975, -140.03080398404541, 324.5775689205982, -200.51308903494527); + double2x3 b2 = double2x3(-358.74544947163452, -198.1592100589346, 208.73709378425826, -12.119406944196385, 25.27141596063575, -194.12068495253135); + double2x3 r2 = double2x3(-124.03371745163281, 61.114747552720246, -65.621356517831487, -6.7173275978851734, 21.3205773929692, -6.3924040824139183); + TestUtils.AreEqual(r2, a2 % b2); + + double2x3 a3 = double2x3(211.42317328761476, -51.272212767634642, -230.63392483006879, 99.989400671790122, 399.18986649028489, 24.903281461868119); + double2x3 b3 = double2x3(-493.8717965995296, -312.3016990685378, -216.98060546488529, 413.57096047586344, -436.39440151508637, 3.4912750737235); + double2x3 r3 = double2x3(211.42317328761476, -51.272212767634642, -13.653319365183506, 99.989400671790122, 399.18986649028489, 0.46435594580361794); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void double2x3_operator_mod_wide_scalar() + { + double2x3 a0 = double2x3(-244.49962889612635, -211.81931958525411, -145.92677576184587, -304.91822090042672, 155.47946436492703, -133.90778428591221); + double b0 = (39.634963769295723); + double2x3 r0 = double2x3(-6.6898462803520147, -13.644500738775491, -27.021884453958705, -27.473474515356656, 36.574573057039856, -15.002892978025045); + TestUtils.AreEqual(r0, a0 % b0); + + double2x3 a1 = double2x3(281.30965412841624, 335.16613046041039, 101.70649032560482, 319.47152033423606, -285.40231646476423, -355.84685985923136); + double b1 = (-226.53575311719243); + double2x3 r1 = double2x3(54.773901011223813, 108.63037734321796, 101.70649032560482, 92.935767217043633, -58.8665633475718, -129.31110674203893); + TestUtils.AreEqual(r1, a1 % b1); + + double2x3 a2 = double2x3(259.37800061860025, -284.34358109363518, -102.68343811048356, -172.14173921017988, 206.41684517935698, -416.71365447375626); + double b2 = (-330.87193957477433); + double2x3 r2 = double2x3(259.37800061860025, -284.34358109363518, -102.68343811048356, -172.14173921017988, 206.41684517935698, -85.841714898981934); + TestUtils.AreEqual(r2, a2 % b2); + + double2x3 a3 = double2x3(-339.256669917729, 132.55290490600885, 226.94410215455298, -306.11827268550093, 115.43844633709568, 281.88292015804109); + double b3 = (435.29751440291182); + double2x3 r3 = double2x3(-339.256669917729, 132.55290490600885, 226.94410215455298, -306.11827268550093, 115.43844633709568, 281.88292015804109); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void double2x3_operator_mod_scalar_wide() + { + double a0 = (-66.945025236785909); + double2x3 b0 = double2x3(-249.77609479137516, -396.07375664081133, 386.49204582091977, 168.93948109864232, -199.4182442163202, 261.7517141130528); + double2x3 r0 = double2x3(-66.945025236785909, -66.945025236785909, -66.945025236785909, -66.945025236785909, -66.945025236785909, -66.945025236785909); + TestUtils.AreEqual(r0, a0 % b0); + + double a1 = (16.127438791155555); + double2x3 b1 = double2x3(257.66814744550186, -75.788451945310669, 170.95630439136005, -242.85828005655588, 425.94531913564788, 303.27240409668184); + double2x3 r1 = double2x3(16.127438791155555, 16.127438791155555, 16.127438791155555, 16.127438791155555, 16.127438791155555, 16.127438791155555); + TestUtils.AreEqual(r1, a1 % b1); + + double a2 = (3.033060790520608); + double2x3 b2 = double2x3(-505.74352788633831, 461.95706126743789, 205.97275672013529, 270.04063642678807, -47.480711720642034, -150.254496405951); + double2x3 r2 = double2x3(3.033060790520608, 3.033060790520608, 3.033060790520608, 3.033060790520608, 3.033060790520608, 3.033060790520608); + TestUtils.AreEqual(r2, a2 % b2); + + double a3 = (149.49949009227544); + double2x3 b3 = double2x3(-220.29804263836616, 31.118842377848409, 400.63568348467152, 6.2314283876826266, -39.050740021770252, -71.941097054603063); + double2x3 r3 = double2x3(149.49949009227544, 25.0241205808818, 149.49949009227544, 6.1766371755750242, 32.347270026964679, 5.6172959830693117); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void double2x3_operator_plus() + { + double2x3 a0 = double2x3(-418.82956357432045, -405.79894823851015, -34.041791216489742, 236.99924456188421, -459.83910129025537, 210.8614223985287); + double2x3 r0 = double2x3(-418.82956357432045, -405.79894823851015, -34.041791216489742, 236.99924456188421, -459.83910129025537, 210.8614223985287); + TestUtils.AreEqual(r0, +a0); + + double2x3 a1 = double2x3(293.74197902052754, -386.059833944803, 4.9544198536101476, -418.64524932328857, 504.47483062393724, -170.74650843941907); + double2x3 r1 = double2x3(293.74197902052754, -386.059833944803, 4.9544198536101476, -418.64524932328857, 504.47483062393724, -170.74650843941907); + TestUtils.AreEqual(r1, +a1); + + double2x3 a2 = double2x3(439.55937572920664, 116.40075665172219, 421.40964742256779, -258.5960806620289, 447.86609122150867, 124.16434031546316); + double2x3 r2 = double2x3(439.55937572920664, 116.40075665172219, 421.40964742256779, -258.5960806620289, 447.86609122150867, 124.16434031546316); + TestUtils.AreEqual(r2, +a2); + + double2x3 a3 = double2x3(222.17254386757156, 239.04183947250328, 498.4495329793773, -139.382530515726, 279.07295549990283, 108.7758186370022); + double2x3 r3 = double2x3(222.17254386757156, 239.04183947250328, 498.4495329793773, -139.382530515726, 279.07295549990283, 108.7758186370022); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void double2x3_operator_neg() + { + double2x3 a0 = double2x3(148.46174890755753, -467.12267873581624, 132.04719954917539, 183.52262290917463, 473.7010145009034, -407.99109024926605); + double2x3 r0 = double2x3(-148.46174890755753, 467.12267873581624, -132.04719954917539, -183.52262290917463, -473.7010145009034, 407.99109024926605); + TestUtils.AreEqual(r0, -a0); + + double2x3 a1 = double2x3(-54.958759571872065, -299.09338893512887, -383.01406377508027, 407.70980305583669, 168.73550351370852, 466.44152829909763); + double2x3 r1 = double2x3(54.958759571872065, 299.09338893512887, 383.01406377508027, -407.70980305583669, -168.73550351370852, -466.44152829909763); + TestUtils.AreEqual(r1, -a1); + + double2x3 a2 = double2x3(171.90249474900895, -78.85761622286293, 318.69633522569029, -39.91539694737429, 140.34000284054321, 132.19563180403577); + double2x3 r2 = double2x3(-171.90249474900895, 78.85761622286293, -318.69633522569029, 39.91539694737429, -140.34000284054321, -132.19563180403577); + TestUtils.AreEqual(r2, -a2); + + double2x3 a3 = double2x3(-505.89525127126615, -237.05693375182193, -137.617827241131, -245.34998547534923, 422.52133222227974, -434.57134386271764); + double2x3 r3 = double2x3(505.89525127126615, 237.05693375182193, 137.617827241131, 245.34998547534923, -422.52133222227974, 434.57134386271764); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void double2x3_operator_prefix_inc() + { + double2x3 a0 = double2x3(-139.84208137348389, -56.743654039103376, -381.955324589254, 509.79634380237962, -222.89634452708827, 210.31986556310198); + double2x3 r0 = double2x3(-138.84208137348389, -55.743654039103376, -380.955324589254, 510.79634380237962, -221.89634452708827, 211.31986556310198); + TestUtils.AreEqual(r0, ++a0); + + double2x3 a1 = double2x3(-392.73151058365193, 362.21273939787068, 401.614830919362, 130.90919429199266, -450.23016402229212, 243.54693114177644); + double2x3 r1 = double2x3(-391.73151058365193, 363.21273939787068, 402.614830919362, 131.90919429199266, -449.23016402229212, 244.54693114177644); + TestUtils.AreEqual(r1, ++a1); + + double2x3 a2 = double2x3(46.19202735190845, 299.18547000511808, 154.35656530892311, -281.23327435237974, 200.70599922943211, 92.957765384091886); + double2x3 r2 = double2x3(47.19202735190845, 300.18547000511808, 155.35656530892311, -280.23327435237974, 201.70599922943211, 93.957765384091886); + TestUtils.AreEqual(r2, ++a2); + + double2x3 a3 = double2x3(448.60215565590283, 18.499063262016989, -215.71113381893895, 471.94723651928234, 257.07660090973445, 41.625937719655212); + double2x3 r3 = double2x3(449.60215565590283, 19.499063262016989, -214.71113381893895, 472.94723651928234, 258.07660090973445, 42.625937719655212); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void double2x3_operator_postfix_inc() + { + double2x3 a0 = double2x3(-396.6697396695007, 511.20749378167443, 249.11127030528678, -128.81731301584153, -259.49027669592306, 278.00817764830219); + double2x3 r0 = double2x3(-396.6697396695007, 511.20749378167443, 249.11127030528678, -128.81731301584153, -259.49027669592306, 278.00817764830219); + TestUtils.AreEqual(r0, a0++); + + double2x3 a1 = double2x3(-81.393423356764686, 167.85212691493894, 147.94395048354932, -326.10758486674524, 41.033564825092185, 128.5304239394751); + double2x3 r1 = double2x3(-81.393423356764686, 167.85212691493894, 147.94395048354932, -326.10758486674524, 41.033564825092185, 128.5304239394751); + TestUtils.AreEqual(r1, a1++); + + double2x3 a2 = double2x3(73.155582223625629, -446.22976490772783, -296.93783797739906, 267.29380071689081, 446.22930714405572, 49.200223230384381); + double2x3 r2 = double2x3(73.155582223625629, -446.22976490772783, -296.93783797739906, 267.29380071689081, 446.22930714405572, 49.200223230384381); + TestUtils.AreEqual(r2, a2++); + + double2x3 a3 = double2x3(-326.64314738225335, 471.64748762159024, -171.01308186865089, 310.72735967800361, -298.91717185588425, 489.98497008252184); + double2x3 r3 = double2x3(-326.64314738225335, 471.64748762159024, -171.01308186865089, 310.72735967800361, -298.91717185588425, 489.98497008252184); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void double2x3_operator_prefix_dec() + { + double2x3 a0 = double2x3(123.12869626056806, 256.8437465433235, 156.33078844674435, 461.73742530389563, 325.86799755965728, 392.01561731473339); + double2x3 r0 = double2x3(122.12869626056806, 255.8437465433235, 155.33078844674435, 460.73742530389563, 324.86799755965728, 391.01561731473339); + TestUtils.AreEqual(r0, --a0); + + double2x3 a1 = double2x3(187.87412580655609, 125.10963517292851, 469.8447313112415, 45.536655685648611, 376.04684680329956, -363.07547991493504); + double2x3 r1 = double2x3(186.87412580655609, 124.10963517292851, 468.8447313112415, 44.536655685648611, 375.04684680329956, -364.07547991493504); + TestUtils.AreEqual(r1, --a1); + + double2x3 a2 = double2x3(-22.028951416736902, 168.0950144120003, 168.26565011230559, -190.284744112885, 166.9455474200405, 183.95795854551625); + double2x3 r2 = double2x3(-23.028951416736902, 167.0950144120003, 167.26565011230559, -191.284744112885, 165.9455474200405, 182.95795854551625); + TestUtils.AreEqual(r2, --a2); + + double2x3 a3 = double2x3(485.69469259944492, 89.569894117102876, -267.42982090051743, 201.75623450137505, -141.21688682456357, -217.48409782046645); + double2x3 r3 = double2x3(484.69469259944492, 88.569894117102876, -268.42982090051743, 200.75623450137505, -142.21688682456357, -218.48409782046645); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void double2x3_operator_postfix_dec() + { + double2x3 a0 = double2x3(379.68831723727669, 302.69287814884115, -176.07134040448409, -291.25267066212962, 470.56758401848731, -402.92594666170231); + double2x3 r0 = double2x3(379.68831723727669, 302.69287814884115, -176.07134040448409, -291.25267066212962, 470.56758401848731, -402.92594666170231); + TestUtils.AreEqual(r0, a0--); + + double2x3 a1 = double2x3(-63.655158787805192, -27.889220489137415, -100.76183824462902, 156.14034969924967, 479.94519613680677, -200.30429491787419); + double2x3 r1 = double2x3(-63.655158787805192, -27.889220489137415, -100.76183824462902, 156.14034969924967, 479.94519613680677, -200.30429491787419); + TestUtils.AreEqual(r1, a1--); + + double2x3 a2 = double2x3(-445.0269393609031, 327.67032519340069, 48.0602071509046, -209.66798100698179, -38.435048836485976, 283.941595924991); + double2x3 r2 = double2x3(-445.0269393609031, 327.67032519340069, 48.0602071509046, -209.66798100698179, -38.435048836485976, 283.941595924991); + TestUtils.AreEqual(r2, a2--); + + double2x3 a3 = double2x3(-94.802087112703418, -287.262531175866, -215.94803939384781, -407.04635567546188, 159.23357136511879, -359.45648663093175); + double2x3 r3 = double2x3(-94.802087112703418, -287.262531175866, -215.94803939384781, -407.04635567546188, 159.23357136511879, -359.45648663093175); + TestUtils.AreEqual(r3, a3--); + } + + [TestCase /* For player builds */] + public static void double2x3_EqualsObjectOverride() + { + TestUtils.IsFalse(new double2x3().Equals((object)new int())); + TestUtils.IsTrue(new double2x3().Equals((object)new double2x3())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestDouble2x3.gen.cs.meta b/src/Tests/Tests/Shared/TestDouble2x3.gen.cs.meta new file mode 100644 index 00000000..a38035f8 --- /dev/null +++ b/src/Tests/Tests/Shared/TestDouble2x3.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fa8d4556e4d042c4199dca8671bc2817 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestDouble2x4.gen.cs b/src/Tests/Tests/Shared/TestDouble2x4.gen.cs new file mode 100644 index 00000000..c519d6f4 --- /dev/null +++ b/src/Tests/Tests/Shared/TestDouble2x4.gen.cs @@ -0,0 +1,952 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestDouble2x4 + { + [TestCompiler] + public static void double2x4_zero() + { + TestUtils.AreEqual(0.0, double2x4.zero.c0.x); + TestUtils.AreEqual(0.0, double2x4.zero.c0.y); + TestUtils.AreEqual(0.0, double2x4.zero.c1.x); + TestUtils.AreEqual(0.0, double2x4.zero.c1.y); + TestUtils.AreEqual(0.0, double2x4.zero.c2.x); + TestUtils.AreEqual(0.0, double2x4.zero.c2.y); + TestUtils.AreEqual(0.0, double2x4.zero.c3.x); + TestUtils.AreEqual(0.0, double2x4.zero.c3.y); + } + + [TestCompiler] + public static void double2x4_operator_equal_wide_wide() + { + double2x4 a0 = double2x4(492.15758275061728, -495.20632027797694, 227.45765195947968, -147.37405950733182, -222.68201909897942, 64.093720704360749, -23.890404473939157, -16.8197190839889); + double2x4 b0 = double2x4(192.56880888369346, -235.61102472786376, -254.04311740307281, -412.62472052715009, 471.90480945627428, -6.4727852374654162, -339.10237447316865, 488.1875700839737); + bool2x4 r0 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + double2x4 a1 = double2x4(163.23210890741655, -165.27101071424363, 470.87767980568003, -423.94255967808078, 109.63436918595539, 462.69031283943468, -335.38147727371262, 357.23446934168896); + double2x4 b1 = double2x4(-379.5965842584132, -308.41700258311675, -82.333374300195544, -102.92108087563935, 226.51573835430463, -356.90132896830391, -362.91277544708589, -427.89843746083716); + bool2x4 r1 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + double2x4 a2 = double2x4(1.5455777652308598, -347.38824741327585, -114.47217302884542, 435.84865804940864, 194.23808607563285, 138.76554710174241, -467.34914205379278, 370.43337767684523); + double2x4 b2 = double2x4(466.65013978753711, -102.79904680270658, -43.355954428834821, 85.045664111639212, -91.127054972167628, 422.19208856215334, -477.43130873024057, 1.8770024785198984); + bool2x4 r2 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + double2x4 a3 = double2x4(476.70826147343416, 320.55264702465047, -498.59197377534207, 92.4169581366782, 104.51136856177425, 166.75460608618084, -204.73343024250744, 434.75675674656259); + double2x4 b3 = double2x4(312.5800799394865, 254.59934365684137, 352.72583763335172, 62.490957050812881, 119.71476059766246, -511.05808639482507, -302.47273053902791, -371.76924365189359); + bool2x4 r3 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void double2x4_operator_equal_wide_scalar() + { + double2x4 a0 = double2x4(-303.2300766926399, 451.52631327674089, -253.65587413201848, -105.20363502632995, -500.6910920090466, -426.19248338518315, 159.87609656149334, -59.558379439431405); + double b0 = (123.5445759871717); + bool2x4 r0 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + double2x4 a1 = double2x4(-57.477391031327386, 406.51375861024189, 370.88599866017978, -172.03530629539642, 455.40001198993991, -11.338988547836891, 363.93823044557973, -27.150561106927); + double b1 = (-182.04973968400139); + bool2x4 r1 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + double2x4 a2 = double2x4(-325.97606507221985, 180.19686635779067, -374.12832015293105, -439.35894295170851, -126.54608899287234, -197.2617896521752, -227.15933357326281, -479.8991937487848); + double b2 = (-290.35904254129116); + bool2x4 r2 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + double2x4 a3 = double2x4(-439.77767750237962, -224.51705013239621, -422.83322616239695, -450.19627043707123, -20.106708774392814, 297.37999906082632, 185.9665759475746, -102.97598962810633); + double b3 = (-495.23734902555); + bool2x4 r3 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void double2x4_operator_equal_scalar_wide() + { + double a0 = (-253.39728534100453); + double2x4 b0 = double2x4(19.952187785856495, -185.79199346610903, 407.8136052600172, -87.2766969610363, -206.27469382354741, 160.503138855334, -274.77081478516141, -2.6315281403397535); + bool2x4 r0 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + double a1 = (448.35453602688131); + double2x4 b1 = double2x4(-410.03524251004461, 247.32901465489022, 355.53915350303942, -298.06671180299793, 414.10151429385951, -481.30262707234482, 196.55074438664633, 34.60100008668428); + bool2x4 r1 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + double a2 = (113.76156645350227); + double2x4 b2 = double2x4(-386.45337861890596, -124.49174672201821, 243.8866447153905, -492.6181826501238, 145.424413033493, 421.55070968230757, -95.409988209330493, 336.80928746648567); + bool2x4 r2 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + double a3 = (209.58380589707929); + double2x4 b3 = double2x4(487.441424358376, 161.80653365040507, 149.84247095409899, 225.723996505944, -71.21880176999548, 85.780251781353854, 192.547256797807, -49.887493395194156); + bool2x4 r3 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void double2x4_operator_not_equal_wide_wide() + { + double2x4 a0 = double2x4(430.8425316432689, 104.69001798736394, 225.80243478799355, -310.57017841496048, -418.61945815506363, 304.12820281839379, -509.32682561749908, -160.53807719076895); + double2x4 b0 = double2x4(210.02470622305975, -55.203330304102678, -269.92533672504373, -234.54673372700194, 25.917412054686565, -63.726991444699024, -484.55371092471933, -425.333599050219); + bool2x4 r0 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + double2x4 a1 = double2x4(-203.30197606016975, -505.76325368590807, 162.17220623892365, 1.1561973100324394, 65.662074358045174, 102.78780250567377, 172.93008120960098, 26.621009123800832); + double2x4 b1 = double2x4(-53.274394775402925, 328.1944192984115, 15.963139303011417, 461.71412417931208, -113.36304455313973, -240.07297264787974, 495.11916970420589, 203.5583661550462); + bool2x4 r1 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + double2x4 a2 = double2x4(235.12595259171258, 128.54198533321824, -354.99697630246959, 334.35948220564023, -495.83200692377613, 468.30740163675853, 458.37094733601941, 299.93733300824522); + double2x4 b2 = double2x4(340.49345103860526, -241.90719448863865, 459.56982896270688, 213.0737384357833, -384.7828506831, -255.07233846144396, 477.66343115161328, -248.03662621604121); + bool2x4 r2 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + double2x4 a3 = double2x4(43.12718560319729, -354.71349994964595, -145.28719551176169, 390.80186218340032, -303.13149108697263, 391.13459533785215, 139.2868607692825, 104.52318506339714); + double2x4 b3 = double2x4(-407.92344565313471, -199.78886971240343, 151.84326488889906, -97.120607659742518, 154.97589380805186, -172.83452065886672, 441.5027942329192, -401.73862785926957); + bool2x4 r3 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void double2x4_operator_not_equal_wide_scalar() + { + double2x4 a0 = double2x4(-16.914588697680529, 168.83411486858233, -462.71352145760949, 130.30776959765137, 214.50161443208424, -440.26328178879959, -197.12796053529155, -169.09985860115842); + double b0 = (-145.37277109239847); + bool2x4 r0 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + double2x4 a1 = double2x4(-386.61117595555783, -270.26885593601912, -403.96372313236992, -269.80570877241234, 299.65422763473089, -71.750904831919286, -432.75573917513515, -457.36312100727258); + double b1 = (-281.02101362916687); + bool2x4 r1 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + double2x4 a2 = double2x4(-13.519590622521719, 185.042454567292, -482.53069351731364, 116.39514427836764, 511.73495578753523, 230.50753628020527, 100.27476768394683, 129.68240863163135); + double b2 = (273.87305773136814); + bool2x4 r2 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + double2x4 a3 = double2x4(321.17879048044733, 140.33521921016984, 369.2123617461009, 453.81121489676241, -333.66624871532724, -373.93775218256644, 150.20429451307484, -442.16476627912596); + double b3 = (-220.63900409482375); + bool2x4 r3 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void double2x4_operator_not_equal_scalar_wide() + { + double a0 = (275.79582823244664); + double2x4 b0 = double2x4(-57.196896341255353, -382.4325279586169, 97.820359990848374, -161.46364529499022, -458.39563367254829, -499.61786364932448, 327.92217818271467, 367.57121699283425); + bool2x4 r0 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + double a1 = (59.7863667289663); + double2x4 b1 = double2x4(-209.58068118318016, -62.580453186566217, -479.97497604786184, -49.494519495169868, -114.68521338081229, 109.93924599044919, -176.28482755286842, -347.48529903380449); + bool2x4 r1 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + double a2 = (85.540928165214609); + double2x4 b2 = double2x4(-356.65954868712441, -104.24357490625397, -133.54918605347592, 243.53971135036079, 13.141311890045813, -379.98594754747393, -41.281226892620907, 87.911684792447659); + bool2x4 r2 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + double a3 = (-339.07727996403224); + double2x4 b3 = double2x4(-371.82034533648766, 333.14425936953364, 294.81196011920088, -187.14565977228136, 220.19225774528093, -228.18207250730234, -499.72373914146971, 97.4059055305114); + bool2x4 r3 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void double2x4_operator_less_wide_wide() + { + double2x4 a0 = double2x4(196.84256825076534, 336.40979997087732, 251.96372115424072, 257.65591466503963, 430.04588647840819, -62.419644146421774, 8.8392293494376872, -333.81671563434259); + double2x4 b0 = double2x4(-465.34502313348696, -256.15239751346053, -314.814018634527, 364.56673662949663, 100.21050290959442, 182.56098636545289, 3.116978885194726, -259.43047893207074); + bool2x4 r0 = bool2x4(false, false, false, true, false, true, false, true); + TestUtils.AreEqual(r0, a0 < b0); + + double2x4 a1 = double2x4(164.67880662003472, -350.94487516532877, 3.84143662631584, 125.40972024081725, -111.12994127680076, 70.005523475820951, 448.19828173527412, -419.98711200244122); + double2x4 b1 = double2x4(-437.33490749696966, -456.0437321402336, -394.2559718537405, 401.91369099259077, 313.43916454605721, 121.28668194696616, -28.012290729215522, -282.96589697663012); + bool2x4 r1 = bool2x4(false, false, false, true, true, true, false, true); + TestUtils.AreEqual(r1, a1 < b1); + + double2x4 a2 = double2x4(-258.30166757213965, -34.832201735504043, -69.859397682295821, 67.767227442826766, -139.77729207825723, 385.43464130229995, 133.707390609061, 506.18837117878184); + double2x4 b2 = double2x4(330.06440631023816, 124.09937077579059, -183.69031700104955, 373.0607623406969, 109.75094013556418, -203.57134232463841, 45.6486556742567, -360.95226280808089); + bool2x4 r2 = bool2x4(true, true, false, true, true, false, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + double2x4 a3 = double2x4(34.442885653322037, 412.11373896715872, -84.809773246203463, 444.78534504621541, -78.754743374304269, 366.97754376334024, 127.18045788965208, 428.36845489422251); + double2x4 b3 = double2x4(211.91309867236441, -313.28636207863985, -259.66108691862837, 79.0985401045059, 446.49610897828643, 450.52455660818362, -375.63076728192658, -53.941822792376286); + bool2x4 r3 = bool2x4(true, false, false, false, true, true, false, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void double2x4_operator_less_wide_scalar() + { + double2x4 a0 = double2x4(-132.05731708000292, -192.46500477216438, -66.834607870706634, -379.01750081545561, -360.28242199508588, 20.927834282129879, -158.24074537970159, 437.34587522845061); + double b0 = (-156.01021845452965); + bool2x4 r0 = bool2x4(false, true, false, true, true, false, true, false); + TestUtils.AreEqual(r0, a0 < b0); + + double2x4 a1 = double2x4(-20.452607402788772, 307.48418607725023, 274.01523292903562, 373.54965584983563, 398.52368301829495, 105.0301654827922, -58.010895994496934, 109.67008810381878); + double b1 = (225.29148517609178); + bool2x4 r1 = bool2x4(true, false, false, false, false, true, true, true); + TestUtils.AreEqual(r1, a1 < b1); + + double2x4 a2 = double2x4(-108.853174498702, 140.42607147080173, -500.08827638071415, 172.10334857371788, -197.50074610370245, -7.27149987559369, -432.99049898283113, 62.158315449095426); + double b2 = (-44.971252223929014); + bool2x4 r2 = bool2x4(true, false, true, false, true, false, true, false); + TestUtils.AreEqual(r2, a2 < b2); + + double2x4 a3 = double2x4(-72.254720959931035, -500.25573586870718, 149.1149638393498, 119.88061695912882, 202.63918909925928, 274.95066393304182, 66.4120323967245, 274.99944580486022); + double b3 = (-377.85232299279994); + bool2x4 r3 = bool2x4(false, true, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void double2x4_operator_less_scalar_wide() + { + double a0 = (-423.117411095238); + double2x4 b0 = double2x4(385.09483617595151, -123.93348532725753, 86.376572887588509, 133.44217378154497, 161.45794947513286, 229.75426660746064, 222.57159934871436, 315.53116360098647); + bool2x4 r0 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 < b0); + + double a1 = (-447.20351883731945); + double2x4 b1 = double2x4(271.83385790131695, -393.60531324595462, 317.48689737798964, -164.6051085761772, -282.87605370342544, 296.97953071118309, -254.40115582868509, 365.61562054493265); + bool2x4 r1 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 < b1); + + double a2 = (-441.98425671178114); + double2x4 b2 = double2x4(-131.42866021554391, 442.62897631275882, -29.792842163607872, -138.37379533535511, 9.2169721169476588, -226.7305482489665, 171.02944310523083, 376.62522595777421); + bool2x4 r2 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 < b2); + + double a3 = (-462.58872697436658); + double2x4 b3 = double2x4(-142.36729795409707, -456.25377414014832, 66.6102416825529, 169.37875779409831, 327.44439450253003, 64.0879266560487, -153.50390369887646, 199.38014921889646); + bool2x4 r3 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void double2x4_operator_greater_wide_wide() + { + double2x4 a0 = double2x4(483.50140141113729, 310.81563415695712, 106.9661896726891, 295.73526038589671, 116.95757179938141, -478.29977653841479, -14.897393471979228, -33.817441717636484); + double2x4 b0 = double2x4(-471.39802454011425, -371.98528617060992, 36.900723236101044, -316.76360407320954, 19.683055648432628, 207.3091381561519, 362.79748861994483, 324.95341816775192); + bool2x4 r0 = bool2x4(true, true, true, true, true, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + double2x4 a1 = double2x4(-24.740548383789417, 319.78262701620474, -120.15856581561201, -289.00857962714906, 455.85146662958505, 144.70691139283917, 63.931990891663304, -285.68304099034663); + double2x4 b1 = double2x4(340.94807140014507, 25.986035120666997, -114.2111352021858, 240.80346428640348, 273.42244757033063, 325.51576224226312, 27.341068995809678, 64.479532510265472); + bool2x4 r1 = bool2x4(false, true, false, false, true, false, true, false); + TestUtils.AreEqual(r1, a1 > b1); + + double2x4 a2 = double2x4(-502.0907201720824, -337.19446412529538, 474.31734274063137, -507.14510679018923, -133.56559735795742, -443.10913654934109, -464.34137056038776, -68.361549647693323); + double2x4 b2 = double2x4(200.94836983501375, 100.12266998184964, -79.00710896356361, -315.137945560337, -122.98542815213347, -163.77920229908972, -492.56600617457462, -90.797273439726439); + bool2x4 r2 = bool2x4(false, false, true, false, false, false, true, true); + TestUtils.AreEqual(r2, a2 > b2); + + double2x4 a3 = double2x4(-185.99299987870876, -157.80389340119615, -74.124229227250567, -94.471165939453613, 329.61055508703487, -315.83675280019486, 404.193811843262, 131.30440503512716); + double2x4 b3 = double2x4(-284.9012335673446, -23.653687249707843, 174.93002112905026, 85.7125366133231, -441.98783012944637, 345.54374210235835, 482.21949814363359, -422.38349719642827); + bool2x4 r3 = bool2x4(true, false, false, false, true, false, false, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void double2x4_operator_greater_wide_scalar() + { + double2x4 a0 = double2x4(64.317918092160426, -397.70346445483318, 431.87690826499693, 85.702980796668157, 246.26305233978803, 197.49155602114809, 286.1994608781298, 280.81334818564972); + double b0 = (305.85991992888034); + bool2x4 r0 = bool2x4(false, false, true, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + double2x4 a1 = double2x4(-405.78459210218148, -241.80727326209063, 333.57817498481745, 370.27919524269146, -413.70138116073861, -356.5923551789449, -353.03129522550444, 396.64532608382649); + double b1 = (171.56538661362856); + bool2x4 r1 = bool2x4(false, false, true, true, false, false, false, true); + TestUtils.AreEqual(r1, a1 > b1); + + double2x4 a2 = double2x4(467.22205541432936, 502.91505193287276, 315.46759024051369, -259.28970134411458, 281.23064554912537, 428.79219909608, 245.15306460352292, -279.17542494422543); + double b2 = (-240.0134228393498); + bool2x4 r2 = bool2x4(true, true, true, false, true, true, true, false); + TestUtils.AreEqual(r2, a2 > b2); + + double2x4 a3 = double2x4(-453.86309668694764, -425.65293451103054, 99.132852838902181, 355.0605339273161, -456.43941256796916, 154.48902208846482, 405.52974409867534, -157.73379643155903); + double b3 = (-124.77154856769909); + bool2x4 r3 = bool2x4(false, false, true, true, false, true, true, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void double2x4_operator_greater_scalar_wide() + { + double a0 = (-282.67049635698572); + double2x4 b0 = double2x4(358.09997360692353, -72.5964134077525, -232.16380106292843, -60.706723956720282, 75.156642710397364, 150.88350040786133, 339.53917924479538, -498.19602965665797); + bool2x4 r0 = bool2x4(false, false, false, false, false, false, false, true); + TestUtils.AreEqual(r0, a0 > b0); + + double a1 = (459.74610326241054); + double2x4 b1 = double2x4(-227.96872316485678, 335.86213485145106, 76.178844248959308, 296.85993899817572, 177.49000390688423, -281.20120657663847, 244.72285162877427, 137.32857257562159); + bool2x4 r1 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + double a2 = (-385.33824724021287); + double2x4 b2 = double2x4(443.16345879210326, -353.56254141105455, 26.040673983302327, -331.7939499969566, -43.691963454565041, 20.949428806523542, -211.17984423934473, 227.42171894173214); + bool2x4 r2 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + double a3 = (-84.7797711290325); + double2x4 b3 = double2x4(-375.13548701588786, -205.17813096064054, -197.04714617368165, -219.63402305340117, -210.01563344244641, -266.773715858708, 144.77848703450456, -471.71120069535039); + bool2x4 r3 = bool2x4(true, true, true, true, true, true, false, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void double2x4_operator_less_equal_wide_wide() + { + double2x4 a0 = double2x4(-438.52313753521219, 210.48942837980087, 4.8773329280677444, -137.29793817237857, 156.09410174009111, -363.92412035722475, -97.948485181642923, 437.29539009430232); + double2x4 b0 = double2x4(-474.8141498392514, 304.3710555063426, 234.8241737982371, -390.48543209139513, -297.17535295019638, -326.29239121372461, 107.2538764976216, -413.13107342884462); + bool2x4 r0 = bool2x4(false, true, true, false, false, true, true, false); + TestUtils.AreEqual(r0, a0 <= b0); + + double2x4 a1 = double2x4(458.53029153241323, -294.06474675520542, 23.622613679441884, -34.284056441059363, 149.736484835733, -418.8866781754823, -197.50252899783783, -88.2055118494693); + double2x4 b1 = double2x4(67.094432623635271, 470.07522724106684, -84.499104777583455, 392.78422683886447, -263.53175485484849, 369.30090039284005, -333.32529298091555, 238.41347443238533); + bool2x4 r1 = bool2x4(false, true, false, true, false, true, false, true); + TestUtils.AreEqual(r1, a1 <= b1); + + double2x4 a2 = double2x4(-376.71814292330208, 341.62712899857536, -83.309179106405566, -107.49073295830317, 319.46688833807912, 205.35738501574724, 345.56372968552807, 395.32190746596177); + double2x4 b2 = double2x4(486.24259279959028, 279.65021408705513, 236.05201803709008, 132.75898248178839, 66.294708998079727, 183.00210699020056, 200.13055071613314, 339.043800750302); + bool2x4 r2 = bool2x4(true, false, true, true, false, false, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + double2x4 a3 = double2x4(-222.87415490992095, 439.02200790821666, -368.0755667016262, -200.03860173003682, 71.46990660180802, -357.36542932939039, 141.7108519737194, 319.0170969064427); + double2x4 b3 = double2x4(438.53791710293751, 145.40187866306019, 178.16310199450845, 157.97596724237133, 329.7052015409364, -243.59091221708383, 5.4011614347813293, -22.580605278993289); + bool2x4 r3 = bool2x4(true, false, true, true, true, true, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void double2x4_operator_less_equal_wide_scalar() + { + double2x4 a0 = double2x4(193.4958237118534, 168.91555197952107, -313.9930695565385, 81.826965131716292, 18.503590830836288, -0.35819602029312136, 241.36115776810846, -463.81641242644582); + double b0 = (443.85054299042122); + bool2x4 r0 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + double2x4 a1 = double2x4(-1.3577692515020203, 398.9919504593089, -471.253072242836, -264.93778264938749, 82.258299150624453, 11.246050124636895, 424.7040156911612, 426.48223157715154); + double b1 = (-268.89945591096739); + bool2x4 r1 = bool2x4(false, false, true, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 <= b1); + + double2x4 a2 = double2x4(56.319978501796754, 31.901173844887467, -152.2575724833913, -437.92645975478297, -37.104814785115821, -47.144214413661587, 333.6230348710078, -274.80387438219225); + double b2 = (-196.28791126808522); + bool2x4 r2 = bool2x4(false, false, false, true, false, false, false, true); + TestUtils.AreEqual(r2, a2 <= b2); + + double2x4 a3 = double2x4(358.67627804292192, 192.30916008367626, 145.30606777281787, -466.13296363602063, -494.26732968458316, -111.57013922164691, -139.54120332540072, -146.58935148389514); + double b3 = (-260.46056926458169); + bool2x4 r3 = bool2x4(false, false, false, true, true, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void double2x4_operator_less_equal_scalar_wide() + { + double a0 = (393.60626644343427); + double2x4 b0 = double2x4(-75.688363825757222, -44.2638714519627, 125.86491566797019, 191.96488174794467, 13.543054825413492, -197.0519259893577, -423.945100743298, -330.04861680141119); + bool2x4 r0 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 <= b0); + + double a1 = (420.16553779140372); + double2x4 b1 = double2x4(105.54730777887039, 174.82126363311954, 296.71757831085358, -469.70041845259277, 123.26718979853536, 112.9969695140594, 495.14339493920249, -488.65789364681478); + bool2x4 r1 = bool2x4(false, false, false, false, false, false, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + double a2 = (388.53941148730894); + double2x4 b2 = double2x4(-493.24077080806751, 16.451064832718657, -387.6516336815672, -229.1773127192526, -373.01533930982248, -391.142134610164, 90.994149488859875, -178.39613517485378); + bool2x4 r2 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + double a3 = (-69.621067317957568); + double2x4 b3 = double2x4(471.7908458522478, -67.4667532758167, 45.305359623071467, -154.69219000390365, 385.73888248286153, -431.652945004242, -331.67304841227508, -349.89271013340573); + bool2x4 r3 = bool2x4(true, true, true, false, true, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void double2x4_operator_greater_equal_wide_wide() + { + double2x4 a0 = double2x4(-507.92858409692, 504.49748181947393, -385.43449205226938, -262.32340944107784, -37.550928848586466, -111.59527759980193, -463.70202157632542, 387.44885772627265); + double2x4 b0 = double2x4(-81.346509732933043, 297.66615047010885, 171.06540616371922, -431.03805538222105, -6.859075311040101, 319.72570362674333, 254.079170106947, 396.5724000393285); + bool2x4 r0 = bool2x4(false, true, false, true, false, false, false, false); + TestUtils.AreEqual(r0, a0 >= b0); + + double2x4 a1 = double2x4(456.96878573716094, -211.01015506079892, 182.41135391146474, -53.596053863687473, -309.57021608463032, -136.02249127999994, 280.73629082401112, -96.9958942388165); + double2x4 b1 = double2x4(178.83927615864172, -447.06336304501787, 288.49268569075161, 474.88929460704765, -321.75022831640683, -395.97722048125104, -158.69246037243516, 391.48869318118727); + bool2x4 r1 = bool2x4(true, true, false, false, true, true, true, false); + TestUtils.AreEqual(r1, a1 >= b1); + + double2x4 a2 = double2x4(-174.05950673579213, 88.9019382413951, 43.816040774721728, -446.07842585354967, 16.645595796706857, 409.83252043734888, -191.32987245886113, 222.99782548798146); + double2x4 b2 = double2x4(-368.10924141859135, 89.1238043723273, -510.27932214656812, -486.92979525352354, -81.215552606254619, 274.21882046117389, -212.88155494112596, 288.99530591117); + bool2x4 r2 = bool2x4(true, false, true, true, true, true, true, false); + TestUtils.AreEqual(r2, a2 >= b2); + + double2x4 a3 = double2x4(404.28838915577546, 230.60328136691976, -441.78928228923553, -86.293056289801882, 484.24954413075443, 95.2363665547391, -204.91210255628084, -199.77434620623211); + double2x4 b3 = double2x4(307.73173131967508, 307.24516620638087, -199.39178213821339, -284.42126978767163, -482.39181278757371, 448.3157362641374, -378.3461889598268, -390.8584684761513); + bool2x4 r3 = bool2x4(true, false, false, true, true, false, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void double2x4_operator_greater_equal_wide_scalar() + { + double2x4 a0 = double2x4(465.15218732559686, -424.8860745024337, -209.22109685150025, 58.779852656079356, -302.26910533675414, 140.12558252183976, 16.353385694489475, -344.55997316192838); + double b0 = (-5.5998842742293391); + bool2x4 r0 = bool2x4(true, false, false, true, false, true, true, false); + TestUtils.AreEqual(r0, a0 >= b0); + + double2x4 a1 = double2x4(393.27804846003562, 441.0115565923096, -509.78156757251435, -36.994287269652943, 494.82028865014217, -164.97393830352183, -466.12009046325466, -123.8137477020797); + double b1 = (-315.70155086913218); + bool2x4 r1 = bool2x4(true, true, false, true, true, true, false, true); + TestUtils.AreEqual(r1, a1 >= b1); + + double2x4 a2 = double2x4(215.65121779947128, 314.34603014325069, 190.51609882643265, -83.111429014760745, -23.836435567511444, 143.04935962662535, -264.91997945724052, -169.70222457205051); + double b2 = (104.99569730879534); + bool2x4 r2 = bool2x4(true, true, true, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + double2x4 a3 = double2x4(329.70751610850334, -260.42331016269668, 354.19514219565087, -111.84533768140028, 33.309096113456917, 355.63126938214123, -435.36056753404466, -38.39930893778768); + double b3 = (359.09582035573931); + bool2x4 r3 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void double2x4_operator_greater_equal_scalar_wide() + { + double a0 = (374.82703393270594); + double2x4 b0 = double2x4(-1.609757185731894, 338.61524049314448, -116.18140392945213, -332.15732375353451, -355.9793509710484, -468.90144107719021, 38.579884785497484, -332.34754697063357); + bool2x4 r0 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + double a1 = (2.8901150240051265); + double2x4 b1 = double2x4(467.77776477661814, 121.40638762405445, -305.02337303060267, -58.428812292604164, -226.51955209789776, -47.020994446715804, 305.3026770582901, -427.40123315686418); + bool2x4 r1 = bool2x4(false, false, true, true, true, true, false, true); + TestUtils.AreEqual(r1, a1 >= b1); + + double a2 = (92.263649745035764); + double2x4 b2 = double2x4(-497.17853736187266, -408.62564225151465, -455.23049113491106, 396.42608637196292, -469.29488561548987, -485.7540130493017, -182.34619268325446, -291.54536284671417); + bool2x4 r2 = bool2x4(true, true, true, false, true, true, true, true); + TestUtils.AreEqual(r2, a2 >= b2); + + double a3 = (278.740809331993); + double2x4 b3 = double2x4(-75.87113932327884, 28.907059921374071, 287.72014988945807, 420.50978990109161, 473.62684152723614, 181.514540518408, -369.20287220981106, 243.74977385427326); + bool2x4 r3 = bool2x4(true, true, false, false, false, true, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void double2x4_operator_add_wide_wide() + { + double2x4 a0 = double2x4(506.12905263627374, -501.77980803967444, 420.08479638587903, -186.03206476291274, -9.3123953385801883, 328.51179686585056, 424.34407659263536, 87.791079800478656); + double2x4 b0 = double2x4(-28.757987751047096, -337.135153689019, -340.676816860529, 152.31202633320913, 423.66745420157326, 90.374096674087468, 376.18866246574964, 1.7671887882831925); + double2x4 r0 = double2x4(477.37106488522664, -838.91496172869347, 79.407979525350015, -33.720038429703607, 414.35505886299308, 418.885893539938, 800.532739058385, 89.558268588761848); + TestUtils.AreEqual(r0, a0 + b0); + + double2x4 a1 = double2x4(462.41368148402012, -46.178705952213477, 401.17006296718966, -454.12414643453627, 69.195687564646732, -177.95734485329939, 299.60415544156183, 340.7048587001417); + double2x4 b1 = double2x4(-120.18586045139745, -279.62936628965167, -344.66710273580026, 242.8391956029642, 418.5930504363929, -23.312797318823982, -95.099945827899489, 147.92812568877275); + double2x4 r1 = double2x4(342.22782103262267, -325.80807224186515, 56.502960231389409, -211.28495083157208, 487.78873800103963, -201.27014217212337, 204.50420961366234, 488.63298438891445); + TestUtils.AreEqual(r1, a1 + b1); + + double2x4 a2 = double2x4(219.91602740991675, -321.90838232725321, 286.35534037573041, -333.41949311523672, -118.93216973120911, 68.607509406566351, 23.190902005504313, -205.57787547147734); + double2x4 b2 = double2x4(331.03287926830023, -82.502564230236487, 279.44956291813844, 342.6227215931857, -300.35853185335105, -209.69408736456842, 446.55942150883345, -351.98918955027557); + double2x4 r2 = double2x4(550.948906678217, -404.41094655748969, 565.80490329386885, 9.2032284779489828, -419.29070158456017, -141.08657795800207, 469.75032351433777, -557.56706502175291); + TestUtils.AreEqual(r2, a2 + b2); + + double2x4 a3 = double2x4(11.521422629953122, -340.7950796283759, -68.931167873056211, 304.8532370556394, -86.633841316510825, 105.66915874633435, 349.28052799277032, 364.7078708916473); + double2x4 b3 = double2x4(-263.12385642860261, -252.4585670216282, 289.82535542632706, 338.79615537207394, -232.61900364263869, -510.50825405051387, 349.2807325559113, -426.2124495106807); + double2x4 r3 = double2x4(-251.60243379864949, -593.25364665000416, 220.89418755327085, 643.64939242771334, -319.25284495914951, -404.83909530417952, 698.56126054868162, -61.504578619033396); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void double2x4_operator_add_wide_scalar() + { + double2x4 a0 = double2x4(-194.51420387742769, 338.54838696985894, 246.97140252169754, 100.51093797595752, -45.724677822424439, -478.11131094308166, 30.916145577522116, 60.37435224483454); + double b0 = (124.121678171736); + double2x4 r0 = double2x4(-70.3925257056917, 462.67006514159493, 371.09308069343354, 224.63261614769351, 78.397000349311554, -353.98963277134567, 155.03782374925811, 184.49603041657053); + TestUtils.AreEqual(r0, a0 + b0); + + double2x4 a1 = double2x4(-242.1187475855084, 6.7993848355483806, -484.69981287638649, -188.26501068298938, -213.52673087526426, -267.78430688929944, 189.25996669999324, 198.53359684652355); + double b1 = (82.50134495762245); + double2x4 r1 = double2x4(-159.61740262788595, 89.300729793170831, -402.19846791876404, -105.76366572536693, -131.02538591764181, -185.282961931677, 271.76131165761569, 281.034941804146); + TestUtils.AreEqual(r1, a1 + b1); + + double2x4 a2 = double2x4(187.53610023648298, 302.10236730338181, 300.39907970111778, 124.02158909850823, -200.16134295247559, 31.37822701007974, 362.52213518811493, -423.98885961248953); + double b2 = (-424.92567582844089); + double2x4 r2 = double2x4(-237.38957559195791, -122.82330852505908, -124.5265961273231, -300.90408672993266, -625.08701878091642, -393.54744881836115, -62.403540640325957, -848.91453544093042); + TestUtils.AreEqual(r2, a2 + b2); + + double2x4 a3 = double2x4(432.41331907380993, -465.69948957194549, -311.04303779781003, 84.918990413154916, -432.44245716204978, 235.75065886031405, -472.63775394514096, -257.57773721291579); + double b3 = (374.21141474983256); + double2x4 r3 = double2x4(806.62473382364249, -91.488074822112935, 63.168376952022527, 459.13040516298747, -58.231042412217221, 609.9620736101466, -98.4263391953084, 116.63367753691676); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void double2x4_operator_add_scalar_wide() + { + double a0 = (-340.35468284243473); + double2x4 b0 = double2x4(511.36225652665007, -146.21663791789518, -106.21042661844308, -363.45024960276214, 199.08958325120136, -27.108407271610758, 419.84900041103788, 284.95503748811552); + double2x4 r0 = double2x4(171.00757368421534, -486.57132076032991, -446.56510946087781, -703.80493244519687, -141.26509959123337, -367.46309011404549, 79.494317568603151, -55.399645354319205); + TestUtils.AreEqual(r0, a0 + b0); + + double a1 = (-164.92418129971446); + double2x4 b1 = double2x4(-249.19032561461921, 150.92817718858282, 298.17509784278229, -457.15341803857751, 424.71807094324288, -301.85750283946163, 230.28885208363124, -423.58759351428023); + double2x4 r1 = double2x4(-414.11450691433367, -13.99600411113164, 133.25091654306783, -622.077599338292, 259.79388964352842, -466.78168413917609, 65.364670783916779, -588.51177481399463); + TestUtils.AreEqual(r1, a1 + b1); + + double a2 = (-67.060037882560891); + double2x4 b2 = double2x4(68.7241366229598, -164.02241833695325, 318.93515339444161, 7.8045504129512437, 187.69836029210046, -3.6569664495331153, -446.0830535581722, -209.28724227160552); + double2x4 r2 = double2x4(1.6640987403989129, -231.08245621951414, 251.87511551188072, -59.255487469609648, 120.63832240953957, -70.717004332094, -513.14309144073309, -276.34728015416641); + TestUtils.AreEqual(r2, a2 + b2); + + double a3 = (-38.212905186327589); + double2x4 b3 = double2x4(-346.25717870623674, 465.60741708502519, -192.18595108398512, 278.69379843338106, 381.97845548297209, 481.24367283342576, -97.228162095522578, -455.51374289743313); + double2x4 r3 = double2x4(-384.47008389256433, 427.3945118986976, -230.39885627031271, 240.48089324705347, 343.76555029664451, 443.03076764709817, -135.44106728185017, -493.72664808376072); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void double2x4_operator_sub_wide_wide() + { + double2x4 a0 = double2x4(160.4922617229131, 11.223957305412682, 359.20010607279846, -498.22830485656311, -355.25362913462038, -94.534852787170053, -410.46404786150163, -401.38464398001537); + double2x4 b0 = double2x4(115.46876078260539, -130.98230630298252, 241.54083716196044, 9.9870860623135513, 419.89512582304656, 59.124466208333388, -402.38163847587145, -75.370143687059226); + double2x4 r0 = double2x4(45.023500940307713, 142.2062636083952, 117.65926891083802, -508.21539091887666, -775.14875495766694, -153.65931899550344, -8.0824093856301715, -326.01450029295614); + TestUtils.AreEqual(r0, a0 - b0); + + double2x4 a1 = double2x4(317.70681944382693, 447.0604133303558, -489.07414482956477, -230.00838218909149, 24.875419389864192, 366.61447136784648, -107.3741567634857, -219.0081404275299); + double2x4 b1 = double2x4(320.97960796997859, -73.908757482612884, -31.444742455819949, -389.25194734579509, -375.02884000122026, 259.18275821357167, 276.648654351313, -453.06919905779381); + double2x4 r1 = double2x4(-3.2727885261516576, 520.96917081296874, -457.62940237374482, 159.2435651567036, 399.90425939108445, 107.4317131542748, -384.02281111479869, 234.06105863026391); + TestUtils.AreEqual(r1, a1 - b1); + + double2x4 a2 = double2x4(473.90756891384137, 259.63620793988753, -360.119631219711, 7.8096120393879573, 437.42847439154446, -59.1991718091067, 418.74433322378638, 183.14215072576985); + double2x4 b2 = double2x4(-272.57653225240136, -191.14805301984217, 87.136884968325944, 430.02477594373033, 343.65711538105143, 121.02942067060133, -354.1881703595576, 249.05200373802893); + double2x4 r2 = double2x4(746.48410116624268, 450.78426095972969, -447.25651618803693, -422.21516390434238, 93.771359010493029, -180.22859247970803, 772.932503583344, -65.909853012259077); + TestUtils.AreEqual(r2, a2 - b2); + + double2x4 a3 = double2x4(271.23036516421962, 496.20853709439211, 165.35493691514944, -227.40367113212295, -166.52285702830312, 356.14227430715334, 386.92636579411396, -394.63875717420075); + double2x4 b3 = double2x4(-2.2254426489702723, 22.447240601502017, 478.1129555544411, -320.0629958212669, -111.52409534879217, 222.22894607401872, -245.41106307013473, -119.90228348593337); + double2x4 r3 = double2x4(273.45580781318989, 473.7612964928901, -312.75801863929166, 92.659324689143943, -54.998761679510949, 133.91332823313462, 632.33742886424875, -274.73647368826738); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void double2x4_operator_sub_wide_scalar() + { + double2x4 a0 = double2x4(207.38960108877609, 248.45773684627272, -384.82393211164697, -205.34476122881506, -374.81156152058929, 191.64204820973896, 18.856238135535364, -44.96160151667965); + double b0 = (-36.112476604111691); + double2x4 r0 = double2x4(243.50207769288778, 284.57021345038441, -348.71145550753528, -169.23228462470337, -338.6990849164776, 227.75452481385065, 54.968714739647055, -8.8491249125679587); + TestUtils.AreEqual(r0, a0 - b0); + + double2x4 a1 = double2x4(480.85798738936796, -366.86545269883493, -35.523088233323335, 349.39776460705218, 439.07729336203886, 490.2222661870635, 195.02405104181923, -384.84940952102158); + double b1 = (16.338193185784917); + double2x4 r1 = double2x4(464.51979420358305, -383.20364588461985, -51.861281419108252, 333.05957142126726, 422.73910017625394, 473.88407300127858, 178.68585785603432, -401.1876027068065); + TestUtils.AreEqual(r1, a1 - b1); + + double2x4 a2 = double2x4(189.05188545447402, -54.931482579061537, 53.088051582261983, 316.80250730961677, -273.80670917863335, 256.88723695319482, 297.17363156805447, 101.82901363346218); + double b2 = (55.602777745389744); + double2x4 r2 = double2x4(133.44910770908427, -110.53426032445128, -2.5147261631277615, 261.199729564227, -329.4094869240231, 201.28445920780507, 241.57085382266473, 46.226235888072438); + TestUtils.AreEqual(r2, a2 - b2); + + double2x4 a3 = double2x4(136.60794765157993, 336.58969966349639, -51.876563334780087, 317.34576311583896, -467.05592773251976, -50.167055391784345, 477.804535373023, -60.821922092149919); + double b3 = (-19.732211837420323); + double2x4 r3 = double2x4(156.34015948900026, 356.32191150091671, -32.144351497359764, 337.07797495325929, -447.32371589509944, -30.434843554364022, 497.53674721044331, -41.089710254729596); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void double2x4_operator_sub_scalar_wide() + { + double a0 = (-86.008225719448262); + double2x4 b0 = double2x4(466.42511413359318, 298.48694219183506, -300.95010652251085, 315.38003006362362, -381.09218543632522, -125.00837546447684, 58.466194418476107, 214.74609361158036); + double2x4 r0 = double2x4(-552.43333985304139, -384.49516791128332, 214.94188080306259, -401.38825578307188, 295.08395971687696, 39.00014974502858, -144.47442013792437, -300.75431933102863); + TestUtils.AreEqual(r0, a0 - b0); + + double a1 = (-257.54942739082009); + double2x4 b1 = double2x4(480.22459505508868, -443.35507723472784, 260.79503858312728, 29.681931747906788, 139.85773164586055, -247.78996216868512, -248.4662297929014, 91.445112509394562); + double2x4 r1 = double2x4(-737.77402244590871, 185.80564984390776, -518.34446597394731, -287.23135913872687, -397.40715903668064, -9.7594652221349634, -9.0831975979186836, -348.99453990021465); + TestUtils.AreEqual(r1, a1 - b1); + + double a2 = (86.384162704639266); + double2x4 b2 = double2x4(373.81828206303453, 260.41195428576873, 114.35393171867076, -464.40545318294573, -109.74146156652898, -311.67535057276268, 107.86401586787031, -258.7951592219971); + double2x4 r2 = double2x4(-287.43411935839526, -174.02779158112946, -27.9697690140315, 550.789615887585, 196.12562427116825, 398.05951327740195, -21.479853163231041, 345.17932192663636); + TestUtils.AreEqual(r2, a2 - b2); + + double a3 = (14.097560173877355); + double2x4 b3 = double2x4(-461.97019527012958, 30.310863747406188, 63.701105862716759, -462.67674634544028, 39.759483117498235, 47.998150132595583, -177.61928113625351, 202.47706017386031); + double2x4 r3 = double2x4(476.06775544400693, -16.213303573528833, -49.603545688839404, 476.77430651931763, -25.66192294362088, -33.900589958718228, 191.71684131013086, -188.37949999998295); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void double2x4_operator_mul_wide_wide() + { + double2x4 a0 = double2x4(-482.71381710596097, -407.29348559272171, 137.70058995937029, 208.54113278563182, 194.296573967811, -484.24241684574747, 183.98730739578014, -241.33547770294149); + double2x4 b0 = double2x4(-236.36788355389979, 260.72759139757954, -416.38629718142852, -364.49561541364324, -253.14750897751537, -369.20287220981106, 193.54791531038836, 169.08491976982214); + double2x4 r0 = double2x4(114098.04331156026, -106192.64949051509, -57336.638772880389, -76012.328533757158, -49185.69370281692, 178783.69114527057, 35610.359790024842, -40806.189885013562); + TestUtils.AreEqual(r0, a0 * b0); + + double2x4 a1 = double2x4(45.868758938214114, 363.32610266438041, -328.11893692990714, -471.02307413100408, -262.68257415605831, -379.26274674910246, -374.09058182970182, 481.44738720424812); + double2x4 b1 = double2x4(201.96966442930034, 249.45608317547294, -308.19319810913555, -385.57964843585137, -183.27959522198864, 22.275629292370581, -265.52144229855458, -95.677454277722859); + double2x4 r1 = double2x4(9264.0978505395742, 90633.9064860661, 101124.02453259782, 181616.91132860651, 48144.355863192381, -8448.3163509892329, 99329.070837727879, -46063.660376363579); + TestUtils.AreEqual(r1, a1 * b1); + + double2x4 a2 = double2x4(104.62807397946165, 412.93539948618752, 477.87724731763694, 20.377821216535722, 291.99596299417124, -138.48832399141429, -393.46498483860165, 9.36312318284206); + double2x4 b2 = double2x4(133.25437146669924, 148.31146080247663, 249.284127113076, 500.00547503866505, -19.331578978957396, -36.691062705913112, 30.5238278054278, -401.36701054189678); + double2x4 r2 = double2x4(13942.148235904471, 61243.052314850727, 119127.21246477668, 10189.022177626932, -5644.7430201585421, 5081.2837796057929, -12010.057444678736, -3758.048761232847); + TestUtils.AreEqual(r2, a2 * b2); + + double2x4 a3 = double2x4(-131.94228917543882, 364.44964258952518, 390.61597866128011, 418.79794974755396, -277.34480942289565, 11.410165553637853, 474.87644956767394, -502.40503358394142); + double2x4 b3 = double2x4(3.4372422711165882, 257.24176681099539, -290.97193516929258, 337.47938100317469, 490.28616284312966, -191.01981481864107, -325.73449650673871, -52.181983733634468); + double2x4 r3 = double2x4(-453.51761370170692, 93751.669973365249, -113658.28721911977, 141335.67284620318, -135978.32239641057, -2179.56771110594, -154683.64120283397, 26216.491290173308); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void double2x4_operator_mul_wide_scalar() + { + double2x4 a0 = double2x4(-96.318821236639678, -277.14229239017811, -239.93690191951436, 509.53140544776409, 255.85810172551226, 215.73149667295229, -455.50827500573746, -389.24327367788334); + double b0 = (-301.20720424373042); + double2x4 r0 = double2x4(29011.922860739887, 83477.255068544036, 72270.723422079071, -153474.5301092997, -77066.303503849529, -64979.880980175592, 137202.37402436248, 117242.87823519246); + TestUtils.AreEqual(r0, a0 * b0); + + double2x4 a1 = double2x4(-338.29248658674419, 243.75734459783757, 135.35469991311186, -207.35010275959507, -383.93960946795517, -31.425238862366086, 42.676120539510634, 260.38388049806645); + double b1 = (53.796284939067618); + double2x4 r1 = double2x4(-18198.879001166202, 13113.239565975766, 7281.5800043677564, -11154.665210200128, -20654.52463033246, -1690.5611041181071, 2295.81674063751, 14007.685428814115); + TestUtils.AreEqual(r1, a1 * b1); + + double2x4 a2 = double2x4(176.86755927692525, -290.50059689697838, 207.09101805793637, -156.52330858843555, -208.4020064847553, 370.94506400215676, -341.59844247512444, 10.270311121954705); + double b2 = (25.672123205695357); + double2x4 r2 = double2x4(4540.5657728478518, -7457.7671148672716, 5316.4661303762241, -4018.2856626453918, -5350.1219867907612, 9522.9473856079185, -8769.5573020950324, 263.66069248364448); + TestUtils.AreEqual(r2, a2 * b2); + + double2x4 a3 = double2x4(-176.88876565587185, 186.27978214355176, -487.65221785365242, -129.37681800191143, -317.71628990663044, -207.62735686433842, 388.87138933170183, -233.33533274072005); + double b3 = (-61.006107120311867); + double2x4 r3 = double2x4(10791.294985981862, -11364.204343797875, 29749.763439837578, 7892.7760179097013, 19382.634015911957, 12666.53677397305, -23723.529633594302, 14234.88030413398); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void double2x4_operator_mul_scalar_wide() + { + double a0 = (37.432166355397612); + double2x4 b0 = double2x4(96.747546479454058, 492.18539427788244, -274.05458534604617, -452.87096926796761, 420.85330434369541, 102.18292694081686, -114.94887762654054, -351.12003843445336); + double2x4 r0 = double2x4(3621.4702542954869, 18423.565556306661, -10258.456829132712, -16951.941459168724, 15753.450899411988, 3824.9283199300971, -4302.785509682908, -13143.183689392061); + TestUtils.AreEqual(r0, a0 * b0); + + double a1 = (-464.66496799172131); + double2x4 b1 = double2x4(444.08484646495663, 447.10525605040846, 130.82935124767448, -321.41334191030512, 445.30131861441828, 478.24357317306271, 358.57170622356784, -144.89011222910608); + double2x4 r1 = double2x4(-206350.67096824755, -207754.14949159342, -60791.816309878326, 149349.52023086412, -206915.92296063996, -222223.03462070762, -166615.71039511106, 67325.359361254479); + TestUtils.AreEqual(r1, a1 * b1); + + double a2 = (-438.89383741789209); + double2x4 b2 = double2x4(-3.536441089369589, -471.80755470311624, -42.560401697904069, 119.91104155402218, 271.9000023677479, 239.6840079946835, 487.44143389511919, -79.188288010278825); + double2x4 r2 = double2x4(1552.1222005157297, 207073.42820640272, 18679.498023240089, -52628.217176421109, -119335.23543311482, -105195.83403648737, -213935.04143870863, 34755.251603384531); + TestUtils.AreEqual(r2, a2 * b2); + + double a3 = (-112.92564468873928); + double2x4 b3 = double2x4(161.3700478828373, 459.75914332818195, -337.19599811043406, -276.83451689259823, 469.72386405883537, -274.56515110403541, 506.78586625810055, 65.882571966332648); + double2x4 r3 = double2x4(-18222.81669062213, -51918.597661877429, 38078.075473083678, 31261.716292192341, -53043.870174529715, 31005.446697484316, -57229.120666337207, -7439.831913050376); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void double2x4_operator_div_wide_wide() + { + double2x4 a0 = double2x4(-353.13144390337703, -102.79985456485292, 51.319128298814917, -191.87167868012176, 8.0418245829836223, -128.73764210973758, -136.05959779399427, -370.4710053738537); + double2x4 b0 = double2x4(-178.73954805114283, -302.09628381491467, -199.40583739029518, 278.85077561012042, 502.33758782890516, -361.48483078623417, 353.121059820578, -38.894930142394685); + double2x4 r0 = double2x4(1.97567604793504, 0.34028837848212429, -0.25736021056579439, -0.68808013268139567, 0.016008805189634039, 0.35613566917796119, -0.3853058151307277, 9.5249176182488586); + TestUtils.AreEqual(r0, a0 / b0); + + double2x4 a1 = double2x4(-237.69456326109105, -432.54687496300176, 200.26549181727012, 361.44157068871039, -416.22613234828509, -450.01919362042992, -273.49744594911925, -286.90817011841955); + double2x4 b1 = double2x4(-75.764737402910725, -195.21784719974636, -405.03399224068687, -394.2300085473014, -375.82771342612227, -121.24548655433836, 447.623344391409, 338.28628007429018); + double2x4 r1 = double2x4(3.1372716570909582, 2.2157137842034547, -0.49444119667433889, -0.9168291678773689, 1.1074918572499153, 3.7116366671409717, -0.61099906735420106, -0.84812239519560884); + TestUtils.AreEqual(r1, a1 / b1); + + double2x4 a2 = double2x4(-314.25606241554772, 177.76210340194507, 97.626988217992221, -68.107280047660367, -386.45074027890837, 263.69934690357161, -297.0270885420158, -501.77703046322659); + double2x4 b2 = double2x4(-405.54420752336466, -431.16893526127978, 296.20513095343722, 437.939790691221, 39.21061684527001, 331.2897075765253, -310.61955156485533, 207.26946959610541); + double2x4 r2 = double2x4(0.77489964493560781, -0.41227947763496636, 0.32959249525403717, -0.15551745124635385, -9.855767936625206, 0.79597808465769837, 0.95624080018671487, -2.420892143165184); + TestUtils.AreEqual(r2, a2 / b2); + + double2x4 a3 = double2x4(-263.40686071263946, -451.08085248017721, -416.34552903489464, -315.27873411554788, -28.181118739853218, -397.87015146662952, -261.38664376986526, 40.348221559239619); + double2x4 b3 = double2x4(-223.2929938879297, -480.091406807346, 448.67593666942605, -460.0974516626901, -220.56984601755153, -84.853158275062754, 441.3738078742166, 72.418480191574645); + double2x4 r3 = double2x4(1.1796467776541293, 0.93957285234474042, -0.92794263076704353, 0.68524338262731188, 0.12776505605218016, 4.6889256635195675, -0.59221149761645042, 0.55715366371267527); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void double2x4_operator_div_wide_scalar() + { + double2x4 a0 = double2x4(171.34242184988341, 0.10338377957384637, 57.888263967767443, -256.13074529177078, 95.6696842162263, -290.38690461329509, -127.44869118903239, -79.7448890580539); + double b0 = (171.79682191265601); + double2x4 r0 = double2x4(0.99735501473360411, 0.00060177934855167557, 0.33695771157628673, -1.4908933846400916, 0.55687691513214455, -1.6902926455818372, -0.74185709473618289, -0.46418139852783397); + TestUtils.AreEqual(r0, a0 / b0); + + double2x4 a1 = double2x4(146.46688110496234, 58.686315802245531, -453.20579859856787, -205.03382143985192, 481.73814247629514, 464.47907159499778, -293.46349753693841, -158.50557930697948); + double b1 = (-499.84355687529012); + double2x4 r1 = double2x4(-0.29302544584265894, -0.11740936738109768, 0.906695289685692, 0.41019598756377973, -0.96377783778552883, -0.92924889239071318, 0.587110693936897, 0.31711037809081188); + TestUtils.AreEqual(r1, a1 / b1); + + double2x4 a2 = double2x4(-289.5822156824089, 203.58342680874443, 180.97040160976837, 259.11918723728468, 460.84470603468117, 490.95625924084163, -280.47805536933151, -320.24387112271222); + double b2 = (494.12860535743118); + double2x4 r2 = double2x4(-0.58604624897791069, 0.41200494082199718, 0.3662414999812898, 0.5243962491300197, 0.93264122141102535, 0.99357991809785062, -0.5676215712434739, -0.64809822311554233); + TestUtils.AreEqual(r2, a2 / b2); + + double2x4 a3 = double2x4(192.41448912043802, 226.85298524929817, -192.23568949114332, 460.97652957447644, -437.89221760159927, -413.23271794488312, 249.47184693509337, 313.03501739773662); + double b3 = (264.80085885934568); + double2x4 r3 = double2x4(0.72663846314276059, 0.85669278501017143, -0.7259632401466386, 1.74084227505974, -1.6536661530776777, -1.5605414564171789, 0.94211116991733534, 1.1821525758872689); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void double2x4_operator_div_scalar_wide() + { + double a0 = (-264.44250095283729); + double2x4 b0 = double2x4(105.58908157497137, -142.34910137129441, -288.94890679463231, 39.644133824689334, -363.99138396046658, -149.71822006521666, -395.72912306139671, 258.71868693955184); + double2x4 r0 = double2x4(-2.5044492954044237, 1.85770404172122, 0.915187753732487, -6.670406827961755, 0.72650758398599513, 1.7662679988958405, 0.66824119212426392, -1.0221236976771717); + TestUtils.AreEqual(r0, a0 / b0); + + double a1 = (-9.6662514254759344); + double2x4 b1 = double2x4(117.72553282497711, -331.38655797177296, -509.98602676297821, 427.8964666928614, 467.61712882836218, -407.12461943511136, 252.69070994699871, 444.59937664708093); + double2x4 r1 = double2x4(-0.082108368452634473, 0.029169111398595994, 0.018953953477569365, -0.022590164158598314, -0.020671294590288436, 0.023742733708631857, -0.0382532916524846, -0.021741486680375892); + TestUtils.AreEqual(r1, a1 / b1); + + double a2 = (-88.313306134340053); + double2x4 b2 = double2x4(199.95503411067421, -218.34692607556792, -13.417186028052697, -296.13107575854804, 0.561349630617201, -289.29929865957206, 196.21833929615946, 334.73346845001606); + double2x4 r2 = double2x4(-0.44166583015588912, 0.40446324444144272, 6.5821034268805914, 0.29822370350063077, -157.32317492974929, 0.30526622962284194, -0.45007671785992226, -0.26383171824220319); + TestUtils.AreEqual(r2, a2 / b2); + + double a3 = (-282.39273203648293); + double2x4 b3 = double2x4(-479.50358436978587, -473.43943927876626, 105.0507777226394, -287.63127841038227, 77.299297130340392, -210.89436421678141, -184.0682357214709, -315.14843645465953); + double2x4 r3 = double2x4(0.588927259861119, 0.59647065412775435, -2.6881546063568527, 0.98178728543414817, -3.6532380308752153, 1.3390245542370554, 1.5341741660619548, 0.89606261485327354); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void double2x4_operator_mod_wide_wide() + { + double2x4 a0 = double2x4(-388.81249422059045, 181.68118842955732, -167.07872470052854, 432.82015319951813, -258.43895995730486, -170.11079629236406, 283.318293464984, 122.71651297561664); + double2x4 b0 = double2x4(436.94417187056695, 58.940049437312382, -201.11623368091705, 279.2893537391393, -397.07975954426445, 377.89994758083481, 174.69386657266591, -228.17652736798698); + double2x4 r0 = double2x4(-388.81249422059045, 4.8610401176201776, -167.07872470052854, 153.53079946037883, -258.43895995730486, -170.11079629236406, 108.62442689231807, 122.71651297561664); + TestUtils.AreEqual(r0, a0 % b0); + + double2x4 a1 = double2x4(335.27101413126616, -503.60851668920765, 191.02251848532933, 289.74269379756538, -124.03371745163281, 259.27395761165485, -274.35845030208975, -140.03080398404541); + double2x4 b1 = double2x4(-317.06019106370405, -417.48011107811709, -249.9759434433542, -397.57157177364991, -358.74544947163452, -198.1592100589346, 208.73709378425826, -12.119406944196385); + double2x4 r1 = double2x4(18.210823067562103, -86.128405611090557, 191.02251848532933, 289.74269379756538, -124.03371745163281, 61.114747552720246, -65.621356517831487, -6.7173275978851734); + TestUtils.AreEqual(r1, a1 % b1); + + double2x4 a2 = double2x4(324.5775689205982, -200.51308903494527, 211.42317328761476, -51.272212767634642, -230.63392483006879, 99.989400671790122, 399.18986649028489, 24.903281461868119); + double2x4 b2 = double2x4(25.27141596063575, -194.12068495253135, -493.8717965995296, -312.3016990685378, -216.98060546488529, 413.57096047586344, -436.39440151508637, 3.4912750737235); + double2x4 r2 = double2x4(21.3205773929692, -6.3924040824139183, 211.42317328761476, -51.272212767634642, -13.653319365183506, 99.989400671790122, 399.18986649028489, 0.46435594580361794); + TestUtils.AreEqual(r2, a2 % b2); + + double2x4 a3 = double2x4(50.92402961241271, -364.86367886367429, -252.62662398658068, -281.28977955565313, -364.79852192699843, -329.02623311105475, 51.6098087074281, 41.647804041229051); + double2x4 b3 = double2x4(-308.23343076754054, -441.37506195594324, 84.6008532441225, 373.16344922276369, 67.252760203207231, -320.33327522889397, 118.97936325845274, 44.823946258436877); + double2x4 r3 = double2x4(50.92402961241271, -364.86367886367429, -83.424917498335674, -281.28977955565313, -28.534720910962278, -8.6929578821607834, 51.6098087074281, 41.647804041229051); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void double2x4_operator_mod_wide_scalar() + { + double2x4 a0 = double2x4(-244.49962889612635, -211.81931958525411, -145.92677576184587, -304.91822090042672, 155.47946436492703, -133.90778428591221, 281.30965412841624, -226.53575311719243); + double b0 = (39.634963769295723); + double2x4 r0 = double2x4(-6.6898462803520147, -13.644500738775491, -27.021884453958705, -27.473474515356656, 36.574573057039856, -15.002892978025045, 3.86490774334618, -28.360934270713813); + TestUtils.AreEqual(r0, a0 % b0); + + double2x4 a1 = double2x4(335.16613046041039, 319.47152033423606, -285.40231646476423, -355.84685985923136, 259.37800061860025, -330.87193957477433, -284.34358109363518, -102.68343811048356); + double b1 = (101.70649032560482); + double2x4 r1 = double2x4(30.046659483595931, 14.352049357421606, -81.98933581355459, -50.7273888824169, 55.965019967390617, -25.752468597959876, -80.930600442425543, -0.976947784878746); + TestUtils.AreEqual(r1, a1 % b1); + + double2x4 a2 = double2x4(-172.14173921017988, -416.71365447375626, -339.256669917729, 435.29751440291182, 132.55290490600885, 226.94410215455298, -306.11827268550093, 115.43844633709568); + double b2 = (206.41684517935698); + double2x4 r2 = double2x4(-172.14173921017988, -3.8799641150422985, -132.83982473837204, 22.46382404419785, 132.55290490600885, 20.527256975195996, -99.701427506143943, 115.43844633709568); + TestUtils.AreEqual(r2, a2 % b2); + + double2x4 a3 = double2x4(281.88292015804109, -140.04050237501065, -462.32346961569203, -211.60869822819188, 351.33104555277669, 321.04701176334504, 346.08518497370426, -94.407745643708722); + double b3 = (-218.3474491659307); + double2x4 r3 = double2x4(63.53547099211039, -140.04050237501065, -25.628571283830638, -211.60869822819188, 132.983596386846, 102.69956259741434, 127.73773580777356, -94.407745643708722); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void double2x4_operator_mod_scalar_wide() + { + double a0 = (-66.945025236785909); + double2x4 b0 = double2x4(-249.77609479137516, -396.07375664081133, 386.49204582091977, 168.93948109864232, -199.4182442163202, 261.7517141130528, 16.127438791155555, 257.66814744550186); + double2x4 r0 = double2x4(-66.945025236785909, -66.945025236785909, -66.945025236785909, -66.945025236785909, -66.945025236785909, -66.945025236785909, -2.4352700721636893, -66.945025236785909); + TestUtils.AreEqual(r0, a0 % b0); + + double a1 = (-75.788451945310669); + double2x4 b1 = double2x4(170.95630439136005, -242.85828005655588, 425.94531913564788, 303.27240409668184, 3.033060790520608, -505.74352788633831, 461.95706126743789, 205.97275672013529); + double2x4 r1 = double2x4(-75.788451945310669, -75.788451945310669, -75.788451945310669, -75.788451945310669, -2.9949929728160782, -75.788451945310669, -75.788451945310669, -75.788451945310669); + TestUtils.AreEqual(r1, a1 % b1); + + double a2 = (270.04063642678807); + double2x4 b2 = double2x4(-47.480711720642034, -150.254496405951, 149.49949009227544, -220.29804263836616, 31.118842377848409, 400.63568348467152, 6.2314283876826266, -39.050740021770252); + double2x4 r2 = double2x4(32.6370778235779, 119.78614002083708, 120.54114633451263, 49.742593788421914, 21.089897404000794, 270.04063642678807, 2.0892157564351237, 35.736196296166554); + TestUtils.AreEqual(r2, a2 % b2); + + double a3 = (-71.941097054603063); + double2x4 b3 = double2x4(-495.30713843521994, -86.71961859926563, -436.97006365143233, -472.2947320753218, -130.00875359867177, -251.51684605866524, 281.97637022751212, 388.86081928241106); + double2x4 r3 = double2x4(-71.941097054603063, -71.941097054603063, -71.941097054603063, -71.941097054603063, -71.941097054603063, -71.941097054603063, -71.941097054603063, -71.941097054603063); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void double2x4_operator_plus() + { + double2x4 a0 = double2x4(-418.82956357432045, -405.79894823851015, -34.041791216489742, 236.99924456188421, -459.83910129025537, 210.8614223985287, 293.74197902052754, -373.015422279488); + double2x4 r0 = double2x4(-418.82956357432045, -405.79894823851015, -34.041791216489742, 236.99924456188421, -459.83910129025537, 210.8614223985287, 293.74197902052754, -373.015422279488); + TestUtils.AreEqual(r0, +a0); + + double2x4 a1 = double2x4(-386.059833944803, -418.64524932328857, 504.47483062393724, -170.74650843941907, 439.55937572920664, -478.74939916969714, 116.40075665172219, 421.40964742256779); + double2x4 r1 = double2x4(-386.059833944803, -418.64524932328857, 504.47483062393724, -170.74650843941907, 439.55937572920664, -478.74939916969714, 116.40075665172219, 421.40964742256779); + TestUtils.AreEqual(r1, +a1); + + double2x4 a2 = double2x4(-258.5960806620289, 124.16434031546316, 222.17254386757156, -65.949277193261878, 239.04183947250328, 498.4495329793773, -139.382530515726, 279.07295549990283); + double2x4 r2 = double2x4(-258.5960806620289, 124.16434031546316, 222.17254386757156, -65.949277193261878, 239.04183947250328, 498.4495329793773, -139.382530515726, 279.07295549990283); + TestUtils.AreEqual(r2, +a2); + + double2x4 a3 = double2x4(108.7758186370022, 136.81214934997831, -236.03003965878395, -440.3083276414817, 342.2791270419392, 102.4722116470673, -161.454825714908, -355.27087919566355); + double2x4 r3 = double2x4(108.7758186370022, 136.81214934997831, -236.03003965878395, -440.3083276414817, 342.2791270419392, 102.4722116470673, -161.454825714908, -355.27087919566355); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void double2x4_operator_neg() + { + double2x4 a0 = double2x4(148.46174890755753, -467.12267873581624, 132.04719954917539, 183.52262290917463, 473.7010145009034, -407.99109024926605, -54.958759571872065, -382.98981803608581); + double2x4 r0 = double2x4(-148.46174890755753, 467.12267873581624, -132.04719954917539, -183.52262290917463, -473.7010145009034, 407.99109024926605, 54.958759571872065, 382.98981803608581); + TestUtils.AreEqual(r0, -a0); + + double2x4 a1 = double2x4(-299.09338893512887, 407.70980305583669, 168.73550351370852, 466.44152829909763, 171.90249474900895, -280.55831564616335, -78.85761622286293, 318.69633522569029); + double2x4 r1 = double2x4(299.09338893512887, -407.70980305583669, -168.73550351370852, -466.44152829909763, -171.90249474900895, 280.55831564616335, 78.85761622286293, -318.69633522569029); + TestUtils.AreEqual(r1, -a1); + + double2x4 a2 = double2x4(-39.91539694737429, 132.19563180403577, -505.89525127126615, 410.38058466947666, -237.05693375182193, -137.617827241131, -245.34998547534923, 422.52133222227974); + double2x4 r2 = double2x4(39.91539694737429, -132.19563180403577, 505.89525127126615, -410.38058466947666, 237.05693375182193, 137.617827241131, 245.34998547534923, -422.52133222227974); + TestUtils.AreEqual(r2, -a2); + + double2x4 a3 = double2x4(-434.57134386271764, -466.56631515294606, 426.89450116962871, 146.64955885086658, -391.37208408460583, 423.23773809114368, 254.29757296959758, -114.84889536483627); + double2x4 r3 = double2x4(434.57134386271764, 466.56631515294606, -426.89450116962871, -146.64955885086658, 391.37208408460583, -423.23773809114368, -254.29757296959758, 114.84889536483627); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void double2x4_operator_prefix_inc() + { + double2x4 a0 = double2x4(-139.84208137348389, -56.743654039103376, -381.955324589254, 509.79634380237962, -222.89634452708827, 210.31986556310198, -392.73151058365193, -300.19410218866267); + double2x4 r0 = double2x4(-138.84208137348389, -55.743654039103376, -380.955324589254, 510.79634380237962, -221.89634452708827, 211.31986556310198, -391.73151058365193, -299.19410218866267); + TestUtils.AreEqual(r0, ++a0); + + double2x4 a1 = double2x4(362.21273939787068, 130.90919429199266, -450.23016402229212, 243.54693114177644, 46.19202735190845, -41.497298975241051, 299.18547000511808, 154.35656530892311); + double2x4 r1 = double2x4(363.21273939787068, 131.90919429199266, -449.23016402229212, 244.54693114177644, 47.19202735190845, -40.497298975241051, 300.18547000511808, 155.35656530892311); + TestUtils.AreEqual(r1, ++a1); + + double2x4 a2 = double2x4(-281.23327435237974, 92.957765384091886, 448.60215565590283, -295.58701171334229, 18.499063262016989, -215.71113381893895, 471.94723651928234, 257.07660090973445); + double2x4 r2 = double2x4(-280.23327435237974, 93.957765384091886, 449.60215565590283, -294.58701171334229, 19.499063262016989, -214.71113381893895, 472.94723651928234, 258.07660090973445); + TestUtils.AreEqual(r2, ++a2); + + double2x4 a3 = double2x4(41.625937719655212, 243.00478588929627, -472.61902330472088, -125.7202084649914, -477.45955227197129, 9.8914859340952717, -76.922842299995409, -29.767583622488928); + double2x4 r3 = double2x4(42.625937719655212, 244.00478588929627, -471.61902330472088, -124.7202084649914, -476.45955227197129, 10.891485934095272, -75.922842299995409, -28.767583622488928); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void double2x4_operator_postfix_inc() + { + double2x4 a0 = double2x4(-396.6697396695007, 511.20749378167443, 249.11127030528678, -128.81731301584153, -259.49027669592306, 278.00817764830219, -81.393423356764686, 66.719732554033271); + double2x4 r0 = double2x4(-396.6697396695007, 511.20749378167443, 249.11127030528678, -128.81731301584153, -259.49027669592306, 278.00817764830219, -81.393423356764686, 66.719732554033271); + TestUtils.AreEqual(r0, a0++); + + double2x4 a1 = double2x4(167.85212691493894, -326.10758486674524, 41.033564825092185, 128.5304239394751, 73.155582223625629, -60.132380275117384, -446.22976490772783, -296.93783797739906); + double2x4 r1 = double2x4(167.85212691493894, -326.10758486674524, 41.033564825092185, 128.5304239394751, 73.155582223625629, -60.132380275117384, -446.22976490772783, -296.93783797739906); + TestUtils.AreEqual(r1, a1++); + + double2x4 a2 = double2x4(267.29380071689081, 49.200223230384381, -326.64314738225335, -510.86424064583343, 471.64748762159024, -171.01308186865089, 310.72735967800361, -298.91717185588425); + double2x4 r2 = double2x4(267.29380071689081, 49.200223230384381, -326.64314738225335, -510.86424064583343, 471.64748762159024, -171.01308186865089, 310.72735967800361, -298.91717185588425); + TestUtils.AreEqual(r2, a2++); + + double2x4 a3 = double2x4(489.98497008252184, 290.69102896875279, 117.1923401901463, 164.44293578175962, 412.36778874526158, -229.38657079887884, 239.59693848322934, 36.624316947825378); + double2x4 r3 = double2x4(489.98497008252184, 290.69102896875279, 117.1923401901463, 164.44293578175962, 412.36778874526158, -229.38657079887884, 239.59693848322934, 36.624316947825378); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void double2x4_operator_prefix_dec() + { + double2x4 a0 = double2x4(123.12869626056806, 256.8437465433235, 156.33078844674435, 461.73742530389563, 325.86799755965728, 392.01561731473339, 187.87412580655609, -236.2252043393558); + double2x4 r0 = double2x4(122.12869626056806, 255.8437465433235, 155.33078844674435, 460.73742530389563, 324.86799755965728, 391.01561731473339, 186.87412580655609, -237.2252043393558); + TestUtils.AreEqual(r0, --a0); + + double2x4 a1 = double2x4(125.10963517292851, 45.536655685648611, 376.04684680329956, -363.07547991493504, -22.028951416736902, 248.79012667797042, 168.0950144120003, 168.26565011230559); + double2x4 r1 = double2x4(124.10963517292851, 44.536655685648611, 375.04684680329956, -364.07547991493504, -23.028951416736902, 247.79012667797042, 167.0950144120003, 167.26565011230559); + TestUtils.AreEqual(r1, --a1); + + double2x4 a2 = double2x4(-190.284744112885, 183.95795854551625, 485.69469259944492, -460.73930261132273, 89.569894117102876, -267.42982090051743, 201.75623450137505, -141.21688682456357); + double2x4 r2 = double2x4(-191.284744112885, 182.95795854551625, 484.69469259944492, -461.73930261132273, 88.569894117102876, -268.42982090051743, 200.75623450137505, -142.21688682456357); + TestUtils.AreEqual(r2, --a2); + + double2x4 a3 = double2x4(-217.48409782046645, -213.54412732531506, 180.74062570405226, -128.31251412644633, 478.04553888647149, -454.56614062495817, -386.89835256473083, 387.85698408068015); + double2x4 r3 = double2x4(-218.48409782046645, -214.54412732531506, 179.74062570405226, -129.31251412644633, 477.04553888647149, -455.56614062495817, -387.89835256473083, 386.85698408068015); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void double2x4_operator_postfix_dec() + { + double2x4 a0 = double2x4(379.68831723727669, 302.69287814884115, -176.07134040448409, -291.25267066212962, 470.56758401848731, -402.92594666170231, -63.655158787805192, 355.26110069605568); + double2x4 r0 = double2x4(379.68831723727669, 302.69287814884115, -176.07134040448409, -291.25267066212962, 470.56758401848731, -402.92594666170231, -63.655158787805192, 355.26110069605568); + TestUtils.AreEqual(r0, a0--); + + double2x4 a1 = double2x4(-27.889220489137415, 156.14034969924967, 479.94519613680677, -200.30429491787419, -445.0269393609031, 407.42034907239508, 327.67032519340069, 48.0602071509046); + double2x4 r1 = double2x4(-27.889220489137415, 156.14034969924967, 479.94519613680677, -200.30429491787419, -445.0269393609031, 407.42034907239508, 327.67032519340069, 48.0602071509046); + TestUtils.AreEqual(r1, a1--); + + double2x4 a2 = double2x4(-209.66798100698179, 283.941595924991, -94.802087112703418, 152.51066334196867, -287.262531175866, -215.94803939384781, -407.04635567546188, 159.23357136511879); + double2x4 r2 = double2x4(-209.66798100698179, 283.941595924991, -94.802087112703418, 152.51066334196867, -287.262531175866, -215.94803939384781, -407.04635567546188, 159.23357136511879); + TestUtils.AreEqual(r2, a2--); + + double2x4 a3 = double2x4(-359.45648663093175, -278.93379868144814, 289.91284073978329, 402.03954691534841, 470.71654937729079, -208.56061873611094, 145.89674789546837, -296.79095258228062); + double2x4 r3 = double2x4(-359.45648663093175, -278.93379868144814, 289.91284073978329, 402.03954691534841, 470.71654937729079, -208.56061873611094, 145.89674789546837, -296.79095258228062); + TestUtils.AreEqual(r3, a3--); + } + + [TestCase /* For player builds */] + public static void double2x4_EqualsObjectOverride() + { + TestUtils.IsFalse(new double2x4().Equals((object)new int())); + TestUtils.IsTrue(new double2x4().Equals((object)new double2x4())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestDouble2x4.gen.cs.meta b/src/Tests/Tests/Shared/TestDouble2x4.gen.cs.meta new file mode 100644 index 00000000..1c44a3ff --- /dev/null +++ b/src/Tests/Tests/Shared/TestDouble2x4.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 93f2834619d034346a15285ea2156089 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestDouble3.gen.cs b/src/Tests/Tests/Shared/TestDouble3.gen.cs new file mode 100644 index 00000000..59b1478b --- /dev/null +++ b/src/Tests/Tests/Shared/TestDouble3.gen.cs @@ -0,0 +1,1069 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestDouble3 + { + [TestCompiler] + public static void double3_zero() + { + TestUtils.AreEqual(0.0, double3.zero.x); + TestUtils.AreEqual(0.0, double3.zero.y); + TestUtils.AreEqual(0.0, double3.zero.z); + } + + [TestCompiler] + public static void double3_constructor() + { + double3 a = new double3(1, 2, 3); + TestUtils.AreEqual(1, a.x); + TestUtils.AreEqual(2, a.y); + TestUtils.AreEqual(3, a.z); + } + + [TestCompiler] + public static void double3_scalar_constructor() + { + double3 a = new double3(17.0); + TestUtils.AreEqual(17.0, a.x); + TestUtils.AreEqual(17.0, a.y); + TestUtils.AreEqual(17.0, a.z); + } + + [TestCompiler] + public static void double3_static_constructor() + { + double3 a = double3(1, 2, 3); + TestUtils.AreEqual(1, a.x); + TestUtils.AreEqual(2, a.y); + TestUtils.AreEqual(3, a.z); + } + + [TestCompiler] + public static void double3_static_scalar_constructor() + { + double3 a = double3(17.0); + TestUtils.AreEqual(17.0, a.x); + TestUtils.AreEqual(17.0, a.y); + TestUtils.AreEqual(17.0, a.z); + } + + [TestCompiler] + public static void double3_operator_equal_wide_wide() + { + double3 a0 = double3(492.15758275061728, -495.20632027797694, 227.45765195947968); + double3 b0 = double3(192.56880888369346, -235.61102472786376, -254.04311740307281); + bool3 r0 = bool3(false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + double3 a1 = double3(-147.37405950733182, -222.68201909897942, 64.093720704360749); + double3 b1 = double3(-412.62472052715009, 471.90480945627428, -6.4727852374654162); + bool3 r1 = bool3(false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + double3 a2 = double3(-23.890404473939157, -16.8197190839889, 163.23210890741655); + double3 b2 = double3(-339.10237447316865, 488.1875700839737, -379.5965842584132); + bool3 r2 = bool3(false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + double3 a3 = double3(-165.27101071424363, 470.87767980568003, -423.94255967808078); + double3 b3 = double3(-308.41700258311675, -82.333374300195544, -102.92108087563935); + bool3 r3 = bool3(false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void double3_operator_equal_wide_scalar() + { + double3 a0 = double3(-303.2300766926399, 451.52631327674089, -253.65587413201848); + double b0 = (123.5445759871717); + bool3 r0 = bool3(false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + double3 a1 = double3(-105.20363502632995, -426.19248338518315, 159.87609656149334); + double b1 = (-500.6910920090466); + bool3 r1 = bool3(false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + double3 a2 = double3(-59.558379439431405, -182.04973968400139, 406.51375861024189); + double b2 = (-57.477391031327386); + bool3 r2 = bool3(false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + double3 a3 = double3(370.88599866017978, 455.40001198993991, -11.338988547836891); + double b3 = (-172.03530629539642); + bool3 r3 = bool3(false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void double3_operator_equal_scalar_wide() + { + double a0 = (-253.39728534100453); + double3 b0 = double3(19.952187785856495, -185.79199346610903, 407.8136052600172); + bool3 r0 = bool3(false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + double a1 = (-87.2766969610363); + double3 b1 = double3(-206.27469382354741, 160.503138855334, -274.77081478516141); + bool3 r1 = bool3(false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + double a2 = (-2.6315281403397535); + double3 b2 = double3(448.35453602688131, -410.03524251004461, 247.32901465489022); + bool3 r2 = bool3(false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + double a3 = (355.53915350303942); + double3 b3 = double3(-298.06671180299793, 414.10151429385951, -481.30262707234482); + bool3 r3 = bool3(false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void double3_operator_not_equal_wide_wide() + { + double3 a0 = double3(430.8425316432689, 104.69001798736394, 225.80243478799355); + double3 b0 = double3(210.02470622305975, -55.203330304102678, -269.92533672504373); + bool3 r0 = bool3(true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + double3 a1 = double3(-310.57017841496048, -418.61945815506363, 304.12820281839379); + double3 b1 = double3(-234.54673372700194, 25.917412054686565, -63.726991444699024); + bool3 r1 = bool3(true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + double3 a2 = double3(-509.32682561749908, -160.53807719076895, -203.30197606016975); + double3 b2 = double3(-484.55371092471933, -425.333599050219, -53.274394775402925); + bool3 r2 = bool3(true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + double3 a3 = double3(-505.76325368590807, 162.17220623892365, 1.1561973100324394); + double3 b3 = double3(328.1944192984115, 15.963139303011417, 461.71412417931208); + bool3 r3 = bool3(true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void double3_operator_not_equal_wide_scalar() + { + double3 a0 = double3(-16.914588697680529, 168.83411486858233, -462.71352145760949); + double b0 = (-145.37277109239847); + bool3 r0 = bool3(true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + double3 a1 = double3(130.30776959765137, -440.26328178879959, -197.12796053529155); + double b1 = (214.50161443208424); + bool3 r1 = bool3(true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + double3 a2 = double3(-169.09985860115842, -281.02101362916687, -270.26885593601912); + double b2 = (-386.61117595555783); + bool3 r2 = bool3(true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + double3 a3 = double3(-403.96372313236992, 299.65422763473089, -71.750904831919286); + double b3 = (-269.80570877241234); + bool3 r3 = bool3(true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void double3_operator_not_equal_scalar_wide() + { + double a0 = (275.79582823244664); + double3 b0 = double3(-57.196896341255353, -382.4325279586169, 97.820359990848374); + bool3 r0 = bool3(true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + double a1 = (-161.46364529499022); + double3 b1 = double3(-458.39563367254829, -499.61786364932448, 327.92217818271467); + bool3 r1 = bool3(true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + double a2 = (367.57121699283425); + double3 b2 = double3(59.7863667289663, -209.58068118318016, -62.580453186566217); + bool3 r2 = bool3(true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + double a3 = (-479.97497604786184); + double3 b3 = double3(-49.494519495169868, -114.68521338081229, 109.93924599044919); + bool3 r3 = bool3(true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void double3_operator_less_wide_wide() + { + double3 a0 = double3(196.84256825076534, 336.40979997087732, 251.96372115424072); + double3 b0 = double3(-465.34502313348696, -256.15239751346053, -314.814018634527); + bool3 r0 = bool3(false, false, false); + TestUtils.AreEqual(r0, a0 < b0); + + double3 a1 = double3(257.65591466503963, 430.04588647840819, -62.419644146421774); + double3 b1 = double3(364.56673662949663, 100.21050290959442, 182.56098636545289); + bool3 r1 = bool3(true, false, true); + TestUtils.AreEqual(r1, a1 < b1); + + double3 a2 = double3(8.8392293494376872, -333.81671563434259, 164.67880662003472); + double3 b2 = double3(3.116978885194726, -259.43047893207074, -437.33490749696966); + bool3 r2 = bool3(false, true, false); + TestUtils.AreEqual(r2, a2 < b2); + + double3 a3 = double3(-350.94487516532877, 3.84143662631584, 125.40972024081725); + double3 b3 = double3(-456.0437321402336, -394.2559718537405, 401.91369099259077); + bool3 r3 = bool3(false, false, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void double3_operator_less_wide_scalar() + { + double3 a0 = double3(-132.05731708000292, -192.46500477216438, -66.834607870706634); + double b0 = (-156.01021845452965); + bool3 r0 = bool3(false, true, false); + TestUtils.AreEqual(r0, a0 < b0); + + double3 a1 = double3(-379.01750081545561, 20.927834282129879, -158.24074537970159); + double b1 = (-360.28242199508588); + bool3 r1 = bool3(true, false, false); + TestUtils.AreEqual(r1, a1 < b1); + + double3 a2 = double3(437.34587522845061, 225.29148517609178, 307.48418607725023); + double b2 = (-20.452607402788772); + bool3 r2 = bool3(false, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + double3 a3 = double3(274.01523292903562, 398.52368301829495, 105.0301654827922); + double b3 = (373.54965584983563); + bool3 r3 = bool3(true, false, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void double3_operator_less_scalar_wide() + { + double a0 = (-423.117411095238); + double3 b0 = double3(385.09483617595151, -123.93348532725753, 86.376572887588509); + bool3 r0 = bool3(true, true, true); + TestUtils.AreEqual(r0, a0 < b0); + + double a1 = (133.44217378154497); + double3 b1 = double3(161.45794947513286, 229.75426660746064, 222.57159934871436); + bool3 r1 = bool3(true, true, true); + TestUtils.AreEqual(r1, a1 < b1); + + double a2 = (315.53116360098647); + double3 b2 = double3(-447.20351883731945, 271.83385790131695, -393.60531324595462); + bool3 r2 = bool3(false, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + double a3 = (317.48689737798964); + double3 b3 = double3(-164.6051085761772, -282.87605370342544, 296.97953071118309); + bool3 r3 = bool3(false, false, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void double3_operator_greater_wide_wide() + { + double3 a0 = double3(483.50140141113729, 310.81563415695712, 106.9661896726891); + double3 b0 = double3(-471.39802454011425, -371.98528617060992, 36.900723236101044); + bool3 r0 = bool3(true, true, true); + TestUtils.AreEqual(r0, a0 > b0); + + double3 a1 = double3(295.73526038589671, 116.95757179938141, -478.29977653841479); + double3 b1 = double3(-316.76360407320954, 19.683055648432628, 207.3091381561519); + bool3 r1 = bool3(true, true, false); + TestUtils.AreEqual(r1, a1 > b1); + + double3 a2 = double3(-14.897393471979228, -33.817441717636484, -24.740548383789417); + double3 b2 = double3(362.79748861994483, 324.95341816775192, 340.94807140014507); + bool3 r2 = bool3(false, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + double3 a3 = double3(319.78262701620474, -120.15856581561201, -289.00857962714906); + double3 b3 = double3(25.986035120666997, -114.2111352021858, 240.80346428640348); + bool3 r3 = bool3(true, false, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void double3_operator_greater_wide_scalar() + { + double3 a0 = double3(64.317918092160426, -397.70346445483318, 431.87690826499693); + double b0 = (305.85991992888034); + bool3 r0 = bool3(false, false, true); + TestUtils.AreEqual(r0, a0 > b0); + + double3 a1 = double3(85.702980796668157, 197.49155602114809, 286.1994608781298); + double b1 = (246.26305233978803); + bool3 r1 = bool3(false, false, true); + TestUtils.AreEqual(r1, a1 > b1); + + double3 a2 = double3(280.81334818564972, 171.56538661362856, -241.80727326209063); + double b2 = (-405.78459210218148); + bool3 r2 = bool3(true, true, true); + TestUtils.AreEqual(r2, a2 > b2); + + double3 a3 = double3(333.57817498481745, -413.70138116073861, -356.5923551789449); + double b3 = (370.27919524269146); + bool3 r3 = bool3(false, false, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void double3_operator_greater_scalar_wide() + { + double a0 = (-282.67049635698572); + double3 b0 = double3(358.09997360692353, -72.5964134077525, -232.16380106292843); + bool3 r0 = bool3(false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + double a1 = (-60.706723956720282); + double3 b1 = double3(75.156642710397364, 150.88350040786133, 339.53917924479538); + bool3 r1 = bool3(false, false, false); + TestUtils.AreEqual(r1, a1 > b1); + + double a2 = (-498.19602965665797); + double3 b2 = double3(459.74610326241054, -227.96872316485678, 335.86213485145106); + bool3 r2 = bool3(false, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + double a3 = (76.178844248959308); + double3 b3 = double3(296.85993899817572, 177.49000390688423, -281.20120657663847); + bool3 r3 = bool3(false, false, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void double3_operator_less_equal_wide_wide() + { + double3 a0 = double3(-438.52313753521219, 210.48942837980087, 4.8773329280677444); + double3 b0 = double3(-474.8141498392514, 304.3710555063426, 234.8241737982371); + bool3 r0 = bool3(false, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + double3 a1 = double3(-137.29793817237857, 156.09410174009111, -363.92412035722475); + double3 b1 = double3(-390.48543209139513, -297.17535295019638, -326.29239121372461); + bool3 r1 = bool3(false, false, true); + TestUtils.AreEqual(r1, a1 <= b1); + + double3 a2 = double3(-97.948485181642923, 437.29539009430232, 458.53029153241323); + double3 b2 = double3(107.2538764976216, -413.13107342884462, 67.094432623635271); + bool3 r2 = bool3(true, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + double3 a3 = double3(-294.06474675520542, 23.622613679441884, -34.284056441059363); + double3 b3 = double3(470.07522724106684, -84.499104777583455, 392.78422683886447); + bool3 r3 = bool3(true, false, true); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void double3_operator_less_equal_wide_scalar() + { + double3 a0 = double3(193.4958237118534, 168.91555197952107, -313.9930695565385); + double b0 = (443.85054299042122); + bool3 r0 = bool3(true, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + double3 a1 = double3(81.826965131716292, -0.35819602029312136, 241.36115776810846); + double b1 = (18.503590830836288); + bool3 r1 = bool3(false, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + double3 a2 = double3(-463.81641242644582, -268.89945591096739, 398.9919504593089); + double b2 = (-1.3577692515020203); + bool3 r2 = bool3(true, true, false); + TestUtils.AreEqual(r2, a2 <= b2); + + double3 a3 = double3(-471.253072242836, 82.258299150624453, 11.246050124636895); + double b3 = (-264.93778264938749); + bool3 r3 = bool3(true, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void double3_operator_less_equal_scalar_wide() + { + double a0 = (393.60626644343427); + double3 b0 = double3(-75.688363825757222, -44.2638714519627, 125.86491566797019); + bool3 r0 = bool3(false, false, false); + TestUtils.AreEqual(r0, a0 <= b0); + + double a1 = (191.96488174794467); + double3 b1 = double3(13.543054825413492, -197.0519259893577, -423.945100743298); + bool3 r1 = bool3(false, false, false); + TestUtils.AreEqual(r1, a1 <= b1); + + double a2 = (-330.04861680141119); + double3 b2 = double3(420.16553779140372, 105.54730777887039, 174.82126363311954); + bool3 r2 = bool3(true, true, true); + TestUtils.AreEqual(r2, a2 <= b2); + + double a3 = (296.71757831085358); + double3 b3 = double3(-469.70041845259277, 123.26718979853536, 112.9969695140594); + bool3 r3 = bool3(false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void double3_operator_greater_equal_wide_wide() + { + double3 a0 = double3(-507.92858409692, 504.49748181947393, -385.43449205226938); + double3 b0 = double3(-81.346509732933043, 297.66615047010885, 171.06540616371922); + bool3 r0 = bool3(false, true, false); + TestUtils.AreEqual(r0, a0 >= b0); + + double3 a1 = double3(-262.32340944107784, -37.550928848586466, -111.59527759980193); + double3 b1 = double3(-431.03805538222105, -6.859075311040101, 319.72570362674333); + bool3 r1 = bool3(true, false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + double3 a2 = double3(-463.70202157632542, 387.44885772627265, 456.96878573716094); + double3 b2 = double3(254.079170106947, 396.5724000393285, 178.83927615864172); + bool3 r2 = bool3(false, false, true); + TestUtils.AreEqual(r2, a2 >= b2); + + double3 a3 = double3(-211.01015506079892, 182.41135391146474, -53.596053863687473); + double3 b3 = double3(-447.06336304501787, 288.49268569075161, 474.88929460704765); + bool3 r3 = bool3(true, false, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void double3_operator_greater_equal_wide_scalar() + { + double3 a0 = double3(465.15218732559686, -424.8860745024337, -209.22109685150025); + double b0 = (-5.5998842742293391); + bool3 r0 = bool3(true, false, false); + TestUtils.AreEqual(r0, a0 >= b0); + + double3 a1 = double3(58.779852656079356, 140.12558252183976, 16.353385694489475); + double b1 = (-302.26910533675414); + bool3 r1 = bool3(true, true, true); + TestUtils.AreEqual(r1, a1 >= b1); + + double3 a2 = double3(-344.55997316192838, -315.70155086913218, 441.0115565923096); + double b2 = (393.27804846003562); + bool3 r2 = bool3(false, false, true); + TestUtils.AreEqual(r2, a2 >= b2); + + double3 a3 = double3(-509.78156757251435, 494.82028865014217, -164.97393830352183); + double b3 = (-36.994287269652943); + bool3 r3 = bool3(false, true, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void double3_operator_greater_equal_scalar_wide() + { + double a0 = (374.82703393270594); + double3 b0 = double3(-1.609757185731894, 338.61524049314448, -116.18140392945213); + bool3 r0 = bool3(true, true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + double a1 = (-332.15732375353451); + double3 b1 = double3(-355.9793509710484, -468.90144107719021, 38.579884785497484); + bool3 r1 = bool3(true, true, false); + TestUtils.AreEqual(r1, a1 >= b1); + + double a2 = (-332.34754697063357); + double3 b2 = double3(2.8901150240051265, 467.77776477661814, 121.40638762405445); + bool3 r2 = bool3(false, false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + double a3 = (-305.02337303060267); + double3 b3 = double3(-58.428812292604164, -226.51955209789776, -47.020994446715804); + bool3 r3 = bool3(false, false, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void double3_operator_add_wide_wide() + { + double3 a0 = double3(506.12905263627374, -501.77980803967444, 420.08479638587903); + double3 b0 = double3(-28.757987751047096, -337.135153689019, -340.676816860529); + double3 r0 = double3(477.37106488522664, -838.91496172869347, 79.407979525350015); + TestUtils.AreEqual(r0, a0 + b0); + + double3 a1 = double3(-186.03206476291274, -9.3123953385801883, 328.51179686585056); + double3 b1 = double3(152.31202633320913, 423.66745420157326, 90.374096674087468); + double3 r1 = double3(-33.720038429703607, 414.35505886299308, 418.885893539938); + TestUtils.AreEqual(r1, a1 + b1); + + double3 a2 = double3(424.34407659263536, 87.791079800478656, 462.41368148402012); + double3 b2 = double3(376.18866246574964, 1.7671887882831925, -120.18586045139745); + double3 r2 = double3(800.532739058385, 89.558268588761848, 342.22782103262267); + TestUtils.AreEqual(r2, a2 + b2); + + double3 a3 = double3(-46.178705952213477, 401.17006296718966, -454.12414643453627); + double3 b3 = double3(-279.62936628965167, -344.66710273580026, 242.8391956029642); + double3 r3 = double3(-325.80807224186515, 56.502960231389409, -211.28495083157208); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void double3_operator_add_wide_scalar() + { + double3 a0 = double3(-194.51420387742769, 338.54838696985894, 246.97140252169754); + double b0 = (124.121678171736); + double3 r0 = double3(-70.3925257056917, 462.67006514159493, 371.09308069343354); + TestUtils.AreEqual(r0, a0 + b0); + + double3 a1 = double3(100.51093797595752, -478.11131094308166, 30.916145577522116); + double b1 = (-45.724677822424439); + double3 r1 = double3(54.786260153533078, -523.835988765506, -14.808532244902324); + TestUtils.AreEqual(r1, a1 + b1); + + double3 a2 = double3(60.37435224483454, 82.50134495762245, 6.7993848355483806); + double b2 = (-242.1187475855084); + double3 r2 = double3(-181.74439534067386, -159.61740262788595, -235.31936274996002); + TestUtils.AreEqual(r2, a2 + b2); + + double3 a3 = double3(-484.69981287638649, -213.52673087526426, -267.78430688929944); + double b3 = (-188.26501068298938); + double3 r3 = double3(-672.96482355937587, -401.79174155825365, -456.04931757228883); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void double3_operator_add_scalar_wide() + { + double a0 = (-340.35468284243473); + double3 b0 = double3(511.36225652665007, -146.21663791789518, -106.21042661844308); + double3 r0 = double3(171.00757368421534, -486.57132076032991, -446.56510946087781); + TestUtils.AreEqual(r0, a0 + b0); + + double a1 = (-363.45024960276214); + double3 b1 = double3(199.08958325120136, -27.108407271610758, 419.84900041103788); + double3 r1 = double3(-164.36066635156078, -390.5586568743729, 56.398750808275736); + TestUtils.AreEqual(r1, a1 + b1); + + double a2 = (284.95503748811552); + double3 b2 = double3(-164.92418129971446, -249.19032561461921, 150.92817718858282); + double3 r2 = double3(120.03085618840106, 35.76471187349631, 435.88321467669834); + TestUtils.AreEqual(r2, a2 + b2); + + double a3 = (298.17509784278229); + double3 b3 = double3(-457.15341803857751, 424.71807094324288, -301.85750283946163); + double3 r3 = double3(-158.97832019579522, 722.89316878602517, -3.6824049966793382); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void double3_operator_sub_wide_wide() + { + double3 a0 = double3(160.4922617229131, 11.223957305412682, 359.20010607279846); + double3 b0 = double3(115.46876078260539, -130.98230630298252, 241.54083716196044); + double3 r0 = double3(45.023500940307713, 142.2062636083952, 117.65926891083802); + TestUtils.AreEqual(r0, a0 - b0); + + double3 a1 = double3(-498.22830485656311, -355.25362913462038, -94.534852787170053); + double3 b1 = double3(9.9870860623135513, 419.89512582304656, 59.124466208333388); + double3 r1 = double3(-508.21539091887666, -775.14875495766694, -153.65931899550344); + TestUtils.AreEqual(r1, a1 - b1); + + double3 a2 = double3(-410.46404786150163, -401.38464398001537, 317.70681944382693); + double3 b2 = double3(-402.38163847587145, -75.370143687059226, 320.97960796997859); + double3 r2 = double3(-8.0824093856301715, -326.01450029295614, -3.2727885261516576); + TestUtils.AreEqual(r2, a2 - b2); + + double3 a3 = double3(447.0604133303558, -489.07414482956477, -230.00838218909149); + double3 b3 = double3(-73.908757482612884, -31.444742455819949, -389.25194734579509); + double3 r3 = double3(520.96917081296874, -457.62940237374482, 159.2435651567036); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void double3_operator_sub_wide_scalar() + { + double3 a0 = double3(207.38960108877609, 248.45773684627272, -384.82393211164697); + double b0 = (-36.112476604111691); + double3 r0 = double3(243.50207769288778, 284.57021345038441, -348.71145550753528); + TestUtils.AreEqual(r0, a0 - b0); + + double3 a1 = double3(-205.34476122881506, 191.64204820973896, 18.856238135535364); + double b1 = (-374.81156152058929); + double3 r1 = double3(169.46680029177423, 566.45360973032825, 393.66779965612466); + TestUtils.AreEqual(r1, a1 - b1); + + double3 a2 = double3(-44.96160151667965, 16.338193185784917, -366.86545269883493); + double b2 = (480.85798738936796); + double3 r2 = double3(-525.81958890604756, -464.51979420358305, -847.72344008820289); + TestUtils.AreEqual(r2, a2 - b2); + + double3 a3 = double3(-35.523088233323335, 439.07729336203886, 490.2222661870635); + double b3 = (349.39776460705218); + double3 r3 = double3(-384.92085284037552, 89.679528754986677, 140.82450158001132); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void double3_operator_sub_scalar_wide() + { + double a0 = (-86.008225719448262); + double3 b0 = double3(466.42511413359318, 298.48694219183506, -300.95010652251085); + double3 r0 = double3(-552.43333985304139, -384.49516791128332, 214.94188080306259); + TestUtils.AreEqual(r0, a0 - b0); + + double a1 = (315.38003006362362); + double3 b1 = double3(-381.09218543632522, -125.00837546447684, 58.466194418476107); + double3 r1 = double3(696.47221549994879, 440.38840552810046, 256.91383564514751); + TestUtils.AreEqual(r1, a1 - b1); + + double a2 = (214.74609361158036); + double3 b2 = double3(-257.54942739082009, 480.22459505508868, -443.35507723472784); + double3 r2 = double3(472.29552100240045, -265.47850144350832, 658.10117084630815); + TestUtils.AreEqual(r2, a2 - b2); + + double a3 = (260.79503858312728); + double3 b3 = double3(29.681931747906788, 139.85773164586055, -247.78996216868512); + double3 r3 = double3(231.11310683522049, 120.93730693726673, 508.5850007518124); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void double3_operator_mul_wide_wide() + { + double3 a0 = double3(-482.71381710596097, -407.29348559272171, 137.70058995937029); + double3 b0 = double3(-236.36788355389979, 260.72759139757954, -416.38629718142852); + double3 r0 = double3(114098.04331156026, -106192.64949051509, -57336.638772880389); + TestUtils.AreEqual(r0, a0 * b0); + + double3 a1 = double3(208.54113278563182, 194.296573967811, -484.24241684574747); + double3 b1 = double3(-364.49561541364324, -253.14750897751537, -369.20287220981106); + double3 r1 = double3(-76012.328533757158, -49185.69370281692, 178783.69114527057); + TestUtils.AreEqual(r1, a1 * b1); + + double3 a2 = double3(183.98730739578014, -241.33547770294149, 45.868758938214114); + double3 b2 = double3(193.54791531038836, 169.08491976982214, 201.96966442930034); + double3 r2 = double3(35610.359790024842, -40806.189885013562, 9264.0978505395742); + TestUtils.AreEqual(r2, a2 * b2); + + double3 a3 = double3(363.32610266438041, -328.11893692990714, -471.02307413100408); + double3 b3 = double3(249.45608317547294, -308.19319810913555, -385.57964843585137); + double3 r3 = double3(90633.9064860661, 101124.02453259782, 181616.91132860651); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void double3_operator_mul_wide_scalar() + { + double3 a0 = double3(-96.318821236639678, -277.14229239017811, -239.93690191951436); + double b0 = (-301.20720424373042); + double3 r0 = double3(29011.922860739887, 83477.255068544036, 72270.723422079071); + TestUtils.AreEqual(r0, a0 * b0); + + double3 a1 = double3(509.53140544776409, 215.73149667295229, -455.50827500573746); + double b1 = (255.85810172551226); + double3 r1 = double3(130367.73816739726, 55196.651221145235, -116545.48256323059); + TestUtils.AreEqual(r1, a1 * b1); + + double3 a2 = double3(-389.24327367788334, 53.796284939067618, 243.75734459783757); + double b2 = (-338.29248658674419); + double3 r2 = double3(131678.07493965575, -18198.879001166202, -82461.278227784351); + TestUtils.AreEqual(r2, a2 * b2); + + double3 a3 = double3(135.35469991311186, -383.93960946795517, -31.425238862366086); + double b3 = (-207.35010275959507); + double3 r3 = double3(-28065.810935977897, 79609.9174766593, 6516.0265073564287); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void double3_operator_mul_scalar_wide() + { + double a0 = (37.432166355397612); + double3 b0 = double3(96.747546479454058, 492.18539427788244, -274.05458534604617); + double3 r0 = double3(3621.4702542954869, 18423.565556306661, -10258.456829132712); + TestUtils.AreEqual(r0, a0 * b0); + + double a1 = (-452.87096926796761); + double3 b1 = double3(420.85330434369541, 102.18292694081686, -114.94887762654054); + double3 r1 = double3(-190592.24385775632, -46275.681166325652, 52057.009626996405); + TestUtils.AreEqual(r1, a1 * b1); + + double a2 = (-351.12003843445336); + double3 b2 = double3(-464.66496799172131, 444.08484646495663, 447.10525605040846); + double3 r2 = double3(163153.18142039722, -155927.08835893389, -156987.61468866552); + TestUtils.AreEqual(r2, a2 * b2); + + double a3 = (130.82935124767448); + double3 b3 = double3(-321.41334191030512, 445.30131861441828, 478.24357317306271); + double3 r3 = double3(-42050.2990044722, 58258.482624058335, 62568.296416601537); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void double3_operator_div_wide_wide() + { + double3 a0 = double3(-353.13144390337703, -102.79985456485292, 51.319128298814917); + double3 b0 = double3(-178.73954805114283, -302.09628381491467, -199.40583739029518); + double3 r0 = double3(1.97567604793504, 0.34028837848212429, -0.25736021056579439); + TestUtils.AreEqual(r0, a0 / b0); + + double3 a1 = double3(-191.87167868012176, 8.0418245829836223, -128.73764210973758); + double3 b1 = double3(278.85077561012042, 502.33758782890516, -361.48483078623417); + double3 r1 = double3(-0.68808013268139567, 0.016008805189634039, 0.35613566917796119); + TestUtils.AreEqual(r1, a1 / b1); + + double3 a2 = double3(-136.05959779399427, -370.4710053738537, -237.69456326109105); + double3 b2 = double3(353.121059820578, -38.894930142394685, -75.764737402910725); + double3 r2 = double3(-0.3853058151307277, 9.5249176182488586, 3.1372716570909582); + TestUtils.AreEqual(r2, a2 / b2); + + double3 a3 = double3(-432.54687496300176, 200.26549181727012, 361.44157068871039); + double3 b3 = double3(-195.21784719974636, -405.03399224068687, -394.2300085473014); + double3 r3 = double3(2.2157137842034547, -0.49444119667433889, -0.9168291678773689); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void double3_operator_div_wide_scalar() + { + double3 a0 = double3(171.34242184988341, 0.10338377957384637, 57.888263967767443); + double b0 = (171.79682191265601); + double3 r0 = double3(0.99735501473360411, 0.00060177934855167557, 0.33695771157628673); + TestUtils.AreEqual(r0, a0 / b0); + + double3 a1 = double3(-256.13074529177078, -290.38690461329509, -127.44869118903239); + double b1 = (95.6696842162263); + double3 r1 = double3(-2.6772404172766056, -3.0353074434423948, -1.332174264325795); + TestUtils.AreEqual(r1, a1 / b1); + + double3 a2 = double3(-79.7448890580539, -499.84355687529012, 58.686315802245531); + double b2 = (146.46688110496234); + double3 r2 = double3(-0.54445679771733813, -3.4126729066968249, 0.400679767053886); + TestUtils.AreEqual(r2, a2 / b2); + + double3 a3 = double3(-453.20579859856787, 481.73814247629514, 464.47907159499778); + double b3 = (-205.03382143985192); + double3 r3 = double3(2.2103953163235506, -2.3495545227284187, -2.2653778207575179); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void double3_operator_div_scalar_wide() + { + double a0 = (-264.44250095283729); + double3 b0 = double3(105.58908157497137, -142.34910137129441, -288.94890679463231); + double3 r0 = double3(-2.5044492954044237, 1.85770404172122, 0.915187753732487); + TestUtils.AreEqual(r0, a0 / b0); + + double a1 = (39.644133824689334); + double3 b1 = double3(-363.99138396046658, -149.71822006521666, -395.72912306139671); + double3 r1 = double3(-0.10891503362891446, -0.26479164531491561, -0.10017997542864343); + TestUtils.AreEqual(r1, a1 / b1); + + double a2 = (258.71868693955184); + double3 b2 = double3(-9.6662514254759344, 117.72553282497711, -331.38655797177296); + double3 r2 = double3(-26.765151820661792, 2.1976429473815986, -0.78071569505721816); + TestUtils.AreEqual(r2, a2 / b2); + + double a3 = (-509.98602676297821); + double3 b3 = double3(427.8964666928614, 467.61712882836218, -407.12461943511136); + double3 r3 = double3(-1.1918444447662142, -1.0906059579998137, 1.2526533705345255); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void double3_operator_mod_wide_wide() + { + double3 a0 = double3(-388.81249422059045, 181.68118842955732, -167.07872470052854); + double3 b0 = double3(436.94417187056695, 58.940049437312382, -201.11623368091705); + double3 r0 = double3(-388.81249422059045, 4.8610401176201776, -167.07872470052854); + TestUtils.AreEqual(r0, a0 % b0); + + double3 a1 = double3(432.82015319951813, -258.43895995730486, -170.11079629236406); + double3 b1 = double3(279.2893537391393, -397.07975954426445, 377.89994758083481); + double3 r1 = double3(153.53079946037883, -258.43895995730486, -170.11079629236406); + TestUtils.AreEqual(r1, a1 % b1); + + double3 a2 = double3(283.318293464984, 122.71651297561664, 335.27101413126616); + double3 b2 = double3(174.69386657266591, -228.17652736798698, -317.06019106370405); + double3 r2 = double3(108.62442689231807, 122.71651297561664, 18.210823067562103); + TestUtils.AreEqual(r2, a2 % b2); + + double3 a3 = double3(-503.60851668920765, 191.02251848532933, 289.74269379756538); + double3 b3 = double3(-417.48011107811709, -249.9759434433542, -397.57157177364991); + double3 r3 = double3(-86.128405611090557, 191.02251848532933, 289.74269379756538); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void double3_operator_mod_wide_scalar() + { + double3 a0 = double3(-244.49962889612635, -211.81931958525411, -145.92677576184587); + double b0 = (39.634963769295723); + double3 r0 = double3(-6.6898462803520147, -13.644500738775491, -27.021884453958705); + TestUtils.AreEqual(r0, a0 % b0); + + double3 a1 = double3(-304.91822090042672, -133.90778428591221, 281.30965412841624); + double b1 = (155.47946436492703); + double3 r1 = double3(-149.43875653549969, -133.90778428591221, 125.83018976348922); + TestUtils.AreEqual(r1, a1 % b1); + + double3 a2 = double3(-226.53575311719243, 101.70649032560482, 319.47152033423606); + double b2 = (335.16613046041039); + double3 r2 = double3(-226.53575311719243, 101.70649032560482, 319.47152033423606); + TestUtils.AreEqual(r2, a2 % b2); + + double3 a3 = double3(-285.40231646476423, 259.37800061860025, -330.87193957477433); + double b3 = (-355.84685985923136); + double3 r3 = double3(-285.40231646476423, 259.37800061860025, -330.87193957477433); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void double3_operator_mod_scalar_wide() + { + double a0 = (-66.945025236785909); + double3 b0 = double3(-249.77609479137516, -396.07375664081133, 386.49204582091977); + double3 r0 = double3(-66.945025236785909, -66.945025236785909, -66.945025236785909); + TestUtils.AreEqual(r0, a0 % b0); + + double a1 = (168.93948109864232); + double3 b1 = double3(-199.4182442163202, 261.7517141130528, 16.127438791155555); + double3 r1 = double3(168.93948109864232, 168.93948109864232, 7.665093187086768); + TestUtils.AreEqual(r1, a1 % b1); + + double a2 = (257.66814744550186); + double3 b2 = double3(-75.788451945310669, 170.95630439136005, -242.85828005655588); + double3 r2 = double3(30.302791609569852, 86.711843054141809, 14.809867388945975); + TestUtils.AreEqual(r2, a2 % b2); + + double a3 = (425.94531913564788); + double3 b3 = double3(303.27240409668184, 3.033060790520608, -505.74352788633831); + double3 r3 = double3(122.67291503896604, 1.316808462762765, 425.94531913564788); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void double3_operator_plus() + { + double3 a0 = double3(-418.82956357432045, -405.79894823851015, -34.041791216489742); + double3 r0 = double3(-418.82956357432045, -405.79894823851015, -34.041791216489742); + TestUtils.AreEqual(r0, +a0); + + double3 a1 = double3(236.99924456188421, 210.8614223985287, 293.74197902052754); + double3 r1 = double3(236.99924456188421, 210.8614223985287, 293.74197902052754); + TestUtils.AreEqual(r1, +a1); + + double3 a2 = double3(-373.015422279488, 4.9544198536101476, -418.64524932328857); + double3 r2 = double3(-373.015422279488, 4.9544198536101476, -418.64524932328857); + TestUtils.AreEqual(r2, +a2); + + double3 a3 = double3(504.47483062393724, 439.55937572920664, -478.74939916969714); + double3 r3 = double3(504.47483062393724, 439.55937572920664, -478.74939916969714); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void double3_operator_neg() + { + double3 a0 = double3(148.46174890755753, -467.12267873581624, 132.04719954917539); + double3 r0 = double3(-148.46174890755753, 467.12267873581624, -132.04719954917539); + TestUtils.AreEqual(r0, -a0); + + double3 a1 = double3(183.52262290917463, -407.99109024926605, -54.958759571872065); + double3 r1 = double3(-183.52262290917463, 407.99109024926605, 54.958759571872065); + TestUtils.AreEqual(r1, -a1); + + double3 a2 = double3(-382.98981803608581, -383.01406377508027, 407.70980305583669); + double3 r2 = double3(382.98981803608581, 383.01406377508027, -407.70980305583669); + TestUtils.AreEqual(r2, -a2); + + double3 a3 = double3(168.73550351370852, 171.90249474900895, -280.55831564616335); + double3 r3 = double3(-168.73550351370852, -171.90249474900895, 280.55831564616335); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void double3_operator_prefix_inc() + { + double3 a0 = double3(-139.84208137348389, -56.743654039103376, -381.955324589254); + double3 r0 = double3(-138.84208137348389, -55.743654039103376, -380.955324589254); + TestUtils.AreEqual(r0, ++a0); + + double3 a1 = double3(509.79634380237962, 210.31986556310198, -392.73151058365193); + double3 r1 = double3(510.79634380237962, 211.31986556310198, -391.73151058365193); + TestUtils.AreEqual(r1, ++a1); + + double3 a2 = double3(-300.19410218866267, 401.614830919362, 130.90919429199266); + double3 r2 = double3(-299.19410218866267, 402.614830919362, 131.90919429199266); + TestUtils.AreEqual(r2, ++a2); + + double3 a3 = double3(-450.23016402229212, 46.19202735190845, -41.497298975241051); + double3 r3 = double3(-449.23016402229212, 47.19202735190845, -40.497298975241051); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void double3_operator_postfix_inc() + { + double3 a0 = double3(-396.6697396695007, 511.20749378167443, 249.11127030528678); + double3 r0 = double3(-396.6697396695007, 511.20749378167443, 249.11127030528678); + TestUtils.AreEqual(r0, a0++); + + double3 a1 = double3(-128.81731301584153, 278.00817764830219, -81.393423356764686); + double3 r1 = double3(-128.81731301584153, 278.00817764830219, -81.393423356764686); + TestUtils.AreEqual(r1, a1++); + + double3 a2 = double3(66.719732554033271, 147.94395048354932, -326.10758486674524); + double3 r2 = double3(66.719732554033271, 147.94395048354932, -326.10758486674524); + TestUtils.AreEqual(r2, a2++); + + double3 a3 = double3(41.033564825092185, 73.155582223625629, -60.132380275117384); + double3 r3 = double3(41.033564825092185, 73.155582223625629, -60.132380275117384); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void double3_operator_prefix_dec() + { + double3 a0 = double3(123.12869626056806, 256.8437465433235, 156.33078844674435); + double3 r0 = double3(122.12869626056806, 255.8437465433235, 155.33078844674435); + TestUtils.AreEqual(r0, --a0); + + double3 a1 = double3(461.73742530389563, 392.01561731473339, 187.87412580655609); + double3 r1 = double3(460.73742530389563, 391.01561731473339, 186.87412580655609); + TestUtils.AreEqual(r1, --a1); + + double3 a2 = double3(-236.2252043393558, 469.8447313112415, 45.536655685648611); + double3 r2 = double3(-237.2252043393558, 468.8447313112415, 44.536655685648611); + TestUtils.AreEqual(r2, --a2); + + double3 a3 = double3(376.04684680329956, -22.028951416736902, 248.79012667797042); + double3 r3 = double3(375.04684680329956, -23.028951416736902, 247.79012667797042); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void double3_operator_postfix_dec() + { + double3 a0 = double3(379.68831723727669, 302.69287814884115, -176.07134040448409); + double3 r0 = double3(379.68831723727669, 302.69287814884115, -176.07134040448409); + TestUtils.AreEqual(r0, a0--); + + double3 a1 = double3(-291.25267066212962, -402.92594666170231, -63.655158787805192); + double3 r1 = double3(-291.25267066212962, -402.92594666170231, -63.655158787805192); + TestUtils.AreEqual(r1, a1--); + + double3 a2 = double3(355.26110069605568, -100.76183824462902, 156.14034969924967); + double3 r2 = double3(355.26110069605568, -100.76183824462902, 156.14034969924967); + TestUtils.AreEqual(r2, a2--); + + double3 a3 = double3(479.94519613680677, -445.0269393609031, 407.42034907239508); + double3 r3 = double3(479.94519613680677, -445.0269393609031, 407.42034907239508); + TestUtils.AreEqual(r3, a3--); + } + + [TestCompiler] + public static void double3_shuffle_result_1() + { + double3 a = double3(0, 1, 2); + double3 b = double3(3, 4, 5); + + TestUtils.AreEqual((0), shuffle(a, b, ShuffleComponent.LeftX)); + TestUtils.AreEqual((1), shuffle(a, b, ShuffleComponent.LeftY)); + TestUtils.AreEqual((2), shuffle(a, b, ShuffleComponent.LeftZ)); + TestUtils.AreEqual((3), shuffle(a, b, ShuffleComponent.RightX)); + TestUtils.AreEqual((4), shuffle(a, b, ShuffleComponent.RightY)); + TestUtils.AreEqual((5), shuffle(a, b, ShuffleComponent.RightZ)); + } + + [TestCompiler] + public static void double3_shuffle_result_2() + { + double3 a = double3(0, 1, 2); + double3 b = double3(3, 4, 5); + + TestUtils.AreEqual(double2(4, 4), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightY)); + TestUtils.AreEqual(double2(4, 3), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightX)); + TestUtils.AreEqual(double2(1, 3), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.RightX)); + TestUtils.AreEqual(double2(5, 2), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(double2(5, 1), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.LeftY)); + TestUtils.AreEqual(double2(1, 2), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(double2(3, 2), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(double2(5, 0), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.LeftX)); + TestUtils.AreEqual(double2(5, 5), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.RightZ)); + TestUtils.AreEqual(double2(4, 1), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftY)); + TestUtils.AreEqual(double2(4, 5), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightZ)); + TestUtils.AreEqual(double2(5, 0), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.LeftX)); + TestUtils.AreEqual(double2(4, 3), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightX)); + TestUtils.AreEqual(double2(5, 4), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.RightY)); + TestUtils.AreEqual(double2(3, 0), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftX)); + TestUtils.AreEqual(double2(1, 2), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.LeftZ)); + } + + [TestCompiler] + public static void double3_shuffle_result_3() + { + double3 a = double3(0, 1, 2); + double3 b = double3(3, 4, 5); + + TestUtils.AreEqual(double3(1, 5, 3), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.RightZ, ShuffleComponent.RightX)); + TestUtils.AreEqual(double3(4, 0, 2), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftX, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(double3(2, 5, 3), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.RightZ, ShuffleComponent.RightX)); + TestUtils.AreEqual(double3(4, 0, 1), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftX, ShuffleComponent.LeftY)); + TestUtils.AreEqual(double3(5, 4, 2), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.RightY, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(double3(2, 0, 1), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.LeftX, ShuffleComponent.LeftY)); + TestUtils.AreEqual(double3(2, 4, 3), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.RightY, ShuffleComponent.RightX)); + TestUtils.AreEqual(double3(2, 1, 5), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.LeftY, ShuffleComponent.RightZ)); + TestUtils.AreEqual(double3(4, 4, 5), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightY, ShuffleComponent.RightZ)); + TestUtils.AreEqual(double3(4, 3, 1), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightX, ShuffleComponent.LeftY)); + TestUtils.AreEqual(double3(5, 5, 0), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.RightZ, ShuffleComponent.LeftX)); + TestUtils.AreEqual(double3(5, 1, 3), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.LeftY, ShuffleComponent.RightX)); + TestUtils.AreEqual(double3(4, 1, 5), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftY, ShuffleComponent.RightZ)); + TestUtils.AreEqual(double3(2, 3, 4), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.RightX, ShuffleComponent.RightY)); + TestUtils.AreEqual(double3(4, 0, 4), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftX, ShuffleComponent.RightY)); + TestUtils.AreEqual(double3(4, 0, 5), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftX, ShuffleComponent.RightZ)); + } + + [TestCompiler] + public static void double3_shuffle_result_4() + { + double3 a = double3(0, 1, 2); + double3 b = double3(3, 4, 5); + + TestUtils.AreEqual(double4(1, 2, 3, 1), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.LeftZ, ShuffleComponent.RightX, ShuffleComponent.LeftY)); + TestUtils.AreEqual(double4(4, 2, 5, 4), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftZ, ShuffleComponent.RightZ, ShuffleComponent.RightY)); + TestUtils.AreEqual(double4(4, 4, 5, 1), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightY, ShuffleComponent.RightZ, ShuffleComponent.LeftY)); + TestUtils.AreEqual(double4(3, 3, 1, 1), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightX, ShuffleComponent.LeftY, ShuffleComponent.LeftY)); + TestUtils.AreEqual(double4(4, 1, 1, 0), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftY, ShuffleComponent.LeftY, ShuffleComponent.LeftX)); + TestUtils.AreEqual(double4(3, 4, 3, 5), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightY, ShuffleComponent.RightX, ShuffleComponent.RightZ)); + TestUtils.AreEqual(double4(1, 5, 0, 5), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.RightZ, ShuffleComponent.LeftX, ShuffleComponent.RightZ)); + TestUtils.AreEqual(double4(4, 0, 0, 0), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftX, ShuffleComponent.LeftX, ShuffleComponent.LeftX)); + TestUtils.AreEqual(double4(3, 5, 2, 0), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightZ, ShuffleComponent.LeftZ, ShuffleComponent.LeftX)); + TestUtils.AreEqual(double4(4, 3, 1, 3), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightX, ShuffleComponent.LeftY, ShuffleComponent.RightX)); + TestUtils.AreEqual(double4(0, 2, 5, 0), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.LeftZ, ShuffleComponent.RightZ, ShuffleComponent.LeftX)); + TestUtils.AreEqual(double4(1, 4, 5, 5), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.RightY, ShuffleComponent.RightZ, ShuffleComponent.RightZ)); + TestUtils.AreEqual(double4(2, 3, 1, 3), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.RightX, ShuffleComponent.LeftY, ShuffleComponent.RightX)); + TestUtils.AreEqual(double4(3, 0, 1, 2), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftX, ShuffleComponent.LeftY, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(double4(5, 3, 0, 4), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.RightX, ShuffleComponent.LeftX, ShuffleComponent.RightY)); + TestUtils.AreEqual(double4(2, 5, 0, 4), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.RightZ, ShuffleComponent.LeftX, ShuffleComponent.RightY)); + } + + [TestCase /* For player builds */] + public static void double3_EqualsObjectOverride() + { + TestUtils.IsFalse(new double3().Equals((object)new int())); + TestUtils.IsTrue(new double3().Equals((object)new double3())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestDouble3.gen.cs.meta b/src/Tests/Tests/Shared/TestDouble3.gen.cs.meta new file mode 100644 index 00000000..1d5e3065 --- /dev/null +++ b/src/Tests/Tests/Shared/TestDouble3.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 617e00812628df941a5b85ca46e4ca9d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestDouble3x2.gen.cs b/src/Tests/Tests/Shared/TestDouble3x2.gen.cs new file mode 100644 index 00000000..0fd677a3 --- /dev/null +++ b/src/Tests/Tests/Shared/TestDouble3x2.gen.cs @@ -0,0 +1,950 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestDouble3x2 + { + [TestCompiler] + public static void double3x2_zero() + { + TestUtils.AreEqual(0.0, double3x2.zero.c0.x); + TestUtils.AreEqual(0.0, double3x2.zero.c0.y); + TestUtils.AreEqual(0.0, double3x2.zero.c0.z); + TestUtils.AreEqual(0.0, double3x2.zero.c1.x); + TestUtils.AreEqual(0.0, double3x2.zero.c1.y); + TestUtils.AreEqual(0.0, double3x2.zero.c1.z); + } + + [TestCompiler] + public static void double3x2_operator_equal_wide_wide() + { + double3x2 a0 = double3x2(492.15758275061728, -495.20632027797694, 227.45765195947968, -147.37405950733182, -222.68201909897942, 64.093720704360749); + double3x2 b0 = double3x2(192.56880888369346, -235.61102472786376, -254.04311740307281, -412.62472052715009, 471.90480945627428, -6.4727852374654162); + bool3x2 r0 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + double3x2 a1 = double3x2(-23.890404473939157, -16.8197190839889, 163.23210890741655, -165.27101071424363, 470.87767980568003, -423.94255967808078); + double3x2 b1 = double3x2(-339.10237447316865, 488.1875700839737, -379.5965842584132, -308.41700258311675, -82.333374300195544, -102.92108087563935); + bool3x2 r1 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + double3x2 a2 = double3x2(109.63436918595539, 462.69031283943468, -335.38147727371262, 357.23446934168896, 1.5455777652308598, -347.38824741327585); + double3x2 b2 = double3x2(226.51573835430463, -356.90132896830391, -362.91277544708589, -427.89843746083716, 466.65013978753711, -102.79904680270658); + bool3x2 r2 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + double3x2 a3 = double3x2(-114.47217302884542, 435.84865804940864, 194.23808607563285, 138.76554710174241, -467.34914205379278, 370.43337767684523); + double3x2 b3 = double3x2(-43.355954428834821, 85.045664111639212, -91.127054972167628, 422.19208856215334, -477.43130873024057, 1.8770024785198984); + bool3x2 r3 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void double3x2_operator_equal_wide_scalar() + { + double3x2 a0 = double3x2(-303.2300766926399, 451.52631327674089, -253.65587413201848, -105.20363502632995, -500.6910920090466, -426.19248338518315); + double b0 = (123.5445759871717); + bool3x2 r0 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + double3x2 a1 = double3x2(159.87609656149334, -57.477391031327386, -182.04973968400139, 406.51375861024189, 370.88599866017978, -172.03530629539642); + double b1 = (-59.558379439431405); + bool3x2 r1 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + double3x2 a2 = double3x2(455.40001198993991, 363.93823044557973, -27.150561106927, -325.97606507221985, -290.35904254129116, 180.19686635779067); + double b2 = (-11.338988547836891); + bool3x2 r2 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + double3x2 a3 = double3x2(-374.12832015293105, -126.54608899287234, -197.2617896521752, -227.15933357326281, -479.8991937487848, -439.77767750237962); + double b3 = (-439.35894295170851); + bool3x2 r3 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void double3x2_operator_equal_scalar_wide() + { + double a0 = (-253.39728534100453); + double3x2 b0 = double3x2(19.952187785856495, -185.79199346610903, 407.8136052600172, -87.2766969610363, -206.27469382354741, 160.503138855334); + bool3x2 r0 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + double a1 = (-274.77081478516141); + double3x2 b1 = double3x2(-2.6315281403397535, 448.35453602688131, -410.03524251004461, 247.32901465489022, 355.53915350303942, -298.06671180299793); + bool3x2 r1 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + double a2 = (414.10151429385951); + double3x2 b2 = double3x2(-481.30262707234482, 196.55074438664633, 34.60100008668428, 113.76156645350227, -386.45337861890596, -124.49174672201821); + bool3x2 r2 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + double a3 = (243.8866447153905); + double3x2 b3 = double3x2(-492.6181826501238, 145.424413033493, 421.55070968230757, -95.409988209330493, 336.80928746648567, 209.58380589707929); + bool3x2 r3 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void double3x2_operator_not_equal_wide_wide() + { + double3x2 a0 = double3x2(430.8425316432689, 104.69001798736394, 225.80243478799355, -310.57017841496048, -418.61945815506363, 304.12820281839379); + double3x2 b0 = double3x2(210.02470622305975, -55.203330304102678, -269.92533672504373, -234.54673372700194, 25.917412054686565, -63.726991444699024); + bool3x2 r0 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + double3x2 a1 = double3x2(-509.32682561749908, -160.53807719076895, -203.30197606016975, -505.76325368590807, 162.17220623892365, 1.1561973100324394); + double3x2 b1 = double3x2(-484.55371092471933, -425.333599050219, -53.274394775402925, 328.1944192984115, 15.963139303011417, 461.71412417931208); + bool3x2 r1 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + double3x2 a2 = double3x2(65.662074358045174, 102.78780250567377, 172.93008120960098, 26.621009123800832, 235.12595259171258, 128.54198533321824); + double3x2 b2 = double3x2(-113.36304455313973, -240.07297264787974, 495.11916970420589, 203.5583661550462, 340.49345103860526, -241.90719448863865); + bool3x2 r2 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + double3x2 a3 = double3x2(-354.99697630246959, 334.35948220564023, -495.83200692377613, 468.30740163675853, 458.37094733601941, 299.93733300824522); + double3x2 b3 = double3x2(459.56982896270688, 213.0737384357833, -384.7828506831, -255.07233846144396, 477.66343115161328, -248.03662621604121); + bool3x2 r3 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void double3x2_operator_not_equal_wide_scalar() + { + double3x2 a0 = double3x2(-16.914588697680529, 168.83411486858233, -462.71352145760949, 130.30776959765137, 214.50161443208424, -440.26328178879959); + double b0 = (-145.37277109239847); + bool3x2 r0 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + double3x2 a1 = double3x2(-197.12796053529155, -386.61117595555783, -281.02101362916687, -270.26885593601912, -403.96372313236992, -269.80570877241234); + double b1 = (-169.09985860115842); + bool3x2 r1 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + double3x2 a2 = double3x2(299.65422763473089, -432.75573917513515, -457.36312100727258, -13.519590622521719, 273.87305773136814, 185.042454567292); + double b2 = (-71.750904831919286); + bool3x2 r2 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + double3x2 a3 = double3x2(-482.53069351731364, 511.73495578753523, 230.50753628020527, 100.27476768394683, 129.68240863163135, 321.17879048044733); + double b3 = (116.39514427836764); + bool3x2 r3 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void double3x2_operator_not_equal_scalar_wide() + { + double a0 = (275.79582823244664); + double3x2 b0 = double3x2(-57.196896341255353, -382.4325279586169, 97.820359990848374, -161.46364529499022, -458.39563367254829, -499.61786364932448); + bool3x2 r0 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + double a1 = (327.92217818271467); + double3x2 b1 = double3x2(367.57121699283425, 59.7863667289663, -209.58068118318016, -62.580453186566217, -479.97497604786184, -49.494519495169868); + bool3x2 r1 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + double a2 = (-114.68521338081229); + double3x2 b2 = double3x2(109.93924599044919, -176.28482755286842, -347.48529903380449, 85.540928165214609, -356.65954868712441, -104.24357490625397); + bool3x2 r2 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + double a3 = (-133.54918605347592); + double3x2 b3 = double3x2(243.53971135036079, 13.141311890045813, -379.98594754747393, -41.281226892620907, 87.911684792447659, -339.07727996403224); + bool3x2 r3 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void double3x2_operator_less_wide_wide() + { + double3x2 a0 = double3x2(196.84256825076534, 336.40979997087732, 251.96372115424072, 257.65591466503963, 430.04588647840819, -62.419644146421774); + double3x2 b0 = double3x2(-465.34502313348696, -256.15239751346053, -314.814018634527, 364.56673662949663, 100.21050290959442, 182.56098636545289); + bool3x2 r0 = bool3x2(false, false, false, true, false, true); + TestUtils.AreEqual(r0, a0 < b0); + + double3x2 a1 = double3x2(8.8392293494376872, -333.81671563434259, 164.67880662003472, -350.94487516532877, 3.84143662631584, 125.40972024081725); + double3x2 b1 = double3x2(3.116978885194726, -259.43047893207074, -437.33490749696966, -456.0437321402336, -394.2559718537405, 401.91369099259077); + bool3x2 r1 = bool3x2(false, true, false, false, false, true); + TestUtils.AreEqual(r1, a1 < b1); + + double3x2 a2 = double3x2(-111.12994127680076, 70.005523475820951, 448.19828173527412, -419.98711200244122, -258.30166757213965, -34.832201735504043); + double3x2 b2 = double3x2(313.43916454605721, 121.28668194696616, -28.012290729215522, -282.96589697663012, 330.06440631023816, 124.09937077579059); + bool3x2 r2 = bool3x2(true, true, false, true, true, true); + TestUtils.AreEqual(r2, a2 < b2); + + double3x2 a3 = double3x2(-69.859397682295821, 67.767227442826766, -139.77729207825723, 385.43464130229995, 133.707390609061, 506.18837117878184); + double3x2 b3 = double3x2(-183.69031700104955, 373.0607623406969, 109.75094013556418, -203.57134232463841, 45.6486556742567, -360.95226280808089); + bool3x2 r3 = bool3x2(false, true, true, false, false, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void double3x2_operator_less_wide_scalar() + { + double3x2 a0 = double3x2(-132.05731708000292, -192.46500477216438, -66.834607870706634, -379.01750081545561, -360.28242199508588, 20.927834282129879); + double b0 = (-156.01021845452965); + bool3x2 r0 = bool3x2(false, true, false, true, true, false); + TestUtils.AreEqual(r0, a0 < b0); + + double3x2 a1 = double3x2(-158.24074537970159, -20.452607402788772, 225.29148517609178, 307.48418607725023, 274.01523292903562, 373.54965584983563); + double b1 = (437.34587522845061); + bool3x2 r1 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 < b1); + + double3x2 a2 = double3x2(398.52368301829495, -58.010895994496934, 109.67008810381878, -108.853174498702, -44.971252223929014, 140.42607147080173); + double b2 = (105.0301654827922); + bool3x2 r2 = bool3x2(false, true, false, true, true, false); + TestUtils.AreEqual(r2, a2 < b2); + + double3x2 a3 = double3x2(-500.08827638071415, -197.50074610370245, -7.27149987559369, -432.99049898283113, 62.158315449095426, -72.254720959931035); + double b3 = (172.10334857371788); + bool3x2 r3 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void double3x2_operator_less_scalar_wide() + { + double a0 = (-423.117411095238); + double3x2 b0 = double3x2(385.09483617595151, -123.93348532725753, 86.376572887588509, 133.44217378154497, 161.45794947513286, 229.75426660746064); + bool3x2 r0 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 < b0); + + double a1 = (222.57159934871436); + double3x2 b1 = double3x2(315.53116360098647, -447.20351883731945, 271.83385790131695, -393.60531324595462, 317.48689737798964, -164.6051085761772); + bool3x2 r1 = bool3x2(true, false, true, false, true, false); + TestUtils.AreEqual(r1, a1 < b1); + + double a2 = (-282.87605370342544); + double3x2 b2 = double3x2(296.97953071118309, -254.40115582868509, 365.61562054493265, -441.98425671178114, -131.42866021554391, 442.62897631275882); + bool3x2 r2 = bool3x2(true, true, true, false, true, true); + TestUtils.AreEqual(r2, a2 < b2); + + double a3 = (-29.792842163607872); + double3x2 b3 = double3x2(-138.37379533535511, 9.2169721169476588, -226.7305482489665, 171.02944310523083, 376.62522595777421, -462.58872697436658); + bool3x2 r3 = bool3x2(false, true, false, true, true, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void double3x2_operator_greater_wide_wide() + { + double3x2 a0 = double3x2(483.50140141113729, 310.81563415695712, 106.9661896726891, 295.73526038589671, 116.95757179938141, -478.29977653841479); + double3x2 b0 = double3x2(-471.39802454011425, -371.98528617060992, 36.900723236101044, -316.76360407320954, 19.683055648432628, 207.3091381561519); + bool3x2 r0 = bool3x2(true, true, true, true, true, false); + TestUtils.AreEqual(r0, a0 > b0); + + double3x2 a1 = double3x2(-14.897393471979228, -33.817441717636484, -24.740548383789417, 319.78262701620474, -120.15856581561201, -289.00857962714906); + double3x2 b1 = double3x2(362.79748861994483, 324.95341816775192, 340.94807140014507, 25.986035120666997, -114.2111352021858, 240.80346428640348); + bool3x2 r1 = bool3x2(false, false, false, true, false, false); + TestUtils.AreEqual(r1, a1 > b1); + + double3x2 a2 = double3x2(455.85146662958505, 144.70691139283917, 63.931990891663304, -285.68304099034663, -502.0907201720824, -337.19446412529538); + double3x2 b2 = double3x2(273.42244757033063, 325.51576224226312, 27.341068995809678, 64.479532510265472, 200.94836983501375, 100.12266998184964); + bool3x2 r2 = bool3x2(true, false, true, false, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + double3x2 a3 = double3x2(474.31734274063137, -507.14510679018923, -133.56559735795742, -443.10913654934109, -464.34137056038776, -68.361549647693323); + double3x2 b3 = double3x2(-79.00710896356361, -315.137945560337, -122.98542815213347, -163.77920229908972, -492.56600617457462, -90.797273439726439); + bool3x2 r3 = bool3x2(true, false, false, false, true, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void double3x2_operator_greater_wide_scalar() + { + double3x2 a0 = double3x2(64.317918092160426, -397.70346445483318, 431.87690826499693, 85.702980796668157, 246.26305233978803, 197.49155602114809); + double b0 = (305.85991992888034); + bool3x2 r0 = bool3x2(false, false, true, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + double3x2 a1 = double3x2(286.1994608781298, -405.78459210218148, 171.56538661362856, -241.80727326209063, 333.57817498481745, 370.27919524269146); + double b1 = (280.81334818564972); + bool3x2 r1 = bool3x2(true, false, false, false, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + double3x2 a2 = double3x2(-413.70138116073861, -353.03129522550444, 396.64532608382649, 467.22205541432936, -240.0134228393498, 502.91505193287276); + double b2 = (-356.5923551789449); + bool3x2 r2 = bool3x2(false, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 > b2); + + double3x2 a3 = double3x2(315.46759024051369, 281.23064554912537, 428.79219909608, 245.15306460352292, -279.17542494422543, -453.86309668694764); + double b3 = (-259.28970134411458); + bool3x2 r3 = bool3x2(true, true, true, true, false, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void double3x2_operator_greater_scalar_wide() + { + double a0 = (-282.67049635698572); + double3x2 b0 = double3x2(358.09997360692353, -72.5964134077525, -232.16380106292843, -60.706723956720282, 75.156642710397364, 150.88350040786133); + bool3x2 r0 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + double a1 = (339.53917924479538); + double3x2 b1 = double3x2(-498.19602965665797, 459.74610326241054, -227.96872316485678, 335.86213485145106, 76.178844248959308, 296.85993899817572); + bool3x2 r1 = bool3x2(true, false, true, true, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + double a2 = (177.49000390688423); + double3x2 b2 = double3x2(-281.20120657663847, 244.72285162877427, 137.32857257562159, -385.33824724021287, 443.16345879210326, -353.56254141105455); + bool3x2 r2 = bool3x2(true, false, true, true, false, true); + TestUtils.AreEqual(r2, a2 > b2); + + double a3 = (26.040673983302327); + double3x2 b3 = double3x2(-331.7939499969566, -43.691963454565041, 20.949428806523542, -211.17984423934473, 227.42171894173214, -84.7797711290325); + bool3x2 r3 = bool3x2(true, true, true, true, false, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void double3x2_operator_less_equal_wide_wide() + { + double3x2 a0 = double3x2(-438.52313753521219, 210.48942837980087, 4.8773329280677444, -137.29793817237857, 156.09410174009111, -363.92412035722475); + double3x2 b0 = double3x2(-474.8141498392514, 304.3710555063426, 234.8241737982371, -390.48543209139513, -297.17535295019638, -326.29239121372461); + bool3x2 r0 = bool3x2(false, true, true, false, false, true); + TestUtils.AreEqual(r0, a0 <= b0); + + double3x2 a1 = double3x2(-97.948485181642923, 437.29539009430232, 458.53029153241323, -294.06474675520542, 23.622613679441884, -34.284056441059363); + double3x2 b1 = double3x2(107.2538764976216, -413.13107342884462, 67.094432623635271, 470.07522724106684, -84.499104777583455, 392.78422683886447); + bool3x2 r1 = bool3x2(true, false, false, true, false, true); + TestUtils.AreEqual(r1, a1 <= b1); + + double3x2 a2 = double3x2(149.736484835733, -418.8866781754823, -197.50252899783783, -88.2055118494693, -376.71814292330208, 341.62712899857536); + double3x2 b2 = double3x2(-263.53175485484849, 369.30090039284005, -333.32529298091555, 238.41347443238533, 486.24259279959028, 279.65021408705513); + bool3x2 r2 = bool3x2(false, true, false, true, true, false); + TestUtils.AreEqual(r2, a2 <= b2); + + double3x2 a3 = double3x2(-83.309179106405566, -107.49073295830317, 319.46688833807912, 205.35738501574724, 345.56372968552807, 395.32190746596177); + double3x2 b3 = double3x2(236.05201803709008, 132.75898248178839, 66.294708998079727, 183.00210699020056, 200.13055071613314, 339.043800750302); + bool3x2 r3 = bool3x2(true, true, false, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void double3x2_operator_less_equal_wide_scalar() + { + double3x2 a0 = double3x2(193.4958237118534, 168.91555197952107, -313.9930695565385, 81.826965131716292, 18.503590830836288, -0.35819602029312136); + double b0 = (443.85054299042122); + bool3x2 r0 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + double3x2 a1 = double3x2(241.36115776810846, -1.3577692515020203, -268.89945591096739, 398.9919504593089, -471.253072242836, -264.93778264938749); + double b1 = (-463.81641242644582); + bool3x2 r1 = bool3x2(false, false, false, false, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + double3x2 a2 = double3x2(82.258299150624453, 424.7040156911612, 426.48223157715154, 56.319978501796754, -196.28791126808522, 31.901173844887467); + double b2 = (11.246050124636895); + bool3x2 r2 = bool3x2(false, false, false, false, true, false); + TestUtils.AreEqual(r2, a2 <= b2); + + double3x2 a3 = double3x2(-152.2575724833913, -37.104814785115821, -47.144214413661587, 333.6230348710078, -274.80387438219225, 358.67627804292192); + double b3 = (-437.92645975478297); + bool3x2 r3 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void double3x2_operator_less_equal_scalar_wide() + { + double a0 = (393.60626644343427); + double3x2 b0 = double3x2(-75.688363825757222, -44.2638714519627, 125.86491566797019, 191.96488174794467, 13.543054825413492, -197.0519259893577); + bool3x2 r0 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 <= b0); + + double a1 = (-423.945100743298); + double3x2 b1 = double3x2(-330.04861680141119, 420.16553779140372, 105.54730777887039, 174.82126363311954, 296.71757831085358, -469.70041845259277); + bool3x2 r1 = bool3x2(true, true, true, true, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + double a2 = (123.26718979853536); + double3x2 b2 = double3x2(112.9969695140594, 495.14339493920249, -488.65789364681478, 388.53941148730894, -493.24077080806751, 16.451064832718657); + bool3x2 r2 = bool3x2(false, true, false, true, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + double a3 = (-387.6516336815672); + double3x2 b3 = double3x2(-229.1773127192526, -373.01533930982248, -391.142134610164, 90.994149488859875, -178.39613517485378, -69.621067317957568); + bool3x2 r3 = bool3x2(true, true, false, true, true, true); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void double3x2_operator_greater_equal_wide_wide() + { + double3x2 a0 = double3x2(-507.92858409692, 504.49748181947393, -385.43449205226938, -262.32340944107784, -37.550928848586466, -111.59527759980193); + double3x2 b0 = double3x2(-81.346509732933043, 297.66615047010885, 171.06540616371922, -431.03805538222105, -6.859075311040101, 319.72570362674333); + bool3x2 r0 = bool3x2(false, true, false, true, false, false); + TestUtils.AreEqual(r0, a0 >= b0); + + double3x2 a1 = double3x2(-463.70202157632542, 387.44885772627265, 456.96878573716094, -211.01015506079892, 182.41135391146474, -53.596053863687473); + double3x2 b1 = double3x2(254.079170106947, 396.5724000393285, 178.83927615864172, -447.06336304501787, 288.49268569075161, 474.88929460704765); + bool3x2 r1 = bool3x2(false, false, true, true, false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + double3x2 a2 = double3x2(-309.57021608463032, -136.02249127999994, 280.73629082401112, -96.9958942388165, -174.05950673579213, 88.9019382413951); + double3x2 b2 = double3x2(-321.75022831640683, -395.97722048125104, -158.69246037243516, 391.48869318118727, -368.10924141859135, 89.1238043723273); + bool3x2 r2 = bool3x2(true, true, true, false, true, false); + TestUtils.AreEqual(r2, a2 >= b2); + + double3x2 a3 = double3x2(43.816040774721728, -446.07842585354967, 16.645595796706857, 409.83252043734888, -191.32987245886113, 222.99782548798146); + double3x2 b3 = double3x2(-510.27932214656812, -486.92979525352354, -81.215552606254619, 274.21882046117389, -212.88155494112596, 288.99530591117); + bool3x2 r3 = bool3x2(true, true, true, true, true, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void double3x2_operator_greater_equal_wide_scalar() + { + double3x2 a0 = double3x2(465.15218732559686, -424.8860745024337, -209.22109685150025, 58.779852656079356, -302.26910533675414, 140.12558252183976); + double b0 = (-5.5998842742293391); + bool3x2 r0 = bool3x2(true, false, false, true, false, true); + TestUtils.AreEqual(r0, a0 >= b0); + + double3x2 a1 = double3x2(16.353385694489475, 393.27804846003562, -315.70155086913218, 441.0115565923096, -509.78156757251435, -36.994287269652943); + double b1 = (-344.55997316192838); + bool3x2 r1 = bool3x2(true, true, true, true, false, true); + TestUtils.AreEqual(r1, a1 >= b1); + + double3x2 a2 = double3x2(494.82028865014217, -466.12009046325466, -123.8137477020797, 215.65121779947128, 104.99569730879534, 314.34603014325069); + double b2 = (-164.97393830352183); + bool3x2 r2 = bool3x2(true, false, true, true, true, true); + TestUtils.AreEqual(r2, a2 >= b2); + + double3x2 a3 = double3x2(190.51609882643265, -23.836435567511444, 143.04935962662535, -264.91997945724052, -169.70222457205051, 329.70751610850334); + double b3 = (-83.111429014760745); + bool3x2 r3 = bool3x2(true, true, true, false, false, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void double3x2_operator_greater_equal_scalar_wide() + { + double a0 = (374.82703393270594); + double3x2 b0 = double3x2(-1.609757185731894, 338.61524049314448, -116.18140392945213, -332.15732375353451, -355.9793509710484, -468.90144107719021); + bool3x2 r0 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + double a1 = (38.579884785497484); + double3x2 b1 = double3x2(-332.34754697063357, 2.8901150240051265, 467.77776477661814, 121.40638762405445, -305.02337303060267, -58.428812292604164); + bool3x2 r1 = bool3x2(true, true, false, false, true, true); + TestUtils.AreEqual(r1, a1 >= b1); + + double a2 = (-226.51955209789776); + double3x2 b2 = double3x2(-47.020994446715804, 305.3026770582901, -427.40123315686418, 92.263649745035764, -497.17853736187266, -408.62564225151465); + bool3x2 r2 = bool3x2(false, false, true, false, true, true); + TestUtils.AreEqual(r2, a2 >= b2); + + double a3 = (-455.23049113491106); + double3x2 b3 = double3x2(396.42608637196292, -469.29488561548987, -485.7540130493017, -182.34619268325446, -291.54536284671417, 278.740809331993); + bool3x2 r3 = bool3x2(false, true, true, false, false, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void double3x2_operator_add_wide_wide() + { + double3x2 a0 = double3x2(506.12905263627374, -501.77980803967444, 420.08479638587903, -186.03206476291274, -9.3123953385801883, 328.51179686585056); + double3x2 b0 = double3x2(-28.757987751047096, -337.135153689019, -340.676816860529, 152.31202633320913, 423.66745420157326, 90.374096674087468); + double3x2 r0 = double3x2(477.37106488522664, -838.91496172869347, 79.407979525350015, -33.720038429703607, 414.35505886299308, 418.885893539938); + TestUtils.AreEqual(r0, a0 + b0); + + double3x2 a1 = double3x2(424.34407659263536, 87.791079800478656, 462.41368148402012, -46.178705952213477, 401.17006296718966, -454.12414643453627); + double3x2 b1 = double3x2(376.18866246574964, 1.7671887882831925, -120.18586045139745, -279.62936628965167, -344.66710273580026, 242.8391956029642); + double3x2 r1 = double3x2(800.532739058385, 89.558268588761848, 342.22782103262267, -325.80807224186515, 56.502960231389409, -211.28495083157208); + TestUtils.AreEqual(r1, a1 + b1); + + double3x2 a2 = double3x2(69.195687564646732, -177.95734485329939, 299.60415544156183, 340.7048587001417, 219.91602740991675, -321.90838232725321); + double3x2 b2 = double3x2(418.5930504363929, -23.312797318823982, -95.099945827899489, 147.92812568877275, 331.03287926830023, -82.502564230236487); + double3x2 r2 = double3x2(487.78873800103963, -201.27014217212337, 204.50420961366234, 488.63298438891445, 550.948906678217, -404.41094655748969); + TestUtils.AreEqual(r2, a2 + b2); + + double3x2 a3 = double3x2(286.35534037573041, -333.41949311523672, -118.93216973120911, 68.607509406566351, 23.190902005504313, -205.57787547147734); + double3x2 b3 = double3x2(279.44956291813844, 342.6227215931857, -300.35853185335105, -209.69408736456842, 446.55942150883345, -351.98918955027557); + double3x2 r3 = double3x2(565.80490329386885, 9.2032284779489828, -419.29070158456017, -141.08657795800207, 469.75032351433777, -557.56706502175291); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void double3x2_operator_add_wide_scalar() + { + double3x2 a0 = double3x2(-194.51420387742769, 338.54838696985894, 246.97140252169754, 100.51093797595752, -45.724677822424439, -478.11131094308166); + double b0 = (124.121678171736); + double3x2 r0 = double3x2(-70.3925257056917, 462.67006514159493, 371.09308069343354, 224.63261614769351, 78.397000349311554, -353.98963277134567); + TestUtils.AreEqual(r0, a0 + b0); + + double3x2 a1 = double3x2(30.916145577522116, -242.1187475855084, 82.50134495762245, 6.7993848355483806, -484.69981287638649, -188.26501068298938); + double b1 = (60.37435224483454); + double3x2 r1 = double3x2(91.290497822356656, -181.74439534067386, 142.875697202457, 67.173737080382921, -424.32546063155195, -127.89065843815484); + TestUtils.AreEqual(r1, a1 + b1); + + double3x2 a2 = double3x2(-213.52673087526426, 189.25996669999324, 198.53359684652355, 187.53610023648298, -424.92567582844089, 302.10236730338181); + double b2 = (-267.78430688929944); + double3x2 r2 = double3x2(-481.31103776456371, -78.5243401893062, -69.250710042775893, -80.248206652816464, -692.70998271774033, 34.318060414082368); + TestUtils.AreEqual(r2, a2 + b2); + + double3x2 a3 = double3x2(300.39907970111778, -200.16134295247559, 31.37822701007974, 362.52213518811493, -423.98885961248953, 432.41331907380993); + double b3 = (124.02158909850823); + double3x2 r3 = double3x2(424.420668799626, -76.139753853967363, 155.39981610858797, 486.54372428662316, -299.9672705139813, 556.43490817231816); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void double3x2_operator_add_scalar_wide() + { + double a0 = (-340.35468284243473); + double3x2 b0 = double3x2(511.36225652665007, -146.21663791789518, -106.21042661844308, -363.45024960276214, 199.08958325120136, -27.108407271610758); + double3x2 r0 = double3x2(171.00757368421534, -486.57132076032991, -446.56510946087781, -703.80493244519687, -141.26509959123337, -367.46309011404549); + TestUtils.AreEqual(r0, a0 + b0); + + double a1 = (419.84900041103788); + double3x2 b1 = double3x2(284.95503748811552, -164.92418129971446, -249.19032561461921, 150.92817718858282, 298.17509784278229, -457.15341803857751); + double3x2 r1 = double3x2(704.8040378991534, 254.92481911132342, 170.65867479641867, 570.7771775996207, 718.02409825382017, -37.304417627539635); + TestUtils.AreEqual(r1, a1 + b1); + + double a2 = (424.71807094324288); + double3x2 b2 = double3x2(-301.85750283946163, 230.28885208363124, -423.58759351428023, -67.060037882560891, 68.7241366229598, -164.02241833695325); + double3x2 r2 = double3x2(122.86056810378125, 655.00692302687412, 1.1304774289626494, 357.658033060682, 493.44220756620268, 260.69565260628963); + TestUtils.AreEqual(r2, a2 + b2); + + double a3 = (318.93515339444161); + double3x2 b3 = double3x2(7.8045504129512437, 187.69836029210046, -3.6569664495331153, -446.0830535581722, -209.28724227160552, -38.212905186327589); + double3x2 r3 = double3x2(326.73970380739286, 506.63351368654207, 315.2781869449085, -127.14790016373058, 109.64791112283609, 280.722248208114); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void double3x2_operator_sub_wide_wide() + { + double3x2 a0 = double3x2(160.4922617229131, 11.223957305412682, 359.20010607279846, -498.22830485656311, -355.25362913462038, -94.534852787170053); + double3x2 b0 = double3x2(115.46876078260539, -130.98230630298252, 241.54083716196044, 9.9870860623135513, 419.89512582304656, 59.124466208333388); + double3x2 r0 = double3x2(45.023500940307713, 142.2062636083952, 117.65926891083802, -508.21539091887666, -775.14875495766694, -153.65931899550344); + TestUtils.AreEqual(r0, a0 - b0); + + double3x2 a1 = double3x2(-410.46404786150163, -401.38464398001537, 317.70681944382693, 447.0604133303558, -489.07414482956477, -230.00838218909149); + double3x2 b1 = double3x2(-402.38163847587145, -75.370143687059226, 320.97960796997859, -73.908757482612884, -31.444742455819949, -389.25194734579509); + double3x2 r1 = double3x2(-8.0824093856301715, -326.01450029295614, -3.2727885261516576, 520.96917081296874, -457.62940237374482, 159.2435651567036); + TestUtils.AreEqual(r1, a1 - b1); + + double3x2 a2 = double3x2(24.875419389864192, 366.61447136784648, -107.3741567634857, -219.0081404275299, 473.90756891384137, 259.63620793988753); + double3x2 b2 = double3x2(-375.02884000122026, 259.18275821357167, 276.648654351313, -453.06919905779381, -272.57653225240136, -191.14805301984217); + double3x2 r2 = double3x2(399.90425939108445, 107.4317131542748, -384.02281111479869, 234.06105863026391, 746.48410116624268, 450.78426095972969); + TestUtils.AreEqual(r2, a2 - b2); + + double3x2 a3 = double3x2(-360.119631219711, 7.8096120393879573, 437.42847439154446, -59.1991718091067, 418.74433322378638, 183.14215072576985); + double3x2 b3 = double3x2(87.136884968325944, 430.02477594373033, 343.65711538105143, 121.02942067060133, -354.1881703595576, 249.05200373802893); + double3x2 r3 = double3x2(-447.25651618803693, -422.21516390434238, 93.771359010493029, -180.22859247970803, 772.932503583344, -65.909853012259077); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void double3x2_operator_sub_wide_scalar() + { + double3x2 a0 = double3x2(207.38960108877609, 248.45773684627272, -384.82393211164697, -205.34476122881506, -374.81156152058929, 191.64204820973896); + double b0 = (-36.112476604111691); + double3x2 r0 = double3x2(243.50207769288778, 284.57021345038441, -348.71145550753528, -169.23228462470337, -338.6990849164776, 227.75452481385065); + TestUtils.AreEqual(r0, a0 - b0); + + double3x2 a1 = double3x2(18.856238135535364, 480.85798738936796, 16.338193185784917, -366.86545269883493, -35.523088233323335, 349.39776460705218); + double b1 = (-44.96160151667965); + double3x2 r1 = double3x2(63.817839652215014, 525.81958890604756, 61.299794702464567, -321.90385118215528, 9.4385132833563148, 394.35936612373183); + TestUtils.AreEqual(r1, a1 - b1); + + double3x2 a2 = double3x2(439.07729336203886, 195.02405104181923, -384.84940952102158, 189.05188545447402, 55.602777745389744, -54.931482579061537); + double b2 = (490.2222661870635); + double3x2 r2 = double3x2(-51.144972825024638, -295.19821514524426, -875.07167570808508, -301.17038073258948, -434.61948844167375, -545.15374876612509); + TestUtils.AreEqual(r2, a2 - b2); + + double3x2 a3 = double3x2(53.088051582261983, -273.80670917863335, 256.88723695319482, 297.17363156805447, 101.82901363346218, 136.60794765157993); + double b3 = (316.80250730961677); + double3x2 r3 = double3x2(-263.71445572735479, -590.60921648825013, -59.915270356421956, -19.628875741562297, -214.97349367615459, -180.19455965803684); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void double3x2_operator_sub_scalar_wide() + { + double a0 = (-86.008225719448262); + double3x2 b0 = double3x2(466.42511413359318, 298.48694219183506, -300.95010652251085, 315.38003006362362, -381.09218543632522, -125.00837546447684); + double3x2 r0 = double3x2(-552.43333985304139, -384.49516791128332, 214.94188080306259, -401.38825578307188, 295.08395971687696, 39.00014974502858); + TestUtils.AreEqual(r0, a0 - b0); + + double a1 = (58.466194418476107); + double3x2 b1 = double3x2(214.74609361158036, -257.54942739082009, 480.22459505508868, -443.35507723472784, 260.79503858312728, 29.681931747906788); + double3x2 r1 = double3x2(-156.27989919310426, 316.01562180929619, -421.75840063661258, 501.82127165320395, -202.32884416465117, 28.784262670569319); + TestUtils.AreEqual(r1, a1 - b1); + + double a2 = (139.85773164586055); + double3x2 b2 = double3x2(-247.78996216868512, -248.4662297929014, 91.445112509394562, 86.384162704639266, 373.81828206303453, 260.41195428576873); + double3x2 r2 = double3x2(387.64769381454568, 388.32396143876196, 48.412619136465992, 53.473568941221288, -233.96055041717398, -120.55422263990818); + TestUtils.AreEqual(r2, a2 - b2); + + double a3 = (114.35393171867076); + double3x2 b3 = double3x2(-464.40545318294573, -109.74146156652898, -311.67535057276268, 107.86401586787031, -258.7951592219971, 14.097560173877355); + double3x2 r3 = double3x2(578.7593849016165, 224.09539328519975, 426.02928229143345, 6.4899158508004575, 373.14909094066786, 100.25637154479341); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void double3x2_operator_mul_wide_wide() + { + double3x2 a0 = double3x2(-482.71381710596097, -407.29348559272171, 137.70058995937029, 208.54113278563182, 194.296573967811, -484.24241684574747); + double3x2 b0 = double3x2(-236.36788355389979, 260.72759139757954, -416.38629718142852, -364.49561541364324, -253.14750897751537, -369.20287220981106); + double3x2 r0 = double3x2(114098.04331156026, -106192.64949051509, -57336.638772880389, -76012.328533757158, -49185.69370281692, 178783.69114527057); + TestUtils.AreEqual(r0, a0 * b0); + + double3x2 a1 = double3x2(183.98730739578014, -241.33547770294149, 45.868758938214114, 363.32610266438041, -328.11893692990714, -471.02307413100408); + double3x2 b1 = double3x2(193.54791531038836, 169.08491976982214, 201.96966442930034, 249.45608317547294, -308.19319810913555, -385.57964843585137); + double3x2 r1 = double3x2(35610.359790024842, -40806.189885013562, 9264.0978505395742, 90633.9064860661, 101124.02453259782, 181616.91132860651); + TestUtils.AreEqual(r1, a1 * b1); + + double3x2 a2 = double3x2(-262.68257415605831, -379.26274674910246, -374.09058182970182, 481.44738720424812, 104.62807397946165, 412.93539948618752); + double3x2 b2 = double3x2(-183.27959522198864, 22.275629292370581, -265.52144229855458, -95.677454277722859, 133.25437146669924, 148.31146080247663); + double3x2 r2 = double3x2(48144.355863192381, -8448.3163509892329, 99329.070837727879, -46063.660376363579, 13942.148235904471, 61243.052314850727); + TestUtils.AreEqual(r2, a2 * b2); + + double3x2 a3 = double3x2(477.87724731763694, 20.377821216535722, 291.99596299417124, -138.48832399141429, -393.46498483860165, 9.36312318284206); + double3x2 b3 = double3x2(249.284127113076, 500.00547503866505, -19.331578978957396, -36.691062705913112, 30.5238278054278, -401.36701054189678); + double3x2 r3 = double3x2(119127.21246477668, 10189.022177626932, -5644.7430201585421, 5081.2837796057929, -12010.057444678736, -3758.048761232847); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void double3x2_operator_mul_wide_scalar() + { + double3x2 a0 = double3x2(-96.318821236639678, -277.14229239017811, -239.93690191951436, 509.53140544776409, 255.85810172551226, 215.73149667295229); + double b0 = (-301.20720424373042); + double3x2 r0 = double3x2(29011.922860739887, 83477.255068544036, 72270.723422079071, -153474.5301092997, -77066.303503849529, -64979.880980175592); + TestUtils.AreEqual(r0, a0 * b0); + + double3x2 a1 = double3x2(-455.50827500573746, -338.29248658674419, 53.796284939067618, 243.75734459783757, 135.35469991311186, -207.35010275959507); + double b1 = (-389.24327367788334); + double3x2 r1 = double3x2(177303.53215059882, 131678.07493965575, -20939.842061390889, -94880.9067942902, -52685.906501867168, 80709.6327955903); + TestUtils.AreEqual(r1, a1 * b1); + + double3x2 a2 = double3x2(-383.93960946795517, 42.676120539510634, 260.38388049806645, 176.86755927692525, 25.672123205695357, -290.50059689697838); + double b2 = (-31.425238862366086); + double3x2 r2 = double3x2(12065.393936254042, -1341.1072816732492, -8182.625640561525, -5558.1052972810685, -806.752603843068, 9129.05064714747); + TestUtils.AreEqual(r2, a2 * b2); + + double3x2 a3 = double3x2(207.09101805793637, -208.4020064847553, 370.94506400215676, -341.59844247512444, 10.270311121954705, -176.88876565587185); + double b3 = (-156.52330858843555); + double3x2 r3 = double3x2(-32414.571325375655, 32619.7715714625, -58061.548722166561, 53468.118424862856, -1607.5430770409582, 27687.214852581492); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void double3x2_operator_mul_scalar_wide() + { + double a0 = (37.432166355397612); + double3x2 b0 = double3x2(96.747546479454058, 492.18539427788244, -274.05458534604617, -452.87096926796761, 420.85330434369541, 102.18292694081686); + double3x2 r0 = double3x2(3621.4702542954869, 18423.565556306661, -10258.456829132712, -16951.941459168724, 15753.450899411988, 3824.9283199300971); + TestUtils.AreEqual(r0, a0 * b0); + + double a1 = (-114.94887762654054); + double3x2 b1 = double3x2(-351.12003843445336, -464.66496799172131, 444.08484646495663, 447.10525605040846, 130.82935124767448, -321.41334191030512); + double3x2 r1 = double3x2(40360.854330228191, 53412.716543020746, -51047.054672101345, -51394.247363921473, -15038.687086528622, 36946.1029067851); + TestUtils.AreEqual(r1, a1 * b1); + + double a2 = (445.30131861441828); + double3x2 b2 = double3x2(478.24357317306271, 358.57170622356784, -144.89011222910608, -438.89383741789209, -3.536441089369589, -471.80755470311624); + double3x2 r2 = double3x2(212962.49375283587, 159672.45359917657, -64519.758029811986, -195440.00453392946, -1574.7818802984877, -210096.52624154196); + TestUtils.AreEqual(r2, a2 * b2); + + double a3 = (-42.560401697904069); + double3x2 b3 = double3x2(119.91104155402218, 271.9000023677479, 239.6840079946835, 487.44143389511919, -79.188288010278825, -112.92564468873928); + double3x2 r3 = double3x2(-5103.4620965532513, -11572.173322432418, -10201.047660817379, -20745.703230778625, 3370.2853474867875, 4806.1607999475309); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void double3x2_operator_div_wide_wide() + { + double3x2 a0 = double3x2(-353.13144390337703, -102.79985456485292, 51.319128298814917, -191.87167868012176, 8.0418245829836223, -128.73764210973758); + double3x2 b0 = double3x2(-178.73954805114283, -302.09628381491467, -199.40583739029518, 278.85077561012042, 502.33758782890516, -361.48483078623417); + double3x2 r0 = double3x2(1.97567604793504, 0.34028837848212429, -0.25736021056579439, -0.68808013268139567, 0.016008805189634039, 0.35613566917796119); + TestUtils.AreEqual(r0, a0 / b0); + + double3x2 a1 = double3x2(-136.05959779399427, -370.4710053738537, -237.69456326109105, -432.54687496300176, 200.26549181727012, 361.44157068871039); + double3x2 b1 = double3x2(353.121059820578, -38.894930142394685, -75.764737402910725, -195.21784719974636, -405.03399224068687, -394.2300085473014); + double3x2 r1 = double3x2(-0.3853058151307277, 9.5249176182488586, 3.1372716570909582, 2.2157137842034547, -0.49444119667433889, -0.9168291678773689); + TestUtils.AreEqual(r1, a1 / b1); + + double3x2 a2 = double3x2(-416.22613234828509, -450.01919362042992, -273.49744594911925, -286.90817011841955, -314.25606241554772, 177.76210340194507); + double3x2 b2 = double3x2(-375.82771342612227, -121.24548655433836, 447.623344391409, 338.28628007429018, -405.54420752336466, -431.16893526127978); + double3x2 r2 = double3x2(1.1074918572499153, 3.7116366671409717, -0.61099906735420106, -0.84812239519560884, 0.77489964493560781, -0.41227947763496636); + TestUtils.AreEqual(r2, a2 / b2); + + double3x2 a3 = double3x2(97.626988217992221, -68.107280047660367, -386.45074027890837, 263.69934690357161, -297.0270885420158, -501.77703046322659); + double3x2 b3 = double3x2(296.20513095343722, 437.939790691221, 39.21061684527001, 331.2897075765253, -310.61955156485533, 207.26946959610541); + double3x2 r3 = double3x2(0.32959249525403717, -0.15551745124635385, -9.855767936625206, 0.79597808465769837, 0.95624080018671487, -2.420892143165184); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void double3x2_operator_div_wide_scalar() + { + double3x2 a0 = double3x2(171.34242184988341, 0.10338377957384637, 57.888263967767443, -256.13074529177078, 95.6696842162263, -290.38690461329509); + double b0 = (171.79682191265601); + double3x2 r0 = double3x2(0.99735501473360411, 0.00060177934855167557, 0.33695771157628673, -1.4908933846400916, 0.55687691513214455, -1.6902926455818372); + TestUtils.AreEqual(r0, a0 / b0); + + double3x2 a1 = double3x2(-127.44869118903239, 146.46688110496234, -499.84355687529012, 58.686315802245531, -453.20579859856787, -205.03382143985192); + double b1 = (-79.7448890580539); + double3x2 r1 = double3x2(1.5982051350808244, -1.8366930198916591, 6.2680325069034382, -0.73592573135968842, 5.6831955496061468, 2.5711217842511296); + TestUtils.AreEqual(r1, a1 / b1); + + double3x2 a2 = double3x2(481.73814247629514, -293.46349753693841, -158.50557930697948, -289.5822156824089, 494.12860535743118, 203.58342680874443); + double b2 = (464.47907159499778); + double3x2 r2 = double3x2(1.0371579085835463, -0.631812099798597, -0.34125451285174013, -0.62345589584477534, 1.0638339498497067, 0.4383048435522599); + TestUtils.AreEqual(r2, a2 / b2); + + double3x2 a3 = double3x2(180.97040160976837, 460.84470603468117, 490.95625924084163, -280.47805536933151, -320.24387112271222, 192.41448912043802); + double b3 = (259.11918723728468); + double3x2 r3 = double3x2(0.69840602519352346, 1.778504752767186, 1.8947120993832676, -1.082428740070444, -1.2358940861814818, 0.7425713671455646); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void double3x2_operator_div_scalar_wide() + { + double a0 = (-264.44250095283729); + double3x2 b0 = double3x2(105.58908157497137, -142.34910137129441, -288.94890679463231, 39.644133824689334, -363.99138396046658, -149.71822006521666); + double3x2 r0 = double3x2(-2.5044492954044237, 1.85770404172122, 0.915187753732487, -6.670406827961755, 0.72650758398599513, 1.7662679988958405); + TestUtils.AreEqual(r0, a0 / b0); + + double a1 = (-395.72912306139671); + double3x2 b1 = double3x2(258.71868693955184, -9.6662514254759344, 117.72553282497711, -331.38655797177296, -509.98602676297821, 427.8964666928614); + double3x2 r1 = double3x2(-1.5295730190291843, 40.939254075104124, -3.3614553577746666, 1.1941616626921372, 0.77596071714591563, -0.92482447008716717); + TestUtils.AreEqual(r1, a1 / b1); + + double a2 = (467.61712882836218); + double3x2 b2 = double3x2(-407.12461943511136, 252.69070994699871, 444.59937664708093, -88.313306134340053, 199.95503411067421, -218.34692607556792); + double3x2 r2 = double3x2(-1.1485847490067898, 1.8505513278523131, 1.0517718948570469, -5.2949793105586425, 2.33861143285614, -2.1416245111988621); + TestUtils.AreEqual(r2, a2 / b2); + + double a3 = (-13.417186028052697); + double3x2 b3 = double3x2(-296.13107575854804, 0.561349630617201, -289.29929865957206, 196.21833929615946, 334.73346845001606, -282.39273203648293); + double3x2 r3 = double3x2(0.045308267609821762, -23.901656465508974, 0.04637821830270366, -0.068378858348207977, -0.04008319242823552, 0.04751250477055232); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void double3x2_operator_mod_wide_wide() + { + double3x2 a0 = double3x2(-388.81249422059045, 181.68118842955732, -167.07872470052854, 432.82015319951813, -258.43895995730486, -170.11079629236406); + double3x2 b0 = double3x2(436.94417187056695, 58.940049437312382, -201.11623368091705, 279.2893537391393, -397.07975954426445, 377.89994758083481); + double3x2 r0 = double3x2(-388.81249422059045, 4.8610401176201776, -167.07872470052854, 153.53079946037883, -258.43895995730486, -170.11079629236406); + TestUtils.AreEqual(r0, a0 % b0); + + double3x2 a1 = double3x2(283.318293464984, 122.71651297561664, 335.27101413126616, -503.60851668920765, 191.02251848532933, 289.74269379756538); + double3x2 b1 = double3x2(174.69386657266591, -228.17652736798698, -317.06019106370405, -417.48011107811709, -249.9759434433542, -397.57157177364991); + double3x2 r1 = double3x2(108.62442689231807, 122.71651297561664, 18.210823067562103, -86.128405611090557, 191.02251848532933, 289.74269379756538); + TestUtils.AreEqual(r1, a1 % b1); + + double3x2 a2 = double3x2(-124.03371745163281, 259.27395761165485, -274.35845030208975, -140.03080398404541, 324.5775689205982, -200.51308903494527); + double3x2 b2 = double3x2(-358.74544947163452, -198.1592100589346, 208.73709378425826, -12.119406944196385, 25.27141596063575, -194.12068495253135); + double3x2 r2 = double3x2(-124.03371745163281, 61.114747552720246, -65.621356517831487, -6.7173275978851734, 21.3205773929692, -6.3924040824139183); + TestUtils.AreEqual(r2, a2 % b2); + + double3x2 a3 = double3x2(211.42317328761476, -51.272212767634642, -230.63392483006879, 99.989400671790122, 399.18986649028489, 24.903281461868119); + double3x2 b3 = double3x2(-493.8717965995296, -312.3016990685378, -216.98060546488529, 413.57096047586344, -436.39440151508637, 3.4912750737235); + double3x2 r3 = double3x2(211.42317328761476, -51.272212767634642, -13.653319365183506, 99.989400671790122, 399.18986649028489, 0.46435594580361794); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void double3x2_operator_mod_wide_scalar() + { + double3x2 a0 = double3x2(-244.49962889612635, -211.81931958525411, -145.92677576184587, -304.91822090042672, 155.47946436492703, -133.90778428591221); + double b0 = (39.634963769295723); + double3x2 r0 = double3x2(-6.6898462803520147, -13.644500738775491, -27.021884453958705, -27.473474515356656, 36.574573057039856, -15.002892978025045); + TestUtils.AreEqual(r0, a0 % b0); + + double3x2 a1 = double3x2(281.30965412841624, 335.16613046041039, 101.70649032560482, 319.47152033423606, -285.40231646476423, -355.84685985923136); + double b1 = (-226.53575311719243); + double3x2 r1 = double3x2(54.773901011223813, 108.63037734321796, 101.70649032560482, 92.935767217043633, -58.8665633475718, -129.31110674203893); + TestUtils.AreEqual(r1, a1 % b1); + + double3x2 a2 = double3x2(259.37800061860025, -284.34358109363518, -102.68343811048356, -172.14173921017988, 206.41684517935698, -416.71365447375626); + double b2 = (-330.87193957477433); + double3x2 r2 = double3x2(259.37800061860025, -284.34358109363518, -102.68343811048356, -172.14173921017988, 206.41684517935698, -85.841714898981934); + TestUtils.AreEqual(r2, a2 % b2); + + double3x2 a3 = double3x2(-339.256669917729, 132.55290490600885, 226.94410215455298, -306.11827268550093, 115.43844633709568, 281.88292015804109); + double b3 = (435.29751440291182); + double3x2 r3 = double3x2(-339.256669917729, 132.55290490600885, 226.94410215455298, -306.11827268550093, 115.43844633709568, 281.88292015804109); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void double3x2_operator_mod_scalar_wide() + { + double a0 = (-66.945025236785909); + double3x2 b0 = double3x2(-249.77609479137516, -396.07375664081133, 386.49204582091977, 168.93948109864232, -199.4182442163202, 261.7517141130528); + double3x2 r0 = double3x2(-66.945025236785909, -66.945025236785909, -66.945025236785909, -66.945025236785909, -66.945025236785909, -66.945025236785909); + TestUtils.AreEqual(r0, a0 % b0); + + double a1 = (16.127438791155555); + double3x2 b1 = double3x2(257.66814744550186, -75.788451945310669, 170.95630439136005, -242.85828005655588, 425.94531913564788, 303.27240409668184); + double3x2 r1 = double3x2(16.127438791155555, 16.127438791155555, 16.127438791155555, 16.127438791155555, 16.127438791155555, 16.127438791155555); + TestUtils.AreEqual(r1, a1 % b1); + + double a2 = (3.033060790520608); + double3x2 b2 = double3x2(-505.74352788633831, 461.95706126743789, 205.97275672013529, 270.04063642678807, -47.480711720642034, -150.254496405951); + double3x2 r2 = double3x2(3.033060790520608, 3.033060790520608, 3.033060790520608, 3.033060790520608, 3.033060790520608, 3.033060790520608); + TestUtils.AreEqual(r2, a2 % b2); + + double a3 = (149.49949009227544); + double3x2 b3 = double3x2(-220.29804263836616, 31.118842377848409, 400.63568348467152, 6.2314283876826266, -39.050740021770252, -71.941097054603063); + double3x2 r3 = double3x2(149.49949009227544, 25.0241205808818, 149.49949009227544, 6.1766371755750242, 32.347270026964679, 5.6172959830693117); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void double3x2_operator_plus() + { + double3x2 a0 = double3x2(-418.82956357432045, -405.79894823851015, -34.041791216489742, 236.99924456188421, -459.83910129025537, 210.8614223985287); + double3x2 r0 = double3x2(-418.82956357432045, -405.79894823851015, -34.041791216489742, 236.99924456188421, -459.83910129025537, 210.8614223985287); + TestUtils.AreEqual(r0, +a0); + + double3x2 a1 = double3x2(293.74197902052754, -386.059833944803, 4.9544198536101476, -418.64524932328857, 504.47483062393724, -170.74650843941907); + double3x2 r1 = double3x2(293.74197902052754, -386.059833944803, 4.9544198536101476, -418.64524932328857, 504.47483062393724, -170.74650843941907); + TestUtils.AreEqual(r1, +a1); + + double3x2 a2 = double3x2(439.55937572920664, 116.40075665172219, 421.40964742256779, -258.5960806620289, 447.86609122150867, 124.16434031546316); + double3x2 r2 = double3x2(439.55937572920664, 116.40075665172219, 421.40964742256779, -258.5960806620289, 447.86609122150867, 124.16434031546316); + TestUtils.AreEqual(r2, +a2); + + double3x2 a3 = double3x2(222.17254386757156, 239.04183947250328, 498.4495329793773, -139.382530515726, 279.07295549990283, 108.7758186370022); + double3x2 r3 = double3x2(222.17254386757156, 239.04183947250328, 498.4495329793773, -139.382530515726, 279.07295549990283, 108.7758186370022); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void double3x2_operator_neg() + { + double3x2 a0 = double3x2(148.46174890755753, -467.12267873581624, 132.04719954917539, 183.52262290917463, 473.7010145009034, -407.99109024926605); + double3x2 r0 = double3x2(-148.46174890755753, 467.12267873581624, -132.04719954917539, -183.52262290917463, -473.7010145009034, 407.99109024926605); + TestUtils.AreEqual(r0, -a0); + + double3x2 a1 = double3x2(-54.958759571872065, -299.09338893512887, -383.01406377508027, 407.70980305583669, 168.73550351370852, 466.44152829909763); + double3x2 r1 = double3x2(54.958759571872065, 299.09338893512887, 383.01406377508027, -407.70980305583669, -168.73550351370852, -466.44152829909763); + TestUtils.AreEqual(r1, -a1); + + double3x2 a2 = double3x2(171.90249474900895, -78.85761622286293, 318.69633522569029, -39.91539694737429, 140.34000284054321, 132.19563180403577); + double3x2 r2 = double3x2(-171.90249474900895, 78.85761622286293, -318.69633522569029, 39.91539694737429, -140.34000284054321, -132.19563180403577); + TestUtils.AreEqual(r2, -a2); + + double3x2 a3 = double3x2(-505.89525127126615, -237.05693375182193, -137.617827241131, -245.34998547534923, 422.52133222227974, -434.57134386271764); + double3x2 r3 = double3x2(505.89525127126615, 237.05693375182193, 137.617827241131, 245.34998547534923, -422.52133222227974, 434.57134386271764); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void double3x2_operator_prefix_inc() + { + double3x2 a0 = double3x2(-139.84208137348389, -56.743654039103376, -381.955324589254, 509.79634380237962, -222.89634452708827, 210.31986556310198); + double3x2 r0 = double3x2(-138.84208137348389, -55.743654039103376, -380.955324589254, 510.79634380237962, -221.89634452708827, 211.31986556310198); + TestUtils.AreEqual(r0, ++a0); + + double3x2 a1 = double3x2(-392.73151058365193, 362.21273939787068, 401.614830919362, 130.90919429199266, -450.23016402229212, 243.54693114177644); + double3x2 r1 = double3x2(-391.73151058365193, 363.21273939787068, 402.614830919362, 131.90919429199266, -449.23016402229212, 244.54693114177644); + TestUtils.AreEqual(r1, ++a1); + + double3x2 a2 = double3x2(46.19202735190845, 299.18547000511808, 154.35656530892311, -281.23327435237974, 200.70599922943211, 92.957765384091886); + double3x2 r2 = double3x2(47.19202735190845, 300.18547000511808, 155.35656530892311, -280.23327435237974, 201.70599922943211, 93.957765384091886); + TestUtils.AreEqual(r2, ++a2); + + double3x2 a3 = double3x2(448.60215565590283, 18.499063262016989, -215.71113381893895, 471.94723651928234, 257.07660090973445, 41.625937719655212); + double3x2 r3 = double3x2(449.60215565590283, 19.499063262016989, -214.71113381893895, 472.94723651928234, 258.07660090973445, 42.625937719655212); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void double3x2_operator_postfix_inc() + { + double3x2 a0 = double3x2(-396.6697396695007, 511.20749378167443, 249.11127030528678, -128.81731301584153, -259.49027669592306, 278.00817764830219); + double3x2 r0 = double3x2(-396.6697396695007, 511.20749378167443, 249.11127030528678, -128.81731301584153, -259.49027669592306, 278.00817764830219); + TestUtils.AreEqual(r0, a0++); + + double3x2 a1 = double3x2(-81.393423356764686, 167.85212691493894, 147.94395048354932, -326.10758486674524, 41.033564825092185, 128.5304239394751); + double3x2 r1 = double3x2(-81.393423356764686, 167.85212691493894, 147.94395048354932, -326.10758486674524, 41.033564825092185, 128.5304239394751); + TestUtils.AreEqual(r1, a1++); + + double3x2 a2 = double3x2(73.155582223625629, -446.22976490772783, -296.93783797739906, 267.29380071689081, 446.22930714405572, 49.200223230384381); + double3x2 r2 = double3x2(73.155582223625629, -446.22976490772783, -296.93783797739906, 267.29380071689081, 446.22930714405572, 49.200223230384381); + TestUtils.AreEqual(r2, a2++); + + double3x2 a3 = double3x2(-326.64314738225335, 471.64748762159024, -171.01308186865089, 310.72735967800361, -298.91717185588425, 489.98497008252184); + double3x2 r3 = double3x2(-326.64314738225335, 471.64748762159024, -171.01308186865089, 310.72735967800361, -298.91717185588425, 489.98497008252184); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void double3x2_operator_prefix_dec() + { + double3x2 a0 = double3x2(123.12869626056806, 256.8437465433235, 156.33078844674435, 461.73742530389563, 325.86799755965728, 392.01561731473339); + double3x2 r0 = double3x2(122.12869626056806, 255.8437465433235, 155.33078844674435, 460.73742530389563, 324.86799755965728, 391.01561731473339); + TestUtils.AreEqual(r0, --a0); + + double3x2 a1 = double3x2(187.87412580655609, 125.10963517292851, 469.8447313112415, 45.536655685648611, 376.04684680329956, -363.07547991493504); + double3x2 r1 = double3x2(186.87412580655609, 124.10963517292851, 468.8447313112415, 44.536655685648611, 375.04684680329956, -364.07547991493504); + TestUtils.AreEqual(r1, --a1); + + double3x2 a2 = double3x2(-22.028951416736902, 168.0950144120003, 168.26565011230559, -190.284744112885, 166.9455474200405, 183.95795854551625); + double3x2 r2 = double3x2(-23.028951416736902, 167.0950144120003, 167.26565011230559, -191.284744112885, 165.9455474200405, 182.95795854551625); + TestUtils.AreEqual(r2, --a2); + + double3x2 a3 = double3x2(485.69469259944492, 89.569894117102876, -267.42982090051743, 201.75623450137505, -141.21688682456357, -217.48409782046645); + double3x2 r3 = double3x2(484.69469259944492, 88.569894117102876, -268.42982090051743, 200.75623450137505, -142.21688682456357, -218.48409782046645); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void double3x2_operator_postfix_dec() + { + double3x2 a0 = double3x2(379.68831723727669, 302.69287814884115, -176.07134040448409, -291.25267066212962, 470.56758401848731, -402.92594666170231); + double3x2 r0 = double3x2(379.68831723727669, 302.69287814884115, -176.07134040448409, -291.25267066212962, 470.56758401848731, -402.92594666170231); + TestUtils.AreEqual(r0, a0--); + + double3x2 a1 = double3x2(-63.655158787805192, -27.889220489137415, -100.76183824462902, 156.14034969924967, 479.94519613680677, -200.30429491787419); + double3x2 r1 = double3x2(-63.655158787805192, -27.889220489137415, -100.76183824462902, 156.14034969924967, 479.94519613680677, -200.30429491787419); + TestUtils.AreEqual(r1, a1--); + + double3x2 a2 = double3x2(-445.0269393609031, 327.67032519340069, 48.0602071509046, -209.66798100698179, -38.435048836485976, 283.941595924991); + double3x2 r2 = double3x2(-445.0269393609031, 327.67032519340069, 48.0602071509046, -209.66798100698179, -38.435048836485976, 283.941595924991); + TestUtils.AreEqual(r2, a2--); + + double3x2 a3 = double3x2(-94.802087112703418, -287.262531175866, -215.94803939384781, -407.04635567546188, 159.23357136511879, -359.45648663093175); + double3x2 r3 = double3x2(-94.802087112703418, -287.262531175866, -215.94803939384781, -407.04635567546188, 159.23357136511879, -359.45648663093175); + TestUtils.AreEqual(r3, a3--); + } + + [TestCase /* For player builds */] + public static void double3x2_EqualsObjectOverride() + { + TestUtils.IsFalse(new double3x2().Equals((object)new int())); + TestUtils.IsTrue(new double3x2().Equals((object)new double3x2())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestDouble3x2.gen.cs.meta b/src/Tests/Tests/Shared/TestDouble3x2.gen.cs.meta new file mode 100644 index 00000000..26df49cc --- /dev/null +++ b/src/Tests/Tests/Shared/TestDouble3x2.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f95b40a83bedc474aa2badff08c0b04b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestDouble3x3.gen.cs b/src/Tests/Tests/Shared/TestDouble3x3.gen.cs new file mode 100644 index 00000000..d066be3d --- /dev/null +++ b/src/Tests/Tests/Shared/TestDouble3x3.gen.cs @@ -0,0 +1,967 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestDouble3x3 + { + [TestCompiler] + public static void double3x3_zero() + { + TestUtils.AreEqual(0.0, double3x3.zero.c0.x); + TestUtils.AreEqual(0.0, double3x3.zero.c0.y); + TestUtils.AreEqual(0.0, double3x3.zero.c0.z); + TestUtils.AreEqual(0.0, double3x3.zero.c1.x); + TestUtils.AreEqual(0.0, double3x3.zero.c1.y); + TestUtils.AreEqual(0.0, double3x3.zero.c1.z); + TestUtils.AreEqual(0.0, double3x3.zero.c2.x); + TestUtils.AreEqual(0.0, double3x3.zero.c2.y); + TestUtils.AreEqual(0.0, double3x3.zero.c2.z); + } + + [TestCompiler] + public static void double3x3_identity() + { + TestUtils.AreEqual(1.0, double3x3.identity.c0.x); + TestUtils.AreEqual(0.0, double3x3.identity.c0.y); + TestUtils.AreEqual(0.0, double3x3.identity.c0.z); + TestUtils.AreEqual(0.0, double3x3.identity.c1.x); + TestUtils.AreEqual(1.0, double3x3.identity.c1.y); + TestUtils.AreEqual(0.0, double3x3.identity.c1.z); + TestUtils.AreEqual(0.0, double3x3.identity.c2.x); + TestUtils.AreEqual(0.0, double3x3.identity.c2.y); + TestUtils.AreEqual(1.0, double3x3.identity.c2.z); + } + + [TestCompiler] + public static void double3x3_operator_equal_wide_wide() + { + double3x3 a0 = double3x3(492.15758275061728, -495.20632027797694, 227.45765195947968, -147.37405950733182, -222.68201909897942, 64.093720704360749, -23.890404473939157, -16.8197190839889, 163.23210890741655); + double3x3 b0 = double3x3(192.56880888369346, -235.61102472786376, -254.04311740307281, -412.62472052715009, 471.90480945627428, -6.4727852374654162, -339.10237447316865, 488.1875700839737, -379.5965842584132); + bool3x3 r0 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + double3x3 a1 = double3x3(-165.27101071424363, 470.87767980568003, -423.94255967808078, 109.63436918595539, 462.69031283943468, -335.38147727371262, 357.23446934168896, 1.5455777652308598, -347.38824741327585); + double3x3 b1 = double3x3(-308.41700258311675, -82.333374300195544, -102.92108087563935, 226.51573835430463, -356.90132896830391, -362.91277544708589, -427.89843746083716, 466.65013978753711, -102.79904680270658); + bool3x3 r1 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + double3x3 a2 = double3x3(-114.47217302884542, 435.84865804940864, 194.23808607563285, 138.76554710174241, -467.34914205379278, 370.43337767684523, 476.70826147343416, 320.55264702465047, -498.59197377534207); + double3x3 b2 = double3x3(-43.355954428834821, 85.045664111639212, -91.127054972167628, 422.19208856215334, -477.43130873024057, 1.8770024785198984, 312.5800799394865, 254.59934365684137, 352.72583763335172); + bool3x3 r2 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + double3x3 a3 = double3x3(92.4169581366782, 104.51136856177425, 166.75460608618084, -204.73343024250744, 434.75675674656259, -397.32965988541469, 503.98163699730378, -503.7141270598928, 90.659743112819115); + double3x3 b3 = double3x3(62.490957050812881, 119.71476059766246, -511.05808639482507, -302.47273053902791, -371.76924365189359, -20.007841834802093, 21.459455738523729, -426.02067228128232, -305.41193666374863); + bool3x3 r3 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void double3x3_operator_equal_wide_scalar() + { + double3x3 a0 = double3x3(-303.2300766926399, 451.52631327674089, -253.65587413201848, -105.20363502632995, -500.6910920090466, -426.19248338518315, 159.87609656149334, -59.558379439431405, -57.477391031327386); + double b0 = (123.5445759871717); + bool3x3 r0 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + double3x3 a1 = double3x3(-182.04973968400139, 370.88599866017978, -172.03530629539642, 455.40001198993991, -11.338988547836891, 363.93823044557973, -27.150561106927, -325.97606507221985, -290.35904254129116); + double b1 = (406.51375861024189); + bool3x3 r1 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + double3x3 a2 = double3x3(180.19686635779067, -439.35894295170851, -126.54608899287234, -197.2617896521752, -227.15933357326281, -479.8991937487848, -439.77767750237962, -495.23734902555, -224.51705013239621); + double b2 = (-374.12832015293105); + bool3x3 r2 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + double3x3 a3 = double3x3(-422.83322616239695, -20.106708774392814, 297.37999906082632, 185.9665759475746, -102.97598962810633, -220.59704910060253, -228.686854707397, -333.00125972041917, 434.2130317325765); + double b3 = (-450.19627043707123); + bool3x3 r3 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void double3x3_operator_equal_scalar_wide() + { + double a0 = (-253.39728534100453); + double3x3 b0 = double3x3(19.952187785856495, -185.79199346610903, 407.8136052600172, -87.2766969610363, -206.27469382354741, 160.503138855334, -274.77081478516141, -2.6315281403397535, 448.35453602688131); + bool3x3 r0 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + double a1 = (-410.03524251004461); + double3x3 b1 = double3x3(247.32901465489022, 355.53915350303942, -298.06671180299793, 414.10151429385951, -481.30262707234482, 196.55074438664633, 34.60100008668428, 113.76156645350227, -386.45337861890596); + bool3x3 r1 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + double a2 = (-124.49174672201821); + double3x3 b2 = double3x3(243.8866447153905, -492.6181826501238, 145.424413033493, 421.55070968230757, -95.409988209330493, 336.80928746648567, 209.58380589707929, 487.441424358376, 161.80653365040507); + bool3x3 r2 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + double a3 = (149.84247095409899); + double3x3 b3 = double3x3(225.723996505944, -71.21880176999548, 85.780251781353854, 192.547256797807, -49.887493395194156, -229.80195652218629, -103.40733413743197, 19.215747126944279, 492.88110827509365); + bool3x3 r3 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void double3x3_operator_not_equal_wide_wide() + { + double3x3 a0 = double3x3(430.8425316432689, 104.69001798736394, 225.80243478799355, -310.57017841496048, -418.61945815506363, 304.12820281839379, -509.32682561749908, -160.53807719076895, -203.30197606016975); + double3x3 b0 = double3x3(210.02470622305975, -55.203330304102678, -269.92533672504373, -234.54673372700194, 25.917412054686565, -63.726991444699024, -484.55371092471933, -425.333599050219, -53.274394775402925); + bool3x3 r0 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + double3x3 a1 = double3x3(-505.76325368590807, 162.17220623892365, 1.1561973100324394, 65.662074358045174, 102.78780250567377, 172.93008120960098, 26.621009123800832, 235.12595259171258, 128.54198533321824); + double3x3 b1 = double3x3(328.1944192984115, 15.963139303011417, 461.71412417931208, -113.36304455313973, -240.07297264787974, 495.11916970420589, 203.5583661550462, 340.49345103860526, -241.90719448863865); + bool3x3 r1 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + double3x3 a2 = double3x3(-354.99697630246959, 334.35948220564023, -495.83200692377613, 468.30740163675853, 458.37094733601941, 299.93733300824522, 43.12718560319729, -354.71349994964595, -145.28719551176169); + double3x3 b2 = double3x3(459.56982896270688, 213.0737384357833, -384.7828506831, -255.07233846144396, 477.66343115161328, -248.03662621604121, -407.92344565313471, -199.78886971240343, 151.84326488889906); + bool3x3 r2 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + double3x3 a3 = double3x3(390.80186218340032, -303.13149108697263, 391.13459533785215, 139.2868607692825, 104.52318506339714, 511.29640293088573, 213.1470559635884, -101.09569625793756, 441.6633772522506); + double3x3 b3 = double3x3(-97.120607659742518, 154.97589380805186, -172.83452065886672, 441.5027942329192, -401.73862785926957, -411.43016333665241, -337.8202766561044, -430.63088270213029, -150.87180502287663); + bool3x3 r3 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void double3x3_operator_not_equal_wide_scalar() + { + double3x3 a0 = double3x3(-16.914588697680529, 168.83411486858233, -462.71352145760949, 130.30776959765137, 214.50161443208424, -440.26328178879959, -197.12796053529155, -169.09985860115842, -386.61117595555783); + double b0 = (-145.37277109239847); + bool3x3 r0 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + double3x3 a1 = double3x3(-281.02101362916687, -403.96372313236992, -269.80570877241234, 299.65422763473089, -71.750904831919286, -432.75573917513515, -457.36312100727258, -13.519590622521719, 273.87305773136814); + double b1 = (-270.26885593601912); + bool3x3 r1 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + double3x3 a2 = double3x3(185.042454567292, 116.39514427836764, 511.73495578753523, 230.50753628020527, 100.27476768394683, 129.68240863163135, 321.17879048044733, -220.63900409482375, 140.33521921016984); + double b2 = (-482.53069351731364); + bool3x3 r2 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + double3x3 a3 = double3x3(369.2123617461009, -333.66624871532724, -373.93775218256644, 150.20429451307484, -442.16476627912596, 372.32001488856974, -95.837970539852051, 495.56669663617697, -5.385580780629823); + double b3 = (453.81121489676241); + bool3x3 r3 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void double3x3_operator_not_equal_scalar_wide() + { + double a0 = (275.79582823244664); + double3x3 b0 = double3x3(-57.196896341255353, -382.4325279586169, 97.820359990848374, -161.46364529499022, -458.39563367254829, -499.61786364932448, 327.92217818271467, 367.57121699283425, 59.7863667289663); + bool3x3 r0 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + double a1 = (-209.58068118318016); + double3x3 b1 = double3x3(-62.580453186566217, -479.97497604786184, -49.494519495169868, -114.68521338081229, 109.93924599044919, -176.28482755286842, -347.48529903380449, 85.540928165214609, -356.65954868712441); + bool3x3 r1 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + double a2 = (-104.24357490625397); + double3x3 b2 = double3x3(-133.54918605347592, 243.53971135036079, 13.141311890045813, -379.98594754747393, -41.281226892620907, 87.911684792447659, -339.07727996403224, -371.82034533648766, 333.14425936953364); + bool3x3 r2 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + double a3 = (294.81196011920088); + double3x3 b3 = double3x3(-187.14565977228136, 220.19225774528093, -228.18207250730234, -499.72373914146971, 97.4059055305114, 501.60439395420462, 459.67539880223353, 158.09812290877949, 358.48858921531985); + bool3x3 r3 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void double3x3_operator_less_wide_wide() + { + double3x3 a0 = double3x3(196.84256825076534, 336.40979997087732, 251.96372115424072, 257.65591466503963, 430.04588647840819, -62.419644146421774, 8.8392293494376872, -333.81671563434259, 164.67880662003472); + double3x3 b0 = double3x3(-465.34502313348696, -256.15239751346053, -314.814018634527, 364.56673662949663, 100.21050290959442, 182.56098636545289, 3.116978885194726, -259.43047893207074, -437.33490749696966); + bool3x3 r0 = bool3x3(false, false, false, true, false, true, false, true, false); + TestUtils.AreEqual(r0, a0 < b0); + + double3x3 a1 = double3x3(-350.94487516532877, 3.84143662631584, 125.40972024081725, -111.12994127680076, 70.005523475820951, 448.19828173527412, -419.98711200244122, -258.30166757213965, -34.832201735504043); + double3x3 b1 = double3x3(-456.0437321402336, -394.2559718537405, 401.91369099259077, 313.43916454605721, 121.28668194696616, -28.012290729215522, -282.96589697663012, 330.06440631023816, 124.09937077579059); + bool3x3 r1 = bool3x3(false, false, true, true, true, false, true, true, true); + TestUtils.AreEqual(r1, a1 < b1); + + double3x3 a2 = double3x3(-69.859397682295821, 67.767227442826766, -139.77729207825723, 385.43464130229995, 133.707390609061, 506.18837117878184, 34.442885653322037, 412.11373896715872, -84.809773246203463); + double3x3 b2 = double3x3(-183.69031700104955, 373.0607623406969, 109.75094013556418, -203.57134232463841, 45.6486556742567, -360.95226280808089, 211.91309867236441, -313.28636207863985, -259.66108691862837); + bool3x3 r2 = bool3x3(false, true, true, false, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + double3x3 a3 = double3x3(444.78534504621541, -78.754743374304269, 366.97754376334024, 127.18045788965208, 428.36845489422251, 8.1976149120356467, -71.137346062407516, -474.05081937930117, 322.42891875022508); + double3x3 b3 = double3x3(79.0985401045059, 446.49610897828643, 450.52455660818362, -375.63076728192658, -53.941822792376286, -291.4537471697916, 190.77482303919965, 54.083913589866825, -163.63087637891567); + bool3x3 r3 = bool3x3(false, true, true, false, false, false, true, true, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void double3x3_operator_less_wide_scalar() + { + double3x3 a0 = double3x3(-132.05731708000292, -192.46500477216438, -66.834607870706634, -379.01750081545561, -360.28242199508588, 20.927834282129879, -158.24074537970159, 437.34587522845061, -20.452607402788772); + double b0 = (-156.01021845452965); + bool3x3 r0 = bool3x3(false, true, false, true, true, false, true, false, false); + TestUtils.AreEqual(r0, a0 < b0); + + double3x3 a1 = double3x3(225.29148517609178, 274.01523292903562, 373.54965584983563, 398.52368301829495, 105.0301654827922, -58.010895994496934, 109.67008810381878, -108.853174498702, -44.971252223929014); + double b1 = (307.48418607725023); + bool3x3 r1 = bool3x3(true, true, false, false, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 < b1); + + double3x3 a2 = double3x3(140.42607147080173, 172.10334857371788, -197.50074610370245, -7.27149987559369, -432.99049898283113, 62.158315449095426, -72.254720959931035, -377.85232299279994, -500.25573586870718); + double b2 = (-500.08827638071415); + bool3x3 r2 = bool3x3(false, false, false, false, false, false, false, false, true); + TestUtils.AreEqual(r2, a2 < b2); + + double3x3 a3 = double3x3(149.1149638393498, 202.63918909925928, 274.95066393304182, 66.4120323967245, 274.99944580486022, -149.63581402117194, 223.75870834279749, 73.266824041151835, 213.09497390179661); + double b3 = (119.88061695912882); + bool3x3 r3 = bool3x3(false, false, false, true, false, true, false, true, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void double3x3_operator_less_scalar_wide() + { + double a0 = (-423.117411095238); + double3x3 b0 = double3x3(385.09483617595151, -123.93348532725753, 86.376572887588509, 133.44217378154497, 161.45794947513286, 229.75426660746064, 222.57159934871436, 315.53116360098647, -447.20351883731945); + bool3x3 r0 = bool3x3(true, true, true, true, true, true, true, true, false); + TestUtils.AreEqual(r0, a0 < b0); + + double a1 = (271.83385790131695); + double3x3 b1 = double3x3(-393.60531324595462, 317.48689737798964, -164.6051085761772, -282.87605370342544, 296.97953071118309, -254.40115582868509, 365.61562054493265, -441.98425671178114, -131.42866021554391); + bool3x3 r1 = bool3x3(false, true, false, false, true, false, true, false, false); + TestUtils.AreEqual(r1, a1 < b1); + + double a2 = (442.62897631275882); + double3x3 b2 = double3x3(-29.792842163607872, -138.37379533535511, 9.2169721169476588, -226.7305482489665, 171.02944310523083, 376.62522595777421, -462.58872697436658, -142.36729795409707, -456.25377414014832); + bool3x3 r2 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + double a3 = (66.6102416825529); + double3x3 b3 = double3x3(169.37875779409831, 327.44439450253003, 64.0879266560487, -153.50390369887646, 199.38014921889646, -244.96905314408662, 472.74382112582396, -363.78010075342843, -179.48750575794259); + bool3x3 r3 = bool3x3(true, true, false, false, true, false, true, false, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void double3x3_operator_greater_wide_wide() + { + double3x3 a0 = double3x3(483.50140141113729, 310.81563415695712, 106.9661896726891, 295.73526038589671, 116.95757179938141, -478.29977653841479, -14.897393471979228, -33.817441717636484, -24.740548383789417); + double3x3 b0 = double3x3(-471.39802454011425, -371.98528617060992, 36.900723236101044, -316.76360407320954, 19.683055648432628, 207.3091381561519, 362.79748861994483, 324.95341816775192, 340.94807140014507); + bool3x3 r0 = bool3x3(true, true, true, true, true, false, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + double3x3 a1 = double3x3(319.78262701620474, -120.15856581561201, -289.00857962714906, 455.85146662958505, 144.70691139283917, 63.931990891663304, -285.68304099034663, -502.0907201720824, -337.19446412529538); + double3x3 b1 = double3x3(25.986035120666997, -114.2111352021858, 240.80346428640348, 273.42244757033063, 325.51576224226312, 27.341068995809678, 64.479532510265472, 200.94836983501375, 100.12266998184964); + bool3x3 r1 = bool3x3(true, false, false, true, false, true, false, false, false); + TestUtils.AreEqual(r1, a1 > b1); + + double3x3 a2 = double3x3(474.31734274063137, -507.14510679018923, -133.56559735795742, -443.10913654934109, -464.34137056038776, -68.361549647693323, -185.99299987870876, -157.80389340119615, -74.124229227250567); + double3x3 b2 = double3x3(-79.00710896356361, -315.137945560337, -122.98542815213347, -163.77920229908972, -492.56600617457462, -90.797273439726439, -284.9012335673446, -23.653687249707843, 174.93002112905026); + bool3x3 r2 = bool3x3(true, false, false, false, true, true, true, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + double3x3 a3 = double3x3(-94.471165939453613, 329.61055508703487, -315.83675280019486, 404.193811843262, 131.30440503512716, -206.6339033612208, 197.39985832823436, 187.99195274524016, 362.63607542712055); + double3x3 b3 = double3x3(85.7125366133231, -441.98783012944637, 345.54374210235835, 482.21949814363359, -422.38349719642827, -30.779309048680261, 296.15423669300708, 378.05988830051376, -457.73343942022575); + bool3x3 r3 = bool3x3(false, true, false, false, true, false, false, false, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void double3x3_operator_greater_wide_scalar() + { + double3x3 a0 = double3x3(64.317918092160426, -397.70346445483318, 431.87690826499693, 85.702980796668157, 246.26305233978803, 197.49155602114809, 286.1994608781298, 280.81334818564972, -405.78459210218148); + double b0 = (305.85991992888034); + bool3x3 r0 = bool3x3(false, false, true, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + double3x3 a1 = double3x3(171.56538661362856, 333.57817498481745, 370.27919524269146, -413.70138116073861, -356.5923551789449, -353.03129522550444, 396.64532608382649, 467.22205541432936, -240.0134228393498); + double b1 = (-241.80727326209063); + bool3x3 r1 = bool3x3(true, true, true, false, false, false, true, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + double3x3 a2 = double3x3(502.91505193287276, -259.28970134411458, 281.23064554912537, 428.79219909608, 245.15306460352292, -279.17542494422543, -453.86309668694764, -124.77154856769909, -425.65293451103054); + double b2 = (315.46759024051369); + bool3x3 r2 = bool3x3(true, false, false, true, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + double3x3 a3 = double3x3(99.132852838902181, -456.43941256796916, 154.48902208846482, 405.52974409867534, -157.73379643155903, 186.08628639303436, 249.99909531790718, -110.0969179189284, -435.3045134187231); + double b3 = (355.0605339273161); + bool3x3 r3 = bool3x3(false, false, false, true, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void double3x3_operator_greater_scalar_wide() + { + double a0 = (-282.67049635698572); + double3x3 b0 = double3x3(358.09997360692353, -72.5964134077525, -232.16380106292843, -60.706723956720282, 75.156642710397364, 150.88350040786133, 339.53917924479538, -498.19602965665797, 459.74610326241054); + bool3x3 r0 = bool3x3(false, false, false, false, false, false, false, true, false); + TestUtils.AreEqual(r0, a0 > b0); + + double a1 = (-227.96872316485678); + double3x3 b1 = double3x3(335.86213485145106, 76.178844248959308, 296.85993899817572, 177.49000390688423, -281.20120657663847, 244.72285162877427, 137.32857257562159, -385.33824724021287, 443.16345879210326); + bool3x3 r1 = bool3x3(false, false, false, false, true, false, false, true, false); + TestUtils.AreEqual(r1, a1 > b1); + + double a2 = (-353.56254141105455); + double3x3 b2 = double3x3(26.040673983302327, -331.7939499969566, -43.691963454565041, 20.949428806523542, -211.17984423934473, 227.42171894173214, -84.7797711290325, -375.13548701588786, -205.17813096064054); + bool3x3 r2 = bool3x3(false, false, false, false, false, false, false, true, false); + TestUtils.AreEqual(r2, a2 > b2); + + double a3 = (-197.04714617368165); + double3x3 b3 = double3x3(-219.63402305340117, -210.01563344244641, -266.773715858708, 144.77848703450456, -471.71120069535039, -155.91317494023275, 99.724721716588647, -230.94484316135981, -338.86889640375455); + bool3x3 r3 = bool3x3(true, true, true, false, true, false, false, true, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void double3x3_operator_less_equal_wide_wide() + { + double3x3 a0 = double3x3(-438.52313753521219, 210.48942837980087, 4.8773329280677444, -137.29793817237857, 156.09410174009111, -363.92412035722475, -97.948485181642923, 437.29539009430232, 458.53029153241323); + double3x3 b0 = double3x3(-474.8141498392514, 304.3710555063426, 234.8241737982371, -390.48543209139513, -297.17535295019638, -326.29239121372461, 107.2538764976216, -413.13107342884462, 67.094432623635271); + bool3x3 r0 = bool3x3(false, true, true, false, false, true, true, false, false); + TestUtils.AreEqual(r0, a0 <= b0); + + double3x3 a1 = double3x3(-294.06474675520542, 23.622613679441884, -34.284056441059363, 149.736484835733, -418.8866781754823, -197.50252899783783, -88.2055118494693, -376.71814292330208, 341.62712899857536); + double3x3 b1 = double3x3(470.07522724106684, -84.499104777583455, 392.78422683886447, -263.53175485484849, 369.30090039284005, -333.32529298091555, 238.41347443238533, 486.24259279959028, 279.65021408705513); + bool3x3 r1 = bool3x3(true, false, true, false, true, false, true, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + double3x3 a2 = double3x3(-83.309179106405566, -107.49073295830317, 319.46688833807912, 205.35738501574724, 345.56372968552807, 395.32190746596177, -222.87415490992095, 439.02200790821666, -368.0755667016262); + double3x3 b2 = double3x3(236.05201803709008, 132.75898248178839, 66.294708998079727, 183.00210699020056, 200.13055071613314, 339.043800750302, 438.53791710293751, 145.40187866306019, 178.16310199450845); + bool3x3 r2 = bool3x3(true, true, false, false, false, false, true, false, true); + TestUtils.AreEqual(r2, a2 <= b2); + + double3x3 a3 = double3x3(-200.03860173003682, 71.46990660180802, -357.36542932939039, 141.7108519737194, 319.0170969064427, 303.03015889927292, -461.57424829042247, 277.62674749904625, 182.178105677561); + double3x3 b3 = double3x3(157.97596724237133, 329.7052015409364, -243.59091221708383, 5.4011614347813293, -22.580605278993289, -90.33759478961008, -72.19107798123315, -354.35482399275281, -289.52172650467685); + bool3x3 r3 = bool3x3(true, true, true, false, false, false, true, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void double3x3_operator_less_equal_wide_scalar() + { + double3x3 a0 = double3x3(193.4958237118534, 168.91555197952107, -313.9930695565385, 81.826965131716292, 18.503590830836288, -0.35819602029312136, 241.36115776810846, -463.81641242644582, -1.3577692515020203); + double b0 = (443.85054299042122); + bool3x3 r0 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + double3x3 a1 = double3x3(-268.89945591096739, -471.253072242836, -264.93778264938749, 82.258299150624453, 11.246050124636895, 424.7040156911612, 426.48223157715154, 56.319978501796754, -196.28791126808522); + double b1 = (398.9919504593089); + bool3x3 r1 = bool3x3(true, true, true, true, true, false, false, true, true); + TestUtils.AreEqual(r1, a1 <= b1); + + double3x3 a2 = double3x3(31.901173844887467, -437.92645975478297, -37.104814785115821, -47.144214413661587, 333.6230348710078, -274.80387438219225, 358.67627804292192, -260.46056926458169, 192.30916008367626); + double b2 = (-152.2575724833913); + bool3x3 r2 = bool3x3(false, true, false, false, false, true, false, true, false); + TestUtils.AreEqual(r2, a2 <= b2); + + double3x3 a3 = double3x3(145.30606777281787, -494.26732968458316, -111.57013922164691, -139.54120332540072, -146.58935148389514, 33.984021917909445, -445.70445248377717, -451.04219624541804, -122.03926115950537); + double b3 = (-466.13296363602063); + bool3x3 r3 = bool3x3(false, true, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void double3x3_operator_less_equal_scalar_wide() + { + double a0 = (393.60626644343427); + double3x3 b0 = double3x3(-75.688363825757222, -44.2638714519627, 125.86491566797019, 191.96488174794467, 13.543054825413492, -197.0519259893577, -423.945100743298, -330.04861680141119, 420.16553779140372); + bool3x3 r0 = bool3x3(false, false, false, false, false, false, false, false, true); + TestUtils.AreEqual(r0, a0 <= b0); + + double a1 = (105.54730777887039); + double3x3 b1 = double3x3(174.82126363311954, 296.71757831085358, -469.70041845259277, 123.26718979853536, 112.9969695140594, 495.14339493920249, -488.65789364681478, 388.53941148730894, -493.24077080806751); + bool3x3 r1 = bool3x3(true, true, false, true, true, true, false, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + double a2 = (16.451064832718657); + double3x3 b2 = double3x3(-387.6516336815672, -229.1773127192526, -373.01533930982248, -391.142134610164, 90.994149488859875, -178.39613517485378, -69.621067317957568, 471.7908458522478, -67.4667532758167); + bool3x3 r2 = bool3x3(false, false, false, false, true, false, false, true, false); + TestUtils.AreEqual(r2, a2 <= b2); + + double a3 = (45.305359623071467); + double3x3 b3 = double3x3(-154.69219000390365, 385.73888248286153, -431.652945004242, -331.67304841227508, -349.89271013340573, -114.83913021666888, -245.21782671903156, -486.69548224224496, 391.95091957224111); + bool3x3 r3 = bool3x3(false, true, false, false, false, false, false, false, true); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void double3x3_operator_greater_equal_wide_wide() + { + double3x3 a0 = double3x3(-507.92858409692, 504.49748181947393, -385.43449205226938, -262.32340944107784, -37.550928848586466, -111.59527759980193, -463.70202157632542, 387.44885772627265, 456.96878573716094); + double3x3 b0 = double3x3(-81.346509732933043, 297.66615047010885, 171.06540616371922, -431.03805538222105, -6.859075311040101, 319.72570362674333, 254.079170106947, 396.5724000393285, 178.83927615864172); + bool3x3 r0 = bool3x3(false, true, false, true, false, false, false, false, true); + TestUtils.AreEqual(r0, a0 >= b0); + + double3x3 a1 = double3x3(-211.01015506079892, 182.41135391146474, -53.596053863687473, -309.57021608463032, -136.02249127999994, 280.73629082401112, -96.9958942388165, -174.05950673579213, 88.9019382413951); + double3x3 b1 = double3x3(-447.06336304501787, 288.49268569075161, 474.88929460704765, -321.75022831640683, -395.97722048125104, -158.69246037243516, 391.48869318118727, -368.10924141859135, 89.1238043723273); + bool3x3 r1 = bool3x3(true, false, false, true, true, true, false, true, false); + TestUtils.AreEqual(r1, a1 >= b1); + + double3x3 a2 = double3x3(43.816040774721728, -446.07842585354967, 16.645595796706857, 409.83252043734888, -191.32987245886113, 222.99782548798146, 404.28838915577546, 230.60328136691976, -441.78928228923553); + double3x3 b2 = double3x3(-510.27932214656812, -486.92979525352354, -81.215552606254619, 274.21882046117389, -212.88155494112596, 288.99530591117, 307.73173131967508, 307.24516620638087, -199.39178213821339); + bool3x3 r2 = bool3x3(true, true, true, true, true, false, true, false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + double3x3 a3 = double3x3(-86.293056289801882, 484.24954413075443, 95.2363665547391, -204.91210255628084, -199.77434620623211, -421.86318107222354, -18.214789637464492, -346.8227681344481, -159.24364073539323); + double3x3 b3 = double3x3(-284.42126978767163, -482.39181278757371, 448.3157362641374, -378.3461889598268, -390.8584684761513, 8.9160292190108521, 416.40721984226593, -213.67494664605471, 455.24810788372906); + bool3x3 r3 = bool3x3(true, true, false, true, true, false, false, false, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void double3x3_operator_greater_equal_wide_scalar() + { + double3x3 a0 = double3x3(465.15218732559686, -424.8860745024337, -209.22109685150025, 58.779852656079356, -302.26910533675414, 140.12558252183976, 16.353385694489475, -344.55997316192838, 393.27804846003562); + double b0 = (-5.5998842742293391); + bool3x3 r0 = bool3x3(true, false, false, true, false, true, true, false, true); + TestUtils.AreEqual(r0, a0 >= b0); + + double3x3 a1 = double3x3(-315.70155086913218, -509.78156757251435, -36.994287269652943, 494.82028865014217, -164.97393830352183, -466.12009046325466, -123.8137477020797, 215.65121779947128, 104.99569730879534); + double b1 = (441.0115565923096); + bool3x3 r1 = bool3x3(false, false, false, true, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + double3x3 a2 = double3x3(314.34603014325069, -83.111429014760745, -23.836435567511444, 143.04935962662535, -264.91997945724052, -169.70222457205051, 329.70751610850334, 359.09582035573931, -260.42331016269668); + double b2 = (190.51609882643265); + bool3x3 r2 = bool3x3(true, false, false, false, false, false, true, true, false); + TestUtils.AreEqual(r2, a2 >= b2); + + double3x3 a3 = double3x3(354.19514219565087, 33.309096113456917, 355.63126938214123, -435.36056753404466, -38.39930893778768, -93.29572896533449, -338.84962169213668, 436.89581676800537, 511.08413982348713); + double b3 = (-111.84533768140028); + bool3x3 r3 = bool3x3(true, true, true, false, true, true, false, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void double3x3_operator_greater_equal_scalar_wide() + { + double a0 = (374.82703393270594); + double3x3 b0 = double3x3(-1.609757185731894, 338.61524049314448, -116.18140392945213, -332.15732375353451, -355.9793509710484, -468.90144107719021, 38.579884785497484, -332.34754697063357, 2.8901150240051265); + bool3x3 r0 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + double a1 = (467.77776477661814); + double3x3 b1 = double3x3(121.40638762405445, -305.02337303060267, -58.428812292604164, -226.51955209789776, -47.020994446715804, 305.3026770582901, -427.40123315686418, 92.263649745035764, -497.17853736187266); + bool3x3 r1 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 >= b1); + + double a2 = (-408.62564225151465); + double3x3 b2 = double3x3(-455.23049113491106, 396.42608637196292, -469.29488561548987, -485.7540130493017, -182.34619268325446, -291.54536284671417, 278.740809331993, -75.87113932327884, 28.907059921374071); + bool3x3 r2 = bool3x3(true, false, true, true, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + double a3 = (287.72014988945807); + double3x3 b3 = double3x3(420.50978990109161, 473.62684152723614, 181.514540518408, -369.20287220981106, 243.74977385427326, -244.12415825767636, -242.9933451353541, -322.11536780098237, 192.974957794405); + bool3x3 r3 = bool3x3(false, false, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void double3x3_operator_add_wide_wide() + { + double3x3 a0 = double3x3(506.12905263627374, -501.77980803967444, 420.08479638587903, -186.03206476291274, -9.3123953385801883, 328.51179686585056, 424.34407659263536, 87.791079800478656, 462.41368148402012); + double3x3 b0 = double3x3(-28.757987751047096, -337.135153689019, -340.676816860529, 152.31202633320913, 423.66745420157326, 90.374096674087468, 376.18866246574964, 1.7671887882831925, -120.18586045139745); + double3x3 r0 = double3x3(477.37106488522664, -838.91496172869347, 79.407979525350015, -33.720038429703607, 414.35505886299308, 418.885893539938, 800.532739058385, 89.558268588761848, 342.22782103262267); + TestUtils.AreEqual(r0, a0 + b0); + + double3x3 a1 = double3x3(-46.178705952213477, 401.17006296718966, -454.12414643453627, 69.195687564646732, -177.95734485329939, 299.60415544156183, 340.7048587001417, 219.91602740991675, -321.90838232725321); + double3x3 b1 = double3x3(-279.62936628965167, -344.66710273580026, 242.8391956029642, 418.5930504363929, -23.312797318823982, -95.099945827899489, 147.92812568877275, 331.03287926830023, -82.502564230236487); + double3x3 r1 = double3x3(-325.80807224186515, 56.502960231389409, -211.28495083157208, 487.78873800103963, -201.27014217212337, 204.50420961366234, 488.63298438891445, 550.948906678217, -404.41094655748969); + TestUtils.AreEqual(r1, a1 + b1); + + double3x3 a2 = double3x3(286.35534037573041, -333.41949311523672, -118.93216973120911, 68.607509406566351, 23.190902005504313, -205.57787547147734, 11.521422629953122, -340.7950796283759, -68.931167873056211); + double3x3 b2 = double3x3(279.44956291813844, 342.6227215931857, -300.35853185335105, -209.69408736456842, 446.55942150883345, -351.98918955027557, -263.12385642860261, -252.4585670216282, 289.82535542632706); + double3x3 r2 = double3x3(565.80490329386885, 9.2032284779489828, -419.29070158456017, -141.08657795800207, 469.75032351433777, -557.56706502175291, -251.60243379864949, -593.25364665000416, 220.89418755327085); + TestUtils.AreEqual(r2, a2 + b2); + + double3x3 a3 = double3x3(304.8532370556394, -86.633841316510825, 105.66915874633435, 349.28052799277032, 364.7078708916473, -429.03740449856843, 382.45806926417072, 186.09704479300274, 227.41184841255279); + double3x3 b3 = double3x3(338.79615537207394, -232.61900364263869, -510.50825405051387, 349.2807325559113, -426.2124495106807, -331.41632882292208, -418.68880267566482, -341.7063559692848, -329.03588143411832); + double3x3 r3 = double3x3(643.64939242771334, -319.25284495914951, -404.83909530417952, 698.56126054868162, -61.504578619033396, -760.45373332149052, -36.2307334114941, -155.60931117628206, -101.62403302156554); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void double3x3_operator_add_wide_scalar() + { + double3x3 a0 = double3x3(-194.51420387742769, 338.54838696985894, 246.97140252169754, 100.51093797595752, -45.724677822424439, -478.11131094308166, 30.916145577522116, 60.37435224483454, -242.1187475855084); + double b0 = (124.121678171736); + double3x3 r0 = double3x3(-70.3925257056917, 462.67006514159493, 371.09308069343354, 224.63261614769351, 78.397000349311554, -353.98963277134567, 155.03782374925811, 184.49603041657053, -117.99706941377241); + TestUtils.AreEqual(r0, a0 + b0); + + double3x3 a1 = double3x3(82.50134495762245, -484.69981287638649, -188.26501068298938, -213.52673087526426, -267.78430688929944, 189.25996669999324, 198.53359684652355, 187.53610023648298, -424.92567582844089); + double b1 = (6.7993848355483806); + double3x3 r1 = double3x3(89.300729793170831, -477.90042804083811, -181.465625847441, -206.72734603971588, -260.98492205375106, 196.05935153554162, 205.33298168207193, 194.33548507203136, -418.12629099289251); + TestUtils.AreEqual(r1, a1 + b1); + + double3x3 a2 = double3x3(302.10236730338181, 124.02158909850823, -200.16134295247559, 31.37822701007974, 362.52213518811493, -423.98885961248953, 432.41331907380993, 374.21141474983256, -465.69948957194549); + double b2 = (300.39907970111778); + double3x3 r2 = double3x3(602.5014470044996, 424.420668799626, 100.23773674864219, 331.77730671119753, 662.92121488923271, -123.58977991137175, 732.81239877492771, 674.61049445095034, -165.30040987082771); + TestUtils.AreEqual(r2, a2 + b2); + + double3x3 a3 = double3x3(-311.04303779781003, -432.44245716204978, 235.75065886031405, -472.63775394514096, -257.57773721291579, 186.120703068618, -170.29822667422621, -115.27248840931452, -101.16882686557659); + double b3 = (84.918990413154916); + double3x3 r3 = double3x3(-226.12404738465511, -347.52346674889486, 320.66964927346896, -387.71876353198604, -172.65874679976088, 271.03969348177293, -85.3792362610713, -30.353497996159604, -16.249836452421675); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void double3x3_operator_add_scalar_wide() + { + double a0 = (-340.35468284243473); + double3x3 b0 = double3x3(511.36225652665007, -146.21663791789518, -106.21042661844308, -363.45024960276214, 199.08958325120136, -27.108407271610758, 419.84900041103788, 284.95503748811552, -164.92418129971446); + double3x3 r0 = double3x3(171.00757368421534, -486.57132076032991, -446.56510946087781, -703.80493244519687, -141.26509959123337, -367.46309011404549, 79.494317568603151, -55.399645354319205, -505.27886414214919); + TestUtils.AreEqual(r0, a0 + b0); + + double a1 = (-249.19032561461921); + double3x3 b1 = double3x3(150.92817718858282, 298.17509784278229, -457.15341803857751, 424.71807094324288, -301.85750283946163, 230.28885208363124, -423.58759351428023, -67.060037882560891, 68.7241366229598); + double3x3 r1 = double3x3(-98.26214842603639, 48.984772228163081, -706.34374365319673, 175.52774532862367, -551.0478284540809, -18.901473530987971, -672.77791912889938, -316.2503634971801, -180.46618899165941); + TestUtils.AreEqual(r1, a1 + b1); + + double a2 = (-164.02241833695325); + double3x3 b2 = double3x3(318.93515339444161, 7.8045504129512437, 187.69836029210046, -3.6569664495331153, -446.0830535581722, -209.28724227160552, -38.212905186327589, -346.25717870623674, 465.60741708502519); + double3x3 r2 = double3x3(154.91273505748836, -156.217867924002, 23.675941955147209, -167.67938478648637, -610.10547189512545, -373.30966060855877, -202.23532352328084, -510.27959704319, 301.58499874807194); + TestUtils.AreEqual(r2, a2 + b2); + + double a3 = (-192.18595108398512); + double3x3 b3 = double3x3(278.69379843338106, 381.97845548297209, 481.24367283342576, -97.228162095522578, -455.51374289743313, 501.83498858932171, 358.70657818331688, 430.69978519468555, 256.987155795557); + double3x3 r3 = double3x3(86.507847349395945, 189.79250439898698, 289.05772174944065, -289.41411317950769, -647.69969398141825, 309.64903750533659, 166.52062709933176, 238.51383411070043, 64.80120471157187); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void double3x3_operator_sub_wide_wide() + { + double3x3 a0 = double3x3(160.4922617229131, 11.223957305412682, 359.20010607279846, -498.22830485656311, -355.25362913462038, -94.534852787170053, -410.46404786150163, -401.38464398001537, 317.70681944382693); + double3x3 b0 = double3x3(115.46876078260539, -130.98230630298252, 241.54083716196044, 9.9870860623135513, 419.89512582304656, 59.124466208333388, -402.38163847587145, -75.370143687059226, 320.97960796997859); + double3x3 r0 = double3x3(45.023500940307713, 142.2062636083952, 117.65926891083802, -508.21539091887666, -775.14875495766694, -153.65931899550344, -8.0824093856301715, -326.01450029295614, -3.2727885261516576); + TestUtils.AreEqual(r0, a0 - b0); + + double3x3 a1 = double3x3(447.0604133303558, -489.07414482956477, -230.00838218909149, 24.875419389864192, 366.61447136784648, -107.3741567634857, -219.0081404275299, 473.90756891384137, 259.63620793988753); + double3x3 b1 = double3x3(-73.908757482612884, -31.444742455819949, -389.25194734579509, -375.02884000122026, 259.18275821357167, 276.648654351313, -453.06919905779381, -272.57653225240136, -191.14805301984217); + double3x3 r1 = double3x3(520.96917081296874, -457.62940237374482, 159.2435651567036, 399.90425939108445, 107.4317131542748, -384.02281111479869, 234.06105863026391, 746.48410116624268, 450.78426095972969); + TestUtils.AreEqual(r1, a1 - b1); + + double3x3 a2 = double3x3(-360.119631219711, 7.8096120393879573, 437.42847439154446, -59.1991718091067, 418.74433322378638, 183.14215072576985, 271.23036516421962, 496.20853709439211, 165.35493691514944); + double3x3 b2 = double3x3(87.136884968325944, 430.02477594373033, 343.65711538105143, 121.02942067060133, -354.1881703595576, 249.05200373802893, -2.2254426489702723, 22.447240601502017, 478.1129555544411); + double3x3 r2 = double3x3(-447.25651618803693, -422.21516390434238, 93.771359010493029, -180.22859247970803, 772.932503583344, -65.909853012259077, 273.45580781318989, 473.7612964928901, -312.75801863929166); + TestUtils.AreEqual(r2, a2 - b2); + + double3x3 a3 = double3x3(-227.40367113212295, -166.52285702830312, 356.14227430715334, 386.92636579411396, -394.63875717420075, 126.90326625057651, 97.2168972944919, -150.01784641575898, -227.25051246734824); + double3x3 b3 = double3x3(-320.0629958212669, -111.52409534879217, 222.22894607401872, -245.41106307013473, -119.90228348593337, -153.46565372937624, 374.11248439089979, 301.7634090398268, -281.43006552449896); + double3x3 r3 = double3x3(92.659324689143943, -54.998761679510949, 133.91332823313462, 632.33742886424875, -274.73647368826738, 280.36891997995275, -276.89558709640789, -451.78125545558578, 54.179553057150713); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void double3x3_operator_sub_wide_scalar() + { + double3x3 a0 = double3x3(207.38960108877609, 248.45773684627272, -384.82393211164697, -205.34476122881506, -374.81156152058929, 191.64204820973896, 18.856238135535364, -44.96160151667965, 480.85798738936796); + double b0 = (-36.112476604111691); + double3x3 r0 = double3x3(243.50207769288778, 284.57021345038441, -348.71145550753528, -169.23228462470337, -338.6990849164776, 227.75452481385065, 54.968714739647055, -8.8491249125679587, 516.9704639934796); + TestUtils.AreEqual(r0, a0 - b0); + + double3x3 a1 = double3x3(16.338193185784917, -35.523088233323335, 349.39776460705218, 439.07729336203886, 490.2222661870635, 195.02405104181923, -384.84940952102158, 189.05188545447402, 55.602777745389744); + double b1 = (-366.86545269883493); + double3x3 r1 = double3x3(383.20364588461985, 331.34236446551159, 716.26321730588711, 805.94274606087379, 857.08771888589843, 561.88950374065416, -17.983956822186656, 555.917338153309, 422.46823044422467); + TestUtils.AreEqual(r1, a1 - b1); + + double3x3 a2 = double3x3(-54.931482579061537, 316.80250730961677, -273.80670917863335, 256.88723695319482, 297.17363156805447, 101.82901363346218, 136.60794765157993, -19.732211837420323, 336.58969966349639); + double b2 = (53.088051582261983); + double3x3 r2 = double3x3(-108.01953416132352, 263.71445572735479, -326.89476076089534, 203.79918537093283, 244.08557998579249, 48.7409620512002, 83.519896069317952, -72.8202634196823, 283.50164808123441); + TestUtils.AreEqual(r2, a2 - b2); + + double3x3 a3 = double3x3(-51.876563334780087, -467.05592773251976, -50.167055391784345, 477.804535373023, -60.821922092149919, 0.41113877315592617, 46.660927078994405, -19.241408595462076, 396.80972809195976); + double b3 = (317.34576311583896); + double3x3 r3 = double3x3(-369.22232645061905, -784.40169084835873, -367.51281850762331, 160.45877225718402, -378.16768520798888, -316.93462434268304, -270.68483603684456, -336.58717171130104, 79.463964976120792); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void double3x3_operator_sub_scalar_wide() + { + double a0 = (-86.008225719448262); + double3x3 b0 = double3x3(466.42511413359318, 298.48694219183506, -300.95010652251085, 315.38003006362362, -381.09218543632522, -125.00837546447684, 58.466194418476107, 214.74609361158036, -257.54942739082009); + double3x3 r0 = double3x3(-552.43333985304139, -384.49516791128332, 214.94188080306259, -401.38825578307188, 295.08395971687696, 39.00014974502858, -144.47442013792437, -300.75431933102863, 171.54120167137182); + TestUtils.AreEqual(r0, a0 - b0); + + double a1 = (480.22459505508868); + double3x3 b1 = double3x3(-443.35507723472784, 260.79503858312728, 29.681931747906788, 139.85773164586055, -247.78996216868512, -248.4662297929014, 91.445112509394562, 86.384162704639266, 373.81828206303453); + double3x3 r1 = double3x3(923.57967228981647, 219.4295564719614, 450.5426633071819, 340.36686340922813, 728.01455722377386, 728.69082484799014, 388.77948254569412, 393.84043235044942, 106.40631299205415); + TestUtils.AreEqual(r1, a1 - b1); + + double a2 = (260.41195428576873); + double3x3 b2 = double3x3(114.35393171867076, -464.40545318294573, -109.74146156652898, -311.67535057276268, 107.86401586787031, -258.7951592219971, 14.097560173877355, -461.97019527012958, 30.310863747406188); + double3x3 r2 = double3x3(146.05802256709796, 724.81740746871446, 370.15341585229771, 572.08730485853141, 152.54793841789842, 519.20711350776583, 246.31439411189137, 722.38214955589831, 230.10109053836254); + TestUtils.AreEqual(r2, a2 - b2); + + double a3 = (63.701105862716759); + double3x3 b3 = double3x3(-462.67674634544028, 39.759483117498235, 47.998150132595583, -177.61928113625351, 202.47706017386031, -289.30880250097664, -459.92539832551284, 248.38668715599306, 85.3297222057962); + double3x3 r3 = double3x3(526.377852208157, 23.941622745218524, 15.702955730121175, 241.32038699897026, -138.77595431114355, 353.0099083636934, 523.62650418822955, -184.6855812932763, -21.628616343079443); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void double3x3_operator_mul_wide_wide() + { + double3x3 a0 = double3x3(-482.71381710596097, -407.29348559272171, 137.70058995937029, 208.54113278563182, 194.296573967811, -484.24241684574747, 183.98730739578014, -241.33547770294149, 45.868758938214114); + double3x3 b0 = double3x3(-236.36788355389979, 260.72759139757954, -416.38629718142852, -364.49561541364324, -253.14750897751537, -369.20287220981106, 193.54791531038836, 169.08491976982214, 201.96966442930034); + double3x3 r0 = double3x3(114098.04331156026, -106192.64949051509, -57336.638772880389, -76012.328533757158, -49185.69370281692, 178783.69114527057, 35610.359790024842, -40806.189885013562, 9264.0978505395742); + TestUtils.AreEqual(r0, a0 * b0); + + double3x3 a1 = double3x3(363.32610266438041, -328.11893692990714, -471.02307413100408, -262.68257415605831, -379.26274674910246, -374.09058182970182, 481.44738720424812, 104.62807397946165, 412.93539948618752); + double3x3 b1 = double3x3(249.45608317547294, -308.19319810913555, -385.57964843585137, -183.27959522198864, 22.275629292370581, -265.52144229855458, -95.677454277722859, 133.25437146669924, 148.31146080247663); + double3x3 r1 = double3x3(90633.9064860661, 101124.02453259782, 181616.91132860651, 48144.355863192381, -8448.3163509892329, 99329.070837727879, -46063.660376363579, 13942.148235904471, 61243.052314850727); + TestUtils.AreEqual(r1, a1 * b1); + + double3x3 a2 = double3x3(477.87724731763694, 20.377821216535722, 291.99596299417124, -138.48832399141429, -393.46498483860165, 9.36312318284206, -131.94228917543882, 364.44964258952518, 390.61597866128011); + double3x3 b2 = double3x3(249.284127113076, 500.00547503866505, -19.331578978957396, -36.691062705913112, 30.5238278054278, -401.36701054189678, 3.4372422711165882, 257.24176681099539, -290.97193516929258); + double3x3 r2 = double3x3(119127.21246477668, 10189.022177626932, -5644.7430201585421, 5081.2837796057929, -12010.057444678736, -3758.048761232847, -453.51761370170692, 93751.669973365249, -113658.28721911977); + TestUtils.AreEqual(r2, a2 * b2); + + double3x3 a3 = double3x3(418.79794974755396, -277.34480942289565, 11.410165553637853, 474.87644956767394, -502.40503358394142, -222.59489618176354, 38.169053810727291, 292.61251582420084, 203.20767245218519); + double3x3 b3 = double3x3(337.47938100317469, 490.28616284312966, -191.01981481864107, -325.73449650673871, -52.181983733634468, 123.43503743197539, -461.2670640709191, 122.35306149458188, 308.58463182513822); + double3x3 r3 = double3x3(141335.67284620318, -135978.32239641057, -2179.56771110594, -154683.64120283397, 26216.491290173308, -27476.00934236266, -17606.127389639103, 35802.037142722758, 62706.764787700849); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void double3x3_operator_mul_wide_scalar() + { + double3x3 a0 = double3x3(-96.318821236639678, -277.14229239017811, -239.93690191951436, 509.53140544776409, 255.85810172551226, 215.73149667295229, -455.50827500573746, -389.24327367788334, -338.29248658674419); + double b0 = (-301.20720424373042); + double3x3 r0 = double3x3(29011.922860739887, 83477.255068544036, 72270.723422079071, -153474.5301092997, -77066.303503849529, -64979.880980175592, 137202.37402436248, 117242.87823519246, 101896.13410145289); + TestUtils.AreEqual(r0, a0 * b0); + + double3x3 a1 = double3x3(53.796284939067618, 135.35469991311186, -207.35010275959507, -383.93960946795517, -31.425238862366086, 42.676120539510634, 260.38388049806645, 176.86755927692525, 25.672123205695357); + double b1 = (243.75734459783757); + double3x3 r1 = double3x3(13113.239565975766, 32993.702229657305, -50543.11045076765, -93588.099689839524, -7660.1327784431269, 10402.617820448348, 63470.483286289338, 43112.766594843932, 6257.7685828088261); + TestUtils.AreEqual(r1, a1 * b1); + + double3x3 a2 = double3x3(-290.50059689697838, -156.52330858843555, -208.4020064847553, 370.94506400215676, -341.59844247512444, 10.270311121954705, -176.88876565587185, -61.006107120311867, 186.27978214355176); + double b2 = (207.09101805793637); + double3x3 r2 = double3x3(-60160.064357833442, -32414.571325375655, -43158.18368824463, 76819.390947773, -70741.969219178936, 2126.8891860173467, -36632.074562686234, -12633.816831296905, 38576.869727718731); + TestUtils.AreEqual(r2, a2 * b2); + + double3x3 a3 = double3x3(-487.65221785365242, -317.71628990663044, -207.62735686433842, 388.87138933170183, -233.33533274072005, 128.4155209662465, 510.38953399583215, 267.57635486665015, -309.20967569444781); + double b3 = (-129.37681800191143); + double3x3 r3 = double3x3(63090.892237480453, 41105.122615492655, 26862.166761255427, -50310.942963718029, 30188.182877411582, -16613.991484670714, -66032.573849859167, -34618.177365197465, 40004.56393675063); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void double3x3_operator_mul_scalar_wide() + { + double a0 = (37.432166355397612); + double3x3 b0 = double3x3(96.747546479454058, 492.18539427788244, -274.05458534604617, -452.87096926796761, 420.85330434369541, 102.18292694081686, -114.94887762654054, -351.12003843445336, -464.66496799172131); + double3x3 r0 = double3x3(3621.4702542954869, 18423.565556306661, -10258.456829132712, -16951.941459168724, 15753.450899411988, 3824.9283199300971, -4302.785509682908, -13143.183689392061, -17393.41638139162); + TestUtils.AreEqual(r0, a0 * b0); + + double a1 = (444.08484646495663); + double3x3 b1 = double3x3(447.10525605040846, 130.82935124767448, -321.41334191030512, 445.30131861441828, 478.24357317306271, 358.57170622356784, -144.89011222910608, -438.89383741789209, -3.536441089369589); + double3x3 r1 = double3x3(198552.66898682076, 58099.332361933404, -142734.79459402646, 197751.56770752667, 212380.72376541179, 159236.26110497065, -64343.503243552906, -194906.10240414026, -1570.4798982050579); + TestUtils.AreEqual(r1, a1 * b1); + + double a2 = (-471.80755470311624); + double3x3 b2 = double3x3(-42.560401697904069, 119.91104155402218, 271.9000023677479, 239.6840079946835, 487.44143389511919, -79.188288010278825, -112.92564468873928, 161.3700478828373, 459.75914332818195); + double3x3 r2 = double3x3(20080.319052270475, -56574.935297506963, -128284.47524089865, -113084.72571341379, -229978.55098703687, 37361.632527255751, 53279.172283867025, -76135.607693926242, -216917.83716606908); + TestUtils.AreEqual(r2, a2 * b2); + + double a3 = (-337.19599811043406); + double3x3 b3 = double3x3(-276.83451689259823, 469.72386405883537, -274.56515110403541, 506.78586625810055, 65.882571966332648, 495.8556585236712, -347.27959148365983, -343.60605232026711, -183.70378860444936); + double3x3 r3 = double3x3(93347.491235019479, -158389.00717760884, 92582.270172867371, -170886.16600116115, -22215.33961227004, -167200.54369459586, 117101.28847371647, 115862.58576891849, 61944.182355145487); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void double3x3_operator_div_wide_wide() + { + double3x3 a0 = double3x3(-353.13144390337703, -102.79985456485292, 51.319128298814917, -191.87167868012176, 8.0418245829836223, -128.73764210973758, -136.05959779399427, -370.4710053738537, -237.69456326109105); + double3x3 b0 = double3x3(-178.73954805114283, -302.09628381491467, -199.40583739029518, 278.85077561012042, 502.33758782890516, -361.48483078623417, 353.121059820578, -38.894930142394685, -75.764737402910725); + double3x3 r0 = double3x3(1.97567604793504, 0.34028837848212429, -0.25736021056579439, -0.68808013268139567, 0.016008805189634039, 0.35613566917796119, -0.3853058151307277, 9.5249176182488586, 3.1372716570909582); + TestUtils.AreEqual(r0, a0 / b0); + + double3x3 a1 = double3x3(-432.54687496300176, 200.26549181727012, 361.44157068871039, -416.22613234828509, -450.01919362042992, -273.49744594911925, -286.90817011841955, -314.25606241554772, 177.76210340194507); + double3x3 b1 = double3x3(-195.21784719974636, -405.03399224068687, -394.2300085473014, -375.82771342612227, -121.24548655433836, 447.623344391409, 338.28628007429018, -405.54420752336466, -431.16893526127978); + double3x3 r1 = double3x3(2.2157137842034547, -0.49444119667433889, -0.9168291678773689, 1.1074918572499153, 3.7116366671409717, -0.61099906735420106, -0.84812239519560884, 0.77489964493560781, -0.41227947763496636); + TestUtils.AreEqual(r1, a1 / b1); + + double3x3 a2 = double3x3(97.626988217992221, -68.107280047660367, -386.45074027890837, 263.69934690357161, -297.0270885420158, -501.77703046322659, -263.40686071263946, -451.08085248017721, -416.34552903489464); + double3x3 b2 = double3x3(296.20513095343722, 437.939790691221, 39.21061684527001, 331.2897075765253, -310.61955156485533, 207.26946959610541, -223.2929938879297, -480.091406807346, 448.67593666942605); + double3x3 r2 = double3x3(0.32959249525403717, -0.15551745124635385, -9.855767936625206, 0.79597808465769837, 0.95624080018671487, -2.420892143165184, 1.1796467776541293, 0.93957285234474042, -0.92794263076704353); + TestUtils.AreEqual(r2, a2 / b2); + + double3x3 a3 = double3x3(-315.27873411554788, -28.181118739853218, -397.87015146662952, -261.38664376986526, 40.348221559239619, 277.24575794732471, 464.77123162931355, -336.64104358136706, 375.47808163961304); + double3x3 b3 = double3x3(-460.0974516626901, -220.56984601755153, -84.853158275062754, 441.3738078742166, 72.418480191574645, 44.9760778159723, -242.51539027062961, -451.30207011257392, -21.899694214528267); + double3x3 r3 = double3x3(0.68524338262731188, 0.12776505605218016, 4.6889256635195675, -0.59221149761645042, 0.55715366371267527, 6.1642938070706279, -1.9164607702243661, 0.74593285933165443, -17.145357280400777); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void double3x3_operator_div_wide_scalar() + { + double3x3 a0 = double3x3(171.34242184988341, 0.10338377957384637, 57.888263967767443, -256.13074529177078, 95.6696842162263, -290.38690461329509, -127.44869118903239, -79.7448890580539, 146.46688110496234); + double b0 = (171.79682191265601); + double3x3 r0 = double3x3(0.99735501473360411, 0.00060177934855167557, 0.33695771157628673, -1.4908933846400916, 0.55687691513214455, -1.6902926455818372, -0.74185709473618289, -0.46418139852783397, 0.85255873463962106); + TestUtils.AreEqual(r0, a0 / b0); + + double3x3 a1 = double3x3(-499.84355687529012, -453.20579859856787, -205.03382143985192, 481.73814247629514, 464.47907159499778, -293.46349753693841, -158.50557930697948, -289.5822156824089, 494.12860535743118); + double b1 = (58.686315802245531); + double3x3 r1 = double3x3(-8.5172079733136776, -7.7225123506769311, -3.4937245358995028, 8.2086962844899229, 7.9146060754630856, -5.0005438836170653, -2.7008950406955781, -4.9344078210363405, 8.41982664276438); + TestUtils.AreEqual(r1, a1 / b1); + + double3x3 a2 = double3x3(203.58342680874443, 259.11918723728468, 460.84470603468117, 490.95625924084163, -280.47805536933151, -320.24387112271222, 192.41448912043802, 264.80085885934568, 226.85298524929817); + double b2 = (180.97040160976837); + double3x3 r2 = double3x3(1.1249542742781615, 1.4318318627375914, 2.5465197730422995, 2.7129091546113964, -1.5498559591757679, -1.7695925315636045, 1.0632373438356337, 1.46322744771459, 1.253536397285937); + TestUtils.AreEqual(r2, a2 / b2); + + double3x3 a3 = double3x3(-192.23568949114332, -437.89221760159927, -413.23271794488312, 249.47184693509337, 313.03501739773662, 216.78560195527302, 383.73890298592812, 82.023314752626789, 189.57466062790468); + double b3 = (460.97652957447644); + double3x3 r3 = double3x3(-0.41701838848193523, -0.94992302103930082, -0.89642897508542307, 0.54118123359854942, 0.67906931766503731, 0.4702747060796913, 0.83244781104182086, 0.17793381981581974, 0.41124579770449365); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void double3x3_operator_div_scalar_wide() + { + double a0 = (-264.44250095283729); + double3x3 b0 = double3x3(105.58908157497137, -142.34910137129441, -288.94890679463231, 39.644133824689334, -363.99138396046658, -149.71822006521666, -395.72912306139671, 258.71868693955184, -9.6662514254759344); + double3x3 r0 = double3x3(-2.5044492954044237, 1.85770404172122, 0.915187753732487, -6.670406827961755, 0.72650758398599513, 1.7662679988958405, 0.66824119212426392, -1.0221236976771717, 27.357295947825712); + TestUtils.AreEqual(r0, a0 / b0); + + double a1 = (117.72553282497711); + double3x3 b1 = double3x3(-331.38655797177296, -509.98602676297821, 427.8964666928614, 467.61712882836218, -407.12461943511136, 252.69070994699871, 444.59937664708093, -88.313306134340053, 199.95503411067421); + double3x3 r1 = double3x3(-0.35525138239012338, -0.23084070277810059, 0.275126209232008, 0.25175624579866063, -0.28916338439154632, 0.46588785495782481, 0.26479014368575376, -1.3330441128078241, 0.58876003471768834); + TestUtils.AreEqual(r1, a1 / b1); + + double a2 = (-218.34692607556792); + double3x3 b2 = double3x3(-13.417186028052697, -296.13107575854804, 0.561349630617201, -289.29929865957206, 196.21833929615946, 334.73346845001606, -282.39273203648293, -479.50358436978587, -473.43943927876626); + double3x3 r2 = double3x3(16.273675092455857, 0.737332026084281, -388.96779149118993, 0.7547440560251889, -1.1127753239517995, -0.65230085024549167, 0.77320306546472739, 0.4553603626603594, 0.46119293823133078); + TestUtils.AreEqual(r2, a2 / b2); + + double a3 = (105.0507777226394); + double3x3 b3 = double3x3(-287.63127841038227, 77.299297130340392, -210.89436421678141, -184.0682357214709, -315.14843645465953, 87.86691264429453, 101.5905373569534, 345.93639890567226, -146.31811744827689); + double3x3 r3 = double3x3(-0.36522723920434208, 1.3590133626377618, -0.49812036520168057, -0.57071649169061711, -0.3333374548972356, 1.195566961000543, 1.0340606561960384, 0.30367078473081976, -0.71796151805858621); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void double3x3_operator_mod_wide_wide() + { + double3x3 a0 = double3x3(-388.81249422059045, 181.68118842955732, -167.07872470052854, 432.82015319951813, -258.43895995730486, -170.11079629236406, 283.318293464984, 122.71651297561664, 335.27101413126616); + double3x3 b0 = double3x3(436.94417187056695, 58.940049437312382, -201.11623368091705, 279.2893537391393, -397.07975954426445, 377.89994758083481, 174.69386657266591, -228.17652736798698, -317.06019106370405); + double3x3 r0 = double3x3(-388.81249422059045, 4.8610401176201776, -167.07872470052854, 153.53079946037883, -258.43895995730486, -170.11079629236406, 108.62442689231807, 122.71651297561664, 18.210823067562103); + TestUtils.AreEqual(r0, a0 % b0); + + double3x3 a1 = double3x3(-503.60851668920765, 191.02251848532933, 289.74269379756538, -124.03371745163281, 259.27395761165485, -274.35845030208975, -140.03080398404541, 324.5775689205982, -200.51308903494527); + double3x3 b1 = double3x3(-417.48011107811709, -249.9759434433542, -397.57157177364991, -358.74544947163452, -198.1592100589346, 208.73709378425826, -12.119406944196385, 25.27141596063575, -194.12068495253135); + double3x3 r1 = double3x3(-86.128405611090557, 191.02251848532933, 289.74269379756538, -124.03371745163281, 61.114747552720246, -65.621356517831487, -6.7173275978851734, 21.3205773929692, -6.3924040824139183); + TestUtils.AreEqual(r1, a1 % b1); + + double3x3 a2 = double3x3(211.42317328761476, -51.272212767634642, -230.63392483006879, 99.989400671790122, 399.18986649028489, 24.903281461868119, 50.92402961241271, -364.86367886367429, -252.62662398658068); + double3x3 b2 = double3x3(-493.8717965995296, -312.3016990685378, -216.98060546488529, 413.57096047586344, -436.39440151508637, 3.4912750737235, -308.23343076754054, -441.37506195594324, 84.6008532441225); + double3x3 r2 = double3x3(211.42317328761476, -51.272212767634642, -13.653319365183506, 99.989400671790122, 399.18986649028489, 0.46435594580361794, 50.92402961241271, -364.86367886367429, -83.424917498335674); + TestUtils.AreEqual(r2, a2 % b2); + + double3x3 a3 = double3x3(-281.28977955565313, -364.79852192699843, -329.02623311105475, 51.6098087074281, 41.647804041229051, 254.95104443978096, -458.67762133976333, -136.79304439238882, 72.400299344398263); + double3x3 b3 = double3x3(373.16344922276369, 67.252760203207231, -320.33327522889397, 118.97936325845274, 44.823946258436877, 354.00861065183233, -253.95312249565177, -195.16280207185207, 317.14281073079576); + double3x3 r3 = double3x3(-281.28977955565313, -28.534720910962278, -8.6929578821607834, 51.6098087074281, 41.647804041229051, 254.95104443978096, -204.72449884411157, -136.79304439238882, 72.400299344398263); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void double3x3_operator_mod_wide_scalar() + { + double3x3 a0 = double3x3(-244.49962889612635, -211.81931958525411, -145.92677576184587, -304.91822090042672, 155.47946436492703, -133.90778428591221, 281.30965412841624, -226.53575311719243, 335.16613046041039); + double b0 = (39.634963769295723); + double3x3 r0 = double3x3(-6.6898462803520147, -13.644500738775491, -27.021884453958705, -27.473474515356656, 36.574573057039856, -15.002892978025045, 3.86490774334618, -28.360934270713813, 18.0864203060446); + TestUtils.AreEqual(r0, a0 % b0); + + double3x3 a1 = double3x3(101.70649032560482, -285.40231646476423, -355.84685985923136, 259.37800061860025, -330.87193957477433, -284.34358109363518, -102.68343811048356, -172.14173921017988, 206.41684517935698); + double b1 = (319.47152033423606); + double3x3 r1 = double3x3(101.70649032560482, -285.40231646476423, -36.3753395249953, 259.37800061860025, -11.40041924053827, -284.34358109363518, -102.68343811048356, -172.14173921017988, 206.41684517935698); + TestUtils.AreEqual(r1, a1 % b1); + + double3x3 a2 = double3x3(-416.71365447375626, 435.29751440291182, 132.55290490600885, 226.94410215455298, -306.11827268550093, 115.43844633709568, 281.88292015804109, -218.3474491659307, -140.04050237501065); + double b2 = (-339.256669917729); + double3x3 r2 = double3x3(-77.456984556027237, 96.040844485182788, 132.55290490600885, 226.94410215455298, -306.11827268550093, 115.43844633709568, 281.88292015804109, -218.3474491659307, -140.04050237501065); + TestUtils.AreEqual(r2, a2 % b2); + + double3x3 a3 = double3x3(-462.32346961569203, 351.33104555277669, 321.04701176334504, 346.08518497370426, -94.407745643708722, 465.40920446133669, -367.19701617173712, -467.51058957889239, 415.21510215067076); + double b3 = (-211.60869822819188); + double3x3 r3 = double3x3(-39.106073159308266, 139.7223473245848, 109.43831353515316, 134.47648674551237, -94.407745643708722, 42.191808004952918, -155.58831794354523, -44.293193122508626, 203.60640392247888); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void double3x3_operator_mod_scalar_wide() + { + double a0 = (-66.945025236785909); + double3x3 b0 = double3x3(-249.77609479137516, -396.07375664081133, 386.49204582091977, 168.93948109864232, -199.4182442163202, 261.7517141130528, 16.127438791155555, 257.66814744550186, -75.788451945310669); + double3x3 r0 = double3x3(-66.945025236785909, -66.945025236785909, -66.945025236785909, -66.945025236785909, -66.945025236785909, -66.945025236785909, -2.4352700721636893, -66.945025236785909, -66.945025236785909); + TestUtils.AreEqual(r0, a0 % b0); + + double a1 = (170.95630439136005); + double3x3 b1 = double3x3(-242.85828005655588, 425.94531913564788, 303.27240409668184, 3.033060790520608, -505.74352788633831, 461.95706126743789, 205.97275672013529, 270.04063642678807, -47.480711720642034); + double3x3 r1 = double3x3(170.95630439136005, 170.95630439136005, 170.95630439136005, 1.1049001222060042, 170.95630439136005, 170.95630439136005, 170.95630439136005, 170.95630439136005, 28.514169229433946); + TestUtils.AreEqual(r1, a1 % b1); + + double a2 = (-150.254496405951); + double3x3 b2 = double3x3(149.49949009227544, -220.29804263836616, 31.118842377848409, 400.63568348467152, 6.2314283876826266, -39.050740021770252, -71.941097054603063, -495.30713843521994, -86.71961859926563); + double3x3 r2 = double3x3(-0.75500631367555116, -150.254496405951, -25.779126894557351, -150.254496405951, -0.70021510156794875, -33.102276340640231, -6.3723022967448628, -150.254496405951, -63.534877806685358); + TestUtils.AreEqual(r2, a2 % b2); + + double a3 = (-436.97006365143233); + double3x3 b3 = double3x3(-472.2947320753218, -130.00875359867177, -251.51684605866524, 281.97637022751212, 388.86081928241106, 50.615297579493017, 293.870868581287, 123.74424820940203, 422.90433211946129); + double3x3 r3 = double3x3(-436.97006365143233, -46.943802855417005, -185.45321759276709, -154.99369342392021, -48.109244369021269, -32.04768301548819, -143.0991950701453, -65.737319023226235, -14.065731531971039); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void double3x3_operator_plus() + { + double3x3 a0 = double3x3(-418.82956357432045, -405.79894823851015, -34.041791216489742, 236.99924456188421, -459.83910129025537, 210.8614223985287, 293.74197902052754, -373.015422279488, -386.059833944803); + double3x3 r0 = double3x3(-418.82956357432045, -405.79894823851015, -34.041791216489742, 236.99924456188421, -459.83910129025537, 210.8614223985287, 293.74197902052754, -373.015422279488, -386.059833944803); + TestUtils.AreEqual(r0, +a0); + + double3x3 a1 = double3x3(4.9544198536101476, 504.47483062393724, -170.74650843941907, 439.55937572920664, -478.74939916969714, 116.40075665172219, 421.40964742256779, -258.5960806620289, 447.86609122150867); + double3x3 r1 = double3x3(4.9544198536101476, 504.47483062393724, -170.74650843941907, 439.55937572920664, -478.74939916969714, 116.40075665172219, 421.40964742256779, -258.5960806620289, 447.86609122150867); + TestUtils.AreEqual(r1, +a1); + + double3x3 a2 = double3x3(124.16434031546316, -65.949277193261878, 239.04183947250328, 498.4495329793773, -139.382530515726, 279.07295549990283, 108.7758186370022, 37.999210613779383, 136.81214934997831); + double3x3 r2 = double3x3(124.16434031546316, -65.949277193261878, 239.04183947250328, 498.4495329793773, -139.382530515726, 279.07295549990283, 108.7758186370022, 37.999210613779383, 136.81214934997831); + TestUtils.AreEqual(r2, +a2); + + double3x3 a3 = double3x3(-236.03003965878395, 342.2791270419392, 102.4722116470673, -161.454825714908, -355.27087919566355, 141.31435949230308, 239.32088600812517, -494.60408543730347, 361.59198134094106); + double3x3 r3 = double3x3(-236.03003965878395, 342.2791270419392, 102.4722116470673, -161.454825714908, -355.27087919566355, 141.31435949230308, 239.32088600812517, -494.60408543730347, 361.59198134094106); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void double3x3_operator_neg() + { + double3x3 a0 = double3x3(148.46174890755753, -467.12267873581624, 132.04719954917539, 183.52262290917463, 473.7010145009034, -407.99109024926605, -54.958759571872065, -382.98981803608581, -299.09338893512887); + double3x3 r0 = double3x3(-148.46174890755753, 467.12267873581624, -132.04719954917539, -183.52262290917463, -473.7010145009034, 407.99109024926605, 54.958759571872065, 382.98981803608581, 299.09338893512887); + TestUtils.AreEqual(r0, -a0); + + double3x3 a1 = double3x3(-383.01406377508027, 168.73550351370852, 466.44152829909763, 171.90249474900895, -280.55831564616335, -78.85761622286293, 318.69633522569029, -39.91539694737429, 140.34000284054321); + double3x3 r1 = double3x3(383.01406377508027, -168.73550351370852, -466.44152829909763, -171.90249474900895, 280.55831564616335, 78.85761622286293, -318.69633522569029, 39.91539694737429, -140.34000284054321); + TestUtils.AreEqual(r1, -a1); + + double3x3 a2 = double3x3(132.19563180403577, 410.38058466947666, -237.05693375182193, -137.617827241131, -245.34998547534923, 422.52133222227974, -434.57134386271764, 60.222219256787639, -466.56631515294606); + double3x3 r2 = double3x3(-132.19563180403577, -410.38058466947666, 237.05693375182193, 137.617827241131, 245.34998547534923, -422.52133222227974, 434.57134386271764, -60.222219256787639, 466.56631515294606); + TestUtils.AreEqual(r2, -a2); + + double3x3 a3 = double3x3(426.89450116962871, -391.37208408460583, 423.23773809114368, 254.29757296959758, -114.84889536483627, 108.05966263080927, -507.97628688624889, -306.24571456864743, 219.66627298093692); + double3x3 r3 = double3x3(-426.89450116962871, 391.37208408460583, -423.23773809114368, -254.29757296959758, 114.84889536483627, -108.05966263080927, 507.97628688624889, 306.24571456864743, -219.66627298093692); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void double3x3_operator_prefix_inc() + { + double3x3 a0 = double3x3(-139.84208137348389, -56.743654039103376, -381.955324589254, 509.79634380237962, -222.89634452708827, 210.31986556310198, -392.73151058365193, -300.19410218866267, 362.21273939787068); + double3x3 r0 = double3x3(-138.84208137348389, -55.743654039103376, -380.955324589254, 510.79634380237962, -221.89634452708827, 211.31986556310198, -391.73151058365193, -299.19410218866267, 363.21273939787068); + TestUtils.AreEqual(r0, ++a0); + + double3x3 a1 = double3x3(401.614830919362, -450.23016402229212, 243.54693114177644, 46.19202735190845, -41.497298975241051, 299.18547000511808, 154.35656530892311, -281.23327435237974, 200.70599922943211); + double3x3 r1 = double3x3(402.614830919362, -449.23016402229212, 244.54693114177644, 47.19202735190845, -40.497298975241051, 300.18547000511808, 155.35656530892311, -280.23327435237974, 201.70599922943211); + TestUtils.AreEqual(r1, ++a1); + + double3x3 a2 = double3x3(92.957765384091886, -295.58701171334229, 18.499063262016989, -215.71113381893895, 471.94723651928234, 257.07660090973445, 41.625937719655212, 4.8254301570474354, 243.00478588929627); + double3x3 r2 = double3x3(93.957765384091886, -294.58701171334229, 19.499063262016989, -214.71113381893895, 472.94723651928234, 258.07660090973445, 42.625937719655212, 5.8254301570474354, 244.00478588929627); + TestUtils.AreEqual(r2, ++a2); + + double3x3 a3 = double3x3(-472.61902330472088, -477.45955227197129, 9.8914859340952717, -76.922842299995409, -29.767583622488928, -387.17744344620849, 461.70929906410595, 13.699699169816313, -46.303758404359087); + double3x3 r3 = double3x3(-471.61902330472088, -476.45955227197129, 10.891485934095272, -75.922842299995409, -28.767583622488928, -386.17744344620849, 462.70929906410595, 14.699699169816313, -45.303758404359087); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void double3x3_operator_postfix_inc() + { + double3x3 a0 = double3x3(-396.6697396695007, 511.20749378167443, 249.11127030528678, -128.81731301584153, -259.49027669592306, 278.00817764830219, -81.393423356764686, 66.719732554033271, 167.85212691493894); + double3x3 r0 = double3x3(-396.6697396695007, 511.20749378167443, 249.11127030528678, -128.81731301584153, -259.49027669592306, 278.00817764830219, -81.393423356764686, 66.719732554033271, 167.85212691493894); + TestUtils.AreEqual(r0, a0++); + + double3x3 a1 = double3x3(147.94395048354932, 41.033564825092185, 128.5304239394751, 73.155582223625629, -60.132380275117384, -446.22976490772783, -296.93783797739906, 267.29380071689081, 446.22930714405572); + double3x3 r1 = double3x3(147.94395048354932, 41.033564825092185, 128.5304239394751, 73.155582223625629, -60.132380275117384, -446.22976490772783, -296.93783797739906, 267.29380071689081, 446.22930714405572); + TestUtils.AreEqual(r1, a1++); + + double3x3 a2 = double3x3(49.200223230384381, -510.86424064583343, 471.64748762159024, -171.01308186865089, 310.72735967800361, -298.91717185588425, 489.98497008252184, 184.60345109952777, 290.69102896875279); + double3x3 r2 = double3x3(49.200223230384381, -510.86424064583343, 471.64748762159024, -171.01308186865089, 310.72735967800361, -298.91717185588425, 489.98497008252184, 184.60345109952777, 290.69102896875279); + TestUtils.AreEqual(r2, a2++); + + double3x3 a3 = double3x3(117.1923401901463, 412.36778874526158, -229.38657079887884, 239.59693848322934, 36.624316947825378, -80.708194531830145, -391.03352016538076, -478.22714136458336, 166.86049159190645); + double3x3 r3 = double3x3(117.1923401901463, 412.36778874526158, -229.38657079887884, 239.59693848322934, 36.624316947825378, -80.708194531830145, -391.03352016538076, -478.22714136458336, 166.86049159190645); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void double3x3_operator_prefix_dec() + { + double3x3 a0 = double3x3(123.12869626056806, 256.8437465433235, 156.33078844674435, 461.73742530389563, 325.86799755965728, 392.01561731473339, 187.87412580655609, -236.2252043393558, 125.10963517292851); + double3x3 r0 = double3x3(122.12869626056806, 255.8437465433235, 155.33078844674435, 460.73742530389563, 324.86799755965728, 391.01561731473339, 186.87412580655609, -237.2252043393558, 124.10963517292851); + TestUtils.AreEqual(r0, --a0); + + double3x3 a1 = double3x3(469.8447313112415, 376.04684680329956, -363.07547991493504, -22.028951416736902, 248.79012667797042, 168.0950144120003, 168.26565011230559, -190.284744112885, 166.9455474200405); + double3x3 r1 = double3x3(468.8447313112415, 375.04684680329956, -364.07547991493504, -23.028951416736902, 247.79012667797042, 167.0950144120003, 167.26565011230559, -191.284744112885, 165.9455474200405); + TestUtils.AreEqual(r1, --a1); + + double3x3 a2 = double3x3(183.95795854551625, -460.73930261132273, 89.569894117102876, -267.42982090051743, 201.75623450137505, -141.21688682456357, -217.48409782046645, 197.36173281323249, -213.54412732531506); + double3x3 r2 = double3x3(182.95795854551625, -461.73930261132273, 88.569894117102876, -268.42982090051743, 200.75623450137505, -142.21688682456357, -218.48409782046645, 196.36173281323249, -214.54412732531506); + TestUtils.AreEqual(r2, --a2); + + double3x3 a3 = double3x3(180.74062570405226, 478.04553888647149, -454.56614062495817, -386.89835256473083, 387.85698408068015, -315.11044969927076, -108.28654556548526, -286.31702937107394, -375.60158007945938); + double3x3 r3 = double3x3(179.74062570405226, 477.04553888647149, -455.56614062495817, -387.89835256473083, 386.85698408068015, -316.11044969927076, -109.28654556548526, -287.31702937107394, -376.60158007945938); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void double3x3_operator_postfix_dec() + { + double3x3 a0 = double3x3(379.68831723727669, 302.69287814884115, -176.07134040448409, -291.25267066212962, 470.56758401848731, -402.92594666170231, -63.655158787805192, 355.26110069605568, -27.889220489137415); + double3x3 r0 = double3x3(379.68831723727669, 302.69287814884115, -176.07134040448409, -291.25267066212962, 470.56758401848731, -402.92594666170231, -63.655158787805192, 355.26110069605568, -27.889220489137415); + TestUtils.AreEqual(r0, a0--); + + double3x3 a1 = double3x3(-100.76183824462902, 479.94519613680677, -200.30429491787419, -445.0269393609031, 407.42034907239508, 327.67032519340069, 48.0602071509046, -209.66798100698179, -38.435048836485976); + double3x3 r1 = double3x3(-100.76183824462902, 479.94519613680677, -200.30429491787419, -445.0269393609031, 407.42034907239508, 327.67032519340069, 48.0602071509046, -209.66798100698179, -38.435048836485976); + TestUtils.AreEqual(r1, a1--); + + double3x3 a2 = double3x3(283.941595924991, 152.51066334196867, -287.262531175866, -215.94803939384781, -407.04635567546188, 159.23357136511879, -359.45648663093175, 168.4139531442961, -278.93379868144814); + double3x3 r2 = double3x3(283.941595924991, 152.51066334196867, -287.262531175866, -215.94803939384781, -407.04635567546188, 159.23357136511879, -359.45648663093175, 168.4139531442961, -278.93379868144814); + TestUtils.AreEqual(r2, a2--); + + double3x3 a3 = double3x3(289.91284073978329, 470.71654937729079, -208.56061873611094, 145.89674789546837, -296.79095258228062, -274.57083309561517, -250.04125630578085, -70.856303486440481, -485.627825724719); + double3x3 r3 = double3x3(289.91284073978329, 470.71654937729079, -208.56061873611094, 145.89674789546837, -296.79095258228062, -274.57083309561517, -250.04125630578085, -70.856303486440481, -485.627825724719); + TestUtils.AreEqual(r3, a3--); + } + + [TestCase /* For player builds */] + public static void double3x3_EqualsObjectOverride() + { + TestUtils.IsFalse(new double3x3().Equals((object)new int())); + TestUtils.IsTrue(new double3x3().Equals((object)new double3x3())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestDouble3x3.gen.cs.meta b/src/Tests/Tests/Shared/TestDouble3x3.gen.cs.meta new file mode 100644 index 00000000..c045174d --- /dev/null +++ b/src/Tests/Tests/Shared/TestDouble3x3.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4971c82bdb64ccb49b92ffe0a2d2c59a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestDouble3x4.gen.cs b/src/Tests/Tests/Shared/TestDouble3x4.gen.cs new file mode 100644 index 00000000..03ea5969 --- /dev/null +++ b/src/Tests/Tests/Shared/TestDouble3x4.gen.cs @@ -0,0 +1,956 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestDouble3x4 + { + [TestCompiler] + public static void double3x4_zero() + { + TestUtils.AreEqual(0.0, double3x4.zero.c0.x); + TestUtils.AreEqual(0.0, double3x4.zero.c0.y); + TestUtils.AreEqual(0.0, double3x4.zero.c0.z); + TestUtils.AreEqual(0.0, double3x4.zero.c1.x); + TestUtils.AreEqual(0.0, double3x4.zero.c1.y); + TestUtils.AreEqual(0.0, double3x4.zero.c1.z); + TestUtils.AreEqual(0.0, double3x4.zero.c2.x); + TestUtils.AreEqual(0.0, double3x4.zero.c2.y); + TestUtils.AreEqual(0.0, double3x4.zero.c2.z); + TestUtils.AreEqual(0.0, double3x4.zero.c3.x); + TestUtils.AreEqual(0.0, double3x4.zero.c3.y); + TestUtils.AreEqual(0.0, double3x4.zero.c3.z); + } + + [TestCompiler] + public static void double3x4_operator_equal_wide_wide() + { + double3x4 a0 = double3x4(492.15758275061728, -495.20632027797694, 227.45765195947968, -147.37405950733182, -222.68201909897942, 64.093720704360749, -23.890404473939157, -16.8197190839889, 163.23210890741655, -165.27101071424363, 470.87767980568003, -423.94255967808078); + double3x4 b0 = double3x4(192.56880888369346, -235.61102472786376, -254.04311740307281, -412.62472052715009, 471.90480945627428, -6.4727852374654162, -339.10237447316865, 488.1875700839737, -379.5965842584132, -308.41700258311675, -82.333374300195544, -102.92108087563935); + bool3x4 r0 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + double3x4 a1 = double3x4(109.63436918595539, 462.69031283943468, -335.38147727371262, 357.23446934168896, 1.5455777652308598, -347.38824741327585, -114.47217302884542, 435.84865804940864, 194.23808607563285, 138.76554710174241, -467.34914205379278, 370.43337767684523); + double3x4 b1 = double3x4(226.51573835430463, -356.90132896830391, -362.91277544708589, -427.89843746083716, 466.65013978753711, -102.79904680270658, -43.355954428834821, 85.045664111639212, -91.127054972167628, 422.19208856215334, -477.43130873024057, 1.8770024785198984); + bool3x4 r1 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + double3x4 a2 = double3x4(476.70826147343416, 320.55264702465047, -498.59197377534207, 92.4169581366782, 104.51136856177425, 166.75460608618084, -204.73343024250744, 434.75675674656259, -397.32965988541469, 503.98163699730378, -503.7141270598928, 90.659743112819115); + double3x4 b2 = double3x4(312.5800799394865, 254.59934365684137, 352.72583763335172, 62.490957050812881, 119.71476059766246, -511.05808639482507, -302.47273053902791, -371.76924365189359, -20.007841834802093, 21.459455738523729, -426.02067228128232, -305.41193666374863); + bool3x4 r2 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + double3x4 a3 = double3x4(-303.4452423078219, 9.3449113412503948, 290.9010785980621, -147.57193882184657, 368.08236067745941, -321.60959044173808, -171.4654224717363, -441.30646368549503, -137.76681834914109, 304.68958463551928, 301.88943948498434, -222.22090564585335); + double3x4 b3 = double3x4(261.68332517411716, 50.0047347778476, -334.13464824023407, 75.065677916196023, -51.186689639085273, -135.96155721319911, -409.36487431515235, 160.81974013187914, 102.12079553591127, 277.81306637349212, 434.90674444423371, -15.289183385339186); + bool3x4 r3 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void double3x4_operator_equal_wide_scalar() + { + double3x4 a0 = double3x4(-303.2300766926399, 451.52631327674089, -253.65587413201848, -105.20363502632995, -500.6910920090466, -426.19248338518315, 159.87609656149334, -59.558379439431405, -57.477391031327386, -182.04973968400139, 406.51375861024189, 370.88599866017978); + double b0 = (123.5445759871717); + bool3x4 r0 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + double3x4 a1 = double3x4(-172.03530629539642, -11.338988547836891, 363.93823044557973, -27.150561106927, -325.97606507221985, -290.35904254129116, 180.19686635779067, -374.12832015293105, -439.35894295170851, -126.54608899287234, -197.2617896521752, -227.15933357326281); + double b1 = (455.40001198993991); + bool3x4 r1 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + double3x4 a2 = double3x4(-479.8991937487848, -495.23734902555, -224.51705013239621, -422.83322616239695, -450.19627043707123, -20.106708774392814, 297.37999906082632, 185.9665759475746, -102.97598962810633, -220.59704910060253, -228.686854707397, -333.00125972041917); + double b2 = (-439.77767750237962); + bool3x4 r2 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + double3x4 a3 = double3x4(434.2130317325765, -239.86977707588568, 380.93927281952426, 90.349506658664723, -361.32792751925433, -453.59993836544453, 157.73248799039629, -491.04621457077855, 296.61425055964582, 482.26513432071783, -305.87698259292029, -290.10212601819171); + double b3 = (406.24874062382094); + bool3x4 r3 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void double3x4_operator_equal_scalar_wide() + { + double a0 = (-253.39728534100453); + double3x4 b0 = double3x4(19.952187785856495, -185.79199346610903, 407.8136052600172, -87.2766969610363, -206.27469382354741, 160.503138855334, -274.77081478516141, -2.6315281403397535, 448.35453602688131, -410.03524251004461, 247.32901465489022, 355.53915350303942); + bool3x4 r0 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + double a1 = (-298.06671180299793); + double3x4 b1 = double3x4(414.10151429385951, -481.30262707234482, 196.55074438664633, 34.60100008668428, 113.76156645350227, -386.45337861890596, -124.49174672201821, 243.8866447153905, -492.6181826501238, 145.424413033493, 421.55070968230757, -95.409988209330493); + bool3x4 r1 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + double a2 = (336.80928746648567); + double3x4 b2 = double3x4(209.58380589707929, 487.441424358376, 161.80653365040507, 149.84247095409899, 225.723996505944, -71.21880176999548, 85.780251781353854, 192.547256797807, -49.887493395194156, -229.80195652218629, -103.40733413743197, 19.215747126944279); + bool3x4 r2 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + double a3 = (492.88110827509365); + double3x4 b3 = double3x4(140.40315849166507, -267.53641546309757, 125.9727018466092, 478.00049398746364, 116.14462071105118, -368.95778220191494, -225.02866350162247, 2.7237255585955609, -452.2632198055569, 87.456553261474028, 401.30651802630462, -18.645524272064449); + bool3x4 r3 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void double3x4_operator_not_equal_wide_wide() + { + double3x4 a0 = double3x4(430.8425316432689, 104.69001798736394, 225.80243478799355, -310.57017841496048, -418.61945815506363, 304.12820281839379, -509.32682561749908, -160.53807719076895, -203.30197606016975, -505.76325368590807, 162.17220623892365, 1.1561973100324394); + double3x4 b0 = double3x4(210.02470622305975, -55.203330304102678, -269.92533672504373, -234.54673372700194, 25.917412054686565, -63.726991444699024, -484.55371092471933, -425.333599050219, -53.274394775402925, 328.1944192984115, 15.963139303011417, 461.71412417931208); + bool3x4 r0 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + double3x4 a1 = double3x4(65.662074358045174, 102.78780250567377, 172.93008120960098, 26.621009123800832, 235.12595259171258, 128.54198533321824, -354.99697630246959, 334.35948220564023, -495.83200692377613, 468.30740163675853, 458.37094733601941, 299.93733300824522); + double3x4 b1 = double3x4(-113.36304455313973, -240.07297264787974, 495.11916970420589, 203.5583661550462, 340.49345103860526, -241.90719448863865, 459.56982896270688, 213.0737384357833, -384.7828506831, -255.07233846144396, 477.66343115161328, -248.03662621604121); + bool3x4 r1 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + double3x4 a2 = double3x4(43.12718560319729, -354.71349994964595, -145.28719551176169, 390.80186218340032, -303.13149108697263, 391.13459533785215, 139.2868607692825, 104.52318506339714, 511.29640293088573, 213.1470559635884, -101.09569625793756, 441.6633772522506); + double3x4 b2 = double3x4(-407.92344565313471, -199.78886971240343, 151.84326488889906, -97.120607659742518, 154.97589380805186, -172.83452065886672, 441.5027942329192, -401.73862785926957, -411.43016333665241, -337.8202766561044, -430.63088270213029, -150.87180502287663); + bool3x4 r2 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + double3x4 a3 = double3x4(124.36612301895684, 312.02642622218764, 59.65573766625289, -508.65682315670739, 98.699622438615052, 228.79984174892297, 337.83266965385189, -163.1544383331921, 461.69158885520494, -450.77570340166596, -443.56476637514527, -438.2131223334992); + double3x4 b3 = double3x4(-206.83699212169137, 34.955056922023687, -255.77146422852366, 99.99864320643178, -161.17557127828502, 68.853526862735634, -285.59012116379574, -428.71731229718648, -286.33740700703925, 2.0271298894784877, -4.8059971354929871, -425.33480115669539); + bool3x4 r3 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void double3x4_operator_not_equal_wide_scalar() + { + double3x4 a0 = double3x4(-16.914588697680529, 168.83411486858233, -462.71352145760949, 130.30776959765137, 214.50161443208424, -440.26328178879959, -197.12796053529155, -169.09985860115842, -386.61117595555783, -281.02101362916687, -270.26885593601912, -403.96372313236992); + double b0 = (-145.37277109239847); + bool3x4 r0 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + double3x4 a1 = double3x4(-269.80570877241234, -71.750904831919286, -432.75573917513515, -457.36312100727258, -13.519590622521719, 273.87305773136814, 185.042454567292, -482.53069351731364, 116.39514427836764, 511.73495578753523, 230.50753628020527, 100.27476768394683); + double b1 = (299.65422763473089); + bool3x4 r1 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + double3x4 a2 = double3x4(129.68240863163135, -220.63900409482375, 140.33521921016984, 369.2123617461009, 453.81121489676241, -333.66624871532724, -373.93775218256644, 150.20429451307484, -442.16476627912596, 372.32001488856974, -95.837970539852051, 495.56669663617697); + double b2 = (321.17879048044733); + bool3x4 r2 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + double3x4 a3 = double3x4(-5.385580780629823, -459.61274812166243, 243.3090676010163, 314.10215702378287, 96.745011136282756, -168.16192944727931, -71.905446324453408, 216.60847983910162, -377.37381356646017, 142.35499841643264, -432.27255722148, 94.290808959999481); + double b3 = (-210.50298581388915); + bool3x4 r3 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void double3x4_operator_not_equal_scalar_wide() + { + double a0 = (275.79582823244664); + double3x4 b0 = double3x4(-57.196896341255353, -382.4325279586169, 97.820359990848374, -161.46364529499022, -458.39563367254829, -499.61786364932448, 327.92217818271467, 367.57121699283425, 59.7863667289663, -209.58068118318016, -62.580453186566217, -479.97497604786184); + bool3x4 r0 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + double a1 = (-49.494519495169868); + double3x4 b1 = double3x4(-114.68521338081229, 109.93924599044919, -176.28482755286842, -347.48529903380449, 85.540928165214609, -356.65954868712441, -104.24357490625397, -133.54918605347592, 243.53971135036079, 13.141311890045813, -379.98594754747393, -41.281226892620907); + bool3x4 r1 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + double a2 = (87.911684792447659); + double3x4 b2 = double3x4(-339.07727996403224, -371.82034533648766, 333.14425936953364, 294.81196011920088, -187.14565977228136, 220.19225774528093, -228.18207250730234, -499.72373914146971, 97.4059055305114, 501.60439395420462, 459.67539880223353, 158.09812290877949); + bool3x4 r2 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + double a3 = (358.48858921531985); + double3x4 b3 = double3x4(243.51259171381253, 336.70294991913386, 89.953149122164177, -65.578377515812576, -159.26015503670095, 410.58855528877518, 123.96303206494224, -239.6251271886868, -299.42983808155628, -491.29190443981992, 207.71164641515895, 271.56546724567443); + bool3x4 r3 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void double3x4_operator_less_wide_wide() + { + double3x4 a0 = double3x4(196.84256825076534, 336.40979997087732, 251.96372115424072, 257.65591466503963, 430.04588647840819, -62.419644146421774, 8.8392293494376872, -333.81671563434259, 164.67880662003472, -350.94487516532877, 3.84143662631584, 125.40972024081725); + double3x4 b0 = double3x4(-465.34502313348696, -256.15239751346053, -314.814018634527, 364.56673662949663, 100.21050290959442, 182.56098636545289, 3.116978885194726, -259.43047893207074, -437.33490749696966, -456.0437321402336, -394.2559718537405, 401.91369099259077); + bool3x4 r0 = bool3x4(false, false, false, true, false, true, false, true, false, false, false, true); + TestUtils.AreEqual(r0, a0 < b0); + + double3x4 a1 = double3x4(-111.12994127680076, 70.005523475820951, 448.19828173527412, -419.98711200244122, -258.30166757213965, -34.832201735504043, -69.859397682295821, 67.767227442826766, -139.77729207825723, 385.43464130229995, 133.707390609061, 506.18837117878184); + double3x4 b1 = double3x4(313.43916454605721, 121.28668194696616, -28.012290729215522, -282.96589697663012, 330.06440631023816, 124.09937077579059, -183.69031700104955, 373.0607623406969, 109.75094013556418, -203.57134232463841, 45.6486556742567, -360.95226280808089); + bool3x4 r1 = bool3x4(true, true, false, true, true, true, false, true, true, false, false, false); + TestUtils.AreEqual(r1, a1 < b1); + + double3x4 a2 = double3x4(34.442885653322037, 412.11373896715872, -84.809773246203463, 444.78534504621541, -78.754743374304269, 366.97754376334024, 127.18045788965208, 428.36845489422251, 8.1976149120356467, -71.137346062407516, -474.05081937930117, 322.42891875022508); + double3x4 b2 = double3x4(211.91309867236441, -313.28636207863985, -259.66108691862837, 79.0985401045059, 446.49610897828643, 450.52455660818362, -375.63076728192658, -53.941822792376286, -291.4537471697916, 190.77482303919965, 54.083913589866825, -163.63087637891567); + bool3x4 r2 = bool3x4(true, false, false, false, true, true, false, false, false, true, true, false); + TestUtils.AreEqual(r2, a2 < b2); + + double3x4 a3 = double3x4(6.8978650602036851, 195.73355993802363, -267.69061315604051, -243.79369961647024, 319.25079336727538, -425.15620370635588, 71.873970303625811, 313.84387626957334, 397.27906126402274, -309.14588584990514, -38.667860764389786, -266.11969554895518); + double3x4 b3 = double3x4(-212.00563750602566, 406.09049649075166, -183.01893743454428, 355.22140304894253, -81.042213716098217, -275.71481693709029, 405.29925007619863, -510.64058065351128, 398.06925815999011, -4.35550666058225, 129.24267083464315, -276.1465247963306); + bool3x4 r3 = bool3x4(false, true, true, true, false, true, true, false, true, true, true, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void double3x4_operator_less_wide_scalar() + { + double3x4 a0 = double3x4(-132.05731708000292, -192.46500477216438, -66.834607870706634, -379.01750081545561, -360.28242199508588, 20.927834282129879, -158.24074537970159, 437.34587522845061, -20.452607402788772, 225.29148517609178, 307.48418607725023, 274.01523292903562); + double b0 = (-156.01021845452965); + bool3x4 r0 = bool3x4(false, true, false, true, true, false, true, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 < b0); + + double3x4 a1 = double3x4(373.54965584983563, 105.0301654827922, -58.010895994496934, 109.67008810381878, -108.853174498702, -44.971252223929014, 140.42607147080173, -500.08827638071415, 172.10334857371788, -197.50074610370245, -7.27149987559369, -432.99049898283113); + double b1 = (398.52368301829495); + bool3x4 r1 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 < b1); + + double3x4 a2 = double3x4(62.158315449095426, -377.85232299279994, -500.25573586870718, 149.1149638393498, 119.88061695912882, 202.63918909925928, 274.95066393304182, 66.4120323967245, 274.99944580486022, -149.63581402117194, 223.75870834279749, 73.266824041151835); + double b2 = (-72.254720959931035); + bool3x4 r2 = bool3x4(false, true, true, false, false, false, false, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + double3x4 a3 = double3x4(213.09497390179661, 418.3772096197946, 421.10357947885223, -187.16683658732421, 389.10944313048822, 401.33542818638284, -106.28507929029178, 380.60798162063952, 385.65284484701829, 120.65986376659009, -13.830871826890359, -500.12711238308208); + double b3 = (322.85949459805124); + bool3x4 r3 = bool3x4(true, false, false, true, false, false, true, false, false, true, true, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void double3x4_operator_less_scalar_wide() + { + double a0 = (-423.117411095238); + double3x4 b0 = double3x4(385.09483617595151, -123.93348532725753, 86.376572887588509, 133.44217378154497, 161.45794947513286, 229.75426660746064, 222.57159934871436, 315.53116360098647, -447.20351883731945, 271.83385790131695, -393.60531324595462, 317.48689737798964); + bool3x4 r0 = bool3x4(true, true, true, true, true, true, true, true, false, true, true, true); + TestUtils.AreEqual(r0, a0 < b0); + + double a1 = (-164.6051085761772); + double3x4 b1 = double3x4(-282.87605370342544, 296.97953071118309, -254.40115582868509, 365.61562054493265, -441.98425671178114, -131.42866021554391, 442.62897631275882, -29.792842163607872, -138.37379533535511, 9.2169721169476588, -226.7305482489665, 171.02944310523083); + bool3x4 r1 = bool3x4(false, true, false, true, false, true, true, true, true, true, false, true); + TestUtils.AreEqual(r1, a1 < b1); + + double a2 = (376.62522595777421); + double3x4 b2 = double3x4(-462.58872697436658, -142.36729795409707, -456.25377414014832, 66.6102416825529, 169.37875779409831, 327.44439450253003, 64.0879266560487, -153.50390369887646, 199.38014921889646, -244.96905314408662, 472.74382112582396, -363.78010075342843); + bool3x4 r2 = bool3x4(false, false, false, false, false, false, false, false, false, false, true, false); + TestUtils.AreEqual(r2, a2 < b2); + + double a3 = (-179.48750575794259); + double3x4 b3 = double3x4(-83.4251511485433, 178.88648828253451, 62.155780582761281, 409.74679560668153, -117.16365366669544, 316.60167684992848, 285.51627339307049, 18.674469718092382, 282.52931298060776, 132.92379075518056, -318.21533957040651, 314.83989181874313); + bool3x4 r3 = bool3x4(true, true, true, true, true, true, true, true, true, true, false, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void double3x4_operator_greater_wide_wide() + { + double3x4 a0 = double3x4(483.50140141113729, 310.81563415695712, 106.9661896726891, 295.73526038589671, 116.95757179938141, -478.29977653841479, -14.897393471979228, -33.817441717636484, -24.740548383789417, 319.78262701620474, -120.15856581561201, -289.00857962714906); + double3x4 b0 = double3x4(-471.39802454011425, -371.98528617060992, 36.900723236101044, -316.76360407320954, 19.683055648432628, 207.3091381561519, 362.79748861994483, 324.95341816775192, 340.94807140014507, 25.986035120666997, -114.2111352021858, 240.80346428640348); + bool3x4 r0 = bool3x4(true, true, true, true, true, false, false, false, false, true, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + double3x4 a1 = double3x4(455.85146662958505, 144.70691139283917, 63.931990891663304, -285.68304099034663, -502.0907201720824, -337.19446412529538, 474.31734274063137, -507.14510679018923, -133.56559735795742, -443.10913654934109, -464.34137056038776, -68.361549647693323); + double3x4 b1 = double3x4(273.42244757033063, 325.51576224226312, 27.341068995809678, 64.479532510265472, 200.94836983501375, 100.12266998184964, -79.00710896356361, -315.137945560337, -122.98542815213347, -163.77920229908972, -492.56600617457462, -90.797273439726439); + bool3x4 r1 = bool3x4(true, false, true, false, false, false, true, false, false, false, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + double3x4 a2 = double3x4(-185.99299987870876, -157.80389340119615, -74.124229227250567, -94.471165939453613, 329.61055508703487, -315.83675280019486, 404.193811843262, 131.30440503512716, -206.6339033612208, 197.39985832823436, 187.99195274524016, 362.63607542712055); + double3x4 b2 = double3x4(-284.9012335673446, -23.653687249707843, 174.93002112905026, 85.7125366133231, -441.98783012944637, 345.54374210235835, 482.21949814363359, -422.38349719642827, -30.779309048680261, 296.15423669300708, 378.05988830051376, -457.73343942022575); + bool3x4 r2 = bool3x4(true, false, false, false, true, false, false, true, false, false, false, true); + TestUtils.AreEqual(r2, a2 > b2); + + double3x4 a3 = double3x4(336.09317819033436, -352.44836752137559, -183.10199865284471, 193.14483484679124, -170.216002781976, -0.49123787902817639, -326.85503760299412, -373.39623826248396, -216.58046422553269, 282.51211489481489, -275.17035616336875, -207.331757403599); + double3x4 b3 = double3x4(122.92057257654176, -509.17313766347854, 386.7706226719406, 436.41747280415962, -276.49581516743444, -163.16677554099203, 249.97064625936127, -165.02074130113272, 89.092999261381578, 404.30517287007774, -340.68884889254758, -103.78509550159106); + bool3x4 r3 = bool3x4(true, true, false, false, true, true, false, false, false, false, true, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void double3x4_operator_greater_wide_scalar() + { + double3x4 a0 = double3x4(64.317918092160426, -397.70346445483318, 431.87690826499693, 85.702980796668157, 246.26305233978803, 197.49155602114809, 286.1994608781298, 280.81334818564972, -405.78459210218148, 171.56538661362856, -241.80727326209063, 333.57817498481745); + double b0 = (305.85991992888034); + bool3x4 r0 = bool3x4(false, false, true, false, false, false, false, false, false, false, false, true); + TestUtils.AreEqual(r0, a0 > b0); + + double3x4 a1 = double3x4(370.27919524269146, -356.5923551789449, -353.03129522550444, 396.64532608382649, 467.22205541432936, -240.0134228393498, 502.91505193287276, 315.46759024051369, -259.28970134411458, 281.23064554912537, 428.79219909608, 245.15306460352292); + double b1 = (-413.70138116073861); + bool3x4 r1 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + double3x4 a2 = double3x4(-279.17542494422543, -124.77154856769909, -425.65293451103054, 99.132852838902181, 355.0605339273161, -456.43941256796916, 154.48902208846482, 405.52974409867534, -157.73379643155903, 186.08628639303436, 249.99909531790718, -110.0969179189284); + double b2 = (-453.86309668694764); + bool3x4 r2 = bool3x4(true, true, true, true, true, false, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 > b2); + + double3x4 a3 = double3x4(-435.3045134187231, -254.34657037181154, -428.98794980951953, 255.37367761105941, -309.11230459302305, 185.50160678918553, -201.33417687254689, 23.321151029002408, -143.97610027341921, -111.77951412637697, -356.65661852278589, -318.31356945555359); + double b3 = (72.752033029101767); + bool3x4 r3 = bool3x4(false, false, false, true, false, true, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void double3x4_operator_greater_scalar_wide() + { + double a0 = (-282.67049635698572); + double3x4 b0 = double3x4(358.09997360692353, -72.5964134077525, -232.16380106292843, -60.706723956720282, 75.156642710397364, 150.88350040786133, 339.53917924479538, -498.19602965665797, 459.74610326241054, -227.96872316485678, 335.86213485145106, 76.178844248959308); + bool3x4 r0 = bool3x4(false, false, false, false, false, false, false, true, false, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + double a1 = (296.85993899817572); + double3x4 b1 = double3x4(177.49000390688423, -281.20120657663847, 244.72285162877427, 137.32857257562159, -385.33824724021287, 443.16345879210326, -353.56254141105455, 26.040673983302327, -331.7939499969566, -43.691963454565041, 20.949428806523542, -211.17984423934473); + bool3x4 r1 = bool3x4(true, true, true, true, true, false, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + double a2 = (227.42171894173214); + double3x4 b2 = double3x4(-84.7797711290325, -375.13548701588786, -205.17813096064054, -197.04714617368165, -219.63402305340117, -210.01563344244641, -266.773715858708, 144.77848703450456, -471.71120069535039, -155.91317494023275, 99.724721716588647, -230.94484316135981); + bool3x4 r2 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 > b2); + + double a3 = (-338.86889640375455); + double3x4 b3 = double3x4(334.06826630889827, -158.66085703608621, -315.01822414762262, -177.19281991626735, 171.959285100903, 198.38915047347041, 303.67832603290594, 400.69957346501735, 351.87867252523017, -31.76966072608235, 386.07330077983124, -360.34885733218346); + bool3x4 r3 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void double3x4_operator_less_equal_wide_wide() + { + double3x4 a0 = double3x4(-438.52313753521219, 210.48942837980087, 4.8773329280677444, -137.29793817237857, 156.09410174009111, -363.92412035722475, -97.948485181642923, 437.29539009430232, 458.53029153241323, -294.06474675520542, 23.622613679441884, -34.284056441059363); + double3x4 b0 = double3x4(-474.8141498392514, 304.3710555063426, 234.8241737982371, -390.48543209139513, -297.17535295019638, -326.29239121372461, 107.2538764976216, -413.13107342884462, 67.094432623635271, 470.07522724106684, -84.499104777583455, 392.78422683886447); + bool3x4 r0 = bool3x4(false, true, true, false, false, true, true, false, false, true, false, true); + TestUtils.AreEqual(r0, a0 <= b0); + + double3x4 a1 = double3x4(149.736484835733, -418.8866781754823, -197.50252899783783, -88.2055118494693, -376.71814292330208, 341.62712899857536, -83.309179106405566, -107.49073295830317, 319.46688833807912, 205.35738501574724, 345.56372968552807, 395.32190746596177); + double3x4 b1 = double3x4(-263.53175485484849, 369.30090039284005, -333.32529298091555, 238.41347443238533, 486.24259279959028, 279.65021408705513, 236.05201803709008, 132.75898248178839, 66.294708998079727, 183.00210699020056, 200.13055071613314, 339.043800750302); + bool3x4 r1 = bool3x4(false, true, false, true, true, false, true, true, false, false, false, false); + TestUtils.AreEqual(r1, a1 <= b1); + + double3x4 a2 = double3x4(-222.87415490992095, 439.02200790821666, -368.0755667016262, -200.03860173003682, 71.46990660180802, -357.36542932939039, 141.7108519737194, 319.0170969064427, 303.03015889927292, -461.57424829042247, 277.62674749904625, 182.178105677561); + double3x4 b2 = double3x4(438.53791710293751, 145.40187866306019, 178.16310199450845, 157.97596724237133, 329.7052015409364, -243.59091221708383, 5.4011614347813293, -22.580605278993289, -90.33759478961008, -72.19107798123315, -354.35482399275281, -289.52172650467685); + bool3x4 r2 = bool3x4(true, false, true, true, true, true, false, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + double3x4 a3 = double3x4(-337.41483441806156, -361.39166109701227, 222.14351020666936, -464.7795028466636, -146.8536623208102, 80.175055302761052, -260.34730088913221, 94.489041134011472, 174.2811945296271, -303.81969251475283, 81.417447366480474, 503.048130508069); + double3x4 b3 = double3x4(85.176270763006187, 469.32790468136216, 294.71383656874013, 461.60593411959985, -245.93047892578431, -124.04044610077534, 278.39260948747051, -42.881244917810534, -328.34883824379597, 98.985619352658091, -375.8998207412194, -197.93427309670221); + bool3x4 r3 = bool3x4(true, true, true, true, false, false, true, false, false, true, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void double3x4_operator_less_equal_wide_scalar() + { + double3x4 a0 = double3x4(193.4958237118534, 168.91555197952107, -313.9930695565385, 81.826965131716292, 18.503590830836288, -0.35819602029312136, 241.36115776810846, -463.81641242644582, -1.3577692515020203, -268.89945591096739, 398.9919504593089, -471.253072242836); + double b0 = (443.85054299042122); + bool3x4 r0 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + double3x4 a1 = double3x4(-264.93778264938749, 11.246050124636895, 424.7040156911612, 426.48223157715154, 56.319978501796754, -196.28791126808522, 31.901173844887467, -152.2575724833913, -437.92645975478297, -37.104814785115821, -47.144214413661587, 333.6230348710078); + double b1 = (82.258299150624453); + bool3x4 r1 = bool3x4(true, true, false, false, true, true, true, true, true, true, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + double3x4 a2 = double3x4(-274.80387438219225, -260.46056926458169, 192.30916008367626, 145.30606777281787, -466.13296363602063, -494.26732968458316, -111.57013922164691, -139.54120332540072, -146.58935148389514, 33.984021917909445, -445.70445248377717, -451.04219624541804); + double b2 = (358.67627804292192); + bool3x4 r2 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 <= b2); + + double3x4 a3 = double3x4(-122.03926115950537, -202.46552119146361, -76.564869677910963, 218.03280482908372, -103.5359361653849, -283.35842312656268, -374.76167910860931, -213.49586568283655, 477.49183891596829, -383.37006849021191, 23.964948426915726, -5.9607760933976692); + double b3 = (83.327714720427821); + bool3x4 r3 = bool3x4(true, true, true, false, true, true, true, true, false, true, true, true); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void double3x4_operator_less_equal_scalar_wide() + { + double a0 = (393.60626644343427); + double3x4 b0 = double3x4(-75.688363825757222, -44.2638714519627, 125.86491566797019, 191.96488174794467, 13.543054825413492, -197.0519259893577, -423.945100743298, -330.04861680141119, 420.16553779140372, 105.54730777887039, 174.82126363311954, 296.71757831085358); + bool3x4 r0 = bool3x4(false, false, false, false, false, false, false, false, true, false, false, false); + TestUtils.AreEqual(r0, a0 <= b0); + + double a1 = (-469.70041845259277); + double3x4 b1 = double3x4(123.26718979853536, 112.9969695140594, 495.14339493920249, -488.65789364681478, 388.53941148730894, -493.24077080806751, 16.451064832718657, -387.6516336815672, -229.1773127192526, -373.01533930982248, -391.142134610164, 90.994149488859875); + bool3x4 r1 = bool3x4(true, true, true, false, true, false, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 <= b1); + + double a2 = (-178.39613517485378); + double3x4 b2 = double3x4(-69.621067317957568, 471.7908458522478, -67.4667532758167, 45.305359623071467, -154.69219000390365, 385.73888248286153, -431.652945004242, -331.67304841227508, -349.89271013340573, -114.83913021666888, -245.21782671903156, -486.69548224224496); + bool3x4 r2 = bool3x4(true, true, true, true, true, true, false, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + double a3 = (391.95091957224111); + double3x4 b3 = double3x4(-125.77055150166643, -229.81227527829458, 289.44901265271426, -200.49423680104979, 281.59270991086623, 99.901066588191838, -146.02742845659492, 124.14839774190841, 94.357016368935319, 93.920113845691162, -484.92414711645068, -270.79689396116737); + bool3x4 r3 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void double3x4_operator_greater_equal_wide_wide() + { + double3x4 a0 = double3x4(-507.92858409692, 504.49748181947393, -385.43449205226938, -262.32340944107784, -37.550928848586466, -111.59527759980193, -463.70202157632542, 387.44885772627265, 456.96878573716094, -211.01015506079892, 182.41135391146474, -53.596053863687473); + double3x4 b0 = double3x4(-81.346509732933043, 297.66615047010885, 171.06540616371922, -431.03805538222105, -6.859075311040101, 319.72570362674333, 254.079170106947, 396.5724000393285, 178.83927615864172, -447.06336304501787, 288.49268569075161, 474.88929460704765); + bool3x4 r0 = bool3x4(false, true, false, true, false, false, false, false, true, true, false, false); + TestUtils.AreEqual(r0, a0 >= b0); + + double3x4 a1 = double3x4(-309.57021608463032, -136.02249127999994, 280.73629082401112, -96.9958942388165, -174.05950673579213, 88.9019382413951, 43.816040774721728, -446.07842585354967, 16.645595796706857, 409.83252043734888, -191.32987245886113, 222.99782548798146); + double3x4 b1 = double3x4(-321.75022831640683, -395.97722048125104, -158.69246037243516, 391.48869318118727, -368.10924141859135, 89.1238043723273, -510.27932214656812, -486.92979525352354, -81.215552606254619, 274.21882046117389, -212.88155494112596, 288.99530591117); + bool3x4 r1 = bool3x4(true, true, true, false, true, false, true, true, true, true, true, false); + TestUtils.AreEqual(r1, a1 >= b1); + + double3x4 a2 = double3x4(404.28838915577546, 230.60328136691976, -441.78928228923553, -86.293056289801882, 484.24954413075443, 95.2363665547391, -204.91210255628084, -199.77434620623211, -421.86318107222354, -18.214789637464492, -346.8227681344481, -159.24364073539323); + double3x4 b2 = double3x4(307.73173131967508, 307.24516620638087, -199.39178213821339, -284.42126978767163, -482.39181278757371, 448.3157362641374, -378.3461889598268, -390.8584684761513, 8.9160292190108521, 416.40721984226593, -213.67494664605471, 455.24810788372906); + bool3x4 r2 = bool3x4(true, false, false, true, true, false, true, true, false, false, false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + double3x4 a3 = double3x4(112.9177020121914, 48.29104115827522, 390.66016525340274, 154.21916706590878, -32.748053804388292, -288.2656096370265, 122.70425826064513, 321.2779754704228, 230.18381487121053, 116.87426024157287, -93.515688701307283, 229.98230730275736); + double3x4 b3 = double3x4(-236.08035980727539, -248.37309348228064, 184.18512567513858, 415.31133885649558, 86.982202808830039, 485.00455950433604, 107.75893955480262, -486.66772459757874, -138.67679197093321, 14.207853562295327, -382.39416211768713, -117.00821524346628); + bool3x4 r3 = bool3x4(true, true, true, false, false, false, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void double3x4_operator_greater_equal_wide_scalar() + { + double3x4 a0 = double3x4(465.15218732559686, -424.8860745024337, -209.22109685150025, 58.779852656079356, -302.26910533675414, 140.12558252183976, 16.353385694489475, -344.55997316192838, 393.27804846003562, -315.70155086913218, 441.0115565923096, -509.78156757251435); + double b0 = (-5.5998842742293391); + bool3x4 r0 = bool3x4(true, false, false, true, false, true, true, false, true, false, true, false); + TestUtils.AreEqual(r0, a0 >= b0); + + double3x4 a1 = double3x4(-36.994287269652943, -164.97393830352183, -466.12009046325466, -123.8137477020797, 215.65121779947128, 104.99569730879534, 314.34603014325069, 190.51609882643265, -83.111429014760745, -23.836435567511444, 143.04935962662535, -264.91997945724052); + double b1 = (494.82028865014217); + bool3x4 r1 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + double3x4 a2 = double3x4(-169.70222457205051, 359.09582035573931, -260.42331016269668, 354.19514219565087, -111.84533768140028, 33.309096113456917, 355.63126938214123, -435.36056753404466, -38.39930893778768, -93.29572896533449, -338.84962169213668, 436.89581676800537); + double b2 = (329.70751610850334); + bool3x4 r2 = bool3x4(false, true, false, true, false, false, true, false, false, false, false, true); + TestUtils.AreEqual(r2, a2 >= b2); + + double3x4 a3 = double3x4(511.08413982348713, -453.79924771459741, 170.91899998994495, -182.82575591971437, -207.51692710049309, -319.500592142111, -240.5086177515372, 436.34132286363342, -66.956061632817637, 303.32088174639307, 180.19605907248149, 337.9651765012951); + double b3 = (-277.67452419813469); + bool3x4 r3 = bool3x4(true, false, true, true, true, false, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void double3x4_operator_greater_equal_scalar_wide() + { + double a0 = (374.82703393270594); + double3x4 b0 = double3x4(-1.609757185731894, 338.61524049314448, -116.18140392945213, -332.15732375353451, -355.9793509710484, -468.90144107719021, 38.579884785497484, -332.34754697063357, 2.8901150240051265, 467.77776477661814, 121.40638762405445, -305.02337303060267); + bool3x4 r0 = bool3x4(true, true, true, true, true, true, true, true, true, false, true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + double a1 = (-58.428812292604164); + double3x4 b1 = double3x4(-226.51955209789776, -47.020994446715804, 305.3026770582901, -427.40123315686418, 92.263649745035764, -497.17853736187266, -408.62564225151465, -455.23049113491106, 396.42608637196292, -469.29488561548987, -485.7540130493017, -182.34619268325446); + bool3x4 r1 = bool3x4(true, false, false, true, false, true, true, true, false, true, true, true); + TestUtils.AreEqual(r1, a1 >= b1); + + double a2 = (-291.54536284671417); + double3x4 b2 = double3x4(278.740809331993, -75.87113932327884, 28.907059921374071, 287.72014988945807, 420.50978990109161, 473.62684152723614, 181.514540518408, -369.20287220981106, 243.74977385427326, -244.12415825767636, -242.9933451353541, -322.11536780098237); + bool3x4 r2 = bool3x4(false, false, false, false, false, false, false, true, false, false, false, true); + TestUtils.AreEqual(r2, a2 >= b2); + + double a3 = (192.974957794405); + double3x4 b3 = double3x4(-54.725568558427312, -166.00083907228003, 244.29344117096321, 438.24940105818655, -162.69282610839832, 37.185346382290732, -506.66736459483735, -205.1630781652234, 368.3899807261256, -35.459948317827639, -20.916435966694905, 9.041354422011068); + bool3x4 r3 = bool3x4(true, true, false, false, true, true, true, true, false, true, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void double3x4_operator_add_wide_wide() + { + double3x4 a0 = double3x4(506.12905263627374, -501.77980803967444, 420.08479638587903, -186.03206476291274, -9.3123953385801883, 328.51179686585056, 424.34407659263536, 87.791079800478656, 462.41368148402012, -46.178705952213477, 401.17006296718966, -454.12414643453627); + double3x4 b0 = double3x4(-28.757987751047096, -337.135153689019, -340.676816860529, 152.31202633320913, 423.66745420157326, 90.374096674087468, 376.18866246574964, 1.7671887882831925, -120.18586045139745, -279.62936628965167, -344.66710273580026, 242.8391956029642); + double3x4 r0 = double3x4(477.37106488522664, -838.91496172869347, 79.407979525350015, -33.720038429703607, 414.35505886299308, 418.885893539938, 800.532739058385, 89.558268588761848, 342.22782103262267, -325.80807224186515, 56.502960231389409, -211.28495083157208); + TestUtils.AreEqual(r0, a0 + b0); + + double3x4 a1 = double3x4(69.195687564646732, -177.95734485329939, 299.60415544156183, 340.7048587001417, 219.91602740991675, -321.90838232725321, 286.35534037573041, -333.41949311523672, -118.93216973120911, 68.607509406566351, 23.190902005504313, -205.57787547147734); + double3x4 b1 = double3x4(418.5930504363929, -23.312797318823982, -95.099945827899489, 147.92812568877275, 331.03287926830023, -82.502564230236487, 279.44956291813844, 342.6227215931857, -300.35853185335105, -209.69408736456842, 446.55942150883345, -351.98918955027557); + double3x4 r1 = double3x4(487.78873800103963, -201.27014217212337, 204.50420961366234, 488.63298438891445, 550.948906678217, -404.41094655748969, 565.80490329386885, 9.2032284779489828, -419.29070158456017, -141.08657795800207, 469.75032351433777, -557.56706502175291); + TestUtils.AreEqual(r1, a1 + b1); + + double3x4 a2 = double3x4(11.521422629953122, -340.7950796283759, -68.931167873056211, 304.8532370556394, -86.633841316510825, 105.66915874633435, 349.28052799277032, 364.7078708916473, -429.03740449856843, 382.45806926417072, 186.09704479300274, 227.41184841255279); + double3x4 b2 = double3x4(-263.12385642860261, -252.4585670216282, 289.82535542632706, 338.79615537207394, -232.61900364263869, -510.50825405051387, 349.2807325559113, -426.2124495106807, -331.41632882292208, -418.68880267566482, -341.7063559692848, -329.03588143411832); + double3x4 r2 = double3x4(-251.60243379864949, -593.25364665000416, 220.89418755327085, 643.64939242771334, -319.25284495914951, -404.83909530417952, 698.56126054868162, -61.504578619033396, -760.45373332149052, -36.2307334114941, -155.60931117628206, -101.62403302156554); + TestUtils.AreEqual(r2, a2 + b2); + + double3x4 a3 = double3x4(-298.76636733616067, 351.30280344155744, 98.725387857633336, -292.35170640254006, 112.17092590787024, 477.1657800512229, -266.30486619952364, -295.14070643817104, -485.82035778733916, -507.86872291372566, -338.21959582819585, 505.34219360041538); + double3x4 b3 = double3x4(123.19857245460082, 189.52859482054066, 267.56994093003209, 134.63626605581317, -337.96815530302382, 50.728011870164437, 81.16342572176984, 442.09067198358969, -148.70453769932715, 6.9743440183691519, -334.91123906472291, 43.787097712879586); + double3x4 r3 = double3x4(-175.56779488155985, 540.83139826209811, 366.29532878766543, -157.71544034672689, -225.79722939515358, 527.89379192138733, -185.1414404777538, 146.94996554541865, -634.52489548666631, -500.89437889535651, -673.13083489291876, 549.129291313295); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void double3x4_operator_add_wide_scalar() + { + double3x4 a0 = double3x4(-194.51420387742769, 338.54838696985894, 246.97140252169754, 100.51093797595752, -45.724677822424439, -478.11131094308166, 30.916145577522116, 60.37435224483454, -242.1187475855084, 82.50134495762245, 6.7993848355483806, -484.69981287638649); + double b0 = (124.121678171736); + double3x4 r0 = double3x4(-70.3925257056917, 462.67006514159493, 371.09308069343354, 224.63261614769351, 78.397000349311554, -353.98963277134567, 155.03782374925811, 184.49603041657053, -117.99706941377241, 206.62302312935844, 130.92106300728437, -360.57813470465049); + TestUtils.AreEqual(r0, a0 + b0); + + double3x4 a1 = double3x4(-188.26501068298938, -267.78430688929944, 189.25996669999324, 198.53359684652355, 187.53610023648298, -424.92567582844089, 302.10236730338181, 300.39907970111778, 124.02158909850823, -200.16134295247559, 31.37822701007974, 362.52213518811493); + double b1 = (-213.52673087526426); + double3x4 r1 = double3x4(-401.79174155825365, -481.31103776456371, -24.266764175271021, -14.993134028740712, -25.990630638781283, -638.45240670370515, 88.575636428117548, 86.872348825853521, -89.505141776756034, -413.68807382773986, -182.14850386518452, 148.99540431285067); + TestUtils.AreEqual(r1, a1 + b1); + + double3x4 a2 = double3x4(-423.98885961248953, 374.21141474983256, -465.69948957194549, -311.04303779781003, 84.918990413154916, -432.44245716204978, 235.75065886031405, -472.63775394514096, -257.57773721291579, 186.120703068618, -170.29822667422621, -115.27248840931452); + double b2 = (432.41331907380993); + double3x4 r2 = double3x4(8.4244594613203958, 806.62473382364249, -33.286170498135562, 121.3702812759999, 517.33230948696485, -0.029138088239847093, 668.163977934124, -40.224434871331027, 174.83558186089414, 618.534022142428, 262.11509239958372, 317.14083066449541); + TestUtils.AreEqual(r2, a2 + b2); + + double3x4 a3 = double3x4(-101.16882686557659, 246.5492557243208, -397.53459066782824, -199.04838213652761, 20.585038433123827, 207.3238519203494, 197.93518671669779, -201.54056439247938, -106.63866453368155, -179.38222631224534, 203.81710610343941, -364.82094853223344); + double b3 = (257.77516973101308); + double3x4 r3 = double3x4(156.60634286543649, 504.32442545533388, -139.75942093681516, 58.726787594485472, 278.36020816413691, 465.09902165136248, 455.71035644771086, 56.2346053385337, 151.13650519733153, 78.392943418767743, 461.59227583445249, -107.04577880122037); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void double3x4_operator_add_scalar_wide() + { + double a0 = (-340.35468284243473); + double3x4 b0 = double3x4(511.36225652665007, -146.21663791789518, -106.21042661844308, -363.45024960276214, 199.08958325120136, -27.108407271610758, 419.84900041103788, 284.95503748811552, -164.92418129971446, -249.19032561461921, 150.92817718858282, 298.17509784278229); + double3x4 r0 = double3x4(171.00757368421534, -486.57132076032991, -446.56510946087781, -703.80493244519687, -141.26509959123337, -367.46309011404549, 79.494317568603151, -55.399645354319205, -505.27886414214919, -589.54500845705388, -189.4265056538519, -42.179584999652434); + TestUtils.AreEqual(r0, a0 + b0); + + double a1 = (-457.15341803857751); + double3x4 b1 = double3x4(424.71807094324288, -301.85750283946163, 230.28885208363124, -423.58759351428023, -67.060037882560891, 68.7241366229598, -164.02241833695325, 318.93515339444161, 7.8045504129512437, 187.69836029210046, -3.6569664495331153, -446.0830535581722); + double3x4 r1 = double3x4(-32.435347095334635, -759.01092087803909, -226.86456595494627, -880.7410115528578, -524.21345592113835, -388.42928141561771, -621.17583637553071, -138.2182646441359, -449.34886762562627, -269.45505774647705, -460.81038448811063, -903.23647159674965); + TestUtils.AreEqual(r1, a1 + b1); + + double a2 = (-209.28724227160552); + double3x4 b2 = double3x4(-38.212905186327589, -346.25717870623674, 465.60741708502519, -192.18595108398512, 278.69379843338106, 381.97845548297209, 481.24367283342576, -97.228162095522578, -455.51374289743313, 501.83498858932171, 358.70657818331688, 430.69978519468555); + double3x4 r2 = double3x4(-247.50014745793311, -555.54442097784226, 256.32017481341967, -401.47319335559064, 69.406556161775541, 172.69121321136657, 271.95643056182024, -306.5154043671281, -664.80098516903865, 292.54774631771619, 149.41933591171136, 221.41254292308003); + TestUtils.AreEqual(r2, a2 + b2); + + double a3 = (256.987155795557); + double3x4 b3 = double3x4(207.65164837970008, -376.96518605619912, -428.08534093763927, -373.493553097124, -468.89328573126966, -467.65843818507085, 297.48495139623287, -506.89978646994558, -233.35846315760097, 434.55879493921941, -387.3151673690021, 171.59027751329836); + double3x4 r3 = double3x4(464.63880417525706, -119.97803026064213, -171.09818514208229, -116.506397301567, -211.90612993571267, -210.67128238951386, 554.47210719178986, -249.91263067438859, 23.628692637956021, 691.5459507347764, -130.32801157344511, 428.57743330885535); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void double3x4_operator_sub_wide_wide() + { + double3x4 a0 = double3x4(160.4922617229131, 11.223957305412682, 359.20010607279846, -498.22830485656311, -355.25362913462038, -94.534852787170053, -410.46404786150163, -401.38464398001537, 317.70681944382693, 447.0604133303558, -489.07414482956477, -230.00838218909149); + double3x4 b0 = double3x4(115.46876078260539, -130.98230630298252, 241.54083716196044, 9.9870860623135513, 419.89512582304656, 59.124466208333388, -402.38163847587145, -75.370143687059226, 320.97960796997859, -73.908757482612884, -31.444742455819949, -389.25194734579509); + double3x4 r0 = double3x4(45.023500940307713, 142.2062636083952, 117.65926891083802, -508.21539091887666, -775.14875495766694, -153.65931899550344, -8.0824093856301715, -326.01450029295614, -3.2727885261516576, 520.96917081296874, -457.62940237374482, 159.2435651567036); + TestUtils.AreEqual(r0, a0 - b0); + + double3x4 a1 = double3x4(24.875419389864192, 366.61447136784648, -107.3741567634857, -219.0081404275299, 473.90756891384137, 259.63620793988753, -360.119631219711, 7.8096120393879573, 437.42847439154446, -59.1991718091067, 418.74433322378638, 183.14215072576985); + double3x4 b1 = double3x4(-375.02884000122026, 259.18275821357167, 276.648654351313, -453.06919905779381, -272.57653225240136, -191.14805301984217, 87.136884968325944, 430.02477594373033, 343.65711538105143, 121.02942067060133, -354.1881703595576, 249.05200373802893); + double3x4 r1 = double3x4(399.90425939108445, 107.4317131542748, -384.02281111479869, 234.06105863026391, 746.48410116624268, 450.78426095972969, -447.25651618803693, -422.21516390434238, 93.771359010493029, -180.22859247970803, 772.932503583344, -65.909853012259077); + TestUtils.AreEqual(r1, a1 - b1); + + double3x4 a2 = double3x4(271.23036516421962, 496.20853709439211, 165.35493691514944, -227.40367113212295, -166.52285702830312, 356.14227430715334, 386.92636579411396, -394.63875717420075, 126.90326625057651, 97.2168972944919, -150.01784641575898, -227.25051246734824); + double3x4 b2 = double3x4(-2.2254426489702723, 22.447240601502017, 478.1129555544411, -320.0629958212669, -111.52409534879217, 222.22894607401872, -245.41106307013473, -119.90228348593337, -153.46565372937624, 374.11248439089979, 301.7634090398268, -281.43006552449896); + double3x4 r2 = double3x4(273.45580781318989, 473.7612964928901, -312.75801863929166, 92.659324689143943, -54.998761679510949, 133.91332823313462, 632.33742886424875, -274.73647368826738, 280.36891997995275, -276.89558709640789, -451.78125545558578, 54.179553057150713); + TestUtils.AreEqual(r2, a2 - b2); + + double3x4 a3 = double3x4(-198.83000406940931, 0.66276812584271738, -484.2455706467133, -295.99628056958147, -46.170990726990169, 499.95239304935205, 292.44011725692087, -106.42413597294325, 466.82713887972159, 487.37480400846096, 242.9946106611726, -468.90158985038363); + double3x4 b3 = double3x4(-494.96436261337453, -320.73126021061614, 160.96219714030724, -132.93641025057826, -394.43753237018245, 406.85128588548457, 270.54461897096814, 507.79461335940039, 67.699203761154422, 263.40446412908125, 297.58066596536923, 170.83953746167924); + double3x4 r3 = double3x4(296.13435854396522, 321.39402833645886, -645.20776778702054, -163.05987031900321, 348.26654164319228, 93.101107163867482, 21.895498285952726, -614.21874933234358, 399.12793511856717, 223.97033987937971, -54.586055304196634, -639.74112731206287); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void double3x4_operator_sub_wide_scalar() + { + double3x4 a0 = double3x4(207.38960108877609, 248.45773684627272, -384.82393211164697, -205.34476122881506, -374.81156152058929, 191.64204820973896, 18.856238135535364, -44.96160151667965, 480.85798738936796, 16.338193185784917, -366.86545269883493, -35.523088233323335); + double b0 = (-36.112476604111691); + double3x4 r0 = double3x4(243.50207769288778, 284.57021345038441, -348.71145550753528, -169.23228462470337, -338.6990849164776, 227.75452481385065, 54.968714739647055, -8.8491249125679587, 516.9704639934796, 52.450669789896608, -330.75297609472324, 0.589388370788356); + TestUtils.AreEqual(r0, a0 - b0); + + double3x4 a1 = double3x4(349.39776460705218, 490.2222661870635, 195.02405104181923, -384.84940952102158, 189.05188545447402, 55.602777745389744, -54.931482579061537, 53.088051582261983, 316.80250730961677, -273.80670917863335, 256.88723695319482, 297.17363156805447); + double b1 = (439.07729336203886); + double3x4 r1 = double3x4(-89.679528754986677, 51.144972825024638, -244.05324232021962, -823.92670288306044, -250.02540790756484, -383.47451561664911, -494.0087759411004, -385.98924177977688, -122.27478605242209, -712.88400254067221, -182.19005640884404, -141.90366179398438); + TestUtils.AreEqual(r1, a1 - b1); + + double3x4 a2 = double3x4(101.82901363346218, -19.732211837420323, 336.58969966349639, -51.876563334780087, 317.34576311583896, -467.05592773251976, -50.167055391784345, 477.804535373023, -60.821922092149919, 0.41113877315592617, 46.660927078994405, -19.241408595462076); + double b2 = (136.60794765157993); + double3x4 r2 = double3x4(-34.778934018117752, -156.34015948900026, 199.98175201191646, -188.48451098636002, 180.73781546425903, -603.6638753840997, -186.77500304336428, 341.19658772144305, -197.42986974372985, -136.196808878424, -89.947020572585529, -155.849356247042); + TestUtils.AreEqual(r2, a2 - b2); + + double3x4 a3 = double3x4(396.80972809195976, -334.27423373529416, -198.07713684722648, -239.20061432532992, -339.68122665010446, -14.514425522887336, 219.99709211103482, -180.26066621591366, -438.89060398512083, 186.35550102328671, -365.06679241967703, -478.80124615076988); + double b3 = (69.590537342052244); + double3x4 r3 = double3x4(327.21919074990751, -403.8647710773464, -267.66767418927873, -308.79115166738217, -409.27176399215671, -84.10496286493958, 150.40655476898257, -249.8512035579659, -508.48114132717308, 116.76496368123446, -434.65732976172927, -548.39178349282213); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void double3x4_operator_sub_scalar_wide() + { + double a0 = (-86.008225719448262); + double3x4 b0 = double3x4(466.42511413359318, 298.48694219183506, -300.95010652251085, 315.38003006362362, -381.09218543632522, -125.00837546447684, 58.466194418476107, 214.74609361158036, -257.54942739082009, 480.22459505508868, -443.35507723472784, 260.79503858312728); + double3x4 r0 = double3x4(-552.43333985304139, -384.49516791128332, 214.94188080306259, -401.38825578307188, 295.08395971687696, 39.00014974502858, -144.47442013792437, -300.75431933102863, 171.54120167137182, -566.232820774537, 357.34685151527958, -346.80326430257554); + TestUtils.AreEqual(r0, a0 - b0); + + double a1 = (29.681931747906788); + double3x4 b1 = double3x4(139.85773164586055, -247.78996216868512, -248.4662297929014, 91.445112509394562, 86.384162704639266, 373.81828206303453, 260.41195428576873, 114.35393171867076, -464.40545318294573, -109.74146156652898, -311.67535057276268, 107.86401586787031); + double3x4 r1 = double3x4(-110.17579989795377, 277.47189391659191, 278.14816154080819, -61.763180761487774, -56.702230956732478, -344.13635031512774, -230.73002253786194, -84.671999970763977, 494.08738493085252, 139.42339331443577, 341.35728232066947, -78.18208411996352); + TestUtils.AreEqual(r1, a1 - b1); + + double a2 = (-258.7951592219971); + double3x4 b2 = double3x4(14.097560173877355, -461.97019527012958, 30.310863747406188, 63.701105862716759, -462.67674634544028, 39.759483117498235, 47.998150132595583, -177.61928113625351, 202.47706017386031, -289.30880250097664, -459.92539832551284, 248.38668715599306); + double3x4 r2 = double3x4(-272.89271939587445, 203.17503604813248, -289.10602296940328, -322.49626508471385, 203.88158712344318, -298.55464233949533, -306.79330935459268, -81.175878085743591, -461.27221939585741, 30.513643278979544, 201.13023910351575, -507.18184637799015); + TestUtils.AreEqual(r2, a2 - b2); + + double a3 = (85.3297222057962); + double3x4 b3 = double3x4(-73.374776159122, -510.65201044019869, 426.96324535224733, 239.5901807470201, 477.85233257610923, 256.01360785961788, 338.620331683485, -483.83120440125055, 330.39224139339865, -263.41821706640451, 123.92803603221103, -269.11598194256237); + double3x4 r3 = double3x4(158.70449836491821, 595.981732645995, -341.63352314645113, -154.2604585412239, -392.52261037031303, -170.68388565382168, -253.2906094776888, 569.1609266070468, -245.06251918760245, 348.74793927220071, -38.598313826414824, 354.44570414835857); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void double3x4_operator_mul_wide_wide() + { + double3x4 a0 = double3x4(-482.71381710596097, -407.29348559272171, 137.70058995937029, 208.54113278563182, 194.296573967811, -484.24241684574747, 183.98730739578014, -241.33547770294149, 45.868758938214114, 363.32610266438041, -328.11893692990714, -471.02307413100408); + double3x4 b0 = double3x4(-236.36788355389979, 260.72759139757954, -416.38629718142852, -364.49561541364324, -253.14750897751537, -369.20287220981106, 193.54791531038836, 169.08491976982214, 201.96966442930034, 249.45608317547294, -308.19319810913555, -385.57964843585137); + double3x4 r0 = double3x4(114098.04331156026, -106192.64949051509, -57336.638772880389, -76012.328533757158, -49185.69370281692, 178783.69114527057, 35610.359790024842, -40806.189885013562, 9264.0978505395742, 90633.9064860661, 101124.02453259782, 181616.91132860651); + TestUtils.AreEqual(r0, a0 * b0); + + double3x4 a1 = double3x4(-262.68257415605831, -379.26274674910246, -374.09058182970182, 481.44738720424812, 104.62807397946165, 412.93539948618752, 477.87724731763694, 20.377821216535722, 291.99596299417124, -138.48832399141429, -393.46498483860165, 9.36312318284206); + double3x4 b1 = double3x4(-183.27959522198864, 22.275629292370581, -265.52144229855458, -95.677454277722859, 133.25437146669924, 148.31146080247663, 249.284127113076, 500.00547503866505, -19.331578978957396, -36.691062705913112, 30.5238278054278, -401.36701054189678); + double3x4 r1 = double3x4(48144.355863192381, -8448.3163509892329, 99329.070837727879, -46063.660376363579, 13942.148235904471, 61243.052314850727, 119127.21246477668, 10189.022177626932, -5644.7430201585421, 5081.2837796057929, -12010.057444678736, -3758.048761232847); + TestUtils.AreEqual(r1, a1 * b1); + + double3x4 a2 = double3x4(-131.94228917543882, 364.44964258952518, 390.61597866128011, 418.79794974755396, -277.34480942289565, 11.410165553637853, 474.87644956767394, -502.40503358394142, -222.59489618176354, 38.169053810727291, 292.61251582420084, 203.20767245218519); + double3x4 b2 = double3x4(3.4372422711165882, 257.24176681099539, -290.97193516929258, 337.47938100317469, 490.28616284312966, -191.01981481864107, -325.73449650673871, -52.181983733634468, 123.43503743197539, -461.2670640709191, 122.35306149458188, 308.58463182513822); + double3x4 r2 = double3x4(-453.51761370170692, 93751.669973365249, -113658.28721911977, 141335.67284620318, -135978.32239641057, -2179.56771110594, -154683.64120283397, 26216.491290173308, -27476.00934236266, -17606.127389639103, 35802.037142722758, 62706.764787700849); + TestUtils.AreEqual(r2, a2 * b2); + + double3x4 a3 = double3x4(-330.40815678723538, 469.4601201813017, 342.29512588227874, -504.11466359724972, 319.35728159516918, -357.7820815321906, -117.9710848880797, 25.706567060997031, 226.45642171914528, -86.343729774627718, -274.12603844056184, -486.87097452900883); + double3x4 b3 = double3x4(375.32062762571525, 203.21264204905026, 77.667988574909032, 218.793598038514, -489.89573620720569, 134.47217589918159, -287.79437960674727, -116.39999085124583, -436.54398151698706, 499.59108447450728, -300.60236396482321, 105.73045950091); + double3x4 r3 = double3x4(-124008.99677804091, 95400.23135870698, 26585.373926271874, -110297.06107241736, -156451.77058019731, -48111.735001372064, 33951.415186899816, -2992.2441707169919, -98858.187977365582, -43136.557595680068, 82402.935179544889, -51477.091854607956); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void double3x4_operator_mul_wide_scalar() + { + double3x4 a0 = double3x4(-96.318821236639678, -277.14229239017811, -239.93690191951436, 509.53140544776409, 255.85810172551226, 215.73149667295229, -455.50827500573746, -389.24327367788334, -338.29248658674419, 53.796284939067618, 243.75734459783757, 135.35469991311186); + double b0 = (-301.20720424373042); + double3x4 r0 = double3x4(29011.922860739887, 83477.255068544036, 72270.723422079071, -153474.5301092997, -77066.303503849529, -64979.880980175592, 137202.37402436248, 117242.87823519246, 101896.13410145289, -16203.828585195659, -73421.468280190238, -40769.81074207752); + TestUtils.AreEqual(r0, a0 * b0); + + double3x4 a1 = double3x4(-207.35010275959507, -31.425238862366086, 42.676120539510634, 260.38388049806645, 176.86755927692525, 25.672123205695357, -290.50059689697838, 207.09101805793637, -156.52330858843555, -208.4020064847553, 370.94506400215676, -341.59844247512444); + double b1 = (-383.93960946795517); + double3x4 r1 = double3x4(79609.9174766593, 12065.393936254042, -16385.053053547093, -99971.685390178332, -67906.461636333086, -9856.5449578079042, 111534.68572283375, -79510.444597485344, 60095.497972076177, 80013.784982095211, -142420.50300705369, 131153.17259876104); + TestUtils.AreEqual(r1, a1 * b1); + + double3x4 a2 = double3x4(10.270311121954705, -61.006107120311867, 186.27978214355176, -487.65221785365242, -129.37681800191143, -317.71628990663044, -207.62735686433842, 388.87138933170183, -233.33533274072005, 128.4155209662465, 510.38953399583215, 267.57635486665015); + double b2 = (-176.88876565587185); + double3x4 r2 = double3x4(-1816.7026572643401, 10791.294985981862, -32950.800730017589, 86260.198885480888, 22885.305640842493, 56200.442350346995, 36726.946872124034, -68786.980057768713, 41274.398992408111, -22715.262994775076, -90282.1746721984, -47331.251131059282); + TestUtils.AreEqual(r2, a2 * b2); + + double3x4 a3 = double3x4(-309.20967569444781, -189.56950983291932, 233.20923887622041, -331.08696261564592, -98.644771860281367, -214.18099389513071, -87.880760949049488, -493.16573475914345, -407.30606551063528, -411.37138362013332, 477.93567512833317, 364.7485498696326); + double b3 = (-36.482969062627717); + double3x4 r3 = double3x4(11280.88703222569, 6916.0585624518963, -8508.1654470401063, 12079.03541414599, 3598.8541599686141, 7813.95857407891, 3206.1510829043546, 17992.150243965898, 14859.734587045124, 15008.049461863682, -17436.512449633072, -13307.11006053213); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void double3x4_operator_mul_scalar_wide() + { + double a0 = (37.432166355397612); + double3x4 b0 = double3x4(96.747546479454058, 492.18539427788244, -274.05458534604617, -452.87096926796761, 420.85330434369541, 102.18292694081686, -114.94887762654054, -351.12003843445336, -464.66496799172131, 444.08484646495663, 447.10525605040846, 130.82935124767448); + double3x4 r0 = double3x4(3621.4702542954869, 18423.565556306661, -10258.456829132712, -16951.941459168724, 15753.450899411988, 3824.9283199300971, -4302.785509682908, -13143.183689392061, -17393.41638139162, 16623.057848787463, 16736.118322851533, 4897.2260400716978); + TestUtils.AreEqual(r0, a0 * b0); + + double a1 = (-321.41334191030512); + double3x4 b1 = double3x4(445.30131861441828, 478.24357317306271, 358.57170622356784, -144.89011222910608, -438.89383741789209, -3.536441089369589, -471.80755470311624, -42.560401697904069, 119.91104155402218, 271.9000023677479, 239.6840079946835, 487.44143389511919); + double3x4 r1 = double3x4(-143125.78497292573, -153713.86510067963, -115249.73041179709, 46569.615181316156, 141066.33502832282, 1136.6593490031996, 151645.24289565769, 13679.48094276837, -38541.008597823733, -87392.288426437735, -77037.638012027513, -156670.18025378135); + TestUtils.AreEqual(r1, a1 * b1); + + double a2 = (-79.188288010278825); + double3x4 b2 = double3x4(-112.92564468873928, 161.3700478828373, 459.75914332818195, -337.19599811043406, -276.83451689259823, 469.72386405883537, -274.56515110403541, 506.78586625810055, 65.882571966332648, 495.8556585236712, -347.27959148365983, -343.60605232026711); + double3x4 r2 = double3x4(8942.3884753582988, -12778.617827978605, -36407.539457231134, 26701.973814282486, 21922.051454877466, -37196.628632392116, 21742.344263212082, -40131.505136785112, -5217.1280837278719, -39265.960698698946, 27500.476310500027, 27209.575033212248); + TestUtils.AreEqual(r2, a2 * b2); + + double a3 = (-183.70378860444936); + double3x4 b3 = double3x4(460.26475808595524, 437.513251746778, -324.55724755141756, -112.28778343661122, 273.13543070160574, -283.09366072485864, 1.8802692898923397, -310.81670322586626, 326.01218357962193, 243.64321982285162, 78.179342067884022, -308.66400184699523); + double3x4 r3 = double3x4(-84552.379821500348, -80372.841910535339, 59622.395994227547, 20627.691231301418, -50176.013421993011, 52005.378005059138, -345.41259214982045, 57098.205944136411, -59889.673254785805, -44758.18254924452, -14361.841328473502, 56702.746545103779); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void double3x4_operator_div_wide_wide() + { + double3x4 a0 = double3x4(-353.13144390337703, -102.79985456485292, 51.319128298814917, -191.87167868012176, 8.0418245829836223, -128.73764210973758, -136.05959779399427, -370.4710053738537, -237.69456326109105, -432.54687496300176, 200.26549181727012, 361.44157068871039); + double3x4 b0 = double3x4(-178.73954805114283, -302.09628381491467, -199.40583739029518, 278.85077561012042, 502.33758782890516, -361.48483078623417, 353.121059820578, -38.894930142394685, -75.764737402910725, -195.21784719974636, -405.03399224068687, -394.2300085473014); + double3x4 r0 = double3x4(1.97567604793504, 0.34028837848212429, -0.25736021056579439, -0.68808013268139567, 0.016008805189634039, 0.35613566917796119, -0.3853058151307277, 9.5249176182488586, 3.1372716570909582, 2.2157137842034547, -0.49444119667433889, -0.9168291678773689); + TestUtils.AreEqual(r0, a0 / b0); + + double3x4 a1 = double3x4(-416.22613234828509, -450.01919362042992, -273.49744594911925, -286.90817011841955, -314.25606241554772, 177.76210340194507, 97.626988217992221, -68.107280047660367, -386.45074027890837, 263.69934690357161, -297.0270885420158, -501.77703046322659); + double3x4 b1 = double3x4(-375.82771342612227, -121.24548655433836, 447.623344391409, 338.28628007429018, -405.54420752336466, -431.16893526127978, 296.20513095343722, 437.939790691221, 39.21061684527001, 331.2897075765253, -310.61955156485533, 207.26946959610541); + double3x4 r1 = double3x4(1.1074918572499153, 3.7116366671409717, -0.61099906735420106, -0.84812239519560884, 0.77489964493560781, -0.41227947763496636, 0.32959249525403717, -0.15551745124635385, -9.855767936625206, 0.79597808465769837, 0.95624080018671487, -2.420892143165184); + TestUtils.AreEqual(r1, a1 / b1); + + double3x4 a2 = double3x4(-263.40686071263946, -451.08085248017721, -416.34552903489464, -315.27873411554788, -28.181118739853218, -397.87015146662952, -261.38664376986526, 40.348221559239619, 277.24575794732471, 464.77123162931355, -336.64104358136706, 375.47808163961304); + double3x4 b2 = double3x4(-223.2929938879297, -480.091406807346, 448.67593666942605, -460.0974516626901, -220.56984601755153, -84.853158275062754, 441.3738078742166, 72.418480191574645, 44.9760778159723, -242.51539027062961, -451.30207011257392, -21.899694214528267); + double3x4 r2 = double3x4(1.1796467776541293, 0.93957285234474042, -0.92794263076704353, 0.68524338262731188, 0.12776505605218016, 4.6889256635195675, -0.59221149761645042, 0.55715366371267527, 6.1642938070706279, -1.9164607702243661, 0.74593285933165443, -17.145357280400777); + TestUtils.AreEqual(r2, a2 / b2); + + double3x4 a3 = double3x4(504.34254264474964, -320.76710692083793, -156.73333914425848, 414.79707999471441, -386.05068296289568, -369.8386258416989, 386.70419687158619, 242.63180910918481, 421.73452659218322, 109.01218347857343, 182.07528242006674, 187.32643446108625); + double3x4 b3 = double3x4(-358.4866656542228, -350.94512502799978, -481.84813688781492, 406.39341921657012, -145.28866321653533, 461.7955479388105, -318.81676331107354, -250.93199908497371, 125.85955506463517, -193.80316576445625, -495.25412177259761, -315.82454815312497); + double3x4 r3 = double3x4(-1.4068655572567703, 0.914009296739044, 0.32527538688138485, 1.0206786340053058, 2.6571287422992764, -0.80087092110880154, -1.2129355836106837, -0.96692255269931449, 3.3508343993080341, -0.56248917838145251, -0.36764011527736257, -0.59313449684811248); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void double3x4_operator_div_wide_scalar() + { + double3x4 a0 = double3x4(171.34242184988341, 0.10338377957384637, 57.888263967767443, -256.13074529177078, 95.6696842162263, -290.38690461329509, -127.44869118903239, -79.7448890580539, 146.46688110496234, -499.84355687529012, 58.686315802245531, -453.20579859856787); + double b0 = (171.79682191265601); + double3x4 r0 = double3x4(0.99735501473360411, 0.00060177934855167557, 0.33695771157628673, -1.4908933846400916, 0.55687691513214455, -1.6902926455818372, -0.74185709473618289, -0.46418139852783397, 0.85255873463962106, -2.909504095072363, 0.34160303519515922, -2.6380336583233435); + TestUtils.AreEqual(r0, a0 / b0); + + double3x4 a1 = double3x4(-205.03382143985192, 464.47907159499778, -293.46349753693841, -158.50557930697948, -289.5822156824089, 494.12860535743118, 203.58342680874443, 180.97040160976837, 259.11918723728468, 460.84470603468117, 490.95625924084163, -280.47805536933151); + double b1 = (481.73814247629514); + double3x4 r1 = double3x4(-0.42561259605874163, 0.96417333534650185, -0.60917637957509008, -0.32902850185830795, -0.60111955053809829, 1.0257203276814348, 0.42260184290630909, 0.37566135137134876, 0.53788389249255919, 0.95662905923493058, 1.0191351191690206, -0.582220984054907); + TestUtils.AreEqual(r1, a1 / b1); + + double3x4 a2 = double3x4(-320.24387112271222, 264.80085885934568, 226.85298524929817, -192.23568949114332, 460.97652957447644, -437.89221760159927, -413.23271794488312, 249.47184693509337, 313.03501739773662, 216.78560195527302, 383.73890298592812, 82.023314752626789); + double b2 = (192.41448912043802); + double3x4 r2 = double3x4(-1.6643438474233712, 1.3762002023329898, 1.1789807840682105, -0.99907075797611689, 2.3957474911670364, -2.2757756944567169, -2.14761746807034, 1.2965335826604067, 1.6268786141245246, 1.126659447249736, 1.9943347548309338, 0.4262845024175177); + TestUtils.AreEqual(r2, a2 / b2); + + double3x4 a3 = double3x4(189.57466062790468, -391.92216343056509, 121.28058701440716, 417.90175147443165, -133.26287013537382, -428.74240299162568, -188.53187641339929, 356.25952570338711, 181.96896823773579, -140.8904808223669, 474.08261678837357, -451.35772511519383); + double b3 = (314.50384273869167); + double3x4 r3 = double3x4(0.60277374984385956, -1.2461601741260666, 0.38562513563681389, 1.3287651681307089, -0.42372413950470061, -1.3632342271501279, -0.59945810127999832, 1.1327668450760029, 0.57859060370504389, -0.44797697730970815, 1.5073984872810262, -1.4351421629217054); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void double3x4_operator_div_scalar_wide() + { + double a0 = (-264.44250095283729); + double3x4 b0 = double3x4(105.58908157497137, -142.34910137129441, -288.94890679463231, 39.644133824689334, -363.99138396046658, -149.71822006521666, -395.72912306139671, 258.71868693955184, -9.6662514254759344, 117.72553282497711, -331.38655797177296, -509.98602676297821); + double3x4 r0 = double3x4(-2.5044492954044237, 1.85770404172122, 0.915187753732487, -6.670406827961755, 0.72650758398599513, 1.7662679988958405, 0.66824119212426392, -1.0221236976771717, 27.357295947825712, -2.2462629355518375, 0.79798801306648692, 0.51852891466718543); + TestUtils.AreEqual(r0, a0 / b0); + + double a1 = (427.8964666928614); + double3x4 b1 = double3x4(467.61712882836218, -407.12461943511136, 252.69070994699871, 444.59937664708093, -88.313306134340053, 199.95503411067421, -218.34692607556792, -13.417186028052697, -296.13107575854804, 0.561349630617201, -289.29929865957206, 196.21833929615946); + double3x4 r1 = double3x4(0.915057298617305, -1.0510208576591884, 1.6933604990172044, 0.96243154886949345, -4.8452094641543111, 2.1399634602648847, -1.9597091398702369, -31.891669817964367, -1.4449563106364052, 762.26373610042538, -1.4790788248552968, 2.1807159729704049); + TestUtils.AreEqual(r1, a1 / b1); + + double a2 = (334.73346845001606); + double3x4 b2 = double3x4(-282.39273203648293, -479.50358436978587, -473.43943927876626, 105.0507777226394, -287.63127841038227, 77.299297130340392, -210.89436421678141, -184.0682357214709, -315.14843645465953, 87.86691264429453, 101.5905373569534, 345.93639890567226); + double3x4 r2 = double3x4(-1.1853473212149495, -0.698083349866838, -0.70702489205366215, 3.1863968616567222, -1.1637589287922645, 4.3303559136585132, -1.5872091684059353, -1.818529238018717, -1.0621454201571907, 3.8095508124325947, 3.2949276296657475, 0.96761563544311813); + TestUtils.AreEqual(r2, a2 / b2); + + double a3 = (-146.31811744827689); + double3x4 b3 = double3x4(479.99991177022457, -172.67688401633728, -178.0136545533378, 361.76045315422141, 349.37693111476347, -398.68612951724145, -243.7800091448147, 296.62295045360133, 477.81065224009126, 486.60035942802222, 256.91724622292315, -89.8642156542578); + double3x4 r3 = double3x4(-0.3048294673819007, 0.84735208352748281, 0.82194884328064821, -0.40446133946515234, -0.41879730576777624, 0.36700077232546224, 0.60020556222622135, -0.4932798262053712, -0.30622615205898479, -0.30069463495725229, -0.56951457949739548, 1.6282133703944957); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void double3x4_operator_mod_wide_wide() + { + double3x4 a0 = double3x4(-388.81249422059045, 181.68118842955732, -167.07872470052854, 432.82015319951813, -258.43895995730486, -170.11079629236406, 283.318293464984, 122.71651297561664, 335.27101413126616, -503.60851668920765, 191.02251848532933, 289.74269379756538); + double3x4 b0 = double3x4(436.94417187056695, 58.940049437312382, -201.11623368091705, 279.2893537391393, -397.07975954426445, 377.89994758083481, 174.69386657266591, -228.17652736798698, -317.06019106370405, -417.48011107811709, -249.9759434433542, -397.57157177364991); + double3x4 r0 = double3x4(-388.81249422059045, 4.8610401176201776, -167.07872470052854, 153.53079946037883, -258.43895995730486, -170.11079629236406, 108.62442689231807, 122.71651297561664, 18.210823067562103, -86.128405611090557, 191.02251848532933, 289.74269379756538); + TestUtils.AreEqual(r0, a0 % b0); + + double3x4 a1 = double3x4(-124.03371745163281, 259.27395761165485, -274.35845030208975, -140.03080398404541, 324.5775689205982, -200.51308903494527, 211.42317328761476, -51.272212767634642, -230.63392483006879, 99.989400671790122, 399.18986649028489, 24.903281461868119); + double3x4 b1 = double3x4(-358.74544947163452, -198.1592100589346, 208.73709378425826, -12.119406944196385, 25.27141596063575, -194.12068495253135, -493.8717965995296, -312.3016990685378, -216.98060546488529, 413.57096047586344, -436.39440151508637, 3.4912750737235); + double3x4 r1 = double3x4(-124.03371745163281, 61.114747552720246, -65.621356517831487, -6.7173275978851734, 21.3205773929692, -6.3924040824139183, 211.42317328761476, -51.272212767634642, -13.653319365183506, 99.989400671790122, 399.18986649028489, 0.46435594580361794); + TestUtils.AreEqual(r1, a1 % b1); + + double3x4 a2 = double3x4(50.92402961241271, -364.86367886367429, -252.62662398658068, -281.28977955565313, -364.79852192699843, -329.02623311105475, 51.6098087074281, 41.647804041229051, 254.95104443978096, -458.67762133976333, -136.79304439238882, 72.400299344398263); + double3x4 b2 = double3x4(-308.23343076754054, -441.37506195594324, 84.6008532441225, 373.16344922276369, 67.252760203207231, -320.33327522889397, 118.97936325845274, 44.823946258436877, 354.00861065183233, -253.95312249565177, -195.16280207185207, 317.14281073079576); + double3x4 r2 = double3x4(50.92402961241271, -364.86367886367429, -83.424917498335674, -281.28977955565313, -28.534720910962278, -8.6929578821607834, 51.6098087074281, 41.647804041229051, 254.95104443978096, -204.72449884411157, -136.79304439238882, 72.400299344398263); + TestUtils.AreEqual(r2, a2 % b2); + + double3x4 a3 = double3x4(246.21202170393053, 325.1538137519517, 162.03465588485574, -284.76143826393479, 128.35126906649737, 262.91676032865269, 61.600772647932558, -271.4927829576157, -205.43880448371118, -341.32216302553292, 347.1544365115252, 148.0884922240341); + double3x4 b3 = double3x4(320.6931823793301, -103.99687604978533, 388.17173332170194, -199.63931593654644, -256.21731746206865, -478.12501953454921, -210.65574202810217, -272.02328432352431, -61.676538257709012, -367.82958691559247, -242.93893753874067, 162.38671191147841); + double3x4 r3 = double3x4(246.21202170393053, 13.163185602595718, 162.03465588485574, -85.122122327388354, 128.35126906649737, 262.91676032865269, 61.600772647932558, -271.4927829576157, -20.409189710584144, -341.32216302553292, 104.21549897278453, 148.0884922240341); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void double3x4_operator_mod_wide_scalar() + { + double3x4 a0 = double3x4(-244.49962889612635, -211.81931958525411, -145.92677576184587, -304.91822090042672, 155.47946436492703, -133.90778428591221, 281.30965412841624, -226.53575311719243, 335.16613046041039, 101.70649032560482, 319.47152033423606, -285.40231646476423); + double b0 = (39.634963769295723); + double3x4 r0 = double3x4(-6.6898462803520147, -13.644500738775491, -27.021884453958705, -27.473474515356656, 36.574573057039856, -15.002892978025045, 3.86490774334618, -28.360934270713813, 18.0864203060446, 22.436562787013372, 2.3918101798702764, -7.9575700796941646); + TestUtils.AreEqual(r0, a0 % b0); + + double3x4 a1 = double3x4(-355.84685985923136, -330.87193957477433, -284.34358109363518, -102.68343811048356, -172.14173921017988, 206.41684517935698, -416.71365447375626, -339.256669917729, 435.29751440291182, 132.55290490600885, 226.94410215455298, -306.11827268550093); + double b1 = (259.37800061860025); + double3x4 r1 = double3x4(-96.4688592406311, -71.493938956174077, -24.965580475034926, -102.68343811048356, -172.14173921017988, 206.41684517935698, -157.335653855156, -79.878669299128774, 175.91951378431156, 132.55290490600885, 226.94410215455298, -46.740272066900673); + TestUtils.AreEqual(r1, a1 % b1); + + double3x4 a2 = double3x4(115.43844633709568, -218.3474491659307, -140.04050237501065, -462.32346961569203, -211.60869822819188, 351.33104555277669, 321.04701176334504, 346.08518497370426, -94.407745643708722, 465.40920446133669, -367.19701617173712, -467.51058957889239); + double b2 = (281.88292015804109); + double3x4 r2 = double3x4(115.43844633709568, -218.3474491659307, -140.04050237501065, -180.44054945765095, -211.60869822819188, 69.4481253947356, 39.164091605303952, 64.20226481566317, -94.407745643708722, 183.5262843032956, -85.31409601369603, -185.6276694208513); + TestUtils.AreEqual(r2, a2 % b2); + + double3x4 a3 = double3x4(415.21510215067076, -3.729830982037754, 128.24987822782714, 134.94156104649494, 247.61696230974837, -285.28786553316183, 433.76666017704019, -141.83102209019989, -229.7818902608854, 471.21804283150379, 377.68146651689028, 433.40759559786306); + double b3 = (506.18618011203887); + double3x4 r3 = double3x4(415.21510215067076, -3.729830982037754, 128.24987822782714, 134.94156104649494, 247.61696230974837, -285.28786553316183, 433.76666017704019, -141.83102209019989, -229.7818902608854, 471.21804283150379, 377.68146651689028, 433.40759559786306); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void double3x4_operator_mod_scalar_wide() + { + double a0 = (-66.945025236785909); + double3x4 b0 = double3x4(-249.77609479137516, -396.07375664081133, 386.49204582091977, 168.93948109864232, -199.4182442163202, 261.7517141130528, 16.127438791155555, 257.66814744550186, -75.788451945310669, 170.95630439136005, -242.85828005655588, 425.94531913564788); + double3x4 r0 = double3x4(-66.945025236785909, -66.945025236785909, -66.945025236785909, -66.945025236785909, -66.945025236785909, -66.945025236785909, -2.4352700721636893, -66.945025236785909, -66.945025236785909, -66.945025236785909, -66.945025236785909, -66.945025236785909); + TestUtils.AreEqual(r0, a0 % b0); + + double a1 = (303.27240409668184); + double3x4 b1 = double3x4(3.033060790520608, -505.74352788633831, 461.95706126743789, 205.97275672013529, 270.04063642678807, -47.480711720642034, -150.254496405951, 149.49949009227544, -220.29804263836616, 31.118842377848409, 400.63568348467152, 6.2314283876826266); + double3x4 r1 = double3x4(2.999385835141652, 303.27240409668184, 303.27240409668184, 97.299647376546545, 33.23176766989377, 18.388133772829633, 2.7634112847798633, 4.2734239121309656, 82.974361458315684, 23.202822696046155, 303.27240409668184, 4.1638414879157608); + TestUtils.AreEqual(r1, a1 % b1); + + double a2 = (-39.050740021770252); + double3x4 b2 = double3x4(-71.941097054603063, -495.30713843521994, -86.71961859926563, -436.97006365143233, -472.2947320753218, -130.00875359867177, -251.51684605866524, 281.97637022751212, 388.86081928241106, 50.615297579493017, 293.870868581287, 123.74424820940203); + double3x4 r2 = double3x4(-39.050740021770252, -39.050740021770252, -39.050740021770252, -39.050740021770252, -39.050740021770252, -39.050740021770252, -39.050740021770252, -39.050740021770252, -39.050740021770252, -39.050740021770252, -39.050740021770252, -39.050740021770252); + TestUtils.AreEqual(r2, a2 % b2); + + double a3 = (422.90433211946129); + double3x4 b3 = double3x4(-53.8761976016109, -178.85765966161046, -362.27595799149753, 361.08526747351755, 465.27609822958527, -269.88963306596952, -159.40897734435691, -29.095214618879936, 484.49945067078784, -354.95061008769585, -328.69059411095952, -171.73922236810404); + double3x4 r3 = double3x4(45.770948908185005, 65.189012796240377, 60.628374127963752, 61.81906464594374, 422.90433211946129, 153.01469905349177, 104.08637743074746, 15.571327455142182, 422.90433211946129, 67.953722031765437, 94.213738008501764, 79.425887383253212); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void double3x4_operator_plus() + { + double3x4 a0 = double3x4(-418.82956357432045, -405.79894823851015, -34.041791216489742, 236.99924456188421, -459.83910129025537, 210.8614223985287, 293.74197902052754, -373.015422279488, -386.059833944803, 4.9544198536101476, -418.64524932328857, 504.47483062393724); + double3x4 r0 = double3x4(-418.82956357432045, -405.79894823851015, -34.041791216489742, 236.99924456188421, -459.83910129025537, 210.8614223985287, 293.74197902052754, -373.015422279488, -386.059833944803, 4.9544198536101476, -418.64524932328857, 504.47483062393724); + TestUtils.AreEqual(r0, +a0); + + double3x4 a1 = double3x4(-170.74650843941907, -478.74939916969714, 116.40075665172219, 421.40964742256779, -258.5960806620289, 447.86609122150867, 124.16434031546316, 222.17254386757156, -65.949277193261878, 239.04183947250328, 498.4495329793773, -139.382530515726); + double3x4 r1 = double3x4(-170.74650843941907, -478.74939916969714, 116.40075665172219, 421.40964742256779, -258.5960806620289, 447.86609122150867, 124.16434031546316, 222.17254386757156, -65.949277193261878, 239.04183947250328, 498.4495329793773, -139.382530515726); + TestUtils.AreEqual(r1, +a1); + + double3x4 a2 = double3x4(279.07295549990283, 37.999210613779383, 136.81214934997831, -236.03003965878395, -440.3083276414817, 342.2791270419392, 102.4722116470673, -161.454825714908, -355.27087919566355, 141.31435949230308, 239.32088600812517, -494.60408543730347); + double3x4 r2 = double3x4(279.07295549990283, 37.999210613779383, 136.81214934997831, -236.03003965878395, -440.3083276414817, 342.2791270419392, 102.4722116470673, -161.454825714908, -355.27087919566355, 141.31435949230308, 239.32088600812517, -494.60408543730347); + TestUtils.AreEqual(r2, +a2); + + double3x4 a3 = double3x4(361.59198134094106, 141.71249515456725, 25.25630880578251, -268.22689569565784, 106.77467613423926, 176.74438079481217, 104.11991005023935, 144.61861736356218, 289.45191372998613, -393.01668781461973, -198.95573506083139, -419.00921388110578); + double3x4 r3 = double3x4(361.59198134094106, 141.71249515456725, 25.25630880578251, -268.22689569565784, 106.77467613423926, 176.74438079481217, 104.11991005023935, 144.61861736356218, 289.45191372998613, -393.01668781461973, -198.95573506083139, -419.00921388110578); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void double3x4_operator_neg() + { + double3x4 a0 = double3x4(148.46174890755753, -467.12267873581624, 132.04719954917539, 183.52262290917463, 473.7010145009034, -407.99109024926605, -54.958759571872065, -382.98981803608581, -299.09338893512887, -383.01406377508027, 407.70980305583669, 168.73550351370852); + double3x4 r0 = double3x4(-148.46174890755753, 467.12267873581624, -132.04719954917539, -183.52262290917463, -473.7010145009034, 407.99109024926605, 54.958759571872065, 382.98981803608581, 299.09338893512887, 383.01406377508027, -407.70980305583669, -168.73550351370852); + TestUtils.AreEqual(r0, -a0); + + double3x4 a1 = double3x4(466.44152829909763, -280.55831564616335, -78.85761622286293, 318.69633522569029, -39.91539694737429, 140.34000284054321, 132.19563180403577, -505.89525127126615, 410.38058466947666, -237.05693375182193, -137.617827241131, -245.34998547534923); + double3x4 r1 = double3x4(-466.44152829909763, 280.55831564616335, 78.85761622286293, -318.69633522569029, 39.91539694737429, -140.34000284054321, -132.19563180403577, 505.89525127126615, -410.38058466947666, 237.05693375182193, 137.617827241131, 245.34998547534923); + TestUtils.AreEqual(r1, -a1); + + double3x4 a2 = double3x4(422.52133222227974, 60.222219256787639, -466.56631515294606, 426.89450116962871, 146.64955885086658, -391.37208408460583, 423.23773809114368, 254.29757296959758, -114.84889536483627, 108.05966263080927, -507.97628688624889, -306.24571456864743); + double3x4 r2 = double3x4(-422.52133222227974, -60.222219256787639, 466.56631515294606, -426.89450116962871, -146.64955885086658, 391.37208408460583, -423.23773809114368, -254.29757296959758, 114.84889536483627, -108.05966263080927, 507.97628688624889, 306.24571456864743); + TestUtils.AreEqual(r2, -a2); + + double3x4 a3 = double3x4(219.66627298093692, -98.760666177962264, 492.11106156376707, 84.0458290968304, 300.97664298721429, -483.86463307024195, -389.157431545275, -324.68608418325243, 378.8543824529529, 190.2192524365239, -69.102404865018286, 507.49539184360549); + double3x4 r3 = double3x4(-219.66627298093692, 98.760666177962264, -492.11106156376707, -84.0458290968304, -300.97664298721429, 483.86463307024195, 389.157431545275, 324.68608418325243, -378.8543824529529, -190.2192524365239, 69.102404865018286, -507.49539184360549); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void double3x4_operator_prefix_inc() + { + double3x4 a0 = double3x4(-139.84208137348389, -56.743654039103376, -381.955324589254, 509.79634380237962, -222.89634452708827, 210.31986556310198, -392.73151058365193, -300.19410218866267, 362.21273939787068, 401.614830919362, 130.90919429199266, -450.23016402229212); + double3x4 r0 = double3x4(-138.84208137348389, -55.743654039103376, -380.955324589254, 510.79634380237962, -221.89634452708827, 211.31986556310198, -391.73151058365193, -299.19410218866267, 363.21273939787068, 402.614830919362, 131.90919429199266, -449.23016402229212); + TestUtils.AreEqual(r0, ++a0); + + double3x4 a1 = double3x4(243.54693114177644, -41.497298975241051, 299.18547000511808, 154.35656530892311, -281.23327435237974, 200.70599922943211, 92.957765384091886, 448.60215565590283, -295.58701171334229, 18.499063262016989, -215.71113381893895, 471.94723651928234); + double3x4 r1 = double3x4(244.54693114177644, -40.497298975241051, 300.18547000511808, 155.35656530892311, -280.23327435237974, 201.70599922943211, 93.957765384091886, 449.60215565590283, -294.58701171334229, 19.499063262016989, -214.71113381893895, 472.94723651928234); + TestUtils.AreEqual(r1, ++a1); + + double3x4 a2 = double3x4(257.07660090973445, 4.8254301570474354, 243.00478588929627, -472.61902330472088, -125.7202084649914, -477.45955227197129, 9.8914859340952717, -76.922842299995409, -29.767583622488928, -387.17744344620849, 461.70929906410595, 13.699699169816313); + double3x4 r2 = double3x4(258.07660090973445, 5.8254301570474354, 244.00478588929627, -471.61902330472088, -124.7202084649914, -476.45955227197129, 10.891485934095272, -75.922842299995409, -28.767583622488928, -386.17744344620849, 462.70929906410595, 14.699699169816313); + TestUtils.AreEqual(r2, ++a2); + + double3x4 a3 = double3x4(-46.303758404359087, -222.22908626414329, 340.81780807153223, 399.74125046270956, -311.37233772472121, 300.17795457512977, -272.77828777617697, 351.01916782512296, 436.57524010007046, -137.06332475369021, 312.57995453131377, -315.99901380948677); + double3x4 r3 = double3x4(-45.303758404359087, -221.22908626414329, 341.81780807153223, 400.74125046270956, -310.37233772472121, 301.17795457512977, -271.77828777617697, 352.01916782512296, 437.57524010007046, -136.06332475369021, 313.57995453131377, -314.99901380948677); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void double3x4_operator_postfix_inc() + { + double3x4 a0 = double3x4(-396.6697396695007, 511.20749378167443, 249.11127030528678, -128.81731301584153, -259.49027669592306, 278.00817764830219, -81.393423356764686, 66.719732554033271, 167.85212691493894, 147.94395048354932, -326.10758486674524, 41.033564825092185); + double3x4 r0 = double3x4(-396.6697396695007, 511.20749378167443, 249.11127030528678, -128.81731301584153, -259.49027669592306, 278.00817764830219, -81.393423356764686, 66.719732554033271, 167.85212691493894, 147.94395048354932, -326.10758486674524, 41.033564825092185); + TestUtils.AreEqual(r0, a0++); + + double3x4 a1 = double3x4(128.5304239394751, -60.132380275117384, -446.22976490772783, -296.93783797739906, 267.29380071689081, 446.22930714405572, 49.200223230384381, -326.64314738225335, -510.86424064583343, 471.64748762159024, -171.01308186865089, 310.72735967800361); + double3x4 r1 = double3x4(128.5304239394751, -60.132380275117384, -446.22976490772783, -296.93783797739906, 267.29380071689081, 446.22930714405572, 49.200223230384381, -326.64314738225335, -510.86424064583343, 471.64748762159024, -171.01308186865089, 310.72735967800361); + TestUtils.AreEqual(r1, a1++); + + double3x4 a2 = double3x4(-298.91717185588425, 184.60345109952777, 290.69102896875279, 117.1923401901463, 164.44293578175962, 412.36778874526158, -229.38657079887884, 239.59693848322934, 36.624316947825378, -80.708194531830145, -391.03352016538076, -478.22714136458336); + double3x4 r2 = double3x4(-298.91717185588425, 184.60345109952777, 290.69102896875279, 117.1923401901463, 164.44293578175962, 412.36778874526158, -229.38657079887884, 239.59693848322934, 36.624316947825378, -80.708194531830145, -391.03352016538076, -478.22714136458336); + TestUtils.AreEqual(r2, a2++); + + double3x4 a3 = double3x4(166.86049159190645, -389.39665216458809, -52.132133269744031, 35.755328910311391, 356.05211298356392, 6.5294592410929226, -285.34983052189921, 418.0164985219094, 47.142905018824536, 31.451607480389839, 148.9468749263076, -219.80038200123255); + double3x4 r3 = double3x4(166.86049159190645, -389.39665216458809, -52.132133269744031, 35.755328910311391, 356.05211298356392, 6.5294592410929226, -285.34983052189921, 418.0164985219094, 47.142905018824536, 31.451607480389839, 148.9468749263076, -219.80038200123255); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void double3x4_operator_prefix_dec() + { + double3x4 a0 = double3x4(123.12869626056806, 256.8437465433235, 156.33078844674435, 461.73742530389563, 325.86799755965728, 392.01561731473339, 187.87412580655609, -236.2252043393558, 125.10963517292851, 469.8447313112415, 45.536655685648611, 376.04684680329956); + double3x4 r0 = double3x4(122.12869626056806, 255.8437465433235, 155.33078844674435, 460.73742530389563, 324.86799755965728, 391.01561731473339, 186.87412580655609, -237.2252043393558, 124.10963517292851, 468.8447313112415, 44.536655685648611, 375.04684680329956); + TestUtils.AreEqual(r0, --a0); + + double3x4 a1 = double3x4(-363.07547991493504, 248.79012667797042, 168.0950144120003, 168.26565011230559, -190.284744112885, 166.9455474200405, 183.95795854551625, 485.69469259944492, -460.73930261132273, 89.569894117102876, -267.42982090051743, 201.75623450137505); + double3x4 r1 = double3x4(-364.07547991493504, 247.79012667797042, 167.0950144120003, 167.26565011230559, -191.284744112885, 165.9455474200405, 182.95795854551625, 484.69469259944492, -461.73930261132273, 88.569894117102876, -268.42982090051743, 200.75623450137505); + TestUtils.AreEqual(r1, --a1); + + double3x4 a2 = double3x4(-141.21688682456357, 197.36173281323249, -213.54412732531506, 180.74062570405226, -128.31251412644633, 478.04553888647149, -454.56614062495817, -386.89835256473083, 387.85698408068015, -315.11044969927076, -108.28654556548526, -286.31702937107394); + double3x4 r2 = double3x4(-142.21688682456357, 196.36173281323249, -214.54412732531506, 179.74062570405226, -129.31251412644633, 477.04553888647149, -455.56614062495817, -387.89835256473083, 386.85698408068015, -316.11044969927076, -109.28654556548526, -287.31702937107394); + TestUtils.AreEqual(r2, --a2); + + double3x4 a3 = double3x4(-375.60158007945938, 78.275426662655263, 161.5319641388636, -346.8479546731561, -57.540783670517044, 455.37286231265068, 444.79814478605897, 129.82014638270255, 134.71065455987616, 61.323015956824179, -274.54334486394345, -43.3955581390278); + double3x4 r3 = double3x4(-376.60158007945938, 77.275426662655263, 160.5319641388636, -347.8479546731561, -58.540783670517044, 454.37286231265068, 443.79814478605897, 128.82014638270255, 133.71065455987616, 60.323015956824179, -275.54334486394345, -44.3955581390278); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void double3x4_operator_postfix_dec() + { + double3x4 a0 = double3x4(379.68831723727669, 302.69287814884115, -176.07134040448409, -291.25267066212962, 470.56758401848731, -402.92594666170231, -63.655158787805192, 355.26110069605568, -27.889220489137415, -100.76183824462902, 156.14034969924967, 479.94519613680677); + double3x4 r0 = double3x4(379.68831723727669, 302.69287814884115, -176.07134040448409, -291.25267066212962, 470.56758401848731, -402.92594666170231, -63.655158787805192, 355.26110069605568, -27.889220489137415, -100.76183824462902, 156.14034969924967, 479.94519613680677); + TestUtils.AreEqual(r0, a0--); + + double3x4 a1 = double3x4(-200.30429491787419, 407.42034907239508, 327.67032519340069, 48.0602071509046, -209.66798100698179, -38.435048836485976, 283.941595924991, -94.802087112703418, 152.51066334196867, -287.262531175866, -215.94803939384781, -407.04635567546188); + double3x4 r1 = double3x4(-200.30429491787419, 407.42034907239508, 327.67032519340069, 48.0602071509046, -209.66798100698179, -38.435048836485976, 283.941595924991, -94.802087112703418, 152.51066334196867, -287.262531175866, -215.94803939384781, -407.04635567546188); + TestUtils.AreEqual(r1, a1--); + + double3x4 a2 = double3x4(159.23357136511879, 168.4139531442961, -278.93379868144814, 289.91284073978329, 402.03954691534841, 470.71654937729079, -208.56061873611094, 145.89674789546837, -296.79095258228062, -274.57083309561517, -250.04125630578085, -70.856303486440481); + double3x4 r2 = double3x4(159.23357136511879, 168.4139531442961, -278.93379868144814, 289.91284073978329, 402.03954691534841, 470.71654937729079, -208.56061873611094, 145.89674789546837, -296.79095258228062, -274.57083309561517, -250.04125630578085, -70.856303486440481); + TestUtils.AreEqual(r2, a2--); + + double3x4 a3 = double3x4(-485.627825724719, -503.19208335466317, 397.64861387649955, 446.6215557747621, -292.8101204805123, 126.6225212209963, -250.44240700939781, 470.81648204793055, 26.943619502216393, -186.92351945998308, 45.746085426651916, -206.45597586708885); + double3x4 r3 = double3x4(-485.627825724719, -503.19208335466317, 397.64861387649955, 446.6215557747621, -292.8101204805123, 126.6225212209963, -250.44240700939781, 470.81648204793055, 26.943619502216393, -186.92351945998308, 45.746085426651916, -206.45597586708885); + TestUtils.AreEqual(r3, a3--); + } + + [TestCase /* For player builds */] + public static void double3x4_EqualsObjectOverride() + { + TestUtils.IsFalse(new double3x4().Equals((object)new int())); + TestUtils.IsTrue(new double3x4().Equals((object)new double3x4())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestDouble3x4.gen.cs.meta b/src/Tests/Tests/Shared/TestDouble3x4.gen.cs.meta new file mode 100644 index 00000000..20c7480f --- /dev/null +++ b/src/Tests/Tests/Shared/TestDouble3x4.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a43acb77473e8f64189c28afbb4c366a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestDouble4.gen.cs b/src/Tests/Tests/Shared/TestDouble4.gen.cs new file mode 100644 index 00000000..0344dae9 --- /dev/null +++ b/src/Tests/Tests/Shared/TestDouble4.gen.cs @@ -0,0 +1,1076 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestDouble4 + { + [TestCompiler] + public static void double4_zero() + { + TestUtils.AreEqual(0.0, double4.zero.x); + TestUtils.AreEqual(0.0, double4.zero.y); + TestUtils.AreEqual(0.0, double4.zero.z); + TestUtils.AreEqual(0.0, double4.zero.w); + } + + [TestCompiler] + public static void double4_constructor() + { + double4 a = new double4(1, 2, 3, 4); + TestUtils.AreEqual(1, a.x); + TestUtils.AreEqual(2, a.y); + TestUtils.AreEqual(3, a.z); + TestUtils.AreEqual(4, a.w); + } + + [TestCompiler] + public static void double4_scalar_constructor() + { + double4 a = new double4(17.0); + TestUtils.AreEqual(17.0, a.x); + TestUtils.AreEqual(17.0, a.y); + TestUtils.AreEqual(17.0, a.z); + TestUtils.AreEqual(17.0, a.w); + } + + [TestCompiler] + public static void double4_static_constructor() + { + double4 a = double4(1, 2, 3, 4); + TestUtils.AreEqual(1, a.x); + TestUtils.AreEqual(2, a.y); + TestUtils.AreEqual(3, a.z); + TestUtils.AreEqual(4, a.w); + } + + [TestCompiler] + public static void double4_static_scalar_constructor() + { + double4 a = double4(17.0); + TestUtils.AreEqual(17.0, a.x); + TestUtils.AreEqual(17.0, a.y); + TestUtils.AreEqual(17.0, a.z); + TestUtils.AreEqual(17.0, a.w); + } + + [TestCompiler] + public static void double4_operator_equal_wide_wide() + { + double4 a0 = double4(492.15758275061728, -495.20632027797694, 227.45765195947968, -147.37405950733182); + double4 b0 = double4(192.56880888369346, -235.61102472786376, -254.04311740307281, -412.62472052715009); + bool4 r0 = bool4(false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + double4 a1 = double4(-222.68201909897942, 64.093720704360749, -23.890404473939157, -16.8197190839889); + double4 b1 = double4(471.90480945627428, -6.4727852374654162, -339.10237447316865, 488.1875700839737); + bool4 r1 = bool4(false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + double4 a2 = double4(163.23210890741655, -165.27101071424363, 470.87767980568003, -423.94255967808078); + double4 b2 = double4(-379.5965842584132, -308.41700258311675, -82.333374300195544, -102.92108087563935); + bool4 r2 = bool4(false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + double4 a3 = double4(109.63436918595539, 462.69031283943468, -335.38147727371262, 357.23446934168896); + double4 b3 = double4(226.51573835430463, -356.90132896830391, -362.91277544708589, -427.89843746083716); + bool4 r3 = bool4(false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void double4_operator_equal_wide_scalar() + { + double4 a0 = double4(-303.2300766926399, 451.52631327674089, -253.65587413201848, -105.20363502632995); + double b0 = (123.5445759871717); + bool4 r0 = bool4(false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + double4 a1 = double4(-500.6910920090466, 159.87609656149334, -59.558379439431405, -57.477391031327386); + double b1 = (-426.19248338518315); + bool4 r1 = bool4(false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + double4 a2 = double4(-182.04973968400139, 370.88599866017978, -172.03530629539642, 455.40001198993991); + double b2 = (406.51375861024189); + bool4 r2 = bool4(false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + double4 a3 = double4(-11.338988547836891, -27.150561106927, -325.97606507221985, -290.35904254129116); + double b3 = (363.93823044557973); + bool4 r3 = bool4(false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void double4_operator_equal_scalar_wide() + { + double a0 = (-253.39728534100453); + double4 b0 = double4(19.952187785856495, -185.79199346610903, 407.8136052600172, -87.2766969610363); + bool4 r0 = bool4(false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + double a1 = (-206.27469382354741); + double4 b1 = double4(160.503138855334, -274.77081478516141, -2.6315281403397535, 448.35453602688131); + bool4 r1 = bool4(false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + double a2 = (-410.03524251004461); + double4 b2 = double4(247.32901465489022, 355.53915350303942, -298.06671180299793, 414.10151429385951); + bool4 r2 = bool4(false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + double a3 = (-481.30262707234482); + double4 b3 = double4(196.55074438664633, 34.60100008668428, 113.76156645350227, -386.45337861890596); + bool4 r3 = bool4(false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void double4_operator_not_equal_wide_wide() + { + double4 a0 = double4(430.8425316432689, 104.69001798736394, 225.80243478799355, -310.57017841496048); + double4 b0 = double4(210.02470622305975, -55.203330304102678, -269.92533672504373, -234.54673372700194); + bool4 r0 = bool4(true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + double4 a1 = double4(-418.61945815506363, 304.12820281839379, -509.32682561749908, -160.53807719076895); + double4 b1 = double4(25.917412054686565, -63.726991444699024, -484.55371092471933, -425.333599050219); + bool4 r1 = bool4(true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + double4 a2 = double4(-203.30197606016975, -505.76325368590807, 162.17220623892365, 1.1561973100324394); + double4 b2 = double4(-53.274394775402925, 328.1944192984115, 15.963139303011417, 461.71412417931208); + bool4 r2 = bool4(true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + double4 a3 = double4(65.662074358045174, 102.78780250567377, 172.93008120960098, 26.621009123800832); + double4 b3 = double4(-113.36304455313973, -240.07297264787974, 495.11916970420589, 203.5583661550462); + bool4 r3 = bool4(true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void double4_operator_not_equal_wide_scalar() + { + double4 a0 = double4(-16.914588697680529, 168.83411486858233, -462.71352145760949, 130.30776959765137); + double b0 = (-145.37277109239847); + bool4 r0 = bool4(true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + double4 a1 = double4(214.50161443208424, -197.12796053529155, -169.09985860115842, -386.61117595555783); + double b1 = (-440.26328178879959); + bool4 r1 = bool4(true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + double4 a2 = double4(-281.02101362916687, -403.96372313236992, -269.80570877241234, 299.65422763473089); + double b2 = (-270.26885593601912); + bool4 r2 = bool4(true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + double4 a3 = double4(-71.750904831919286, -457.36312100727258, -13.519590622521719, 273.87305773136814); + double b3 = (-432.75573917513515); + bool4 r3 = bool4(true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void double4_operator_not_equal_scalar_wide() + { + double a0 = (275.79582823244664); + double4 b0 = double4(-57.196896341255353, -382.4325279586169, 97.820359990848374, -161.46364529499022); + bool4 r0 = bool4(true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + double a1 = (-458.39563367254829); + double4 b1 = double4(-499.61786364932448, 327.92217818271467, 367.57121699283425, 59.7863667289663); + bool4 r1 = bool4(true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + double a2 = (-209.58068118318016); + double4 b2 = double4(-62.580453186566217, -479.97497604786184, -49.494519495169868, -114.68521338081229); + bool4 r2 = bool4(true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + double a3 = (109.93924599044919); + double4 b3 = double4(-176.28482755286842, -347.48529903380449, 85.540928165214609, -356.65954868712441); + bool4 r3 = bool4(true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void double4_operator_less_wide_wide() + { + double4 a0 = double4(196.84256825076534, 336.40979997087732, 251.96372115424072, 257.65591466503963); + double4 b0 = double4(-465.34502313348696, -256.15239751346053, -314.814018634527, 364.56673662949663); + bool4 r0 = bool4(false, false, false, true); + TestUtils.AreEqual(r0, a0 < b0); + + double4 a1 = double4(430.04588647840819, -62.419644146421774, 8.8392293494376872, -333.81671563434259); + double4 b1 = double4(100.21050290959442, 182.56098636545289, 3.116978885194726, -259.43047893207074); + bool4 r1 = bool4(false, true, false, true); + TestUtils.AreEqual(r1, a1 < b1); + + double4 a2 = double4(164.67880662003472, -350.94487516532877, 3.84143662631584, 125.40972024081725); + double4 b2 = double4(-437.33490749696966, -456.0437321402336, -394.2559718537405, 401.91369099259077); + bool4 r2 = bool4(false, false, false, true); + TestUtils.AreEqual(r2, a2 < b2); + + double4 a3 = double4(-111.12994127680076, 70.005523475820951, 448.19828173527412, -419.98711200244122); + double4 b3 = double4(313.43916454605721, 121.28668194696616, -28.012290729215522, -282.96589697663012); + bool4 r3 = bool4(true, true, false, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void double4_operator_less_wide_scalar() + { + double4 a0 = double4(-132.05731708000292, -192.46500477216438, -66.834607870706634, -379.01750081545561); + double b0 = (-156.01021845452965); + bool4 r0 = bool4(false, true, false, true); + TestUtils.AreEqual(r0, a0 < b0); + + double4 a1 = double4(-360.28242199508588, -158.24074537970159, 437.34587522845061, -20.452607402788772); + double b1 = (20.927834282129879); + bool4 r1 = bool4(true, true, false, true); + TestUtils.AreEqual(r1, a1 < b1); + + double4 a2 = double4(225.29148517609178, 274.01523292903562, 373.54965584983563, 398.52368301829495); + double b2 = (307.48418607725023); + bool4 r2 = bool4(true, true, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + double4 a3 = double4(105.0301654827922, 109.67008810381878, -108.853174498702, -44.971252223929014); + double b3 = (-58.010895994496934); + bool4 r3 = bool4(false, false, true, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void double4_operator_less_scalar_wide() + { + double a0 = (-423.117411095238); + double4 b0 = double4(385.09483617595151, -123.93348532725753, 86.376572887588509, 133.44217378154497); + bool4 r0 = bool4(true, true, true, true); + TestUtils.AreEqual(r0, a0 < b0); + + double a1 = (161.45794947513286); + double4 b1 = double4(229.75426660746064, 222.57159934871436, 315.53116360098647, -447.20351883731945); + bool4 r1 = bool4(true, true, true, false); + TestUtils.AreEqual(r1, a1 < b1); + + double a2 = (271.83385790131695); + double4 b2 = double4(-393.60531324595462, 317.48689737798964, -164.6051085761772, -282.87605370342544); + bool4 r2 = bool4(false, true, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + double a3 = (296.97953071118309); + double4 b3 = double4(-254.40115582868509, 365.61562054493265, -441.98425671178114, -131.42866021554391); + bool4 r3 = bool4(false, true, false, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void double4_operator_greater_wide_wide() + { + double4 a0 = double4(483.50140141113729, 310.81563415695712, 106.9661896726891, 295.73526038589671); + double4 b0 = double4(-471.39802454011425, -371.98528617060992, 36.900723236101044, -316.76360407320954); + bool4 r0 = bool4(true, true, true, true); + TestUtils.AreEqual(r0, a0 > b0); + + double4 a1 = double4(116.95757179938141, -478.29977653841479, -14.897393471979228, -33.817441717636484); + double4 b1 = double4(19.683055648432628, 207.3091381561519, 362.79748861994483, 324.95341816775192); + bool4 r1 = bool4(true, false, false, false); + TestUtils.AreEqual(r1, a1 > b1); + + double4 a2 = double4(-24.740548383789417, 319.78262701620474, -120.15856581561201, -289.00857962714906); + double4 b2 = double4(340.94807140014507, 25.986035120666997, -114.2111352021858, 240.80346428640348); + bool4 r2 = bool4(false, true, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + double4 a3 = double4(455.85146662958505, 144.70691139283917, 63.931990891663304, -285.68304099034663); + double4 b3 = double4(273.42244757033063, 325.51576224226312, 27.341068995809678, 64.479532510265472); + bool4 r3 = bool4(true, false, true, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void double4_operator_greater_wide_scalar() + { + double4 a0 = double4(64.317918092160426, -397.70346445483318, 431.87690826499693, 85.702980796668157); + double b0 = (305.85991992888034); + bool4 r0 = bool4(false, false, true, false); + TestUtils.AreEqual(r0, a0 > b0); + + double4 a1 = double4(246.26305233978803, 286.1994608781298, 280.81334818564972, -405.78459210218148); + double b1 = (197.49155602114809); + bool4 r1 = bool4(true, true, true, false); + TestUtils.AreEqual(r1, a1 > b1); + + double4 a2 = double4(171.56538661362856, 333.57817498481745, 370.27919524269146, -413.70138116073861); + double b2 = (-241.80727326209063); + bool4 r2 = bool4(true, true, true, false); + TestUtils.AreEqual(r2, a2 > b2); + + double4 a3 = double4(-356.5923551789449, 396.64532608382649, 467.22205541432936, -240.0134228393498); + double b3 = (-353.03129522550444); + bool4 r3 = bool4(false, true, true, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void double4_operator_greater_scalar_wide() + { + double a0 = (-282.67049635698572); + double4 b0 = double4(358.09997360692353, -72.5964134077525, -232.16380106292843, -60.706723956720282); + bool4 r0 = bool4(false, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + double a1 = (75.156642710397364); + double4 b1 = double4(150.88350040786133, 339.53917924479538, -498.19602965665797, 459.74610326241054); + bool4 r1 = bool4(false, false, true, false); + TestUtils.AreEqual(r1, a1 > b1); + + double a2 = (-227.96872316485678); + double4 b2 = double4(335.86213485145106, 76.178844248959308, 296.85993899817572, 177.49000390688423); + bool4 r2 = bool4(false, false, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + double a3 = (-281.20120657663847); + double4 b3 = double4(244.72285162877427, 137.32857257562159, -385.33824724021287, 443.16345879210326); + bool4 r3 = bool4(false, false, true, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void double4_operator_less_equal_wide_wide() + { + double4 a0 = double4(-438.52313753521219, 210.48942837980087, 4.8773329280677444, -137.29793817237857); + double4 b0 = double4(-474.8141498392514, 304.3710555063426, 234.8241737982371, -390.48543209139513); + bool4 r0 = bool4(false, true, true, false); + TestUtils.AreEqual(r0, a0 <= b0); + + double4 a1 = double4(156.09410174009111, -363.92412035722475, -97.948485181642923, 437.29539009430232); + double4 b1 = double4(-297.17535295019638, -326.29239121372461, 107.2538764976216, -413.13107342884462); + bool4 r1 = bool4(false, true, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + double4 a2 = double4(458.53029153241323, -294.06474675520542, 23.622613679441884, -34.284056441059363); + double4 b2 = double4(67.094432623635271, 470.07522724106684, -84.499104777583455, 392.78422683886447); + bool4 r2 = bool4(false, true, false, true); + TestUtils.AreEqual(r2, a2 <= b2); + + double4 a3 = double4(149.736484835733, -418.8866781754823, -197.50252899783783, -88.2055118494693); + double4 b3 = double4(-263.53175485484849, 369.30090039284005, -333.32529298091555, 238.41347443238533); + bool4 r3 = bool4(false, true, false, true); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void double4_operator_less_equal_wide_scalar() + { + double4 a0 = double4(193.4958237118534, 168.91555197952107, -313.9930695565385, 81.826965131716292); + double b0 = (443.85054299042122); + bool4 r0 = bool4(true, true, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + double4 a1 = double4(18.503590830836288, 241.36115776810846, -463.81641242644582, -1.3577692515020203); + double b1 = (-0.35819602029312136); + bool4 r1 = bool4(false, false, true, true); + TestUtils.AreEqual(r1, a1 <= b1); + + double4 a2 = double4(-268.89945591096739, -471.253072242836, -264.93778264938749, 82.258299150624453); + double b2 = (398.9919504593089); + bool4 r2 = bool4(true, true, true, true); + TestUtils.AreEqual(r2, a2 <= b2); + + double4 a3 = double4(11.246050124636895, 426.48223157715154, 56.319978501796754, -196.28791126808522); + double b3 = (424.7040156911612); + bool4 r3 = bool4(true, false, true, true); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void double4_operator_less_equal_scalar_wide() + { + double a0 = (393.60626644343427); + double4 b0 = double4(-75.688363825757222, -44.2638714519627, 125.86491566797019, 191.96488174794467); + bool4 r0 = bool4(false, false, false, false); + TestUtils.AreEqual(r0, a0 <= b0); + + double a1 = (13.543054825413492); + double4 b1 = double4(-197.0519259893577, -423.945100743298, -330.04861680141119, 420.16553779140372); + bool4 r1 = bool4(false, false, false, true); + TestUtils.AreEqual(r1, a1 <= b1); + + double a2 = (105.54730777887039); + double4 b2 = double4(174.82126363311954, 296.71757831085358, -469.70041845259277, 123.26718979853536); + bool4 r2 = bool4(true, true, false, true); + TestUtils.AreEqual(r2, a2 <= b2); + + double a3 = (112.9969695140594); + double4 b3 = double4(495.14339493920249, -488.65789364681478, 388.53941148730894, -493.24077080806751); + bool4 r3 = bool4(true, false, true, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void double4_operator_greater_equal_wide_wide() + { + double4 a0 = double4(-507.92858409692, 504.49748181947393, -385.43449205226938, -262.32340944107784); + double4 b0 = double4(-81.346509732933043, 297.66615047010885, 171.06540616371922, -431.03805538222105); + bool4 r0 = bool4(false, true, false, true); + TestUtils.AreEqual(r0, a0 >= b0); + + double4 a1 = double4(-37.550928848586466, -111.59527759980193, -463.70202157632542, 387.44885772627265); + double4 b1 = double4(-6.859075311040101, 319.72570362674333, 254.079170106947, 396.5724000393285); + bool4 r1 = bool4(false, false, false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + double4 a2 = double4(456.96878573716094, -211.01015506079892, 182.41135391146474, -53.596053863687473); + double4 b2 = double4(178.83927615864172, -447.06336304501787, 288.49268569075161, 474.88929460704765); + bool4 r2 = bool4(true, true, false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + double4 a3 = double4(-309.57021608463032, -136.02249127999994, 280.73629082401112, -96.9958942388165); + double4 b3 = double4(-321.75022831640683, -395.97722048125104, -158.69246037243516, 391.48869318118727); + bool4 r3 = bool4(true, true, true, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void double4_operator_greater_equal_wide_scalar() + { + double4 a0 = double4(465.15218732559686, -424.8860745024337, -209.22109685150025, 58.779852656079356); + double b0 = (-5.5998842742293391); + bool4 r0 = bool4(true, false, false, true); + TestUtils.AreEqual(r0, a0 >= b0); + + double4 a1 = double4(-302.26910533675414, 16.353385694489475, -344.55997316192838, 393.27804846003562); + double b1 = (140.12558252183976); + bool4 r1 = bool4(false, false, false, true); + TestUtils.AreEqual(r1, a1 >= b1); + + double4 a2 = double4(-315.70155086913218, -509.78156757251435, -36.994287269652943, 494.82028865014217); + double b2 = (441.0115565923096); + bool4 r2 = bool4(false, false, false, true); + TestUtils.AreEqual(r2, a2 >= b2); + + double4 a3 = double4(-164.97393830352183, -123.8137477020797, 215.65121779947128, 104.99569730879534); + double b3 = (-466.12009046325466); + bool4 r3 = bool4(true, true, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void double4_operator_greater_equal_scalar_wide() + { + double a0 = (374.82703393270594); + double4 b0 = double4(-1.609757185731894, 338.61524049314448, -116.18140392945213, -332.15732375353451); + bool4 r0 = bool4(true, true, true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + double a1 = (-355.9793509710484); + double4 b1 = double4(-468.90144107719021, 38.579884785497484, -332.34754697063357, 2.8901150240051265); + bool4 r1 = bool4(true, false, false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + double a2 = (467.77776477661814); + double4 b2 = double4(121.40638762405445, -305.02337303060267, -58.428812292604164, -226.51955209789776); + bool4 r2 = bool4(true, true, true, true); + TestUtils.AreEqual(r2, a2 >= b2); + + double a3 = (-47.020994446715804); + double4 b3 = double4(305.3026770582901, -427.40123315686418, 92.263649745035764, -497.17853736187266); + bool4 r3 = bool4(false, true, false, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void double4_operator_add_wide_wide() + { + double4 a0 = double4(506.12905263627374, -501.77980803967444, 420.08479638587903, -186.03206476291274); + double4 b0 = double4(-28.757987751047096, -337.135153689019, -340.676816860529, 152.31202633320913); + double4 r0 = double4(477.37106488522664, -838.91496172869347, 79.407979525350015, -33.720038429703607); + TestUtils.AreEqual(r0, a0 + b0); + + double4 a1 = double4(-9.3123953385801883, 328.51179686585056, 424.34407659263536, 87.791079800478656); + double4 b1 = double4(423.66745420157326, 90.374096674087468, 376.18866246574964, 1.7671887882831925); + double4 r1 = double4(414.35505886299308, 418.885893539938, 800.532739058385, 89.558268588761848); + TestUtils.AreEqual(r1, a1 + b1); + + double4 a2 = double4(462.41368148402012, -46.178705952213477, 401.17006296718966, -454.12414643453627); + double4 b2 = double4(-120.18586045139745, -279.62936628965167, -344.66710273580026, 242.8391956029642); + double4 r2 = double4(342.22782103262267, -325.80807224186515, 56.502960231389409, -211.28495083157208); + TestUtils.AreEqual(r2, a2 + b2); + + double4 a3 = double4(69.195687564646732, -177.95734485329939, 299.60415544156183, 340.7048587001417); + double4 b3 = double4(418.5930504363929, -23.312797318823982, -95.099945827899489, 147.92812568877275); + double4 r3 = double4(487.78873800103963, -201.27014217212337, 204.50420961366234, 488.63298438891445); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void double4_operator_add_wide_scalar() + { + double4 a0 = double4(-194.51420387742769, 338.54838696985894, 246.97140252169754, 100.51093797595752); + double b0 = (124.121678171736); + double4 r0 = double4(-70.3925257056917, 462.67006514159493, 371.09308069343354, 224.63261614769351); + TestUtils.AreEqual(r0, a0 + b0); + + double4 a1 = double4(-45.724677822424439, 30.916145577522116, 60.37435224483454, -242.1187475855084); + double b1 = (-478.11131094308166); + double4 r1 = double4(-523.835988765506, -447.19516536555955, -417.73695869824712, -720.23005852859); + TestUtils.AreEqual(r1, a1 + b1); + + double4 a2 = double4(82.50134495762245, -484.69981287638649, -188.26501068298938, -213.52673087526426); + double b2 = (6.7993848355483806); + double4 r2 = double4(89.300729793170831, -477.90042804083811, -181.465625847441, -206.72734603971588); + TestUtils.AreEqual(r2, a2 + b2); + + double4 a3 = double4(-267.78430688929944, 198.53359684652355, 187.53610023648298, -424.92567582844089); + double b3 = (189.25996669999324); + double4 r3 = double4(-78.5243401893062, 387.79356354651679, 376.79606693647622, -235.66570912844765); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void double4_operator_add_scalar_wide() + { + double a0 = (-340.35468284243473); + double4 b0 = double4(511.36225652665007, -146.21663791789518, -106.21042661844308, -363.45024960276214); + double4 r0 = double4(171.00757368421534, -486.57132076032991, -446.56510946087781, -703.80493244519687); + TestUtils.AreEqual(r0, a0 + b0); + + double a1 = (199.08958325120136); + double4 b1 = double4(-27.108407271610758, 419.84900041103788, 284.95503748811552, -164.92418129971446); + double4 r1 = double4(171.9811759795906, 618.93858366223924, 484.04462073931688, 34.1654019514869); + TestUtils.AreEqual(r1, a1 + b1); + + double a2 = (-249.19032561461921); + double4 b2 = double4(150.92817718858282, 298.17509784278229, -457.15341803857751, 424.71807094324288); + double4 r2 = double4(-98.26214842603639, 48.984772228163081, -706.34374365319673, 175.52774532862367); + TestUtils.AreEqual(r2, a2 + b2); + + double a3 = (-301.85750283946163); + double4 b3 = double4(230.28885208363124, -423.58759351428023, -67.060037882560891, 68.7241366229598); + double4 r3 = double4(-71.56865075583039, -725.44509635374186, -368.91754072202252, -233.13336621650183); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void double4_operator_sub_wide_wide() + { + double4 a0 = double4(160.4922617229131, 11.223957305412682, 359.20010607279846, -498.22830485656311); + double4 b0 = double4(115.46876078260539, -130.98230630298252, 241.54083716196044, 9.9870860623135513); + double4 r0 = double4(45.023500940307713, 142.2062636083952, 117.65926891083802, -508.21539091887666); + TestUtils.AreEqual(r0, a0 - b0); + + double4 a1 = double4(-355.25362913462038, -94.534852787170053, -410.46404786150163, -401.38464398001537); + double4 b1 = double4(419.89512582304656, 59.124466208333388, -402.38163847587145, -75.370143687059226); + double4 r1 = double4(-775.14875495766694, -153.65931899550344, -8.0824093856301715, -326.01450029295614); + TestUtils.AreEqual(r1, a1 - b1); + + double4 a2 = double4(317.70681944382693, 447.0604133303558, -489.07414482956477, -230.00838218909149); + double4 b2 = double4(320.97960796997859, -73.908757482612884, -31.444742455819949, -389.25194734579509); + double4 r2 = double4(-3.2727885261516576, 520.96917081296874, -457.62940237374482, 159.2435651567036); + TestUtils.AreEqual(r2, a2 - b2); + + double4 a3 = double4(24.875419389864192, 366.61447136784648, -107.3741567634857, -219.0081404275299); + double4 b3 = double4(-375.02884000122026, 259.18275821357167, 276.648654351313, -453.06919905779381); + double4 r3 = double4(399.90425939108445, 107.4317131542748, -384.02281111479869, 234.06105863026391); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void double4_operator_sub_wide_scalar() + { + double4 a0 = double4(207.38960108877609, 248.45773684627272, -384.82393211164697, -205.34476122881506); + double b0 = (-36.112476604111691); + double4 r0 = double4(243.50207769288778, 284.57021345038441, -348.71145550753528, -169.23228462470337); + TestUtils.AreEqual(r0, a0 - b0); + + double4 a1 = double4(-374.81156152058929, 18.856238135535364, -44.96160151667965, 480.85798738936796); + double b1 = (191.64204820973896); + double4 r1 = double4(-566.45360973032825, -172.7858100742036, -236.60364972641861, 289.215939179629); + TestUtils.AreEqual(r1, a1 - b1); + + double4 a2 = double4(16.338193185784917, -35.523088233323335, 349.39776460705218, 439.07729336203886); + double b2 = (-366.86545269883493); + double4 r2 = double4(383.20364588461985, 331.34236446551159, 716.26321730588711, 805.94274606087379); + TestUtils.AreEqual(r2, a2 - b2); + + double4 a3 = double4(490.2222661870635, -384.84940952102158, 189.05188545447402, 55.602777745389744); + double b3 = (195.02405104181923); + double4 r3 = double4(295.19821514524426, -579.87346056284082, -5.9721655873452164, -139.42127329642949); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void double4_operator_sub_scalar_wide() + { + double a0 = (-86.008225719448262); + double4 b0 = double4(466.42511413359318, 298.48694219183506, -300.95010652251085, 315.38003006362362); + double4 r0 = double4(-552.43333985304139, -384.49516791128332, 214.94188080306259, -401.38825578307188); + TestUtils.AreEqual(r0, a0 - b0); + + double a1 = (-381.09218543632522); + double4 b1 = double4(-125.00837546447684, 58.466194418476107, 214.74609361158036, -257.54942739082009); + double4 r1 = double4(-256.08380997184838, -439.55837985480133, -595.83827904790564, -123.54275804550514); + TestUtils.AreEqual(r1, a1 - b1); + + double a2 = (480.22459505508868); + double4 b2 = double4(-443.35507723472784, 260.79503858312728, 29.681931747906788, 139.85773164586055); + double4 r2 = double4(923.57967228981647, 219.4295564719614, 450.5426633071819, 340.36686340922813); + TestUtils.AreEqual(r2, a2 - b2); + + double a3 = (-247.78996216868512); + double4 b3 = double4(-248.4662297929014, 91.445112509394562, 86.384162704639266, 373.81828206303453); + double4 r3 = double4(0.67626762421627973, -339.23507467807968, -334.17412487332439, -621.60824423171971); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void double4_operator_mul_wide_wide() + { + double4 a0 = double4(-482.71381710596097, -407.29348559272171, 137.70058995937029, 208.54113278563182); + double4 b0 = double4(-236.36788355389979, 260.72759139757954, -416.38629718142852, -364.49561541364324); + double4 r0 = double4(114098.04331156026, -106192.64949051509, -57336.638772880389, -76012.328533757158); + TestUtils.AreEqual(r0, a0 * b0); + + double4 a1 = double4(194.296573967811, -484.24241684574747, 183.98730739578014, -241.33547770294149); + double4 b1 = double4(-253.14750897751537, -369.20287220981106, 193.54791531038836, 169.08491976982214); + double4 r1 = double4(-49185.69370281692, 178783.69114527057, 35610.359790024842, -40806.189885013562); + TestUtils.AreEqual(r1, a1 * b1); + + double4 a2 = double4(45.868758938214114, 363.32610266438041, -328.11893692990714, -471.02307413100408); + double4 b2 = double4(201.96966442930034, 249.45608317547294, -308.19319810913555, -385.57964843585137); + double4 r2 = double4(9264.0978505395742, 90633.9064860661, 101124.02453259782, 181616.91132860651); + TestUtils.AreEqual(r2, a2 * b2); + + double4 a3 = double4(-262.68257415605831, -379.26274674910246, -374.09058182970182, 481.44738720424812); + double4 b3 = double4(-183.27959522198864, 22.275629292370581, -265.52144229855458, -95.677454277722859); + double4 r3 = double4(48144.355863192381, -8448.3163509892329, 99329.070837727879, -46063.660376363579); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void double4_operator_mul_wide_scalar() + { + double4 a0 = double4(-96.318821236639678, -277.14229239017811, -239.93690191951436, 509.53140544776409); + double b0 = (-301.20720424373042); + double4 r0 = double4(29011.922860739887, 83477.255068544036, 72270.723422079071, -153474.5301092997); + TestUtils.AreEqual(r0, a0 * b0); + + double4 a1 = double4(255.85810172551226, -455.50827500573746, -389.24327367788334, -338.29248658674419); + double b1 = (215.73149667295229); + double4 r1 = double4(55196.651221145235, -98267.481913902491, -83972.034000409345, -72980.344444572955); + TestUtils.AreEqual(r1, a1 * b1); + + double4 a2 = double4(53.796284939067618, 135.35469991311186, -207.35010275959507, -383.93960946795517); + double b2 = (243.75734459783757); + double4 r2 = double4(13113.239565975766, 32993.702229657305, -50543.11045076765, -93588.099689839524); + TestUtils.AreEqual(r2, a2 * b2); + + double4 a3 = double4(-31.425238862366086, 260.38388049806645, 176.86755927692525, 25.672123205695357); + double b3 = (42.676120539510634); + double4 r3 = double4(-1341.1072816732492, 11112.173870681016, 7548.021279231104, 1095.5866244314232); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void double4_operator_mul_scalar_wide() + { + double a0 = (37.432166355397612); + double4 b0 = double4(96.747546479454058, 492.18539427788244, -274.05458534604617, -452.87096926796761); + double4 r0 = double4(3621.4702542954869, 18423.565556306661, -10258.456829132712, -16951.941459168724); + TestUtils.AreEqual(r0, a0 * b0); + + double a1 = (420.85330434369541); + double4 b1 = double4(102.18292694081686, -114.94887762654054, -351.12003843445336, -464.66496799172131); + double4 r1 = double4(43004.022450553188, -48376.614979728663, -147770.02839642504, -195555.78719207339); + TestUtils.AreEqual(r1, a1 * b1); + + double a2 = (444.08484646495663); + double4 b2 = double4(447.10525605040846, 130.82935124767448, -321.41334191030512, 445.30131861441828); + double4 r2 = double4(198552.66898682076, 58099.332361933404, -142734.79459402646, 197751.56770752667); + TestUtils.AreEqual(r2, a2 * b2); + + double a3 = (478.24357317306271); + double4 b3 = double4(358.57170622356784, -144.89011222910608, -438.89383741789209, -3.536441089369589); + double4 r3 = double4(171484.61402312081, -69292.764989893767, -209898.15705036998, -1691.2802228961507); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void double4_operator_div_wide_wide() + { + double4 a0 = double4(-353.13144390337703, -102.79985456485292, 51.319128298814917, -191.87167868012176); + double4 b0 = double4(-178.73954805114283, -302.09628381491467, -199.40583739029518, 278.85077561012042); + double4 r0 = double4(1.97567604793504, 0.34028837848212429, -0.25736021056579439, -0.68808013268139567); + TestUtils.AreEqual(r0, a0 / b0); + + double4 a1 = double4(8.0418245829836223, -128.73764210973758, -136.05959779399427, -370.4710053738537); + double4 b1 = double4(502.33758782890516, -361.48483078623417, 353.121059820578, -38.894930142394685); + double4 r1 = double4(0.016008805189634039, 0.35613566917796119, -0.3853058151307277, 9.5249176182488586); + TestUtils.AreEqual(r1, a1 / b1); + + double4 a2 = double4(-237.69456326109105, -432.54687496300176, 200.26549181727012, 361.44157068871039); + double4 b2 = double4(-75.764737402910725, -195.21784719974636, -405.03399224068687, -394.2300085473014); + double4 r2 = double4(3.1372716570909582, 2.2157137842034547, -0.49444119667433889, -0.9168291678773689); + TestUtils.AreEqual(r2, a2 / b2); + + double4 a3 = double4(-416.22613234828509, -450.01919362042992, -273.49744594911925, -286.90817011841955); + double4 b3 = double4(-375.82771342612227, -121.24548655433836, 447.623344391409, 338.28628007429018); + double4 r3 = double4(1.1074918572499153, 3.7116366671409717, -0.61099906735420106, -0.84812239519560884); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void double4_operator_div_wide_scalar() + { + double4 a0 = double4(171.34242184988341, 0.10338377957384637, 57.888263967767443, -256.13074529177078); + double b0 = (171.79682191265601); + double4 r0 = double4(0.99735501473360411, 0.00060177934855167557, 0.33695771157628673, -1.4908933846400916); + TestUtils.AreEqual(r0, a0 / b0); + + double4 a1 = double4(95.6696842162263, -127.44869118903239, -79.7448890580539, 146.46688110496234); + double b1 = (-290.38690461329509); + double4 r1 = double4(-0.32945591793689361, 0.43889269510536072, 0.27461599607685222, -0.50438528314494968); + TestUtils.AreEqual(r1, a1 / b1); + + double4 a2 = double4(-499.84355687529012, -453.20579859856787, -205.03382143985192, 481.73814247629514); + double b2 = (58.686315802245531); + double4 r2 = double4(-8.5172079733136776, -7.7225123506769311, -3.4937245358995028, 8.2086962844899229); + TestUtils.AreEqual(r2, a2 / b2); + + double4 a3 = double4(464.47907159499778, -158.50557930697948, -289.5822156824089, 494.12860535743118); + double b3 = (-293.46349753693841); + double4 r3 = double4(-1.5827490488370997, 0.54012025562745947, 0.9867742261402, -1.683782172245238); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void double4_operator_div_scalar_wide() + { + double a0 = (-264.44250095283729); + double4 b0 = double4(105.58908157497137, -142.34910137129441, -288.94890679463231, 39.644133824689334); + double4 r0 = double4(-2.5044492954044237, 1.85770404172122, 0.915187753732487, -6.670406827961755); + TestUtils.AreEqual(r0, a0 / b0); + + double a1 = (-363.99138396046658); + double4 b1 = double4(-149.71822006521666, -395.72912306139671, 258.71868693955184, -9.6662514254759344); + double4 r1 = double4(2.4311762710103912, 0.91979933431382543, -1.4069002446874319, 37.655898645585339); + TestUtils.AreEqual(r1, a1 / b1); + + double a2 = (117.72553282497711); + double4 b2 = double4(-331.38655797177296, -509.98602676297821, 427.8964666928614, 467.61712882836218); + double4 r2 = double4(-0.35525138239012338, -0.23084070277810059, 0.275126209232008, 0.25175624579866063); + TestUtils.AreEqual(r2, a2 / b2); + + double a3 = (-407.12461943511136); + double4 b3 = double4(252.69070994699871, 444.59937664708093, -88.313306134340053, 199.95503411067421); + double4 r3 = double4(-1.6111578439923842, -0.91571117914158318, 4.6100031496477243, -2.0360808681104259); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void double4_operator_mod_wide_wide() + { + double4 a0 = double4(-388.81249422059045, 181.68118842955732, -167.07872470052854, 432.82015319951813); + double4 b0 = double4(436.94417187056695, 58.940049437312382, -201.11623368091705, 279.2893537391393); + double4 r0 = double4(-388.81249422059045, 4.8610401176201776, -167.07872470052854, 153.53079946037883); + TestUtils.AreEqual(r0, a0 % b0); + + double4 a1 = double4(-258.43895995730486, -170.11079629236406, 283.318293464984, 122.71651297561664); + double4 b1 = double4(-397.07975954426445, 377.89994758083481, 174.69386657266591, -228.17652736798698); + double4 r1 = double4(-258.43895995730486, -170.11079629236406, 108.62442689231807, 122.71651297561664); + TestUtils.AreEqual(r1, a1 % b1); + + double4 a2 = double4(335.27101413126616, -503.60851668920765, 191.02251848532933, 289.74269379756538); + double4 b2 = double4(-317.06019106370405, -417.48011107811709, -249.9759434433542, -397.57157177364991); + double4 r2 = double4(18.210823067562103, -86.128405611090557, 191.02251848532933, 289.74269379756538); + TestUtils.AreEqual(r2, a2 % b2); + + double4 a3 = double4(-124.03371745163281, 259.27395761165485, -274.35845030208975, -140.03080398404541); + double4 b3 = double4(-358.74544947163452, -198.1592100589346, 208.73709378425826, -12.119406944196385); + double4 r3 = double4(-124.03371745163281, 61.114747552720246, -65.621356517831487, -6.7173275978851734); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void double4_operator_mod_wide_scalar() + { + double4 a0 = double4(-244.49962889612635, -211.81931958525411, -145.92677576184587, -304.91822090042672); + double b0 = (39.634963769295723); + double4 r0 = double4(-6.6898462803520147, -13.644500738775491, -27.021884453958705, -27.473474515356656); + TestUtils.AreEqual(r0, a0 % b0); + + double4 a1 = double4(155.47946436492703, 281.30965412841624, -226.53575311719243, 335.16613046041039); + double b1 = (-133.90778428591221); + double4 r1 = double4(21.571680079014811, 13.494085556591813, -92.627968831280214, 67.350561888585958); + TestUtils.AreEqual(r1, a1 % b1); + + double4 a2 = double4(101.70649032560482, -285.40231646476423, -355.84685985923136, 259.37800061860025); + double b2 = (319.47152033423606); + double4 r2 = double4(101.70649032560482, -285.40231646476423, -36.3753395249953, 259.37800061860025); + TestUtils.AreEqual(r2, a2 % b2); + + double4 a3 = double4(-330.87193957477433, -102.68343811048356, -172.14173921017988, 206.41684517935698); + double b3 = (-284.34358109363518); + double4 r3 = double4(-46.528358481139151, -102.68343811048356, -172.14173921017988, 206.41684517935698); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void double4_operator_mod_scalar_wide() + { + double a0 = (-66.945025236785909); + double4 b0 = double4(-249.77609479137516, -396.07375664081133, 386.49204582091977, 168.93948109864232); + double4 r0 = double4(-66.945025236785909, -66.945025236785909, -66.945025236785909, -66.945025236785909); + TestUtils.AreEqual(r0, a0 % b0); + + double a1 = (-199.4182442163202); + double4 b1 = double4(261.7517141130528, 16.127438791155555, 257.66814744550186, -75.788451945310669); + double4 r1 = double4(-199.4182442163202, -5.8889787224535439, -199.4182442163202, -47.841340325698866); + TestUtils.AreEqual(r1, a1 % b1); + + double a2 = (170.95630439136005); + double4 b2 = double4(-242.85828005655588, 425.94531913564788, 303.27240409668184, 3.033060790520608); + double4 r2 = double4(170.95630439136005, 170.95630439136005, 170.95630439136005, 1.1049001222060042); + TestUtils.AreEqual(r2, a2 % b2); + + double a3 = (-505.74352788633831); + double4 b3 = double4(461.95706126743789, 205.97275672013529, 270.04063642678807, -47.480711720642034); + double4 r3 = double4(-43.78646661890042, -93.798014446067725, -235.70289145955024, -30.936410679917969); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void double4_operator_plus() + { + double4 a0 = double4(-418.82956357432045, -405.79894823851015, -34.041791216489742, 236.99924456188421); + double4 r0 = double4(-418.82956357432045, -405.79894823851015, -34.041791216489742, 236.99924456188421); + TestUtils.AreEqual(r0, +a0); + + double4 a1 = double4(-459.83910129025537, 293.74197902052754, -373.015422279488, -386.059833944803); + double4 r1 = double4(-459.83910129025537, 293.74197902052754, -373.015422279488, -386.059833944803); + TestUtils.AreEqual(r1, +a1); + + double4 a2 = double4(4.9544198536101476, 504.47483062393724, -170.74650843941907, 439.55937572920664); + double4 r2 = double4(4.9544198536101476, 504.47483062393724, -170.74650843941907, 439.55937572920664); + TestUtils.AreEqual(r2, +a2); + + double4 a3 = double4(-478.74939916969714, 421.40964742256779, -258.5960806620289, 447.86609122150867); + double4 r3 = double4(-478.74939916969714, 421.40964742256779, -258.5960806620289, 447.86609122150867); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void double4_operator_neg() + { + double4 a0 = double4(148.46174890755753, -467.12267873581624, 132.04719954917539, 183.52262290917463); + double4 r0 = double4(-148.46174890755753, 467.12267873581624, -132.04719954917539, -183.52262290917463); + TestUtils.AreEqual(r0, -a0); + + double4 a1 = double4(473.7010145009034, -54.958759571872065, -382.98981803608581, -299.09338893512887); + double4 r1 = double4(-473.7010145009034, 54.958759571872065, 382.98981803608581, 299.09338893512887); + TestUtils.AreEqual(r1, -a1); + + double4 a2 = double4(-383.01406377508027, 168.73550351370852, 466.44152829909763, 171.90249474900895); + double4 r2 = double4(383.01406377508027, -168.73550351370852, -466.44152829909763, -171.90249474900895); + TestUtils.AreEqual(r2, -a2); + + double4 a3 = double4(-280.55831564616335, 318.69633522569029, -39.91539694737429, 140.34000284054321); + double4 r3 = double4(280.55831564616335, -318.69633522569029, 39.91539694737429, -140.34000284054321); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void double4_operator_prefix_inc() + { + double4 a0 = double4(-139.84208137348389, -56.743654039103376, -381.955324589254, 509.79634380237962); + double4 r0 = double4(-138.84208137348389, -55.743654039103376, -380.955324589254, 510.79634380237962); + TestUtils.AreEqual(r0, ++a0); + + double4 a1 = double4(-222.89634452708827, -392.73151058365193, -300.19410218866267, 362.21273939787068); + double4 r1 = double4(-221.89634452708827, -391.73151058365193, -299.19410218866267, 363.21273939787068); + TestUtils.AreEqual(r1, ++a1); + + double4 a2 = double4(401.614830919362, -450.23016402229212, 243.54693114177644, 46.19202735190845); + double4 r2 = double4(402.614830919362, -449.23016402229212, 244.54693114177644, 47.19202735190845); + TestUtils.AreEqual(r2, ++a2); + + double4 a3 = double4(-41.497298975241051, 154.35656530892311, -281.23327435237974, 200.70599922943211); + double4 r3 = double4(-40.497298975241051, 155.35656530892311, -280.23327435237974, 201.70599922943211); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void double4_operator_postfix_inc() + { + double4 a0 = double4(-396.6697396695007, 511.20749378167443, 249.11127030528678, -128.81731301584153); + double4 r0 = double4(-396.6697396695007, 511.20749378167443, 249.11127030528678, -128.81731301584153); + TestUtils.AreEqual(r0, a0++); + + double4 a1 = double4(-259.49027669592306, -81.393423356764686, 66.719732554033271, 167.85212691493894); + double4 r1 = double4(-259.49027669592306, -81.393423356764686, 66.719732554033271, 167.85212691493894); + TestUtils.AreEqual(r1, a1++); + + double4 a2 = double4(147.94395048354932, 41.033564825092185, 128.5304239394751, 73.155582223625629); + double4 r2 = double4(147.94395048354932, 41.033564825092185, 128.5304239394751, 73.155582223625629); + TestUtils.AreEqual(r2, a2++); + + double4 a3 = double4(-60.132380275117384, -296.93783797739906, 267.29380071689081, 446.22930714405572); + double4 r3 = double4(-60.132380275117384, -296.93783797739906, 267.29380071689081, 446.22930714405572); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void double4_operator_prefix_dec() + { + double4 a0 = double4(123.12869626056806, 256.8437465433235, 156.33078844674435, 461.73742530389563); + double4 r0 = double4(122.12869626056806, 255.8437465433235, 155.33078844674435, 460.73742530389563); + TestUtils.AreEqual(r0, --a0); + + double4 a1 = double4(325.86799755965728, 187.87412580655609, -236.2252043393558, 125.10963517292851); + double4 r1 = double4(324.86799755965728, 186.87412580655609, -237.2252043393558, 124.10963517292851); + TestUtils.AreEqual(r1, --a1); + + double4 a2 = double4(469.8447313112415, 376.04684680329956, -363.07547991493504, -22.028951416736902); + double4 r2 = double4(468.8447313112415, 375.04684680329956, -364.07547991493504, -23.028951416736902); + TestUtils.AreEqual(r2, --a2); + + double4 a3 = double4(248.79012667797042, 168.26565011230559, -190.284744112885, 166.9455474200405); + double4 r3 = double4(247.79012667797042, 167.26565011230559, -191.284744112885, 165.9455474200405); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void double4_operator_postfix_dec() + { + double4 a0 = double4(379.68831723727669, 302.69287814884115, -176.07134040448409, -291.25267066212962); + double4 r0 = double4(379.68831723727669, 302.69287814884115, -176.07134040448409, -291.25267066212962); + TestUtils.AreEqual(r0, a0--); + + double4 a1 = double4(470.56758401848731, -63.655158787805192, 355.26110069605568, -27.889220489137415); + double4 r1 = double4(470.56758401848731, -63.655158787805192, 355.26110069605568, -27.889220489137415); + TestUtils.AreEqual(r1, a1--); + + double4 a2 = double4(-100.76183824462902, 479.94519613680677, -200.30429491787419, -445.0269393609031); + double4 r2 = double4(-100.76183824462902, 479.94519613680677, -200.30429491787419, -445.0269393609031); + TestUtils.AreEqual(r2, a2--); + + double4 a3 = double4(407.42034907239508, 48.0602071509046, -209.66798100698179, -38.435048836485976); + double4 r3 = double4(407.42034907239508, 48.0602071509046, -209.66798100698179, -38.435048836485976); + TestUtils.AreEqual(r3, a3--); + } + + [TestCompiler] + public static void double4_shuffle_result_1() + { + double4 a = double4(0, 1, 2, 3); + double4 b = double4(4, 5, 6, 7); + + TestUtils.AreEqual((0), shuffle(a, b, ShuffleComponent.LeftX)); + TestUtils.AreEqual((1), shuffle(a, b, ShuffleComponent.LeftY)); + TestUtils.AreEqual((2), shuffle(a, b, ShuffleComponent.LeftZ)); + TestUtils.AreEqual((3), shuffle(a, b, ShuffleComponent.LeftW)); + TestUtils.AreEqual((4), shuffle(a, b, ShuffleComponent.RightX)); + TestUtils.AreEqual((5), shuffle(a, b, ShuffleComponent.RightY)); + TestUtils.AreEqual((6), shuffle(a, b, ShuffleComponent.RightZ)); + TestUtils.AreEqual((7), shuffle(a, b, ShuffleComponent.RightW)); + } + + [TestCompiler] + public static void double4_shuffle_result_2() + { + double4 a = double4(0, 1, 2, 3); + double4 b = double4(4, 5, 6, 7); + + TestUtils.AreEqual(double2(5, 6), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightZ)); + TestUtils.AreEqual(double2(6, 4), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.RightX)); + TestUtils.AreEqual(double2(1, 4), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.RightX)); + TestUtils.AreEqual(double2(7, 3), shuffle(a, b, ShuffleComponent.RightW, ShuffleComponent.LeftW)); + TestUtils.AreEqual(double2(7, 2), shuffle(a, b, ShuffleComponent.RightW, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(double2(2, 3), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.LeftW)); + TestUtils.AreEqual(double2(5, 3), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftW)); + TestUtils.AreEqual(double2(7, 0), shuffle(a, b, ShuffleComponent.RightW, ShuffleComponent.LeftX)); + TestUtils.AreEqual(double2(6, 7), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.RightW)); + TestUtils.AreEqual(double2(5, 2), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(double2(6, 6), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.RightZ)); + TestUtils.AreEqual(double2(7, 0), shuffle(a, b, ShuffleComponent.RightW, ShuffleComponent.LeftX)); + TestUtils.AreEqual(double2(5, 4), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightX)); + TestUtils.AreEqual(double2(7, 5), shuffle(a, b, ShuffleComponent.RightW, ShuffleComponent.RightY)); + TestUtils.AreEqual(double2(4, 0), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftX)); + TestUtils.AreEqual(double2(1, 3), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.LeftW)); + } + + [TestCompiler] + public static void double4_shuffle_result_3() + { + double4 a = double4(0, 1, 2, 3); + double4 b = double4(4, 5, 6, 7); + + TestUtils.AreEqual(double3(2, 7, 5), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.RightW, ShuffleComponent.RightY)); + TestUtils.AreEqual(double3(6, 0, 3), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.LeftX, ShuffleComponent.LeftW)); + TestUtils.AreEqual(double3(2, 7, 4), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.RightW, ShuffleComponent.RightX)); + TestUtils.AreEqual(double3(5, 0, 2), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftX, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(double3(7, 6, 2), shuffle(a, b, ShuffleComponent.RightW, ShuffleComponent.RightZ, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(double3(3, 1, 1), shuffle(a, b, ShuffleComponent.LeftW, ShuffleComponent.LeftY, ShuffleComponent.LeftY)); + TestUtils.AreEqual(double3(3, 5, 4), shuffle(a, b, ShuffleComponent.LeftW, ShuffleComponent.RightY, ShuffleComponent.RightX)); + TestUtils.AreEqual(double3(3, 1, 7), shuffle(a, b, ShuffleComponent.LeftW, ShuffleComponent.LeftY, ShuffleComponent.RightW)); + TestUtils.AreEqual(double3(6, 5, 6), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.RightY, ShuffleComponent.RightZ)); + TestUtils.AreEqual(double3(5, 4, 1), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightX, ShuffleComponent.LeftY)); + TestUtils.AreEqual(double3(7, 7, 0), shuffle(a, b, ShuffleComponent.RightW, ShuffleComponent.RightW, ShuffleComponent.LeftX)); + TestUtils.AreEqual(double3(6, 1, 5), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.LeftY, ShuffleComponent.RightY)); + TestUtils.AreEqual(double3(6, 1, 7), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.LeftY, ShuffleComponent.RightW)); + TestUtils.AreEqual(double3(3, 5, 5), shuffle(a, b, ShuffleComponent.LeftW, ShuffleComponent.RightY, ShuffleComponent.RightY)); + TestUtils.AreEqual(double3(6, 0, 5), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.LeftX, ShuffleComponent.RightY)); + TestUtils.AreEqual(double3(5, 1, 7), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftY, ShuffleComponent.RightW)); + } + + [TestCompiler] + public static void double4_shuffle_result_4() + { + double4 a = double4(0, 1, 2, 3); + double4 b = double4(4, 5, 6, 7); + + TestUtils.AreEqual(double4(1, 3, 4, 2), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.LeftW, ShuffleComponent.RightX, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(double4(5, 3, 6, 6), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftW, ShuffleComponent.RightZ, ShuffleComponent.RightZ)); + TestUtils.AreEqual(double4(6, 6, 7, 2), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.RightZ, ShuffleComponent.RightW, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(double4(4, 5, 2, 2), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightY, ShuffleComponent.LeftZ, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(double4(6, 1, 1, 0), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.LeftY, ShuffleComponent.LeftY, ShuffleComponent.LeftX)); + TestUtils.AreEqual(double4(4, 5, 5, 7), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightY, ShuffleComponent.RightY, ShuffleComponent.RightW)); + TestUtils.AreEqual(double4(1, 7, 0, 7), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.RightW, ShuffleComponent.LeftX, ShuffleComponent.RightW)); + TestUtils.AreEqual(double4(5, 0, 1, 0), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftX, ShuffleComponent.LeftY, ShuffleComponent.LeftX)); + TestUtils.AreEqual(double4(4, 7, 3, 1), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightW, ShuffleComponent.LeftW, ShuffleComponent.LeftY)); + TestUtils.AreEqual(double4(5, 4, 1, 4), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightX, ShuffleComponent.LeftY, ShuffleComponent.RightX)); + TestUtils.AreEqual(double4(0, 2, 6, 0), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.LeftZ, ShuffleComponent.RightZ, ShuffleComponent.LeftX)); + TestUtils.AreEqual(double4(2, 5, 7, 7), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.RightY, ShuffleComponent.RightW, ShuffleComponent.RightW)); + TestUtils.AreEqual(double4(3, 4, 2, 4), shuffle(a, b, ShuffleComponent.LeftW, ShuffleComponent.RightX, ShuffleComponent.LeftZ, ShuffleComponent.RightX)); + TestUtils.AreEqual(double4(4, 0, 2, 3), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftX, ShuffleComponent.LeftZ, ShuffleComponent.LeftW)); + TestUtils.AreEqual(double4(6, 4, 0, 5), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.RightX, ShuffleComponent.LeftX, ShuffleComponent.RightY)); + TestUtils.AreEqual(double4(3, 7, 1, 5), shuffle(a, b, ShuffleComponent.LeftW, ShuffleComponent.RightW, ShuffleComponent.LeftY, ShuffleComponent.RightY)); + } + + [TestCase /* For player builds */] + public static void double4_EqualsObjectOverride() + { + TestUtils.IsFalse(new double4().Equals((object)new int())); + TestUtils.IsTrue(new double4().Equals((object)new double4())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestDouble4.gen.cs.meta b/src/Tests/Tests/Shared/TestDouble4.gen.cs.meta new file mode 100644 index 00000000..47631bfc --- /dev/null +++ b/src/Tests/Tests/Shared/TestDouble4.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 872190ea505e35646b9b1e492b8316c7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestDouble4x2.gen.cs b/src/Tests/Tests/Shared/TestDouble4x2.gen.cs new file mode 100644 index 00000000..80b2e856 --- /dev/null +++ b/src/Tests/Tests/Shared/TestDouble4x2.gen.cs @@ -0,0 +1,952 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestDouble4x2 + { + [TestCompiler] + public static void double4x2_zero() + { + TestUtils.AreEqual(0.0, double4x2.zero.c0.x); + TestUtils.AreEqual(0.0, double4x2.zero.c0.y); + TestUtils.AreEqual(0.0, double4x2.zero.c0.z); + TestUtils.AreEqual(0.0, double4x2.zero.c0.w); + TestUtils.AreEqual(0.0, double4x2.zero.c1.x); + TestUtils.AreEqual(0.0, double4x2.zero.c1.y); + TestUtils.AreEqual(0.0, double4x2.zero.c1.z); + TestUtils.AreEqual(0.0, double4x2.zero.c1.w); + } + + [TestCompiler] + public static void double4x2_operator_equal_wide_wide() + { + double4x2 a0 = double4x2(492.15758275061728, -495.20632027797694, 227.45765195947968, -147.37405950733182, -222.68201909897942, 64.093720704360749, -23.890404473939157, -16.8197190839889); + double4x2 b0 = double4x2(192.56880888369346, -235.61102472786376, -254.04311740307281, -412.62472052715009, 471.90480945627428, -6.4727852374654162, -339.10237447316865, 488.1875700839737); + bool4x2 r0 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + double4x2 a1 = double4x2(163.23210890741655, -165.27101071424363, 470.87767980568003, -423.94255967808078, 109.63436918595539, 462.69031283943468, -335.38147727371262, 357.23446934168896); + double4x2 b1 = double4x2(-379.5965842584132, -308.41700258311675, -82.333374300195544, -102.92108087563935, 226.51573835430463, -356.90132896830391, -362.91277544708589, -427.89843746083716); + bool4x2 r1 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + double4x2 a2 = double4x2(1.5455777652308598, -347.38824741327585, -114.47217302884542, 435.84865804940864, 194.23808607563285, 138.76554710174241, -467.34914205379278, 370.43337767684523); + double4x2 b2 = double4x2(466.65013978753711, -102.79904680270658, -43.355954428834821, 85.045664111639212, -91.127054972167628, 422.19208856215334, -477.43130873024057, 1.8770024785198984); + bool4x2 r2 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + double4x2 a3 = double4x2(476.70826147343416, 320.55264702465047, -498.59197377534207, 92.4169581366782, 104.51136856177425, 166.75460608618084, -204.73343024250744, 434.75675674656259); + double4x2 b3 = double4x2(312.5800799394865, 254.59934365684137, 352.72583763335172, 62.490957050812881, 119.71476059766246, -511.05808639482507, -302.47273053902791, -371.76924365189359); + bool4x2 r3 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void double4x2_operator_equal_wide_scalar() + { + double4x2 a0 = double4x2(-303.2300766926399, 451.52631327674089, -253.65587413201848, -105.20363502632995, -500.6910920090466, -426.19248338518315, 159.87609656149334, -59.558379439431405); + double b0 = (123.5445759871717); + bool4x2 r0 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + double4x2 a1 = double4x2(-57.477391031327386, 406.51375861024189, 370.88599866017978, -172.03530629539642, 455.40001198993991, -11.338988547836891, 363.93823044557973, -27.150561106927); + double b1 = (-182.04973968400139); + bool4x2 r1 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + double4x2 a2 = double4x2(-325.97606507221985, 180.19686635779067, -374.12832015293105, -439.35894295170851, -126.54608899287234, -197.2617896521752, -227.15933357326281, -479.8991937487848); + double b2 = (-290.35904254129116); + bool4x2 r2 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + double4x2 a3 = double4x2(-439.77767750237962, -224.51705013239621, -422.83322616239695, -450.19627043707123, -20.106708774392814, 297.37999906082632, 185.9665759475746, -102.97598962810633); + double b3 = (-495.23734902555); + bool4x2 r3 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void double4x2_operator_equal_scalar_wide() + { + double a0 = (-253.39728534100453); + double4x2 b0 = double4x2(19.952187785856495, -185.79199346610903, 407.8136052600172, -87.2766969610363, -206.27469382354741, 160.503138855334, -274.77081478516141, -2.6315281403397535); + bool4x2 r0 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + double a1 = (448.35453602688131); + double4x2 b1 = double4x2(-410.03524251004461, 247.32901465489022, 355.53915350303942, -298.06671180299793, 414.10151429385951, -481.30262707234482, 196.55074438664633, 34.60100008668428); + bool4x2 r1 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + double a2 = (113.76156645350227); + double4x2 b2 = double4x2(-386.45337861890596, -124.49174672201821, 243.8866447153905, -492.6181826501238, 145.424413033493, 421.55070968230757, -95.409988209330493, 336.80928746648567); + bool4x2 r2 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + double a3 = (209.58380589707929); + double4x2 b3 = double4x2(487.441424358376, 161.80653365040507, 149.84247095409899, 225.723996505944, -71.21880176999548, 85.780251781353854, 192.547256797807, -49.887493395194156); + bool4x2 r3 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void double4x2_operator_not_equal_wide_wide() + { + double4x2 a0 = double4x2(430.8425316432689, 104.69001798736394, 225.80243478799355, -310.57017841496048, -418.61945815506363, 304.12820281839379, -509.32682561749908, -160.53807719076895); + double4x2 b0 = double4x2(210.02470622305975, -55.203330304102678, -269.92533672504373, -234.54673372700194, 25.917412054686565, -63.726991444699024, -484.55371092471933, -425.333599050219); + bool4x2 r0 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + double4x2 a1 = double4x2(-203.30197606016975, -505.76325368590807, 162.17220623892365, 1.1561973100324394, 65.662074358045174, 102.78780250567377, 172.93008120960098, 26.621009123800832); + double4x2 b1 = double4x2(-53.274394775402925, 328.1944192984115, 15.963139303011417, 461.71412417931208, -113.36304455313973, -240.07297264787974, 495.11916970420589, 203.5583661550462); + bool4x2 r1 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + double4x2 a2 = double4x2(235.12595259171258, 128.54198533321824, -354.99697630246959, 334.35948220564023, -495.83200692377613, 468.30740163675853, 458.37094733601941, 299.93733300824522); + double4x2 b2 = double4x2(340.49345103860526, -241.90719448863865, 459.56982896270688, 213.0737384357833, -384.7828506831, -255.07233846144396, 477.66343115161328, -248.03662621604121); + bool4x2 r2 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + double4x2 a3 = double4x2(43.12718560319729, -354.71349994964595, -145.28719551176169, 390.80186218340032, -303.13149108697263, 391.13459533785215, 139.2868607692825, 104.52318506339714); + double4x2 b3 = double4x2(-407.92344565313471, -199.78886971240343, 151.84326488889906, -97.120607659742518, 154.97589380805186, -172.83452065886672, 441.5027942329192, -401.73862785926957); + bool4x2 r3 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void double4x2_operator_not_equal_wide_scalar() + { + double4x2 a0 = double4x2(-16.914588697680529, 168.83411486858233, -462.71352145760949, 130.30776959765137, 214.50161443208424, -440.26328178879959, -197.12796053529155, -169.09985860115842); + double b0 = (-145.37277109239847); + bool4x2 r0 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + double4x2 a1 = double4x2(-386.61117595555783, -270.26885593601912, -403.96372313236992, -269.80570877241234, 299.65422763473089, -71.750904831919286, -432.75573917513515, -457.36312100727258); + double b1 = (-281.02101362916687); + bool4x2 r1 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + double4x2 a2 = double4x2(-13.519590622521719, 185.042454567292, -482.53069351731364, 116.39514427836764, 511.73495578753523, 230.50753628020527, 100.27476768394683, 129.68240863163135); + double b2 = (273.87305773136814); + bool4x2 r2 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + double4x2 a3 = double4x2(321.17879048044733, 140.33521921016984, 369.2123617461009, 453.81121489676241, -333.66624871532724, -373.93775218256644, 150.20429451307484, -442.16476627912596); + double b3 = (-220.63900409482375); + bool4x2 r3 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void double4x2_operator_not_equal_scalar_wide() + { + double a0 = (275.79582823244664); + double4x2 b0 = double4x2(-57.196896341255353, -382.4325279586169, 97.820359990848374, -161.46364529499022, -458.39563367254829, -499.61786364932448, 327.92217818271467, 367.57121699283425); + bool4x2 r0 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + double a1 = (59.7863667289663); + double4x2 b1 = double4x2(-209.58068118318016, -62.580453186566217, -479.97497604786184, -49.494519495169868, -114.68521338081229, 109.93924599044919, -176.28482755286842, -347.48529903380449); + bool4x2 r1 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + double a2 = (85.540928165214609); + double4x2 b2 = double4x2(-356.65954868712441, -104.24357490625397, -133.54918605347592, 243.53971135036079, 13.141311890045813, -379.98594754747393, -41.281226892620907, 87.911684792447659); + bool4x2 r2 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + double a3 = (-339.07727996403224); + double4x2 b3 = double4x2(-371.82034533648766, 333.14425936953364, 294.81196011920088, -187.14565977228136, 220.19225774528093, -228.18207250730234, -499.72373914146971, 97.4059055305114); + bool4x2 r3 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void double4x2_operator_less_wide_wide() + { + double4x2 a0 = double4x2(196.84256825076534, 336.40979997087732, 251.96372115424072, 257.65591466503963, 430.04588647840819, -62.419644146421774, 8.8392293494376872, -333.81671563434259); + double4x2 b0 = double4x2(-465.34502313348696, -256.15239751346053, -314.814018634527, 364.56673662949663, 100.21050290959442, 182.56098636545289, 3.116978885194726, -259.43047893207074); + bool4x2 r0 = bool4x2(false, false, false, true, false, true, false, true); + TestUtils.AreEqual(r0, a0 < b0); + + double4x2 a1 = double4x2(164.67880662003472, -350.94487516532877, 3.84143662631584, 125.40972024081725, -111.12994127680076, 70.005523475820951, 448.19828173527412, -419.98711200244122); + double4x2 b1 = double4x2(-437.33490749696966, -456.0437321402336, -394.2559718537405, 401.91369099259077, 313.43916454605721, 121.28668194696616, -28.012290729215522, -282.96589697663012); + bool4x2 r1 = bool4x2(false, false, false, true, true, true, false, true); + TestUtils.AreEqual(r1, a1 < b1); + + double4x2 a2 = double4x2(-258.30166757213965, -34.832201735504043, -69.859397682295821, 67.767227442826766, -139.77729207825723, 385.43464130229995, 133.707390609061, 506.18837117878184); + double4x2 b2 = double4x2(330.06440631023816, 124.09937077579059, -183.69031700104955, 373.0607623406969, 109.75094013556418, -203.57134232463841, 45.6486556742567, -360.95226280808089); + bool4x2 r2 = bool4x2(true, true, false, true, true, false, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + double4x2 a3 = double4x2(34.442885653322037, 412.11373896715872, -84.809773246203463, 444.78534504621541, -78.754743374304269, 366.97754376334024, 127.18045788965208, 428.36845489422251); + double4x2 b3 = double4x2(211.91309867236441, -313.28636207863985, -259.66108691862837, 79.0985401045059, 446.49610897828643, 450.52455660818362, -375.63076728192658, -53.941822792376286); + bool4x2 r3 = bool4x2(true, false, false, false, true, true, false, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void double4x2_operator_less_wide_scalar() + { + double4x2 a0 = double4x2(-132.05731708000292, -192.46500477216438, -66.834607870706634, -379.01750081545561, -360.28242199508588, 20.927834282129879, -158.24074537970159, 437.34587522845061); + double b0 = (-156.01021845452965); + bool4x2 r0 = bool4x2(false, true, false, true, true, false, true, false); + TestUtils.AreEqual(r0, a0 < b0); + + double4x2 a1 = double4x2(-20.452607402788772, 307.48418607725023, 274.01523292903562, 373.54965584983563, 398.52368301829495, 105.0301654827922, -58.010895994496934, 109.67008810381878); + double b1 = (225.29148517609178); + bool4x2 r1 = bool4x2(true, false, false, false, false, true, true, true); + TestUtils.AreEqual(r1, a1 < b1); + + double4x2 a2 = double4x2(-108.853174498702, 140.42607147080173, -500.08827638071415, 172.10334857371788, -197.50074610370245, -7.27149987559369, -432.99049898283113, 62.158315449095426); + double b2 = (-44.971252223929014); + bool4x2 r2 = bool4x2(true, false, true, false, true, false, true, false); + TestUtils.AreEqual(r2, a2 < b2); + + double4x2 a3 = double4x2(-72.254720959931035, -500.25573586870718, 149.1149638393498, 119.88061695912882, 202.63918909925928, 274.95066393304182, 66.4120323967245, 274.99944580486022); + double b3 = (-377.85232299279994); + bool4x2 r3 = bool4x2(false, true, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void double4x2_operator_less_scalar_wide() + { + double a0 = (-423.117411095238); + double4x2 b0 = double4x2(385.09483617595151, -123.93348532725753, 86.376572887588509, 133.44217378154497, 161.45794947513286, 229.75426660746064, 222.57159934871436, 315.53116360098647); + bool4x2 r0 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 < b0); + + double a1 = (-447.20351883731945); + double4x2 b1 = double4x2(271.83385790131695, -393.60531324595462, 317.48689737798964, -164.6051085761772, -282.87605370342544, 296.97953071118309, -254.40115582868509, 365.61562054493265); + bool4x2 r1 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 < b1); + + double a2 = (-441.98425671178114); + double4x2 b2 = double4x2(-131.42866021554391, 442.62897631275882, -29.792842163607872, -138.37379533535511, 9.2169721169476588, -226.7305482489665, 171.02944310523083, 376.62522595777421); + bool4x2 r2 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 < b2); + + double a3 = (-462.58872697436658); + double4x2 b3 = double4x2(-142.36729795409707, -456.25377414014832, 66.6102416825529, 169.37875779409831, 327.44439450253003, 64.0879266560487, -153.50390369887646, 199.38014921889646); + bool4x2 r3 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void double4x2_operator_greater_wide_wide() + { + double4x2 a0 = double4x2(483.50140141113729, 310.81563415695712, 106.9661896726891, 295.73526038589671, 116.95757179938141, -478.29977653841479, -14.897393471979228, -33.817441717636484); + double4x2 b0 = double4x2(-471.39802454011425, -371.98528617060992, 36.900723236101044, -316.76360407320954, 19.683055648432628, 207.3091381561519, 362.79748861994483, 324.95341816775192); + bool4x2 r0 = bool4x2(true, true, true, true, true, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + double4x2 a1 = double4x2(-24.740548383789417, 319.78262701620474, -120.15856581561201, -289.00857962714906, 455.85146662958505, 144.70691139283917, 63.931990891663304, -285.68304099034663); + double4x2 b1 = double4x2(340.94807140014507, 25.986035120666997, -114.2111352021858, 240.80346428640348, 273.42244757033063, 325.51576224226312, 27.341068995809678, 64.479532510265472); + bool4x2 r1 = bool4x2(false, true, false, false, true, false, true, false); + TestUtils.AreEqual(r1, a1 > b1); + + double4x2 a2 = double4x2(-502.0907201720824, -337.19446412529538, 474.31734274063137, -507.14510679018923, -133.56559735795742, -443.10913654934109, -464.34137056038776, -68.361549647693323); + double4x2 b2 = double4x2(200.94836983501375, 100.12266998184964, -79.00710896356361, -315.137945560337, -122.98542815213347, -163.77920229908972, -492.56600617457462, -90.797273439726439); + bool4x2 r2 = bool4x2(false, false, true, false, false, false, true, true); + TestUtils.AreEqual(r2, a2 > b2); + + double4x2 a3 = double4x2(-185.99299987870876, -157.80389340119615, -74.124229227250567, -94.471165939453613, 329.61055508703487, -315.83675280019486, 404.193811843262, 131.30440503512716); + double4x2 b3 = double4x2(-284.9012335673446, -23.653687249707843, 174.93002112905026, 85.7125366133231, -441.98783012944637, 345.54374210235835, 482.21949814363359, -422.38349719642827); + bool4x2 r3 = bool4x2(true, false, false, false, true, false, false, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void double4x2_operator_greater_wide_scalar() + { + double4x2 a0 = double4x2(64.317918092160426, -397.70346445483318, 431.87690826499693, 85.702980796668157, 246.26305233978803, 197.49155602114809, 286.1994608781298, 280.81334818564972); + double b0 = (305.85991992888034); + bool4x2 r0 = bool4x2(false, false, true, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + double4x2 a1 = double4x2(-405.78459210218148, -241.80727326209063, 333.57817498481745, 370.27919524269146, -413.70138116073861, -356.5923551789449, -353.03129522550444, 396.64532608382649); + double b1 = (171.56538661362856); + bool4x2 r1 = bool4x2(false, false, true, true, false, false, false, true); + TestUtils.AreEqual(r1, a1 > b1); + + double4x2 a2 = double4x2(467.22205541432936, 502.91505193287276, 315.46759024051369, -259.28970134411458, 281.23064554912537, 428.79219909608, 245.15306460352292, -279.17542494422543); + double b2 = (-240.0134228393498); + bool4x2 r2 = bool4x2(true, true, true, false, true, true, true, false); + TestUtils.AreEqual(r2, a2 > b2); + + double4x2 a3 = double4x2(-453.86309668694764, -425.65293451103054, 99.132852838902181, 355.0605339273161, -456.43941256796916, 154.48902208846482, 405.52974409867534, -157.73379643155903); + double b3 = (-124.77154856769909); + bool4x2 r3 = bool4x2(false, false, true, true, false, true, true, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void double4x2_operator_greater_scalar_wide() + { + double a0 = (-282.67049635698572); + double4x2 b0 = double4x2(358.09997360692353, -72.5964134077525, -232.16380106292843, -60.706723956720282, 75.156642710397364, 150.88350040786133, 339.53917924479538, -498.19602965665797); + bool4x2 r0 = bool4x2(false, false, false, false, false, false, false, true); + TestUtils.AreEqual(r0, a0 > b0); + + double a1 = (459.74610326241054); + double4x2 b1 = double4x2(-227.96872316485678, 335.86213485145106, 76.178844248959308, 296.85993899817572, 177.49000390688423, -281.20120657663847, 244.72285162877427, 137.32857257562159); + bool4x2 r1 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + double a2 = (-385.33824724021287); + double4x2 b2 = double4x2(443.16345879210326, -353.56254141105455, 26.040673983302327, -331.7939499969566, -43.691963454565041, 20.949428806523542, -211.17984423934473, 227.42171894173214); + bool4x2 r2 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + double a3 = (-84.7797711290325); + double4x2 b3 = double4x2(-375.13548701588786, -205.17813096064054, -197.04714617368165, -219.63402305340117, -210.01563344244641, -266.773715858708, 144.77848703450456, -471.71120069535039); + bool4x2 r3 = bool4x2(true, true, true, true, true, true, false, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void double4x2_operator_less_equal_wide_wide() + { + double4x2 a0 = double4x2(-438.52313753521219, 210.48942837980087, 4.8773329280677444, -137.29793817237857, 156.09410174009111, -363.92412035722475, -97.948485181642923, 437.29539009430232); + double4x2 b0 = double4x2(-474.8141498392514, 304.3710555063426, 234.8241737982371, -390.48543209139513, -297.17535295019638, -326.29239121372461, 107.2538764976216, -413.13107342884462); + bool4x2 r0 = bool4x2(false, true, true, false, false, true, true, false); + TestUtils.AreEqual(r0, a0 <= b0); + + double4x2 a1 = double4x2(458.53029153241323, -294.06474675520542, 23.622613679441884, -34.284056441059363, 149.736484835733, -418.8866781754823, -197.50252899783783, -88.2055118494693); + double4x2 b1 = double4x2(67.094432623635271, 470.07522724106684, -84.499104777583455, 392.78422683886447, -263.53175485484849, 369.30090039284005, -333.32529298091555, 238.41347443238533); + bool4x2 r1 = bool4x2(false, true, false, true, false, true, false, true); + TestUtils.AreEqual(r1, a1 <= b1); + + double4x2 a2 = double4x2(-376.71814292330208, 341.62712899857536, -83.309179106405566, -107.49073295830317, 319.46688833807912, 205.35738501574724, 345.56372968552807, 395.32190746596177); + double4x2 b2 = double4x2(486.24259279959028, 279.65021408705513, 236.05201803709008, 132.75898248178839, 66.294708998079727, 183.00210699020056, 200.13055071613314, 339.043800750302); + bool4x2 r2 = bool4x2(true, false, true, true, false, false, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + double4x2 a3 = double4x2(-222.87415490992095, 439.02200790821666, -368.0755667016262, -200.03860173003682, 71.46990660180802, -357.36542932939039, 141.7108519737194, 319.0170969064427); + double4x2 b3 = double4x2(438.53791710293751, 145.40187866306019, 178.16310199450845, 157.97596724237133, 329.7052015409364, -243.59091221708383, 5.4011614347813293, -22.580605278993289); + bool4x2 r3 = bool4x2(true, false, true, true, true, true, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void double4x2_operator_less_equal_wide_scalar() + { + double4x2 a0 = double4x2(193.4958237118534, 168.91555197952107, -313.9930695565385, 81.826965131716292, 18.503590830836288, -0.35819602029312136, 241.36115776810846, -463.81641242644582); + double b0 = (443.85054299042122); + bool4x2 r0 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + double4x2 a1 = double4x2(-1.3577692515020203, 398.9919504593089, -471.253072242836, -264.93778264938749, 82.258299150624453, 11.246050124636895, 424.7040156911612, 426.48223157715154); + double b1 = (-268.89945591096739); + bool4x2 r1 = bool4x2(false, false, true, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 <= b1); + + double4x2 a2 = double4x2(56.319978501796754, 31.901173844887467, -152.2575724833913, -437.92645975478297, -37.104814785115821, -47.144214413661587, 333.6230348710078, -274.80387438219225); + double b2 = (-196.28791126808522); + bool4x2 r2 = bool4x2(false, false, false, true, false, false, false, true); + TestUtils.AreEqual(r2, a2 <= b2); + + double4x2 a3 = double4x2(358.67627804292192, 192.30916008367626, 145.30606777281787, -466.13296363602063, -494.26732968458316, -111.57013922164691, -139.54120332540072, -146.58935148389514); + double b3 = (-260.46056926458169); + bool4x2 r3 = bool4x2(false, false, false, true, true, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void double4x2_operator_less_equal_scalar_wide() + { + double a0 = (393.60626644343427); + double4x2 b0 = double4x2(-75.688363825757222, -44.2638714519627, 125.86491566797019, 191.96488174794467, 13.543054825413492, -197.0519259893577, -423.945100743298, -330.04861680141119); + bool4x2 r0 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 <= b0); + + double a1 = (420.16553779140372); + double4x2 b1 = double4x2(105.54730777887039, 174.82126363311954, 296.71757831085358, -469.70041845259277, 123.26718979853536, 112.9969695140594, 495.14339493920249, -488.65789364681478); + bool4x2 r1 = bool4x2(false, false, false, false, false, false, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + double a2 = (388.53941148730894); + double4x2 b2 = double4x2(-493.24077080806751, 16.451064832718657, -387.6516336815672, -229.1773127192526, -373.01533930982248, -391.142134610164, 90.994149488859875, -178.39613517485378); + bool4x2 r2 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + double a3 = (-69.621067317957568); + double4x2 b3 = double4x2(471.7908458522478, -67.4667532758167, 45.305359623071467, -154.69219000390365, 385.73888248286153, -431.652945004242, -331.67304841227508, -349.89271013340573); + bool4x2 r3 = bool4x2(true, true, true, false, true, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void double4x2_operator_greater_equal_wide_wide() + { + double4x2 a0 = double4x2(-507.92858409692, 504.49748181947393, -385.43449205226938, -262.32340944107784, -37.550928848586466, -111.59527759980193, -463.70202157632542, 387.44885772627265); + double4x2 b0 = double4x2(-81.346509732933043, 297.66615047010885, 171.06540616371922, -431.03805538222105, -6.859075311040101, 319.72570362674333, 254.079170106947, 396.5724000393285); + bool4x2 r0 = bool4x2(false, true, false, true, false, false, false, false); + TestUtils.AreEqual(r0, a0 >= b0); + + double4x2 a1 = double4x2(456.96878573716094, -211.01015506079892, 182.41135391146474, -53.596053863687473, -309.57021608463032, -136.02249127999994, 280.73629082401112, -96.9958942388165); + double4x2 b1 = double4x2(178.83927615864172, -447.06336304501787, 288.49268569075161, 474.88929460704765, -321.75022831640683, -395.97722048125104, -158.69246037243516, 391.48869318118727); + bool4x2 r1 = bool4x2(true, true, false, false, true, true, true, false); + TestUtils.AreEqual(r1, a1 >= b1); + + double4x2 a2 = double4x2(-174.05950673579213, 88.9019382413951, 43.816040774721728, -446.07842585354967, 16.645595796706857, 409.83252043734888, -191.32987245886113, 222.99782548798146); + double4x2 b2 = double4x2(-368.10924141859135, 89.1238043723273, -510.27932214656812, -486.92979525352354, -81.215552606254619, 274.21882046117389, -212.88155494112596, 288.99530591117); + bool4x2 r2 = bool4x2(true, false, true, true, true, true, true, false); + TestUtils.AreEqual(r2, a2 >= b2); + + double4x2 a3 = double4x2(404.28838915577546, 230.60328136691976, -441.78928228923553, -86.293056289801882, 484.24954413075443, 95.2363665547391, -204.91210255628084, -199.77434620623211); + double4x2 b3 = double4x2(307.73173131967508, 307.24516620638087, -199.39178213821339, -284.42126978767163, -482.39181278757371, 448.3157362641374, -378.3461889598268, -390.8584684761513); + bool4x2 r3 = bool4x2(true, false, false, true, true, false, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void double4x2_operator_greater_equal_wide_scalar() + { + double4x2 a0 = double4x2(465.15218732559686, -424.8860745024337, -209.22109685150025, 58.779852656079356, -302.26910533675414, 140.12558252183976, 16.353385694489475, -344.55997316192838); + double b0 = (-5.5998842742293391); + bool4x2 r0 = bool4x2(true, false, false, true, false, true, true, false); + TestUtils.AreEqual(r0, a0 >= b0); + + double4x2 a1 = double4x2(393.27804846003562, 441.0115565923096, -509.78156757251435, -36.994287269652943, 494.82028865014217, -164.97393830352183, -466.12009046325466, -123.8137477020797); + double b1 = (-315.70155086913218); + bool4x2 r1 = bool4x2(true, true, false, true, true, true, false, true); + TestUtils.AreEqual(r1, a1 >= b1); + + double4x2 a2 = double4x2(215.65121779947128, 314.34603014325069, 190.51609882643265, -83.111429014760745, -23.836435567511444, 143.04935962662535, -264.91997945724052, -169.70222457205051); + double b2 = (104.99569730879534); + bool4x2 r2 = bool4x2(true, true, true, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + double4x2 a3 = double4x2(329.70751610850334, -260.42331016269668, 354.19514219565087, -111.84533768140028, 33.309096113456917, 355.63126938214123, -435.36056753404466, -38.39930893778768); + double b3 = (359.09582035573931); + bool4x2 r3 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void double4x2_operator_greater_equal_scalar_wide() + { + double a0 = (374.82703393270594); + double4x2 b0 = double4x2(-1.609757185731894, 338.61524049314448, -116.18140392945213, -332.15732375353451, -355.9793509710484, -468.90144107719021, 38.579884785497484, -332.34754697063357); + bool4x2 r0 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + double a1 = (2.8901150240051265); + double4x2 b1 = double4x2(467.77776477661814, 121.40638762405445, -305.02337303060267, -58.428812292604164, -226.51955209789776, -47.020994446715804, 305.3026770582901, -427.40123315686418); + bool4x2 r1 = bool4x2(false, false, true, true, true, true, false, true); + TestUtils.AreEqual(r1, a1 >= b1); + + double a2 = (92.263649745035764); + double4x2 b2 = double4x2(-497.17853736187266, -408.62564225151465, -455.23049113491106, 396.42608637196292, -469.29488561548987, -485.7540130493017, -182.34619268325446, -291.54536284671417); + bool4x2 r2 = bool4x2(true, true, true, false, true, true, true, true); + TestUtils.AreEqual(r2, a2 >= b2); + + double a3 = (278.740809331993); + double4x2 b3 = double4x2(-75.87113932327884, 28.907059921374071, 287.72014988945807, 420.50978990109161, 473.62684152723614, 181.514540518408, -369.20287220981106, 243.74977385427326); + bool4x2 r3 = bool4x2(true, true, false, false, false, true, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void double4x2_operator_add_wide_wide() + { + double4x2 a0 = double4x2(506.12905263627374, -501.77980803967444, 420.08479638587903, -186.03206476291274, -9.3123953385801883, 328.51179686585056, 424.34407659263536, 87.791079800478656); + double4x2 b0 = double4x2(-28.757987751047096, -337.135153689019, -340.676816860529, 152.31202633320913, 423.66745420157326, 90.374096674087468, 376.18866246574964, 1.7671887882831925); + double4x2 r0 = double4x2(477.37106488522664, -838.91496172869347, 79.407979525350015, -33.720038429703607, 414.35505886299308, 418.885893539938, 800.532739058385, 89.558268588761848); + TestUtils.AreEqual(r0, a0 + b0); + + double4x2 a1 = double4x2(462.41368148402012, -46.178705952213477, 401.17006296718966, -454.12414643453627, 69.195687564646732, -177.95734485329939, 299.60415544156183, 340.7048587001417); + double4x2 b1 = double4x2(-120.18586045139745, -279.62936628965167, -344.66710273580026, 242.8391956029642, 418.5930504363929, -23.312797318823982, -95.099945827899489, 147.92812568877275); + double4x2 r1 = double4x2(342.22782103262267, -325.80807224186515, 56.502960231389409, -211.28495083157208, 487.78873800103963, -201.27014217212337, 204.50420961366234, 488.63298438891445); + TestUtils.AreEqual(r1, a1 + b1); + + double4x2 a2 = double4x2(219.91602740991675, -321.90838232725321, 286.35534037573041, -333.41949311523672, -118.93216973120911, 68.607509406566351, 23.190902005504313, -205.57787547147734); + double4x2 b2 = double4x2(331.03287926830023, -82.502564230236487, 279.44956291813844, 342.6227215931857, -300.35853185335105, -209.69408736456842, 446.55942150883345, -351.98918955027557); + double4x2 r2 = double4x2(550.948906678217, -404.41094655748969, 565.80490329386885, 9.2032284779489828, -419.29070158456017, -141.08657795800207, 469.75032351433777, -557.56706502175291); + TestUtils.AreEqual(r2, a2 + b2); + + double4x2 a3 = double4x2(11.521422629953122, -340.7950796283759, -68.931167873056211, 304.8532370556394, -86.633841316510825, 105.66915874633435, 349.28052799277032, 364.7078708916473); + double4x2 b3 = double4x2(-263.12385642860261, -252.4585670216282, 289.82535542632706, 338.79615537207394, -232.61900364263869, -510.50825405051387, 349.2807325559113, -426.2124495106807); + double4x2 r3 = double4x2(-251.60243379864949, -593.25364665000416, 220.89418755327085, 643.64939242771334, -319.25284495914951, -404.83909530417952, 698.56126054868162, -61.504578619033396); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void double4x2_operator_add_wide_scalar() + { + double4x2 a0 = double4x2(-194.51420387742769, 338.54838696985894, 246.97140252169754, 100.51093797595752, -45.724677822424439, -478.11131094308166, 30.916145577522116, 60.37435224483454); + double b0 = (124.121678171736); + double4x2 r0 = double4x2(-70.3925257056917, 462.67006514159493, 371.09308069343354, 224.63261614769351, 78.397000349311554, -353.98963277134567, 155.03782374925811, 184.49603041657053); + TestUtils.AreEqual(r0, a0 + b0); + + double4x2 a1 = double4x2(-242.1187475855084, 6.7993848355483806, -484.69981287638649, -188.26501068298938, -213.52673087526426, -267.78430688929944, 189.25996669999324, 198.53359684652355); + double b1 = (82.50134495762245); + double4x2 r1 = double4x2(-159.61740262788595, 89.300729793170831, -402.19846791876404, -105.76366572536693, -131.02538591764181, -185.282961931677, 271.76131165761569, 281.034941804146); + TestUtils.AreEqual(r1, a1 + b1); + + double4x2 a2 = double4x2(187.53610023648298, 302.10236730338181, 300.39907970111778, 124.02158909850823, -200.16134295247559, 31.37822701007974, 362.52213518811493, -423.98885961248953); + double b2 = (-424.92567582844089); + double4x2 r2 = double4x2(-237.38957559195791, -122.82330852505908, -124.5265961273231, -300.90408672993266, -625.08701878091642, -393.54744881836115, -62.403540640325957, -848.91453544093042); + TestUtils.AreEqual(r2, a2 + b2); + + double4x2 a3 = double4x2(432.41331907380993, -465.69948957194549, -311.04303779781003, 84.918990413154916, -432.44245716204978, 235.75065886031405, -472.63775394514096, -257.57773721291579); + double b3 = (374.21141474983256); + double4x2 r3 = double4x2(806.62473382364249, -91.488074822112935, 63.168376952022527, 459.13040516298747, -58.231042412217221, 609.9620736101466, -98.4263391953084, 116.63367753691676); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void double4x2_operator_add_scalar_wide() + { + double a0 = (-340.35468284243473); + double4x2 b0 = double4x2(511.36225652665007, -146.21663791789518, -106.21042661844308, -363.45024960276214, 199.08958325120136, -27.108407271610758, 419.84900041103788, 284.95503748811552); + double4x2 r0 = double4x2(171.00757368421534, -486.57132076032991, -446.56510946087781, -703.80493244519687, -141.26509959123337, -367.46309011404549, 79.494317568603151, -55.399645354319205); + TestUtils.AreEqual(r0, a0 + b0); + + double a1 = (-164.92418129971446); + double4x2 b1 = double4x2(-249.19032561461921, 150.92817718858282, 298.17509784278229, -457.15341803857751, 424.71807094324288, -301.85750283946163, 230.28885208363124, -423.58759351428023); + double4x2 r1 = double4x2(-414.11450691433367, -13.99600411113164, 133.25091654306783, -622.077599338292, 259.79388964352842, -466.78168413917609, 65.364670783916779, -588.51177481399463); + TestUtils.AreEqual(r1, a1 + b1); + + double a2 = (-67.060037882560891); + double4x2 b2 = double4x2(68.7241366229598, -164.02241833695325, 318.93515339444161, 7.8045504129512437, 187.69836029210046, -3.6569664495331153, -446.0830535581722, -209.28724227160552); + double4x2 r2 = double4x2(1.6640987403989129, -231.08245621951414, 251.87511551188072, -59.255487469609648, 120.63832240953957, -70.717004332094, -513.14309144073309, -276.34728015416641); + TestUtils.AreEqual(r2, a2 + b2); + + double a3 = (-38.212905186327589); + double4x2 b3 = double4x2(-346.25717870623674, 465.60741708502519, -192.18595108398512, 278.69379843338106, 381.97845548297209, 481.24367283342576, -97.228162095522578, -455.51374289743313); + double4x2 r3 = double4x2(-384.47008389256433, 427.3945118986976, -230.39885627031271, 240.48089324705347, 343.76555029664451, 443.03076764709817, -135.44106728185017, -493.72664808376072); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void double4x2_operator_sub_wide_wide() + { + double4x2 a0 = double4x2(160.4922617229131, 11.223957305412682, 359.20010607279846, -498.22830485656311, -355.25362913462038, -94.534852787170053, -410.46404786150163, -401.38464398001537); + double4x2 b0 = double4x2(115.46876078260539, -130.98230630298252, 241.54083716196044, 9.9870860623135513, 419.89512582304656, 59.124466208333388, -402.38163847587145, -75.370143687059226); + double4x2 r0 = double4x2(45.023500940307713, 142.2062636083952, 117.65926891083802, -508.21539091887666, -775.14875495766694, -153.65931899550344, -8.0824093856301715, -326.01450029295614); + TestUtils.AreEqual(r0, a0 - b0); + + double4x2 a1 = double4x2(317.70681944382693, 447.0604133303558, -489.07414482956477, -230.00838218909149, 24.875419389864192, 366.61447136784648, -107.3741567634857, -219.0081404275299); + double4x2 b1 = double4x2(320.97960796997859, -73.908757482612884, -31.444742455819949, -389.25194734579509, -375.02884000122026, 259.18275821357167, 276.648654351313, -453.06919905779381); + double4x2 r1 = double4x2(-3.2727885261516576, 520.96917081296874, -457.62940237374482, 159.2435651567036, 399.90425939108445, 107.4317131542748, -384.02281111479869, 234.06105863026391); + TestUtils.AreEqual(r1, a1 - b1); + + double4x2 a2 = double4x2(473.90756891384137, 259.63620793988753, -360.119631219711, 7.8096120393879573, 437.42847439154446, -59.1991718091067, 418.74433322378638, 183.14215072576985); + double4x2 b2 = double4x2(-272.57653225240136, -191.14805301984217, 87.136884968325944, 430.02477594373033, 343.65711538105143, 121.02942067060133, -354.1881703595576, 249.05200373802893); + double4x2 r2 = double4x2(746.48410116624268, 450.78426095972969, -447.25651618803693, -422.21516390434238, 93.771359010493029, -180.22859247970803, 772.932503583344, -65.909853012259077); + TestUtils.AreEqual(r2, a2 - b2); + + double4x2 a3 = double4x2(271.23036516421962, 496.20853709439211, 165.35493691514944, -227.40367113212295, -166.52285702830312, 356.14227430715334, 386.92636579411396, -394.63875717420075); + double4x2 b3 = double4x2(-2.2254426489702723, 22.447240601502017, 478.1129555544411, -320.0629958212669, -111.52409534879217, 222.22894607401872, -245.41106307013473, -119.90228348593337); + double4x2 r3 = double4x2(273.45580781318989, 473.7612964928901, -312.75801863929166, 92.659324689143943, -54.998761679510949, 133.91332823313462, 632.33742886424875, -274.73647368826738); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void double4x2_operator_sub_wide_scalar() + { + double4x2 a0 = double4x2(207.38960108877609, 248.45773684627272, -384.82393211164697, -205.34476122881506, -374.81156152058929, 191.64204820973896, 18.856238135535364, -44.96160151667965); + double b0 = (-36.112476604111691); + double4x2 r0 = double4x2(243.50207769288778, 284.57021345038441, -348.71145550753528, -169.23228462470337, -338.6990849164776, 227.75452481385065, 54.968714739647055, -8.8491249125679587); + TestUtils.AreEqual(r0, a0 - b0); + + double4x2 a1 = double4x2(480.85798738936796, -366.86545269883493, -35.523088233323335, 349.39776460705218, 439.07729336203886, 490.2222661870635, 195.02405104181923, -384.84940952102158); + double b1 = (16.338193185784917); + double4x2 r1 = double4x2(464.51979420358305, -383.20364588461985, -51.861281419108252, 333.05957142126726, 422.73910017625394, 473.88407300127858, 178.68585785603432, -401.1876027068065); + TestUtils.AreEqual(r1, a1 - b1); + + double4x2 a2 = double4x2(189.05188545447402, -54.931482579061537, 53.088051582261983, 316.80250730961677, -273.80670917863335, 256.88723695319482, 297.17363156805447, 101.82901363346218); + double b2 = (55.602777745389744); + double4x2 r2 = double4x2(133.44910770908427, -110.53426032445128, -2.5147261631277615, 261.199729564227, -329.4094869240231, 201.28445920780507, 241.57085382266473, 46.226235888072438); + TestUtils.AreEqual(r2, a2 - b2); + + double4x2 a3 = double4x2(136.60794765157993, 336.58969966349639, -51.876563334780087, 317.34576311583896, -467.05592773251976, -50.167055391784345, 477.804535373023, -60.821922092149919); + double b3 = (-19.732211837420323); + double4x2 r3 = double4x2(156.34015948900026, 356.32191150091671, -32.144351497359764, 337.07797495325929, -447.32371589509944, -30.434843554364022, 497.53674721044331, -41.089710254729596); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void double4x2_operator_sub_scalar_wide() + { + double a0 = (-86.008225719448262); + double4x2 b0 = double4x2(466.42511413359318, 298.48694219183506, -300.95010652251085, 315.38003006362362, -381.09218543632522, -125.00837546447684, 58.466194418476107, 214.74609361158036); + double4x2 r0 = double4x2(-552.43333985304139, -384.49516791128332, 214.94188080306259, -401.38825578307188, 295.08395971687696, 39.00014974502858, -144.47442013792437, -300.75431933102863); + TestUtils.AreEqual(r0, a0 - b0); + + double a1 = (-257.54942739082009); + double4x2 b1 = double4x2(480.22459505508868, -443.35507723472784, 260.79503858312728, 29.681931747906788, 139.85773164586055, -247.78996216868512, -248.4662297929014, 91.445112509394562); + double4x2 r1 = double4x2(-737.77402244590871, 185.80564984390776, -518.34446597394731, -287.23135913872687, -397.40715903668064, -9.7594652221349634, -9.0831975979186836, -348.99453990021465); + TestUtils.AreEqual(r1, a1 - b1); + + double a2 = (86.384162704639266); + double4x2 b2 = double4x2(373.81828206303453, 260.41195428576873, 114.35393171867076, -464.40545318294573, -109.74146156652898, -311.67535057276268, 107.86401586787031, -258.7951592219971); + double4x2 r2 = double4x2(-287.43411935839526, -174.02779158112946, -27.9697690140315, 550.789615887585, 196.12562427116825, 398.05951327740195, -21.479853163231041, 345.17932192663636); + TestUtils.AreEqual(r2, a2 - b2); + + double a3 = (14.097560173877355); + double4x2 b3 = double4x2(-461.97019527012958, 30.310863747406188, 63.701105862716759, -462.67674634544028, 39.759483117498235, 47.998150132595583, -177.61928113625351, 202.47706017386031); + double4x2 r3 = double4x2(476.06775544400693, -16.213303573528833, -49.603545688839404, 476.77430651931763, -25.66192294362088, -33.900589958718228, 191.71684131013086, -188.37949999998295); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void double4x2_operator_mul_wide_wide() + { + double4x2 a0 = double4x2(-482.71381710596097, -407.29348559272171, 137.70058995937029, 208.54113278563182, 194.296573967811, -484.24241684574747, 183.98730739578014, -241.33547770294149); + double4x2 b0 = double4x2(-236.36788355389979, 260.72759139757954, -416.38629718142852, -364.49561541364324, -253.14750897751537, -369.20287220981106, 193.54791531038836, 169.08491976982214); + double4x2 r0 = double4x2(114098.04331156026, -106192.64949051509, -57336.638772880389, -76012.328533757158, -49185.69370281692, 178783.69114527057, 35610.359790024842, -40806.189885013562); + TestUtils.AreEqual(r0, a0 * b0); + + double4x2 a1 = double4x2(45.868758938214114, 363.32610266438041, -328.11893692990714, -471.02307413100408, -262.68257415605831, -379.26274674910246, -374.09058182970182, 481.44738720424812); + double4x2 b1 = double4x2(201.96966442930034, 249.45608317547294, -308.19319810913555, -385.57964843585137, -183.27959522198864, 22.275629292370581, -265.52144229855458, -95.677454277722859); + double4x2 r1 = double4x2(9264.0978505395742, 90633.9064860661, 101124.02453259782, 181616.91132860651, 48144.355863192381, -8448.3163509892329, 99329.070837727879, -46063.660376363579); + TestUtils.AreEqual(r1, a1 * b1); + + double4x2 a2 = double4x2(104.62807397946165, 412.93539948618752, 477.87724731763694, 20.377821216535722, 291.99596299417124, -138.48832399141429, -393.46498483860165, 9.36312318284206); + double4x2 b2 = double4x2(133.25437146669924, 148.31146080247663, 249.284127113076, 500.00547503866505, -19.331578978957396, -36.691062705913112, 30.5238278054278, -401.36701054189678); + double4x2 r2 = double4x2(13942.148235904471, 61243.052314850727, 119127.21246477668, 10189.022177626932, -5644.7430201585421, 5081.2837796057929, -12010.057444678736, -3758.048761232847); + TestUtils.AreEqual(r2, a2 * b2); + + double4x2 a3 = double4x2(-131.94228917543882, 364.44964258952518, 390.61597866128011, 418.79794974755396, -277.34480942289565, 11.410165553637853, 474.87644956767394, -502.40503358394142); + double4x2 b3 = double4x2(3.4372422711165882, 257.24176681099539, -290.97193516929258, 337.47938100317469, 490.28616284312966, -191.01981481864107, -325.73449650673871, -52.181983733634468); + double4x2 r3 = double4x2(-453.51761370170692, 93751.669973365249, -113658.28721911977, 141335.67284620318, -135978.32239641057, -2179.56771110594, -154683.64120283397, 26216.491290173308); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void double4x2_operator_mul_wide_scalar() + { + double4x2 a0 = double4x2(-96.318821236639678, -277.14229239017811, -239.93690191951436, 509.53140544776409, 255.85810172551226, 215.73149667295229, -455.50827500573746, -389.24327367788334); + double b0 = (-301.20720424373042); + double4x2 r0 = double4x2(29011.922860739887, 83477.255068544036, 72270.723422079071, -153474.5301092997, -77066.303503849529, -64979.880980175592, 137202.37402436248, 117242.87823519246); + TestUtils.AreEqual(r0, a0 * b0); + + double4x2 a1 = double4x2(-338.29248658674419, 243.75734459783757, 135.35469991311186, -207.35010275959507, -383.93960946795517, -31.425238862366086, 42.676120539510634, 260.38388049806645); + double b1 = (53.796284939067618); + double4x2 r1 = double4x2(-18198.879001166202, 13113.239565975766, 7281.5800043677564, -11154.665210200128, -20654.52463033246, -1690.5611041181071, 2295.81674063751, 14007.685428814115); + TestUtils.AreEqual(r1, a1 * b1); + + double4x2 a2 = double4x2(176.86755927692525, -290.50059689697838, 207.09101805793637, -156.52330858843555, -208.4020064847553, 370.94506400215676, -341.59844247512444, 10.270311121954705); + double b2 = (25.672123205695357); + double4x2 r2 = double4x2(4540.5657728478518, -7457.7671148672716, 5316.4661303762241, -4018.2856626453918, -5350.1219867907612, 9522.9473856079185, -8769.5573020950324, 263.66069248364448); + TestUtils.AreEqual(r2, a2 * b2); + + double4x2 a3 = double4x2(-176.88876565587185, 186.27978214355176, -487.65221785365242, -129.37681800191143, -317.71628990663044, -207.62735686433842, 388.87138933170183, -233.33533274072005); + double b3 = (-61.006107120311867); + double4x2 r3 = double4x2(10791.294985981862, -11364.204343797875, 29749.763439837578, 7892.7760179097013, 19382.634015911957, 12666.53677397305, -23723.529633594302, 14234.88030413398); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void double4x2_operator_mul_scalar_wide() + { + double a0 = (37.432166355397612); + double4x2 b0 = double4x2(96.747546479454058, 492.18539427788244, -274.05458534604617, -452.87096926796761, 420.85330434369541, 102.18292694081686, -114.94887762654054, -351.12003843445336); + double4x2 r0 = double4x2(3621.4702542954869, 18423.565556306661, -10258.456829132712, -16951.941459168724, 15753.450899411988, 3824.9283199300971, -4302.785509682908, -13143.183689392061); + TestUtils.AreEqual(r0, a0 * b0); + + double a1 = (-464.66496799172131); + double4x2 b1 = double4x2(444.08484646495663, 447.10525605040846, 130.82935124767448, -321.41334191030512, 445.30131861441828, 478.24357317306271, 358.57170622356784, -144.89011222910608); + double4x2 r1 = double4x2(-206350.67096824755, -207754.14949159342, -60791.816309878326, 149349.52023086412, -206915.92296063996, -222223.03462070762, -166615.71039511106, 67325.359361254479); + TestUtils.AreEqual(r1, a1 * b1); + + double a2 = (-438.89383741789209); + double4x2 b2 = double4x2(-3.536441089369589, -471.80755470311624, -42.560401697904069, 119.91104155402218, 271.9000023677479, 239.6840079946835, 487.44143389511919, -79.188288010278825); + double4x2 r2 = double4x2(1552.1222005157297, 207073.42820640272, 18679.498023240089, -52628.217176421109, -119335.23543311482, -105195.83403648737, -213935.04143870863, 34755.251603384531); + TestUtils.AreEqual(r2, a2 * b2); + + double a3 = (-112.92564468873928); + double4x2 b3 = double4x2(161.3700478828373, 459.75914332818195, -337.19599811043406, -276.83451689259823, 469.72386405883537, -274.56515110403541, 506.78586625810055, 65.882571966332648); + double4x2 r3 = double4x2(-18222.81669062213, -51918.597661877429, 38078.075473083678, 31261.716292192341, -53043.870174529715, 31005.446697484316, -57229.120666337207, -7439.831913050376); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void double4x2_operator_div_wide_wide() + { + double4x2 a0 = double4x2(-353.13144390337703, -102.79985456485292, 51.319128298814917, -191.87167868012176, 8.0418245829836223, -128.73764210973758, -136.05959779399427, -370.4710053738537); + double4x2 b0 = double4x2(-178.73954805114283, -302.09628381491467, -199.40583739029518, 278.85077561012042, 502.33758782890516, -361.48483078623417, 353.121059820578, -38.894930142394685); + double4x2 r0 = double4x2(1.97567604793504, 0.34028837848212429, -0.25736021056579439, -0.68808013268139567, 0.016008805189634039, 0.35613566917796119, -0.3853058151307277, 9.5249176182488586); + TestUtils.AreEqual(r0, a0 / b0); + + double4x2 a1 = double4x2(-237.69456326109105, -432.54687496300176, 200.26549181727012, 361.44157068871039, -416.22613234828509, -450.01919362042992, -273.49744594911925, -286.90817011841955); + double4x2 b1 = double4x2(-75.764737402910725, -195.21784719974636, -405.03399224068687, -394.2300085473014, -375.82771342612227, -121.24548655433836, 447.623344391409, 338.28628007429018); + double4x2 r1 = double4x2(3.1372716570909582, 2.2157137842034547, -0.49444119667433889, -0.9168291678773689, 1.1074918572499153, 3.7116366671409717, -0.61099906735420106, -0.84812239519560884); + TestUtils.AreEqual(r1, a1 / b1); + + double4x2 a2 = double4x2(-314.25606241554772, 177.76210340194507, 97.626988217992221, -68.107280047660367, -386.45074027890837, 263.69934690357161, -297.0270885420158, -501.77703046322659); + double4x2 b2 = double4x2(-405.54420752336466, -431.16893526127978, 296.20513095343722, 437.939790691221, 39.21061684527001, 331.2897075765253, -310.61955156485533, 207.26946959610541); + double4x2 r2 = double4x2(0.77489964493560781, -0.41227947763496636, 0.32959249525403717, -0.15551745124635385, -9.855767936625206, 0.79597808465769837, 0.95624080018671487, -2.420892143165184); + TestUtils.AreEqual(r2, a2 / b2); + + double4x2 a3 = double4x2(-263.40686071263946, -451.08085248017721, -416.34552903489464, -315.27873411554788, -28.181118739853218, -397.87015146662952, -261.38664376986526, 40.348221559239619); + double4x2 b3 = double4x2(-223.2929938879297, -480.091406807346, 448.67593666942605, -460.0974516626901, -220.56984601755153, -84.853158275062754, 441.3738078742166, 72.418480191574645); + double4x2 r3 = double4x2(1.1796467776541293, 0.93957285234474042, -0.92794263076704353, 0.68524338262731188, 0.12776505605218016, 4.6889256635195675, -0.59221149761645042, 0.55715366371267527); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void double4x2_operator_div_wide_scalar() + { + double4x2 a0 = double4x2(171.34242184988341, 0.10338377957384637, 57.888263967767443, -256.13074529177078, 95.6696842162263, -290.38690461329509, -127.44869118903239, -79.7448890580539); + double b0 = (171.79682191265601); + double4x2 r0 = double4x2(0.99735501473360411, 0.00060177934855167557, 0.33695771157628673, -1.4908933846400916, 0.55687691513214455, -1.6902926455818372, -0.74185709473618289, -0.46418139852783397); + TestUtils.AreEqual(r0, a0 / b0); + + double4x2 a1 = double4x2(146.46688110496234, 58.686315802245531, -453.20579859856787, -205.03382143985192, 481.73814247629514, 464.47907159499778, -293.46349753693841, -158.50557930697948); + double b1 = (-499.84355687529012); + double4x2 r1 = double4x2(-0.29302544584265894, -0.11740936738109768, 0.906695289685692, 0.41019598756377973, -0.96377783778552883, -0.92924889239071318, 0.587110693936897, 0.31711037809081188); + TestUtils.AreEqual(r1, a1 / b1); + + double4x2 a2 = double4x2(-289.5822156824089, 203.58342680874443, 180.97040160976837, 259.11918723728468, 460.84470603468117, 490.95625924084163, -280.47805536933151, -320.24387112271222); + double b2 = (494.12860535743118); + double4x2 r2 = double4x2(-0.58604624897791069, 0.41200494082199718, 0.3662414999812898, 0.5243962491300197, 0.93264122141102535, 0.99357991809785062, -0.5676215712434739, -0.64809822311554233); + TestUtils.AreEqual(r2, a2 / b2); + + double4x2 a3 = double4x2(192.41448912043802, 226.85298524929817, -192.23568949114332, 460.97652957447644, -437.89221760159927, -413.23271794488312, 249.47184693509337, 313.03501739773662); + double b3 = (264.80085885934568); + double4x2 r3 = double4x2(0.72663846314276059, 0.85669278501017143, -0.7259632401466386, 1.74084227505974, -1.6536661530776777, -1.5605414564171789, 0.94211116991733534, 1.1821525758872689); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void double4x2_operator_div_scalar_wide() + { + double a0 = (-264.44250095283729); + double4x2 b0 = double4x2(105.58908157497137, -142.34910137129441, -288.94890679463231, 39.644133824689334, -363.99138396046658, -149.71822006521666, -395.72912306139671, 258.71868693955184); + double4x2 r0 = double4x2(-2.5044492954044237, 1.85770404172122, 0.915187753732487, -6.670406827961755, 0.72650758398599513, 1.7662679988958405, 0.66824119212426392, -1.0221236976771717); + TestUtils.AreEqual(r0, a0 / b0); + + double a1 = (-9.6662514254759344); + double4x2 b1 = double4x2(117.72553282497711, -331.38655797177296, -509.98602676297821, 427.8964666928614, 467.61712882836218, -407.12461943511136, 252.69070994699871, 444.59937664708093); + double4x2 r1 = double4x2(-0.082108368452634473, 0.029169111398595994, 0.018953953477569365, -0.022590164158598314, -0.020671294590288436, 0.023742733708631857, -0.0382532916524846, -0.021741486680375892); + TestUtils.AreEqual(r1, a1 / b1); + + double a2 = (-88.313306134340053); + double4x2 b2 = double4x2(199.95503411067421, -218.34692607556792, -13.417186028052697, -296.13107575854804, 0.561349630617201, -289.29929865957206, 196.21833929615946, 334.73346845001606); + double4x2 r2 = double4x2(-0.44166583015588912, 0.40446324444144272, 6.5821034268805914, 0.29822370350063077, -157.32317492974929, 0.30526622962284194, -0.45007671785992226, -0.26383171824220319); + TestUtils.AreEqual(r2, a2 / b2); + + double a3 = (-282.39273203648293); + double4x2 b3 = double4x2(-479.50358436978587, -473.43943927876626, 105.0507777226394, -287.63127841038227, 77.299297130340392, -210.89436421678141, -184.0682357214709, -315.14843645465953); + double4x2 r3 = double4x2(0.588927259861119, 0.59647065412775435, -2.6881546063568527, 0.98178728543414817, -3.6532380308752153, 1.3390245542370554, 1.5341741660619548, 0.89606261485327354); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void double4x2_operator_mod_wide_wide() + { + double4x2 a0 = double4x2(-388.81249422059045, 181.68118842955732, -167.07872470052854, 432.82015319951813, -258.43895995730486, -170.11079629236406, 283.318293464984, 122.71651297561664); + double4x2 b0 = double4x2(436.94417187056695, 58.940049437312382, -201.11623368091705, 279.2893537391393, -397.07975954426445, 377.89994758083481, 174.69386657266591, -228.17652736798698); + double4x2 r0 = double4x2(-388.81249422059045, 4.8610401176201776, -167.07872470052854, 153.53079946037883, -258.43895995730486, -170.11079629236406, 108.62442689231807, 122.71651297561664); + TestUtils.AreEqual(r0, a0 % b0); + + double4x2 a1 = double4x2(335.27101413126616, -503.60851668920765, 191.02251848532933, 289.74269379756538, -124.03371745163281, 259.27395761165485, -274.35845030208975, -140.03080398404541); + double4x2 b1 = double4x2(-317.06019106370405, -417.48011107811709, -249.9759434433542, -397.57157177364991, -358.74544947163452, -198.1592100589346, 208.73709378425826, -12.119406944196385); + double4x2 r1 = double4x2(18.210823067562103, -86.128405611090557, 191.02251848532933, 289.74269379756538, -124.03371745163281, 61.114747552720246, -65.621356517831487, -6.7173275978851734); + TestUtils.AreEqual(r1, a1 % b1); + + double4x2 a2 = double4x2(324.5775689205982, -200.51308903494527, 211.42317328761476, -51.272212767634642, -230.63392483006879, 99.989400671790122, 399.18986649028489, 24.903281461868119); + double4x2 b2 = double4x2(25.27141596063575, -194.12068495253135, -493.8717965995296, -312.3016990685378, -216.98060546488529, 413.57096047586344, -436.39440151508637, 3.4912750737235); + double4x2 r2 = double4x2(21.3205773929692, -6.3924040824139183, 211.42317328761476, -51.272212767634642, -13.653319365183506, 99.989400671790122, 399.18986649028489, 0.46435594580361794); + TestUtils.AreEqual(r2, a2 % b2); + + double4x2 a3 = double4x2(50.92402961241271, -364.86367886367429, -252.62662398658068, -281.28977955565313, -364.79852192699843, -329.02623311105475, 51.6098087074281, 41.647804041229051); + double4x2 b3 = double4x2(-308.23343076754054, -441.37506195594324, 84.6008532441225, 373.16344922276369, 67.252760203207231, -320.33327522889397, 118.97936325845274, 44.823946258436877); + double4x2 r3 = double4x2(50.92402961241271, -364.86367886367429, -83.424917498335674, -281.28977955565313, -28.534720910962278, -8.6929578821607834, 51.6098087074281, 41.647804041229051); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void double4x2_operator_mod_wide_scalar() + { + double4x2 a0 = double4x2(-244.49962889612635, -211.81931958525411, -145.92677576184587, -304.91822090042672, 155.47946436492703, -133.90778428591221, 281.30965412841624, -226.53575311719243); + double b0 = (39.634963769295723); + double4x2 r0 = double4x2(-6.6898462803520147, -13.644500738775491, -27.021884453958705, -27.473474515356656, 36.574573057039856, -15.002892978025045, 3.86490774334618, -28.360934270713813); + TestUtils.AreEqual(r0, a0 % b0); + + double4x2 a1 = double4x2(335.16613046041039, 319.47152033423606, -285.40231646476423, -355.84685985923136, 259.37800061860025, -330.87193957477433, -284.34358109363518, -102.68343811048356); + double b1 = (101.70649032560482); + double4x2 r1 = double4x2(30.046659483595931, 14.352049357421606, -81.98933581355459, -50.7273888824169, 55.965019967390617, -25.752468597959876, -80.930600442425543, -0.976947784878746); + TestUtils.AreEqual(r1, a1 % b1); + + double4x2 a2 = double4x2(-172.14173921017988, -416.71365447375626, -339.256669917729, 435.29751440291182, 132.55290490600885, 226.94410215455298, -306.11827268550093, 115.43844633709568); + double b2 = (206.41684517935698); + double4x2 r2 = double4x2(-172.14173921017988, -3.8799641150422985, -132.83982473837204, 22.46382404419785, 132.55290490600885, 20.527256975195996, -99.701427506143943, 115.43844633709568); + TestUtils.AreEqual(r2, a2 % b2); + + double4x2 a3 = double4x2(281.88292015804109, -140.04050237501065, -462.32346961569203, -211.60869822819188, 351.33104555277669, 321.04701176334504, 346.08518497370426, -94.407745643708722); + double b3 = (-218.3474491659307); + double4x2 r3 = double4x2(63.53547099211039, -140.04050237501065, -25.628571283830638, -211.60869822819188, 132.983596386846, 102.69956259741434, 127.73773580777356, -94.407745643708722); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void double4x2_operator_mod_scalar_wide() + { + double a0 = (-66.945025236785909); + double4x2 b0 = double4x2(-249.77609479137516, -396.07375664081133, 386.49204582091977, 168.93948109864232, -199.4182442163202, 261.7517141130528, 16.127438791155555, 257.66814744550186); + double4x2 r0 = double4x2(-66.945025236785909, -66.945025236785909, -66.945025236785909, -66.945025236785909, -66.945025236785909, -66.945025236785909, -2.4352700721636893, -66.945025236785909); + TestUtils.AreEqual(r0, a0 % b0); + + double a1 = (-75.788451945310669); + double4x2 b1 = double4x2(170.95630439136005, -242.85828005655588, 425.94531913564788, 303.27240409668184, 3.033060790520608, -505.74352788633831, 461.95706126743789, 205.97275672013529); + double4x2 r1 = double4x2(-75.788451945310669, -75.788451945310669, -75.788451945310669, -75.788451945310669, -2.9949929728160782, -75.788451945310669, -75.788451945310669, -75.788451945310669); + TestUtils.AreEqual(r1, a1 % b1); + + double a2 = (270.04063642678807); + double4x2 b2 = double4x2(-47.480711720642034, -150.254496405951, 149.49949009227544, -220.29804263836616, 31.118842377848409, 400.63568348467152, 6.2314283876826266, -39.050740021770252); + double4x2 r2 = double4x2(32.6370778235779, 119.78614002083708, 120.54114633451263, 49.742593788421914, 21.089897404000794, 270.04063642678807, 2.0892157564351237, 35.736196296166554); + TestUtils.AreEqual(r2, a2 % b2); + + double a3 = (-71.941097054603063); + double4x2 b3 = double4x2(-495.30713843521994, -86.71961859926563, -436.97006365143233, -472.2947320753218, -130.00875359867177, -251.51684605866524, 281.97637022751212, 388.86081928241106); + double4x2 r3 = double4x2(-71.941097054603063, -71.941097054603063, -71.941097054603063, -71.941097054603063, -71.941097054603063, -71.941097054603063, -71.941097054603063, -71.941097054603063); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void double4x2_operator_plus() + { + double4x2 a0 = double4x2(-418.82956357432045, -405.79894823851015, -34.041791216489742, 236.99924456188421, -459.83910129025537, 210.8614223985287, 293.74197902052754, -373.015422279488); + double4x2 r0 = double4x2(-418.82956357432045, -405.79894823851015, -34.041791216489742, 236.99924456188421, -459.83910129025537, 210.8614223985287, 293.74197902052754, -373.015422279488); + TestUtils.AreEqual(r0, +a0); + + double4x2 a1 = double4x2(-386.059833944803, -418.64524932328857, 504.47483062393724, -170.74650843941907, 439.55937572920664, -478.74939916969714, 116.40075665172219, 421.40964742256779); + double4x2 r1 = double4x2(-386.059833944803, -418.64524932328857, 504.47483062393724, -170.74650843941907, 439.55937572920664, -478.74939916969714, 116.40075665172219, 421.40964742256779); + TestUtils.AreEqual(r1, +a1); + + double4x2 a2 = double4x2(-258.5960806620289, 124.16434031546316, 222.17254386757156, -65.949277193261878, 239.04183947250328, 498.4495329793773, -139.382530515726, 279.07295549990283); + double4x2 r2 = double4x2(-258.5960806620289, 124.16434031546316, 222.17254386757156, -65.949277193261878, 239.04183947250328, 498.4495329793773, -139.382530515726, 279.07295549990283); + TestUtils.AreEqual(r2, +a2); + + double4x2 a3 = double4x2(108.7758186370022, 136.81214934997831, -236.03003965878395, -440.3083276414817, 342.2791270419392, 102.4722116470673, -161.454825714908, -355.27087919566355); + double4x2 r3 = double4x2(108.7758186370022, 136.81214934997831, -236.03003965878395, -440.3083276414817, 342.2791270419392, 102.4722116470673, -161.454825714908, -355.27087919566355); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void double4x2_operator_neg() + { + double4x2 a0 = double4x2(148.46174890755753, -467.12267873581624, 132.04719954917539, 183.52262290917463, 473.7010145009034, -407.99109024926605, -54.958759571872065, -382.98981803608581); + double4x2 r0 = double4x2(-148.46174890755753, 467.12267873581624, -132.04719954917539, -183.52262290917463, -473.7010145009034, 407.99109024926605, 54.958759571872065, 382.98981803608581); + TestUtils.AreEqual(r0, -a0); + + double4x2 a1 = double4x2(-299.09338893512887, 407.70980305583669, 168.73550351370852, 466.44152829909763, 171.90249474900895, -280.55831564616335, -78.85761622286293, 318.69633522569029); + double4x2 r1 = double4x2(299.09338893512887, -407.70980305583669, -168.73550351370852, -466.44152829909763, -171.90249474900895, 280.55831564616335, 78.85761622286293, -318.69633522569029); + TestUtils.AreEqual(r1, -a1); + + double4x2 a2 = double4x2(-39.91539694737429, 132.19563180403577, -505.89525127126615, 410.38058466947666, -237.05693375182193, -137.617827241131, -245.34998547534923, 422.52133222227974); + double4x2 r2 = double4x2(39.91539694737429, -132.19563180403577, 505.89525127126615, -410.38058466947666, 237.05693375182193, 137.617827241131, 245.34998547534923, -422.52133222227974); + TestUtils.AreEqual(r2, -a2); + + double4x2 a3 = double4x2(-434.57134386271764, -466.56631515294606, 426.89450116962871, 146.64955885086658, -391.37208408460583, 423.23773809114368, 254.29757296959758, -114.84889536483627); + double4x2 r3 = double4x2(434.57134386271764, 466.56631515294606, -426.89450116962871, -146.64955885086658, 391.37208408460583, -423.23773809114368, -254.29757296959758, 114.84889536483627); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void double4x2_operator_prefix_inc() + { + double4x2 a0 = double4x2(-139.84208137348389, -56.743654039103376, -381.955324589254, 509.79634380237962, -222.89634452708827, 210.31986556310198, -392.73151058365193, -300.19410218866267); + double4x2 r0 = double4x2(-138.84208137348389, -55.743654039103376, -380.955324589254, 510.79634380237962, -221.89634452708827, 211.31986556310198, -391.73151058365193, -299.19410218866267); + TestUtils.AreEqual(r0, ++a0); + + double4x2 a1 = double4x2(362.21273939787068, 130.90919429199266, -450.23016402229212, 243.54693114177644, 46.19202735190845, -41.497298975241051, 299.18547000511808, 154.35656530892311); + double4x2 r1 = double4x2(363.21273939787068, 131.90919429199266, -449.23016402229212, 244.54693114177644, 47.19202735190845, -40.497298975241051, 300.18547000511808, 155.35656530892311); + TestUtils.AreEqual(r1, ++a1); + + double4x2 a2 = double4x2(-281.23327435237974, 92.957765384091886, 448.60215565590283, -295.58701171334229, 18.499063262016989, -215.71113381893895, 471.94723651928234, 257.07660090973445); + double4x2 r2 = double4x2(-280.23327435237974, 93.957765384091886, 449.60215565590283, -294.58701171334229, 19.499063262016989, -214.71113381893895, 472.94723651928234, 258.07660090973445); + TestUtils.AreEqual(r2, ++a2); + + double4x2 a3 = double4x2(41.625937719655212, 243.00478588929627, -472.61902330472088, -125.7202084649914, -477.45955227197129, 9.8914859340952717, -76.922842299995409, -29.767583622488928); + double4x2 r3 = double4x2(42.625937719655212, 244.00478588929627, -471.61902330472088, -124.7202084649914, -476.45955227197129, 10.891485934095272, -75.922842299995409, -28.767583622488928); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void double4x2_operator_postfix_inc() + { + double4x2 a0 = double4x2(-396.6697396695007, 511.20749378167443, 249.11127030528678, -128.81731301584153, -259.49027669592306, 278.00817764830219, -81.393423356764686, 66.719732554033271); + double4x2 r0 = double4x2(-396.6697396695007, 511.20749378167443, 249.11127030528678, -128.81731301584153, -259.49027669592306, 278.00817764830219, -81.393423356764686, 66.719732554033271); + TestUtils.AreEqual(r0, a0++); + + double4x2 a1 = double4x2(167.85212691493894, -326.10758486674524, 41.033564825092185, 128.5304239394751, 73.155582223625629, -60.132380275117384, -446.22976490772783, -296.93783797739906); + double4x2 r1 = double4x2(167.85212691493894, -326.10758486674524, 41.033564825092185, 128.5304239394751, 73.155582223625629, -60.132380275117384, -446.22976490772783, -296.93783797739906); + TestUtils.AreEqual(r1, a1++); + + double4x2 a2 = double4x2(267.29380071689081, 49.200223230384381, -326.64314738225335, -510.86424064583343, 471.64748762159024, -171.01308186865089, 310.72735967800361, -298.91717185588425); + double4x2 r2 = double4x2(267.29380071689081, 49.200223230384381, -326.64314738225335, -510.86424064583343, 471.64748762159024, -171.01308186865089, 310.72735967800361, -298.91717185588425); + TestUtils.AreEqual(r2, a2++); + + double4x2 a3 = double4x2(489.98497008252184, 290.69102896875279, 117.1923401901463, 164.44293578175962, 412.36778874526158, -229.38657079887884, 239.59693848322934, 36.624316947825378); + double4x2 r3 = double4x2(489.98497008252184, 290.69102896875279, 117.1923401901463, 164.44293578175962, 412.36778874526158, -229.38657079887884, 239.59693848322934, 36.624316947825378); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void double4x2_operator_prefix_dec() + { + double4x2 a0 = double4x2(123.12869626056806, 256.8437465433235, 156.33078844674435, 461.73742530389563, 325.86799755965728, 392.01561731473339, 187.87412580655609, -236.2252043393558); + double4x2 r0 = double4x2(122.12869626056806, 255.8437465433235, 155.33078844674435, 460.73742530389563, 324.86799755965728, 391.01561731473339, 186.87412580655609, -237.2252043393558); + TestUtils.AreEqual(r0, --a0); + + double4x2 a1 = double4x2(125.10963517292851, 45.536655685648611, 376.04684680329956, -363.07547991493504, -22.028951416736902, 248.79012667797042, 168.0950144120003, 168.26565011230559); + double4x2 r1 = double4x2(124.10963517292851, 44.536655685648611, 375.04684680329956, -364.07547991493504, -23.028951416736902, 247.79012667797042, 167.0950144120003, 167.26565011230559); + TestUtils.AreEqual(r1, --a1); + + double4x2 a2 = double4x2(-190.284744112885, 183.95795854551625, 485.69469259944492, -460.73930261132273, 89.569894117102876, -267.42982090051743, 201.75623450137505, -141.21688682456357); + double4x2 r2 = double4x2(-191.284744112885, 182.95795854551625, 484.69469259944492, -461.73930261132273, 88.569894117102876, -268.42982090051743, 200.75623450137505, -142.21688682456357); + TestUtils.AreEqual(r2, --a2); + + double4x2 a3 = double4x2(-217.48409782046645, -213.54412732531506, 180.74062570405226, -128.31251412644633, 478.04553888647149, -454.56614062495817, -386.89835256473083, 387.85698408068015); + double4x2 r3 = double4x2(-218.48409782046645, -214.54412732531506, 179.74062570405226, -129.31251412644633, 477.04553888647149, -455.56614062495817, -387.89835256473083, 386.85698408068015); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void double4x2_operator_postfix_dec() + { + double4x2 a0 = double4x2(379.68831723727669, 302.69287814884115, -176.07134040448409, -291.25267066212962, 470.56758401848731, -402.92594666170231, -63.655158787805192, 355.26110069605568); + double4x2 r0 = double4x2(379.68831723727669, 302.69287814884115, -176.07134040448409, -291.25267066212962, 470.56758401848731, -402.92594666170231, -63.655158787805192, 355.26110069605568); + TestUtils.AreEqual(r0, a0--); + + double4x2 a1 = double4x2(-27.889220489137415, 156.14034969924967, 479.94519613680677, -200.30429491787419, -445.0269393609031, 407.42034907239508, 327.67032519340069, 48.0602071509046); + double4x2 r1 = double4x2(-27.889220489137415, 156.14034969924967, 479.94519613680677, -200.30429491787419, -445.0269393609031, 407.42034907239508, 327.67032519340069, 48.0602071509046); + TestUtils.AreEqual(r1, a1--); + + double4x2 a2 = double4x2(-209.66798100698179, 283.941595924991, -94.802087112703418, 152.51066334196867, -287.262531175866, -215.94803939384781, -407.04635567546188, 159.23357136511879); + double4x2 r2 = double4x2(-209.66798100698179, 283.941595924991, -94.802087112703418, 152.51066334196867, -287.262531175866, -215.94803939384781, -407.04635567546188, 159.23357136511879); + TestUtils.AreEqual(r2, a2--); + + double4x2 a3 = double4x2(-359.45648663093175, -278.93379868144814, 289.91284073978329, 402.03954691534841, 470.71654937729079, -208.56061873611094, 145.89674789546837, -296.79095258228062); + double4x2 r3 = double4x2(-359.45648663093175, -278.93379868144814, 289.91284073978329, 402.03954691534841, 470.71654937729079, -208.56061873611094, 145.89674789546837, -296.79095258228062); + TestUtils.AreEqual(r3, a3--); + } + + [TestCase /* For player builds */] + public static void double4x2_EqualsObjectOverride() + { + TestUtils.IsFalse(new double4x2().Equals((object)new int())); + TestUtils.IsTrue(new double4x2().Equals((object)new double4x2())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestDouble4x2.gen.cs.meta b/src/Tests/Tests/Shared/TestDouble4x2.gen.cs.meta new file mode 100644 index 00000000..9e9f4809 --- /dev/null +++ b/src/Tests/Tests/Shared/TestDouble4x2.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a5dfd972b64a9fd4193994214128a39b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestDouble4x3.gen.cs b/src/Tests/Tests/Shared/TestDouble4x3.gen.cs new file mode 100644 index 00000000..6debf3f6 --- /dev/null +++ b/src/Tests/Tests/Shared/TestDouble4x3.gen.cs @@ -0,0 +1,956 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestDouble4x3 + { + [TestCompiler] + public static void double4x3_zero() + { + TestUtils.AreEqual(0.0, double4x3.zero.c0.x); + TestUtils.AreEqual(0.0, double4x3.zero.c0.y); + TestUtils.AreEqual(0.0, double4x3.zero.c0.z); + TestUtils.AreEqual(0.0, double4x3.zero.c0.w); + TestUtils.AreEqual(0.0, double4x3.zero.c1.x); + TestUtils.AreEqual(0.0, double4x3.zero.c1.y); + TestUtils.AreEqual(0.0, double4x3.zero.c1.z); + TestUtils.AreEqual(0.0, double4x3.zero.c1.w); + TestUtils.AreEqual(0.0, double4x3.zero.c2.x); + TestUtils.AreEqual(0.0, double4x3.zero.c2.y); + TestUtils.AreEqual(0.0, double4x3.zero.c2.z); + TestUtils.AreEqual(0.0, double4x3.zero.c2.w); + } + + [TestCompiler] + public static void double4x3_operator_equal_wide_wide() + { + double4x3 a0 = double4x3(492.15758275061728, -495.20632027797694, 227.45765195947968, -147.37405950733182, -222.68201909897942, 64.093720704360749, -23.890404473939157, -16.8197190839889, 163.23210890741655, -165.27101071424363, 470.87767980568003, -423.94255967808078); + double4x3 b0 = double4x3(192.56880888369346, -235.61102472786376, -254.04311740307281, -412.62472052715009, 471.90480945627428, -6.4727852374654162, -339.10237447316865, 488.1875700839737, -379.5965842584132, -308.41700258311675, -82.333374300195544, -102.92108087563935); + bool4x3 r0 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + double4x3 a1 = double4x3(109.63436918595539, 462.69031283943468, -335.38147727371262, 357.23446934168896, 1.5455777652308598, -347.38824741327585, -114.47217302884542, 435.84865804940864, 194.23808607563285, 138.76554710174241, -467.34914205379278, 370.43337767684523); + double4x3 b1 = double4x3(226.51573835430463, -356.90132896830391, -362.91277544708589, -427.89843746083716, 466.65013978753711, -102.79904680270658, -43.355954428834821, 85.045664111639212, -91.127054972167628, 422.19208856215334, -477.43130873024057, 1.8770024785198984); + bool4x3 r1 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + double4x3 a2 = double4x3(476.70826147343416, 320.55264702465047, -498.59197377534207, 92.4169581366782, 104.51136856177425, 166.75460608618084, -204.73343024250744, 434.75675674656259, -397.32965988541469, 503.98163699730378, -503.7141270598928, 90.659743112819115); + double4x3 b2 = double4x3(312.5800799394865, 254.59934365684137, 352.72583763335172, 62.490957050812881, 119.71476059766246, -511.05808639482507, -302.47273053902791, -371.76924365189359, -20.007841834802093, 21.459455738523729, -426.02067228128232, -305.41193666374863); + bool4x3 r2 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + double4x3 a3 = double4x3(-303.4452423078219, 9.3449113412503948, 290.9010785980621, -147.57193882184657, 368.08236067745941, -321.60959044173808, -171.4654224717363, -441.30646368549503, -137.76681834914109, 304.68958463551928, 301.88943948498434, -222.22090564585335); + double4x3 b3 = double4x3(261.68332517411716, 50.0047347778476, -334.13464824023407, 75.065677916196023, -51.186689639085273, -135.96155721319911, -409.36487431515235, 160.81974013187914, 102.12079553591127, 277.81306637349212, 434.90674444423371, -15.289183385339186); + bool4x3 r3 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void double4x3_operator_equal_wide_scalar() + { + double4x3 a0 = double4x3(-303.2300766926399, 451.52631327674089, -253.65587413201848, -105.20363502632995, -500.6910920090466, -426.19248338518315, 159.87609656149334, -59.558379439431405, -57.477391031327386, -182.04973968400139, 406.51375861024189, 370.88599866017978); + double b0 = (123.5445759871717); + bool4x3 r0 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + double4x3 a1 = double4x3(-172.03530629539642, -11.338988547836891, 363.93823044557973, -27.150561106927, -325.97606507221985, -290.35904254129116, 180.19686635779067, -374.12832015293105, -439.35894295170851, -126.54608899287234, -197.2617896521752, -227.15933357326281); + double b1 = (455.40001198993991); + bool4x3 r1 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + double4x3 a2 = double4x3(-479.8991937487848, -495.23734902555, -224.51705013239621, -422.83322616239695, -450.19627043707123, -20.106708774392814, 297.37999906082632, 185.9665759475746, -102.97598962810633, -220.59704910060253, -228.686854707397, -333.00125972041917); + double b2 = (-439.77767750237962); + bool4x3 r2 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + double4x3 a3 = double4x3(434.2130317325765, -239.86977707588568, 380.93927281952426, 90.349506658664723, -361.32792751925433, -453.59993836544453, 157.73248799039629, -491.04621457077855, 296.61425055964582, 482.26513432071783, -305.87698259292029, -290.10212601819171); + double b3 = (406.24874062382094); + bool4x3 r3 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void double4x3_operator_equal_scalar_wide() + { + double a0 = (-253.39728534100453); + double4x3 b0 = double4x3(19.952187785856495, -185.79199346610903, 407.8136052600172, -87.2766969610363, -206.27469382354741, 160.503138855334, -274.77081478516141, -2.6315281403397535, 448.35453602688131, -410.03524251004461, 247.32901465489022, 355.53915350303942); + bool4x3 r0 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + double a1 = (-298.06671180299793); + double4x3 b1 = double4x3(414.10151429385951, -481.30262707234482, 196.55074438664633, 34.60100008668428, 113.76156645350227, -386.45337861890596, -124.49174672201821, 243.8866447153905, -492.6181826501238, 145.424413033493, 421.55070968230757, -95.409988209330493); + bool4x3 r1 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + double a2 = (336.80928746648567); + double4x3 b2 = double4x3(209.58380589707929, 487.441424358376, 161.80653365040507, 149.84247095409899, 225.723996505944, -71.21880176999548, 85.780251781353854, 192.547256797807, -49.887493395194156, -229.80195652218629, -103.40733413743197, 19.215747126944279); + bool4x3 r2 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + double a3 = (492.88110827509365); + double4x3 b3 = double4x3(140.40315849166507, -267.53641546309757, 125.9727018466092, 478.00049398746364, 116.14462071105118, -368.95778220191494, -225.02866350162247, 2.7237255585955609, -452.2632198055569, 87.456553261474028, 401.30651802630462, -18.645524272064449); + bool4x3 r3 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void double4x3_operator_not_equal_wide_wide() + { + double4x3 a0 = double4x3(430.8425316432689, 104.69001798736394, 225.80243478799355, -310.57017841496048, -418.61945815506363, 304.12820281839379, -509.32682561749908, -160.53807719076895, -203.30197606016975, -505.76325368590807, 162.17220623892365, 1.1561973100324394); + double4x3 b0 = double4x3(210.02470622305975, -55.203330304102678, -269.92533672504373, -234.54673372700194, 25.917412054686565, -63.726991444699024, -484.55371092471933, -425.333599050219, -53.274394775402925, 328.1944192984115, 15.963139303011417, 461.71412417931208); + bool4x3 r0 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + double4x3 a1 = double4x3(65.662074358045174, 102.78780250567377, 172.93008120960098, 26.621009123800832, 235.12595259171258, 128.54198533321824, -354.99697630246959, 334.35948220564023, -495.83200692377613, 468.30740163675853, 458.37094733601941, 299.93733300824522); + double4x3 b1 = double4x3(-113.36304455313973, -240.07297264787974, 495.11916970420589, 203.5583661550462, 340.49345103860526, -241.90719448863865, 459.56982896270688, 213.0737384357833, -384.7828506831, -255.07233846144396, 477.66343115161328, -248.03662621604121); + bool4x3 r1 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + double4x3 a2 = double4x3(43.12718560319729, -354.71349994964595, -145.28719551176169, 390.80186218340032, -303.13149108697263, 391.13459533785215, 139.2868607692825, 104.52318506339714, 511.29640293088573, 213.1470559635884, -101.09569625793756, 441.6633772522506); + double4x3 b2 = double4x3(-407.92344565313471, -199.78886971240343, 151.84326488889906, -97.120607659742518, 154.97589380805186, -172.83452065886672, 441.5027942329192, -401.73862785926957, -411.43016333665241, -337.8202766561044, -430.63088270213029, -150.87180502287663); + bool4x3 r2 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + double4x3 a3 = double4x3(124.36612301895684, 312.02642622218764, 59.65573766625289, -508.65682315670739, 98.699622438615052, 228.79984174892297, 337.83266965385189, -163.1544383331921, 461.69158885520494, -450.77570340166596, -443.56476637514527, -438.2131223334992); + double4x3 b3 = double4x3(-206.83699212169137, 34.955056922023687, -255.77146422852366, 99.99864320643178, -161.17557127828502, 68.853526862735634, -285.59012116379574, -428.71731229718648, -286.33740700703925, 2.0271298894784877, -4.8059971354929871, -425.33480115669539); + bool4x3 r3 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void double4x3_operator_not_equal_wide_scalar() + { + double4x3 a0 = double4x3(-16.914588697680529, 168.83411486858233, -462.71352145760949, 130.30776959765137, 214.50161443208424, -440.26328178879959, -197.12796053529155, -169.09985860115842, -386.61117595555783, -281.02101362916687, -270.26885593601912, -403.96372313236992); + double b0 = (-145.37277109239847); + bool4x3 r0 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + double4x3 a1 = double4x3(-269.80570877241234, -71.750904831919286, -432.75573917513515, -457.36312100727258, -13.519590622521719, 273.87305773136814, 185.042454567292, -482.53069351731364, 116.39514427836764, 511.73495578753523, 230.50753628020527, 100.27476768394683); + double b1 = (299.65422763473089); + bool4x3 r1 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + double4x3 a2 = double4x3(129.68240863163135, -220.63900409482375, 140.33521921016984, 369.2123617461009, 453.81121489676241, -333.66624871532724, -373.93775218256644, 150.20429451307484, -442.16476627912596, 372.32001488856974, -95.837970539852051, 495.56669663617697); + double b2 = (321.17879048044733); + bool4x3 r2 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + double4x3 a3 = double4x3(-5.385580780629823, -459.61274812166243, 243.3090676010163, 314.10215702378287, 96.745011136282756, -168.16192944727931, -71.905446324453408, 216.60847983910162, -377.37381356646017, 142.35499841643264, -432.27255722148, 94.290808959999481); + double b3 = (-210.50298581388915); + bool4x3 r3 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void double4x3_operator_not_equal_scalar_wide() + { + double a0 = (275.79582823244664); + double4x3 b0 = double4x3(-57.196896341255353, -382.4325279586169, 97.820359990848374, -161.46364529499022, -458.39563367254829, -499.61786364932448, 327.92217818271467, 367.57121699283425, 59.7863667289663, -209.58068118318016, -62.580453186566217, -479.97497604786184); + bool4x3 r0 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + double a1 = (-49.494519495169868); + double4x3 b1 = double4x3(-114.68521338081229, 109.93924599044919, -176.28482755286842, -347.48529903380449, 85.540928165214609, -356.65954868712441, -104.24357490625397, -133.54918605347592, 243.53971135036079, 13.141311890045813, -379.98594754747393, -41.281226892620907); + bool4x3 r1 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + double a2 = (87.911684792447659); + double4x3 b2 = double4x3(-339.07727996403224, -371.82034533648766, 333.14425936953364, 294.81196011920088, -187.14565977228136, 220.19225774528093, -228.18207250730234, -499.72373914146971, 97.4059055305114, 501.60439395420462, 459.67539880223353, 158.09812290877949); + bool4x3 r2 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + double a3 = (358.48858921531985); + double4x3 b3 = double4x3(243.51259171381253, 336.70294991913386, 89.953149122164177, -65.578377515812576, -159.26015503670095, 410.58855528877518, 123.96303206494224, -239.6251271886868, -299.42983808155628, -491.29190443981992, 207.71164641515895, 271.56546724567443); + bool4x3 r3 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void double4x3_operator_less_wide_wide() + { + double4x3 a0 = double4x3(196.84256825076534, 336.40979997087732, 251.96372115424072, 257.65591466503963, 430.04588647840819, -62.419644146421774, 8.8392293494376872, -333.81671563434259, 164.67880662003472, -350.94487516532877, 3.84143662631584, 125.40972024081725); + double4x3 b0 = double4x3(-465.34502313348696, -256.15239751346053, -314.814018634527, 364.56673662949663, 100.21050290959442, 182.56098636545289, 3.116978885194726, -259.43047893207074, -437.33490749696966, -456.0437321402336, -394.2559718537405, 401.91369099259077); + bool4x3 r0 = bool4x3(false, false, false, true, false, true, false, true, false, false, false, true); + TestUtils.AreEqual(r0, a0 < b0); + + double4x3 a1 = double4x3(-111.12994127680076, 70.005523475820951, 448.19828173527412, -419.98711200244122, -258.30166757213965, -34.832201735504043, -69.859397682295821, 67.767227442826766, -139.77729207825723, 385.43464130229995, 133.707390609061, 506.18837117878184); + double4x3 b1 = double4x3(313.43916454605721, 121.28668194696616, -28.012290729215522, -282.96589697663012, 330.06440631023816, 124.09937077579059, -183.69031700104955, 373.0607623406969, 109.75094013556418, -203.57134232463841, 45.6486556742567, -360.95226280808089); + bool4x3 r1 = bool4x3(true, true, false, true, true, true, false, true, true, false, false, false); + TestUtils.AreEqual(r1, a1 < b1); + + double4x3 a2 = double4x3(34.442885653322037, 412.11373896715872, -84.809773246203463, 444.78534504621541, -78.754743374304269, 366.97754376334024, 127.18045788965208, 428.36845489422251, 8.1976149120356467, -71.137346062407516, -474.05081937930117, 322.42891875022508); + double4x3 b2 = double4x3(211.91309867236441, -313.28636207863985, -259.66108691862837, 79.0985401045059, 446.49610897828643, 450.52455660818362, -375.63076728192658, -53.941822792376286, -291.4537471697916, 190.77482303919965, 54.083913589866825, -163.63087637891567); + bool4x3 r2 = bool4x3(true, false, false, false, true, true, false, false, false, true, true, false); + TestUtils.AreEqual(r2, a2 < b2); + + double4x3 a3 = double4x3(6.8978650602036851, 195.73355993802363, -267.69061315604051, -243.79369961647024, 319.25079336727538, -425.15620370635588, 71.873970303625811, 313.84387626957334, 397.27906126402274, -309.14588584990514, -38.667860764389786, -266.11969554895518); + double4x3 b3 = double4x3(-212.00563750602566, 406.09049649075166, -183.01893743454428, 355.22140304894253, -81.042213716098217, -275.71481693709029, 405.29925007619863, -510.64058065351128, 398.06925815999011, -4.35550666058225, 129.24267083464315, -276.1465247963306); + bool4x3 r3 = bool4x3(false, true, true, true, false, true, true, false, true, true, true, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void double4x3_operator_less_wide_scalar() + { + double4x3 a0 = double4x3(-132.05731708000292, -192.46500477216438, -66.834607870706634, -379.01750081545561, -360.28242199508588, 20.927834282129879, -158.24074537970159, 437.34587522845061, -20.452607402788772, 225.29148517609178, 307.48418607725023, 274.01523292903562); + double b0 = (-156.01021845452965); + bool4x3 r0 = bool4x3(false, true, false, true, true, false, true, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 < b0); + + double4x3 a1 = double4x3(373.54965584983563, 105.0301654827922, -58.010895994496934, 109.67008810381878, -108.853174498702, -44.971252223929014, 140.42607147080173, -500.08827638071415, 172.10334857371788, -197.50074610370245, -7.27149987559369, -432.99049898283113); + double b1 = (398.52368301829495); + bool4x3 r1 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 < b1); + + double4x3 a2 = double4x3(62.158315449095426, -377.85232299279994, -500.25573586870718, 149.1149638393498, 119.88061695912882, 202.63918909925928, 274.95066393304182, 66.4120323967245, 274.99944580486022, -149.63581402117194, 223.75870834279749, 73.266824041151835); + double b2 = (-72.254720959931035); + bool4x3 r2 = bool4x3(false, true, true, false, false, false, false, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + double4x3 a3 = double4x3(213.09497390179661, 418.3772096197946, 421.10357947885223, -187.16683658732421, 389.10944313048822, 401.33542818638284, -106.28507929029178, 380.60798162063952, 385.65284484701829, 120.65986376659009, -13.830871826890359, -500.12711238308208); + double b3 = (322.85949459805124); + bool4x3 r3 = bool4x3(true, false, false, true, false, false, true, false, false, true, true, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void double4x3_operator_less_scalar_wide() + { + double a0 = (-423.117411095238); + double4x3 b0 = double4x3(385.09483617595151, -123.93348532725753, 86.376572887588509, 133.44217378154497, 161.45794947513286, 229.75426660746064, 222.57159934871436, 315.53116360098647, -447.20351883731945, 271.83385790131695, -393.60531324595462, 317.48689737798964); + bool4x3 r0 = bool4x3(true, true, true, true, true, true, true, true, false, true, true, true); + TestUtils.AreEqual(r0, a0 < b0); + + double a1 = (-164.6051085761772); + double4x3 b1 = double4x3(-282.87605370342544, 296.97953071118309, -254.40115582868509, 365.61562054493265, -441.98425671178114, -131.42866021554391, 442.62897631275882, -29.792842163607872, -138.37379533535511, 9.2169721169476588, -226.7305482489665, 171.02944310523083); + bool4x3 r1 = bool4x3(false, true, false, true, false, true, true, true, true, true, false, true); + TestUtils.AreEqual(r1, a1 < b1); + + double a2 = (376.62522595777421); + double4x3 b2 = double4x3(-462.58872697436658, -142.36729795409707, -456.25377414014832, 66.6102416825529, 169.37875779409831, 327.44439450253003, 64.0879266560487, -153.50390369887646, 199.38014921889646, -244.96905314408662, 472.74382112582396, -363.78010075342843); + bool4x3 r2 = bool4x3(false, false, false, false, false, false, false, false, false, false, true, false); + TestUtils.AreEqual(r2, a2 < b2); + + double a3 = (-179.48750575794259); + double4x3 b3 = double4x3(-83.4251511485433, 178.88648828253451, 62.155780582761281, 409.74679560668153, -117.16365366669544, 316.60167684992848, 285.51627339307049, 18.674469718092382, 282.52931298060776, 132.92379075518056, -318.21533957040651, 314.83989181874313); + bool4x3 r3 = bool4x3(true, true, true, true, true, true, true, true, true, true, false, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void double4x3_operator_greater_wide_wide() + { + double4x3 a0 = double4x3(483.50140141113729, 310.81563415695712, 106.9661896726891, 295.73526038589671, 116.95757179938141, -478.29977653841479, -14.897393471979228, -33.817441717636484, -24.740548383789417, 319.78262701620474, -120.15856581561201, -289.00857962714906); + double4x3 b0 = double4x3(-471.39802454011425, -371.98528617060992, 36.900723236101044, -316.76360407320954, 19.683055648432628, 207.3091381561519, 362.79748861994483, 324.95341816775192, 340.94807140014507, 25.986035120666997, -114.2111352021858, 240.80346428640348); + bool4x3 r0 = bool4x3(true, true, true, true, true, false, false, false, false, true, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + double4x3 a1 = double4x3(455.85146662958505, 144.70691139283917, 63.931990891663304, -285.68304099034663, -502.0907201720824, -337.19446412529538, 474.31734274063137, -507.14510679018923, -133.56559735795742, -443.10913654934109, -464.34137056038776, -68.361549647693323); + double4x3 b1 = double4x3(273.42244757033063, 325.51576224226312, 27.341068995809678, 64.479532510265472, 200.94836983501375, 100.12266998184964, -79.00710896356361, -315.137945560337, -122.98542815213347, -163.77920229908972, -492.56600617457462, -90.797273439726439); + bool4x3 r1 = bool4x3(true, false, true, false, false, false, true, false, false, false, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + double4x3 a2 = double4x3(-185.99299987870876, -157.80389340119615, -74.124229227250567, -94.471165939453613, 329.61055508703487, -315.83675280019486, 404.193811843262, 131.30440503512716, -206.6339033612208, 197.39985832823436, 187.99195274524016, 362.63607542712055); + double4x3 b2 = double4x3(-284.9012335673446, -23.653687249707843, 174.93002112905026, 85.7125366133231, -441.98783012944637, 345.54374210235835, 482.21949814363359, -422.38349719642827, -30.779309048680261, 296.15423669300708, 378.05988830051376, -457.73343942022575); + bool4x3 r2 = bool4x3(true, false, false, false, true, false, false, true, false, false, false, true); + TestUtils.AreEqual(r2, a2 > b2); + + double4x3 a3 = double4x3(336.09317819033436, -352.44836752137559, -183.10199865284471, 193.14483484679124, -170.216002781976, -0.49123787902817639, -326.85503760299412, -373.39623826248396, -216.58046422553269, 282.51211489481489, -275.17035616336875, -207.331757403599); + double4x3 b3 = double4x3(122.92057257654176, -509.17313766347854, 386.7706226719406, 436.41747280415962, -276.49581516743444, -163.16677554099203, 249.97064625936127, -165.02074130113272, 89.092999261381578, 404.30517287007774, -340.68884889254758, -103.78509550159106); + bool4x3 r3 = bool4x3(true, true, false, false, true, true, false, false, false, false, true, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void double4x3_operator_greater_wide_scalar() + { + double4x3 a0 = double4x3(64.317918092160426, -397.70346445483318, 431.87690826499693, 85.702980796668157, 246.26305233978803, 197.49155602114809, 286.1994608781298, 280.81334818564972, -405.78459210218148, 171.56538661362856, -241.80727326209063, 333.57817498481745); + double b0 = (305.85991992888034); + bool4x3 r0 = bool4x3(false, false, true, false, false, false, false, false, false, false, false, true); + TestUtils.AreEqual(r0, a0 > b0); + + double4x3 a1 = double4x3(370.27919524269146, -356.5923551789449, -353.03129522550444, 396.64532608382649, 467.22205541432936, -240.0134228393498, 502.91505193287276, 315.46759024051369, -259.28970134411458, 281.23064554912537, 428.79219909608, 245.15306460352292); + double b1 = (-413.70138116073861); + bool4x3 r1 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + double4x3 a2 = double4x3(-279.17542494422543, -124.77154856769909, -425.65293451103054, 99.132852838902181, 355.0605339273161, -456.43941256796916, 154.48902208846482, 405.52974409867534, -157.73379643155903, 186.08628639303436, 249.99909531790718, -110.0969179189284); + double b2 = (-453.86309668694764); + bool4x3 r2 = bool4x3(true, true, true, true, true, false, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 > b2); + + double4x3 a3 = double4x3(-435.3045134187231, -254.34657037181154, -428.98794980951953, 255.37367761105941, -309.11230459302305, 185.50160678918553, -201.33417687254689, 23.321151029002408, -143.97610027341921, -111.77951412637697, -356.65661852278589, -318.31356945555359); + double b3 = (72.752033029101767); + bool4x3 r3 = bool4x3(false, false, false, true, false, true, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void double4x3_operator_greater_scalar_wide() + { + double a0 = (-282.67049635698572); + double4x3 b0 = double4x3(358.09997360692353, -72.5964134077525, -232.16380106292843, -60.706723956720282, 75.156642710397364, 150.88350040786133, 339.53917924479538, -498.19602965665797, 459.74610326241054, -227.96872316485678, 335.86213485145106, 76.178844248959308); + bool4x3 r0 = bool4x3(false, false, false, false, false, false, false, true, false, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + double a1 = (296.85993899817572); + double4x3 b1 = double4x3(177.49000390688423, -281.20120657663847, 244.72285162877427, 137.32857257562159, -385.33824724021287, 443.16345879210326, -353.56254141105455, 26.040673983302327, -331.7939499969566, -43.691963454565041, 20.949428806523542, -211.17984423934473); + bool4x3 r1 = bool4x3(true, true, true, true, true, false, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + double a2 = (227.42171894173214); + double4x3 b2 = double4x3(-84.7797711290325, -375.13548701588786, -205.17813096064054, -197.04714617368165, -219.63402305340117, -210.01563344244641, -266.773715858708, 144.77848703450456, -471.71120069535039, -155.91317494023275, 99.724721716588647, -230.94484316135981); + bool4x3 r2 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 > b2); + + double a3 = (-338.86889640375455); + double4x3 b3 = double4x3(334.06826630889827, -158.66085703608621, -315.01822414762262, -177.19281991626735, 171.959285100903, 198.38915047347041, 303.67832603290594, 400.69957346501735, 351.87867252523017, -31.76966072608235, 386.07330077983124, -360.34885733218346); + bool4x3 r3 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void double4x3_operator_less_equal_wide_wide() + { + double4x3 a0 = double4x3(-438.52313753521219, 210.48942837980087, 4.8773329280677444, -137.29793817237857, 156.09410174009111, -363.92412035722475, -97.948485181642923, 437.29539009430232, 458.53029153241323, -294.06474675520542, 23.622613679441884, -34.284056441059363); + double4x3 b0 = double4x3(-474.8141498392514, 304.3710555063426, 234.8241737982371, -390.48543209139513, -297.17535295019638, -326.29239121372461, 107.2538764976216, -413.13107342884462, 67.094432623635271, 470.07522724106684, -84.499104777583455, 392.78422683886447); + bool4x3 r0 = bool4x3(false, true, true, false, false, true, true, false, false, true, false, true); + TestUtils.AreEqual(r0, a0 <= b0); + + double4x3 a1 = double4x3(149.736484835733, -418.8866781754823, -197.50252899783783, -88.2055118494693, -376.71814292330208, 341.62712899857536, -83.309179106405566, -107.49073295830317, 319.46688833807912, 205.35738501574724, 345.56372968552807, 395.32190746596177); + double4x3 b1 = double4x3(-263.53175485484849, 369.30090039284005, -333.32529298091555, 238.41347443238533, 486.24259279959028, 279.65021408705513, 236.05201803709008, 132.75898248178839, 66.294708998079727, 183.00210699020056, 200.13055071613314, 339.043800750302); + bool4x3 r1 = bool4x3(false, true, false, true, true, false, true, true, false, false, false, false); + TestUtils.AreEqual(r1, a1 <= b1); + + double4x3 a2 = double4x3(-222.87415490992095, 439.02200790821666, -368.0755667016262, -200.03860173003682, 71.46990660180802, -357.36542932939039, 141.7108519737194, 319.0170969064427, 303.03015889927292, -461.57424829042247, 277.62674749904625, 182.178105677561); + double4x3 b2 = double4x3(438.53791710293751, 145.40187866306019, 178.16310199450845, 157.97596724237133, 329.7052015409364, -243.59091221708383, 5.4011614347813293, -22.580605278993289, -90.33759478961008, -72.19107798123315, -354.35482399275281, -289.52172650467685); + bool4x3 r2 = bool4x3(true, false, true, true, true, true, false, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + double4x3 a3 = double4x3(-337.41483441806156, -361.39166109701227, 222.14351020666936, -464.7795028466636, -146.8536623208102, 80.175055302761052, -260.34730088913221, 94.489041134011472, 174.2811945296271, -303.81969251475283, 81.417447366480474, 503.048130508069); + double4x3 b3 = double4x3(85.176270763006187, 469.32790468136216, 294.71383656874013, 461.60593411959985, -245.93047892578431, -124.04044610077534, 278.39260948747051, -42.881244917810534, -328.34883824379597, 98.985619352658091, -375.8998207412194, -197.93427309670221); + bool4x3 r3 = bool4x3(true, true, true, true, false, false, true, false, false, true, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void double4x3_operator_less_equal_wide_scalar() + { + double4x3 a0 = double4x3(193.4958237118534, 168.91555197952107, -313.9930695565385, 81.826965131716292, 18.503590830836288, -0.35819602029312136, 241.36115776810846, -463.81641242644582, -1.3577692515020203, -268.89945591096739, 398.9919504593089, -471.253072242836); + double b0 = (443.85054299042122); + bool4x3 r0 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + double4x3 a1 = double4x3(-264.93778264938749, 11.246050124636895, 424.7040156911612, 426.48223157715154, 56.319978501796754, -196.28791126808522, 31.901173844887467, -152.2575724833913, -437.92645975478297, -37.104814785115821, -47.144214413661587, 333.6230348710078); + double b1 = (82.258299150624453); + bool4x3 r1 = bool4x3(true, true, false, false, true, true, true, true, true, true, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + double4x3 a2 = double4x3(-274.80387438219225, -260.46056926458169, 192.30916008367626, 145.30606777281787, -466.13296363602063, -494.26732968458316, -111.57013922164691, -139.54120332540072, -146.58935148389514, 33.984021917909445, -445.70445248377717, -451.04219624541804); + double b2 = (358.67627804292192); + bool4x3 r2 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 <= b2); + + double4x3 a3 = double4x3(-122.03926115950537, -202.46552119146361, -76.564869677910963, 218.03280482908372, -103.5359361653849, -283.35842312656268, -374.76167910860931, -213.49586568283655, 477.49183891596829, -383.37006849021191, 23.964948426915726, -5.9607760933976692); + double b3 = (83.327714720427821); + bool4x3 r3 = bool4x3(true, true, true, false, true, true, true, true, false, true, true, true); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void double4x3_operator_less_equal_scalar_wide() + { + double a0 = (393.60626644343427); + double4x3 b0 = double4x3(-75.688363825757222, -44.2638714519627, 125.86491566797019, 191.96488174794467, 13.543054825413492, -197.0519259893577, -423.945100743298, -330.04861680141119, 420.16553779140372, 105.54730777887039, 174.82126363311954, 296.71757831085358); + bool4x3 r0 = bool4x3(false, false, false, false, false, false, false, false, true, false, false, false); + TestUtils.AreEqual(r0, a0 <= b0); + + double a1 = (-469.70041845259277); + double4x3 b1 = double4x3(123.26718979853536, 112.9969695140594, 495.14339493920249, -488.65789364681478, 388.53941148730894, -493.24077080806751, 16.451064832718657, -387.6516336815672, -229.1773127192526, -373.01533930982248, -391.142134610164, 90.994149488859875); + bool4x3 r1 = bool4x3(true, true, true, false, true, false, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 <= b1); + + double a2 = (-178.39613517485378); + double4x3 b2 = double4x3(-69.621067317957568, 471.7908458522478, -67.4667532758167, 45.305359623071467, -154.69219000390365, 385.73888248286153, -431.652945004242, -331.67304841227508, -349.89271013340573, -114.83913021666888, -245.21782671903156, -486.69548224224496); + bool4x3 r2 = bool4x3(true, true, true, true, true, true, false, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + double a3 = (391.95091957224111); + double4x3 b3 = double4x3(-125.77055150166643, -229.81227527829458, 289.44901265271426, -200.49423680104979, 281.59270991086623, 99.901066588191838, -146.02742845659492, 124.14839774190841, 94.357016368935319, 93.920113845691162, -484.92414711645068, -270.79689396116737); + bool4x3 r3 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void double4x3_operator_greater_equal_wide_wide() + { + double4x3 a0 = double4x3(-507.92858409692, 504.49748181947393, -385.43449205226938, -262.32340944107784, -37.550928848586466, -111.59527759980193, -463.70202157632542, 387.44885772627265, 456.96878573716094, -211.01015506079892, 182.41135391146474, -53.596053863687473); + double4x3 b0 = double4x3(-81.346509732933043, 297.66615047010885, 171.06540616371922, -431.03805538222105, -6.859075311040101, 319.72570362674333, 254.079170106947, 396.5724000393285, 178.83927615864172, -447.06336304501787, 288.49268569075161, 474.88929460704765); + bool4x3 r0 = bool4x3(false, true, false, true, false, false, false, false, true, true, false, false); + TestUtils.AreEqual(r0, a0 >= b0); + + double4x3 a1 = double4x3(-309.57021608463032, -136.02249127999994, 280.73629082401112, -96.9958942388165, -174.05950673579213, 88.9019382413951, 43.816040774721728, -446.07842585354967, 16.645595796706857, 409.83252043734888, -191.32987245886113, 222.99782548798146); + double4x3 b1 = double4x3(-321.75022831640683, -395.97722048125104, -158.69246037243516, 391.48869318118727, -368.10924141859135, 89.1238043723273, -510.27932214656812, -486.92979525352354, -81.215552606254619, 274.21882046117389, -212.88155494112596, 288.99530591117); + bool4x3 r1 = bool4x3(true, true, true, false, true, false, true, true, true, true, true, false); + TestUtils.AreEqual(r1, a1 >= b1); + + double4x3 a2 = double4x3(404.28838915577546, 230.60328136691976, -441.78928228923553, -86.293056289801882, 484.24954413075443, 95.2363665547391, -204.91210255628084, -199.77434620623211, -421.86318107222354, -18.214789637464492, -346.8227681344481, -159.24364073539323); + double4x3 b2 = double4x3(307.73173131967508, 307.24516620638087, -199.39178213821339, -284.42126978767163, -482.39181278757371, 448.3157362641374, -378.3461889598268, -390.8584684761513, 8.9160292190108521, 416.40721984226593, -213.67494664605471, 455.24810788372906); + bool4x3 r2 = bool4x3(true, false, false, true, true, false, true, true, false, false, false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + double4x3 a3 = double4x3(112.9177020121914, 48.29104115827522, 390.66016525340274, 154.21916706590878, -32.748053804388292, -288.2656096370265, 122.70425826064513, 321.2779754704228, 230.18381487121053, 116.87426024157287, -93.515688701307283, 229.98230730275736); + double4x3 b3 = double4x3(-236.08035980727539, -248.37309348228064, 184.18512567513858, 415.31133885649558, 86.982202808830039, 485.00455950433604, 107.75893955480262, -486.66772459757874, -138.67679197093321, 14.207853562295327, -382.39416211768713, -117.00821524346628); + bool4x3 r3 = bool4x3(true, true, true, false, false, false, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void double4x3_operator_greater_equal_wide_scalar() + { + double4x3 a0 = double4x3(465.15218732559686, -424.8860745024337, -209.22109685150025, 58.779852656079356, -302.26910533675414, 140.12558252183976, 16.353385694489475, -344.55997316192838, 393.27804846003562, -315.70155086913218, 441.0115565923096, -509.78156757251435); + double b0 = (-5.5998842742293391); + bool4x3 r0 = bool4x3(true, false, false, true, false, true, true, false, true, false, true, false); + TestUtils.AreEqual(r0, a0 >= b0); + + double4x3 a1 = double4x3(-36.994287269652943, -164.97393830352183, -466.12009046325466, -123.8137477020797, 215.65121779947128, 104.99569730879534, 314.34603014325069, 190.51609882643265, -83.111429014760745, -23.836435567511444, 143.04935962662535, -264.91997945724052); + double b1 = (494.82028865014217); + bool4x3 r1 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + double4x3 a2 = double4x3(-169.70222457205051, 359.09582035573931, -260.42331016269668, 354.19514219565087, -111.84533768140028, 33.309096113456917, 355.63126938214123, -435.36056753404466, -38.39930893778768, -93.29572896533449, -338.84962169213668, 436.89581676800537); + double b2 = (329.70751610850334); + bool4x3 r2 = bool4x3(false, true, false, true, false, false, true, false, false, false, false, true); + TestUtils.AreEqual(r2, a2 >= b2); + + double4x3 a3 = double4x3(511.08413982348713, -453.79924771459741, 170.91899998994495, -182.82575591971437, -207.51692710049309, -319.500592142111, -240.5086177515372, 436.34132286363342, -66.956061632817637, 303.32088174639307, 180.19605907248149, 337.9651765012951); + double b3 = (-277.67452419813469); + bool4x3 r3 = bool4x3(true, false, true, true, true, false, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void double4x3_operator_greater_equal_scalar_wide() + { + double a0 = (374.82703393270594); + double4x3 b0 = double4x3(-1.609757185731894, 338.61524049314448, -116.18140392945213, -332.15732375353451, -355.9793509710484, -468.90144107719021, 38.579884785497484, -332.34754697063357, 2.8901150240051265, 467.77776477661814, 121.40638762405445, -305.02337303060267); + bool4x3 r0 = bool4x3(true, true, true, true, true, true, true, true, true, false, true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + double a1 = (-58.428812292604164); + double4x3 b1 = double4x3(-226.51955209789776, -47.020994446715804, 305.3026770582901, -427.40123315686418, 92.263649745035764, -497.17853736187266, -408.62564225151465, -455.23049113491106, 396.42608637196292, -469.29488561548987, -485.7540130493017, -182.34619268325446); + bool4x3 r1 = bool4x3(true, false, false, true, false, true, true, true, false, true, true, true); + TestUtils.AreEqual(r1, a1 >= b1); + + double a2 = (-291.54536284671417); + double4x3 b2 = double4x3(278.740809331993, -75.87113932327884, 28.907059921374071, 287.72014988945807, 420.50978990109161, 473.62684152723614, 181.514540518408, -369.20287220981106, 243.74977385427326, -244.12415825767636, -242.9933451353541, -322.11536780098237); + bool4x3 r2 = bool4x3(false, false, false, false, false, false, false, true, false, false, false, true); + TestUtils.AreEqual(r2, a2 >= b2); + + double a3 = (192.974957794405); + double4x3 b3 = double4x3(-54.725568558427312, -166.00083907228003, 244.29344117096321, 438.24940105818655, -162.69282610839832, 37.185346382290732, -506.66736459483735, -205.1630781652234, 368.3899807261256, -35.459948317827639, -20.916435966694905, 9.041354422011068); + bool4x3 r3 = bool4x3(true, true, false, false, true, true, true, true, false, true, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void double4x3_operator_add_wide_wide() + { + double4x3 a0 = double4x3(506.12905263627374, -501.77980803967444, 420.08479638587903, -186.03206476291274, -9.3123953385801883, 328.51179686585056, 424.34407659263536, 87.791079800478656, 462.41368148402012, -46.178705952213477, 401.17006296718966, -454.12414643453627); + double4x3 b0 = double4x3(-28.757987751047096, -337.135153689019, -340.676816860529, 152.31202633320913, 423.66745420157326, 90.374096674087468, 376.18866246574964, 1.7671887882831925, -120.18586045139745, -279.62936628965167, -344.66710273580026, 242.8391956029642); + double4x3 r0 = double4x3(477.37106488522664, -838.91496172869347, 79.407979525350015, -33.720038429703607, 414.35505886299308, 418.885893539938, 800.532739058385, 89.558268588761848, 342.22782103262267, -325.80807224186515, 56.502960231389409, -211.28495083157208); + TestUtils.AreEqual(r0, a0 + b0); + + double4x3 a1 = double4x3(69.195687564646732, -177.95734485329939, 299.60415544156183, 340.7048587001417, 219.91602740991675, -321.90838232725321, 286.35534037573041, -333.41949311523672, -118.93216973120911, 68.607509406566351, 23.190902005504313, -205.57787547147734); + double4x3 b1 = double4x3(418.5930504363929, -23.312797318823982, -95.099945827899489, 147.92812568877275, 331.03287926830023, -82.502564230236487, 279.44956291813844, 342.6227215931857, -300.35853185335105, -209.69408736456842, 446.55942150883345, -351.98918955027557); + double4x3 r1 = double4x3(487.78873800103963, -201.27014217212337, 204.50420961366234, 488.63298438891445, 550.948906678217, -404.41094655748969, 565.80490329386885, 9.2032284779489828, -419.29070158456017, -141.08657795800207, 469.75032351433777, -557.56706502175291); + TestUtils.AreEqual(r1, a1 + b1); + + double4x3 a2 = double4x3(11.521422629953122, -340.7950796283759, -68.931167873056211, 304.8532370556394, -86.633841316510825, 105.66915874633435, 349.28052799277032, 364.7078708916473, -429.03740449856843, 382.45806926417072, 186.09704479300274, 227.41184841255279); + double4x3 b2 = double4x3(-263.12385642860261, -252.4585670216282, 289.82535542632706, 338.79615537207394, -232.61900364263869, -510.50825405051387, 349.2807325559113, -426.2124495106807, -331.41632882292208, -418.68880267566482, -341.7063559692848, -329.03588143411832); + double4x3 r2 = double4x3(-251.60243379864949, -593.25364665000416, 220.89418755327085, 643.64939242771334, -319.25284495914951, -404.83909530417952, 698.56126054868162, -61.504578619033396, -760.45373332149052, -36.2307334114941, -155.60931117628206, -101.62403302156554); + TestUtils.AreEqual(r2, a2 + b2); + + double4x3 a3 = double4x3(-298.76636733616067, 351.30280344155744, 98.725387857633336, -292.35170640254006, 112.17092590787024, 477.1657800512229, -266.30486619952364, -295.14070643817104, -485.82035778733916, -507.86872291372566, -338.21959582819585, 505.34219360041538); + double4x3 b3 = double4x3(123.19857245460082, 189.52859482054066, 267.56994093003209, 134.63626605581317, -337.96815530302382, 50.728011870164437, 81.16342572176984, 442.09067198358969, -148.70453769932715, 6.9743440183691519, -334.91123906472291, 43.787097712879586); + double4x3 r3 = double4x3(-175.56779488155985, 540.83139826209811, 366.29532878766543, -157.71544034672689, -225.79722939515358, 527.89379192138733, -185.1414404777538, 146.94996554541865, -634.52489548666631, -500.89437889535651, -673.13083489291876, 549.129291313295); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void double4x3_operator_add_wide_scalar() + { + double4x3 a0 = double4x3(-194.51420387742769, 338.54838696985894, 246.97140252169754, 100.51093797595752, -45.724677822424439, -478.11131094308166, 30.916145577522116, 60.37435224483454, -242.1187475855084, 82.50134495762245, 6.7993848355483806, -484.69981287638649); + double b0 = (124.121678171736); + double4x3 r0 = double4x3(-70.3925257056917, 462.67006514159493, 371.09308069343354, 224.63261614769351, 78.397000349311554, -353.98963277134567, 155.03782374925811, 184.49603041657053, -117.99706941377241, 206.62302312935844, 130.92106300728437, -360.57813470465049); + TestUtils.AreEqual(r0, a0 + b0); + + double4x3 a1 = double4x3(-188.26501068298938, -267.78430688929944, 189.25996669999324, 198.53359684652355, 187.53610023648298, -424.92567582844089, 302.10236730338181, 300.39907970111778, 124.02158909850823, -200.16134295247559, 31.37822701007974, 362.52213518811493); + double b1 = (-213.52673087526426); + double4x3 r1 = double4x3(-401.79174155825365, -481.31103776456371, -24.266764175271021, -14.993134028740712, -25.990630638781283, -638.45240670370515, 88.575636428117548, 86.872348825853521, -89.505141776756034, -413.68807382773986, -182.14850386518452, 148.99540431285067); + TestUtils.AreEqual(r1, a1 + b1); + + double4x3 a2 = double4x3(-423.98885961248953, 374.21141474983256, -465.69948957194549, -311.04303779781003, 84.918990413154916, -432.44245716204978, 235.75065886031405, -472.63775394514096, -257.57773721291579, 186.120703068618, -170.29822667422621, -115.27248840931452); + double b2 = (432.41331907380993); + double4x3 r2 = double4x3(8.4244594613203958, 806.62473382364249, -33.286170498135562, 121.3702812759999, 517.33230948696485, -0.029138088239847093, 668.163977934124, -40.224434871331027, 174.83558186089414, 618.534022142428, 262.11509239958372, 317.14083066449541); + TestUtils.AreEqual(r2, a2 + b2); + + double4x3 a3 = double4x3(-101.16882686557659, 246.5492557243208, -397.53459066782824, -199.04838213652761, 20.585038433123827, 207.3238519203494, 197.93518671669779, -201.54056439247938, -106.63866453368155, -179.38222631224534, 203.81710610343941, -364.82094853223344); + double b3 = (257.77516973101308); + double4x3 r3 = double4x3(156.60634286543649, 504.32442545533388, -139.75942093681516, 58.726787594485472, 278.36020816413691, 465.09902165136248, 455.71035644771086, 56.2346053385337, 151.13650519733153, 78.392943418767743, 461.59227583445249, -107.04577880122037); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void double4x3_operator_add_scalar_wide() + { + double a0 = (-340.35468284243473); + double4x3 b0 = double4x3(511.36225652665007, -146.21663791789518, -106.21042661844308, -363.45024960276214, 199.08958325120136, -27.108407271610758, 419.84900041103788, 284.95503748811552, -164.92418129971446, -249.19032561461921, 150.92817718858282, 298.17509784278229); + double4x3 r0 = double4x3(171.00757368421534, -486.57132076032991, -446.56510946087781, -703.80493244519687, -141.26509959123337, -367.46309011404549, 79.494317568603151, -55.399645354319205, -505.27886414214919, -589.54500845705388, -189.4265056538519, -42.179584999652434); + TestUtils.AreEqual(r0, a0 + b0); + + double a1 = (-457.15341803857751); + double4x3 b1 = double4x3(424.71807094324288, -301.85750283946163, 230.28885208363124, -423.58759351428023, -67.060037882560891, 68.7241366229598, -164.02241833695325, 318.93515339444161, 7.8045504129512437, 187.69836029210046, -3.6569664495331153, -446.0830535581722); + double4x3 r1 = double4x3(-32.435347095334635, -759.01092087803909, -226.86456595494627, -880.7410115528578, -524.21345592113835, -388.42928141561771, -621.17583637553071, -138.2182646441359, -449.34886762562627, -269.45505774647705, -460.81038448811063, -903.23647159674965); + TestUtils.AreEqual(r1, a1 + b1); + + double a2 = (-209.28724227160552); + double4x3 b2 = double4x3(-38.212905186327589, -346.25717870623674, 465.60741708502519, -192.18595108398512, 278.69379843338106, 381.97845548297209, 481.24367283342576, -97.228162095522578, -455.51374289743313, 501.83498858932171, 358.70657818331688, 430.69978519468555); + double4x3 r2 = double4x3(-247.50014745793311, -555.54442097784226, 256.32017481341967, -401.47319335559064, 69.406556161775541, 172.69121321136657, 271.95643056182024, -306.5154043671281, -664.80098516903865, 292.54774631771619, 149.41933591171136, 221.41254292308003); + TestUtils.AreEqual(r2, a2 + b2); + + double a3 = (256.987155795557); + double4x3 b3 = double4x3(207.65164837970008, -376.96518605619912, -428.08534093763927, -373.493553097124, -468.89328573126966, -467.65843818507085, 297.48495139623287, -506.89978646994558, -233.35846315760097, 434.55879493921941, -387.3151673690021, 171.59027751329836); + double4x3 r3 = double4x3(464.63880417525706, -119.97803026064213, -171.09818514208229, -116.506397301567, -211.90612993571267, -210.67128238951386, 554.47210719178986, -249.91263067438859, 23.628692637956021, 691.5459507347764, -130.32801157344511, 428.57743330885535); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void double4x3_operator_sub_wide_wide() + { + double4x3 a0 = double4x3(160.4922617229131, 11.223957305412682, 359.20010607279846, -498.22830485656311, -355.25362913462038, -94.534852787170053, -410.46404786150163, -401.38464398001537, 317.70681944382693, 447.0604133303558, -489.07414482956477, -230.00838218909149); + double4x3 b0 = double4x3(115.46876078260539, -130.98230630298252, 241.54083716196044, 9.9870860623135513, 419.89512582304656, 59.124466208333388, -402.38163847587145, -75.370143687059226, 320.97960796997859, -73.908757482612884, -31.444742455819949, -389.25194734579509); + double4x3 r0 = double4x3(45.023500940307713, 142.2062636083952, 117.65926891083802, -508.21539091887666, -775.14875495766694, -153.65931899550344, -8.0824093856301715, -326.01450029295614, -3.2727885261516576, 520.96917081296874, -457.62940237374482, 159.2435651567036); + TestUtils.AreEqual(r0, a0 - b0); + + double4x3 a1 = double4x3(24.875419389864192, 366.61447136784648, -107.3741567634857, -219.0081404275299, 473.90756891384137, 259.63620793988753, -360.119631219711, 7.8096120393879573, 437.42847439154446, -59.1991718091067, 418.74433322378638, 183.14215072576985); + double4x3 b1 = double4x3(-375.02884000122026, 259.18275821357167, 276.648654351313, -453.06919905779381, -272.57653225240136, -191.14805301984217, 87.136884968325944, 430.02477594373033, 343.65711538105143, 121.02942067060133, -354.1881703595576, 249.05200373802893); + double4x3 r1 = double4x3(399.90425939108445, 107.4317131542748, -384.02281111479869, 234.06105863026391, 746.48410116624268, 450.78426095972969, -447.25651618803693, -422.21516390434238, 93.771359010493029, -180.22859247970803, 772.932503583344, -65.909853012259077); + TestUtils.AreEqual(r1, a1 - b1); + + double4x3 a2 = double4x3(271.23036516421962, 496.20853709439211, 165.35493691514944, -227.40367113212295, -166.52285702830312, 356.14227430715334, 386.92636579411396, -394.63875717420075, 126.90326625057651, 97.2168972944919, -150.01784641575898, -227.25051246734824); + double4x3 b2 = double4x3(-2.2254426489702723, 22.447240601502017, 478.1129555544411, -320.0629958212669, -111.52409534879217, 222.22894607401872, -245.41106307013473, -119.90228348593337, -153.46565372937624, 374.11248439089979, 301.7634090398268, -281.43006552449896); + double4x3 r2 = double4x3(273.45580781318989, 473.7612964928901, -312.75801863929166, 92.659324689143943, -54.998761679510949, 133.91332823313462, 632.33742886424875, -274.73647368826738, 280.36891997995275, -276.89558709640789, -451.78125545558578, 54.179553057150713); + TestUtils.AreEqual(r2, a2 - b2); + + double4x3 a3 = double4x3(-198.83000406940931, 0.66276812584271738, -484.2455706467133, -295.99628056958147, -46.170990726990169, 499.95239304935205, 292.44011725692087, -106.42413597294325, 466.82713887972159, 487.37480400846096, 242.9946106611726, -468.90158985038363); + double4x3 b3 = double4x3(-494.96436261337453, -320.73126021061614, 160.96219714030724, -132.93641025057826, -394.43753237018245, 406.85128588548457, 270.54461897096814, 507.79461335940039, 67.699203761154422, 263.40446412908125, 297.58066596536923, 170.83953746167924); + double4x3 r3 = double4x3(296.13435854396522, 321.39402833645886, -645.20776778702054, -163.05987031900321, 348.26654164319228, 93.101107163867482, 21.895498285952726, -614.21874933234358, 399.12793511856717, 223.97033987937971, -54.586055304196634, -639.74112731206287); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void double4x3_operator_sub_wide_scalar() + { + double4x3 a0 = double4x3(207.38960108877609, 248.45773684627272, -384.82393211164697, -205.34476122881506, -374.81156152058929, 191.64204820973896, 18.856238135535364, -44.96160151667965, 480.85798738936796, 16.338193185784917, -366.86545269883493, -35.523088233323335); + double b0 = (-36.112476604111691); + double4x3 r0 = double4x3(243.50207769288778, 284.57021345038441, -348.71145550753528, -169.23228462470337, -338.6990849164776, 227.75452481385065, 54.968714739647055, -8.8491249125679587, 516.9704639934796, 52.450669789896608, -330.75297609472324, 0.589388370788356); + TestUtils.AreEqual(r0, a0 - b0); + + double4x3 a1 = double4x3(349.39776460705218, 490.2222661870635, 195.02405104181923, -384.84940952102158, 189.05188545447402, 55.602777745389744, -54.931482579061537, 53.088051582261983, 316.80250730961677, -273.80670917863335, 256.88723695319482, 297.17363156805447); + double b1 = (439.07729336203886); + double4x3 r1 = double4x3(-89.679528754986677, 51.144972825024638, -244.05324232021962, -823.92670288306044, -250.02540790756484, -383.47451561664911, -494.0087759411004, -385.98924177977688, -122.27478605242209, -712.88400254067221, -182.19005640884404, -141.90366179398438); + TestUtils.AreEqual(r1, a1 - b1); + + double4x3 a2 = double4x3(101.82901363346218, -19.732211837420323, 336.58969966349639, -51.876563334780087, 317.34576311583896, -467.05592773251976, -50.167055391784345, 477.804535373023, -60.821922092149919, 0.41113877315592617, 46.660927078994405, -19.241408595462076); + double b2 = (136.60794765157993); + double4x3 r2 = double4x3(-34.778934018117752, -156.34015948900026, 199.98175201191646, -188.48451098636002, 180.73781546425903, -603.6638753840997, -186.77500304336428, 341.19658772144305, -197.42986974372985, -136.196808878424, -89.947020572585529, -155.849356247042); + TestUtils.AreEqual(r2, a2 - b2); + + double4x3 a3 = double4x3(396.80972809195976, -334.27423373529416, -198.07713684722648, -239.20061432532992, -339.68122665010446, -14.514425522887336, 219.99709211103482, -180.26066621591366, -438.89060398512083, 186.35550102328671, -365.06679241967703, -478.80124615076988); + double b3 = (69.590537342052244); + double4x3 r3 = double4x3(327.21919074990751, -403.8647710773464, -267.66767418927873, -308.79115166738217, -409.27176399215671, -84.10496286493958, 150.40655476898257, -249.8512035579659, -508.48114132717308, 116.76496368123446, -434.65732976172927, -548.39178349282213); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void double4x3_operator_sub_scalar_wide() + { + double a0 = (-86.008225719448262); + double4x3 b0 = double4x3(466.42511413359318, 298.48694219183506, -300.95010652251085, 315.38003006362362, -381.09218543632522, -125.00837546447684, 58.466194418476107, 214.74609361158036, -257.54942739082009, 480.22459505508868, -443.35507723472784, 260.79503858312728); + double4x3 r0 = double4x3(-552.43333985304139, -384.49516791128332, 214.94188080306259, -401.38825578307188, 295.08395971687696, 39.00014974502858, -144.47442013792437, -300.75431933102863, 171.54120167137182, -566.232820774537, 357.34685151527958, -346.80326430257554); + TestUtils.AreEqual(r0, a0 - b0); + + double a1 = (29.681931747906788); + double4x3 b1 = double4x3(139.85773164586055, -247.78996216868512, -248.4662297929014, 91.445112509394562, 86.384162704639266, 373.81828206303453, 260.41195428576873, 114.35393171867076, -464.40545318294573, -109.74146156652898, -311.67535057276268, 107.86401586787031); + double4x3 r1 = double4x3(-110.17579989795377, 277.47189391659191, 278.14816154080819, -61.763180761487774, -56.702230956732478, -344.13635031512774, -230.73002253786194, -84.671999970763977, 494.08738493085252, 139.42339331443577, 341.35728232066947, -78.18208411996352); + TestUtils.AreEqual(r1, a1 - b1); + + double a2 = (-258.7951592219971); + double4x3 b2 = double4x3(14.097560173877355, -461.97019527012958, 30.310863747406188, 63.701105862716759, -462.67674634544028, 39.759483117498235, 47.998150132595583, -177.61928113625351, 202.47706017386031, -289.30880250097664, -459.92539832551284, 248.38668715599306); + double4x3 r2 = double4x3(-272.89271939587445, 203.17503604813248, -289.10602296940328, -322.49626508471385, 203.88158712344318, -298.55464233949533, -306.79330935459268, -81.175878085743591, -461.27221939585741, 30.513643278979544, 201.13023910351575, -507.18184637799015); + TestUtils.AreEqual(r2, a2 - b2); + + double a3 = (85.3297222057962); + double4x3 b3 = double4x3(-73.374776159122, -510.65201044019869, 426.96324535224733, 239.5901807470201, 477.85233257610923, 256.01360785961788, 338.620331683485, -483.83120440125055, 330.39224139339865, -263.41821706640451, 123.92803603221103, -269.11598194256237); + double4x3 r3 = double4x3(158.70449836491821, 595.981732645995, -341.63352314645113, -154.2604585412239, -392.52261037031303, -170.68388565382168, -253.2906094776888, 569.1609266070468, -245.06251918760245, 348.74793927220071, -38.598313826414824, 354.44570414835857); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void double4x3_operator_mul_wide_wide() + { + double4x3 a0 = double4x3(-482.71381710596097, -407.29348559272171, 137.70058995937029, 208.54113278563182, 194.296573967811, -484.24241684574747, 183.98730739578014, -241.33547770294149, 45.868758938214114, 363.32610266438041, -328.11893692990714, -471.02307413100408); + double4x3 b0 = double4x3(-236.36788355389979, 260.72759139757954, -416.38629718142852, -364.49561541364324, -253.14750897751537, -369.20287220981106, 193.54791531038836, 169.08491976982214, 201.96966442930034, 249.45608317547294, -308.19319810913555, -385.57964843585137); + double4x3 r0 = double4x3(114098.04331156026, -106192.64949051509, -57336.638772880389, -76012.328533757158, -49185.69370281692, 178783.69114527057, 35610.359790024842, -40806.189885013562, 9264.0978505395742, 90633.9064860661, 101124.02453259782, 181616.91132860651); + TestUtils.AreEqual(r0, a0 * b0); + + double4x3 a1 = double4x3(-262.68257415605831, -379.26274674910246, -374.09058182970182, 481.44738720424812, 104.62807397946165, 412.93539948618752, 477.87724731763694, 20.377821216535722, 291.99596299417124, -138.48832399141429, -393.46498483860165, 9.36312318284206); + double4x3 b1 = double4x3(-183.27959522198864, 22.275629292370581, -265.52144229855458, -95.677454277722859, 133.25437146669924, 148.31146080247663, 249.284127113076, 500.00547503866505, -19.331578978957396, -36.691062705913112, 30.5238278054278, -401.36701054189678); + double4x3 r1 = double4x3(48144.355863192381, -8448.3163509892329, 99329.070837727879, -46063.660376363579, 13942.148235904471, 61243.052314850727, 119127.21246477668, 10189.022177626932, -5644.7430201585421, 5081.2837796057929, -12010.057444678736, -3758.048761232847); + TestUtils.AreEqual(r1, a1 * b1); + + double4x3 a2 = double4x3(-131.94228917543882, 364.44964258952518, 390.61597866128011, 418.79794974755396, -277.34480942289565, 11.410165553637853, 474.87644956767394, -502.40503358394142, -222.59489618176354, 38.169053810727291, 292.61251582420084, 203.20767245218519); + double4x3 b2 = double4x3(3.4372422711165882, 257.24176681099539, -290.97193516929258, 337.47938100317469, 490.28616284312966, -191.01981481864107, -325.73449650673871, -52.181983733634468, 123.43503743197539, -461.2670640709191, 122.35306149458188, 308.58463182513822); + double4x3 r2 = double4x3(-453.51761370170692, 93751.669973365249, -113658.28721911977, 141335.67284620318, -135978.32239641057, -2179.56771110594, -154683.64120283397, 26216.491290173308, -27476.00934236266, -17606.127389639103, 35802.037142722758, 62706.764787700849); + TestUtils.AreEqual(r2, a2 * b2); + + double4x3 a3 = double4x3(-330.40815678723538, 469.4601201813017, 342.29512588227874, -504.11466359724972, 319.35728159516918, -357.7820815321906, -117.9710848880797, 25.706567060997031, 226.45642171914528, -86.343729774627718, -274.12603844056184, -486.87097452900883); + double4x3 b3 = double4x3(375.32062762571525, 203.21264204905026, 77.667988574909032, 218.793598038514, -489.89573620720569, 134.47217589918159, -287.79437960674727, -116.39999085124583, -436.54398151698706, 499.59108447450728, -300.60236396482321, 105.73045950091); + double4x3 r3 = double4x3(-124008.99677804091, 95400.23135870698, 26585.373926271874, -110297.06107241736, -156451.77058019731, -48111.735001372064, 33951.415186899816, -2992.2441707169919, -98858.187977365582, -43136.557595680068, 82402.935179544889, -51477.091854607956); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void double4x3_operator_mul_wide_scalar() + { + double4x3 a0 = double4x3(-96.318821236639678, -277.14229239017811, -239.93690191951436, 509.53140544776409, 255.85810172551226, 215.73149667295229, -455.50827500573746, -389.24327367788334, -338.29248658674419, 53.796284939067618, 243.75734459783757, 135.35469991311186); + double b0 = (-301.20720424373042); + double4x3 r0 = double4x3(29011.922860739887, 83477.255068544036, 72270.723422079071, -153474.5301092997, -77066.303503849529, -64979.880980175592, 137202.37402436248, 117242.87823519246, 101896.13410145289, -16203.828585195659, -73421.468280190238, -40769.81074207752); + TestUtils.AreEqual(r0, a0 * b0); + + double4x3 a1 = double4x3(-207.35010275959507, -31.425238862366086, 42.676120539510634, 260.38388049806645, 176.86755927692525, 25.672123205695357, -290.50059689697838, 207.09101805793637, -156.52330858843555, -208.4020064847553, 370.94506400215676, -341.59844247512444); + double b1 = (-383.93960946795517); + double4x3 r1 = double4x3(79609.9174766593, 12065.393936254042, -16385.053053547093, -99971.685390178332, -67906.461636333086, -9856.5449578079042, 111534.68572283375, -79510.444597485344, 60095.497972076177, 80013.784982095211, -142420.50300705369, 131153.17259876104); + TestUtils.AreEqual(r1, a1 * b1); + + double4x3 a2 = double4x3(10.270311121954705, -61.006107120311867, 186.27978214355176, -487.65221785365242, -129.37681800191143, -317.71628990663044, -207.62735686433842, 388.87138933170183, -233.33533274072005, 128.4155209662465, 510.38953399583215, 267.57635486665015); + double b2 = (-176.88876565587185); + double4x3 r2 = double4x3(-1816.7026572643401, 10791.294985981862, -32950.800730017589, 86260.198885480888, 22885.305640842493, 56200.442350346995, 36726.946872124034, -68786.980057768713, 41274.398992408111, -22715.262994775076, -90282.1746721984, -47331.251131059282); + TestUtils.AreEqual(r2, a2 * b2); + + double4x3 a3 = double4x3(-309.20967569444781, -189.56950983291932, 233.20923887622041, -331.08696261564592, -98.644771860281367, -214.18099389513071, -87.880760949049488, -493.16573475914345, -407.30606551063528, -411.37138362013332, 477.93567512833317, 364.7485498696326); + double b3 = (-36.482969062627717); + double4x3 r3 = double4x3(11280.88703222569, 6916.0585624518963, -8508.1654470401063, 12079.03541414599, 3598.8541599686141, 7813.95857407891, 3206.1510829043546, 17992.150243965898, 14859.734587045124, 15008.049461863682, -17436.512449633072, -13307.11006053213); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void double4x3_operator_mul_scalar_wide() + { + double a0 = (37.432166355397612); + double4x3 b0 = double4x3(96.747546479454058, 492.18539427788244, -274.05458534604617, -452.87096926796761, 420.85330434369541, 102.18292694081686, -114.94887762654054, -351.12003843445336, -464.66496799172131, 444.08484646495663, 447.10525605040846, 130.82935124767448); + double4x3 r0 = double4x3(3621.4702542954869, 18423.565556306661, -10258.456829132712, -16951.941459168724, 15753.450899411988, 3824.9283199300971, -4302.785509682908, -13143.183689392061, -17393.41638139162, 16623.057848787463, 16736.118322851533, 4897.2260400716978); + TestUtils.AreEqual(r0, a0 * b0); + + double a1 = (-321.41334191030512); + double4x3 b1 = double4x3(445.30131861441828, 478.24357317306271, 358.57170622356784, -144.89011222910608, -438.89383741789209, -3.536441089369589, -471.80755470311624, -42.560401697904069, 119.91104155402218, 271.9000023677479, 239.6840079946835, 487.44143389511919); + double4x3 r1 = double4x3(-143125.78497292573, -153713.86510067963, -115249.73041179709, 46569.615181316156, 141066.33502832282, 1136.6593490031996, 151645.24289565769, 13679.48094276837, -38541.008597823733, -87392.288426437735, -77037.638012027513, -156670.18025378135); + TestUtils.AreEqual(r1, a1 * b1); + + double a2 = (-79.188288010278825); + double4x3 b2 = double4x3(-112.92564468873928, 161.3700478828373, 459.75914332818195, -337.19599811043406, -276.83451689259823, 469.72386405883537, -274.56515110403541, 506.78586625810055, 65.882571966332648, 495.8556585236712, -347.27959148365983, -343.60605232026711); + double4x3 r2 = double4x3(8942.3884753582988, -12778.617827978605, -36407.539457231134, 26701.973814282486, 21922.051454877466, -37196.628632392116, 21742.344263212082, -40131.505136785112, -5217.1280837278719, -39265.960698698946, 27500.476310500027, 27209.575033212248); + TestUtils.AreEqual(r2, a2 * b2); + + double a3 = (-183.70378860444936); + double4x3 b3 = double4x3(460.26475808595524, 437.513251746778, -324.55724755141756, -112.28778343661122, 273.13543070160574, -283.09366072485864, 1.8802692898923397, -310.81670322586626, 326.01218357962193, 243.64321982285162, 78.179342067884022, -308.66400184699523); + double4x3 r3 = double4x3(-84552.379821500348, -80372.841910535339, 59622.395994227547, 20627.691231301418, -50176.013421993011, 52005.378005059138, -345.41259214982045, 57098.205944136411, -59889.673254785805, -44758.18254924452, -14361.841328473502, 56702.746545103779); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void double4x3_operator_div_wide_wide() + { + double4x3 a0 = double4x3(-353.13144390337703, -102.79985456485292, 51.319128298814917, -191.87167868012176, 8.0418245829836223, -128.73764210973758, -136.05959779399427, -370.4710053738537, -237.69456326109105, -432.54687496300176, 200.26549181727012, 361.44157068871039); + double4x3 b0 = double4x3(-178.73954805114283, -302.09628381491467, -199.40583739029518, 278.85077561012042, 502.33758782890516, -361.48483078623417, 353.121059820578, -38.894930142394685, -75.764737402910725, -195.21784719974636, -405.03399224068687, -394.2300085473014); + double4x3 r0 = double4x3(1.97567604793504, 0.34028837848212429, -0.25736021056579439, -0.68808013268139567, 0.016008805189634039, 0.35613566917796119, -0.3853058151307277, 9.5249176182488586, 3.1372716570909582, 2.2157137842034547, -0.49444119667433889, -0.9168291678773689); + TestUtils.AreEqual(r0, a0 / b0); + + double4x3 a1 = double4x3(-416.22613234828509, -450.01919362042992, -273.49744594911925, -286.90817011841955, -314.25606241554772, 177.76210340194507, 97.626988217992221, -68.107280047660367, -386.45074027890837, 263.69934690357161, -297.0270885420158, -501.77703046322659); + double4x3 b1 = double4x3(-375.82771342612227, -121.24548655433836, 447.623344391409, 338.28628007429018, -405.54420752336466, -431.16893526127978, 296.20513095343722, 437.939790691221, 39.21061684527001, 331.2897075765253, -310.61955156485533, 207.26946959610541); + double4x3 r1 = double4x3(1.1074918572499153, 3.7116366671409717, -0.61099906735420106, -0.84812239519560884, 0.77489964493560781, -0.41227947763496636, 0.32959249525403717, -0.15551745124635385, -9.855767936625206, 0.79597808465769837, 0.95624080018671487, -2.420892143165184); + TestUtils.AreEqual(r1, a1 / b1); + + double4x3 a2 = double4x3(-263.40686071263946, -451.08085248017721, -416.34552903489464, -315.27873411554788, -28.181118739853218, -397.87015146662952, -261.38664376986526, 40.348221559239619, 277.24575794732471, 464.77123162931355, -336.64104358136706, 375.47808163961304); + double4x3 b2 = double4x3(-223.2929938879297, -480.091406807346, 448.67593666942605, -460.0974516626901, -220.56984601755153, -84.853158275062754, 441.3738078742166, 72.418480191574645, 44.9760778159723, -242.51539027062961, -451.30207011257392, -21.899694214528267); + double4x3 r2 = double4x3(1.1796467776541293, 0.93957285234474042, -0.92794263076704353, 0.68524338262731188, 0.12776505605218016, 4.6889256635195675, -0.59221149761645042, 0.55715366371267527, 6.1642938070706279, -1.9164607702243661, 0.74593285933165443, -17.145357280400777); + TestUtils.AreEqual(r2, a2 / b2); + + double4x3 a3 = double4x3(504.34254264474964, -320.76710692083793, -156.73333914425848, 414.79707999471441, -386.05068296289568, -369.8386258416989, 386.70419687158619, 242.63180910918481, 421.73452659218322, 109.01218347857343, 182.07528242006674, 187.32643446108625); + double4x3 b3 = double4x3(-358.4866656542228, -350.94512502799978, -481.84813688781492, 406.39341921657012, -145.28866321653533, 461.7955479388105, -318.81676331107354, -250.93199908497371, 125.85955506463517, -193.80316576445625, -495.25412177259761, -315.82454815312497); + double4x3 r3 = double4x3(-1.4068655572567703, 0.914009296739044, 0.32527538688138485, 1.0206786340053058, 2.6571287422992764, -0.80087092110880154, -1.2129355836106837, -0.96692255269931449, 3.3508343993080341, -0.56248917838145251, -0.36764011527736257, -0.59313449684811248); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void double4x3_operator_div_wide_scalar() + { + double4x3 a0 = double4x3(171.34242184988341, 0.10338377957384637, 57.888263967767443, -256.13074529177078, 95.6696842162263, -290.38690461329509, -127.44869118903239, -79.7448890580539, 146.46688110496234, -499.84355687529012, 58.686315802245531, -453.20579859856787); + double b0 = (171.79682191265601); + double4x3 r0 = double4x3(0.99735501473360411, 0.00060177934855167557, 0.33695771157628673, -1.4908933846400916, 0.55687691513214455, -1.6902926455818372, -0.74185709473618289, -0.46418139852783397, 0.85255873463962106, -2.909504095072363, 0.34160303519515922, -2.6380336583233435); + TestUtils.AreEqual(r0, a0 / b0); + + double4x3 a1 = double4x3(-205.03382143985192, 464.47907159499778, -293.46349753693841, -158.50557930697948, -289.5822156824089, 494.12860535743118, 203.58342680874443, 180.97040160976837, 259.11918723728468, 460.84470603468117, 490.95625924084163, -280.47805536933151); + double b1 = (481.73814247629514); + double4x3 r1 = double4x3(-0.42561259605874163, 0.96417333534650185, -0.60917637957509008, -0.32902850185830795, -0.60111955053809829, 1.0257203276814348, 0.42260184290630909, 0.37566135137134876, 0.53788389249255919, 0.95662905923493058, 1.0191351191690206, -0.582220984054907); + TestUtils.AreEqual(r1, a1 / b1); + + double4x3 a2 = double4x3(-320.24387112271222, 264.80085885934568, 226.85298524929817, -192.23568949114332, 460.97652957447644, -437.89221760159927, -413.23271794488312, 249.47184693509337, 313.03501739773662, 216.78560195527302, 383.73890298592812, 82.023314752626789); + double b2 = (192.41448912043802); + double4x3 r2 = double4x3(-1.6643438474233712, 1.3762002023329898, 1.1789807840682105, -0.99907075797611689, 2.3957474911670364, -2.2757756944567169, -2.14761746807034, 1.2965335826604067, 1.6268786141245246, 1.126659447249736, 1.9943347548309338, 0.4262845024175177); + TestUtils.AreEqual(r2, a2 / b2); + + double4x3 a3 = double4x3(189.57466062790468, -391.92216343056509, 121.28058701440716, 417.90175147443165, -133.26287013537382, -428.74240299162568, -188.53187641339929, 356.25952570338711, 181.96896823773579, -140.8904808223669, 474.08261678837357, -451.35772511519383); + double b3 = (314.50384273869167); + double4x3 r3 = double4x3(0.60277374984385956, -1.2461601741260666, 0.38562513563681389, 1.3287651681307089, -0.42372413950470061, -1.3632342271501279, -0.59945810127999832, 1.1327668450760029, 0.57859060370504389, -0.44797697730970815, 1.5073984872810262, -1.4351421629217054); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void double4x3_operator_div_scalar_wide() + { + double a0 = (-264.44250095283729); + double4x3 b0 = double4x3(105.58908157497137, -142.34910137129441, -288.94890679463231, 39.644133824689334, -363.99138396046658, -149.71822006521666, -395.72912306139671, 258.71868693955184, -9.6662514254759344, 117.72553282497711, -331.38655797177296, -509.98602676297821); + double4x3 r0 = double4x3(-2.5044492954044237, 1.85770404172122, 0.915187753732487, -6.670406827961755, 0.72650758398599513, 1.7662679988958405, 0.66824119212426392, -1.0221236976771717, 27.357295947825712, -2.2462629355518375, 0.79798801306648692, 0.51852891466718543); + TestUtils.AreEqual(r0, a0 / b0); + + double a1 = (427.8964666928614); + double4x3 b1 = double4x3(467.61712882836218, -407.12461943511136, 252.69070994699871, 444.59937664708093, -88.313306134340053, 199.95503411067421, -218.34692607556792, -13.417186028052697, -296.13107575854804, 0.561349630617201, -289.29929865957206, 196.21833929615946); + double4x3 r1 = double4x3(0.915057298617305, -1.0510208576591884, 1.6933604990172044, 0.96243154886949345, -4.8452094641543111, 2.1399634602648847, -1.9597091398702369, -31.891669817964367, -1.4449563106364052, 762.26373610042538, -1.4790788248552968, 2.1807159729704049); + TestUtils.AreEqual(r1, a1 / b1); + + double a2 = (334.73346845001606); + double4x3 b2 = double4x3(-282.39273203648293, -479.50358436978587, -473.43943927876626, 105.0507777226394, -287.63127841038227, 77.299297130340392, -210.89436421678141, -184.0682357214709, -315.14843645465953, 87.86691264429453, 101.5905373569534, 345.93639890567226); + double4x3 r2 = double4x3(-1.1853473212149495, -0.698083349866838, -0.70702489205366215, 3.1863968616567222, -1.1637589287922645, 4.3303559136585132, -1.5872091684059353, -1.818529238018717, -1.0621454201571907, 3.8095508124325947, 3.2949276296657475, 0.96761563544311813); + TestUtils.AreEqual(r2, a2 / b2); + + double a3 = (-146.31811744827689); + double4x3 b3 = double4x3(479.99991177022457, -172.67688401633728, -178.0136545533378, 361.76045315422141, 349.37693111476347, -398.68612951724145, -243.7800091448147, 296.62295045360133, 477.81065224009126, 486.60035942802222, 256.91724622292315, -89.8642156542578); + double4x3 r3 = double4x3(-0.3048294673819007, 0.84735208352748281, 0.82194884328064821, -0.40446133946515234, -0.41879730576777624, 0.36700077232546224, 0.60020556222622135, -0.4932798262053712, -0.30622615205898479, -0.30069463495725229, -0.56951457949739548, 1.6282133703944957); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void double4x3_operator_mod_wide_wide() + { + double4x3 a0 = double4x3(-388.81249422059045, 181.68118842955732, -167.07872470052854, 432.82015319951813, -258.43895995730486, -170.11079629236406, 283.318293464984, 122.71651297561664, 335.27101413126616, -503.60851668920765, 191.02251848532933, 289.74269379756538); + double4x3 b0 = double4x3(436.94417187056695, 58.940049437312382, -201.11623368091705, 279.2893537391393, -397.07975954426445, 377.89994758083481, 174.69386657266591, -228.17652736798698, -317.06019106370405, -417.48011107811709, -249.9759434433542, -397.57157177364991); + double4x3 r0 = double4x3(-388.81249422059045, 4.8610401176201776, -167.07872470052854, 153.53079946037883, -258.43895995730486, -170.11079629236406, 108.62442689231807, 122.71651297561664, 18.210823067562103, -86.128405611090557, 191.02251848532933, 289.74269379756538); + TestUtils.AreEqual(r0, a0 % b0); + + double4x3 a1 = double4x3(-124.03371745163281, 259.27395761165485, -274.35845030208975, -140.03080398404541, 324.5775689205982, -200.51308903494527, 211.42317328761476, -51.272212767634642, -230.63392483006879, 99.989400671790122, 399.18986649028489, 24.903281461868119); + double4x3 b1 = double4x3(-358.74544947163452, -198.1592100589346, 208.73709378425826, -12.119406944196385, 25.27141596063575, -194.12068495253135, -493.8717965995296, -312.3016990685378, -216.98060546488529, 413.57096047586344, -436.39440151508637, 3.4912750737235); + double4x3 r1 = double4x3(-124.03371745163281, 61.114747552720246, -65.621356517831487, -6.7173275978851734, 21.3205773929692, -6.3924040824139183, 211.42317328761476, -51.272212767634642, -13.653319365183506, 99.989400671790122, 399.18986649028489, 0.46435594580361794); + TestUtils.AreEqual(r1, a1 % b1); + + double4x3 a2 = double4x3(50.92402961241271, -364.86367886367429, -252.62662398658068, -281.28977955565313, -364.79852192699843, -329.02623311105475, 51.6098087074281, 41.647804041229051, 254.95104443978096, -458.67762133976333, -136.79304439238882, 72.400299344398263); + double4x3 b2 = double4x3(-308.23343076754054, -441.37506195594324, 84.6008532441225, 373.16344922276369, 67.252760203207231, -320.33327522889397, 118.97936325845274, 44.823946258436877, 354.00861065183233, -253.95312249565177, -195.16280207185207, 317.14281073079576); + double4x3 r2 = double4x3(50.92402961241271, -364.86367886367429, -83.424917498335674, -281.28977955565313, -28.534720910962278, -8.6929578821607834, 51.6098087074281, 41.647804041229051, 254.95104443978096, -204.72449884411157, -136.79304439238882, 72.400299344398263); + TestUtils.AreEqual(r2, a2 % b2); + + double4x3 a3 = double4x3(246.21202170393053, 325.1538137519517, 162.03465588485574, -284.76143826393479, 128.35126906649737, 262.91676032865269, 61.600772647932558, -271.4927829576157, -205.43880448371118, -341.32216302553292, 347.1544365115252, 148.0884922240341); + double4x3 b3 = double4x3(320.6931823793301, -103.99687604978533, 388.17173332170194, -199.63931593654644, -256.21731746206865, -478.12501953454921, -210.65574202810217, -272.02328432352431, -61.676538257709012, -367.82958691559247, -242.93893753874067, 162.38671191147841); + double4x3 r3 = double4x3(246.21202170393053, 13.163185602595718, 162.03465588485574, -85.122122327388354, 128.35126906649737, 262.91676032865269, 61.600772647932558, -271.4927829576157, -20.409189710584144, -341.32216302553292, 104.21549897278453, 148.0884922240341); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void double4x3_operator_mod_wide_scalar() + { + double4x3 a0 = double4x3(-244.49962889612635, -211.81931958525411, -145.92677576184587, -304.91822090042672, 155.47946436492703, -133.90778428591221, 281.30965412841624, -226.53575311719243, 335.16613046041039, 101.70649032560482, 319.47152033423606, -285.40231646476423); + double b0 = (39.634963769295723); + double4x3 r0 = double4x3(-6.6898462803520147, -13.644500738775491, -27.021884453958705, -27.473474515356656, 36.574573057039856, -15.002892978025045, 3.86490774334618, -28.360934270713813, 18.0864203060446, 22.436562787013372, 2.3918101798702764, -7.9575700796941646); + TestUtils.AreEqual(r0, a0 % b0); + + double4x3 a1 = double4x3(-355.84685985923136, -330.87193957477433, -284.34358109363518, -102.68343811048356, -172.14173921017988, 206.41684517935698, -416.71365447375626, -339.256669917729, 435.29751440291182, 132.55290490600885, 226.94410215455298, -306.11827268550093); + double b1 = (259.37800061860025); + double4x3 r1 = double4x3(-96.4688592406311, -71.493938956174077, -24.965580475034926, -102.68343811048356, -172.14173921017988, 206.41684517935698, -157.335653855156, -79.878669299128774, 175.91951378431156, 132.55290490600885, 226.94410215455298, -46.740272066900673); + TestUtils.AreEqual(r1, a1 % b1); + + double4x3 a2 = double4x3(115.43844633709568, -218.3474491659307, -140.04050237501065, -462.32346961569203, -211.60869822819188, 351.33104555277669, 321.04701176334504, 346.08518497370426, -94.407745643708722, 465.40920446133669, -367.19701617173712, -467.51058957889239); + double b2 = (281.88292015804109); + double4x3 r2 = double4x3(115.43844633709568, -218.3474491659307, -140.04050237501065, -180.44054945765095, -211.60869822819188, 69.4481253947356, 39.164091605303952, 64.20226481566317, -94.407745643708722, 183.5262843032956, -85.31409601369603, -185.6276694208513); + TestUtils.AreEqual(r2, a2 % b2); + + double4x3 a3 = double4x3(415.21510215067076, -3.729830982037754, 128.24987822782714, 134.94156104649494, 247.61696230974837, -285.28786553316183, 433.76666017704019, -141.83102209019989, -229.7818902608854, 471.21804283150379, 377.68146651689028, 433.40759559786306); + double b3 = (506.18618011203887); + double4x3 r3 = double4x3(415.21510215067076, -3.729830982037754, 128.24987822782714, 134.94156104649494, 247.61696230974837, -285.28786553316183, 433.76666017704019, -141.83102209019989, -229.7818902608854, 471.21804283150379, 377.68146651689028, 433.40759559786306); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void double4x3_operator_mod_scalar_wide() + { + double a0 = (-66.945025236785909); + double4x3 b0 = double4x3(-249.77609479137516, -396.07375664081133, 386.49204582091977, 168.93948109864232, -199.4182442163202, 261.7517141130528, 16.127438791155555, 257.66814744550186, -75.788451945310669, 170.95630439136005, -242.85828005655588, 425.94531913564788); + double4x3 r0 = double4x3(-66.945025236785909, -66.945025236785909, -66.945025236785909, -66.945025236785909, -66.945025236785909, -66.945025236785909, -2.4352700721636893, -66.945025236785909, -66.945025236785909, -66.945025236785909, -66.945025236785909, -66.945025236785909); + TestUtils.AreEqual(r0, a0 % b0); + + double a1 = (303.27240409668184); + double4x3 b1 = double4x3(3.033060790520608, -505.74352788633831, 461.95706126743789, 205.97275672013529, 270.04063642678807, -47.480711720642034, -150.254496405951, 149.49949009227544, -220.29804263836616, 31.118842377848409, 400.63568348467152, 6.2314283876826266); + double4x3 r1 = double4x3(2.999385835141652, 303.27240409668184, 303.27240409668184, 97.299647376546545, 33.23176766989377, 18.388133772829633, 2.7634112847798633, 4.2734239121309656, 82.974361458315684, 23.202822696046155, 303.27240409668184, 4.1638414879157608); + TestUtils.AreEqual(r1, a1 % b1); + + double a2 = (-39.050740021770252); + double4x3 b2 = double4x3(-71.941097054603063, -495.30713843521994, -86.71961859926563, -436.97006365143233, -472.2947320753218, -130.00875359867177, -251.51684605866524, 281.97637022751212, 388.86081928241106, 50.615297579493017, 293.870868581287, 123.74424820940203); + double4x3 r2 = double4x3(-39.050740021770252, -39.050740021770252, -39.050740021770252, -39.050740021770252, -39.050740021770252, -39.050740021770252, -39.050740021770252, -39.050740021770252, -39.050740021770252, -39.050740021770252, -39.050740021770252, -39.050740021770252); + TestUtils.AreEqual(r2, a2 % b2); + + double a3 = (422.90433211946129); + double4x3 b3 = double4x3(-53.8761976016109, -178.85765966161046, -362.27595799149753, 361.08526747351755, 465.27609822958527, -269.88963306596952, -159.40897734435691, -29.095214618879936, 484.49945067078784, -354.95061008769585, -328.69059411095952, -171.73922236810404); + double4x3 r3 = double4x3(45.770948908185005, 65.189012796240377, 60.628374127963752, 61.81906464594374, 422.90433211946129, 153.01469905349177, 104.08637743074746, 15.571327455142182, 422.90433211946129, 67.953722031765437, 94.213738008501764, 79.425887383253212); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void double4x3_operator_plus() + { + double4x3 a0 = double4x3(-418.82956357432045, -405.79894823851015, -34.041791216489742, 236.99924456188421, -459.83910129025537, 210.8614223985287, 293.74197902052754, -373.015422279488, -386.059833944803, 4.9544198536101476, -418.64524932328857, 504.47483062393724); + double4x3 r0 = double4x3(-418.82956357432045, -405.79894823851015, -34.041791216489742, 236.99924456188421, -459.83910129025537, 210.8614223985287, 293.74197902052754, -373.015422279488, -386.059833944803, 4.9544198536101476, -418.64524932328857, 504.47483062393724); + TestUtils.AreEqual(r0, +a0); + + double4x3 a1 = double4x3(-170.74650843941907, -478.74939916969714, 116.40075665172219, 421.40964742256779, -258.5960806620289, 447.86609122150867, 124.16434031546316, 222.17254386757156, -65.949277193261878, 239.04183947250328, 498.4495329793773, -139.382530515726); + double4x3 r1 = double4x3(-170.74650843941907, -478.74939916969714, 116.40075665172219, 421.40964742256779, -258.5960806620289, 447.86609122150867, 124.16434031546316, 222.17254386757156, -65.949277193261878, 239.04183947250328, 498.4495329793773, -139.382530515726); + TestUtils.AreEqual(r1, +a1); + + double4x3 a2 = double4x3(279.07295549990283, 37.999210613779383, 136.81214934997831, -236.03003965878395, -440.3083276414817, 342.2791270419392, 102.4722116470673, -161.454825714908, -355.27087919566355, 141.31435949230308, 239.32088600812517, -494.60408543730347); + double4x3 r2 = double4x3(279.07295549990283, 37.999210613779383, 136.81214934997831, -236.03003965878395, -440.3083276414817, 342.2791270419392, 102.4722116470673, -161.454825714908, -355.27087919566355, 141.31435949230308, 239.32088600812517, -494.60408543730347); + TestUtils.AreEqual(r2, +a2); + + double4x3 a3 = double4x3(361.59198134094106, 141.71249515456725, 25.25630880578251, -268.22689569565784, 106.77467613423926, 176.74438079481217, 104.11991005023935, 144.61861736356218, 289.45191372998613, -393.01668781461973, -198.95573506083139, -419.00921388110578); + double4x3 r3 = double4x3(361.59198134094106, 141.71249515456725, 25.25630880578251, -268.22689569565784, 106.77467613423926, 176.74438079481217, 104.11991005023935, 144.61861736356218, 289.45191372998613, -393.01668781461973, -198.95573506083139, -419.00921388110578); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void double4x3_operator_neg() + { + double4x3 a0 = double4x3(148.46174890755753, -467.12267873581624, 132.04719954917539, 183.52262290917463, 473.7010145009034, -407.99109024926605, -54.958759571872065, -382.98981803608581, -299.09338893512887, -383.01406377508027, 407.70980305583669, 168.73550351370852); + double4x3 r0 = double4x3(-148.46174890755753, 467.12267873581624, -132.04719954917539, -183.52262290917463, -473.7010145009034, 407.99109024926605, 54.958759571872065, 382.98981803608581, 299.09338893512887, 383.01406377508027, -407.70980305583669, -168.73550351370852); + TestUtils.AreEqual(r0, -a0); + + double4x3 a1 = double4x3(466.44152829909763, -280.55831564616335, -78.85761622286293, 318.69633522569029, -39.91539694737429, 140.34000284054321, 132.19563180403577, -505.89525127126615, 410.38058466947666, -237.05693375182193, -137.617827241131, -245.34998547534923); + double4x3 r1 = double4x3(-466.44152829909763, 280.55831564616335, 78.85761622286293, -318.69633522569029, 39.91539694737429, -140.34000284054321, -132.19563180403577, 505.89525127126615, -410.38058466947666, 237.05693375182193, 137.617827241131, 245.34998547534923); + TestUtils.AreEqual(r1, -a1); + + double4x3 a2 = double4x3(422.52133222227974, 60.222219256787639, -466.56631515294606, 426.89450116962871, 146.64955885086658, -391.37208408460583, 423.23773809114368, 254.29757296959758, -114.84889536483627, 108.05966263080927, -507.97628688624889, -306.24571456864743); + double4x3 r2 = double4x3(-422.52133222227974, -60.222219256787639, 466.56631515294606, -426.89450116962871, -146.64955885086658, 391.37208408460583, -423.23773809114368, -254.29757296959758, 114.84889536483627, -108.05966263080927, 507.97628688624889, 306.24571456864743); + TestUtils.AreEqual(r2, -a2); + + double4x3 a3 = double4x3(219.66627298093692, -98.760666177962264, 492.11106156376707, 84.0458290968304, 300.97664298721429, -483.86463307024195, -389.157431545275, -324.68608418325243, 378.8543824529529, 190.2192524365239, -69.102404865018286, 507.49539184360549); + double4x3 r3 = double4x3(-219.66627298093692, 98.760666177962264, -492.11106156376707, -84.0458290968304, -300.97664298721429, 483.86463307024195, 389.157431545275, 324.68608418325243, -378.8543824529529, -190.2192524365239, 69.102404865018286, -507.49539184360549); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void double4x3_operator_prefix_inc() + { + double4x3 a0 = double4x3(-139.84208137348389, -56.743654039103376, -381.955324589254, 509.79634380237962, -222.89634452708827, 210.31986556310198, -392.73151058365193, -300.19410218866267, 362.21273939787068, 401.614830919362, 130.90919429199266, -450.23016402229212); + double4x3 r0 = double4x3(-138.84208137348389, -55.743654039103376, -380.955324589254, 510.79634380237962, -221.89634452708827, 211.31986556310198, -391.73151058365193, -299.19410218866267, 363.21273939787068, 402.614830919362, 131.90919429199266, -449.23016402229212); + TestUtils.AreEqual(r0, ++a0); + + double4x3 a1 = double4x3(243.54693114177644, -41.497298975241051, 299.18547000511808, 154.35656530892311, -281.23327435237974, 200.70599922943211, 92.957765384091886, 448.60215565590283, -295.58701171334229, 18.499063262016989, -215.71113381893895, 471.94723651928234); + double4x3 r1 = double4x3(244.54693114177644, -40.497298975241051, 300.18547000511808, 155.35656530892311, -280.23327435237974, 201.70599922943211, 93.957765384091886, 449.60215565590283, -294.58701171334229, 19.499063262016989, -214.71113381893895, 472.94723651928234); + TestUtils.AreEqual(r1, ++a1); + + double4x3 a2 = double4x3(257.07660090973445, 4.8254301570474354, 243.00478588929627, -472.61902330472088, -125.7202084649914, -477.45955227197129, 9.8914859340952717, -76.922842299995409, -29.767583622488928, -387.17744344620849, 461.70929906410595, 13.699699169816313); + double4x3 r2 = double4x3(258.07660090973445, 5.8254301570474354, 244.00478588929627, -471.61902330472088, -124.7202084649914, -476.45955227197129, 10.891485934095272, -75.922842299995409, -28.767583622488928, -386.17744344620849, 462.70929906410595, 14.699699169816313); + TestUtils.AreEqual(r2, ++a2); + + double4x3 a3 = double4x3(-46.303758404359087, -222.22908626414329, 340.81780807153223, 399.74125046270956, -311.37233772472121, 300.17795457512977, -272.77828777617697, 351.01916782512296, 436.57524010007046, -137.06332475369021, 312.57995453131377, -315.99901380948677); + double4x3 r3 = double4x3(-45.303758404359087, -221.22908626414329, 341.81780807153223, 400.74125046270956, -310.37233772472121, 301.17795457512977, -271.77828777617697, 352.01916782512296, 437.57524010007046, -136.06332475369021, 313.57995453131377, -314.99901380948677); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void double4x3_operator_postfix_inc() + { + double4x3 a0 = double4x3(-396.6697396695007, 511.20749378167443, 249.11127030528678, -128.81731301584153, -259.49027669592306, 278.00817764830219, -81.393423356764686, 66.719732554033271, 167.85212691493894, 147.94395048354932, -326.10758486674524, 41.033564825092185); + double4x3 r0 = double4x3(-396.6697396695007, 511.20749378167443, 249.11127030528678, -128.81731301584153, -259.49027669592306, 278.00817764830219, -81.393423356764686, 66.719732554033271, 167.85212691493894, 147.94395048354932, -326.10758486674524, 41.033564825092185); + TestUtils.AreEqual(r0, a0++); + + double4x3 a1 = double4x3(128.5304239394751, -60.132380275117384, -446.22976490772783, -296.93783797739906, 267.29380071689081, 446.22930714405572, 49.200223230384381, -326.64314738225335, -510.86424064583343, 471.64748762159024, -171.01308186865089, 310.72735967800361); + double4x3 r1 = double4x3(128.5304239394751, -60.132380275117384, -446.22976490772783, -296.93783797739906, 267.29380071689081, 446.22930714405572, 49.200223230384381, -326.64314738225335, -510.86424064583343, 471.64748762159024, -171.01308186865089, 310.72735967800361); + TestUtils.AreEqual(r1, a1++); + + double4x3 a2 = double4x3(-298.91717185588425, 184.60345109952777, 290.69102896875279, 117.1923401901463, 164.44293578175962, 412.36778874526158, -229.38657079887884, 239.59693848322934, 36.624316947825378, -80.708194531830145, -391.03352016538076, -478.22714136458336); + double4x3 r2 = double4x3(-298.91717185588425, 184.60345109952777, 290.69102896875279, 117.1923401901463, 164.44293578175962, 412.36778874526158, -229.38657079887884, 239.59693848322934, 36.624316947825378, -80.708194531830145, -391.03352016538076, -478.22714136458336); + TestUtils.AreEqual(r2, a2++); + + double4x3 a3 = double4x3(166.86049159190645, -389.39665216458809, -52.132133269744031, 35.755328910311391, 356.05211298356392, 6.5294592410929226, -285.34983052189921, 418.0164985219094, 47.142905018824536, 31.451607480389839, 148.9468749263076, -219.80038200123255); + double4x3 r3 = double4x3(166.86049159190645, -389.39665216458809, -52.132133269744031, 35.755328910311391, 356.05211298356392, 6.5294592410929226, -285.34983052189921, 418.0164985219094, 47.142905018824536, 31.451607480389839, 148.9468749263076, -219.80038200123255); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void double4x3_operator_prefix_dec() + { + double4x3 a0 = double4x3(123.12869626056806, 256.8437465433235, 156.33078844674435, 461.73742530389563, 325.86799755965728, 392.01561731473339, 187.87412580655609, -236.2252043393558, 125.10963517292851, 469.8447313112415, 45.536655685648611, 376.04684680329956); + double4x3 r0 = double4x3(122.12869626056806, 255.8437465433235, 155.33078844674435, 460.73742530389563, 324.86799755965728, 391.01561731473339, 186.87412580655609, -237.2252043393558, 124.10963517292851, 468.8447313112415, 44.536655685648611, 375.04684680329956); + TestUtils.AreEqual(r0, --a0); + + double4x3 a1 = double4x3(-363.07547991493504, 248.79012667797042, 168.0950144120003, 168.26565011230559, -190.284744112885, 166.9455474200405, 183.95795854551625, 485.69469259944492, -460.73930261132273, 89.569894117102876, -267.42982090051743, 201.75623450137505); + double4x3 r1 = double4x3(-364.07547991493504, 247.79012667797042, 167.0950144120003, 167.26565011230559, -191.284744112885, 165.9455474200405, 182.95795854551625, 484.69469259944492, -461.73930261132273, 88.569894117102876, -268.42982090051743, 200.75623450137505); + TestUtils.AreEqual(r1, --a1); + + double4x3 a2 = double4x3(-141.21688682456357, 197.36173281323249, -213.54412732531506, 180.74062570405226, -128.31251412644633, 478.04553888647149, -454.56614062495817, -386.89835256473083, 387.85698408068015, -315.11044969927076, -108.28654556548526, -286.31702937107394); + double4x3 r2 = double4x3(-142.21688682456357, 196.36173281323249, -214.54412732531506, 179.74062570405226, -129.31251412644633, 477.04553888647149, -455.56614062495817, -387.89835256473083, 386.85698408068015, -316.11044969927076, -109.28654556548526, -287.31702937107394); + TestUtils.AreEqual(r2, --a2); + + double4x3 a3 = double4x3(-375.60158007945938, 78.275426662655263, 161.5319641388636, -346.8479546731561, -57.540783670517044, 455.37286231265068, 444.79814478605897, 129.82014638270255, 134.71065455987616, 61.323015956824179, -274.54334486394345, -43.3955581390278); + double4x3 r3 = double4x3(-376.60158007945938, 77.275426662655263, 160.5319641388636, -347.8479546731561, -58.540783670517044, 454.37286231265068, 443.79814478605897, 128.82014638270255, 133.71065455987616, 60.323015956824179, -275.54334486394345, -44.3955581390278); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void double4x3_operator_postfix_dec() + { + double4x3 a0 = double4x3(379.68831723727669, 302.69287814884115, -176.07134040448409, -291.25267066212962, 470.56758401848731, -402.92594666170231, -63.655158787805192, 355.26110069605568, -27.889220489137415, -100.76183824462902, 156.14034969924967, 479.94519613680677); + double4x3 r0 = double4x3(379.68831723727669, 302.69287814884115, -176.07134040448409, -291.25267066212962, 470.56758401848731, -402.92594666170231, -63.655158787805192, 355.26110069605568, -27.889220489137415, -100.76183824462902, 156.14034969924967, 479.94519613680677); + TestUtils.AreEqual(r0, a0--); + + double4x3 a1 = double4x3(-200.30429491787419, 407.42034907239508, 327.67032519340069, 48.0602071509046, -209.66798100698179, -38.435048836485976, 283.941595924991, -94.802087112703418, 152.51066334196867, -287.262531175866, -215.94803939384781, -407.04635567546188); + double4x3 r1 = double4x3(-200.30429491787419, 407.42034907239508, 327.67032519340069, 48.0602071509046, -209.66798100698179, -38.435048836485976, 283.941595924991, -94.802087112703418, 152.51066334196867, -287.262531175866, -215.94803939384781, -407.04635567546188); + TestUtils.AreEqual(r1, a1--); + + double4x3 a2 = double4x3(159.23357136511879, 168.4139531442961, -278.93379868144814, 289.91284073978329, 402.03954691534841, 470.71654937729079, -208.56061873611094, 145.89674789546837, -296.79095258228062, -274.57083309561517, -250.04125630578085, -70.856303486440481); + double4x3 r2 = double4x3(159.23357136511879, 168.4139531442961, -278.93379868144814, 289.91284073978329, 402.03954691534841, 470.71654937729079, -208.56061873611094, 145.89674789546837, -296.79095258228062, -274.57083309561517, -250.04125630578085, -70.856303486440481); + TestUtils.AreEqual(r2, a2--); + + double4x3 a3 = double4x3(-485.627825724719, -503.19208335466317, 397.64861387649955, 446.6215557747621, -292.8101204805123, 126.6225212209963, -250.44240700939781, 470.81648204793055, 26.943619502216393, -186.92351945998308, 45.746085426651916, -206.45597586708885); + double4x3 r3 = double4x3(-485.627825724719, -503.19208335466317, 397.64861387649955, 446.6215557747621, -292.8101204805123, 126.6225212209963, -250.44240700939781, 470.81648204793055, 26.943619502216393, -186.92351945998308, 45.746085426651916, -206.45597586708885); + TestUtils.AreEqual(r3, a3--); + } + + [TestCase /* For player builds */] + public static void double4x3_EqualsObjectOverride() + { + TestUtils.IsFalse(new double4x3().Equals((object)new int())); + TestUtils.IsTrue(new double4x3().Equals((object)new double4x3())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestDouble4x3.gen.cs.meta b/src/Tests/Tests/Shared/TestDouble4x3.gen.cs.meta new file mode 100644 index 00000000..57d1b815 --- /dev/null +++ b/src/Tests/Tests/Shared/TestDouble4x3.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a9a5b693ba34291418f7e9f627709a57 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestDouble4x4.gen.cs b/src/Tests/Tests/Shared/TestDouble4x4.gen.cs new file mode 100644 index 00000000..3fcaff74 --- /dev/null +++ b/src/Tests/Tests/Shared/TestDouble4x4.gen.cs @@ -0,0 +1,981 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestDouble4x4 + { + [TestCompiler] + public static void double4x4_zero() + { + TestUtils.AreEqual(0.0, double4x4.zero.c0.x); + TestUtils.AreEqual(0.0, double4x4.zero.c0.y); + TestUtils.AreEqual(0.0, double4x4.zero.c0.z); + TestUtils.AreEqual(0.0, double4x4.zero.c0.w); + TestUtils.AreEqual(0.0, double4x4.zero.c1.x); + TestUtils.AreEqual(0.0, double4x4.zero.c1.y); + TestUtils.AreEqual(0.0, double4x4.zero.c1.z); + TestUtils.AreEqual(0.0, double4x4.zero.c1.w); + TestUtils.AreEqual(0.0, double4x4.zero.c2.x); + TestUtils.AreEqual(0.0, double4x4.zero.c2.y); + TestUtils.AreEqual(0.0, double4x4.zero.c2.z); + TestUtils.AreEqual(0.0, double4x4.zero.c2.w); + TestUtils.AreEqual(0.0, double4x4.zero.c3.x); + TestUtils.AreEqual(0.0, double4x4.zero.c3.y); + TestUtils.AreEqual(0.0, double4x4.zero.c3.z); + TestUtils.AreEqual(0.0, double4x4.zero.c3.w); + } + + [TestCompiler] + public static void double4x4_identity() + { + TestUtils.AreEqual(1.0, double4x4.identity.c0.x); + TestUtils.AreEqual(0.0, double4x4.identity.c0.y); + TestUtils.AreEqual(0.0, double4x4.identity.c0.z); + TestUtils.AreEqual(0.0, double4x4.identity.c0.w); + TestUtils.AreEqual(0.0, double4x4.identity.c1.x); + TestUtils.AreEqual(1.0, double4x4.identity.c1.y); + TestUtils.AreEqual(0.0, double4x4.identity.c1.z); + TestUtils.AreEqual(0.0, double4x4.identity.c1.w); + TestUtils.AreEqual(0.0, double4x4.identity.c2.x); + TestUtils.AreEqual(0.0, double4x4.identity.c2.y); + TestUtils.AreEqual(1.0, double4x4.identity.c2.z); + TestUtils.AreEqual(0.0, double4x4.identity.c2.w); + TestUtils.AreEqual(0.0, double4x4.identity.c3.x); + TestUtils.AreEqual(0.0, double4x4.identity.c3.y); + TestUtils.AreEqual(0.0, double4x4.identity.c3.z); + TestUtils.AreEqual(1.0, double4x4.identity.c3.w); + } + + [TestCompiler] + public static void double4x4_operator_equal_wide_wide() + { + double4x4 a0 = double4x4(492.15758275061728, -495.20632027797694, 227.45765195947968, -147.37405950733182, -222.68201909897942, 64.093720704360749, -23.890404473939157, -16.8197190839889, 163.23210890741655, -165.27101071424363, 470.87767980568003, -423.94255967808078, 109.63436918595539, 462.69031283943468, -335.38147727371262, 357.23446934168896); + double4x4 b0 = double4x4(192.56880888369346, -235.61102472786376, -254.04311740307281, -412.62472052715009, 471.90480945627428, -6.4727852374654162, -339.10237447316865, 488.1875700839737, -379.5965842584132, -308.41700258311675, -82.333374300195544, -102.92108087563935, 226.51573835430463, -356.90132896830391, -362.91277544708589, -427.89843746083716); + bool4x4 r0 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + double4x4 a1 = double4x4(1.5455777652308598, -347.38824741327585, -114.47217302884542, 435.84865804940864, 194.23808607563285, 138.76554710174241, -467.34914205379278, 370.43337767684523, 476.70826147343416, 320.55264702465047, -498.59197377534207, 92.4169581366782, 104.51136856177425, 166.75460608618084, -204.73343024250744, 434.75675674656259); + double4x4 b1 = double4x4(466.65013978753711, -102.79904680270658, -43.355954428834821, 85.045664111639212, -91.127054972167628, 422.19208856215334, -477.43130873024057, 1.8770024785198984, 312.5800799394865, 254.59934365684137, 352.72583763335172, 62.490957050812881, 119.71476059766246, -511.05808639482507, -302.47273053902791, -371.76924365189359); + bool4x4 r1 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + double4x4 a2 = double4x4(-397.32965988541469, 503.98163699730378, -503.7141270598928, 90.659743112819115, -303.4452423078219, 9.3449113412503948, 290.9010785980621, -147.57193882184657, 368.08236067745941, -321.60959044173808, -171.4654224717363, -441.30646368549503, -137.76681834914109, 304.68958463551928, 301.88943948498434, -222.22090564585335); + double4x4 b2 = double4x4(-20.007841834802093, 21.459455738523729, -426.02067228128232, -305.41193666374863, 261.68332517411716, 50.0047347778476, -334.13464824023407, 75.065677916196023, -51.186689639085273, -135.96155721319911, -409.36487431515235, 160.81974013187914, 102.12079553591127, 277.81306637349212, 434.90674444423371, -15.289183385339186); + bool4x4 r2 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + double4x4 a3 = double4x4(-13.883811718730158, 307.52174844756803, -469.41294572754435, -6.4088704615872416, -290.07966317333262, 46.04458596466327, -168.61907370789862, 283.58987845275078, -244.71330058049097, -367.14044707228447, -492.86314009728989, 311.69617881984277, -90.701378149307061, -352.77372591233518, -218.71025691680154, -95.301376148733027); + double4x4 b3 = double4x4(-1.4652092463640543, 64.658699781009318, -163.0260780616785, 390.72893375471654, 113.9645836883991, -248.27529894945923, -469.58777664116946, -73.353983197991738, -420.31107183001518, 358.45325939657789, 58.718313959761645, -499.96478557026239, -168.83810313457536, -93.834922595804073, 324.846676739327, -226.35198675205555); + bool4x4 r3 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void double4x4_operator_equal_wide_scalar() + { + double4x4 a0 = double4x4(-303.2300766926399, 451.52631327674089, -253.65587413201848, -105.20363502632995, -500.6910920090466, -426.19248338518315, 159.87609656149334, -59.558379439431405, -57.477391031327386, -182.04973968400139, 406.51375861024189, 370.88599866017978, -172.03530629539642, 455.40001198993991, -11.338988547836891, 363.93823044557973); + double b0 = (123.5445759871717); + bool4x4 r0 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + double4x4 a1 = double4x4(-27.150561106927, -290.35904254129116, 180.19686635779067, -374.12832015293105, -439.35894295170851, -126.54608899287234, -197.2617896521752, -227.15933357326281, -479.8991937487848, -439.77767750237962, -495.23734902555, -224.51705013239621, -422.83322616239695, -450.19627043707123, -20.106708774392814, 297.37999906082632); + double b1 = (-325.97606507221985); + bool4x4 r1 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + double4x4 a2 = double4x4(185.9665759475746, -220.59704910060253, -228.686854707397, -333.00125972041917, 434.2130317325765, 406.24874062382094, -239.86977707588568, 380.93927281952426, 90.349506658664723, -361.32792751925433, -453.59993836544453, 157.73248799039629, -491.04621457077855, 296.61425055964582, 482.26513432071783, -305.87698259292029); + double b2 = (-102.97598962810633); + bool4x4 r2 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + double4x4 a3 = double4x4(-290.10212601819171, -110.52835588833705, 496.86356782208361, -441.10175653970884, 50.903518938880211, 66.072402269613235, 455.60591552015671, -390.04430145306713, 491.20810173973814, -498.41480588280353, 143.11344558704343, -347.0413293070352, -146.64416486893043, -243.85346924693022, -85.379532615365235, -438.4940004006466); + double b3 = (115.24653988482737); + bool4x4 r3 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void double4x4_operator_equal_scalar_wide() + { + double a0 = (-253.39728534100453); + double4x4 b0 = double4x4(19.952187785856495, -185.79199346610903, 407.8136052600172, -87.2766969610363, -206.27469382354741, 160.503138855334, -274.77081478516141, -2.6315281403397535, 448.35453602688131, -410.03524251004461, 247.32901465489022, 355.53915350303942, -298.06671180299793, 414.10151429385951, -481.30262707234482, 196.55074438664633); + bool4x4 r0 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + double a1 = (34.60100008668428); + double4x4 b1 = double4x4(113.76156645350227, -386.45337861890596, -124.49174672201821, 243.8866447153905, -492.6181826501238, 145.424413033493, 421.55070968230757, -95.409988209330493, 336.80928746648567, 209.58380589707929, 487.441424358376, 161.80653365040507, 149.84247095409899, 225.723996505944, -71.21880176999548, 85.780251781353854); + bool4x4 r1 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + double a2 = (192.547256797807); + double4x4 b2 = double4x4(-49.887493395194156, -229.80195652218629, -103.40733413743197, 19.215747126944279, 492.88110827509365, 140.40315849166507, -267.53641546309757, 125.9727018466092, 478.00049398746364, 116.14462071105118, -368.95778220191494, -225.02866350162247, 2.7237255585955609, -452.2632198055569, 87.456553261474028, 401.30651802630462); + bool4x4 r2 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + double a3 = (-18.645524272064449); + double4x4 b3 = double4x4(-294.21400060048978, -32.7313416156598, -1.252336741076931, 14.716069943605021, 0.57037043598029413, 180.78359350039796, 498.26289557770963, -503.8667087517058, -31.08398129003308, 462.9193329582547, -250.21223914353749, 347.56193820925523, -213.48793492721762, -123.75923901598867, -193.4521835751143, -242.24109827831438); + bool4x4 r3 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void double4x4_operator_not_equal_wide_wide() + { + double4x4 a0 = double4x4(430.8425316432689, 104.69001798736394, 225.80243478799355, -310.57017841496048, -418.61945815506363, 304.12820281839379, -509.32682561749908, -160.53807719076895, -203.30197606016975, -505.76325368590807, 162.17220623892365, 1.1561973100324394, 65.662074358045174, 102.78780250567377, 172.93008120960098, 26.621009123800832); + double4x4 b0 = double4x4(210.02470622305975, -55.203330304102678, -269.92533672504373, -234.54673372700194, 25.917412054686565, -63.726991444699024, -484.55371092471933, -425.333599050219, -53.274394775402925, 328.1944192984115, 15.963139303011417, 461.71412417931208, -113.36304455313973, -240.07297264787974, 495.11916970420589, 203.5583661550462); + bool4x4 r0 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + double4x4 a1 = double4x4(235.12595259171258, 128.54198533321824, -354.99697630246959, 334.35948220564023, -495.83200692377613, 468.30740163675853, 458.37094733601941, 299.93733300824522, 43.12718560319729, -354.71349994964595, -145.28719551176169, 390.80186218340032, -303.13149108697263, 391.13459533785215, 139.2868607692825, 104.52318506339714); + double4x4 b1 = double4x4(340.49345103860526, -241.90719448863865, 459.56982896270688, 213.0737384357833, -384.7828506831, -255.07233846144396, 477.66343115161328, -248.03662621604121, -407.92344565313471, -199.78886971240343, 151.84326488889906, -97.120607659742518, 154.97589380805186, -172.83452065886672, 441.5027942329192, -401.73862785926957); + bool4x4 r1 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + double4x4 a2 = double4x4(511.29640293088573, 213.1470559635884, -101.09569625793756, 441.6633772522506, 124.36612301895684, 312.02642622218764, 59.65573766625289, -508.65682315670739, 98.699622438615052, 228.79984174892297, 337.83266965385189, -163.1544383331921, 461.69158885520494, -450.77570340166596, -443.56476637514527, -438.2131223334992); + double4x4 b2 = double4x4(-411.43016333665241, -337.8202766561044, -430.63088270213029, -150.87180502287663, -206.83699212169137, 34.955056922023687, -255.77146422852366, 99.99864320643178, -161.17557127828502, 68.853526862735634, -285.59012116379574, -428.71731229718648, -286.33740700703925, 2.0271298894784877, -4.8059971354929871, -425.33480115669539); + bool4x4 r2 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + double4x4 a3 = double4x4(22.693964253502827, -254.3687413923297, -247.48362481197512, 365.05907004189635, -337.58682290538536, 187.84500726863973, 351.81683866671142, 355.22365467400459, 151.63271696475931, 240.46585690251823, -299.29704751600377, -227.57129751312141, 263.72427499653975, -287.51186551130928, -491.85517930046433, -219.3070386477313); + double4x4 b3 = double4x4(358.04602949602815, 357.80111067267183, 125.75760966434962, -38.241931694672417, 308.15830507323062, -450.45020339007033, -156.15319473862331, 464.63997314155097, -220.86404786857963, -211.53756795243248, -476.3303417993385, 284.88652409468148, 129.86436826077488, -326.75828925089832, -72.36375263722789, -382.82787984555023); + bool4x4 r3 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void double4x4_operator_not_equal_wide_scalar() + { + double4x4 a0 = double4x4(-16.914588697680529, 168.83411486858233, -462.71352145760949, 130.30776959765137, 214.50161443208424, -440.26328178879959, -197.12796053529155, -169.09985860115842, -386.61117595555783, -281.02101362916687, -270.26885593601912, -403.96372313236992, -269.80570877241234, 299.65422763473089, -71.750904831919286, -432.75573917513515); + double b0 = (-145.37277109239847); + bool4x4 r0 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + double4x4 a1 = double4x4(-457.36312100727258, 273.87305773136814, 185.042454567292, -482.53069351731364, 116.39514427836764, 511.73495578753523, 230.50753628020527, 100.27476768394683, 129.68240863163135, 321.17879048044733, -220.63900409482375, 140.33521921016984, 369.2123617461009, 453.81121489676241, -333.66624871532724, -373.93775218256644); + double b1 = (-13.519590622521719); + bool4x4 r1 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + double4x4 a2 = double4x4(150.20429451307484, 372.32001488856974, -95.837970539852051, 495.56669663617697, -5.385580780629823, -210.50298581388915, -459.61274812166243, 243.3090676010163, 314.10215702378287, 96.745011136282756, -168.16192944727931, -71.905446324453408, 216.60847983910162, -377.37381356646017, 142.35499841643264, -432.27255722148); + double b2 = (-442.16476627912596); + bool4x4 r2 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + double4x4 a3 = double4x4(94.290808959999481, 337.81056205267578, -197.66150746013108, -46.383895180366892, 250.232084629234, 169.099159081047, -181.22105773781476, -481.96699808629558, -427.18079419954717, -249.44207226924692, -488.48895644046786, 202.56492218867174, -243.82353770165867, -222.83222852592928, -448.60260722069188, 481.97402905019658); + double b3 = (331.65338889307031); + bool4x4 r3 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void double4x4_operator_not_equal_scalar_wide() + { + double a0 = (275.79582823244664); + double4x4 b0 = double4x4(-57.196896341255353, -382.4325279586169, 97.820359990848374, -161.46364529499022, -458.39563367254829, -499.61786364932448, 327.92217818271467, 367.57121699283425, 59.7863667289663, -209.58068118318016, -62.580453186566217, -479.97497604786184, -49.494519495169868, -114.68521338081229, 109.93924599044919, -176.28482755286842); + bool4x4 r0 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + double a1 = (-347.48529903380449); + double4x4 b1 = double4x4(85.540928165214609, -356.65954868712441, -104.24357490625397, -133.54918605347592, 243.53971135036079, 13.141311890045813, -379.98594754747393, -41.281226892620907, 87.911684792447659, -339.07727996403224, -371.82034533648766, 333.14425936953364, 294.81196011920088, -187.14565977228136, 220.19225774528093, -228.18207250730234); + bool4x4 r1 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + double a2 = (-499.72373914146971); + double4x4 b2 = double4x4(97.4059055305114, 501.60439395420462, 459.67539880223353, 158.09812290877949, 358.48858921531985, 243.51259171381253, 336.70294991913386, 89.953149122164177, -65.578377515812576, -159.26015503670095, 410.58855528877518, 123.96303206494224, -239.6251271886868, -299.42983808155628, -491.29190443981992, 207.71164641515895); + bool4x4 r2 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + double a3 = (271.56546724567443); + double4x4 b3 = double4x4(-329.03772202554984, 461.00740334997295, -317.16052523123125, -102.6549857140775, 211.26339230838391, 116.4261601513374, -34.1936924616777, 391.81758159763069, -34.307318464996, 351.45941631470782, 187.74252351920234, -477.57304237669939, 276.97440660976542, 489.5649785891012, 229.2272890681528, 260.20709645944044); + bool4x4 r3 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void double4x4_operator_less_wide_wide() + { + double4x4 a0 = double4x4(196.84256825076534, 336.40979997087732, 251.96372115424072, 257.65591466503963, 430.04588647840819, -62.419644146421774, 8.8392293494376872, -333.81671563434259, 164.67880662003472, -350.94487516532877, 3.84143662631584, 125.40972024081725, -111.12994127680076, 70.005523475820951, 448.19828173527412, -419.98711200244122); + double4x4 b0 = double4x4(-465.34502313348696, -256.15239751346053, -314.814018634527, 364.56673662949663, 100.21050290959442, 182.56098636545289, 3.116978885194726, -259.43047893207074, -437.33490749696966, -456.0437321402336, -394.2559718537405, 401.91369099259077, 313.43916454605721, 121.28668194696616, -28.012290729215522, -282.96589697663012); + bool4x4 r0 = bool4x4(false, false, false, true, false, true, false, true, false, false, false, true, true, true, false, true); + TestUtils.AreEqual(r0, a0 < b0); + + double4x4 a1 = double4x4(-258.30166757213965, -34.832201735504043, -69.859397682295821, 67.767227442826766, -139.77729207825723, 385.43464130229995, 133.707390609061, 506.18837117878184, 34.442885653322037, 412.11373896715872, -84.809773246203463, 444.78534504621541, -78.754743374304269, 366.97754376334024, 127.18045788965208, 428.36845489422251); + double4x4 b1 = double4x4(330.06440631023816, 124.09937077579059, -183.69031700104955, 373.0607623406969, 109.75094013556418, -203.57134232463841, 45.6486556742567, -360.95226280808089, 211.91309867236441, -313.28636207863985, -259.66108691862837, 79.0985401045059, 446.49610897828643, 450.52455660818362, -375.63076728192658, -53.941822792376286); + bool4x4 r1 = bool4x4(true, true, false, true, true, false, false, false, true, false, false, false, true, true, false, false); + TestUtils.AreEqual(r1, a1 < b1); + + double4x4 a2 = double4x4(8.1976149120356467, -71.137346062407516, -474.05081937930117, 322.42891875022508, 6.8978650602036851, 195.73355993802363, -267.69061315604051, -243.79369961647024, 319.25079336727538, -425.15620370635588, 71.873970303625811, 313.84387626957334, 397.27906126402274, -309.14588584990514, -38.667860764389786, -266.11969554895518); + double4x4 b2 = double4x4(-291.4537471697916, 190.77482303919965, 54.083913589866825, -163.63087637891567, -212.00563750602566, 406.09049649075166, -183.01893743454428, 355.22140304894253, -81.042213716098217, -275.71481693709029, 405.29925007619863, -510.64058065351128, 398.06925815999011, -4.35550666058225, 129.24267083464315, -276.1465247963306); + bool4x4 r2 = bool4x4(false, true, true, false, false, true, true, true, false, true, true, false, true, true, true, false); + TestUtils.AreEqual(r2, a2 < b2); + + double4x4 a3 = double4x4(193.38248524134167, 300.23104276332583, -395.21399826333578, -398.90144342877966, 401.48417992213933, 191.81577286115646, 56.605353143348111, -165.21084673945364, 178.28980859475666, -380.72623675909188, -462.47456357557076, 386.18420690399796, -93.297623439364884, 305.4957617751769, -148.77020056022803, 387.03698438547406); + double4x4 b3 = double4x4(-72.6235359053237, -86.838862221147338, -196.58645186041781, 492.35897206345521, 63.7446153460744, -384.8041357401778, -473.30515144453625, -407.73580593976, -500.2438592856023, -303.77732839424971, 192.0832718313128, 114.89836483583713, -72.4967654088963, -360.12007753929129, -185.21557458919267, 389.65519422556054); + bool4x4 r3 = bool4x4(false, false, true, true, false, false, false, false, false, true, true, false, true, false, false, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void double4x4_operator_less_wide_scalar() + { + double4x4 a0 = double4x4(-132.05731708000292, -192.46500477216438, -66.834607870706634, -379.01750081545561, -360.28242199508588, 20.927834282129879, -158.24074537970159, 437.34587522845061, -20.452607402788772, 225.29148517609178, 307.48418607725023, 274.01523292903562, 373.54965584983563, 398.52368301829495, 105.0301654827922, -58.010895994496934); + double b0 = (-156.01021845452965); + bool4x4 r0 = bool4x4(false, true, false, true, true, false, true, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 < b0); + + double4x4 a1 = double4x4(109.67008810381878, -44.971252223929014, 140.42607147080173, -500.08827638071415, 172.10334857371788, -197.50074610370245, -7.27149987559369, -432.99049898283113, 62.158315449095426, -72.254720959931035, -377.85232299279994, -500.25573586870718, 149.1149638393498, 119.88061695912882, 202.63918909925928, 274.95066393304182); + double b1 = (-108.853174498702); + bool4x4 r1 = bool4x4(false, false, false, true, false, true, false, true, false, false, true, true, false, false, false, false); + TestUtils.AreEqual(r1, a1 < b1); + + double4x4 a2 = double4x4(66.4120323967245, -149.63581402117194, 223.75870834279749, 73.266824041151835, 213.09497390179661, 322.85949459805124, 418.3772096197946, 421.10357947885223, -187.16683658732421, 389.10944313048822, 401.33542818638284, -106.28507929029178, 380.60798162063952, 385.65284484701829, 120.65986376659009, -13.830871826890359); + double b2 = (274.99944580486022); + bool4x4 r2 = bool4x4(true, true, true, true, true, false, false, false, true, false, false, true, false, false, true, true); + TestUtils.AreEqual(r2, a2 < b2); + + double4x4 a3 = double4x4(-500.12711238308208, 431.94365926829335, 129.68896704990834, -143.96904069928871, 183.88643297175247, -506.96425866846192, 452.43689200488711, -458.02700183262442, 89.559262555818691, -418.81744475793903, -292.38842238690165, 425.60161109715773, 342.43242875786143, -406.58913178303703, -407.15500302200905, 511.0645689959938); + double b3 = (487.52823494725317); + bool4x4 r3 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void double4x4_operator_less_scalar_wide() + { + double a0 = (-423.117411095238); + double4x4 b0 = double4x4(385.09483617595151, -123.93348532725753, 86.376572887588509, 133.44217378154497, 161.45794947513286, 229.75426660746064, 222.57159934871436, 315.53116360098647, -447.20351883731945, 271.83385790131695, -393.60531324595462, 317.48689737798964, -164.6051085761772, -282.87605370342544, 296.97953071118309, -254.40115582868509); + bool4x4 r0 = bool4x4(true, true, true, true, true, true, true, true, false, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 < b0); + + double a1 = (365.61562054493265); + double4x4 b1 = double4x4(-441.98425671178114, -131.42866021554391, 442.62897631275882, -29.792842163607872, -138.37379533535511, 9.2169721169476588, -226.7305482489665, 171.02944310523083, 376.62522595777421, -462.58872697436658, -142.36729795409707, -456.25377414014832, 66.6102416825529, 169.37875779409831, 327.44439450253003, 64.0879266560487); + bool4x4 r1 = bool4x4(false, false, true, false, false, false, false, false, true, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 < b1); + + double a2 = (-153.50390369887646); + double4x4 b2 = double4x4(199.38014921889646, -244.96905314408662, 472.74382112582396, -363.78010075342843, -179.48750575794259, -83.4251511485433, 178.88648828253451, 62.155780582761281, 409.74679560668153, -117.16365366669544, 316.60167684992848, 285.51627339307049, 18.674469718092382, 282.52931298060776, 132.92379075518056, -318.21533957040651); + bool4x4 r2 = bool4x4(true, false, true, false, false, true, true, true, true, true, true, true, true, true, true, false); + TestUtils.AreEqual(r2, a2 < b2); + + double a3 = (314.83989181874313); + double4x4 b3 = double4x4(78.003720081413007, 116.83946638779685, -134.37564212380704, 118.6754310683699, 11.468631511306739, 378.84954255579487, -198.89287886344493, 474.41273067631425, 296.83272351735866, 180.34299358182727, -147.06110269718857, 259.78493774113474, -1.8137605198722895, -409.54489989278136, -209.04970774848465, -258.60102927805906); + bool4x4 r3 = bool4x4(false, false, false, false, false, true, false, true, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void double4x4_operator_greater_wide_wide() + { + double4x4 a0 = double4x4(483.50140141113729, 310.81563415695712, 106.9661896726891, 295.73526038589671, 116.95757179938141, -478.29977653841479, -14.897393471979228, -33.817441717636484, -24.740548383789417, 319.78262701620474, -120.15856581561201, -289.00857962714906, 455.85146662958505, 144.70691139283917, 63.931990891663304, -285.68304099034663); + double4x4 b0 = double4x4(-471.39802454011425, -371.98528617060992, 36.900723236101044, -316.76360407320954, 19.683055648432628, 207.3091381561519, 362.79748861994483, 324.95341816775192, 340.94807140014507, 25.986035120666997, -114.2111352021858, 240.80346428640348, 273.42244757033063, 325.51576224226312, 27.341068995809678, 64.479532510265472); + bool4x4 r0 = bool4x4(true, true, true, true, true, false, false, false, false, true, false, false, true, false, true, false); + TestUtils.AreEqual(r0, a0 > b0); + + double4x4 a1 = double4x4(-502.0907201720824, -337.19446412529538, 474.31734274063137, -507.14510679018923, -133.56559735795742, -443.10913654934109, -464.34137056038776, -68.361549647693323, -185.99299987870876, -157.80389340119615, -74.124229227250567, -94.471165939453613, 329.61055508703487, -315.83675280019486, 404.193811843262, 131.30440503512716); + double4x4 b1 = double4x4(200.94836983501375, 100.12266998184964, -79.00710896356361, -315.137945560337, -122.98542815213347, -163.77920229908972, -492.56600617457462, -90.797273439726439, -284.9012335673446, -23.653687249707843, 174.93002112905026, 85.7125366133231, -441.98783012944637, 345.54374210235835, 482.21949814363359, -422.38349719642827); + bool4x4 r1 = bool4x4(false, false, true, false, false, false, true, true, true, false, false, false, true, false, false, true); + TestUtils.AreEqual(r1, a1 > b1); + + double4x4 a2 = double4x4(-206.6339033612208, 197.39985832823436, 187.99195274524016, 362.63607542712055, 336.09317819033436, -352.44836752137559, -183.10199865284471, 193.14483484679124, -170.216002781976, -0.49123787902817639, -326.85503760299412, -373.39623826248396, -216.58046422553269, 282.51211489481489, -275.17035616336875, -207.331757403599); + double4x4 b2 = double4x4(-30.779309048680261, 296.15423669300708, 378.05988830051376, -457.73343942022575, 122.92057257654176, -509.17313766347854, 386.7706226719406, 436.41747280415962, -276.49581516743444, -163.16677554099203, 249.97064625936127, -165.02074130113272, 89.092999261381578, 404.30517287007774, -340.68884889254758, -103.78509550159106); + bool4x4 r2 = bool4x4(false, false, false, true, true, true, false, false, true, true, false, false, false, false, true, false); + TestUtils.AreEqual(r2, a2 > b2); + + double4x4 a3 = double4x4(257.71016681273943, -469.14529893786892, -177.96586450280893, 233.21077381503335, -135.53730899446521, 152.25313455995786, 15.378388650425904, -243.18546473383225, -123.13266497623766, 3.7597448843343955, -29.289263977338237, 416.47154040656585, -169.3830707861963, 0.73470091853971553, -416.45222659430107, 329.436916743143); + double4x4 b3 = double4x4(491.27436064708718, 78.4379384882925, 147.4842136592996, -52.052888179222521, -212.0704539809704, 314.95519819620768, -97.298028275975014, 454.83993241509415, -240.25422560435453, 168.68962701069643, -217.5288194238808, 55.39545037941798, -149.57940037063292, -413.10104651614142, 470.3309025570428, 164.78202708288188); + bool4x4 r3 = bool4x4(false, false, false, true, true, false, true, false, true, false, true, true, false, true, false, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void double4x4_operator_greater_wide_scalar() + { + double4x4 a0 = double4x4(64.317918092160426, -397.70346445483318, 431.87690826499693, 85.702980796668157, 246.26305233978803, 197.49155602114809, 286.1994608781298, 280.81334818564972, -405.78459210218148, 171.56538661362856, -241.80727326209063, 333.57817498481745, 370.27919524269146, -413.70138116073861, -356.5923551789449, -353.03129522550444); + double b0 = (305.85991992888034); + bool4x4 r0 = bool4x4(false, false, true, false, false, false, false, false, false, false, false, true, true, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + double4x4 a1 = double4x4(396.64532608382649, -240.0134228393498, 502.91505193287276, 315.46759024051369, -259.28970134411458, 281.23064554912537, 428.79219909608, 245.15306460352292, -279.17542494422543, -453.86309668694764, -124.77154856769909, -425.65293451103054, 99.132852838902181, 355.0605339273161, -456.43941256796916, 154.48902208846482); + double b1 = (467.22205541432936); + bool4x4 r1 = bool4x4(false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 > b1); + + double4x4 a2 = double4x4(405.52974409867534, 186.08628639303436, 249.99909531790718, -110.0969179189284, -435.3045134187231, 72.752033029101767, -254.34657037181154, -428.98794980951953, 255.37367761105941, -309.11230459302305, 185.50160678918553, -201.33417687254689, 23.321151029002408, -143.97610027341921, -111.77951412637697, -356.65661852278589); + double b2 = (-157.73379643155903); + bool4x4 r2 = bool4x4(true, true, true, true, false, true, false, false, true, false, true, false, true, true, true, false); + TestUtils.AreEqual(r2, a2 > b2); + + double4x4 a3 = double4x4(-318.31356945555359, 490.18712567267335, -305.57897224350785, 260.85032785164674, 53.149621272994978, -166.93411000395849, -508.9152908310831, 352.54991619314524, 13.438477284013516, 139.35465270809584, -101.02899055417112, 194.46628269668031, 7.0825550589163413, 328.50485268631246, -297.36786069412153, -332.91084710364737); + double b3 = (287.20765961669747); + bool4x4 r3 = bool4x4(false, true, false, false, false, false, false, true, false, false, false, false, false, true, false, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void double4x4_operator_greater_scalar_wide() + { + double a0 = (-282.67049635698572); + double4x4 b0 = double4x4(358.09997360692353, -72.5964134077525, -232.16380106292843, -60.706723956720282, 75.156642710397364, 150.88350040786133, 339.53917924479538, -498.19602965665797, 459.74610326241054, -227.96872316485678, 335.86213485145106, 76.178844248959308, 296.85993899817572, 177.49000390688423, -281.20120657663847, 244.72285162877427); + bool4x4 r0 = bool4x4(false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + double a1 = (137.32857257562159); + double4x4 b1 = double4x4(-385.33824724021287, 443.16345879210326, -353.56254141105455, 26.040673983302327, -331.7939499969566, -43.691963454565041, 20.949428806523542, -211.17984423934473, 227.42171894173214, -84.7797711290325, -375.13548701588786, -205.17813096064054, -197.04714617368165, -219.63402305340117, -210.01563344244641, -266.773715858708); + bool4x4 r1 = bool4x4(true, false, true, true, true, true, true, true, false, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + double a2 = (144.77848703450456); + double4x4 b2 = double4x4(-471.71120069535039, -155.91317494023275, 99.724721716588647, -230.94484316135981, -338.86889640375455, 334.06826630889827, -158.66085703608621, -315.01822414762262, -177.19281991626735, 171.959285100903, 198.38915047347041, 303.67832603290594, 400.69957346501735, 351.87867252523017, -31.76966072608235, 386.07330077983124); + bool4x4 r2 = bool4x4(true, true, true, true, true, false, true, true, true, false, false, false, false, false, true, false); + TestUtils.AreEqual(r2, a2 > b2); + + double a3 = (-360.34885733218346); + double4x4 b3 = double4x4(-499.82369088559585, 428.29035755074131, 425.83018441956028, 203.28882965971195, 177.89392360388024, 483.09555004681249, 258.88677013054803, -361.52687971737555, 359.73492376866511, -276.33672846310617, 202.67466626068324, 218.98210130398263, 144.7932494360922, 503.66529988854438, 33.877768293897475, -169.04743989233276); + bool4x4 r3 = bool4x4(true, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void double4x4_operator_less_equal_wide_wide() + { + double4x4 a0 = double4x4(-438.52313753521219, 210.48942837980087, 4.8773329280677444, -137.29793817237857, 156.09410174009111, -363.92412035722475, -97.948485181642923, 437.29539009430232, 458.53029153241323, -294.06474675520542, 23.622613679441884, -34.284056441059363, 149.736484835733, -418.8866781754823, -197.50252899783783, -88.2055118494693); + double4x4 b0 = double4x4(-474.8141498392514, 304.3710555063426, 234.8241737982371, -390.48543209139513, -297.17535295019638, -326.29239121372461, 107.2538764976216, -413.13107342884462, 67.094432623635271, 470.07522724106684, -84.499104777583455, 392.78422683886447, -263.53175485484849, 369.30090039284005, -333.32529298091555, 238.41347443238533); + bool4x4 r0 = bool4x4(false, true, true, false, false, true, true, false, false, true, false, true, false, true, false, true); + TestUtils.AreEqual(r0, a0 <= b0); + + double4x4 a1 = double4x4(-376.71814292330208, 341.62712899857536, -83.309179106405566, -107.49073295830317, 319.46688833807912, 205.35738501574724, 345.56372968552807, 395.32190746596177, -222.87415490992095, 439.02200790821666, -368.0755667016262, -200.03860173003682, 71.46990660180802, -357.36542932939039, 141.7108519737194, 319.0170969064427); + double4x4 b1 = double4x4(486.24259279959028, 279.65021408705513, 236.05201803709008, 132.75898248178839, 66.294708998079727, 183.00210699020056, 200.13055071613314, 339.043800750302, 438.53791710293751, 145.40187866306019, 178.16310199450845, 157.97596724237133, 329.7052015409364, -243.59091221708383, 5.4011614347813293, -22.580605278993289); + bool4x4 r1 = bool4x4(true, false, true, true, false, false, false, false, true, false, true, true, true, true, false, false); + TestUtils.AreEqual(r1, a1 <= b1); + + double4x4 a2 = double4x4(303.03015889927292, -461.57424829042247, 277.62674749904625, 182.178105677561, -337.41483441806156, -361.39166109701227, 222.14351020666936, -464.7795028466636, -146.8536623208102, 80.175055302761052, -260.34730088913221, 94.489041134011472, 174.2811945296271, -303.81969251475283, 81.417447366480474, 503.048130508069); + double4x4 b2 = double4x4(-90.33759478961008, -72.19107798123315, -354.35482399275281, -289.52172650467685, 85.176270763006187, 469.32790468136216, 294.71383656874013, 461.60593411959985, -245.93047892578431, -124.04044610077534, 278.39260948747051, -42.881244917810534, -328.34883824379597, 98.985619352658091, -375.8998207412194, -197.93427309670221); + bool4x4 r2 = bool4x4(false, true, false, false, true, true, true, true, false, false, true, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + double4x4 a3 = double4x4(259.277612091637, 391.97194809092764, 149.70479900655562, -450.58294674874423, -255.64018857462338, -29.183286918878196, 27.554763091520726, 447.83245703570196, 282.48470438759989, 415.26275010372638, 437.22610613202028, -274.23330438986108, 327.17336407637845, 265.52772748913981, 461.46486852199996, 141.06082612884268); + double4x4 b3 = double4x4(-284.06200970525947, -76.098675524861846, -44.487014552805135, -380.51933091716808, 216.54373441289351, 58.748162535367555, -157.36650641139897, 288.75607003306789, -306.97136344899025, -124.35866910049629, -68.942456992781956, -487.36245058819765, 93.306996627388, 93.975585742842213, -428.80751367509714, -473.51501367684222); + bool4x4 r3 = bool4x4(false, false, false, true, true, true, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void double4x4_operator_less_equal_wide_scalar() + { + double4x4 a0 = double4x4(193.4958237118534, 168.91555197952107, -313.9930695565385, 81.826965131716292, 18.503590830836288, -0.35819602029312136, 241.36115776810846, -463.81641242644582, -1.3577692515020203, -268.89945591096739, 398.9919504593089, -471.253072242836, -264.93778264938749, 82.258299150624453, 11.246050124636895, 424.7040156911612); + double b0 = (443.85054299042122); + bool4x4 r0 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + double4x4 a1 = double4x4(426.48223157715154, -196.28791126808522, 31.901173844887467, -152.2575724833913, -437.92645975478297, -37.104814785115821, -47.144214413661587, 333.6230348710078, -274.80387438219225, 358.67627804292192, -260.46056926458169, 192.30916008367626, 145.30606777281787, -466.13296363602063, -494.26732968458316, -111.57013922164691); + double b1 = (56.319978501796754); + bool4x4 r1 = bool4x4(false, true, true, true, true, true, true, false, true, false, true, false, false, true, true, true); + TestUtils.AreEqual(r1, a1 <= b1); + + double4x4 a2 = double4x4(-139.54120332540072, 33.984021917909445, -445.70445248377717, -451.04219624541804, -122.03926115950537, 83.327714720427821, -202.46552119146361, -76.564869677910963, 218.03280482908372, -103.5359361653849, -283.35842312656268, -374.76167910860931, -213.49586568283655, 477.49183891596829, -383.37006849021191, 23.964948426915726); + double b2 = (-146.58935148389514); + bool4x4 r2 = bool4x4(false, false, true, true, false, false, true, false, false, false, true, true, true, false, true, false); + TestUtils.AreEqual(r2, a2 <= b2); + + double4x4 a3 = double4x4(-5.9607760933976692, 164.9914258294699, -117.63179808372252, -166.2466038047553, 369.77700274520419, -305.97963323536311, 245.15114485712309, 260.20393026070849, -218.69253478697152, 152.96552593678496, -10.178272967309795, -144.12557251012214, 365.33616297568017, -314.76649227494676, 381.25928014389206, 152.31706697881089); + double b3 = (-283.961719883588); + bool4x4 r3 = bool4x4(false, false, false, false, false, true, false, false, false, false, false, false, false, true, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void double4x4_operator_less_equal_scalar_wide() + { + double a0 = (393.60626644343427); + double4x4 b0 = double4x4(-75.688363825757222, -44.2638714519627, 125.86491566797019, 191.96488174794467, 13.543054825413492, -197.0519259893577, -423.945100743298, -330.04861680141119, 420.16553779140372, 105.54730777887039, 174.82126363311954, 296.71757831085358, -469.70041845259277, 123.26718979853536, 112.9969695140594, 495.14339493920249); + bool4x4 r0 = bool4x4(false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, true); + TestUtils.AreEqual(r0, a0 <= b0); + + double a1 = (-488.65789364681478); + double4x4 b1 = double4x4(388.53941148730894, -493.24077080806751, 16.451064832718657, -387.6516336815672, -229.1773127192526, -373.01533930982248, -391.142134610164, 90.994149488859875, -178.39613517485378, -69.621067317957568, 471.7908458522478, -67.4667532758167, 45.305359623071467, -154.69219000390365, 385.73888248286153, -431.652945004242); + bool4x4 r1 = bool4x4(true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 <= b1); + + double a2 = (-331.67304841227508); + double4x4 b2 = double4x4(-349.89271013340573, -114.83913021666888, -245.21782671903156, -486.69548224224496, 391.95091957224111, -125.77055150166643, -229.81227527829458, 289.44901265271426, -200.49423680104979, 281.59270991086623, 99.901066588191838, -146.02742845659492, 124.14839774190841, 94.357016368935319, 93.920113845691162, -484.92414711645068); + bool4x4 r2 = bool4x4(false, true, true, false, true, true, true, true, true, true, true, true, true, true, true, false); + TestUtils.AreEqual(r2, a2 <= b2); + + double a3 = (-270.79689396116737); + double4x4 b3 = double4x4(-313.37407245923487, 252.96782815315191, -302.89972772398016, 269.25790012500147, -358.51105110650462, -183.24853214214022, 5.0070502781342157, -411.0292677409152, -320.06080999973267, 384.56914132859981, -383.73594659554584, 249.41813647440551, -137.13982183166769, -251.76050221722596, 301.0823811502579, 216.37052331509562); + bool4x4 r3 = bool4x4(false, true, false, true, false, true, true, false, false, true, false, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void double4x4_operator_greater_equal_wide_wide() + { + double4x4 a0 = double4x4(-507.92858409692, 504.49748181947393, -385.43449205226938, -262.32340944107784, -37.550928848586466, -111.59527759980193, -463.70202157632542, 387.44885772627265, 456.96878573716094, -211.01015506079892, 182.41135391146474, -53.596053863687473, -309.57021608463032, -136.02249127999994, 280.73629082401112, -96.9958942388165); + double4x4 b0 = double4x4(-81.346509732933043, 297.66615047010885, 171.06540616371922, -431.03805538222105, -6.859075311040101, 319.72570362674333, 254.079170106947, 396.5724000393285, 178.83927615864172, -447.06336304501787, 288.49268569075161, 474.88929460704765, -321.75022831640683, -395.97722048125104, -158.69246037243516, 391.48869318118727); + bool4x4 r0 = bool4x4(false, true, false, true, false, false, false, false, true, true, false, false, true, true, true, false); + TestUtils.AreEqual(r0, a0 >= b0); + + double4x4 a1 = double4x4(-174.05950673579213, 88.9019382413951, 43.816040774721728, -446.07842585354967, 16.645595796706857, 409.83252043734888, -191.32987245886113, 222.99782548798146, 404.28838915577546, 230.60328136691976, -441.78928228923553, -86.293056289801882, 484.24954413075443, 95.2363665547391, -204.91210255628084, -199.77434620623211); + double4x4 b1 = double4x4(-368.10924141859135, 89.1238043723273, -510.27932214656812, -486.92979525352354, -81.215552606254619, 274.21882046117389, -212.88155494112596, 288.99530591117, 307.73173131967508, 307.24516620638087, -199.39178213821339, -284.42126978767163, -482.39181278757371, 448.3157362641374, -378.3461889598268, -390.8584684761513); + bool4x4 r1 = bool4x4(true, false, true, true, true, true, true, false, true, false, false, true, true, false, true, true); + TestUtils.AreEqual(r1, a1 >= b1); + + double4x4 a2 = double4x4(-421.86318107222354, -18.214789637464492, -346.8227681344481, -159.24364073539323, 112.9177020121914, 48.29104115827522, 390.66016525340274, 154.21916706590878, -32.748053804388292, -288.2656096370265, 122.70425826064513, 321.2779754704228, 230.18381487121053, 116.87426024157287, -93.515688701307283, 229.98230730275736); + double4x4 b2 = double4x4(8.9160292190108521, 416.40721984226593, -213.67494664605471, 455.24810788372906, -236.08035980727539, -248.37309348228064, 184.18512567513858, 415.31133885649558, 86.982202808830039, 485.00455950433604, 107.75893955480262, -486.66772459757874, -138.67679197093321, 14.207853562295327, -382.39416211768713, -117.00821524346628); + bool4x4 r2 = bool4x4(false, false, false, false, true, true, true, false, false, false, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 >= b2); + + double4x4 a3 = double4x4(-393.44120640002245, 184.08200153339749, 317.33323469633854, 123.81807404561812, -45.024627944931694, -317.67253580581053, 264.31717670351134, -163.08143504107437, -124.61097985348243, -30.936209931474252, 421.9194206771997, -1.562726736796435, 199.63805374858805, -325.7765950289446, 181.45079311237237, 36.7637965850364); + double4x4 b3 = double4x4(288.69098891350018, 311.754098322128, 318.59060564571553, 105.96333580183023, 287.3551734831907, 306.29107751803986, -349.91996280752119, -211.93558154438415, 191.92502769824353, 220.10569463488912, -172.77890571056815, -17.622120627026106, -43.547065039885752, 303.85402383648511, 338.54850570231145, -16.688135870121471); + bool4x4 r3 = bool4x4(false, false, false, true, false, false, true, true, false, false, true, true, true, false, false, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void double4x4_operator_greater_equal_wide_scalar() + { + double4x4 a0 = double4x4(465.15218732559686, -424.8860745024337, -209.22109685150025, 58.779852656079356, -302.26910533675414, 140.12558252183976, 16.353385694489475, -344.55997316192838, 393.27804846003562, -315.70155086913218, 441.0115565923096, -509.78156757251435, -36.994287269652943, 494.82028865014217, -164.97393830352183, -466.12009046325466); + double b0 = (-5.5998842742293391); + bool4x4 r0 = bool4x4(true, false, false, true, false, true, true, false, true, false, true, false, false, true, false, false); + TestUtils.AreEqual(r0, a0 >= b0); + + double4x4 a1 = double4x4(-123.8137477020797, 104.99569730879534, 314.34603014325069, 190.51609882643265, -83.111429014760745, -23.836435567511444, 143.04935962662535, -264.91997945724052, -169.70222457205051, 329.70751610850334, 359.09582035573931, -260.42331016269668, 354.19514219565087, -111.84533768140028, 33.309096113456917, 355.63126938214123); + double b1 = (215.65121779947128); + bool4x4 r1 = bool4x4(false, false, true, false, false, false, false, false, false, true, true, false, true, false, false, true); + TestUtils.AreEqual(r1, a1 >= b1); + + double4x4 a2 = double4x4(-435.36056753404466, -93.29572896533449, -338.84962169213668, 436.89581676800537, 511.08413982348713, -277.67452419813469, -453.79924771459741, 170.91899998994495, -182.82575591971437, -207.51692710049309, -319.500592142111, -240.5086177515372, 436.34132286363342, -66.956061632817637, 303.32088174639307, 180.19605907248149); + double b2 = (-38.39930893778768); + bool4x4 r2 = bool4x4(false, false, false, true, true, false, false, true, false, false, false, false, true, false, true, true); + TestUtils.AreEqual(r2, a2 >= b2); + + double4x4 a3 = double4x4(337.9651765012951, 107.35668545000101, -501.20867633317067, -237.36391150083574, -434.48845525946865, 110.9503610650778, 159.72954352187435, -188.30016788668007, 379.43311923529632, 322.41806641333642, 169.25756533875017, 427.8633370007683, -472.91709373561531, 308.1437868122681, -104.29753952114726, -353.41283695465552); + double b3 = (-84.4359534179959); + bool4x4 r3 = bool4x4(true, true, false, false, false, true, true, false, true, true, true, true, false, true, false, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void double4x4_operator_greater_equal_scalar_wide() + { + double a0 = (374.82703393270594); + double4x4 b0 = double4x4(-1.609757185731894, 338.61524049314448, -116.18140392945213, -332.15732375353451, -355.9793509710484, -468.90144107719021, 38.579884785497484, -332.34754697063357, 2.8901150240051265, 467.77776477661814, 121.40638762405445, -305.02337303060267, -58.428812292604164, -226.51955209789776, -47.020994446715804, 305.3026770582901); + bool4x4 r0 = bool4x4(true, true, true, true, true, true, true, true, true, false, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + double a1 = (-427.40123315686418); + double4x4 b1 = double4x4(92.263649745035764, -497.17853736187266, -408.62564225151465, -455.23049113491106, 396.42608637196292, -469.29488561548987, -485.7540130493017, -182.34619268325446, -291.54536284671417, 278.740809331993, -75.87113932327884, 28.907059921374071, 287.72014988945807, 420.50978990109161, 473.62684152723614, 181.514540518408); + bool4x4 r1 = bool4x4(false, true, false, true, false, true, true, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + double a2 = (-369.20287220981106); + double4x4 b2 = double4x4(243.74977385427326, -244.12415825767636, -242.9933451353541, -322.11536780098237, 192.974957794405, -54.725568558427312, -166.00083907228003, 244.29344117096321, 438.24940105818655, -162.69282610839832, 37.185346382290732, -506.66736459483735, -205.1630781652234, 368.3899807261256, -35.459948317827639, -20.916435966694905); + bool4x4 r2 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + double a3 = (9.041354422011068); + double4x4 b3 = double4x4(-377.58709901272653, -18.980614432590357, 59.219140318790096, 318.057525067617, 113.96415644230512, 295.91012610863436, -142.42739088015043, 362.18886892972, 447.56601187566571, -235.64225040918319, -397.54897589122362, 150.7453931079923, 227.16996513454706, -464.73202512447352, 159.77954609681831, 25.462086450989432); + bool4x4 r3 = bool4x4(true, true, false, false, false, false, true, false, false, true, true, false, false, true, false, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void double4x4_operator_add_wide_wide() + { + double4x4 a0 = double4x4(506.12905263627374, -501.77980803967444, 420.08479638587903, -186.03206476291274, -9.3123953385801883, 328.51179686585056, 424.34407659263536, 87.791079800478656, 462.41368148402012, -46.178705952213477, 401.17006296718966, -454.12414643453627, 69.195687564646732, -177.95734485329939, 299.60415544156183, 340.7048587001417); + double4x4 b0 = double4x4(-28.757987751047096, -337.135153689019, -340.676816860529, 152.31202633320913, 423.66745420157326, 90.374096674087468, 376.18866246574964, 1.7671887882831925, -120.18586045139745, -279.62936628965167, -344.66710273580026, 242.8391956029642, 418.5930504363929, -23.312797318823982, -95.099945827899489, 147.92812568877275); + double4x4 r0 = double4x4(477.37106488522664, -838.91496172869347, 79.407979525350015, -33.720038429703607, 414.35505886299308, 418.885893539938, 800.532739058385, 89.558268588761848, 342.22782103262267, -325.80807224186515, 56.502960231389409, -211.28495083157208, 487.78873800103963, -201.27014217212337, 204.50420961366234, 488.63298438891445); + TestUtils.AreEqual(r0, a0 + b0); + + double4x4 a1 = double4x4(219.91602740991675, -321.90838232725321, 286.35534037573041, -333.41949311523672, -118.93216973120911, 68.607509406566351, 23.190902005504313, -205.57787547147734, 11.521422629953122, -340.7950796283759, -68.931167873056211, 304.8532370556394, -86.633841316510825, 105.66915874633435, 349.28052799277032, 364.7078708916473); + double4x4 b1 = double4x4(331.03287926830023, -82.502564230236487, 279.44956291813844, 342.6227215931857, -300.35853185335105, -209.69408736456842, 446.55942150883345, -351.98918955027557, -263.12385642860261, -252.4585670216282, 289.82535542632706, 338.79615537207394, -232.61900364263869, -510.50825405051387, 349.2807325559113, -426.2124495106807); + double4x4 r1 = double4x4(550.948906678217, -404.41094655748969, 565.80490329386885, 9.2032284779489828, -419.29070158456017, -141.08657795800207, 469.75032351433777, -557.56706502175291, -251.60243379864949, -593.25364665000416, 220.89418755327085, 643.64939242771334, -319.25284495914951, -404.83909530417952, 698.56126054868162, -61.504578619033396); + TestUtils.AreEqual(r1, a1 + b1); + + double4x4 a2 = double4x4(-429.03740449856843, 382.45806926417072, 186.09704479300274, 227.41184841255279, -298.76636733616067, 351.30280344155744, 98.725387857633336, -292.35170640254006, 112.17092590787024, 477.1657800512229, -266.30486619952364, -295.14070643817104, -485.82035778733916, -507.86872291372566, -338.21959582819585, 505.34219360041538); + double4x4 b2 = double4x4(-331.41632882292208, -418.68880267566482, -341.7063559692848, -329.03588143411832, 123.19857245460082, 189.52859482054066, 267.56994093003209, 134.63626605581317, -337.96815530302382, 50.728011870164437, 81.16342572176984, 442.09067198358969, -148.70453769932715, 6.9743440183691519, -334.91123906472291, 43.787097712879586); + double4x4 r2 = double4x4(-760.45373332149052, -36.2307334114941, -155.60931117628206, -101.62403302156554, -175.56779488155985, 540.83139826209811, 366.29532878766543, -157.71544034672689, -225.79722939515358, 527.89379192138733, -185.1414404777538, 146.94996554541865, -634.52489548666631, -500.89437889535651, -673.13083489291876, 549.129291313295); + TestUtils.AreEqual(r2, a2 + b2); + + double4x4 a3 = double4x4(-153.06640274499841, -292.656682866, -447.89864775533727, -26.086234343278306, 21.464295158844607, -465.69219968546747, 450.52255198476951, -271.9292324855594, -452.26729724009863, -110.67917995838411, 384.1149525046884, 352.09241668884295, 475.72437761524895, -444.8684448883256, -345.83763305555919, -502.81628560592247); + double4x4 b3 = double4x4(-17.180041082752894, -157.3927691715736, -298.88907279581258, -158.77222140076208, 500.24080180574242, 319.87025967234297, -396.67535776490126, 157.79621775345697, 483.03289269052118, 175.24868329579419, -198.02014097851708, 1.7991697796616108, 452.36739728058103, -177.19841750767006, -291.56249560581637, -475.85512827143776); + double4x4 r3 = double4x4(-170.24644382775131, -450.04945203757359, -746.78772055114985, -184.85845574404038, 521.705096964587, -145.8219400131245, 53.847194219868243, -114.13301473210242, 30.765595450422552, 64.569503337410083, 186.09481152617133, 353.89158646850456, 928.09177489583, -622.06686239599571, -637.40012866137556, -978.67141387736024); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void double4x4_operator_add_wide_scalar() + { + double4x4 a0 = double4x4(-194.51420387742769, 338.54838696985894, 246.97140252169754, 100.51093797595752, -45.724677822424439, -478.11131094308166, 30.916145577522116, 60.37435224483454, -242.1187475855084, 82.50134495762245, 6.7993848355483806, -484.69981287638649, -188.26501068298938, -213.52673087526426, -267.78430688929944, 189.25996669999324); + double b0 = (124.121678171736); + double4x4 r0 = double4x4(-70.3925257056917, 462.67006514159493, 371.09308069343354, 224.63261614769351, 78.397000349311554, -353.98963277134567, 155.03782374925811, 184.49603041657053, -117.99706941377241, 206.62302312935844, 130.92106300728437, -360.57813470465049, -64.143332511253391, -89.40505270352827, -143.66262871756345, 313.38164487172924); + TestUtils.AreEqual(r0, a0 + b0); + + double4x4 a1 = double4x4(198.53359684652355, -424.92567582844089, 302.10236730338181, 300.39907970111778, 124.02158909850823, -200.16134295247559, 31.37822701007974, 362.52213518811493, -423.98885961248953, 432.41331907380993, 374.21141474983256, -465.69948957194549, -311.04303779781003, 84.918990413154916, -432.44245716204978, 235.75065886031405); + double b1 = (187.53610023648298); + double4x4 r1 = double4x4(386.06969708300653, -237.38957559195791, 489.63846753986479, 487.93517993760076, 311.55768933499121, -12.625242715992613, 218.91432724656272, 550.05823542459791, -236.45275937600655, 619.94941931029291, 561.74751498631554, -278.16338933546251, -123.50693756132705, 272.4550906496379, -244.9063569255668, 423.286759096797); + TestUtils.AreEqual(r1, a1 + b1); + + double4x4 a2 = double4x4(-472.63775394514096, 186.120703068618, -170.29822667422621, -115.27248840931452, -101.16882686557659, 257.77516973101308, 246.5492557243208, -397.53459066782824, -199.04838213652761, 20.585038433123827, 207.3238519203494, 197.93518671669779, -201.54056439247938, -106.63866453368155, -179.38222631224534, 203.81710610343941); + double b2 = (-257.57773721291579); + double4x4 r2 = double4x4(-730.21549115805669, -71.457034144297779, -427.875963887142, -372.85022562223031, -358.74656407849238, 0.1974325180972869, -11.028481488594991, -655.112327880744, -456.6261193494434, -236.99269877979197, -50.253885292566395, -59.642550496218007, -459.11830160539517, -364.21640174659734, -436.95996352516113, -53.760631109476378); + TestUtils.AreEqual(r2, a2 + b2); + + double4x4 a3 = double4x4(-364.82094853223344, 77.3942611577894, 185.27890333220307, 17.086716421454526, -511.89991092677224, 26.709729922334532, -296.4068244883822, 249.98880278784259, -133.73581820993491, -398.52463001689159, 168.70473082768956, 14.073841816780032, -443.07570978769832, 509.58235454446742, -72.758158002401785, -208.45047173670048); + double b3 = (154.5262444738886); + double4x4 r3 = double4x4(-210.29470405834485, 231.920505631678, 339.80514780609167, 171.61296089534312, -357.37366645288364, 181.23597439622313, -141.8805800144936, 404.51504726173118, 20.790426263953691, -243.998385543003, 323.23097530157816, 168.60008629066863, -288.54946531380972, 664.108599018356, 81.768086471486811, -53.924227262811883); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void double4x4_operator_add_scalar_wide() + { + double a0 = (-340.35468284243473); + double4x4 b0 = double4x4(511.36225652665007, -146.21663791789518, -106.21042661844308, -363.45024960276214, 199.08958325120136, -27.108407271610758, 419.84900041103788, 284.95503748811552, -164.92418129971446, -249.19032561461921, 150.92817718858282, 298.17509784278229, -457.15341803857751, 424.71807094324288, -301.85750283946163, 230.28885208363124); + double4x4 r0 = double4x4(171.00757368421534, -486.57132076032991, -446.56510946087781, -703.80493244519687, -141.26509959123337, -367.46309011404549, 79.494317568603151, -55.399645354319205, -505.27886414214919, -589.54500845705388, -189.4265056538519, -42.179584999652434, -797.5081008810123, 84.363388100808152, -642.21218568189636, -110.06583075880349); + TestUtils.AreEqual(r0, a0 + b0); + + double a1 = (-423.58759351428023); + double4x4 b1 = double4x4(-67.060037882560891, 68.7241366229598, -164.02241833695325, 318.93515339444161, 7.8045504129512437, 187.69836029210046, -3.6569664495331153, -446.0830535581722, -209.28724227160552, -38.212905186327589, -346.25717870623674, 465.60741708502519, -192.18595108398512, 278.69379843338106, 381.97845548297209, 481.24367283342576); + double4x4 r1 = double4x4(-490.64763139684112, -354.86345689132042, -587.61001185123348, -104.65244011983862, -415.783043101329, -235.88923322217977, -427.24455996381334, -869.67064707245243, -632.87483578588581, -461.80049870060782, -769.84477222051692, 42.019823570744961, -615.77354459826529, -144.89379508089917, -41.609138031308134, 57.656079319145533); + TestUtils.AreEqual(r1, a1 + b1); + + double a2 = (-97.228162095522578); + double4x4 b2 = double4x4(-455.51374289743313, 501.83498858932171, 358.70657818331688, 430.69978519468555, 256.987155795557, 207.65164837970008, -376.96518605619912, -428.08534093763927, -373.493553097124, -468.89328573126966, -467.65843818507085, 297.48495139623287, -506.89978646994558, -233.35846315760097, 434.55879493921941, -387.3151673690021); + double4x4 r2 = double4x4(-552.74190499295571, 404.60682649379913, 261.4784160877943, 333.47162309916297, 159.75899370003441, 110.4234862841775, -474.19334815172169, -525.31350303316185, -470.72171519264657, -566.12144782679229, -564.88660028059348, 200.2567893007103, -604.12794856546816, -330.58662525312354, 337.33063284369683, -484.54332946452467); + TestUtils.AreEqual(r2, a2 + b2); + + double a3 = (171.59027751329836); + double4x4 b3 = double4x4(245.0575402924128, 200.50275597372217, 353.49684421787822, -147.28983623687634, -8.44229388630123, 178.0850017900043, 409.44653983109004, -429.36719604458995, -103.62317447719312, -500.89550208528317, 254.10617911727456, 331.34762040309033, -484.73823021572935, -15.884124048000274, 280.94972170561073, 328.93142500935653); + double4x4 r3 = double4x4(416.64781780571116, 372.09303348702053, 525.08712173117658, 24.300441276422021, 163.14798362699713, 349.67527930330266, 581.0368173443884, -257.77691853129159, 67.967103036105243, -329.30522457198481, 425.69645663057292, 502.93789791638869, -313.147952702431, 155.70615346529809, 452.53999921890909, 500.52170252265489); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void double4x4_operator_sub_wide_wide() + { + double4x4 a0 = double4x4(160.4922617229131, 11.223957305412682, 359.20010607279846, -498.22830485656311, -355.25362913462038, -94.534852787170053, -410.46404786150163, -401.38464398001537, 317.70681944382693, 447.0604133303558, -489.07414482956477, -230.00838218909149, 24.875419389864192, 366.61447136784648, -107.3741567634857, -219.0081404275299); + double4x4 b0 = double4x4(115.46876078260539, -130.98230630298252, 241.54083716196044, 9.9870860623135513, 419.89512582304656, 59.124466208333388, -402.38163847587145, -75.370143687059226, 320.97960796997859, -73.908757482612884, -31.444742455819949, -389.25194734579509, -375.02884000122026, 259.18275821357167, 276.648654351313, -453.06919905779381); + double4x4 r0 = double4x4(45.023500940307713, 142.2062636083952, 117.65926891083802, -508.21539091887666, -775.14875495766694, -153.65931899550344, -8.0824093856301715, -326.01450029295614, -3.2727885261516576, 520.96917081296874, -457.62940237374482, 159.2435651567036, 399.90425939108445, 107.4317131542748, -384.02281111479869, 234.06105863026391); + TestUtils.AreEqual(r0, a0 - b0); + + double4x4 a1 = double4x4(473.90756891384137, 259.63620793988753, -360.119631219711, 7.8096120393879573, 437.42847439154446, -59.1991718091067, 418.74433322378638, 183.14215072576985, 271.23036516421962, 496.20853709439211, 165.35493691514944, -227.40367113212295, -166.52285702830312, 356.14227430715334, 386.92636579411396, -394.63875717420075); + double4x4 b1 = double4x4(-272.57653225240136, -191.14805301984217, 87.136884968325944, 430.02477594373033, 343.65711538105143, 121.02942067060133, -354.1881703595576, 249.05200373802893, -2.2254426489702723, 22.447240601502017, 478.1129555544411, -320.0629958212669, -111.52409534879217, 222.22894607401872, -245.41106307013473, -119.90228348593337); + double4x4 r1 = double4x4(746.48410116624268, 450.78426095972969, -447.25651618803693, -422.21516390434238, 93.771359010493029, -180.22859247970803, 772.932503583344, -65.909853012259077, 273.45580781318989, 473.7612964928901, -312.75801863929166, 92.659324689143943, -54.998761679510949, 133.91332823313462, 632.33742886424875, -274.73647368826738); + TestUtils.AreEqual(r1, a1 - b1); + + double4x4 a2 = double4x4(126.90326625057651, 97.2168972944919, -150.01784641575898, -227.25051246734824, -198.83000406940931, 0.66276812584271738, -484.2455706467133, -295.99628056958147, -46.170990726990169, 499.95239304935205, 292.44011725692087, -106.42413597294325, 466.82713887972159, 487.37480400846096, 242.9946106611726, -468.90158985038363); + double4x4 b2 = double4x4(-153.46565372937624, 374.11248439089979, 301.7634090398268, -281.43006552449896, -494.96436261337453, -320.73126021061614, 160.96219714030724, -132.93641025057826, -394.43753237018245, 406.85128588548457, 270.54461897096814, 507.79461335940039, 67.699203761154422, 263.40446412908125, 297.58066596536923, 170.83953746167924); + double4x4 r2 = double4x4(280.36891997995275, -276.89558709640789, -451.78125545558578, 54.179553057150713, 296.13435854396522, 321.39402833645886, -645.20776778702054, -163.05987031900321, 348.26654164319228, 93.101107163867482, 21.895498285952726, -614.21874933234358, 399.12793511856717, 223.97033987937971, -54.586055304196634, -639.74112731206287); + TestUtils.AreEqual(r2, a2 - b2); + + double4x4 a3 = double4x4(226.29587255525212, 506.12615442002482, 60.5949323459505, -112.93014984621209, -286.97493018162197, -290.72275532908867, -34.549812571401617, -347.81742517455359, -327.52781477921076, -243.60006319899117, -233.36345611948678, 99.657599257145876, 464.958482243567, 419.28534551117821, 326.38860503136584, -12.424676185671558); + double4x4 b3 = double4x4(-451.29688832317333, 60.20998695316257, 321.02966633487017, 481.46695612439282, 265.63860261889113, 148.31929952852397, -418.67241092150675, 184.51494583138958, -22.921315442268394, 269.36389816429653, -289.49004305968526, 368.35864727960836, 101.42228393509163, 294.2829498230866, 21.345023403570508, 15.589329965221395); + double4x4 r3 = double4x4(677.59276087842545, 445.91616746686225, -260.43473398891967, -594.39710597060491, -552.6135328005131, -439.04205485761264, 384.12259835010514, -532.33237100594317, -304.60649933694236, -512.96396136328769, 56.126586940198479, -268.70104802246249, 363.53619830847538, 125.00239568809161, 305.04358162779533, -28.014006150892953); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void double4x4_operator_sub_wide_scalar() + { + double4x4 a0 = double4x4(207.38960108877609, 248.45773684627272, -384.82393211164697, -205.34476122881506, -374.81156152058929, 191.64204820973896, 18.856238135535364, -44.96160151667965, 480.85798738936796, 16.338193185784917, -366.86545269883493, -35.523088233323335, 349.39776460705218, 439.07729336203886, 490.2222661870635, 195.02405104181923); + double b0 = (-36.112476604111691); + double4x4 r0 = double4x4(243.50207769288778, 284.57021345038441, -348.71145550753528, -169.23228462470337, -338.6990849164776, 227.75452481385065, 54.968714739647055, -8.8491249125679587, 516.9704639934796, 52.450669789896608, -330.75297609472324, 0.589388370788356, 385.51024121116387, 475.18976996615055, 526.33474279117513, 231.13652764593093); + TestUtils.AreEqual(r0, a0 - b0); + + double4x4 a1 = double4x4(-384.84940952102158, 55.602777745389744, -54.931482579061537, 53.088051582261983, 316.80250730961677, -273.80670917863335, 256.88723695319482, 297.17363156805447, 101.82901363346218, 136.60794765157993, -19.732211837420323, 336.58969966349639, -51.876563334780087, 317.34576311583896, -467.05592773251976, -50.167055391784345); + double b1 = (189.05188545447402); + double4x4 r1 = double4x4(-573.9012949754956, -133.44910770908427, -243.98336803353556, -135.96383387221204, 127.75062185514275, -462.85859463310737, 67.8353514987208, 108.12174611358046, -87.222871821011836, -52.443937802894084, -208.78409729189434, 147.53781420902237, -240.92844878925411, 128.29387766136495, -656.10781318699378, -239.21894084625836); + TestUtils.AreEqual(r1, a1 - b1); + + double4x4 a2 = double4x4(477.804535373023, 0.41113877315592617, 46.660927078994405, -19.241408595462076, 396.80972809195976, 69.590537342052244, -334.27423373529416, -198.07713684722648, -239.20061432532992, -339.68122665010446, -14.514425522887336, 219.99709211103482, -180.26066621591366, -438.89060398512083, 186.35550102328671, -365.06679241967703); + double b2 = (-60.821922092149919); + double4x4 r2 = double4x4(538.626457465173, 61.233060865305845, 107.48284917114432, 41.580513496687843, 457.63165018410967, 130.41245943420216, -273.45231164314424, -137.25521475507657, -178.37869223318, -278.85930455795454, 46.307496569262582, 280.81901420318474, -119.43874412376374, -378.06868189297091, 247.17742311543662, -304.24487032752711); + TestUtils.AreEqual(r2, a2 - b2); + + double4x4 a3 = double4x4(-478.80124615076988, 57.560462740045296, 306.90591611848492, -357.69845049348589, 159.08501608627148, 10.264446024906078, -129.71116906484178, 9.4816072031304657, 35.359424845948524, -456.96589944184103, -473.41155002704426, 130.4486988198239, 20.734550724148107, 210.99243006994595, -411.80952496631517, -497.35603284153905); + double b3 = (-193.2267821734896); + double4x4 r3 = double4x4(-285.57446397728029, 250.78724491353489, 500.13269829197452, -164.4716683199963, 352.31179825976108, 203.49122819839567, 63.515613108647813, 202.70838937662006, 228.58620701943812, -263.73911726835144, -280.18476785355466, 323.6754809933135, 213.9613328976377, 404.21921224343555, -218.58274279282557, -304.12925066804945); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void double4x4_operator_sub_scalar_wide() + { + double a0 = (-86.008225719448262); + double4x4 b0 = double4x4(466.42511413359318, 298.48694219183506, -300.95010652251085, 315.38003006362362, -381.09218543632522, -125.00837546447684, 58.466194418476107, 214.74609361158036, -257.54942739082009, 480.22459505508868, -443.35507723472784, 260.79503858312728, 29.681931747906788, 139.85773164586055, -247.78996216868512, -248.4662297929014); + double4x4 r0 = double4x4(-552.43333985304139, -384.49516791128332, 214.94188080306259, -401.38825578307188, 295.08395971687696, 39.00014974502858, -144.47442013792437, -300.75431933102863, 171.54120167137182, -566.232820774537, 357.34685151527958, -346.80326430257554, -115.69015746735505, -225.86595736530882, 161.78173644923686, 162.45800407345314); + TestUtils.AreEqual(r0, a0 - b0); + + double a1 = (91.445112509394562); + double4x4 b1 = double4x4(86.384162704639266, 373.81828206303453, 260.41195428576873, 114.35393171867076, -464.40545318294573, -109.74146156652898, -311.67535057276268, 107.86401586787031, -258.7951592219971, 14.097560173877355, -461.97019527012958, 30.310863747406188, 63.701105862716759, -462.67674634544028, 39.759483117498235, 47.998150132595583); + double4x4 r1 = double4x4(5.0609498047552961, -282.37316955363997, -168.96684177637417, -22.908819209276203, 555.8505656923403, 201.18657407592355, 403.12046308215724, -16.418903358475745, 350.24027173139166, 77.347552335517207, 553.41530777952414, 61.134248761988374, 27.744006646677803, 554.12185885483484, 51.685629391896327, 43.446962376798979); + TestUtils.AreEqual(r1, a1 - b1); + + double a2 = (-177.61928113625351); + double4x4 b2 = double4x4(202.47706017386031, -289.30880250097664, -459.92539832551284, 248.38668715599306, 85.3297222057962, -73.374776159122, -510.65201044019869, 426.96324535224733, 239.5901807470201, 477.85233257610923, 256.01360785961788, 338.620331683485, -483.83120440125055, 330.39224139339865, -263.41821706640451, 123.92803603221103); + double4x4 r2 = double4x4(-380.09634131011381, 111.68952136472313, 282.30611718925934, -426.00596829224656, -262.94900334204971, -104.2445049771315, 333.03272930394519, -604.58252648850089, -417.2094618832736, -655.4716137123628, -433.63288899587138, -516.23961281973857, 306.21192326499704, -508.01152252965215, 85.798935930151, -301.54731716846453); + TestUtils.AreEqual(r2, a2 - b2); + + double a3 = (-269.11598194256237); + double4x4 b3 = double4x4(-265.63821256609549, 484.58034657155179, -304.01562585682404, 311.63784256188103, 418.83056731653892, -103.77159624163602, -501.27475594974811, -304.48398580424674, 389.70297378567182, 372.89406436164586, 8.4363896886055727, -327.56477013582582, 190.74946674646321, 430.90134140052896, 28.885439647773978, -299.2031115494683); + double4x4 r3 = double4x4(-3.4777693764668811, -753.69632851411416, 34.899643914261674, -580.7538245044434, -687.94654925910129, -165.34438570092635, 232.15877400718574, 35.368003861684372, -658.81895572823419, -642.01004630420823, -277.55237163116794, 58.448788193263454, -459.86544868902558, -700.01732334309133, -298.00142159033635, 30.087129606905933); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void double4x4_operator_mul_wide_wide() + { + double4x4 a0 = double4x4(-482.71381710596097, -407.29348559272171, 137.70058995937029, 208.54113278563182, 194.296573967811, -484.24241684574747, 183.98730739578014, -241.33547770294149, 45.868758938214114, 363.32610266438041, -328.11893692990714, -471.02307413100408, -262.68257415605831, -379.26274674910246, -374.09058182970182, 481.44738720424812); + double4x4 b0 = double4x4(-236.36788355389979, 260.72759139757954, -416.38629718142852, -364.49561541364324, -253.14750897751537, -369.20287220981106, 193.54791531038836, 169.08491976982214, 201.96966442930034, 249.45608317547294, -308.19319810913555, -385.57964843585137, -183.27959522198864, 22.275629292370581, -265.52144229855458, -95.677454277722859); + double4x4 r0 = double4x4(114098.04331156026, -106192.64949051509, -57336.638772880389, -76012.328533757158, -49185.69370281692, 178783.69114527057, 35610.359790024842, -40806.189885013562, 9264.0978505395742, 90633.9064860661, 101124.02453259782, 181616.91132860651, 48144.355863192381, -8448.3163509892329, 99329.070837727879, -46063.660376363579); + TestUtils.AreEqual(r0, a0 * b0); + + double4x4 a1 = double4x4(104.62807397946165, 412.93539948618752, 477.87724731763694, 20.377821216535722, 291.99596299417124, -138.48832399141429, -393.46498483860165, 9.36312318284206, -131.94228917543882, 364.44964258952518, 390.61597866128011, 418.79794974755396, -277.34480942289565, 11.410165553637853, 474.87644956767394, -502.40503358394142); + double4x4 b1 = double4x4(133.25437146669924, 148.31146080247663, 249.284127113076, 500.00547503866505, -19.331578978957396, -36.691062705913112, 30.5238278054278, -401.36701054189678, 3.4372422711165882, 257.24176681099539, -290.97193516929258, 337.47938100317469, 490.28616284312966, -191.01981481864107, -325.73449650673871, -52.181983733634468); + double4x4 r1 = double4x4(13942.148235904471, 61243.052314850727, 119127.21246477668, 10189.022177626932, -5644.7430201585421, 5081.2837796057929, -12010.057444678736, -3758.048761232847, -453.51761370170692, 93751.669973365249, -113658.28721911977, 141335.67284620318, -135978.32239641057, -2179.56771110594, -154683.64120283397, 26216.491290173308); + TestUtils.AreEqual(r1, a1 * b1); + + double4x4 a2 = double4x4(-222.59489618176354, 38.169053810727291, 292.61251582420084, 203.20767245218519, -330.40815678723538, 469.4601201813017, 342.29512588227874, -504.11466359724972, 319.35728159516918, -357.7820815321906, -117.9710848880797, 25.706567060997031, 226.45642171914528, -86.343729774627718, -274.12603844056184, -486.87097452900883); + double4x4 b2 = double4x4(123.43503743197539, -461.2670640709191, 122.35306149458188, 308.58463182513822, 375.32062762571525, 203.21264204905026, 77.667988574909032, 218.793598038514, -489.89573620720569, 134.47217589918159, -287.79437960674727, -116.39999085124583, -436.54398151698706, 499.59108447450728, -300.60236396482321, 105.73045950091); + double4x4 r2 = double4x4(-27476.00934236266, -17606.127389639103, 35802.037142722758, 62706.764787700849, -124008.99677804091, 95400.23135870698, 26585.373926271874, -110297.06107241736, -156451.77058019731, -48111.735001372064, 33951.415186899816, -2992.2441707169919, -98858.187977365582, -43136.557595680068, 82402.935179544889, -51477.091854607956); + TestUtils.AreEqual(r2, a2 * b2); + + double4x4 a3 = double4x4(-28.926545395015978, -326.09616652414957, 504.35477399470039, -181.97952636609762, 312.2295698189314, 75.649923598230771, -248.43205535059423, 507.18425512089595, 482.40082644037943, 1.6229035861896364, -479.95241497454811, -446.21089884555477, -414.27152962902164, -175.72348579006433, -303.3032087307904, 70.71067026570006); + double4x4 b3 = double4x4(425.69365974222012, -4.90002227057704, -41.369812746238836, 257.70464932997925, -456.13498923561303, -496.70464896443514, -296.41469230149625, 156.98720200219532, 304.61656751512385, 452.77218577487963, -124.87720948312301, -446.80051657501633, -357.43095533802682, 217.1564973411879, 215.61658797767791, 482.19420717758783); + double4x4 r3 = double4x4(-12313.846972903815, 1597.8784783181318, -20865.062557832363, -46896.9700274109, -142418.83146839836, -37575.66874504555, 73638.911244574672, 79621.437110997053, 146947.28391672738, 734.8056040209724, 59935.118266707432, 199367.26010559621, 148073.46860464689, -38159.496674754373, -65397.202989214478, 34096.275587765071); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void double4x4_operator_mul_wide_scalar() + { + double4x4 a0 = double4x4(-96.318821236639678, -277.14229239017811, -239.93690191951436, 509.53140544776409, 255.85810172551226, 215.73149667295229, -455.50827500573746, -389.24327367788334, -338.29248658674419, 53.796284939067618, 243.75734459783757, 135.35469991311186, -207.35010275959507, -383.93960946795517, -31.425238862366086, 42.676120539510634); + double b0 = (-301.20720424373042); + double4x4 r0 = double4x4(29011.922860739887, 83477.255068544036, 72270.723422079071, -153474.5301092997, -77066.303503849529, -64979.880980175592, 137202.37402436248, 117242.87823519246, 101896.13410145289, -16203.828585195659, -73421.468280190238, -40769.81074207752, 62455.344751867844, 115645.37636627247, 9465.5083404247162, -12854.354955674438); + TestUtils.AreEqual(r0, a0 * b0); + + double4x4 a1 = double4x4(260.38388049806645, 25.672123205695357, -290.50059689697838, 207.09101805793637, -156.52330858843555, -208.4020064847553, 370.94506400215676, -341.59844247512444, 10.270311121954705, -176.88876565587185, -61.006107120311867, 186.27978214355176, -487.65221785365242, -129.37681800191143, -317.71628990663044, -207.62735686433842); + double b1 = (176.86755927692525); + double4x4 r1 = double4x4(46053.461418747589, 4540.5657728478518, -51380.131541658491, 36627.682912080854, -27683.895559985587, -36859.55423537262, 65608.148095884288, -60417.682773374414, 1816.4848611547886, -31285.884245062054, -10790.001267356211, 32946.850410367362, -86249.857547754931, -22882.562027013038, -56193.704738305729, -36722.543847714689); + TestUtils.AreEqual(r1, a1 * b1); + + double4x4 a2 = double4x4(388.87138933170183, 128.4155209662465, 510.38953399583215, 267.57635486665015, -309.20967569444781, -36.482969062627717, -189.56950983291932, 233.20923887622041, -331.08696261564592, -98.644771860281367, -214.18099389513071, -87.880760949049488, -493.16573475914345, -407.30606551063528, -411.37138362013332, 477.93567512833317); + double b2 = (-233.33533274072005); + double4x4 r2 = double4x4(-90737.435023058744, -29963.878313732039, -119091.91174229854, -62435.0177963588, 72149.54256481411, 8512.7657255976337, 44233.264654359431, -54415.955351392957, 77254.286588036077, 23017.31066515117, 49975.993477258453, 20505.68659755414, 115072.99081634643, 95038.8963232376, 95987.4786770142, -111519.2797847303); + TestUtils.AreEqual(r2, a2 * b2); + + double4x4 a3 = double4x4(364.7485498696326, -187.4824174323503, -287.95763768253738, 208.59016070542395, 367.3161043447052, 443.25971409457725, -98.88196592167111, 339.12984792288853, -266.41220939644251, -119.37973767117586, 117.49783211457441, -63.523055821435094, -362.64026873309177, -328.826897059021, 49.473634504468009, -169.01794322254972); + double b3 = (-8.0584857501361853); + double4x4 r3 = double4x4(-2939.3209915072721, 1510.8243892796788, 2320.5025199076063, -1680.9208376632757, -2960.011592657343, -3572.0020896405904, 796.83891332523854, -2732.8730469324487, 2146.8789930835296, 962.01991487816667, -946.85460576719174, 511.89964014214013, 2922.3314380111769, 2649.846864211619, -398.68257866170137, 1362.0286869762438); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void double4x4_operator_mul_scalar_wide() + { + double a0 = (37.432166355397612); + double4x4 b0 = double4x4(96.747546479454058, 492.18539427788244, -274.05458534604617, -452.87096926796761, 420.85330434369541, 102.18292694081686, -114.94887762654054, -351.12003843445336, -464.66496799172131, 444.08484646495663, 447.10525605040846, 130.82935124767448, -321.41334191030512, 445.30131861441828, 478.24357317306271, 358.57170622356784); + double4x4 r0 = double4x4(3621.4702542954869, 18423.565556306661, -10258.456829132712, -16951.941459168724, 15753.450899411988, 3824.9283199300971, -4302.785509682908, -13143.183689392061, -17393.41638139162, 16623.057848787463, 16736.118322851533, 4897.2260400716978, -12031.197683230832, 16668.593036652819, 17901.692989413856, 13422.115757699354); + TestUtils.AreEqual(r0, a0 * b0); + + double a1 = (-144.89011222910608); + double4x4 b1 = double4x4(-438.89383741789209, -3.536441089369589, -471.80755470311624, -42.560401697904069, 119.91104155402218, 271.9000023677479, 239.6840079946835, 487.44143389511919, -79.188288010278825, -112.92564468873928, 161.3700478828373, 459.75914332818195, -337.19599811043406, -276.83451689259823, 469.72386405883537, -274.56515110403541); + double4x4 r1 = double4x4(63591.377360141421, 512.39534633038193, 68360.249551474612, 6166.5813785251576, -17373.924268271276, -39395.6218581572, -34727.842817871649, -70625.4440621802, 11473.599937040075, 16361.809332495592, -23380.924348160519, -66614.553875177953, 48856.36600942623, 40110.584221458921, -68058.343380174032, 39781.775557665162); + TestUtils.AreEqual(r1, a1 * b1); + + double a2 = (506.78586625810055); + double4x4 b2 = double4x4(65.882571966332648, 495.8556585236712, -347.27959148365983, -343.60605232026711, -183.70378860444936, 460.26475808595524, 437.513251746778, -324.55724755141756, -112.28778343661122, 273.13543070160574, -283.09366072485864, 1.8802692898923397, -310.81670322586626, 326.01218357962193, 243.64321982285162, 78.179342067884022); + double4x4 r2 = double4x4(33388.356305269539, 251292.63944389962, -175996.38860380583, -174134.69087665278, -93098.483642800842, 233255.67413466593, 221725.53228588932, -164481.02585068994, -56905.861599125012, 138421.17585389267, -143467.8660826243, 952.893900876593, -157517.51219180759, 165218.36686609359, 123474.94021583667, 39620.18559336097); + TestUtils.AreEqual(r2, a2 * b2); + + double a3 = (-308.66400184699523); + double4x4 b3 = double4x4(-382.20924562132416, -134.17188865233766, -173.00490363547806, -432.00743194669832, 488.83650492543188, -291.71460808986546, -1.7385933407296648, -428.3124031630868, -11.958407646025705, -296.8914283704438, 235.68107449062222, -298.87918176263531, 384.53103011871269, 208.91936335755486, 489.38139199157308, -106.60549764829011); + double4x4 r3 = double4x4(117974.23529639906, 41414.032086799991, 53400.385895280429, 133345.14277231134, -150886.23185918221, 90041.798330245729, 536.64117813415487, 132204.620401022, 3691.1299597400002, 91639.696394891726, -72746.263611875242, 92253.244311610484, -118690.88659078932, -64485.886757269378, -151054.41888157203, 32905.279523011668); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void double4x4_operator_div_wide_wide() + { + double4x4 a0 = double4x4(-353.13144390337703, -102.79985456485292, 51.319128298814917, -191.87167868012176, 8.0418245829836223, -128.73764210973758, -136.05959779399427, -370.4710053738537, -237.69456326109105, -432.54687496300176, 200.26549181727012, 361.44157068871039, -416.22613234828509, -450.01919362042992, -273.49744594911925, -286.90817011841955); + double4x4 b0 = double4x4(-178.73954805114283, -302.09628381491467, -199.40583739029518, 278.85077561012042, 502.33758782890516, -361.48483078623417, 353.121059820578, -38.894930142394685, -75.764737402910725, -195.21784719974636, -405.03399224068687, -394.2300085473014, -375.82771342612227, -121.24548655433836, 447.623344391409, 338.28628007429018); + double4x4 r0 = double4x4(1.97567604793504, 0.34028837848212429, -0.25736021056579439, -0.68808013268139567, 0.016008805189634039, 0.35613566917796119, -0.3853058151307277, 9.5249176182488586, 3.1372716570909582, 2.2157137842034547, -0.49444119667433889, -0.9168291678773689, 1.1074918572499153, 3.7116366671409717, -0.61099906735420106, -0.84812239519560884); + TestUtils.AreEqual(r0, a0 / b0); + + double4x4 a1 = double4x4(-314.25606241554772, 177.76210340194507, 97.626988217992221, -68.107280047660367, -386.45074027890837, 263.69934690357161, -297.0270885420158, -501.77703046322659, -263.40686071263946, -451.08085248017721, -416.34552903489464, -315.27873411554788, -28.181118739853218, -397.87015146662952, -261.38664376986526, 40.348221559239619); + double4x4 b1 = double4x4(-405.54420752336466, -431.16893526127978, 296.20513095343722, 437.939790691221, 39.21061684527001, 331.2897075765253, -310.61955156485533, 207.26946959610541, -223.2929938879297, -480.091406807346, 448.67593666942605, -460.0974516626901, -220.56984601755153, -84.853158275062754, 441.3738078742166, 72.418480191574645); + double4x4 r1 = double4x4(0.77489964493560781, -0.41227947763496636, 0.32959249525403717, -0.15551745124635385, -9.855767936625206, 0.79597808465769837, 0.95624080018671487, -2.420892143165184, 1.1796467776541293, 0.93957285234474042, -0.92794263076704353, 0.68524338262731188, 0.12776505605218016, 4.6889256635195675, -0.59221149761645042, 0.55715366371267527); + TestUtils.AreEqual(r1, a1 / b1); + + double4x4 a2 = double4x4(277.24575794732471, 464.77123162931355, -336.64104358136706, 375.47808163961304, 504.34254264474964, -320.76710692083793, -156.73333914425848, 414.79707999471441, -386.05068296289568, -369.8386258416989, 386.70419687158619, 242.63180910918481, 421.73452659218322, 109.01218347857343, 182.07528242006674, 187.32643446108625); + double4x4 b2 = double4x4(44.9760778159723, -242.51539027062961, -451.30207011257392, -21.899694214528267, -358.4866656542228, -350.94512502799978, -481.84813688781492, 406.39341921657012, -145.28866321653533, 461.7955479388105, -318.81676331107354, -250.93199908497371, 125.85955506463517, -193.80316576445625, -495.25412177259761, -315.82454815312497); + double4x4 r2 = double4x4(6.1642938070706279, -1.9164607702243661, 0.74593285933165443, -17.145357280400777, -1.4068655572567703, 0.914009296739044, 0.32527538688138485, 1.0206786340053058, 2.6571287422992764, -0.80087092110880154, -1.2129355836106837, -0.96692255269931449, 3.3508343993080341, -0.56248917838145251, -0.36764011527736257, -0.59313449684811248); + TestUtils.AreEqual(r2, a2 / b2); + + double4x4 a3 = double4x4(510.86239528603028, -457.9560503707994, -263.39078319416888, 31.910513177472353, -86.771075527542791, -472.43394945209565, 257.443043590264, 208.63588748156837, -123.36692601226594, -210.80247531216708, 299.21243371591549, 197.71428331998845, 314.34426870678749, -152.24991686281277, -48.314253591147349, 308.02502336540488); + double4x4 b3 = double4x4(-320.71913328800309, 169.99683364201189, 252.73835980740296, -324.10479060006548, 82.818841734351054, 454.14113661932811, -476.33360908754804, -58.3329818520383, -292.2635706831997, 395.90201944667012, 90.552673620429232, 84.062521258398192, 203.7032307142872, 49.499401353997882, 57.28124740406929, 487.59666441734726); + double4x4 r3 = double4x4(-1.5928653524617757, -2.6939092956000987, -1.0421480276871444, -0.098457394345796215, -1.047721432833713, -1.040280017284805, -0.54046793818184491, -3.5766367646141188, 0.42210846094804616, -0.53246122767141668, 3.3042915438380978, 2.3519908796482354, 1.5431481749432079, -3.0757930944252947, -0.84345672939578964, 0.63172094036672466); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void double4x4_operator_div_wide_scalar() + { + double4x4 a0 = double4x4(171.34242184988341, 0.10338377957384637, 57.888263967767443, -256.13074529177078, 95.6696842162263, -290.38690461329509, -127.44869118903239, -79.7448890580539, 146.46688110496234, -499.84355687529012, 58.686315802245531, -453.20579859856787, -205.03382143985192, 481.73814247629514, 464.47907159499778, -293.46349753693841); + double b0 = (171.79682191265601); + double4x4 r0 = double4x4(0.99735501473360411, 0.00060177934855167557, 0.33695771157628673, -1.4908933846400916, 0.55687691513214455, -1.6902926455818372, -0.74185709473618289, -0.46418139852783397, 0.85255873463962106, -2.909504095072363, 0.34160303519515922, -2.6380336583233435, -1.193466905599069, 2.8041155657769838, 2.7036534577522375, -1.7082009682701784); + TestUtils.AreEqual(r0, a0 / b0); + + double4x4 a1 = double4x4(-158.50557930697948, 494.12860535743118, 203.58342680874443, 180.97040160976837, 259.11918723728468, 460.84470603468117, 490.95625924084163, -280.47805536933151, -320.24387112271222, 192.41448912043802, 264.80085885934568, 226.85298524929817, -192.23568949114332, 460.97652957447644, -437.89221760159927, -413.23271794488312); + double b1 = (-289.5822156824089); + double4x4 r1 = double4x4(0.54735950870966465, -1.706349971088531, -0.70302461885994683, -0.624936172904494, -0.89480352454194323, -1.5914123211906754, -1.6953950645204126, 0.9685610516805282, 1.1058823842757342, -0.66445547654578063, -0.91442376126356639, -0.78338023871636087, 0.663838036593975, -1.5918675409267515, 1.5121516235715426, 1.4269961881847206); + TestUtils.AreEqual(r1, a1 / b1); + + double4x4 a2 = double4x4(249.47184693509337, 216.78560195527302, 383.73890298592812, 82.023314752626789, 189.57466062790468, 314.50384273869167, -391.92216343056509, 121.28058701440716, 417.90175147443165, -133.26287013537382, -428.74240299162568, -188.53187641339929, 356.25952570338711, 181.96896823773579, -140.8904808223669, 474.08261678837357); + double b2 = (313.03501739773662); + double4x4 r2 = double4x4(0.79694549513647206, 0.69252827928777427, 1.2258657391621985, 0.26202600410167354, 0.60560208951650463, 1.0046922077701255, -1.252007416577922, 0.38743456889460465, 1.3350000103772839, -0.42571234120447432, -1.3696308053832627, -0.602270883240689, 1.1380820224682091, 0.58130547103147034, -0.4500789783634781, 1.5144715141757217); + TestUtils.AreEqual(r2, a2 / b2); + + double4x4 a3 = double4x4(-451.35772511519383, -220.99979816237453, 463.01120946510287, 502.37202024011503, 424.67763467537134, 51.258677744892793, 78.932004726925811, -487.65268992243927, -96.086444661061478, 29.198606266266893, 119.75044995162193, 205.40212569264793, -173.29742940389434, -448.82008644976656, -15.421466596155199, 472.02691934631525); + double b3 = (390.12471097992955); + double4x4 r3 = double4x4(-1.156957537966403, -0.56648500323719342, 1.1868287151103409, 1.2877216082473695, 1.0885689184072715, 0.13139049207146958, 0.2023250578735746, -1.2499918005643256, -0.24629674039285546, 0.074844288107063922, 0.30695428046797746, 0.52650375613662448, -0.44421033717295044, -1.1504528521723318, -0.0395295815981997, 1.2099385300681433); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void double4x4_operator_div_scalar_wide() + { + double a0 = (-264.44250095283729); + double4x4 b0 = double4x4(105.58908157497137, -142.34910137129441, -288.94890679463231, 39.644133824689334, -363.99138396046658, -149.71822006521666, -395.72912306139671, 258.71868693955184, -9.6662514254759344, 117.72553282497711, -331.38655797177296, -509.98602676297821, 427.8964666928614, 467.61712882836218, -407.12461943511136, 252.69070994699871); + double4x4 r0 = double4x4(-2.5044492954044237, 1.85770404172122, 0.915187753732487, -6.670406827961755, 0.72650758398599513, 1.7662679988958405, 0.66824119212426392, -1.0221236976771717, 27.357295947825712, -2.2462629355518375, 0.79798801306648692, 0.51852891466718543, -0.6180058063967393, -0.56551072373120947, 0.64953699267745924, -1.0465066207155123); + TestUtils.AreEqual(r0, a0 / b0); + + double a1 = (444.59937664708093); + double4x4 b1 = double4x4(-88.313306134340053, 199.95503411067421, -218.34692607556792, -13.417186028052697, -296.13107575854804, 0.561349630617201, -289.29929865957206, 196.21833929615946, 334.73346845001606, -282.39273203648293, -479.50358436978587, -473.43943927876626, 105.0507777226394, -287.63127841038227, 77.299297130340392, -210.89436421678141); + double4x4 r1 = double4x4(-5.0343418914785865, 2.2234967907884591, -2.0362062550548985, -33.136559015989725, -1.5013600835651144, 792.01865004925048, -1.5368145678439944, 2.2658400751013947, 1.3282190714474986, -1.5744009183269, -0.92720761875309077, -0.93908394561378317, 4.2322330808529154, -1.5457268037891974, 5.7516613106766954, -2.1081614878530881); + TestUtils.AreEqual(r1, a1 / b1); + + double a2 = (-184.0682357214709); + double4x4 b2 = double4x4(-315.14843645465953, 87.86691264429453, 101.5905373569534, 345.93639890567226, -146.31811744827689, 479.99991177022457, -172.67688401633728, -178.0136545533378, 361.76045315422141, 349.37693111476347, -398.68612951724145, -243.7800091448147, 296.62295045360133, 477.81065224009126, 486.60035942802222, 256.91724622292315); + double4x4 r2 = double4x4(0.58406837676934764, -2.0948526604846291, -1.8118639836968269, -0.53208692783918776, 1.2580003005201223, -0.38347556157381996, 1.0659691757239254, 1.0340118918592225, -0.50881248659593292, -0.52684713651288007, 0.46168708187654856, 0.75505877765443552, -0.6205461696068707, -0.38523259131732357, -0.37827394114101187, -0.71644951215831465); + TestUtils.AreEqual(r2, a2 / b2); + + double a3 = (-89.8642156542578); + double4x4 b3 = double4x4(-148.20586330639469, 388.35636657679288, 76.937261855666179, 260.97468507521535, -110.27984266648059, 369.08954899808839, -511.64960813506025, 355.42579452852988, -186.72485241048264, -379.32548802873373, -428.22553869161084, 220.1581262183181, 397.28297085188467, -106.64318876464068, 103.31414489788665, 212.90833745380326); + double4x4 r3 = double4x4(0.60634723653595424, -0.23139627256886547, -1.1680194159085426, -0.34434073798521148, 0.81487435492662263, -0.2434753731125647, 0.17563624446387993, -0.25283537952967688, 0.48126542607572503, 0.23690529239482749, 0.20985253688704927, -0.40818032564986789, -0.22619699873257604, 0.84266249626674494, -0.86981521981406851, -0.42207936395988482); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void double4x4_operator_mod_wide_wide() + { + double4x4 a0 = double4x4(-388.81249422059045, 181.68118842955732, -167.07872470052854, 432.82015319951813, -258.43895995730486, -170.11079629236406, 283.318293464984, 122.71651297561664, 335.27101413126616, -503.60851668920765, 191.02251848532933, 289.74269379756538, -124.03371745163281, 259.27395761165485, -274.35845030208975, -140.03080398404541); + double4x4 b0 = double4x4(436.94417187056695, 58.940049437312382, -201.11623368091705, 279.2893537391393, -397.07975954426445, 377.89994758083481, 174.69386657266591, -228.17652736798698, -317.06019106370405, -417.48011107811709, -249.9759434433542, -397.57157177364991, -358.74544947163452, -198.1592100589346, 208.73709378425826, -12.119406944196385); + double4x4 r0 = double4x4(-388.81249422059045, 4.8610401176201776, -167.07872470052854, 153.53079946037883, -258.43895995730486, -170.11079629236406, 108.62442689231807, 122.71651297561664, 18.210823067562103, -86.128405611090557, 191.02251848532933, 289.74269379756538, -124.03371745163281, 61.114747552720246, -65.621356517831487, -6.7173275978851734); + TestUtils.AreEqual(r0, a0 % b0); + + double4x4 a1 = double4x4(324.5775689205982, -200.51308903494527, 211.42317328761476, -51.272212767634642, -230.63392483006879, 99.989400671790122, 399.18986649028489, 24.903281461868119, 50.92402961241271, -364.86367886367429, -252.62662398658068, -281.28977955565313, -364.79852192699843, -329.02623311105475, 51.6098087074281, 41.647804041229051); + double4x4 b1 = double4x4(25.27141596063575, -194.12068495253135, -493.8717965995296, -312.3016990685378, -216.98060546488529, 413.57096047586344, -436.39440151508637, 3.4912750737235, -308.23343076754054, -441.37506195594324, 84.6008532441225, 373.16344922276369, 67.252760203207231, -320.33327522889397, 118.97936325845274, 44.823946258436877); + double4x4 r1 = double4x4(21.3205773929692, -6.3924040824139183, 211.42317328761476, -51.272212767634642, -13.653319365183506, 99.989400671790122, 399.18986649028489, 0.46435594580361794, 50.92402961241271, -364.86367886367429, -83.424917498335674, -281.28977955565313, -28.534720910962278, -8.6929578821607834, 51.6098087074281, 41.647804041229051); + TestUtils.AreEqual(r1, a1 % b1); + + double4x4 a2 = double4x4(254.95104443978096, -458.67762133976333, -136.79304439238882, 72.400299344398263, 246.21202170393053, 325.1538137519517, 162.03465588485574, -284.76143826393479, 128.35126906649737, 262.91676032865269, 61.600772647932558, -271.4927829576157, -205.43880448371118, -341.32216302553292, 347.1544365115252, 148.0884922240341); + double4x4 b2 = double4x4(354.00861065183233, -253.95312249565177, -195.16280207185207, 317.14281073079576, 320.6931823793301, -103.99687604978533, 388.17173332170194, -199.63931593654644, -256.21731746206865, -478.12501953454921, -210.65574202810217, -272.02328432352431, -61.676538257709012, -367.82958691559247, -242.93893753874067, 162.38671191147841); + double4x4 r2 = double4x4(254.95104443978096, -204.72449884411157, -136.79304439238882, 72.400299344398263, 246.21202170393053, 13.163185602595718, 162.03465588485574, -85.122122327388354, 128.35126906649737, 262.91676032865269, 61.600772647932558, -271.4927829576157, -20.409189710584144, -341.32216302553292, 104.21549897278453, 148.0884922240341); + TestUtils.AreEqual(r2, a2 % b2); + + double4x4 a3 = double4x4(253.37159049388561, -353.38008396391763, -489.71678017532304, -371.71568053388768, 131.3662698880612, -175.58708365987383, 271.4470394921708, -300.871206662092, -159.98580153285798, 63.315455704608667, 368.06260292980005, 495.22317361050432, 113.50139360944809, 463.48568198805935, -365.8406390463191, 481.98837421927055); + double4x4 b3 = double4x4(-456.83454558664681, -466.8187441615475, -233.14359604248011, -265.91316831573522, -170.00648959447, -61.319806365910836, 334.7070964941322, -240.97025524870037, 382.61308282549169, -204.17287383050325, 7.7728235757782613, -46.393213532116818, 325.34566298376103, 436.88349386532025, -71.770113740009322, -22.849040757328737); + double4x4 r3 = double4x4(253.37159049388561, -353.38008396391763, -23.429588090362813, -105.80251221815246, 131.3662698880612, -52.947470928052155, 271.4470394921708, -59.900951413391624, -159.98580153285798, 63.315455704608667, 2.7398948682217679, 31.291038289336143, 113.50139360944809, 26.602188122739108, -6.9900703462724891, 2.1585183153670755); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void double4x4_operator_mod_wide_scalar() + { + double4x4 a0 = double4x4(-244.49962889612635, -211.81931958525411, -145.92677576184587, -304.91822090042672, 155.47946436492703, -133.90778428591221, 281.30965412841624, -226.53575311719243, 335.16613046041039, 101.70649032560482, 319.47152033423606, -285.40231646476423, -355.84685985923136, 259.37800061860025, -330.87193957477433, -284.34358109363518); + double b0 = (39.634963769295723); + double4x4 r0 = double4x4(-6.6898462803520147, -13.644500738775491, -27.021884453958705, -27.473474515356656, 36.574573057039856, -15.002892978025045, 3.86490774334618, -28.360934270713813, 18.0864203060446, 22.436562787013372, 2.3918101798702764, -7.9575700796941646, -38.767149704865574, 21.568218002825915, -13.792229420408546, -6.8988347085651185); + TestUtils.AreEqual(r0, a0 % b0); + + double4x4 a1 = double4x4(-102.68343811048356, 206.41684517935698, -416.71365447375626, -339.256669917729, 435.29751440291182, 132.55290490600885, 226.94410215455298, -306.11827268550093, 115.43844633709568, 281.88292015804109, -218.3474491659307, -140.04050237501065, -462.32346961569203, -211.60869822819188, 351.33104555277669, 321.04701176334504); + double b1 = (-172.14173921017988); + double4x4 r1 = double4x4(-102.68343811048356, 34.275105969177105, -72.430176053396508, -167.11493070754915, 91.014035982552059, 132.55290490600885, 54.8023629443731, -133.97653347532105, 115.43844633709568, 109.74118094786121, -46.20570995575082, -140.04050237501065, -118.03999119533228, -39.466959018012005, 7.04756713241693, 148.90527255316516); + TestUtils.AreEqual(r1, a1 % b1); + + double4x4 a2 = double4x4(346.08518497370426, 465.40920446133669, -367.19701617173712, -467.51058957889239, 415.21510215067076, 506.18618011203887, -3.729830982037754, 128.24987822782714, 134.94156104649494, 247.61696230974837, -285.28786553316183, 433.76666017704019, -141.83102209019989, -229.7818902608854, 471.21804283150379, 377.68146651689028); + double b2 = (-94.407745643708722); + double4x4 r2 = double4x4(62.861948042578092, 87.7782218865018, -83.973779240610952, -89.8796070040575, 37.584119575835871, 34.147451893495258, -3.729830982037754, 33.842132584118417, 40.533815402786217, 58.801471022330929, -2.0646286020356683, 56.135677602205305, -47.423276446491172, -40.96639897346796, 93.5870602566689, 0.050483942055393527); + TestUtils.AreEqual(r2, a2 % b2); + + double4x4 a3 = double4x4(433.40759559786306, -333.35813084866766, 403.17845625578354, -417.24295897839727, 116.33744936638391, 167.62777550873705, 139.12912208360115, -510.79994821492579, -471.95898197216866, 96.209295556046641, -12.342896705653004, 425.50474925781816, 285.48960007610242, -198.6848114462033, 480.14047478145937, -94.449328228109209); + double b3 = (-99.44909791808999); + double4x4 r3 = double4x4(35.611203925503105, -35.010837094397687, 5.3820645834235847, -19.446567306037309, 16.888351448293918, 68.178677590647055, 39.680024165511156, -13.554458624475842, -74.1625902998087, 96.209295556046641, -12.342896705653004, 27.708357585458202, 86.59140423992244, -99.235713528113308, 82.344083109099415, -94.449328228109209); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void double4x4_operator_mod_scalar_wide() + { + double a0 = (-66.945025236785909); + double4x4 b0 = double4x4(-249.77609479137516, -396.07375664081133, 386.49204582091977, 168.93948109864232, -199.4182442163202, 261.7517141130528, 16.127438791155555, 257.66814744550186, -75.788451945310669, 170.95630439136005, -242.85828005655588, 425.94531913564788, 303.27240409668184, 3.033060790520608, -505.74352788633831, 461.95706126743789); + double4x4 r0 = double4x4(-66.945025236785909, -66.945025236785909, -66.945025236785909, -66.945025236785909, -66.945025236785909, -66.945025236785909, -2.4352700721636893, -66.945025236785909, -66.945025236785909, -66.945025236785909, -66.945025236785909, -66.945025236785909, -66.945025236785909, -0.21768784533253438, -66.945025236785909, -66.945025236785909); + TestUtils.AreEqual(r0, a0 % b0); + + double a1 = (205.97275672013529); + double4x4 b1 = double4x4(270.04063642678807, -47.480711720642034, -150.254496405951, 149.49949009227544, -220.29804263836616, 31.118842377848409, 400.63568348467152, 6.2314283876826266, -39.050740021770252, -71.941097054603063, -495.30713843521994, -86.71961859926563, -436.97006365143233, -472.2947320753218, -130.00875359867177, -251.51684605866524); + double4x4 r1 = double4x4(205.97275672013529, 16.049909837567157, 55.718260314184306, 56.473266627859857, 205.97275672013529, 19.259702453044838, 205.97275672013529, 0.33561992660861506, 10.719056611284032, 62.090562610929169, 205.97275672013529, 32.533519521604035, 205.97275672013529, 205.97275672013529, 75.96400312146352, 205.97275672013529); + TestUtils.AreEqual(r1, a1 % b1); + + double a2 = (281.97637022751212); + double4x4 b2 = double4x4(388.86081928241106, 50.615297579493017, 293.870868581287, 123.74424820940203, 422.90433211946129, -53.8761976016109, -178.85765966161046, -362.27595799149753, 361.08526747351755, 465.27609822958527, -269.88963306596952, -159.40897734435691, -29.095214618879936, 484.49945067078784, -354.95061008769585, -328.69059411095952); + double4x4 r2 = double4x4(281.97637022751212, 28.899882330047035, 281.97637022751212, 34.487873808708059, 281.97637022751212, 12.595382219457633, 103.11871056590167, 281.97637022751212, 281.97637022751212, 281.97637022751212, 12.086737161542601, 122.56739288315521, 20.119438657592696, 281.97637022751212, 281.97637022751212, 281.97637022751212); + TestUtils.AreEqual(r2, a2 % b2); + + double a3 = (-171.73922236810404); + double4x4 b3 = double4x4(-300.49299468681818, -64.589186936891281, 400.00459475070454, 295.55548467093865, 482.521947846991, 84.807400981340265, 497.85636233624837, -349.29194728904031, 351.63249580545005, -178.30718883234408, -0.56542277362450477, -167.61223395523251, -150.81838829387834, 131.25103646668185, 399.15047354211583, 165.46216519431312); + double4x4 r3 = double4x4(-171.73922236810404, -42.560848494321476, -171.73922236810404, -171.73922236810404, -171.73922236810404, -2.124420405423507, -171.73922236810404, -171.73922236810404, -171.73922236810404, -171.73922236810404, -0.41612195987909217, -4.1269884128715262, -20.920834074225695, -40.488185901422185, -171.73922236810404, -6.2770571737909222); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void double4x4_operator_plus() + { + double4x4 a0 = double4x4(-418.82956357432045, -405.79894823851015, -34.041791216489742, 236.99924456188421, -459.83910129025537, 210.8614223985287, 293.74197902052754, -373.015422279488, -386.059833944803, 4.9544198536101476, -418.64524932328857, 504.47483062393724, -170.74650843941907, 439.55937572920664, -478.74939916969714, 116.40075665172219); + double4x4 r0 = double4x4(-418.82956357432045, -405.79894823851015, -34.041791216489742, 236.99924456188421, -459.83910129025537, 210.8614223985287, 293.74197902052754, -373.015422279488, -386.059833944803, 4.9544198536101476, -418.64524932328857, 504.47483062393724, -170.74650843941907, 439.55937572920664, -478.74939916969714, 116.40075665172219); + TestUtils.AreEqual(r0, +a0); + + double4x4 a1 = double4x4(421.40964742256779, 447.86609122150867, 124.16434031546316, 222.17254386757156, -65.949277193261878, 239.04183947250328, 498.4495329793773, -139.382530515726, 279.07295549990283, 108.7758186370022, 37.999210613779383, 136.81214934997831, -236.03003965878395, -440.3083276414817, 342.2791270419392, 102.4722116470673); + double4x4 r1 = double4x4(421.40964742256779, 447.86609122150867, 124.16434031546316, 222.17254386757156, -65.949277193261878, 239.04183947250328, 498.4495329793773, -139.382530515726, 279.07295549990283, 108.7758186370022, 37.999210613779383, 136.81214934997831, -236.03003965878395, -440.3083276414817, 342.2791270419392, 102.4722116470673); + TestUtils.AreEqual(r1, +a1); + + double4x4 a2 = double4x4(-161.454825714908, 141.31435949230308, 239.32088600812517, -494.60408543730347, 361.59198134094106, -14.601737267617921, 141.71249515456725, 25.25630880578251, -268.22689569565784, 106.77467613423926, 176.74438079481217, 104.11991005023935, 144.61861736356218, 289.45191372998613, -393.01668781461973, -198.95573506083139); + double4x4 r2 = double4x4(-161.454825714908, 141.31435949230308, 239.32088600812517, -494.60408543730347, 361.59198134094106, -14.601737267617921, 141.71249515456725, 25.25630880578251, -268.22689569565784, 106.77467613423926, 176.74438079481217, 104.11991005023935, 144.61861736356218, 289.45191372998613, -393.01668781461973, -198.95573506083139); + TestUtils.AreEqual(r2, +a2); + + double4x4 a3 = double4x4(-419.00921388110578, 233.29548727408769, 407.3215832222819, -129.00210744189195, 321.17217436487419, -132.84078771101349, -20.491324195867094, -135.6182249223898, -226.9120567901582, -409.91439623847344, -256.25723159325179, 2.17242837053368, 361.97020571398093, -66.737252504908156, -248.92437636522777, -109.99738102313012); + double4x4 r3 = double4x4(-419.00921388110578, 233.29548727408769, 407.3215832222819, -129.00210744189195, 321.17217436487419, -132.84078771101349, -20.491324195867094, -135.6182249223898, -226.9120567901582, -409.91439623847344, -256.25723159325179, 2.17242837053368, 361.97020571398093, -66.737252504908156, -248.92437636522777, -109.99738102313012); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void double4x4_operator_neg() + { + double4x4 a0 = double4x4(148.46174890755753, -467.12267873581624, 132.04719954917539, 183.52262290917463, 473.7010145009034, -407.99109024926605, -54.958759571872065, -382.98981803608581, -299.09338893512887, -383.01406377508027, 407.70980305583669, 168.73550351370852, 466.44152829909763, 171.90249474900895, -280.55831564616335, -78.85761622286293); + double4x4 r0 = double4x4(-148.46174890755753, 467.12267873581624, -132.04719954917539, -183.52262290917463, -473.7010145009034, 407.99109024926605, 54.958759571872065, 382.98981803608581, 299.09338893512887, 383.01406377508027, -407.70980305583669, -168.73550351370852, -466.44152829909763, -171.90249474900895, 280.55831564616335, 78.85761622286293); + TestUtils.AreEqual(r0, -a0); + + double4x4 a1 = double4x4(318.69633522569029, 140.34000284054321, 132.19563180403577, -505.89525127126615, 410.38058466947666, -237.05693375182193, -137.617827241131, -245.34998547534923, 422.52133222227974, -434.57134386271764, 60.222219256787639, -466.56631515294606, 426.89450116962871, 146.64955885086658, -391.37208408460583, 423.23773809114368); + double4x4 r1 = double4x4(-318.69633522569029, -140.34000284054321, -132.19563180403577, 505.89525127126615, -410.38058466947666, 237.05693375182193, 137.617827241131, 245.34998547534923, -422.52133222227974, 434.57134386271764, -60.222219256787639, 466.56631515294606, -426.89450116962871, -146.64955885086658, 391.37208408460583, -423.23773809114368); + TestUtils.AreEqual(r1, -a1); + + double4x4 a2 = double4x4(254.29757296959758, 108.05966263080927, -507.97628688624889, -306.24571456864743, 219.66627298093692, 474.66795252015254, -98.760666177962264, 492.11106156376707, 84.0458290968304, 300.97664298721429, -483.86463307024195, -389.157431545275, -324.68608418325243, 378.8543824529529, 190.2192524365239, -69.102404865018286); + double4x4 r2 = double4x4(-254.29757296959758, -108.05966263080927, 507.97628688624889, 306.24571456864743, -219.66627298093692, -474.66795252015254, 98.760666177962264, -492.11106156376707, -84.0458290968304, -300.97664298721429, 483.86463307024195, 389.157431545275, 324.68608418325243, -378.8543824529529, -190.2192524365239, 69.102404865018286); + TestUtils.AreEqual(r2, -a2); + + double4x4 a3 = double4x4(507.49539184360549, 245.01338517154261, 429.61580034234362, 142.35700017882368, -430.84906765019946, 281.93425501600575, -242.33497320969354, -83.1273916154762, -460.82031772137634, -485.41974638654841, 396.8190211713403, -428.42350288313975, -213.98789010475758, -17.6636226259468, 287.08188714044252, 257.49776542256484); + double4x4 r3 = double4x4(-507.49539184360549, -245.01338517154261, -429.61580034234362, -142.35700017882368, 430.84906765019946, -281.93425501600575, 242.33497320969354, 83.1273916154762, 460.82031772137634, 485.41974638654841, -396.8190211713403, 428.42350288313975, 213.98789010475758, 17.6636226259468, -287.08188714044252, -257.49776542256484); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void double4x4_operator_prefix_inc() + { + double4x4 a0 = double4x4(-139.84208137348389, -56.743654039103376, -381.955324589254, 509.79634380237962, -222.89634452708827, 210.31986556310198, -392.73151058365193, -300.19410218866267, 362.21273939787068, 401.614830919362, 130.90919429199266, -450.23016402229212, 243.54693114177644, 46.19202735190845, -41.497298975241051, 299.18547000511808); + double4x4 r0 = double4x4(-138.84208137348389, -55.743654039103376, -380.955324589254, 510.79634380237962, -221.89634452708827, 211.31986556310198, -391.73151058365193, -299.19410218866267, 363.21273939787068, 402.614830919362, 131.90919429199266, -449.23016402229212, 244.54693114177644, 47.19202735190845, -40.497298975241051, 300.18547000511808); + TestUtils.AreEqual(r0, ++a0); + + double4x4 a1 = double4x4(154.35656530892311, 200.70599922943211, 92.957765384091886, 448.60215565590283, -295.58701171334229, 18.499063262016989, -215.71113381893895, 471.94723651928234, 257.07660090973445, 41.625937719655212, 4.8254301570474354, 243.00478588929627, -472.61902330472088, -125.7202084649914, -477.45955227197129, 9.8914859340952717); + double4x4 r1 = double4x4(155.35656530892311, 201.70599922943211, 93.957765384091886, 449.60215565590283, -294.58701171334229, 19.499063262016989, -214.71113381893895, 472.94723651928234, 258.07660090973445, 42.625937719655212, 5.8254301570474354, 244.00478588929627, -471.61902330472088, -124.7202084649914, -476.45955227197129, 10.891485934095272); + TestUtils.AreEqual(r1, ++a1); + + double4x4 a2 = double4x4(-76.922842299995409, -387.17744344620849, 461.70929906410595, 13.699699169816313, -46.303758404359087, 89.366049569736219, -222.22908626414329, 340.81780807153223, 399.74125046270956, -311.37233772472121, 300.17795457512977, -272.77828777617697, 351.01916782512296, 436.57524010007046, -137.06332475369021, 312.57995453131377); + double4x4 r2 = double4x4(-75.922842299995409, -386.17744344620849, 462.70929906410595, 14.699699169816313, -45.303758404359087, 90.366049569736219, -221.22908626414329, 341.81780807153223, 400.74125046270956, -310.37233772472121, 301.17795457512977, -271.77828777617697, 352.01916782512296, 437.57524010007046, -136.06332475369021, 313.57995453131377); + TestUtils.AreEqual(r2, ++a2); + + double4x4 a3 = double4x4(-315.99901380948677, -442.44696041683062, -93.810562415891582, -76.444237029386784, -8.3283851185479989, 436.75728269887964, 345.75580922968493, -474.15089271690272, 32.02705456317733, -343.30607215655323, 114.44305925930064, -31.198888077958884, 322.83176270259162, 15.335039384353422, 96.3687465639639, 51.878350043612727); + double4x4 r3 = double4x4(-314.99901380948677, -441.44696041683062, -92.810562415891582, -75.444237029386784, -7.3283851185479989, 437.75728269887964, 346.75580922968493, -473.15089271690272, 33.02705456317733, -342.30607215655323, 115.44305925930064, -30.198888077958884, 323.83176270259162, 16.335039384353422, 97.3687465639639, 52.878350043612727); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void double4x4_operator_postfix_inc() + { + double4x4 a0 = double4x4(-396.6697396695007, 511.20749378167443, 249.11127030528678, -128.81731301584153, -259.49027669592306, 278.00817764830219, -81.393423356764686, 66.719732554033271, 167.85212691493894, 147.94395048354932, -326.10758486674524, 41.033564825092185, 128.5304239394751, 73.155582223625629, -60.132380275117384, -446.22976490772783); + double4x4 r0 = double4x4(-396.6697396695007, 511.20749378167443, 249.11127030528678, -128.81731301584153, -259.49027669592306, 278.00817764830219, -81.393423356764686, 66.719732554033271, 167.85212691493894, 147.94395048354932, -326.10758486674524, 41.033564825092185, 128.5304239394751, 73.155582223625629, -60.132380275117384, -446.22976490772783); + TestUtils.AreEqual(r0, a0++); + + double4x4 a1 = double4x4(-296.93783797739906, 446.22930714405572, 49.200223230384381, -326.64314738225335, -510.86424064583343, 471.64748762159024, -171.01308186865089, 310.72735967800361, -298.91717185588425, 489.98497008252184, 184.60345109952777, 290.69102896875279, 117.1923401901463, 164.44293578175962, 412.36778874526158, -229.38657079887884); + double4x4 r1 = double4x4(-296.93783797739906, 446.22930714405572, 49.200223230384381, -326.64314738225335, -510.86424064583343, 471.64748762159024, -171.01308186865089, 310.72735967800361, -298.91717185588425, 489.98497008252184, 184.60345109952777, 290.69102896875279, 117.1923401901463, 164.44293578175962, 412.36778874526158, -229.38657079887884); + TestUtils.AreEqual(r1, a1++); + + double4x4 a2 = double4x4(239.59693848322934, -80.708194531830145, -391.03352016538076, -478.22714136458336, 166.86049159190645, -291.17449321000583, -389.39665216458809, -52.132133269744031, 35.755328910311391, 356.05211298356392, 6.5294592410929226, -285.34983052189921, 418.0164985219094, 47.142905018824536, 31.451607480389839, 148.9468749263076); + double4x4 r2 = double4x4(239.59693848322934, -80.708194531830145, -391.03352016538076, -478.22714136458336, 166.86049159190645, -291.17449321000583, -389.39665216458809, -52.132133269744031, 35.755328910311391, 356.05211298356392, 6.5294592410929226, -285.34983052189921, 418.0164985219094, 47.142905018824536, 31.451607480389839, 148.9468749263076); + TestUtils.AreEqual(r2, a2++); + + double4x4 a3 = double4x4(-219.80038200123255, 448.954246014801, -32.546052232638942, 441.97340771275265, -128.24944478285005, -472.43999383991581, -91.875647826062334, 72.4553273061548, -472.57310484003887, 300.02320756578035, 246.0031255437076, 288.02870358528048, -461.3402132752073, 495.5010147017897, -226.47537361200682, -241.57986437602892); + double4x4 r3 = double4x4(-219.80038200123255, 448.954246014801, -32.546052232638942, 441.97340771275265, -128.24944478285005, -472.43999383991581, -91.875647826062334, 72.4553273061548, -472.57310484003887, 300.02320756578035, 246.0031255437076, 288.02870358528048, -461.3402132752073, 495.5010147017897, -226.47537361200682, -241.57986437602892); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void double4x4_operator_prefix_dec() + { + double4x4 a0 = double4x4(123.12869626056806, 256.8437465433235, 156.33078844674435, 461.73742530389563, 325.86799755965728, 392.01561731473339, 187.87412580655609, -236.2252043393558, 125.10963517292851, 469.8447313112415, 45.536655685648611, 376.04684680329956, -363.07547991493504, -22.028951416736902, 248.79012667797042, 168.0950144120003); + double4x4 r0 = double4x4(122.12869626056806, 255.8437465433235, 155.33078844674435, 460.73742530389563, 324.86799755965728, 391.01561731473339, 186.87412580655609, -237.2252043393558, 124.10963517292851, 468.8447313112415, 44.536655685648611, 375.04684680329956, -364.07547991493504, -23.028951416736902, 247.79012667797042, 167.0950144120003); + TestUtils.AreEqual(r0, --a0); + + double4x4 a1 = double4x4(168.26565011230559, 166.9455474200405, 183.95795854551625, 485.69469259944492, -460.73930261132273, 89.569894117102876, -267.42982090051743, 201.75623450137505, -141.21688682456357, -217.48409782046645, 197.36173281323249, -213.54412732531506, 180.74062570405226, -128.31251412644633, 478.04553888647149, -454.56614062495817); + double4x4 r1 = double4x4(167.26565011230559, 165.9455474200405, 182.95795854551625, 484.69469259944492, -461.73930261132273, 88.569894117102876, -268.42982090051743, 200.75623450137505, -142.21688682456357, -218.48409782046645, 196.36173281323249, -214.54412732531506, 179.74062570405226, -129.31251412644633, 477.04553888647149, -455.56614062495817); + TestUtils.AreEqual(r1, --a1); + + double4x4 a2 = double4x4(-386.89835256473083, -315.11044969927076, -108.28654556548526, -286.31702937107394, -375.60158007945938, -87.60597113874087, 78.275426662655263, 161.5319641388636, -346.8479546731561, -57.540783670517044, 455.37286231265068, 444.79814478605897, 129.82014638270255, 134.71065455987616, 61.323015956824179, -274.54334486394345); + double4x4 r2 = double4x4(-387.89835256473083, -316.11044969927076, -109.28654556548526, -287.31702937107394, -376.60158007945938, -88.60597113874087, 77.275426662655263, 160.5319641388636, -347.8479546731561, -58.540783670517044, 454.37286231265068, 443.79814478605897, 128.82014638270255, 133.71065455987616, 60.323015956824179, -275.54334486394345); + TestUtils.AreEqual(r2, --a2); + + double4x4 a3 = double4x4(-43.3955581390278, 211.51068673446343, -161.216324642867, 149.43400366112314, 90.4325187627378, -344.72614757377937, -88.239390652738223, -252.0188091974793, -44.915115615779143, 97.499715135199835, 502.51239299332372, 489.31892298595926, 456.36900946887624, 86.157245437687834, 79.491116799177234, 318.61298742825772); + double4x4 r3 = double4x4(-44.3955581390278, 210.51068673446343, -162.216324642867, 148.43400366112314, 89.4325187627378, -345.72614757377937, -89.239390652738223, -253.0188091974793, -45.915115615779143, 96.499715135199835, 501.51239299332372, 488.31892298595926, 455.36900946887624, 85.157245437687834, 78.491116799177234, 317.61298742825772); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void double4x4_operator_postfix_dec() + { + double4x4 a0 = double4x4(379.68831723727669, 302.69287814884115, -176.07134040448409, -291.25267066212962, 470.56758401848731, -402.92594666170231, -63.655158787805192, 355.26110069605568, -27.889220489137415, -100.76183824462902, 156.14034969924967, 479.94519613680677, -200.30429491787419, -445.0269393609031, 407.42034907239508, 327.67032519340069); + double4x4 r0 = double4x4(379.68831723727669, 302.69287814884115, -176.07134040448409, -291.25267066212962, 470.56758401848731, -402.92594666170231, -63.655158787805192, 355.26110069605568, -27.889220489137415, -100.76183824462902, 156.14034969924967, 479.94519613680677, -200.30429491787419, -445.0269393609031, 407.42034907239508, 327.67032519340069); + TestUtils.AreEqual(r0, a0--); + + double4x4 a1 = double4x4(48.0602071509046, -38.435048836485976, 283.941595924991, -94.802087112703418, 152.51066334196867, -287.262531175866, -215.94803939384781, -407.04635567546188, 159.23357136511879, -359.45648663093175, 168.4139531442961, -278.93379868144814, 289.91284073978329, 402.03954691534841, 470.71654937729079, -208.56061873611094); + double4x4 r1 = double4x4(48.0602071509046, -38.435048836485976, 283.941595924991, -94.802087112703418, 152.51066334196867, -287.262531175866, -215.94803939384781, -407.04635567546188, 159.23357136511879, -359.45648663093175, 168.4139531442961, -278.93379868144814, 289.91284073978329, 402.03954691534841, 470.71654937729079, -208.56061873611094); + TestUtils.AreEqual(r1, a1--); + + double4x4 a2 = double4x4(145.89674789546837, -274.57083309561517, -250.04125630578085, -70.856303486440481, -485.627825724719, -341.09452668814663, -503.19208335466317, 397.64861387649955, 446.6215557747621, -292.8101204805123, 126.6225212209963, -250.44240700939781, 470.81648204793055, 26.943619502216393, -186.92351945998308, 45.746085426651916); + double4x4 r2 = double4x4(145.89674789546837, -274.57083309561517, -250.04125630578085, -70.856303486440481, -485.627825724719, -341.09452668814663, -503.19208335466317, 397.64861387649955, 446.6215557747621, -292.8101204805123, 126.6225212209963, -250.44240700939781, 470.81648204793055, 26.943619502216393, -186.92351945998308, 45.746085426651916); + TestUtils.AreEqual(r2, a2--); + + double4x4 a3 = double4x4(-206.45597586708885, -350.94811527382029, -92.184192461978739, -37.509595650019889, 114.51668577758437, 77.955409324707148, -472.12330101063628, -396.20631498666773, -200.66598734663148, 468.53053996922938, 279.93088806789876, 122.19489937750382, 194.19793877107929, 9.1986148400226284, 197.42380032195888, 176.50581487291765); + double4x4 r3 = double4x4(-206.45597586708885, -350.94811527382029, -92.184192461978739, -37.509595650019889, 114.51668577758437, 77.955409324707148, -472.12330101063628, -396.20631498666773, -200.66598734663148, 468.53053996922938, 279.93088806789876, 122.19489937750382, 194.19793877107929, 9.1986148400226284, 197.42380032195888, 176.50581487291765); + TestUtils.AreEqual(r3, a3--); + } + + [TestCase /* For player builds */] + public static void double4x4_EqualsObjectOverride() + { + TestUtils.IsFalse(new double4x4().Equals((object)new int())); + TestUtils.IsTrue(new double4x4().Equals((object)new double4x4())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestDouble4x4.gen.cs.meta b/src/Tests/Tests/Shared/TestDouble4x4.gen.cs.meta new file mode 100644 index 00000000..9231c46f --- /dev/null +++ b/src/Tests/Tests/Shared/TestDouble4x4.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1021c7218a1b3894ba0a61ae37e36a8c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestFloat2.gen.cs b/src/Tests/Tests/Shared/TestFloat2.gen.cs new file mode 100644 index 00000000..885cbf2c --- /dev/null +++ b/src/Tests/Tests/Shared/TestFloat2.gen.cs @@ -0,0 +1,1062 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestFloat2 + { + [TestCompiler] + public static void float2_zero() + { + TestUtils.AreEqual(0.0f, float2.zero.x); + TestUtils.AreEqual(0.0f, float2.zero.y); + } + + [TestCompiler] + public static void float2_constructor() + { + float2 a = new float2(1, 2); + TestUtils.AreEqual(1, a.x); + TestUtils.AreEqual(2, a.y); + } + + [TestCompiler] + public static void float2_scalar_constructor() + { + float2 a = new float2(17.0f); + TestUtils.AreEqual(17.0f, a.x); + TestUtils.AreEqual(17.0f, a.y); + } + + [TestCompiler] + public static void float2_static_constructor() + { + float2 a = float2(1, 2); + TestUtils.AreEqual(1, a.x); + TestUtils.AreEqual(2, a.y); + } + + [TestCompiler] + public static void float2_static_scalar_constructor() + { + float2 a = float2(17.0f); + TestUtils.AreEqual(17.0f, a.x); + TestUtils.AreEqual(17.0f, a.y); + } + + [TestCompiler] + public static void float2_operator_equal_wide_wide() + { + float2 a0 = float2(492.1576f, -495.206329f); + float2 b0 = float2(192.568787f, -235.611023f); + bool2 r0 = bool2(false, false); + TestUtils.AreEqual(r0, a0 == b0); + + float2 a1 = float2(227.457642f, -147.374054f); + float2 b1 = float2(-254.043121f, -412.624725f); + bool2 r1 = bool2(false, false); + TestUtils.AreEqual(r1, a1 == b1); + + float2 a2 = float2(-222.682f, 64.09375f); + float2 b2 = float2(471.9048f, -6.47277832f); + bool2 r2 = bool2(false, false); + TestUtils.AreEqual(r2, a2 == b2); + + float2 a3 = float2(-23.8904114f, -16.8197327f); + float2 b3 = float2(-339.102356f, 488.187561f); + bool2 r3 = bool2(false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void float2_operator_equal_wide_scalar() + { + float2 a0 = float2(-303.230072f, 451.5263f); + float b0 = (123.544556f); + bool2 r0 = bool2(false, false); + TestUtils.AreEqual(r0, a0 == b0); + + float2 a1 = float2(-253.655884f, -500.6911f); + float b1 = (-105.203644f); + bool2 r1 = bool2(false, false); + TestUtils.AreEqual(r1, a1 == b1); + + float2 a2 = float2(-426.192474f, -59.55838f); + float b2 = (159.8761f); + bool2 r2 = bool2(false, false); + TestUtils.AreEqual(r2, a2 == b2); + + float2 a3 = float2(-57.4773865f, 406.513733f); + float b3 = (-182.049744f); + bool2 r3 = bool2(false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void float2_operator_equal_scalar_wide() + { + float a0 = (-253.397278f); + float2 b0 = float2(19.95221f, -185.791992f); + bool2 r0 = bool2(false, false); + TestUtils.AreEqual(r0, a0 == b0); + + float a1 = (407.8136f); + float2 b1 = float2(-87.2767f, -206.274689f); + bool2 r1 = bool2(false, false); + TestUtils.AreEqual(r1, a1 == b1); + + float a2 = (160.503113f); + float2 b2 = float2(-274.7708f, -2.63153076f); + bool2 r2 = bool2(false, false); + TestUtils.AreEqual(r2, a2 == b2); + + float a3 = (448.354553f); + float2 b3 = float2(-410.035248f, 247.329041f); + bool2 r3 = bool2(false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void float2_operator_not_equal_wide_wide() + { + float2 a0 = float2(430.842529f, 104.69f); + float2 b0 = float2(210.024719f, -55.20334f); + bool2 r0 = bool2(true, true); + TestUtils.AreEqual(r0, a0 != b0); + + float2 a1 = float2(225.802429f, -310.5702f); + float2 b1 = float2(-269.925354f, -234.546722f); + bool2 r1 = bool2(true, true); + TestUtils.AreEqual(r1, a1 != b1); + + float2 a2 = float2(-418.619446f, 304.128174f); + float2 b2 = float2(25.91742f, -63.72699f); + bool2 r2 = bool2(true, true); + TestUtils.AreEqual(r2, a2 != b2); + + float2 a3 = float2(-509.3268f, -160.538086f); + float2 b3 = float2(-484.5537f, -425.3336f); + bool2 r3 = bool2(true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void float2_operator_not_equal_wide_scalar() + { + float2 a0 = float2(-16.9145813f, 168.8341f); + float b0 = (-145.372772f); + bool2 r0 = bool2(true, true); + TestUtils.AreEqual(r0, a0 != b0); + + float2 a1 = float2(-462.713531f, 214.501587f); + float b1 = (130.307739f); + bool2 r1 = bool2(true, true); + TestUtils.AreEqual(r1, a1 != b1); + + float2 a2 = float2(-440.263275f, -169.099854f); + float b2 = (-197.12796f); + bool2 r2 = bool2(true, true); + TestUtils.AreEqual(r2, a2 != b2); + + float2 a3 = float2(-386.611176f, -270.26886f); + float b3 = (-281.021f); + bool2 r3 = bool2(true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void float2_operator_not_equal_scalar_wide() + { + float a0 = (275.795837f); + float2 b0 = float2(-57.1969f, -382.432526f); + bool2 r0 = bool2(true, true); + TestUtils.AreEqual(r0, a0 != b0); + + float a1 = (97.82037f); + float2 b1 = float2(-161.463654f, -458.39563f); + bool2 r1 = bool2(true, true); + TestUtils.AreEqual(r1, a1 != b1); + + float a2 = (-499.617859f); + float2 b2 = float2(327.92218f, 367.571228f); + bool2 r2 = bool2(true, true); + TestUtils.AreEqual(r2, a2 != b2); + + float a3 = (59.786377f); + float2 b3 = float2(-209.580688f, -62.5804443f); + bool2 r3 = bool2(true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void float2_operator_less_wide_wide() + { + float2 a0 = float2(196.84259f, 336.4098f); + float2 b0 = float2(-465.345032f, -256.1524f); + bool2 r0 = bool2(false, false); + TestUtils.AreEqual(r0, a0 < b0); + + float2 a1 = float2(251.963745f, 257.655945f); + float2 b1 = float2(-314.814026f, 364.5667f); + bool2 r1 = bool2(false, true); + TestUtils.AreEqual(r1, a1 < b1); + + float2 a2 = float2(430.0459f, -62.4196472f); + float2 b2 = float2(100.21051f, 182.560974f); + bool2 r2 = bool2(false, true); + TestUtils.AreEqual(r2, a2 < b2); + + float2 a3 = float2(8.839233f, -333.8167f); + float2 b3 = float2(3.11700439f, -259.430481f); + bool2 r3 = bool2(false, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void float2_operator_less_wide_scalar() + { + float2 a0 = float2(-132.057312f, -192.465f); + float b0 = (-156.010223f); + bool2 r0 = bool2(false, true); + TestUtils.AreEqual(r0, a0 < b0); + + float2 a1 = float2(-66.8345947f, -360.2824f); + float b1 = (-379.017517f); + bool2 r1 = bool2(false, false); + TestUtils.AreEqual(r1, a1 < b1); + + float2 a2 = float2(20.9278564f, 437.3459f); + float b2 = (-158.240753f); + bool2 r2 = bool2(false, false); + TestUtils.AreEqual(r2, a2 < b2); + + float2 a3 = float2(-20.4526062f, 307.4842f); + float b3 = (225.2915f); + bool2 r3 = bool2(true, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void float2_operator_less_scalar_wide() + { + float a0 = (-423.1174f); + float2 b0 = float2(385.094849f, -123.933472f); + bool2 r0 = bool2(true, true); + TestUtils.AreEqual(r0, a0 < b0); + + float a1 = (86.37659f); + float2 b1 = float2(133.4422f, 161.457947f); + bool2 r1 = bool2(true, true); + TestUtils.AreEqual(r1, a1 < b1); + + float a2 = (229.754272f); + float2 b2 = float2(222.5716f, 315.5312f); + bool2 r2 = bool2(false, true); + TestUtils.AreEqual(r2, a2 < b2); + + float a3 = (-447.203522f); + float2 b3 = float2(271.833862f, -393.605316f); + bool2 r3 = bool2(true, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void float2_operator_greater_wide_wide() + { + float2 a0 = float2(483.5014f, 310.8156f); + float2 b0 = float2(-471.398f, -371.9853f); + bool2 r0 = bool2(true, true); + TestUtils.AreEqual(r0, a0 > b0); + + float2 a1 = float2(106.966187f, 295.7353f); + float2 b1 = float2(36.9006958f, -316.7636f); + bool2 r1 = bool2(true, true); + TestUtils.AreEqual(r1, a1 > b1); + + float2 a2 = float2(116.957581f, -478.299774f); + float2 b2 = float2(19.6830444f, 207.309143f); + bool2 r2 = bool2(true, false); + TestUtils.AreEqual(r2, a2 > b2); + + float2 a3 = float2(-14.8974f, -33.8174438f); + float2 b3 = float2(362.7975f, 324.95343f); + bool2 r3 = bool2(false, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void float2_operator_greater_wide_scalar() + { + float2 a0 = float2(64.31793f, -397.703461f); + float b0 = (305.859924f); + bool2 r0 = bool2(false, false); + TestUtils.AreEqual(r0, a0 > b0); + + float2 a1 = float2(431.8769f, 246.263062f); + float b1 = (85.703f); + bool2 r1 = bool2(true, true); + TestUtils.AreEqual(r1, a1 > b1); + + float2 a2 = float2(197.491577f, 280.813354f); + float b2 = (286.199463f); + bool2 r2 = bool2(false, false); + TestUtils.AreEqual(r2, a2 > b2); + + float2 a3 = float2(-405.7846f, -241.807281f); + float b3 = (171.565369f); + bool2 r3 = bool2(false, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void float2_operator_greater_scalar_wide() + { + float a0 = (-282.6705f); + float2 b0 = float2(358.099976f, -72.596405f); + bool2 r0 = bool2(false, false); + TestUtils.AreEqual(r0, a0 > b0); + + float a1 = (-232.163788f); + float2 b1 = float2(-60.7067261f, 75.15662f); + bool2 r1 = bool2(false, false); + TestUtils.AreEqual(r1, a1 > b1); + + float a2 = (150.883484f); + float2 b2 = float2(339.539185f, -498.196045f); + bool2 r2 = bool2(false, true); + TestUtils.AreEqual(r2, a2 > b2); + + float a3 = (459.7461f); + float2 b3 = float2(-227.968719f, 335.862122f); + bool2 r3 = bool2(true, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void float2_operator_less_equal_wide_wide() + { + float2 a0 = float2(-438.523132f, 210.489441f); + float2 b0 = float2(-474.814148f, 304.371033f); + bool2 r0 = bool2(false, true); + TestUtils.AreEqual(r0, a0 <= b0); + + float2 a1 = float2(4.87731934f, -137.297943f); + float2 b1 = float2(234.824158f, -390.485443f); + bool2 r1 = bool2(true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + float2 a2 = float2(156.094116f, -363.924133f); + float2 b2 = float2(-297.175354f, -326.2924f); + bool2 r2 = bool2(false, true); + TestUtils.AreEqual(r2, a2 <= b2); + + float2 a3 = float2(-97.94849f, 437.2954f); + float2 b3 = float2(107.253906f, -413.131073f); + bool2 r3 = bool2(true, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void float2_operator_less_equal_wide_scalar() + { + float2 a0 = float2(193.49585f, 168.915527f); + float b0 = (443.850525f); + bool2 r0 = bool2(true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + float2 a1 = float2(-313.993073f, 18.5036011f); + float b1 = (81.8269653f); + bool2 r1 = bool2(true, true); + TestUtils.AreEqual(r1, a1 <= b1); + + float2 a2 = float2(-0.3581848f, -463.8164f); + float b2 = (241.361145f); + bool2 r2 = bool2(true, true); + TestUtils.AreEqual(r2, a2 <= b2); + + float2 a3 = float2(-1.35775757f, 398.991943f); + float b3 = (-268.899475f); + bool2 r3 = bool2(false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void float2_operator_less_equal_scalar_wide() + { + float a0 = (393.606262f); + float2 b0 = float2(-75.6883545f, -44.2638855f); + bool2 r0 = bool2(false, false); + TestUtils.AreEqual(r0, a0 <= b0); + + float a1 = (125.864929f); + float2 b1 = float2(191.9649f, 13.54303f); + bool2 r1 = bool2(true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + float a2 = (-197.051941f); + float2 b2 = float2(-423.9451f, -330.0486f); + bool2 r2 = bool2(false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + float a3 = (420.165527f); + float2 b3 = float2(105.5473f, 174.821289f); + bool2 r3 = bool2(false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void float2_operator_greater_equal_wide_wide() + { + float2 a0 = float2(-507.9286f, 504.4975f); + float2 b0 = float2(-81.3465f, 297.666138f); + bool2 r0 = bool2(false, true); + TestUtils.AreEqual(r0, a0 >= b0); + + float2 a1 = float2(-385.4345f, -262.323425f); + float2 b1 = float2(171.06543f, -431.038055f); + bool2 r1 = bool2(false, true); + TestUtils.AreEqual(r1, a1 >= b1); + + float2 a2 = float2(-37.5509338f, -111.595276f); + float2 b2 = float2(-6.85907f, 319.7257f); + bool2 r2 = bool2(false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + float2 a3 = float2(-463.702026f, 387.448853f); + float2 b3 = float2(254.079163f, 396.5724f); + bool2 r3 = bool2(false, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void float2_operator_greater_equal_wide_scalar() + { + float2 a0 = float2(465.152161f, -424.886078f); + float b0 = (-5.599884f); + bool2 r0 = bool2(true, false); + TestUtils.AreEqual(r0, a0 >= b0); + + float2 a1 = float2(-209.2211f, -302.2691f); + float b1 = (58.7798462f); + bool2 r1 = bool2(false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + float2 a2 = float2(140.12561f, -344.559967f); + float b2 = (16.3533936f); + bool2 r2 = bool2(true, false); + TestUtils.AreEqual(r2, a2 >= b2); + + float2 a3 = float2(393.278076f, 441.011536f); + float b3 = (-315.701538f); + bool2 r3 = bool2(true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void float2_operator_greater_equal_scalar_wide() + { + float a0 = (374.827026f); + float2 b0 = float2(-1.60977173f, 338.615234f); + bool2 r0 = bool2(true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + float a1 = (-116.1814f); + float2 b1 = float2(-332.157318f, -355.97937f); + bool2 r1 = bool2(true, true); + TestUtils.AreEqual(r1, a1 >= b1); + + float a2 = (-468.901428f); + float2 b2 = float2(38.579895f, -332.347534f); + bool2 r2 = bool2(false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + float a3 = (2.89013672f); + float2 b3 = float2(467.777771f, 121.406372f); + bool2 r3 = bool2(false, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void float2_operator_add_wide_wide() + { + float2 a0 = float2(506.129028f, -501.779816f); + float2 b0 = float2(-28.7579956f, -337.135132f); + float2 r0 = float2(477.371033f, -838.9149f); + TestUtils.AreEqual(r0, a0 + b0); + + float2 a1 = float2(420.084778f, -186.032074f); + float2 b1 = float2(-340.676819f, 152.312012f); + float2 r1 = float2(79.40796f, -33.7200623f); + TestUtils.AreEqual(r1, a1 + b1); + + float2 a2 = float2(-9.312408f, 328.51178f); + float2 b2 = float2(423.66748f, 90.3740845f); + float2 r2 = float2(414.355072f, 418.885864f); + TestUtils.AreEqual(r2, a2 + b2); + + float2 a3 = float2(424.344055f, 87.79108f); + float2 b3 = float2(376.18866f, 1.76721191f); + float2 r3 = float2(800.5327f, 89.55829f); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void float2_operator_add_wide_scalar() + { + float2 a0 = float2(-194.514191f, 338.5484f); + float b0 = (124.121704f); + float2 r0 = float2(-70.39249f, 462.6701f); + TestUtils.AreEqual(r0, a0 + b0); + + float2 a1 = float2(246.971375f, -45.72467f); + float b1 = (100.510925f); + float2 r1 = float2(347.4823f, 54.7862549f); + TestUtils.AreEqual(r1, a1 + b1); + + float2 a2 = float2(-478.1113f, 60.37433f); + float b2 = (30.9161377f); + float2 r2 = float2(-447.19516f, 91.29047f); + TestUtils.AreEqual(r2, a2 + b2); + + float2 a3 = float2(-242.118744f, 6.79937744f); + float b3 = (82.50134f); + float2 r3 = float2(-159.6174f, 89.30072f); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void float2_operator_add_scalar_wide() + { + float a0 = (-340.354675f); + float2 b0 = float2(511.362244f, -146.216644f); + float2 r0 = float2(171.007568f, -486.57132f); + TestUtils.AreEqual(r0, a0 + b0); + + float a1 = (-106.210419f); + float2 b1 = float2(-363.450256f, 199.0896f); + float2 r1 = float2(-469.660675f, 92.87918f); + TestUtils.AreEqual(r1, a1 + b1); + + float a2 = (-27.1083984f); + float2 b2 = float2(419.849f, 284.955017f); + float2 r2 = float2(392.7406f, 257.846619f); + TestUtils.AreEqual(r2, a2 + b2); + + float a3 = (-164.9242f); + float2 b3 = float2(-249.190338f, 150.928162f); + float2 r3 = float2(-414.114532f, -13.9960327f); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void float2_operator_sub_wide_wide() + { + float2 a0 = float2(160.492249f, 11.223938f); + float2 b0 = float2(115.46875f, -130.9823f); + float2 r0 = float2(45.0235f, 142.206238f); + TestUtils.AreEqual(r0, a0 - b0); + + float2 a1 = float2(359.200134f, -498.2283f); + float2 b1 = float2(241.540833f, 9.987061f); + float2 r1 = float2(117.6593f, -508.215363f); + TestUtils.AreEqual(r1, a1 - b1); + + float2 a2 = float2(-355.253632f, -94.53485f); + float2 b2 = float2(419.895142f, 59.12445f); + float2 r2 = float2(-775.1488f, -153.6593f); + TestUtils.AreEqual(r2, a2 - b2); + + float2 a3 = float2(-410.46405f, -401.384644f); + float2 b3 = float2(-402.381653f, -75.37015f); + float2 r3 = float2(-8.082397f, -326.0145f); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void float2_operator_sub_wide_scalar() + { + float2 a0 = float2(207.389587f, 248.457764f); + float b0 = (-36.1124878f); + float2 r0 = float2(243.502075f, 284.570251f); + TestUtils.AreEqual(r0, a0 - b0); + + float2 a1 = float2(-384.8239f, -374.811554f); + float b1 = (-205.344757f); + float2 r1 = float2(-179.479156f, -169.4668f); + TestUtils.AreEqual(r1, a1 - b1); + + float2 a2 = float2(191.642029f, -44.96161f); + float b2 = (18.8562622f); + float2 r2 = float2(172.785767f, -63.81787f); + TestUtils.AreEqual(r2, a2 - b2); + + float2 a3 = float2(480.857971f, -366.865448f); + float b3 = (16.3381958f); + float2 r3 = float2(464.519775f, -383.203644f); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void float2_operator_sub_scalar_wide() + { + float a0 = (-86.00824f); + float2 b0 = float2(466.4251f, 298.486938f); + float2 r0 = float2(-552.43335f, -384.495178f); + TestUtils.AreEqual(r0, a0 - b0); + + float a1 = (-300.9501f); + float2 b1 = float2(315.38f, -381.092163f); + float2 r1 = float2(-616.3301f, 80.14206f); + TestUtils.AreEqual(r1, a1 - b1); + + float a2 = (-125.008362f); + float2 b2 = float2(58.4661865f, 214.7461f); + float2 r2 = float2(-183.474548f, -339.754456f); + TestUtils.AreEqual(r2, a2 - b2); + + float a3 = (-257.549438f); + float2 b3 = float2(480.2246f, -443.355072f); + float2 r3 = float2(-737.774048f, 185.805634f); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void float2_operator_mul_wide_wide() + { + float2 a0 = float2(-482.7138f, -407.2935f); + float2 b0 = float2(-236.367889f, 260.7276f); + float2 r0 = float2(114098.047f, -106192.656f); + TestUtils.AreEqual(r0, a0 * b0); + + float2 a1 = float2(137.700562f, 208.541138f); + float2 b1 = float2(-416.3863f, -364.4956f); + float2 r1 = float2(-57336.625f, -76012.33f); + TestUtils.AreEqual(r1, a1 * b1); + + float2 a2 = float2(194.29657f, -484.242432f); + float2 b2 = float2(-253.147522f, -369.202881f); + float2 r2 = float2(-49185.6953f, 178783.7f); + TestUtils.AreEqual(r2, a2 * b2); + + float2 a3 = float2(183.9873f, -241.33548f); + float2 b3 = float2(193.547913f, 169.0849f); + float2 r3 = float2(35610.36f, -40806.1836f); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void float2_operator_mul_wide_scalar() + { + float2 a0 = float2(-96.31882f, -277.142273f); + float b0 = (-301.2072f); + float2 r0 = float2(29011.9219f, 83477.25f); + TestUtils.AreEqual(r0, a0 * b0); + + float2 a1 = float2(-239.93689f, 255.8581f); + float b1 = (509.531433f); + float2 r1 = float2(-122255.391f, 130367.742f); + TestUtils.AreEqual(r1, a1 * b1); + + float2 a2 = float2(215.7315f, -389.2433f); + float b2 = (-455.50827f); + float2 r2 = float2(-98267.4844f, 177303.531f); + TestUtils.AreEqual(r2, a2 * b2); + + float2 a3 = float2(-338.29248f, 243.757324f); + float b3 = (53.7962646f); + float2 r3 = float2(-18198.8711f, 13113.2334f); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void float2_operator_mul_scalar_wide() + { + float a0 = (37.43219f); + float2 b0 = float2(96.74756f, 492.185364f); + float2 r0 = float2(3621.473f, 18423.5762f); + TestUtils.AreEqual(r0, a0 * b0); + + float a1 = (-274.054565f); + float2 b1 = float2(-452.870972f, 420.853333f); + float2 r1 = float2(124111.359f, -115336.773f); + TestUtils.AreEqual(r1, a1 * b1); + + float a2 = (102.182922f); + float2 b2 = float2(-114.948883f, -351.120056f); + float2 r2 = float2(-11745.8125f, -35878.4727f); + TestUtils.AreEqual(r2, a2 * b2); + + float a3 = (-464.664978f); + float2 b3 = float2(444.084839f, 447.1053f); + float2 r3 = float2(-206350.672f, -207754.172f); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void float2_operator_div_wide_wide() + { + float2 a0 = float2(-353.131439f, -102.799866f); + float2 b0 = float2(-178.739563f, -302.096283f); + float2 r0 = float2(1.97567582f, 0.34028843f); + TestUtils.AreEqual(r0, a0 / b0); + + float2 a1 = float2(51.3191528f, -191.871674f); + float2 b1 = float2(-199.405823f, 278.850769f); + float2 r1 = float2(-0.257360339f, -0.688080132f); + TestUtils.AreEqual(r1, a1 / b1); + + float2 a2 = float2(8.041809f, -128.73764f); + float2 b2 = float2(502.3376f, -361.484833f); + float2 r2 = float2(0.0160087738f, 0.356135666f); + TestUtils.AreEqual(r2, a2 / b2); + + float2 a3 = float2(-136.0596f, -370.471f); + float2 b3 = float2(353.121033f, -38.894928f); + float2 r3 = float2(-0.385305852f, 9.524919f); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void float2_operator_div_wide_scalar() + { + float2 a0 = float2(171.3424f, 0.103393555f); + float b0 = (171.796814f); + float2 r0 = float2(0.997355f, 0.000601836247f); + TestUtils.AreEqual(r0, a0 / b0); + + float2 a1 = float2(57.8882446f, 95.66968f); + float b1 = (-256.130737f); + float2 r1 = float2(-0.226010531f, -0.3735189f); + TestUtils.AreEqual(r1, a1 / b1); + + float2 a2 = float2(-290.3869f, -79.7449f); + float b2 = (-127.4487f); + float2 r2 = float2(2.278461f, 0.625701964f); + TestUtils.AreEqual(r2, a2 / b2); + + float2 a3 = float2(146.466858f, 58.68634f); + float b3 = (-499.843567f); + float2 r3 = float2(-0.2930254f, -0.117409416f); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void float2_operator_div_scalar_wide() + { + float a0 = (-264.4425f); + float2 b0 = float2(105.589111f, -142.349091f); + float2 r0 = float2(-2.50444865f, 1.85770416f); + TestUtils.AreEqual(r0, a0 / b0); + + float a1 = (-288.9489f); + float2 b1 = float2(39.644104f, -363.9914f); + float2 r1 = float2(-7.28857231f, 0.793834448f); + TestUtils.AreEqual(r1, a1 / b1); + + float a2 = (-149.718231f); + float2 b2 = float2(-395.729126f, 258.7187f); + float2 r2 = float2(0.378335118f, -0.5786912f); + TestUtils.AreEqual(r2, a2 / b2); + + float a3 = (-9.66626f); + float2 b3 = float2(117.725525f, -331.386536f); + float2 r3 = float2(-0.0821084455f, 0.0291691385f); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void float2_operator_mod_wide_wide() + { + float2 a0 = float2(-388.8125f, 181.681213f); + float2 b0 = float2(436.944153f, 58.9400635f); + float2 r0 = float2(-388.8125f, 4.861023f); + TestUtils.AreEqual(r0, a0 % b0); + + float2 a1 = float2(-167.078735f, 432.820129f); + float2 b1 = float2(-201.116241f, 279.289368f); + float2 r1 = float2(-167.078735f, 153.530762f); + TestUtils.AreEqual(r1, a1 % b1); + + float2 a2 = float2(-258.438965f, -170.110809f); + float2 b2 = float2(-397.079773f, 377.899963f); + float2 r2 = float2(-258.438965f, -170.110809f); + TestUtils.AreEqual(r2, a2 % b2); + + float2 a3 = float2(283.3183f, 122.716492f); + float2 b3 = float2(174.693848f, -228.176514f); + float2 r3 = float2(108.624451f, 122.716492f); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void float2_operator_mod_wide_scalar() + { + float2 a0 = float2(-244.499634f, -211.8193f); + float b0 = (39.63495f); + float2 r0 = float2(-6.68994141f, -13.6445618f); + TestUtils.AreEqual(r0, a0 % b0); + + float2 a1 = float2(-145.926788f, 155.479492f); + float b1 = (-304.9182f); + float2 r1 = float2(-145.926788f, 155.479492f); + TestUtils.AreEqual(r1, a1 % b1); + + float2 a2 = float2(-133.907776f, -226.535767f); + float b2 = (281.309631f); + float2 r2 = float2(-133.907776f, -226.535767f); + TestUtils.AreEqual(r2, a2 % b2); + + float2 a3 = float2(335.166138f, 319.4715f); + float b3 = (101.706482f); + float2 r3 = float2(30.0466919f, 14.3520508f); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void float2_operator_mod_scalar_wide() + { + float a0 = (-66.94504f); + float2 b0 = float2(-249.7761f, -396.073761f); + float2 r0 = float2(-66.94504f, -66.94504f); + TestUtils.AreEqual(r0, a0 % b0); + + float a1 = (386.492065f); + float2 b1 = float2(168.939453f, -199.418243f); + float2 r1 = float2(48.61316f, 187.073822f); + TestUtils.AreEqual(r1, a1 % b1); + + float a2 = (261.7517f); + float2 b2 = float2(16.1274414f, 257.668152f); + float2 r2 = float2(3.71264648f, 4.083557f); + TestUtils.AreEqual(r2, a2 % b2); + + float a3 = (-75.78845f); + float2 b3 = float2(170.9563f, -242.858276f); + float2 r3 = float2(-75.78845f, -75.78845f); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void float2_operator_plus() + { + float2 a0 = float2(-418.829559f, -405.79895f); + float2 r0 = float2(-418.829559f, -405.79895f); + TestUtils.AreEqual(r0, +a0); + + float2 a1 = float2(-34.04178f, -459.8391f); + float2 r1 = float2(-34.04178f, -459.8391f); + TestUtils.AreEqual(r1, +a1); + + float2 a2 = float2(210.86145f, -373.015442f); + float2 r2 = float2(210.86145f, -373.015442f); + TestUtils.AreEqual(r2, +a2); + + float2 a3 = float2(-386.059845f, -418.645264f); + float2 r3 = float2(-386.059845f, -418.645264f); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void float2_operator_neg() + { + float2 a0 = float2(148.461731f, -467.122681f); + float2 r0 = float2(-148.461731f, 467.122681f); + TestUtils.AreEqual(r0, -a0); + + float2 a1 = float2(132.04718f, 473.701f); + float2 r1 = float2(-132.04718f, -473.701f); + TestUtils.AreEqual(r1, -a1); + + float2 a2 = float2(-407.9911f, -382.9898f); + float2 r2 = float2(407.9911f, 382.9898f); + TestUtils.AreEqual(r2, -a2); + + float2 a3 = float2(-299.093384f, 407.709778f); + float2 r3 = float2(299.093384f, -407.709778f); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void float2_operator_prefix_inc() + { + float2 a0 = float2(-139.842072f, -56.7436523f); + float2 r0 = float2(-138.842072f, -55.7436523f); + TestUtils.AreEqual(r0, ++a0); + + float2 a1 = float2(-381.955322f, -222.896332f); + float2 r1 = float2(-380.955322f, -221.896332f); + TestUtils.AreEqual(r1, ++a1); + + float2 a2 = float2(210.319885f, -300.1941f); + float2 r2 = float2(211.319885f, -299.1941f); + TestUtils.AreEqual(r2, ++a2); + + float2 a3 = float2(362.212769f, 130.90918f); + float2 r3 = float2(363.212769f, 131.90918f); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void float2_operator_postfix_inc() + { + float2 a0 = float2(-396.669739f, 511.20752f); + float2 r0 = float2(-396.669739f, 511.20752f); + TestUtils.AreEqual(r0, a0++); + + float2 a1 = float2(249.111267f, -259.4903f); + float2 r1 = float2(249.111267f, -259.4903f); + TestUtils.AreEqual(r1, a1++); + + float2 a2 = float2(278.008179f, 66.71973f); + float2 r2 = float2(278.008179f, 66.71973f); + TestUtils.AreEqual(r2, a2++); + + float2 a3 = float2(167.852112f, -326.1076f); + float2 r3 = float2(167.852112f, -326.1076f); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void float2_operator_prefix_dec() + { + float2 a0 = float2(123.128723f, 256.84375f); + float2 r0 = float2(122.128723f, 255.84375f); + TestUtils.AreEqual(r0, --a0); + + float2 a1 = float2(156.330811f, 325.867981f); + float2 r1 = float2(155.330811f, 324.867981f); + TestUtils.AreEqual(r1, --a1); + + float2 a2 = float2(392.015625f, -236.225189f); + float2 r2 = float2(391.015625f, -237.225189f); + TestUtils.AreEqual(r2, --a2); + + float2 a3 = float2(125.109619f, 45.5366821f); + float2 r3 = float2(124.109619f, 44.5366821f); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void float2_operator_postfix_dec() + { + float2 a0 = float2(379.6883f, 302.692871f); + float2 r0 = float2(379.6883f, 302.692871f); + TestUtils.AreEqual(r0, a0--); + + float2 a1 = float2(-176.07135f, 470.567566f); + float2 r1 = float2(-176.07135f, 470.567566f); + TestUtils.AreEqual(r1, a1--); + + float2 a2 = float2(-402.925964f, 355.2611f); + float2 r2 = float2(-402.925964f, 355.2611f); + TestUtils.AreEqual(r2, a2--); + + float2 a3 = float2(-27.8892212f, 156.14032f); + float2 r3 = float2(-27.8892212f, 156.14032f); + TestUtils.AreEqual(r3, a3--); + } + + [TestCompiler] + public static void float2_shuffle_result_1() + { + float2 a = float2(0, 1); + float2 b = float2(2, 3); + + TestUtils.AreEqual((0), shuffle(a, b, ShuffleComponent.LeftX)); + TestUtils.AreEqual((1), shuffle(a, b, ShuffleComponent.LeftY)); + TestUtils.AreEqual((2), shuffle(a, b, ShuffleComponent.RightX)); + TestUtils.AreEqual((3), shuffle(a, b, ShuffleComponent.RightY)); + } + + [TestCompiler] + public static void float2_shuffle_result_2() + { + float2 a = float2(0, 1); + float2 b = float2(2, 3); + + TestUtils.AreEqual(float2(0, 0), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.LeftX)); + TestUtils.AreEqual(float2(1, 0), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.LeftX)); + TestUtils.AreEqual(float2(2, 0), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftX)); + TestUtils.AreEqual(float2(3, 0), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftX)); + TestUtils.AreEqual(float2(0, 1), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.LeftY)); + TestUtils.AreEqual(float2(1, 1), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.LeftY)); + TestUtils.AreEqual(float2(2, 1), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftY)); + TestUtils.AreEqual(float2(3, 1), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftY)); + TestUtils.AreEqual(float2(0, 2), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.RightX)); + TestUtils.AreEqual(float2(1, 2), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.RightX)); + TestUtils.AreEqual(float2(2, 2), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightX)); + TestUtils.AreEqual(float2(3, 2), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightX)); + TestUtils.AreEqual(float2(0, 3), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.RightY)); + TestUtils.AreEqual(float2(1, 3), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.RightY)); + TestUtils.AreEqual(float2(2, 3), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightY)); + TestUtils.AreEqual(float2(3, 3), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightY)); + } + + [TestCompiler] + public static void float2_shuffle_result_3() + { + float2 a = float2(0, 1); + float2 b = float2(2, 3); + + TestUtils.AreEqual(float3(2, 3, 3), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightY, ShuffleComponent.RightY)); + TestUtils.AreEqual(float3(2, 0, 2), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftX, ShuffleComponent.RightX)); + TestUtils.AreEqual(float3(3, 1, 3), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftY, ShuffleComponent.RightY)); + TestUtils.AreEqual(float3(1, 1, 1), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.LeftY, ShuffleComponent.LeftY)); + TestUtils.AreEqual(float3(2, 1, 3), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftY, ShuffleComponent.RightY)); + TestUtils.AreEqual(float3(0, 3, 3), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.RightY, ShuffleComponent.RightY)); + TestUtils.AreEqual(float3(2, 1, 3), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftY, ShuffleComponent.RightY)); + TestUtils.AreEqual(float3(3, 3, 0), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightY, ShuffleComponent.LeftX)); + TestUtils.AreEqual(float3(2, 2, 3), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightX, ShuffleComponent.RightY)); + TestUtils.AreEqual(float3(2, 2, 0), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightX, ShuffleComponent.LeftX)); + TestUtils.AreEqual(float3(0, 1, 1), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.LeftY, ShuffleComponent.LeftY)); + TestUtils.AreEqual(float3(3, 2, 3), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightX, ShuffleComponent.RightY)); + TestUtils.AreEqual(float3(0, 1, 1), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.LeftY, ShuffleComponent.LeftY)); + TestUtils.AreEqual(float3(3, 2, 2), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightX, ShuffleComponent.RightX)); + TestUtils.AreEqual(float3(0, 1, 3), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.LeftY, ShuffleComponent.RightY)); + TestUtils.AreEqual(float3(3, 1, 1), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftY, ShuffleComponent.LeftY)); + } + + [TestCompiler] + public static void float2_shuffle_result_4() + { + float2 a = float2(0, 1); + float2 b = float2(2, 3); + + TestUtils.AreEqual(float4(0, 0, 1, 2), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.LeftX, ShuffleComponent.LeftY, ShuffleComponent.RightX)); + TestUtils.AreEqual(float4(2, 1, 0, 3), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftY, ShuffleComponent.LeftX, ShuffleComponent.RightY)); + TestUtils.AreEqual(float4(3, 2, 3, 2), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightX, ShuffleComponent.RightY, ShuffleComponent.RightX)); + TestUtils.AreEqual(float4(2, 0, 3, 3), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftX, ShuffleComponent.RightY, ShuffleComponent.RightY)); + TestUtils.AreEqual(float4(0, 3, 0, 2), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.RightY, ShuffleComponent.LeftX, ShuffleComponent.RightX)); + TestUtils.AreEqual(float4(3, 0, 3, 1), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftX, ShuffleComponent.RightY, ShuffleComponent.LeftY)); + TestUtils.AreEqual(float4(2, 2, 3, 0), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightX, ShuffleComponent.RightY, ShuffleComponent.LeftX)); + TestUtils.AreEqual(float4(2, 2, 0, 3), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightX, ShuffleComponent.LeftX, ShuffleComponent.RightY)); + TestUtils.AreEqual(float4(0, 1, 2, 1), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.LeftY, ShuffleComponent.RightX, ShuffleComponent.LeftY)); + TestUtils.AreEqual(float4(2, 1, 3, 3), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftY, ShuffleComponent.RightY, ShuffleComponent.RightY)); + TestUtils.AreEqual(float4(3, 3, 3, 1), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightY, ShuffleComponent.RightY, ShuffleComponent.LeftY)); + TestUtils.AreEqual(float4(2, 2, 1, 1), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightX, ShuffleComponent.LeftY, ShuffleComponent.LeftY)); + TestUtils.AreEqual(float4(3, 0, 0, 0), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftX, ShuffleComponent.LeftX, ShuffleComponent.LeftX)); + TestUtils.AreEqual(float4(2, 2, 2, 3), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightX, ShuffleComponent.RightX, ShuffleComponent.RightY)); + TestUtils.AreEqual(float4(0, 3, 0, 3), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.RightY, ShuffleComponent.LeftX, ShuffleComponent.RightY)); + TestUtils.AreEqual(float4(2, 0, 0, 0), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftX, ShuffleComponent.LeftX, ShuffleComponent.LeftX)); + } + + [TestCase /* For player builds */] + public static void float2_EqualsObjectOverride() + { + TestUtils.IsFalse(new float2().Equals((object)new int())); + TestUtils.IsTrue(new float2().Equals((object)new float2())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestFloat2.gen.cs.meta b/src/Tests/Tests/Shared/TestFloat2.gen.cs.meta new file mode 100644 index 00000000..51ad5c46 --- /dev/null +++ b/src/Tests/Tests/Shared/TestFloat2.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 79dc86a9e627dcb4a9b6c6ae87b366b6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestFloat2x2.gen.cs b/src/Tests/Tests/Shared/TestFloat2x2.gen.cs new file mode 100644 index 00000000..b56dd1c0 --- /dev/null +++ b/src/Tests/Tests/Shared/TestFloat2x2.gen.cs @@ -0,0 +1,957 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestFloat2x2 + { + [TestCompiler] + public static void float2x2_zero() + { + TestUtils.AreEqual(0.0f, float2x2.zero.c0.x); + TestUtils.AreEqual(0.0f, float2x2.zero.c0.y); + TestUtils.AreEqual(0.0f, float2x2.zero.c1.x); + TestUtils.AreEqual(0.0f, float2x2.zero.c1.y); + } + + [TestCompiler] + public static void float2x2_identity() + { + TestUtils.AreEqual(1.0f, float2x2.identity.c0.x); + TestUtils.AreEqual(0.0f, float2x2.identity.c0.y); + TestUtils.AreEqual(0.0f, float2x2.identity.c1.x); + TestUtils.AreEqual(1.0f, float2x2.identity.c1.y); + } + + [TestCompiler] + public static void float2x2_operator_equal_wide_wide() + { + float2x2 a0 = float2x2(492.1576f, -495.206329f, 227.457642f, -147.374054f); + float2x2 b0 = float2x2(192.568787f, -235.611023f, -254.043121f, -412.624725f); + bool2x2 r0 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + float2x2 a1 = float2x2(-222.682f, 64.09375f, -23.8904114f, -16.8197327f); + float2x2 b1 = float2x2(471.9048f, -6.47277832f, -339.102356f, 488.187561f); + bool2x2 r1 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + float2x2 a2 = float2x2(163.232117f, -165.271f, 470.8777f, -423.942566f); + float2x2 b2 = float2x2(-379.5966f, -308.417f, -82.333374f, -102.921082f); + bool2x2 r2 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + float2x2 a3 = float2x2(109.6344f, 462.6903f, -335.38147f, 357.2345f); + float2x2 b3 = float2x2(226.515747f, -356.9013f, -362.912781f, -427.898438f); + bool2x2 r3 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void float2x2_operator_equal_wide_scalar() + { + float2x2 a0 = float2x2(-303.230072f, 451.5263f, -253.655884f, -105.203644f); + float b0 = (123.544556f); + bool2x2 r0 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + float2x2 a1 = float2x2(-500.6911f, 159.8761f, -59.55838f, -57.4773865f); + float b1 = (-426.192474f); + bool2x2 r1 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + float2x2 a2 = float2x2(-182.049744f, 370.886f, -172.035309f, 455.400024f); + float b2 = (406.513733f); + bool2x2 r2 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + float2x2 a3 = float2x2(-11.3389893f, -27.1505737f, -325.976074f, -290.359039f); + float b3 = (363.938232f); + bool2x2 r3 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void float2x2_operator_equal_scalar_wide() + { + float a0 = (-253.397278f); + float2x2 b0 = float2x2(19.95221f, -185.791992f, 407.8136f, -87.2767f); + bool2x2 r0 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + float a1 = (-206.274689f); + float2x2 b1 = float2x2(160.503113f, -274.7708f, -2.63153076f, 448.354553f); + bool2x2 r1 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + float a2 = (-410.035248f); + float2x2 b2 = float2x2(247.329041f, 355.539124f, -298.0667f, 414.1015f); + bool2x2 r2 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + float a3 = (-481.3026f); + float2x2 b3 = float2x2(196.55072f, 34.6010132f, 113.7616f, -386.453369f); + bool2x2 r3 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void float2x2_operator_not_equal_wide_wide() + { + float2x2 a0 = float2x2(430.842529f, 104.69f, 225.802429f, -310.5702f); + float2x2 b0 = float2x2(210.024719f, -55.20334f, -269.925354f, -234.546722f); + bool2x2 r0 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + float2x2 a1 = float2x2(-418.619446f, 304.128174f, -509.3268f, -160.538086f); + float2x2 b1 = float2x2(25.91742f, -63.72699f, -484.5537f, -425.3336f); + bool2x2 r1 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + float2x2 a2 = float2x2(-203.301971f, -505.763245f, 162.17218f, 1.156189f); + float2x2 b2 = float2x2(-53.2743835f, 328.1944f, 15.9631348f, 461.7141f); + bool2x2 r2 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + float2x2 a3 = float2x2(65.66205f, 102.787781f, 172.930054f, 26.6210327f); + float2x2 b3 = float2x2(-113.363037f, -240.072968f, 495.119141f, 203.55835f); + bool2x2 r3 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void float2x2_operator_not_equal_wide_scalar() + { + float2x2 a0 = float2x2(-16.9145813f, 168.8341f, -462.713531f, 130.307739f); + float b0 = (-145.372772f); + bool2x2 r0 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + float2x2 a1 = float2x2(214.501587f, -197.12796f, -169.099854f, -386.611176f); + float b1 = (-440.263275f); + bool2x2 r1 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + float2x2 a2 = float2x2(-281.021f, -403.9637f, -269.805725f, 299.654236f); + float b2 = (-270.26886f); + bool2x2 r2 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + float2x2 a3 = float2x2(-71.7509155f, -457.363129f, -13.5195923f, 273.873047f); + float b3 = (-432.755737f); + bool2x2 r3 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void float2x2_operator_not_equal_scalar_wide() + { + float a0 = (275.795837f); + float2x2 b0 = float2x2(-57.1969f, -382.432526f, 97.82037f, -161.463654f); + bool2x2 r0 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + float a1 = (-458.39563f); + float2x2 b1 = float2x2(-499.617859f, 327.92218f, 367.571228f, 59.786377f); + bool2x2 r1 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + float a2 = (-209.580688f); + float2x2 b2 = float2x2(-62.5804443f, -479.974976f, -49.4945068f, -114.685211f); + bool2x2 r2 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + float a3 = (109.93927f); + float2x2 b3 = float2x2(-176.284821f, -347.4853f, 85.5409546f, -356.659546f); + bool2x2 r3 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void float2x2_operator_less_wide_wide() + { + float2x2 a0 = float2x2(196.84259f, 336.4098f, 251.963745f, 257.655945f); + float2x2 b0 = float2x2(-465.345032f, -256.1524f, -314.814026f, 364.5667f); + bool2x2 r0 = bool2x2(false, false, false, true); + TestUtils.AreEqual(r0, a0 < b0); + + float2x2 a1 = float2x2(430.0459f, -62.4196472f, 8.839233f, -333.8167f); + float2x2 b1 = float2x2(100.21051f, 182.560974f, 3.11700439f, -259.430481f); + bool2x2 r1 = bool2x2(false, true, false, true); + TestUtils.AreEqual(r1, a1 < b1); + + float2x2 a2 = float2x2(164.678833f, -350.9449f, 3.84143066f, 125.409729f); + float2x2 b2 = float2x2(-437.3349f, -456.043732f, -394.255981f, 401.9137f); + bool2x2 r2 = bool2x2(false, false, false, true); + TestUtils.AreEqual(r2, a2 < b2); + + float2x2 a3 = float2x2(-111.129944f, 70.00549f, 448.1983f, -419.987122f); + float2x2 b3 = float2x2(313.439148f, 121.286682f, -28.0122986f, -282.965881f); + bool2x2 r3 = bool2x2(true, true, false, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void float2x2_operator_less_wide_scalar() + { + float2x2 a0 = float2x2(-132.057312f, -192.465f, -66.8345947f, -379.017517f); + float b0 = (-156.010223f); + bool2x2 r0 = bool2x2(false, true, false, true); + TestUtils.AreEqual(r0, a0 < b0); + + float2x2 a1 = float2x2(-360.2824f, -158.240753f, 437.3459f, -20.4526062f); + float b1 = (20.9278564f); + bool2x2 r1 = bool2x2(true, true, false, true); + TestUtils.AreEqual(r1, a1 < b1); + + float2x2 a2 = float2x2(225.2915f, 274.015259f, 373.549683f, 398.523682f); + float b2 = (307.4842f); + bool2x2 r2 = bool2x2(true, true, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + float2x2 a3 = float2x2(105.030151f, 109.670105f, -108.85318f, -44.9712524f); + float b3 = (-58.0108948f); + bool2x2 r3 = bool2x2(false, false, true, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void float2x2_operator_less_scalar_wide() + { + float a0 = (-423.1174f); + float2x2 b0 = float2x2(385.094849f, -123.933472f, 86.37659f, 133.4422f); + bool2x2 r0 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r0, a0 < b0); + + float a1 = (161.457947f); + float2x2 b1 = float2x2(229.754272f, 222.5716f, 315.5312f, -447.203522f); + bool2x2 r1 = bool2x2(true, true, true, false); + TestUtils.AreEqual(r1, a1 < b1); + + float a2 = (271.833862f); + float2x2 b2 = float2x2(-393.605316f, 317.486877f, -164.6051f, -282.876038f); + bool2x2 r2 = bool2x2(false, true, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + float a3 = (296.979553f); + float2x2 b3 = float2x2(-254.401154f, 365.6156f, -441.984253f, -131.42865f); + bool2x2 r3 = bool2x2(false, true, false, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void float2x2_operator_greater_wide_wide() + { + float2x2 a0 = float2x2(483.5014f, 310.8156f, 106.966187f, 295.7353f); + float2x2 b0 = float2x2(-471.398f, -371.9853f, 36.9006958f, -316.7636f); + bool2x2 r0 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r0, a0 > b0); + + float2x2 a1 = float2x2(116.957581f, -478.299774f, -14.8974f, -33.8174438f); + float2x2 b1 = float2x2(19.6830444f, 207.309143f, 362.7975f, 324.95343f); + bool2x2 r1 = bool2x2(true, false, false, false); + TestUtils.AreEqual(r1, a1 > b1); + + float2x2 a2 = float2x2(-24.74054f, 319.782654f, -120.158569f, -289.008575f); + float2x2 b2 = float2x2(340.948059f, 25.9860229f, -114.211121f, 240.803467f); + bool2x2 r2 = bool2x2(false, true, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + float2x2 a3 = float2x2(455.85144f, 144.706909f, 63.9320068f, -285.683044f); + float2x2 b3 = float2x2(273.422424f, 325.515747f, 27.3410645f, 64.47955f); + bool2x2 r3 = bool2x2(true, false, true, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void float2x2_operator_greater_wide_scalar() + { + float2x2 a0 = float2x2(64.31793f, -397.703461f, 431.8769f, 85.703f); + float b0 = (305.859924f); + bool2x2 r0 = bool2x2(false, false, true, false); + TestUtils.AreEqual(r0, a0 > b0); + + float2x2 a1 = float2x2(246.263062f, 286.199463f, 280.813354f, -405.7846f); + float b1 = (197.491577f); + bool2x2 r1 = bool2x2(true, true, true, false); + TestUtils.AreEqual(r1, a1 > b1); + + float2x2 a2 = float2x2(171.565369f, 333.5782f, 370.279175f, -413.7014f); + float b2 = (-241.807281f); + bool2x2 r2 = bool2x2(true, true, true, false); + TestUtils.AreEqual(r2, a2 > b2); + + float2x2 a3 = float2x2(-356.592346f, 396.645325f, 467.222046f, -240.013428f); + float b3 = (-353.0313f); + bool2x2 r3 = bool2x2(false, true, true, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void float2x2_operator_greater_scalar_wide() + { + float a0 = (-282.6705f); + float2x2 b0 = float2x2(358.099976f, -72.596405f, -232.163788f, -60.7067261f); + bool2x2 r0 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + float a1 = (75.15662f); + float2x2 b1 = float2x2(150.883484f, 339.539185f, -498.196045f, 459.7461f); + bool2x2 r1 = bool2x2(false, false, true, false); + TestUtils.AreEqual(r1, a1 > b1); + + float a2 = (-227.968719f); + float2x2 b2 = float2x2(335.862122f, 76.17883f, 296.859924f, 177.48999f); + bool2x2 r2 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + float a3 = (-281.2012f); + float2x2 b3 = float2x2(244.722839f, 137.328552f, -385.338257f, 443.163452f); + bool2x2 r3 = bool2x2(false, false, true, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void float2x2_operator_less_equal_wide_wide() + { + float2x2 a0 = float2x2(-438.523132f, 210.489441f, 4.87731934f, -137.297943f); + float2x2 b0 = float2x2(-474.814148f, 304.371033f, 234.824158f, -390.485443f); + bool2x2 r0 = bool2x2(false, true, true, false); + TestUtils.AreEqual(r0, a0 <= b0); + + float2x2 a1 = float2x2(156.094116f, -363.924133f, -97.94849f, 437.2954f); + float2x2 b1 = float2x2(-297.175354f, -326.2924f, 107.253906f, -413.131073f); + bool2x2 r1 = bool2x2(false, true, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + float2x2 a2 = float2x2(458.530273f, -294.064758f, 23.62262f, -34.2840576f); + float2x2 b2 = float2x2(67.09442f, 470.075256f, -84.499115f, 392.784241f); + bool2x2 r2 = bool2x2(false, true, false, true); + TestUtils.AreEqual(r2, a2 <= b2); + + float2x2 a3 = float2x2(149.736511f, -418.8867f, -197.502533f, -88.2055054f); + float2x2 b3 = float2x2(-263.531738f, 369.3009f, -333.3253f, 238.413452f); + bool2x2 r3 = bool2x2(false, true, false, true); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void float2x2_operator_less_equal_wide_scalar() + { + float2x2 a0 = float2x2(193.49585f, 168.915527f, -313.993073f, 81.8269653f); + float b0 = (443.850525f); + bool2x2 r0 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + float2x2 a1 = float2x2(18.5036011f, 241.361145f, -463.8164f, -1.35775757f); + float b1 = (-0.3581848f); + bool2x2 r1 = bool2x2(false, false, true, true); + TestUtils.AreEqual(r1, a1 <= b1); + + float2x2 a2 = float2x2(-268.899475f, -471.253082f, -264.9378f, 82.2583f); + float b2 = (398.991943f); + bool2x2 r2 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r2, a2 <= b2); + + float2x2 a3 = float2x2(11.2460327f, 426.482239f, 56.3200073f, -196.2879f); + float b3 = (424.704041f); + bool2x2 r3 = bool2x2(true, false, true, true); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void float2x2_operator_less_equal_scalar_wide() + { + float a0 = (393.606262f); + float2x2 b0 = float2x2(-75.6883545f, -44.2638855f, 125.864929f, 191.9649f); + bool2x2 r0 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r0, a0 <= b0); + + float a1 = (13.54303f); + float2x2 b1 = float2x2(-197.051941f, -423.9451f, -330.0486f, 420.165527f); + bool2x2 r1 = bool2x2(false, false, false, true); + TestUtils.AreEqual(r1, a1 <= b1); + + float a2 = (105.5473f); + float2x2 b2 = float2x2(174.821289f, 296.7176f, -469.7004f, 123.267212f); + bool2x2 r2 = bool2x2(true, true, false, true); + TestUtils.AreEqual(r2, a2 <= b2); + + float a3 = (112.996948f); + float2x2 b3 = float2x2(495.143372f, -488.6579f, 388.539429f, -493.240784f); + bool2x2 r3 = bool2x2(true, false, true, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void float2x2_operator_greater_equal_wide_wide() + { + float2x2 a0 = float2x2(-507.9286f, 504.4975f, -385.4345f, -262.323425f); + float2x2 b0 = float2x2(-81.3465f, 297.666138f, 171.06543f, -431.038055f); + bool2x2 r0 = bool2x2(false, true, false, true); + TestUtils.AreEqual(r0, a0 >= b0); + + float2x2 a1 = float2x2(-37.5509338f, -111.595276f, -463.702026f, 387.448853f); + float2x2 b1 = float2x2(-6.85907f, 319.7257f, 254.079163f, 396.5724f); + bool2x2 r1 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + float2x2 a2 = float2x2(456.9688f, -211.010162f, 182.411377f, -53.59604f); + float2x2 b2 = float2x2(178.8393f, -447.063354f, 288.492676f, 474.889282f); + bool2x2 r2 = bool2x2(true, true, false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + float2x2 a3 = float2x2(-309.570221f, -136.022491f, 280.736267f, -96.99588f); + float2x2 b3 = float2x2(-321.750244f, -395.977234f, -158.692474f, 391.4887f); + bool2x2 r3 = bool2x2(true, true, true, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void float2x2_operator_greater_equal_wide_scalar() + { + float2x2 a0 = float2x2(465.152161f, -424.886078f, -209.2211f, 58.7798462f); + float b0 = (-5.599884f); + bool2x2 r0 = bool2x2(true, false, false, true); + TestUtils.AreEqual(r0, a0 >= b0); + + float2x2 a1 = float2x2(-302.2691f, 16.3533936f, -344.559967f, 393.278076f); + float b1 = (140.12561f); + bool2x2 r1 = bool2x2(false, false, false, true); + TestUtils.AreEqual(r1, a1 >= b1); + + float2x2 a2 = float2x2(-315.701538f, -509.781555f, -36.9942932f, 494.8203f); + float b2 = (441.011536f); + bool2x2 r2 = bool2x2(false, false, false, true); + TestUtils.AreEqual(r2, a2 >= b2); + + float2x2 a3 = float2x2(-164.973938f, -123.813751f, 215.651245f, 104.995728f); + float b3 = (-466.1201f); + bool2x2 r3 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void float2x2_operator_greater_equal_scalar_wide() + { + float a0 = (374.827026f); + float2x2 b0 = float2x2(-1.60977173f, 338.615234f, -116.1814f, -332.157318f); + bool2x2 r0 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + float a1 = (-355.97937f); + float2x2 b1 = float2x2(-468.901428f, 38.579895f, -332.347534f, 2.89013672f); + bool2x2 r1 = bool2x2(true, false, false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + float a2 = (467.777771f); + float2x2 b2 = float2x2(121.406372f, -305.023376f, -58.4288025f, -226.519562f); + bool2x2 r2 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r2, a2 >= b2); + + float a3 = (-47.0209961f); + float2x2 b3 = float2x2(305.302673f, -427.401245f, 92.26367f, -497.178528f); + bool2x2 r3 = bool2x2(false, true, false, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void float2x2_operator_add_wide_wide() + { + float2x2 a0 = float2x2(506.129028f, -501.779816f, 420.084778f, -186.032074f); + float2x2 b0 = float2x2(-28.7579956f, -337.135132f, -340.676819f, 152.312012f); + float2x2 r0 = float2x2(477.371033f, -838.9149f, 79.40796f, -33.7200623f); + TestUtils.AreEqual(r0, a0 + b0); + + float2x2 a1 = float2x2(-9.312408f, 328.51178f, 424.344055f, 87.79108f); + float2x2 b1 = float2x2(423.66748f, 90.3740845f, 376.18866f, 1.76721191f); + float2x2 r1 = float2x2(414.355072f, 418.885864f, 800.5327f, 89.55829f); + TestUtils.AreEqual(r1, a1 + b1); + + float2x2 a2 = float2x2(462.4137f, -46.17871f, 401.170044f, -454.124146f); + float2x2 b2 = float2x2(-120.185852f, -279.629364f, -344.6671f, 242.839172f); + float2x2 r2 = float2x2(342.227844f, -325.808075f, 56.50293f, -211.284973f); + TestUtils.AreEqual(r2, a2 + b2); + + float2x2 a3 = float2x2(69.19568f, -177.957336f, 299.604126f, 340.704834f); + float2x2 b3 = float2x2(418.593079f, -23.3128052f, -95.0999451f, 147.9281f); + float2x2 r3 = float2x2(487.788757f, -201.270142f, 204.504181f, 488.632935f); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void float2x2_operator_add_wide_scalar() + { + float2x2 a0 = float2x2(-194.514191f, 338.5484f, 246.971375f, 100.510925f); + float b0 = (124.121704f); + float2x2 r0 = float2x2(-70.39249f, 462.6701f, 371.093079f, 224.632629f); + TestUtils.AreEqual(r0, a0 + b0); + + float2x2 a1 = float2x2(-45.72467f, 30.9161377f, 60.37433f, -242.118744f); + float b1 = (-478.1113f); + float2x2 r1 = float2x2(-523.835938f, -447.19516f, -417.736969f, -720.230042f); + TestUtils.AreEqual(r1, a1 + b1); + + float2x2 a2 = float2x2(82.50134f, -484.6998f, -188.265015f, -213.526733f); + float b2 = (6.79937744f); + float2x2 r2 = float2x2(89.30072f, -477.900421f, -181.465637f, -206.727356f); + TestUtils.AreEqual(r2, a2 + b2); + + float2x2 a3 = float2x2(-267.7843f, 198.533569f, 187.536072f, -424.925659f); + float b3 = (189.259949f); + float2x2 r3 = float2x2(-78.52435f, 387.793518f, 376.796021f, -235.66571f); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void float2x2_operator_add_scalar_wide() + { + float a0 = (-340.354675f); + float2x2 b0 = float2x2(511.362244f, -146.216644f, -106.210419f, -363.450256f); + float2x2 r0 = float2x2(171.007568f, -486.57132f, -446.5651f, -703.804932f); + TestUtils.AreEqual(r0, a0 + b0); + + float a1 = (199.0896f); + float2x2 b1 = float2x2(-27.1083984f, 419.849f, 284.955017f, -164.9242f); + float2x2 r1 = float2x2(171.9812f, 618.9386f, 484.044617f, 34.1654053f); + TestUtils.AreEqual(r1, a1 + b1); + + float a2 = (-249.190338f); + float2x2 b2 = float2x2(150.928162f, 298.1751f, -457.1534f, 424.718079f); + float2x2 r2 = float2x2(-98.26218f, 48.98477f, -706.34375f, 175.52774f); + TestUtils.AreEqual(r2, a2 + b2); + + float a3 = (-301.857483f); + float2x2 b3 = float2x2(230.288879f, -423.5876f, -67.06003f, 68.72412f); + float2x2 r3 = float2x2(-71.5686f, -725.445068f, -368.9175f, -233.133362f); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void float2x2_operator_sub_wide_wide() + { + float2x2 a0 = float2x2(160.492249f, 11.223938f, 359.200134f, -498.2283f); + float2x2 b0 = float2x2(115.46875f, -130.9823f, 241.540833f, 9.987061f); + float2x2 r0 = float2x2(45.0235f, 142.206238f, 117.6593f, -508.215363f); + TestUtils.AreEqual(r0, a0 - b0); + + float2x2 a1 = float2x2(-355.253632f, -94.53485f, -410.46405f, -401.384644f); + float2x2 b1 = float2x2(419.895142f, 59.12445f, -402.381653f, -75.37015f); + float2x2 r1 = float2x2(-775.1488f, -153.6593f, -8.082397f, -326.0145f); + TestUtils.AreEqual(r1, a1 - b1); + + float2x2 a2 = float2x2(317.706848f, 447.060425f, -489.074158f, -230.008392f); + float2x2 b2 = float2x2(320.9796f, -73.90875f, -31.4447327f, -389.251953f); + float2x2 r2 = float2x2(-3.272766f, 520.9692f, -457.629425f, 159.243561f); + TestUtils.AreEqual(r2, a2 - b2); + + float2x2 a3 = float2x2(24.8754272f, 366.614441f, -107.374146f, -219.008148f); + float2x2 b3 = float2x2(-375.028839f, 259.182739f, 276.648682f, -453.0692f); + float2x2 r3 = float2x2(399.904266f, 107.4317f, -384.022827f, 234.061066f); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void float2x2_operator_sub_wide_scalar() + { + float2x2 a0 = float2x2(207.389587f, 248.457764f, -384.8239f, -205.344757f); + float b0 = (-36.1124878f); + float2x2 r0 = float2x2(243.502075f, 284.570251f, -348.711426f, -169.232269f); + TestUtils.AreEqual(r0, a0 - b0); + + float2x2 a1 = float2x2(-374.811554f, 18.8562622f, -44.96161f, 480.857971f); + float b1 = (191.642029f); + float2x2 r1 = float2x2(-566.4536f, -172.785767f, -236.603638f, 289.215942f); + TestUtils.AreEqual(r1, a1 - b1); + + float2x2 a2 = float2x2(16.3381958f, -35.5231f, 349.397766f, 439.077271f); + float b2 = (-366.865448f); + float2x2 r2 = float2x2(383.203644f, 331.342346f, 716.2632f, 805.942749f); + TestUtils.AreEqual(r2, a2 - b2); + + float2x2 a3 = float2x2(490.2223f, -384.849426f, 189.05188f, 55.6027832f); + float b3 = (195.024048f); + float2x2 r3 = float2x2(295.198242f, -579.8735f, -5.972168f, -139.421265f); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void float2x2_operator_sub_scalar_wide() + { + float a0 = (-86.00824f); + float2x2 b0 = float2x2(466.4251f, 298.486938f, -300.9501f, 315.38f); + float2x2 r0 = float2x2(-552.43335f, -384.495178f, 214.941864f, -401.388245f); + TestUtils.AreEqual(r0, a0 - b0); + + float a1 = (-381.092163f); + float2x2 b1 = float2x2(-125.008362f, 58.4661865f, 214.7461f, -257.549438f); + float2x2 r1 = float2x2(-256.0838f, -439.55835f, -595.838257f, -123.542725f); + TestUtils.AreEqual(r1, a1 - b1); + + float a2 = (480.2246f); + float2x2 b2 = float2x2(-443.355072f, 260.795044f, 29.6819458f, 139.857727f); + float2x2 r2 = float2x2(923.5797f, 219.429565f, 450.542664f, 340.366882f); + TestUtils.AreEqual(r2, a2 - b2); + + float a3 = (-247.789948f); + float2x2 b3 = float2x2(-248.466217f, 91.44513f, 86.3841553f, 373.8183f); + float2x2 r3 = float2x2(0.676269531f, -339.235077f, -334.1741f, -621.6083f); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void float2x2_operator_mul_wide_wide() + { + float2x2 a0 = float2x2(-482.7138f, -407.2935f, 137.700562f, 208.541138f); + float2x2 b0 = float2x2(-236.367889f, 260.7276f, -416.3863f, -364.4956f); + float2x2 r0 = float2x2(114098.047f, -106192.656f, -57336.625f, -76012.33f); + TestUtils.AreEqual(r0, a0 * b0); + + float2x2 a1 = float2x2(194.29657f, -484.242432f, 183.9873f, -241.33548f); + float2x2 b1 = float2x2(-253.147522f, -369.202881f, 193.547913f, 169.0849f); + float2x2 r1 = float2x2(-49185.6953f, 178783.7f, 35610.36f, -40806.1836f); + TestUtils.AreEqual(r1, a1 * b1); + + float2x2 a2 = float2x2(45.8687744f, 363.3261f, -328.118958f, -471.023071f); + float2x2 b2 = float2x2(201.969666f, 249.456055f, -308.193176f, -385.579651f); + float2x2 r2 = float2x2(9264.101f, 90633.9f, 101124.023f, 181616.9f); + TestUtils.AreEqual(r2, a2 * b2); + + float2x2 a3 = float2x2(-262.682556f, -379.262756f, -374.090576f, 481.4474f); + float2x2 b3 = float2x2(-183.2796f, 22.2756348f, -265.521423f, -95.67746f); + float2x2 r3 = float2x2(48144.3555f, -8448.318f, 99329.06f, -46063.6641f); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void float2x2_operator_mul_wide_scalar() + { + float2x2 a0 = float2x2(-96.31882f, -277.142273f, -239.93689f, 509.531433f); + float b0 = (-301.2072f); + float2x2 r0 = float2x2(29011.9219f, 83477.25f, 72270.72f, -153474.547f); + TestUtils.AreEqual(r0, a0 * b0); + + float2x2 a1 = float2x2(255.8581f, -455.50827f, -389.2433f, -338.29248f); + float b1 = (215.7315f); + float2x2 r1 = float2x2(55196.6523f, -98267.4844f, -83972.04f, -72980.34f); + TestUtils.AreEqual(r1, a1 * b1); + + float2x2 a2 = float2x2(53.7962646f, 135.354675f, -207.3501f, -383.9396f); + float b2 = (243.757324f); + float2x2 r2 = float2x2(13113.2334f, 32993.6953f, -50543.1055f, -93588.09f); + TestUtils.AreEqual(r2, a2 * b2); + + float2x2 a3 = float2x2(-31.4252319f, 260.38385f, 176.867554f, 25.67212f); + float b3 = (42.6761475f); + float2x2 r3 = float2x2(-1341.10779f, 11112.18f, 7548.026f, 1095.58716f); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void float2x2_operator_mul_scalar_wide() + { + float a0 = (37.43219f); + float2x2 b0 = float2x2(96.74756f, 492.185364f, -274.054565f, -452.870972f); + float2x2 r0 = float2x2(3621.473f, 18423.5762f, -10258.4629f, -16951.9531f); + TestUtils.AreEqual(r0, a0 * b0); + + float a1 = (420.853333f); + float2x2 b1 = float2x2(102.182922f, -114.948883f, -351.120056f, -464.664978f); + float2x2 r1 = float2x2(43004.0234f, -48376.62f, -147770.047f, -195555.8f); + TestUtils.AreEqual(r1, a1 * b1); + + float a2 = (444.084839f); + float2x2 b2 = float2x2(447.1053f, 130.829346f, -321.41333f, 445.301331f); + float2x2 r2 = float2x2(198552.672f, 58099.33f, -142734.781f, 197751.563f); + TestUtils.AreEqual(r2, a2 * b2); + + float a3 = (478.2436f); + float2x2 b3 = float2x2(358.571716f, -144.8901f, -438.893829f, -3.536438f); + float2x2 r3 = float2x2(171484.625f, -69292.7656f, -209898.156f, -1691.27881f); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void float2x2_operator_div_wide_wide() + { + float2x2 a0 = float2x2(-353.131439f, -102.799866f, 51.3191528f, -191.871674f); + float2x2 b0 = float2x2(-178.739563f, -302.096283f, -199.405823f, 278.850769f); + float2x2 r0 = float2x2(1.97567582f, 0.34028843f, -0.257360339f, -0.688080132f); + TestUtils.AreEqual(r0, a0 / b0); + + float2x2 a1 = float2x2(8.041809f, -128.73764f, -136.0596f, -370.471f); + float2x2 b1 = float2x2(502.3376f, -361.484833f, 353.121033f, -38.894928f); + float2x2 r1 = float2x2(0.0160087738f, 0.356135666f, -0.385305852f, 9.524919f); + TestUtils.AreEqual(r1, a1 / b1); + + float2x2 a2 = float2x2(-237.69455f, -432.546875f, 200.2655f, 361.4416f); + float2x2 b2 = float2x2(-75.76474f, -195.217834f, -405.034f, -394.23f); + float2x2 r2 = float2x2(3.1372714f, 2.215714f, -0.4944412f, -0.9168292f); + TestUtils.AreEqual(r2, a2 / b2); + + float2x2 a3 = float2x2(-416.226135f, -450.0192f, -273.497437f, -286.908173f); + float2x2 b3 = float2x2(-375.8277f, -121.245483f, 447.623352f, 338.286255f); + float2x2 r3 = float2x2(1.107492f, 3.71163678f, -0.610999048f, -0.8481225f); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void float2x2_operator_div_wide_scalar() + { + float2x2 a0 = float2x2(171.3424f, 0.103393555f, 57.8882446f, -256.130737f); + float b0 = (171.796814f); + float2x2 r0 = float2x2(0.997355f, 0.000601836247f, 0.3369576f, -1.49089336f); + TestUtils.AreEqual(r0, a0 / b0); + + float2x2 a1 = float2x2(95.66968f, -127.4487f, -79.7449f, 146.466858f); + float b1 = (-290.3869f); + float2x2 r1 = float2x2(-0.3294559f, 0.438892722f, 0.274616063f, -0.504385233f); + TestUtils.AreEqual(r1, a1 / b1); + + float2x2 a2 = float2x2(-499.843567f, -453.2058f, -205.033813f, 481.738159f); + float b2 = (58.68634f); + float2x2 r2 = float2x2(-8.517204f, -7.72250938f, -3.493723f, 8.2086935f); + TestUtils.AreEqual(r2, a2 / b2); + + float2x2 a3 = float2x2(464.479065f, -158.505585f, -289.5822f, 494.1286f); + float b3 = (-293.4635f); + float2x2 r3 = float2x2(-1.582749f, 0.540120244f, 0.9867742f, -1.6837821f); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void float2x2_operator_div_scalar_wide() + { + float a0 = (-264.4425f); + float2x2 b0 = float2x2(105.589111f, -142.349091f, -288.9489f, 39.644104f); + float2x2 r0 = float2x2(-2.50444865f, 1.85770416f, 0.9151877f, -6.670412f); + TestUtils.AreEqual(r0, a0 / b0); + + float a1 = (-363.9914f); + float2x2 b1 = float2x2(-149.718231f, -395.729126f, 258.7187f, -9.66626f); + float2x2 r1 = float2x2(2.43117619f, 0.9197993f, -1.40690029f, 37.65587f); + TestUtils.AreEqual(r1, a1 / b1); + + float a2 = (117.725525f); + float2x2 b2 = float2x2(-331.386536f, -509.986023f, 427.896484f, 467.617126f); + float2x2 r2 = float2x2(-0.355251372f, -0.230840683f, 0.2751262f, 0.251756221f); + TestUtils.AreEqual(r2, a2 / b2); + + float a3 = (-407.124634f); + float2x2 b3 = float2x2(252.690735f, 444.599365f, -88.31329f, 199.955017f); + float2x2 r3 = float2x2(-1.61115777f, -0.9157112f, 4.610004f, -2.036081f); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void float2x2_operator_mod_wide_wide() + { + float2x2 a0 = float2x2(-388.8125f, 181.681213f, -167.078735f, 432.820129f); + float2x2 b0 = float2x2(436.944153f, 58.9400635f, -201.116241f, 279.289368f); + float2x2 r0 = float2x2(-388.8125f, 4.861023f, -167.078735f, 153.530762f); + TestUtils.AreEqual(r0, a0 % b0); + + float2x2 a1 = float2x2(-258.438965f, -170.110809f, 283.3183f, 122.716492f); + float2x2 b1 = float2x2(-397.079773f, 377.899963f, 174.693848f, -228.176514f); + float2x2 r1 = float2x2(-258.438965f, -170.110809f, 108.624451f, 122.716492f); + TestUtils.AreEqual(r1, a1 % b1); + + float2x2 a2 = float2x2(335.271f, -503.608521f, 191.022522f, 289.742676f); + float2x2 b2 = float2x2(-317.060181f, -417.4801f, -249.975952f, -397.571564f); + float2x2 r2 = float2x2(18.2108154f, -86.12842f, 191.022522f, 289.742676f); + TestUtils.AreEqual(r2, a2 % b2); + + float2x2 a3 = float2x2(-124.033722f, 259.274f, -274.358459f, -140.030792f); + float2x2 b3 = float2x2(-358.745453f, -198.15921f, 208.737122f, -12.1194153f); + float2x2 r3 = float2x2(-124.033722f, 61.1147766f, -65.62134f, -6.717224f); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void float2x2_operator_mod_wide_scalar() + { + float2x2 a0 = float2x2(-244.499634f, -211.8193f, -145.926788f, -304.9182f); + float b0 = (39.63495f); + float2x2 r0 = float2x2(-6.68994141f, -13.6445618f, -27.0219421f, -27.4735718f); + TestUtils.AreEqual(r0, a0 % b0); + + float2x2 a1 = float2x2(155.479492f, 281.309631f, -226.535767f, 335.166138f); + float b1 = (-133.907776f); + float2x2 r1 = float2x2(21.5717163f, 13.49408f, -92.62799f, 67.3505859f); + TestUtils.AreEqual(r1, a1 % b1); + + float2x2 a2 = float2x2(101.706482f, -285.4023f, -355.846863f, 259.378f); + float b2 = (319.4715f); + float2x2 r2 = float2x2(101.706482f, -285.4023f, -36.3753662f, 259.378f); + TestUtils.AreEqual(r2, a2 % b2); + + float2x2 a3 = float2x2(-330.871948f, -102.683441f, -172.141754f, 206.41687f); + float b3 = (-284.343567f); + float2x2 r3 = float2x2(-46.52838f, -102.683441f, -172.141754f, 206.41687f); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void float2x2_operator_mod_scalar_wide() + { + float a0 = (-66.94504f); + float2x2 b0 = float2x2(-249.7761f, -396.073761f, 386.492065f, 168.939453f); + float2x2 r0 = float2x2(-66.94504f, -66.94504f, -66.94504f, -66.94504f); + TestUtils.AreEqual(r0, a0 % b0); + + float a1 = (-199.418243f); + float2x2 b1 = float2x2(261.7517f, 16.1274414f, 257.668152f, -75.78845f); + float2x2 r1 = float2x2(-199.418243f, -5.88894653f, -199.418243f, -47.84134f); + TestUtils.AreEqual(r1, a1 % b1); + + float a2 = (170.9563f); + float2x2 b2 = float2x2(-242.858276f, 425.9453f, 303.2724f, 3.033081f); + float2x2 r2 = float2x2(170.9563f, 170.9563f, 170.9563f, 1.10375977f); + TestUtils.AreEqual(r2, a2 % b2); + + float a3 = (-505.74353f); + float2x2 b3 = float2x2(461.957031f, 205.972778f, 270.040649f, -47.4807129f); + float2x2 r3 = float2x2(-43.7865f, -93.79797f, -235.702881f, -30.9364014f); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void float2x2_operator_plus() + { + float2x2 a0 = float2x2(-418.829559f, -405.79895f, -34.04178f, 236.999268f); + float2x2 r0 = float2x2(-418.829559f, -405.79895f, -34.04178f, 236.999268f); + TestUtils.AreEqual(r0, +a0); + + float2x2 a1 = float2x2(-459.8391f, 293.742f, -373.015442f, -386.059845f); + float2x2 r1 = float2x2(-459.8391f, 293.742f, -373.015442f, -386.059845f); + TestUtils.AreEqual(r1, +a1); + + float2x2 a2 = float2x2(4.95440674f, 504.474854f, -170.746521f, 439.5594f); + float2x2 r2 = float2x2(4.95440674f, 504.474854f, -170.746521f, 439.5594f); + TestUtils.AreEqual(r2, +a2); + + float2x2 a3 = float2x2(-478.7494f, 421.409668f, -258.596069f, 447.8661f); + float2x2 r3 = float2x2(-478.7494f, 421.409668f, -258.596069f, 447.8661f); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void float2x2_operator_neg() + { + float2x2 a0 = float2x2(148.461731f, -467.122681f, 132.04718f, 183.522644f); + float2x2 r0 = float2x2(-148.461731f, 467.122681f, -132.04718f, -183.522644f); + TestUtils.AreEqual(r0, -a0); + + float2x2 a1 = float2x2(473.701f, -54.95877f, -382.9898f, -299.093384f); + float2x2 r1 = float2x2(-473.701f, 54.95877f, 382.9898f, 299.093384f); + TestUtils.AreEqual(r1, -a1); + + float2x2 a2 = float2x2(-383.014069f, 168.735474f, 466.441528f, 171.902466f); + float2x2 r2 = float2x2(383.014069f, -168.735474f, -466.441528f, -171.902466f); + TestUtils.AreEqual(r2, -a2); + + float2x2 a3 = float2x2(-280.558319f, 318.69635f, -39.9154053f, 140.340027f); + float2x2 r3 = float2x2(280.558319f, -318.69635f, 39.9154053f, -140.340027f); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void float2x2_operator_prefix_inc() + { + float2x2 a0 = float2x2(-139.842072f, -56.7436523f, -381.955322f, 509.796326f); + float2x2 r0 = float2x2(-138.842072f, -55.7436523f, -380.955322f, 510.796326f); + TestUtils.AreEqual(r0, ++a0); + + float2x2 a1 = float2x2(-222.896332f, -392.7315f, -300.1941f, 362.212769f); + float2x2 r1 = float2x2(-221.896332f, -391.7315f, -299.1941f, 363.212769f); + TestUtils.AreEqual(r1, ++a1); + + float2x2 a2 = float2x2(401.6148f, -450.230164f, 243.546936f, 46.1920166f); + float2x2 r2 = float2x2(402.6148f, -449.230164f, 244.546936f, 47.1920166f); + TestUtils.AreEqual(r2, ++a2); + + float2x2 a3 = float2x2(-41.4972839f, 154.356567f, -281.233276f, 200.706f); + float2x2 r3 = float2x2(-40.4972839f, 155.356567f, -280.233276f, 201.706f); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void float2x2_operator_postfix_inc() + { + float2x2 a0 = float2x2(-396.669739f, 511.20752f, 249.111267f, -128.817322f); + float2x2 r0 = float2x2(-396.669739f, 511.20752f, 249.111267f, -128.817322f); + TestUtils.AreEqual(r0, a0++); + + float2x2 a1 = float2x2(-259.4903f, -81.39343f, 66.71973f, 167.852112f); + float2x2 r1 = float2x2(-259.4903f, -81.39343f, 66.71973f, 167.852112f); + TestUtils.AreEqual(r1, a1++); + + float2x2 a2 = float2x2(147.94397f, 41.03357f, 128.5304f, 73.15558f); + float2x2 r2 = float2x2(147.94397f, 41.03357f, 128.5304f, 73.15558f); + TestUtils.AreEqual(r2, a2++); + + float2x2 a3 = float2x2(-60.1323853f, -296.937836f, 267.293823f, 446.2293f); + float2x2 r3 = float2x2(-60.1323853f, -296.937836f, 267.293823f, 446.2293f); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void float2x2_operator_prefix_dec() + { + float2x2 a0 = float2x2(123.128723f, 256.84375f, 156.330811f, 461.737427f); + float2x2 r0 = float2x2(122.128723f, 255.84375f, 155.330811f, 460.737427f); + TestUtils.AreEqual(r0, --a0); + + float2x2 a1 = float2x2(325.867981f, 187.874146f, -236.225189f, 125.109619f); + float2x2 r1 = float2x2(324.867981f, 186.874146f, -237.225189f, 124.109619f); + TestUtils.AreEqual(r1, --a1); + + float2x2 a2 = float2x2(469.844727f, 376.046875f, -363.0755f, -22.0289612f); + float2x2 r2 = float2x2(468.844727f, 375.046875f, -364.0755f, -23.0289612f); + TestUtils.AreEqual(r2, --a2); + + float2x2 a3 = float2x2(248.7901f, 168.265625f, -190.284729f, 166.945557f); + float2x2 r3 = float2x2(247.7901f, 167.265625f, -191.284729f, 165.945557f); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void float2x2_operator_postfix_dec() + { + float2x2 a0 = float2x2(379.6883f, 302.692871f, -176.07135f, -291.2527f); + float2x2 r0 = float2x2(379.6883f, 302.692871f, -176.07135f, -291.2527f); + TestUtils.AreEqual(r0, a0--); + + float2x2 a1 = float2x2(470.567566f, -63.65515f, 355.2611f, -27.8892212f); + float2x2 r1 = float2x2(470.567566f, -63.65515f, 355.2611f, -27.8892212f); + TestUtils.AreEqual(r1, a1--); + + float2x2 a2 = float2x2(-100.761841f, 479.9452f, -200.304291f, -445.026947f); + float2x2 r2 = float2x2(-100.761841f, 479.9452f, -200.304291f, -445.026947f); + TestUtils.AreEqual(r2, a2--); + + float2x2 a3 = float2x2(407.420349f, 48.06018f, -209.667969f, -38.43506f); + float2x2 r3 = float2x2(407.420349f, 48.06018f, -209.667969f, -38.43506f); + TestUtils.AreEqual(r3, a3--); + } + + [TestCase /* For player builds */] + public static void float2x2_EqualsObjectOverride() + { + TestUtils.IsFalse(new float2x2().Equals((object)new int())); + TestUtils.IsTrue(new float2x2().Equals((object)new float2x2())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestFloat2x2.gen.cs.meta b/src/Tests/Tests/Shared/TestFloat2x2.gen.cs.meta new file mode 100644 index 00000000..ca8cdeb8 --- /dev/null +++ b/src/Tests/Tests/Shared/TestFloat2x2.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 052651d6ebd1a8146ad211a6838dad17 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestFloat2x3.gen.cs b/src/Tests/Tests/Shared/TestFloat2x3.gen.cs new file mode 100644 index 00000000..ee756468 --- /dev/null +++ b/src/Tests/Tests/Shared/TestFloat2x3.gen.cs @@ -0,0 +1,950 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestFloat2x3 + { + [TestCompiler] + public static void float2x3_zero() + { + TestUtils.AreEqual(0.0f, float2x3.zero.c0.x); + TestUtils.AreEqual(0.0f, float2x3.zero.c0.y); + TestUtils.AreEqual(0.0f, float2x3.zero.c1.x); + TestUtils.AreEqual(0.0f, float2x3.zero.c1.y); + TestUtils.AreEqual(0.0f, float2x3.zero.c2.x); + TestUtils.AreEqual(0.0f, float2x3.zero.c2.y); + } + + [TestCompiler] + public static void float2x3_operator_equal_wide_wide() + { + float2x3 a0 = float2x3(492.1576f, -495.206329f, 227.457642f, -147.374054f, -222.682f, 64.09375f); + float2x3 b0 = float2x3(192.568787f, -235.611023f, -254.043121f, -412.624725f, 471.9048f, -6.47277832f); + bool2x3 r0 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + float2x3 a1 = float2x3(-23.8904114f, -16.8197327f, 163.232117f, -165.271f, 470.8777f, -423.942566f); + float2x3 b1 = float2x3(-339.102356f, 488.187561f, -379.5966f, -308.417f, -82.333374f, -102.921082f); + bool2x3 r1 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + float2x3 a2 = float2x3(109.6344f, 462.6903f, -335.38147f, 357.2345f, 1.54559326f, -347.388245f); + float2x3 b2 = float2x3(226.515747f, -356.9013f, -362.912781f, -427.898438f, 466.650146f, -102.799042f); + bool2x3 r2 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + float2x3 a3 = float2x3(-114.472168f, 435.848633f, 194.2381f, 138.765564f, -467.349152f, 370.43335f); + float2x3 b3 = float2x3(-43.355957f, 85.0456543f, -91.1270447f, 422.192078f, -477.4313f, 1.87701416f); + bool2x3 r3 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void float2x3_operator_equal_wide_scalar() + { + float2x3 a0 = float2x3(-303.230072f, 451.5263f, -253.655884f, -105.203644f, -500.6911f, -426.192474f); + float b0 = (123.544556f); + bool2x3 r0 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + float2x3 a1 = float2x3(159.8761f, -57.4773865f, -182.049744f, 406.513733f, 370.886f, -172.035309f); + float b1 = (-59.55838f); + bool2x3 r1 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + float2x3 a2 = float2x3(455.400024f, 363.938232f, -27.1505737f, -325.976074f, -290.359039f, 180.196838f); + float b2 = (-11.3389893f); + bool2x3 r2 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + float2x3 a3 = float2x3(-374.128326f, -126.546082f, -197.26178f, -227.159332f, -479.8992f, -439.777679f); + float b3 = (-439.358948f); + bool2x3 r3 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void float2x3_operator_equal_scalar_wide() + { + float a0 = (-253.397278f); + float2x3 b0 = float2x3(19.95221f, -185.791992f, 407.8136f, -87.2767f, -206.274689f, 160.503113f); + bool2x3 r0 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + float a1 = (-274.7708f); + float2x3 b1 = float2x3(-2.63153076f, 448.354553f, -410.035248f, 247.329041f, 355.539124f, -298.0667f); + bool2x3 r1 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + float a2 = (414.1015f); + float2x3 b2 = float2x3(-481.3026f, 196.55072f, 34.6010132f, 113.7616f, -386.453369f, -124.49176f); + bool2x3 r2 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + float a3 = (243.886658f); + float2x3 b3 = float2x3(-492.6182f, 145.424438f, 421.55072f, -95.40997f, 336.809265f, 209.5838f); + bool2x3 r3 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void float2x3_operator_not_equal_wide_wide() + { + float2x3 a0 = float2x3(430.842529f, 104.69f, 225.802429f, -310.5702f, -418.619446f, 304.128174f); + float2x3 b0 = float2x3(210.024719f, -55.20334f, -269.925354f, -234.546722f, 25.91742f, -63.72699f); + bool2x3 r0 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + float2x3 a1 = float2x3(-509.3268f, -160.538086f, -203.301971f, -505.763245f, 162.17218f, 1.156189f); + float2x3 b1 = float2x3(-484.5537f, -425.3336f, -53.2743835f, 328.1944f, 15.9631348f, 461.7141f); + bool2x3 r1 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + float2x3 a2 = float2x3(65.66205f, 102.787781f, 172.930054f, 26.6210327f, 235.125977f, 128.541992f); + float2x3 b2 = float2x3(-113.363037f, -240.072968f, 495.119141f, 203.55835f, 340.493469f, -241.9072f); + bool2x3 r2 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + float2x3 a3 = float2x3(-354.996979f, 334.3595f, -495.832f, 468.307373f, 458.370972f, 299.937317f); + float2x3 b3 = float2x3(459.569824f, 213.07373f, -384.782837f, -255.072327f, 477.663452f, -248.036621f); + bool2x3 r3 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void float2x3_operator_not_equal_wide_scalar() + { + float2x3 a0 = float2x3(-16.9145813f, 168.8341f, -462.713531f, 130.307739f, 214.501587f, -440.263275f); + float b0 = (-145.372772f); + bool2x3 r0 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + float2x3 a1 = float2x3(-197.12796f, -386.611176f, -281.021f, -270.26886f, -403.9637f, -269.805725f); + float b1 = (-169.099854f); + bool2x3 r1 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + float2x3 a2 = float2x3(299.654236f, -432.755737f, -457.363129f, -13.5195923f, 273.873047f, 185.04248f); + float b2 = (-71.7509155f); + bool2x3 r2 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + float2x3 a3 = float2x3(-482.5307f, 511.735f, 230.5075f, 100.27478f, 129.682434f, 321.178772f); + float b3 = (116.395142f); + bool2x3 r3 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void float2x3_operator_not_equal_scalar_wide() + { + float a0 = (275.795837f); + float2x3 b0 = float2x3(-57.1969f, -382.432526f, 97.82037f, -161.463654f, -458.39563f, -499.617859f); + bool2x3 r0 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + float a1 = (327.92218f); + float2x3 b1 = float2x3(367.571228f, 59.786377f, -209.580688f, -62.5804443f, -479.974976f, -49.4945068f); + bool2x3 r1 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + float a2 = (-114.685211f); + float2x3 b2 = float2x3(109.93927f, -176.284821f, -347.4853f, 85.5409546f, -356.659546f, -104.243561f); + bool2x3 r2 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + float a3 = (-133.5492f); + float2x3 b3 = float2x3(243.539734f, 13.1412964f, -379.985962f, -41.28122f, 87.91168f, -339.077271f); + bool2x3 r3 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void float2x3_operator_less_wide_wide() + { + float2x3 a0 = float2x3(196.84259f, 336.4098f, 251.963745f, 257.655945f, 430.0459f, -62.4196472f); + float2x3 b0 = float2x3(-465.345032f, -256.1524f, -314.814026f, 364.5667f, 100.21051f, 182.560974f); + bool2x3 r0 = bool2x3(false, false, false, true, false, true); + TestUtils.AreEqual(r0, a0 < b0); + + float2x3 a1 = float2x3(8.839233f, -333.8167f, 164.678833f, -350.9449f, 3.84143066f, 125.409729f); + float2x3 b1 = float2x3(3.11700439f, -259.430481f, -437.3349f, -456.043732f, -394.255981f, 401.9137f); + bool2x3 r1 = bool2x3(false, true, false, false, false, true); + TestUtils.AreEqual(r1, a1 < b1); + + float2x3 a2 = float2x3(-111.129944f, 70.00549f, 448.1983f, -419.987122f, -258.301666f, -34.8322144f); + float2x3 b2 = float2x3(313.439148f, 121.286682f, -28.0122986f, -282.965881f, 330.0644f, 124.099365f); + bool2x3 r2 = bool2x3(true, true, false, true, true, true); + TestUtils.AreEqual(r2, a2 < b2); + + float2x3 a3 = float2x3(-69.8594055f, 67.76721f, -139.777283f, 385.434631f, 133.7074f, 506.188354f); + float2x3 b3 = float2x3(-183.6903f, 373.0608f, 109.750916f, -203.57135f, 45.64868f, -360.952271f); + bool2x3 r3 = bool2x3(false, true, true, false, false, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void float2x3_operator_less_wide_scalar() + { + float2x3 a0 = float2x3(-132.057312f, -192.465f, -66.8345947f, -379.017517f, -360.2824f, 20.9278564f); + float b0 = (-156.010223f); + bool2x3 r0 = bool2x3(false, true, false, true, true, false); + TestUtils.AreEqual(r0, a0 < b0); + + float2x3 a1 = float2x3(-158.240753f, -20.4526062f, 225.2915f, 307.4842f, 274.015259f, 373.549683f); + float b1 = (437.3459f); + bool2x3 r1 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 < b1); + + float2x3 a2 = float2x3(398.523682f, -58.0108948f, 109.670105f, -108.85318f, -44.9712524f, 140.426086f); + float b2 = (105.030151f); + bool2x3 r2 = bool2x3(false, true, false, true, true, false); + TestUtils.AreEqual(r2, a2 < b2); + + float2x3 a3 = float2x3(-500.0883f, -197.500732f, -7.271515f, -432.9905f, 62.1583252f, -72.25473f); + float b3 = (172.103333f); + bool2x3 r3 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void float2x3_operator_less_scalar_wide() + { + float a0 = (-423.1174f); + float2x3 b0 = float2x3(385.094849f, -123.933472f, 86.37659f, 133.4422f, 161.457947f, 229.754272f); + bool2x3 r0 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 < b0); + + float a1 = (222.5716f); + float2x3 b1 = float2x3(315.5312f, -447.203522f, 271.833862f, -393.605316f, 317.486877f, -164.6051f); + bool2x3 r1 = bool2x3(true, false, true, false, true, false); + TestUtils.AreEqual(r1, a1 < b1); + + float a2 = (-282.876038f); + float2x3 b2 = float2x3(296.979553f, -254.401154f, 365.6156f, -441.984253f, -131.42865f, 442.628967f); + bool2x3 r2 = bool2x3(true, true, true, false, true, true); + TestUtils.AreEqual(r2, a2 < b2); + + float a3 = (-29.7928467f); + float2x3 b3 = float2x3(-138.37381f, 9.21698f, -226.73056f, 171.029419f, 376.625244f, -462.5887f); + bool2x3 r3 = bool2x3(false, true, false, true, true, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void float2x3_operator_greater_wide_wide() + { + float2x3 a0 = float2x3(483.5014f, 310.8156f, 106.966187f, 295.7353f, 116.957581f, -478.299774f); + float2x3 b0 = float2x3(-471.398f, -371.9853f, 36.9006958f, -316.7636f, 19.6830444f, 207.309143f); + bool2x3 r0 = bool2x3(true, true, true, true, true, false); + TestUtils.AreEqual(r0, a0 > b0); + + float2x3 a1 = float2x3(-14.8974f, -33.8174438f, -24.74054f, 319.782654f, -120.158569f, -289.008575f); + float2x3 b1 = float2x3(362.7975f, 324.95343f, 340.948059f, 25.9860229f, -114.211121f, 240.803467f); + bool2x3 r1 = bool2x3(false, false, false, true, false, false); + TestUtils.AreEqual(r1, a1 > b1); + + float2x3 a2 = float2x3(455.85144f, 144.706909f, 63.9320068f, -285.683044f, -502.090729f, -337.194458f); + float2x3 b2 = float2x3(273.422424f, 325.515747f, 27.3410645f, 64.47955f, 200.948364f, 100.122681f); + bool2x3 r2 = bool2x3(true, false, true, false, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + float2x3 a3 = float2x3(474.317322f, -507.1451f, -133.565582f, -443.109131f, -464.34137f, -68.36154f); + float2x3 b3 = float2x3(-79.00711f, -315.137939f, -122.985443f, -163.7792f, -492.566f, -90.79727f); + bool2x3 r3 = bool2x3(true, false, false, false, true, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void float2x3_operator_greater_wide_scalar() + { + float2x3 a0 = float2x3(64.31793f, -397.703461f, 431.8769f, 85.703f, 246.263062f, 197.491577f); + float b0 = (305.859924f); + bool2x3 r0 = bool2x3(false, false, true, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + float2x3 a1 = float2x3(286.199463f, -405.7846f, 171.565369f, -241.807281f, 333.5782f, 370.279175f); + float b1 = (280.813354f); + bool2x3 r1 = bool2x3(true, false, false, false, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + float2x3 a2 = float2x3(-413.7014f, -353.0313f, 396.645325f, 467.222046f, -240.013428f, 502.915039f); + float b2 = (-356.592346f); + bool2x3 r2 = bool2x3(false, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 > b2); + + float2x3 a3 = float2x3(315.4676f, 281.230652f, 428.792175f, 245.153076f, -279.1754f, -453.8631f); + float b3 = (-259.2897f); + bool2x3 r3 = bool2x3(true, true, true, true, false, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void float2x3_operator_greater_scalar_wide() + { + float a0 = (-282.6705f); + float2x3 b0 = float2x3(358.099976f, -72.596405f, -232.163788f, -60.7067261f, 75.15662f, 150.883484f); + bool2x3 r0 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + float a1 = (339.539185f); + float2x3 b1 = float2x3(-498.196045f, 459.7461f, -227.968719f, 335.862122f, 76.17883f, 296.859924f); + bool2x3 r1 = bool2x3(true, false, true, true, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + float a2 = (177.48999f); + float2x3 b2 = float2x3(-281.2012f, 244.722839f, 137.328552f, -385.338257f, 443.163452f, -353.562561f); + bool2x3 r2 = bool2x3(true, false, true, true, false, true); + TestUtils.AreEqual(r2, a2 > b2); + + float a3 = (26.04065f); + float2x3 b3 = float2x3(-331.793945f, -43.6919556f, 20.9494019f, -211.17984f, 227.421692f, -84.7797852f); + bool2x3 r3 = bool2x3(true, true, true, true, false, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void float2x3_operator_less_equal_wide_wide() + { + float2x3 a0 = float2x3(-438.523132f, 210.489441f, 4.87731934f, -137.297943f, 156.094116f, -363.924133f); + float2x3 b0 = float2x3(-474.814148f, 304.371033f, 234.824158f, -390.485443f, -297.175354f, -326.2924f); + bool2x3 r0 = bool2x3(false, true, true, false, false, true); + TestUtils.AreEqual(r0, a0 <= b0); + + float2x3 a1 = float2x3(-97.94849f, 437.2954f, 458.530273f, -294.064758f, 23.62262f, -34.2840576f); + float2x3 b1 = float2x3(107.253906f, -413.131073f, 67.09442f, 470.075256f, -84.499115f, 392.784241f); + bool2x3 r1 = bool2x3(true, false, false, true, false, true); + TestUtils.AreEqual(r1, a1 <= b1); + + float2x3 a2 = float2x3(149.736511f, -418.8867f, -197.502533f, -88.2055054f, -376.71814f, 341.627136f); + float2x3 b2 = float2x3(-263.531738f, 369.3009f, -333.3253f, 238.413452f, 486.2426f, 279.6502f); + bool2x3 r2 = bool2x3(false, true, false, true, true, false); + TestUtils.AreEqual(r2, a2 <= b2); + + float2x3 a3 = float2x3(-83.30917f, -107.490723f, 319.466858f, 205.357361f, 345.563721f, 395.3219f); + float2x3 b3 = float2x3(236.052f, 132.758972f, 66.29474f, 183.002136f, 200.130554f, 339.043823f); + bool2x3 r3 = bool2x3(true, true, false, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void float2x3_operator_less_equal_wide_scalar() + { + float2x3 a0 = float2x3(193.49585f, 168.915527f, -313.993073f, 81.8269653f, 18.5036011f, -0.3581848f); + float b0 = (443.850525f); + bool2x3 r0 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + float2x3 a1 = float2x3(241.361145f, -1.35775757f, -268.899475f, 398.991943f, -471.253082f, -264.9378f); + float b1 = (-463.8164f); + bool2x3 r1 = bool2x3(false, false, false, false, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + float2x3 a2 = float2x3(82.2583f, 424.704041f, 426.482239f, 56.3200073f, -196.2879f, 31.9011841f); + float b2 = (11.2460327f); + bool2x3 r2 = bool2x3(false, false, false, false, true, false); + TestUtils.AreEqual(r2, a2 <= b2); + + float2x3 a3 = float2x3(-152.257568f, -37.1048279f, -47.1442261f, 333.623047f, -274.8039f, 358.67627f); + float b3 = (-437.926453f); + bool2x3 r3 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void float2x3_operator_less_equal_scalar_wide() + { + float a0 = (393.606262f); + float2x3 b0 = float2x3(-75.6883545f, -44.2638855f, 125.864929f, 191.9649f, 13.54303f, -197.051941f); + bool2x3 r0 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 <= b0); + + float a1 = (-423.9451f); + float2x3 b1 = float2x3(-330.0486f, 420.165527f, 105.5473f, 174.821289f, 296.7176f, -469.7004f); + bool2x3 r1 = bool2x3(true, true, true, true, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + float a2 = (123.267212f); + float2x3 b2 = float2x3(112.996948f, 495.143372f, -488.6579f, 388.539429f, -493.240784f, 16.45105f); + bool2x3 r2 = bool2x3(false, true, false, true, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + float a3 = (-387.651642f); + float2x3 b3 = float2x3(-229.1773f, -373.01532f, -391.142151f, 90.99414f, -178.396149f, -69.62106f); + bool2x3 r3 = bool2x3(true, true, false, true, true, true); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void float2x3_operator_greater_equal_wide_wide() + { + float2x3 a0 = float2x3(-507.9286f, 504.4975f, -385.4345f, -262.323425f, -37.5509338f, -111.595276f); + float2x3 b0 = float2x3(-81.3465f, 297.666138f, 171.06543f, -431.038055f, -6.85907f, 319.7257f); + bool2x3 r0 = bool2x3(false, true, false, true, false, false); + TestUtils.AreEqual(r0, a0 >= b0); + + float2x3 a1 = float2x3(-463.702026f, 387.448853f, 456.9688f, -211.010162f, 182.411377f, -53.59604f); + float2x3 b1 = float2x3(254.079163f, 396.5724f, 178.8393f, -447.063354f, 288.492676f, 474.889282f); + bool2x3 r1 = bool2x3(false, false, true, true, false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + float2x3 a2 = float2x3(-309.570221f, -136.022491f, 280.736267f, -96.99588f, -174.059509f, 88.90192f); + float2x3 b2 = float2x3(-321.750244f, -395.977234f, -158.692474f, 391.4887f, -368.109253f, 89.12378f); + bool2x3 r2 = bool2x3(true, true, true, false, true, false); + TestUtils.AreEqual(r2, a2 >= b2); + + float2x3 a3 = float2x3(43.81604f, -446.07843f, 16.6455688f, 409.83252f, -191.329865f, 222.9978f); + float2x3 b3 = float2x3(-510.279327f, -486.9298f, -81.2155457f, 274.2188f, -212.881561f, 288.9953f); + bool2x3 r3 = bool2x3(true, true, true, true, true, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void float2x3_operator_greater_equal_wide_scalar() + { + float2x3 a0 = float2x3(465.152161f, -424.886078f, -209.2211f, 58.7798462f, -302.2691f, 140.12561f); + float b0 = (-5.599884f); + bool2x3 r0 = bool2x3(true, false, false, true, false, true); + TestUtils.AreEqual(r0, a0 >= b0); + + float2x3 a1 = float2x3(16.3533936f, 393.278076f, -315.701538f, 441.011536f, -509.781555f, -36.9942932f); + float b1 = (-344.559967f); + bool2x3 r1 = bool2x3(true, true, true, true, false, true); + TestUtils.AreEqual(r1, a1 >= b1); + + float2x3 a2 = float2x3(494.8203f, -466.1201f, -123.813751f, 215.651245f, 104.995728f, 314.346f); + float b2 = (-164.973938f); + bool2x3 r2 = bool2x3(true, false, true, true, true, true); + TestUtils.AreEqual(r2, a2 >= b2); + + float2x3 a3 = float2x3(190.516113f, -23.8364258f, 143.049377f, -264.919983f, -169.702209f, 329.70752f); + float b3 = (-83.11142f); + bool2x3 r3 = bool2x3(true, true, true, false, false, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void float2x3_operator_greater_equal_scalar_wide() + { + float a0 = (374.827026f); + float2x3 b0 = float2x3(-1.60977173f, 338.615234f, -116.1814f, -332.157318f, -355.97937f, -468.901428f); + bool2x3 r0 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + float a1 = (38.579895f); + float2x3 b1 = float2x3(-332.347534f, 2.89013672f, 467.777771f, 121.406372f, -305.023376f, -58.4288025f); + bool2x3 r1 = bool2x3(true, true, false, false, true, true); + TestUtils.AreEqual(r1, a1 >= b1); + + float a2 = (-226.519562f); + float2x3 b2 = float2x3(-47.0209961f, 305.302673f, -427.401245f, 92.26367f, -497.178528f, -408.625641f); + bool2x3 r2 = bool2x3(false, false, true, false, true, true); + TestUtils.AreEqual(r2, a2 >= b2); + + float a3 = (-455.2305f); + float2x3 b3 = float2x3(396.4261f, -469.2949f, -485.754028f, -182.346191f, -291.545349f, 278.740784f); + bool2x3 r3 = bool2x3(false, true, true, false, false, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void float2x3_operator_add_wide_wide() + { + float2x3 a0 = float2x3(506.129028f, -501.779816f, 420.084778f, -186.032074f, -9.312408f, 328.51178f); + float2x3 b0 = float2x3(-28.7579956f, -337.135132f, -340.676819f, 152.312012f, 423.66748f, 90.3740845f); + float2x3 r0 = float2x3(477.371033f, -838.9149f, 79.40796f, -33.7200623f, 414.355072f, 418.885864f); + TestUtils.AreEqual(r0, a0 + b0); + + float2x3 a1 = float2x3(424.344055f, 87.79108f, 462.4137f, -46.17871f, 401.170044f, -454.124146f); + float2x3 b1 = float2x3(376.18866f, 1.76721191f, -120.185852f, -279.629364f, -344.6671f, 242.839172f); + float2x3 r1 = float2x3(800.5327f, 89.55829f, 342.227844f, -325.808075f, 56.50293f, -211.284973f); + TestUtils.AreEqual(r1, a1 + b1); + + float2x3 a2 = float2x3(69.19568f, -177.957336f, 299.604126f, 340.704834f, 219.916016f, -321.9084f); + float2x3 b2 = float2x3(418.593079f, -23.3128052f, -95.0999451f, 147.9281f, 331.0329f, -82.50256f); + float2x3 r2 = float2x3(487.788757f, -201.270142f, 204.504181f, 488.632935f, 550.9489f, -404.41095f); + TestUtils.AreEqual(r2, a2 + b2); + + float2x3 a3 = float2x3(286.355347f, -333.4195f, -118.932159f, 68.60748f, 23.190918f, -205.577881f); + float2x3 b3 = float2x3(279.4496f, 342.622742f, -300.358521f, -209.694092f, 446.559448f, -351.9892f); + float2x3 r3 = float2x3(565.804932f, 9.203247f, -419.29068f, -141.086609f, 469.750366f, -557.5671f); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void float2x3_operator_add_wide_scalar() + { + float2x3 a0 = float2x3(-194.514191f, 338.5484f, 246.971375f, 100.510925f, -45.72467f, -478.1113f); + float b0 = (124.121704f); + float2x3 r0 = float2x3(-70.39249f, 462.6701f, 371.093079f, 224.632629f, 78.39703f, -353.9896f); + TestUtils.AreEqual(r0, a0 + b0); + + float2x3 a1 = float2x3(30.9161377f, -242.118744f, 82.50134f, 6.79937744f, -484.6998f, -188.265015f); + float b1 = (60.37433f); + float2x3 r1 = float2x3(91.29047f, -181.744415f, 142.875671f, 67.1737061f, -424.32547f, -127.890686f); + TestUtils.AreEqual(r1, a1 + b1); + + float2x3 a2 = float2x3(-213.526733f, 189.259949f, 198.533569f, 187.536072f, -424.925659f, 302.102356f); + float b2 = (-267.7843f); + float2x3 r2 = float2x3(-481.311035f, -78.52435f, -69.25073f, -80.24823f, -692.709961f, 34.3180542f); + TestUtils.AreEqual(r2, a2 + b2); + + float2x3 a3 = float2x3(300.3991f, -200.161346f, 31.3782349f, 362.522156f, -423.988861f, 432.41333f); + float b3 = (124.021606f); + float2x3 r3 = float2x3(424.420715f, -76.13974f, 155.399841f, 486.543762f, -299.967255f, 556.434937f); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void float2x3_operator_add_scalar_wide() + { + float a0 = (-340.354675f); + float2x3 b0 = float2x3(511.362244f, -146.216644f, -106.210419f, -363.450256f, 199.0896f, -27.1083984f); + float2x3 r0 = float2x3(171.007568f, -486.57132f, -446.5651f, -703.804932f, -141.265076f, -367.463074f); + TestUtils.AreEqual(r0, a0 + b0); + + float a1 = (419.849f); + float2x3 b1 = float2x3(284.955017f, -164.9242f, -249.190338f, 150.928162f, 298.1751f, -457.1534f); + float2x3 r1 = float2x3(704.804f, 254.9248f, 170.658661f, 570.777161f, 718.0241f, -37.3044128f); + TestUtils.AreEqual(r1, a1 + b1); + + float a2 = (424.718079f); + float2x3 b2 = float2x3(-301.857483f, 230.288879f, -423.5876f, -67.06003f, 68.72412f, -164.02243f); + float2x3 r2 = float2x3(122.860596f, 655.006958f, 1.13049316f, 357.658051f, 493.4422f, 260.695648f); + TestUtils.AreEqual(r2, a2 + b2); + + float a3 = (318.935181f); + float2x3 b3 = float2x3(7.80456543f, 187.698364f, -3.656952f, -446.083069f, -209.287231f, -38.21289f); + float2x3 r3 = float2x3(326.739746f, 506.633545f, 315.278229f, -127.147888f, 109.647949f, 280.7223f); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void float2x3_operator_sub_wide_wide() + { + float2x3 a0 = float2x3(160.492249f, 11.223938f, 359.200134f, -498.2283f, -355.253632f, -94.53485f); + float2x3 b0 = float2x3(115.46875f, -130.9823f, 241.540833f, 9.987061f, 419.895142f, 59.12445f); + float2x3 r0 = float2x3(45.0235f, 142.206238f, 117.6593f, -508.215363f, -775.1488f, -153.6593f); + TestUtils.AreEqual(r0, a0 - b0); + + float2x3 a1 = float2x3(-410.46405f, -401.384644f, 317.706848f, 447.060425f, -489.074158f, -230.008392f); + float2x3 b1 = float2x3(-402.381653f, -75.37015f, 320.9796f, -73.90875f, -31.4447327f, -389.251953f); + float2x3 r1 = float2x3(-8.082397f, -326.0145f, -3.272766f, 520.9692f, -457.629425f, 159.243561f); + TestUtils.AreEqual(r1, a1 - b1); + + float2x3 a2 = float2x3(24.8754272f, 366.614441f, -107.374146f, -219.008148f, 473.9076f, 259.63623f); + float2x3 b2 = float2x3(-375.028839f, 259.182739f, 276.648682f, -453.0692f, -272.576538f, -191.148041f); + float2x3 r2 = float2x3(399.904266f, 107.4317f, -384.022827f, 234.061066f, 746.484131f, 450.784271f); + TestUtils.AreEqual(r2, a2 - b2); + + float2x3 a3 = float2x3(-360.119629f, 7.80963135f, 437.428467f, -59.1991577f, 418.744324f, 183.142151f); + float2x3 b3 = float2x3(87.1369f, 430.02478f, 343.6571f, 121.029419f, -354.188171f, 249.052f); + float2x3 r3 = float2x3(-447.256531f, -422.215149f, 93.77136f, -180.228577f, 772.9325f, -65.90985f); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void float2x3_operator_sub_wide_scalar() + { + float2x3 a0 = float2x3(207.389587f, 248.457764f, -384.8239f, -205.344757f, -374.811554f, 191.642029f); + float b0 = (-36.1124878f); + float2x3 r0 = float2x3(243.502075f, 284.570251f, -348.711426f, -169.232269f, -338.699066f, 227.754517f); + TestUtils.AreEqual(r0, a0 - b0); + + float2x3 a1 = float2x3(18.8562622f, 480.857971f, 16.3381958f, -366.865448f, -35.5231f, 349.397766f); + float b1 = (-44.96161f); + float2x3 r1 = float2x3(63.81787f, 525.8196f, 61.2998047f, -321.903839f, 9.438507f, 394.359375f); + TestUtils.AreEqual(r1, a1 - b1); + + float2x3 a2 = float2x3(439.077271f, 195.024048f, -384.849426f, 189.05188f, 55.6027832f, -54.931488f); + float b2 = (490.2223f); + float2x3 r2 = float2x3(-51.14502f, -295.198242f, -875.0717f, -301.1704f, -434.6195f, -545.1538f); + TestUtils.AreEqual(r2, a2 - b2); + + float2x3 a3 = float2x3(53.0880737f, -273.8067f, 256.8872f, 297.173645f, 101.829041f, 136.607971f); + float b3 = (316.8025f); + float2x3 r3 = float2x3(-263.714417f, -590.6092f, -59.9152832f, -19.6288452f, -214.97345f, -180.194519f); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void float2x3_operator_sub_scalar_wide() + { + float a0 = (-86.00824f); + float2x3 b0 = float2x3(466.4251f, 298.486938f, -300.9501f, 315.38f, -381.092163f, -125.008362f); + float2x3 r0 = float2x3(-552.43335f, -384.495178f, 214.941864f, -401.388245f, 295.083923f, 39.0001221f); + TestUtils.AreEqual(r0, a0 - b0); + + float a1 = (58.4661865f); + float2x3 b1 = float2x3(214.7461f, -257.549438f, 480.2246f, -443.355072f, 260.795044f, 29.6819458f); + float2x3 r1 = float2x3(-156.2799f, 316.015625f, -421.758423f, 501.821259f, -202.328857f, 28.78424f); + TestUtils.AreEqual(r1, a1 - b1); + + float a2 = (139.857727f); + float2x3 b2 = float2x3(-247.789948f, -248.466217f, 91.44513f, 86.3841553f, 373.8183f, 260.411926f); + float2x3 r2 = float2x3(387.647675f, 388.323944f, 48.4125977f, 53.47357f, -233.960571f, -120.5542f); + TestUtils.AreEqual(r2, a2 - b2); + + float a3 = (114.353943f); + float2x3 b3 = float2x3(-464.405457f, -109.741455f, -311.675354f, 107.864014f, -258.795166f, 14.0975342f); + float2x3 r3 = float2x3(578.7594f, 224.0954f, 426.0293f, 6.489929f, 373.1491f, 100.256409f); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void float2x3_operator_mul_wide_wide() + { + float2x3 a0 = float2x3(-482.7138f, -407.2935f, 137.700562f, 208.541138f, 194.29657f, -484.242432f); + float2x3 b0 = float2x3(-236.367889f, 260.7276f, -416.3863f, -364.4956f, -253.147522f, -369.202881f); + float2x3 r0 = float2x3(114098.047f, -106192.656f, -57336.625f, -76012.33f, -49185.6953f, 178783.7f); + TestUtils.AreEqual(r0, a0 * b0); + + float2x3 a1 = float2x3(183.9873f, -241.33548f, 45.8687744f, 363.3261f, -328.118958f, -471.023071f); + float2x3 b1 = float2x3(193.547913f, 169.0849f, 201.969666f, 249.456055f, -308.193176f, -385.579651f); + float2x3 r1 = float2x3(35610.36f, -40806.1836f, 9264.101f, 90633.9f, 101124.023f, 181616.9f); + TestUtils.AreEqual(r1, a1 * b1); + + float2x3 a2 = float2x3(-262.682556f, -379.262756f, -374.090576f, 481.4474f, 104.628052f, 412.935425f); + float2x3 b2 = float2x3(-183.2796f, 22.2756348f, -265.521423f, -95.67746f, 133.2544f, 148.311462f); + float2x3 r2 = float2x3(48144.3555f, -8448.318f, 99329.06f, -46063.6641f, 13942.1475f, 61243.06f); + TestUtils.AreEqual(r2, a2 * b2); + + float2x3 a3 = float2x3(477.877258f, 20.3778076f, 291.995972f, -138.488312f, -393.464966f, 9.363098f); + float2x3 b3 = float2x3(249.284119f, 500.0055f, -19.3315735f, -36.69107f, 30.5238037f, -401.367f); + float2x3 r3 = float2x3(119127.211f, 10189.0156f, -5644.7417f, 5081.284f, -12010.0479f, -3758.03857f); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void float2x3_operator_mul_wide_scalar() + { + float2x3 a0 = float2x3(-96.31882f, -277.142273f, -239.93689f, 509.531433f, 255.8581f, 215.7315f); + float b0 = (-301.2072f); + float2x3 r0 = float2x3(29011.9219f, 83477.25f, 72270.72f, -153474.547f, -77066.3047f, -64979.8867f); + TestUtils.AreEqual(r0, a0 * b0); + + float2x3 a1 = float2x3(-455.50827f, -338.29248f, 53.7962646f, 243.757324f, 135.354675f, -207.3501f); + float b1 = (-389.2433f); + float2x3 r1 = float2x3(177303.531f, 131678.078f, -20939.834f, -94880.9f, -52685.9f, 80709.63f); + TestUtils.AreEqual(r1, a1 * b1); + + float2x3 a2 = float2x3(-383.9396f, 42.6761475f, 260.38385f, 176.867554f, 25.67212f, -290.5006f); + float b2 = (-31.4252319f); + float2x3 r2 = float2x3(12065.3916f, -1341.10779f, -8182.623f, -5558.104f, -806.7523f, 9129.049f); + TestUtils.AreEqual(r2, a2 * b2); + + float2x3 a3 = float2x3(207.091f, -208.402008f, 370.945068f, -341.59845f, 10.2703247f, -176.888763f); + float b3 = (-156.523315f); + float2x3 r3 = float2x3(-32414.57f, 32619.7734f, -58061.55f, 53468.12f, -1607.54529f, 27687.2148f); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void float2x3_operator_mul_scalar_wide() + { + float a0 = (37.43219f); + float2x3 b0 = float2x3(96.74756f, 492.185364f, -274.054565f, -452.870972f, 420.853333f, 102.182922f); + float2x3 r0 = float2x3(3621.473f, 18423.5762f, -10258.4629f, -16951.9531f, 15753.4619f, 3824.93066f); + TestUtils.AreEqual(r0, a0 * b0); + + float a1 = (-114.948883f); + float2x3 b1 = float2x3(-351.120056f, -464.664978f, 444.084839f, 447.1053f, 130.829346f, -321.41333f); + float2x3 r1 = float2x3(40360.86f, 53412.72f, -51047.0547f, -51394.2539f, -15038.6875f, 36946.1f); + TestUtils.AreEqual(r1, a1 * b1); + + float a2 = (445.301331f); + float2x3 b2 = float2x3(478.2436f, 358.571716f, -144.8901f, -438.893829f, -3.536438f, -471.807556f); + float2x3 r2 = float2x3(212962.5f, 159672.469f, -64519.7578f, -195440f, -1574.78052f, -210096.531f); + TestUtils.AreEqual(r2, a2 * b2); + + float a3 = (-42.5603943f); + float2x3 b3 = float2x3(119.911072f, 271.900024f, 239.684021f, 487.4414f, -79.18829f, -112.925659f); + float2x3 r3 = float2x3(-5103.4624f, -11572.1719f, -10201.0469f, -20745.7f, 3370.285f, 4806.16064f); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void float2x3_operator_div_wide_wide() + { + float2x3 a0 = float2x3(-353.131439f, -102.799866f, 51.3191528f, -191.871674f, 8.041809f, -128.73764f); + float2x3 b0 = float2x3(-178.739563f, -302.096283f, -199.405823f, 278.850769f, 502.3376f, -361.484833f); + float2x3 r0 = float2x3(1.97567582f, 0.34028843f, -0.257360339f, -0.688080132f, 0.0160087738f, 0.356135666f); + TestUtils.AreEqual(r0, a0 / b0); + + float2x3 a1 = float2x3(-136.0596f, -370.471f, -237.69455f, -432.546875f, 200.2655f, 361.4416f); + float2x3 b1 = float2x3(353.121033f, -38.894928f, -75.76474f, -195.217834f, -405.034f, -394.23f); + float2x3 r1 = float2x3(-0.385305852f, 9.524919f, 3.1372714f, 2.215714f, -0.4944412f, -0.9168292f); + TestUtils.AreEqual(r1, a1 / b1); + + float2x3 a2 = float2x3(-416.226135f, -450.0192f, -273.497437f, -286.908173f, -314.256042f, 177.762085f); + float2x3 b2 = float2x3(-375.8277f, -121.245483f, 447.623352f, 338.286255f, -405.5442f, -431.168945f); + float2x3 r2 = float2x3(1.107492f, 3.71163678f, -0.610999048f, -0.8481225f, 0.7748996f, -0.412279427f); + TestUtils.AreEqual(r2, a2 / b2); + + float2x3 a3 = float2x3(97.6270142f, -68.10727f, -386.450745f, 263.699341f, -297.0271f, -501.777039f); + float2x3 b3 = float2x3(296.205139f, 437.939819f, 39.2106323f, 331.289734f, -310.619568f, 207.26947f); + float2x3 r3 = float2x3(0.3295926f, -0.155517414f, -9.855764f, 0.795978f, 0.9562408f, -2.42089224f); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void float2x3_operator_div_wide_scalar() + { + float2x3 a0 = float2x3(171.3424f, 0.103393555f, 57.8882446f, -256.130737f, 95.66968f, -290.3869f); + float b0 = (171.796814f); + float2x3 r0 = float2x3(0.997355f, 0.000601836247f, 0.3369576f, -1.49089336f, 0.5568769f, -1.69029272f); + TestUtils.AreEqual(r0, a0 / b0); + + float2x3 a1 = float2x3(-127.4487f, 146.466858f, -499.843567f, 58.68634f, -453.2058f, -205.033813f); + float b1 = (-79.7449f); + float2x3 r1 = float2x3(1.598205f, -1.83669245f, 6.2680316f, -0.7359259f, 5.68319464f, 2.57112122f); + TestUtils.AreEqual(r1, a1 / b1); + + float2x3 a2 = float2x3(481.738159f, -293.4635f, -158.505585f, -289.5822f, 494.1286f, 203.583435f); + float b2 = (464.479065f); + float2x3 r2 = float2x3(1.037158f, -0.6318121f, -0.341254532f, -0.6234559f, 1.063834f, 0.438304871f); + TestUtils.AreEqual(r2, a2 / b2); + + float2x3 a3 = float2x3(180.9704f, 460.844727f, 490.956238f, -280.478058f, -320.243866f, 192.41449f); + float b3 = (259.1192f); + float2x3 r3 = float2x3(0.698406f, 1.77850473f, 1.89471185f, -1.08242869f, -1.235894f, 0.742571354f); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void float2x3_operator_div_scalar_wide() + { + float a0 = (-264.4425f); + float2x3 b0 = float2x3(105.589111f, -142.349091f, -288.9489f, 39.644104f, -363.9914f, -149.718231f); + float2x3 r0 = float2x3(-2.50444865f, 1.85770416f, 0.9151877f, -6.670412f, 0.7265076f, 1.7662679f); + TestUtils.AreEqual(r0, a0 / b0); + + float a1 = (-395.729126f); + float2x3 b1 = float2x3(258.7187f, -9.66626f, 117.725525f, -331.386536f, -509.986023f, 427.896484f); + float2x3 r1 = float2x3(-1.529573f, 40.93922f, -3.36145568f, 1.19416177f, 0.775960743f, -0.9248244f); + TestUtils.AreEqual(r1, a1 / b1); + + float a2 = (467.617126f); + float2x3 b2 = float2x3(-407.124634f, 252.690735f, 444.599365f, -88.31329f, 199.955017f, -218.346924f); + float2x3 r2 = float2x3(-1.14858472f, 1.85055113f, 1.05177188f, -5.29498f, 2.3386116f, -2.14162445f); + TestUtils.AreEqual(r2, a2 / b2); + + float a3 = (-13.4171753f); + float2x3 b3 = float2x3(-296.131073f, 0.561340332f, -289.299316f, 196.218323f, 334.733459f, -282.392731f); + float2x3 r3 = float2x3(0.0453082323f, -23.9020329f, 0.0463781767f, -0.0683788061f, -0.0400831625f, 0.047512468f); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void float2x3_operator_mod_wide_wide() + { + float2x3 a0 = float2x3(-388.8125f, 181.681213f, -167.078735f, 432.820129f, -258.438965f, -170.110809f); + float2x3 b0 = float2x3(436.944153f, 58.9400635f, -201.116241f, 279.289368f, -397.079773f, 377.899963f); + float2x3 r0 = float2x3(-388.8125f, 4.861023f, -167.078735f, 153.530762f, -258.438965f, -170.110809f); + TestUtils.AreEqual(r0, a0 % b0); + + float2x3 a1 = float2x3(283.3183f, 122.716492f, 335.271f, -503.608521f, 191.022522f, 289.742676f); + float2x3 b1 = float2x3(174.693848f, -228.176514f, -317.060181f, -417.4801f, -249.975952f, -397.571564f); + float2x3 r1 = float2x3(108.624451f, 122.716492f, 18.2108154f, -86.12842f, 191.022522f, 289.742676f); + TestUtils.AreEqual(r1, a1 % b1); + + float2x3 a2 = float2x3(-124.033722f, 259.274f, -274.358459f, -140.030792f, 324.577576f, -200.513092f); + float2x3 b2 = float2x3(-358.745453f, -198.15921f, 208.737122f, -12.1194153f, 25.2714233f, -194.1207f); + float2x3 r2 = float2x3(-124.033722f, 61.1147766f, -65.62134f, -6.717224f, 21.3204956f, -6.392395f); + TestUtils.AreEqual(r2, a2 % b2); + + float2x3 a3 = float2x3(211.423157f, -51.2722168f, -230.633911f, 99.98938f, 399.18988f, 24.90326f); + float2x3 b3 = float2x3(-493.8718f, -312.3017f, -216.980591f, 413.570984f, -436.3944f, 3.491272f); + float2x3 r3 = float2x3(211.423157f, -51.2722168f, -13.65332f, 99.98938f, 399.18988f, 0.464355469f); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void float2x3_operator_mod_wide_scalar() + { + float2x3 a0 = float2x3(-244.499634f, -211.8193f, -145.926788f, -304.9182f, 155.479492f, -133.907776f); + float b0 = (39.63495f); + float2x3 r0 = float2x3(-6.68994141f, -13.6445618f, -27.0219421f, -27.4735718f, 36.574646f, -15.00293f); + TestUtils.AreEqual(r0, a0 % b0); + + float2x3 a1 = float2x3(281.309631f, 335.166138f, 101.706482f, 319.4715f, -285.4023f, -355.846863f); + float b1 = (-226.535767f); + float2x3 r1 = float2x3(54.7738647f, 108.630371f, 101.706482f, 92.93573f, -58.8665466f, -129.3111f); + TestUtils.AreEqual(r1, a1 % b1); + + float2x3 a2 = float2x3(259.378f, -284.343567f, -102.683441f, -172.141754f, 206.41687f, -416.713654f); + float b2 = (-330.871948f); + float2x3 r2 = float2x3(259.378f, -284.343567f, -102.683441f, -172.141754f, 206.41687f, -85.8417053f); + TestUtils.AreEqual(r2, a2 % b2); + + float2x3 a3 = float2x3(-339.256653f, 132.552917f, 226.944092f, -306.1183f, 115.438477f, 281.882935f); + float b3 = (435.2975f); + float2x3 r3 = float2x3(-339.256653f, 132.552917f, 226.944092f, -306.1183f, 115.438477f, 281.882935f); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void float2x3_operator_mod_scalar_wide() + { + float a0 = (-66.94504f); + float2x3 b0 = float2x3(-249.7761f, -396.073761f, 386.492065f, 168.939453f, -199.418243f, 261.7517f); + float2x3 r0 = float2x3(-66.94504f, -66.94504f, -66.94504f, -66.94504f, -66.94504f, -66.94504f); + TestUtils.AreEqual(r0, a0 % b0); + + float a1 = (16.1274414f); + float2x3 b1 = float2x3(257.668152f, -75.78845f, 170.9563f, -242.858276f, 425.9453f, 303.2724f); + float2x3 r1 = float2x3(16.1274414f, 16.1274414f, 16.1274414f, 16.1274414f, 16.1274414f, 16.1274414f); + TestUtils.AreEqual(r1, a1 % b1); + + float a2 = (3.033081f); + float2x3 b2 = float2x3(-505.74353f, 461.957031f, 205.972778f, 270.040649f, -47.4807129f, -150.254486f); + float2x3 r2 = float2x3(3.033081f, 3.033081f, 3.033081f, 3.033081f, 3.033081f, 3.033081f); + TestUtils.AreEqual(r2, a2 % b2); + + float a3 = (149.499512f); + float2x3 b3 = float2x3(-220.298035f, 31.1188354f, 400.635681f, 6.23144531f, -39.05075f, -71.9411f); + float2x3 r3 = float2x3(149.499512f, 25.02417f, 149.499512f, 6.17626953f, 32.34726f, 5.61730957f); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void float2x3_operator_plus() + { + float2x3 a0 = float2x3(-418.829559f, -405.79895f, -34.04178f, 236.999268f, -459.8391f, 210.86145f); + float2x3 r0 = float2x3(-418.829559f, -405.79895f, -34.04178f, 236.999268f, -459.8391f, 210.86145f); + TestUtils.AreEqual(r0, +a0); + + float2x3 a1 = float2x3(293.742f, -386.059845f, 4.95440674f, -418.645264f, 504.474854f, -170.746521f); + float2x3 r1 = float2x3(293.742f, -386.059845f, 4.95440674f, -418.645264f, 504.474854f, -170.746521f); + TestUtils.AreEqual(r1, +a1); + + float2x3 a2 = float2x3(439.5594f, 116.400757f, 421.409668f, -258.596069f, 447.8661f, 124.164368f); + float2x3 r2 = float2x3(439.5594f, 116.400757f, 421.409668f, -258.596069f, 447.8661f, 124.164368f); + TestUtils.AreEqual(r2, +a2); + + float2x3 a3 = float2x3(222.172546f, 239.041809f, 498.449524f, -139.382538f, 279.072937f, 108.775818f); + float2x3 r3 = float2x3(222.172546f, 239.041809f, 498.449524f, -139.382538f, 279.072937f, 108.775818f); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void float2x3_operator_neg() + { + float2x3 a0 = float2x3(148.461731f, -467.122681f, 132.04718f, 183.522644f, 473.701f, -407.9911f); + float2x3 r0 = float2x3(-148.461731f, 467.122681f, -132.04718f, -183.522644f, -473.701f, 407.9911f); + TestUtils.AreEqual(r0, -a0); + + float2x3 a1 = float2x3(-54.95877f, -299.093384f, -383.014069f, 407.709778f, 168.735474f, 466.441528f); + float2x3 r1 = float2x3(54.95877f, 299.093384f, 383.014069f, -407.709778f, -168.735474f, -466.441528f); + TestUtils.AreEqual(r1, -a1); + + float2x3 a2 = float2x3(171.902466f, -78.857605f, 318.69635f, -39.9154053f, 140.340027f, 132.195618f); + float2x3 r2 = float2x3(-171.902466f, 78.857605f, -318.69635f, 39.9154053f, -140.340027f, -132.195618f); + TestUtils.AreEqual(r2, -a2); + + float2x3 a3 = float2x3(-505.895264f, -237.056946f, -137.617828f, -245.349976f, 422.521362f, -434.57135f); + float2x3 r3 = float2x3(505.895264f, 237.056946f, 137.617828f, 245.349976f, -422.521362f, 434.57135f); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void float2x3_operator_prefix_inc() + { + float2x3 a0 = float2x3(-139.842072f, -56.7436523f, -381.955322f, 509.796326f, -222.896332f, 210.319885f); + float2x3 r0 = float2x3(-138.842072f, -55.7436523f, -380.955322f, 510.796326f, -221.896332f, 211.319885f); + TestUtils.AreEqual(r0, ++a0); + + float2x3 a1 = float2x3(-392.7315f, 362.212769f, 401.6148f, 130.90918f, -450.230164f, 243.546936f); + float2x3 r1 = float2x3(-391.7315f, 363.212769f, 402.6148f, 131.90918f, -449.230164f, 244.546936f); + TestUtils.AreEqual(r1, ++a1); + + float2x3 a2 = float2x3(46.1920166f, 299.1855f, 154.356567f, -281.233276f, 200.706f, 92.95776f); + float2x3 r2 = float2x3(47.1920166f, 300.1855f, 155.356567f, -280.233276f, 201.706f, 93.95776f); + TestUtils.AreEqual(r2, ++a2); + + float2x3 a3 = float2x3(448.602173f, 18.4990845f, -215.711121f, 471.947266f, 257.0766f, 41.6259155f); + float2x3 r3 = float2x3(449.602173f, 19.4990845f, -214.711121f, 472.947266f, 258.0766f, 42.6259155f); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void float2x3_operator_postfix_inc() + { + float2x3 a0 = float2x3(-396.669739f, 511.20752f, 249.111267f, -128.817322f, -259.4903f, 278.008179f); + float2x3 r0 = float2x3(-396.669739f, 511.20752f, 249.111267f, -128.817322f, -259.4903f, 278.008179f); + TestUtils.AreEqual(r0, a0++); + + float2x3 a1 = float2x3(-81.39343f, 167.852112f, 147.94397f, -326.1076f, 41.03357f, 128.5304f); + float2x3 r1 = float2x3(-81.39343f, 167.852112f, 147.94397f, -326.1076f, 41.03357f, 128.5304f); + TestUtils.AreEqual(r1, a1++); + + float2x3 a2 = float2x3(73.15558f, -446.229767f, -296.937836f, 267.293823f, 446.2293f, 49.2001953f); + float2x3 r2 = float2x3(73.15558f, -446.229767f, -296.937836f, 267.293823f, 446.2293f, 49.2001953f); + TestUtils.AreEqual(r2, a2++); + + float2x3 a3 = float2x3(-326.643127f, 471.647461f, -171.013092f, 310.727356f, -298.917175f, 489.985f); + float2x3 r3 = float2x3(-326.643127f, 471.647461f, -171.013092f, 310.727356f, -298.917175f, 489.985f); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void float2x3_operator_prefix_dec() + { + float2x3 a0 = float2x3(123.128723f, 256.84375f, 156.330811f, 461.737427f, 325.867981f, 392.015625f); + float2x3 r0 = float2x3(122.128723f, 255.84375f, 155.330811f, 460.737427f, 324.867981f, 391.015625f); + TestUtils.AreEqual(r0, --a0); + + float2x3 a1 = float2x3(187.874146f, 125.109619f, 469.844727f, 45.5366821f, 376.046875f, -363.0755f); + float2x3 r1 = float2x3(186.874146f, 124.109619f, 468.844727f, 44.5366821f, 375.046875f, -364.0755f); + TestUtils.AreEqual(r1, --a1); + + float2x3 a2 = float2x3(-22.0289612f, 168.095032f, 168.265625f, -190.284729f, 166.945557f, 183.957947f); + float2x3 r2 = float2x3(-23.0289612f, 167.095032f, 167.265625f, -191.284729f, 165.945557f, 182.957947f); + TestUtils.AreEqual(r2, --a2); + + float2x3 a3 = float2x3(485.6947f, 89.5698853f, -267.4298f, 201.756226f, -141.216888f, -217.4841f); + float2x3 r3 = float2x3(484.6947f, 88.5698853f, -268.4298f, 200.756226f, -142.216888f, -218.4841f); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void float2x3_operator_postfix_dec() + { + float2x3 a0 = float2x3(379.6883f, 302.692871f, -176.07135f, -291.2527f, 470.567566f, -402.925964f); + float2x3 r0 = float2x3(379.6883f, 302.692871f, -176.07135f, -291.2527f, 470.567566f, -402.925964f); + TestUtils.AreEqual(r0, a0--); + + float2x3 a1 = float2x3(-63.65515f, -27.8892212f, -100.761841f, 156.14032f, 479.9452f, -200.304291f); + float2x3 r1 = float2x3(-63.65515f, -27.8892212f, -100.761841f, 156.14032f, 479.9452f, -200.304291f); + TestUtils.AreEqual(r1, a1--); + + float2x3 a2 = float2x3(-445.026947f, 327.670349f, 48.06018f, -209.667969f, -38.43506f, 283.9416f); + float2x3 r2 = float2x3(-445.026947f, 327.670349f, 48.06018f, -209.667969f, -38.43506f, 283.9416f); + TestUtils.AreEqual(r2, a2--); + + float2x3 a3 = float2x3(-94.80209f, -287.2625f, -215.948029f, -407.046356f, 159.233582f, -359.456482f); + float2x3 r3 = float2x3(-94.80209f, -287.2625f, -215.948029f, -407.046356f, 159.233582f, -359.456482f); + TestUtils.AreEqual(r3, a3--); + } + + [TestCase /* For player builds */] + public static void float2x3_EqualsObjectOverride() + { + TestUtils.IsFalse(new float2x3().Equals((object)new int())); + TestUtils.IsTrue(new float2x3().Equals((object)new float2x3())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestFloat2x3.gen.cs.meta b/src/Tests/Tests/Shared/TestFloat2x3.gen.cs.meta new file mode 100644 index 00000000..8cbf217f --- /dev/null +++ b/src/Tests/Tests/Shared/TestFloat2x3.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c55c5a192a2ac9046aed8be3f03ce6f2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestFloat2x4.gen.cs b/src/Tests/Tests/Shared/TestFloat2x4.gen.cs new file mode 100644 index 00000000..769a761e --- /dev/null +++ b/src/Tests/Tests/Shared/TestFloat2x4.gen.cs @@ -0,0 +1,952 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestFloat2x4 + { + [TestCompiler] + public static void float2x4_zero() + { + TestUtils.AreEqual(0.0f, float2x4.zero.c0.x); + TestUtils.AreEqual(0.0f, float2x4.zero.c0.y); + TestUtils.AreEqual(0.0f, float2x4.zero.c1.x); + TestUtils.AreEqual(0.0f, float2x4.zero.c1.y); + TestUtils.AreEqual(0.0f, float2x4.zero.c2.x); + TestUtils.AreEqual(0.0f, float2x4.zero.c2.y); + TestUtils.AreEqual(0.0f, float2x4.zero.c3.x); + TestUtils.AreEqual(0.0f, float2x4.zero.c3.y); + } + + [TestCompiler] + public static void float2x4_operator_equal_wide_wide() + { + float2x4 a0 = float2x4(492.1576f, -495.206329f, 227.457642f, -147.374054f, -222.682f, 64.09375f, -23.8904114f, -16.8197327f); + float2x4 b0 = float2x4(192.568787f, -235.611023f, -254.043121f, -412.624725f, 471.9048f, -6.47277832f, -339.102356f, 488.187561f); + bool2x4 r0 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + float2x4 a1 = float2x4(163.232117f, -165.271f, 470.8777f, -423.942566f, 109.6344f, 462.6903f, -335.38147f, 357.2345f); + float2x4 b1 = float2x4(-379.5966f, -308.417f, -82.333374f, -102.921082f, 226.515747f, -356.9013f, -362.912781f, -427.898438f); + bool2x4 r1 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + float2x4 a2 = float2x4(1.54559326f, -347.388245f, -114.472168f, 435.848633f, 194.2381f, 138.765564f, -467.349152f, 370.43335f); + float2x4 b2 = float2x4(466.650146f, -102.799042f, -43.355957f, 85.0456543f, -91.1270447f, 422.192078f, -477.4313f, 1.87701416f); + bool2x4 r2 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + float2x4 a3 = float2x4(476.708252f, 320.552673f, -498.59198f, 92.41693f, 104.511353f, 166.754578f, -204.733429f, 434.756775f); + float2x4 b3 = float2x4(312.580078f, 254.599365f, 352.72583f, 62.4909668f, 119.714783f, -511.058075f, -302.472717f, -371.769226f); + bool2x4 r3 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void float2x4_operator_equal_wide_scalar() + { + float2x4 a0 = float2x4(-303.230072f, 451.5263f, -253.655884f, -105.203644f, -500.6911f, -426.192474f, 159.8761f, -59.55838f); + float b0 = (123.544556f); + bool2x4 r0 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + float2x4 a1 = float2x4(-57.4773865f, 406.513733f, 370.886f, -172.035309f, 455.400024f, -11.3389893f, 363.938232f, -27.1505737f); + float b1 = (-182.049744f); + bool2x4 r1 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + float2x4 a2 = float2x4(-325.976074f, 180.196838f, -374.128326f, -439.358948f, -126.546082f, -197.26178f, -227.159332f, -479.8992f); + float b2 = (-290.359039f); + bool2x4 r2 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + float2x4 a3 = float2x4(-439.777679f, -224.517059f, -422.833221f, -450.196259f, -20.10672f, 297.38f, 185.966553f, -102.975983f); + float b3 = (-495.237335f); + bool2x4 r3 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void float2x4_operator_equal_scalar_wide() + { + float a0 = (-253.397278f); + float2x4 b0 = float2x4(19.95221f, -185.791992f, 407.8136f, -87.2767f, -206.274689f, 160.503113f, -274.7708f, -2.63153076f); + bool2x4 r0 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + float a1 = (448.354553f); + float2x4 b1 = float2x4(-410.035248f, 247.329041f, 355.539124f, -298.0667f, 414.1015f, -481.3026f, 196.55072f, 34.6010132f); + bool2x4 r1 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + float a2 = (113.7616f); + float2x4 b2 = float2x4(-386.453369f, -124.49176f, 243.886658f, -492.6182f, 145.424438f, 421.55072f, -95.40997f, 336.809265f); + bool2x4 r2 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + float a3 = (209.5838f); + float2x4 b3 = float2x4(487.4414f, 161.806519f, 149.842468f, 225.724f, -71.21881f, 85.78027f, 192.547241f, -49.88748f); + bool2x4 r3 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void float2x4_operator_not_equal_wide_wide() + { + float2x4 a0 = float2x4(430.842529f, 104.69f, 225.802429f, -310.5702f, -418.619446f, 304.128174f, -509.3268f, -160.538086f); + float2x4 b0 = float2x4(210.024719f, -55.20334f, -269.925354f, -234.546722f, 25.91742f, -63.72699f, -484.5537f, -425.3336f); + bool2x4 r0 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + float2x4 a1 = float2x4(-203.301971f, -505.763245f, 162.17218f, 1.156189f, 65.66205f, 102.787781f, 172.930054f, 26.6210327f); + float2x4 b1 = float2x4(-53.2743835f, 328.1944f, 15.9631348f, 461.7141f, -113.363037f, -240.072968f, 495.119141f, 203.55835f); + bool2x4 r1 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + float2x4 a2 = float2x4(235.125977f, 128.541992f, -354.996979f, 334.3595f, -495.832f, 468.307373f, 458.370972f, 299.937317f); + float2x4 b2 = float2x4(340.493469f, -241.9072f, 459.569824f, 213.07373f, -384.782837f, -255.072327f, 477.663452f, -248.036621f); + bool2x4 r2 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + float2x4 a3 = float2x4(43.1271973f, -354.7135f, -145.2872f, 390.80188f, -303.13147f, 391.134583f, 139.286865f, 104.523193f); + float2x4 b3 = float2x4(-407.923462f, -199.788879f, 151.843262f, -97.1206055f, 154.975891f, -172.834534f, 441.5028f, -401.738617f); + bool2x4 r3 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void float2x4_operator_not_equal_wide_scalar() + { + float2x4 a0 = float2x4(-16.9145813f, 168.8341f, -462.713531f, 130.307739f, 214.501587f, -440.263275f, -197.12796f, -169.099854f); + float b0 = (-145.372772f); + bool2x4 r0 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + float2x4 a1 = float2x4(-386.611176f, -270.26886f, -403.9637f, -269.805725f, 299.654236f, -71.7509155f, -432.755737f, -457.363129f); + float b1 = (-281.021f); + bool2x4 r1 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + float2x4 a2 = float2x4(-13.5195923f, 185.04248f, -482.5307f, 116.395142f, 511.735f, 230.5075f, 100.27478f, 129.682434f); + float b2 = (273.873047f); + bool2x4 r2 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + float2x4 a3 = float2x4(321.178772f, 140.3352f, 369.212341f, 453.811218f, -333.66626f, -373.937744f, 150.204285f, -442.164764f); + float b3 = (-220.639f); + bool2x4 r3 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void float2x4_operator_not_equal_scalar_wide() + { + float a0 = (275.795837f); + float2x4 b0 = float2x4(-57.1969f, -382.432526f, 97.82037f, -161.463654f, -458.39563f, -499.617859f, 327.92218f, 367.571228f); + bool2x4 r0 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + float a1 = (59.786377f); + float2x4 b1 = float2x4(-209.580688f, -62.5804443f, -479.974976f, -49.4945068f, -114.685211f, 109.93927f, -176.284821f, -347.4853f); + bool2x4 r1 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + float a2 = (85.5409546f); + float2x4 b2 = float2x4(-356.659546f, -104.243561f, -133.5492f, 243.539734f, 13.1412964f, -379.985962f, -41.28122f, 87.91168f); + bool2x4 r2 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + float a3 = (-339.077271f); + float2x4 b3 = float2x4(-371.820343f, 333.1443f, 294.811951f, -187.14566f, 220.192261f, -228.182068f, -499.723724f, 97.40588f); + bool2x4 r3 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void float2x4_operator_less_wide_wide() + { + float2x4 a0 = float2x4(196.84259f, 336.4098f, 251.963745f, 257.655945f, 430.0459f, -62.4196472f, 8.839233f, -333.8167f); + float2x4 b0 = float2x4(-465.345032f, -256.1524f, -314.814026f, 364.5667f, 100.21051f, 182.560974f, 3.11700439f, -259.430481f); + bool2x4 r0 = bool2x4(false, false, false, true, false, true, false, true); + TestUtils.AreEqual(r0, a0 < b0); + + float2x4 a1 = float2x4(164.678833f, -350.9449f, 3.84143066f, 125.409729f, -111.129944f, 70.00549f, 448.1983f, -419.987122f); + float2x4 b1 = float2x4(-437.3349f, -456.043732f, -394.255981f, 401.9137f, 313.439148f, 121.286682f, -28.0122986f, -282.965881f); + bool2x4 r1 = bool2x4(false, false, false, true, true, true, false, true); + TestUtils.AreEqual(r1, a1 < b1); + + float2x4 a2 = float2x4(-258.301666f, -34.8322144f, -69.8594055f, 67.76721f, -139.777283f, 385.434631f, 133.7074f, 506.188354f); + float2x4 b2 = float2x4(330.0644f, 124.099365f, -183.6903f, 373.0608f, 109.750916f, -203.57135f, 45.64868f, -360.952271f); + bool2x4 r2 = bool2x4(true, true, false, true, true, false, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + float2x4 a3 = float2x4(34.44287f, 412.1137f, -84.8097839f, 444.785339f, -78.75473f, 366.977539f, 127.180481f, 428.368469f); + float2x4 b3 = float2x4(211.913086f, -313.286377f, -259.661072f, 79.09851f, 446.4961f, 450.524536f, -375.630768f, -53.9418335f); + bool2x4 r3 = bool2x4(true, false, false, false, true, true, false, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void float2x4_operator_less_wide_scalar() + { + float2x4 a0 = float2x4(-132.057312f, -192.465f, -66.8345947f, -379.017517f, -360.2824f, 20.9278564f, -158.240753f, 437.3459f); + float b0 = (-156.010223f); + bool2x4 r0 = bool2x4(false, true, false, true, true, false, true, false); + TestUtils.AreEqual(r0, a0 < b0); + + float2x4 a1 = float2x4(-20.4526062f, 307.4842f, 274.015259f, 373.549683f, 398.523682f, 105.030151f, -58.0108948f, 109.670105f); + float b1 = (225.2915f); + bool2x4 r1 = bool2x4(true, false, false, false, false, true, true, true); + TestUtils.AreEqual(r1, a1 < b1); + + float2x4 a2 = float2x4(-108.85318f, 140.426086f, -500.0883f, 172.103333f, -197.500732f, -7.271515f, -432.9905f, 62.1583252f); + float b2 = (-44.9712524f); + bool2x4 r2 = bool2x4(true, false, true, false, true, false, true, false); + TestUtils.AreEqual(r2, a2 < b2); + + float2x4 a3 = float2x4(-72.25473f, -500.255737f, 149.11499f, 119.880615f, 202.63916f, 274.950684f, 66.41205f, 274.999451f); + float b3 = (-377.852325f); + bool2x4 r3 = bool2x4(false, true, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void float2x4_operator_less_scalar_wide() + { + float a0 = (-423.1174f); + float2x4 b0 = float2x4(385.094849f, -123.933472f, 86.37659f, 133.4422f, 161.457947f, 229.754272f, 222.5716f, 315.5312f); + bool2x4 r0 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 < b0); + + float a1 = (-447.203522f); + float2x4 b1 = float2x4(271.833862f, -393.605316f, 317.486877f, -164.6051f, -282.876038f, 296.979553f, -254.401154f, 365.6156f); + bool2x4 r1 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 < b1); + + float a2 = (-441.984253f); + float2x4 b2 = float2x4(-131.42865f, 442.628967f, -29.7928467f, -138.37381f, 9.21698f, -226.73056f, 171.029419f, 376.625244f); + bool2x4 r2 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 < b2); + + float a3 = (-462.5887f); + float2x4 b3 = float2x4(-142.36731f, -456.253784f, 66.61023f, 169.378784f, 327.4444f, 64.08795f, -153.5039f, 199.380127f); + bool2x4 r3 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void float2x4_operator_greater_wide_wide() + { + float2x4 a0 = float2x4(483.5014f, 310.8156f, 106.966187f, 295.7353f, 116.957581f, -478.299774f, -14.8974f, -33.8174438f); + float2x4 b0 = float2x4(-471.398f, -371.9853f, 36.9006958f, -316.7636f, 19.6830444f, 207.309143f, 362.7975f, 324.95343f); + bool2x4 r0 = bool2x4(true, true, true, true, true, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + float2x4 a1 = float2x4(-24.74054f, 319.782654f, -120.158569f, -289.008575f, 455.85144f, 144.706909f, 63.9320068f, -285.683044f); + float2x4 b1 = float2x4(340.948059f, 25.9860229f, -114.211121f, 240.803467f, 273.422424f, 325.515747f, 27.3410645f, 64.47955f); + bool2x4 r1 = bool2x4(false, true, false, false, true, false, true, false); + TestUtils.AreEqual(r1, a1 > b1); + + float2x4 a2 = float2x4(-502.090729f, -337.194458f, 474.317322f, -507.1451f, -133.565582f, -443.109131f, -464.34137f, -68.36154f); + float2x4 b2 = float2x4(200.948364f, 100.122681f, -79.00711f, -315.137939f, -122.985443f, -163.7792f, -492.566f, -90.79727f); + bool2x4 r2 = bool2x4(false, false, true, false, false, false, true, true); + TestUtils.AreEqual(r2, a2 > b2); + + float2x4 a3 = float2x4(-185.993011f, -157.8039f, -74.12424f, -94.47116f, 329.610535f, -315.836731f, 404.1938f, 131.304382f); + float2x4 b3 = float2x4(-284.901245f, -23.6536865f, 174.93f, 85.7125244f, -441.987823f, 345.543762f, 482.219482f, -422.383484f); + bool2x4 r3 = bool2x4(true, false, false, false, true, false, false, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void float2x4_operator_greater_wide_scalar() + { + float2x4 a0 = float2x4(64.31793f, -397.703461f, 431.8769f, 85.703f, 246.263062f, 197.491577f, 286.199463f, 280.813354f); + float b0 = (305.859924f); + bool2x4 r0 = bool2x4(false, false, true, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + float2x4 a1 = float2x4(-405.7846f, -241.807281f, 333.5782f, 370.279175f, -413.7014f, -356.592346f, -353.0313f, 396.645325f); + float b1 = (171.565369f); + bool2x4 r1 = bool2x4(false, false, true, true, false, false, false, true); + TestUtils.AreEqual(r1, a1 > b1); + + float2x4 a2 = float2x4(467.222046f, 502.915039f, 315.4676f, -259.2897f, 281.230652f, 428.792175f, 245.153076f, -279.1754f); + float b2 = (-240.013428f); + bool2x4 r2 = bool2x4(true, true, true, false, true, true, true, false); + TestUtils.AreEqual(r2, a2 > b2); + + float2x4 a3 = float2x4(-453.8631f, -425.652924f, 99.13287f, 355.060547f, -456.439423f, 154.489014f, 405.529724f, -157.7338f); + float b3 = (-124.771545f); + bool2x4 r3 = bool2x4(false, false, true, true, false, true, true, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void float2x4_operator_greater_scalar_wide() + { + float a0 = (-282.6705f); + float2x4 b0 = float2x4(358.099976f, -72.596405f, -232.163788f, -60.7067261f, 75.15662f, 150.883484f, 339.539185f, -498.196045f); + bool2x4 r0 = bool2x4(false, false, false, false, false, false, false, true); + TestUtils.AreEqual(r0, a0 > b0); + + float a1 = (459.7461f); + float2x4 b1 = float2x4(-227.968719f, 335.862122f, 76.17883f, 296.859924f, 177.48999f, -281.2012f, 244.722839f, 137.328552f); + bool2x4 r1 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + float a2 = (-385.338257f); + float2x4 b2 = float2x4(443.163452f, -353.562561f, 26.04065f, -331.793945f, -43.6919556f, 20.9494019f, -211.17984f, 227.421692f); + bool2x4 r2 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + float a3 = (-84.7797852f); + float2x4 b3 = float2x4(-375.1355f, -205.178131f, -197.04715f, -219.634033f, -210.015625f, -266.7737f, 144.7785f, -471.7112f); + bool2x4 r3 = bool2x4(true, true, true, true, true, true, false, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void float2x4_operator_less_equal_wide_wide() + { + float2x4 a0 = float2x4(-438.523132f, 210.489441f, 4.87731934f, -137.297943f, 156.094116f, -363.924133f, -97.94849f, 437.2954f); + float2x4 b0 = float2x4(-474.814148f, 304.371033f, 234.824158f, -390.485443f, -297.175354f, -326.2924f, 107.253906f, -413.131073f); + bool2x4 r0 = bool2x4(false, true, true, false, false, true, true, false); + TestUtils.AreEqual(r0, a0 <= b0); + + float2x4 a1 = float2x4(458.530273f, -294.064758f, 23.62262f, -34.2840576f, 149.736511f, -418.8867f, -197.502533f, -88.2055054f); + float2x4 b1 = float2x4(67.09442f, 470.075256f, -84.499115f, 392.784241f, -263.531738f, 369.3009f, -333.3253f, 238.413452f); + bool2x4 r1 = bool2x4(false, true, false, true, false, true, false, true); + TestUtils.AreEqual(r1, a1 <= b1); + + float2x4 a2 = float2x4(-376.71814f, 341.627136f, -83.30917f, -107.490723f, 319.466858f, 205.357361f, 345.563721f, 395.3219f); + float2x4 b2 = float2x4(486.2426f, 279.6502f, 236.052f, 132.758972f, 66.29474f, 183.002136f, 200.130554f, 339.043823f); + bool2x4 r2 = bool2x4(true, false, true, true, false, false, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + float2x4 a3 = float2x4(-222.874146f, 439.022034f, -368.075562f, -200.0386f, 71.46991f, -357.365417f, 141.710876f, 319.0171f); + float2x4 b3 = float2x4(438.5379f, 145.401855f, 178.163086f, 157.975952f, 329.7052f, -243.590912f, 5.401184f, -22.5805969f); + bool2x4 r3 = bool2x4(true, false, true, true, true, true, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void float2x4_operator_less_equal_wide_scalar() + { + float2x4 a0 = float2x4(193.49585f, 168.915527f, -313.993073f, 81.8269653f, 18.5036011f, -0.3581848f, 241.361145f, -463.8164f); + float b0 = (443.850525f); + bool2x4 r0 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + float2x4 a1 = float2x4(-1.35775757f, 398.991943f, -471.253082f, -264.9378f, 82.2583f, 11.2460327f, 424.704041f, 426.482239f); + float b1 = (-268.899475f); + bool2x4 r1 = bool2x4(false, false, true, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 <= b1); + + float2x4 a2 = float2x4(56.3200073f, 31.9011841f, -152.257568f, -437.926453f, -37.1048279f, -47.1442261f, 333.623047f, -274.8039f); + float b2 = (-196.2879f); + bool2x4 r2 = bool2x4(false, false, false, true, false, false, false, true); + TestUtils.AreEqual(r2, a2 <= b2); + + float2x4 a3 = float2x4(358.67627f, 192.309143f, 145.306091f, -466.132965f, -494.267334f, -111.570129f, -139.5412f, -146.589355f); + float b3 = (-260.460571f); + bool2x4 r3 = bool2x4(false, false, false, true, true, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void float2x4_operator_less_equal_scalar_wide() + { + float a0 = (393.606262f); + float2x4 b0 = float2x4(-75.6883545f, -44.2638855f, 125.864929f, 191.9649f, 13.54303f, -197.051941f, -423.9451f, -330.0486f); + bool2x4 r0 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 <= b0); + + float a1 = (420.165527f); + float2x4 b1 = float2x4(105.5473f, 174.821289f, 296.7176f, -469.7004f, 123.267212f, 112.996948f, 495.143372f, -488.6579f); + bool2x4 r1 = bool2x4(false, false, false, false, false, false, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + float a2 = (388.539429f); + float2x4 b2 = float2x4(-493.240784f, 16.45105f, -387.651642f, -229.1773f, -373.01532f, -391.142151f, 90.99414f, -178.396149f); + bool2x4 r2 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + float a3 = (-69.62106f); + float2x4 b3 = float2x4(471.790833f, -67.46677f, 45.30536f, -154.6922f, 385.7389f, -431.652954f, -331.673035f, -349.8927f); + bool2x4 r3 = bool2x4(true, true, true, false, true, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void float2x4_operator_greater_equal_wide_wide() + { + float2x4 a0 = float2x4(-507.9286f, 504.4975f, -385.4345f, -262.323425f, -37.5509338f, -111.595276f, -463.702026f, 387.448853f); + float2x4 b0 = float2x4(-81.3465f, 297.666138f, 171.06543f, -431.038055f, -6.85907f, 319.7257f, 254.079163f, 396.5724f); + bool2x4 r0 = bool2x4(false, true, false, true, false, false, false, false); + TestUtils.AreEqual(r0, a0 >= b0); + + float2x4 a1 = float2x4(456.9688f, -211.010162f, 182.411377f, -53.59604f, -309.570221f, -136.022491f, 280.736267f, -96.99588f); + float2x4 b1 = float2x4(178.8393f, -447.063354f, 288.492676f, 474.889282f, -321.750244f, -395.977234f, -158.692474f, 391.4887f); + bool2x4 r1 = bool2x4(true, true, false, false, true, true, true, false); + TestUtils.AreEqual(r1, a1 >= b1); + + float2x4 a2 = float2x4(-174.059509f, 88.90192f, 43.81604f, -446.07843f, 16.6455688f, 409.83252f, -191.329865f, 222.9978f); + float2x4 b2 = float2x4(-368.109253f, 89.12378f, -510.279327f, -486.9298f, -81.2155457f, 274.2188f, -212.881561f, 288.9953f); + bool2x4 r2 = bool2x4(true, false, true, true, true, true, true, false); + TestUtils.AreEqual(r2, a2 >= b2); + + float2x4 a3 = float2x4(404.2884f, 230.603271f, -441.789276f, -86.29306f, 484.249573f, 95.23639f, -204.912109f, -199.774353f); + float2x4 b3 = float2x4(307.73175f, 307.245178f, -199.391785f, -284.421265f, -482.3918f, 448.315735f, -378.3462f, -390.858459f); + bool2x4 r3 = bool2x4(true, false, false, true, true, false, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void float2x4_operator_greater_equal_wide_scalar() + { + float2x4 a0 = float2x4(465.152161f, -424.886078f, -209.2211f, 58.7798462f, -302.2691f, 140.12561f, 16.3533936f, -344.559967f); + float b0 = (-5.599884f); + bool2x4 r0 = bool2x4(true, false, false, true, false, true, true, false); + TestUtils.AreEqual(r0, a0 >= b0); + + float2x4 a1 = float2x4(393.278076f, 441.011536f, -509.781555f, -36.9942932f, 494.8203f, -164.973938f, -466.1201f, -123.813751f); + float b1 = (-315.701538f); + bool2x4 r1 = bool2x4(true, true, false, true, true, true, false, true); + TestUtils.AreEqual(r1, a1 >= b1); + + float2x4 a2 = float2x4(215.651245f, 314.346f, 190.516113f, -83.11142f, -23.8364258f, 143.049377f, -264.919983f, -169.702209f); + float b2 = (104.995728f); + bool2x4 r2 = bool2x4(true, true, true, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + float2x4 a3 = float2x4(329.70752f, -260.4233f, 354.195129f, -111.845337f, 33.309082f, 355.6313f, -435.360565f, -38.3993225f); + float b3 = (359.095825f); + bool2x4 r3 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void float2x4_operator_greater_equal_scalar_wide() + { + float a0 = (374.827026f); + float2x4 b0 = float2x4(-1.60977173f, 338.615234f, -116.1814f, -332.157318f, -355.97937f, -468.901428f, 38.579895f, -332.347534f); + bool2x4 r0 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + float a1 = (2.89013672f); + float2x4 b1 = float2x4(467.777771f, 121.406372f, -305.023376f, -58.4288025f, -226.519562f, -47.0209961f, 305.302673f, -427.401245f); + bool2x4 r1 = bool2x4(false, false, true, true, true, true, false, true); + TestUtils.AreEqual(r1, a1 >= b1); + + float a2 = (92.26367f); + float2x4 b2 = float2x4(-497.178528f, -408.625641f, -455.2305f, 396.4261f, -469.2949f, -485.754028f, -182.346191f, -291.545349f); + bool2x4 r2 = bool2x4(true, true, true, false, true, true, true, true); + TestUtils.AreEqual(r2, a2 >= b2); + + float a3 = (278.740784f); + float2x4 b3 = float2x4(-75.8711243f, 28.9070435f, 287.720154f, 420.509766f, 473.626831f, 181.514526f, -369.202881f, 243.749756f); + bool2x4 r3 = bool2x4(true, true, false, false, false, true, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void float2x4_operator_add_wide_wide() + { + float2x4 a0 = float2x4(506.129028f, -501.779816f, 420.084778f, -186.032074f, -9.312408f, 328.51178f, 424.344055f, 87.79108f); + float2x4 b0 = float2x4(-28.7579956f, -337.135132f, -340.676819f, 152.312012f, 423.66748f, 90.3740845f, 376.18866f, 1.76721191f); + float2x4 r0 = float2x4(477.371033f, -838.9149f, 79.40796f, -33.7200623f, 414.355072f, 418.885864f, 800.5327f, 89.55829f); + TestUtils.AreEqual(r0, a0 + b0); + + float2x4 a1 = float2x4(462.4137f, -46.17871f, 401.170044f, -454.124146f, 69.19568f, -177.957336f, 299.604126f, 340.704834f); + float2x4 b1 = float2x4(-120.185852f, -279.629364f, -344.6671f, 242.839172f, 418.593079f, -23.3128052f, -95.0999451f, 147.9281f); + float2x4 r1 = float2x4(342.227844f, -325.808075f, 56.50293f, -211.284973f, 487.788757f, -201.270142f, 204.504181f, 488.632935f); + TestUtils.AreEqual(r1, a1 + b1); + + float2x4 a2 = float2x4(219.916016f, -321.9084f, 286.355347f, -333.4195f, -118.932159f, 68.60748f, 23.190918f, -205.577881f); + float2x4 b2 = float2x4(331.0329f, -82.50256f, 279.4496f, 342.622742f, -300.358521f, -209.694092f, 446.559448f, -351.9892f); + float2x4 r2 = float2x4(550.9489f, -404.41095f, 565.804932f, 9.203247f, -419.29068f, -141.086609f, 469.750366f, -557.5671f); + TestUtils.AreEqual(r2, a2 + b2); + + float2x4 a3 = float2x4(11.5214233f, -340.795074f, -68.93118f, 304.8532f, -86.63385f, 105.669128f, 349.280518f, 364.7079f); + float2x4 b3 = float2x4(-263.12384f, -252.458557f, 289.825378f, 338.796143f, -232.619019f, -510.50824f, 349.280762f, -426.212463f); + float2x4 r3 = float2x4(-251.602417f, -593.253662f, 220.8942f, 643.649353f, -319.252869f, -404.8391f, 698.5613f, -61.5045776f); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void float2x4_operator_add_wide_scalar() + { + float2x4 a0 = float2x4(-194.514191f, 338.5484f, 246.971375f, 100.510925f, -45.72467f, -478.1113f, 30.9161377f, 60.37433f); + float b0 = (124.121704f); + float2x4 r0 = float2x4(-70.39249f, 462.6701f, 371.093079f, 224.632629f, 78.39703f, -353.9896f, 155.037842f, 184.496033f); + TestUtils.AreEqual(r0, a0 + b0); + + float2x4 a1 = float2x4(-242.118744f, 6.79937744f, -484.6998f, -188.265015f, -213.526733f, -267.7843f, 189.259949f, 198.533569f); + float b1 = (82.50134f); + float2x4 r1 = float2x4(-159.6174f, 89.30072f, -402.198456f, -105.763672f, -131.025391f, -185.282959f, 271.7613f, 281.0349f); + TestUtils.AreEqual(r1, a1 + b1); + + float2x4 a2 = float2x4(187.536072f, 302.102356f, 300.3991f, 124.021606f, -200.161346f, 31.3782349f, 362.522156f, -423.988861f); + float b2 = (-424.925659f); + float2x4 r2 = float2x4(-237.389587f, -122.8233f, -124.52655f, -300.904053f, -625.087036f, -393.547424f, -62.4035034f, -848.914551f); + TestUtils.AreEqual(r2, a2 + b2); + + float2x4 a3 = float2x4(432.41333f, -465.6995f, -311.04303f, 84.91901f, -432.442444f, 235.750671f, -472.637756f, -257.577759f); + float b3 = (374.211426f); + float2x4 r3 = float2x4(806.624756f, -91.48807f, 63.168396f, 459.130432f, -58.2310181f, 609.9621f, -98.42633f, 116.633667f); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void float2x4_operator_add_scalar_wide() + { + float a0 = (-340.354675f); + float2x4 b0 = float2x4(511.362244f, -146.216644f, -106.210419f, -363.450256f, 199.0896f, -27.1083984f, 419.849f, 284.955017f); + float2x4 r0 = float2x4(171.007568f, -486.57132f, -446.5651f, -703.804932f, -141.265076f, -367.463074f, 79.49432f, -55.39966f); + TestUtils.AreEqual(r0, a0 + b0); + + float a1 = (-164.9242f); + float2x4 b1 = float2x4(-249.190338f, 150.928162f, 298.1751f, -457.1534f, 424.718079f, -301.857483f, 230.288879f, -423.5876f); + float2x4 r1 = float2x4(-414.114532f, -13.9960327f, 133.250916f, -622.077637f, 259.793884f, -466.781677f, 65.3646851f, -588.5118f); + TestUtils.AreEqual(r1, a1 + b1); + + float a2 = (-67.06003f); + float2x4 b2 = float2x4(68.72412f, -164.02243f, 318.935181f, 7.80456543f, 187.698364f, -3.656952f, -446.083069f, -209.287231f); + float2x4 r2 = float2x4(1.664093f, -231.082458f, 251.875153f, -59.2554626f, 120.638336f, -70.71698f, -513.143066f, -276.34726f); + TestUtils.AreEqual(r2, a2 + b2); + + float a3 = (-38.21289f); + float2x4 b3 = float2x4(-346.257172f, 465.607422f, -192.185944f, 278.6938f, 381.978455f, 481.243652f, -97.22815f, -455.513733f); + float2x4 r3 = float2x4(-384.470062f, 427.394531f, -230.398834f, 240.4809f, 343.765564f, 443.030762f, -135.44104f, -493.726624f); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void float2x4_operator_sub_wide_wide() + { + float2x4 a0 = float2x4(160.492249f, 11.223938f, 359.200134f, -498.2283f, -355.253632f, -94.53485f, -410.46405f, -401.384644f); + float2x4 b0 = float2x4(115.46875f, -130.9823f, 241.540833f, 9.987061f, 419.895142f, 59.12445f, -402.381653f, -75.37015f); + float2x4 r0 = float2x4(45.0235f, 142.206238f, 117.6593f, -508.215363f, -775.1488f, -153.6593f, -8.082397f, -326.0145f); + TestUtils.AreEqual(r0, a0 - b0); + + float2x4 a1 = float2x4(317.706848f, 447.060425f, -489.074158f, -230.008392f, 24.8754272f, 366.614441f, -107.374146f, -219.008148f); + float2x4 b1 = float2x4(320.9796f, -73.90875f, -31.4447327f, -389.251953f, -375.028839f, 259.182739f, 276.648682f, -453.0692f); + float2x4 r1 = float2x4(-3.272766f, 520.9692f, -457.629425f, 159.243561f, 399.904266f, 107.4317f, -384.022827f, 234.061066f); + TestUtils.AreEqual(r1, a1 - b1); + + float2x4 a2 = float2x4(473.9076f, 259.63623f, -360.119629f, 7.80963135f, 437.428467f, -59.1991577f, 418.744324f, 183.142151f); + float2x4 b2 = float2x4(-272.576538f, -191.148041f, 87.1369f, 430.02478f, 343.6571f, 121.029419f, -354.188171f, 249.052f); + float2x4 r2 = float2x4(746.484131f, 450.784271f, -447.256531f, -422.215149f, 93.77136f, -180.228577f, 772.9325f, -65.90985f); + TestUtils.AreEqual(r2, a2 - b2); + + float2x4 a3 = float2x4(271.230347f, 496.208557f, 165.354919f, -227.403656f, -166.522858f, 356.142273f, 386.9264f, -394.638763f); + float2x4 b3 = float2x4(-2.22543335f, 22.4472656f, 478.112976f, -320.063f, -111.524109f, 222.228943f, -245.411072f, -119.902283f); + float2x4 r3 = float2x4(273.45578f, 473.7613f, -312.758057f, 92.65933f, -54.99875f, 133.91333f, 632.337463f, -274.736481f); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void float2x4_operator_sub_wide_scalar() + { + float2x4 a0 = float2x4(207.389587f, 248.457764f, -384.8239f, -205.344757f, -374.811554f, 191.642029f, 18.8562622f, -44.96161f); + float b0 = (-36.1124878f); + float2x4 r0 = float2x4(243.502075f, 284.570251f, -348.711426f, -169.232269f, -338.699066f, 227.754517f, 54.96875f, -8.849121f); + TestUtils.AreEqual(r0, a0 - b0); + + float2x4 a1 = float2x4(480.857971f, -366.865448f, -35.5231f, 349.397766f, 439.077271f, 490.2223f, 195.024048f, -384.849426f); + float b1 = (16.3381958f); + float2x4 r1 = float2x4(464.519775f, -383.203644f, -51.8612976f, 333.05957f, 422.739075f, 473.8841f, 178.685852f, -401.187622f); + TestUtils.AreEqual(r1, a1 - b1); + + float2x4 a2 = float2x4(189.05188f, -54.931488f, 53.0880737f, 316.8025f, -273.8067f, 256.8872f, 297.173645f, 101.829041f); + float b2 = (55.6027832f); + float2x4 r2 = float2x4(133.4491f, -110.534271f, -2.51470947f, 261.1997f, -329.4095f, 201.284424f, 241.570862f, 46.2262573f); + TestUtils.AreEqual(r2, a2 - b2); + + float2x4 a3 = float2x4(136.607971f, 336.589722f, -51.8765564f, 317.345764f, -467.055939f, -50.1670532f, 477.804565f, -60.82193f); + float b3 = (-19.7322083f); + float2x4 r3 = float2x4(156.340179f, 356.32193f, -32.14435f, 337.077972f, -447.32373f, -30.434845f, 497.536774f, -41.08972f); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void float2x4_operator_sub_scalar_wide() + { + float a0 = (-86.00824f); + float2x4 b0 = float2x4(466.4251f, 298.486938f, -300.9501f, 315.38f, -381.092163f, -125.008362f, 58.4661865f, 214.7461f); + float2x4 r0 = float2x4(-552.43335f, -384.495178f, 214.941864f, -401.388245f, 295.083923f, 39.0001221f, -144.474426f, -300.754333f); + TestUtils.AreEqual(r0, a0 - b0); + + float a1 = (-257.549438f); + float2x4 b1 = float2x4(480.2246f, -443.355072f, 260.795044f, 29.6819458f, 139.857727f, -247.789948f, -248.466217f, 91.44513f); + float2x4 r1 = float2x4(-737.774048f, 185.805634f, -518.3445f, -287.231384f, -397.407166f, -9.759491f, -9.083221f, -348.994568f); + TestUtils.AreEqual(r1, a1 - b1); + + float a2 = (86.3841553f); + float2x4 b2 = float2x4(373.8183f, 260.411926f, 114.353943f, -464.405457f, -109.741455f, -311.675354f, 107.864014f, -258.795166f); + float2x4 r2 = float2x4(-287.434143f, -174.027771f, -27.9697876f, 550.7896f, 196.12561f, 398.0595f, -21.4798584f, 345.179321f); + TestUtils.AreEqual(r2, a2 - b2); + + float a3 = (14.0975342f); + float2x4 b3 = float2x4(-461.970184f, 30.3108521f, 63.70111f, -462.676758f, 39.75946f, 47.99817f, -177.6193f, 202.477051f); + float2x4 r3 = float2x4(476.067719f, -16.2133179f, -49.6035767f, 476.7743f, -25.6619263f, -33.9006348f, 191.716827f, -188.379517f); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void float2x4_operator_mul_wide_wide() + { + float2x4 a0 = float2x4(-482.7138f, -407.2935f, 137.700562f, 208.541138f, 194.29657f, -484.242432f, 183.9873f, -241.33548f); + float2x4 b0 = float2x4(-236.367889f, 260.7276f, -416.3863f, -364.4956f, -253.147522f, -369.202881f, 193.547913f, 169.0849f); + float2x4 r0 = float2x4(114098.047f, -106192.656f, -57336.625f, -76012.33f, -49185.6953f, 178783.7f, 35610.36f, -40806.1836f); + TestUtils.AreEqual(r0, a0 * b0); + + float2x4 a1 = float2x4(45.8687744f, 363.3261f, -328.118958f, -471.023071f, -262.682556f, -379.262756f, -374.090576f, 481.4474f); + float2x4 b1 = float2x4(201.969666f, 249.456055f, -308.193176f, -385.579651f, -183.2796f, 22.2756348f, -265.521423f, -95.67746f); + float2x4 r1 = float2x4(9264.101f, 90633.9f, 101124.023f, 181616.9f, 48144.3555f, -8448.318f, 99329.06f, -46063.6641f); + TestUtils.AreEqual(r1, a1 * b1); + + float2x4 a2 = float2x4(104.628052f, 412.935425f, 477.877258f, 20.3778076f, 291.995972f, -138.488312f, -393.464966f, 9.363098f); + float2x4 b2 = float2x4(133.2544f, 148.311462f, 249.284119f, 500.0055f, -19.3315735f, -36.69107f, 30.5238037f, -401.367f); + float2x4 r2 = float2x4(13942.1475f, 61243.06f, 119127.211f, 10189.0156f, -5644.7417f, 5081.284f, -12010.0479f, -3758.03857f); + TestUtils.AreEqual(r2, a2 * b2); + + float2x4 a3 = float2x4(-131.942291f, 364.449646f, 390.615967f, 418.797974f, -277.3448f, 11.4101563f, 474.876465f, -502.405029f); + float2x4 b3 = float2x4(3.43725586f, 257.24176f, -290.971924f, 337.47937f, 490.286133f, -191.0198f, -325.7345f, -52.1819763f); + float2x4 r3 = float2x4(-453.5194f, 93751.67f, -113658.281f, 141335.672f, -135978.3f, -2179.566f, -154683.641f, 26216.4883f); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void float2x4_operator_mul_wide_scalar() + { + float2x4 a0 = float2x4(-96.31882f, -277.142273f, -239.93689f, 509.531433f, 255.8581f, 215.7315f, -455.50827f, -389.2433f); + float b0 = (-301.2072f); + float2x4 r0 = float2x4(29011.9219f, 83477.25f, 72270.72f, -153474.547f, -77066.3047f, -64979.8867f, 137202.375f, 117242.883f); + TestUtils.AreEqual(r0, a0 * b0); + + float2x4 a1 = float2x4(-338.29248f, 243.757324f, 135.354675f, -207.3501f, -383.9396f, -31.4252319f, 42.6761475f, 260.38385f); + float b1 = (53.7962646f); + float2x4 r1 = float2x4(-18198.8711f, 13113.2334f, 7281.576f, -11154.6611f, -20654.5176f, -1690.56f, 2295.81738f, 14007.6787f); + TestUtils.AreEqual(r1, a1 * b1); + + float2x4 a2 = float2x4(176.867554f, -290.5006f, 207.091f, -156.523315f, -208.402008f, 370.945068f, -341.59845f, 10.2703247f); + float b2 = (25.67212f); + float2x4 r2 = float2x4(4540.565f, -7457.766f, 5316.465f, -4018.28516f, -5350.121f, 9522.946f, -8769.556f, 263.661f); + TestUtils.AreEqual(r2, a2 * b2); + + float2x4 a3 = float2x4(-176.888763f, 186.279785f, -487.652222f, -129.376831f, -317.7163f, -207.62735f, 388.8714f, -233.335327f); + float b3 = (-61.0061035f); + float2x4 r3 = float2x4(10791.2939f, -11364.2041f, 29749.7617f, 7892.77637f, 19382.6348f, 12666.5352f, -23723.53f, 14234.8789f); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void float2x4_operator_mul_scalar_wide() + { + float a0 = (37.43219f); + float2x4 b0 = float2x4(96.74756f, 492.185364f, -274.054565f, -452.870972f, 420.853333f, 102.182922f, -114.948883f, -351.120056f); + float2x4 r0 = float2x4(3621.473f, 18423.5762f, -10258.4629f, -16951.9531f, 15753.4619f, 3824.93066f, -4302.78857f, -13143.1924f); + TestUtils.AreEqual(r0, a0 * b0); + + float a1 = (-464.664978f); + float2x4 b1 = float2x4(444.084839f, 447.1053f, 130.829346f, -321.41333f, 445.301331f, 478.2436f, 358.571716f, -144.8901f); + float2x4 r1 = float2x4(-206350.672f, -207754.172f, -60791.8164f, 149349.516f, -206915.938f, -222223.047f, -166615.719f, 67325.36f); + TestUtils.AreEqual(r1, a1 * b1); + + float a2 = (-438.893829f); + float2x4 b2 = float2x4(-3.536438f, -471.807556f, -42.5603943f, 119.911072f, 271.900024f, 239.684021f, 487.4414f, -79.18829f); + float2x4 r2 = float2x4(1552.12085f, 207073.422f, 18679.4941f, -52628.23f, -119335.242f, -105195.836f, -213935.031f, 34755.2539f); + TestUtils.AreEqual(r2, a2 * b2); + + float a3 = (-112.925659f); + float2x4 b3 = float2x4(161.370056f, 459.759155f, -337.195984f, -276.834534f, 469.723877f, -274.565155f, 506.7859f, 65.88257f); + float2x4 r3 = float2x4(-18222.82f, -51918.6055f, 38078.08f, 31261.7227f, -53043.88f, 31005.4512f, -57229.13f, -7439.83252f); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void float2x4_operator_div_wide_wide() + { + float2x4 a0 = float2x4(-353.131439f, -102.799866f, 51.3191528f, -191.871674f, 8.041809f, -128.73764f, -136.0596f, -370.471f); + float2x4 b0 = float2x4(-178.739563f, -302.096283f, -199.405823f, 278.850769f, 502.3376f, -361.484833f, 353.121033f, -38.894928f); + float2x4 r0 = float2x4(1.97567582f, 0.34028843f, -0.257360339f, -0.688080132f, 0.0160087738f, 0.356135666f, -0.385305852f, 9.524919f); + TestUtils.AreEqual(r0, a0 / b0); + + float2x4 a1 = float2x4(-237.69455f, -432.546875f, 200.2655f, 361.4416f, -416.226135f, -450.0192f, -273.497437f, -286.908173f); + float2x4 b1 = float2x4(-75.76474f, -195.217834f, -405.034f, -394.23f, -375.8277f, -121.245483f, 447.623352f, 338.286255f); + float2x4 r1 = float2x4(3.1372714f, 2.215714f, -0.4944412f, -0.9168292f, 1.107492f, 3.71163678f, -0.610999048f, -0.8481225f); + TestUtils.AreEqual(r1, a1 / b1); + + float2x4 a2 = float2x4(-314.256042f, 177.762085f, 97.6270142f, -68.10727f, -386.450745f, 263.699341f, -297.0271f, -501.777039f); + float2x4 b2 = float2x4(-405.5442f, -431.168945f, 296.205139f, 437.939819f, 39.2106323f, 331.289734f, -310.619568f, 207.26947f); + float2x4 r2 = float2x4(0.7748996f, -0.412279427f, 0.3295926f, -0.155517414f, -9.855764f, 0.795978f, 0.9562408f, -2.42089224f); + TestUtils.AreEqual(r2, a2 / b2); + + float2x4 a3 = float2x4(-263.40686f, -451.080841f, -416.34552f, -315.278748f, -28.1811218f, -397.870148f, -261.386658f, 40.3482056f); + float2x4 b3 = float2x4(-223.293f, -480.0914f, 448.675964f, -460.097443f, -220.569855f, -84.85315f, 441.373779f, 72.41846f); + float2x4 r3 = float2x4(1.17964673f, 0.9395729f, -0.9279426f, 0.6852434f, 0.127765059f, 4.688926f, -0.592211545f, 0.557153642f); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void float2x4_operator_div_wide_scalar() + { + float2x4 a0 = float2x4(171.3424f, 0.103393555f, 57.8882446f, -256.130737f, 95.66968f, -290.3869f, -127.4487f, -79.7449f); + float b0 = (171.796814f); + float2x4 r0 = float2x4(0.997355f, 0.000601836247f, 0.3369576f, -1.49089336f, 0.5568769f, -1.69029272f, -0.7418572f, -0.4641815f); + TestUtils.AreEqual(r0, a0 / b0); + + float2x4 a1 = float2x4(146.466858f, 58.68634f, -453.2058f, -205.033813f, 481.738159f, 464.479065f, -293.4635f, -158.505585f); + float b1 = (-499.843567f); + float2x4 r1 = float2x4(-0.2930254f, -0.117409416f, 0.9066953f, 0.410195976f, -0.96377784f, -0.929248869f, 0.5871107f, 0.3171104f); + TestUtils.AreEqual(r1, a1 / b1); + + float2x4 a2 = float2x4(-289.5822f, 203.583435f, 180.9704f, 259.1192f, 460.844727f, 490.956238f, -280.478058f, -320.243866f); + float b2 = (494.1286f); + float2x4 r2 = float2x4(-0.5860463f, 0.412004948f, 0.366241485f, 0.5243963f, 0.932641268f, 0.993579865f, -0.5676216f, -0.64809823f); + TestUtils.AreEqual(r2, a2 / b2); + + float2x4 a3 = float2x4(192.41449f, 226.852966f, -192.235687f, 460.9765f, -437.8922f, -413.232727f, 249.471863f, 313.035034f); + float b3 = (264.800842f); + float2x4 r3 = float2x4(0.7266385f, 0.8566928f, -0.7259633f, 1.74084222f, -1.65366626f, -1.56054163f, 0.9421113f, 1.18215275f); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void float2x4_operator_div_scalar_wide() + { + float a0 = (-264.4425f); + float2x4 b0 = float2x4(105.589111f, -142.349091f, -288.9489f, 39.644104f, -363.9914f, -149.718231f, -395.729126f, 258.7187f); + float2x4 r0 = float2x4(-2.50444865f, 1.85770416f, 0.9151877f, -6.670412f, 0.7265076f, 1.7662679f, 0.6682412f, -1.02212369f); + TestUtils.AreEqual(r0, a0 / b0); + + float a1 = (-9.66626f); + float2x4 b1 = float2x4(117.725525f, -331.386536f, -509.986023f, 427.896484f, 467.617126f, -407.124634f, 252.690735f, 444.599365f); + float2x4 r1 = float2x4(-0.0821084455f, 0.0291691385f, 0.01895397f, -0.0225901827f, -0.0206713118f, 0.023742754f, -0.0382533222f, -0.0217415057f); + TestUtils.AreEqual(r1, a1 / b1); + + float a2 = (-88.31329f); + float2x4 b2 = float2x4(199.955017f, -218.346924f, -13.4171753f, -296.131073f, 0.561340332f, -289.299316f, 196.218323f, 334.733459f); + float2x4 r2 = float2x4(-0.4416658f, 0.4044632f, 6.58210754f, 0.298223674f, -157.32576f, 0.305266172f, -0.4500767f, -0.263831675f); + TestUtils.AreEqual(r2, a2 / b2); + + float a3 = (-282.392731f); + float2x4 b3 = float2x4(-479.5036f, -473.439453f, 105.050781f, -287.6313f, 77.29932f, -210.894379f, -184.068237f, -315.148438f); + float2x4 r3 = float2x4(0.5889272f, 0.596470654f, -2.68815446f, 0.981787264f, -3.653237f, 1.33902442f, 1.5341742f, 0.8960626f); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void float2x4_operator_mod_wide_wide() + { + float2x4 a0 = float2x4(-388.8125f, 181.681213f, -167.078735f, 432.820129f, -258.438965f, -170.110809f, 283.3183f, 122.716492f); + float2x4 b0 = float2x4(436.944153f, 58.9400635f, -201.116241f, 279.289368f, -397.079773f, 377.899963f, 174.693848f, -228.176514f); + float2x4 r0 = float2x4(-388.8125f, 4.861023f, -167.078735f, 153.530762f, -258.438965f, -170.110809f, 108.624451f, 122.716492f); + TestUtils.AreEqual(r0, a0 % b0); + + float2x4 a1 = float2x4(335.271f, -503.608521f, 191.022522f, 289.742676f, -124.033722f, 259.274f, -274.358459f, -140.030792f); + float2x4 b1 = float2x4(-317.060181f, -417.4801f, -249.975952f, -397.571564f, -358.745453f, -198.15921f, 208.737122f, -12.1194153f); + float2x4 r1 = float2x4(18.2108154f, -86.12842f, 191.022522f, 289.742676f, -124.033722f, 61.1147766f, -65.62134f, -6.717224f); + TestUtils.AreEqual(r1, a1 % b1); + + float2x4 a2 = float2x4(324.577576f, -200.513092f, 211.423157f, -51.2722168f, -230.633911f, 99.98938f, 399.18988f, 24.90326f); + float2x4 b2 = float2x4(25.2714233f, -194.1207f, -493.8718f, -312.3017f, -216.980591f, 413.570984f, -436.3944f, 3.491272f); + float2x4 r2 = float2x4(21.3204956f, -6.392395f, 211.423157f, -51.2722168f, -13.65332f, 99.98938f, 399.18988f, 0.464355469f); + TestUtils.AreEqual(r2, a2 % b2); + + float2x4 a3 = float2x4(50.92401f, -364.863678f, -252.626617f, -281.2898f, -364.798523f, -329.026245f, 51.6098022f, 41.6478271f); + float2x4 b3 = float2x4(-308.233429f, -441.375061f, 84.60083f, 373.163452f, 67.25275f, -320.333282f, 118.97937f, 44.8239746f); + float2x4 r3 = float2x4(50.92401f, -364.863678f, -83.42496f, -281.2898f, -28.53479f, -8.692963f, 51.6098022f, 41.6478271f); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void float2x4_operator_mod_wide_scalar() + { + float2x4 a0 = float2x4(-244.499634f, -211.8193f, -145.926788f, -304.9182f, 155.479492f, -133.907776f, 281.309631f, -226.535767f); + float b0 = (39.63495f); + float2x4 r0 = float2x4(-6.68994141f, -13.6445618f, -27.0219421f, -27.4735718f, 36.574646f, -15.00293f, 3.86499023f, -28.3610229f); + TestUtils.AreEqual(r0, a0 % b0); + + float2x4 a1 = float2x4(335.166138f, 319.4715f, -285.4023f, -355.846863f, 259.378f, -330.871948f, -284.343567f, -102.683441f); + float b1 = (101.706482f); + float2x4 r1 = float2x4(30.0466919f, 14.3520508f, -81.98935f, -50.727417f, 55.9650269f, -25.7525024f, -80.9306f, -0.9769592f); + TestUtils.AreEqual(r1, a1 % b1); + + float2x4 a2 = float2x4(-172.141754f, -416.713654f, -339.256653f, 435.2975f, 132.552917f, 226.944092f, -306.1183f, 115.438477f); + float b2 = (206.41687f); + float2x4 r2 = float2x4(-172.141754f, -3.87991333f, -132.839783f, 22.4637451f, 132.552917f, 20.5272217f, -99.701416f, 115.438477f); + TestUtils.AreEqual(r2, a2 % b2); + + float2x4 a3 = float2x4(281.882935f, -140.0405f, -462.3235f, -211.6087f, 351.331055f, 321.047f, 346.0852f, -94.4077454f); + float b3 = (-218.347443f); + float2x4 r3 = float2x4(63.5354919f, -140.0405f, -25.6286011f, -211.6087f, 132.983612f, 102.699554f, 127.737762f, -94.4077454f); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void float2x4_operator_mod_scalar_wide() + { + float a0 = (-66.94504f); + float2x4 b0 = float2x4(-249.7761f, -396.073761f, 386.492065f, 168.939453f, -199.418243f, 261.7517f, 16.1274414f, 257.668152f); + float2x4 r0 = float2x4(-66.94504f, -66.94504f, -66.94504f, -66.94504f, -66.94504f, -66.94504f, -2.43527222f, -66.94504f); + TestUtils.AreEqual(r0, a0 % b0); + + float a1 = (-75.78845f); + float2x4 b1 = float2x4(170.9563f, -242.858276f, 425.9453f, 303.2724f, 3.033081f, -505.74353f, 461.957031f, 205.972778f); + float2x4 r1 = float2x4(-75.78845f, -75.78845f, -75.78845f, -75.78845f, -2.99450684f, -75.78845f, -75.78845f, -75.78845f); + TestUtils.AreEqual(r1, a1 % b1); + + float a2 = (270.040649f); + float2x4 b2 = float2x4(-47.4807129f, -150.254486f, 149.499512f, -220.298035f, 31.1188354f, 400.635681f, 6.23144531f, -39.05075f); + float2x4 r2 = float2x4(32.637085f, 119.786163f, 120.541138f, 49.7426147f, 21.0899658f, 270.040649f, 2.088501f, 35.736145f); + TestUtils.AreEqual(r2, a2 % b2); + + float a3 = (-71.9411f); + float2x4 b3 = float2x4(-495.307129f, -86.7196045f, -436.970062f, -472.294739f, -130.008759f, -251.516846f, 281.976379f, 388.86084f); + float2x4 r3 = float2x4(-71.9411f, -71.9411f, -71.9411f, -71.9411f, -71.9411f, -71.9411f, -71.9411f, -71.9411f); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void float2x4_operator_plus() + { + float2x4 a0 = float2x4(-418.829559f, -405.79895f, -34.04178f, 236.999268f, -459.8391f, 210.86145f, 293.742f, -373.015442f); + float2x4 r0 = float2x4(-418.829559f, -405.79895f, -34.04178f, 236.999268f, -459.8391f, 210.86145f, 293.742f, -373.015442f); + TestUtils.AreEqual(r0, +a0); + + float2x4 a1 = float2x4(-386.059845f, -418.645264f, 504.474854f, -170.746521f, 439.5594f, -478.7494f, 116.400757f, 421.409668f); + float2x4 r1 = float2x4(-386.059845f, -418.645264f, 504.474854f, -170.746521f, 439.5594f, -478.7494f, 116.400757f, 421.409668f); + TestUtils.AreEqual(r1, +a1); + + float2x4 a2 = float2x4(-258.596069f, 124.164368f, 222.172546f, -65.94928f, 239.041809f, 498.449524f, -139.382538f, 279.072937f); + float2x4 r2 = float2x4(-258.596069f, 124.164368f, 222.172546f, -65.94928f, 239.041809f, 498.449524f, -139.382538f, 279.072937f); + TestUtils.AreEqual(r2, +a2); + + float2x4 a3 = float2x4(108.775818f, 136.812134f, -236.030029f, -440.308319f, 342.2791f, 102.472229f, -161.454834f, -355.270874f); + float2x4 r3 = float2x4(108.775818f, 136.812134f, -236.030029f, -440.308319f, 342.2791f, 102.472229f, -161.454834f, -355.270874f); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void float2x4_operator_neg() + { + float2x4 a0 = float2x4(148.461731f, -467.122681f, 132.04718f, 183.522644f, 473.701f, -407.9911f, -54.95877f, -382.9898f); + float2x4 r0 = float2x4(-148.461731f, 467.122681f, -132.04718f, -183.522644f, -473.701f, 407.9911f, 54.95877f, 382.9898f); + TestUtils.AreEqual(r0, -a0); + + float2x4 a1 = float2x4(-299.093384f, 407.709778f, 168.735474f, 466.441528f, 171.902466f, -280.558319f, -78.857605f, 318.69635f); + float2x4 r1 = float2x4(299.093384f, -407.709778f, -168.735474f, -466.441528f, -171.902466f, 280.558319f, 78.857605f, -318.69635f); + TestUtils.AreEqual(r1, -a1); + + float2x4 a2 = float2x4(-39.9154053f, 132.195618f, -505.895264f, 410.380554f, -237.056946f, -137.617828f, -245.349976f, 422.521362f); + float2x4 r2 = float2x4(39.9154053f, -132.195618f, 505.895264f, -410.380554f, 237.056946f, 137.617828f, 245.349976f, -422.521362f); + TestUtils.AreEqual(r2, -a2); + + float2x4 a3 = float2x4(-434.57135f, -466.5663f, 426.894531f, 146.649536f, -391.37207f, 423.237732f, 254.297546f, -114.848907f); + float2x4 r3 = float2x4(434.57135f, 466.5663f, -426.894531f, -146.649536f, 391.37207f, -423.237732f, -254.297546f, 114.848907f); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void float2x4_operator_prefix_inc() + { + float2x4 a0 = float2x4(-139.842072f, -56.7436523f, -381.955322f, 509.796326f, -222.896332f, 210.319885f, -392.7315f, -300.1941f); + float2x4 r0 = float2x4(-138.842072f, -55.7436523f, -380.955322f, 510.796326f, -221.896332f, 211.319885f, -391.7315f, -299.1941f); + TestUtils.AreEqual(r0, ++a0); + + float2x4 a1 = float2x4(362.212769f, 130.90918f, -450.230164f, 243.546936f, 46.1920166f, -41.4972839f, 299.1855f, 154.356567f); + float2x4 r1 = float2x4(363.212769f, 131.90918f, -449.230164f, 244.546936f, 47.1920166f, -40.4972839f, 300.1855f, 155.356567f); + TestUtils.AreEqual(r1, ++a1); + + float2x4 a2 = float2x4(-281.233276f, 92.95776f, 448.602173f, -295.587f, 18.4990845f, -215.711121f, 471.947266f, 257.0766f); + float2x4 r2 = float2x4(-280.233276f, 93.95776f, 449.602173f, -294.587f, 19.4990845f, -214.711121f, 472.947266f, 258.0766f); + TestUtils.AreEqual(r2, ++a2); + + float2x4 a3 = float2x4(41.6259155f, 243.004761f, -472.619019f, -125.720215f, -477.459564f, 9.89147949f, -76.92285f, -29.7675781f); + float2x4 r3 = float2x4(42.6259155f, 244.004761f, -471.619019f, -124.720215f, -476.459564f, 10.8914795f, -75.92285f, -28.7675781f); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void float2x4_operator_postfix_inc() + { + float2x4 a0 = float2x4(-396.669739f, 511.20752f, 249.111267f, -128.817322f, -259.4903f, 278.008179f, -81.39343f, 66.71973f); + float2x4 r0 = float2x4(-396.669739f, 511.20752f, 249.111267f, -128.817322f, -259.4903f, 278.008179f, -81.39343f, 66.71973f); + TestUtils.AreEqual(r0, a0++); + + float2x4 a1 = float2x4(167.852112f, -326.1076f, 41.03357f, 128.5304f, 73.15558f, -60.1323853f, -446.229767f, -296.937836f); + float2x4 r1 = float2x4(167.852112f, -326.1076f, 41.03357f, 128.5304f, 73.15558f, -60.1323853f, -446.229767f, -296.937836f); + TestUtils.AreEqual(r1, a1++); + + float2x4 a2 = float2x4(267.293823f, 49.2001953f, -326.643127f, -510.864227f, 471.647461f, -171.013092f, 310.727356f, -298.917175f); + float2x4 r2 = float2x4(267.293823f, 49.2001953f, -326.643127f, -510.864227f, 471.647461f, -171.013092f, 310.727356f, -298.917175f); + TestUtils.AreEqual(r2, a2++); + + float2x4 a3 = float2x4(489.985f, 290.69104f, 117.192322f, 164.442932f, 412.3678f, -229.386566f, 239.596924f, 36.62433f); + float2x4 r3 = float2x4(489.985f, 290.69104f, 117.192322f, 164.442932f, 412.3678f, -229.386566f, 239.596924f, 36.62433f); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void float2x4_operator_prefix_dec() + { + float2x4 a0 = float2x4(123.128723f, 256.84375f, 156.330811f, 461.737427f, 325.867981f, 392.015625f, 187.874146f, -236.225189f); + float2x4 r0 = float2x4(122.128723f, 255.84375f, 155.330811f, 460.737427f, 324.867981f, 391.015625f, 186.874146f, -237.225189f); + TestUtils.AreEqual(r0, --a0); + + float2x4 a1 = float2x4(125.109619f, 45.5366821f, 376.046875f, -363.0755f, -22.0289612f, 248.7901f, 168.095032f, 168.265625f); + float2x4 r1 = float2x4(124.109619f, 44.5366821f, 375.046875f, -364.0755f, -23.0289612f, 247.7901f, 167.095032f, 167.265625f); + TestUtils.AreEqual(r1, --a1); + + float2x4 a2 = float2x4(-190.284729f, 183.957947f, 485.6947f, -460.739319f, 89.5698853f, -267.4298f, 201.756226f, -141.216888f); + float2x4 r2 = float2x4(-191.284729f, 182.957947f, 484.6947f, -461.739319f, 88.5698853f, -268.4298f, 200.756226f, -142.216888f); + TestUtils.AreEqual(r2, --a2); + + float2x4 a3 = float2x4(-217.4841f, -213.544128f, 180.7406f, -128.3125f, 478.045532f, -454.566132f, -386.898346f, 387.857f); + float2x4 r3 = float2x4(-218.4841f, -214.544128f, 179.7406f, -129.3125f, 477.045532f, -455.566132f, -387.898346f, 386.857f); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void float2x4_operator_postfix_dec() + { + float2x4 a0 = float2x4(379.6883f, 302.692871f, -176.07135f, -291.2527f, 470.567566f, -402.925964f, -63.65515f, 355.2611f); + float2x4 r0 = float2x4(379.6883f, 302.692871f, -176.07135f, -291.2527f, 470.567566f, -402.925964f, -63.65515f, 355.2611f); + TestUtils.AreEqual(r0, a0--); + + float2x4 a1 = float2x4(-27.8892212f, 156.14032f, 479.9452f, -200.304291f, -445.026947f, 407.420349f, 327.670349f, 48.06018f); + float2x4 r1 = float2x4(-27.8892212f, 156.14032f, 479.9452f, -200.304291f, -445.026947f, 407.420349f, 327.670349f, 48.06018f); + TestUtils.AreEqual(r1, a1--); + + float2x4 a2 = float2x4(-209.667969f, 283.9416f, -94.80209f, 152.510681f, -287.2625f, -215.948029f, -407.046356f, 159.233582f); + float2x4 r2 = float2x4(-209.667969f, 283.9416f, -94.80209f, 152.510681f, -287.2625f, -215.948029f, -407.046356f, 159.233582f); + TestUtils.AreEqual(r2, a2--); + + float2x4 a3 = float2x4(-359.456482f, -278.933777f, 289.912842f, 402.039551f, 470.716553f, -208.560608f, 145.896729f, -296.790955f); + float2x4 r3 = float2x4(-359.456482f, -278.933777f, 289.912842f, 402.039551f, 470.716553f, -208.560608f, 145.896729f, -296.790955f); + TestUtils.AreEqual(r3, a3--); + } + + [TestCase /* For player builds */] + public static void float2x4_EqualsObjectOverride() + { + TestUtils.IsFalse(new float2x4().Equals((object)new int())); + TestUtils.IsTrue(new float2x4().Equals((object)new float2x4())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestFloat2x4.gen.cs.meta b/src/Tests/Tests/Shared/TestFloat2x4.gen.cs.meta new file mode 100644 index 00000000..6568ff0c --- /dev/null +++ b/src/Tests/Tests/Shared/TestFloat2x4.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b3517a3babe572246a5b80234b2f8a4b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestFloat3.gen.cs b/src/Tests/Tests/Shared/TestFloat3.gen.cs new file mode 100644 index 00000000..29bbf5a0 --- /dev/null +++ b/src/Tests/Tests/Shared/TestFloat3.gen.cs @@ -0,0 +1,1069 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestFloat3 + { + [TestCompiler] + public static void float3_zero() + { + TestUtils.AreEqual(0.0f, float3.zero.x); + TestUtils.AreEqual(0.0f, float3.zero.y); + TestUtils.AreEqual(0.0f, float3.zero.z); + } + + [TestCompiler] + public static void float3_constructor() + { + float3 a = new float3(1, 2, 3); + TestUtils.AreEqual(1, a.x); + TestUtils.AreEqual(2, a.y); + TestUtils.AreEqual(3, a.z); + } + + [TestCompiler] + public static void float3_scalar_constructor() + { + float3 a = new float3(17.0f); + TestUtils.AreEqual(17.0f, a.x); + TestUtils.AreEqual(17.0f, a.y); + TestUtils.AreEqual(17.0f, a.z); + } + + [TestCompiler] + public static void float3_static_constructor() + { + float3 a = float3(1, 2, 3); + TestUtils.AreEqual(1, a.x); + TestUtils.AreEqual(2, a.y); + TestUtils.AreEqual(3, a.z); + } + + [TestCompiler] + public static void float3_static_scalar_constructor() + { + float3 a = float3(17.0f); + TestUtils.AreEqual(17.0f, a.x); + TestUtils.AreEqual(17.0f, a.y); + TestUtils.AreEqual(17.0f, a.z); + } + + [TestCompiler] + public static void float3_operator_equal_wide_wide() + { + float3 a0 = float3(492.1576f, -495.206329f, 227.457642f); + float3 b0 = float3(192.568787f, -235.611023f, -254.043121f); + bool3 r0 = bool3(false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + float3 a1 = float3(-147.374054f, -222.682f, 64.09375f); + float3 b1 = float3(-412.624725f, 471.9048f, -6.47277832f); + bool3 r1 = bool3(false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + float3 a2 = float3(-23.8904114f, -16.8197327f, 163.232117f); + float3 b2 = float3(-339.102356f, 488.187561f, -379.5966f); + bool3 r2 = bool3(false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + float3 a3 = float3(-165.271f, 470.8777f, -423.942566f); + float3 b3 = float3(-308.417f, -82.333374f, -102.921082f); + bool3 r3 = bool3(false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void float3_operator_equal_wide_scalar() + { + float3 a0 = float3(-303.230072f, 451.5263f, -253.655884f); + float b0 = (123.544556f); + bool3 r0 = bool3(false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + float3 a1 = float3(-105.203644f, -426.192474f, 159.8761f); + float b1 = (-500.6911f); + bool3 r1 = bool3(false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + float3 a2 = float3(-59.55838f, -182.049744f, 406.513733f); + float b2 = (-57.4773865f); + bool3 r2 = bool3(false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + float3 a3 = float3(370.886f, 455.400024f, -11.3389893f); + float b3 = (-172.035309f); + bool3 r3 = bool3(false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void float3_operator_equal_scalar_wide() + { + float a0 = (-253.397278f); + float3 b0 = float3(19.95221f, -185.791992f, 407.8136f); + bool3 r0 = bool3(false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + float a1 = (-87.2767f); + float3 b1 = float3(-206.274689f, 160.503113f, -274.7708f); + bool3 r1 = bool3(false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + float a2 = (-2.63153076f); + float3 b2 = float3(448.354553f, -410.035248f, 247.329041f); + bool3 r2 = bool3(false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + float a3 = (355.539124f); + float3 b3 = float3(-298.0667f, 414.1015f, -481.3026f); + bool3 r3 = bool3(false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void float3_operator_not_equal_wide_wide() + { + float3 a0 = float3(430.842529f, 104.69f, 225.802429f); + float3 b0 = float3(210.024719f, -55.20334f, -269.925354f); + bool3 r0 = bool3(true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + float3 a1 = float3(-310.5702f, -418.619446f, 304.128174f); + float3 b1 = float3(-234.546722f, 25.91742f, -63.72699f); + bool3 r1 = bool3(true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + float3 a2 = float3(-509.3268f, -160.538086f, -203.301971f); + float3 b2 = float3(-484.5537f, -425.3336f, -53.2743835f); + bool3 r2 = bool3(true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + float3 a3 = float3(-505.763245f, 162.17218f, 1.156189f); + float3 b3 = float3(328.1944f, 15.9631348f, 461.7141f); + bool3 r3 = bool3(true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void float3_operator_not_equal_wide_scalar() + { + float3 a0 = float3(-16.9145813f, 168.8341f, -462.713531f); + float b0 = (-145.372772f); + bool3 r0 = bool3(true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + float3 a1 = float3(130.307739f, -440.263275f, -197.12796f); + float b1 = (214.501587f); + bool3 r1 = bool3(true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + float3 a2 = float3(-169.099854f, -281.021f, -270.26886f); + float b2 = (-386.611176f); + bool3 r2 = bool3(true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + float3 a3 = float3(-403.9637f, 299.654236f, -71.7509155f); + float b3 = (-269.805725f); + bool3 r3 = bool3(true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void float3_operator_not_equal_scalar_wide() + { + float a0 = (275.795837f); + float3 b0 = float3(-57.1969f, -382.432526f, 97.82037f); + bool3 r0 = bool3(true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + float a1 = (-161.463654f); + float3 b1 = float3(-458.39563f, -499.617859f, 327.92218f); + bool3 r1 = bool3(true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + float a2 = (367.571228f); + float3 b2 = float3(59.786377f, -209.580688f, -62.5804443f); + bool3 r2 = bool3(true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + float a3 = (-479.974976f); + float3 b3 = float3(-49.4945068f, -114.685211f, 109.93927f); + bool3 r3 = bool3(true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void float3_operator_less_wide_wide() + { + float3 a0 = float3(196.84259f, 336.4098f, 251.963745f); + float3 b0 = float3(-465.345032f, -256.1524f, -314.814026f); + bool3 r0 = bool3(false, false, false); + TestUtils.AreEqual(r0, a0 < b0); + + float3 a1 = float3(257.655945f, 430.0459f, -62.4196472f); + float3 b1 = float3(364.5667f, 100.21051f, 182.560974f); + bool3 r1 = bool3(true, false, true); + TestUtils.AreEqual(r1, a1 < b1); + + float3 a2 = float3(8.839233f, -333.8167f, 164.678833f); + float3 b2 = float3(3.11700439f, -259.430481f, -437.3349f); + bool3 r2 = bool3(false, true, false); + TestUtils.AreEqual(r2, a2 < b2); + + float3 a3 = float3(-350.9449f, 3.84143066f, 125.409729f); + float3 b3 = float3(-456.043732f, -394.255981f, 401.9137f); + bool3 r3 = bool3(false, false, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void float3_operator_less_wide_scalar() + { + float3 a0 = float3(-132.057312f, -192.465f, -66.8345947f); + float b0 = (-156.010223f); + bool3 r0 = bool3(false, true, false); + TestUtils.AreEqual(r0, a0 < b0); + + float3 a1 = float3(-379.017517f, 20.9278564f, -158.240753f); + float b1 = (-360.2824f); + bool3 r1 = bool3(true, false, false); + TestUtils.AreEqual(r1, a1 < b1); + + float3 a2 = float3(437.3459f, 225.2915f, 307.4842f); + float b2 = (-20.4526062f); + bool3 r2 = bool3(false, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + float3 a3 = float3(274.015259f, 398.523682f, 105.030151f); + float b3 = (373.549683f); + bool3 r3 = bool3(true, false, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void float3_operator_less_scalar_wide() + { + float a0 = (-423.1174f); + float3 b0 = float3(385.094849f, -123.933472f, 86.37659f); + bool3 r0 = bool3(true, true, true); + TestUtils.AreEqual(r0, a0 < b0); + + float a1 = (133.4422f); + float3 b1 = float3(161.457947f, 229.754272f, 222.5716f); + bool3 r1 = bool3(true, true, true); + TestUtils.AreEqual(r1, a1 < b1); + + float a2 = (315.5312f); + float3 b2 = float3(-447.203522f, 271.833862f, -393.605316f); + bool3 r2 = bool3(false, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + float a3 = (317.486877f); + float3 b3 = float3(-164.6051f, -282.876038f, 296.979553f); + bool3 r3 = bool3(false, false, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void float3_operator_greater_wide_wide() + { + float3 a0 = float3(483.5014f, 310.8156f, 106.966187f); + float3 b0 = float3(-471.398f, -371.9853f, 36.9006958f); + bool3 r0 = bool3(true, true, true); + TestUtils.AreEqual(r0, a0 > b0); + + float3 a1 = float3(295.7353f, 116.957581f, -478.299774f); + float3 b1 = float3(-316.7636f, 19.6830444f, 207.309143f); + bool3 r1 = bool3(true, true, false); + TestUtils.AreEqual(r1, a1 > b1); + + float3 a2 = float3(-14.8974f, -33.8174438f, -24.74054f); + float3 b2 = float3(362.7975f, 324.95343f, 340.948059f); + bool3 r2 = bool3(false, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + float3 a3 = float3(319.782654f, -120.158569f, -289.008575f); + float3 b3 = float3(25.9860229f, -114.211121f, 240.803467f); + bool3 r3 = bool3(true, false, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void float3_operator_greater_wide_scalar() + { + float3 a0 = float3(64.31793f, -397.703461f, 431.8769f); + float b0 = (305.859924f); + bool3 r0 = bool3(false, false, true); + TestUtils.AreEqual(r0, a0 > b0); + + float3 a1 = float3(85.703f, 197.491577f, 286.199463f); + float b1 = (246.263062f); + bool3 r1 = bool3(false, false, true); + TestUtils.AreEqual(r1, a1 > b1); + + float3 a2 = float3(280.813354f, 171.565369f, -241.807281f); + float b2 = (-405.7846f); + bool3 r2 = bool3(true, true, true); + TestUtils.AreEqual(r2, a2 > b2); + + float3 a3 = float3(333.5782f, -413.7014f, -356.592346f); + float b3 = (370.279175f); + bool3 r3 = bool3(false, false, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void float3_operator_greater_scalar_wide() + { + float a0 = (-282.6705f); + float3 b0 = float3(358.099976f, -72.596405f, -232.163788f); + bool3 r0 = bool3(false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + float a1 = (-60.7067261f); + float3 b1 = float3(75.15662f, 150.883484f, 339.539185f); + bool3 r1 = bool3(false, false, false); + TestUtils.AreEqual(r1, a1 > b1); + + float a2 = (-498.196045f); + float3 b2 = float3(459.7461f, -227.968719f, 335.862122f); + bool3 r2 = bool3(false, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + float a3 = (76.17883f); + float3 b3 = float3(296.859924f, 177.48999f, -281.2012f); + bool3 r3 = bool3(false, false, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void float3_operator_less_equal_wide_wide() + { + float3 a0 = float3(-438.523132f, 210.489441f, 4.87731934f); + float3 b0 = float3(-474.814148f, 304.371033f, 234.824158f); + bool3 r0 = bool3(false, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + float3 a1 = float3(-137.297943f, 156.094116f, -363.924133f); + float3 b1 = float3(-390.485443f, -297.175354f, -326.2924f); + bool3 r1 = bool3(false, false, true); + TestUtils.AreEqual(r1, a1 <= b1); + + float3 a2 = float3(-97.94849f, 437.2954f, 458.530273f); + float3 b2 = float3(107.253906f, -413.131073f, 67.09442f); + bool3 r2 = bool3(true, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + float3 a3 = float3(-294.064758f, 23.62262f, -34.2840576f); + float3 b3 = float3(470.075256f, -84.499115f, 392.784241f); + bool3 r3 = bool3(true, false, true); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void float3_operator_less_equal_wide_scalar() + { + float3 a0 = float3(193.49585f, 168.915527f, -313.993073f); + float b0 = (443.850525f); + bool3 r0 = bool3(true, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + float3 a1 = float3(81.8269653f, -0.3581848f, 241.361145f); + float b1 = (18.5036011f); + bool3 r1 = bool3(false, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + float3 a2 = float3(-463.8164f, -268.899475f, 398.991943f); + float b2 = (-1.35775757f); + bool3 r2 = bool3(true, true, false); + TestUtils.AreEqual(r2, a2 <= b2); + + float3 a3 = float3(-471.253082f, 82.2583f, 11.2460327f); + float b3 = (-264.9378f); + bool3 r3 = bool3(true, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void float3_operator_less_equal_scalar_wide() + { + float a0 = (393.606262f); + float3 b0 = float3(-75.6883545f, -44.2638855f, 125.864929f); + bool3 r0 = bool3(false, false, false); + TestUtils.AreEqual(r0, a0 <= b0); + + float a1 = (191.9649f); + float3 b1 = float3(13.54303f, -197.051941f, -423.9451f); + bool3 r1 = bool3(false, false, false); + TestUtils.AreEqual(r1, a1 <= b1); + + float a2 = (-330.0486f); + float3 b2 = float3(420.165527f, 105.5473f, 174.821289f); + bool3 r2 = bool3(true, true, true); + TestUtils.AreEqual(r2, a2 <= b2); + + float a3 = (296.7176f); + float3 b3 = float3(-469.7004f, 123.267212f, 112.996948f); + bool3 r3 = bool3(false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void float3_operator_greater_equal_wide_wide() + { + float3 a0 = float3(-507.9286f, 504.4975f, -385.4345f); + float3 b0 = float3(-81.3465f, 297.666138f, 171.06543f); + bool3 r0 = bool3(false, true, false); + TestUtils.AreEqual(r0, a0 >= b0); + + float3 a1 = float3(-262.323425f, -37.5509338f, -111.595276f); + float3 b1 = float3(-431.038055f, -6.85907f, 319.7257f); + bool3 r1 = bool3(true, false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + float3 a2 = float3(-463.702026f, 387.448853f, 456.9688f); + float3 b2 = float3(254.079163f, 396.5724f, 178.8393f); + bool3 r2 = bool3(false, false, true); + TestUtils.AreEqual(r2, a2 >= b2); + + float3 a3 = float3(-211.010162f, 182.411377f, -53.59604f); + float3 b3 = float3(-447.063354f, 288.492676f, 474.889282f); + bool3 r3 = bool3(true, false, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void float3_operator_greater_equal_wide_scalar() + { + float3 a0 = float3(465.152161f, -424.886078f, -209.2211f); + float b0 = (-5.599884f); + bool3 r0 = bool3(true, false, false); + TestUtils.AreEqual(r0, a0 >= b0); + + float3 a1 = float3(58.7798462f, 140.12561f, 16.3533936f); + float b1 = (-302.2691f); + bool3 r1 = bool3(true, true, true); + TestUtils.AreEqual(r1, a1 >= b1); + + float3 a2 = float3(-344.559967f, -315.701538f, 441.011536f); + float b2 = (393.278076f); + bool3 r2 = bool3(false, false, true); + TestUtils.AreEqual(r2, a2 >= b2); + + float3 a3 = float3(-509.781555f, 494.8203f, -164.973938f); + float b3 = (-36.9942932f); + bool3 r3 = bool3(false, true, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void float3_operator_greater_equal_scalar_wide() + { + float a0 = (374.827026f); + float3 b0 = float3(-1.60977173f, 338.615234f, -116.1814f); + bool3 r0 = bool3(true, true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + float a1 = (-332.157318f); + float3 b1 = float3(-355.97937f, -468.901428f, 38.579895f); + bool3 r1 = bool3(true, true, false); + TestUtils.AreEqual(r1, a1 >= b1); + + float a2 = (-332.347534f); + float3 b2 = float3(2.89013672f, 467.777771f, 121.406372f); + bool3 r2 = bool3(false, false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + float a3 = (-305.023376f); + float3 b3 = float3(-58.4288025f, -226.519562f, -47.0209961f); + bool3 r3 = bool3(false, false, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void float3_operator_add_wide_wide() + { + float3 a0 = float3(506.129028f, -501.779816f, 420.084778f); + float3 b0 = float3(-28.7579956f, -337.135132f, -340.676819f); + float3 r0 = float3(477.371033f, -838.9149f, 79.40796f); + TestUtils.AreEqual(r0, a0 + b0); + + float3 a1 = float3(-186.032074f, -9.312408f, 328.51178f); + float3 b1 = float3(152.312012f, 423.66748f, 90.3740845f); + float3 r1 = float3(-33.7200623f, 414.355072f, 418.885864f); + TestUtils.AreEqual(r1, a1 + b1); + + float3 a2 = float3(424.344055f, 87.79108f, 462.4137f); + float3 b2 = float3(376.18866f, 1.76721191f, -120.185852f); + float3 r2 = float3(800.5327f, 89.55829f, 342.227844f); + TestUtils.AreEqual(r2, a2 + b2); + + float3 a3 = float3(-46.17871f, 401.170044f, -454.124146f); + float3 b3 = float3(-279.629364f, -344.6671f, 242.839172f); + float3 r3 = float3(-325.808075f, 56.50293f, -211.284973f); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void float3_operator_add_wide_scalar() + { + float3 a0 = float3(-194.514191f, 338.5484f, 246.971375f); + float b0 = (124.121704f); + float3 r0 = float3(-70.39249f, 462.6701f, 371.093079f); + TestUtils.AreEqual(r0, a0 + b0); + + float3 a1 = float3(100.510925f, -478.1113f, 30.9161377f); + float b1 = (-45.72467f); + float3 r1 = float3(54.7862549f, -523.835938f, -14.8085327f); + TestUtils.AreEqual(r1, a1 + b1); + + float3 a2 = float3(60.37433f, 82.50134f, 6.79937744f); + float b2 = (-242.118744f); + float3 r2 = float3(-181.744415f, -159.6174f, -235.319366f); + TestUtils.AreEqual(r2, a2 + b2); + + float3 a3 = float3(-484.6998f, -213.526733f, -267.7843f); + float b3 = (-188.265015f); + float3 r3 = float3(-672.964844f, -401.791748f, -456.049316f); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void float3_operator_add_scalar_wide() + { + float a0 = (-340.354675f); + float3 b0 = float3(511.362244f, -146.216644f, -106.210419f); + float3 r0 = float3(171.007568f, -486.57132f, -446.5651f); + TestUtils.AreEqual(r0, a0 + b0); + + float a1 = (-363.450256f); + float3 b1 = float3(199.0896f, -27.1083984f, 419.849f); + float3 r1 = float3(-164.360657f, -390.558655f, 56.3987427f); + TestUtils.AreEqual(r1, a1 + b1); + + float a2 = (284.955017f); + float3 b2 = float3(-164.9242f, -249.190338f, 150.928162f); + float3 r2 = float3(120.030823f, 35.76468f, 435.883179f); + TestUtils.AreEqual(r2, a2 + b2); + + float a3 = (298.1751f); + float3 b3 = float3(-457.1534f, 424.718079f, -301.857483f); + float3 r3 = float3(-158.9783f, 722.8932f, -3.682373f); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void float3_operator_sub_wide_wide() + { + float3 a0 = float3(160.492249f, 11.223938f, 359.200134f); + float3 b0 = float3(115.46875f, -130.9823f, 241.540833f); + float3 r0 = float3(45.0235f, 142.206238f, 117.6593f); + TestUtils.AreEqual(r0, a0 - b0); + + float3 a1 = float3(-498.2283f, -355.253632f, -94.53485f); + float3 b1 = float3(9.987061f, 419.895142f, 59.12445f); + float3 r1 = float3(-508.215363f, -775.1488f, -153.6593f); + TestUtils.AreEqual(r1, a1 - b1); + + float3 a2 = float3(-410.46405f, -401.384644f, 317.706848f); + float3 b2 = float3(-402.381653f, -75.37015f, 320.9796f); + float3 r2 = float3(-8.082397f, -326.0145f, -3.272766f); + TestUtils.AreEqual(r2, a2 - b2); + + float3 a3 = float3(447.060425f, -489.074158f, -230.008392f); + float3 b3 = float3(-73.90875f, -31.4447327f, -389.251953f); + float3 r3 = float3(520.9692f, -457.629425f, 159.243561f); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void float3_operator_sub_wide_scalar() + { + float3 a0 = float3(207.389587f, 248.457764f, -384.8239f); + float b0 = (-36.1124878f); + float3 r0 = float3(243.502075f, 284.570251f, -348.711426f); + TestUtils.AreEqual(r0, a0 - b0); + + float3 a1 = float3(-205.344757f, 191.642029f, 18.8562622f); + float b1 = (-374.811554f); + float3 r1 = float3(169.4668f, 566.4536f, 393.667816f); + TestUtils.AreEqual(r1, a1 - b1); + + float3 a2 = float3(-44.96161f, 16.3381958f, -366.865448f); + float b2 = (480.857971f); + float3 r2 = float3(-525.8196f, -464.519775f, -847.7234f); + TestUtils.AreEqual(r2, a2 - b2); + + float3 a3 = float3(-35.5231f, 439.077271f, 490.2223f); + float b3 = (349.397766f); + float3 r3 = float3(-384.920868f, 89.6795044f, 140.824524f); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void float3_operator_sub_scalar_wide() + { + float a0 = (-86.00824f); + float3 b0 = float3(466.4251f, 298.486938f, -300.9501f); + float3 r0 = float3(-552.43335f, -384.495178f, 214.941864f); + TestUtils.AreEqual(r0, a0 - b0); + + float a1 = (315.38f); + float3 b1 = float3(-381.092163f, -125.008362f, 58.4661865f); + float3 r1 = float3(696.472168f, 440.388367f, 256.913818f); + TestUtils.AreEqual(r1, a1 - b1); + + float a2 = (214.7461f); + float3 b2 = float3(-257.549438f, 480.2246f, -443.355072f); + float3 r2 = float3(472.295532f, -265.478516f, 658.1012f); + TestUtils.AreEqual(r2, a2 - b2); + + float a3 = (260.795044f); + float3 b3 = float3(29.6819458f, 139.857727f, -247.789948f); + float3 r3 = float3(231.1131f, 120.937317f, 508.585f); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void float3_operator_mul_wide_wide() + { + float3 a0 = float3(-482.7138f, -407.2935f, 137.700562f); + float3 b0 = float3(-236.367889f, 260.7276f, -416.3863f); + float3 r0 = float3(114098.047f, -106192.656f, -57336.625f); + TestUtils.AreEqual(r0, a0 * b0); + + float3 a1 = float3(208.541138f, 194.29657f, -484.242432f); + float3 b1 = float3(-364.4956f, -253.147522f, -369.202881f); + float3 r1 = float3(-76012.33f, -49185.6953f, 178783.7f); + TestUtils.AreEqual(r1, a1 * b1); + + float3 a2 = float3(183.9873f, -241.33548f, 45.8687744f); + float3 b2 = float3(193.547913f, 169.0849f, 201.969666f); + float3 r2 = float3(35610.36f, -40806.1836f, 9264.101f); + TestUtils.AreEqual(r2, a2 * b2); + + float3 a3 = float3(363.3261f, -328.118958f, -471.023071f); + float3 b3 = float3(249.456055f, -308.193176f, -385.579651f); + float3 r3 = float3(90633.9f, 101124.023f, 181616.9f); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void float3_operator_mul_wide_scalar() + { + float3 a0 = float3(-96.31882f, -277.142273f, -239.93689f); + float b0 = (-301.2072f); + float3 r0 = float3(29011.9219f, 83477.25f, 72270.72f); + TestUtils.AreEqual(r0, a0 * b0); + + float3 a1 = float3(509.531433f, 215.7315f, -455.50827f); + float b1 = (255.8581f); + float3 r1 = float3(130367.742f, 55196.6523f, -116545.477f); + TestUtils.AreEqual(r1, a1 * b1); + + float3 a2 = float3(-389.2433f, 53.7962646f, 243.757324f); + float b2 = (-338.29248f); + float3 r2 = float3(131678.078f, -18198.8711f, -82461.27f); + TestUtils.AreEqual(r2, a2 * b2); + + float3 a3 = float3(135.354675f, -383.9396f, -31.4252319f); + float b3 = (-207.3501f); + float3 r3 = float3(-28065.8047f, 79609.9141f, 6516.025f); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void float3_operator_mul_scalar_wide() + { + float a0 = (37.43219f); + float3 b0 = float3(96.74756f, 492.185364f, -274.054565f); + float3 r0 = float3(3621.473f, 18423.5762f, -10258.4629f); + TestUtils.AreEqual(r0, a0 * b0); + + float a1 = (-452.870972f); + float3 b1 = float3(420.853333f, 102.182922f, -114.948883f); + float3 r1 = float3(-190592.25f, -46275.68f, 52057.01f); + TestUtils.AreEqual(r1, a1 * b1); + + float a2 = (-351.120056f); + float3 b2 = float3(-464.664978f, 444.084839f, 447.1053f); + float3 r2 = float3(163153.188f, -155927.1f, -156987.641f); + TestUtils.AreEqual(r2, a2 * b2); + + float a3 = (130.829346f); + float3 b3 = float3(-321.41333f, 445.301331f, 478.2436f); + float3 r3 = float3(-42050.2969f, 58258.48f, 62568.2969f); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void float3_operator_div_wide_wide() + { + float3 a0 = float3(-353.131439f, -102.799866f, 51.3191528f); + float3 b0 = float3(-178.739563f, -302.096283f, -199.405823f); + float3 r0 = float3(1.97567582f, 0.34028843f, -0.257360339f); + TestUtils.AreEqual(r0, a0 / b0); + + float3 a1 = float3(-191.871674f, 8.041809f, -128.73764f); + float3 b1 = float3(278.850769f, 502.3376f, -361.484833f); + float3 r1 = float3(-0.688080132f, 0.0160087738f, 0.356135666f); + TestUtils.AreEqual(r1, a1 / b1); + + float3 a2 = float3(-136.0596f, -370.471f, -237.69455f); + float3 b2 = float3(353.121033f, -38.894928f, -75.76474f); + float3 r2 = float3(-0.385305852f, 9.524919f, 3.1372714f); + TestUtils.AreEqual(r2, a2 / b2); + + float3 a3 = float3(-432.546875f, 200.2655f, 361.4416f); + float3 b3 = float3(-195.217834f, -405.034f, -394.23f); + float3 r3 = float3(2.215714f, -0.4944412f, -0.9168292f); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void float3_operator_div_wide_scalar() + { + float3 a0 = float3(171.3424f, 0.103393555f, 57.8882446f); + float b0 = (171.796814f); + float3 r0 = float3(0.997355f, 0.000601836247f, 0.3369576f); + TestUtils.AreEqual(r0, a0 / b0); + + float3 a1 = float3(-256.130737f, -290.3869f, -127.4487f); + float b1 = (95.66968f); + float3 r1 = float3(-2.67724061f, -3.03530765f, -1.33217442f); + TestUtils.AreEqual(r1, a1 / b1); + + float3 a2 = float3(-79.7449f, -499.843567f, 58.68634f); + float b2 = (146.466858f); + float3 r2 = float3(-0.544456959f, -3.41267347f, 0.40068f); + TestUtils.AreEqual(r2, a2 / b2); + + float3 a3 = float3(-453.2058f, 481.738159f, 464.479065f); + float b3 = (-205.033813f); + float3 r3 = float3(2.21039557f, -2.34955478f, -2.26537776f); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void float3_operator_div_scalar_wide() + { + float a0 = (-264.4425f); + float3 b0 = float3(105.589111f, -142.349091f, -288.9489f); + float3 r0 = float3(-2.50444865f, 1.85770416f, 0.9151877f); + TestUtils.AreEqual(r0, a0 / b0); + + float a1 = (39.644104f); + float3 b1 = float3(-363.9914f, -149.718231f, -395.729126f); + float3 r1 = float3(-0.108914949f, -0.264791429f, -0.100179896f); + TestUtils.AreEqual(r1, a1 / b1); + + float a2 = (258.7187f); + float3 b2 = float3(-9.66626f, 117.725525f, -331.386536f); + float3 r2 = float3(-26.76513f, 2.197643f, -0.780715764f); + TestUtils.AreEqual(r2, a2 / b2); + + float a3 = (-509.986023f); + float3 b3 = float3(427.896484f, 467.617126f, -407.124634f); + float3 r3 = float3(-1.19184434f, -1.090606f, 1.25265336f); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void float3_operator_mod_wide_wide() + { + float3 a0 = float3(-388.8125f, 181.681213f, -167.078735f); + float3 b0 = float3(436.944153f, 58.9400635f, -201.116241f); + float3 r0 = float3(-388.8125f, 4.861023f, -167.078735f); + TestUtils.AreEqual(r0, a0 % b0); + + float3 a1 = float3(432.820129f, -258.438965f, -170.110809f); + float3 b1 = float3(279.289368f, -397.079773f, 377.899963f); + float3 r1 = float3(153.530762f, -258.438965f, -170.110809f); + TestUtils.AreEqual(r1, a1 % b1); + + float3 a2 = float3(283.3183f, 122.716492f, 335.271f); + float3 b2 = float3(174.693848f, -228.176514f, -317.060181f); + float3 r2 = float3(108.624451f, 122.716492f, 18.2108154f); + TestUtils.AreEqual(r2, a2 % b2); + + float3 a3 = float3(-503.608521f, 191.022522f, 289.742676f); + float3 b3 = float3(-417.4801f, -249.975952f, -397.571564f); + float3 r3 = float3(-86.12842f, 191.022522f, 289.742676f); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void float3_operator_mod_wide_scalar() + { + float3 a0 = float3(-244.499634f, -211.8193f, -145.926788f); + float b0 = (39.63495f); + float3 r0 = float3(-6.68994141f, -13.6445618f, -27.0219421f); + TestUtils.AreEqual(r0, a0 % b0); + + float3 a1 = float3(-304.9182f, -133.907776f, 281.309631f); + float b1 = (155.479492f); + float3 r1 = float3(-149.438721f, -133.907776f, 125.830139f); + TestUtils.AreEqual(r1, a1 % b1); + + float3 a2 = float3(-226.535767f, 101.706482f, 319.4715f); + float b2 = (335.166138f); + float3 r2 = float3(-226.535767f, 101.706482f, 319.4715f); + TestUtils.AreEqual(r2, a2 % b2); + + float3 a3 = float3(-285.4023f, 259.378f, -330.871948f); + float b3 = (-355.846863f); + float3 r3 = float3(-285.4023f, 259.378f, -330.871948f); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void float3_operator_mod_scalar_wide() + { + float a0 = (-66.94504f); + float3 b0 = float3(-249.7761f, -396.073761f, 386.492065f); + float3 r0 = float3(-66.94504f, -66.94504f, -66.94504f); + TestUtils.AreEqual(r0, a0 % b0); + + float a1 = (168.939453f); + float3 b1 = float3(-199.418243f, 261.7517f, 16.1274414f); + float3 r1 = float3(168.939453f, 168.939453f, 7.665039f); + TestUtils.AreEqual(r1, a1 % b1); + + float a2 = (257.668152f); + float3 b2 = float3(-75.78845f, 170.9563f, -242.858276f); + float3 r2 = float3(30.3027954f, 86.71185f, 14.8098755f); + TestUtils.AreEqual(r2, a2 % b2); + + float a3 = (425.9453f); + float3 b3 = float3(303.2724f, 3.033081f, -505.74353f); + float3 r3 = float3(122.672913f, 1.31396484f, 425.9453f); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void float3_operator_plus() + { + float3 a0 = float3(-418.829559f, -405.79895f, -34.04178f); + float3 r0 = float3(-418.829559f, -405.79895f, -34.04178f); + TestUtils.AreEqual(r0, +a0); + + float3 a1 = float3(236.999268f, 210.86145f, 293.742f); + float3 r1 = float3(236.999268f, 210.86145f, 293.742f); + TestUtils.AreEqual(r1, +a1); + + float3 a2 = float3(-373.015442f, 4.95440674f, -418.645264f); + float3 r2 = float3(-373.015442f, 4.95440674f, -418.645264f); + TestUtils.AreEqual(r2, +a2); + + float3 a3 = float3(504.474854f, 439.5594f, -478.7494f); + float3 r3 = float3(504.474854f, 439.5594f, -478.7494f); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void float3_operator_neg() + { + float3 a0 = float3(148.461731f, -467.122681f, 132.04718f); + float3 r0 = float3(-148.461731f, 467.122681f, -132.04718f); + TestUtils.AreEqual(r0, -a0); + + float3 a1 = float3(183.522644f, -407.9911f, -54.95877f); + float3 r1 = float3(-183.522644f, 407.9911f, 54.95877f); + TestUtils.AreEqual(r1, -a1); + + float3 a2 = float3(-382.9898f, -383.014069f, 407.709778f); + float3 r2 = float3(382.9898f, 383.014069f, -407.709778f); + TestUtils.AreEqual(r2, -a2); + + float3 a3 = float3(168.735474f, 171.902466f, -280.558319f); + float3 r3 = float3(-168.735474f, -171.902466f, 280.558319f); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void float3_operator_prefix_inc() + { + float3 a0 = float3(-139.842072f, -56.7436523f, -381.955322f); + float3 r0 = float3(-138.842072f, -55.7436523f, -380.955322f); + TestUtils.AreEqual(r0, ++a0); + + float3 a1 = float3(509.796326f, 210.319885f, -392.7315f); + float3 r1 = float3(510.796326f, 211.319885f, -391.7315f); + TestUtils.AreEqual(r1, ++a1); + + float3 a2 = float3(-300.1941f, 401.6148f, 130.90918f); + float3 r2 = float3(-299.1941f, 402.6148f, 131.90918f); + TestUtils.AreEqual(r2, ++a2); + + float3 a3 = float3(-450.230164f, 46.1920166f, -41.4972839f); + float3 r3 = float3(-449.230164f, 47.1920166f, -40.4972839f); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void float3_operator_postfix_inc() + { + float3 a0 = float3(-396.669739f, 511.20752f, 249.111267f); + float3 r0 = float3(-396.669739f, 511.20752f, 249.111267f); + TestUtils.AreEqual(r0, a0++); + + float3 a1 = float3(-128.817322f, 278.008179f, -81.39343f); + float3 r1 = float3(-128.817322f, 278.008179f, -81.39343f); + TestUtils.AreEqual(r1, a1++); + + float3 a2 = float3(66.71973f, 147.94397f, -326.1076f); + float3 r2 = float3(66.71973f, 147.94397f, -326.1076f); + TestUtils.AreEqual(r2, a2++); + + float3 a3 = float3(41.03357f, 73.15558f, -60.1323853f); + float3 r3 = float3(41.03357f, 73.15558f, -60.1323853f); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void float3_operator_prefix_dec() + { + float3 a0 = float3(123.128723f, 256.84375f, 156.330811f); + float3 r0 = float3(122.128723f, 255.84375f, 155.330811f); + TestUtils.AreEqual(r0, --a0); + + float3 a1 = float3(461.737427f, 392.015625f, 187.874146f); + float3 r1 = float3(460.737427f, 391.015625f, 186.874146f); + TestUtils.AreEqual(r1, --a1); + + float3 a2 = float3(-236.225189f, 469.844727f, 45.5366821f); + float3 r2 = float3(-237.225189f, 468.844727f, 44.5366821f); + TestUtils.AreEqual(r2, --a2); + + float3 a3 = float3(376.046875f, -22.0289612f, 248.7901f); + float3 r3 = float3(375.046875f, -23.0289612f, 247.7901f); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void float3_operator_postfix_dec() + { + float3 a0 = float3(379.6883f, 302.692871f, -176.07135f); + float3 r0 = float3(379.6883f, 302.692871f, -176.07135f); + TestUtils.AreEqual(r0, a0--); + + float3 a1 = float3(-291.2527f, -402.925964f, -63.65515f); + float3 r1 = float3(-291.2527f, -402.925964f, -63.65515f); + TestUtils.AreEqual(r1, a1--); + + float3 a2 = float3(355.2611f, -100.761841f, 156.14032f); + float3 r2 = float3(355.2611f, -100.761841f, 156.14032f); + TestUtils.AreEqual(r2, a2--); + + float3 a3 = float3(479.9452f, -445.026947f, 407.420349f); + float3 r3 = float3(479.9452f, -445.026947f, 407.420349f); + TestUtils.AreEqual(r3, a3--); + } + + [TestCompiler] + public static void float3_shuffle_result_1() + { + float3 a = float3(0, 1, 2); + float3 b = float3(3, 4, 5); + + TestUtils.AreEqual((0), shuffle(a, b, ShuffleComponent.LeftX)); + TestUtils.AreEqual((1), shuffle(a, b, ShuffleComponent.LeftY)); + TestUtils.AreEqual((2), shuffle(a, b, ShuffleComponent.LeftZ)); + TestUtils.AreEqual((3), shuffle(a, b, ShuffleComponent.RightX)); + TestUtils.AreEqual((4), shuffle(a, b, ShuffleComponent.RightY)); + TestUtils.AreEqual((5), shuffle(a, b, ShuffleComponent.RightZ)); + } + + [TestCompiler] + public static void float3_shuffle_result_2() + { + float3 a = float3(0, 1, 2); + float3 b = float3(3, 4, 5); + + TestUtils.AreEqual(float2(4, 4), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightY)); + TestUtils.AreEqual(float2(4, 3), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightX)); + TestUtils.AreEqual(float2(1, 3), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.RightX)); + TestUtils.AreEqual(float2(5, 2), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(float2(5, 1), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.LeftY)); + TestUtils.AreEqual(float2(1, 2), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(float2(3, 2), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(float2(5, 0), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.LeftX)); + TestUtils.AreEqual(float2(5, 5), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.RightZ)); + TestUtils.AreEqual(float2(4, 1), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftY)); + TestUtils.AreEqual(float2(4, 5), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightZ)); + TestUtils.AreEqual(float2(5, 0), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.LeftX)); + TestUtils.AreEqual(float2(4, 3), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightX)); + TestUtils.AreEqual(float2(5, 4), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.RightY)); + TestUtils.AreEqual(float2(3, 0), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftX)); + TestUtils.AreEqual(float2(1, 2), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.LeftZ)); + } + + [TestCompiler] + public static void float3_shuffle_result_3() + { + float3 a = float3(0, 1, 2); + float3 b = float3(3, 4, 5); + + TestUtils.AreEqual(float3(1, 5, 3), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.RightZ, ShuffleComponent.RightX)); + TestUtils.AreEqual(float3(4, 0, 2), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftX, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(float3(2, 5, 3), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.RightZ, ShuffleComponent.RightX)); + TestUtils.AreEqual(float3(4, 0, 1), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftX, ShuffleComponent.LeftY)); + TestUtils.AreEqual(float3(5, 4, 2), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.RightY, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(float3(2, 0, 1), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.LeftX, ShuffleComponent.LeftY)); + TestUtils.AreEqual(float3(2, 4, 3), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.RightY, ShuffleComponent.RightX)); + TestUtils.AreEqual(float3(2, 1, 5), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.LeftY, ShuffleComponent.RightZ)); + TestUtils.AreEqual(float3(4, 4, 5), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightY, ShuffleComponent.RightZ)); + TestUtils.AreEqual(float3(4, 3, 1), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightX, ShuffleComponent.LeftY)); + TestUtils.AreEqual(float3(5, 5, 0), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.RightZ, ShuffleComponent.LeftX)); + TestUtils.AreEqual(float3(5, 1, 3), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.LeftY, ShuffleComponent.RightX)); + TestUtils.AreEqual(float3(4, 1, 5), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftY, ShuffleComponent.RightZ)); + TestUtils.AreEqual(float3(2, 3, 4), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.RightX, ShuffleComponent.RightY)); + TestUtils.AreEqual(float3(4, 0, 4), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftX, ShuffleComponent.RightY)); + TestUtils.AreEqual(float3(4, 0, 5), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftX, ShuffleComponent.RightZ)); + } + + [TestCompiler] + public static void float3_shuffle_result_4() + { + float3 a = float3(0, 1, 2); + float3 b = float3(3, 4, 5); + + TestUtils.AreEqual(float4(1, 2, 3, 1), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.LeftZ, ShuffleComponent.RightX, ShuffleComponent.LeftY)); + TestUtils.AreEqual(float4(4, 2, 5, 4), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftZ, ShuffleComponent.RightZ, ShuffleComponent.RightY)); + TestUtils.AreEqual(float4(4, 4, 5, 1), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightY, ShuffleComponent.RightZ, ShuffleComponent.LeftY)); + TestUtils.AreEqual(float4(3, 3, 1, 1), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightX, ShuffleComponent.LeftY, ShuffleComponent.LeftY)); + TestUtils.AreEqual(float4(4, 1, 1, 0), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftY, ShuffleComponent.LeftY, ShuffleComponent.LeftX)); + TestUtils.AreEqual(float4(3, 4, 3, 5), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightY, ShuffleComponent.RightX, ShuffleComponent.RightZ)); + TestUtils.AreEqual(float4(1, 5, 0, 5), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.RightZ, ShuffleComponent.LeftX, ShuffleComponent.RightZ)); + TestUtils.AreEqual(float4(4, 0, 0, 0), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftX, ShuffleComponent.LeftX, ShuffleComponent.LeftX)); + TestUtils.AreEqual(float4(3, 5, 2, 0), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightZ, ShuffleComponent.LeftZ, ShuffleComponent.LeftX)); + TestUtils.AreEqual(float4(4, 3, 1, 3), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightX, ShuffleComponent.LeftY, ShuffleComponent.RightX)); + TestUtils.AreEqual(float4(0, 2, 5, 0), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.LeftZ, ShuffleComponent.RightZ, ShuffleComponent.LeftX)); + TestUtils.AreEqual(float4(1, 4, 5, 5), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.RightY, ShuffleComponent.RightZ, ShuffleComponent.RightZ)); + TestUtils.AreEqual(float4(2, 3, 1, 3), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.RightX, ShuffleComponent.LeftY, ShuffleComponent.RightX)); + TestUtils.AreEqual(float4(3, 0, 1, 2), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftX, ShuffleComponent.LeftY, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(float4(5, 3, 0, 4), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.RightX, ShuffleComponent.LeftX, ShuffleComponent.RightY)); + TestUtils.AreEqual(float4(2, 5, 0, 4), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.RightZ, ShuffleComponent.LeftX, ShuffleComponent.RightY)); + } + + [TestCase /* For player builds */] + public static void float3_EqualsObjectOverride() + { + TestUtils.IsFalse(new float3().Equals((object)new int())); + TestUtils.IsTrue(new float3().Equals((object)new float3())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestFloat3.gen.cs.meta b/src/Tests/Tests/Shared/TestFloat3.gen.cs.meta new file mode 100644 index 00000000..b9523b25 --- /dev/null +++ b/src/Tests/Tests/Shared/TestFloat3.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d920c9d9a3133d242af38fd80330960f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestFloat3x2.gen.cs b/src/Tests/Tests/Shared/TestFloat3x2.gen.cs new file mode 100644 index 00000000..a9fcca5b --- /dev/null +++ b/src/Tests/Tests/Shared/TestFloat3x2.gen.cs @@ -0,0 +1,950 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestFloat3x2 + { + [TestCompiler] + public static void float3x2_zero() + { + TestUtils.AreEqual(0.0f, float3x2.zero.c0.x); + TestUtils.AreEqual(0.0f, float3x2.zero.c0.y); + TestUtils.AreEqual(0.0f, float3x2.zero.c0.z); + TestUtils.AreEqual(0.0f, float3x2.zero.c1.x); + TestUtils.AreEqual(0.0f, float3x2.zero.c1.y); + TestUtils.AreEqual(0.0f, float3x2.zero.c1.z); + } + + [TestCompiler] + public static void float3x2_operator_equal_wide_wide() + { + float3x2 a0 = float3x2(492.1576f, -495.206329f, 227.457642f, -147.374054f, -222.682f, 64.09375f); + float3x2 b0 = float3x2(192.568787f, -235.611023f, -254.043121f, -412.624725f, 471.9048f, -6.47277832f); + bool3x2 r0 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + float3x2 a1 = float3x2(-23.8904114f, -16.8197327f, 163.232117f, -165.271f, 470.8777f, -423.942566f); + float3x2 b1 = float3x2(-339.102356f, 488.187561f, -379.5966f, -308.417f, -82.333374f, -102.921082f); + bool3x2 r1 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + float3x2 a2 = float3x2(109.6344f, 462.6903f, -335.38147f, 357.2345f, 1.54559326f, -347.388245f); + float3x2 b2 = float3x2(226.515747f, -356.9013f, -362.912781f, -427.898438f, 466.650146f, -102.799042f); + bool3x2 r2 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + float3x2 a3 = float3x2(-114.472168f, 435.848633f, 194.2381f, 138.765564f, -467.349152f, 370.43335f); + float3x2 b3 = float3x2(-43.355957f, 85.0456543f, -91.1270447f, 422.192078f, -477.4313f, 1.87701416f); + bool3x2 r3 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void float3x2_operator_equal_wide_scalar() + { + float3x2 a0 = float3x2(-303.230072f, 451.5263f, -253.655884f, -105.203644f, -500.6911f, -426.192474f); + float b0 = (123.544556f); + bool3x2 r0 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + float3x2 a1 = float3x2(159.8761f, -57.4773865f, -182.049744f, 406.513733f, 370.886f, -172.035309f); + float b1 = (-59.55838f); + bool3x2 r1 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + float3x2 a2 = float3x2(455.400024f, 363.938232f, -27.1505737f, -325.976074f, -290.359039f, 180.196838f); + float b2 = (-11.3389893f); + bool3x2 r2 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + float3x2 a3 = float3x2(-374.128326f, -126.546082f, -197.26178f, -227.159332f, -479.8992f, -439.777679f); + float b3 = (-439.358948f); + bool3x2 r3 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void float3x2_operator_equal_scalar_wide() + { + float a0 = (-253.397278f); + float3x2 b0 = float3x2(19.95221f, -185.791992f, 407.8136f, -87.2767f, -206.274689f, 160.503113f); + bool3x2 r0 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + float a1 = (-274.7708f); + float3x2 b1 = float3x2(-2.63153076f, 448.354553f, -410.035248f, 247.329041f, 355.539124f, -298.0667f); + bool3x2 r1 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + float a2 = (414.1015f); + float3x2 b2 = float3x2(-481.3026f, 196.55072f, 34.6010132f, 113.7616f, -386.453369f, -124.49176f); + bool3x2 r2 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + float a3 = (243.886658f); + float3x2 b3 = float3x2(-492.6182f, 145.424438f, 421.55072f, -95.40997f, 336.809265f, 209.5838f); + bool3x2 r3 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void float3x2_operator_not_equal_wide_wide() + { + float3x2 a0 = float3x2(430.842529f, 104.69f, 225.802429f, -310.5702f, -418.619446f, 304.128174f); + float3x2 b0 = float3x2(210.024719f, -55.20334f, -269.925354f, -234.546722f, 25.91742f, -63.72699f); + bool3x2 r0 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + float3x2 a1 = float3x2(-509.3268f, -160.538086f, -203.301971f, -505.763245f, 162.17218f, 1.156189f); + float3x2 b1 = float3x2(-484.5537f, -425.3336f, -53.2743835f, 328.1944f, 15.9631348f, 461.7141f); + bool3x2 r1 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + float3x2 a2 = float3x2(65.66205f, 102.787781f, 172.930054f, 26.6210327f, 235.125977f, 128.541992f); + float3x2 b2 = float3x2(-113.363037f, -240.072968f, 495.119141f, 203.55835f, 340.493469f, -241.9072f); + bool3x2 r2 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + float3x2 a3 = float3x2(-354.996979f, 334.3595f, -495.832f, 468.307373f, 458.370972f, 299.937317f); + float3x2 b3 = float3x2(459.569824f, 213.07373f, -384.782837f, -255.072327f, 477.663452f, -248.036621f); + bool3x2 r3 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void float3x2_operator_not_equal_wide_scalar() + { + float3x2 a0 = float3x2(-16.9145813f, 168.8341f, -462.713531f, 130.307739f, 214.501587f, -440.263275f); + float b0 = (-145.372772f); + bool3x2 r0 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + float3x2 a1 = float3x2(-197.12796f, -386.611176f, -281.021f, -270.26886f, -403.9637f, -269.805725f); + float b1 = (-169.099854f); + bool3x2 r1 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + float3x2 a2 = float3x2(299.654236f, -432.755737f, -457.363129f, -13.5195923f, 273.873047f, 185.04248f); + float b2 = (-71.7509155f); + bool3x2 r2 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + float3x2 a3 = float3x2(-482.5307f, 511.735f, 230.5075f, 100.27478f, 129.682434f, 321.178772f); + float b3 = (116.395142f); + bool3x2 r3 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void float3x2_operator_not_equal_scalar_wide() + { + float a0 = (275.795837f); + float3x2 b0 = float3x2(-57.1969f, -382.432526f, 97.82037f, -161.463654f, -458.39563f, -499.617859f); + bool3x2 r0 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + float a1 = (327.92218f); + float3x2 b1 = float3x2(367.571228f, 59.786377f, -209.580688f, -62.5804443f, -479.974976f, -49.4945068f); + bool3x2 r1 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + float a2 = (-114.685211f); + float3x2 b2 = float3x2(109.93927f, -176.284821f, -347.4853f, 85.5409546f, -356.659546f, -104.243561f); + bool3x2 r2 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + float a3 = (-133.5492f); + float3x2 b3 = float3x2(243.539734f, 13.1412964f, -379.985962f, -41.28122f, 87.91168f, -339.077271f); + bool3x2 r3 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void float3x2_operator_less_wide_wide() + { + float3x2 a0 = float3x2(196.84259f, 336.4098f, 251.963745f, 257.655945f, 430.0459f, -62.4196472f); + float3x2 b0 = float3x2(-465.345032f, -256.1524f, -314.814026f, 364.5667f, 100.21051f, 182.560974f); + bool3x2 r0 = bool3x2(false, false, false, true, false, true); + TestUtils.AreEqual(r0, a0 < b0); + + float3x2 a1 = float3x2(8.839233f, -333.8167f, 164.678833f, -350.9449f, 3.84143066f, 125.409729f); + float3x2 b1 = float3x2(3.11700439f, -259.430481f, -437.3349f, -456.043732f, -394.255981f, 401.9137f); + bool3x2 r1 = bool3x2(false, true, false, false, false, true); + TestUtils.AreEqual(r1, a1 < b1); + + float3x2 a2 = float3x2(-111.129944f, 70.00549f, 448.1983f, -419.987122f, -258.301666f, -34.8322144f); + float3x2 b2 = float3x2(313.439148f, 121.286682f, -28.0122986f, -282.965881f, 330.0644f, 124.099365f); + bool3x2 r2 = bool3x2(true, true, false, true, true, true); + TestUtils.AreEqual(r2, a2 < b2); + + float3x2 a3 = float3x2(-69.8594055f, 67.76721f, -139.777283f, 385.434631f, 133.7074f, 506.188354f); + float3x2 b3 = float3x2(-183.6903f, 373.0608f, 109.750916f, -203.57135f, 45.64868f, -360.952271f); + bool3x2 r3 = bool3x2(false, true, true, false, false, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void float3x2_operator_less_wide_scalar() + { + float3x2 a0 = float3x2(-132.057312f, -192.465f, -66.8345947f, -379.017517f, -360.2824f, 20.9278564f); + float b0 = (-156.010223f); + bool3x2 r0 = bool3x2(false, true, false, true, true, false); + TestUtils.AreEqual(r0, a0 < b0); + + float3x2 a1 = float3x2(-158.240753f, -20.4526062f, 225.2915f, 307.4842f, 274.015259f, 373.549683f); + float b1 = (437.3459f); + bool3x2 r1 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 < b1); + + float3x2 a2 = float3x2(398.523682f, -58.0108948f, 109.670105f, -108.85318f, -44.9712524f, 140.426086f); + float b2 = (105.030151f); + bool3x2 r2 = bool3x2(false, true, false, true, true, false); + TestUtils.AreEqual(r2, a2 < b2); + + float3x2 a3 = float3x2(-500.0883f, -197.500732f, -7.271515f, -432.9905f, 62.1583252f, -72.25473f); + float b3 = (172.103333f); + bool3x2 r3 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void float3x2_operator_less_scalar_wide() + { + float a0 = (-423.1174f); + float3x2 b0 = float3x2(385.094849f, -123.933472f, 86.37659f, 133.4422f, 161.457947f, 229.754272f); + bool3x2 r0 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 < b0); + + float a1 = (222.5716f); + float3x2 b1 = float3x2(315.5312f, -447.203522f, 271.833862f, -393.605316f, 317.486877f, -164.6051f); + bool3x2 r1 = bool3x2(true, false, true, false, true, false); + TestUtils.AreEqual(r1, a1 < b1); + + float a2 = (-282.876038f); + float3x2 b2 = float3x2(296.979553f, -254.401154f, 365.6156f, -441.984253f, -131.42865f, 442.628967f); + bool3x2 r2 = bool3x2(true, true, true, false, true, true); + TestUtils.AreEqual(r2, a2 < b2); + + float a3 = (-29.7928467f); + float3x2 b3 = float3x2(-138.37381f, 9.21698f, -226.73056f, 171.029419f, 376.625244f, -462.5887f); + bool3x2 r3 = bool3x2(false, true, false, true, true, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void float3x2_operator_greater_wide_wide() + { + float3x2 a0 = float3x2(483.5014f, 310.8156f, 106.966187f, 295.7353f, 116.957581f, -478.299774f); + float3x2 b0 = float3x2(-471.398f, -371.9853f, 36.9006958f, -316.7636f, 19.6830444f, 207.309143f); + bool3x2 r0 = bool3x2(true, true, true, true, true, false); + TestUtils.AreEqual(r0, a0 > b0); + + float3x2 a1 = float3x2(-14.8974f, -33.8174438f, -24.74054f, 319.782654f, -120.158569f, -289.008575f); + float3x2 b1 = float3x2(362.7975f, 324.95343f, 340.948059f, 25.9860229f, -114.211121f, 240.803467f); + bool3x2 r1 = bool3x2(false, false, false, true, false, false); + TestUtils.AreEqual(r1, a1 > b1); + + float3x2 a2 = float3x2(455.85144f, 144.706909f, 63.9320068f, -285.683044f, -502.090729f, -337.194458f); + float3x2 b2 = float3x2(273.422424f, 325.515747f, 27.3410645f, 64.47955f, 200.948364f, 100.122681f); + bool3x2 r2 = bool3x2(true, false, true, false, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + float3x2 a3 = float3x2(474.317322f, -507.1451f, -133.565582f, -443.109131f, -464.34137f, -68.36154f); + float3x2 b3 = float3x2(-79.00711f, -315.137939f, -122.985443f, -163.7792f, -492.566f, -90.79727f); + bool3x2 r3 = bool3x2(true, false, false, false, true, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void float3x2_operator_greater_wide_scalar() + { + float3x2 a0 = float3x2(64.31793f, -397.703461f, 431.8769f, 85.703f, 246.263062f, 197.491577f); + float b0 = (305.859924f); + bool3x2 r0 = bool3x2(false, false, true, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + float3x2 a1 = float3x2(286.199463f, -405.7846f, 171.565369f, -241.807281f, 333.5782f, 370.279175f); + float b1 = (280.813354f); + bool3x2 r1 = bool3x2(true, false, false, false, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + float3x2 a2 = float3x2(-413.7014f, -353.0313f, 396.645325f, 467.222046f, -240.013428f, 502.915039f); + float b2 = (-356.592346f); + bool3x2 r2 = bool3x2(false, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 > b2); + + float3x2 a3 = float3x2(315.4676f, 281.230652f, 428.792175f, 245.153076f, -279.1754f, -453.8631f); + float b3 = (-259.2897f); + bool3x2 r3 = bool3x2(true, true, true, true, false, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void float3x2_operator_greater_scalar_wide() + { + float a0 = (-282.6705f); + float3x2 b0 = float3x2(358.099976f, -72.596405f, -232.163788f, -60.7067261f, 75.15662f, 150.883484f); + bool3x2 r0 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + float a1 = (339.539185f); + float3x2 b1 = float3x2(-498.196045f, 459.7461f, -227.968719f, 335.862122f, 76.17883f, 296.859924f); + bool3x2 r1 = bool3x2(true, false, true, true, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + float a2 = (177.48999f); + float3x2 b2 = float3x2(-281.2012f, 244.722839f, 137.328552f, -385.338257f, 443.163452f, -353.562561f); + bool3x2 r2 = bool3x2(true, false, true, true, false, true); + TestUtils.AreEqual(r2, a2 > b2); + + float a3 = (26.04065f); + float3x2 b3 = float3x2(-331.793945f, -43.6919556f, 20.9494019f, -211.17984f, 227.421692f, -84.7797852f); + bool3x2 r3 = bool3x2(true, true, true, true, false, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void float3x2_operator_less_equal_wide_wide() + { + float3x2 a0 = float3x2(-438.523132f, 210.489441f, 4.87731934f, -137.297943f, 156.094116f, -363.924133f); + float3x2 b0 = float3x2(-474.814148f, 304.371033f, 234.824158f, -390.485443f, -297.175354f, -326.2924f); + bool3x2 r0 = bool3x2(false, true, true, false, false, true); + TestUtils.AreEqual(r0, a0 <= b0); + + float3x2 a1 = float3x2(-97.94849f, 437.2954f, 458.530273f, -294.064758f, 23.62262f, -34.2840576f); + float3x2 b1 = float3x2(107.253906f, -413.131073f, 67.09442f, 470.075256f, -84.499115f, 392.784241f); + bool3x2 r1 = bool3x2(true, false, false, true, false, true); + TestUtils.AreEqual(r1, a1 <= b1); + + float3x2 a2 = float3x2(149.736511f, -418.8867f, -197.502533f, -88.2055054f, -376.71814f, 341.627136f); + float3x2 b2 = float3x2(-263.531738f, 369.3009f, -333.3253f, 238.413452f, 486.2426f, 279.6502f); + bool3x2 r2 = bool3x2(false, true, false, true, true, false); + TestUtils.AreEqual(r2, a2 <= b2); + + float3x2 a3 = float3x2(-83.30917f, -107.490723f, 319.466858f, 205.357361f, 345.563721f, 395.3219f); + float3x2 b3 = float3x2(236.052f, 132.758972f, 66.29474f, 183.002136f, 200.130554f, 339.043823f); + bool3x2 r3 = bool3x2(true, true, false, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void float3x2_operator_less_equal_wide_scalar() + { + float3x2 a0 = float3x2(193.49585f, 168.915527f, -313.993073f, 81.8269653f, 18.5036011f, -0.3581848f); + float b0 = (443.850525f); + bool3x2 r0 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + float3x2 a1 = float3x2(241.361145f, -1.35775757f, -268.899475f, 398.991943f, -471.253082f, -264.9378f); + float b1 = (-463.8164f); + bool3x2 r1 = bool3x2(false, false, false, false, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + float3x2 a2 = float3x2(82.2583f, 424.704041f, 426.482239f, 56.3200073f, -196.2879f, 31.9011841f); + float b2 = (11.2460327f); + bool3x2 r2 = bool3x2(false, false, false, false, true, false); + TestUtils.AreEqual(r2, a2 <= b2); + + float3x2 a3 = float3x2(-152.257568f, -37.1048279f, -47.1442261f, 333.623047f, -274.8039f, 358.67627f); + float b3 = (-437.926453f); + bool3x2 r3 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void float3x2_operator_less_equal_scalar_wide() + { + float a0 = (393.606262f); + float3x2 b0 = float3x2(-75.6883545f, -44.2638855f, 125.864929f, 191.9649f, 13.54303f, -197.051941f); + bool3x2 r0 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 <= b0); + + float a1 = (-423.9451f); + float3x2 b1 = float3x2(-330.0486f, 420.165527f, 105.5473f, 174.821289f, 296.7176f, -469.7004f); + bool3x2 r1 = bool3x2(true, true, true, true, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + float a2 = (123.267212f); + float3x2 b2 = float3x2(112.996948f, 495.143372f, -488.6579f, 388.539429f, -493.240784f, 16.45105f); + bool3x2 r2 = bool3x2(false, true, false, true, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + float a3 = (-387.651642f); + float3x2 b3 = float3x2(-229.1773f, -373.01532f, -391.142151f, 90.99414f, -178.396149f, -69.62106f); + bool3x2 r3 = bool3x2(true, true, false, true, true, true); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void float3x2_operator_greater_equal_wide_wide() + { + float3x2 a0 = float3x2(-507.9286f, 504.4975f, -385.4345f, -262.323425f, -37.5509338f, -111.595276f); + float3x2 b0 = float3x2(-81.3465f, 297.666138f, 171.06543f, -431.038055f, -6.85907f, 319.7257f); + bool3x2 r0 = bool3x2(false, true, false, true, false, false); + TestUtils.AreEqual(r0, a0 >= b0); + + float3x2 a1 = float3x2(-463.702026f, 387.448853f, 456.9688f, -211.010162f, 182.411377f, -53.59604f); + float3x2 b1 = float3x2(254.079163f, 396.5724f, 178.8393f, -447.063354f, 288.492676f, 474.889282f); + bool3x2 r1 = bool3x2(false, false, true, true, false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + float3x2 a2 = float3x2(-309.570221f, -136.022491f, 280.736267f, -96.99588f, -174.059509f, 88.90192f); + float3x2 b2 = float3x2(-321.750244f, -395.977234f, -158.692474f, 391.4887f, -368.109253f, 89.12378f); + bool3x2 r2 = bool3x2(true, true, true, false, true, false); + TestUtils.AreEqual(r2, a2 >= b2); + + float3x2 a3 = float3x2(43.81604f, -446.07843f, 16.6455688f, 409.83252f, -191.329865f, 222.9978f); + float3x2 b3 = float3x2(-510.279327f, -486.9298f, -81.2155457f, 274.2188f, -212.881561f, 288.9953f); + bool3x2 r3 = bool3x2(true, true, true, true, true, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void float3x2_operator_greater_equal_wide_scalar() + { + float3x2 a0 = float3x2(465.152161f, -424.886078f, -209.2211f, 58.7798462f, -302.2691f, 140.12561f); + float b0 = (-5.599884f); + bool3x2 r0 = bool3x2(true, false, false, true, false, true); + TestUtils.AreEqual(r0, a0 >= b0); + + float3x2 a1 = float3x2(16.3533936f, 393.278076f, -315.701538f, 441.011536f, -509.781555f, -36.9942932f); + float b1 = (-344.559967f); + bool3x2 r1 = bool3x2(true, true, true, true, false, true); + TestUtils.AreEqual(r1, a1 >= b1); + + float3x2 a2 = float3x2(494.8203f, -466.1201f, -123.813751f, 215.651245f, 104.995728f, 314.346f); + float b2 = (-164.973938f); + bool3x2 r2 = bool3x2(true, false, true, true, true, true); + TestUtils.AreEqual(r2, a2 >= b2); + + float3x2 a3 = float3x2(190.516113f, -23.8364258f, 143.049377f, -264.919983f, -169.702209f, 329.70752f); + float b3 = (-83.11142f); + bool3x2 r3 = bool3x2(true, true, true, false, false, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void float3x2_operator_greater_equal_scalar_wide() + { + float a0 = (374.827026f); + float3x2 b0 = float3x2(-1.60977173f, 338.615234f, -116.1814f, -332.157318f, -355.97937f, -468.901428f); + bool3x2 r0 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + float a1 = (38.579895f); + float3x2 b1 = float3x2(-332.347534f, 2.89013672f, 467.777771f, 121.406372f, -305.023376f, -58.4288025f); + bool3x2 r1 = bool3x2(true, true, false, false, true, true); + TestUtils.AreEqual(r1, a1 >= b1); + + float a2 = (-226.519562f); + float3x2 b2 = float3x2(-47.0209961f, 305.302673f, -427.401245f, 92.26367f, -497.178528f, -408.625641f); + bool3x2 r2 = bool3x2(false, false, true, false, true, true); + TestUtils.AreEqual(r2, a2 >= b2); + + float a3 = (-455.2305f); + float3x2 b3 = float3x2(396.4261f, -469.2949f, -485.754028f, -182.346191f, -291.545349f, 278.740784f); + bool3x2 r3 = bool3x2(false, true, true, false, false, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void float3x2_operator_add_wide_wide() + { + float3x2 a0 = float3x2(506.129028f, -501.779816f, 420.084778f, -186.032074f, -9.312408f, 328.51178f); + float3x2 b0 = float3x2(-28.7579956f, -337.135132f, -340.676819f, 152.312012f, 423.66748f, 90.3740845f); + float3x2 r0 = float3x2(477.371033f, -838.9149f, 79.40796f, -33.7200623f, 414.355072f, 418.885864f); + TestUtils.AreEqual(r0, a0 + b0); + + float3x2 a1 = float3x2(424.344055f, 87.79108f, 462.4137f, -46.17871f, 401.170044f, -454.124146f); + float3x2 b1 = float3x2(376.18866f, 1.76721191f, -120.185852f, -279.629364f, -344.6671f, 242.839172f); + float3x2 r1 = float3x2(800.5327f, 89.55829f, 342.227844f, -325.808075f, 56.50293f, -211.284973f); + TestUtils.AreEqual(r1, a1 + b1); + + float3x2 a2 = float3x2(69.19568f, -177.957336f, 299.604126f, 340.704834f, 219.916016f, -321.9084f); + float3x2 b2 = float3x2(418.593079f, -23.3128052f, -95.0999451f, 147.9281f, 331.0329f, -82.50256f); + float3x2 r2 = float3x2(487.788757f, -201.270142f, 204.504181f, 488.632935f, 550.9489f, -404.41095f); + TestUtils.AreEqual(r2, a2 + b2); + + float3x2 a3 = float3x2(286.355347f, -333.4195f, -118.932159f, 68.60748f, 23.190918f, -205.577881f); + float3x2 b3 = float3x2(279.4496f, 342.622742f, -300.358521f, -209.694092f, 446.559448f, -351.9892f); + float3x2 r3 = float3x2(565.804932f, 9.203247f, -419.29068f, -141.086609f, 469.750366f, -557.5671f); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void float3x2_operator_add_wide_scalar() + { + float3x2 a0 = float3x2(-194.514191f, 338.5484f, 246.971375f, 100.510925f, -45.72467f, -478.1113f); + float b0 = (124.121704f); + float3x2 r0 = float3x2(-70.39249f, 462.6701f, 371.093079f, 224.632629f, 78.39703f, -353.9896f); + TestUtils.AreEqual(r0, a0 + b0); + + float3x2 a1 = float3x2(30.9161377f, -242.118744f, 82.50134f, 6.79937744f, -484.6998f, -188.265015f); + float b1 = (60.37433f); + float3x2 r1 = float3x2(91.29047f, -181.744415f, 142.875671f, 67.1737061f, -424.32547f, -127.890686f); + TestUtils.AreEqual(r1, a1 + b1); + + float3x2 a2 = float3x2(-213.526733f, 189.259949f, 198.533569f, 187.536072f, -424.925659f, 302.102356f); + float b2 = (-267.7843f); + float3x2 r2 = float3x2(-481.311035f, -78.52435f, -69.25073f, -80.24823f, -692.709961f, 34.3180542f); + TestUtils.AreEqual(r2, a2 + b2); + + float3x2 a3 = float3x2(300.3991f, -200.161346f, 31.3782349f, 362.522156f, -423.988861f, 432.41333f); + float b3 = (124.021606f); + float3x2 r3 = float3x2(424.420715f, -76.13974f, 155.399841f, 486.543762f, -299.967255f, 556.434937f); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void float3x2_operator_add_scalar_wide() + { + float a0 = (-340.354675f); + float3x2 b0 = float3x2(511.362244f, -146.216644f, -106.210419f, -363.450256f, 199.0896f, -27.1083984f); + float3x2 r0 = float3x2(171.007568f, -486.57132f, -446.5651f, -703.804932f, -141.265076f, -367.463074f); + TestUtils.AreEqual(r0, a0 + b0); + + float a1 = (419.849f); + float3x2 b1 = float3x2(284.955017f, -164.9242f, -249.190338f, 150.928162f, 298.1751f, -457.1534f); + float3x2 r1 = float3x2(704.804f, 254.9248f, 170.658661f, 570.777161f, 718.0241f, -37.3044128f); + TestUtils.AreEqual(r1, a1 + b1); + + float a2 = (424.718079f); + float3x2 b2 = float3x2(-301.857483f, 230.288879f, -423.5876f, -67.06003f, 68.72412f, -164.02243f); + float3x2 r2 = float3x2(122.860596f, 655.006958f, 1.13049316f, 357.658051f, 493.4422f, 260.695648f); + TestUtils.AreEqual(r2, a2 + b2); + + float a3 = (318.935181f); + float3x2 b3 = float3x2(7.80456543f, 187.698364f, -3.656952f, -446.083069f, -209.287231f, -38.21289f); + float3x2 r3 = float3x2(326.739746f, 506.633545f, 315.278229f, -127.147888f, 109.647949f, 280.7223f); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void float3x2_operator_sub_wide_wide() + { + float3x2 a0 = float3x2(160.492249f, 11.223938f, 359.200134f, -498.2283f, -355.253632f, -94.53485f); + float3x2 b0 = float3x2(115.46875f, -130.9823f, 241.540833f, 9.987061f, 419.895142f, 59.12445f); + float3x2 r0 = float3x2(45.0235f, 142.206238f, 117.6593f, -508.215363f, -775.1488f, -153.6593f); + TestUtils.AreEqual(r0, a0 - b0); + + float3x2 a1 = float3x2(-410.46405f, -401.384644f, 317.706848f, 447.060425f, -489.074158f, -230.008392f); + float3x2 b1 = float3x2(-402.381653f, -75.37015f, 320.9796f, -73.90875f, -31.4447327f, -389.251953f); + float3x2 r1 = float3x2(-8.082397f, -326.0145f, -3.272766f, 520.9692f, -457.629425f, 159.243561f); + TestUtils.AreEqual(r1, a1 - b1); + + float3x2 a2 = float3x2(24.8754272f, 366.614441f, -107.374146f, -219.008148f, 473.9076f, 259.63623f); + float3x2 b2 = float3x2(-375.028839f, 259.182739f, 276.648682f, -453.0692f, -272.576538f, -191.148041f); + float3x2 r2 = float3x2(399.904266f, 107.4317f, -384.022827f, 234.061066f, 746.484131f, 450.784271f); + TestUtils.AreEqual(r2, a2 - b2); + + float3x2 a3 = float3x2(-360.119629f, 7.80963135f, 437.428467f, -59.1991577f, 418.744324f, 183.142151f); + float3x2 b3 = float3x2(87.1369f, 430.02478f, 343.6571f, 121.029419f, -354.188171f, 249.052f); + float3x2 r3 = float3x2(-447.256531f, -422.215149f, 93.77136f, -180.228577f, 772.9325f, -65.90985f); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void float3x2_operator_sub_wide_scalar() + { + float3x2 a0 = float3x2(207.389587f, 248.457764f, -384.8239f, -205.344757f, -374.811554f, 191.642029f); + float b0 = (-36.1124878f); + float3x2 r0 = float3x2(243.502075f, 284.570251f, -348.711426f, -169.232269f, -338.699066f, 227.754517f); + TestUtils.AreEqual(r0, a0 - b0); + + float3x2 a1 = float3x2(18.8562622f, 480.857971f, 16.3381958f, -366.865448f, -35.5231f, 349.397766f); + float b1 = (-44.96161f); + float3x2 r1 = float3x2(63.81787f, 525.8196f, 61.2998047f, -321.903839f, 9.438507f, 394.359375f); + TestUtils.AreEqual(r1, a1 - b1); + + float3x2 a2 = float3x2(439.077271f, 195.024048f, -384.849426f, 189.05188f, 55.6027832f, -54.931488f); + float b2 = (490.2223f); + float3x2 r2 = float3x2(-51.14502f, -295.198242f, -875.0717f, -301.1704f, -434.6195f, -545.1538f); + TestUtils.AreEqual(r2, a2 - b2); + + float3x2 a3 = float3x2(53.0880737f, -273.8067f, 256.8872f, 297.173645f, 101.829041f, 136.607971f); + float b3 = (316.8025f); + float3x2 r3 = float3x2(-263.714417f, -590.6092f, -59.9152832f, -19.6288452f, -214.97345f, -180.194519f); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void float3x2_operator_sub_scalar_wide() + { + float a0 = (-86.00824f); + float3x2 b0 = float3x2(466.4251f, 298.486938f, -300.9501f, 315.38f, -381.092163f, -125.008362f); + float3x2 r0 = float3x2(-552.43335f, -384.495178f, 214.941864f, -401.388245f, 295.083923f, 39.0001221f); + TestUtils.AreEqual(r0, a0 - b0); + + float a1 = (58.4661865f); + float3x2 b1 = float3x2(214.7461f, -257.549438f, 480.2246f, -443.355072f, 260.795044f, 29.6819458f); + float3x2 r1 = float3x2(-156.2799f, 316.015625f, -421.758423f, 501.821259f, -202.328857f, 28.78424f); + TestUtils.AreEqual(r1, a1 - b1); + + float a2 = (139.857727f); + float3x2 b2 = float3x2(-247.789948f, -248.466217f, 91.44513f, 86.3841553f, 373.8183f, 260.411926f); + float3x2 r2 = float3x2(387.647675f, 388.323944f, 48.4125977f, 53.47357f, -233.960571f, -120.5542f); + TestUtils.AreEqual(r2, a2 - b2); + + float a3 = (114.353943f); + float3x2 b3 = float3x2(-464.405457f, -109.741455f, -311.675354f, 107.864014f, -258.795166f, 14.0975342f); + float3x2 r3 = float3x2(578.7594f, 224.0954f, 426.0293f, 6.489929f, 373.1491f, 100.256409f); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void float3x2_operator_mul_wide_wide() + { + float3x2 a0 = float3x2(-482.7138f, -407.2935f, 137.700562f, 208.541138f, 194.29657f, -484.242432f); + float3x2 b0 = float3x2(-236.367889f, 260.7276f, -416.3863f, -364.4956f, -253.147522f, -369.202881f); + float3x2 r0 = float3x2(114098.047f, -106192.656f, -57336.625f, -76012.33f, -49185.6953f, 178783.7f); + TestUtils.AreEqual(r0, a0 * b0); + + float3x2 a1 = float3x2(183.9873f, -241.33548f, 45.8687744f, 363.3261f, -328.118958f, -471.023071f); + float3x2 b1 = float3x2(193.547913f, 169.0849f, 201.969666f, 249.456055f, -308.193176f, -385.579651f); + float3x2 r1 = float3x2(35610.36f, -40806.1836f, 9264.101f, 90633.9f, 101124.023f, 181616.9f); + TestUtils.AreEqual(r1, a1 * b1); + + float3x2 a2 = float3x2(-262.682556f, -379.262756f, -374.090576f, 481.4474f, 104.628052f, 412.935425f); + float3x2 b2 = float3x2(-183.2796f, 22.2756348f, -265.521423f, -95.67746f, 133.2544f, 148.311462f); + float3x2 r2 = float3x2(48144.3555f, -8448.318f, 99329.06f, -46063.6641f, 13942.1475f, 61243.06f); + TestUtils.AreEqual(r2, a2 * b2); + + float3x2 a3 = float3x2(477.877258f, 20.3778076f, 291.995972f, -138.488312f, -393.464966f, 9.363098f); + float3x2 b3 = float3x2(249.284119f, 500.0055f, -19.3315735f, -36.69107f, 30.5238037f, -401.367f); + float3x2 r3 = float3x2(119127.211f, 10189.0156f, -5644.7417f, 5081.284f, -12010.0479f, -3758.03857f); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void float3x2_operator_mul_wide_scalar() + { + float3x2 a0 = float3x2(-96.31882f, -277.142273f, -239.93689f, 509.531433f, 255.8581f, 215.7315f); + float b0 = (-301.2072f); + float3x2 r0 = float3x2(29011.9219f, 83477.25f, 72270.72f, -153474.547f, -77066.3047f, -64979.8867f); + TestUtils.AreEqual(r0, a0 * b0); + + float3x2 a1 = float3x2(-455.50827f, -338.29248f, 53.7962646f, 243.757324f, 135.354675f, -207.3501f); + float b1 = (-389.2433f); + float3x2 r1 = float3x2(177303.531f, 131678.078f, -20939.834f, -94880.9f, -52685.9f, 80709.63f); + TestUtils.AreEqual(r1, a1 * b1); + + float3x2 a2 = float3x2(-383.9396f, 42.6761475f, 260.38385f, 176.867554f, 25.67212f, -290.5006f); + float b2 = (-31.4252319f); + float3x2 r2 = float3x2(12065.3916f, -1341.10779f, -8182.623f, -5558.104f, -806.7523f, 9129.049f); + TestUtils.AreEqual(r2, a2 * b2); + + float3x2 a3 = float3x2(207.091f, -208.402008f, 370.945068f, -341.59845f, 10.2703247f, -176.888763f); + float b3 = (-156.523315f); + float3x2 r3 = float3x2(-32414.57f, 32619.7734f, -58061.55f, 53468.12f, -1607.54529f, 27687.2148f); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void float3x2_operator_mul_scalar_wide() + { + float a0 = (37.43219f); + float3x2 b0 = float3x2(96.74756f, 492.185364f, -274.054565f, -452.870972f, 420.853333f, 102.182922f); + float3x2 r0 = float3x2(3621.473f, 18423.5762f, -10258.4629f, -16951.9531f, 15753.4619f, 3824.93066f); + TestUtils.AreEqual(r0, a0 * b0); + + float a1 = (-114.948883f); + float3x2 b1 = float3x2(-351.120056f, -464.664978f, 444.084839f, 447.1053f, 130.829346f, -321.41333f); + float3x2 r1 = float3x2(40360.86f, 53412.72f, -51047.0547f, -51394.2539f, -15038.6875f, 36946.1f); + TestUtils.AreEqual(r1, a1 * b1); + + float a2 = (445.301331f); + float3x2 b2 = float3x2(478.2436f, 358.571716f, -144.8901f, -438.893829f, -3.536438f, -471.807556f); + float3x2 r2 = float3x2(212962.5f, 159672.469f, -64519.7578f, -195440f, -1574.78052f, -210096.531f); + TestUtils.AreEqual(r2, a2 * b2); + + float a3 = (-42.5603943f); + float3x2 b3 = float3x2(119.911072f, 271.900024f, 239.684021f, 487.4414f, -79.18829f, -112.925659f); + float3x2 r3 = float3x2(-5103.4624f, -11572.1719f, -10201.0469f, -20745.7f, 3370.285f, 4806.16064f); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void float3x2_operator_div_wide_wide() + { + float3x2 a0 = float3x2(-353.131439f, -102.799866f, 51.3191528f, -191.871674f, 8.041809f, -128.73764f); + float3x2 b0 = float3x2(-178.739563f, -302.096283f, -199.405823f, 278.850769f, 502.3376f, -361.484833f); + float3x2 r0 = float3x2(1.97567582f, 0.34028843f, -0.257360339f, -0.688080132f, 0.0160087738f, 0.356135666f); + TestUtils.AreEqual(r0, a0 / b0); + + float3x2 a1 = float3x2(-136.0596f, -370.471f, -237.69455f, -432.546875f, 200.2655f, 361.4416f); + float3x2 b1 = float3x2(353.121033f, -38.894928f, -75.76474f, -195.217834f, -405.034f, -394.23f); + float3x2 r1 = float3x2(-0.385305852f, 9.524919f, 3.1372714f, 2.215714f, -0.4944412f, -0.9168292f); + TestUtils.AreEqual(r1, a1 / b1); + + float3x2 a2 = float3x2(-416.226135f, -450.0192f, -273.497437f, -286.908173f, -314.256042f, 177.762085f); + float3x2 b2 = float3x2(-375.8277f, -121.245483f, 447.623352f, 338.286255f, -405.5442f, -431.168945f); + float3x2 r2 = float3x2(1.107492f, 3.71163678f, -0.610999048f, -0.8481225f, 0.7748996f, -0.412279427f); + TestUtils.AreEqual(r2, a2 / b2); + + float3x2 a3 = float3x2(97.6270142f, -68.10727f, -386.450745f, 263.699341f, -297.0271f, -501.777039f); + float3x2 b3 = float3x2(296.205139f, 437.939819f, 39.2106323f, 331.289734f, -310.619568f, 207.26947f); + float3x2 r3 = float3x2(0.3295926f, -0.155517414f, -9.855764f, 0.795978f, 0.9562408f, -2.42089224f); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void float3x2_operator_div_wide_scalar() + { + float3x2 a0 = float3x2(171.3424f, 0.103393555f, 57.8882446f, -256.130737f, 95.66968f, -290.3869f); + float b0 = (171.796814f); + float3x2 r0 = float3x2(0.997355f, 0.000601836247f, 0.3369576f, -1.49089336f, 0.5568769f, -1.69029272f); + TestUtils.AreEqual(r0, a0 / b0); + + float3x2 a1 = float3x2(-127.4487f, 146.466858f, -499.843567f, 58.68634f, -453.2058f, -205.033813f); + float b1 = (-79.7449f); + float3x2 r1 = float3x2(1.598205f, -1.83669245f, 6.2680316f, -0.7359259f, 5.68319464f, 2.57112122f); + TestUtils.AreEqual(r1, a1 / b1); + + float3x2 a2 = float3x2(481.738159f, -293.4635f, -158.505585f, -289.5822f, 494.1286f, 203.583435f); + float b2 = (464.479065f); + float3x2 r2 = float3x2(1.037158f, -0.6318121f, -0.341254532f, -0.6234559f, 1.063834f, 0.438304871f); + TestUtils.AreEqual(r2, a2 / b2); + + float3x2 a3 = float3x2(180.9704f, 460.844727f, 490.956238f, -280.478058f, -320.243866f, 192.41449f); + float b3 = (259.1192f); + float3x2 r3 = float3x2(0.698406f, 1.77850473f, 1.89471185f, -1.08242869f, -1.235894f, 0.742571354f); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void float3x2_operator_div_scalar_wide() + { + float a0 = (-264.4425f); + float3x2 b0 = float3x2(105.589111f, -142.349091f, -288.9489f, 39.644104f, -363.9914f, -149.718231f); + float3x2 r0 = float3x2(-2.50444865f, 1.85770416f, 0.9151877f, -6.670412f, 0.7265076f, 1.7662679f); + TestUtils.AreEqual(r0, a0 / b0); + + float a1 = (-395.729126f); + float3x2 b1 = float3x2(258.7187f, -9.66626f, 117.725525f, -331.386536f, -509.986023f, 427.896484f); + float3x2 r1 = float3x2(-1.529573f, 40.93922f, -3.36145568f, 1.19416177f, 0.775960743f, -0.9248244f); + TestUtils.AreEqual(r1, a1 / b1); + + float a2 = (467.617126f); + float3x2 b2 = float3x2(-407.124634f, 252.690735f, 444.599365f, -88.31329f, 199.955017f, -218.346924f); + float3x2 r2 = float3x2(-1.14858472f, 1.85055113f, 1.05177188f, -5.29498f, 2.3386116f, -2.14162445f); + TestUtils.AreEqual(r2, a2 / b2); + + float a3 = (-13.4171753f); + float3x2 b3 = float3x2(-296.131073f, 0.561340332f, -289.299316f, 196.218323f, 334.733459f, -282.392731f); + float3x2 r3 = float3x2(0.0453082323f, -23.9020329f, 0.0463781767f, -0.0683788061f, -0.0400831625f, 0.047512468f); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void float3x2_operator_mod_wide_wide() + { + float3x2 a0 = float3x2(-388.8125f, 181.681213f, -167.078735f, 432.820129f, -258.438965f, -170.110809f); + float3x2 b0 = float3x2(436.944153f, 58.9400635f, -201.116241f, 279.289368f, -397.079773f, 377.899963f); + float3x2 r0 = float3x2(-388.8125f, 4.861023f, -167.078735f, 153.530762f, -258.438965f, -170.110809f); + TestUtils.AreEqual(r0, a0 % b0); + + float3x2 a1 = float3x2(283.3183f, 122.716492f, 335.271f, -503.608521f, 191.022522f, 289.742676f); + float3x2 b1 = float3x2(174.693848f, -228.176514f, -317.060181f, -417.4801f, -249.975952f, -397.571564f); + float3x2 r1 = float3x2(108.624451f, 122.716492f, 18.2108154f, -86.12842f, 191.022522f, 289.742676f); + TestUtils.AreEqual(r1, a1 % b1); + + float3x2 a2 = float3x2(-124.033722f, 259.274f, -274.358459f, -140.030792f, 324.577576f, -200.513092f); + float3x2 b2 = float3x2(-358.745453f, -198.15921f, 208.737122f, -12.1194153f, 25.2714233f, -194.1207f); + float3x2 r2 = float3x2(-124.033722f, 61.1147766f, -65.62134f, -6.717224f, 21.3204956f, -6.392395f); + TestUtils.AreEqual(r2, a2 % b2); + + float3x2 a3 = float3x2(211.423157f, -51.2722168f, -230.633911f, 99.98938f, 399.18988f, 24.90326f); + float3x2 b3 = float3x2(-493.8718f, -312.3017f, -216.980591f, 413.570984f, -436.3944f, 3.491272f); + float3x2 r3 = float3x2(211.423157f, -51.2722168f, -13.65332f, 99.98938f, 399.18988f, 0.464355469f); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void float3x2_operator_mod_wide_scalar() + { + float3x2 a0 = float3x2(-244.499634f, -211.8193f, -145.926788f, -304.9182f, 155.479492f, -133.907776f); + float b0 = (39.63495f); + float3x2 r0 = float3x2(-6.68994141f, -13.6445618f, -27.0219421f, -27.4735718f, 36.574646f, -15.00293f); + TestUtils.AreEqual(r0, a0 % b0); + + float3x2 a1 = float3x2(281.309631f, 335.166138f, 101.706482f, 319.4715f, -285.4023f, -355.846863f); + float b1 = (-226.535767f); + float3x2 r1 = float3x2(54.7738647f, 108.630371f, 101.706482f, 92.93573f, -58.8665466f, -129.3111f); + TestUtils.AreEqual(r1, a1 % b1); + + float3x2 a2 = float3x2(259.378f, -284.343567f, -102.683441f, -172.141754f, 206.41687f, -416.713654f); + float b2 = (-330.871948f); + float3x2 r2 = float3x2(259.378f, -284.343567f, -102.683441f, -172.141754f, 206.41687f, -85.8417053f); + TestUtils.AreEqual(r2, a2 % b2); + + float3x2 a3 = float3x2(-339.256653f, 132.552917f, 226.944092f, -306.1183f, 115.438477f, 281.882935f); + float b3 = (435.2975f); + float3x2 r3 = float3x2(-339.256653f, 132.552917f, 226.944092f, -306.1183f, 115.438477f, 281.882935f); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void float3x2_operator_mod_scalar_wide() + { + float a0 = (-66.94504f); + float3x2 b0 = float3x2(-249.7761f, -396.073761f, 386.492065f, 168.939453f, -199.418243f, 261.7517f); + float3x2 r0 = float3x2(-66.94504f, -66.94504f, -66.94504f, -66.94504f, -66.94504f, -66.94504f); + TestUtils.AreEqual(r0, a0 % b0); + + float a1 = (16.1274414f); + float3x2 b1 = float3x2(257.668152f, -75.78845f, 170.9563f, -242.858276f, 425.9453f, 303.2724f); + float3x2 r1 = float3x2(16.1274414f, 16.1274414f, 16.1274414f, 16.1274414f, 16.1274414f, 16.1274414f); + TestUtils.AreEqual(r1, a1 % b1); + + float a2 = (3.033081f); + float3x2 b2 = float3x2(-505.74353f, 461.957031f, 205.972778f, 270.040649f, -47.4807129f, -150.254486f); + float3x2 r2 = float3x2(3.033081f, 3.033081f, 3.033081f, 3.033081f, 3.033081f, 3.033081f); + TestUtils.AreEqual(r2, a2 % b2); + + float a3 = (149.499512f); + float3x2 b3 = float3x2(-220.298035f, 31.1188354f, 400.635681f, 6.23144531f, -39.05075f, -71.9411f); + float3x2 r3 = float3x2(149.499512f, 25.02417f, 149.499512f, 6.17626953f, 32.34726f, 5.61730957f); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void float3x2_operator_plus() + { + float3x2 a0 = float3x2(-418.829559f, -405.79895f, -34.04178f, 236.999268f, -459.8391f, 210.86145f); + float3x2 r0 = float3x2(-418.829559f, -405.79895f, -34.04178f, 236.999268f, -459.8391f, 210.86145f); + TestUtils.AreEqual(r0, +a0); + + float3x2 a1 = float3x2(293.742f, -386.059845f, 4.95440674f, -418.645264f, 504.474854f, -170.746521f); + float3x2 r1 = float3x2(293.742f, -386.059845f, 4.95440674f, -418.645264f, 504.474854f, -170.746521f); + TestUtils.AreEqual(r1, +a1); + + float3x2 a2 = float3x2(439.5594f, 116.400757f, 421.409668f, -258.596069f, 447.8661f, 124.164368f); + float3x2 r2 = float3x2(439.5594f, 116.400757f, 421.409668f, -258.596069f, 447.8661f, 124.164368f); + TestUtils.AreEqual(r2, +a2); + + float3x2 a3 = float3x2(222.172546f, 239.041809f, 498.449524f, -139.382538f, 279.072937f, 108.775818f); + float3x2 r3 = float3x2(222.172546f, 239.041809f, 498.449524f, -139.382538f, 279.072937f, 108.775818f); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void float3x2_operator_neg() + { + float3x2 a0 = float3x2(148.461731f, -467.122681f, 132.04718f, 183.522644f, 473.701f, -407.9911f); + float3x2 r0 = float3x2(-148.461731f, 467.122681f, -132.04718f, -183.522644f, -473.701f, 407.9911f); + TestUtils.AreEqual(r0, -a0); + + float3x2 a1 = float3x2(-54.95877f, -299.093384f, -383.014069f, 407.709778f, 168.735474f, 466.441528f); + float3x2 r1 = float3x2(54.95877f, 299.093384f, 383.014069f, -407.709778f, -168.735474f, -466.441528f); + TestUtils.AreEqual(r1, -a1); + + float3x2 a2 = float3x2(171.902466f, -78.857605f, 318.69635f, -39.9154053f, 140.340027f, 132.195618f); + float3x2 r2 = float3x2(-171.902466f, 78.857605f, -318.69635f, 39.9154053f, -140.340027f, -132.195618f); + TestUtils.AreEqual(r2, -a2); + + float3x2 a3 = float3x2(-505.895264f, -237.056946f, -137.617828f, -245.349976f, 422.521362f, -434.57135f); + float3x2 r3 = float3x2(505.895264f, 237.056946f, 137.617828f, 245.349976f, -422.521362f, 434.57135f); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void float3x2_operator_prefix_inc() + { + float3x2 a0 = float3x2(-139.842072f, -56.7436523f, -381.955322f, 509.796326f, -222.896332f, 210.319885f); + float3x2 r0 = float3x2(-138.842072f, -55.7436523f, -380.955322f, 510.796326f, -221.896332f, 211.319885f); + TestUtils.AreEqual(r0, ++a0); + + float3x2 a1 = float3x2(-392.7315f, 362.212769f, 401.6148f, 130.90918f, -450.230164f, 243.546936f); + float3x2 r1 = float3x2(-391.7315f, 363.212769f, 402.6148f, 131.90918f, -449.230164f, 244.546936f); + TestUtils.AreEqual(r1, ++a1); + + float3x2 a2 = float3x2(46.1920166f, 299.1855f, 154.356567f, -281.233276f, 200.706f, 92.95776f); + float3x2 r2 = float3x2(47.1920166f, 300.1855f, 155.356567f, -280.233276f, 201.706f, 93.95776f); + TestUtils.AreEqual(r2, ++a2); + + float3x2 a3 = float3x2(448.602173f, 18.4990845f, -215.711121f, 471.947266f, 257.0766f, 41.6259155f); + float3x2 r3 = float3x2(449.602173f, 19.4990845f, -214.711121f, 472.947266f, 258.0766f, 42.6259155f); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void float3x2_operator_postfix_inc() + { + float3x2 a0 = float3x2(-396.669739f, 511.20752f, 249.111267f, -128.817322f, -259.4903f, 278.008179f); + float3x2 r0 = float3x2(-396.669739f, 511.20752f, 249.111267f, -128.817322f, -259.4903f, 278.008179f); + TestUtils.AreEqual(r0, a0++); + + float3x2 a1 = float3x2(-81.39343f, 167.852112f, 147.94397f, -326.1076f, 41.03357f, 128.5304f); + float3x2 r1 = float3x2(-81.39343f, 167.852112f, 147.94397f, -326.1076f, 41.03357f, 128.5304f); + TestUtils.AreEqual(r1, a1++); + + float3x2 a2 = float3x2(73.15558f, -446.229767f, -296.937836f, 267.293823f, 446.2293f, 49.2001953f); + float3x2 r2 = float3x2(73.15558f, -446.229767f, -296.937836f, 267.293823f, 446.2293f, 49.2001953f); + TestUtils.AreEqual(r2, a2++); + + float3x2 a3 = float3x2(-326.643127f, 471.647461f, -171.013092f, 310.727356f, -298.917175f, 489.985f); + float3x2 r3 = float3x2(-326.643127f, 471.647461f, -171.013092f, 310.727356f, -298.917175f, 489.985f); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void float3x2_operator_prefix_dec() + { + float3x2 a0 = float3x2(123.128723f, 256.84375f, 156.330811f, 461.737427f, 325.867981f, 392.015625f); + float3x2 r0 = float3x2(122.128723f, 255.84375f, 155.330811f, 460.737427f, 324.867981f, 391.015625f); + TestUtils.AreEqual(r0, --a0); + + float3x2 a1 = float3x2(187.874146f, 125.109619f, 469.844727f, 45.5366821f, 376.046875f, -363.0755f); + float3x2 r1 = float3x2(186.874146f, 124.109619f, 468.844727f, 44.5366821f, 375.046875f, -364.0755f); + TestUtils.AreEqual(r1, --a1); + + float3x2 a2 = float3x2(-22.0289612f, 168.095032f, 168.265625f, -190.284729f, 166.945557f, 183.957947f); + float3x2 r2 = float3x2(-23.0289612f, 167.095032f, 167.265625f, -191.284729f, 165.945557f, 182.957947f); + TestUtils.AreEqual(r2, --a2); + + float3x2 a3 = float3x2(485.6947f, 89.5698853f, -267.4298f, 201.756226f, -141.216888f, -217.4841f); + float3x2 r3 = float3x2(484.6947f, 88.5698853f, -268.4298f, 200.756226f, -142.216888f, -218.4841f); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void float3x2_operator_postfix_dec() + { + float3x2 a0 = float3x2(379.6883f, 302.692871f, -176.07135f, -291.2527f, 470.567566f, -402.925964f); + float3x2 r0 = float3x2(379.6883f, 302.692871f, -176.07135f, -291.2527f, 470.567566f, -402.925964f); + TestUtils.AreEqual(r0, a0--); + + float3x2 a1 = float3x2(-63.65515f, -27.8892212f, -100.761841f, 156.14032f, 479.9452f, -200.304291f); + float3x2 r1 = float3x2(-63.65515f, -27.8892212f, -100.761841f, 156.14032f, 479.9452f, -200.304291f); + TestUtils.AreEqual(r1, a1--); + + float3x2 a2 = float3x2(-445.026947f, 327.670349f, 48.06018f, -209.667969f, -38.43506f, 283.9416f); + float3x2 r2 = float3x2(-445.026947f, 327.670349f, 48.06018f, -209.667969f, -38.43506f, 283.9416f); + TestUtils.AreEqual(r2, a2--); + + float3x2 a3 = float3x2(-94.80209f, -287.2625f, -215.948029f, -407.046356f, 159.233582f, -359.456482f); + float3x2 r3 = float3x2(-94.80209f, -287.2625f, -215.948029f, -407.046356f, 159.233582f, -359.456482f); + TestUtils.AreEqual(r3, a3--); + } + + [TestCase /* For player builds */] + public static void float3x2_EqualsObjectOverride() + { + TestUtils.IsFalse(new float3x2().Equals((object)new int())); + TestUtils.IsTrue(new float3x2().Equals((object)new float3x2())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestFloat3x2.gen.cs.meta b/src/Tests/Tests/Shared/TestFloat3x2.gen.cs.meta new file mode 100644 index 00000000..e0a2446b --- /dev/null +++ b/src/Tests/Tests/Shared/TestFloat3x2.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5c2a01faa80e74147aeb6f5a1d9fc18d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestFloat3x3.gen.cs b/src/Tests/Tests/Shared/TestFloat3x3.gen.cs new file mode 100644 index 00000000..7561ab09 --- /dev/null +++ b/src/Tests/Tests/Shared/TestFloat3x3.gen.cs @@ -0,0 +1,967 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestFloat3x3 + { + [TestCompiler] + public static void float3x3_zero() + { + TestUtils.AreEqual(0.0f, float3x3.zero.c0.x); + TestUtils.AreEqual(0.0f, float3x3.zero.c0.y); + TestUtils.AreEqual(0.0f, float3x3.zero.c0.z); + TestUtils.AreEqual(0.0f, float3x3.zero.c1.x); + TestUtils.AreEqual(0.0f, float3x3.zero.c1.y); + TestUtils.AreEqual(0.0f, float3x3.zero.c1.z); + TestUtils.AreEqual(0.0f, float3x3.zero.c2.x); + TestUtils.AreEqual(0.0f, float3x3.zero.c2.y); + TestUtils.AreEqual(0.0f, float3x3.zero.c2.z); + } + + [TestCompiler] + public static void float3x3_identity() + { + TestUtils.AreEqual(1.0f, float3x3.identity.c0.x); + TestUtils.AreEqual(0.0f, float3x3.identity.c0.y); + TestUtils.AreEqual(0.0f, float3x3.identity.c0.z); + TestUtils.AreEqual(0.0f, float3x3.identity.c1.x); + TestUtils.AreEqual(1.0f, float3x3.identity.c1.y); + TestUtils.AreEqual(0.0f, float3x3.identity.c1.z); + TestUtils.AreEqual(0.0f, float3x3.identity.c2.x); + TestUtils.AreEqual(0.0f, float3x3.identity.c2.y); + TestUtils.AreEqual(1.0f, float3x3.identity.c2.z); + } + + [TestCompiler] + public static void float3x3_operator_equal_wide_wide() + { + float3x3 a0 = float3x3(492.1576f, -495.206329f, 227.457642f, -147.374054f, -222.682f, 64.09375f, -23.8904114f, -16.8197327f, 163.232117f); + float3x3 b0 = float3x3(192.568787f, -235.611023f, -254.043121f, -412.624725f, 471.9048f, -6.47277832f, -339.102356f, 488.187561f, -379.5966f); + bool3x3 r0 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + float3x3 a1 = float3x3(-165.271f, 470.8777f, -423.942566f, 109.6344f, 462.6903f, -335.38147f, 357.2345f, 1.54559326f, -347.388245f); + float3x3 b1 = float3x3(-308.417f, -82.333374f, -102.921082f, 226.515747f, -356.9013f, -362.912781f, -427.898438f, 466.650146f, -102.799042f); + bool3x3 r1 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + float3x3 a2 = float3x3(-114.472168f, 435.848633f, 194.2381f, 138.765564f, -467.349152f, 370.43335f, 476.708252f, 320.552673f, -498.59198f); + float3x3 b2 = float3x3(-43.355957f, 85.0456543f, -91.1270447f, 422.192078f, -477.4313f, 1.87701416f, 312.580078f, 254.599365f, 352.72583f); + bool3x3 r2 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + float3x3 a3 = float3x3(92.41693f, 104.511353f, 166.754578f, -204.733429f, 434.756775f, -397.329651f, 503.981628f, -503.7141f, 90.65973f); + float3x3 b3 = float3x3(62.4909668f, 119.714783f, -511.058075f, -302.472717f, -371.769226f, -20.007843f, 21.4594727f, -426.0207f, -305.411926f); + bool3x3 r3 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void float3x3_operator_equal_wide_scalar() + { + float3x3 a0 = float3x3(-303.230072f, 451.5263f, -253.655884f, -105.203644f, -500.6911f, -426.192474f, 159.8761f, -59.55838f, -57.4773865f); + float b0 = (123.544556f); + bool3x3 r0 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + float3x3 a1 = float3x3(-182.049744f, 370.886f, -172.035309f, 455.400024f, -11.3389893f, 363.938232f, -27.1505737f, -325.976074f, -290.359039f); + float b1 = (406.513733f); + bool3x3 r1 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + float3x3 a2 = float3x3(180.196838f, -439.358948f, -126.546082f, -197.26178f, -227.159332f, -479.8992f, -439.777679f, -495.237335f, -224.517059f); + float b2 = (-374.128326f); + bool3x3 r2 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + float3x3 a3 = float3x3(-422.833221f, -20.10672f, 297.38f, 185.966553f, -102.975983f, -220.597046f, -228.686859f, -333.001282f, 434.213f); + float b3 = (-450.196259f); + bool3x3 r3 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void float3x3_operator_equal_scalar_wide() + { + float a0 = (-253.397278f); + float3x3 b0 = float3x3(19.95221f, -185.791992f, 407.8136f, -87.2767f, -206.274689f, 160.503113f, -274.7708f, -2.63153076f, 448.354553f); + bool3x3 r0 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + float a1 = (-410.035248f); + float3x3 b1 = float3x3(247.329041f, 355.539124f, -298.0667f, 414.1015f, -481.3026f, 196.55072f, 34.6010132f, 113.7616f, -386.453369f); + bool3x3 r1 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + float a2 = (-124.49176f); + float3x3 b2 = float3x3(243.886658f, -492.6182f, 145.424438f, 421.55072f, -95.40997f, 336.809265f, 209.5838f, 487.4414f, 161.806519f); + bool3x3 r2 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + float a3 = (149.842468f); + float3x3 b3 = float3x3(225.724f, -71.21881f, 85.78027f, 192.547241f, -49.88748f, -229.801971f, -103.407349f, 19.21576f, 492.8811f); + bool3x3 r3 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void float3x3_operator_not_equal_wide_wide() + { + float3x3 a0 = float3x3(430.842529f, 104.69f, 225.802429f, -310.5702f, -418.619446f, 304.128174f, -509.3268f, -160.538086f, -203.301971f); + float3x3 b0 = float3x3(210.024719f, -55.20334f, -269.925354f, -234.546722f, 25.91742f, -63.72699f, -484.5537f, -425.3336f, -53.2743835f); + bool3x3 r0 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + float3x3 a1 = float3x3(-505.763245f, 162.17218f, 1.156189f, 65.66205f, 102.787781f, 172.930054f, 26.6210327f, 235.125977f, 128.541992f); + float3x3 b1 = float3x3(328.1944f, 15.9631348f, 461.7141f, -113.363037f, -240.072968f, 495.119141f, 203.55835f, 340.493469f, -241.9072f); + bool3x3 r1 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + float3x3 a2 = float3x3(-354.996979f, 334.3595f, -495.832f, 468.307373f, 458.370972f, 299.937317f, 43.1271973f, -354.7135f, -145.2872f); + float3x3 b2 = float3x3(459.569824f, 213.07373f, -384.782837f, -255.072327f, 477.663452f, -248.036621f, -407.923462f, -199.788879f, 151.843262f); + bool3x3 r2 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + float3x3 a3 = float3x3(390.80188f, -303.13147f, 391.134583f, 139.286865f, 104.523193f, 511.2964f, 213.147034f, -101.0957f, 441.6634f); + float3x3 b3 = float3x3(-97.1206055f, 154.975891f, -172.834534f, 441.5028f, -401.738617f, -411.430176f, -337.820282f, -430.6309f, -150.8718f); + bool3x3 r3 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void float3x3_operator_not_equal_wide_scalar() + { + float3x3 a0 = float3x3(-16.9145813f, 168.8341f, -462.713531f, 130.307739f, 214.501587f, -440.263275f, -197.12796f, -169.099854f, -386.611176f); + float b0 = (-145.372772f); + bool3x3 r0 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + float3x3 a1 = float3x3(-281.021f, -403.9637f, -269.805725f, 299.654236f, -71.7509155f, -432.755737f, -457.363129f, -13.5195923f, 273.873047f); + float b1 = (-270.26886f); + bool3x3 r1 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + float3x3 a2 = float3x3(185.04248f, 116.395142f, 511.735f, 230.5075f, 100.27478f, 129.682434f, 321.178772f, -220.639f, 140.3352f); + float b2 = (-482.5307f); + bool3x3 r2 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + float3x3 a3 = float3x3(369.212341f, -333.66626f, -373.937744f, 150.204285f, -442.164764f, 372.32f, -95.83798f, 495.5667f, -5.3855896f); + float b3 = (453.811218f); + bool3x3 r3 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void float3x3_operator_not_equal_scalar_wide() + { + float a0 = (275.795837f); + float3x3 b0 = float3x3(-57.1969f, -382.432526f, 97.82037f, -161.463654f, -458.39563f, -499.617859f, 327.92218f, 367.571228f, 59.786377f); + bool3x3 r0 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + float a1 = (-209.580688f); + float3x3 b1 = float3x3(-62.5804443f, -479.974976f, -49.4945068f, -114.685211f, 109.93927f, -176.284821f, -347.4853f, 85.5409546f, -356.659546f); + bool3x3 r1 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + float a2 = (-104.243561f); + float3x3 b2 = float3x3(-133.5492f, 243.539734f, 13.1412964f, -379.985962f, -41.28122f, 87.91168f, -339.077271f, -371.820343f, 333.1443f); + bool3x3 r2 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + float a3 = (294.811951f); + float3x3 b3 = float3x3(-187.14566f, 220.192261f, -228.182068f, -499.723724f, 97.40588f, 501.60437f, 459.6754f, 158.098145f, 358.4886f); + bool3x3 r3 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void float3x3_operator_less_wide_wide() + { + float3x3 a0 = float3x3(196.84259f, 336.4098f, 251.963745f, 257.655945f, 430.0459f, -62.4196472f, 8.839233f, -333.8167f, 164.678833f); + float3x3 b0 = float3x3(-465.345032f, -256.1524f, -314.814026f, 364.5667f, 100.21051f, 182.560974f, 3.11700439f, -259.430481f, -437.3349f); + bool3x3 r0 = bool3x3(false, false, false, true, false, true, false, true, false); + TestUtils.AreEqual(r0, a0 < b0); + + float3x3 a1 = float3x3(-350.9449f, 3.84143066f, 125.409729f, -111.129944f, 70.00549f, 448.1983f, -419.987122f, -258.301666f, -34.8322144f); + float3x3 b1 = float3x3(-456.043732f, -394.255981f, 401.9137f, 313.439148f, 121.286682f, -28.0122986f, -282.965881f, 330.0644f, 124.099365f); + bool3x3 r1 = bool3x3(false, false, true, true, true, false, true, true, true); + TestUtils.AreEqual(r1, a1 < b1); + + float3x3 a2 = float3x3(-69.8594055f, 67.76721f, -139.777283f, 385.434631f, 133.7074f, 506.188354f, 34.44287f, 412.1137f, -84.8097839f); + float3x3 b2 = float3x3(-183.6903f, 373.0608f, 109.750916f, -203.57135f, 45.64868f, -360.952271f, 211.913086f, -313.286377f, -259.661072f); + bool3x3 r2 = bool3x3(false, true, true, false, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + float3x3 a3 = float3x3(444.785339f, -78.75473f, 366.977539f, 127.180481f, 428.368469f, 8.197632f, -71.13736f, -474.0508f, 322.4289f); + float3x3 b3 = float3x3(79.09851f, 446.4961f, 450.524536f, -375.630768f, -53.9418335f, -291.453735f, 190.774841f, 54.0839233f, -163.63089f); + bool3x3 r3 = bool3x3(false, true, true, false, false, false, true, true, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void float3x3_operator_less_wide_scalar() + { + float3x3 a0 = float3x3(-132.057312f, -192.465f, -66.8345947f, -379.017517f, -360.2824f, 20.9278564f, -158.240753f, 437.3459f, -20.4526062f); + float b0 = (-156.010223f); + bool3x3 r0 = bool3x3(false, true, false, true, true, false, true, false, false); + TestUtils.AreEqual(r0, a0 < b0); + + float3x3 a1 = float3x3(225.2915f, 274.015259f, 373.549683f, 398.523682f, 105.030151f, -58.0108948f, 109.670105f, -108.85318f, -44.9712524f); + float b1 = (307.4842f); + bool3x3 r1 = bool3x3(true, true, false, false, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 < b1); + + float3x3 a2 = float3x3(140.426086f, 172.103333f, -197.500732f, -7.271515f, -432.9905f, 62.1583252f, -72.25473f, -377.852325f, -500.255737f); + float b2 = (-500.0883f); + bool3x3 r2 = bool3x3(false, false, false, false, false, false, false, false, true); + TestUtils.AreEqual(r2, a2 < b2); + + float3x3 a3 = float3x3(149.11499f, 202.63916f, 274.950684f, 66.41205f, 274.999451f, -149.6358f, 223.758728f, 73.2668457f, 213.094971f); + float b3 = (119.880615f); + bool3x3 r3 = bool3x3(false, false, false, true, false, true, false, true, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void float3x3_operator_less_scalar_wide() + { + float a0 = (-423.1174f); + float3x3 b0 = float3x3(385.094849f, -123.933472f, 86.37659f, 133.4422f, 161.457947f, 229.754272f, 222.5716f, 315.5312f, -447.203522f); + bool3x3 r0 = bool3x3(true, true, true, true, true, true, true, true, false); + TestUtils.AreEqual(r0, a0 < b0); + + float a1 = (271.833862f); + float3x3 b1 = float3x3(-393.605316f, 317.486877f, -164.6051f, -282.876038f, 296.979553f, -254.401154f, 365.6156f, -441.984253f, -131.42865f); + bool3x3 r1 = bool3x3(false, true, false, false, true, false, true, false, false); + TestUtils.AreEqual(r1, a1 < b1); + + float a2 = (442.628967f); + float3x3 b2 = float3x3(-29.7928467f, -138.37381f, 9.21698f, -226.73056f, 171.029419f, 376.625244f, -462.5887f, -142.36731f, -456.253784f); + bool3x3 r2 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + float a3 = (66.61023f); + float3x3 b3 = float3x3(169.378784f, 327.4444f, 64.08795f, -153.5039f, 199.380127f, -244.969055f, 472.743835f, -363.7801f, -179.487518f); + bool3x3 r3 = bool3x3(true, true, false, false, true, false, true, false, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void float3x3_operator_greater_wide_wide() + { + float3x3 a0 = float3x3(483.5014f, 310.8156f, 106.966187f, 295.7353f, 116.957581f, -478.299774f, -14.8974f, -33.8174438f, -24.74054f); + float3x3 b0 = float3x3(-471.398f, -371.9853f, 36.9006958f, -316.7636f, 19.6830444f, 207.309143f, 362.7975f, 324.95343f, 340.948059f); + bool3x3 r0 = bool3x3(true, true, true, true, true, false, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + float3x3 a1 = float3x3(319.782654f, -120.158569f, -289.008575f, 455.85144f, 144.706909f, 63.9320068f, -285.683044f, -502.090729f, -337.194458f); + float3x3 b1 = float3x3(25.9860229f, -114.211121f, 240.803467f, 273.422424f, 325.515747f, 27.3410645f, 64.47955f, 200.948364f, 100.122681f); + bool3x3 r1 = bool3x3(true, false, false, true, false, true, false, false, false); + TestUtils.AreEqual(r1, a1 > b1); + + float3x3 a2 = float3x3(474.317322f, -507.1451f, -133.565582f, -443.109131f, -464.34137f, -68.36154f, -185.993011f, -157.8039f, -74.12424f); + float3x3 b2 = float3x3(-79.00711f, -315.137939f, -122.985443f, -163.7792f, -492.566f, -90.79727f, -284.901245f, -23.6536865f, 174.93f); + bool3x3 r2 = bool3x3(true, false, false, false, true, true, true, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + float3x3 a3 = float3x3(-94.47116f, 329.610535f, -315.836731f, 404.1938f, 131.304382f, -206.633911f, 197.399841f, 187.991943f, 362.636047f); + float3x3 b3 = float3x3(85.7125244f, -441.987823f, 345.543762f, 482.219482f, -422.383484f, -30.7792969f, 296.154236f, 378.059875f, -457.733429f); + bool3x3 r3 = bool3x3(false, true, false, false, true, false, false, false, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void float3x3_operator_greater_wide_scalar() + { + float3x3 a0 = float3x3(64.31793f, -397.703461f, 431.8769f, 85.703f, 246.263062f, 197.491577f, 286.199463f, 280.813354f, -405.7846f); + float b0 = (305.859924f); + bool3x3 r0 = bool3x3(false, false, true, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + float3x3 a1 = float3x3(171.565369f, 333.5782f, 370.279175f, -413.7014f, -356.592346f, -353.0313f, 396.645325f, 467.222046f, -240.013428f); + float b1 = (-241.807281f); + bool3x3 r1 = bool3x3(true, true, true, false, false, false, true, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + float3x3 a2 = float3x3(502.915039f, -259.2897f, 281.230652f, 428.792175f, 245.153076f, -279.1754f, -453.8631f, -124.771545f, -425.652924f); + float b2 = (315.4676f); + bool3x3 r2 = bool3x3(true, false, false, true, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + float3x3 a3 = float3x3(99.13287f, -456.439423f, 154.489014f, 405.529724f, -157.7338f, 186.0863f, 249.999084f, -110.096924f, -435.3045f); + float b3 = (355.060547f); + bool3x3 r3 = bool3x3(false, false, false, true, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void float3x3_operator_greater_scalar_wide() + { + float a0 = (-282.6705f); + float3x3 b0 = float3x3(358.099976f, -72.596405f, -232.163788f, -60.7067261f, 75.15662f, 150.883484f, 339.539185f, -498.196045f, 459.7461f); + bool3x3 r0 = bool3x3(false, false, false, false, false, false, false, true, false); + TestUtils.AreEqual(r0, a0 > b0); + + float a1 = (-227.968719f); + float3x3 b1 = float3x3(335.862122f, 76.17883f, 296.859924f, 177.48999f, -281.2012f, 244.722839f, 137.328552f, -385.338257f, 443.163452f); + bool3x3 r1 = bool3x3(false, false, false, false, true, false, false, true, false); + TestUtils.AreEqual(r1, a1 > b1); + + float a2 = (-353.562561f); + float3x3 b2 = float3x3(26.04065f, -331.793945f, -43.6919556f, 20.9494019f, -211.17984f, 227.421692f, -84.7797852f, -375.1355f, -205.178131f); + bool3x3 r2 = bool3x3(false, false, false, false, false, false, false, true, false); + TestUtils.AreEqual(r2, a2 > b2); + + float a3 = (-197.04715f); + float3x3 b3 = float3x3(-219.634033f, -210.015625f, -266.7737f, 144.7785f, -471.7112f, -155.913177f, 99.72473f, -230.944855f, -338.8689f); + bool3x3 r3 = bool3x3(true, true, true, false, true, false, false, true, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void float3x3_operator_less_equal_wide_wide() + { + float3x3 a0 = float3x3(-438.523132f, 210.489441f, 4.87731934f, -137.297943f, 156.094116f, -363.924133f, -97.94849f, 437.2954f, 458.530273f); + float3x3 b0 = float3x3(-474.814148f, 304.371033f, 234.824158f, -390.485443f, -297.175354f, -326.2924f, 107.253906f, -413.131073f, 67.09442f); + bool3x3 r0 = bool3x3(false, true, true, false, false, true, true, false, false); + TestUtils.AreEqual(r0, a0 <= b0); + + float3x3 a1 = float3x3(-294.064758f, 23.62262f, -34.2840576f, 149.736511f, -418.8867f, -197.502533f, -88.2055054f, -376.71814f, 341.627136f); + float3x3 b1 = float3x3(470.075256f, -84.499115f, 392.784241f, -263.531738f, 369.3009f, -333.3253f, 238.413452f, 486.2426f, 279.6502f); + bool3x3 r1 = bool3x3(true, false, true, false, true, false, true, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + float3x3 a2 = float3x3(-83.30917f, -107.490723f, 319.466858f, 205.357361f, 345.563721f, 395.3219f, -222.874146f, 439.022034f, -368.075562f); + float3x3 b2 = float3x3(236.052f, 132.758972f, 66.29474f, 183.002136f, 200.130554f, 339.043823f, 438.5379f, 145.401855f, 178.163086f); + bool3x3 r2 = bool3x3(true, true, false, false, false, false, true, false, true); + TestUtils.AreEqual(r2, a2 <= b2); + + float3x3 a3 = float3x3(-200.0386f, 71.46991f, -357.365417f, 141.710876f, 319.0171f, 303.030151f, -461.574249f, 277.62677f, 182.1781f); + float3x3 b3 = float3x3(157.975952f, 329.7052f, -243.590912f, 5.401184f, -22.5805969f, -90.3375854f, -72.19107f, -354.354828f, -289.521729f); + bool3x3 r3 = bool3x3(true, true, true, false, false, false, true, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void float3x3_operator_less_equal_wide_scalar() + { + float3x3 a0 = float3x3(193.49585f, 168.915527f, -313.993073f, 81.8269653f, 18.5036011f, -0.3581848f, 241.361145f, -463.8164f, -1.35775757f); + float b0 = (443.850525f); + bool3x3 r0 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + float3x3 a1 = float3x3(-268.899475f, -471.253082f, -264.9378f, 82.2583f, 11.2460327f, 424.704041f, 426.482239f, 56.3200073f, -196.2879f); + float b1 = (398.991943f); + bool3x3 r1 = bool3x3(true, true, true, true, true, false, false, true, true); + TestUtils.AreEqual(r1, a1 <= b1); + + float3x3 a2 = float3x3(31.9011841f, -437.926453f, -37.1048279f, -47.1442261f, 333.623047f, -274.8039f, 358.67627f, -260.460571f, 192.309143f); + float b2 = (-152.257568f); + bool3x3 r2 = bool3x3(false, true, false, false, false, true, false, true, false); + TestUtils.AreEqual(r2, a2 <= b2); + + float3x3 a3 = float3x3(145.306091f, -494.267334f, -111.570129f, -139.5412f, -146.589355f, 33.98401f, -445.704468f, -451.0422f, -122.039276f); + float b3 = (-466.132965f); + bool3x3 r3 = bool3x3(false, true, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void float3x3_operator_less_equal_scalar_wide() + { + float a0 = (393.606262f); + float3x3 b0 = float3x3(-75.6883545f, -44.2638855f, 125.864929f, 191.9649f, 13.54303f, -197.051941f, -423.9451f, -330.0486f, 420.165527f); + bool3x3 r0 = bool3x3(false, false, false, false, false, false, false, false, true); + TestUtils.AreEqual(r0, a0 <= b0); + + float a1 = (105.5473f); + float3x3 b1 = float3x3(174.821289f, 296.7176f, -469.7004f, 123.267212f, 112.996948f, 495.143372f, -488.6579f, 388.539429f, -493.240784f); + bool3x3 r1 = bool3x3(true, true, false, true, true, true, false, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + float a2 = (16.45105f); + float3x3 b2 = float3x3(-387.651642f, -229.1773f, -373.01532f, -391.142151f, 90.99414f, -178.396149f, -69.62106f, 471.790833f, -67.46677f); + bool3x3 r2 = bool3x3(false, false, false, false, true, false, false, true, false); + TestUtils.AreEqual(r2, a2 <= b2); + + float a3 = (45.30536f); + float3x3 b3 = float3x3(-154.6922f, 385.7389f, -431.652954f, -331.673035f, -349.8927f, -114.839142f, -245.217834f, -486.6955f, 391.950928f); + bool3x3 r3 = bool3x3(false, true, false, false, false, false, false, false, true); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void float3x3_operator_greater_equal_wide_wide() + { + float3x3 a0 = float3x3(-507.9286f, 504.4975f, -385.4345f, -262.323425f, -37.5509338f, -111.595276f, -463.702026f, 387.448853f, 456.9688f); + float3x3 b0 = float3x3(-81.3465f, 297.666138f, 171.06543f, -431.038055f, -6.85907f, 319.7257f, 254.079163f, 396.5724f, 178.8393f); + bool3x3 r0 = bool3x3(false, true, false, true, false, false, false, false, true); + TestUtils.AreEqual(r0, a0 >= b0); + + float3x3 a1 = float3x3(-211.010162f, 182.411377f, -53.59604f, -309.570221f, -136.022491f, 280.736267f, -96.99588f, -174.059509f, 88.90192f); + float3x3 b1 = float3x3(-447.063354f, 288.492676f, 474.889282f, -321.750244f, -395.977234f, -158.692474f, 391.4887f, -368.109253f, 89.12378f); + bool3x3 r1 = bool3x3(true, false, false, true, true, true, false, true, false); + TestUtils.AreEqual(r1, a1 >= b1); + + float3x3 a2 = float3x3(43.81604f, -446.07843f, 16.6455688f, 409.83252f, -191.329865f, 222.9978f, 404.2884f, 230.603271f, -441.789276f); + float3x3 b2 = float3x3(-510.279327f, -486.9298f, -81.2155457f, 274.2188f, -212.881561f, 288.9953f, 307.73175f, 307.245178f, -199.391785f); + bool3x3 r2 = bool3x3(true, true, true, true, true, false, true, false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + float3x3 a3 = float3x3(-86.29306f, 484.249573f, 95.23639f, -204.912109f, -199.774353f, -421.8632f, -18.2147827f, -346.822754f, -159.243652f); + float3x3 b3 = float3x3(-284.421265f, -482.3918f, 448.315735f, -378.3462f, -390.858459f, 8.916016f, 416.407227f, -213.674957f, 455.2481f); + bool3x3 r3 = bool3x3(true, true, false, true, true, false, false, false, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void float3x3_operator_greater_equal_wide_scalar() + { + float3x3 a0 = float3x3(465.152161f, -424.886078f, -209.2211f, 58.7798462f, -302.2691f, 140.12561f, 16.3533936f, -344.559967f, 393.278076f); + float b0 = (-5.599884f); + bool3x3 r0 = bool3x3(true, false, false, true, false, true, true, false, true); + TestUtils.AreEqual(r0, a0 >= b0); + + float3x3 a1 = float3x3(-315.701538f, -509.781555f, -36.9942932f, 494.8203f, -164.973938f, -466.1201f, -123.813751f, 215.651245f, 104.995728f); + float b1 = (441.011536f); + bool3x3 r1 = bool3x3(false, false, false, true, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + float3x3 a2 = float3x3(314.346f, -83.11142f, -23.8364258f, 143.049377f, -264.919983f, -169.702209f, 329.70752f, 359.095825f, -260.4233f); + float b2 = (190.516113f); + bool3x3 r2 = bool3x3(true, false, false, false, false, false, true, true, false); + TestUtils.AreEqual(r2, a2 >= b2); + + float3x3 a3 = float3x3(354.195129f, 33.309082f, 355.6313f, -435.360565f, -38.3993225f, -93.2957153f, -338.8496f, 436.8958f, 511.084167f); + float b3 = (-111.845337f); + bool3x3 r3 = bool3x3(true, true, true, false, true, true, false, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void float3x3_operator_greater_equal_scalar_wide() + { + float a0 = (374.827026f); + float3x3 b0 = float3x3(-1.60977173f, 338.615234f, -116.1814f, -332.157318f, -355.97937f, -468.901428f, 38.579895f, -332.347534f, 2.89013672f); + bool3x3 r0 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + float a1 = (467.777771f); + float3x3 b1 = float3x3(121.406372f, -305.023376f, -58.4288025f, -226.519562f, -47.0209961f, 305.302673f, -427.401245f, 92.26367f, -497.178528f); + bool3x3 r1 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 >= b1); + + float a2 = (-408.625641f); + float3x3 b2 = float3x3(-455.2305f, 396.4261f, -469.2949f, -485.754028f, -182.346191f, -291.545349f, 278.740784f, -75.8711243f, 28.9070435f); + bool3x3 r2 = bool3x3(true, false, true, true, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + float a3 = (287.720154f); + float3x3 b3 = float3x3(420.509766f, 473.626831f, 181.514526f, -369.202881f, 243.749756f, -244.124146f, -242.993347f, -322.115356f, 192.974976f); + bool3x3 r3 = bool3x3(false, false, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void float3x3_operator_add_wide_wide() + { + float3x3 a0 = float3x3(506.129028f, -501.779816f, 420.084778f, -186.032074f, -9.312408f, 328.51178f, 424.344055f, 87.79108f, 462.4137f); + float3x3 b0 = float3x3(-28.7579956f, -337.135132f, -340.676819f, 152.312012f, 423.66748f, 90.3740845f, 376.18866f, 1.76721191f, -120.185852f); + float3x3 r0 = float3x3(477.371033f, -838.9149f, 79.40796f, -33.7200623f, 414.355072f, 418.885864f, 800.5327f, 89.55829f, 342.227844f); + TestUtils.AreEqual(r0, a0 + b0); + + float3x3 a1 = float3x3(-46.17871f, 401.170044f, -454.124146f, 69.19568f, -177.957336f, 299.604126f, 340.704834f, 219.916016f, -321.9084f); + float3x3 b1 = float3x3(-279.629364f, -344.6671f, 242.839172f, 418.593079f, -23.3128052f, -95.0999451f, 147.9281f, 331.0329f, -82.50256f); + float3x3 r1 = float3x3(-325.808075f, 56.50293f, -211.284973f, 487.788757f, -201.270142f, 204.504181f, 488.632935f, 550.9489f, -404.41095f); + TestUtils.AreEqual(r1, a1 + b1); + + float3x3 a2 = float3x3(286.355347f, -333.4195f, -118.932159f, 68.60748f, 23.190918f, -205.577881f, 11.5214233f, -340.795074f, -68.93118f); + float3x3 b2 = float3x3(279.4496f, 342.622742f, -300.358521f, -209.694092f, 446.559448f, -351.9892f, -263.12384f, -252.458557f, 289.825378f); + float3x3 r2 = float3x3(565.804932f, 9.203247f, -419.29068f, -141.086609f, 469.750366f, -557.5671f, -251.602417f, -593.253662f, 220.8942f); + TestUtils.AreEqual(r2, a2 + b2); + + float3x3 a3 = float3x3(304.8532f, -86.63385f, 105.669128f, 349.280518f, 364.7079f, -429.0374f, 382.458069f, 186.097046f, 227.411865f); + float3x3 b3 = float3x3(338.796143f, -232.619019f, -510.50824f, 349.280762f, -426.212463f, -331.416321f, -418.6888f, -341.70636f, -329.0359f); + float3x3 r3 = float3x3(643.649353f, -319.252869f, -404.8391f, 698.5613f, -61.5045776f, -760.453735f, -36.2307434f, -155.609314f, -101.624023f); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void float3x3_operator_add_wide_scalar() + { + float3x3 a0 = float3x3(-194.514191f, 338.5484f, 246.971375f, 100.510925f, -45.72467f, -478.1113f, 30.9161377f, 60.37433f, -242.118744f); + float b0 = (124.121704f); + float3x3 r0 = float3x3(-70.39249f, 462.6701f, 371.093079f, 224.632629f, 78.39703f, -353.9896f, 155.037842f, 184.496033f, -117.99704f); + TestUtils.AreEqual(r0, a0 + b0); + + float3x3 a1 = float3x3(82.50134f, -484.6998f, -188.265015f, -213.526733f, -267.7843f, 189.259949f, 198.533569f, 187.536072f, -424.925659f); + float b1 = (6.79937744f); + float3x3 r1 = float3x3(89.30072f, -477.900421f, -181.465637f, -206.727356f, -260.984924f, 196.059326f, 205.332947f, 194.335449f, -418.126282f); + TestUtils.AreEqual(r1, a1 + b1); + + float3x3 a2 = float3x3(302.102356f, 124.021606f, -200.161346f, 31.3782349f, 362.522156f, -423.988861f, 432.41333f, 374.211426f, -465.6995f); + float b2 = (300.3991f); + float3x3 r2 = float3x3(602.501465f, 424.420715f, 100.237762f, 331.777344f, 662.921265f, -123.589752f, 732.812439f, 674.610535f, -165.300385f); + TestUtils.AreEqual(r2, a2 + b2); + + float3x3 a3 = float3x3(-311.04303f, -432.442444f, 235.750671f, -472.637756f, -257.577759f, 186.120728f, -170.298218f, -115.272491f, -101.168823f); + float b3 = (84.91901f); + float3x3 r3 = float3x3(-226.124023f, -347.523438f, 320.669678f, -387.71875f, -172.658752f, 271.039734f, -85.37921f, -30.3534851f, -16.2498169f); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void float3x3_operator_add_scalar_wide() + { + float a0 = (-340.354675f); + float3x3 b0 = float3x3(511.362244f, -146.216644f, -106.210419f, -363.450256f, 199.0896f, -27.1083984f, 419.849f, 284.955017f, -164.9242f); + float3x3 r0 = float3x3(171.007568f, -486.57132f, -446.5651f, -703.804932f, -141.265076f, -367.463074f, 79.49432f, -55.39966f, -505.27887f); + TestUtils.AreEqual(r0, a0 + b0); + + float a1 = (-249.190338f); + float3x3 b1 = float3x3(150.928162f, 298.1751f, -457.1534f, 424.718079f, -301.857483f, 230.288879f, -423.5876f, -67.06003f, 68.72412f); + float3x3 r1 = float3x3(-98.26218f, 48.98477f, -706.34375f, 175.52774f, -551.047852f, -18.9014587f, -672.777954f, -316.250366f, -180.466217f); + TestUtils.AreEqual(r1, a1 + b1); + + float a2 = (-164.02243f); + float3x3 b2 = float3x3(318.935181f, 7.80456543f, 187.698364f, -3.656952f, -446.083069f, -209.287231f, -38.21289f, -346.257172f, 465.607422f); + float3x3 r2 = float3x3(154.91275f, -156.217865f, 23.6759338f, -167.679382f, -610.105469f, -373.309662f, -202.235321f, -510.2796f, 301.585f); + TestUtils.AreEqual(r2, a2 + b2); + + float a3 = (-192.185944f); + float3x3 b3 = float3x3(278.6938f, 381.978455f, 481.243652f, -97.22815f, -455.513733f, 501.834961f, 358.7066f, 430.699768f, 256.987183f); + float3x3 r3 = float3x3(86.50784f, 189.792511f, 289.0577f, -289.4141f, -647.6997f, 309.649017f, 166.52066f, 238.513824f, 64.80124f); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void float3x3_operator_sub_wide_wide() + { + float3x3 a0 = float3x3(160.492249f, 11.223938f, 359.200134f, -498.2283f, -355.253632f, -94.53485f, -410.46405f, -401.384644f, 317.706848f); + float3x3 b0 = float3x3(115.46875f, -130.9823f, 241.540833f, 9.987061f, 419.895142f, 59.12445f, -402.381653f, -75.37015f, 320.9796f); + float3x3 r0 = float3x3(45.0235f, 142.206238f, 117.6593f, -508.215363f, -775.1488f, -153.6593f, -8.082397f, -326.0145f, -3.272766f); + TestUtils.AreEqual(r0, a0 - b0); + + float3x3 a1 = float3x3(447.060425f, -489.074158f, -230.008392f, 24.8754272f, 366.614441f, -107.374146f, -219.008148f, 473.9076f, 259.63623f); + float3x3 b1 = float3x3(-73.90875f, -31.4447327f, -389.251953f, -375.028839f, 259.182739f, 276.648682f, -453.0692f, -272.576538f, -191.148041f); + float3x3 r1 = float3x3(520.9692f, -457.629425f, 159.243561f, 399.904266f, 107.4317f, -384.022827f, 234.061066f, 746.484131f, 450.784271f); + TestUtils.AreEqual(r1, a1 - b1); + + float3x3 a2 = float3x3(-360.119629f, 7.80963135f, 437.428467f, -59.1991577f, 418.744324f, 183.142151f, 271.230347f, 496.208557f, 165.354919f); + float3x3 b2 = float3x3(87.1369f, 430.02478f, 343.6571f, 121.029419f, -354.188171f, 249.052f, -2.22543335f, 22.4472656f, 478.112976f); + float3x3 r2 = float3x3(-447.256531f, -422.215149f, 93.77136f, -180.228577f, 772.9325f, -65.90985f, 273.45578f, 473.7613f, -312.758057f); + TestUtils.AreEqual(r2, a2 - b2); + + float3x3 a3 = float3x3(-227.403656f, -166.522858f, 356.142273f, 386.9264f, -394.638763f, 126.903259f, 97.21692f, -150.017853f, -227.250519f); + float3x3 b3 = float3x3(-320.063f, -111.524109f, 222.228943f, -245.411072f, -119.902283f, -153.465668f, 374.1125f, 301.763428f, -281.430054f); + float3x3 r3 = float3x3(92.65933f, -54.99875f, 133.91333f, 632.337463f, -274.736481f, 280.368927f, -276.895569f, -451.781281f, 54.1795349f); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void float3x3_operator_sub_wide_scalar() + { + float3x3 a0 = float3x3(207.389587f, 248.457764f, -384.8239f, -205.344757f, -374.811554f, 191.642029f, 18.8562622f, -44.96161f, 480.857971f); + float b0 = (-36.1124878f); + float3x3 r0 = float3x3(243.502075f, 284.570251f, -348.711426f, -169.232269f, -338.699066f, 227.754517f, 54.96875f, -8.849121f, 516.970459f); + TestUtils.AreEqual(r0, a0 - b0); + + float3x3 a1 = float3x3(16.3381958f, -35.5231f, 349.397766f, 439.077271f, 490.2223f, 195.024048f, -384.849426f, 189.05188f, 55.6027832f); + float b1 = (-366.865448f); + float3x3 r1 = float3x3(383.203644f, 331.342346f, 716.2632f, 805.942749f, 857.087769f, 561.8895f, -17.9839783f, 555.917358f, 422.468231f); + TestUtils.AreEqual(r1, a1 - b1); + + float3x3 a2 = float3x3(-54.931488f, 316.8025f, -273.8067f, 256.8872f, 297.173645f, 101.829041f, 136.607971f, -19.7322083f, 336.589722f); + float b2 = (53.0880737f); + float3x3 r2 = float3x3(-108.019562f, 263.714417f, -326.894775f, 203.799133f, 244.085571f, 48.7409668f, 83.5199f, -72.82028f, 283.501648f); + TestUtils.AreEqual(r2, a2 - b2); + + float3x3 a3 = float3x3(-51.8765564f, -467.055939f, -50.1670532f, 477.804565f, -60.82193f, 0.4111328f, 46.66095f, -19.241394f, 396.809753f); + float b3 = (317.345764f); + float3x3 r3 = float3x3(-369.222321f, -784.401733f, -367.512817f, 160.4588f, -378.1677f, -316.934631f, -270.6848f, -336.587158f, 79.46399f); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void float3x3_operator_sub_scalar_wide() + { + float a0 = (-86.00824f); + float3x3 b0 = float3x3(466.4251f, 298.486938f, -300.9501f, 315.38f, -381.092163f, -125.008362f, 58.4661865f, 214.7461f, -257.549438f); + float3x3 r0 = float3x3(-552.43335f, -384.495178f, 214.941864f, -401.388245f, 295.083923f, 39.0001221f, -144.474426f, -300.754333f, 171.5412f); + TestUtils.AreEqual(r0, a0 - b0); + + float a1 = (480.2246f); + float3x3 b1 = float3x3(-443.355072f, 260.795044f, 29.6819458f, 139.857727f, -247.789948f, -248.466217f, 91.44513f, 86.3841553f, 373.8183f); + float3x3 r1 = float3x3(923.5797f, 219.429565f, 450.542664f, 340.366882f, 728.0145f, 728.6908f, 388.77948f, 393.840454f, 106.406311f); + TestUtils.AreEqual(r1, a1 - b1); + + float a2 = (260.411926f); + float3x3 b2 = float3x3(114.353943f, -464.405457f, -109.741455f, -311.675354f, 107.864014f, -258.795166f, 14.0975342f, -461.970184f, 30.3108521f); + float3x3 r2 = float3x3(146.057983f, 724.8174f, 370.153381f, 572.0873f, 152.547913f, 519.2071f, 246.314392f, 722.3821f, 230.101074f); + TestUtils.AreEqual(r2, a2 - b2); + + float a3 = (63.70111f); + float3x3 b3 = float3x3(-462.676758f, 39.75946f, 47.99817f, -177.6193f, 202.477051f, -289.3088f, -459.9254f, 248.386658f, 85.32971f); + float3x3 r3 = float3x3(526.377869f, 23.94165f, 15.7029419f, 241.3204f, -138.77594f, 353.009918f, 523.6265f, -184.685547f, -21.6286011f); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void float3x3_operator_mul_wide_wide() + { + float3x3 a0 = float3x3(-482.7138f, -407.2935f, 137.700562f, 208.541138f, 194.29657f, -484.242432f, 183.9873f, -241.33548f, 45.8687744f); + float3x3 b0 = float3x3(-236.367889f, 260.7276f, -416.3863f, -364.4956f, -253.147522f, -369.202881f, 193.547913f, 169.0849f, 201.969666f); + float3x3 r0 = float3x3(114098.047f, -106192.656f, -57336.625f, -76012.33f, -49185.6953f, 178783.7f, 35610.36f, -40806.1836f, 9264.101f); + TestUtils.AreEqual(r0, a0 * b0); + + float3x3 a1 = float3x3(363.3261f, -328.118958f, -471.023071f, -262.682556f, -379.262756f, -374.090576f, 481.4474f, 104.628052f, 412.935425f); + float3x3 b1 = float3x3(249.456055f, -308.193176f, -385.579651f, -183.2796f, 22.2756348f, -265.521423f, -95.67746f, 133.2544f, 148.311462f); + float3x3 r1 = float3x3(90633.9f, 101124.023f, 181616.9f, 48144.3555f, -8448.318f, 99329.06f, -46063.6641f, 13942.1475f, 61243.06f); + TestUtils.AreEqual(r1, a1 * b1); + + float3x3 a2 = float3x3(477.877258f, 20.3778076f, 291.995972f, -138.488312f, -393.464966f, 9.363098f, -131.942291f, 364.449646f, 390.615967f); + float3x3 b2 = float3x3(249.284119f, 500.0055f, -19.3315735f, -36.69107f, 30.5238037f, -401.367f, 3.43725586f, 257.24176f, -290.971924f); + float3x3 r2 = float3x3(119127.211f, 10189.0156f, -5644.7417f, 5081.284f, -12010.0479f, -3758.03857f, -453.5194f, 93751.67f, -113658.281f); + TestUtils.AreEqual(r2, a2 * b2); + + float3x3 a3 = float3x3(418.797974f, -277.3448f, 11.4101563f, 474.876465f, -502.405029f, -222.59491f, 38.1690674f, 292.6125f, 203.2077f); + float3x3 b3 = float3x3(337.47937f, 490.286133f, -191.0198f, -325.7345f, -52.1819763f, 123.435059f, -461.267059f, 122.353088f, 308.584656f); + float3x3 r3 = float3x3(141335.672f, -135978.3f, -2179.566f, -154683.641f, 26216.4883f, -27476.0156f, -17606.1328f, 35802.043f, 62706.7773f); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void float3x3_operator_mul_wide_scalar() + { + float3x3 a0 = float3x3(-96.31882f, -277.142273f, -239.93689f, 509.531433f, 255.8581f, 215.7315f, -455.50827f, -389.2433f, -338.29248f); + float b0 = (-301.2072f); + float3x3 r0 = float3x3(29011.9219f, 83477.25f, 72270.72f, -153474.547f, -77066.3047f, -64979.8867f, 137202.375f, 117242.883f, 101896.133f); + TestUtils.AreEqual(r0, a0 * b0); + + float3x3 a1 = float3x3(53.7962646f, 135.354675f, -207.3501f, -383.9396f, -31.4252319f, 42.6761475f, 260.38385f, 176.867554f, 25.67212f); + float b1 = (243.757324f); + float3x3 r1 = float3x3(13113.2334f, 32993.6953f, -50543.1055f, -93588.09f, -7660.13037f, 10402.623f, 63470.47f, 43112.76f, 6257.767f); + TestUtils.AreEqual(r1, a1 * b1); + + float3x3 a2 = float3x3(-290.5006f, -156.523315f, -208.402008f, 370.945068f, -341.59845f, 10.2703247f, -176.888763f, -61.0061035f, 186.279785f); + float b2 = (207.091f); + float3x3 r2 = float3x3(-60160.0625f, -32414.57f, -43158.18f, 76819.38f, -70741.97f, 2126.89185f, -36632.07f, -12633.8154f, 38576.8672f); + TestUtils.AreEqual(r2, a2 * b2); + + float3x3 a3 = float3x3(-487.652222f, -317.7163f, -207.62735f, 388.8714f, -233.335327f, 128.415527f, 510.389526f, 267.576355f, -309.209656f); + float b3 = (-129.376831f); + float3x3 r3 = float3x3(63090.9f, 41105.13f, 26862.168f, -50310.95f, 30188.1855f, -16613.9941f, -66032.58f, -34618.18f, 40004.5664f); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void float3x3_operator_mul_scalar_wide() + { + float a0 = (37.43219f); + float3x3 b0 = float3x3(96.74756f, 492.185364f, -274.054565f, -452.870972f, 420.853333f, 102.182922f, -114.948883f, -351.120056f, -464.664978f); + float3x3 r0 = float3x3(3621.473f, 18423.5762f, -10258.4629f, -16951.9531f, 15753.4619f, 3824.93066f, -4302.78857f, -13143.1924f, -17393.4277f); + TestUtils.AreEqual(r0, a0 * b0); + + float a1 = (444.084839f); + float3x3 b1 = float3x3(447.1053f, 130.829346f, -321.41333f, 445.301331f, 478.2436f, 358.571716f, -144.8901f, -438.893829f, -3.536438f); + float3x3 r1 = float3x3(198552.672f, 58099.33f, -142734.781f, 197751.563f, 212380.734f, 159236.266f, -64343.5f, -194906.1f, -1570.47852f); + TestUtils.AreEqual(r1, a1 * b1); + + float a2 = (-471.807556f); + float3x3 b2 = float3x3(-42.5603943f, 119.911072f, 271.900024f, 239.684021f, 487.4414f, -79.18829f, -112.925659f, 161.370056f, 459.759155f); + float3x3 r2 = float3x3(20080.3164f, -56574.95f, -128284.484f, -113084.734f, -229978.531f, 37361.6367f, 53279.18f, -76135.61f, -216917.844f); + TestUtils.AreEqual(r2, a2 * b2); + + float a3 = (-337.195984f); + float3x3 b3 = float3x3(-276.834534f, 469.723877f, -274.565155f, 506.7859f, 65.88257f, 495.855652f, -347.2796f, -343.606049f, -183.7038f); + float3x3 r3 = float3x3(93347.49f, -158389f, 92582.2656f, -170886.172f, -22215.3379f, -167200.531f, 117101.289f, 115862.578f, 61944.1836f); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void float3x3_operator_div_wide_wide() + { + float3x3 a0 = float3x3(-353.131439f, -102.799866f, 51.3191528f, -191.871674f, 8.041809f, -128.73764f, -136.0596f, -370.471f, -237.69455f); + float3x3 b0 = float3x3(-178.739563f, -302.096283f, -199.405823f, 278.850769f, 502.3376f, -361.484833f, 353.121033f, -38.894928f, -75.76474f); + float3x3 r0 = float3x3(1.97567582f, 0.34028843f, -0.257360339f, -0.688080132f, 0.0160087738f, 0.356135666f, -0.385305852f, 9.524919f, 3.1372714f); + TestUtils.AreEqual(r0, a0 / b0); + + float3x3 a1 = float3x3(-432.546875f, 200.2655f, 361.4416f, -416.226135f, -450.0192f, -273.497437f, -286.908173f, -314.256042f, 177.762085f); + float3x3 b1 = float3x3(-195.217834f, -405.034f, -394.23f, -375.8277f, -121.245483f, 447.623352f, 338.286255f, -405.5442f, -431.168945f); + float3x3 r1 = float3x3(2.215714f, -0.4944412f, -0.9168292f, 1.107492f, 3.71163678f, -0.610999048f, -0.8481225f, 0.7748996f, -0.412279427f); + TestUtils.AreEqual(r1, a1 / b1); + + float3x3 a2 = float3x3(97.6270142f, -68.10727f, -386.450745f, 263.699341f, -297.0271f, -501.777039f, -263.40686f, -451.080841f, -416.34552f); + float3x3 b2 = float3x3(296.205139f, 437.939819f, 39.2106323f, 331.289734f, -310.619568f, 207.26947f, -223.293f, -480.0914f, 448.675964f); + float3x3 r2 = float3x3(0.3295926f, -0.155517414f, -9.855764f, 0.795978f, 0.9562408f, -2.42089224f, 1.17964673f, 0.9395729f, -0.9279426f); + TestUtils.AreEqual(r2, a2 / b2); + + float3x3 a3 = float3x3(-315.278748f, -28.1811218f, -397.870148f, -261.386658f, 40.3482056f, 277.245728f, 464.77124f, -336.641052f, 375.4781f); + float3x3 b3 = float3x3(-460.097443f, -220.569855f, -84.85315f, 441.373779f, 72.41846f, 44.9760742f, -242.515381f, -451.302063f, -21.8996887f); + float3x3 r3 = float3x3(0.6852434f, 0.127765059f, 4.688926f, -0.592211545f, 0.557153642f, 6.164294f, -1.91646087f, 0.7459329f, -17.14536f); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void float3x3_operator_div_wide_scalar() + { + float3x3 a0 = float3x3(171.3424f, 0.103393555f, 57.8882446f, -256.130737f, 95.66968f, -290.3869f, -127.4487f, -79.7449f, 146.466858f); + float b0 = (171.796814f); + float3x3 r0 = float3x3(0.997355f, 0.000601836247f, 0.3369576f, -1.49089336f, 0.5568769f, -1.69029272f, -0.7418572f, -0.4641815f, 0.8525586f); + TestUtils.AreEqual(r0, a0 / b0); + + float3x3 a1 = float3x3(-499.843567f, -453.2058f, -205.033813f, 481.738159f, 464.479065f, -293.4635f, -158.505585f, -289.5822f, 494.1286f); + float b1 = (58.68634f); + float3x3 r1 = float3x3(-8.517204f, -7.72250938f, -3.493723f, 8.2086935f, 7.91460276f, -5.00054169f, -2.700894f, -4.934406f, 8.419823f); + TestUtils.AreEqual(r1, a1 / b1); + + float3x3 a2 = float3x3(203.583435f, 259.1192f, 460.844727f, 490.956238f, -280.478058f, -320.243866f, 192.41449f, 264.800842f, 226.852966f); + float b2 = (180.9704f); + float3x3 r2 = float3x3(1.12495434f, 1.431832f, 2.54652f, 2.712909f, -1.549856f, -1.76959252f, 1.06323731f, 1.46322739f, 1.25353634f); + TestUtils.AreEqual(r2, a2 / b2); + + float3x3 a3 = float3x3(-192.235687f, -437.8922f, -413.232727f, 249.471863f, 313.035034f, 216.785583f, 383.7389f, 82.0233154f, 189.574646f); + float b3 = (460.9765f); + float3x3 r3 = float3x3(-0.4170184f, -0.949923038f, -0.896429062f, 0.5411813f, 0.6790694f, 0.4702747f, 0.8324478f, 0.177933827f, 0.4112458f); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void float3x3_operator_div_scalar_wide() + { + float a0 = (-264.4425f); + float3x3 b0 = float3x3(105.589111f, -142.349091f, -288.9489f, 39.644104f, -363.9914f, -149.718231f, -395.729126f, 258.7187f, -9.66626f); + float3x3 r0 = float3x3(-2.50444865f, 1.85770416f, 0.9151877f, -6.670412f, 0.7265076f, 1.7662679f, 0.6682412f, -1.02212369f, 27.3572731f); + TestUtils.AreEqual(r0, a0 / b0); + + float a1 = (117.725525f); + float3x3 b1 = float3x3(-331.386536f, -509.986023f, 427.896484f, 467.617126f, -407.124634f, 252.690735f, 444.599365f, -88.31329f, 199.955017f); + float3x3 r1 = float3x3(-0.355251372f, -0.230840683f, 0.2751262f, 0.251756221f, -0.289163351f, 0.465887785f, 0.264790148f, -1.33304417f, 0.58876f); + TestUtils.AreEqual(r1, a1 / b1); + + float a2 = (-218.346924f); + float3x3 b2 = float3x3(-13.4171753f, -296.131073f, 0.561340332f, -289.299316f, 196.218323f, 334.733459f, -282.392731f, -479.5036f, -473.439453f); + float3x3 r2 = float3x3(16.2736874f, 0.737332046f, -388.974243f, 0.754744f, -1.11277544f, -0.652300835f, 0.7732031f, 0.455360353f, 0.4611929f); + TestUtils.AreEqual(r2, a2 / b2); + + float a3 = (105.050781f); + float3x3 b3 = float3x3(-287.6313f, 77.29932f, -210.894379f, -184.068237f, -315.148438f, 87.86688f, 101.590515f, 345.9364f, -146.318115f); + float3x3 r3 = float3x3(-0.365227252f, 1.35901308f, -0.498120338f, -0.5707165f, -0.333337456f, 1.19556737f, 1.034061f, 0.3036708f, -0.71796155f); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void float3x3_operator_mod_wide_wide() + { + float3x3 a0 = float3x3(-388.8125f, 181.681213f, -167.078735f, 432.820129f, -258.438965f, -170.110809f, 283.3183f, 122.716492f, 335.271f); + float3x3 b0 = float3x3(436.944153f, 58.9400635f, -201.116241f, 279.289368f, -397.079773f, 377.899963f, 174.693848f, -228.176514f, -317.060181f); + float3x3 r0 = float3x3(-388.8125f, 4.861023f, -167.078735f, 153.530762f, -258.438965f, -170.110809f, 108.624451f, 122.716492f, 18.2108154f); + TestUtils.AreEqual(r0, a0 % b0); + + float3x3 a1 = float3x3(-503.608521f, 191.022522f, 289.742676f, -124.033722f, 259.274f, -274.358459f, -140.030792f, 324.577576f, -200.513092f); + float3x3 b1 = float3x3(-417.4801f, -249.975952f, -397.571564f, -358.745453f, -198.15921f, 208.737122f, -12.1194153f, 25.2714233f, -194.1207f); + float3x3 r1 = float3x3(-86.12842f, 191.022522f, 289.742676f, -124.033722f, 61.1147766f, -65.62134f, -6.717224f, 21.3204956f, -6.392395f); + TestUtils.AreEqual(r1, a1 % b1); + + float3x3 a2 = float3x3(211.423157f, -51.2722168f, -230.633911f, 99.98938f, 399.18988f, 24.90326f, 50.92401f, -364.863678f, -252.626617f); + float3x3 b2 = float3x3(-493.8718f, -312.3017f, -216.980591f, 413.570984f, -436.3944f, 3.491272f, -308.233429f, -441.375061f, 84.60083f); + float3x3 r2 = float3x3(211.423157f, -51.2722168f, -13.65332f, 99.98938f, 399.18988f, 0.464355469f, 50.92401f, -364.863678f, -83.42496f); + TestUtils.AreEqual(r2, a2 % b2); + + float3x3 a3 = float3x3(-281.2898f, -364.798523f, -329.026245f, 51.6098022f, 41.6478271f, 254.95105f, -458.6776f, -136.79303f, 72.40033f); + float3x3 b3 = float3x3(373.163452f, 67.25275f, -320.333282f, 118.97937f, 44.8239746f, 354.0086f, -253.953125f, -195.162811f, 317.142822f); + float3x3 r3 = float3x3(-281.2898f, -28.53479f, -8.692963f, 51.6098022f, 41.6478271f, 254.95105f, -204.724487f, -136.79303f, 72.40033f); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void float3x3_operator_mod_wide_scalar() + { + float3x3 a0 = float3x3(-244.499634f, -211.8193f, -145.926788f, -304.9182f, 155.479492f, -133.907776f, 281.309631f, -226.535767f, 335.166138f); + float b0 = (39.63495f); + float3x3 r0 = float3x3(-6.68994141f, -13.6445618f, -27.0219421f, -27.4735718f, 36.574646f, -15.00293f, 3.86499023f, -28.3610229f, 18.0865479f); + TestUtils.AreEqual(r0, a0 % b0); + + float3x3 a1 = float3x3(101.706482f, -285.4023f, -355.846863f, 259.378f, -330.871948f, -284.343567f, -102.683441f, -172.141754f, 206.41687f); + float b1 = (319.4715f); + float3x3 r1 = float3x3(101.706482f, -285.4023f, -36.3753662f, 259.378f, -11.4004517f, -284.343567f, -102.683441f, -172.141754f, 206.41687f); + TestUtils.AreEqual(r1, a1 % b1); + + float3x3 a2 = float3x3(-416.713654f, 435.2975f, 132.552917f, 226.944092f, -306.1183f, 115.438477f, 281.882935f, -218.347443f, -140.0405f); + float b2 = (-339.256653f); + float3x3 r2 = float3x3(-77.457f, 96.04083f, 132.552917f, 226.944092f, -306.1183f, 115.438477f, 281.882935f, -218.347443f, -140.0405f); + TestUtils.AreEqual(r2, a2 % b2); + + float3x3 a3 = float3x3(-462.3235f, 351.331055f, 321.047f, 346.0852f, -94.4077454f, 465.40918f, -367.197021f, -467.5106f, 415.2151f); + float b3 = (-211.6087f); + float3x3 r3 = float3x3(-39.10608f, 139.722351f, 109.438293f, 134.4765f, -94.4077454f, 42.1917725f, -155.588318f, -44.2931824f, 203.606384f); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void float3x3_operator_mod_scalar_wide() + { + float a0 = (-66.94504f); + float3x3 b0 = float3x3(-249.7761f, -396.073761f, 386.492065f, 168.939453f, -199.418243f, 261.7517f, 16.1274414f, 257.668152f, -75.78845f); + float3x3 r0 = float3x3(-66.94504f, -66.94504f, -66.94504f, -66.94504f, -66.94504f, -66.94504f, -2.43527222f, -66.94504f, -66.94504f); + TestUtils.AreEqual(r0, a0 % b0); + + float a1 = (170.9563f); + float3x3 b1 = float3x3(-242.858276f, 425.9453f, 303.2724f, 3.033081f, -505.74353f, 461.957031f, 205.972778f, 270.040649f, -47.4807129f); + float3x3 r1 = float3x3(170.9563f, 170.9563f, 170.9563f, 1.10375977f, 170.9563f, 170.9563f, 170.9563f, 170.9563f, 28.51416f); + TestUtils.AreEqual(r1, a1 % b1); + + float a2 = (-150.254486f); + float3x3 b2 = float3x3(149.499512f, -220.298035f, 31.1188354f, 400.635681f, 6.23144531f, -39.05075f, -71.9411f, -495.307129f, -86.7196045f); + float3x3 r2 = float3x3(-0.754974365f, -150.254486f, -25.7791443f, -150.254486f, -0.6997986f, -33.1022339f, -6.372284f, -150.254486f, -63.53488f); + TestUtils.AreEqual(r2, a2 % b2); + + float a3 = (-436.970062f); + float3x3 b3 = float3x3(-472.294739f, -130.008759f, -251.516846f, 281.976379f, 388.86084f, 50.6152954f, 293.87085f, 123.744263f, 422.904358f); + float3x3 r3 = float3x3(-436.970062f, -46.9437866f, -185.453217f, -154.993683f, -48.1092224f, -32.0477f, -143.099213f, -65.7372742f, -14.0657043f); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void float3x3_operator_plus() + { + float3x3 a0 = float3x3(-418.829559f, -405.79895f, -34.04178f, 236.999268f, -459.8391f, 210.86145f, 293.742f, -373.015442f, -386.059845f); + float3x3 r0 = float3x3(-418.829559f, -405.79895f, -34.04178f, 236.999268f, -459.8391f, 210.86145f, 293.742f, -373.015442f, -386.059845f); + TestUtils.AreEqual(r0, +a0); + + float3x3 a1 = float3x3(4.95440674f, 504.474854f, -170.746521f, 439.5594f, -478.7494f, 116.400757f, 421.409668f, -258.596069f, 447.8661f); + float3x3 r1 = float3x3(4.95440674f, 504.474854f, -170.746521f, 439.5594f, -478.7494f, 116.400757f, 421.409668f, -258.596069f, 447.8661f); + TestUtils.AreEqual(r1, +a1); + + float3x3 a2 = float3x3(124.164368f, -65.94928f, 239.041809f, 498.449524f, -139.382538f, 279.072937f, 108.775818f, 37.9992065f, 136.812134f); + float3x3 r2 = float3x3(124.164368f, -65.94928f, 239.041809f, 498.449524f, -139.382538f, 279.072937f, 108.775818f, 37.9992065f, 136.812134f); + TestUtils.AreEqual(r2, +a2); + + float3x3 a3 = float3x3(-236.030029f, 342.2791f, 102.472229f, -161.454834f, -355.270874f, 141.314331f, 239.320862f, -494.6041f, 361.59198f); + float3x3 r3 = float3x3(-236.030029f, 342.2791f, 102.472229f, -161.454834f, -355.270874f, 141.314331f, 239.320862f, -494.6041f, 361.59198f); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void float3x3_operator_neg() + { + float3x3 a0 = float3x3(148.461731f, -467.122681f, 132.04718f, 183.522644f, 473.701f, -407.9911f, -54.95877f, -382.9898f, -299.093384f); + float3x3 r0 = float3x3(-148.461731f, 467.122681f, -132.04718f, -183.522644f, -473.701f, 407.9911f, 54.95877f, 382.9898f, 299.093384f); + TestUtils.AreEqual(r0, -a0); + + float3x3 a1 = float3x3(-383.014069f, 168.735474f, 466.441528f, 171.902466f, -280.558319f, -78.857605f, 318.69635f, -39.9154053f, 140.340027f); + float3x3 r1 = float3x3(383.014069f, -168.735474f, -466.441528f, -171.902466f, 280.558319f, 78.857605f, -318.69635f, 39.9154053f, -140.340027f); + TestUtils.AreEqual(r1, -a1); + + float3x3 a2 = float3x3(132.195618f, 410.380554f, -237.056946f, -137.617828f, -245.349976f, 422.521362f, -434.57135f, 60.22223f, -466.5663f); + float3x3 r2 = float3x3(-132.195618f, -410.380554f, 237.056946f, 137.617828f, 245.349976f, -422.521362f, 434.57135f, -60.22223f, 466.5663f); + TestUtils.AreEqual(r2, -a2); + + float3x3 a3 = float3x3(426.894531f, -391.37207f, 423.237732f, 254.297546f, -114.848907f, 108.059692f, -507.9763f, -306.245728f, 219.66626f); + float3x3 r3 = float3x3(-426.894531f, 391.37207f, -423.237732f, -254.297546f, 114.848907f, -108.059692f, 507.9763f, 306.245728f, -219.66626f); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void float3x3_operator_prefix_inc() + { + float3x3 a0 = float3x3(-139.842072f, -56.7436523f, -381.955322f, 509.796326f, -222.896332f, 210.319885f, -392.7315f, -300.1941f, 362.212769f); + float3x3 r0 = float3x3(-138.842072f, -55.7436523f, -380.955322f, 510.796326f, -221.896332f, 211.319885f, -391.7315f, -299.1941f, 363.212769f); + TestUtils.AreEqual(r0, ++a0); + + float3x3 a1 = float3x3(401.6148f, -450.230164f, 243.546936f, 46.1920166f, -41.4972839f, 299.1855f, 154.356567f, -281.233276f, 200.706f); + float3x3 r1 = float3x3(402.6148f, -449.230164f, 244.546936f, 47.1920166f, -40.4972839f, 300.1855f, 155.356567f, -280.233276f, 201.706f); + TestUtils.AreEqual(r1, ++a1); + + float3x3 a2 = float3x3(92.95776f, -295.587f, 18.4990845f, -215.711121f, 471.947266f, 257.0766f, 41.6259155f, 4.82543945f, 243.004761f); + float3x3 r2 = float3x3(93.95776f, -294.587f, 19.4990845f, -214.711121f, 472.947266f, 258.0766f, 42.6259155f, 5.82543945f, 244.004761f); + TestUtils.AreEqual(r2, ++a2); + + float3x3 a3 = float3x3(-472.619019f, -477.459564f, 9.89147949f, -76.92285f, -29.7675781f, -387.177429f, 461.7093f, 13.699707f, -46.303772f); + float3x3 r3 = float3x3(-471.619019f, -476.459564f, 10.8914795f, -75.92285f, -28.7675781f, -386.177429f, 462.7093f, 14.699707f, -45.303772f); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void float3x3_operator_postfix_inc() + { + float3x3 a0 = float3x3(-396.669739f, 511.20752f, 249.111267f, -128.817322f, -259.4903f, 278.008179f, -81.39343f, 66.71973f, 167.852112f); + float3x3 r0 = float3x3(-396.669739f, 511.20752f, 249.111267f, -128.817322f, -259.4903f, 278.008179f, -81.39343f, 66.71973f, 167.852112f); + TestUtils.AreEqual(r0, a0++); + + float3x3 a1 = float3x3(147.94397f, 41.03357f, 128.5304f, 73.15558f, -60.1323853f, -446.229767f, -296.937836f, 267.293823f, 446.2293f); + float3x3 r1 = float3x3(147.94397f, 41.03357f, 128.5304f, 73.15558f, -60.1323853f, -446.229767f, -296.937836f, 267.293823f, 446.2293f); + TestUtils.AreEqual(r1, a1++); + + float3x3 a2 = float3x3(49.2001953f, -510.864227f, 471.647461f, -171.013092f, 310.727356f, -298.917175f, 489.985f, 184.603455f, 290.69104f); + float3x3 r2 = float3x3(49.2001953f, -510.864227f, 471.647461f, -171.013092f, 310.727356f, -298.917175f, 489.985f, 184.603455f, 290.69104f); + TestUtils.AreEqual(r2, a2++); + + float3x3 a3 = float3x3(117.192322f, 412.3678f, -229.386566f, 239.596924f, 36.62433f, -80.70819f, -391.0335f, -478.227142f, 166.860474f); + float3x3 r3 = float3x3(117.192322f, 412.3678f, -229.386566f, 239.596924f, 36.62433f, -80.70819f, -391.0335f, -478.227142f, 166.860474f); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void float3x3_operator_prefix_dec() + { + float3x3 a0 = float3x3(123.128723f, 256.84375f, 156.330811f, 461.737427f, 325.867981f, 392.015625f, 187.874146f, -236.225189f, 125.109619f); + float3x3 r0 = float3x3(122.128723f, 255.84375f, 155.330811f, 460.737427f, 324.867981f, 391.015625f, 186.874146f, -237.225189f, 124.109619f); + TestUtils.AreEqual(r0, --a0); + + float3x3 a1 = float3x3(469.844727f, 376.046875f, -363.0755f, -22.0289612f, 248.7901f, 168.095032f, 168.265625f, -190.284729f, 166.945557f); + float3x3 r1 = float3x3(468.844727f, 375.046875f, -364.0755f, -23.0289612f, 247.7901f, 167.095032f, 167.265625f, -191.284729f, 165.945557f); + TestUtils.AreEqual(r1, --a1); + + float3x3 a2 = float3x3(183.957947f, -460.739319f, 89.5698853f, -267.4298f, 201.756226f, -141.216888f, -217.4841f, 197.361755f, -213.544128f); + float3x3 r2 = float3x3(182.957947f, -461.739319f, 88.5698853f, -268.4298f, 200.756226f, -142.216888f, -218.4841f, 196.361755f, -214.544128f); + TestUtils.AreEqual(r2, --a2); + + float3x3 a3 = float3x3(180.7406f, 478.045532f, -454.566132f, -386.898346f, 387.857f, -315.110443f, -108.28656f, -286.317017f, -375.601563f); + float3x3 r3 = float3x3(179.7406f, 477.045532f, -455.566132f, -387.898346f, 386.857f, -316.110443f, -109.28656f, -287.317017f, -376.601563f); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void float3x3_operator_postfix_dec() + { + float3x3 a0 = float3x3(379.6883f, 302.692871f, -176.07135f, -291.2527f, 470.567566f, -402.925964f, -63.65515f, 355.2611f, -27.8892212f); + float3x3 r0 = float3x3(379.6883f, 302.692871f, -176.07135f, -291.2527f, 470.567566f, -402.925964f, -63.65515f, 355.2611f, -27.8892212f); + TestUtils.AreEqual(r0, a0--); + + float3x3 a1 = float3x3(-100.761841f, 479.9452f, -200.304291f, -445.026947f, 407.420349f, 327.670349f, 48.06018f, -209.667969f, -38.43506f); + float3x3 r1 = float3x3(-100.761841f, 479.9452f, -200.304291f, -445.026947f, 407.420349f, 327.670349f, 48.06018f, -209.667969f, -38.43506f); + TestUtils.AreEqual(r1, a1--); + + float3x3 a2 = float3x3(283.9416f, 152.510681f, -287.2625f, -215.948029f, -407.046356f, 159.233582f, -359.456482f, 168.41394f, -278.933777f); + float3x3 r2 = float3x3(283.9416f, 152.510681f, -287.2625f, -215.948029f, -407.046356f, 159.233582f, -359.456482f, 168.41394f, -278.933777f); + TestUtils.AreEqual(r2, a2--); + + float3x3 a3 = float3x3(289.912842f, 470.716553f, -208.560608f, 145.896729f, -296.790955f, -274.570831f, -250.04126f, -70.85629f, -485.627838f); + float3x3 r3 = float3x3(289.912842f, 470.716553f, -208.560608f, 145.896729f, -296.790955f, -274.570831f, -250.04126f, -70.85629f, -485.627838f); + TestUtils.AreEqual(r3, a3--); + } + + [TestCase /* For player builds */] + public static void float3x3_EqualsObjectOverride() + { + TestUtils.IsFalse(new float3x3().Equals((object)new int())); + TestUtils.IsTrue(new float3x3().Equals((object)new float3x3())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestFloat3x3.gen.cs.meta b/src/Tests/Tests/Shared/TestFloat3x3.gen.cs.meta new file mode 100644 index 00000000..15fc4b70 --- /dev/null +++ b/src/Tests/Tests/Shared/TestFloat3x3.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 27c6e6d3cc1ef6643995a494e7e3b0d3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestFloat3x4.gen.cs b/src/Tests/Tests/Shared/TestFloat3x4.gen.cs new file mode 100644 index 00000000..b688cda8 --- /dev/null +++ b/src/Tests/Tests/Shared/TestFloat3x4.gen.cs @@ -0,0 +1,956 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestFloat3x4 + { + [TestCompiler] + public static void float3x4_zero() + { + TestUtils.AreEqual(0.0f, float3x4.zero.c0.x); + TestUtils.AreEqual(0.0f, float3x4.zero.c0.y); + TestUtils.AreEqual(0.0f, float3x4.zero.c0.z); + TestUtils.AreEqual(0.0f, float3x4.zero.c1.x); + TestUtils.AreEqual(0.0f, float3x4.zero.c1.y); + TestUtils.AreEqual(0.0f, float3x4.zero.c1.z); + TestUtils.AreEqual(0.0f, float3x4.zero.c2.x); + TestUtils.AreEqual(0.0f, float3x4.zero.c2.y); + TestUtils.AreEqual(0.0f, float3x4.zero.c2.z); + TestUtils.AreEqual(0.0f, float3x4.zero.c3.x); + TestUtils.AreEqual(0.0f, float3x4.zero.c3.y); + TestUtils.AreEqual(0.0f, float3x4.zero.c3.z); + } + + [TestCompiler] + public static void float3x4_operator_equal_wide_wide() + { + float3x4 a0 = float3x4(492.1576f, -495.206329f, 227.457642f, -147.374054f, -222.682f, 64.09375f, -23.8904114f, -16.8197327f, 163.232117f, -165.271f, 470.8777f, -423.942566f); + float3x4 b0 = float3x4(192.568787f, -235.611023f, -254.043121f, -412.624725f, 471.9048f, -6.47277832f, -339.102356f, 488.187561f, -379.5966f, -308.417f, -82.333374f, -102.921082f); + bool3x4 r0 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + float3x4 a1 = float3x4(109.6344f, 462.6903f, -335.38147f, 357.2345f, 1.54559326f, -347.388245f, -114.472168f, 435.848633f, 194.2381f, 138.765564f, -467.349152f, 370.43335f); + float3x4 b1 = float3x4(226.515747f, -356.9013f, -362.912781f, -427.898438f, 466.650146f, -102.799042f, -43.355957f, 85.0456543f, -91.1270447f, 422.192078f, -477.4313f, 1.87701416f); + bool3x4 r1 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + float3x4 a2 = float3x4(476.708252f, 320.552673f, -498.59198f, 92.41693f, 104.511353f, 166.754578f, -204.733429f, 434.756775f, -397.329651f, 503.981628f, -503.7141f, 90.65973f); + float3x4 b2 = float3x4(312.580078f, 254.599365f, 352.72583f, 62.4909668f, 119.714783f, -511.058075f, -302.472717f, -371.769226f, -20.007843f, 21.4594727f, -426.0207f, -305.411926f); + bool3x4 r2 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + float3x4 a3 = float3x4(-303.445251f, 9.34491f, 290.901062f, -147.57193f, 368.082336f, -321.6096f, -171.465424f, -441.306458f, -137.766815f, 304.689575f, 301.889465f, -222.220917f); + float3x4 b3 = float3x4(261.68335f, 50.00476f, -334.134644f, 75.0656738f, -51.186676f, -135.961548f, -409.364868f, 160.819763f, 102.120789f, 277.813049f, 434.906738f, -15.2891846f); + bool3x4 r3 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void float3x4_operator_equal_wide_scalar() + { + float3x4 a0 = float3x4(-303.230072f, 451.5263f, -253.655884f, -105.203644f, -500.6911f, -426.192474f, 159.8761f, -59.55838f, -57.4773865f, -182.049744f, 406.513733f, 370.886f); + float b0 = (123.544556f); + bool3x4 r0 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + float3x4 a1 = float3x4(-172.035309f, -11.3389893f, 363.938232f, -27.1505737f, -325.976074f, -290.359039f, 180.196838f, -374.128326f, -439.358948f, -126.546082f, -197.26178f, -227.159332f); + float b1 = (455.400024f); + bool3x4 r1 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + float3x4 a2 = float3x4(-479.8992f, -495.237335f, -224.517059f, -422.833221f, -450.196259f, -20.10672f, 297.38f, 185.966553f, -102.975983f, -220.597046f, -228.686859f, -333.001282f); + float b2 = (-439.777679f); + bool3x4 r2 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + float3x4 a3 = float3x4(434.213f, -239.869781f, 380.93927f, 90.34949f, -361.327942f, -453.599945f, 157.732483f, -491.0462f, 296.614258f, 482.265137f, -305.876984f, -290.1021f); + float b3 = (406.248718f); + bool3x4 r3 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void float3x4_operator_equal_scalar_wide() + { + float a0 = (-253.397278f); + float3x4 b0 = float3x4(19.95221f, -185.791992f, 407.8136f, -87.2767f, -206.274689f, 160.503113f, -274.7708f, -2.63153076f, 448.354553f, -410.035248f, 247.329041f, 355.539124f); + bool3x4 r0 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + float a1 = (-298.0667f); + float3x4 b1 = float3x4(414.1015f, -481.3026f, 196.55072f, 34.6010132f, 113.7616f, -386.453369f, -124.49176f, 243.886658f, -492.6182f, 145.424438f, 421.55072f, -95.40997f); + bool3x4 r1 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + float a2 = (336.809265f); + float3x4 b2 = float3x4(209.5838f, 487.4414f, 161.806519f, 149.842468f, 225.724f, -71.21881f, 85.78027f, 192.547241f, -49.88748f, -229.801971f, -103.407349f, 19.21576f); + bool3x4 r2 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + float a3 = (492.8811f); + float3x4 b3 = float3x4(140.403137f, -267.536438f, 125.972717f, 478.0005f, 116.144592f, -368.957764f, -225.028656f, 2.723755f, -452.2632f, 87.45654f, 401.306519f, -18.6455383f); + bool3x4 r3 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void float3x4_operator_not_equal_wide_wide() + { + float3x4 a0 = float3x4(430.842529f, 104.69f, 225.802429f, -310.5702f, -418.619446f, 304.128174f, -509.3268f, -160.538086f, -203.301971f, -505.763245f, 162.17218f, 1.156189f); + float3x4 b0 = float3x4(210.024719f, -55.20334f, -269.925354f, -234.546722f, 25.91742f, -63.72699f, -484.5537f, -425.3336f, -53.2743835f, 328.1944f, 15.9631348f, 461.7141f); + bool3x4 r0 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + float3x4 a1 = float3x4(65.66205f, 102.787781f, 172.930054f, 26.6210327f, 235.125977f, 128.541992f, -354.996979f, 334.3595f, -495.832f, 468.307373f, 458.370972f, 299.937317f); + float3x4 b1 = float3x4(-113.363037f, -240.072968f, 495.119141f, 203.55835f, 340.493469f, -241.9072f, 459.569824f, 213.07373f, -384.782837f, -255.072327f, 477.663452f, -248.036621f); + bool3x4 r1 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + float3x4 a2 = float3x4(43.1271973f, -354.7135f, -145.2872f, 390.80188f, -303.13147f, 391.134583f, 139.286865f, 104.523193f, 511.2964f, 213.147034f, -101.0957f, 441.6634f); + float3x4 b2 = float3x4(-407.923462f, -199.788879f, 151.843262f, -97.1206055f, 154.975891f, -172.834534f, 441.5028f, -401.738617f, -411.430176f, -337.820282f, -430.6309f, -150.8718f); + bool3x4 r2 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + float3x4 a3 = float3x4(124.36615f, 312.026428f, 59.65576f, -508.65683f, 98.699646f, 228.799866f, 337.832642f, -163.154449f, 461.6916f, -450.7757f, -443.564758f, -438.213135f); + float3x4 b3 = float3x4(-206.837f, 34.95508f, -255.771454f, 99.99866f, -161.175568f, 68.8535156f, -285.590118f, -428.717316f, -286.3374f, 2.02709961f, -4.80599976f, -425.3348f); + bool3x4 r3 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void float3x4_operator_not_equal_wide_scalar() + { + float3x4 a0 = float3x4(-16.9145813f, 168.8341f, -462.713531f, 130.307739f, 214.501587f, -440.263275f, -197.12796f, -169.099854f, -386.611176f, -281.021f, -270.26886f, -403.9637f); + float b0 = (-145.372772f); + bool3x4 r0 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + float3x4 a1 = float3x4(-269.805725f, -71.7509155f, -432.755737f, -457.363129f, -13.5195923f, 273.873047f, 185.04248f, -482.5307f, 116.395142f, 511.735f, 230.5075f, 100.27478f); + float b1 = (299.654236f); + bool3x4 r1 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + float3x4 a2 = float3x4(129.682434f, -220.639f, 140.3352f, 369.212341f, 453.811218f, -333.66626f, -373.937744f, 150.204285f, -442.164764f, 372.32f, -95.83798f, 495.5667f); + float b2 = (321.178772f); + bool3x4 r2 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + float3x4 a3 = float3x4(-5.3855896f, -459.612732f, 243.309082f, 314.102173f, 96.7449951f, -168.161926f, -71.90546f, 216.608459f, -377.3738f, 142.35498f, -432.272552f, 94.29083f); + float b3 = (-210.502991f); + bool3x4 r3 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void float3x4_operator_not_equal_scalar_wide() + { + float a0 = (275.795837f); + float3x4 b0 = float3x4(-57.1969f, -382.432526f, 97.82037f, -161.463654f, -458.39563f, -499.617859f, 327.92218f, 367.571228f, 59.786377f, -209.580688f, -62.5804443f, -479.974976f); + bool3x4 r0 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + float a1 = (-49.4945068f); + float3x4 b1 = float3x4(-114.685211f, 109.93927f, -176.284821f, -347.4853f, 85.5409546f, -356.659546f, -104.243561f, -133.5492f, 243.539734f, 13.1412964f, -379.985962f, -41.28122f); + bool3x4 r1 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + float a2 = (87.91168f); + float3x4 b2 = float3x4(-339.077271f, -371.820343f, 333.1443f, 294.811951f, -187.14566f, 220.192261f, -228.182068f, -499.723724f, 97.40588f, 501.60437f, 459.6754f, 158.098145f); + bool3x4 r2 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + float a3 = (358.4886f); + float3x4 b3 = float3x4(243.512573f, 336.702942f, 89.953125f, -65.57837f, -159.260162f, 410.588562f, 123.963013f, -239.625122f, -299.42984f, -491.2919f, 207.71167f, 271.5655f); + bool3x4 r3 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void float3x4_operator_less_wide_wide() + { + float3x4 a0 = float3x4(196.84259f, 336.4098f, 251.963745f, 257.655945f, 430.0459f, -62.4196472f, 8.839233f, -333.8167f, 164.678833f, -350.9449f, 3.84143066f, 125.409729f); + float3x4 b0 = float3x4(-465.345032f, -256.1524f, -314.814026f, 364.5667f, 100.21051f, 182.560974f, 3.11700439f, -259.430481f, -437.3349f, -456.043732f, -394.255981f, 401.9137f); + bool3x4 r0 = bool3x4(false, false, false, true, false, true, false, true, false, false, false, true); + TestUtils.AreEqual(r0, a0 < b0); + + float3x4 a1 = float3x4(-111.129944f, 70.00549f, 448.1983f, -419.987122f, -258.301666f, -34.8322144f, -69.8594055f, 67.76721f, -139.777283f, 385.434631f, 133.7074f, 506.188354f); + float3x4 b1 = float3x4(313.439148f, 121.286682f, -28.0122986f, -282.965881f, 330.0644f, 124.099365f, -183.6903f, 373.0608f, 109.750916f, -203.57135f, 45.64868f, -360.952271f); + bool3x4 r1 = bool3x4(true, true, false, true, true, true, false, true, true, false, false, false); + TestUtils.AreEqual(r1, a1 < b1); + + float3x4 a2 = float3x4(34.44287f, 412.1137f, -84.8097839f, 444.785339f, -78.75473f, 366.977539f, 127.180481f, 428.368469f, 8.197632f, -71.13736f, -474.0508f, 322.4289f); + float3x4 b2 = float3x4(211.913086f, -313.286377f, -259.661072f, 79.09851f, 446.4961f, 450.524536f, -375.630768f, -53.9418335f, -291.453735f, 190.774841f, 54.0839233f, -163.63089f); + bool3x4 r2 = bool3x4(true, false, false, false, true, true, false, false, false, true, true, false); + TestUtils.AreEqual(r2, a2 < b2); + + float3x4 a3 = float3x4(6.897888f, 195.733582f, -267.6906f, -243.7937f, 319.2508f, -425.1562f, 71.87396f, 313.843872f, 397.279053f, -309.145874f, -38.6678467f, -266.1197f); + float3x4 b3 = float3x4(-212.005646f, 406.0905f, -183.018951f, 355.221375f, -81.0422058f, -275.7148f, 405.299255f, -510.6406f, 398.069275f, -4.35549927f, 129.242676f, -276.146545f); + bool3x4 r3 = bool3x4(false, true, true, true, false, true, true, false, true, true, true, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void float3x4_operator_less_wide_scalar() + { + float3x4 a0 = float3x4(-132.057312f, -192.465f, -66.8345947f, -379.017517f, -360.2824f, 20.9278564f, -158.240753f, 437.3459f, -20.4526062f, 225.2915f, 307.4842f, 274.015259f); + float b0 = (-156.010223f); + bool3x4 r0 = bool3x4(false, true, false, true, true, false, true, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 < b0); + + float3x4 a1 = float3x4(373.549683f, 105.030151f, -58.0108948f, 109.670105f, -108.85318f, -44.9712524f, 140.426086f, -500.0883f, 172.103333f, -197.500732f, -7.271515f, -432.9905f); + float b1 = (398.523682f); + bool3x4 r1 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 < b1); + + float3x4 a2 = float3x4(62.1583252f, -377.852325f, -500.255737f, 149.11499f, 119.880615f, 202.63916f, 274.950684f, 66.41205f, 274.999451f, -149.6358f, 223.758728f, 73.2668457f); + float b2 = (-72.25473f); + bool3x4 r2 = bool3x4(false, true, true, false, false, false, false, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + float3x4 a3 = float3x4(213.094971f, 418.3772f, 421.103577f, -187.16684f, 389.109436f, 401.335449f, -106.285065f, 380.607971f, 385.652832f, 120.659851f, -13.8308716f, -500.1271f); + float b3 = (322.8595f); + bool3x4 r3 = bool3x4(true, false, false, true, false, false, true, false, false, true, true, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void float3x4_operator_less_scalar_wide() + { + float a0 = (-423.1174f); + float3x4 b0 = float3x4(385.094849f, -123.933472f, 86.37659f, 133.4422f, 161.457947f, 229.754272f, 222.5716f, 315.5312f, -447.203522f, 271.833862f, -393.605316f, 317.486877f); + bool3x4 r0 = bool3x4(true, true, true, true, true, true, true, true, false, true, true, true); + TestUtils.AreEqual(r0, a0 < b0); + + float a1 = (-164.6051f); + float3x4 b1 = float3x4(-282.876038f, 296.979553f, -254.401154f, 365.6156f, -441.984253f, -131.42865f, 442.628967f, -29.7928467f, -138.37381f, 9.21698f, -226.73056f, 171.029419f); + bool3x4 r1 = bool3x4(false, true, false, true, false, true, true, true, true, true, false, true); + TestUtils.AreEqual(r1, a1 < b1); + + float a2 = (376.625244f); + float3x4 b2 = float3x4(-462.5887f, -142.36731f, -456.253784f, 66.61023f, 169.378784f, 327.4444f, 64.08795f, -153.5039f, 199.380127f, -244.969055f, 472.743835f, -363.7801f); + bool3x4 r2 = bool3x4(false, false, false, false, false, false, false, false, false, false, true, false); + TestUtils.AreEqual(r2, a2 < b2); + + float a3 = (-179.487518f); + float3x4 b3 = float3x4(-83.42514f, 178.886475f, 62.15576f, 409.746765f, -117.163666f, 316.601685f, 285.5163f, 18.6745f, 282.5293f, 132.923767f, -318.215332f, 314.8399f); + bool3x4 r3 = bool3x4(true, true, true, true, true, true, true, true, true, true, false, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void float3x4_operator_greater_wide_wide() + { + float3x4 a0 = float3x4(483.5014f, 310.8156f, 106.966187f, 295.7353f, 116.957581f, -478.299774f, -14.8974f, -33.8174438f, -24.74054f, 319.782654f, -120.158569f, -289.008575f); + float3x4 b0 = float3x4(-471.398f, -371.9853f, 36.9006958f, -316.7636f, 19.6830444f, 207.309143f, 362.7975f, 324.95343f, 340.948059f, 25.9860229f, -114.211121f, 240.803467f); + bool3x4 r0 = bool3x4(true, true, true, true, true, false, false, false, false, true, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + float3x4 a1 = float3x4(455.85144f, 144.706909f, 63.9320068f, -285.683044f, -502.090729f, -337.194458f, 474.317322f, -507.1451f, -133.565582f, -443.109131f, -464.34137f, -68.36154f); + float3x4 b1 = float3x4(273.422424f, 325.515747f, 27.3410645f, 64.47955f, 200.948364f, 100.122681f, -79.00711f, -315.137939f, -122.985443f, -163.7792f, -492.566f, -90.79727f); + bool3x4 r1 = bool3x4(true, false, true, false, false, false, true, false, false, false, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + float3x4 a2 = float3x4(-185.993011f, -157.8039f, -74.12424f, -94.47116f, 329.610535f, -315.836731f, 404.1938f, 131.304382f, -206.633911f, 197.399841f, 187.991943f, 362.636047f); + float3x4 b2 = float3x4(-284.901245f, -23.6536865f, 174.93f, 85.7125244f, -441.987823f, 345.543762f, 482.219482f, -422.383484f, -30.7792969f, 296.154236f, 378.059875f, -457.733429f); + bool3x4 r2 = bool3x4(true, false, false, false, true, false, false, true, false, false, false, true); + TestUtils.AreEqual(r2, a2 > b2); + + float3x4 a3 = float3x4(336.0932f, -352.448364f, -183.10199f, 193.144836f, -170.216f, -0.491241455f, -326.855042f, -373.39624f, -216.580475f, 282.5121f, -275.170349f, -207.331757f); + float3x4 b3 = float3x4(122.920593f, -509.173126f, 386.77063f, 436.41748f, -276.495819f, -163.166779f, 249.970642f, -165.020752f, 89.09302f, 404.305176f, -340.688843f, -103.785095f); + bool3x4 r3 = bool3x4(true, true, false, false, true, true, false, false, false, false, true, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void float3x4_operator_greater_wide_scalar() + { + float3x4 a0 = float3x4(64.31793f, -397.703461f, 431.8769f, 85.703f, 246.263062f, 197.491577f, 286.199463f, 280.813354f, -405.7846f, 171.565369f, -241.807281f, 333.5782f); + float b0 = (305.859924f); + bool3x4 r0 = bool3x4(false, false, true, false, false, false, false, false, false, false, false, true); + TestUtils.AreEqual(r0, a0 > b0); + + float3x4 a1 = float3x4(370.279175f, -356.592346f, -353.0313f, 396.645325f, 467.222046f, -240.013428f, 502.915039f, 315.4676f, -259.2897f, 281.230652f, 428.792175f, 245.153076f); + float b1 = (-413.7014f); + bool3x4 r1 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + float3x4 a2 = float3x4(-279.1754f, -124.771545f, -425.652924f, 99.13287f, 355.060547f, -456.439423f, 154.489014f, 405.529724f, -157.7338f, 186.0863f, 249.999084f, -110.096924f); + float b2 = (-453.8631f); + bool3x4 r2 = bool3x4(true, true, true, true, true, false, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 > b2); + + float3x4 a3 = float3x4(-435.3045f, -254.346558f, -428.987946f, 255.373657f, -309.1123f, 185.501587f, -201.334167f, 23.321167f, -143.9761f, -111.77951f, -356.656616f, -318.313568f); + float b3 = (72.7520142f); + bool3x4 r3 = bool3x4(false, false, false, true, false, true, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void float3x4_operator_greater_scalar_wide() + { + float a0 = (-282.6705f); + float3x4 b0 = float3x4(358.099976f, -72.596405f, -232.163788f, -60.7067261f, 75.15662f, 150.883484f, 339.539185f, -498.196045f, 459.7461f, -227.968719f, 335.862122f, 76.17883f); + bool3x4 r0 = bool3x4(false, false, false, false, false, false, false, true, false, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + float a1 = (296.859924f); + float3x4 b1 = float3x4(177.48999f, -281.2012f, 244.722839f, 137.328552f, -385.338257f, 443.163452f, -353.562561f, 26.04065f, -331.793945f, -43.6919556f, 20.9494019f, -211.17984f); + bool3x4 r1 = bool3x4(true, true, true, true, true, false, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + float a2 = (227.421692f); + float3x4 b2 = float3x4(-84.7797852f, -375.1355f, -205.178131f, -197.04715f, -219.634033f, -210.015625f, -266.7737f, 144.7785f, -471.7112f, -155.913177f, 99.72473f, -230.944855f); + bool3x4 r2 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 > b2); + + float a3 = (-338.8689f); + float3x4 b3 = float3x4(334.068237f, -158.660858f, -315.018219f, -177.19281f, 171.95929f, 198.38916f, 303.678345f, 400.6996f, 351.878662f, -31.7696533f, 386.0733f, -360.348877f); + bool3x4 r3 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void float3x4_operator_less_equal_wide_wide() + { + float3x4 a0 = float3x4(-438.523132f, 210.489441f, 4.87731934f, -137.297943f, 156.094116f, -363.924133f, -97.94849f, 437.2954f, 458.530273f, -294.064758f, 23.62262f, -34.2840576f); + float3x4 b0 = float3x4(-474.814148f, 304.371033f, 234.824158f, -390.485443f, -297.175354f, -326.2924f, 107.253906f, -413.131073f, 67.09442f, 470.075256f, -84.499115f, 392.784241f); + bool3x4 r0 = bool3x4(false, true, true, false, false, true, true, false, false, true, false, true); + TestUtils.AreEqual(r0, a0 <= b0); + + float3x4 a1 = float3x4(149.736511f, -418.8867f, -197.502533f, -88.2055054f, -376.71814f, 341.627136f, -83.30917f, -107.490723f, 319.466858f, 205.357361f, 345.563721f, 395.3219f); + float3x4 b1 = float3x4(-263.531738f, 369.3009f, -333.3253f, 238.413452f, 486.2426f, 279.6502f, 236.052f, 132.758972f, 66.29474f, 183.002136f, 200.130554f, 339.043823f); + bool3x4 r1 = bool3x4(false, true, false, true, true, false, true, true, false, false, false, false); + TestUtils.AreEqual(r1, a1 <= b1); + + float3x4 a2 = float3x4(-222.874146f, 439.022034f, -368.075562f, -200.0386f, 71.46991f, -357.365417f, 141.710876f, 319.0171f, 303.030151f, -461.574249f, 277.62677f, 182.1781f); + float3x4 b2 = float3x4(438.5379f, 145.401855f, 178.163086f, 157.975952f, 329.7052f, -243.590912f, 5.401184f, -22.5805969f, -90.3375854f, -72.19107f, -354.354828f, -289.521729f); + bool3x4 r2 = bool3x4(true, false, true, true, true, true, false, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + float3x4 a3 = float3x4(-337.414856f, -361.391663f, 222.1435f, -464.7795f, -146.853668f, 80.17505f, -260.3473f, 94.48901f, 174.281189f, -303.8197f, 81.41742f, 503.048157f); + float3x4 b3 = float3x4(85.17627f, 469.327881f, 294.7138f, 461.605957f, -245.930481f, -124.040436f, 278.392639f, -42.8812561f, -328.348816f, 98.9855957f, -375.899841f, -197.934265f); + bool3x4 r3 = bool3x4(true, true, true, true, false, false, true, false, false, true, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void float3x4_operator_less_equal_wide_scalar() + { + float3x4 a0 = float3x4(193.49585f, 168.915527f, -313.993073f, 81.8269653f, 18.5036011f, -0.3581848f, 241.361145f, -463.8164f, -1.35775757f, -268.899475f, 398.991943f, -471.253082f); + float b0 = (443.850525f); + bool3x4 r0 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + float3x4 a1 = float3x4(-264.9378f, 11.2460327f, 424.704041f, 426.482239f, 56.3200073f, -196.2879f, 31.9011841f, -152.257568f, -437.926453f, -37.1048279f, -47.1442261f, 333.623047f); + float b1 = (82.2583f); + bool3x4 r1 = bool3x4(true, true, false, false, true, true, true, true, true, true, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + float3x4 a2 = float3x4(-274.8039f, -260.460571f, 192.309143f, 145.306091f, -466.132965f, -494.267334f, -111.570129f, -139.5412f, -146.589355f, 33.98401f, -445.704468f, -451.0422f); + float b2 = (358.67627f); + bool3x4 r2 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 <= b2); + + float3x4 a3 = float3x4(-122.039276f, -202.465515f, -76.56488f, 218.032776f, -103.53595f, -283.358429f, -374.761658f, -213.49588f, 477.491821f, -383.370056f, 23.9649658f, -5.960785f); + float b3 = (83.3277f); + bool3x4 r3 = bool3x4(true, true, true, false, true, true, true, true, false, true, true, true); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void float3x4_operator_less_equal_scalar_wide() + { + float a0 = (393.606262f); + float3x4 b0 = float3x4(-75.6883545f, -44.2638855f, 125.864929f, 191.9649f, 13.54303f, -197.051941f, -423.9451f, -330.0486f, 420.165527f, 105.5473f, 174.821289f, 296.7176f); + bool3x4 r0 = bool3x4(false, false, false, false, false, false, false, false, true, false, false, false); + TestUtils.AreEqual(r0, a0 <= b0); + + float a1 = (-469.7004f); + float3x4 b1 = float3x4(123.267212f, 112.996948f, 495.143372f, -488.6579f, 388.539429f, -493.240784f, 16.45105f, -387.651642f, -229.1773f, -373.01532f, -391.142151f, 90.99414f); + bool3x4 r1 = bool3x4(true, true, true, false, true, false, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 <= b1); + + float a2 = (-178.396149f); + float3x4 b2 = float3x4(-69.62106f, 471.790833f, -67.46677f, 45.30536f, -154.6922f, 385.7389f, -431.652954f, -331.673035f, -349.8927f, -114.839142f, -245.217834f, -486.6955f); + bool3x4 r2 = bool3x4(true, true, true, true, true, true, false, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + float a3 = (391.950928f); + float3x4 b3 = float3x4(-125.770538f, -229.812286f, 289.449036f, -200.494232f, 281.5927f, 99.90106f, -146.027435f, 124.148376f, 94.3569946f, 93.920105f, -484.924133f, -270.796875f); + bool3x4 r3 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void float3x4_operator_greater_equal_wide_wide() + { + float3x4 a0 = float3x4(-507.9286f, 504.4975f, -385.4345f, -262.323425f, -37.5509338f, -111.595276f, -463.702026f, 387.448853f, 456.9688f, -211.010162f, 182.411377f, -53.59604f); + float3x4 b0 = float3x4(-81.3465f, 297.666138f, 171.06543f, -431.038055f, -6.85907f, 319.7257f, 254.079163f, 396.5724f, 178.8393f, -447.063354f, 288.492676f, 474.889282f); + bool3x4 r0 = bool3x4(false, true, false, true, false, false, false, false, true, true, false, false); + TestUtils.AreEqual(r0, a0 >= b0); + + float3x4 a1 = float3x4(-309.570221f, -136.022491f, 280.736267f, -96.99588f, -174.059509f, 88.90192f, 43.81604f, -446.07843f, 16.6455688f, 409.83252f, -191.329865f, 222.9978f); + float3x4 b1 = float3x4(-321.750244f, -395.977234f, -158.692474f, 391.4887f, -368.109253f, 89.12378f, -510.279327f, -486.9298f, -81.2155457f, 274.2188f, -212.881561f, 288.9953f); + bool3x4 r1 = bool3x4(true, true, true, false, true, false, true, true, true, true, true, false); + TestUtils.AreEqual(r1, a1 >= b1); + + float3x4 a2 = float3x4(404.2884f, 230.603271f, -441.789276f, -86.29306f, 484.249573f, 95.23639f, -204.912109f, -199.774353f, -421.8632f, -18.2147827f, -346.822754f, -159.243652f); + float3x4 b2 = float3x4(307.73175f, 307.245178f, -199.391785f, -284.421265f, -482.3918f, 448.315735f, -378.3462f, -390.858459f, 8.916016f, 416.407227f, -213.674957f, 455.2481f); + bool3x4 r2 = bool3x4(true, false, false, true, true, false, true, true, false, false, false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + float3x4 a3 = float3x4(112.917725f, 48.2910156f, 390.660156f, 154.219177f, -32.7480469f, -288.265625f, 122.704285f, 321.277954f, 230.183838f, 116.874268f, -93.515686f, 229.9823f); + float3x4 b3 = float3x4(-236.080353f, -248.373108f, 184.18512f, 415.31134f, 86.98218f, 485.004578f, 107.758911f, -486.667725f, -138.676788f, 14.2078247f, -382.394165f, -117.008209f); + bool3x4 r3 = bool3x4(true, true, true, false, false, false, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void float3x4_operator_greater_equal_wide_scalar() + { + float3x4 a0 = float3x4(465.152161f, -424.886078f, -209.2211f, 58.7798462f, -302.2691f, 140.12561f, 16.3533936f, -344.559967f, 393.278076f, -315.701538f, 441.011536f, -509.781555f); + float b0 = (-5.599884f); + bool3x4 r0 = bool3x4(true, false, false, true, false, true, true, false, true, false, true, false); + TestUtils.AreEqual(r0, a0 >= b0); + + float3x4 a1 = float3x4(-36.9942932f, -164.973938f, -466.1201f, -123.813751f, 215.651245f, 104.995728f, 314.346f, 190.516113f, -83.11142f, -23.8364258f, 143.049377f, -264.919983f); + float b1 = (494.8203f); + bool3x4 r1 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + float3x4 a2 = float3x4(-169.702209f, 359.095825f, -260.4233f, 354.195129f, -111.845337f, 33.309082f, 355.6313f, -435.360565f, -38.3993225f, -93.2957153f, -338.8496f, 436.8958f); + float b2 = (329.70752f); + bool3x4 r2 = bool3x4(false, true, false, true, false, false, true, false, false, false, false, true); + TestUtils.AreEqual(r2, a2 >= b2); + + float3x4 a3 = float3x4(511.084167f, -453.799255f, 170.919f, -182.825745f, -207.516937f, -319.5006f, -240.5086f, 436.3413f, -66.9560547f, 303.320862f, 180.196045f, 337.965149f); + float b3 = (-277.67453f); + bool3x4 r3 = bool3x4(true, false, true, true, true, false, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void float3x4_operator_greater_equal_scalar_wide() + { + float a0 = (374.827026f); + float3x4 b0 = float3x4(-1.60977173f, 338.615234f, -116.1814f, -332.157318f, -355.97937f, -468.901428f, 38.579895f, -332.347534f, 2.89013672f, 467.777771f, 121.406372f, -305.023376f); + bool3x4 r0 = bool3x4(true, true, true, true, true, true, true, true, true, false, true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + float a1 = (-58.4288025f); + float3x4 b1 = float3x4(-226.519562f, -47.0209961f, 305.302673f, -427.401245f, 92.26367f, -497.178528f, -408.625641f, -455.2305f, 396.4261f, -469.2949f, -485.754028f, -182.346191f); + bool3x4 r1 = bool3x4(true, false, false, true, false, true, true, true, false, true, true, true); + TestUtils.AreEqual(r1, a1 >= b1); + + float a2 = (-291.545349f); + float3x4 b2 = float3x4(278.740784f, -75.8711243f, 28.9070435f, 287.720154f, 420.509766f, 473.626831f, 181.514526f, -369.202881f, 243.749756f, -244.124146f, -242.993347f, -322.115356f); + bool3x4 r2 = bool3x4(false, false, false, false, false, false, false, true, false, false, false, true); + TestUtils.AreEqual(r2, a2 >= b2); + + float a3 = (192.974976f); + float3x4 b3 = float3x4(-54.7255554f, -166.000824f, 244.293457f, 438.2494f, -162.692841f, 37.1853638f, -506.667358f, -205.163086f, 368.389954f, -35.45996f, -20.9164429f, 9.041382f); + bool3x4 r3 = bool3x4(true, true, false, false, true, true, true, true, false, true, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void float3x4_operator_add_wide_wide() + { + float3x4 a0 = float3x4(506.129028f, -501.779816f, 420.084778f, -186.032074f, -9.312408f, 328.51178f, 424.344055f, 87.79108f, 462.4137f, -46.17871f, 401.170044f, -454.124146f); + float3x4 b0 = float3x4(-28.7579956f, -337.135132f, -340.676819f, 152.312012f, 423.66748f, 90.3740845f, 376.18866f, 1.76721191f, -120.185852f, -279.629364f, -344.6671f, 242.839172f); + float3x4 r0 = float3x4(477.371033f, -838.9149f, 79.40796f, -33.7200623f, 414.355072f, 418.885864f, 800.5327f, 89.55829f, 342.227844f, -325.808075f, 56.50293f, -211.284973f); + TestUtils.AreEqual(r0, a0 + b0); + + float3x4 a1 = float3x4(69.19568f, -177.957336f, 299.604126f, 340.704834f, 219.916016f, -321.9084f, 286.355347f, -333.4195f, -118.932159f, 68.60748f, 23.190918f, -205.577881f); + float3x4 b1 = float3x4(418.593079f, -23.3128052f, -95.0999451f, 147.9281f, 331.0329f, -82.50256f, 279.4496f, 342.622742f, -300.358521f, -209.694092f, 446.559448f, -351.9892f); + float3x4 r1 = float3x4(487.788757f, -201.270142f, 204.504181f, 488.632935f, 550.9489f, -404.41095f, 565.804932f, 9.203247f, -419.29068f, -141.086609f, 469.750366f, -557.5671f); + TestUtils.AreEqual(r1, a1 + b1); + + float3x4 a2 = float3x4(11.5214233f, -340.795074f, -68.93118f, 304.8532f, -86.63385f, 105.669128f, 349.280518f, 364.7079f, -429.0374f, 382.458069f, 186.097046f, 227.411865f); + float3x4 b2 = float3x4(-263.12384f, -252.458557f, 289.825378f, 338.796143f, -232.619019f, -510.50824f, 349.280762f, -426.212463f, -331.416321f, -418.6888f, -341.70636f, -329.0359f); + float3x4 r2 = float3x4(-251.602417f, -593.253662f, 220.8942f, 643.649353f, -319.252869f, -404.8391f, 698.5613f, -61.5045776f, -760.453735f, -36.2307434f, -155.609314f, -101.624023f); + TestUtils.AreEqual(r2, a2 + b2); + + float3x4 a3 = float3x4(-298.766357f, 351.3028f, 98.7254f, -292.351685f, 112.1709f, 477.165771f, -266.304871f, -295.1407f, -485.820374f, -507.8687f, -338.2196f, 505.342163f); + float3x4 b3 = float3x4(123.198547f, 189.528564f, 267.569946f, 134.636292f, -337.96814f, 50.7280273f, 81.16345f, 442.0907f, -148.704529f, 6.974365f, -334.911255f, 43.78711f); + float3x4 r3 = float3x4(-175.56781f, 540.83136f, 366.295349f, -157.7154f, -225.797241f, 527.8938f, -185.141418f, 146.950012f, -634.5249f, -500.894348f, -673.130859f, 549.1293f); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void float3x4_operator_add_wide_scalar() + { + float3x4 a0 = float3x4(-194.514191f, 338.5484f, 246.971375f, 100.510925f, -45.72467f, -478.1113f, 30.9161377f, 60.37433f, -242.118744f, 82.50134f, 6.79937744f, -484.6998f); + float b0 = (124.121704f); + float3x4 r0 = float3x4(-70.39249f, 462.6701f, 371.093079f, 224.632629f, 78.39703f, -353.9896f, 155.037842f, 184.496033f, -117.99704f, 206.623047f, 130.921082f, -360.5781f); + TestUtils.AreEqual(r0, a0 + b0); + + float3x4 a1 = float3x4(-188.265015f, -267.7843f, 189.259949f, 198.533569f, 187.536072f, -424.925659f, 302.102356f, 300.3991f, 124.021606f, -200.161346f, 31.3782349f, 362.522156f); + float b1 = (-213.526733f); + float3x4 r1 = float3x4(-401.791748f, -481.311035f, -24.2667847f, -14.9931641f, -25.9906616f, -638.4524f, 88.57562f, 86.8723755f, -89.50513f, -413.68808f, -182.1485f, 148.995422f); + TestUtils.AreEqual(r1, a1 + b1); + + float3x4 a2 = float3x4(-423.988861f, 374.211426f, -465.6995f, -311.04303f, 84.91901f, -432.442444f, 235.750671f, -472.637756f, -257.577759f, 186.120728f, -170.298218f, -115.272491f); + float b2 = (432.41333f); + float3x4 r2 = float3x4(8.424469f, 806.624756f, -33.2861633f, 121.3703f, 517.332336f, -0.02911377f, 668.164f, -40.2244263f, 174.835571f, 618.534058f, 262.1151f, 317.140839f); + TestUtils.AreEqual(r2, a2 + b2); + + float3x4 a3 = float3x4(-101.168823f, 246.549255f, -397.5346f, -199.04837f, 20.585022f, 207.323853f, 197.935181f, -201.540558f, -106.638672f, -179.382233f, 203.817078f, -364.820953f); + float b3 = (257.775146f); + float3x4 r3 = float3x4(156.606323f, 504.3244f, -139.75946f, 58.7267761f, 278.360168f, 465.099f, 455.710327f, 56.23459f, 151.136475f, 78.3929138f, 461.592224f, -107.045807f); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void float3x4_operator_add_scalar_wide() + { + float a0 = (-340.354675f); + float3x4 b0 = float3x4(511.362244f, -146.216644f, -106.210419f, -363.450256f, 199.0896f, -27.1083984f, 419.849f, 284.955017f, -164.9242f, -249.190338f, 150.928162f, 298.1751f); + float3x4 r0 = float3x4(171.007568f, -486.57132f, -446.5651f, -703.804932f, -141.265076f, -367.463074f, 79.49432f, -55.39966f, -505.27887f, -589.545044f, -189.426514f, -42.1795654f); + TestUtils.AreEqual(r0, a0 + b0); + + float a1 = (-457.1534f); + float3x4 b1 = float3x4(424.718079f, -301.857483f, 230.288879f, -423.5876f, -67.06003f, 68.72412f, -164.02243f, 318.935181f, 7.80456543f, 187.698364f, -3.656952f, -446.083069f); + float3x4 r1 = float3x4(-32.4353333f, -759.010864f, -226.864532f, -880.740967f, -524.21344f, -388.4293f, -621.175842f, -138.218231f, -449.348846f, -269.455048f, -460.810364f, -903.23645f); + TestUtils.AreEqual(r1, a1 + b1); + + float a2 = (-209.287231f); + float3x4 b2 = float3x4(-38.21289f, -346.257172f, 465.607422f, -192.185944f, 278.6938f, 381.978455f, 481.243652f, -97.22815f, -455.513733f, 501.834961f, 358.7066f, 430.699768f); + float3x4 r2 = float3x4(-247.500122f, -555.544434f, 256.3202f, -401.473175f, 69.4065552f, 172.691223f, 271.956421f, -306.515381f, -664.800964f, 292.547729f, 149.419373f, 221.412537f); + TestUtils.AreEqual(r2, a2 + b2); + + float a3 = (256.987183f); + float3x4 b3 = float3x4(207.651672f, -376.965179f, -428.085327f, -373.49353f, -468.89328f, -467.658447f, 297.484924f, -506.89978f, -233.358459f, 434.558777f, -387.3152f, 171.590271f); + float3x4 r3 = float3x4(464.638855f, -119.978f, -171.098145f, -116.506348f, -211.9061f, -210.671265f, 554.4721f, -249.9126f, 23.6287231f, 691.545959f, -130.328f, 428.577454f); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void float3x4_operator_sub_wide_wide() + { + float3x4 a0 = float3x4(160.492249f, 11.223938f, 359.200134f, -498.2283f, -355.253632f, -94.53485f, -410.46405f, -401.384644f, 317.706848f, 447.060425f, -489.074158f, -230.008392f); + float3x4 b0 = float3x4(115.46875f, -130.9823f, 241.540833f, 9.987061f, 419.895142f, 59.12445f, -402.381653f, -75.37015f, 320.9796f, -73.90875f, -31.4447327f, -389.251953f); + float3x4 r0 = float3x4(45.0235f, 142.206238f, 117.6593f, -508.215363f, -775.1488f, -153.6593f, -8.082397f, -326.0145f, -3.272766f, 520.9692f, -457.629425f, 159.243561f); + TestUtils.AreEqual(r0, a0 - b0); + + float3x4 a1 = float3x4(24.8754272f, 366.614441f, -107.374146f, -219.008148f, 473.9076f, 259.63623f, -360.119629f, 7.80963135f, 437.428467f, -59.1991577f, 418.744324f, 183.142151f); + float3x4 b1 = float3x4(-375.028839f, 259.182739f, 276.648682f, -453.0692f, -272.576538f, -191.148041f, 87.1369f, 430.02478f, 343.6571f, 121.029419f, -354.188171f, 249.052f); + float3x4 r1 = float3x4(399.904266f, 107.4317f, -384.022827f, 234.061066f, 746.484131f, 450.784271f, -447.256531f, -422.215149f, 93.77136f, -180.228577f, 772.9325f, -65.90985f); + TestUtils.AreEqual(r1, a1 - b1); + + float3x4 a2 = float3x4(271.230347f, 496.208557f, 165.354919f, -227.403656f, -166.522858f, 356.142273f, 386.9264f, -394.638763f, 126.903259f, 97.21692f, -150.017853f, -227.250519f); + float3x4 b2 = float3x4(-2.22543335f, 22.4472656f, 478.112976f, -320.063f, -111.524109f, 222.228943f, -245.411072f, -119.902283f, -153.465668f, 374.1125f, 301.763428f, -281.430054f); + float3x4 r2 = float3x4(273.45578f, 473.7613f, -312.758057f, 92.65933f, -54.99875f, 133.91333f, 632.337463f, -274.736481f, 280.368927f, -276.895569f, -451.781281f, 54.1795349f); + TestUtils.AreEqual(r2, a2 - b2); + + float3x4 a3 = float3x4(-198.830017f, 0.662780762f, -484.245575f, -295.996277f, -46.17099f, 499.9524f, 292.440125f, -106.424133f, 466.827148f, 487.374817f, 242.994629f, -468.901581f); + float3x4 b3 = float3x4(-494.964355f, -320.731262f, 160.962219f, -132.9364f, -394.437531f, 406.851257f, 270.544617f, 507.794617f, 67.69922f, 263.40448f, 297.5807f, 170.839539f); + float3x4 r3 = float3x4(296.134338f, 321.394043f, -645.207764f, -163.059875f, 348.266541f, 93.1011353f, 21.8955078f, -614.21875f, 399.12793f, 223.970337f, -54.58606f, -639.7411f); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void float3x4_operator_sub_wide_scalar() + { + float3x4 a0 = float3x4(207.389587f, 248.457764f, -384.8239f, -205.344757f, -374.811554f, 191.642029f, 18.8562622f, -44.96161f, 480.857971f, 16.3381958f, -366.865448f, -35.5231f); + float b0 = (-36.1124878f); + float3x4 r0 = float3x4(243.502075f, 284.570251f, -348.711426f, -169.232269f, -338.699066f, 227.754517f, 54.96875f, -8.849121f, 516.970459f, 52.4506836f, -330.75296f, 0.589386f); + TestUtils.AreEqual(r0, a0 - b0); + + float3x4 a1 = float3x4(349.397766f, 490.2223f, 195.024048f, -384.849426f, 189.05188f, 55.6027832f, -54.931488f, 53.0880737f, 316.8025f, -273.8067f, 256.8872f, 297.173645f); + float b1 = (439.077271f); + float3x4 r1 = float3x4(-89.6795044f, 51.14502f, -244.053223f, -823.9267f, -250.025391f, -383.4745f, -494.008759f, -385.9892f, -122.27478f, -712.884f, -182.190063f, -141.903625f); + TestUtils.AreEqual(r1, a1 - b1); + + float3x4 a2 = float3x4(101.829041f, -19.7322083f, 336.589722f, -51.8765564f, 317.345764f, -467.055939f, -50.1670532f, 477.804565f, -60.82193f, 0.4111328f, 46.66095f, -19.241394f); + float b2 = (136.607971f); + float3x4 r2 = float3x4(-34.77893f, -156.340179f, 199.98175f, -188.484528f, 180.7378f, -603.66394f, -186.775024f, 341.1966f, -197.4299f, -136.196838f, -89.94702f, -155.849365f); + TestUtils.AreEqual(r2, a2 - b2); + + float3x4 a3 = float3x4(396.809753f, -334.274231f, -198.077148f, -239.200623f, -339.6812f, -14.5144348f, 219.99707f, -180.260681f, -438.8906f, 186.35553f, -365.066772f, -478.801239f); + float b3 = (69.5905151f); + float3x4 r3 = float3x4(327.219238f, -403.864746f, -267.667664f, -308.791138f, -409.271729f, -84.10495f, 150.406555f, -249.8512f, -508.4811f, 116.765015f, -434.6573f, -548.3917f); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void float3x4_operator_sub_scalar_wide() + { + float a0 = (-86.00824f); + float3x4 b0 = float3x4(466.4251f, 298.486938f, -300.9501f, 315.38f, -381.092163f, -125.008362f, 58.4661865f, 214.7461f, -257.549438f, 480.2246f, -443.355072f, 260.795044f); + float3x4 r0 = float3x4(-552.43335f, -384.495178f, 214.941864f, -401.388245f, 295.083923f, 39.0001221f, -144.474426f, -300.754333f, 171.5412f, -566.232849f, 357.346832f, -346.803284f); + TestUtils.AreEqual(r0, a0 - b0); + + float a1 = (29.6819458f); + float3x4 b1 = float3x4(139.857727f, -247.789948f, -248.466217f, 91.44513f, 86.3841553f, 373.8183f, 260.411926f, 114.353943f, -464.405457f, -109.741455f, -311.675354f, 107.864014f); + float3x4 r1 = float3x4(-110.175781f, 277.4719f, 278.148163f, -61.7631836f, -56.70221f, -344.136353f, -230.72998f, -84.672f, 494.0874f, 139.4234f, 341.3573f, -78.18207f); + TestUtils.AreEqual(r1, a1 - b1); + + float a2 = (-258.795166f); + float3x4 b2 = float3x4(14.0975342f, -461.970184f, 30.3108521f, 63.70111f, -462.676758f, 39.75946f, 47.99817f, -177.6193f, 202.477051f, -289.3088f, -459.9254f, 248.386658f); + float3x4 r2 = float3x4(-272.8927f, 203.175018f, -289.106018f, -322.496277f, 203.881592f, -298.554626f, -306.793335f, -81.17587f, -461.272217f, 30.5136414f, 201.130249f, -507.181824f); + TestUtils.AreEqual(r2, a2 - b2); + + float a3 = (85.32971f); + float3x4 b3 = float3x4(-73.37479f, -510.652f, 426.963257f, 239.59021f, 477.852356f, 256.0136f, 338.620361f, -483.8312f, 330.3922f, -263.4182f, 123.92804f, -269.115967f); + float3x4 r3 = float3x4(158.7045f, 595.9817f, -341.633545f, -154.2605f, -392.522644f, -170.6839f, -253.290649f, 569.1609f, -245.0625f, 348.747925f, -38.5983276f, 354.445679f); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void float3x4_operator_mul_wide_wide() + { + float3x4 a0 = float3x4(-482.7138f, -407.2935f, 137.700562f, 208.541138f, 194.29657f, -484.242432f, 183.9873f, -241.33548f, 45.8687744f, 363.3261f, -328.118958f, -471.023071f); + float3x4 b0 = float3x4(-236.367889f, 260.7276f, -416.3863f, -364.4956f, -253.147522f, -369.202881f, 193.547913f, 169.0849f, 201.969666f, 249.456055f, -308.193176f, -385.579651f); + float3x4 r0 = float3x4(114098.047f, -106192.656f, -57336.625f, -76012.33f, -49185.6953f, 178783.7f, 35610.36f, -40806.1836f, 9264.101f, 90633.9f, 101124.023f, 181616.9f); + TestUtils.AreEqual(r0, a0 * b0); + + float3x4 a1 = float3x4(-262.682556f, -379.262756f, -374.090576f, 481.4474f, 104.628052f, 412.935425f, 477.877258f, 20.3778076f, 291.995972f, -138.488312f, -393.464966f, 9.363098f); + float3x4 b1 = float3x4(-183.2796f, 22.2756348f, -265.521423f, -95.67746f, 133.2544f, 148.311462f, 249.284119f, 500.0055f, -19.3315735f, -36.69107f, 30.5238037f, -401.367f); + float3x4 r1 = float3x4(48144.3555f, -8448.318f, 99329.06f, -46063.6641f, 13942.1475f, 61243.06f, 119127.211f, 10189.0156f, -5644.7417f, 5081.284f, -12010.0479f, -3758.03857f); + TestUtils.AreEqual(r1, a1 * b1); + + float3x4 a2 = float3x4(-131.942291f, 364.449646f, 390.615967f, 418.797974f, -277.3448f, 11.4101563f, 474.876465f, -502.405029f, -222.59491f, 38.1690674f, 292.6125f, 203.2077f); + float3x4 b2 = float3x4(3.43725586f, 257.24176f, -290.971924f, 337.47937f, 490.286133f, -191.0198f, -325.7345f, -52.1819763f, 123.435059f, -461.267059f, 122.353088f, 308.584656f); + float3x4 r2 = float3x4(-453.5194f, 93751.67f, -113658.281f, 141335.672f, -135978.3f, -2179.566f, -154683.641f, 26216.4883f, -27476.0156f, -17606.1328f, 35802.043f, 62706.7773f); + TestUtils.AreEqual(r2, a2 * b2); + + float3x4 a3 = float3x4(-330.408142f, 469.460144f, 342.2951f, -504.114655f, 319.3573f, -357.782074f, -117.9711f, 25.706543f, 226.456421f, -86.34372f, -274.126038f, -486.870972f); + float3x4 b3 = float3x4(375.320618f, 203.212646f, 77.66797f, 218.793579f, -489.895752f, 134.472168f, -287.794373f, -116.399994f, -436.543976f, 499.591064f, -300.602356f, 105.730469f); + float3x4 r3 = float3x4(-124008.984f, 95400.24f, 26585.3652f, -110297.047f, -156451.781f, -48111.73f, 33951.418f, -2992.24146f, -98858.19f, -43136.55f, 82402.93f, -51477.0977f); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void float3x4_operator_mul_wide_scalar() + { + float3x4 a0 = float3x4(-96.31882f, -277.142273f, -239.93689f, 509.531433f, 255.8581f, 215.7315f, -455.50827f, -389.2433f, -338.29248f, 53.7962646f, 243.757324f, 135.354675f); + float b0 = (-301.2072f); + float3x4 r0 = float3x4(29011.9219f, 83477.25f, 72270.72f, -153474.547f, -77066.3047f, -64979.8867f, 137202.375f, 117242.883f, 101896.133f, -16203.8232f, -73421.46f, -40769.8047f); + TestUtils.AreEqual(r0, a0 * b0); + + float3x4 a1 = float3x4(-207.3501f, -31.4252319f, 42.6761475f, 260.38385f, 176.867554f, 25.67212f, -290.5006f, 207.091f, -156.523315f, -208.402008f, 370.945068f, -341.59845f); + float b1 = (-383.9396f); + float3x4 r1 = float3x4(79609.9141f, 12065.3916f, -16385.0625f, -99971.67f, -67906.46f, -9856.543f, 111534.688f, -79510.44f, 60095.5f, 80013.78f, -142420.5f, 131153.172f); + TestUtils.AreEqual(r1, a1 * b1); + + float3x4 a2 = float3x4(10.2703247f, -61.0061035f, 186.279785f, -487.652222f, -129.376831f, -317.7163f, -207.62735f, 388.8714f, -233.335327f, 128.415527f, 510.389526f, 267.576355f); + float b2 = (-176.888763f); + float3x4 r2 = float3x4(-1816.70508f, 10791.2939f, -32950.8f, 86260.1953f, 22885.3086f, 56200.4453f, 36726.9453f, -68786.9844f, 41274.4f, -22715.2637f, -90282.17f, -47331.25f); + TestUtils.AreEqual(r2, a2 * b2); + + float3x4 a3 = float3x4(-309.209656f, -189.569519f, 233.209229f, -331.086975f, -98.6447754f, -214.181f, -87.88077f, -493.165741f, -407.306061f, -411.3714f, 477.935669f, 364.748535f); + float b3 = (-36.48297f); + float3x4 r3 = float3x4(11280.8867f, 6916.059f, -8508.166f, 12079.0361f, 3598.85449f, 7813.95947f, 3206.15161f, 17992.1523f, 14859.7354f, 15008.0508f, -17436.5137f, -13307.11f); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void float3x4_operator_mul_scalar_wide() + { + float a0 = (37.43219f); + float3x4 b0 = float3x4(96.74756f, 492.185364f, -274.054565f, -452.870972f, 420.853333f, 102.182922f, -114.948883f, -351.120056f, -464.664978f, 444.084839f, 447.1053f, 130.829346f); + float3x4 r0 = float3x4(3621.473f, 18423.5762f, -10258.4629f, -16951.9531f, 15753.4619f, 3824.93066f, -4302.78857f, -13143.1924f, -17393.4277f, 16623.0684f, 16736.13f, 4897.229f); + TestUtils.AreEqual(r0, a0 * b0); + + float a1 = (-321.41333f); + float3x4 b1 = float3x4(445.301331f, 478.2436f, 358.571716f, -144.8901f, -438.893829f, -3.536438f, -471.807556f, -42.5603943f, 119.911072f, 271.900024f, 239.684021f, 487.4414f); + float3x4 r1 = float3x4(-143125.781f, -153713.859f, -115249.727f, 46569.6133f, 141066.328f, 1136.65833f, 151645.234f, 13679.4785f, -38541.0156f, -87392.29f, -77037.64f, -156670.172f); + TestUtils.AreEqual(r1, a1 * b1); + + float a2 = (-79.18829f); + float3x4 b2 = float3x4(-112.925659f, 161.370056f, 459.759155f, -337.195984f, -276.834534f, 469.723877f, -274.565155f, 506.7859f, 65.88257f, 495.855652f, -347.2796f, -343.606049f); + float3x4 r2 = float3x4(8942.391f, -12778.6191f, -36407.543f, 26701.9746f, 21922.0547f, -37196.6328f, 21742.3457f, -40131.5078f, -5217.128f, -39265.96f, 27500.4785f, 27209.5762f); + TestUtils.AreEqual(r2, a2 * b2); + + float a3 = (-183.7038f); + float3x4 b3 = float3x4(460.264771f, 437.513245f, -324.557251f, -112.287781f, 273.135437f, -283.093658f, 1.880249f, -310.8167f, 326.0122f, 243.64325f, 78.17932f, -308.664f); + float3x4 r3 = float3x4(-84552.38f, -80372.84f, 59622.4f, 20627.6914f, -50176.0156f, 52005.38f, -345.408875f, 57098.21f, -59889.68f, -44758.19f, -14361.8379f, 56702.75f); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void float3x4_operator_div_wide_wide() + { + float3x4 a0 = float3x4(-353.131439f, -102.799866f, 51.3191528f, -191.871674f, 8.041809f, -128.73764f, -136.0596f, -370.471f, -237.69455f, -432.546875f, 200.2655f, 361.4416f); + float3x4 b0 = float3x4(-178.739563f, -302.096283f, -199.405823f, 278.850769f, 502.3376f, -361.484833f, 353.121033f, -38.894928f, -75.76474f, -195.217834f, -405.034f, -394.23f); + float3x4 r0 = float3x4(1.97567582f, 0.34028843f, -0.257360339f, -0.688080132f, 0.0160087738f, 0.356135666f, -0.385305852f, 9.524919f, 3.1372714f, 2.215714f, -0.4944412f, -0.9168292f); + TestUtils.AreEqual(r0, a0 / b0); + + float3x4 a1 = float3x4(-416.226135f, -450.0192f, -273.497437f, -286.908173f, -314.256042f, 177.762085f, 97.6270142f, -68.10727f, -386.450745f, 263.699341f, -297.0271f, -501.777039f); + float3x4 b1 = float3x4(-375.8277f, -121.245483f, 447.623352f, 338.286255f, -405.5442f, -431.168945f, 296.205139f, 437.939819f, 39.2106323f, 331.289734f, -310.619568f, 207.26947f); + float3x4 r1 = float3x4(1.107492f, 3.71163678f, -0.610999048f, -0.8481225f, 0.7748996f, -0.412279427f, 0.3295926f, -0.155517414f, -9.855764f, 0.795978f, 0.9562408f, -2.42089224f); + TestUtils.AreEqual(r1, a1 / b1); + + float3x4 a2 = float3x4(-263.40686f, -451.080841f, -416.34552f, -315.278748f, -28.1811218f, -397.870148f, -261.386658f, 40.3482056f, 277.245728f, 464.77124f, -336.641052f, 375.4781f); + float3x4 b2 = float3x4(-223.293f, -480.0914f, 448.675964f, -460.097443f, -220.569855f, -84.85315f, 441.373779f, 72.41846f, 44.9760742f, -242.515381f, -451.302063f, -21.8996887f); + float3x4 r2 = float3x4(1.17964673f, 0.9395729f, -0.9279426f, 0.6852434f, 0.127765059f, 4.688926f, -0.592211545f, 0.557153642f, 6.164294f, -1.91646087f, 0.7459329f, -17.14536f); + TestUtils.AreEqual(r2, a2 / b2); + + float3x4 a3 = float3x4(504.342529f, -320.7671f, -156.733337f, 414.797058f, -386.0507f, -369.838623f, 386.704224f, 242.631836f, 421.7345f, 109.012207f, 182.075256f, 187.326416f); + float3x4 b3 = float3x4(-358.486664f, -350.945129f, -481.848145f, 406.393433f, -145.288666f, 461.795532f, -318.816772f, -250.932f, 125.859558f, -193.803162f, -495.25412f, -315.824554f); + float3x4 r3 = float3x4(-1.40686548f, 0.9140092f, 0.3252754f, 1.02067852f, 2.65712881f, -0.800870955f, -1.21293569f, -0.966922641f, 3.35083413f, -0.562489331f, -0.367640078f, -0.5931344f); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void float3x4_operator_div_wide_scalar() + { + float3x4 a0 = float3x4(171.3424f, 0.103393555f, 57.8882446f, -256.130737f, 95.66968f, -290.3869f, -127.4487f, -79.7449f, 146.466858f, -499.843567f, 58.68634f, -453.2058f); + float b0 = (171.796814f); + float3x4 r0 = float3x4(0.997355f, 0.000601836247f, 0.3369576f, -1.49089336f, 0.5568769f, -1.69029272f, -0.7418572f, -0.4641815f, 0.8525586f, -2.90950418f, 0.3416032f, -2.63803387f); + TestUtils.AreEqual(r0, a0 / b0); + + float3x4 a1 = float3x4(-205.033813f, 464.479065f, -293.4635f, -158.505585f, -289.5822f, 494.1286f, 203.583435f, 180.9704f, 259.1192f, 460.844727f, 490.956238f, -280.478058f); + float b1 = (481.738159f); + float3x4 r1 = float3x4(-0.425612569f, 0.9641733f, -0.609176338f, -0.3290285f, -0.6011195f, 1.02572024f, 0.422601849f, 0.375661343f, 0.5378839f, 0.9566291f, 1.019135f, -0.582221f); + TestUtils.AreEqual(r1, a1 / b1); + + float3x4 a2 = float3x4(-320.243866f, 264.800842f, 226.852966f, -192.235687f, 460.9765f, -437.8922f, -413.232727f, 249.471863f, 313.035034f, 216.785583f, 383.7389f, 82.0233154f); + float b2 = (192.41449f); + float3x4 r2 = float3x4(-1.66434383f, 1.37620008f, 1.17898071f, -0.999070764f, 2.39574742f, -2.27577567f, -2.14761758f, 1.2965337f, 1.62687874f, 1.12665939f, 1.9943347f, 0.4262845f); + TestUtils.AreEqual(r2, a2 / b2); + + float3x4 a3 = float3x4(189.574646f, -391.92218f, 121.280579f, 417.901733f, -133.262878f, -428.7424f, -188.531891f, 356.259521f, 181.969f, -140.890472f, 474.082642f, -451.357727f); + float b3 = (314.503845f); + float3x4 r3 = float3x4(0.6027737f, -1.24616027f, 0.3856251f, 1.32876515f, -0.423724174f, -1.36323416f, -0.599458158f, 1.13276684f, 0.5785907f, -0.447976947f, 1.50739861f, -1.43514216f); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void float3x4_operator_div_scalar_wide() + { + float a0 = (-264.4425f); + float3x4 b0 = float3x4(105.589111f, -142.349091f, -288.9489f, 39.644104f, -363.9914f, -149.718231f, -395.729126f, 258.7187f, -9.66626f, 117.725525f, -331.386536f, -509.986023f); + float3x4 r0 = float3x4(-2.50444865f, 1.85770416f, 0.9151877f, -6.670412f, 0.7265076f, 1.7662679f, 0.6682412f, -1.02212369f, 27.3572731f, -2.246263f, 0.797988057f, 0.518528938f); + TestUtils.AreEqual(r0, a0 / b0); + + float a1 = (427.896484f); + float3x4 b1 = float3x4(467.617126f, -407.124634f, 252.690735f, 444.599365f, -88.31329f, 199.955017f, -218.346924f, -13.4171753f, -296.131073f, 0.561340332f, -289.299316f, 196.218323f); + float3x4 r1 = float3x4(0.915057361f, -1.05102086f, 1.69336045f, 0.9624316f, -4.84521055f, 2.13996363f, -1.95970929f, -31.8916969f, -1.44495642f, 762.276367f, -1.47907877f, 2.18071628f); + TestUtils.AreEqual(r1, a1 / b1); + + float a2 = (334.733459f); + float3x4 b2 = float3x4(-282.392731f, -479.5036f, -473.439453f, 105.050781f, -287.6313f, 77.29932f, -210.894379f, -184.068237f, -315.148438f, 87.86688f, 101.590515f, 345.9364f); + float3x4 r2 = float3x4(-1.18534732f, -0.6980833f, -0.7070249f, 3.1863966f, -1.16375887f, 4.33035469f, -1.587209f, -1.81852913f, -1.06214535f, 3.809552f, 3.29492831f, 0.9676156f); + TestUtils.AreEqual(r2, a2 / b2); + + float a3 = (-146.318115f); + float3x4 b3 = float3x4(479.999939f, -172.67688f, -178.013641f, 361.760437f, 349.376953f, -398.686127f, -243.78f, 296.622925f, 477.810669f, 486.600342f, 256.917236f, -89.86423f); + float3x4 r3 = float3x4(-0.304829448f, 0.8473521f, 0.8219489f, -0.404461354f, -0.418797284f, 0.367000759f, 0.6002056f, -0.493279874f, -0.306226134f, -0.300694644f, -0.5695146f, 1.62821317f); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void float3x4_operator_mod_wide_wide() + { + float3x4 a0 = float3x4(-388.8125f, 181.681213f, -167.078735f, 432.820129f, -258.438965f, -170.110809f, 283.3183f, 122.716492f, 335.271f, -503.608521f, 191.022522f, 289.742676f); + float3x4 b0 = float3x4(436.944153f, 58.9400635f, -201.116241f, 279.289368f, -397.079773f, 377.899963f, 174.693848f, -228.176514f, -317.060181f, -417.4801f, -249.975952f, -397.571564f); + float3x4 r0 = float3x4(-388.8125f, 4.861023f, -167.078735f, 153.530762f, -258.438965f, -170.110809f, 108.624451f, 122.716492f, 18.2108154f, -86.12842f, 191.022522f, 289.742676f); + TestUtils.AreEqual(r0, a0 % b0); + + float3x4 a1 = float3x4(-124.033722f, 259.274f, -274.358459f, -140.030792f, 324.577576f, -200.513092f, 211.423157f, -51.2722168f, -230.633911f, 99.98938f, 399.18988f, 24.90326f); + float3x4 b1 = float3x4(-358.745453f, -198.15921f, 208.737122f, -12.1194153f, 25.2714233f, -194.1207f, -493.8718f, -312.3017f, -216.980591f, 413.570984f, -436.3944f, 3.491272f); + float3x4 r1 = float3x4(-124.033722f, 61.1147766f, -65.62134f, -6.717224f, 21.3204956f, -6.392395f, 211.423157f, -51.2722168f, -13.65332f, 99.98938f, 399.18988f, 0.464355469f); + TestUtils.AreEqual(r1, a1 % b1); + + float3x4 a2 = float3x4(50.92401f, -364.863678f, -252.626617f, -281.2898f, -364.798523f, -329.026245f, 51.6098022f, 41.6478271f, 254.95105f, -458.6776f, -136.79303f, 72.40033f); + float3x4 b2 = float3x4(-308.233429f, -441.375061f, 84.60083f, 373.163452f, 67.25275f, -320.333282f, 118.97937f, 44.8239746f, 354.0086f, -253.953125f, -195.162811f, 317.142822f); + float3x4 r2 = float3x4(50.92401f, -364.863678f, -83.42496f, -281.2898f, -28.53479f, -8.692963f, 51.6098022f, 41.6478271f, 254.95105f, -204.724487f, -136.79303f, 72.40033f); + TestUtils.AreEqual(r2, a2 % b2); + + float3x4 a3 = float3x4(246.212036f, 325.1538f, 162.034668f, -284.761444f, 128.351257f, 262.916748f, 61.60077f, -271.4928f, -205.438812f, -341.322144f, 347.154419f, 148.0885f); + float3x4 b3 = float3x4(320.693176f, -103.996887f, 388.171753f, -199.639313f, -256.217316f, -478.125031f, -210.655731f, -272.0233f, -61.6765442f, -367.8296f, -242.938934f, 162.386719f); + float3x4 r3 = float3x4(246.212036f, 13.163147f, 162.034668f, -85.12213f, 128.351257f, 262.916748f, 61.60077f, -271.4928f, -20.40918f, -341.322144f, 104.215485f, 148.0885f); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void float3x4_operator_mod_wide_scalar() + { + float3x4 a0 = float3x4(-244.499634f, -211.8193f, -145.926788f, -304.9182f, 155.479492f, -133.907776f, 281.309631f, -226.535767f, 335.166138f, 101.706482f, 319.4715f, -285.4023f); + float b0 = (39.63495f); + float3x4 r0 = float3x4(-6.68994141f, -13.6445618f, -27.0219421f, -27.4735718f, 36.574646f, -15.00293f, 3.86499023f, -28.3610229f, 18.0865479f, 22.4365845f, 2.39190674f, -7.957672f); + TestUtils.AreEqual(r0, a0 % b0); + + float3x4 a1 = float3x4(-355.846863f, -330.871948f, -284.343567f, -102.683441f, -172.141754f, 206.41687f, -416.713654f, -339.256653f, 435.2975f, 132.552917f, 226.944092f, -306.1183f); + float b1 = (259.378f); + float3x4 r1 = float3x4(-96.46887f, -71.49396f, -24.9655762f, -102.683441f, -172.141754f, 206.41687f, -157.335663f, -79.87866f, 175.9195f, 132.552917f, 226.944092f, -46.7402954f); + TestUtils.AreEqual(r1, a1 % b1); + + float3x4 a2 = float3x4(115.438477f, -218.347443f, -140.0405f, -462.3235f, -211.6087f, 351.331055f, 321.047f, 346.0852f, -94.4077454f, 465.40918f, -367.197021f, -467.5106f); + float b2 = (281.882935f); + float3x4 r2 = float3x4(115.438477f, -218.347443f, -140.0405f, -180.440552f, -211.6087f, 69.44812f, 39.1640625f, 64.20227f, -94.4077454f, 183.526245f, -85.31409f, -185.627655f); + TestUtils.AreEqual(r2, a2 % b2); + + float3x4 a3 = float3x4(415.2151f, -3.729828f, 128.249878f, 134.941589f, 247.616943f, -285.287872f, 433.766663f, -141.831024f, -229.781891f, 471.218018f, 377.681458f, 433.4076f); + float b3 = (506.186157f); + float3x4 r3 = float3x4(415.2151f, -3.729828f, 128.249878f, 134.941589f, 247.616943f, -285.287872f, 433.766663f, -141.831024f, -229.781891f, 471.218018f, 377.681458f, 433.4076f); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void float3x4_operator_mod_scalar_wide() + { + float a0 = (-66.94504f); + float3x4 b0 = float3x4(-249.7761f, -396.073761f, 386.492065f, 168.939453f, -199.418243f, 261.7517f, 16.1274414f, 257.668152f, -75.78845f, 170.9563f, -242.858276f, 425.9453f); + float3x4 r0 = float3x4(-66.94504f, -66.94504f, -66.94504f, -66.94504f, -66.94504f, -66.94504f, -2.43527222f, -66.94504f, -66.94504f, -66.94504f, -66.94504f, -66.94504f); + TestUtils.AreEqual(r0, a0 % b0); + + float a1 = (303.2724f); + float3x4 b1 = float3x4(3.033081f, -505.74353f, 461.957031f, 205.972778f, 270.040649f, -47.4807129f, -150.254486f, 149.499512f, -220.298035f, 31.1188354f, 400.635681f, 6.23144531f); + float3x4 r1 = float3x4(2.99737549f, 303.2724f, 303.2724f, 97.29962f, 33.23175f, 18.3881226f, 2.76342773f, 4.27337646f, 82.9743652f, 23.20288f, 303.2724f, 4.163025f); + TestUtils.AreEqual(r1, a1 % b1); + + float a2 = (-39.05075f); + float3x4 b2 = float3x4(-71.9411f, -495.307129f, -86.7196045f, -436.970062f, -472.294739f, -130.008759f, -251.516846f, 281.976379f, 388.86084f, 50.6152954f, 293.87085f, 123.744263f); + float3x4 r2 = float3x4(-39.05075f, -39.05075f, -39.05075f, -39.05075f, -39.05075f, -39.05075f, -39.05075f, -39.05075f, -39.05075f, -39.05075f, -39.05075f, -39.05075f); + TestUtils.AreEqual(r2, a2 % b2); + + float a3 = (422.904358f); + float3x4 b3 = float3x4(-53.87619f, -178.857666f, -362.27594f, 361.085266f, 465.276123f, -269.889648f, -159.408966f, -29.0952148f, 484.499451f, -354.950623f, -328.6906f, -171.739227f); + float3x4 r3 = float3x4(45.7710266f, 65.1890259f, 60.628418f, 61.81909f, 422.904358f, 153.014709f, 104.086426f, 15.57135f, 422.904358f, 67.9537354f, 94.2137451f, 79.4259f); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void float3x4_operator_plus() + { + float3x4 a0 = float3x4(-418.829559f, -405.79895f, -34.04178f, 236.999268f, -459.8391f, 210.86145f, 293.742f, -373.015442f, -386.059845f, 4.95440674f, -418.645264f, 504.474854f); + float3x4 r0 = float3x4(-418.829559f, -405.79895f, -34.04178f, 236.999268f, -459.8391f, 210.86145f, 293.742f, -373.015442f, -386.059845f, 4.95440674f, -418.645264f, 504.474854f); + TestUtils.AreEqual(r0, +a0); + + float3x4 a1 = float3x4(-170.746521f, -478.7494f, 116.400757f, 421.409668f, -258.596069f, 447.8661f, 124.164368f, 222.172546f, -65.94928f, 239.041809f, 498.449524f, -139.382538f); + float3x4 r1 = float3x4(-170.746521f, -478.7494f, 116.400757f, 421.409668f, -258.596069f, 447.8661f, 124.164368f, 222.172546f, -65.94928f, 239.041809f, 498.449524f, -139.382538f); + TestUtils.AreEqual(r1, +a1); + + float3x4 a2 = float3x4(279.072937f, 37.9992065f, 136.812134f, -236.030029f, -440.308319f, 342.2791f, 102.472229f, -161.454834f, -355.270874f, 141.314331f, 239.320862f, -494.6041f); + float3x4 r2 = float3x4(279.072937f, 37.9992065f, 136.812134f, -236.030029f, -440.308319f, 342.2791f, 102.472229f, -161.454834f, -355.270874f, 141.314331f, 239.320862f, -494.6041f); + TestUtils.AreEqual(r2, +a2); + + float3x4 a3 = float3x4(361.59198f, 141.712524f, 25.2562866f, -268.2269f, 106.774658f, 176.744385f, 104.119934f, 144.618591f, 289.4519f, -393.0167f, -198.95575f, -419.009216f); + float3x4 r3 = float3x4(361.59198f, 141.712524f, 25.2562866f, -268.2269f, 106.774658f, 176.744385f, 104.119934f, 144.618591f, 289.4519f, -393.0167f, -198.95575f, -419.009216f); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void float3x4_operator_neg() + { + float3x4 a0 = float3x4(148.461731f, -467.122681f, 132.04718f, 183.522644f, 473.701f, -407.9911f, -54.95877f, -382.9898f, -299.093384f, -383.014069f, 407.709778f, 168.735474f); + float3x4 r0 = float3x4(-148.461731f, 467.122681f, -132.04718f, -183.522644f, -473.701f, 407.9911f, 54.95877f, 382.9898f, 299.093384f, 383.014069f, -407.709778f, -168.735474f); + TestUtils.AreEqual(r0, -a0); + + float3x4 a1 = float3x4(466.441528f, -280.558319f, -78.857605f, 318.69635f, -39.9154053f, 140.340027f, 132.195618f, -505.895264f, 410.380554f, -237.056946f, -137.617828f, -245.349976f); + float3x4 r1 = float3x4(-466.441528f, 280.558319f, 78.857605f, -318.69635f, 39.9154053f, -140.340027f, -132.195618f, 505.895264f, -410.380554f, 237.056946f, 137.617828f, 245.349976f); + TestUtils.AreEqual(r1, -a1); + + float3x4 a2 = float3x4(422.521362f, 60.22223f, -466.5663f, 426.894531f, 146.649536f, -391.37207f, 423.237732f, 254.297546f, -114.848907f, 108.059692f, -507.9763f, -306.245728f); + float3x4 r2 = float3x4(-422.521362f, -60.22223f, 466.5663f, -426.894531f, -146.649536f, 391.37207f, -423.237732f, -254.297546f, 114.848907f, -108.059692f, 507.9763f, 306.245728f); + TestUtils.AreEqual(r2, -a2); + + float3x4 a3 = float3x4(219.66626f, -98.76068f, 492.111084f, 84.04584f, 300.976624f, -483.864624f, -389.15744f, -324.6861f, 378.85437f, 190.219238f, -69.10242f, 507.495361f); + float3x4 r3 = float3x4(-219.66626f, 98.76068f, -492.111084f, -84.04584f, -300.976624f, 483.864624f, 389.15744f, 324.6861f, -378.85437f, -190.219238f, 69.10242f, -507.495361f); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void float3x4_operator_prefix_inc() + { + float3x4 a0 = float3x4(-139.842072f, -56.7436523f, -381.955322f, 509.796326f, -222.896332f, 210.319885f, -392.7315f, -300.1941f, 362.212769f, 401.6148f, 130.90918f, -450.230164f); + float3x4 r0 = float3x4(-138.842072f, -55.7436523f, -380.955322f, 510.796326f, -221.896332f, 211.319885f, -391.7315f, -299.1941f, 363.212769f, 402.6148f, 131.90918f, -449.230164f); + TestUtils.AreEqual(r0, ++a0); + + float3x4 a1 = float3x4(243.546936f, -41.4972839f, 299.1855f, 154.356567f, -281.233276f, 200.706f, 92.95776f, 448.602173f, -295.587f, 18.4990845f, -215.711121f, 471.947266f); + float3x4 r1 = float3x4(244.546936f, -40.4972839f, 300.1855f, 155.356567f, -280.233276f, 201.706f, 93.95776f, 449.602173f, -294.587f, 19.4990845f, -214.711121f, 472.947266f); + TestUtils.AreEqual(r1, ++a1); + + float3x4 a2 = float3x4(257.0766f, 4.82543945f, 243.004761f, -472.619019f, -125.720215f, -477.459564f, 9.89147949f, -76.92285f, -29.7675781f, -387.177429f, 461.7093f, 13.699707f); + float3x4 r2 = float3x4(258.0766f, 5.82543945f, 244.004761f, -471.619019f, -124.720215f, -476.459564f, 10.8914795f, -75.92285f, -28.7675781f, -386.177429f, 462.7093f, 14.699707f); + TestUtils.AreEqual(r2, ++a2); + + float3x4 a3 = float3x4(-46.303772f, -222.2291f, 340.8178f, 399.741272f, -311.372345f, 300.177979f, -272.7783f, 351.019165f, 436.575256f, -137.063324f, 312.579956f, -315.999023f); + float3x4 r3 = float3x4(-45.303772f, -221.2291f, 341.8178f, 400.741272f, -310.372345f, 301.177979f, -271.7783f, 352.019165f, 437.575256f, -136.063324f, 313.579956f, -314.999023f); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void float3x4_operator_postfix_inc() + { + float3x4 a0 = float3x4(-396.669739f, 511.20752f, 249.111267f, -128.817322f, -259.4903f, 278.008179f, -81.39343f, 66.71973f, 167.852112f, 147.94397f, -326.1076f, 41.03357f); + float3x4 r0 = float3x4(-396.669739f, 511.20752f, 249.111267f, -128.817322f, -259.4903f, 278.008179f, -81.39343f, 66.71973f, 167.852112f, 147.94397f, -326.1076f, 41.03357f); + TestUtils.AreEqual(r0, a0++); + + float3x4 a1 = float3x4(128.5304f, -60.1323853f, -446.229767f, -296.937836f, 267.293823f, 446.2293f, 49.2001953f, -326.643127f, -510.864227f, 471.647461f, -171.013092f, 310.727356f); + float3x4 r1 = float3x4(128.5304f, -60.1323853f, -446.229767f, -296.937836f, 267.293823f, 446.2293f, 49.2001953f, -326.643127f, -510.864227f, 471.647461f, -171.013092f, 310.727356f); + TestUtils.AreEqual(r1, a1++); + + float3x4 a2 = float3x4(-298.917175f, 184.603455f, 290.69104f, 117.192322f, 164.442932f, 412.3678f, -229.386566f, 239.596924f, 36.62433f, -80.70819f, -391.0335f, -478.227142f); + float3x4 r2 = float3x4(-298.917175f, 184.603455f, 290.69104f, 117.192322f, 164.442932f, 412.3678f, -229.386566f, 239.596924f, 36.62433f, -80.70819f, -391.0335f, -478.227142f); + TestUtils.AreEqual(r2, a2++); + + float3x4 a3 = float3x4(166.860474f, -389.396667f, -52.13214f, 35.75531f, 356.052124f, 6.52948f, -285.349823f, 418.016479f, 47.1428833f, 31.4516f, 148.9469f, -219.800385f); + float3x4 r3 = float3x4(166.860474f, -389.396667f, -52.13214f, 35.75531f, 356.052124f, 6.52948f, -285.349823f, 418.016479f, 47.1428833f, 31.4516f, 148.9469f, -219.800385f); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void float3x4_operator_prefix_dec() + { + float3x4 a0 = float3x4(123.128723f, 256.84375f, 156.330811f, 461.737427f, 325.867981f, 392.015625f, 187.874146f, -236.225189f, 125.109619f, 469.844727f, 45.5366821f, 376.046875f); + float3x4 r0 = float3x4(122.128723f, 255.84375f, 155.330811f, 460.737427f, 324.867981f, 391.015625f, 186.874146f, -237.225189f, 124.109619f, 468.844727f, 44.5366821f, 375.046875f); + TestUtils.AreEqual(r0, --a0); + + float3x4 a1 = float3x4(-363.0755f, 248.7901f, 168.095032f, 168.265625f, -190.284729f, 166.945557f, 183.957947f, 485.6947f, -460.739319f, 89.5698853f, -267.4298f, 201.756226f); + float3x4 r1 = float3x4(-364.0755f, 247.7901f, 167.095032f, 167.265625f, -191.284729f, 165.945557f, 182.957947f, 484.6947f, -461.739319f, 88.5698853f, -268.4298f, 200.756226f); + TestUtils.AreEqual(r1, --a1); + + float3x4 a2 = float3x4(-141.216888f, 197.361755f, -213.544128f, 180.7406f, -128.3125f, 478.045532f, -454.566132f, -386.898346f, 387.857f, -315.110443f, -108.28656f, -286.317017f); + float3x4 r2 = float3x4(-142.216888f, 196.361755f, -214.544128f, 179.7406f, -129.3125f, 477.045532f, -455.566132f, -387.898346f, 386.857f, -316.110443f, -109.28656f, -287.317017f); + TestUtils.AreEqual(r2, --a2); + + float3x4 a3 = float3x4(-375.601563f, 78.27545f, 161.531982f, -346.847961f, -57.54077f, 455.372864f, 444.798157f, 129.820129f, 134.710632f, 61.322998f, -274.543335f, -43.39557f); + float3x4 r3 = float3x4(-376.601563f, 77.27545f, 160.531982f, -347.847961f, -58.54077f, 454.372864f, 443.798157f, 128.820129f, 133.710632f, 60.322998f, -275.543335f, -44.39557f); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void float3x4_operator_postfix_dec() + { + float3x4 a0 = float3x4(379.6883f, 302.692871f, -176.07135f, -291.2527f, 470.567566f, -402.925964f, -63.65515f, 355.2611f, -27.8892212f, -100.761841f, 156.14032f, 479.9452f); + float3x4 r0 = float3x4(379.6883f, 302.692871f, -176.07135f, -291.2527f, 470.567566f, -402.925964f, -63.65515f, 355.2611f, -27.8892212f, -100.761841f, 156.14032f, 479.9452f); + TestUtils.AreEqual(r0, a0--); + + float3x4 a1 = float3x4(-200.304291f, 407.420349f, 327.670349f, 48.06018f, -209.667969f, -38.43506f, 283.9416f, -94.80209f, 152.510681f, -287.2625f, -215.948029f, -407.046356f); + float3x4 r1 = float3x4(-200.304291f, 407.420349f, 327.670349f, 48.06018f, -209.667969f, -38.43506f, 283.9416f, -94.80209f, 152.510681f, -287.2625f, -215.948029f, -407.046356f); + TestUtils.AreEqual(r1, a1--); + + float3x4 a2 = float3x4(159.233582f, 168.41394f, -278.933777f, 289.912842f, 402.039551f, 470.716553f, -208.560608f, 145.896729f, -296.790955f, -274.570831f, -250.04126f, -70.85629f); + float3x4 r2 = float3x4(159.233582f, 168.41394f, -278.933777f, 289.912842f, 402.039551f, 470.716553f, -208.560608f, 145.896729f, -296.790955f, -274.570831f, -250.04126f, -70.85629f); + TestUtils.AreEqual(r2, a2--); + + float3x4 a3 = float3x4(-485.627838f, -503.192078f, 397.648621f, 446.621582f, -292.81012f, 126.6225f, -250.442413f, 470.816467f, 26.9436035f, -186.923523f, 45.7460938f, -206.455963f); + float3x4 r3 = float3x4(-485.627838f, -503.192078f, 397.648621f, 446.621582f, -292.81012f, 126.6225f, -250.442413f, 470.816467f, 26.9436035f, -186.923523f, 45.7460938f, -206.455963f); + TestUtils.AreEqual(r3, a3--); + } + + [TestCase /* For player builds */] + public static void float3x4_EqualsObjectOverride() + { + TestUtils.IsFalse(new float3x4().Equals((object)new int())); + TestUtils.IsTrue(new float3x4().Equals((object)new float3x4())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestFloat3x4.gen.cs.meta b/src/Tests/Tests/Shared/TestFloat3x4.gen.cs.meta new file mode 100644 index 00000000..fd7a21fe --- /dev/null +++ b/src/Tests/Tests/Shared/TestFloat3x4.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f8e09d2585c55f8498cd3e3221744e39 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestFloat4.gen.cs b/src/Tests/Tests/Shared/TestFloat4.gen.cs new file mode 100644 index 00000000..1e0d3ab1 --- /dev/null +++ b/src/Tests/Tests/Shared/TestFloat4.gen.cs @@ -0,0 +1,1076 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestFloat4 + { + [TestCompiler] + public static void float4_zero() + { + TestUtils.AreEqual(0.0f, float4.zero.x); + TestUtils.AreEqual(0.0f, float4.zero.y); + TestUtils.AreEqual(0.0f, float4.zero.z); + TestUtils.AreEqual(0.0f, float4.zero.w); + } + + [TestCompiler] + public static void float4_constructor() + { + float4 a = new float4(1, 2, 3, 4); + TestUtils.AreEqual(1, a.x); + TestUtils.AreEqual(2, a.y); + TestUtils.AreEqual(3, a.z); + TestUtils.AreEqual(4, a.w); + } + + [TestCompiler] + public static void float4_scalar_constructor() + { + float4 a = new float4(17.0f); + TestUtils.AreEqual(17.0f, a.x); + TestUtils.AreEqual(17.0f, a.y); + TestUtils.AreEqual(17.0f, a.z); + TestUtils.AreEqual(17.0f, a.w); + } + + [TestCompiler] + public static void float4_static_constructor() + { + float4 a = float4(1, 2, 3, 4); + TestUtils.AreEqual(1, a.x); + TestUtils.AreEqual(2, a.y); + TestUtils.AreEqual(3, a.z); + TestUtils.AreEqual(4, a.w); + } + + [TestCompiler] + public static void float4_static_scalar_constructor() + { + float4 a = float4(17.0f); + TestUtils.AreEqual(17.0f, a.x); + TestUtils.AreEqual(17.0f, a.y); + TestUtils.AreEqual(17.0f, a.z); + TestUtils.AreEqual(17.0f, a.w); + } + + [TestCompiler] + public static void float4_operator_equal_wide_wide() + { + float4 a0 = float4(492.1576f, -495.206329f, 227.457642f, -147.374054f); + float4 b0 = float4(192.568787f, -235.611023f, -254.043121f, -412.624725f); + bool4 r0 = bool4(false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + float4 a1 = float4(-222.682f, 64.09375f, -23.8904114f, -16.8197327f); + float4 b1 = float4(471.9048f, -6.47277832f, -339.102356f, 488.187561f); + bool4 r1 = bool4(false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + float4 a2 = float4(163.232117f, -165.271f, 470.8777f, -423.942566f); + float4 b2 = float4(-379.5966f, -308.417f, -82.333374f, -102.921082f); + bool4 r2 = bool4(false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + float4 a3 = float4(109.6344f, 462.6903f, -335.38147f, 357.2345f); + float4 b3 = float4(226.515747f, -356.9013f, -362.912781f, -427.898438f); + bool4 r3 = bool4(false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void float4_operator_equal_wide_scalar() + { + float4 a0 = float4(-303.230072f, 451.5263f, -253.655884f, -105.203644f); + float b0 = (123.544556f); + bool4 r0 = bool4(false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + float4 a1 = float4(-500.6911f, 159.8761f, -59.55838f, -57.4773865f); + float b1 = (-426.192474f); + bool4 r1 = bool4(false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + float4 a2 = float4(-182.049744f, 370.886f, -172.035309f, 455.400024f); + float b2 = (406.513733f); + bool4 r2 = bool4(false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + float4 a3 = float4(-11.3389893f, -27.1505737f, -325.976074f, -290.359039f); + float b3 = (363.938232f); + bool4 r3 = bool4(false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void float4_operator_equal_scalar_wide() + { + float a0 = (-253.397278f); + float4 b0 = float4(19.95221f, -185.791992f, 407.8136f, -87.2767f); + bool4 r0 = bool4(false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + float a1 = (-206.274689f); + float4 b1 = float4(160.503113f, -274.7708f, -2.63153076f, 448.354553f); + bool4 r1 = bool4(false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + float a2 = (-410.035248f); + float4 b2 = float4(247.329041f, 355.539124f, -298.0667f, 414.1015f); + bool4 r2 = bool4(false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + float a3 = (-481.3026f); + float4 b3 = float4(196.55072f, 34.6010132f, 113.7616f, -386.453369f); + bool4 r3 = bool4(false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void float4_operator_not_equal_wide_wide() + { + float4 a0 = float4(430.842529f, 104.69f, 225.802429f, -310.5702f); + float4 b0 = float4(210.024719f, -55.20334f, -269.925354f, -234.546722f); + bool4 r0 = bool4(true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + float4 a1 = float4(-418.619446f, 304.128174f, -509.3268f, -160.538086f); + float4 b1 = float4(25.91742f, -63.72699f, -484.5537f, -425.3336f); + bool4 r1 = bool4(true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + float4 a2 = float4(-203.301971f, -505.763245f, 162.17218f, 1.156189f); + float4 b2 = float4(-53.2743835f, 328.1944f, 15.9631348f, 461.7141f); + bool4 r2 = bool4(true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + float4 a3 = float4(65.66205f, 102.787781f, 172.930054f, 26.6210327f); + float4 b3 = float4(-113.363037f, -240.072968f, 495.119141f, 203.55835f); + bool4 r3 = bool4(true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void float4_operator_not_equal_wide_scalar() + { + float4 a0 = float4(-16.9145813f, 168.8341f, -462.713531f, 130.307739f); + float b0 = (-145.372772f); + bool4 r0 = bool4(true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + float4 a1 = float4(214.501587f, -197.12796f, -169.099854f, -386.611176f); + float b1 = (-440.263275f); + bool4 r1 = bool4(true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + float4 a2 = float4(-281.021f, -403.9637f, -269.805725f, 299.654236f); + float b2 = (-270.26886f); + bool4 r2 = bool4(true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + float4 a3 = float4(-71.7509155f, -457.363129f, -13.5195923f, 273.873047f); + float b3 = (-432.755737f); + bool4 r3 = bool4(true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void float4_operator_not_equal_scalar_wide() + { + float a0 = (275.795837f); + float4 b0 = float4(-57.1969f, -382.432526f, 97.82037f, -161.463654f); + bool4 r0 = bool4(true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + float a1 = (-458.39563f); + float4 b1 = float4(-499.617859f, 327.92218f, 367.571228f, 59.786377f); + bool4 r1 = bool4(true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + float a2 = (-209.580688f); + float4 b2 = float4(-62.5804443f, -479.974976f, -49.4945068f, -114.685211f); + bool4 r2 = bool4(true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + float a3 = (109.93927f); + float4 b3 = float4(-176.284821f, -347.4853f, 85.5409546f, -356.659546f); + bool4 r3 = bool4(true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void float4_operator_less_wide_wide() + { + float4 a0 = float4(196.84259f, 336.4098f, 251.963745f, 257.655945f); + float4 b0 = float4(-465.345032f, -256.1524f, -314.814026f, 364.5667f); + bool4 r0 = bool4(false, false, false, true); + TestUtils.AreEqual(r0, a0 < b0); + + float4 a1 = float4(430.0459f, -62.4196472f, 8.839233f, -333.8167f); + float4 b1 = float4(100.21051f, 182.560974f, 3.11700439f, -259.430481f); + bool4 r1 = bool4(false, true, false, true); + TestUtils.AreEqual(r1, a1 < b1); + + float4 a2 = float4(164.678833f, -350.9449f, 3.84143066f, 125.409729f); + float4 b2 = float4(-437.3349f, -456.043732f, -394.255981f, 401.9137f); + bool4 r2 = bool4(false, false, false, true); + TestUtils.AreEqual(r2, a2 < b2); + + float4 a3 = float4(-111.129944f, 70.00549f, 448.1983f, -419.987122f); + float4 b3 = float4(313.439148f, 121.286682f, -28.0122986f, -282.965881f); + bool4 r3 = bool4(true, true, false, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void float4_operator_less_wide_scalar() + { + float4 a0 = float4(-132.057312f, -192.465f, -66.8345947f, -379.017517f); + float b0 = (-156.010223f); + bool4 r0 = bool4(false, true, false, true); + TestUtils.AreEqual(r0, a0 < b0); + + float4 a1 = float4(-360.2824f, -158.240753f, 437.3459f, -20.4526062f); + float b1 = (20.9278564f); + bool4 r1 = bool4(true, true, false, true); + TestUtils.AreEqual(r1, a1 < b1); + + float4 a2 = float4(225.2915f, 274.015259f, 373.549683f, 398.523682f); + float b2 = (307.4842f); + bool4 r2 = bool4(true, true, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + float4 a3 = float4(105.030151f, 109.670105f, -108.85318f, -44.9712524f); + float b3 = (-58.0108948f); + bool4 r3 = bool4(false, false, true, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void float4_operator_less_scalar_wide() + { + float a0 = (-423.1174f); + float4 b0 = float4(385.094849f, -123.933472f, 86.37659f, 133.4422f); + bool4 r0 = bool4(true, true, true, true); + TestUtils.AreEqual(r0, a0 < b0); + + float a1 = (161.457947f); + float4 b1 = float4(229.754272f, 222.5716f, 315.5312f, -447.203522f); + bool4 r1 = bool4(true, true, true, false); + TestUtils.AreEqual(r1, a1 < b1); + + float a2 = (271.833862f); + float4 b2 = float4(-393.605316f, 317.486877f, -164.6051f, -282.876038f); + bool4 r2 = bool4(false, true, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + float a3 = (296.979553f); + float4 b3 = float4(-254.401154f, 365.6156f, -441.984253f, -131.42865f); + bool4 r3 = bool4(false, true, false, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void float4_operator_greater_wide_wide() + { + float4 a0 = float4(483.5014f, 310.8156f, 106.966187f, 295.7353f); + float4 b0 = float4(-471.398f, -371.9853f, 36.9006958f, -316.7636f); + bool4 r0 = bool4(true, true, true, true); + TestUtils.AreEqual(r0, a0 > b0); + + float4 a1 = float4(116.957581f, -478.299774f, -14.8974f, -33.8174438f); + float4 b1 = float4(19.6830444f, 207.309143f, 362.7975f, 324.95343f); + bool4 r1 = bool4(true, false, false, false); + TestUtils.AreEqual(r1, a1 > b1); + + float4 a2 = float4(-24.74054f, 319.782654f, -120.158569f, -289.008575f); + float4 b2 = float4(340.948059f, 25.9860229f, -114.211121f, 240.803467f); + bool4 r2 = bool4(false, true, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + float4 a3 = float4(455.85144f, 144.706909f, 63.9320068f, -285.683044f); + float4 b3 = float4(273.422424f, 325.515747f, 27.3410645f, 64.47955f); + bool4 r3 = bool4(true, false, true, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void float4_operator_greater_wide_scalar() + { + float4 a0 = float4(64.31793f, -397.703461f, 431.8769f, 85.703f); + float b0 = (305.859924f); + bool4 r0 = bool4(false, false, true, false); + TestUtils.AreEqual(r0, a0 > b0); + + float4 a1 = float4(246.263062f, 286.199463f, 280.813354f, -405.7846f); + float b1 = (197.491577f); + bool4 r1 = bool4(true, true, true, false); + TestUtils.AreEqual(r1, a1 > b1); + + float4 a2 = float4(171.565369f, 333.5782f, 370.279175f, -413.7014f); + float b2 = (-241.807281f); + bool4 r2 = bool4(true, true, true, false); + TestUtils.AreEqual(r2, a2 > b2); + + float4 a3 = float4(-356.592346f, 396.645325f, 467.222046f, -240.013428f); + float b3 = (-353.0313f); + bool4 r3 = bool4(false, true, true, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void float4_operator_greater_scalar_wide() + { + float a0 = (-282.6705f); + float4 b0 = float4(358.099976f, -72.596405f, -232.163788f, -60.7067261f); + bool4 r0 = bool4(false, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + float a1 = (75.15662f); + float4 b1 = float4(150.883484f, 339.539185f, -498.196045f, 459.7461f); + bool4 r1 = bool4(false, false, true, false); + TestUtils.AreEqual(r1, a1 > b1); + + float a2 = (-227.968719f); + float4 b2 = float4(335.862122f, 76.17883f, 296.859924f, 177.48999f); + bool4 r2 = bool4(false, false, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + float a3 = (-281.2012f); + float4 b3 = float4(244.722839f, 137.328552f, -385.338257f, 443.163452f); + bool4 r3 = bool4(false, false, true, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void float4_operator_less_equal_wide_wide() + { + float4 a0 = float4(-438.523132f, 210.489441f, 4.87731934f, -137.297943f); + float4 b0 = float4(-474.814148f, 304.371033f, 234.824158f, -390.485443f); + bool4 r0 = bool4(false, true, true, false); + TestUtils.AreEqual(r0, a0 <= b0); + + float4 a1 = float4(156.094116f, -363.924133f, -97.94849f, 437.2954f); + float4 b1 = float4(-297.175354f, -326.2924f, 107.253906f, -413.131073f); + bool4 r1 = bool4(false, true, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + float4 a2 = float4(458.530273f, -294.064758f, 23.62262f, -34.2840576f); + float4 b2 = float4(67.09442f, 470.075256f, -84.499115f, 392.784241f); + bool4 r2 = bool4(false, true, false, true); + TestUtils.AreEqual(r2, a2 <= b2); + + float4 a3 = float4(149.736511f, -418.8867f, -197.502533f, -88.2055054f); + float4 b3 = float4(-263.531738f, 369.3009f, -333.3253f, 238.413452f); + bool4 r3 = bool4(false, true, false, true); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void float4_operator_less_equal_wide_scalar() + { + float4 a0 = float4(193.49585f, 168.915527f, -313.993073f, 81.8269653f); + float b0 = (443.850525f); + bool4 r0 = bool4(true, true, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + float4 a1 = float4(18.5036011f, 241.361145f, -463.8164f, -1.35775757f); + float b1 = (-0.3581848f); + bool4 r1 = bool4(false, false, true, true); + TestUtils.AreEqual(r1, a1 <= b1); + + float4 a2 = float4(-268.899475f, -471.253082f, -264.9378f, 82.2583f); + float b2 = (398.991943f); + bool4 r2 = bool4(true, true, true, true); + TestUtils.AreEqual(r2, a2 <= b2); + + float4 a3 = float4(11.2460327f, 426.482239f, 56.3200073f, -196.2879f); + float b3 = (424.704041f); + bool4 r3 = bool4(true, false, true, true); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void float4_operator_less_equal_scalar_wide() + { + float a0 = (393.606262f); + float4 b0 = float4(-75.6883545f, -44.2638855f, 125.864929f, 191.9649f); + bool4 r0 = bool4(false, false, false, false); + TestUtils.AreEqual(r0, a0 <= b0); + + float a1 = (13.54303f); + float4 b1 = float4(-197.051941f, -423.9451f, -330.0486f, 420.165527f); + bool4 r1 = bool4(false, false, false, true); + TestUtils.AreEqual(r1, a1 <= b1); + + float a2 = (105.5473f); + float4 b2 = float4(174.821289f, 296.7176f, -469.7004f, 123.267212f); + bool4 r2 = bool4(true, true, false, true); + TestUtils.AreEqual(r2, a2 <= b2); + + float a3 = (112.996948f); + float4 b3 = float4(495.143372f, -488.6579f, 388.539429f, -493.240784f); + bool4 r3 = bool4(true, false, true, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void float4_operator_greater_equal_wide_wide() + { + float4 a0 = float4(-507.9286f, 504.4975f, -385.4345f, -262.323425f); + float4 b0 = float4(-81.3465f, 297.666138f, 171.06543f, -431.038055f); + bool4 r0 = bool4(false, true, false, true); + TestUtils.AreEqual(r0, a0 >= b0); + + float4 a1 = float4(-37.5509338f, -111.595276f, -463.702026f, 387.448853f); + float4 b1 = float4(-6.85907f, 319.7257f, 254.079163f, 396.5724f); + bool4 r1 = bool4(false, false, false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + float4 a2 = float4(456.9688f, -211.010162f, 182.411377f, -53.59604f); + float4 b2 = float4(178.8393f, -447.063354f, 288.492676f, 474.889282f); + bool4 r2 = bool4(true, true, false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + float4 a3 = float4(-309.570221f, -136.022491f, 280.736267f, -96.99588f); + float4 b3 = float4(-321.750244f, -395.977234f, -158.692474f, 391.4887f); + bool4 r3 = bool4(true, true, true, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void float4_operator_greater_equal_wide_scalar() + { + float4 a0 = float4(465.152161f, -424.886078f, -209.2211f, 58.7798462f); + float b0 = (-5.599884f); + bool4 r0 = bool4(true, false, false, true); + TestUtils.AreEqual(r0, a0 >= b0); + + float4 a1 = float4(-302.2691f, 16.3533936f, -344.559967f, 393.278076f); + float b1 = (140.12561f); + bool4 r1 = bool4(false, false, false, true); + TestUtils.AreEqual(r1, a1 >= b1); + + float4 a2 = float4(-315.701538f, -509.781555f, -36.9942932f, 494.8203f); + float b2 = (441.011536f); + bool4 r2 = bool4(false, false, false, true); + TestUtils.AreEqual(r2, a2 >= b2); + + float4 a3 = float4(-164.973938f, -123.813751f, 215.651245f, 104.995728f); + float b3 = (-466.1201f); + bool4 r3 = bool4(true, true, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void float4_operator_greater_equal_scalar_wide() + { + float a0 = (374.827026f); + float4 b0 = float4(-1.60977173f, 338.615234f, -116.1814f, -332.157318f); + bool4 r0 = bool4(true, true, true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + float a1 = (-355.97937f); + float4 b1 = float4(-468.901428f, 38.579895f, -332.347534f, 2.89013672f); + bool4 r1 = bool4(true, false, false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + float a2 = (467.777771f); + float4 b2 = float4(121.406372f, -305.023376f, -58.4288025f, -226.519562f); + bool4 r2 = bool4(true, true, true, true); + TestUtils.AreEqual(r2, a2 >= b2); + + float a3 = (-47.0209961f); + float4 b3 = float4(305.302673f, -427.401245f, 92.26367f, -497.178528f); + bool4 r3 = bool4(false, true, false, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void float4_operator_add_wide_wide() + { + float4 a0 = float4(506.129028f, -501.779816f, 420.084778f, -186.032074f); + float4 b0 = float4(-28.7579956f, -337.135132f, -340.676819f, 152.312012f); + float4 r0 = float4(477.371033f, -838.9149f, 79.40796f, -33.7200623f); + TestUtils.AreEqual(r0, a0 + b0); + + float4 a1 = float4(-9.312408f, 328.51178f, 424.344055f, 87.79108f); + float4 b1 = float4(423.66748f, 90.3740845f, 376.18866f, 1.76721191f); + float4 r1 = float4(414.355072f, 418.885864f, 800.5327f, 89.55829f); + TestUtils.AreEqual(r1, a1 + b1); + + float4 a2 = float4(462.4137f, -46.17871f, 401.170044f, -454.124146f); + float4 b2 = float4(-120.185852f, -279.629364f, -344.6671f, 242.839172f); + float4 r2 = float4(342.227844f, -325.808075f, 56.50293f, -211.284973f); + TestUtils.AreEqual(r2, a2 + b2); + + float4 a3 = float4(69.19568f, -177.957336f, 299.604126f, 340.704834f); + float4 b3 = float4(418.593079f, -23.3128052f, -95.0999451f, 147.9281f); + float4 r3 = float4(487.788757f, -201.270142f, 204.504181f, 488.632935f); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void float4_operator_add_wide_scalar() + { + float4 a0 = float4(-194.514191f, 338.5484f, 246.971375f, 100.510925f); + float b0 = (124.121704f); + float4 r0 = float4(-70.39249f, 462.6701f, 371.093079f, 224.632629f); + TestUtils.AreEqual(r0, a0 + b0); + + float4 a1 = float4(-45.72467f, 30.9161377f, 60.37433f, -242.118744f); + float b1 = (-478.1113f); + float4 r1 = float4(-523.835938f, -447.19516f, -417.736969f, -720.230042f); + TestUtils.AreEqual(r1, a1 + b1); + + float4 a2 = float4(82.50134f, -484.6998f, -188.265015f, -213.526733f); + float b2 = (6.79937744f); + float4 r2 = float4(89.30072f, -477.900421f, -181.465637f, -206.727356f); + TestUtils.AreEqual(r2, a2 + b2); + + float4 a3 = float4(-267.7843f, 198.533569f, 187.536072f, -424.925659f); + float b3 = (189.259949f); + float4 r3 = float4(-78.52435f, 387.793518f, 376.796021f, -235.66571f); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void float4_operator_add_scalar_wide() + { + float a0 = (-340.354675f); + float4 b0 = float4(511.362244f, -146.216644f, -106.210419f, -363.450256f); + float4 r0 = float4(171.007568f, -486.57132f, -446.5651f, -703.804932f); + TestUtils.AreEqual(r0, a0 + b0); + + float a1 = (199.0896f); + float4 b1 = float4(-27.1083984f, 419.849f, 284.955017f, -164.9242f); + float4 r1 = float4(171.9812f, 618.9386f, 484.044617f, 34.1654053f); + TestUtils.AreEqual(r1, a1 + b1); + + float a2 = (-249.190338f); + float4 b2 = float4(150.928162f, 298.1751f, -457.1534f, 424.718079f); + float4 r2 = float4(-98.26218f, 48.98477f, -706.34375f, 175.52774f); + TestUtils.AreEqual(r2, a2 + b2); + + float a3 = (-301.857483f); + float4 b3 = float4(230.288879f, -423.5876f, -67.06003f, 68.72412f); + float4 r3 = float4(-71.5686f, -725.445068f, -368.9175f, -233.133362f); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void float4_operator_sub_wide_wide() + { + float4 a0 = float4(160.492249f, 11.223938f, 359.200134f, -498.2283f); + float4 b0 = float4(115.46875f, -130.9823f, 241.540833f, 9.987061f); + float4 r0 = float4(45.0235f, 142.206238f, 117.6593f, -508.215363f); + TestUtils.AreEqual(r0, a0 - b0); + + float4 a1 = float4(-355.253632f, -94.53485f, -410.46405f, -401.384644f); + float4 b1 = float4(419.895142f, 59.12445f, -402.381653f, -75.37015f); + float4 r1 = float4(-775.1488f, -153.6593f, -8.082397f, -326.0145f); + TestUtils.AreEqual(r1, a1 - b1); + + float4 a2 = float4(317.706848f, 447.060425f, -489.074158f, -230.008392f); + float4 b2 = float4(320.9796f, -73.90875f, -31.4447327f, -389.251953f); + float4 r2 = float4(-3.272766f, 520.9692f, -457.629425f, 159.243561f); + TestUtils.AreEqual(r2, a2 - b2); + + float4 a3 = float4(24.8754272f, 366.614441f, -107.374146f, -219.008148f); + float4 b3 = float4(-375.028839f, 259.182739f, 276.648682f, -453.0692f); + float4 r3 = float4(399.904266f, 107.4317f, -384.022827f, 234.061066f); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void float4_operator_sub_wide_scalar() + { + float4 a0 = float4(207.389587f, 248.457764f, -384.8239f, -205.344757f); + float b0 = (-36.1124878f); + float4 r0 = float4(243.502075f, 284.570251f, -348.711426f, -169.232269f); + TestUtils.AreEqual(r0, a0 - b0); + + float4 a1 = float4(-374.811554f, 18.8562622f, -44.96161f, 480.857971f); + float b1 = (191.642029f); + float4 r1 = float4(-566.4536f, -172.785767f, -236.603638f, 289.215942f); + TestUtils.AreEqual(r1, a1 - b1); + + float4 a2 = float4(16.3381958f, -35.5231f, 349.397766f, 439.077271f); + float b2 = (-366.865448f); + float4 r2 = float4(383.203644f, 331.342346f, 716.2632f, 805.942749f); + TestUtils.AreEqual(r2, a2 - b2); + + float4 a3 = float4(490.2223f, -384.849426f, 189.05188f, 55.6027832f); + float b3 = (195.024048f); + float4 r3 = float4(295.198242f, -579.8735f, -5.972168f, -139.421265f); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void float4_operator_sub_scalar_wide() + { + float a0 = (-86.00824f); + float4 b0 = float4(466.4251f, 298.486938f, -300.9501f, 315.38f); + float4 r0 = float4(-552.43335f, -384.495178f, 214.941864f, -401.388245f); + TestUtils.AreEqual(r0, a0 - b0); + + float a1 = (-381.092163f); + float4 b1 = float4(-125.008362f, 58.4661865f, 214.7461f, -257.549438f); + float4 r1 = float4(-256.0838f, -439.55835f, -595.838257f, -123.542725f); + TestUtils.AreEqual(r1, a1 - b1); + + float a2 = (480.2246f); + float4 b2 = float4(-443.355072f, 260.795044f, 29.6819458f, 139.857727f); + float4 r2 = float4(923.5797f, 219.429565f, 450.542664f, 340.366882f); + TestUtils.AreEqual(r2, a2 - b2); + + float a3 = (-247.789948f); + float4 b3 = float4(-248.466217f, 91.44513f, 86.3841553f, 373.8183f); + float4 r3 = float4(0.676269531f, -339.235077f, -334.1741f, -621.6083f); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void float4_operator_mul_wide_wide() + { + float4 a0 = float4(-482.7138f, -407.2935f, 137.700562f, 208.541138f); + float4 b0 = float4(-236.367889f, 260.7276f, -416.3863f, -364.4956f); + float4 r0 = float4(114098.047f, -106192.656f, -57336.625f, -76012.33f); + TestUtils.AreEqual(r0, a0 * b0); + + float4 a1 = float4(194.29657f, -484.242432f, 183.9873f, -241.33548f); + float4 b1 = float4(-253.147522f, -369.202881f, 193.547913f, 169.0849f); + float4 r1 = float4(-49185.6953f, 178783.7f, 35610.36f, -40806.1836f); + TestUtils.AreEqual(r1, a1 * b1); + + float4 a2 = float4(45.8687744f, 363.3261f, -328.118958f, -471.023071f); + float4 b2 = float4(201.969666f, 249.456055f, -308.193176f, -385.579651f); + float4 r2 = float4(9264.101f, 90633.9f, 101124.023f, 181616.9f); + TestUtils.AreEqual(r2, a2 * b2); + + float4 a3 = float4(-262.682556f, -379.262756f, -374.090576f, 481.4474f); + float4 b3 = float4(-183.2796f, 22.2756348f, -265.521423f, -95.67746f); + float4 r3 = float4(48144.3555f, -8448.318f, 99329.06f, -46063.6641f); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void float4_operator_mul_wide_scalar() + { + float4 a0 = float4(-96.31882f, -277.142273f, -239.93689f, 509.531433f); + float b0 = (-301.2072f); + float4 r0 = float4(29011.9219f, 83477.25f, 72270.72f, -153474.547f); + TestUtils.AreEqual(r0, a0 * b0); + + float4 a1 = float4(255.8581f, -455.50827f, -389.2433f, -338.29248f); + float b1 = (215.7315f); + float4 r1 = float4(55196.6523f, -98267.4844f, -83972.04f, -72980.34f); + TestUtils.AreEqual(r1, a1 * b1); + + float4 a2 = float4(53.7962646f, 135.354675f, -207.3501f, -383.9396f); + float b2 = (243.757324f); + float4 r2 = float4(13113.2334f, 32993.6953f, -50543.1055f, -93588.09f); + TestUtils.AreEqual(r2, a2 * b2); + + float4 a3 = float4(-31.4252319f, 260.38385f, 176.867554f, 25.67212f); + float b3 = (42.6761475f); + float4 r3 = float4(-1341.10779f, 11112.18f, 7548.026f, 1095.58716f); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void float4_operator_mul_scalar_wide() + { + float a0 = (37.43219f); + float4 b0 = float4(96.74756f, 492.185364f, -274.054565f, -452.870972f); + float4 r0 = float4(3621.473f, 18423.5762f, -10258.4629f, -16951.9531f); + TestUtils.AreEqual(r0, a0 * b0); + + float a1 = (420.853333f); + float4 b1 = float4(102.182922f, -114.948883f, -351.120056f, -464.664978f); + float4 r1 = float4(43004.0234f, -48376.62f, -147770.047f, -195555.8f); + TestUtils.AreEqual(r1, a1 * b1); + + float a2 = (444.084839f); + float4 b2 = float4(447.1053f, 130.829346f, -321.41333f, 445.301331f); + float4 r2 = float4(198552.672f, 58099.33f, -142734.781f, 197751.563f); + TestUtils.AreEqual(r2, a2 * b2); + + float a3 = (478.2436f); + float4 b3 = float4(358.571716f, -144.8901f, -438.893829f, -3.536438f); + float4 r3 = float4(171484.625f, -69292.7656f, -209898.156f, -1691.27881f); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void float4_operator_div_wide_wide() + { + float4 a0 = float4(-353.131439f, -102.799866f, 51.3191528f, -191.871674f); + float4 b0 = float4(-178.739563f, -302.096283f, -199.405823f, 278.850769f); + float4 r0 = float4(1.97567582f, 0.34028843f, -0.257360339f, -0.688080132f); + TestUtils.AreEqual(r0, a0 / b0); + + float4 a1 = float4(8.041809f, -128.73764f, -136.0596f, -370.471f); + float4 b1 = float4(502.3376f, -361.484833f, 353.121033f, -38.894928f); + float4 r1 = float4(0.0160087738f, 0.356135666f, -0.385305852f, 9.524919f); + TestUtils.AreEqual(r1, a1 / b1); + + float4 a2 = float4(-237.69455f, -432.546875f, 200.2655f, 361.4416f); + float4 b2 = float4(-75.76474f, -195.217834f, -405.034f, -394.23f); + float4 r2 = float4(3.1372714f, 2.215714f, -0.4944412f, -0.9168292f); + TestUtils.AreEqual(r2, a2 / b2); + + float4 a3 = float4(-416.226135f, -450.0192f, -273.497437f, -286.908173f); + float4 b3 = float4(-375.8277f, -121.245483f, 447.623352f, 338.286255f); + float4 r3 = float4(1.107492f, 3.71163678f, -0.610999048f, -0.8481225f); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void float4_operator_div_wide_scalar() + { + float4 a0 = float4(171.3424f, 0.103393555f, 57.8882446f, -256.130737f); + float b0 = (171.796814f); + float4 r0 = float4(0.997355f, 0.000601836247f, 0.3369576f, -1.49089336f); + TestUtils.AreEqual(r0, a0 / b0); + + float4 a1 = float4(95.66968f, -127.4487f, -79.7449f, 146.466858f); + float b1 = (-290.3869f); + float4 r1 = float4(-0.3294559f, 0.438892722f, 0.274616063f, -0.504385233f); + TestUtils.AreEqual(r1, a1 / b1); + + float4 a2 = float4(-499.843567f, -453.2058f, -205.033813f, 481.738159f); + float b2 = (58.68634f); + float4 r2 = float4(-8.517204f, -7.72250938f, -3.493723f, 8.2086935f); + TestUtils.AreEqual(r2, a2 / b2); + + float4 a3 = float4(464.479065f, -158.505585f, -289.5822f, 494.1286f); + float b3 = (-293.4635f); + float4 r3 = float4(-1.582749f, 0.540120244f, 0.9867742f, -1.6837821f); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void float4_operator_div_scalar_wide() + { + float a0 = (-264.4425f); + float4 b0 = float4(105.589111f, -142.349091f, -288.9489f, 39.644104f); + float4 r0 = float4(-2.50444865f, 1.85770416f, 0.9151877f, -6.670412f); + TestUtils.AreEqual(r0, a0 / b0); + + float a1 = (-363.9914f); + float4 b1 = float4(-149.718231f, -395.729126f, 258.7187f, -9.66626f); + float4 r1 = float4(2.43117619f, 0.9197993f, -1.40690029f, 37.65587f); + TestUtils.AreEqual(r1, a1 / b1); + + float a2 = (117.725525f); + float4 b2 = float4(-331.386536f, -509.986023f, 427.896484f, 467.617126f); + float4 r2 = float4(-0.355251372f, -0.230840683f, 0.2751262f, 0.251756221f); + TestUtils.AreEqual(r2, a2 / b2); + + float a3 = (-407.124634f); + float4 b3 = float4(252.690735f, 444.599365f, -88.31329f, 199.955017f); + float4 r3 = float4(-1.61115777f, -0.9157112f, 4.610004f, -2.036081f); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void float4_operator_mod_wide_wide() + { + float4 a0 = float4(-388.8125f, 181.681213f, -167.078735f, 432.820129f); + float4 b0 = float4(436.944153f, 58.9400635f, -201.116241f, 279.289368f); + float4 r0 = float4(-388.8125f, 4.861023f, -167.078735f, 153.530762f); + TestUtils.AreEqual(r0, a0 % b0); + + float4 a1 = float4(-258.438965f, -170.110809f, 283.3183f, 122.716492f); + float4 b1 = float4(-397.079773f, 377.899963f, 174.693848f, -228.176514f); + float4 r1 = float4(-258.438965f, -170.110809f, 108.624451f, 122.716492f); + TestUtils.AreEqual(r1, a1 % b1); + + float4 a2 = float4(335.271f, -503.608521f, 191.022522f, 289.742676f); + float4 b2 = float4(-317.060181f, -417.4801f, -249.975952f, -397.571564f); + float4 r2 = float4(18.2108154f, -86.12842f, 191.022522f, 289.742676f); + TestUtils.AreEqual(r2, a2 % b2); + + float4 a3 = float4(-124.033722f, 259.274f, -274.358459f, -140.030792f); + float4 b3 = float4(-358.745453f, -198.15921f, 208.737122f, -12.1194153f); + float4 r3 = float4(-124.033722f, 61.1147766f, -65.62134f, -6.717224f); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void float4_operator_mod_wide_scalar() + { + float4 a0 = float4(-244.499634f, -211.8193f, -145.926788f, -304.9182f); + float b0 = (39.63495f); + float4 r0 = float4(-6.68994141f, -13.6445618f, -27.0219421f, -27.4735718f); + TestUtils.AreEqual(r0, a0 % b0); + + float4 a1 = float4(155.479492f, 281.309631f, -226.535767f, 335.166138f); + float b1 = (-133.907776f); + float4 r1 = float4(21.5717163f, 13.49408f, -92.62799f, 67.3505859f); + TestUtils.AreEqual(r1, a1 % b1); + + float4 a2 = float4(101.706482f, -285.4023f, -355.846863f, 259.378f); + float b2 = (319.4715f); + float4 r2 = float4(101.706482f, -285.4023f, -36.3753662f, 259.378f); + TestUtils.AreEqual(r2, a2 % b2); + + float4 a3 = float4(-330.871948f, -102.683441f, -172.141754f, 206.41687f); + float b3 = (-284.343567f); + float4 r3 = float4(-46.52838f, -102.683441f, -172.141754f, 206.41687f); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void float4_operator_mod_scalar_wide() + { + float a0 = (-66.94504f); + float4 b0 = float4(-249.7761f, -396.073761f, 386.492065f, 168.939453f); + float4 r0 = float4(-66.94504f, -66.94504f, -66.94504f, -66.94504f); + TestUtils.AreEqual(r0, a0 % b0); + + float a1 = (-199.418243f); + float4 b1 = float4(261.7517f, 16.1274414f, 257.668152f, -75.78845f); + float4 r1 = float4(-199.418243f, -5.88894653f, -199.418243f, -47.84134f); + TestUtils.AreEqual(r1, a1 % b1); + + float a2 = (170.9563f); + float4 b2 = float4(-242.858276f, 425.9453f, 303.2724f, 3.033081f); + float4 r2 = float4(170.9563f, 170.9563f, 170.9563f, 1.10375977f); + TestUtils.AreEqual(r2, a2 % b2); + + float a3 = (-505.74353f); + float4 b3 = float4(461.957031f, 205.972778f, 270.040649f, -47.4807129f); + float4 r3 = float4(-43.7865f, -93.79797f, -235.702881f, -30.9364014f); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void float4_operator_plus() + { + float4 a0 = float4(-418.829559f, -405.79895f, -34.04178f, 236.999268f); + float4 r0 = float4(-418.829559f, -405.79895f, -34.04178f, 236.999268f); + TestUtils.AreEqual(r0, +a0); + + float4 a1 = float4(-459.8391f, 293.742f, -373.015442f, -386.059845f); + float4 r1 = float4(-459.8391f, 293.742f, -373.015442f, -386.059845f); + TestUtils.AreEqual(r1, +a1); + + float4 a2 = float4(4.95440674f, 504.474854f, -170.746521f, 439.5594f); + float4 r2 = float4(4.95440674f, 504.474854f, -170.746521f, 439.5594f); + TestUtils.AreEqual(r2, +a2); + + float4 a3 = float4(-478.7494f, 421.409668f, -258.596069f, 447.8661f); + float4 r3 = float4(-478.7494f, 421.409668f, -258.596069f, 447.8661f); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void float4_operator_neg() + { + float4 a0 = float4(148.461731f, -467.122681f, 132.04718f, 183.522644f); + float4 r0 = float4(-148.461731f, 467.122681f, -132.04718f, -183.522644f); + TestUtils.AreEqual(r0, -a0); + + float4 a1 = float4(473.701f, -54.95877f, -382.9898f, -299.093384f); + float4 r1 = float4(-473.701f, 54.95877f, 382.9898f, 299.093384f); + TestUtils.AreEqual(r1, -a1); + + float4 a2 = float4(-383.014069f, 168.735474f, 466.441528f, 171.902466f); + float4 r2 = float4(383.014069f, -168.735474f, -466.441528f, -171.902466f); + TestUtils.AreEqual(r2, -a2); + + float4 a3 = float4(-280.558319f, 318.69635f, -39.9154053f, 140.340027f); + float4 r3 = float4(280.558319f, -318.69635f, 39.9154053f, -140.340027f); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void float4_operator_prefix_inc() + { + float4 a0 = float4(-139.842072f, -56.7436523f, -381.955322f, 509.796326f); + float4 r0 = float4(-138.842072f, -55.7436523f, -380.955322f, 510.796326f); + TestUtils.AreEqual(r0, ++a0); + + float4 a1 = float4(-222.896332f, -392.7315f, -300.1941f, 362.212769f); + float4 r1 = float4(-221.896332f, -391.7315f, -299.1941f, 363.212769f); + TestUtils.AreEqual(r1, ++a1); + + float4 a2 = float4(401.6148f, -450.230164f, 243.546936f, 46.1920166f); + float4 r2 = float4(402.6148f, -449.230164f, 244.546936f, 47.1920166f); + TestUtils.AreEqual(r2, ++a2); + + float4 a3 = float4(-41.4972839f, 154.356567f, -281.233276f, 200.706f); + float4 r3 = float4(-40.4972839f, 155.356567f, -280.233276f, 201.706f); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void float4_operator_postfix_inc() + { + float4 a0 = float4(-396.669739f, 511.20752f, 249.111267f, -128.817322f); + float4 r0 = float4(-396.669739f, 511.20752f, 249.111267f, -128.817322f); + TestUtils.AreEqual(r0, a0++); + + float4 a1 = float4(-259.4903f, -81.39343f, 66.71973f, 167.852112f); + float4 r1 = float4(-259.4903f, -81.39343f, 66.71973f, 167.852112f); + TestUtils.AreEqual(r1, a1++); + + float4 a2 = float4(147.94397f, 41.03357f, 128.5304f, 73.15558f); + float4 r2 = float4(147.94397f, 41.03357f, 128.5304f, 73.15558f); + TestUtils.AreEqual(r2, a2++); + + float4 a3 = float4(-60.1323853f, -296.937836f, 267.293823f, 446.2293f); + float4 r3 = float4(-60.1323853f, -296.937836f, 267.293823f, 446.2293f); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void float4_operator_prefix_dec() + { + float4 a0 = float4(123.128723f, 256.84375f, 156.330811f, 461.737427f); + float4 r0 = float4(122.128723f, 255.84375f, 155.330811f, 460.737427f); + TestUtils.AreEqual(r0, --a0); + + float4 a1 = float4(325.867981f, 187.874146f, -236.225189f, 125.109619f); + float4 r1 = float4(324.867981f, 186.874146f, -237.225189f, 124.109619f); + TestUtils.AreEqual(r1, --a1); + + float4 a2 = float4(469.844727f, 376.046875f, -363.0755f, -22.0289612f); + float4 r2 = float4(468.844727f, 375.046875f, -364.0755f, -23.0289612f); + TestUtils.AreEqual(r2, --a2); + + float4 a3 = float4(248.7901f, 168.265625f, -190.284729f, 166.945557f); + float4 r3 = float4(247.7901f, 167.265625f, -191.284729f, 165.945557f); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void float4_operator_postfix_dec() + { + float4 a0 = float4(379.6883f, 302.692871f, -176.07135f, -291.2527f); + float4 r0 = float4(379.6883f, 302.692871f, -176.07135f, -291.2527f); + TestUtils.AreEqual(r0, a0--); + + float4 a1 = float4(470.567566f, -63.65515f, 355.2611f, -27.8892212f); + float4 r1 = float4(470.567566f, -63.65515f, 355.2611f, -27.8892212f); + TestUtils.AreEqual(r1, a1--); + + float4 a2 = float4(-100.761841f, 479.9452f, -200.304291f, -445.026947f); + float4 r2 = float4(-100.761841f, 479.9452f, -200.304291f, -445.026947f); + TestUtils.AreEqual(r2, a2--); + + float4 a3 = float4(407.420349f, 48.06018f, -209.667969f, -38.43506f); + float4 r3 = float4(407.420349f, 48.06018f, -209.667969f, -38.43506f); + TestUtils.AreEqual(r3, a3--); + } + + [TestCompiler] + public static void float4_shuffle_result_1() + { + float4 a = float4(0, 1, 2, 3); + float4 b = float4(4, 5, 6, 7); + + TestUtils.AreEqual((0), shuffle(a, b, ShuffleComponent.LeftX)); + TestUtils.AreEqual((1), shuffle(a, b, ShuffleComponent.LeftY)); + TestUtils.AreEqual((2), shuffle(a, b, ShuffleComponent.LeftZ)); + TestUtils.AreEqual((3), shuffle(a, b, ShuffleComponent.LeftW)); + TestUtils.AreEqual((4), shuffle(a, b, ShuffleComponent.RightX)); + TestUtils.AreEqual((5), shuffle(a, b, ShuffleComponent.RightY)); + TestUtils.AreEqual((6), shuffle(a, b, ShuffleComponent.RightZ)); + TestUtils.AreEqual((7), shuffle(a, b, ShuffleComponent.RightW)); + } + + [TestCompiler] + public static void float4_shuffle_result_2() + { + float4 a = float4(0, 1, 2, 3); + float4 b = float4(4, 5, 6, 7); + + TestUtils.AreEqual(float2(5, 6), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightZ)); + TestUtils.AreEqual(float2(6, 4), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.RightX)); + TestUtils.AreEqual(float2(1, 4), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.RightX)); + TestUtils.AreEqual(float2(7, 3), shuffle(a, b, ShuffleComponent.RightW, ShuffleComponent.LeftW)); + TestUtils.AreEqual(float2(7, 2), shuffle(a, b, ShuffleComponent.RightW, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(float2(2, 3), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.LeftW)); + TestUtils.AreEqual(float2(5, 3), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftW)); + TestUtils.AreEqual(float2(7, 0), shuffle(a, b, ShuffleComponent.RightW, ShuffleComponent.LeftX)); + TestUtils.AreEqual(float2(6, 7), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.RightW)); + TestUtils.AreEqual(float2(5, 2), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(float2(6, 6), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.RightZ)); + TestUtils.AreEqual(float2(7, 0), shuffle(a, b, ShuffleComponent.RightW, ShuffleComponent.LeftX)); + TestUtils.AreEqual(float2(5, 4), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightX)); + TestUtils.AreEqual(float2(7, 5), shuffle(a, b, ShuffleComponent.RightW, ShuffleComponent.RightY)); + TestUtils.AreEqual(float2(4, 0), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftX)); + TestUtils.AreEqual(float2(1, 3), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.LeftW)); + } + + [TestCompiler] + public static void float4_shuffle_result_3() + { + float4 a = float4(0, 1, 2, 3); + float4 b = float4(4, 5, 6, 7); + + TestUtils.AreEqual(float3(2, 7, 5), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.RightW, ShuffleComponent.RightY)); + TestUtils.AreEqual(float3(6, 0, 3), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.LeftX, ShuffleComponent.LeftW)); + TestUtils.AreEqual(float3(2, 7, 4), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.RightW, ShuffleComponent.RightX)); + TestUtils.AreEqual(float3(5, 0, 2), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftX, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(float3(7, 6, 2), shuffle(a, b, ShuffleComponent.RightW, ShuffleComponent.RightZ, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(float3(3, 1, 1), shuffle(a, b, ShuffleComponent.LeftW, ShuffleComponent.LeftY, ShuffleComponent.LeftY)); + TestUtils.AreEqual(float3(3, 5, 4), shuffle(a, b, ShuffleComponent.LeftW, ShuffleComponent.RightY, ShuffleComponent.RightX)); + TestUtils.AreEqual(float3(3, 1, 7), shuffle(a, b, ShuffleComponent.LeftW, ShuffleComponent.LeftY, ShuffleComponent.RightW)); + TestUtils.AreEqual(float3(6, 5, 6), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.RightY, ShuffleComponent.RightZ)); + TestUtils.AreEqual(float3(5, 4, 1), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightX, ShuffleComponent.LeftY)); + TestUtils.AreEqual(float3(7, 7, 0), shuffle(a, b, ShuffleComponent.RightW, ShuffleComponent.RightW, ShuffleComponent.LeftX)); + TestUtils.AreEqual(float3(6, 1, 5), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.LeftY, ShuffleComponent.RightY)); + TestUtils.AreEqual(float3(6, 1, 7), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.LeftY, ShuffleComponent.RightW)); + TestUtils.AreEqual(float3(3, 5, 5), shuffle(a, b, ShuffleComponent.LeftW, ShuffleComponent.RightY, ShuffleComponent.RightY)); + TestUtils.AreEqual(float3(6, 0, 5), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.LeftX, ShuffleComponent.RightY)); + TestUtils.AreEqual(float3(5, 1, 7), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftY, ShuffleComponent.RightW)); + } + + [TestCompiler] + public static void float4_shuffle_result_4() + { + float4 a = float4(0, 1, 2, 3); + float4 b = float4(4, 5, 6, 7); + + TestUtils.AreEqual(float4(1, 3, 4, 2), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.LeftW, ShuffleComponent.RightX, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(float4(5, 3, 6, 6), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftW, ShuffleComponent.RightZ, ShuffleComponent.RightZ)); + TestUtils.AreEqual(float4(6, 6, 7, 2), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.RightZ, ShuffleComponent.RightW, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(float4(4, 5, 2, 2), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightY, ShuffleComponent.LeftZ, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(float4(6, 1, 1, 0), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.LeftY, ShuffleComponent.LeftY, ShuffleComponent.LeftX)); + TestUtils.AreEqual(float4(4, 5, 5, 7), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightY, ShuffleComponent.RightY, ShuffleComponent.RightW)); + TestUtils.AreEqual(float4(1, 7, 0, 7), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.RightW, ShuffleComponent.LeftX, ShuffleComponent.RightW)); + TestUtils.AreEqual(float4(5, 0, 1, 0), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftX, ShuffleComponent.LeftY, ShuffleComponent.LeftX)); + TestUtils.AreEqual(float4(4, 7, 3, 1), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightW, ShuffleComponent.LeftW, ShuffleComponent.LeftY)); + TestUtils.AreEqual(float4(5, 4, 1, 4), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightX, ShuffleComponent.LeftY, ShuffleComponent.RightX)); + TestUtils.AreEqual(float4(0, 2, 6, 0), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.LeftZ, ShuffleComponent.RightZ, ShuffleComponent.LeftX)); + TestUtils.AreEqual(float4(2, 5, 7, 7), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.RightY, ShuffleComponent.RightW, ShuffleComponent.RightW)); + TestUtils.AreEqual(float4(3, 4, 2, 4), shuffle(a, b, ShuffleComponent.LeftW, ShuffleComponent.RightX, ShuffleComponent.LeftZ, ShuffleComponent.RightX)); + TestUtils.AreEqual(float4(4, 0, 2, 3), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftX, ShuffleComponent.LeftZ, ShuffleComponent.LeftW)); + TestUtils.AreEqual(float4(6, 4, 0, 5), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.RightX, ShuffleComponent.LeftX, ShuffleComponent.RightY)); + TestUtils.AreEqual(float4(3, 7, 1, 5), shuffle(a, b, ShuffleComponent.LeftW, ShuffleComponent.RightW, ShuffleComponent.LeftY, ShuffleComponent.RightY)); + } + + [TestCase /* For player builds */] + public static void float4_EqualsObjectOverride() + { + TestUtils.IsFalse(new float4().Equals((object)new int())); + TestUtils.IsTrue(new float4().Equals((object)new float4())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestFloat4.gen.cs.meta b/src/Tests/Tests/Shared/TestFloat4.gen.cs.meta new file mode 100644 index 00000000..3784a8b2 --- /dev/null +++ b/src/Tests/Tests/Shared/TestFloat4.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f415d23fdfcb53742837bd44ef1b7825 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestFloat4x2.gen.cs b/src/Tests/Tests/Shared/TestFloat4x2.gen.cs new file mode 100644 index 00000000..9b0cd505 --- /dev/null +++ b/src/Tests/Tests/Shared/TestFloat4x2.gen.cs @@ -0,0 +1,952 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestFloat4x2 + { + [TestCompiler] + public static void float4x2_zero() + { + TestUtils.AreEqual(0.0f, float4x2.zero.c0.x); + TestUtils.AreEqual(0.0f, float4x2.zero.c0.y); + TestUtils.AreEqual(0.0f, float4x2.zero.c0.z); + TestUtils.AreEqual(0.0f, float4x2.zero.c0.w); + TestUtils.AreEqual(0.0f, float4x2.zero.c1.x); + TestUtils.AreEqual(0.0f, float4x2.zero.c1.y); + TestUtils.AreEqual(0.0f, float4x2.zero.c1.z); + TestUtils.AreEqual(0.0f, float4x2.zero.c1.w); + } + + [TestCompiler] + public static void float4x2_operator_equal_wide_wide() + { + float4x2 a0 = float4x2(492.1576f, -495.206329f, 227.457642f, -147.374054f, -222.682f, 64.09375f, -23.8904114f, -16.8197327f); + float4x2 b0 = float4x2(192.568787f, -235.611023f, -254.043121f, -412.624725f, 471.9048f, -6.47277832f, -339.102356f, 488.187561f); + bool4x2 r0 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + float4x2 a1 = float4x2(163.232117f, -165.271f, 470.8777f, -423.942566f, 109.6344f, 462.6903f, -335.38147f, 357.2345f); + float4x2 b1 = float4x2(-379.5966f, -308.417f, -82.333374f, -102.921082f, 226.515747f, -356.9013f, -362.912781f, -427.898438f); + bool4x2 r1 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + float4x2 a2 = float4x2(1.54559326f, -347.388245f, -114.472168f, 435.848633f, 194.2381f, 138.765564f, -467.349152f, 370.43335f); + float4x2 b2 = float4x2(466.650146f, -102.799042f, -43.355957f, 85.0456543f, -91.1270447f, 422.192078f, -477.4313f, 1.87701416f); + bool4x2 r2 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + float4x2 a3 = float4x2(476.708252f, 320.552673f, -498.59198f, 92.41693f, 104.511353f, 166.754578f, -204.733429f, 434.756775f); + float4x2 b3 = float4x2(312.580078f, 254.599365f, 352.72583f, 62.4909668f, 119.714783f, -511.058075f, -302.472717f, -371.769226f); + bool4x2 r3 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void float4x2_operator_equal_wide_scalar() + { + float4x2 a0 = float4x2(-303.230072f, 451.5263f, -253.655884f, -105.203644f, -500.6911f, -426.192474f, 159.8761f, -59.55838f); + float b0 = (123.544556f); + bool4x2 r0 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + float4x2 a1 = float4x2(-57.4773865f, 406.513733f, 370.886f, -172.035309f, 455.400024f, -11.3389893f, 363.938232f, -27.1505737f); + float b1 = (-182.049744f); + bool4x2 r1 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + float4x2 a2 = float4x2(-325.976074f, 180.196838f, -374.128326f, -439.358948f, -126.546082f, -197.26178f, -227.159332f, -479.8992f); + float b2 = (-290.359039f); + bool4x2 r2 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + float4x2 a3 = float4x2(-439.777679f, -224.517059f, -422.833221f, -450.196259f, -20.10672f, 297.38f, 185.966553f, -102.975983f); + float b3 = (-495.237335f); + bool4x2 r3 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void float4x2_operator_equal_scalar_wide() + { + float a0 = (-253.397278f); + float4x2 b0 = float4x2(19.95221f, -185.791992f, 407.8136f, -87.2767f, -206.274689f, 160.503113f, -274.7708f, -2.63153076f); + bool4x2 r0 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + float a1 = (448.354553f); + float4x2 b1 = float4x2(-410.035248f, 247.329041f, 355.539124f, -298.0667f, 414.1015f, -481.3026f, 196.55072f, 34.6010132f); + bool4x2 r1 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + float a2 = (113.7616f); + float4x2 b2 = float4x2(-386.453369f, -124.49176f, 243.886658f, -492.6182f, 145.424438f, 421.55072f, -95.40997f, 336.809265f); + bool4x2 r2 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + float a3 = (209.5838f); + float4x2 b3 = float4x2(487.4414f, 161.806519f, 149.842468f, 225.724f, -71.21881f, 85.78027f, 192.547241f, -49.88748f); + bool4x2 r3 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void float4x2_operator_not_equal_wide_wide() + { + float4x2 a0 = float4x2(430.842529f, 104.69f, 225.802429f, -310.5702f, -418.619446f, 304.128174f, -509.3268f, -160.538086f); + float4x2 b0 = float4x2(210.024719f, -55.20334f, -269.925354f, -234.546722f, 25.91742f, -63.72699f, -484.5537f, -425.3336f); + bool4x2 r0 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + float4x2 a1 = float4x2(-203.301971f, -505.763245f, 162.17218f, 1.156189f, 65.66205f, 102.787781f, 172.930054f, 26.6210327f); + float4x2 b1 = float4x2(-53.2743835f, 328.1944f, 15.9631348f, 461.7141f, -113.363037f, -240.072968f, 495.119141f, 203.55835f); + bool4x2 r1 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + float4x2 a2 = float4x2(235.125977f, 128.541992f, -354.996979f, 334.3595f, -495.832f, 468.307373f, 458.370972f, 299.937317f); + float4x2 b2 = float4x2(340.493469f, -241.9072f, 459.569824f, 213.07373f, -384.782837f, -255.072327f, 477.663452f, -248.036621f); + bool4x2 r2 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + float4x2 a3 = float4x2(43.1271973f, -354.7135f, -145.2872f, 390.80188f, -303.13147f, 391.134583f, 139.286865f, 104.523193f); + float4x2 b3 = float4x2(-407.923462f, -199.788879f, 151.843262f, -97.1206055f, 154.975891f, -172.834534f, 441.5028f, -401.738617f); + bool4x2 r3 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void float4x2_operator_not_equal_wide_scalar() + { + float4x2 a0 = float4x2(-16.9145813f, 168.8341f, -462.713531f, 130.307739f, 214.501587f, -440.263275f, -197.12796f, -169.099854f); + float b0 = (-145.372772f); + bool4x2 r0 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + float4x2 a1 = float4x2(-386.611176f, -270.26886f, -403.9637f, -269.805725f, 299.654236f, -71.7509155f, -432.755737f, -457.363129f); + float b1 = (-281.021f); + bool4x2 r1 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + float4x2 a2 = float4x2(-13.5195923f, 185.04248f, -482.5307f, 116.395142f, 511.735f, 230.5075f, 100.27478f, 129.682434f); + float b2 = (273.873047f); + bool4x2 r2 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + float4x2 a3 = float4x2(321.178772f, 140.3352f, 369.212341f, 453.811218f, -333.66626f, -373.937744f, 150.204285f, -442.164764f); + float b3 = (-220.639f); + bool4x2 r3 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void float4x2_operator_not_equal_scalar_wide() + { + float a0 = (275.795837f); + float4x2 b0 = float4x2(-57.1969f, -382.432526f, 97.82037f, -161.463654f, -458.39563f, -499.617859f, 327.92218f, 367.571228f); + bool4x2 r0 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + float a1 = (59.786377f); + float4x2 b1 = float4x2(-209.580688f, -62.5804443f, -479.974976f, -49.4945068f, -114.685211f, 109.93927f, -176.284821f, -347.4853f); + bool4x2 r1 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + float a2 = (85.5409546f); + float4x2 b2 = float4x2(-356.659546f, -104.243561f, -133.5492f, 243.539734f, 13.1412964f, -379.985962f, -41.28122f, 87.91168f); + bool4x2 r2 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + float a3 = (-339.077271f); + float4x2 b3 = float4x2(-371.820343f, 333.1443f, 294.811951f, -187.14566f, 220.192261f, -228.182068f, -499.723724f, 97.40588f); + bool4x2 r3 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void float4x2_operator_less_wide_wide() + { + float4x2 a0 = float4x2(196.84259f, 336.4098f, 251.963745f, 257.655945f, 430.0459f, -62.4196472f, 8.839233f, -333.8167f); + float4x2 b0 = float4x2(-465.345032f, -256.1524f, -314.814026f, 364.5667f, 100.21051f, 182.560974f, 3.11700439f, -259.430481f); + bool4x2 r0 = bool4x2(false, false, false, true, false, true, false, true); + TestUtils.AreEqual(r0, a0 < b0); + + float4x2 a1 = float4x2(164.678833f, -350.9449f, 3.84143066f, 125.409729f, -111.129944f, 70.00549f, 448.1983f, -419.987122f); + float4x2 b1 = float4x2(-437.3349f, -456.043732f, -394.255981f, 401.9137f, 313.439148f, 121.286682f, -28.0122986f, -282.965881f); + bool4x2 r1 = bool4x2(false, false, false, true, true, true, false, true); + TestUtils.AreEqual(r1, a1 < b1); + + float4x2 a2 = float4x2(-258.301666f, -34.8322144f, -69.8594055f, 67.76721f, -139.777283f, 385.434631f, 133.7074f, 506.188354f); + float4x2 b2 = float4x2(330.0644f, 124.099365f, -183.6903f, 373.0608f, 109.750916f, -203.57135f, 45.64868f, -360.952271f); + bool4x2 r2 = bool4x2(true, true, false, true, true, false, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + float4x2 a3 = float4x2(34.44287f, 412.1137f, -84.8097839f, 444.785339f, -78.75473f, 366.977539f, 127.180481f, 428.368469f); + float4x2 b3 = float4x2(211.913086f, -313.286377f, -259.661072f, 79.09851f, 446.4961f, 450.524536f, -375.630768f, -53.9418335f); + bool4x2 r3 = bool4x2(true, false, false, false, true, true, false, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void float4x2_operator_less_wide_scalar() + { + float4x2 a0 = float4x2(-132.057312f, -192.465f, -66.8345947f, -379.017517f, -360.2824f, 20.9278564f, -158.240753f, 437.3459f); + float b0 = (-156.010223f); + bool4x2 r0 = bool4x2(false, true, false, true, true, false, true, false); + TestUtils.AreEqual(r0, a0 < b0); + + float4x2 a1 = float4x2(-20.4526062f, 307.4842f, 274.015259f, 373.549683f, 398.523682f, 105.030151f, -58.0108948f, 109.670105f); + float b1 = (225.2915f); + bool4x2 r1 = bool4x2(true, false, false, false, false, true, true, true); + TestUtils.AreEqual(r1, a1 < b1); + + float4x2 a2 = float4x2(-108.85318f, 140.426086f, -500.0883f, 172.103333f, -197.500732f, -7.271515f, -432.9905f, 62.1583252f); + float b2 = (-44.9712524f); + bool4x2 r2 = bool4x2(true, false, true, false, true, false, true, false); + TestUtils.AreEqual(r2, a2 < b2); + + float4x2 a3 = float4x2(-72.25473f, -500.255737f, 149.11499f, 119.880615f, 202.63916f, 274.950684f, 66.41205f, 274.999451f); + float b3 = (-377.852325f); + bool4x2 r3 = bool4x2(false, true, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void float4x2_operator_less_scalar_wide() + { + float a0 = (-423.1174f); + float4x2 b0 = float4x2(385.094849f, -123.933472f, 86.37659f, 133.4422f, 161.457947f, 229.754272f, 222.5716f, 315.5312f); + bool4x2 r0 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 < b0); + + float a1 = (-447.203522f); + float4x2 b1 = float4x2(271.833862f, -393.605316f, 317.486877f, -164.6051f, -282.876038f, 296.979553f, -254.401154f, 365.6156f); + bool4x2 r1 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 < b1); + + float a2 = (-441.984253f); + float4x2 b2 = float4x2(-131.42865f, 442.628967f, -29.7928467f, -138.37381f, 9.21698f, -226.73056f, 171.029419f, 376.625244f); + bool4x2 r2 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 < b2); + + float a3 = (-462.5887f); + float4x2 b3 = float4x2(-142.36731f, -456.253784f, 66.61023f, 169.378784f, 327.4444f, 64.08795f, -153.5039f, 199.380127f); + bool4x2 r3 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void float4x2_operator_greater_wide_wide() + { + float4x2 a0 = float4x2(483.5014f, 310.8156f, 106.966187f, 295.7353f, 116.957581f, -478.299774f, -14.8974f, -33.8174438f); + float4x2 b0 = float4x2(-471.398f, -371.9853f, 36.9006958f, -316.7636f, 19.6830444f, 207.309143f, 362.7975f, 324.95343f); + bool4x2 r0 = bool4x2(true, true, true, true, true, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + float4x2 a1 = float4x2(-24.74054f, 319.782654f, -120.158569f, -289.008575f, 455.85144f, 144.706909f, 63.9320068f, -285.683044f); + float4x2 b1 = float4x2(340.948059f, 25.9860229f, -114.211121f, 240.803467f, 273.422424f, 325.515747f, 27.3410645f, 64.47955f); + bool4x2 r1 = bool4x2(false, true, false, false, true, false, true, false); + TestUtils.AreEqual(r1, a1 > b1); + + float4x2 a2 = float4x2(-502.090729f, -337.194458f, 474.317322f, -507.1451f, -133.565582f, -443.109131f, -464.34137f, -68.36154f); + float4x2 b2 = float4x2(200.948364f, 100.122681f, -79.00711f, -315.137939f, -122.985443f, -163.7792f, -492.566f, -90.79727f); + bool4x2 r2 = bool4x2(false, false, true, false, false, false, true, true); + TestUtils.AreEqual(r2, a2 > b2); + + float4x2 a3 = float4x2(-185.993011f, -157.8039f, -74.12424f, -94.47116f, 329.610535f, -315.836731f, 404.1938f, 131.304382f); + float4x2 b3 = float4x2(-284.901245f, -23.6536865f, 174.93f, 85.7125244f, -441.987823f, 345.543762f, 482.219482f, -422.383484f); + bool4x2 r3 = bool4x2(true, false, false, false, true, false, false, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void float4x2_operator_greater_wide_scalar() + { + float4x2 a0 = float4x2(64.31793f, -397.703461f, 431.8769f, 85.703f, 246.263062f, 197.491577f, 286.199463f, 280.813354f); + float b0 = (305.859924f); + bool4x2 r0 = bool4x2(false, false, true, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + float4x2 a1 = float4x2(-405.7846f, -241.807281f, 333.5782f, 370.279175f, -413.7014f, -356.592346f, -353.0313f, 396.645325f); + float b1 = (171.565369f); + bool4x2 r1 = bool4x2(false, false, true, true, false, false, false, true); + TestUtils.AreEqual(r1, a1 > b1); + + float4x2 a2 = float4x2(467.222046f, 502.915039f, 315.4676f, -259.2897f, 281.230652f, 428.792175f, 245.153076f, -279.1754f); + float b2 = (-240.013428f); + bool4x2 r2 = bool4x2(true, true, true, false, true, true, true, false); + TestUtils.AreEqual(r2, a2 > b2); + + float4x2 a3 = float4x2(-453.8631f, -425.652924f, 99.13287f, 355.060547f, -456.439423f, 154.489014f, 405.529724f, -157.7338f); + float b3 = (-124.771545f); + bool4x2 r3 = bool4x2(false, false, true, true, false, true, true, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void float4x2_operator_greater_scalar_wide() + { + float a0 = (-282.6705f); + float4x2 b0 = float4x2(358.099976f, -72.596405f, -232.163788f, -60.7067261f, 75.15662f, 150.883484f, 339.539185f, -498.196045f); + bool4x2 r0 = bool4x2(false, false, false, false, false, false, false, true); + TestUtils.AreEqual(r0, a0 > b0); + + float a1 = (459.7461f); + float4x2 b1 = float4x2(-227.968719f, 335.862122f, 76.17883f, 296.859924f, 177.48999f, -281.2012f, 244.722839f, 137.328552f); + bool4x2 r1 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + float a2 = (-385.338257f); + float4x2 b2 = float4x2(443.163452f, -353.562561f, 26.04065f, -331.793945f, -43.6919556f, 20.9494019f, -211.17984f, 227.421692f); + bool4x2 r2 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + float a3 = (-84.7797852f); + float4x2 b3 = float4x2(-375.1355f, -205.178131f, -197.04715f, -219.634033f, -210.015625f, -266.7737f, 144.7785f, -471.7112f); + bool4x2 r3 = bool4x2(true, true, true, true, true, true, false, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void float4x2_operator_less_equal_wide_wide() + { + float4x2 a0 = float4x2(-438.523132f, 210.489441f, 4.87731934f, -137.297943f, 156.094116f, -363.924133f, -97.94849f, 437.2954f); + float4x2 b0 = float4x2(-474.814148f, 304.371033f, 234.824158f, -390.485443f, -297.175354f, -326.2924f, 107.253906f, -413.131073f); + bool4x2 r0 = bool4x2(false, true, true, false, false, true, true, false); + TestUtils.AreEqual(r0, a0 <= b0); + + float4x2 a1 = float4x2(458.530273f, -294.064758f, 23.62262f, -34.2840576f, 149.736511f, -418.8867f, -197.502533f, -88.2055054f); + float4x2 b1 = float4x2(67.09442f, 470.075256f, -84.499115f, 392.784241f, -263.531738f, 369.3009f, -333.3253f, 238.413452f); + bool4x2 r1 = bool4x2(false, true, false, true, false, true, false, true); + TestUtils.AreEqual(r1, a1 <= b1); + + float4x2 a2 = float4x2(-376.71814f, 341.627136f, -83.30917f, -107.490723f, 319.466858f, 205.357361f, 345.563721f, 395.3219f); + float4x2 b2 = float4x2(486.2426f, 279.6502f, 236.052f, 132.758972f, 66.29474f, 183.002136f, 200.130554f, 339.043823f); + bool4x2 r2 = bool4x2(true, false, true, true, false, false, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + float4x2 a3 = float4x2(-222.874146f, 439.022034f, -368.075562f, -200.0386f, 71.46991f, -357.365417f, 141.710876f, 319.0171f); + float4x2 b3 = float4x2(438.5379f, 145.401855f, 178.163086f, 157.975952f, 329.7052f, -243.590912f, 5.401184f, -22.5805969f); + bool4x2 r3 = bool4x2(true, false, true, true, true, true, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void float4x2_operator_less_equal_wide_scalar() + { + float4x2 a0 = float4x2(193.49585f, 168.915527f, -313.993073f, 81.8269653f, 18.5036011f, -0.3581848f, 241.361145f, -463.8164f); + float b0 = (443.850525f); + bool4x2 r0 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + float4x2 a1 = float4x2(-1.35775757f, 398.991943f, -471.253082f, -264.9378f, 82.2583f, 11.2460327f, 424.704041f, 426.482239f); + float b1 = (-268.899475f); + bool4x2 r1 = bool4x2(false, false, true, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 <= b1); + + float4x2 a2 = float4x2(56.3200073f, 31.9011841f, -152.257568f, -437.926453f, -37.1048279f, -47.1442261f, 333.623047f, -274.8039f); + float b2 = (-196.2879f); + bool4x2 r2 = bool4x2(false, false, false, true, false, false, false, true); + TestUtils.AreEqual(r2, a2 <= b2); + + float4x2 a3 = float4x2(358.67627f, 192.309143f, 145.306091f, -466.132965f, -494.267334f, -111.570129f, -139.5412f, -146.589355f); + float b3 = (-260.460571f); + bool4x2 r3 = bool4x2(false, false, false, true, true, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void float4x2_operator_less_equal_scalar_wide() + { + float a0 = (393.606262f); + float4x2 b0 = float4x2(-75.6883545f, -44.2638855f, 125.864929f, 191.9649f, 13.54303f, -197.051941f, -423.9451f, -330.0486f); + bool4x2 r0 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 <= b0); + + float a1 = (420.165527f); + float4x2 b1 = float4x2(105.5473f, 174.821289f, 296.7176f, -469.7004f, 123.267212f, 112.996948f, 495.143372f, -488.6579f); + bool4x2 r1 = bool4x2(false, false, false, false, false, false, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + float a2 = (388.539429f); + float4x2 b2 = float4x2(-493.240784f, 16.45105f, -387.651642f, -229.1773f, -373.01532f, -391.142151f, 90.99414f, -178.396149f); + bool4x2 r2 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + float a3 = (-69.62106f); + float4x2 b3 = float4x2(471.790833f, -67.46677f, 45.30536f, -154.6922f, 385.7389f, -431.652954f, -331.673035f, -349.8927f); + bool4x2 r3 = bool4x2(true, true, true, false, true, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void float4x2_operator_greater_equal_wide_wide() + { + float4x2 a0 = float4x2(-507.9286f, 504.4975f, -385.4345f, -262.323425f, -37.5509338f, -111.595276f, -463.702026f, 387.448853f); + float4x2 b0 = float4x2(-81.3465f, 297.666138f, 171.06543f, -431.038055f, -6.85907f, 319.7257f, 254.079163f, 396.5724f); + bool4x2 r0 = bool4x2(false, true, false, true, false, false, false, false); + TestUtils.AreEqual(r0, a0 >= b0); + + float4x2 a1 = float4x2(456.9688f, -211.010162f, 182.411377f, -53.59604f, -309.570221f, -136.022491f, 280.736267f, -96.99588f); + float4x2 b1 = float4x2(178.8393f, -447.063354f, 288.492676f, 474.889282f, -321.750244f, -395.977234f, -158.692474f, 391.4887f); + bool4x2 r1 = bool4x2(true, true, false, false, true, true, true, false); + TestUtils.AreEqual(r1, a1 >= b1); + + float4x2 a2 = float4x2(-174.059509f, 88.90192f, 43.81604f, -446.07843f, 16.6455688f, 409.83252f, -191.329865f, 222.9978f); + float4x2 b2 = float4x2(-368.109253f, 89.12378f, -510.279327f, -486.9298f, -81.2155457f, 274.2188f, -212.881561f, 288.9953f); + bool4x2 r2 = bool4x2(true, false, true, true, true, true, true, false); + TestUtils.AreEqual(r2, a2 >= b2); + + float4x2 a3 = float4x2(404.2884f, 230.603271f, -441.789276f, -86.29306f, 484.249573f, 95.23639f, -204.912109f, -199.774353f); + float4x2 b3 = float4x2(307.73175f, 307.245178f, -199.391785f, -284.421265f, -482.3918f, 448.315735f, -378.3462f, -390.858459f); + bool4x2 r3 = bool4x2(true, false, false, true, true, false, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void float4x2_operator_greater_equal_wide_scalar() + { + float4x2 a0 = float4x2(465.152161f, -424.886078f, -209.2211f, 58.7798462f, -302.2691f, 140.12561f, 16.3533936f, -344.559967f); + float b0 = (-5.599884f); + bool4x2 r0 = bool4x2(true, false, false, true, false, true, true, false); + TestUtils.AreEqual(r0, a0 >= b0); + + float4x2 a1 = float4x2(393.278076f, 441.011536f, -509.781555f, -36.9942932f, 494.8203f, -164.973938f, -466.1201f, -123.813751f); + float b1 = (-315.701538f); + bool4x2 r1 = bool4x2(true, true, false, true, true, true, false, true); + TestUtils.AreEqual(r1, a1 >= b1); + + float4x2 a2 = float4x2(215.651245f, 314.346f, 190.516113f, -83.11142f, -23.8364258f, 143.049377f, -264.919983f, -169.702209f); + float b2 = (104.995728f); + bool4x2 r2 = bool4x2(true, true, true, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + float4x2 a3 = float4x2(329.70752f, -260.4233f, 354.195129f, -111.845337f, 33.309082f, 355.6313f, -435.360565f, -38.3993225f); + float b3 = (359.095825f); + bool4x2 r3 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void float4x2_operator_greater_equal_scalar_wide() + { + float a0 = (374.827026f); + float4x2 b0 = float4x2(-1.60977173f, 338.615234f, -116.1814f, -332.157318f, -355.97937f, -468.901428f, 38.579895f, -332.347534f); + bool4x2 r0 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + float a1 = (2.89013672f); + float4x2 b1 = float4x2(467.777771f, 121.406372f, -305.023376f, -58.4288025f, -226.519562f, -47.0209961f, 305.302673f, -427.401245f); + bool4x2 r1 = bool4x2(false, false, true, true, true, true, false, true); + TestUtils.AreEqual(r1, a1 >= b1); + + float a2 = (92.26367f); + float4x2 b2 = float4x2(-497.178528f, -408.625641f, -455.2305f, 396.4261f, -469.2949f, -485.754028f, -182.346191f, -291.545349f); + bool4x2 r2 = bool4x2(true, true, true, false, true, true, true, true); + TestUtils.AreEqual(r2, a2 >= b2); + + float a3 = (278.740784f); + float4x2 b3 = float4x2(-75.8711243f, 28.9070435f, 287.720154f, 420.509766f, 473.626831f, 181.514526f, -369.202881f, 243.749756f); + bool4x2 r3 = bool4x2(true, true, false, false, false, true, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void float4x2_operator_add_wide_wide() + { + float4x2 a0 = float4x2(506.129028f, -501.779816f, 420.084778f, -186.032074f, -9.312408f, 328.51178f, 424.344055f, 87.79108f); + float4x2 b0 = float4x2(-28.7579956f, -337.135132f, -340.676819f, 152.312012f, 423.66748f, 90.3740845f, 376.18866f, 1.76721191f); + float4x2 r0 = float4x2(477.371033f, -838.9149f, 79.40796f, -33.7200623f, 414.355072f, 418.885864f, 800.5327f, 89.55829f); + TestUtils.AreEqual(r0, a0 + b0); + + float4x2 a1 = float4x2(462.4137f, -46.17871f, 401.170044f, -454.124146f, 69.19568f, -177.957336f, 299.604126f, 340.704834f); + float4x2 b1 = float4x2(-120.185852f, -279.629364f, -344.6671f, 242.839172f, 418.593079f, -23.3128052f, -95.0999451f, 147.9281f); + float4x2 r1 = float4x2(342.227844f, -325.808075f, 56.50293f, -211.284973f, 487.788757f, -201.270142f, 204.504181f, 488.632935f); + TestUtils.AreEqual(r1, a1 + b1); + + float4x2 a2 = float4x2(219.916016f, -321.9084f, 286.355347f, -333.4195f, -118.932159f, 68.60748f, 23.190918f, -205.577881f); + float4x2 b2 = float4x2(331.0329f, -82.50256f, 279.4496f, 342.622742f, -300.358521f, -209.694092f, 446.559448f, -351.9892f); + float4x2 r2 = float4x2(550.9489f, -404.41095f, 565.804932f, 9.203247f, -419.29068f, -141.086609f, 469.750366f, -557.5671f); + TestUtils.AreEqual(r2, a2 + b2); + + float4x2 a3 = float4x2(11.5214233f, -340.795074f, -68.93118f, 304.8532f, -86.63385f, 105.669128f, 349.280518f, 364.7079f); + float4x2 b3 = float4x2(-263.12384f, -252.458557f, 289.825378f, 338.796143f, -232.619019f, -510.50824f, 349.280762f, -426.212463f); + float4x2 r3 = float4x2(-251.602417f, -593.253662f, 220.8942f, 643.649353f, -319.252869f, -404.8391f, 698.5613f, -61.5045776f); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void float4x2_operator_add_wide_scalar() + { + float4x2 a0 = float4x2(-194.514191f, 338.5484f, 246.971375f, 100.510925f, -45.72467f, -478.1113f, 30.9161377f, 60.37433f); + float b0 = (124.121704f); + float4x2 r0 = float4x2(-70.39249f, 462.6701f, 371.093079f, 224.632629f, 78.39703f, -353.9896f, 155.037842f, 184.496033f); + TestUtils.AreEqual(r0, a0 + b0); + + float4x2 a1 = float4x2(-242.118744f, 6.79937744f, -484.6998f, -188.265015f, -213.526733f, -267.7843f, 189.259949f, 198.533569f); + float b1 = (82.50134f); + float4x2 r1 = float4x2(-159.6174f, 89.30072f, -402.198456f, -105.763672f, -131.025391f, -185.282959f, 271.7613f, 281.0349f); + TestUtils.AreEqual(r1, a1 + b1); + + float4x2 a2 = float4x2(187.536072f, 302.102356f, 300.3991f, 124.021606f, -200.161346f, 31.3782349f, 362.522156f, -423.988861f); + float b2 = (-424.925659f); + float4x2 r2 = float4x2(-237.389587f, -122.8233f, -124.52655f, -300.904053f, -625.087036f, -393.547424f, -62.4035034f, -848.914551f); + TestUtils.AreEqual(r2, a2 + b2); + + float4x2 a3 = float4x2(432.41333f, -465.6995f, -311.04303f, 84.91901f, -432.442444f, 235.750671f, -472.637756f, -257.577759f); + float b3 = (374.211426f); + float4x2 r3 = float4x2(806.624756f, -91.48807f, 63.168396f, 459.130432f, -58.2310181f, 609.9621f, -98.42633f, 116.633667f); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void float4x2_operator_add_scalar_wide() + { + float a0 = (-340.354675f); + float4x2 b0 = float4x2(511.362244f, -146.216644f, -106.210419f, -363.450256f, 199.0896f, -27.1083984f, 419.849f, 284.955017f); + float4x2 r0 = float4x2(171.007568f, -486.57132f, -446.5651f, -703.804932f, -141.265076f, -367.463074f, 79.49432f, -55.39966f); + TestUtils.AreEqual(r0, a0 + b0); + + float a1 = (-164.9242f); + float4x2 b1 = float4x2(-249.190338f, 150.928162f, 298.1751f, -457.1534f, 424.718079f, -301.857483f, 230.288879f, -423.5876f); + float4x2 r1 = float4x2(-414.114532f, -13.9960327f, 133.250916f, -622.077637f, 259.793884f, -466.781677f, 65.3646851f, -588.5118f); + TestUtils.AreEqual(r1, a1 + b1); + + float a2 = (-67.06003f); + float4x2 b2 = float4x2(68.72412f, -164.02243f, 318.935181f, 7.80456543f, 187.698364f, -3.656952f, -446.083069f, -209.287231f); + float4x2 r2 = float4x2(1.664093f, -231.082458f, 251.875153f, -59.2554626f, 120.638336f, -70.71698f, -513.143066f, -276.34726f); + TestUtils.AreEqual(r2, a2 + b2); + + float a3 = (-38.21289f); + float4x2 b3 = float4x2(-346.257172f, 465.607422f, -192.185944f, 278.6938f, 381.978455f, 481.243652f, -97.22815f, -455.513733f); + float4x2 r3 = float4x2(-384.470062f, 427.394531f, -230.398834f, 240.4809f, 343.765564f, 443.030762f, -135.44104f, -493.726624f); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void float4x2_operator_sub_wide_wide() + { + float4x2 a0 = float4x2(160.492249f, 11.223938f, 359.200134f, -498.2283f, -355.253632f, -94.53485f, -410.46405f, -401.384644f); + float4x2 b0 = float4x2(115.46875f, -130.9823f, 241.540833f, 9.987061f, 419.895142f, 59.12445f, -402.381653f, -75.37015f); + float4x2 r0 = float4x2(45.0235f, 142.206238f, 117.6593f, -508.215363f, -775.1488f, -153.6593f, -8.082397f, -326.0145f); + TestUtils.AreEqual(r0, a0 - b0); + + float4x2 a1 = float4x2(317.706848f, 447.060425f, -489.074158f, -230.008392f, 24.8754272f, 366.614441f, -107.374146f, -219.008148f); + float4x2 b1 = float4x2(320.9796f, -73.90875f, -31.4447327f, -389.251953f, -375.028839f, 259.182739f, 276.648682f, -453.0692f); + float4x2 r1 = float4x2(-3.272766f, 520.9692f, -457.629425f, 159.243561f, 399.904266f, 107.4317f, -384.022827f, 234.061066f); + TestUtils.AreEqual(r1, a1 - b1); + + float4x2 a2 = float4x2(473.9076f, 259.63623f, -360.119629f, 7.80963135f, 437.428467f, -59.1991577f, 418.744324f, 183.142151f); + float4x2 b2 = float4x2(-272.576538f, -191.148041f, 87.1369f, 430.02478f, 343.6571f, 121.029419f, -354.188171f, 249.052f); + float4x2 r2 = float4x2(746.484131f, 450.784271f, -447.256531f, -422.215149f, 93.77136f, -180.228577f, 772.9325f, -65.90985f); + TestUtils.AreEqual(r2, a2 - b2); + + float4x2 a3 = float4x2(271.230347f, 496.208557f, 165.354919f, -227.403656f, -166.522858f, 356.142273f, 386.9264f, -394.638763f); + float4x2 b3 = float4x2(-2.22543335f, 22.4472656f, 478.112976f, -320.063f, -111.524109f, 222.228943f, -245.411072f, -119.902283f); + float4x2 r3 = float4x2(273.45578f, 473.7613f, -312.758057f, 92.65933f, -54.99875f, 133.91333f, 632.337463f, -274.736481f); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void float4x2_operator_sub_wide_scalar() + { + float4x2 a0 = float4x2(207.389587f, 248.457764f, -384.8239f, -205.344757f, -374.811554f, 191.642029f, 18.8562622f, -44.96161f); + float b0 = (-36.1124878f); + float4x2 r0 = float4x2(243.502075f, 284.570251f, -348.711426f, -169.232269f, -338.699066f, 227.754517f, 54.96875f, -8.849121f); + TestUtils.AreEqual(r0, a0 - b0); + + float4x2 a1 = float4x2(480.857971f, -366.865448f, -35.5231f, 349.397766f, 439.077271f, 490.2223f, 195.024048f, -384.849426f); + float b1 = (16.3381958f); + float4x2 r1 = float4x2(464.519775f, -383.203644f, -51.8612976f, 333.05957f, 422.739075f, 473.8841f, 178.685852f, -401.187622f); + TestUtils.AreEqual(r1, a1 - b1); + + float4x2 a2 = float4x2(189.05188f, -54.931488f, 53.0880737f, 316.8025f, -273.8067f, 256.8872f, 297.173645f, 101.829041f); + float b2 = (55.6027832f); + float4x2 r2 = float4x2(133.4491f, -110.534271f, -2.51470947f, 261.1997f, -329.4095f, 201.284424f, 241.570862f, 46.2262573f); + TestUtils.AreEqual(r2, a2 - b2); + + float4x2 a3 = float4x2(136.607971f, 336.589722f, -51.8765564f, 317.345764f, -467.055939f, -50.1670532f, 477.804565f, -60.82193f); + float b3 = (-19.7322083f); + float4x2 r3 = float4x2(156.340179f, 356.32193f, -32.14435f, 337.077972f, -447.32373f, -30.434845f, 497.536774f, -41.08972f); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void float4x2_operator_sub_scalar_wide() + { + float a0 = (-86.00824f); + float4x2 b0 = float4x2(466.4251f, 298.486938f, -300.9501f, 315.38f, -381.092163f, -125.008362f, 58.4661865f, 214.7461f); + float4x2 r0 = float4x2(-552.43335f, -384.495178f, 214.941864f, -401.388245f, 295.083923f, 39.0001221f, -144.474426f, -300.754333f); + TestUtils.AreEqual(r0, a0 - b0); + + float a1 = (-257.549438f); + float4x2 b1 = float4x2(480.2246f, -443.355072f, 260.795044f, 29.6819458f, 139.857727f, -247.789948f, -248.466217f, 91.44513f); + float4x2 r1 = float4x2(-737.774048f, 185.805634f, -518.3445f, -287.231384f, -397.407166f, -9.759491f, -9.083221f, -348.994568f); + TestUtils.AreEqual(r1, a1 - b1); + + float a2 = (86.3841553f); + float4x2 b2 = float4x2(373.8183f, 260.411926f, 114.353943f, -464.405457f, -109.741455f, -311.675354f, 107.864014f, -258.795166f); + float4x2 r2 = float4x2(-287.434143f, -174.027771f, -27.9697876f, 550.7896f, 196.12561f, 398.0595f, -21.4798584f, 345.179321f); + TestUtils.AreEqual(r2, a2 - b2); + + float a3 = (14.0975342f); + float4x2 b3 = float4x2(-461.970184f, 30.3108521f, 63.70111f, -462.676758f, 39.75946f, 47.99817f, -177.6193f, 202.477051f); + float4x2 r3 = float4x2(476.067719f, -16.2133179f, -49.6035767f, 476.7743f, -25.6619263f, -33.9006348f, 191.716827f, -188.379517f); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void float4x2_operator_mul_wide_wide() + { + float4x2 a0 = float4x2(-482.7138f, -407.2935f, 137.700562f, 208.541138f, 194.29657f, -484.242432f, 183.9873f, -241.33548f); + float4x2 b0 = float4x2(-236.367889f, 260.7276f, -416.3863f, -364.4956f, -253.147522f, -369.202881f, 193.547913f, 169.0849f); + float4x2 r0 = float4x2(114098.047f, -106192.656f, -57336.625f, -76012.33f, -49185.6953f, 178783.7f, 35610.36f, -40806.1836f); + TestUtils.AreEqual(r0, a0 * b0); + + float4x2 a1 = float4x2(45.8687744f, 363.3261f, -328.118958f, -471.023071f, -262.682556f, -379.262756f, -374.090576f, 481.4474f); + float4x2 b1 = float4x2(201.969666f, 249.456055f, -308.193176f, -385.579651f, -183.2796f, 22.2756348f, -265.521423f, -95.67746f); + float4x2 r1 = float4x2(9264.101f, 90633.9f, 101124.023f, 181616.9f, 48144.3555f, -8448.318f, 99329.06f, -46063.6641f); + TestUtils.AreEqual(r1, a1 * b1); + + float4x2 a2 = float4x2(104.628052f, 412.935425f, 477.877258f, 20.3778076f, 291.995972f, -138.488312f, -393.464966f, 9.363098f); + float4x2 b2 = float4x2(133.2544f, 148.311462f, 249.284119f, 500.0055f, -19.3315735f, -36.69107f, 30.5238037f, -401.367f); + float4x2 r2 = float4x2(13942.1475f, 61243.06f, 119127.211f, 10189.0156f, -5644.7417f, 5081.284f, -12010.0479f, -3758.03857f); + TestUtils.AreEqual(r2, a2 * b2); + + float4x2 a3 = float4x2(-131.942291f, 364.449646f, 390.615967f, 418.797974f, -277.3448f, 11.4101563f, 474.876465f, -502.405029f); + float4x2 b3 = float4x2(3.43725586f, 257.24176f, -290.971924f, 337.47937f, 490.286133f, -191.0198f, -325.7345f, -52.1819763f); + float4x2 r3 = float4x2(-453.5194f, 93751.67f, -113658.281f, 141335.672f, -135978.3f, -2179.566f, -154683.641f, 26216.4883f); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void float4x2_operator_mul_wide_scalar() + { + float4x2 a0 = float4x2(-96.31882f, -277.142273f, -239.93689f, 509.531433f, 255.8581f, 215.7315f, -455.50827f, -389.2433f); + float b0 = (-301.2072f); + float4x2 r0 = float4x2(29011.9219f, 83477.25f, 72270.72f, -153474.547f, -77066.3047f, -64979.8867f, 137202.375f, 117242.883f); + TestUtils.AreEqual(r0, a0 * b0); + + float4x2 a1 = float4x2(-338.29248f, 243.757324f, 135.354675f, -207.3501f, -383.9396f, -31.4252319f, 42.6761475f, 260.38385f); + float b1 = (53.7962646f); + float4x2 r1 = float4x2(-18198.8711f, 13113.2334f, 7281.576f, -11154.6611f, -20654.5176f, -1690.56f, 2295.81738f, 14007.6787f); + TestUtils.AreEqual(r1, a1 * b1); + + float4x2 a2 = float4x2(176.867554f, -290.5006f, 207.091f, -156.523315f, -208.402008f, 370.945068f, -341.59845f, 10.2703247f); + float b2 = (25.67212f); + float4x2 r2 = float4x2(4540.565f, -7457.766f, 5316.465f, -4018.28516f, -5350.121f, 9522.946f, -8769.556f, 263.661f); + TestUtils.AreEqual(r2, a2 * b2); + + float4x2 a3 = float4x2(-176.888763f, 186.279785f, -487.652222f, -129.376831f, -317.7163f, -207.62735f, 388.8714f, -233.335327f); + float b3 = (-61.0061035f); + float4x2 r3 = float4x2(10791.2939f, -11364.2041f, 29749.7617f, 7892.77637f, 19382.6348f, 12666.5352f, -23723.53f, 14234.8789f); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void float4x2_operator_mul_scalar_wide() + { + float a0 = (37.43219f); + float4x2 b0 = float4x2(96.74756f, 492.185364f, -274.054565f, -452.870972f, 420.853333f, 102.182922f, -114.948883f, -351.120056f); + float4x2 r0 = float4x2(3621.473f, 18423.5762f, -10258.4629f, -16951.9531f, 15753.4619f, 3824.93066f, -4302.78857f, -13143.1924f); + TestUtils.AreEqual(r0, a0 * b0); + + float a1 = (-464.664978f); + float4x2 b1 = float4x2(444.084839f, 447.1053f, 130.829346f, -321.41333f, 445.301331f, 478.2436f, 358.571716f, -144.8901f); + float4x2 r1 = float4x2(-206350.672f, -207754.172f, -60791.8164f, 149349.516f, -206915.938f, -222223.047f, -166615.719f, 67325.36f); + TestUtils.AreEqual(r1, a1 * b1); + + float a2 = (-438.893829f); + float4x2 b2 = float4x2(-3.536438f, -471.807556f, -42.5603943f, 119.911072f, 271.900024f, 239.684021f, 487.4414f, -79.18829f); + float4x2 r2 = float4x2(1552.12085f, 207073.422f, 18679.4941f, -52628.23f, -119335.242f, -105195.836f, -213935.031f, 34755.2539f); + TestUtils.AreEqual(r2, a2 * b2); + + float a3 = (-112.925659f); + float4x2 b3 = float4x2(161.370056f, 459.759155f, -337.195984f, -276.834534f, 469.723877f, -274.565155f, 506.7859f, 65.88257f); + float4x2 r3 = float4x2(-18222.82f, -51918.6055f, 38078.08f, 31261.7227f, -53043.88f, 31005.4512f, -57229.13f, -7439.83252f); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void float4x2_operator_div_wide_wide() + { + float4x2 a0 = float4x2(-353.131439f, -102.799866f, 51.3191528f, -191.871674f, 8.041809f, -128.73764f, -136.0596f, -370.471f); + float4x2 b0 = float4x2(-178.739563f, -302.096283f, -199.405823f, 278.850769f, 502.3376f, -361.484833f, 353.121033f, -38.894928f); + float4x2 r0 = float4x2(1.97567582f, 0.34028843f, -0.257360339f, -0.688080132f, 0.0160087738f, 0.356135666f, -0.385305852f, 9.524919f); + TestUtils.AreEqual(r0, a0 / b0); + + float4x2 a1 = float4x2(-237.69455f, -432.546875f, 200.2655f, 361.4416f, -416.226135f, -450.0192f, -273.497437f, -286.908173f); + float4x2 b1 = float4x2(-75.76474f, -195.217834f, -405.034f, -394.23f, -375.8277f, -121.245483f, 447.623352f, 338.286255f); + float4x2 r1 = float4x2(3.1372714f, 2.215714f, -0.4944412f, -0.9168292f, 1.107492f, 3.71163678f, -0.610999048f, -0.8481225f); + TestUtils.AreEqual(r1, a1 / b1); + + float4x2 a2 = float4x2(-314.256042f, 177.762085f, 97.6270142f, -68.10727f, -386.450745f, 263.699341f, -297.0271f, -501.777039f); + float4x2 b2 = float4x2(-405.5442f, -431.168945f, 296.205139f, 437.939819f, 39.2106323f, 331.289734f, -310.619568f, 207.26947f); + float4x2 r2 = float4x2(0.7748996f, -0.412279427f, 0.3295926f, -0.155517414f, -9.855764f, 0.795978f, 0.9562408f, -2.42089224f); + TestUtils.AreEqual(r2, a2 / b2); + + float4x2 a3 = float4x2(-263.40686f, -451.080841f, -416.34552f, -315.278748f, -28.1811218f, -397.870148f, -261.386658f, 40.3482056f); + float4x2 b3 = float4x2(-223.293f, -480.0914f, 448.675964f, -460.097443f, -220.569855f, -84.85315f, 441.373779f, 72.41846f); + float4x2 r3 = float4x2(1.17964673f, 0.9395729f, -0.9279426f, 0.6852434f, 0.127765059f, 4.688926f, -0.592211545f, 0.557153642f); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void float4x2_operator_div_wide_scalar() + { + float4x2 a0 = float4x2(171.3424f, 0.103393555f, 57.8882446f, -256.130737f, 95.66968f, -290.3869f, -127.4487f, -79.7449f); + float b0 = (171.796814f); + float4x2 r0 = float4x2(0.997355f, 0.000601836247f, 0.3369576f, -1.49089336f, 0.5568769f, -1.69029272f, -0.7418572f, -0.4641815f); + TestUtils.AreEqual(r0, a0 / b0); + + float4x2 a1 = float4x2(146.466858f, 58.68634f, -453.2058f, -205.033813f, 481.738159f, 464.479065f, -293.4635f, -158.505585f); + float b1 = (-499.843567f); + float4x2 r1 = float4x2(-0.2930254f, -0.117409416f, 0.9066953f, 0.410195976f, -0.96377784f, -0.929248869f, 0.5871107f, 0.3171104f); + TestUtils.AreEqual(r1, a1 / b1); + + float4x2 a2 = float4x2(-289.5822f, 203.583435f, 180.9704f, 259.1192f, 460.844727f, 490.956238f, -280.478058f, -320.243866f); + float b2 = (494.1286f); + float4x2 r2 = float4x2(-0.5860463f, 0.412004948f, 0.366241485f, 0.5243963f, 0.932641268f, 0.993579865f, -0.5676216f, -0.64809823f); + TestUtils.AreEqual(r2, a2 / b2); + + float4x2 a3 = float4x2(192.41449f, 226.852966f, -192.235687f, 460.9765f, -437.8922f, -413.232727f, 249.471863f, 313.035034f); + float b3 = (264.800842f); + float4x2 r3 = float4x2(0.7266385f, 0.8566928f, -0.7259633f, 1.74084222f, -1.65366626f, -1.56054163f, 0.9421113f, 1.18215275f); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void float4x2_operator_div_scalar_wide() + { + float a0 = (-264.4425f); + float4x2 b0 = float4x2(105.589111f, -142.349091f, -288.9489f, 39.644104f, -363.9914f, -149.718231f, -395.729126f, 258.7187f); + float4x2 r0 = float4x2(-2.50444865f, 1.85770416f, 0.9151877f, -6.670412f, 0.7265076f, 1.7662679f, 0.6682412f, -1.02212369f); + TestUtils.AreEqual(r0, a0 / b0); + + float a1 = (-9.66626f); + float4x2 b1 = float4x2(117.725525f, -331.386536f, -509.986023f, 427.896484f, 467.617126f, -407.124634f, 252.690735f, 444.599365f); + float4x2 r1 = float4x2(-0.0821084455f, 0.0291691385f, 0.01895397f, -0.0225901827f, -0.0206713118f, 0.023742754f, -0.0382533222f, -0.0217415057f); + TestUtils.AreEqual(r1, a1 / b1); + + float a2 = (-88.31329f); + float4x2 b2 = float4x2(199.955017f, -218.346924f, -13.4171753f, -296.131073f, 0.561340332f, -289.299316f, 196.218323f, 334.733459f); + float4x2 r2 = float4x2(-0.4416658f, 0.4044632f, 6.58210754f, 0.298223674f, -157.32576f, 0.305266172f, -0.4500767f, -0.263831675f); + TestUtils.AreEqual(r2, a2 / b2); + + float a3 = (-282.392731f); + float4x2 b3 = float4x2(-479.5036f, -473.439453f, 105.050781f, -287.6313f, 77.29932f, -210.894379f, -184.068237f, -315.148438f); + float4x2 r3 = float4x2(0.5889272f, 0.596470654f, -2.68815446f, 0.981787264f, -3.653237f, 1.33902442f, 1.5341742f, 0.8960626f); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void float4x2_operator_mod_wide_wide() + { + float4x2 a0 = float4x2(-388.8125f, 181.681213f, -167.078735f, 432.820129f, -258.438965f, -170.110809f, 283.3183f, 122.716492f); + float4x2 b0 = float4x2(436.944153f, 58.9400635f, -201.116241f, 279.289368f, -397.079773f, 377.899963f, 174.693848f, -228.176514f); + float4x2 r0 = float4x2(-388.8125f, 4.861023f, -167.078735f, 153.530762f, -258.438965f, -170.110809f, 108.624451f, 122.716492f); + TestUtils.AreEqual(r0, a0 % b0); + + float4x2 a1 = float4x2(335.271f, -503.608521f, 191.022522f, 289.742676f, -124.033722f, 259.274f, -274.358459f, -140.030792f); + float4x2 b1 = float4x2(-317.060181f, -417.4801f, -249.975952f, -397.571564f, -358.745453f, -198.15921f, 208.737122f, -12.1194153f); + float4x2 r1 = float4x2(18.2108154f, -86.12842f, 191.022522f, 289.742676f, -124.033722f, 61.1147766f, -65.62134f, -6.717224f); + TestUtils.AreEqual(r1, a1 % b1); + + float4x2 a2 = float4x2(324.577576f, -200.513092f, 211.423157f, -51.2722168f, -230.633911f, 99.98938f, 399.18988f, 24.90326f); + float4x2 b2 = float4x2(25.2714233f, -194.1207f, -493.8718f, -312.3017f, -216.980591f, 413.570984f, -436.3944f, 3.491272f); + float4x2 r2 = float4x2(21.3204956f, -6.392395f, 211.423157f, -51.2722168f, -13.65332f, 99.98938f, 399.18988f, 0.464355469f); + TestUtils.AreEqual(r2, a2 % b2); + + float4x2 a3 = float4x2(50.92401f, -364.863678f, -252.626617f, -281.2898f, -364.798523f, -329.026245f, 51.6098022f, 41.6478271f); + float4x2 b3 = float4x2(-308.233429f, -441.375061f, 84.60083f, 373.163452f, 67.25275f, -320.333282f, 118.97937f, 44.8239746f); + float4x2 r3 = float4x2(50.92401f, -364.863678f, -83.42496f, -281.2898f, -28.53479f, -8.692963f, 51.6098022f, 41.6478271f); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void float4x2_operator_mod_wide_scalar() + { + float4x2 a0 = float4x2(-244.499634f, -211.8193f, -145.926788f, -304.9182f, 155.479492f, -133.907776f, 281.309631f, -226.535767f); + float b0 = (39.63495f); + float4x2 r0 = float4x2(-6.68994141f, -13.6445618f, -27.0219421f, -27.4735718f, 36.574646f, -15.00293f, 3.86499023f, -28.3610229f); + TestUtils.AreEqual(r0, a0 % b0); + + float4x2 a1 = float4x2(335.166138f, 319.4715f, -285.4023f, -355.846863f, 259.378f, -330.871948f, -284.343567f, -102.683441f); + float b1 = (101.706482f); + float4x2 r1 = float4x2(30.0466919f, 14.3520508f, -81.98935f, -50.727417f, 55.9650269f, -25.7525024f, -80.9306f, -0.9769592f); + TestUtils.AreEqual(r1, a1 % b1); + + float4x2 a2 = float4x2(-172.141754f, -416.713654f, -339.256653f, 435.2975f, 132.552917f, 226.944092f, -306.1183f, 115.438477f); + float b2 = (206.41687f); + float4x2 r2 = float4x2(-172.141754f, -3.87991333f, -132.839783f, 22.4637451f, 132.552917f, 20.5272217f, -99.701416f, 115.438477f); + TestUtils.AreEqual(r2, a2 % b2); + + float4x2 a3 = float4x2(281.882935f, -140.0405f, -462.3235f, -211.6087f, 351.331055f, 321.047f, 346.0852f, -94.4077454f); + float b3 = (-218.347443f); + float4x2 r3 = float4x2(63.5354919f, -140.0405f, -25.6286011f, -211.6087f, 132.983612f, 102.699554f, 127.737762f, -94.4077454f); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void float4x2_operator_mod_scalar_wide() + { + float a0 = (-66.94504f); + float4x2 b0 = float4x2(-249.7761f, -396.073761f, 386.492065f, 168.939453f, -199.418243f, 261.7517f, 16.1274414f, 257.668152f); + float4x2 r0 = float4x2(-66.94504f, -66.94504f, -66.94504f, -66.94504f, -66.94504f, -66.94504f, -2.43527222f, -66.94504f); + TestUtils.AreEqual(r0, a0 % b0); + + float a1 = (-75.78845f); + float4x2 b1 = float4x2(170.9563f, -242.858276f, 425.9453f, 303.2724f, 3.033081f, -505.74353f, 461.957031f, 205.972778f); + float4x2 r1 = float4x2(-75.78845f, -75.78845f, -75.78845f, -75.78845f, -2.99450684f, -75.78845f, -75.78845f, -75.78845f); + TestUtils.AreEqual(r1, a1 % b1); + + float a2 = (270.040649f); + float4x2 b2 = float4x2(-47.4807129f, -150.254486f, 149.499512f, -220.298035f, 31.1188354f, 400.635681f, 6.23144531f, -39.05075f); + float4x2 r2 = float4x2(32.637085f, 119.786163f, 120.541138f, 49.7426147f, 21.0899658f, 270.040649f, 2.088501f, 35.736145f); + TestUtils.AreEqual(r2, a2 % b2); + + float a3 = (-71.9411f); + float4x2 b3 = float4x2(-495.307129f, -86.7196045f, -436.970062f, -472.294739f, -130.008759f, -251.516846f, 281.976379f, 388.86084f); + float4x2 r3 = float4x2(-71.9411f, -71.9411f, -71.9411f, -71.9411f, -71.9411f, -71.9411f, -71.9411f, -71.9411f); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void float4x2_operator_plus() + { + float4x2 a0 = float4x2(-418.829559f, -405.79895f, -34.04178f, 236.999268f, -459.8391f, 210.86145f, 293.742f, -373.015442f); + float4x2 r0 = float4x2(-418.829559f, -405.79895f, -34.04178f, 236.999268f, -459.8391f, 210.86145f, 293.742f, -373.015442f); + TestUtils.AreEqual(r0, +a0); + + float4x2 a1 = float4x2(-386.059845f, -418.645264f, 504.474854f, -170.746521f, 439.5594f, -478.7494f, 116.400757f, 421.409668f); + float4x2 r1 = float4x2(-386.059845f, -418.645264f, 504.474854f, -170.746521f, 439.5594f, -478.7494f, 116.400757f, 421.409668f); + TestUtils.AreEqual(r1, +a1); + + float4x2 a2 = float4x2(-258.596069f, 124.164368f, 222.172546f, -65.94928f, 239.041809f, 498.449524f, -139.382538f, 279.072937f); + float4x2 r2 = float4x2(-258.596069f, 124.164368f, 222.172546f, -65.94928f, 239.041809f, 498.449524f, -139.382538f, 279.072937f); + TestUtils.AreEqual(r2, +a2); + + float4x2 a3 = float4x2(108.775818f, 136.812134f, -236.030029f, -440.308319f, 342.2791f, 102.472229f, -161.454834f, -355.270874f); + float4x2 r3 = float4x2(108.775818f, 136.812134f, -236.030029f, -440.308319f, 342.2791f, 102.472229f, -161.454834f, -355.270874f); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void float4x2_operator_neg() + { + float4x2 a0 = float4x2(148.461731f, -467.122681f, 132.04718f, 183.522644f, 473.701f, -407.9911f, -54.95877f, -382.9898f); + float4x2 r0 = float4x2(-148.461731f, 467.122681f, -132.04718f, -183.522644f, -473.701f, 407.9911f, 54.95877f, 382.9898f); + TestUtils.AreEqual(r0, -a0); + + float4x2 a1 = float4x2(-299.093384f, 407.709778f, 168.735474f, 466.441528f, 171.902466f, -280.558319f, -78.857605f, 318.69635f); + float4x2 r1 = float4x2(299.093384f, -407.709778f, -168.735474f, -466.441528f, -171.902466f, 280.558319f, 78.857605f, -318.69635f); + TestUtils.AreEqual(r1, -a1); + + float4x2 a2 = float4x2(-39.9154053f, 132.195618f, -505.895264f, 410.380554f, -237.056946f, -137.617828f, -245.349976f, 422.521362f); + float4x2 r2 = float4x2(39.9154053f, -132.195618f, 505.895264f, -410.380554f, 237.056946f, 137.617828f, 245.349976f, -422.521362f); + TestUtils.AreEqual(r2, -a2); + + float4x2 a3 = float4x2(-434.57135f, -466.5663f, 426.894531f, 146.649536f, -391.37207f, 423.237732f, 254.297546f, -114.848907f); + float4x2 r3 = float4x2(434.57135f, 466.5663f, -426.894531f, -146.649536f, 391.37207f, -423.237732f, -254.297546f, 114.848907f); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void float4x2_operator_prefix_inc() + { + float4x2 a0 = float4x2(-139.842072f, -56.7436523f, -381.955322f, 509.796326f, -222.896332f, 210.319885f, -392.7315f, -300.1941f); + float4x2 r0 = float4x2(-138.842072f, -55.7436523f, -380.955322f, 510.796326f, -221.896332f, 211.319885f, -391.7315f, -299.1941f); + TestUtils.AreEqual(r0, ++a0); + + float4x2 a1 = float4x2(362.212769f, 130.90918f, -450.230164f, 243.546936f, 46.1920166f, -41.4972839f, 299.1855f, 154.356567f); + float4x2 r1 = float4x2(363.212769f, 131.90918f, -449.230164f, 244.546936f, 47.1920166f, -40.4972839f, 300.1855f, 155.356567f); + TestUtils.AreEqual(r1, ++a1); + + float4x2 a2 = float4x2(-281.233276f, 92.95776f, 448.602173f, -295.587f, 18.4990845f, -215.711121f, 471.947266f, 257.0766f); + float4x2 r2 = float4x2(-280.233276f, 93.95776f, 449.602173f, -294.587f, 19.4990845f, -214.711121f, 472.947266f, 258.0766f); + TestUtils.AreEqual(r2, ++a2); + + float4x2 a3 = float4x2(41.6259155f, 243.004761f, -472.619019f, -125.720215f, -477.459564f, 9.89147949f, -76.92285f, -29.7675781f); + float4x2 r3 = float4x2(42.6259155f, 244.004761f, -471.619019f, -124.720215f, -476.459564f, 10.8914795f, -75.92285f, -28.7675781f); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void float4x2_operator_postfix_inc() + { + float4x2 a0 = float4x2(-396.669739f, 511.20752f, 249.111267f, -128.817322f, -259.4903f, 278.008179f, -81.39343f, 66.71973f); + float4x2 r0 = float4x2(-396.669739f, 511.20752f, 249.111267f, -128.817322f, -259.4903f, 278.008179f, -81.39343f, 66.71973f); + TestUtils.AreEqual(r0, a0++); + + float4x2 a1 = float4x2(167.852112f, -326.1076f, 41.03357f, 128.5304f, 73.15558f, -60.1323853f, -446.229767f, -296.937836f); + float4x2 r1 = float4x2(167.852112f, -326.1076f, 41.03357f, 128.5304f, 73.15558f, -60.1323853f, -446.229767f, -296.937836f); + TestUtils.AreEqual(r1, a1++); + + float4x2 a2 = float4x2(267.293823f, 49.2001953f, -326.643127f, -510.864227f, 471.647461f, -171.013092f, 310.727356f, -298.917175f); + float4x2 r2 = float4x2(267.293823f, 49.2001953f, -326.643127f, -510.864227f, 471.647461f, -171.013092f, 310.727356f, -298.917175f); + TestUtils.AreEqual(r2, a2++); + + float4x2 a3 = float4x2(489.985f, 290.69104f, 117.192322f, 164.442932f, 412.3678f, -229.386566f, 239.596924f, 36.62433f); + float4x2 r3 = float4x2(489.985f, 290.69104f, 117.192322f, 164.442932f, 412.3678f, -229.386566f, 239.596924f, 36.62433f); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void float4x2_operator_prefix_dec() + { + float4x2 a0 = float4x2(123.128723f, 256.84375f, 156.330811f, 461.737427f, 325.867981f, 392.015625f, 187.874146f, -236.225189f); + float4x2 r0 = float4x2(122.128723f, 255.84375f, 155.330811f, 460.737427f, 324.867981f, 391.015625f, 186.874146f, -237.225189f); + TestUtils.AreEqual(r0, --a0); + + float4x2 a1 = float4x2(125.109619f, 45.5366821f, 376.046875f, -363.0755f, -22.0289612f, 248.7901f, 168.095032f, 168.265625f); + float4x2 r1 = float4x2(124.109619f, 44.5366821f, 375.046875f, -364.0755f, -23.0289612f, 247.7901f, 167.095032f, 167.265625f); + TestUtils.AreEqual(r1, --a1); + + float4x2 a2 = float4x2(-190.284729f, 183.957947f, 485.6947f, -460.739319f, 89.5698853f, -267.4298f, 201.756226f, -141.216888f); + float4x2 r2 = float4x2(-191.284729f, 182.957947f, 484.6947f, -461.739319f, 88.5698853f, -268.4298f, 200.756226f, -142.216888f); + TestUtils.AreEqual(r2, --a2); + + float4x2 a3 = float4x2(-217.4841f, -213.544128f, 180.7406f, -128.3125f, 478.045532f, -454.566132f, -386.898346f, 387.857f); + float4x2 r3 = float4x2(-218.4841f, -214.544128f, 179.7406f, -129.3125f, 477.045532f, -455.566132f, -387.898346f, 386.857f); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void float4x2_operator_postfix_dec() + { + float4x2 a0 = float4x2(379.6883f, 302.692871f, -176.07135f, -291.2527f, 470.567566f, -402.925964f, -63.65515f, 355.2611f); + float4x2 r0 = float4x2(379.6883f, 302.692871f, -176.07135f, -291.2527f, 470.567566f, -402.925964f, -63.65515f, 355.2611f); + TestUtils.AreEqual(r0, a0--); + + float4x2 a1 = float4x2(-27.8892212f, 156.14032f, 479.9452f, -200.304291f, -445.026947f, 407.420349f, 327.670349f, 48.06018f); + float4x2 r1 = float4x2(-27.8892212f, 156.14032f, 479.9452f, -200.304291f, -445.026947f, 407.420349f, 327.670349f, 48.06018f); + TestUtils.AreEqual(r1, a1--); + + float4x2 a2 = float4x2(-209.667969f, 283.9416f, -94.80209f, 152.510681f, -287.2625f, -215.948029f, -407.046356f, 159.233582f); + float4x2 r2 = float4x2(-209.667969f, 283.9416f, -94.80209f, 152.510681f, -287.2625f, -215.948029f, -407.046356f, 159.233582f); + TestUtils.AreEqual(r2, a2--); + + float4x2 a3 = float4x2(-359.456482f, -278.933777f, 289.912842f, 402.039551f, 470.716553f, -208.560608f, 145.896729f, -296.790955f); + float4x2 r3 = float4x2(-359.456482f, -278.933777f, 289.912842f, 402.039551f, 470.716553f, -208.560608f, 145.896729f, -296.790955f); + TestUtils.AreEqual(r3, a3--); + } + + [TestCase /* For player builds */] + public static void float4x2_EqualsObjectOverride() + { + TestUtils.IsFalse(new float4x2().Equals((object)new int())); + TestUtils.IsTrue(new float4x2().Equals((object)new float4x2())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestFloat4x2.gen.cs.meta b/src/Tests/Tests/Shared/TestFloat4x2.gen.cs.meta new file mode 100644 index 00000000..bc296688 --- /dev/null +++ b/src/Tests/Tests/Shared/TestFloat4x2.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 24d6c72f4a165e342afb784bad62cab5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestFloat4x3.gen.cs b/src/Tests/Tests/Shared/TestFloat4x3.gen.cs new file mode 100644 index 00000000..f2d4f21f --- /dev/null +++ b/src/Tests/Tests/Shared/TestFloat4x3.gen.cs @@ -0,0 +1,956 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestFloat4x3 + { + [TestCompiler] + public static void float4x3_zero() + { + TestUtils.AreEqual(0.0f, float4x3.zero.c0.x); + TestUtils.AreEqual(0.0f, float4x3.zero.c0.y); + TestUtils.AreEqual(0.0f, float4x3.zero.c0.z); + TestUtils.AreEqual(0.0f, float4x3.zero.c0.w); + TestUtils.AreEqual(0.0f, float4x3.zero.c1.x); + TestUtils.AreEqual(0.0f, float4x3.zero.c1.y); + TestUtils.AreEqual(0.0f, float4x3.zero.c1.z); + TestUtils.AreEqual(0.0f, float4x3.zero.c1.w); + TestUtils.AreEqual(0.0f, float4x3.zero.c2.x); + TestUtils.AreEqual(0.0f, float4x3.zero.c2.y); + TestUtils.AreEqual(0.0f, float4x3.zero.c2.z); + TestUtils.AreEqual(0.0f, float4x3.zero.c2.w); + } + + [TestCompiler] + public static void float4x3_operator_equal_wide_wide() + { + float4x3 a0 = float4x3(492.1576f, -495.206329f, 227.457642f, -147.374054f, -222.682f, 64.09375f, -23.8904114f, -16.8197327f, 163.232117f, -165.271f, 470.8777f, -423.942566f); + float4x3 b0 = float4x3(192.568787f, -235.611023f, -254.043121f, -412.624725f, 471.9048f, -6.47277832f, -339.102356f, 488.187561f, -379.5966f, -308.417f, -82.333374f, -102.921082f); + bool4x3 r0 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + float4x3 a1 = float4x3(109.6344f, 462.6903f, -335.38147f, 357.2345f, 1.54559326f, -347.388245f, -114.472168f, 435.848633f, 194.2381f, 138.765564f, -467.349152f, 370.43335f); + float4x3 b1 = float4x3(226.515747f, -356.9013f, -362.912781f, -427.898438f, 466.650146f, -102.799042f, -43.355957f, 85.0456543f, -91.1270447f, 422.192078f, -477.4313f, 1.87701416f); + bool4x3 r1 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + float4x3 a2 = float4x3(476.708252f, 320.552673f, -498.59198f, 92.41693f, 104.511353f, 166.754578f, -204.733429f, 434.756775f, -397.329651f, 503.981628f, -503.7141f, 90.65973f); + float4x3 b2 = float4x3(312.580078f, 254.599365f, 352.72583f, 62.4909668f, 119.714783f, -511.058075f, -302.472717f, -371.769226f, -20.007843f, 21.4594727f, -426.0207f, -305.411926f); + bool4x3 r2 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + float4x3 a3 = float4x3(-303.445251f, 9.34491f, 290.901062f, -147.57193f, 368.082336f, -321.6096f, -171.465424f, -441.306458f, -137.766815f, 304.689575f, 301.889465f, -222.220917f); + float4x3 b3 = float4x3(261.68335f, 50.00476f, -334.134644f, 75.0656738f, -51.186676f, -135.961548f, -409.364868f, 160.819763f, 102.120789f, 277.813049f, 434.906738f, -15.2891846f); + bool4x3 r3 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void float4x3_operator_equal_wide_scalar() + { + float4x3 a0 = float4x3(-303.230072f, 451.5263f, -253.655884f, -105.203644f, -500.6911f, -426.192474f, 159.8761f, -59.55838f, -57.4773865f, -182.049744f, 406.513733f, 370.886f); + float b0 = (123.544556f); + bool4x3 r0 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + float4x3 a1 = float4x3(-172.035309f, -11.3389893f, 363.938232f, -27.1505737f, -325.976074f, -290.359039f, 180.196838f, -374.128326f, -439.358948f, -126.546082f, -197.26178f, -227.159332f); + float b1 = (455.400024f); + bool4x3 r1 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + float4x3 a2 = float4x3(-479.8992f, -495.237335f, -224.517059f, -422.833221f, -450.196259f, -20.10672f, 297.38f, 185.966553f, -102.975983f, -220.597046f, -228.686859f, -333.001282f); + float b2 = (-439.777679f); + bool4x3 r2 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + float4x3 a3 = float4x3(434.213f, -239.869781f, 380.93927f, 90.34949f, -361.327942f, -453.599945f, 157.732483f, -491.0462f, 296.614258f, 482.265137f, -305.876984f, -290.1021f); + float b3 = (406.248718f); + bool4x3 r3 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void float4x3_operator_equal_scalar_wide() + { + float a0 = (-253.397278f); + float4x3 b0 = float4x3(19.95221f, -185.791992f, 407.8136f, -87.2767f, -206.274689f, 160.503113f, -274.7708f, -2.63153076f, 448.354553f, -410.035248f, 247.329041f, 355.539124f); + bool4x3 r0 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + float a1 = (-298.0667f); + float4x3 b1 = float4x3(414.1015f, -481.3026f, 196.55072f, 34.6010132f, 113.7616f, -386.453369f, -124.49176f, 243.886658f, -492.6182f, 145.424438f, 421.55072f, -95.40997f); + bool4x3 r1 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + float a2 = (336.809265f); + float4x3 b2 = float4x3(209.5838f, 487.4414f, 161.806519f, 149.842468f, 225.724f, -71.21881f, 85.78027f, 192.547241f, -49.88748f, -229.801971f, -103.407349f, 19.21576f); + bool4x3 r2 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + float a3 = (492.8811f); + float4x3 b3 = float4x3(140.403137f, -267.536438f, 125.972717f, 478.0005f, 116.144592f, -368.957764f, -225.028656f, 2.723755f, -452.2632f, 87.45654f, 401.306519f, -18.6455383f); + bool4x3 r3 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void float4x3_operator_not_equal_wide_wide() + { + float4x3 a0 = float4x3(430.842529f, 104.69f, 225.802429f, -310.5702f, -418.619446f, 304.128174f, -509.3268f, -160.538086f, -203.301971f, -505.763245f, 162.17218f, 1.156189f); + float4x3 b0 = float4x3(210.024719f, -55.20334f, -269.925354f, -234.546722f, 25.91742f, -63.72699f, -484.5537f, -425.3336f, -53.2743835f, 328.1944f, 15.9631348f, 461.7141f); + bool4x3 r0 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + float4x3 a1 = float4x3(65.66205f, 102.787781f, 172.930054f, 26.6210327f, 235.125977f, 128.541992f, -354.996979f, 334.3595f, -495.832f, 468.307373f, 458.370972f, 299.937317f); + float4x3 b1 = float4x3(-113.363037f, -240.072968f, 495.119141f, 203.55835f, 340.493469f, -241.9072f, 459.569824f, 213.07373f, -384.782837f, -255.072327f, 477.663452f, -248.036621f); + bool4x3 r1 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + float4x3 a2 = float4x3(43.1271973f, -354.7135f, -145.2872f, 390.80188f, -303.13147f, 391.134583f, 139.286865f, 104.523193f, 511.2964f, 213.147034f, -101.0957f, 441.6634f); + float4x3 b2 = float4x3(-407.923462f, -199.788879f, 151.843262f, -97.1206055f, 154.975891f, -172.834534f, 441.5028f, -401.738617f, -411.430176f, -337.820282f, -430.6309f, -150.8718f); + bool4x3 r2 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + float4x3 a3 = float4x3(124.36615f, 312.026428f, 59.65576f, -508.65683f, 98.699646f, 228.799866f, 337.832642f, -163.154449f, 461.6916f, -450.7757f, -443.564758f, -438.213135f); + float4x3 b3 = float4x3(-206.837f, 34.95508f, -255.771454f, 99.99866f, -161.175568f, 68.8535156f, -285.590118f, -428.717316f, -286.3374f, 2.02709961f, -4.80599976f, -425.3348f); + bool4x3 r3 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void float4x3_operator_not_equal_wide_scalar() + { + float4x3 a0 = float4x3(-16.9145813f, 168.8341f, -462.713531f, 130.307739f, 214.501587f, -440.263275f, -197.12796f, -169.099854f, -386.611176f, -281.021f, -270.26886f, -403.9637f); + float b0 = (-145.372772f); + bool4x3 r0 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + float4x3 a1 = float4x3(-269.805725f, -71.7509155f, -432.755737f, -457.363129f, -13.5195923f, 273.873047f, 185.04248f, -482.5307f, 116.395142f, 511.735f, 230.5075f, 100.27478f); + float b1 = (299.654236f); + bool4x3 r1 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + float4x3 a2 = float4x3(129.682434f, -220.639f, 140.3352f, 369.212341f, 453.811218f, -333.66626f, -373.937744f, 150.204285f, -442.164764f, 372.32f, -95.83798f, 495.5667f); + float b2 = (321.178772f); + bool4x3 r2 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + float4x3 a3 = float4x3(-5.3855896f, -459.612732f, 243.309082f, 314.102173f, 96.7449951f, -168.161926f, -71.90546f, 216.608459f, -377.3738f, 142.35498f, -432.272552f, 94.29083f); + float b3 = (-210.502991f); + bool4x3 r3 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void float4x3_operator_not_equal_scalar_wide() + { + float a0 = (275.795837f); + float4x3 b0 = float4x3(-57.1969f, -382.432526f, 97.82037f, -161.463654f, -458.39563f, -499.617859f, 327.92218f, 367.571228f, 59.786377f, -209.580688f, -62.5804443f, -479.974976f); + bool4x3 r0 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + float a1 = (-49.4945068f); + float4x3 b1 = float4x3(-114.685211f, 109.93927f, -176.284821f, -347.4853f, 85.5409546f, -356.659546f, -104.243561f, -133.5492f, 243.539734f, 13.1412964f, -379.985962f, -41.28122f); + bool4x3 r1 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + float a2 = (87.91168f); + float4x3 b2 = float4x3(-339.077271f, -371.820343f, 333.1443f, 294.811951f, -187.14566f, 220.192261f, -228.182068f, -499.723724f, 97.40588f, 501.60437f, 459.6754f, 158.098145f); + bool4x3 r2 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + float a3 = (358.4886f); + float4x3 b3 = float4x3(243.512573f, 336.702942f, 89.953125f, -65.57837f, -159.260162f, 410.588562f, 123.963013f, -239.625122f, -299.42984f, -491.2919f, 207.71167f, 271.5655f); + bool4x3 r3 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void float4x3_operator_less_wide_wide() + { + float4x3 a0 = float4x3(196.84259f, 336.4098f, 251.963745f, 257.655945f, 430.0459f, -62.4196472f, 8.839233f, -333.8167f, 164.678833f, -350.9449f, 3.84143066f, 125.409729f); + float4x3 b0 = float4x3(-465.345032f, -256.1524f, -314.814026f, 364.5667f, 100.21051f, 182.560974f, 3.11700439f, -259.430481f, -437.3349f, -456.043732f, -394.255981f, 401.9137f); + bool4x3 r0 = bool4x3(false, false, false, true, false, true, false, true, false, false, false, true); + TestUtils.AreEqual(r0, a0 < b0); + + float4x3 a1 = float4x3(-111.129944f, 70.00549f, 448.1983f, -419.987122f, -258.301666f, -34.8322144f, -69.8594055f, 67.76721f, -139.777283f, 385.434631f, 133.7074f, 506.188354f); + float4x3 b1 = float4x3(313.439148f, 121.286682f, -28.0122986f, -282.965881f, 330.0644f, 124.099365f, -183.6903f, 373.0608f, 109.750916f, -203.57135f, 45.64868f, -360.952271f); + bool4x3 r1 = bool4x3(true, true, false, true, true, true, false, true, true, false, false, false); + TestUtils.AreEqual(r1, a1 < b1); + + float4x3 a2 = float4x3(34.44287f, 412.1137f, -84.8097839f, 444.785339f, -78.75473f, 366.977539f, 127.180481f, 428.368469f, 8.197632f, -71.13736f, -474.0508f, 322.4289f); + float4x3 b2 = float4x3(211.913086f, -313.286377f, -259.661072f, 79.09851f, 446.4961f, 450.524536f, -375.630768f, -53.9418335f, -291.453735f, 190.774841f, 54.0839233f, -163.63089f); + bool4x3 r2 = bool4x3(true, false, false, false, true, true, false, false, false, true, true, false); + TestUtils.AreEqual(r2, a2 < b2); + + float4x3 a3 = float4x3(6.897888f, 195.733582f, -267.6906f, -243.7937f, 319.2508f, -425.1562f, 71.87396f, 313.843872f, 397.279053f, -309.145874f, -38.6678467f, -266.1197f); + float4x3 b3 = float4x3(-212.005646f, 406.0905f, -183.018951f, 355.221375f, -81.0422058f, -275.7148f, 405.299255f, -510.6406f, 398.069275f, -4.35549927f, 129.242676f, -276.146545f); + bool4x3 r3 = bool4x3(false, true, true, true, false, true, true, false, true, true, true, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void float4x3_operator_less_wide_scalar() + { + float4x3 a0 = float4x3(-132.057312f, -192.465f, -66.8345947f, -379.017517f, -360.2824f, 20.9278564f, -158.240753f, 437.3459f, -20.4526062f, 225.2915f, 307.4842f, 274.015259f); + float b0 = (-156.010223f); + bool4x3 r0 = bool4x3(false, true, false, true, true, false, true, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 < b0); + + float4x3 a1 = float4x3(373.549683f, 105.030151f, -58.0108948f, 109.670105f, -108.85318f, -44.9712524f, 140.426086f, -500.0883f, 172.103333f, -197.500732f, -7.271515f, -432.9905f); + float b1 = (398.523682f); + bool4x3 r1 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 < b1); + + float4x3 a2 = float4x3(62.1583252f, -377.852325f, -500.255737f, 149.11499f, 119.880615f, 202.63916f, 274.950684f, 66.41205f, 274.999451f, -149.6358f, 223.758728f, 73.2668457f); + float b2 = (-72.25473f); + bool4x3 r2 = bool4x3(false, true, true, false, false, false, false, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + float4x3 a3 = float4x3(213.094971f, 418.3772f, 421.103577f, -187.16684f, 389.109436f, 401.335449f, -106.285065f, 380.607971f, 385.652832f, 120.659851f, -13.8308716f, -500.1271f); + float b3 = (322.8595f); + bool4x3 r3 = bool4x3(true, false, false, true, false, false, true, false, false, true, true, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void float4x3_operator_less_scalar_wide() + { + float a0 = (-423.1174f); + float4x3 b0 = float4x3(385.094849f, -123.933472f, 86.37659f, 133.4422f, 161.457947f, 229.754272f, 222.5716f, 315.5312f, -447.203522f, 271.833862f, -393.605316f, 317.486877f); + bool4x3 r0 = bool4x3(true, true, true, true, true, true, true, true, false, true, true, true); + TestUtils.AreEqual(r0, a0 < b0); + + float a1 = (-164.6051f); + float4x3 b1 = float4x3(-282.876038f, 296.979553f, -254.401154f, 365.6156f, -441.984253f, -131.42865f, 442.628967f, -29.7928467f, -138.37381f, 9.21698f, -226.73056f, 171.029419f); + bool4x3 r1 = bool4x3(false, true, false, true, false, true, true, true, true, true, false, true); + TestUtils.AreEqual(r1, a1 < b1); + + float a2 = (376.625244f); + float4x3 b2 = float4x3(-462.5887f, -142.36731f, -456.253784f, 66.61023f, 169.378784f, 327.4444f, 64.08795f, -153.5039f, 199.380127f, -244.969055f, 472.743835f, -363.7801f); + bool4x3 r2 = bool4x3(false, false, false, false, false, false, false, false, false, false, true, false); + TestUtils.AreEqual(r2, a2 < b2); + + float a3 = (-179.487518f); + float4x3 b3 = float4x3(-83.42514f, 178.886475f, 62.15576f, 409.746765f, -117.163666f, 316.601685f, 285.5163f, 18.6745f, 282.5293f, 132.923767f, -318.215332f, 314.8399f); + bool4x3 r3 = bool4x3(true, true, true, true, true, true, true, true, true, true, false, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void float4x3_operator_greater_wide_wide() + { + float4x3 a0 = float4x3(483.5014f, 310.8156f, 106.966187f, 295.7353f, 116.957581f, -478.299774f, -14.8974f, -33.8174438f, -24.74054f, 319.782654f, -120.158569f, -289.008575f); + float4x3 b0 = float4x3(-471.398f, -371.9853f, 36.9006958f, -316.7636f, 19.6830444f, 207.309143f, 362.7975f, 324.95343f, 340.948059f, 25.9860229f, -114.211121f, 240.803467f); + bool4x3 r0 = bool4x3(true, true, true, true, true, false, false, false, false, true, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + float4x3 a1 = float4x3(455.85144f, 144.706909f, 63.9320068f, -285.683044f, -502.090729f, -337.194458f, 474.317322f, -507.1451f, -133.565582f, -443.109131f, -464.34137f, -68.36154f); + float4x3 b1 = float4x3(273.422424f, 325.515747f, 27.3410645f, 64.47955f, 200.948364f, 100.122681f, -79.00711f, -315.137939f, -122.985443f, -163.7792f, -492.566f, -90.79727f); + bool4x3 r1 = bool4x3(true, false, true, false, false, false, true, false, false, false, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + float4x3 a2 = float4x3(-185.993011f, -157.8039f, -74.12424f, -94.47116f, 329.610535f, -315.836731f, 404.1938f, 131.304382f, -206.633911f, 197.399841f, 187.991943f, 362.636047f); + float4x3 b2 = float4x3(-284.901245f, -23.6536865f, 174.93f, 85.7125244f, -441.987823f, 345.543762f, 482.219482f, -422.383484f, -30.7792969f, 296.154236f, 378.059875f, -457.733429f); + bool4x3 r2 = bool4x3(true, false, false, false, true, false, false, true, false, false, false, true); + TestUtils.AreEqual(r2, a2 > b2); + + float4x3 a3 = float4x3(336.0932f, -352.448364f, -183.10199f, 193.144836f, -170.216f, -0.491241455f, -326.855042f, -373.39624f, -216.580475f, 282.5121f, -275.170349f, -207.331757f); + float4x3 b3 = float4x3(122.920593f, -509.173126f, 386.77063f, 436.41748f, -276.495819f, -163.166779f, 249.970642f, -165.020752f, 89.09302f, 404.305176f, -340.688843f, -103.785095f); + bool4x3 r3 = bool4x3(true, true, false, false, true, true, false, false, false, false, true, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void float4x3_operator_greater_wide_scalar() + { + float4x3 a0 = float4x3(64.31793f, -397.703461f, 431.8769f, 85.703f, 246.263062f, 197.491577f, 286.199463f, 280.813354f, -405.7846f, 171.565369f, -241.807281f, 333.5782f); + float b0 = (305.859924f); + bool4x3 r0 = bool4x3(false, false, true, false, false, false, false, false, false, false, false, true); + TestUtils.AreEqual(r0, a0 > b0); + + float4x3 a1 = float4x3(370.279175f, -356.592346f, -353.0313f, 396.645325f, 467.222046f, -240.013428f, 502.915039f, 315.4676f, -259.2897f, 281.230652f, 428.792175f, 245.153076f); + float b1 = (-413.7014f); + bool4x3 r1 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + float4x3 a2 = float4x3(-279.1754f, -124.771545f, -425.652924f, 99.13287f, 355.060547f, -456.439423f, 154.489014f, 405.529724f, -157.7338f, 186.0863f, 249.999084f, -110.096924f); + float b2 = (-453.8631f); + bool4x3 r2 = bool4x3(true, true, true, true, true, false, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 > b2); + + float4x3 a3 = float4x3(-435.3045f, -254.346558f, -428.987946f, 255.373657f, -309.1123f, 185.501587f, -201.334167f, 23.321167f, -143.9761f, -111.77951f, -356.656616f, -318.313568f); + float b3 = (72.7520142f); + bool4x3 r3 = bool4x3(false, false, false, true, false, true, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void float4x3_operator_greater_scalar_wide() + { + float a0 = (-282.6705f); + float4x3 b0 = float4x3(358.099976f, -72.596405f, -232.163788f, -60.7067261f, 75.15662f, 150.883484f, 339.539185f, -498.196045f, 459.7461f, -227.968719f, 335.862122f, 76.17883f); + bool4x3 r0 = bool4x3(false, false, false, false, false, false, false, true, false, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + float a1 = (296.859924f); + float4x3 b1 = float4x3(177.48999f, -281.2012f, 244.722839f, 137.328552f, -385.338257f, 443.163452f, -353.562561f, 26.04065f, -331.793945f, -43.6919556f, 20.9494019f, -211.17984f); + bool4x3 r1 = bool4x3(true, true, true, true, true, false, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + float a2 = (227.421692f); + float4x3 b2 = float4x3(-84.7797852f, -375.1355f, -205.178131f, -197.04715f, -219.634033f, -210.015625f, -266.7737f, 144.7785f, -471.7112f, -155.913177f, 99.72473f, -230.944855f); + bool4x3 r2 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 > b2); + + float a3 = (-338.8689f); + float4x3 b3 = float4x3(334.068237f, -158.660858f, -315.018219f, -177.19281f, 171.95929f, 198.38916f, 303.678345f, 400.6996f, 351.878662f, -31.7696533f, 386.0733f, -360.348877f); + bool4x3 r3 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void float4x3_operator_less_equal_wide_wide() + { + float4x3 a0 = float4x3(-438.523132f, 210.489441f, 4.87731934f, -137.297943f, 156.094116f, -363.924133f, -97.94849f, 437.2954f, 458.530273f, -294.064758f, 23.62262f, -34.2840576f); + float4x3 b0 = float4x3(-474.814148f, 304.371033f, 234.824158f, -390.485443f, -297.175354f, -326.2924f, 107.253906f, -413.131073f, 67.09442f, 470.075256f, -84.499115f, 392.784241f); + bool4x3 r0 = bool4x3(false, true, true, false, false, true, true, false, false, true, false, true); + TestUtils.AreEqual(r0, a0 <= b0); + + float4x3 a1 = float4x3(149.736511f, -418.8867f, -197.502533f, -88.2055054f, -376.71814f, 341.627136f, -83.30917f, -107.490723f, 319.466858f, 205.357361f, 345.563721f, 395.3219f); + float4x3 b1 = float4x3(-263.531738f, 369.3009f, -333.3253f, 238.413452f, 486.2426f, 279.6502f, 236.052f, 132.758972f, 66.29474f, 183.002136f, 200.130554f, 339.043823f); + bool4x3 r1 = bool4x3(false, true, false, true, true, false, true, true, false, false, false, false); + TestUtils.AreEqual(r1, a1 <= b1); + + float4x3 a2 = float4x3(-222.874146f, 439.022034f, -368.075562f, -200.0386f, 71.46991f, -357.365417f, 141.710876f, 319.0171f, 303.030151f, -461.574249f, 277.62677f, 182.1781f); + float4x3 b2 = float4x3(438.5379f, 145.401855f, 178.163086f, 157.975952f, 329.7052f, -243.590912f, 5.401184f, -22.5805969f, -90.3375854f, -72.19107f, -354.354828f, -289.521729f); + bool4x3 r2 = bool4x3(true, false, true, true, true, true, false, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + float4x3 a3 = float4x3(-337.414856f, -361.391663f, 222.1435f, -464.7795f, -146.853668f, 80.17505f, -260.3473f, 94.48901f, 174.281189f, -303.8197f, 81.41742f, 503.048157f); + float4x3 b3 = float4x3(85.17627f, 469.327881f, 294.7138f, 461.605957f, -245.930481f, -124.040436f, 278.392639f, -42.8812561f, -328.348816f, 98.9855957f, -375.899841f, -197.934265f); + bool4x3 r3 = bool4x3(true, true, true, true, false, false, true, false, false, true, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void float4x3_operator_less_equal_wide_scalar() + { + float4x3 a0 = float4x3(193.49585f, 168.915527f, -313.993073f, 81.8269653f, 18.5036011f, -0.3581848f, 241.361145f, -463.8164f, -1.35775757f, -268.899475f, 398.991943f, -471.253082f); + float b0 = (443.850525f); + bool4x3 r0 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + float4x3 a1 = float4x3(-264.9378f, 11.2460327f, 424.704041f, 426.482239f, 56.3200073f, -196.2879f, 31.9011841f, -152.257568f, -437.926453f, -37.1048279f, -47.1442261f, 333.623047f); + float b1 = (82.2583f); + bool4x3 r1 = bool4x3(true, true, false, false, true, true, true, true, true, true, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + float4x3 a2 = float4x3(-274.8039f, -260.460571f, 192.309143f, 145.306091f, -466.132965f, -494.267334f, -111.570129f, -139.5412f, -146.589355f, 33.98401f, -445.704468f, -451.0422f); + float b2 = (358.67627f); + bool4x3 r2 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 <= b2); + + float4x3 a3 = float4x3(-122.039276f, -202.465515f, -76.56488f, 218.032776f, -103.53595f, -283.358429f, -374.761658f, -213.49588f, 477.491821f, -383.370056f, 23.9649658f, -5.960785f); + float b3 = (83.3277f); + bool4x3 r3 = bool4x3(true, true, true, false, true, true, true, true, false, true, true, true); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void float4x3_operator_less_equal_scalar_wide() + { + float a0 = (393.606262f); + float4x3 b0 = float4x3(-75.6883545f, -44.2638855f, 125.864929f, 191.9649f, 13.54303f, -197.051941f, -423.9451f, -330.0486f, 420.165527f, 105.5473f, 174.821289f, 296.7176f); + bool4x3 r0 = bool4x3(false, false, false, false, false, false, false, false, true, false, false, false); + TestUtils.AreEqual(r0, a0 <= b0); + + float a1 = (-469.7004f); + float4x3 b1 = float4x3(123.267212f, 112.996948f, 495.143372f, -488.6579f, 388.539429f, -493.240784f, 16.45105f, -387.651642f, -229.1773f, -373.01532f, -391.142151f, 90.99414f); + bool4x3 r1 = bool4x3(true, true, true, false, true, false, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 <= b1); + + float a2 = (-178.396149f); + float4x3 b2 = float4x3(-69.62106f, 471.790833f, -67.46677f, 45.30536f, -154.6922f, 385.7389f, -431.652954f, -331.673035f, -349.8927f, -114.839142f, -245.217834f, -486.6955f); + bool4x3 r2 = bool4x3(true, true, true, true, true, true, false, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + float a3 = (391.950928f); + float4x3 b3 = float4x3(-125.770538f, -229.812286f, 289.449036f, -200.494232f, 281.5927f, 99.90106f, -146.027435f, 124.148376f, 94.3569946f, 93.920105f, -484.924133f, -270.796875f); + bool4x3 r3 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void float4x3_operator_greater_equal_wide_wide() + { + float4x3 a0 = float4x3(-507.9286f, 504.4975f, -385.4345f, -262.323425f, -37.5509338f, -111.595276f, -463.702026f, 387.448853f, 456.9688f, -211.010162f, 182.411377f, -53.59604f); + float4x3 b0 = float4x3(-81.3465f, 297.666138f, 171.06543f, -431.038055f, -6.85907f, 319.7257f, 254.079163f, 396.5724f, 178.8393f, -447.063354f, 288.492676f, 474.889282f); + bool4x3 r0 = bool4x3(false, true, false, true, false, false, false, false, true, true, false, false); + TestUtils.AreEqual(r0, a0 >= b0); + + float4x3 a1 = float4x3(-309.570221f, -136.022491f, 280.736267f, -96.99588f, -174.059509f, 88.90192f, 43.81604f, -446.07843f, 16.6455688f, 409.83252f, -191.329865f, 222.9978f); + float4x3 b1 = float4x3(-321.750244f, -395.977234f, -158.692474f, 391.4887f, -368.109253f, 89.12378f, -510.279327f, -486.9298f, -81.2155457f, 274.2188f, -212.881561f, 288.9953f); + bool4x3 r1 = bool4x3(true, true, true, false, true, false, true, true, true, true, true, false); + TestUtils.AreEqual(r1, a1 >= b1); + + float4x3 a2 = float4x3(404.2884f, 230.603271f, -441.789276f, -86.29306f, 484.249573f, 95.23639f, -204.912109f, -199.774353f, -421.8632f, -18.2147827f, -346.822754f, -159.243652f); + float4x3 b2 = float4x3(307.73175f, 307.245178f, -199.391785f, -284.421265f, -482.3918f, 448.315735f, -378.3462f, -390.858459f, 8.916016f, 416.407227f, -213.674957f, 455.2481f); + bool4x3 r2 = bool4x3(true, false, false, true, true, false, true, true, false, false, false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + float4x3 a3 = float4x3(112.917725f, 48.2910156f, 390.660156f, 154.219177f, -32.7480469f, -288.265625f, 122.704285f, 321.277954f, 230.183838f, 116.874268f, -93.515686f, 229.9823f); + float4x3 b3 = float4x3(-236.080353f, -248.373108f, 184.18512f, 415.31134f, 86.98218f, 485.004578f, 107.758911f, -486.667725f, -138.676788f, 14.2078247f, -382.394165f, -117.008209f); + bool4x3 r3 = bool4x3(true, true, true, false, false, false, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void float4x3_operator_greater_equal_wide_scalar() + { + float4x3 a0 = float4x3(465.152161f, -424.886078f, -209.2211f, 58.7798462f, -302.2691f, 140.12561f, 16.3533936f, -344.559967f, 393.278076f, -315.701538f, 441.011536f, -509.781555f); + float b0 = (-5.599884f); + bool4x3 r0 = bool4x3(true, false, false, true, false, true, true, false, true, false, true, false); + TestUtils.AreEqual(r0, a0 >= b0); + + float4x3 a1 = float4x3(-36.9942932f, -164.973938f, -466.1201f, -123.813751f, 215.651245f, 104.995728f, 314.346f, 190.516113f, -83.11142f, -23.8364258f, 143.049377f, -264.919983f); + float b1 = (494.8203f); + bool4x3 r1 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + float4x3 a2 = float4x3(-169.702209f, 359.095825f, -260.4233f, 354.195129f, -111.845337f, 33.309082f, 355.6313f, -435.360565f, -38.3993225f, -93.2957153f, -338.8496f, 436.8958f); + float b2 = (329.70752f); + bool4x3 r2 = bool4x3(false, true, false, true, false, false, true, false, false, false, false, true); + TestUtils.AreEqual(r2, a2 >= b2); + + float4x3 a3 = float4x3(511.084167f, -453.799255f, 170.919f, -182.825745f, -207.516937f, -319.5006f, -240.5086f, 436.3413f, -66.9560547f, 303.320862f, 180.196045f, 337.965149f); + float b3 = (-277.67453f); + bool4x3 r3 = bool4x3(true, false, true, true, true, false, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void float4x3_operator_greater_equal_scalar_wide() + { + float a0 = (374.827026f); + float4x3 b0 = float4x3(-1.60977173f, 338.615234f, -116.1814f, -332.157318f, -355.97937f, -468.901428f, 38.579895f, -332.347534f, 2.89013672f, 467.777771f, 121.406372f, -305.023376f); + bool4x3 r0 = bool4x3(true, true, true, true, true, true, true, true, true, false, true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + float a1 = (-58.4288025f); + float4x3 b1 = float4x3(-226.519562f, -47.0209961f, 305.302673f, -427.401245f, 92.26367f, -497.178528f, -408.625641f, -455.2305f, 396.4261f, -469.2949f, -485.754028f, -182.346191f); + bool4x3 r1 = bool4x3(true, false, false, true, false, true, true, true, false, true, true, true); + TestUtils.AreEqual(r1, a1 >= b1); + + float a2 = (-291.545349f); + float4x3 b2 = float4x3(278.740784f, -75.8711243f, 28.9070435f, 287.720154f, 420.509766f, 473.626831f, 181.514526f, -369.202881f, 243.749756f, -244.124146f, -242.993347f, -322.115356f); + bool4x3 r2 = bool4x3(false, false, false, false, false, false, false, true, false, false, false, true); + TestUtils.AreEqual(r2, a2 >= b2); + + float a3 = (192.974976f); + float4x3 b3 = float4x3(-54.7255554f, -166.000824f, 244.293457f, 438.2494f, -162.692841f, 37.1853638f, -506.667358f, -205.163086f, 368.389954f, -35.45996f, -20.9164429f, 9.041382f); + bool4x3 r3 = bool4x3(true, true, false, false, true, true, true, true, false, true, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void float4x3_operator_add_wide_wide() + { + float4x3 a0 = float4x3(506.129028f, -501.779816f, 420.084778f, -186.032074f, -9.312408f, 328.51178f, 424.344055f, 87.79108f, 462.4137f, -46.17871f, 401.170044f, -454.124146f); + float4x3 b0 = float4x3(-28.7579956f, -337.135132f, -340.676819f, 152.312012f, 423.66748f, 90.3740845f, 376.18866f, 1.76721191f, -120.185852f, -279.629364f, -344.6671f, 242.839172f); + float4x3 r0 = float4x3(477.371033f, -838.9149f, 79.40796f, -33.7200623f, 414.355072f, 418.885864f, 800.5327f, 89.55829f, 342.227844f, -325.808075f, 56.50293f, -211.284973f); + TestUtils.AreEqual(r0, a0 + b0); + + float4x3 a1 = float4x3(69.19568f, -177.957336f, 299.604126f, 340.704834f, 219.916016f, -321.9084f, 286.355347f, -333.4195f, -118.932159f, 68.60748f, 23.190918f, -205.577881f); + float4x3 b1 = float4x3(418.593079f, -23.3128052f, -95.0999451f, 147.9281f, 331.0329f, -82.50256f, 279.4496f, 342.622742f, -300.358521f, -209.694092f, 446.559448f, -351.9892f); + float4x3 r1 = float4x3(487.788757f, -201.270142f, 204.504181f, 488.632935f, 550.9489f, -404.41095f, 565.804932f, 9.203247f, -419.29068f, -141.086609f, 469.750366f, -557.5671f); + TestUtils.AreEqual(r1, a1 + b1); + + float4x3 a2 = float4x3(11.5214233f, -340.795074f, -68.93118f, 304.8532f, -86.63385f, 105.669128f, 349.280518f, 364.7079f, -429.0374f, 382.458069f, 186.097046f, 227.411865f); + float4x3 b2 = float4x3(-263.12384f, -252.458557f, 289.825378f, 338.796143f, -232.619019f, -510.50824f, 349.280762f, -426.212463f, -331.416321f, -418.6888f, -341.70636f, -329.0359f); + float4x3 r2 = float4x3(-251.602417f, -593.253662f, 220.8942f, 643.649353f, -319.252869f, -404.8391f, 698.5613f, -61.5045776f, -760.453735f, -36.2307434f, -155.609314f, -101.624023f); + TestUtils.AreEqual(r2, a2 + b2); + + float4x3 a3 = float4x3(-298.766357f, 351.3028f, 98.7254f, -292.351685f, 112.1709f, 477.165771f, -266.304871f, -295.1407f, -485.820374f, -507.8687f, -338.2196f, 505.342163f); + float4x3 b3 = float4x3(123.198547f, 189.528564f, 267.569946f, 134.636292f, -337.96814f, 50.7280273f, 81.16345f, 442.0907f, -148.704529f, 6.974365f, -334.911255f, 43.78711f); + float4x3 r3 = float4x3(-175.56781f, 540.83136f, 366.295349f, -157.7154f, -225.797241f, 527.8938f, -185.141418f, 146.950012f, -634.5249f, -500.894348f, -673.130859f, 549.1293f); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void float4x3_operator_add_wide_scalar() + { + float4x3 a0 = float4x3(-194.514191f, 338.5484f, 246.971375f, 100.510925f, -45.72467f, -478.1113f, 30.9161377f, 60.37433f, -242.118744f, 82.50134f, 6.79937744f, -484.6998f); + float b0 = (124.121704f); + float4x3 r0 = float4x3(-70.39249f, 462.6701f, 371.093079f, 224.632629f, 78.39703f, -353.9896f, 155.037842f, 184.496033f, -117.99704f, 206.623047f, 130.921082f, -360.5781f); + TestUtils.AreEqual(r0, a0 + b0); + + float4x3 a1 = float4x3(-188.265015f, -267.7843f, 189.259949f, 198.533569f, 187.536072f, -424.925659f, 302.102356f, 300.3991f, 124.021606f, -200.161346f, 31.3782349f, 362.522156f); + float b1 = (-213.526733f); + float4x3 r1 = float4x3(-401.791748f, -481.311035f, -24.2667847f, -14.9931641f, -25.9906616f, -638.4524f, 88.57562f, 86.8723755f, -89.50513f, -413.68808f, -182.1485f, 148.995422f); + TestUtils.AreEqual(r1, a1 + b1); + + float4x3 a2 = float4x3(-423.988861f, 374.211426f, -465.6995f, -311.04303f, 84.91901f, -432.442444f, 235.750671f, -472.637756f, -257.577759f, 186.120728f, -170.298218f, -115.272491f); + float b2 = (432.41333f); + float4x3 r2 = float4x3(8.424469f, 806.624756f, -33.2861633f, 121.3703f, 517.332336f, -0.02911377f, 668.164f, -40.2244263f, 174.835571f, 618.534058f, 262.1151f, 317.140839f); + TestUtils.AreEqual(r2, a2 + b2); + + float4x3 a3 = float4x3(-101.168823f, 246.549255f, -397.5346f, -199.04837f, 20.585022f, 207.323853f, 197.935181f, -201.540558f, -106.638672f, -179.382233f, 203.817078f, -364.820953f); + float b3 = (257.775146f); + float4x3 r3 = float4x3(156.606323f, 504.3244f, -139.75946f, 58.7267761f, 278.360168f, 465.099f, 455.710327f, 56.23459f, 151.136475f, 78.3929138f, 461.592224f, -107.045807f); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void float4x3_operator_add_scalar_wide() + { + float a0 = (-340.354675f); + float4x3 b0 = float4x3(511.362244f, -146.216644f, -106.210419f, -363.450256f, 199.0896f, -27.1083984f, 419.849f, 284.955017f, -164.9242f, -249.190338f, 150.928162f, 298.1751f); + float4x3 r0 = float4x3(171.007568f, -486.57132f, -446.5651f, -703.804932f, -141.265076f, -367.463074f, 79.49432f, -55.39966f, -505.27887f, -589.545044f, -189.426514f, -42.1795654f); + TestUtils.AreEqual(r0, a0 + b0); + + float a1 = (-457.1534f); + float4x3 b1 = float4x3(424.718079f, -301.857483f, 230.288879f, -423.5876f, -67.06003f, 68.72412f, -164.02243f, 318.935181f, 7.80456543f, 187.698364f, -3.656952f, -446.083069f); + float4x3 r1 = float4x3(-32.4353333f, -759.010864f, -226.864532f, -880.740967f, -524.21344f, -388.4293f, -621.175842f, -138.218231f, -449.348846f, -269.455048f, -460.810364f, -903.23645f); + TestUtils.AreEqual(r1, a1 + b1); + + float a2 = (-209.287231f); + float4x3 b2 = float4x3(-38.21289f, -346.257172f, 465.607422f, -192.185944f, 278.6938f, 381.978455f, 481.243652f, -97.22815f, -455.513733f, 501.834961f, 358.7066f, 430.699768f); + float4x3 r2 = float4x3(-247.500122f, -555.544434f, 256.3202f, -401.473175f, 69.4065552f, 172.691223f, 271.956421f, -306.515381f, -664.800964f, 292.547729f, 149.419373f, 221.412537f); + TestUtils.AreEqual(r2, a2 + b2); + + float a3 = (256.987183f); + float4x3 b3 = float4x3(207.651672f, -376.965179f, -428.085327f, -373.49353f, -468.89328f, -467.658447f, 297.484924f, -506.89978f, -233.358459f, 434.558777f, -387.3152f, 171.590271f); + float4x3 r3 = float4x3(464.638855f, -119.978f, -171.098145f, -116.506348f, -211.9061f, -210.671265f, 554.4721f, -249.9126f, 23.6287231f, 691.545959f, -130.328f, 428.577454f); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void float4x3_operator_sub_wide_wide() + { + float4x3 a0 = float4x3(160.492249f, 11.223938f, 359.200134f, -498.2283f, -355.253632f, -94.53485f, -410.46405f, -401.384644f, 317.706848f, 447.060425f, -489.074158f, -230.008392f); + float4x3 b0 = float4x3(115.46875f, -130.9823f, 241.540833f, 9.987061f, 419.895142f, 59.12445f, -402.381653f, -75.37015f, 320.9796f, -73.90875f, -31.4447327f, -389.251953f); + float4x3 r0 = float4x3(45.0235f, 142.206238f, 117.6593f, -508.215363f, -775.1488f, -153.6593f, -8.082397f, -326.0145f, -3.272766f, 520.9692f, -457.629425f, 159.243561f); + TestUtils.AreEqual(r0, a0 - b0); + + float4x3 a1 = float4x3(24.8754272f, 366.614441f, -107.374146f, -219.008148f, 473.9076f, 259.63623f, -360.119629f, 7.80963135f, 437.428467f, -59.1991577f, 418.744324f, 183.142151f); + float4x3 b1 = float4x3(-375.028839f, 259.182739f, 276.648682f, -453.0692f, -272.576538f, -191.148041f, 87.1369f, 430.02478f, 343.6571f, 121.029419f, -354.188171f, 249.052f); + float4x3 r1 = float4x3(399.904266f, 107.4317f, -384.022827f, 234.061066f, 746.484131f, 450.784271f, -447.256531f, -422.215149f, 93.77136f, -180.228577f, 772.9325f, -65.90985f); + TestUtils.AreEqual(r1, a1 - b1); + + float4x3 a2 = float4x3(271.230347f, 496.208557f, 165.354919f, -227.403656f, -166.522858f, 356.142273f, 386.9264f, -394.638763f, 126.903259f, 97.21692f, -150.017853f, -227.250519f); + float4x3 b2 = float4x3(-2.22543335f, 22.4472656f, 478.112976f, -320.063f, -111.524109f, 222.228943f, -245.411072f, -119.902283f, -153.465668f, 374.1125f, 301.763428f, -281.430054f); + float4x3 r2 = float4x3(273.45578f, 473.7613f, -312.758057f, 92.65933f, -54.99875f, 133.91333f, 632.337463f, -274.736481f, 280.368927f, -276.895569f, -451.781281f, 54.1795349f); + TestUtils.AreEqual(r2, a2 - b2); + + float4x3 a3 = float4x3(-198.830017f, 0.662780762f, -484.245575f, -295.996277f, -46.17099f, 499.9524f, 292.440125f, -106.424133f, 466.827148f, 487.374817f, 242.994629f, -468.901581f); + float4x3 b3 = float4x3(-494.964355f, -320.731262f, 160.962219f, -132.9364f, -394.437531f, 406.851257f, 270.544617f, 507.794617f, 67.69922f, 263.40448f, 297.5807f, 170.839539f); + float4x3 r3 = float4x3(296.134338f, 321.394043f, -645.207764f, -163.059875f, 348.266541f, 93.1011353f, 21.8955078f, -614.21875f, 399.12793f, 223.970337f, -54.58606f, -639.7411f); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void float4x3_operator_sub_wide_scalar() + { + float4x3 a0 = float4x3(207.389587f, 248.457764f, -384.8239f, -205.344757f, -374.811554f, 191.642029f, 18.8562622f, -44.96161f, 480.857971f, 16.3381958f, -366.865448f, -35.5231f); + float b0 = (-36.1124878f); + float4x3 r0 = float4x3(243.502075f, 284.570251f, -348.711426f, -169.232269f, -338.699066f, 227.754517f, 54.96875f, -8.849121f, 516.970459f, 52.4506836f, -330.75296f, 0.589386f); + TestUtils.AreEqual(r0, a0 - b0); + + float4x3 a1 = float4x3(349.397766f, 490.2223f, 195.024048f, -384.849426f, 189.05188f, 55.6027832f, -54.931488f, 53.0880737f, 316.8025f, -273.8067f, 256.8872f, 297.173645f); + float b1 = (439.077271f); + float4x3 r1 = float4x3(-89.6795044f, 51.14502f, -244.053223f, -823.9267f, -250.025391f, -383.4745f, -494.008759f, -385.9892f, -122.27478f, -712.884f, -182.190063f, -141.903625f); + TestUtils.AreEqual(r1, a1 - b1); + + float4x3 a2 = float4x3(101.829041f, -19.7322083f, 336.589722f, -51.8765564f, 317.345764f, -467.055939f, -50.1670532f, 477.804565f, -60.82193f, 0.4111328f, 46.66095f, -19.241394f); + float b2 = (136.607971f); + float4x3 r2 = float4x3(-34.77893f, -156.340179f, 199.98175f, -188.484528f, 180.7378f, -603.66394f, -186.775024f, 341.1966f, -197.4299f, -136.196838f, -89.94702f, -155.849365f); + TestUtils.AreEqual(r2, a2 - b2); + + float4x3 a3 = float4x3(396.809753f, -334.274231f, -198.077148f, -239.200623f, -339.6812f, -14.5144348f, 219.99707f, -180.260681f, -438.8906f, 186.35553f, -365.066772f, -478.801239f); + float b3 = (69.5905151f); + float4x3 r3 = float4x3(327.219238f, -403.864746f, -267.667664f, -308.791138f, -409.271729f, -84.10495f, 150.406555f, -249.8512f, -508.4811f, 116.765015f, -434.6573f, -548.3917f); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void float4x3_operator_sub_scalar_wide() + { + float a0 = (-86.00824f); + float4x3 b0 = float4x3(466.4251f, 298.486938f, -300.9501f, 315.38f, -381.092163f, -125.008362f, 58.4661865f, 214.7461f, -257.549438f, 480.2246f, -443.355072f, 260.795044f); + float4x3 r0 = float4x3(-552.43335f, -384.495178f, 214.941864f, -401.388245f, 295.083923f, 39.0001221f, -144.474426f, -300.754333f, 171.5412f, -566.232849f, 357.346832f, -346.803284f); + TestUtils.AreEqual(r0, a0 - b0); + + float a1 = (29.6819458f); + float4x3 b1 = float4x3(139.857727f, -247.789948f, -248.466217f, 91.44513f, 86.3841553f, 373.8183f, 260.411926f, 114.353943f, -464.405457f, -109.741455f, -311.675354f, 107.864014f); + float4x3 r1 = float4x3(-110.175781f, 277.4719f, 278.148163f, -61.7631836f, -56.70221f, -344.136353f, -230.72998f, -84.672f, 494.0874f, 139.4234f, 341.3573f, -78.18207f); + TestUtils.AreEqual(r1, a1 - b1); + + float a2 = (-258.795166f); + float4x3 b2 = float4x3(14.0975342f, -461.970184f, 30.3108521f, 63.70111f, -462.676758f, 39.75946f, 47.99817f, -177.6193f, 202.477051f, -289.3088f, -459.9254f, 248.386658f); + float4x3 r2 = float4x3(-272.8927f, 203.175018f, -289.106018f, -322.496277f, 203.881592f, -298.554626f, -306.793335f, -81.17587f, -461.272217f, 30.5136414f, 201.130249f, -507.181824f); + TestUtils.AreEqual(r2, a2 - b2); + + float a3 = (85.32971f); + float4x3 b3 = float4x3(-73.37479f, -510.652f, 426.963257f, 239.59021f, 477.852356f, 256.0136f, 338.620361f, -483.8312f, 330.3922f, -263.4182f, 123.92804f, -269.115967f); + float4x3 r3 = float4x3(158.7045f, 595.9817f, -341.633545f, -154.2605f, -392.522644f, -170.6839f, -253.290649f, 569.1609f, -245.0625f, 348.747925f, -38.5983276f, 354.445679f); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void float4x3_operator_mul_wide_wide() + { + float4x3 a0 = float4x3(-482.7138f, -407.2935f, 137.700562f, 208.541138f, 194.29657f, -484.242432f, 183.9873f, -241.33548f, 45.8687744f, 363.3261f, -328.118958f, -471.023071f); + float4x3 b0 = float4x3(-236.367889f, 260.7276f, -416.3863f, -364.4956f, -253.147522f, -369.202881f, 193.547913f, 169.0849f, 201.969666f, 249.456055f, -308.193176f, -385.579651f); + float4x3 r0 = float4x3(114098.047f, -106192.656f, -57336.625f, -76012.33f, -49185.6953f, 178783.7f, 35610.36f, -40806.1836f, 9264.101f, 90633.9f, 101124.023f, 181616.9f); + TestUtils.AreEqual(r0, a0 * b0); + + float4x3 a1 = float4x3(-262.682556f, -379.262756f, -374.090576f, 481.4474f, 104.628052f, 412.935425f, 477.877258f, 20.3778076f, 291.995972f, -138.488312f, -393.464966f, 9.363098f); + float4x3 b1 = float4x3(-183.2796f, 22.2756348f, -265.521423f, -95.67746f, 133.2544f, 148.311462f, 249.284119f, 500.0055f, -19.3315735f, -36.69107f, 30.5238037f, -401.367f); + float4x3 r1 = float4x3(48144.3555f, -8448.318f, 99329.06f, -46063.6641f, 13942.1475f, 61243.06f, 119127.211f, 10189.0156f, -5644.7417f, 5081.284f, -12010.0479f, -3758.03857f); + TestUtils.AreEqual(r1, a1 * b1); + + float4x3 a2 = float4x3(-131.942291f, 364.449646f, 390.615967f, 418.797974f, -277.3448f, 11.4101563f, 474.876465f, -502.405029f, -222.59491f, 38.1690674f, 292.6125f, 203.2077f); + float4x3 b2 = float4x3(3.43725586f, 257.24176f, -290.971924f, 337.47937f, 490.286133f, -191.0198f, -325.7345f, -52.1819763f, 123.435059f, -461.267059f, 122.353088f, 308.584656f); + float4x3 r2 = float4x3(-453.5194f, 93751.67f, -113658.281f, 141335.672f, -135978.3f, -2179.566f, -154683.641f, 26216.4883f, -27476.0156f, -17606.1328f, 35802.043f, 62706.7773f); + TestUtils.AreEqual(r2, a2 * b2); + + float4x3 a3 = float4x3(-330.408142f, 469.460144f, 342.2951f, -504.114655f, 319.3573f, -357.782074f, -117.9711f, 25.706543f, 226.456421f, -86.34372f, -274.126038f, -486.870972f); + float4x3 b3 = float4x3(375.320618f, 203.212646f, 77.66797f, 218.793579f, -489.895752f, 134.472168f, -287.794373f, -116.399994f, -436.543976f, 499.591064f, -300.602356f, 105.730469f); + float4x3 r3 = float4x3(-124008.984f, 95400.24f, 26585.3652f, -110297.047f, -156451.781f, -48111.73f, 33951.418f, -2992.24146f, -98858.19f, -43136.55f, 82402.93f, -51477.0977f); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void float4x3_operator_mul_wide_scalar() + { + float4x3 a0 = float4x3(-96.31882f, -277.142273f, -239.93689f, 509.531433f, 255.8581f, 215.7315f, -455.50827f, -389.2433f, -338.29248f, 53.7962646f, 243.757324f, 135.354675f); + float b0 = (-301.2072f); + float4x3 r0 = float4x3(29011.9219f, 83477.25f, 72270.72f, -153474.547f, -77066.3047f, -64979.8867f, 137202.375f, 117242.883f, 101896.133f, -16203.8232f, -73421.46f, -40769.8047f); + TestUtils.AreEqual(r0, a0 * b0); + + float4x3 a1 = float4x3(-207.3501f, -31.4252319f, 42.6761475f, 260.38385f, 176.867554f, 25.67212f, -290.5006f, 207.091f, -156.523315f, -208.402008f, 370.945068f, -341.59845f); + float b1 = (-383.9396f); + float4x3 r1 = float4x3(79609.9141f, 12065.3916f, -16385.0625f, -99971.67f, -67906.46f, -9856.543f, 111534.688f, -79510.44f, 60095.5f, 80013.78f, -142420.5f, 131153.172f); + TestUtils.AreEqual(r1, a1 * b1); + + float4x3 a2 = float4x3(10.2703247f, -61.0061035f, 186.279785f, -487.652222f, -129.376831f, -317.7163f, -207.62735f, 388.8714f, -233.335327f, 128.415527f, 510.389526f, 267.576355f); + float b2 = (-176.888763f); + float4x3 r2 = float4x3(-1816.70508f, 10791.2939f, -32950.8f, 86260.1953f, 22885.3086f, 56200.4453f, 36726.9453f, -68786.9844f, 41274.4f, -22715.2637f, -90282.17f, -47331.25f); + TestUtils.AreEqual(r2, a2 * b2); + + float4x3 a3 = float4x3(-309.209656f, -189.569519f, 233.209229f, -331.086975f, -98.6447754f, -214.181f, -87.88077f, -493.165741f, -407.306061f, -411.3714f, 477.935669f, 364.748535f); + float b3 = (-36.48297f); + float4x3 r3 = float4x3(11280.8867f, 6916.059f, -8508.166f, 12079.0361f, 3598.85449f, 7813.95947f, 3206.15161f, 17992.1523f, 14859.7354f, 15008.0508f, -17436.5137f, -13307.11f); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void float4x3_operator_mul_scalar_wide() + { + float a0 = (37.43219f); + float4x3 b0 = float4x3(96.74756f, 492.185364f, -274.054565f, -452.870972f, 420.853333f, 102.182922f, -114.948883f, -351.120056f, -464.664978f, 444.084839f, 447.1053f, 130.829346f); + float4x3 r0 = float4x3(3621.473f, 18423.5762f, -10258.4629f, -16951.9531f, 15753.4619f, 3824.93066f, -4302.78857f, -13143.1924f, -17393.4277f, 16623.0684f, 16736.13f, 4897.229f); + TestUtils.AreEqual(r0, a0 * b0); + + float a1 = (-321.41333f); + float4x3 b1 = float4x3(445.301331f, 478.2436f, 358.571716f, -144.8901f, -438.893829f, -3.536438f, -471.807556f, -42.5603943f, 119.911072f, 271.900024f, 239.684021f, 487.4414f); + float4x3 r1 = float4x3(-143125.781f, -153713.859f, -115249.727f, 46569.6133f, 141066.328f, 1136.65833f, 151645.234f, 13679.4785f, -38541.0156f, -87392.29f, -77037.64f, -156670.172f); + TestUtils.AreEqual(r1, a1 * b1); + + float a2 = (-79.18829f); + float4x3 b2 = float4x3(-112.925659f, 161.370056f, 459.759155f, -337.195984f, -276.834534f, 469.723877f, -274.565155f, 506.7859f, 65.88257f, 495.855652f, -347.2796f, -343.606049f); + float4x3 r2 = float4x3(8942.391f, -12778.6191f, -36407.543f, 26701.9746f, 21922.0547f, -37196.6328f, 21742.3457f, -40131.5078f, -5217.128f, -39265.96f, 27500.4785f, 27209.5762f); + TestUtils.AreEqual(r2, a2 * b2); + + float a3 = (-183.7038f); + float4x3 b3 = float4x3(460.264771f, 437.513245f, -324.557251f, -112.287781f, 273.135437f, -283.093658f, 1.880249f, -310.8167f, 326.0122f, 243.64325f, 78.17932f, -308.664f); + float4x3 r3 = float4x3(-84552.38f, -80372.84f, 59622.4f, 20627.6914f, -50176.0156f, 52005.38f, -345.408875f, 57098.21f, -59889.68f, -44758.19f, -14361.8379f, 56702.75f); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void float4x3_operator_div_wide_wide() + { + float4x3 a0 = float4x3(-353.131439f, -102.799866f, 51.3191528f, -191.871674f, 8.041809f, -128.73764f, -136.0596f, -370.471f, -237.69455f, -432.546875f, 200.2655f, 361.4416f); + float4x3 b0 = float4x3(-178.739563f, -302.096283f, -199.405823f, 278.850769f, 502.3376f, -361.484833f, 353.121033f, -38.894928f, -75.76474f, -195.217834f, -405.034f, -394.23f); + float4x3 r0 = float4x3(1.97567582f, 0.34028843f, -0.257360339f, -0.688080132f, 0.0160087738f, 0.356135666f, -0.385305852f, 9.524919f, 3.1372714f, 2.215714f, -0.4944412f, -0.9168292f); + TestUtils.AreEqual(r0, a0 / b0); + + float4x3 a1 = float4x3(-416.226135f, -450.0192f, -273.497437f, -286.908173f, -314.256042f, 177.762085f, 97.6270142f, -68.10727f, -386.450745f, 263.699341f, -297.0271f, -501.777039f); + float4x3 b1 = float4x3(-375.8277f, -121.245483f, 447.623352f, 338.286255f, -405.5442f, -431.168945f, 296.205139f, 437.939819f, 39.2106323f, 331.289734f, -310.619568f, 207.26947f); + float4x3 r1 = float4x3(1.107492f, 3.71163678f, -0.610999048f, -0.8481225f, 0.7748996f, -0.412279427f, 0.3295926f, -0.155517414f, -9.855764f, 0.795978f, 0.9562408f, -2.42089224f); + TestUtils.AreEqual(r1, a1 / b1); + + float4x3 a2 = float4x3(-263.40686f, -451.080841f, -416.34552f, -315.278748f, -28.1811218f, -397.870148f, -261.386658f, 40.3482056f, 277.245728f, 464.77124f, -336.641052f, 375.4781f); + float4x3 b2 = float4x3(-223.293f, -480.0914f, 448.675964f, -460.097443f, -220.569855f, -84.85315f, 441.373779f, 72.41846f, 44.9760742f, -242.515381f, -451.302063f, -21.8996887f); + float4x3 r2 = float4x3(1.17964673f, 0.9395729f, -0.9279426f, 0.6852434f, 0.127765059f, 4.688926f, -0.592211545f, 0.557153642f, 6.164294f, -1.91646087f, 0.7459329f, -17.14536f); + TestUtils.AreEqual(r2, a2 / b2); + + float4x3 a3 = float4x3(504.342529f, -320.7671f, -156.733337f, 414.797058f, -386.0507f, -369.838623f, 386.704224f, 242.631836f, 421.7345f, 109.012207f, 182.075256f, 187.326416f); + float4x3 b3 = float4x3(-358.486664f, -350.945129f, -481.848145f, 406.393433f, -145.288666f, 461.795532f, -318.816772f, -250.932f, 125.859558f, -193.803162f, -495.25412f, -315.824554f); + float4x3 r3 = float4x3(-1.40686548f, 0.9140092f, 0.3252754f, 1.02067852f, 2.65712881f, -0.800870955f, -1.21293569f, -0.966922641f, 3.35083413f, -0.562489331f, -0.367640078f, -0.5931344f); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void float4x3_operator_div_wide_scalar() + { + float4x3 a0 = float4x3(171.3424f, 0.103393555f, 57.8882446f, -256.130737f, 95.66968f, -290.3869f, -127.4487f, -79.7449f, 146.466858f, -499.843567f, 58.68634f, -453.2058f); + float b0 = (171.796814f); + float4x3 r0 = float4x3(0.997355f, 0.000601836247f, 0.3369576f, -1.49089336f, 0.5568769f, -1.69029272f, -0.7418572f, -0.4641815f, 0.8525586f, -2.90950418f, 0.3416032f, -2.63803387f); + TestUtils.AreEqual(r0, a0 / b0); + + float4x3 a1 = float4x3(-205.033813f, 464.479065f, -293.4635f, -158.505585f, -289.5822f, 494.1286f, 203.583435f, 180.9704f, 259.1192f, 460.844727f, 490.956238f, -280.478058f); + float b1 = (481.738159f); + float4x3 r1 = float4x3(-0.425612569f, 0.9641733f, -0.609176338f, -0.3290285f, -0.6011195f, 1.02572024f, 0.422601849f, 0.375661343f, 0.5378839f, 0.9566291f, 1.019135f, -0.582221f); + TestUtils.AreEqual(r1, a1 / b1); + + float4x3 a2 = float4x3(-320.243866f, 264.800842f, 226.852966f, -192.235687f, 460.9765f, -437.8922f, -413.232727f, 249.471863f, 313.035034f, 216.785583f, 383.7389f, 82.0233154f); + float b2 = (192.41449f); + float4x3 r2 = float4x3(-1.66434383f, 1.37620008f, 1.17898071f, -0.999070764f, 2.39574742f, -2.27577567f, -2.14761758f, 1.2965337f, 1.62687874f, 1.12665939f, 1.9943347f, 0.4262845f); + TestUtils.AreEqual(r2, a2 / b2); + + float4x3 a3 = float4x3(189.574646f, -391.92218f, 121.280579f, 417.901733f, -133.262878f, -428.7424f, -188.531891f, 356.259521f, 181.969f, -140.890472f, 474.082642f, -451.357727f); + float b3 = (314.503845f); + float4x3 r3 = float4x3(0.6027737f, -1.24616027f, 0.3856251f, 1.32876515f, -0.423724174f, -1.36323416f, -0.599458158f, 1.13276684f, 0.5785907f, -0.447976947f, 1.50739861f, -1.43514216f); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void float4x3_operator_div_scalar_wide() + { + float a0 = (-264.4425f); + float4x3 b0 = float4x3(105.589111f, -142.349091f, -288.9489f, 39.644104f, -363.9914f, -149.718231f, -395.729126f, 258.7187f, -9.66626f, 117.725525f, -331.386536f, -509.986023f); + float4x3 r0 = float4x3(-2.50444865f, 1.85770416f, 0.9151877f, -6.670412f, 0.7265076f, 1.7662679f, 0.6682412f, -1.02212369f, 27.3572731f, -2.246263f, 0.797988057f, 0.518528938f); + TestUtils.AreEqual(r0, a0 / b0); + + float a1 = (427.896484f); + float4x3 b1 = float4x3(467.617126f, -407.124634f, 252.690735f, 444.599365f, -88.31329f, 199.955017f, -218.346924f, -13.4171753f, -296.131073f, 0.561340332f, -289.299316f, 196.218323f); + float4x3 r1 = float4x3(0.915057361f, -1.05102086f, 1.69336045f, 0.9624316f, -4.84521055f, 2.13996363f, -1.95970929f, -31.8916969f, -1.44495642f, 762.276367f, -1.47907877f, 2.18071628f); + TestUtils.AreEqual(r1, a1 / b1); + + float a2 = (334.733459f); + float4x3 b2 = float4x3(-282.392731f, -479.5036f, -473.439453f, 105.050781f, -287.6313f, 77.29932f, -210.894379f, -184.068237f, -315.148438f, 87.86688f, 101.590515f, 345.9364f); + float4x3 r2 = float4x3(-1.18534732f, -0.6980833f, -0.7070249f, 3.1863966f, -1.16375887f, 4.33035469f, -1.587209f, -1.81852913f, -1.06214535f, 3.809552f, 3.29492831f, 0.9676156f); + TestUtils.AreEqual(r2, a2 / b2); + + float a3 = (-146.318115f); + float4x3 b3 = float4x3(479.999939f, -172.67688f, -178.013641f, 361.760437f, 349.376953f, -398.686127f, -243.78f, 296.622925f, 477.810669f, 486.600342f, 256.917236f, -89.86423f); + float4x3 r3 = float4x3(-0.304829448f, 0.8473521f, 0.8219489f, -0.404461354f, -0.418797284f, 0.367000759f, 0.6002056f, -0.493279874f, -0.306226134f, -0.300694644f, -0.5695146f, 1.62821317f); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void float4x3_operator_mod_wide_wide() + { + float4x3 a0 = float4x3(-388.8125f, 181.681213f, -167.078735f, 432.820129f, -258.438965f, -170.110809f, 283.3183f, 122.716492f, 335.271f, -503.608521f, 191.022522f, 289.742676f); + float4x3 b0 = float4x3(436.944153f, 58.9400635f, -201.116241f, 279.289368f, -397.079773f, 377.899963f, 174.693848f, -228.176514f, -317.060181f, -417.4801f, -249.975952f, -397.571564f); + float4x3 r0 = float4x3(-388.8125f, 4.861023f, -167.078735f, 153.530762f, -258.438965f, -170.110809f, 108.624451f, 122.716492f, 18.2108154f, -86.12842f, 191.022522f, 289.742676f); + TestUtils.AreEqual(r0, a0 % b0); + + float4x3 a1 = float4x3(-124.033722f, 259.274f, -274.358459f, -140.030792f, 324.577576f, -200.513092f, 211.423157f, -51.2722168f, -230.633911f, 99.98938f, 399.18988f, 24.90326f); + float4x3 b1 = float4x3(-358.745453f, -198.15921f, 208.737122f, -12.1194153f, 25.2714233f, -194.1207f, -493.8718f, -312.3017f, -216.980591f, 413.570984f, -436.3944f, 3.491272f); + float4x3 r1 = float4x3(-124.033722f, 61.1147766f, -65.62134f, -6.717224f, 21.3204956f, -6.392395f, 211.423157f, -51.2722168f, -13.65332f, 99.98938f, 399.18988f, 0.464355469f); + TestUtils.AreEqual(r1, a1 % b1); + + float4x3 a2 = float4x3(50.92401f, -364.863678f, -252.626617f, -281.2898f, -364.798523f, -329.026245f, 51.6098022f, 41.6478271f, 254.95105f, -458.6776f, -136.79303f, 72.40033f); + float4x3 b2 = float4x3(-308.233429f, -441.375061f, 84.60083f, 373.163452f, 67.25275f, -320.333282f, 118.97937f, 44.8239746f, 354.0086f, -253.953125f, -195.162811f, 317.142822f); + float4x3 r2 = float4x3(50.92401f, -364.863678f, -83.42496f, -281.2898f, -28.53479f, -8.692963f, 51.6098022f, 41.6478271f, 254.95105f, -204.724487f, -136.79303f, 72.40033f); + TestUtils.AreEqual(r2, a2 % b2); + + float4x3 a3 = float4x3(246.212036f, 325.1538f, 162.034668f, -284.761444f, 128.351257f, 262.916748f, 61.60077f, -271.4928f, -205.438812f, -341.322144f, 347.154419f, 148.0885f); + float4x3 b3 = float4x3(320.693176f, -103.996887f, 388.171753f, -199.639313f, -256.217316f, -478.125031f, -210.655731f, -272.0233f, -61.6765442f, -367.8296f, -242.938934f, 162.386719f); + float4x3 r3 = float4x3(246.212036f, 13.163147f, 162.034668f, -85.12213f, 128.351257f, 262.916748f, 61.60077f, -271.4928f, -20.40918f, -341.322144f, 104.215485f, 148.0885f); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void float4x3_operator_mod_wide_scalar() + { + float4x3 a0 = float4x3(-244.499634f, -211.8193f, -145.926788f, -304.9182f, 155.479492f, -133.907776f, 281.309631f, -226.535767f, 335.166138f, 101.706482f, 319.4715f, -285.4023f); + float b0 = (39.63495f); + float4x3 r0 = float4x3(-6.68994141f, -13.6445618f, -27.0219421f, -27.4735718f, 36.574646f, -15.00293f, 3.86499023f, -28.3610229f, 18.0865479f, 22.4365845f, 2.39190674f, -7.957672f); + TestUtils.AreEqual(r0, a0 % b0); + + float4x3 a1 = float4x3(-355.846863f, -330.871948f, -284.343567f, -102.683441f, -172.141754f, 206.41687f, -416.713654f, -339.256653f, 435.2975f, 132.552917f, 226.944092f, -306.1183f); + float b1 = (259.378f); + float4x3 r1 = float4x3(-96.46887f, -71.49396f, -24.9655762f, -102.683441f, -172.141754f, 206.41687f, -157.335663f, -79.87866f, 175.9195f, 132.552917f, 226.944092f, -46.7402954f); + TestUtils.AreEqual(r1, a1 % b1); + + float4x3 a2 = float4x3(115.438477f, -218.347443f, -140.0405f, -462.3235f, -211.6087f, 351.331055f, 321.047f, 346.0852f, -94.4077454f, 465.40918f, -367.197021f, -467.5106f); + float b2 = (281.882935f); + float4x3 r2 = float4x3(115.438477f, -218.347443f, -140.0405f, -180.440552f, -211.6087f, 69.44812f, 39.1640625f, 64.20227f, -94.4077454f, 183.526245f, -85.31409f, -185.627655f); + TestUtils.AreEqual(r2, a2 % b2); + + float4x3 a3 = float4x3(415.2151f, -3.729828f, 128.249878f, 134.941589f, 247.616943f, -285.287872f, 433.766663f, -141.831024f, -229.781891f, 471.218018f, 377.681458f, 433.4076f); + float b3 = (506.186157f); + float4x3 r3 = float4x3(415.2151f, -3.729828f, 128.249878f, 134.941589f, 247.616943f, -285.287872f, 433.766663f, -141.831024f, -229.781891f, 471.218018f, 377.681458f, 433.4076f); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void float4x3_operator_mod_scalar_wide() + { + float a0 = (-66.94504f); + float4x3 b0 = float4x3(-249.7761f, -396.073761f, 386.492065f, 168.939453f, -199.418243f, 261.7517f, 16.1274414f, 257.668152f, -75.78845f, 170.9563f, -242.858276f, 425.9453f); + float4x3 r0 = float4x3(-66.94504f, -66.94504f, -66.94504f, -66.94504f, -66.94504f, -66.94504f, -2.43527222f, -66.94504f, -66.94504f, -66.94504f, -66.94504f, -66.94504f); + TestUtils.AreEqual(r0, a0 % b0); + + float a1 = (303.2724f); + float4x3 b1 = float4x3(3.033081f, -505.74353f, 461.957031f, 205.972778f, 270.040649f, -47.4807129f, -150.254486f, 149.499512f, -220.298035f, 31.1188354f, 400.635681f, 6.23144531f); + float4x3 r1 = float4x3(2.99737549f, 303.2724f, 303.2724f, 97.29962f, 33.23175f, 18.3881226f, 2.76342773f, 4.27337646f, 82.9743652f, 23.20288f, 303.2724f, 4.163025f); + TestUtils.AreEqual(r1, a1 % b1); + + float a2 = (-39.05075f); + float4x3 b2 = float4x3(-71.9411f, -495.307129f, -86.7196045f, -436.970062f, -472.294739f, -130.008759f, -251.516846f, 281.976379f, 388.86084f, 50.6152954f, 293.87085f, 123.744263f); + float4x3 r2 = float4x3(-39.05075f, -39.05075f, -39.05075f, -39.05075f, -39.05075f, -39.05075f, -39.05075f, -39.05075f, -39.05075f, -39.05075f, -39.05075f, -39.05075f); + TestUtils.AreEqual(r2, a2 % b2); + + float a3 = (422.904358f); + float4x3 b3 = float4x3(-53.87619f, -178.857666f, -362.27594f, 361.085266f, 465.276123f, -269.889648f, -159.408966f, -29.0952148f, 484.499451f, -354.950623f, -328.6906f, -171.739227f); + float4x3 r3 = float4x3(45.7710266f, 65.1890259f, 60.628418f, 61.81909f, 422.904358f, 153.014709f, 104.086426f, 15.57135f, 422.904358f, 67.9537354f, 94.2137451f, 79.4259f); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void float4x3_operator_plus() + { + float4x3 a0 = float4x3(-418.829559f, -405.79895f, -34.04178f, 236.999268f, -459.8391f, 210.86145f, 293.742f, -373.015442f, -386.059845f, 4.95440674f, -418.645264f, 504.474854f); + float4x3 r0 = float4x3(-418.829559f, -405.79895f, -34.04178f, 236.999268f, -459.8391f, 210.86145f, 293.742f, -373.015442f, -386.059845f, 4.95440674f, -418.645264f, 504.474854f); + TestUtils.AreEqual(r0, +a0); + + float4x3 a1 = float4x3(-170.746521f, -478.7494f, 116.400757f, 421.409668f, -258.596069f, 447.8661f, 124.164368f, 222.172546f, -65.94928f, 239.041809f, 498.449524f, -139.382538f); + float4x3 r1 = float4x3(-170.746521f, -478.7494f, 116.400757f, 421.409668f, -258.596069f, 447.8661f, 124.164368f, 222.172546f, -65.94928f, 239.041809f, 498.449524f, -139.382538f); + TestUtils.AreEqual(r1, +a1); + + float4x3 a2 = float4x3(279.072937f, 37.9992065f, 136.812134f, -236.030029f, -440.308319f, 342.2791f, 102.472229f, -161.454834f, -355.270874f, 141.314331f, 239.320862f, -494.6041f); + float4x3 r2 = float4x3(279.072937f, 37.9992065f, 136.812134f, -236.030029f, -440.308319f, 342.2791f, 102.472229f, -161.454834f, -355.270874f, 141.314331f, 239.320862f, -494.6041f); + TestUtils.AreEqual(r2, +a2); + + float4x3 a3 = float4x3(361.59198f, 141.712524f, 25.2562866f, -268.2269f, 106.774658f, 176.744385f, 104.119934f, 144.618591f, 289.4519f, -393.0167f, -198.95575f, -419.009216f); + float4x3 r3 = float4x3(361.59198f, 141.712524f, 25.2562866f, -268.2269f, 106.774658f, 176.744385f, 104.119934f, 144.618591f, 289.4519f, -393.0167f, -198.95575f, -419.009216f); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void float4x3_operator_neg() + { + float4x3 a0 = float4x3(148.461731f, -467.122681f, 132.04718f, 183.522644f, 473.701f, -407.9911f, -54.95877f, -382.9898f, -299.093384f, -383.014069f, 407.709778f, 168.735474f); + float4x3 r0 = float4x3(-148.461731f, 467.122681f, -132.04718f, -183.522644f, -473.701f, 407.9911f, 54.95877f, 382.9898f, 299.093384f, 383.014069f, -407.709778f, -168.735474f); + TestUtils.AreEqual(r0, -a0); + + float4x3 a1 = float4x3(466.441528f, -280.558319f, -78.857605f, 318.69635f, -39.9154053f, 140.340027f, 132.195618f, -505.895264f, 410.380554f, -237.056946f, -137.617828f, -245.349976f); + float4x3 r1 = float4x3(-466.441528f, 280.558319f, 78.857605f, -318.69635f, 39.9154053f, -140.340027f, -132.195618f, 505.895264f, -410.380554f, 237.056946f, 137.617828f, 245.349976f); + TestUtils.AreEqual(r1, -a1); + + float4x3 a2 = float4x3(422.521362f, 60.22223f, -466.5663f, 426.894531f, 146.649536f, -391.37207f, 423.237732f, 254.297546f, -114.848907f, 108.059692f, -507.9763f, -306.245728f); + float4x3 r2 = float4x3(-422.521362f, -60.22223f, 466.5663f, -426.894531f, -146.649536f, 391.37207f, -423.237732f, -254.297546f, 114.848907f, -108.059692f, 507.9763f, 306.245728f); + TestUtils.AreEqual(r2, -a2); + + float4x3 a3 = float4x3(219.66626f, -98.76068f, 492.111084f, 84.04584f, 300.976624f, -483.864624f, -389.15744f, -324.6861f, 378.85437f, 190.219238f, -69.10242f, 507.495361f); + float4x3 r3 = float4x3(-219.66626f, 98.76068f, -492.111084f, -84.04584f, -300.976624f, 483.864624f, 389.15744f, 324.6861f, -378.85437f, -190.219238f, 69.10242f, -507.495361f); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void float4x3_operator_prefix_inc() + { + float4x3 a0 = float4x3(-139.842072f, -56.7436523f, -381.955322f, 509.796326f, -222.896332f, 210.319885f, -392.7315f, -300.1941f, 362.212769f, 401.6148f, 130.90918f, -450.230164f); + float4x3 r0 = float4x3(-138.842072f, -55.7436523f, -380.955322f, 510.796326f, -221.896332f, 211.319885f, -391.7315f, -299.1941f, 363.212769f, 402.6148f, 131.90918f, -449.230164f); + TestUtils.AreEqual(r0, ++a0); + + float4x3 a1 = float4x3(243.546936f, -41.4972839f, 299.1855f, 154.356567f, -281.233276f, 200.706f, 92.95776f, 448.602173f, -295.587f, 18.4990845f, -215.711121f, 471.947266f); + float4x3 r1 = float4x3(244.546936f, -40.4972839f, 300.1855f, 155.356567f, -280.233276f, 201.706f, 93.95776f, 449.602173f, -294.587f, 19.4990845f, -214.711121f, 472.947266f); + TestUtils.AreEqual(r1, ++a1); + + float4x3 a2 = float4x3(257.0766f, 4.82543945f, 243.004761f, -472.619019f, -125.720215f, -477.459564f, 9.89147949f, -76.92285f, -29.7675781f, -387.177429f, 461.7093f, 13.699707f); + float4x3 r2 = float4x3(258.0766f, 5.82543945f, 244.004761f, -471.619019f, -124.720215f, -476.459564f, 10.8914795f, -75.92285f, -28.7675781f, -386.177429f, 462.7093f, 14.699707f); + TestUtils.AreEqual(r2, ++a2); + + float4x3 a3 = float4x3(-46.303772f, -222.2291f, 340.8178f, 399.741272f, -311.372345f, 300.177979f, -272.7783f, 351.019165f, 436.575256f, -137.063324f, 312.579956f, -315.999023f); + float4x3 r3 = float4x3(-45.303772f, -221.2291f, 341.8178f, 400.741272f, -310.372345f, 301.177979f, -271.7783f, 352.019165f, 437.575256f, -136.063324f, 313.579956f, -314.999023f); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void float4x3_operator_postfix_inc() + { + float4x3 a0 = float4x3(-396.669739f, 511.20752f, 249.111267f, -128.817322f, -259.4903f, 278.008179f, -81.39343f, 66.71973f, 167.852112f, 147.94397f, -326.1076f, 41.03357f); + float4x3 r0 = float4x3(-396.669739f, 511.20752f, 249.111267f, -128.817322f, -259.4903f, 278.008179f, -81.39343f, 66.71973f, 167.852112f, 147.94397f, -326.1076f, 41.03357f); + TestUtils.AreEqual(r0, a0++); + + float4x3 a1 = float4x3(128.5304f, -60.1323853f, -446.229767f, -296.937836f, 267.293823f, 446.2293f, 49.2001953f, -326.643127f, -510.864227f, 471.647461f, -171.013092f, 310.727356f); + float4x3 r1 = float4x3(128.5304f, -60.1323853f, -446.229767f, -296.937836f, 267.293823f, 446.2293f, 49.2001953f, -326.643127f, -510.864227f, 471.647461f, -171.013092f, 310.727356f); + TestUtils.AreEqual(r1, a1++); + + float4x3 a2 = float4x3(-298.917175f, 184.603455f, 290.69104f, 117.192322f, 164.442932f, 412.3678f, -229.386566f, 239.596924f, 36.62433f, -80.70819f, -391.0335f, -478.227142f); + float4x3 r2 = float4x3(-298.917175f, 184.603455f, 290.69104f, 117.192322f, 164.442932f, 412.3678f, -229.386566f, 239.596924f, 36.62433f, -80.70819f, -391.0335f, -478.227142f); + TestUtils.AreEqual(r2, a2++); + + float4x3 a3 = float4x3(166.860474f, -389.396667f, -52.13214f, 35.75531f, 356.052124f, 6.52948f, -285.349823f, 418.016479f, 47.1428833f, 31.4516f, 148.9469f, -219.800385f); + float4x3 r3 = float4x3(166.860474f, -389.396667f, -52.13214f, 35.75531f, 356.052124f, 6.52948f, -285.349823f, 418.016479f, 47.1428833f, 31.4516f, 148.9469f, -219.800385f); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void float4x3_operator_prefix_dec() + { + float4x3 a0 = float4x3(123.128723f, 256.84375f, 156.330811f, 461.737427f, 325.867981f, 392.015625f, 187.874146f, -236.225189f, 125.109619f, 469.844727f, 45.5366821f, 376.046875f); + float4x3 r0 = float4x3(122.128723f, 255.84375f, 155.330811f, 460.737427f, 324.867981f, 391.015625f, 186.874146f, -237.225189f, 124.109619f, 468.844727f, 44.5366821f, 375.046875f); + TestUtils.AreEqual(r0, --a0); + + float4x3 a1 = float4x3(-363.0755f, 248.7901f, 168.095032f, 168.265625f, -190.284729f, 166.945557f, 183.957947f, 485.6947f, -460.739319f, 89.5698853f, -267.4298f, 201.756226f); + float4x3 r1 = float4x3(-364.0755f, 247.7901f, 167.095032f, 167.265625f, -191.284729f, 165.945557f, 182.957947f, 484.6947f, -461.739319f, 88.5698853f, -268.4298f, 200.756226f); + TestUtils.AreEqual(r1, --a1); + + float4x3 a2 = float4x3(-141.216888f, 197.361755f, -213.544128f, 180.7406f, -128.3125f, 478.045532f, -454.566132f, -386.898346f, 387.857f, -315.110443f, -108.28656f, -286.317017f); + float4x3 r2 = float4x3(-142.216888f, 196.361755f, -214.544128f, 179.7406f, -129.3125f, 477.045532f, -455.566132f, -387.898346f, 386.857f, -316.110443f, -109.28656f, -287.317017f); + TestUtils.AreEqual(r2, --a2); + + float4x3 a3 = float4x3(-375.601563f, 78.27545f, 161.531982f, -346.847961f, -57.54077f, 455.372864f, 444.798157f, 129.820129f, 134.710632f, 61.322998f, -274.543335f, -43.39557f); + float4x3 r3 = float4x3(-376.601563f, 77.27545f, 160.531982f, -347.847961f, -58.54077f, 454.372864f, 443.798157f, 128.820129f, 133.710632f, 60.322998f, -275.543335f, -44.39557f); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void float4x3_operator_postfix_dec() + { + float4x3 a0 = float4x3(379.6883f, 302.692871f, -176.07135f, -291.2527f, 470.567566f, -402.925964f, -63.65515f, 355.2611f, -27.8892212f, -100.761841f, 156.14032f, 479.9452f); + float4x3 r0 = float4x3(379.6883f, 302.692871f, -176.07135f, -291.2527f, 470.567566f, -402.925964f, -63.65515f, 355.2611f, -27.8892212f, -100.761841f, 156.14032f, 479.9452f); + TestUtils.AreEqual(r0, a0--); + + float4x3 a1 = float4x3(-200.304291f, 407.420349f, 327.670349f, 48.06018f, -209.667969f, -38.43506f, 283.9416f, -94.80209f, 152.510681f, -287.2625f, -215.948029f, -407.046356f); + float4x3 r1 = float4x3(-200.304291f, 407.420349f, 327.670349f, 48.06018f, -209.667969f, -38.43506f, 283.9416f, -94.80209f, 152.510681f, -287.2625f, -215.948029f, -407.046356f); + TestUtils.AreEqual(r1, a1--); + + float4x3 a2 = float4x3(159.233582f, 168.41394f, -278.933777f, 289.912842f, 402.039551f, 470.716553f, -208.560608f, 145.896729f, -296.790955f, -274.570831f, -250.04126f, -70.85629f); + float4x3 r2 = float4x3(159.233582f, 168.41394f, -278.933777f, 289.912842f, 402.039551f, 470.716553f, -208.560608f, 145.896729f, -296.790955f, -274.570831f, -250.04126f, -70.85629f); + TestUtils.AreEqual(r2, a2--); + + float4x3 a3 = float4x3(-485.627838f, -503.192078f, 397.648621f, 446.621582f, -292.81012f, 126.6225f, -250.442413f, 470.816467f, 26.9436035f, -186.923523f, 45.7460938f, -206.455963f); + float4x3 r3 = float4x3(-485.627838f, -503.192078f, 397.648621f, 446.621582f, -292.81012f, 126.6225f, -250.442413f, 470.816467f, 26.9436035f, -186.923523f, 45.7460938f, -206.455963f); + TestUtils.AreEqual(r3, a3--); + } + + [TestCase /* For player builds */] + public static void float4x3_EqualsObjectOverride() + { + TestUtils.IsFalse(new float4x3().Equals((object)new int())); + TestUtils.IsTrue(new float4x3().Equals((object)new float4x3())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestFloat4x3.gen.cs.meta b/src/Tests/Tests/Shared/TestFloat4x3.gen.cs.meta new file mode 100644 index 00000000..60f17546 --- /dev/null +++ b/src/Tests/Tests/Shared/TestFloat4x3.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d5d74a51bcf6045408a569332921009f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestFloat4x4.gen.cs b/src/Tests/Tests/Shared/TestFloat4x4.gen.cs new file mode 100644 index 00000000..1e706448 --- /dev/null +++ b/src/Tests/Tests/Shared/TestFloat4x4.gen.cs @@ -0,0 +1,981 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestFloat4x4 + { + [TestCompiler] + public static void float4x4_zero() + { + TestUtils.AreEqual(0.0f, float4x4.zero.c0.x); + TestUtils.AreEqual(0.0f, float4x4.zero.c0.y); + TestUtils.AreEqual(0.0f, float4x4.zero.c0.z); + TestUtils.AreEqual(0.0f, float4x4.zero.c0.w); + TestUtils.AreEqual(0.0f, float4x4.zero.c1.x); + TestUtils.AreEqual(0.0f, float4x4.zero.c1.y); + TestUtils.AreEqual(0.0f, float4x4.zero.c1.z); + TestUtils.AreEqual(0.0f, float4x4.zero.c1.w); + TestUtils.AreEqual(0.0f, float4x4.zero.c2.x); + TestUtils.AreEqual(0.0f, float4x4.zero.c2.y); + TestUtils.AreEqual(0.0f, float4x4.zero.c2.z); + TestUtils.AreEqual(0.0f, float4x4.zero.c2.w); + TestUtils.AreEqual(0.0f, float4x4.zero.c3.x); + TestUtils.AreEqual(0.0f, float4x4.zero.c3.y); + TestUtils.AreEqual(0.0f, float4x4.zero.c3.z); + TestUtils.AreEqual(0.0f, float4x4.zero.c3.w); + } + + [TestCompiler] + public static void float4x4_identity() + { + TestUtils.AreEqual(1.0f, float4x4.identity.c0.x); + TestUtils.AreEqual(0.0f, float4x4.identity.c0.y); + TestUtils.AreEqual(0.0f, float4x4.identity.c0.z); + TestUtils.AreEqual(0.0f, float4x4.identity.c0.w); + TestUtils.AreEqual(0.0f, float4x4.identity.c1.x); + TestUtils.AreEqual(1.0f, float4x4.identity.c1.y); + TestUtils.AreEqual(0.0f, float4x4.identity.c1.z); + TestUtils.AreEqual(0.0f, float4x4.identity.c1.w); + TestUtils.AreEqual(0.0f, float4x4.identity.c2.x); + TestUtils.AreEqual(0.0f, float4x4.identity.c2.y); + TestUtils.AreEqual(1.0f, float4x4.identity.c2.z); + TestUtils.AreEqual(0.0f, float4x4.identity.c2.w); + TestUtils.AreEqual(0.0f, float4x4.identity.c3.x); + TestUtils.AreEqual(0.0f, float4x4.identity.c3.y); + TestUtils.AreEqual(0.0f, float4x4.identity.c3.z); + TestUtils.AreEqual(1.0f, float4x4.identity.c3.w); + } + + [TestCompiler] + public static void float4x4_operator_equal_wide_wide() + { + float4x4 a0 = float4x4(492.1576f, -495.206329f, 227.457642f, -147.374054f, -222.682f, 64.09375f, -23.8904114f, -16.8197327f, 163.232117f, -165.271f, 470.8777f, -423.942566f, 109.6344f, 462.6903f, -335.38147f, 357.2345f); + float4x4 b0 = float4x4(192.568787f, -235.611023f, -254.043121f, -412.624725f, 471.9048f, -6.47277832f, -339.102356f, 488.187561f, -379.5966f, -308.417f, -82.333374f, -102.921082f, 226.515747f, -356.9013f, -362.912781f, -427.898438f); + bool4x4 r0 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + float4x4 a1 = float4x4(1.54559326f, -347.388245f, -114.472168f, 435.848633f, 194.2381f, 138.765564f, -467.349152f, 370.43335f, 476.708252f, 320.552673f, -498.59198f, 92.41693f, 104.511353f, 166.754578f, -204.733429f, 434.756775f); + float4x4 b1 = float4x4(466.650146f, -102.799042f, -43.355957f, 85.0456543f, -91.1270447f, 422.192078f, -477.4313f, 1.87701416f, 312.580078f, 254.599365f, 352.72583f, 62.4909668f, 119.714783f, -511.058075f, -302.472717f, -371.769226f); + bool4x4 r1 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + float4x4 a2 = float4x4(-397.329651f, 503.981628f, -503.7141f, 90.65973f, -303.445251f, 9.34491f, 290.901062f, -147.57193f, 368.082336f, -321.6096f, -171.465424f, -441.306458f, -137.766815f, 304.689575f, 301.889465f, -222.220917f); + float4x4 b2 = float4x4(-20.007843f, 21.4594727f, -426.0207f, -305.411926f, 261.68335f, 50.00476f, -334.134644f, 75.0656738f, -51.186676f, -135.961548f, -409.364868f, 160.819763f, 102.120789f, 277.813049f, 434.906738f, -15.2891846f); + bool4x4 r2 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + float4x4 a3 = float4x4(-13.88382f, 307.521729f, -469.412933f, -6.40887451f, -290.079651f, 46.0445557f, -168.61908f, 283.5899f, -244.713287f, -367.140442f, -492.863129f, 311.696167f, -90.7013855f, -352.773743f, -218.710266f, -95.30136f); + float4x4 b3 = float4x4(-1.46521f, 64.65869f, -163.0261f, 390.728943f, 113.9646f, -248.2753f, -469.587769f, -73.35397f, -420.311066f, 358.453247f, 58.7183228f, -499.964783f, -168.8381f, -93.83493f, 324.84668f, -226.35199f); + bool4x4 r3 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void float4x4_operator_equal_wide_scalar() + { + float4x4 a0 = float4x4(-303.230072f, 451.5263f, -253.655884f, -105.203644f, -500.6911f, -426.192474f, 159.8761f, -59.55838f, -57.4773865f, -182.049744f, 406.513733f, 370.886f, -172.035309f, 455.400024f, -11.3389893f, 363.938232f); + float b0 = (123.544556f); + bool4x4 r0 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + float4x4 a1 = float4x4(-27.1505737f, -290.359039f, 180.196838f, -374.128326f, -439.358948f, -126.546082f, -197.26178f, -227.159332f, -479.8992f, -439.777679f, -495.237335f, -224.517059f, -422.833221f, -450.196259f, -20.10672f, 297.38f); + float b1 = (-325.976074f); + bool4x4 r1 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + float4x4 a2 = float4x4(185.966553f, -220.597046f, -228.686859f, -333.001282f, 434.213f, 406.248718f, -239.869781f, 380.93927f, 90.34949f, -361.327942f, -453.599945f, 157.732483f, -491.0462f, 296.614258f, 482.265137f, -305.876984f); + float b2 = (-102.975983f); + bool4x4 r2 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + float4x4 a3 = float4x4(-290.1021f, -110.528351f, 496.8636f, -441.101746f, 50.9035034f, 66.07239f, 455.6059f, -390.0443f, 491.20813f, -498.4148f, 143.113464f, -347.041321f, -146.644165f, -243.853455f, -85.37955f, -438.494019f); + float b3 = (115.246521f); + bool4x4 r3 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void float4x4_operator_equal_scalar_wide() + { + float a0 = (-253.397278f); + float4x4 b0 = float4x4(19.95221f, -185.791992f, 407.8136f, -87.2767f, -206.274689f, 160.503113f, -274.7708f, -2.63153076f, 448.354553f, -410.035248f, 247.329041f, 355.539124f, -298.0667f, 414.1015f, -481.3026f, 196.55072f); + bool4x4 r0 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + float a1 = (34.6010132f); + float4x4 b1 = float4x4(113.7616f, -386.453369f, -124.49176f, 243.886658f, -492.6182f, 145.424438f, 421.55072f, -95.40997f, 336.809265f, 209.5838f, 487.4414f, 161.806519f, 149.842468f, 225.724f, -71.21881f, 85.78027f); + bool4x4 r1 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + float a2 = (192.547241f); + float4x4 b2 = float4x4(-49.88748f, -229.801971f, -103.407349f, 19.21576f, 492.8811f, 140.403137f, -267.536438f, 125.972717f, 478.0005f, 116.144592f, -368.957764f, -225.028656f, 2.723755f, -452.2632f, 87.45654f, 401.306519f); + bool4x4 r2 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + float a3 = (-18.6455383f); + float4x4 b3 = float4x4(-294.214f, -32.7313538f, -1.25234985f, 14.7160645f, 0.570373535f, 180.783569f, 498.262878f, -503.8667f, -31.0839844f, 462.9193f, -250.21225f, 347.561951f, -213.487946f, -123.759247f, -193.452179f, -242.241089f); + bool4x4 r3 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void float4x4_operator_not_equal_wide_wide() + { + float4x4 a0 = float4x4(430.842529f, 104.69f, 225.802429f, -310.5702f, -418.619446f, 304.128174f, -509.3268f, -160.538086f, -203.301971f, -505.763245f, 162.17218f, 1.156189f, 65.66205f, 102.787781f, 172.930054f, 26.6210327f); + float4x4 b0 = float4x4(210.024719f, -55.20334f, -269.925354f, -234.546722f, 25.91742f, -63.72699f, -484.5537f, -425.3336f, -53.2743835f, 328.1944f, 15.9631348f, 461.7141f, -113.363037f, -240.072968f, 495.119141f, 203.55835f); + bool4x4 r0 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + float4x4 a1 = float4x4(235.125977f, 128.541992f, -354.996979f, 334.3595f, -495.832f, 468.307373f, 458.370972f, 299.937317f, 43.1271973f, -354.7135f, -145.2872f, 390.80188f, -303.13147f, 391.134583f, 139.286865f, 104.523193f); + float4x4 b1 = float4x4(340.493469f, -241.9072f, 459.569824f, 213.07373f, -384.782837f, -255.072327f, 477.663452f, -248.036621f, -407.923462f, -199.788879f, 151.843262f, -97.1206055f, 154.975891f, -172.834534f, 441.5028f, -401.738617f); + bool4x4 r1 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + float4x4 a2 = float4x4(511.2964f, 213.147034f, -101.0957f, 441.6634f, 124.36615f, 312.026428f, 59.65576f, -508.65683f, 98.699646f, 228.799866f, 337.832642f, -163.154449f, 461.6916f, -450.7757f, -443.564758f, -438.213135f); + float4x4 b2 = float4x4(-411.430176f, -337.820282f, -430.6309f, -150.8718f, -206.837f, 34.95508f, -255.771454f, 99.99866f, -161.175568f, 68.8535156f, -285.590118f, -428.717316f, -286.3374f, 2.02709961f, -4.80599976f, -425.3348f); + bool4x4 r2 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + float4x4 a3 = float4x4(22.69397f, -254.368744f, -247.483612f, 365.059082f, -337.586823f, 187.845032f, 351.816833f, 355.223633f, 151.63269f, 240.465881f, -299.297058f, -227.571289f, 263.7243f, -287.511871f, -491.855164f, -219.307037f); + float4x4 b3 = float4x4(358.046021f, 357.8011f, 125.757629f, -38.2419434f, 308.158325f, -450.4502f, -156.1532f, 464.639954f, -220.864044f, -211.537567f, -476.330353f, 284.886536f, 129.86438f, -326.7583f, -72.36374f, -382.827881f); + bool4x4 r3 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void float4x4_operator_not_equal_wide_scalar() + { + float4x4 a0 = float4x4(-16.9145813f, 168.8341f, -462.713531f, 130.307739f, 214.501587f, -440.263275f, -197.12796f, -169.099854f, -386.611176f, -281.021f, -270.26886f, -403.9637f, -269.805725f, 299.654236f, -71.7509155f, -432.755737f); + float b0 = (-145.372772f); + bool4x4 r0 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + float4x4 a1 = float4x4(-457.363129f, 273.873047f, 185.04248f, -482.5307f, 116.395142f, 511.735f, 230.5075f, 100.27478f, 129.682434f, 321.178772f, -220.639f, 140.3352f, 369.212341f, 453.811218f, -333.66626f, -373.937744f); + float b1 = (-13.5195923f); + bool4x4 r1 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + float4x4 a2 = float4x4(150.204285f, 372.32f, -95.83798f, 495.5667f, -5.3855896f, -210.502991f, -459.612732f, 243.309082f, 314.102173f, 96.7449951f, -168.161926f, -71.90546f, 216.608459f, -377.3738f, 142.35498f, -432.272552f); + float b2 = (-442.164764f); + bool4x4 r2 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + float4x4 a3 = float4x4(94.29083f, 337.810547f, -197.6615f, -46.38388f, 250.232056f, 169.099182f, -181.221069f, -481.967f, -427.1808f, -249.442078f, -488.488953f, 202.564941f, -243.823547f, -222.832214f, -448.6026f, 481.974f); + float b3 = (331.653381f); + bool4x4 r3 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void float4x4_operator_not_equal_scalar_wide() + { + float a0 = (275.795837f); + float4x4 b0 = float4x4(-57.1969f, -382.432526f, 97.82037f, -161.463654f, -458.39563f, -499.617859f, 327.92218f, 367.571228f, 59.786377f, -209.580688f, -62.5804443f, -479.974976f, -49.4945068f, -114.685211f, 109.93927f, -176.284821f); + bool4x4 r0 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + float a1 = (-347.4853f); + float4x4 b1 = float4x4(85.5409546f, -356.659546f, -104.243561f, -133.5492f, 243.539734f, 13.1412964f, -379.985962f, -41.28122f, 87.91168f, -339.077271f, -371.820343f, 333.1443f, 294.811951f, -187.14566f, 220.192261f, -228.182068f); + bool4x4 r1 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + float a2 = (-499.723724f); + float4x4 b2 = float4x4(97.40588f, 501.60437f, 459.6754f, 158.098145f, 358.4886f, 243.512573f, 336.702942f, 89.953125f, -65.57837f, -159.260162f, 410.588562f, 123.963013f, -239.625122f, -299.42984f, -491.2919f, 207.71167f); + bool4x4 r2 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + float a3 = (271.5655f); + float4x4 b3 = float4x4(-329.03772f, 461.0074f, -317.160522f, -102.655f, 211.263367f, 116.426147f, -34.1936951f, 391.817566f, -34.307312f, 351.4594f, 187.742554f, -477.573059f, 276.974426f, 489.565f, 229.2273f, 260.2071f); + bool4x4 r3 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void float4x4_operator_less_wide_wide() + { + float4x4 a0 = float4x4(196.84259f, 336.4098f, 251.963745f, 257.655945f, 430.0459f, -62.4196472f, 8.839233f, -333.8167f, 164.678833f, -350.9449f, 3.84143066f, 125.409729f, -111.129944f, 70.00549f, 448.1983f, -419.987122f); + float4x4 b0 = float4x4(-465.345032f, -256.1524f, -314.814026f, 364.5667f, 100.21051f, 182.560974f, 3.11700439f, -259.430481f, -437.3349f, -456.043732f, -394.255981f, 401.9137f, 313.439148f, 121.286682f, -28.0122986f, -282.965881f); + bool4x4 r0 = bool4x4(false, false, false, true, false, true, false, true, false, false, false, true, true, true, false, true); + TestUtils.AreEqual(r0, a0 < b0); + + float4x4 a1 = float4x4(-258.301666f, -34.8322144f, -69.8594055f, 67.76721f, -139.777283f, 385.434631f, 133.7074f, 506.188354f, 34.44287f, 412.1137f, -84.8097839f, 444.785339f, -78.75473f, 366.977539f, 127.180481f, 428.368469f); + float4x4 b1 = float4x4(330.0644f, 124.099365f, -183.6903f, 373.0608f, 109.750916f, -203.57135f, 45.64868f, -360.952271f, 211.913086f, -313.286377f, -259.661072f, 79.09851f, 446.4961f, 450.524536f, -375.630768f, -53.9418335f); + bool4x4 r1 = bool4x4(true, true, false, true, true, false, false, false, true, false, false, false, true, true, false, false); + TestUtils.AreEqual(r1, a1 < b1); + + float4x4 a2 = float4x4(8.197632f, -71.13736f, -474.0508f, 322.4289f, 6.897888f, 195.733582f, -267.6906f, -243.7937f, 319.2508f, -425.1562f, 71.87396f, 313.843872f, 397.279053f, -309.145874f, -38.6678467f, -266.1197f); + float4x4 b2 = float4x4(-291.453735f, 190.774841f, 54.0839233f, -163.63089f, -212.005646f, 406.0905f, -183.018951f, 355.221375f, -81.0422058f, -275.7148f, 405.299255f, -510.6406f, 398.069275f, -4.35549927f, 129.242676f, -276.146545f); + bool4x4 r2 = bool4x4(false, true, true, false, false, true, true, true, false, true, true, false, true, true, true, false); + TestUtils.AreEqual(r2, a2 < b2); + + float4x4 a3 = float4x4(193.3825f, 300.231018f, -395.214f, -398.901428f, 401.4842f, 191.8158f, 56.6053467f, -165.210846f, 178.2898f, -380.726257f, -462.474548f, 386.1842f, -93.29764f, 305.4958f, -148.7702f, 387.037f); + float4x4 b3 = float4x4(-72.6235352f, -86.83887f, -196.586456f, 492.358948f, 63.74463f, -384.804138f, -473.305145f, -407.7358f, -500.243866f, -303.777344f, 192.083252f, 114.898376f, -72.4967651f, -360.120056f, -185.215576f, 389.6552f); + bool4x4 r3 = bool4x4(false, false, true, true, false, false, false, false, false, true, true, false, true, false, false, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void float4x4_operator_less_wide_scalar() + { + float4x4 a0 = float4x4(-132.057312f, -192.465f, -66.8345947f, -379.017517f, -360.2824f, 20.9278564f, -158.240753f, 437.3459f, -20.4526062f, 225.2915f, 307.4842f, 274.015259f, 373.549683f, 398.523682f, 105.030151f, -58.0108948f); + float b0 = (-156.010223f); + bool4x4 r0 = bool4x4(false, true, false, true, true, false, true, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 < b0); + + float4x4 a1 = float4x4(109.670105f, -44.9712524f, 140.426086f, -500.0883f, 172.103333f, -197.500732f, -7.271515f, -432.9905f, 62.1583252f, -72.25473f, -377.852325f, -500.255737f, 149.11499f, 119.880615f, 202.63916f, 274.950684f); + float b1 = (-108.85318f); + bool4x4 r1 = bool4x4(false, false, false, true, false, true, false, true, false, false, true, true, false, false, false, false); + TestUtils.AreEqual(r1, a1 < b1); + + float4x4 a2 = float4x4(66.41205f, -149.6358f, 223.758728f, 73.2668457f, 213.094971f, 322.8595f, 418.3772f, 421.103577f, -187.16684f, 389.109436f, 401.335449f, -106.285065f, 380.607971f, 385.652832f, 120.659851f, -13.8308716f); + float b2 = (274.999451f); + bool4x4 r2 = bool4x4(true, true, true, true, true, false, false, false, true, false, false, true, false, false, true, true); + TestUtils.AreEqual(r2, a2 < b2); + + float4x4 a3 = float4x4(-500.1271f, 431.943665f, 129.688965f, -143.969055f, 183.886414f, -506.964264f, 452.4369f, -458.027f, 89.5592651f, -418.817444f, -292.388428f, 425.601624f, 342.432434f, -406.589142f, -407.155f, 511.064575f); + float b3 = (487.528259f); + bool4x4 r3 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void float4x4_operator_less_scalar_wide() + { + float a0 = (-423.1174f); + float4x4 b0 = float4x4(385.094849f, -123.933472f, 86.37659f, 133.4422f, 161.457947f, 229.754272f, 222.5716f, 315.5312f, -447.203522f, 271.833862f, -393.605316f, 317.486877f, -164.6051f, -282.876038f, 296.979553f, -254.401154f); + bool4x4 r0 = bool4x4(true, true, true, true, true, true, true, true, false, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 < b0); + + float a1 = (365.6156f); + float4x4 b1 = float4x4(-441.984253f, -131.42865f, 442.628967f, -29.7928467f, -138.37381f, 9.21698f, -226.73056f, 171.029419f, 376.625244f, -462.5887f, -142.36731f, -456.253784f, 66.61023f, 169.378784f, 327.4444f, 64.08795f); + bool4x4 r1 = bool4x4(false, false, true, false, false, false, false, false, true, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 < b1); + + float a2 = (-153.5039f); + float4x4 b2 = float4x4(199.380127f, -244.969055f, 472.743835f, -363.7801f, -179.487518f, -83.42514f, 178.886475f, 62.15576f, 409.746765f, -117.163666f, 316.601685f, 285.5163f, 18.6745f, 282.5293f, 132.923767f, -318.215332f); + bool4x4 r2 = bool4x4(true, false, true, false, false, true, true, true, true, true, true, true, true, true, true, false); + TestUtils.AreEqual(r2, a2 < b2); + + float a3 = (314.8399f); + float4x4 b3 = float4x4(78.00372f, 116.839478f, -134.375641f, 118.675415f, 11.4686279f, 378.849548f, -198.892883f, 474.41272f, 296.8327f, 180.343018f, -147.0611f, 259.7849f, -1.81375122f, -409.5449f, -209.049713f, -258.601f); + bool4x4 r3 = bool4x4(false, false, false, false, false, true, false, true, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void float4x4_operator_greater_wide_wide() + { + float4x4 a0 = float4x4(483.5014f, 310.8156f, 106.966187f, 295.7353f, 116.957581f, -478.299774f, -14.8974f, -33.8174438f, -24.74054f, 319.782654f, -120.158569f, -289.008575f, 455.85144f, 144.706909f, 63.9320068f, -285.683044f); + float4x4 b0 = float4x4(-471.398f, -371.9853f, 36.9006958f, -316.7636f, 19.6830444f, 207.309143f, 362.7975f, 324.95343f, 340.948059f, 25.9860229f, -114.211121f, 240.803467f, 273.422424f, 325.515747f, 27.3410645f, 64.47955f); + bool4x4 r0 = bool4x4(true, true, true, true, true, false, false, false, false, true, false, false, true, false, true, false); + TestUtils.AreEqual(r0, a0 > b0); + + float4x4 a1 = float4x4(-502.090729f, -337.194458f, 474.317322f, -507.1451f, -133.565582f, -443.109131f, -464.34137f, -68.36154f, -185.993011f, -157.8039f, -74.12424f, -94.47116f, 329.610535f, -315.836731f, 404.1938f, 131.304382f); + float4x4 b1 = float4x4(200.948364f, 100.122681f, -79.00711f, -315.137939f, -122.985443f, -163.7792f, -492.566f, -90.79727f, -284.901245f, -23.6536865f, 174.93f, 85.7125244f, -441.987823f, 345.543762f, 482.219482f, -422.383484f); + bool4x4 r1 = bool4x4(false, false, true, false, false, false, true, true, true, false, false, false, true, false, false, true); + TestUtils.AreEqual(r1, a1 > b1); + + float4x4 a2 = float4x4(-206.633911f, 197.399841f, 187.991943f, 362.636047f, 336.0932f, -352.448364f, -183.10199f, 193.144836f, -170.216f, -0.491241455f, -326.855042f, -373.39624f, -216.580475f, 282.5121f, -275.170349f, -207.331757f); + float4x4 b2 = float4x4(-30.7792969f, 296.154236f, 378.059875f, -457.733429f, 122.920593f, -509.173126f, 386.77063f, 436.41748f, -276.495819f, -163.166779f, 249.970642f, -165.020752f, 89.09302f, 404.305176f, -340.688843f, -103.785095f); + bool4x4 r2 = bool4x4(false, false, false, true, true, true, false, false, true, true, false, false, false, false, true, false); + TestUtils.AreEqual(r2, a2 > b2); + + float4x4 a3 = float4x4(257.710144f, -469.1453f, -177.965851f, 233.210754f, -135.537323f, 152.253113f, 15.378418f, -243.185455f, -123.13266f, 3.75976563f, -29.2892761f, 416.471558f, -169.383057f, 0.7346802f, -416.4522f, 329.4369f); + float4x4 b3 = float4x4(491.274353f, 78.43793f, 147.484192f, -52.052887f, -212.070465f, 314.9552f, -97.2980347f, 454.8399f, -240.254211f, 168.689636f, -217.528809f, 55.3954468f, -149.5794f, -413.101044f, 470.330933f, 164.782043f); + bool4x4 r3 = bool4x4(false, false, false, true, true, false, true, false, true, false, true, true, false, true, false, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void float4x4_operator_greater_wide_scalar() + { + float4x4 a0 = float4x4(64.31793f, -397.703461f, 431.8769f, 85.703f, 246.263062f, 197.491577f, 286.199463f, 280.813354f, -405.7846f, 171.565369f, -241.807281f, 333.5782f, 370.279175f, -413.7014f, -356.592346f, -353.0313f); + float b0 = (305.859924f); + bool4x4 r0 = bool4x4(false, false, true, false, false, false, false, false, false, false, false, true, true, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + float4x4 a1 = float4x4(396.645325f, -240.013428f, 502.915039f, 315.4676f, -259.2897f, 281.230652f, 428.792175f, 245.153076f, -279.1754f, -453.8631f, -124.771545f, -425.652924f, 99.13287f, 355.060547f, -456.439423f, 154.489014f); + float b1 = (467.222046f); + bool4x4 r1 = bool4x4(false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 > b1); + + float4x4 a2 = float4x4(405.529724f, 186.0863f, 249.999084f, -110.096924f, -435.3045f, 72.7520142f, -254.346558f, -428.987946f, 255.373657f, -309.1123f, 185.501587f, -201.334167f, 23.321167f, -143.9761f, -111.77951f, -356.656616f); + float b2 = (-157.7338f); + bool4x4 r2 = bool4x4(true, true, true, true, false, true, false, false, true, false, true, false, true, true, true, false); + TestUtils.AreEqual(r2, a2 > b2); + + float4x4 a3 = float4x4(-318.313568f, 490.187134f, -305.578979f, 260.850342f, 53.1495972f, -166.934113f, -508.915283f, 352.549927f, 13.4384766f, 139.354675f, -101.028992f, 194.466309f, 7.08258057f, 328.504883f, -297.367859f, -332.910828f); + float b3 = (287.207642f); + bool4x4 r3 = bool4x4(false, true, false, false, false, false, false, true, false, false, false, false, false, true, false, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void float4x4_operator_greater_scalar_wide() + { + float a0 = (-282.6705f); + float4x4 b0 = float4x4(358.099976f, -72.596405f, -232.163788f, -60.7067261f, 75.15662f, 150.883484f, 339.539185f, -498.196045f, 459.7461f, -227.968719f, 335.862122f, 76.17883f, 296.859924f, 177.48999f, -281.2012f, 244.722839f); + bool4x4 r0 = bool4x4(false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + float a1 = (137.328552f); + float4x4 b1 = float4x4(-385.338257f, 443.163452f, -353.562561f, 26.04065f, -331.793945f, -43.6919556f, 20.9494019f, -211.17984f, 227.421692f, -84.7797852f, -375.1355f, -205.178131f, -197.04715f, -219.634033f, -210.015625f, -266.7737f); + bool4x4 r1 = bool4x4(true, false, true, true, true, true, true, true, false, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + float a2 = (144.7785f); + float4x4 b2 = float4x4(-471.7112f, -155.913177f, 99.72473f, -230.944855f, -338.8689f, 334.068237f, -158.660858f, -315.018219f, -177.19281f, 171.95929f, 198.38916f, 303.678345f, 400.6996f, 351.878662f, -31.7696533f, 386.0733f); + bool4x4 r2 = bool4x4(true, true, true, true, true, false, true, true, true, false, false, false, false, false, true, false); + TestUtils.AreEqual(r2, a2 > b2); + + float a3 = (-360.348877f); + float4x4 b3 = float4x4(-499.8237f, 428.290344f, 425.8302f, 203.288818f, 177.893921f, 483.09552f, 258.88678f, -361.5269f, 359.734924f, -276.336731f, 202.674683f, 218.982117f, 144.793274f, 503.665283f, 33.8777466f, -169.047455f); + bool4x4 r3 = bool4x4(true, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void float4x4_operator_less_equal_wide_wide() + { + float4x4 a0 = float4x4(-438.523132f, 210.489441f, 4.87731934f, -137.297943f, 156.094116f, -363.924133f, -97.94849f, 437.2954f, 458.530273f, -294.064758f, 23.62262f, -34.2840576f, 149.736511f, -418.8867f, -197.502533f, -88.2055054f); + float4x4 b0 = float4x4(-474.814148f, 304.371033f, 234.824158f, -390.485443f, -297.175354f, -326.2924f, 107.253906f, -413.131073f, 67.09442f, 470.075256f, -84.499115f, 392.784241f, -263.531738f, 369.3009f, -333.3253f, 238.413452f); + bool4x4 r0 = bool4x4(false, true, true, false, false, true, true, false, false, true, false, true, false, true, false, true); + TestUtils.AreEqual(r0, a0 <= b0); + + float4x4 a1 = float4x4(-376.71814f, 341.627136f, -83.30917f, -107.490723f, 319.466858f, 205.357361f, 345.563721f, 395.3219f, -222.874146f, 439.022034f, -368.075562f, -200.0386f, 71.46991f, -357.365417f, 141.710876f, 319.0171f); + float4x4 b1 = float4x4(486.2426f, 279.6502f, 236.052f, 132.758972f, 66.29474f, 183.002136f, 200.130554f, 339.043823f, 438.5379f, 145.401855f, 178.163086f, 157.975952f, 329.7052f, -243.590912f, 5.401184f, -22.5805969f); + bool4x4 r1 = bool4x4(true, false, true, true, false, false, false, false, true, false, true, true, true, true, false, false); + TestUtils.AreEqual(r1, a1 <= b1); + + float4x4 a2 = float4x4(303.030151f, -461.574249f, 277.62677f, 182.1781f, -337.414856f, -361.391663f, 222.1435f, -464.7795f, -146.853668f, 80.17505f, -260.3473f, 94.48901f, 174.281189f, -303.8197f, 81.41742f, 503.048157f); + float4x4 b2 = float4x4(-90.3375854f, -72.19107f, -354.354828f, -289.521729f, 85.17627f, 469.327881f, 294.7138f, 461.605957f, -245.930481f, -124.040436f, 278.392639f, -42.8812561f, -328.348816f, 98.9855957f, -375.899841f, -197.934265f); + bool4x4 r2 = bool4x4(false, true, false, false, true, true, true, true, false, false, true, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + float4x4 a3 = float4x4(259.2776f, 391.971924f, 149.704773f, -450.582947f, -255.6402f, -29.1832886f, 27.5547485f, 447.832458f, 282.48468f, 415.262756f, 437.226135f, -274.2333f, 327.17334f, 265.5277f, 461.464844f, 141.060852f); + float4x4 b3 = float4x4(-284.062f, -76.09866f, -44.487f, -380.519348f, 216.543762f, 58.74817f, -157.366516f, 288.756042f, -306.971375f, -124.358673f, -68.9424438f, -487.362457f, 93.30701f, 93.9755859f, -428.8075f, -473.515f); + bool4x4 r3 = bool4x4(false, false, false, true, true, true, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void float4x4_operator_less_equal_wide_scalar() + { + float4x4 a0 = float4x4(193.49585f, 168.915527f, -313.993073f, 81.8269653f, 18.5036011f, -0.3581848f, 241.361145f, -463.8164f, -1.35775757f, -268.899475f, 398.991943f, -471.253082f, -264.9378f, 82.2583f, 11.2460327f, 424.704041f); + float b0 = (443.850525f); + bool4x4 r0 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + float4x4 a1 = float4x4(426.482239f, -196.2879f, 31.9011841f, -152.257568f, -437.926453f, -37.1048279f, -47.1442261f, 333.623047f, -274.8039f, 358.67627f, -260.460571f, 192.309143f, 145.306091f, -466.132965f, -494.267334f, -111.570129f); + float b1 = (56.3200073f); + bool4x4 r1 = bool4x4(false, true, true, true, true, true, true, false, true, false, true, false, false, true, true, true); + TestUtils.AreEqual(r1, a1 <= b1); + + float4x4 a2 = float4x4(-139.5412f, 33.98401f, -445.704468f, -451.0422f, -122.039276f, 83.3277f, -202.465515f, -76.56488f, 218.032776f, -103.53595f, -283.358429f, -374.761658f, -213.49588f, 477.491821f, -383.370056f, 23.9649658f); + float b2 = (-146.589355f); + bool4x4 r2 = bool4x4(false, false, true, true, false, false, true, false, false, false, true, true, true, false, true, false); + TestUtils.AreEqual(r2, a2 <= b2); + + float4x4 a3 = float4x4(-5.960785f, 164.991455f, -117.631805f, -166.246613f, 369.776978f, -305.9796f, 245.151123f, 260.203918f, -218.692535f, 152.965515f, -10.1782837f, -144.12558f, 365.336182f, -314.766479f, 381.259277f, 152.317078f); + float b3 = (-283.961731f); + bool4x4 r3 = bool4x4(false, false, false, false, false, true, false, false, false, false, false, false, false, true, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void float4x4_operator_less_equal_scalar_wide() + { + float a0 = (393.606262f); + float4x4 b0 = float4x4(-75.6883545f, -44.2638855f, 125.864929f, 191.9649f, 13.54303f, -197.051941f, -423.9451f, -330.0486f, 420.165527f, 105.5473f, 174.821289f, 296.7176f, -469.7004f, 123.267212f, 112.996948f, 495.143372f); + bool4x4 r0 = bool4x4(false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, true); + TestUtils.AreEqual(r0, a0 <= b0); + + float a1 = (-488.6579f); + float4x4 b1 = float4x4(388.539429f, -493.240784f, 16.45105f, -387.651642f, -229.1773f, -373.01532f, -391.142151f, 90.99414f, -178.396149f, -69.62106f, 471.790833f, -67.46677f, 45.30536f, -154.6922f, 385.7389f, -431.652954f); + bool4x4 r1 = bool4x4(true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 <= b1); + + float a2 = (-331.673035f); + float4x4 b2 = float4x4(-349.8927f, -114.839142f, -245.217834f, -486.6955f, 391.950928f, -125.770538f, -229.812286f, 289.449036f, -200.494232f, 281.5927f, 99.90106f, -146.027435f, 124.148376f, 94.3569946f, 93.920105f, -484.924133f); + bool4x4 r2 = bool4x4(false, true, true, false, true, true, true, true, true, true, true, true, true, true, true, false); + TestUtils.AreEqual(r2, a2 <= b2); + + float a3 = (-270.796875f); + float4x4 b3 = float4x4(-313.374084f, 252.967834f, -302.899719f, 269.257874f, -358.511047f, -183.248535f, 5.00708f, -411.029266f, -320.0608f, 384.569153f, -383.735962f, 249.418152f, -137.139832f, -251.7605f, 301.0824f, 216.370544f); + bool4x4 r3 = bool4x4(false, true, false, true, false, true, true, false, false, true, false, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void float4x4_operator_greater_equal_wide_wide() + { + float4x4 a0 = float4x4(-507.9286f, 504.4975f, -385.4345f, -262.323425f, -37.5509338f, -111.595276f, -463.702026f, 387.448853f, 456.9688f, -211.010162f, 182.411377f, -53.59604f, -309.570221f, -136.022491f, 280.736267f, -96.99588f); + float4x4 b0 = float4x4(-81.3465f, 297.666138f, 171.06543f, -431.038055f, -6.85907f, 319.7257f, 254.079163f, 396.5724f, 178.8393f, -447.063354f, 288.492676f, 474.889282f, -321.750244f, -395.977234f, -158.692474f, 391.4887f); + bool4x4 r0 = bool4x4(false, true, false, true, false, false, false, false, true, true, false, false, true, true, true, false); + TestUtils.AreEqual(r0, a0 >= b0); + + float4x4 a1 = float4x4(-174.059509f, 88.90192f, 43.81604f, -446.07843f, 16.6455688f, 409.83252f, -191.329865f, 222.9978f, 404.2884f, 230.603271f, -441.789276f, -86.29306f, 484.249573f, 95.23639f, -204.912109f, -199.774353f); + float4x4 b1 = float4x4(-368.109253f, 89.12378f, -510.279327f, -486.9298f, -81.2155457f, 274.2188f, -212.881561f, 288.9953f, 307.73175f, 307.245178f, -199.391785f, -284.421265f, -482.3918f, 448.315735f, -378.3462f, -390.858459f); + bool4x4 r1 = bool4x4(true, false, true, true, true, true, true, false, true, false, false, true, true, false, true, true); + TestUtils.AreEqual(r1, a1 >= b1); + + float4x4 a2 = float4x4(-421.8632f, -18.2147827f, -346.822754f, -159.243652f, 112.917725f, 48.2910156f, 390.660156f, 154.219177f, -32.7480469f, -288.265625f, 122.704285f, 321.277954f, 230.183838f, 116.874268f, -93.515686f, 229.9823f); + float4x4 b2 = float4x4(8.916016f, 416.407227f, -213.674957f, 455.2481f, -236.080353f, -248.373108f, 184.18512f, 415.31134f, 86.98218f, 485.004578f, 107.758911f, -486.667725f, -138.676788f, 14.2078247f, -382.394165f, -117.008209f); + bool4x4 r2 = bool4x4(false, false, false, false, true, true, true, false, false, false, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 >= b2); + + float4x4 a3 = float4x4(-393.441223f, 184.082031f, 317.333252f, 123.818054f, -45.0246277f, -317.672546f, 264.3172f, -163.081421f, -124.610992f, -30.9362183f, 421.919434f, -1.56271362f, 199.638062f, -325.7766f, 181.4508f, 36.7637939f); + float4x4 b3 = float4x4(288.690979f, 311.7541f, 318.590576f, 105.963318f, 287.355164f, 306.291077f, -349.919983f, -211.935577f, 191.925049f, 220.105713f, -172.7789f, -17.6221313f, -43.54706f, 303.854f, 338.548523f, -16.68814f); + bool4x4 r3 = bool4x4(false, false, false, true, false, false, true, true, false, false, true, true, true, false, false, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void float4x4_operator_greater_equal_wide_scalar() + { + float4x4 a0 = float4x4(465.152161f, -424.886078f, -209.2211f, 58.7798462f, -302.2691f, 140.12561f, 16.3533936f, -344.559967f, 393.278076f, -315.701538f, 441.011536f, -509.781555f, -36.9942932f, 494.8203f, -164.973938f, -466.1201f); + float b0 = (-5.599884f); + bool4x4 r0 = bool4x4(true, false, false, true, false, true, true, false, true, false, true, false, false, true, false, false); + TestUtils.AreEqual(r0, a0 >= b0); + + float4x4 a1 = float4x4(-123.813751f, 104.995728f, 314.346f, 190.516113f, -83.11142f, -23.8364258f, 143.049377f, -264.919983f, -169.702209f, 329.70752f, 359.095825f, -260.4233f, 354.195129f, -111.845337f, 33.309082f, 355.6313f); + float b1 = (215.651245f); + bool4x4 r1 = bool4x4(false, false, true, false, false, false, false, false, false, true, true, false, true, false, false, true); + TestUtils.AreEqual(r1, a1 >= b1); + + float4x4 a2 = float4x4(-435.360565f, -93.2957153f, -338.8496f, 436.8958f, 511.084167f, -277.67453f, -453.799255f, 170.919f, -182.825745f, -207.516937f, -319.5006f, -240.5086f, 436.3413f, -66.9560547f, 303.320862f, 180.196045f); + float b2 = (-38.3993225f); + bool4x4 r2 = bool4x4(false, false, false, true, true, false, false, true, false, false, false, false, true, false, true, true); + TestUtils.AreEqual(r2, a2 >= b2); + + float4x4 a3 = float4x4(337.965149f, 107.356689f, -501.208679f, -237.363922f, -434.488464f, 110.950378f, 159.729553f, -188.300171f, 379.4331f, 322.4181f, 169.257568f, 427.863342f, -472.917084f, 308.1438f, -104.297546f, -353.412842f); + float b3 = (-84.43594f); + bool4x4 r3 = bool4x4(true, true, false, false, false, true, true, false, true, true, true, true, false, true, false, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void float4x4_operator_greater_equal_scalar_wide() + { + float a0 = (374.827026f); + float4x4 b0 = float4x4(-1.60977173f, 338.615234f, -116.1814f, -332.157318f, -355.97937f, -468.901428f, 38.579895f, -332.347534f, 2.89013672f, 467.777771f, 121.406372f, -305.023376f, -58.4288025f, -226.519562f, -47.0209961f, 305.302673f); + bool4x4 r0 = bool4x4(true, true, true, true, true, true, true, true, true, false, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + float a1 = (-427.401245f); + float4x4 b1 = float4x4(92.26367f, -497.178528f, -408.625641f, -455.2305f, 396.4261f, -469.2949f, -485.754028f, -182.346191f, -291.545349f, 278.740784f, -75.8711243f, 28.9070435f, 287.720154f, 420.509766f, 473.626831f, 181.514526f); + bool4x4 r1 = bool4x4(false, true, false, true, false, true, true, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + float a2 = (-369.202881f); + float4x4 b2 = float4x4(243.749756f, -244.124146f, -242.993347f, -322.115356f, 192.974976f, -54.7255554f, -166.000824f, 244.293457f, 438.2494f, -162.692841f, 37.1853638f, -506.667358f, -205.163086f, 368.389954f, -35.45996f, -20.9164429f); + bool4x4 r2 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + float a3 = (9.041382f); + float4x4 b3 = float4x4(-377.5871f, -18.9806213f, 59.2191162f, 318.0575f, 113.964172f, 295.910156f, -142.4274f, 362.188843f, 447.56604f, -235.642242f, -397.548981f, 150.745422f, 227.169983f, -464.732025f, 159.779541f, 25.4620972f); + bool4x4 r3 = bool4x4(true, true, false, false, false, false, true, false, false, true, true, false, false, true, false, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void float4x4_operator_add_wide_wide() + { + float4x4 a0 = float4x4(506.129028f, -501.779816f, 420.084778f, -186.032074f, -9.312408f, 328.51178f, 424.344055f, 87.79108f, 462.4137f, -46.17871f, 401.170044f, -454.124146f, 69.19568f, -177.957336f, 299.604126f, 340.704834f); + float4x4 b0 = float4x4(-28.7579956f, -337.135132f, -340.676819f, 152.312012f, 423.66748f, 90.3740845f, 376.18866f, 1.76721191f, -120.185852f, -279.629364f, -344.6671f, 242.839172f, 418.593079f, -23.3128052f, -95.0999451f, 147.9281f); + float4x4 r0 = float4x4(477.371033f, -838.9149f, 79.40796f, -33.7200623f, 414.355072f, 418.885864f, 800.5327f, 89.55829f, 342.227844f, -325.808075f, 56.50293f, -211.284973f, 487.788757f, -201.270142f, 204.504181f, 488.632935f); + TestUtils.AreEqual(r0, a0 + b0); + + float4x4 a1 = float4x4(219.916016f, -321.9084f, 286.355347f, -333.4195f, -118.932159f, 68.60748f, 23.190918f, -205.577881f, 11.5214233f, -340.795074f, -68.93118f, 304.8532f, -86.63385f, 105.669128f, 349.280518f, 364.7079f); + float4x4 b1 = float4x4(331.0329f, -82.50256f, 279.4496f, 342.622742f, -300.358521f, -209.694092f, 446.559448f, -351.9892f, -263.12384f, -252.458557f, 289.825378f, 338.796143f, -232.619019f, -510.50824f, 349.280762f, -426.212463f); + float4x4 r1 = float4x4(550.9489f, -404.41095f, 565.804932f, 9.203247f, -419.29068f, -141.086609f, 469.750366f, -557.5671f, -251.602417f, -593.253662f, 220.8942f, 643.649353f, -319.252869f, -404.8391f, 698.5613f, -61.5045776f); + TestUtils.AreEqual(r1, a1 + b1); + + float4x4 a2 = float4x4(-429.0374f, 382.458069f, 186.097046f, 227.411865f, -298.766357f, 351.3028f, 98.7254f, -292.351685f, 112.1709f, 477.165771f, -266.304871f, -295.1407f, -485.820374f, -507.8687f, -338.2196f, 505.342163f); + float4x4 b2 = float4x4(-331.416321f, -418.6888f, -341.70636f, -329.0359f, 123.198547f, 189.528564f, 267.569946f, 134.636292f, -337.96814f, 50.7280273f, 81.16345f, 442.0907f, -148.704529f, 6.974365f, -334.911255f, 43.78711f); + float4x4 r2 = float4x4(-760.453735f, -36.2307434f, -155.609314f, -101.624023f, -175.56781f, 540.83136f, 366.295349f, -157.7154f, -225.797241f, 527.8938f, -185.141418f, 146.950012f, -634.5249f, -500.894348f, -673.130859f, 549.1293f); + TestUtils.AreEqual(r2, a2 + b2); + + float4x4 a3 = float4x4(-153.0664f, -292.656677f, -447.898651f, -26.0862427f, 21.4642944f, -465.6922f, 450.522522f, -271.92923f, -452.2673f, -110.679169f, 384.114929f, 352.0924f, 475.724365f, -444.868439f, -345.837646f, -502.816284f); + float4x4 b3 = float4x4(-17.1800537f, -157.392761f, -298.889069f, -158.772217f, 500.240784f, 319.870239f, -396.675354f, 157.7962f, 483.0329f, 175.248657f, -198.020142f, 1.79919434f, 452.367371f, -177.198425f, -291.5625f, -475.855133f); + float4x4 r3 = float4x4(-170.24646f, -450.049438f, -746.7877f, -184.858459f, 521.7051f, -145.82196f, 53.847168f, -114.133026f, 30.7655945f, 64.56949f, 186.094788f, 353.8916f, 928.091736f, -622.0669f, -637.400146f, -978.6714f); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void float4x4_operator_add_wide_scalar() + { + float4x4 a0 = float4x4(-194.514191f, 338.5484f, 246.971375f, 100.510925f, -45.72467f, -478.1113f, 30.9161377f, 60.37433f, -242.118744f, 82.50134f, 6.79937744f, -484.6998f, -188.265015f, -213.526733f, -267.7843f, 189.259949f); + float b0 = (124.121704f); + float4x4 r0 = float4x4(-70.39249f, 462.6701f, 371.093079f, 224.632629f, 78.39703f, -353.9896f, 155.037842f, 184.496033f, -117.99704f, 206.623047f, 130.921082f, -360.5781f, -64.14331f, -89.40503f, -143.6626f, 313.381653f); + TestUtils.AreEqual(r0, a0 + b0); + + float4x4 a1 = float4x4(198.533569f, -424.925659f, 302.102356f, 300.3991f, 124.021606f, -200.161346f, 31.3782349f, 362.522156f, -423.988861f, 432.41333f, 374.211426f, -465.6995f, -311.04303f, 84.91901f, -432.442444f, 235.750671f); + float b1 = (187.536072f); + float4x4 r1 = float4x4(386.069641f, -237.389587f, 489.638428f, 487.935181f, 311.557678f, -12.6252747f, 218.9143f, 550.0582f, -236.452789f, 619.9494f, 561.7475f, -278.163422f, -123.506958f, 272.455078f, -244.906372f, 423.286743f); + TestUtils.AreEqual(r1, a1 + b1); + + float4x4 a2 = float4x4(-472.637756f, 186.120728f, -170.298218f, -115.272491f, -101.168823f, 257.775146f, 246.549255f, -397.5346f, -199.04837f, 20.585022f, 207.323853f, 197.935181f, -201.540558f, -106.638672f, -179.382233f, 203.817078f); + float b2 = (-257.577759f); + float4x4 r2 = float4x4(-730.2155f, -71.45703f, -427.875977f, -372.85025f, -358.746582f, 0.1973877f, -11.0285034f, -655.112366f, -456.626129f, -236.992737f, -50.2539063f, -59.64258f, -459.118317f, -364.216431f, -436.96f, -53.76068f); + TestUtils.AreEqual(r2, a2 + b2); + + float4x4 a3 = float4x4(-364.820953f, 77.39429f, 185.278931f, 17.086731f, -511.8999f, 26.7097168f, -296.40683f, 249.988831f, -133.735809f, -398.524628f, 168.704712f, 14.0738525f, -443.0757f, 509.582336f, -72.75815f, -208.45047f); + float b3 = (154.526245f); + float4x4 r3 = float4x4(-210.294708f, 231.920532f, 339.805176f, 171.612976f, -357.373657f, 181.235962f, -141.880585f, 404.515076f, 20.7904358f, -243.998383f, 323.230957f, 168.6001f, -288.549469f, 664.1086f, 81.7681f, -53.9242249f); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void float4x4_operator_add_scalar_wide() + { + float a0 = (-340.354675f); + float4x4 b0 = float4x4(511.362244f, -146.216644f, -106.210419f, -363.450256f, 199.0896f, -27.1083984f, 419.849f, 284.955017f, -164.9242f, -249.190338f, 150.928162f, 298.1751f, -457.1534f, 424.718079f, -301.857483f, 230.288879f); + float4x4 r0 = float4x4(171.007568f, -486.57132f, -446.5651f, -703.804932f, -141.265076f, -367.463074f, 79.49432f, -55.39966f, -505.27887f, -589.545044f, -189.426514f, -42.1795654f, -797.508057f, 84.3634f, -642.212158f, -110.065796f); + TestUtils.AreEqual(r0, a0 + b0); + + float a1 = (-423.5876f); + float4x4 b1 = float4x4(-67.06003f, 68.72412f, -164.02243f, 318.935181f, 7.80456543f, 187.698364f, -3.656952f, -446.083069f, -209.287231f, -38.21289f, -346.257172f, 465.607422f, -192.185944f, 278.6938f, 381.978455f, 481.243652f); + float4x4 r1 = float4x4(-490.6476f, -354.863464f, -587.61f, -104.652405f, -415.78302f, -235.889221f, -427.244537f, -869.670654f, -632.8748f, -461.800476f, -769.8447f, 42.0198364f, -615.77356f, -144.8938f, -41.60913f, 57.6560669f); + TestUtils.AreEqual(r1, a1 + b1); + + float a2 = (-97.22815f); + float4x4 b2 = float4x4(-455.513733f, 501.834961f, 358.7066f, 430.699768f, 256.987183f, 207.651672f, -376.965179f, -428.085327f, -373.49353f, -468.89328f, -467.658447f, 297.484924f, -506.89978f, -233.358459f, 434.558777f, -387.3152f); + float4x4 r2 = float4x4(-552.7419f, 404.6068f, 261.478455f, 333.471619f, 159.759033f, 110.423523f, -474.193329f, -525.3135f, -470.72168f, -566.12146f, -564.8866f, 200.256775f, -604.1279f, -330.5866f, 337.330627f, -484.543335f); + TestUtils.AreEqual(r2, a2 + b2); + + float a3 = (171.590271f); + float4x4 b3 = float4x4(245.057556f, 200.502747f, 353.496826f, -147.289825f, -8.442291f, 178.085022f, 409.446533f, -429.3672f, -103.623169f, -500.8955f, 254.1062f, 331.3476f, -484.73822f, -15.8841248f, 280.9497f, 328.9314f); + float4x4 r3 = float4x4(416.647827f, 372.093018f, 525.0871f, 24.3004456f, 163.14798f, 349.6753f, 581.0368f, -257.776917f, 67.9671f, -329.305237f, 425.696472f, 502.937866f, -313.147949f, 155.706146f, 452.539978f, 500.521667f); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void float4x4_operator_sub_wide_wide() + { + float4x4 a0 = float4x4(160.492249f, 11.223938f, 359.200134f, -498.2283f, -355.253632f, -94.53485f, -410.46405f, -401.384644f, 317.706848f, 447.060425f, -489.074158f, -230.008392f, 24.8754272f, 366.614441f, -107.374146f, -219.008148f); + float4x4 b0 = float4x4(115.46875f, -130.9823f, 241.540833f, 9.987061f, 419.895142f, 59.12445f, -402.381653f, -75.37015f, 320.9796f, -73.90875f, -31.4447327f, -389.251953f, -375.028839f, 259.182739f, 276.648682f, -453.0692f); + float4x4 r0 = float4x4(45.0235f, 142.206238f, 117.6593f, -508.215363f, -775.1488f, -153.6593f, -8.082397f, -326.0145f, -3.272766f, 520.9692f, -457.629425f, 159.243561f, 399.904266f, 107.4317f, -384.022827f, 234.061066f); + TestUtils.AreEqual(r0, a0 - b0); + + float4x4 a1 = float4x4(473.9076f, 259.63623f, -360.119629f, 7.80963135f, 437.428467f, -59.1991577f, 418.744324f, 183.142151f, 271.230347f, 496.208557f, 165.354919f, -227.403656f, -166.522858f, 356.142273f, 386.9264f, -394.638763f); + float4x4 b1 = float4x4(-272.576538f, -191.148041f, 87.1369f, 430.02478f, 343.6571f, 121.029419f, -354.188171f, 249.052f, -2.22543335f, 22.4472656f, 478.112976f, -320.063f, -111.524109f, 222.228943f, -245.411072f, -119.902283f); + float4x4 r1 = float4x4(746.484131f, 450.784271f, -447.256531f, -422.215149f, 93.77136f, -180.228577f, 772.9325f, -65.90985f, 273.45578f, 473.7613f, -312.758057f, 92.65933f, -54.99875f, 133.91333f, 632.337463f, -274.736481f); + TestUtils.AreEqual(r1, a1 - b1); + + float4x4 a2 = float4x4(126.903259f, 97.21692f, -150.017853f, -227.250519f, -198.830017f, 0.662780762f, -484.245575f, -295.996277f, -46.17099f, 499.9524f, 292.440125f, -106.424133f, 466.827148f, 487.374817f, 242.994629f, -468.901581f); + float4x4 b2 = float4x4(-153.465668f, 374.1125f, 301.763428f, -281.430054f, -494.964355f, -320.731262f, 160.962219f, -132.9364f, -394.437531f, 406.851257f, 270.544617f, 507.794617f, 67.69922f, 263.40448f, 297.5807f, 170.839539f); + float4x4 r2 = float4x4(280.368927f, -276.895569f, -451.781281f, 54.1795349f, 296.134338f, 321.394043f, -645.207764f, -163.059875f, 348.266541f, 93.1011353f, 21.8955078f, -614.21875f, 399.12793f, 223.970337f, -54.58606f, -639.7411f); + TestUtils.AreEqual(r2, a2 - b2); + + float4x4 a3 = float4x4(226.2959f, 506.12616f, 60.59491f, -112.930145f, -286.9749f, -290.722748f, -34.5498047f, -347.817444f, -327.527832f, -243.600067f, -233.363464f, 99.65759f, 464.9585f, 419.285339f, 326.3886f, -12.4246826f); + float4x4 b3 = float4x4(-451.296875f, 60.20996f, 321.029663f, 481.46698f, 265.6386f, 148.319275f, -418.672424f, 184.514954f, -22.9213257f, 269.3639f, -289.490051f, 368.358643f, 101.4223f, 294.282959f, 21.3450317f, 15.5893555f); + float4x4 r3 = float4x4(677.5928f, 445.9162f, -260.434753f, -594.3971f, -552.6135f, -439.042023f, 384.12262f, -532.3324f, -304.6065f, -512.964f, 56.1265869f, -268.70105f, 363.5362f, 125.00238f, 305.043579f, -28.0140381f); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void float4x4_operator_sub_wide_scalar() + { + float4x4 a0 = float4x4(207.389587f, 248.457764f, -384.8239f, -205.344757f, -374.811554f, 191.642029f, 18.8562622f, -44.96161f, 480.857971f, 16.3381958f, -366.865448f, -35.5231f, 349.397766f, 439.077271f, 490.2223f, 195.024048f); + float b0 = (-36.1124878f); + float4x4 r0 = float4x4(243.502075f, 284.570251f, -348.711426f, -169.232269f, -338.699066f, 227.754517f, 54.96875f, -8.849121f, 516.970459f, 52.4506836f, -330.75296f, 0.589386f, 385.510254f, 475.189758f, 526.3348f, 231.136536f); + TestUtils.AreEqual(r0, a0 - b0); + + float4x4 a1 = float4x4(-384.849426f, 55.6027832f, -54.931488f, 53.0880737f, 316.8025f, -273.8067f, 256.8872f, 297.173645f, 101.829041f, 136.607971f, -19.7322083f, 336.589722f, -51.8765564f, 317.345764f, -467.055939f, -50.1670532f); + float b1 = (189.05188f); + float4x4 r1 = float4x4(-573.9013f, -133.4491f, -243.983368f, -135.9638f, 127.75061f, -462.858582f, 67.83533f, 108.121765f, -87.22284f, -52.44391f, -208.784088f, 147.537842f, -240.928436f, 128.293884f, -656.1078f, -239.218933f); + TestUtils.AreEqual(r1, a1 - b1); + + float4x4 a2 = float4x4(477.804565f, 0.4111328f, 46.66095f, -19.241394f, 396.809753f, 69.5905151f, -334.274231f, -198.077148f, -239.200623f, -339.6812f, -14.5144348f, 219.99707f, -180.260681f, -438.8906f, 186.35553f, -365.066772f); + float b2 = (-60.82193f); + float4x4 r2 = float4x4(538.626465f, 61.2330627f, 107.48288f, 41.5805359f, 457.631683f, 130.412445f, -273.4523f, -137.255219f, -178.3787f, -278.859283f, 46.3074951f, 280.819f, -119.438751f, -378.068665f, 247.17746f, -304.244843f); + TestUtils.AreEqual(r2, a2 - b2); + + float4x4 a3 = float4x4(-478.801239f, 57.5604858f, 306.905945f, -357.698456f, 159.085022f, 10.2644653f, -129.711182f, 9.481628f, 35.359436f, -456.9659f, -473.41156f, 130.448669f, 20.7345581f, 210.992432f, -411.8095f, -497.356018f); + float b3 = (-193.226776f); + float4x4 r3 = float4x4(-285.574463f, 250.787262f, 500.132721f, -164.47168f, 352.3118f, 203.491241f, 63.5155945f, 202.7084f, 228.586212f, -263.739136f, -280.184784f, 323.675446f, 213.961334f, 404.2192f, -218.582733f, -304.129242f); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void float4x4_operator_sub_scalar_wide() + { + float a0 = (-86.00824f); + float4x4 b0 = float4x4(466.4251f, 298.486938f, -300.9501f, 315.38f, -381.092163f, -125.008362f, 58.4661865f, 214.7461f, -257.549438f, 480.2246f, -443.355072f, 260.795044f, 29.6819458f, 139.857727f, -247.789948f, -248.466217f); + float4x4 r0 = float4x4(-552.43335f, -384.495178f, 214.941864f, -401.388245f, 295.083923f, 39.0001221f, -144.474426f, -300.754333f, 171.5412f, -566.232849f, 357.346832f, -346.803284f, -115.690186f, -225.865967f, 161.781708f, 162.457977f); + TestUtils.AreEqual(r0, a0 - b0); + + float a1 = (91.44513f); + float4x4 b1 = float4x4(86.3841553f, 373.8183f, 260.411926f, 114.353943f, -464.405457f, -109.741455f, -311.675354f, 107.864014f, -258.795166f, 14.0975342f, -461.970184f, 30.3108521f, 63.70111f, -462.676758f, 39.75946f, 47.99817f); + float4x4 r1 = float4x4(5.060974f, -282.373169f, -168.9668f, -22.9088135f, 555.8506f, 201.186584f, 403.120483f, -16.4188843f, 350.2403f, 77.3475952f, 553.4153f, 61.1342773f, 27.7440186f, 554.1219f, 51.68567f, 43.44696f); + TestUtils.AreEqual(r1, a1 - b1); + + float a2 = (-177.6193f); + float4x4 b2 = float4x4(202.477051f, -289.3088f, -459.9254f, 248.386658f, 85.32971f, -73.37479f, -510.652f, 426.963257f, 239.59021f, 477.852356f, 256.0136f, 338.620361f, -483.8312f, 330.3922f, -263.4182f, 123.92804f); + float4x4 r2 = float4x4(-380.096344f, 111.689514f, 282.306122f, -426.005951f, -262.949f, -104.244507f, 333.0327f, -604.5825f, -417.2095f, -655.4717f, -433.6329f, -516.2396f, 306.2119f, -508.0115f, 85.79892f, -301.547333f); + TestUtils.AreEqual(r2, a2 - b2); + + float a3 = (-269.115967f); + float4x4 b3 = float4x4(-265.6382f, 484.580322f, -304.015625f, 311.637817f, 418.830566f, -103.771606f, -501.27475f, -304.483978f, 389.703f, 372.894043f, 8.436401f, -327.564758f, 190.749451f, 430.901367f, 28.885437f, -299.203125f); + float4x4 r3 = float4x4(-3.47775269f, -753.6963f, 34.89966f, -580.7538f, -687.946533f, -165.34436f, 232.158783f, 35.36801f, -658.819f, -642.01f, -277.552368f, 58.44879f, -459.865417f, -700.017334f, -298.0014f, 30.0871582f); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void float4x4_operator_mul_wide_wide() + { + float4x4 a0 = float4x4(-482.7138f, -407.2935f, 137.700562f, 208.541138f, 194.29657f, -484.242432f, 183.9873f, -241.33548f, 45.8687744f, 363.3261f, -328.118958f, -471.023071f, -262.682556f, -379.262756f, -374.090576f, 481.4474f); + float4x4 b0 = float4x4(-236.367889f, 260.7276f, -416.3863f, -364.4956f, -253.147522f, -369.202881f, 193.547913f, 169.0849f, 201.969666f, 249.456055f, -308.193176f, -385.579651f, -183.2796f, 22.2756348f, -265.521423f, -95.67746f); + float4x4 r0 = float4x4(114098.047f, -106192.656f, -57336.625f, -76012.33f, -49185.6953f, 178783.7f, 35610.36f, -40806.1836f, 9264.101f, 90633.9f, 101124.023f, 181616.9f, 48144.3555f, -8448.318f, 99329.06f, -46063.6641f); + TestUtils.AreEqual(r0, a0 * b0); + + float4x4 a1 = float4x4(104.628052f, 412.935425f, 477.877258f, 20.3778076f, 291.995972f, -138.488312f, -393.464966f, 9.363098f, -131.942291f, 364.449646f, 390.615967f, 418.797974f, -277.3448f, 11.4101563f, 474.876465f, -502.405029f); + float4x4 b1 = float4x4(133.2544f, 148.311462f, 249.284119f, 500.0055f, -19.3315735f, -36.69107f, 30.5238037f, -401.367f, 3.43725586f, 257.24176f, -290.971924f, 337.47937f, 490.286133f, -191.0198f, -325.7345f, -52.1819763f); + float4x4 r1 = float4x4(13942.1475f, 61243.06f, 119127.211f, 10189.0156f, -5644.7417f, 5081.284f, -12010.0479f, -3758.03857f, -453.5194f, 93751.67f, -113658.281f, 141335.672f, -135978.3f, -2179.566f, -154683.641f, 26216.4883f); + TestUtils.AreEqual(r1, a1 * b1); + + float4x4 a2 = float4x4(-222.59491f, 38.1690674f, 292.6125f, 203.2077f, -330.408142f, 469.460144f, 342.2951f, -504.114655f, 319.3573f, -357.782074f, -117.9711f, 25.706543f, 226.456421f, -86.34372f, -274.126038f, -486.870972f); + float4x4 b2 = float4x4(123.435059f, -461.267059f, 122.353088f, 308.584656f, 375.320618f, 203.212646f, 77.66797f, 218.793579f, -489.895752f, 134.472168f, -287.794373f, -116.399994f, -436.543976f, 499.591064f, -300.602356f, 105.730469f); + float4x4 r2 = float4x4(-27476.0156f, -17606.1328f, 35802.043f, 62706.7773f, -124008.984f, 95400.24f, 26585.3652f, -110297.047f, -156451.781f, -48111.73f, 33951.418f, -2992.24146f, -98858.19f, -43136.55f, 82402.93f, -51477.0977f); + TestUtils.AreEqual(r2, a2 * b2); + + float4x4 a3 = float4x4(-28.9265442f, -326.096161f, 504.3548f, -181.979523f, 312.229553f, 75.6499f, -248.432068f, 507.184265f, 482.400818f, 1.6229248f, -479.952423f, -446.2109f, -414.271545f, -175.72348f, -303.303223f, 70.71069f); + float4x4 b3 = float4x4(425.693665f, -4.90002441f, -41.369812f, 257.704651f, -456.134979f, -496.704651f, -296.414673f, 156.987183f, 304.616577f, 452.772156f, -124.8772f, -446.8005f, -357.430969f, 217.1565f, 215.616577f, 482.1942f); + float4x4 r3 = float4x4(-12313.8467f, 1597.87915f, -20865.0625f, -46896.97f, -142418.828f, -37575.66f, 73638.91f, 79621.43f, 146947.281f, 734.8152f, 59935.1133f, 199367.266f, 148073.484f, -38159.4961f, -65397.2031f, 34096.29f); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void float4x4_operator_mul_wide_scalar() + { + float4x4 a0 = float4x4(-96.31882f, -277.142273f, -239.93689f, 509.531433f, 255.8581f, 215.7315f, -455.50827f, -389.2433f, -338.29248f, 53.7962646f, 243.757324f, 135.354675f, -207.3501f, -383.9396f, -31.4252319f, 42.6761475f); + float b0 = (-301.2072f); + float4x4 r0 = float4x4(29011.9219f, 83477.25f, 72270.72f, -153474.547f, -77066.3047f, -64979.8867f, 137202.375f, 117242.883f, 101896.133f, -16203.8232f, -73421.46f, -40769.8047f, 62455.3438f, 115645.383f, 9465.507f, -12854.3633f); + TestUtils.AreEqual(r0, a0 * b0); + + float4x4 a1 = float4x4(260.38385f, 25.67212f, -290.5006f, 207.091f, -156.523315f, -208.402008f, 370.945068f, -341.59845f, 10.2703247f, -176.888763f, -61.0061035f, 186.279785f, -487.652222f, -129.376831f, -317.7163f, -207.62735f); + float b1 = (176.867554f); + float4x4 r1 = float4x4(46053.4531f, 4540.565f, -51380.1328f, 36627.68f, -27683.8965f, -36859.5547f, 65608.15f, -60417.6836f, 1816.48718f, -31285.8828f, -10790f, 32946.85f, -86249.86f, -22882.5645f, -56193.707f, -36722.543f); + TestUtils.AreEqual(r1, a1 * b1); + + float4x4 a2 = float4x4(388.8714f, 128.415527f, 510.389526f, 267.576355f, -309.209656f, -36.48297f, -189.569519f, 233.209229f, -331.086975f, -98.6447754f, -214.181f, -87.88077f, -493.165741f, -407.306061f, -411.3714f, 477.935669f); + float b2 = (-233.335327f); + float4x4 r2 = float4x4(-90737.44f, -29963.8789f, -119091.906f, -62435.0156f, 72149.54f, 8512.766f, 44233.2656f, -54415.9531f, 77254.29f, 23017.31f, 49975.9922f, 20505.6875f, 115072.992f, 95038.89f, 95987.48f, -111519.273f); + TestUtils.AreEqual(r2, a2 * b2); + + float4x4 a3 = float4x4(364.748535f, -187.482422f, -287.957642f, 208.590149f, 367.3161f, 443.2597f, -98.88196f, 339.129822f, -266.412231f, -119.37973f, 117.4978f, -63.52304f, -362.640259f, -328.8269f, 49.4736328f, -169.017944f); + float b3 = (-8.058472f); + float4x4 r3 = float4x4(-2939.31567f, 1510.82178f, 2320.49854f, -1680.91785f, -2960.00635f, -3571.99585f, 796.837463f, -2732.86816f, 2146.87549f, 962.0182f, -946.8527f, 511.898621f, 2922.32617f, 2649.84229f, -398.681854f, 1362.02637f); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void float4x4_operator_mul_scalar_wide() + { + float a0 = (37.43219f); + float4x4 b0 = float4x4(96.74756f, 492.185364f, -274.054565f, -452.870972f, 420.853333f, 102.182922f, -114.948883f, -351.120056f, -464.664978f, 444.084839f, 447.1053f, 130.829346f, -321.41333f, 445.301331f, 478.2436f, 358.571716f); + float4x4 r0 = float4x4(3621.473f, 18423.5762f, -10258.4629f, -16951.9531f, 15753.4619f, 3824.93066f, -4302.78857f, -13143.1924f, -17393.4277f, 16623.0684f, 16736.13f, 4897.229f, -12031.2051f, 16668.6035f, 17901.7051f, 13422.125f); + TestUtils.AreEqual(r0, a0 * b0); + + float a1 = (-144.8901f); + float4x4 b1 = float4x4(-438.893829f, -3.536438f, -471.807556f, -42.5603943f, 119.911072f, 271.900024f, 239.684021f, 487.4414f, -79.18829f, -112.925659f, 161.370056f, 459.759155f, -337.195984f, -276.834534f, 469.723877f, -274.565155f); + float4x4 r1 = float4x4(63591.375f, 512.3949f, 68360.25f, 6166.58f, -17373.9277f, -39395.625f, -34727.8438f, -70625.44f, 11473.6006f, 16361.8105f, -23380.9238f, -66614.5547f, 48856.3633f, 40110.5859f, -68058.34f, 39781.7734f); + TestUtils.AreEqual(r1, a1 * b1); + + float a2 = (506.7859f); + float4x4 b2 = float4x4(65.88257f, 495.855652f, -347.2796f, -343.606049f, -183.7038f, 460.264771f, 437.513245f, -324.557251f, -112.287781f, 273.135437f, -283.093658f, 1.880249f, -310.8167f, 326.0122f, 243.64325f, 78.17932f); + float4x4 r2 = float4x4(33388.3555f, 251292.641f, -175996.4f, -174134.7f, -93098.49f, 233255.688f, 221725.531f, -164481.031f, -56905.8633f, 138421.188f, -143467.875f, 952.883667f, -157517.516f, 165218.391f, 123474.961f, 39620.1758f); + TestUtils.AreEqual(r2, a2 * b2); + + float a3 = (-308.664f); + float4x4 b3 = float4x4(-382.209229f, -134.171875f, -173.004913f, -432.007446f, 488.8365f, -291.7146f, -1.73858643f, -428.3124f, -11.9584045f, -296.891418f, 235.681091f, -298.879181f, 384.531f, 208.919373f, 489.3814f, -106.6055f); + float4x4 r3 = float4x4(117974.227f, 41414.0273f, 53400.39f, 133345.141f, -150886.219f, 90041.8f, 536.639038f, 132204.625f, 3691.129f, 91639.6953f, -72746.2656f, 92253.24f, -118690.883f, -64485.89f, -151054.422f, 32905.28f); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void float4x4_operator_div_wide_wide() + { + float4x4 a0 = float4x4(-353.131439f, -102.799866f, 51.3191528f, -191.871674f, 8.041809f, -128.73764f, -136.0596f, -370.471f, -237.69455f, -432.546875f, 200.2655f, 361.4416f, -416.226135f, -450.0192f, -273.497437f, -286.908173f); + float4x4 b0 = float4x4(-178.739563f, -302.096283f, -199.405823f, 278.850769f, 502.3376f, -361.484833f, 353.121033f, -38.894928f, -75.76474f, -195.217834f, -405.034f, -394.23f, -375.8277f, -121.245483f, 447.623352f, 338.286255f); + float4x4 r0 = float4x4(1.97567582f, 0.34028843f, -0.257360339f, -0.688080132f, 0.0160087738f, 0.356135666f, -0.385305852f, 9.524919f, 3.1372714f, 2.215714f, -0.4944412f, -0.9168292f, 1.107492f, 3.71163678f, -0.610999048f, -0.8481225f); + TestUtils.AreEqual(r0, a0 / b0); + + float4x4 a1 = float4x4(-314.256042f, 177.762085f, 97.6270142f, -68.10727f, -386.450745f, 263.699341f, -297.0271f, -501.777039f, -263.40686f, -451.080841f, -416.34552f, -315.278748f, -28.1811218f, -397.870148f, -261.386658f, 40.3482056f); + float4x4 b1 = float4x4(-405.5442f, -431.168945f, 296.205139f, 437.939819f, 39.2106323f, 331.289734f, -310.619568f, 207.26947f, -223.293f, -480.0914f, 448.675964f, -460.097443f, -220.569855f, -84.85315f, 441.373779f, 72.41846f); + float4x4 r1 = float4x4(0.7748996f, -0.412279427f, 0.3295926f, -0.155517414f, -9.855764f, 0.795978f, 0.9562408f, -2.42089224f, 1.17964673f, 0.9395729f, -0.9279426f, 0.6852434f, 0.127765059f, 4.688926f, -0.592211545f, 0.557153642f); + TestUtils.AreEqual(r1, a1 / b1); + + float4x4 a2 = float4x4(277.245728f, 464.77124f, -336.641052f, 375.4781f, 504.342529f, -320.7671f, -156.733337f, 414.797058f, -386.0507f, -369.838623f, 386.704224f, 242.631836f, 421.7345f, 109.012207f, 182.075256f, 187.326416f); + float4x4 b2 = float4x4(44.9760742f, -242.515381f, -451.302063f, -21.8996887f, -358.486664f, -350.945129f, -481.848145f, 406.393433f, -145.288666f, 461.795532f, -318.816772f, -250.932f, 125.859558f, -193.803162f, -495.25412f, -315.824554f); + float4x4 r2 = float4x4(6.164294f, -1.91646087f, 0.7459329f, -17.14536f, -1.40686548f, 0.9140092f, 0.3252754f, 1.02067852f, 2.65712881f, -0.800870955f, -1.21293569f, -0.966922641f, 3.35083413f, -0.562489331f, -0.367640078f, -0.5931344f); + TestUtils.AreEqual(r2, a2 / b2); + + float4x4 a3 = float4x4(510.862366f, -457.956055f, -263.390778f, 31.9105225f, -86.77109f, -472.43396f, 257.443054f, 208.635864f, -123.366913f, -210.80249f, 299.212463f, 197.7143f, 314.344238f, -152.249908f, -48.31424f, 308.025024f); + float4x4 b3 = float4x4(-320.719116f, 169.996826f, 252.738342f, -324.1048f, 82.81885f, 454.1411f, -476.333618f, -58.3329773f, -292.26355f, 395.902039f, 90.55267f, 84.0625f, 203.703247f, 49.49939f, 57.28125f, 487.59668f); + float4x4 r3 = float4x4(-1.59286535f, -2.69390941f, -1.04214811f, -0.09845742f, -1.04772151f, -1.0402801f, -0.540468f, -3.57663655f, 0.422108442f, -0.5324612f, 3.304292f, 2.35199165f, 1.54314792f, -3.07579374f, -0.843456447f, 0.6317209f); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void float4x4_operator_div_wide_scalar() + { + float4x4 a0 = float4x4(171.3424f, 0.103393555f, 57.8882446f, -256.130737f, 95.66968f, -290.3869f, -127.4487f, -79.7449f, 146.466858f, -499.843567f, 58.68634f, -453.2058f, -205.033813f, 481.738159f, 464.479065f, -293.4635f); + float b0 = (171.796814f); + float4x4 r0 = float4x4(0.997355f, 0.000601836247f, 0.3369576f, -1.49089336f, 0.5568769f, -1.69029272f, -0.7418572f, -0.4641815f, 0.8525586f, -2.90950418f, 0.3416032f, -2.63803387f, -1.1934669f, 2.80411577f, 2.70365357f, -1.708201f); + TestUtils.AreEqual(r0, a0 / b0); + + float4x4 a1 = float4x4(-158.505585f, 494.1286f, 203.583435f, 180.9704f, 259.1192f, 460.844727f, 490.956238f, -280.478058f, -320.243866f, 192.41449f, 264.800842f, 226.852966f, -192.235687f, 460.9765f, -437.8922f, -413.232727f); + float b1 = (-289.5822f); + float4x4 r1 = float4x4(0.5473595f, -1.70635f, -0.7030246f, -0.624936163f, -0.8948036f, -1.59141243f, -1.695395f, 0.968561053f, 1.10588241f, -0.6644555f, -0.9144237f, -0.783380151f, 0.663838f, -1.59186745f, 1.5121516f, 1.42699623f); + TestUtils.AreEqual(r1, a1 / b1); + + float4x4 a2 = float4x4(249.471863f, 216.785583f, 383.7389f, 82.0233154f, 189.574646f, 314.503845f, -391.92218f, 121.280579f, 417.901733f, -133.262878f, -428.7424f, -188.531891f, 356.259521f, 181.969f, -140.890472f, 474.082642f); + float b2 = (313.035034f); + float4x4 r2 = float4x4(0.7969455f, 0.6925282f, 1.2258656f, 0.262025982f, 0.605602f, 1.0046922f, -1.25200737f, 0.3874345f, 1.33499992f, -0.425712347f, -1.36963069f, -0.6022709f, 1.13808191f, 0.5813055f, -0.450078934f, 1.51447153f); + TestUtils.AreEqual(r2, a2 / b2); + + float4x4 a3 = float4x4(-451.357727f, -220.999786f, 463.01123f, 502.372f, 424.6776f, 51.258667f, 78.93201f, -487.652679f, -96.08646f, 29.1986084f, 119.750427f, 205.4021f, -173.297424f, -448.8201f, -15.4214783f, 472.026917f); + float b3 = (390.1247f); + float4x4 r3 = float4x4(-1.15695763f, -0.566485f, 1.18682885f, 1.28772163f, 1.08856893f, 0.131390467f, 0.202325076f, -1.24999177f, -0.246296778f, 0.07484429f, 0.306954235f, 0.5265037f, -0.444210351f, -1.150453f, -0.0395296142f, 1.20993853f); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void float4x4_operator_div_scalar_wide() + { + float a0 = (-264.4425f); + float4x4 b0 = float4x4(105.589111f, -142.349091f, -288.9489f, 39.644104f, -363.9914f, -149.718231f, -395.729126f, 258.7187f, -9.66626f, 117.725525f, -331.386536f, -509.986023f, 427.896484f, 467.617126f, -407.124634f, 252.690735f); + float4x4 r0 = float4x4(-2.50444865f, 1.85770416f, 0.9151877f, -6.670412f, 0.7265076f, 1.7662679f, 0.6682412f, -1.02212369f, 27.3572731f, -2.246263f, 0.797988057f, 0.518528938f, -0.6180058f, -0.56551075f, 0.649536967f, -1.04650652f); + TestUtils.AreEqual(r0, a0 / b0); + + float a1 = (444.599365f); + float4x4 b1 = float4x4(-88.31329f, 199.955017f, -218.346924f, -13.4171753f, -296.131073f, 0.561340332f, -289.299316f, 196.218323f, 334.733459f, -282.392731f, -479.5036f, -473.439453f, 105.050781f, -287.6313f, 77.29932f, -210.894379f); + float4x4 r1 = float4x4(-5.03434229f, 2.223497f, -2.03620625f, -33.1365852f, -1.50136f, 792.031738f, -1.53681445f, 2.26584029f, 1.328219f, -1.5744009f, -0.9272076f, -0.9390839f, 4.232233f, -1.54572678f, 5.75166f, -2.10816121f); + TestUtils.AreEqual(r1, a1 / b1); + + float a2 = (-184.068237f); + float4x4 b2 = float4x4(-315.148438f, 87.86688f, 101.590515f, 345.9364f, -146.318115f, 479.999939f, -172.67688f, -178.013641f, 361.760437f, 349.376953f, -398.686127f, -243.78f, 296.622925f, 477.810669f, 486.600342f, 256.917236f); + float4x4 r2 = float4x4(0.584068358f, -2.0948534f, -1.81186438f, -0.5320869f, 1.25800037f, -0.383475542f, 1.06596923f, 1.034012f, -0.5088125f, -0.5268471f, 0.4616871f, 0.7550588f, -0.6205462f, -0.385232568f, -0.378273964f, -0.716449559f); + TestUtils.AreEqual(r2, a2 / b2); + + float a3 = (-89.86423f); + float4x4 b3 = float4x4(-148.205872f, 388.356384f, 76.9372559f, 260.97467f, -110.279846f, 369.089539f, -511.6496f, 355.425781f, -186.724854f, -379.3255f, -428.225525f, 220.158142f, 397.282959f, -106.643188f, 103.314148f, 212.908325f); + float4x4 r3 = float4x4(0.606347263f, -0.231396288f, -1.16801965f, -0.3443408f, 0.8148744f, -0.2434754f, 0.175636277f, -0.252835423f, 0.4812655f, 0.236905321f, 0.209852576f, -0.408180356f, -0.226197034f, 0.842662632f, -0.8698153f, -0.422079444f); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void float4x4_operator_mod_wide_wide() + { + float4x4 a0 = float4x4(-388.8125f, 181.681213f, -167.078735f, 432.820129f, -258.438965f, -170.110809f, 283.3183f, 122.716492f, 335.271f, -503.608521f, 191.022522f, 289.742676f, -124.033722f, 259.274f, -274.358459f, -140.030792f); + float4x4 b0 = float4x4(436.944153f, 58.9400635f, -201.116241f, 279.289368f, -397.079773f, 377.899963f, 174.693848f, -228.176514f, -317.060181f, -417.4801f, -249.975952f, -397.571564f, -358.745453f, -198.15921f, 208.737122f, -12.1194153f); + float4x4 r0 = float4x4(-388.8125f, 4.861023f, -167.078735f, 153.530762f, -258.438965f, -170.110809f, 108.624451f, 122.716492f, 18.2108154f, -86.12842f, 191.022522f, 289.742676f, -124.033722f, 61.1147766f, -65.62134f, -6.717224f); + TestUtils.AreEqual(r0, a0 % b0); + + float4x4 a1 = float4x4(324.577576f, -200.513092f, 211.423157f, -51.2722168f, -230.633911f, 99.98938f, 399.18988f, 24.90326f, 50.92401f, -364.863678f, -252.626617f, -281.2898f, -364.798523f, -329.026245f, 51.6098022f, 41.6478271f); + float4x4 b1 = float4x4(25.2714233f, -194.1207f, -493.8718f, -312.3017f, -216.980591f, 413.570984f, -436.3944f, 3.491272f, -308.233429f, -441.375061f, 84.60083f, 373.163452f, 67.25275f, -320.333282f, 118.97937f, 44.8239746f); + float4x4 r1 = float4x4(21.3204956f, -6.392395f, 211.423157f, -51.2722168f, -13.65332f, 99.98938f, 399.18988f, 0.464355469f, 50.92401f, -364.863678f, -83.42496f, -281.2898f, -28.53479f, -8.692963f, 51.6098022f, 41.6478271f); + TestUtils.AreEqual(r1, a1 % b1); + + float4x4 a2 = float4x4(254.95105f, -458.6776f, -136.79303f, 72.40033f, 246.212036f, 325.1538f, 162.034668f, -284.761444f, 128.351257f, 262.916748f, 61.60077f, -271.4928f, -205.438812f, -341.322144f, 347.154419f, 148.0885f); + float4x4 b2 = float4x4(354.0086f, -253.953125f, -195.162811f, 317.142822f, 320.693176f, -103.996887f, 388.171753f, -199.639313f, -256.217316f, -478.125031f, -210.655731f, -272.0233f, -61.6765442f, -367.8296f, -242.938934f, 162.386719f); + float4x4 r2 = float4x4(254.95105f, -204.724487f, -136.79303f, 72.40033f, 246.212036f, 13.163147f, 162.034668f, -85.12213f, 128.351257f, 262.916748f, 61.60077f, -271.4928f, -20.40918f, -341.322144f, 104.215485f, 148.0885f); + TestUtils.AreEqual(r2, a2 % b2); + + float4x4 a3 = float4x4(253.371582f, -353.380066f, -489.716766f, -371.7157f, 131.366272f, -175.5871f, 271.447021f, -300.871216f, -159.985809f, 63.31543f, 368.062622f, 495.223145f, 113.5014f, 463.485657f, -365.840637f, 481.9884f); + float4x4 b3 = float4x4(-456.834534f, -466.818756f, -233.143585f, -265.913147f, -170.0065f, -61.3197937f, 334.7071f, -240.970245f, 382.6131f, -204.172882f, 7.772827f, -46.39322f, 325.345642f, 436.883484f, -71.77011f, -22.84903f); + float4x4 r3 = float4x4(253.371582f, -353.380066f, -23.4295959f, -105.802551f, 131.366272f, -52.94751f, 271.447021f, -59.90097f, -159.985809f, 63.31543f, 2.739746f, 31.2909546f, 113.5014f, 26.6021729f, -6.990082f, 2.158783f); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void float4x4_operator_mod_wide_scalar() + { + float4x4 a0 = float4x4(-244.499634f, -211.8193f, -145.926788f, -304.9182f, 155.479492f, -133.907776f, 281.309631f, -226.535767f, 335.166138f, 101.706482f, 319.4715f, -285.4023f, -355.846863f, 259.378f, -330.871948f, -284.343567f); + float b0 = (39.63495f); + float4x4 r0 = float4x4(-6.68994141f, -13.6445618f, -27.0219421f, -27.4735718f, 36.574646f, -15.00293f, 3.86499023f, -28.3610229f, 18.0865479f, 22.4365845f, 2.39190674f, -7.957672f, -38.7672729f, 21.5682983f, -13.7923584f, -6.898926f); + TestUtils.AreEqual(r0, a0 % b0); + + float4x4 a1 = float4x4(-102.683441f, 206.41687f, -416.713654f, -339.256653f, 435.2975f, 132.552917f, 226.944092f, -306.1183f, 115.438477f, 281.882935f, -218.347443f, -140.0405f, -462.3235f, -211.6087f, 351.331055f, 321.047f); + float b1 = (-172.141754f); + float4x4 r1 = float4x4(-102.683441f, 34.275116f, -72.4301453f, -167.1149f, 91.01398f, 132.552917f, 54.8023376f, -133.976532f, 115.438477f, 109.74118f, -46.20569f, -140.0405f, -118.039978f, -39.46695f, 7.04754639f, 148.905243f); + TestUtils.AreEqual(r1, a1 % b1); + + float4x4 a2 = float4x4(346.0852f, 465.40918f, -367.197021f, -467.5106f, 415.2151f, 506.186157f, -3.729828f, 128.249878f, 134.941589f, 247.616943f, -285.287872f, 433.766663f, -141.831024f, -229.781891f, 471.218018f, 377.681458f); + float b2 = (-94.4077454f); + float4x4 r2 = float4x4(62.86197f, 87.7782f, -83.9737854f, -89.87961f, 37.5841064f, 34.14743f, -3.729828f, 33.8421326f, 40.533844f, 58.8014526f, -2.06463623f, 56.13568f, -47.42328f, -40.9664f, 93.5870361f, 0.0504760742f); + TestUtils.AreEqual(r2, a2 % b2); + + float4x4 a3 = float4x4(433.4076f, -333.358124f, 403.178467f, -417.24295f, 116.337463f, 167.627747f, 139.12915f, -510.799957f, -471.958984f, 96.20929f, -12.3428955f, 425.504761f, 285.489624f, -198.684814f, 480.1405f, -94.44934f); + float b3 = (-99.4491f); + float4x4 r3 = float4x4(35.6112061f, -35.0108337f, 5.38208f, -19.4465637f, 16.8883667f, 68.17865f, 39.6800537f, -13.5544739f, -74.1626f, 96.20929f, -12.3428955f, 27.708374f, 86.59143f, -99.23572f, 82.34412f, -94.44934f); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void float4x4_operator_mod_scalar_wide() + { + float a0 = (-66.94504f); + float4x4 b0 = float4x4(-249.7761f, -396.073761f, 386.492065f, 168.939453f, -199.418243f, 261.7517f, 16.1274414f, 257.668152f, -75.78845f, 170.9563f, -242.858276f, 425.9453f, 303.2724f, 3.033081f, -505.74353f, 461.957031f); + float4x4 r0 = float4x4(-66.94504f, -66.94504f, -66.94504f, -66.94504f, -66.94504f, -66.94504f, -2.43527222f, -66.94504f, -66.94504f, -66.94504f, -66.94504f, -66.94504f, -66.94504f, -0.217254639f, -66.94504f, -66.94504f); + TestUtils.AreEqual(r0, a0 % b0); + + float a1 = (205.972778f); + float4x4 b1 = float4x4(270.040649f, -47.4807129f, -150.254486f, 149.499512f, -220.298035f, 31.1188354f, 400.635681f, 6.23144531f, -39.05075f, -71.9411f, -495.307129f, -86.7196045f, -436.970062f, -472.294739f, -130.008759f, -251.516846f); + float4x4 r1 = float4x4(205.972778f, 16.0499268f, 55.7182922f, 56.4732666f, 205.972778f, 19.2597656f, 205.972778f, 0.335083f, 10.7190247f, 62.0905762f, 205.972778f, 32.53357f, 205.972778f, 205.972778f, 75.96402f, 205.972778f); + TestUtils.AreEqual(r1, a1 % b1); + + float a2 = (281.976379f); + float4x4 b2 = float4x4(388.86084f, 50.6152954f, 293.87085f, 123.744263f, 422.904358f, -53.87619f, -178.857666f, -362.27594f, 361.085266f, 465.276123f, -269.889648f, -159.408966f, -29.0952148f, 484.499451f, -354.950623f, -328.6906f); + float4x4 r2 = float4x4(281.976379f, 28.8999023f, 281.976379f, 34.487854f, 281.976379f, 12.5954285f, 103.118713f, 281.976379f, 281.976379f, 281.976379f, 12.086731f, 122.567413f, 20.1194458f, 281.976379f, 281.976379f, 281.976379f); + TestUtils.AreEqual(r2, a2 % b2); + + float a3 = (-171.739227f); + float4x4 b3 = float4x4(-300.492981f, -64.58917f, 400.004578f, 295.555481f, 482.521973f, 84.80737f, 497.856384f, -349.291931f, 351.6325f, -178.30719f, -0.5654297f, -167.612244f, -150.81839f, 131.251038f, 399.150452f, 165.462158f); + float4x4 r3 = float4x4(-171.739227f, -42.5608826f, -171.739227f, -171.739227f, -171.739227f, -2.1244812f, -171.739227f, -171.739227f, -171.739227f, -171.739227f, -0.414031982f, -4.12698364f, -20.9208374f, -40.48819f, -171.739227f, -6.277069f); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void float4x4_operator_plus() + { + float4x4 a0 = float4x4(-418.829559f, -405.79895f, -34.04178f, 236.999268f, -459.8391f, 210.86145f, 293.742f, -373.015442f, -386.059845f, 4.95440674f, -418.645264f, 504.474854f, -170.746521f, 439.5594f, -478.7494f, 116.400757f); + float4x4 r0 = float4x4(-418.829559f, -405.79895f, -34.04178f, 236.999268f, -459.8391f, 210.86145f, 293.742f, -373.015442f, -386.059845f, 4.95440674f, -418.645264f, 504.474854f, -170.746521f, 439.5594f, -478.7494f, 116.400757f); + TestUtils.AreEqual(r0, +a0); + + float4x4 a1 = float4x4(421.409668f, 447.8661f, 124.164368f, 222.172546f, -65.94928f, 239.041809f, 498.449524f, -139.382538f, 279.072937f, 108.775818f, 37.9992065f, 136.812134f, -236.030029f, -440.308319f, 342.2791f, 102.472229f); + float4x4 r1 = float4x4(421.409668f, 447.8661f, 124.164368f, 222.172546f, -65.94928f, 239.041809f, 498.449524f, -139.382538f, 279.072937f, 108.775818f, 37.9992065f, 136.812134f, -236.030029f, -440.308319f, 342.2791f, 102.472229f); + TestUtils.AreEqual(r1, +a1); + + float4x4 a2 = float4x4(-161.454834f, 141.314331f, 239.320862f, -494.6041f, 361.59198f, -14.6017456f, 141.712524f, 25.2562866f, -268.2269f, 106.774658f, 176.744385f, 104.119934f, 144.618591f, 289.4519f, -393.0167f, -198.95575f); + float4x4 r2 = float4x4(-161.454834f, 141.314331f, 239.320862f, -494.6041f, 361.59198f, -14.6017456f, 141.712524f, 25.2562866f, -268.2269f, 106.774658f, 176.744385f, 104.119934f, 144.618591f, 289.4519f, -393.0167f, -198.95575f); + TestUtils.AreEqual(r2, +a2); + + float4x4 a3 = float4x4(-419.009216f, 233.295471f, 407.3216f, -129.0021f, 321.17218f, -132.84079f, -20.491333f, -135.618225f, -226.912048f, -409.9144f, -256.257233f, 2.17242432f, 361.9702f, -66.73724f, -248.924377f, -109.997375f); + float4x4 r3 = float4x4(-419.009216f, 233.295471f, 407.3216f, -129.0021f, 321.17218f, -132.84079f, -20.491333f, -135.618225f, -226.912048f, -409.9144f, -256.257233f, 2.17242432f, 361.9702f, -66.73724f, -248.924377f, -109.997375f); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void float4x4_operator_neg() + { + float4x4 a0 = float4x4(148.461731f, -467.122681f, 132.04718f, 183.522644f, 473.701f, -407.9911f, -54.95877f, -382.9898f, -299.093384f, -383.014069f, 407.709778f, 168.735474f, 466.441528f, 171.902466f, -280.558319f, -78.857605f); + float4x4 r0 = float4x4(-148.461731f, 467.122681f, -132.04718f, -183.522644f, -473.701f, 407.9911f, 54.95877f, 382.9898f, 299.093384f, 383.014069f, -407.709778f, -168.735474f, -466.441528f, -171.902466f, 280.558319f, 78.857605f); + TestUtils.AreEqual(r0, -a0); + + float4x4 a1 = float4x4(318.69635f, 140.340027f, 132.195618f, -505.895264f, 410.380554f, -237.056946f, -137.617828f, -245.349976f, 422.521362f, -434.57135f, 60.22223f, -466.5663f, 426.894531f, 146.649536f, -391.37207f, 423.237732f); + float4x4 r1 = float4x4(-318.69635f, -140.340027f, -132.195618f, 505.895264f, -410.380554f, 237.056946f, 137.617828f, 245.349976f, -422.521362f, 434.57135f, -60.22223f, 466.5663f, -426.894531f, -146.649536f, 391.37207f, -423.237732f); + TestUtils.AreEqual(r1, -a1); + + float4x4 a2 = float4x4(254.297546f, 108.059692f, -507.9763f, -306.245728f, 219.66626f, 474.667969f, -98.76068f, 492.111084f, 84.04584f, 300.976624f, -483.864624f, -389.15744f, -324.6861f, 378.85437f, 190.219238f, -69.10242f); + float4x4 r2 = float4x4(-254.297546f, -108.059692f, 507.9763f, 306.245728f, -219.66626f, -474.667969f, 98.76068f, -492.111084f, -84.04584f, -300.976624f, 483.864624f, 389.15744f, 324.6861f, -378.85437f, -190.219238f, 69.10242f); + TestUtils.AreEqual(r2, -a2); + + float4x4 a3 = float4x4(507.495361f, 245.013367f, 429.615784f, 142.357f, -430.84906f, 281.934265f, -242.334961f, -83.12738f, -460.8203f, -485.419739f, 396.819031f, -428.4235f, -213.987885f, -17.6636353f, 287.0819f, 257.497742f); + float4x4 r3 = float4x4(-507.495361f, -245.013367f, -429.615784f, -142.357f, 430.84906f, -281.934265f, 242.334961f, 83.12738f, 460.8203f, 485.419739f, -396.819031f, 428.4235f, 213.987885f, 17.6636353f, -287.0819f, -257.497742f); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void float4x4_operator_prefix_inc() + { + float4x4 a0 = float4x4(-139.842072f, -56.7436523f, -381.955322f, 509.796326f, -222.896332f, 210.319885f, -392.7315f, -300.1941f, 362.212769f, 401.6148f, 130.90918f, -450.230164f, 243.546936f, 46.1920166f, -41.4972839f, 299.1855f); + float4x4 r0 = float4x4(-138.842072f, -55.7436523f, -380.955322f, 510.796326f, -221.896332f, 211.319885f, -391.7315f, -299.1941f, 363.212769f, 402.6148f, 131.90918f, -449.230164f, 244.546936f, 47.1920166f, -40.4972839f, 300.1855f); + TestUtils.AreEqual(r0, ++a0); + + float4x4 a1 = float4x4(154.356567f, 200.706f, 92.95776f, 448.602173f, -295.587f, 18.4990845f, -215.711121f, 471.947266f, 257.0766f, 41.6259155f, 4.82543945f, 243.004761f, -472.619019f, -125.720215f, -477.459564f, 9.89147949f); + float4x4 r1 = float4x4(155.356567f, 201.706f, 93.95776f, 449.602173f, -294.587f, 19.4990845f, -214.711121f, 472.947266f, 258.0766f, 42.6259155f, 5.82543945f, 244.004761f, -471.619019f, -124.720215f, -476.459564f, 10.8914795f); + TestUtils.AreEqual(r1, ++a1); + + float4x4 a2 = float4x4(-76.92285f, -387.177429f, 461.7093f, 13.699707f, -46.303772f, 89.36603f, -222.2291f, 340.8178f, 399.741272f, -311.372345f, 300.177979f, -272.7783f, 351.019165f, 436.575256f, -137.063324f, 312.579956f); + float4x4 r2 = float4x4(-75.92285f, -386.177429f, 462.7093f, 14.699707f, -45.303772f, 90.36603f, -221.2291f, 341.8178f, 400.741272f, -310.372345f, 301.177979f, -271.7783f, 352.019165f, 437.575256f, -136.063324f, 313.579956f); + TestUtils.AreEqual(r2, ++a2); + + float4x4 a3 = float4x4(-315.999023f, -442.44696f, -93.81058f, -76.4442444f, -8.3284f, 436.757263f, 345.7558f, -474.150879f, 32.02704f, -343.3061f, 114.443054f, -31.1988831f, 322.8318f, 15.335022f, 96.3687744f, 51.8783569f); + float4x4 r3 = float4x4(-314.999023f, -441.44696f, -92.81058f, -75.4442444f, -7.32839966f, 437.757263f, 346.7558f, -473.150879f, 33.02704f, -342.3061f, 115.443054f, -30.1988831f, 323.8318f, 16.335022f, 97.3687744f, 52.8783569f); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void float4x4_operator_postfix_inc() + { + float4x4 a0 = float4x4(-396.669739f, 511.20752f, 249.111267f, -128.817322f, -259.4903f, 278.008179f, -81.39343f, 66.71973f, 167.852112f, 147.94397f, -326.1076f, 41.03357f, 128.5304f, 73.15558f, -60.1323853f, -446.229767f); + float4x4 r0 = float4x4(-396.669739f, 511.20752f, 249.111267f, -128.817322f, -259.4903f, 278.008179f, -81.39343f, 66.71973f, 167.852112f, 147.94397f, -326.1076f, 41.03357f, 128.5304f, 73.15558f, -60.1323853f, -446.229767f); + TestUtils.AreEqual(r0, a0++); + + float4x4 a1 = float4x4(-296.937836f, 446.2293f, 49.2001953f, -326.643127f, -510.864227f, 471.647461f, -171.013092f, 310.727356f, -298.917175f, 489.985f, 184.603455f, 290.69104f, 117.192322f, 164.442932f, 412.3678f, -229.386566f); + float4x4 r1 = float4x4(-296.937836f, 446.2293f, 49.2001953f, -326.643127f, -510.864227f, 471.647461f, -171.013092f, 310.727356f, -298.917175f, 489.985f, 184.603455f, 290.69104f, 117.192322f, 164.442932f, 412.3678f, -229.386566f); + TestUtils.AreEqual(r1, a1++); + + float4x4 a2 = float4x4(239.596924f, -80.70819f, -391.0335f, -478.227142f, 166.860474f, -291.1745f, -389.396667f, -52.13214f, 35.75531f, 356.052124f, 6.52948f, -285.349823f, 418.016479f, 47.1428833f, 31.4516f, 148.9469f); + float4x4 r2 = float4x4(239.596924f, -80.70819f, -391.0335f, -478.227142f, 166.860474f, -291.1745f, -389.396667f, -52.13214f, 35.75531f, 356.052124f, 6.52948f, -285.349823f, 418.016479f, 47.1428833f, 31.4516f, 148.9469f); + TestUtils.AreEqual(r2, a2++); + + float4x4 a3 = float4x4(-219.800385f, 448.954224f, -32.54605f, 441.9734f, -128.249451f, -472.44f, -91.87564f, 72.45532f, -472.57312f, 300.0232f, 246.003113f, 288.0287f, -461.3402f, 495.501038f, -226.475372f, -241.579865f); + float4x4 r3 = float4x4(-219.800385f, 448.954224f, -32.54605f, 441.9734f, -128.249451f, -472.44f, -91.87564f, 72.45532f, -472.57312f, 300.0232f, 246.003113f, 288.0287f, -461.3402f, 495.501038f, -226.475372f, -241.579865f); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void float4x4_operator_prefix_dec() + { + float4x4 a0 = float4x4(123.128723f, 256.84375f, 156.330811f, 461.737427f, 325.867981f, 392.015625f, 187.874146f, -236.225189f, 125.109619f, 469.844727f, 45.5366821f, 376.046875f, -363.0755f, -22.0289612f, 248.7901f, 168.095032f); + float4x4 r0 = float4x4(122.128723f, 255.84375f, 155.330811f, 460.737427f, 324.867981f, 391.015625f, 186.874146f, -237.225189f, 124.109619f, 468.844727f, 44.5366821f, 375.046875f, -364.0755f, -23.0289612f, 247.7901f, 167.095032f); + TestUtils.AreEqual(r0, --a0); + + float4x4 a1 = float4x4(168.265625f, 166.945557f, 183.957947f, 485.6947f, -460.739319f, 89.5698853f, -267.4298f, 201.756226f, -141.216888f, -217.4841f, 197.361755f, -213.544128f, 180.7406f, -128.3125f, 478.045532f, -454.566132f); + float4x4 r1 = float4x4(167.265625f, 165.945557f, 182.957947f, 484.6947f, -461.739319f, 88.5698853f, -268.4298f, 200.756226f, -142.216888f, -218.4841f, 196.361755f, -214.544128f, 179.7406f, -129.3125f, 477.045532f, -455.566132f); + TestUtils.AreEqual(r1, --a1); + + float4x4 a2 = float4x4(-386.898346f, -315.110443f, -108.28656f, -286.317017f, -375.601563f, -87.60596f, 78.27545f, 161.531982f, -346.847961f, -57.54077f, 455.372864f, 444.798157f, 129.820129f, 134.710632f, 61.322998f, -274.543335f); + float4x4 r2 = float4x4(-387.898346f, -316.110443f, -109.28656f, -287.317017f, -376.601563f, -88.60596f, 77.27545f, 160.531982f, -347.847961f, -58.54077f, 454.372864f, 443.798157f, 128.820129f, 133.710632f, 60.322998f, -275.543335f); + TestUtils.AreEqual(r2, --a2); + + float4x4 a3 = float4x4(-43.39557f, 211.510681f, -161.216339f, 149.434021f, 90.4324951f, -344.726135f, -88.23938f, -252.0188f, -44.91513f, 97.4996948f, 502.5124f, 489.3189f, 456.369019f, 86.15723f, 79.49109f, 318.612976f); + float4x4 r3 = float4x4(-44.39557f, 210.510681f, -162.216339f, 148.434021f, 89.4324951f, -345.726135f, -89.23938f, -253.0188f, -45.91513f, 96.4996948f, 501.5124f, 488.3189f, 455.369019f, 85.15723f, 78.49109f, 317.612976f); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void float4x4_operator_postfix_dec() + { + float4x4 a0 = float4x4(379.6883f, 302.692871f, -176.07135f, -291.2527f, 470.567566f, -402.925964f, -63.65515f, 355.2611f, -27.8892212f, -100.761841f, 156.14032f, 479.9452f, -200.304291f, -445.026947f, 407.420349f, 327.670349f); + float4x4 r0 = float4x4(379.6883f, 302.692871f, -176.07135f, -291.2527f, 470.567566f, -402.925964f, -63.65515f, 355.2611f, -27.8892212f, -100.761841f, 156.14032f, 479.9452f, -200.304291f, -445.026947f, 407.420349f, 327.670349f); + TestUtils.AreEqual(r0, a0--); + + float4x4 a1 = float4x4(48.06018f, -38.43506f, 283.9416f, -94.80209f, 152.510681f, -287.2625f, -215.948029f, -407.046356f, 159.233582f, -359.456482f, 168.41394f, -278.933777f, 289.912842f, 402.039551f, 470.716553f, -208.560608f); + float4x4 r1 = float4x4(48.06018f, -38.43506f, 283.9416f, -94.80209f, 152.510681f, -287.2625f, -215.948029f, -407.046356f, 159.233582f, -359.456482f, 168.41394f, -278.933777f, 289.912842f, 402.039551f, 470.716553f, -208.560608f); + TestUtils.AreEqual(r1, a1--); + + float4x4 a2 = float4x4(145.896729f, -274.570831f, -250.04126f, -70.85629f, -485.627838f, -341.094543f, -503.192078f, 397.648621f, 446.621582f, -292.81012f, 126.6225f, -250.442413f, 470.816467f, 26.9436035f, -186.923523f, 45.7460938f); + float4x4 r2 = float4x4(145.896729f, -274.570831f, -250.04126f, -70.85629f, -485.627838f, -341.094543f, -503.192078f, 397.648621f, 446.621582f, -292.81012f, 126.6225f, -250.442413f, 470.816467f, 26.9436035f, -186.923523f, 45.7460938f); + TestUtils.AreEqual(r2, a2--); + + float4x4 a3 = float4x4(-206.455963f, -350.94812f, -92.1842041f, -37.5095825f, 114.516663f, 77.95538f, -472.1233f, -396.2063f, -200.665985f, 468.530518f, 279.9309f, 122.194885f, 194.197937f, 9.198608f, 197.423828f, 176.5058f); + float4x4 r3 = float4x4(-206.455963f, -350.94812f, -92.1842041f, -37.5095825f, 114.516663f, 77.95538f, -472.1233f, -396.2063f, -200.665985f, 468.530518f, 279.9309f, 122.194885f, 194.197937f, 9.198608f, 197.423828f, 176.5058f); + TestUtils.AreEqual(r3, a3--); + } + + [TestCase /* For player builds */] + public static void float4x4_EqualsObjectOverride() + { + TestUtils.IsFalse(new float4x4().Equals((object)new int())); + TestUtils.IsTrue(new float4x4().Equals((object)new float4x4())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestFloat4x4.gen.cs.meta b/src/Tests/Tests/Shared/TestFloat4x4.gen.cs.meta new file mode 100644 index 00000000..84f7f600 --- /dev/null +++ b/src/Tests/Tests/Shared/TestFloat4x4.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b3a17e2bf2fb0984b96ba8a21a08b8b0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestHalf.cs b/src/Tests/Tests/Shared/TestHalf.cs new file mode 100644 index 00000000..7cd3e330 --- /dev/null +++ b/src/Tests/Tests/Shared/TestHalf.cs @@ -0,0 +1,553 @@ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; +using System; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public partial class TestHalf + { + [TestCompiler] + public static void half_zero() + { + TestUtils.AreEqual(0x0000, half.zero.value); + } + + [TestCompiler] + public static void half2_zero() + { + TestUtils.AreEqual(0x0000, half2.zero.x.value); + TestUtils.AreEqual(0x0000, half2.zero.y.value); + } + + [TestCompiler] + public static void half3_zero() + { + TestUtils.AreEqual(0x0000, half3.zero.x.value); + TestUtils.AreEqual(0x0000, half3.zero.y.value); + TestUtils.AreEqual(0x0000, half3.zero.z.value); + } + + [TestCompiler] + public static void half4_zero() + { + TestUtils.AreEqual(0x0000, half4.zero.x.value); + TestUtils.AreEqual(0x0000, half4.zero.y.value); + TestUtils.AreEqual(0x0000, half4.zero.z.value); + TestUtils.AreEqual(0x0000, half4.zero.w.value); + } + + [TestCompiler] + public static void half_from_float_construction() + { + TestUtils.AreEqual(0x0000, half(0.0f).value); + TestUtils.AreEqual(0x0000, half(2.98e-08f).value); + TestUtils.AreEqual(0x0001, half(5.96046448e-08f).value); + TestUtils.AreEqual(0x57B6, half(123.4f).value); + TestUtils.AreEqual(0x7BFF, half(65504.0f).value); + TestUtils.AreEqual(0x7C00, half(65520.0f).value); + TestUtils.AreEqual(0x7C00, half(float.PositiveInfinity).value); + TestUtils.AreEqual(0xFE00, half(TestUtils.SignedFloatQNaN()).value); + + TestUtils.AreEqual(0x8000, half(-2.98e-08f).value); + TestUtils.AreEqual(0x8001, half(-5.96046448e-08f).value); + TestUtils.AreEqual(0xD7B6, half(-123.4f).value); + TestUtils.AreEqual(0xFBFF, half(-65504.0f).value); + TestUtils.AreEqual(0xFC00, half(-65520.0f).value); + TestUtils.AreEqual(0xFC00, half(float.NegativeInfinity).value); + } + + [TestCompiler] + [WindowsOnly("Mono on linux ignores signed zero.")] + public static void half_from_float_construction_signed_zero() + { + TestUtils.AreEqual(0x8000, half(TestUtils.SignedFloatZero()).value); + } + + [TestCompiler] + public static void half2_from_float2_construction() + { + half2 h0 = half2(float2(0.0f, 2.98e-08f)); + half2 h1 = half2(float2(5.96046448e-08f, 123.4f)); + half2 h2 = half2(float2(65504.0f, 65520.0f)); + half2 h3 = half2(float2(float.PositiveInfinity, TestUtils.SignedFloatQNaN())); + + half2 h4 = half2(float2(-2.98e-08f, -5.96046448e-08f)); + half2 h5 = half2(float2(-123.4f, -65504.0f)); + half2 h6 = half2(float2(-65520.0f, float.NegativeInfinity)); + half2 h7 = half2(float2(float.NegativeInfinity, 0.0f)); + + TestUtils.AreEqual(uint2(0x0000, 0x0000), uint2(h0.x.value, h0.y.value)); + TestUtils.AreEqual(uint2(0x0001, 0x57B6), uint2(h1.x.value, h1.y.value)); + TestUtils.AreEqual(uint2(0x7BFF, 0x7C00), uint2(h2.x.value, h2.y.value)); + TestUtils.AreEqual(uint2(0x7C00, 0xFE00), uint2(h3.x.value, h3.y.value)); + + TestUtils.AreEqual(uint2(0x8000, 0x8001), uint2(h4.x.value, h4.y.value)); + TestUtils.AreEqual(uint2(0xD7B6, 0xFBFF), uint2(h5.x.value, h5.y.value)); + TestUtils.AreEqual(uint2(0xFC00, 0xFC00), uint2(h6.x.value, h6.y.value)); + TestUtils.AreEqual(uint2(0xFC00, 0x0000), uint2(h7.x.value, h7.y.value)); + } + + [TestCompiler] + [WindowsOnly("Mono on linux ignores signed zero.")] + public static void half2_from_float2_construction_signed_zero() + { + half2 h0 = half2(float2(TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero())); + TestUtils.AreEqual(uint2(0x8000, 0x8000), uint2(h0.x.value, h0.y.value)); + } + + [TestCompiler] + public static void half3_from_float3_construction() + { + half3 h0 = half3(float3(0.0f, 2.98e-08f, 5.96046448e-08f)); + half3 h1 = half3(float3(123.4f, 65504.0f, 65520.0f)); + half3 h2 = half3(float3(float.PositiveInfinity, TestUtils.SignedFloatQNaN(), -2.98e-08f)); + half3 h3 = half3(float3(-5.96046448e-08f, -123.4f, -65504.0f)); + half3 h4 = half3(float3(-65520.0f, float.NegativeInfinity, 0.0f)); + + TestUtils.AreEqual(uint3(0x0000, 0x0000, 0x0001), uint3(h0.x.value, h0.y.value, h0.z.value)); + TestUtils.AreEqual(uint3(0x57B6, 0x7BFF, 0x7C00), uint3(h1.x.value, h1.y.value, h1.z.value)); + TestUtils.AreEqual(uint3(0x7C00, 0xFE00, 0x8000), uint3(h2.x.value, h2.y.value, h2.z.value)); + + TestUtils.AreEqual(uint3(0x8001, 0xD7B6, 0xFBFF), uint3(h3.x.value, h3.y.value, h3.z.value)); + TestUtils.AreEqual(uint3(0xFC00, 0xFC00, 0x0000), uint3(h4.x.value, h4.y.value, h4.z.value)); + } + + [TestCompiler] + [WindowsOnly("Mono on linux ignores signed zero.")] + public static void half3_from_float3_construction_signed_zero() + { + half3 h0 = half3(float3(TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero())); + TestUtils.AreEqual(uint3(0x8000, 0x8000, 0x8000), uint3(h0.x.value, h0.y.value, h0.z.value)); + } + + [TestCompiler] + public static void half4_from_float4_construction() + { + half4 h0 = half4(float4(0.0f, 2.98e-08f, 5.96046448e-08f, 123.4f)); + half4 h1 = half4(float4(65504.0f, 65520.0f, float.PositiveInfinity, TestUtils.SignedFloatQNaN())); + half4 h2 = half4(float4(-2.98e-08f, -5.96046448e-08f, -123.4f, -65504.0f)); + half4 h3 = half4(float4(-65520.0f, float.NegativeInfinity, float.NegativeInfinity, 0.0f)); + + TestUtils.AreEqual(uint4(0x0000, 0x0000, 0x0001, 0x57B6), uint4(h0.x.value, h0.y.value, h0.z.value, h0.w.value)); + TestUtils.AreEqual(uint4(0x7BFF, 0x7C00, 0x7C00, 0xFE00), uint4(h1.x.value, h1.y.value, h1.z.value, h1.w.value)); + TestUtils.AreEqual(uint4(0x8000, 0x8001, 0xD7B6, 0xFBFF), uint4(h2.x.value, h2.y.value, h2.z.value, h2.w.value)); + TestUtils.AreEqual(uint4(0xFC00, 0xFC00, 0xFC00, 0x0000), uint4(h3.x.value, h3.y.value, h3.z.value, h3.w.value)); + } + + [TestCompiler] + [WindowsOnly("Mono on linux ignores signed zero.")] + public static void half4_from_float4_construction_signed_zero() + { + half4 h0 = half4(float4(TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero())); + TestUtils.AreEqual(uint4(0x8000, 0x8000, 0x8000, 0x8000), uint4(h0.x.value, h0.y.value, h0.z.value, h0.w.value)); + } + + + [TestCompiler] + public static void half_from_double_construction() + { + TestUtils.AreEqual(0x0000, half(0.0).value); + TestUtils.AreEqual(0x0000, half(2.98e-08).value); + TestUtils.AreEqual(0x0001, half(5.96046448e-08).value); + TestUtils.AreEqual(0x57B6, half(123.4).value); + TestUtils.AreEqual(0x7BFF, half(65504.0).value); + TestUtils.AreEqual(0x7C00, half(65520.0).value); + TestUtils.AreEqual(0x7C00, half(double.PositiveInfinity).value); + TestUtils.AreEqual(0xFE00, half(TestUtils.SignedDoubleQNaN()).value); + + TestUtils.AreEqual(0x8000, half(-2.98e-08).value); + TestUtils.AreEqual(0x8001, half(-5.96046448e-08).value); + TestUtils.AreEqual(0xD7B6, half(-123.4).value); + TestUtils.AreEqual(0xFBFF, half(-65504.0).value); + TestUtils.AreEqual(0xFC00, half(-65520.0).value); + TestUtils.AreEqual(0xFC00, half(double.NegativeInfinity).value); + } + + [TestCompiler] + [WindowsOnly("Mono on linux ignores signed zero.")] + public static void half_from_double_construction_signed_zero() + { + TestUtils.AreEqual(0x8000, half(TestUtils.SignedDoubleZero()).value); + } + + [TestCompiler] + public static void half2_from_double2_construction() + { + half2 h0 = half2(double2(0.0, 2.98e-08)); + half2 h1 = half2(double2(5.96046448e-08, 123.4)); + half2 h2 = half2(double2(65504.0, 65520.0)); + half2 h3 = half2(double2(double.PositiveInfinity, TestUtils.SignedDoubleQNaN())); + + half2 h4 = half2(double2(-2.98e-08, -5.96046448e-08)); + half2 h5 = half2(double2(-123.4, -65504.0)); + half2 h6 = half2(double2(-65520.0, double.NegativeInfinity)); + half2 h7 = half2(double2(double.NegativeInfinity, 0.0)); + + TestUtils.AreEqual(uint2(0x0000, 0x0000), uint2(h0.x.value, h0.y.value)); + TestUtils.AreEqual(uint2(0x0001, 0x57B6), uint2(h1.x.value, h1.y.value)); + TestUtils.AreEqual(uint2(0x7BFF, 0x7C00), uint2(h2.x.value, h2.y.value)); + TestUtils.AreEqual(uint2(0x7C00, 0xFE00), uint2(h3.x.value, h3.y.value)); + + TestUtils.AreEqual(uint2(0x8000, 0x8001), uint2(h4.x.value, h4.y.value)); + TestUtils.AreEqual(uint2(0xD7B6, 0xFBFF), uint2(h5.x.value, h5.y.value)); + TestUtils.AreEqual(uint2(0xFC00, 0xFC00), uint2(h6.x.value, h6.y.value)); + TestUtils.AreEqual(uint2(0xFC00, 0x0000), uint2(h7.x.value, h7.y.value)); + } + + [TestCompiler] + [WindowsOnly("Mono on linux ignores signed zero.")] + public static void half2_from_double2_construction_signed_zero() + { + half2 h0 = half2(double2(TestUtils.SignedDoubleZero(), TestUtils.SignedDoubleZero())); + TestUtils.AreEqual(uint2(0x8000, 0x8000), uint2(h0.x.value, h0.y.value)); + } + + [TestCompiler] + public static void half3_from_double3_construction() + { + half3 h0 = half3(double3(0.0, 2.98e-08, 5.96046448e-08)); + half3 h1 = half3(double3(123.4, 65504.0, 65520.0)); + half3 h2 = half3(double3(double.PositiveInfinity, TestUtils.SignedDoubleQNaN(), -2.98e-08)); + half3 h3 = half3(double3(-5.96046448e-08, -123.4, -65504.0)); + half3 h4 = half3(double3(-65520.0, double.NegativeInfinity, 0.0)); + + TestUtils.AreEqual(uint3(0x0000, 0x0000, 0x0001), uint3(h0.x.value, h0.y.value, h0.z.value)); + TestUtils.AreEqual(uint3(0x57B6, 0x7BFF, 0x7C00), uint3(h1.x.value, h1.y.value, h1.z.value)); + TestUtils.AreEqual(uint3(0x7C00, 0xFE00, 0x8000), uint3(h2.x.value, h2.y.value, h2.z.value)); + + TestUtils.AreEqual(uint3(0x8001, 0xD7B6, 0xFBFF), uint3(h3.x.value, h3.y.value, h3.z.value)); + TestUtils.AreEqual(uint3(0xFC00, 0xFC00, 0x0000), uint3(h4.x.value, h4.y.value, h4.z.value)); + } + + [TestCompiler] + [WindowsOnly("Mono on linux ignores signed zero.")] + public static void half3_from_double3_construction_signed_zero() + { + half3 h0 = half3(double3(TestUtils.SignedDoubleZero(), TestUtils.SignedDoubleZero(), TestUtils.SignedDoubleZero())); + TestUtils.AreEqual(uint3(0x8000, 0x8000, 0x8000), uint3(h0.x.value, h0.y.value, h0.z.value)); + } + + [TestCompiler] + public static void half4_from_double4_construction() + { + half4 h0 = half4(double4(0.0, 2.98e-08, 5.96046448e-08, 123.4)); + half4 h1 = half4(double4(65504.0, 65520.0, double.PositiveInfinity, TestUtils.SignedDoubleQNaN())); + half4 h2 = half4(double4(-2.98e-08, -5.96046448e-08, -123.4, -65504.0)); + half4 h3 = half4(double4(-65520.0, double.NegativeInfinity, double.NegativeInfinity, 0.0)); + + TestUtils.AreEqual(uint4(0x0000, 0x0000, 0x0001, 0x57B6), uint4(h0.x.value, h0.y.value, h0.z.value, h0.w.value)); + TestUtils.AreEqual(uint4(0x7BFF, 0x7C00, 0x7C00, 0xFE00), uint4(h1.x.value, h1.y.value, h1.z.value, h1.w.value)); + TestUtils.AreEqual(uint4(0x8000, 0x8001, 0xD7B6, 0xFBFF), uint4(h2.x.value, h2.y.value, h2.z.value, h2.w.value)); + TestUtils.AreEqual(uint4(0xFC00, 0xFC00, 0xFC00, 0x0000), uint4(h3.x.value, h3.y.value, h3.z.value, h3.w.value)); + } + + [TestCompiler] + [WindowsOnly("Mono on linux ignores signed zero.")] + public static void half4_from_double4_construction_signed_zero() + { + half4 h0 = half4(double4(TestUtils.SignedDoubleZero(), TestUtils.SignedDoubleZero(), TestUtils.SignedDoubleZero(), TestUtils.SignedDoubleZero())); + TestUtils.AreEqual(uint4(0x8000, 0x8000, 0x8000, 0x8000), uint4(h0.x.value, h0.y.value, h0.z.value, h0.w.value)); + } + + [TestCompiler] + public static void half_to_float() + { + TestUtils.AreEqual(0x00000000, asuint(new half { value = 0x0000 })); + TestUtils.AreEqual(0x3800C000, asuint(new half { value = 0x0203 })); + TestUtils.AreEqual(0x40642000, asuint(new half { value = 0x4321 })); + TestUtils.AreEqual(0x477FE000, asuint(new half { value = 0x7BFF })); + TestUtils.AreEqual(0x7F800000, asuint(new half { value = 0x7C00 })); + TestUtils.AreEqual(true, isnan(new half { value = 0x7C01 })); + + TestUtils.AreEqual(0x80000000, asuint(new half { value = 0x8000 })); + TestUtils.AreEqual(0xB800C000, asuint(new half { value = 0x8203 })); + TestUtils.AreEqual(0xC0642000, asuint(new half { value = 0xC321 })); + TestUtils.AreEqual(0xC77FE000, asuint(new half { value = 0xFBFF })); + TestUtils.AreEqual(0xFF800000, asuint(new half { value = 0xFC00 })); + TestUtils.AreEqual(true, isnan(new half { value = 0xFC01 })); + } + + [TestCompiler] + public static void half2_to_float2() + { + half2 h0; h0.x.value = 0x0000; h0.y.value = 0x0203; + half2 h1; h1.x.value = 0x4321; h1.y.value = 0x7BFF; + half2 h2; h2.x.value = 0x7C00; h2.y.value = 0x7C00; + half2 h3; h3.x.value = 0x7C01; h3.y.value = 0x7C01; + + half2 h4; h4.x.value = 0x8000; h4.y.value = 0x8203; + half2 h5; h5.x.value = 0xC321; h5.y.value = 0xFBFF; + half2 h6; h6.x.value = 0xFC00; h6.y.value = 0xFC00; + half2 h7; h7.x.value = 0xFC01; h7.y.value = 0xFC01; + + TestUtils.AreEqual(uint2(0x00000000, 0x3800C000), asuint(h0)); + TestUtils.AreEqual(uint2(0x40642000, 0x477FE000), asuint(h1)); + TestUtils.AreEqual(uint2(0x7F800000, 0x7F800000), asuint(h2)); + TestUtils.AreEqual(true, all(isnan(h3))); + + TestUtils.AreEqual(uint2(0x80000000, 0xB800C000), asuint(h4)); + TestUtils.AreEqual(uint2(0xC0642000, 0xC77FE000), asuint(h5)); + TestUtils.AreEqual(uint2(0xFF800000, 0xFF800000), asuint(h6)); + TestUtils.AreEqual(true, all(isnan(h7))); + } + + [TestCompiler] + public static void half3_to_float3() + { + half3 h0; h0.x.value = 0x0000; h0.y.value = 0x0203; h0.z.value = 0x4321; + half3 h1; h1.x.value = 0x7BFF; h1.y.value = 0x7C00; h1.z.value = 0x7C00; + half3 h2; h2.x.value = 0x7C01; h2.y.value = 0x7C01; h2.z.value = 0x7C01; + + half3 h3; h3.x.value = 0x8000; h3.y.value = 0x8203; h3.z.value = 0xC321; + half3 h4; h4.x.value = 0xFBFF; h4.y.value = 0xFC00; h4.z.value = 0xFC00; + half3 h5; h5.x.value = 0xFC01; h5.y.value = 0xFC01; h5.z.value = 0xFC01; + + TestUtils.AreEqual(uint3(0x00000000, 0x3800C000, 0x40642000), asuint(h0)); + TestUtils.AreEqual(uint3(0x477FE000, 0x7F800000, 0x7F800000), asuint(h1)); + TestUtils.AreEqual(true, all(isnan(h2))); + + TestUtils.AreEqual(uint3(0x80000000, 0xB800C000, 0xC0642000), asuint(h3)); + TestUtils.AreEqual(uint3(0xC77FE000, 0xFF800000, 0xFF800000), asuint(h4)); + TestUtils.AreEqual(true, all(isnan(h5))); + } + + [TestCompiler] + public static void half4_to_float4() + { + half4 h0; h0.x.value = 0x0000; h0.y.value = 0x0203; h0.z.value = 0x4321; h0.w.value = 0x7BFF; + half4 h1; h1.x.value = 0x7C00; h1.y.value = 0x7C00; h1.z.value = 0x7C00; h1.w.value = 0x7C00; + half4 h2; h2.x.value = 0x7C01; h2.y.value = 0x7C01; h2.z.value = 0x7C01; h2.w.value = 0x7C01; + + half4 h3; h3.x.value = 0x8000; h3.y.value = 0x8203; h3.z.value = 0xC321; h3.w.value = 0xFBFF; + half4 h4; h4.x.value = 0xFC00; h4.y.value = 0xFC00; h4.z.value = 0xFC00; h4.w.value = 0xFC00; + half4 h5; h5.x.value = 0xFC01; h5.y.value = 0xFC01; h5.z.value = 0xFC01; h5.w.value = 0xFC01; + + TestUtils.AreEqual(uint4(0x00000000, 0x3800C000, 0x40642000, 0x477FE000), asuint(h0)); + TestUtils.AreEqual(uint4(0x7F800000, 0x7F800000, 0x7F800000, 0x7F800000), asuint(h1)); + TestUtils.AreEqual(true, all(isnan(h2))); + + TestUtils.AreEqual(uint4(0x80000000, 0xB800C000, 0xC0642000, 0xC77FE000), asuint(h3)); + TestUtils.AreEqual(uint4(0xFF800000, 0xFF800000, 0xFF800000, 0xFF800000), asuint(h4)); + TestUtils.AreEqual(true, all(isnan(h5))); + } + + + [TestCompiler] + public static void half_to_double() + { + TestUtils.AreEqual(0x0000000000000000u, asulong((double)new half { value = 0x0000 })); + TestUtils.AreEqual(0x3F00180000000000u, asulong((double)new half { value = 0x0203 })); + TestUtils.AreEqual(0x400C840000000000u, asulong((double)new half { value = 0x4321 })); + TestUtils.AreEqual(0x40eFFC0000000000u, asulong((double)new half { value = 0x7BFF })); + TestUtils.AreEqual(0x7FF0000000000000u, asulong((double)new half { value = 0x7C00 })); + TestUtils.AreEqual(true, isnan((double)new half { value = 0x7C01 })); + + TestUtils.AreEqual(0x8000000000000000u, asulong((double)new half { value = 0x8000 })); + TestUtils.AreEqual(0xBF00180000000000u, asulong((double)new half { value = 0x8203 })); + TestUtils.AreEqual(0xC00C840000000000u, asulong((double)new half { value = 0xC321 })); + TestUtils.AreEqual(0xC0eFFC0000000000u, asulong((double)new half { value = 0xFBFF })); + TestUtils.AreEqual(0xFFF0000000000000u, asulong((double)new half { value = 0xFC00 })); + TestUtils.AreEqual(true, isnan((double)new half { value = 0xFC01 })); + } + + + [TestCompiler] + public static void half_from_float_explicit_conversion() + { + half h = (half)123.4f; + TestUtils.AreEqual(0x57B6, h.value); + } + + [TestCompiler] + public static void half2_from_float2_explicit_conversion() + { + half2 h = (half2)float2(123.4f, 5.96046448e-08f); + TestUtils.AreEqual(0x57B6, h.x.value); + TestUtils.AreEqual(0x0001, h.y.value); + } + + [TestCompiler] + public static void half3_from_float3_explicit_conversion() + { + half3 h = (half3)float3(123.4f, 5.96046448e-08f, -65504.0f); + TestUtils.AreEqual(0x57B6, h.x.value); + TestUtils.AreEqual(0x0001, h.y.value); + TestUtils.AreEqual(0xFBFF, h.z.value); + } + + [TestCompiler] + public static void half4_from_float4_explicit_conversion() + { + half4 h = (half4)float4(123.4f, 5.96046448e-08f, -65504.0f, float.PositiveInfinity); + TestUtils.AreEqual(0x57B6, h.x.value); + TestUtils.AreEqual(0x0001, h.y.value); + TestUtils.AreEqual(0xFBFF, h.z.value); + TestUtils.AreEqual(0x7C00, h.w.value); + } + + [TestCompiler] + public static void half_from_double_explicit_conversion() + { + half h = (half)123.4; + TestUtils.AreEqual(0x57B6, h.value); + } + + + [TestCompiler] + public static void half_to_float_implicit_conversion() + { + half h; h.value = 0x0203; + float f = h; + TestUtils.AreEqual(0x3800C000, asuint(f)); + } + + [TestCompiler] + public static void half2_to_float2_implicit_conversion() + { + half2 h; h.x.value = 0x0203; h.y.value = 0x8203; + float2 f = h; + TestUtils.AreEqual(0x3800C000, asuint(f.x)); + TestUtils.AreEqual(0xB800C000, asuint(f.y)); + } + + [TestCompiler] + public static void half3_to_float3_implicit_conversion() + { + half3 h; h.x.value = 0x0203; h.y.value = 0x8203; h.z.value = 0x7BFF; + float3 f = h; + TestUtils.AreEqual(0x3800C000, asuint(f.x)); + TestUtils.AreEqual(0xB800C000, asuint(f.y)); + TestUtils.AreEqual(0x477FE000, asuint(f.z)); + } + + [TestCompiler] + public static void half4_to_float4_implicit_conversion() + { + half4 h; h.x.value = 0x0203; h.y.value = 0x8203; h.z.value = 0x7BFF; h.w.value = 0x7C00; + float4 f = h; + TestUtils.AreEqual(0x3800C000, asuint(f.x)); + TestUtils.AreEqual(0xB800C000, asuint(f.y)); + TestUtils.AreEqual(0x477FE000, asuint(f.z)); + TestUtils.AreEqual(0x7F800000, asuint(f.w)); + } + + [TestCompiler] + public static void half_to_double_implicit_conversion() + { + half h; h.value = 0x0203; + double f = h; + + TestUtils.AreEqual(0x3F00180000000000u, asulong(f)); + } + + [TestCompiler] + public static void half_minvalue() + { + half min = new half(half.MinValue); + TestUtils.AreEqual(0xfbff, min.value); + } + + [TestCompiler] + public static void half_maxvalue() + { + half max = new half(half.MaxValue); + TestUtils.AreEqual(0x7bff, max.value); + } + + [TestCompiler] + public static void half_minvalueashalf() + { + TestUtils.AreEqual(0xfbff, half.MinValueAsHalf.value); + } + + [TestCompiler] + public static void half_maxvalueashalf() + { + TestUtils.AreEqual(0x7bff, half.MaxValueAsHalf.value); + } + + [TestCompiler] + public static void half2_minvalue() + { + half2 min = half.MinValueAsHalf; + TestUtils.AreEqual(0xfbff, min.x.value); + TestUtils.AreEqual(0xfbff, min.y.value); + } + + [TestCompiler] + public static void half2_maxvalue() + { + half2 max = half.MaxValueAsHalf; + TestUtils.AreEqual(0x7bff, max.x.value); + TestUtils.AreEqual(0x7bff, max.y.value); + } + + [TestCompiler] + public static void half3_minvalue() + { + half3 min = half.MinValueAsHalf; + TestUtils.AreEqual(0xfbff, min.x.value); + TestUtils.AreEqual(0xfbff, min.y.value); + TestUtils.AreEqual(0xfbff, min.z.value); + } + + [TestCompiler] + public static void half3_maxvalue() + { + half3 max = half.MaxValueAsHalf; + TestUtils.AreEqual(0x7bff, max.x.value); + TestUtils.AreEqual(0x7bff, max.y.value); + TestUtils.AreEqual(0x7bff, max.z.value); + } + + [TestCompiler] + public static void half4_minvalue() + { + half4 min = half.MinValueAsHalf; + TestUtils.AreEqual(0xfbff, min.x.value); + TestUtils.AreEqual(0xfbff, min.y.value); + TestUtils.AreEqual(0xfbff, min.z.value); + TestUtils.AreEqual(0xfbff, min.w.value); + } + + [TestCompiler] + public static void half4_maxvalue() + { + half4 max = half.MaxValueAsHalf; + TestUtils.AreEqual(0x7bff, max.x.value); + TestUtils.AreEqual(0x7bff, max.y.value); + TestUtils.AreEqual(0x7bff, max.z.value); + TestUtils.AreEqual(0x7bff, max.w.value); + } + + [TestCase] + public static void half_EqualsObjectOverride() + { + TestUtils.IsFalse(new half().Equals((object) new int())); + TestUtils.IsTrue(new half().Equals((object) new half())); + } + + [TestCase] + public static void half2_EqualsObjectOverride() + { + TestUtils.IsFalse(new half2().Equals((object) new int())); + TestUtils.IsTrue(new half2().Equals((object) new half2())); + } + + [TestCase] + public static void half3_EqualsObjectOverride() + { + TestUtils.IsFalse(new half3().Equals((object) new int())); + TestUtils.IsTrue(new half3().Equals((object) new half3())); + } + + [TestCase] + public static void half4_EqualsObjectOverride() + { + TestUtils.IsFalse(new half4().Equals((object) new int())); + TestUtils.IsTrue(new half4().Equals((object) new half4())); + } + } +} diff --git a/src/Tests/Tests/Shared/TestHalf.cs.meta b/src/Tests/Tests/Shared/TestHalf.cs.meta new file mode 100644 index 00000000..291a364e --- /dev/null +++ b/src/Tests/Tests/Shared/TestHalf.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dba01b4c9788ea04d87865908e0ba344 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestInt2.gen.cs b/src/Tests/Tests/Shared/TestInt2.gen.cs new file mode 100644 index 00000000..75f6aba0 --- /dev/null +++ b/src/Tests/Tests/Shared/TestInt2.gen.cs @@ -0,0 +1,1346 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestInt2 + { + [TestCompiler] + public static void int2_zero() + { + TestUtils.AreEqual(0, int2.zero.x); + TestUtils.AreEqual(0, int2.zero.y); + } + + [TestCompiler] + public static void int2_constructor() + { + int2 a = new int2(1, 2); + TestUtils.AreEqual(1, a.x); + TestUtils.AreEqual(2, a.y); + } + + [TestCompiler] + public static void int2_scalar_constructor() + { + int2 a = new int2(17); + TestUtils.AreEqual(17, a.x); + TestUtils.AreEqual(17, a.y); + } + + [TestCompiler] + public static void int2_static_constructor() + { + int2 a = int2(1, 2); + TestUtils.AreEqual(1, a.x); + TestUtils.AreEqual(2, a.y); + } + + [TestCompiler] + public static void int2_static_scalar_constructor() + { + int2 a = int2(17); + TestUtils.AreEqual(17, a.x); + TestUtils.AreEqual(17, a.y); + } + + [TestCompiler] + public static void int2_operator_equal_wide_wide() + { + int2 a0 = int2(2105871082, 35218899); + int2 b0 = int2(1477587886, 579629692); + bool2 r0 = bool2(false, false); + TestUtils.AreEqual(r0, a0 == b0); + + int2 a1 = int2(1550755093, 764676020); + int2 b1 = int2(540974792, 208405066); + bool2 r1 = bool2(false, false); + TestUtils.AreEqual(r1, a1 == b1); + + int2 a2 = int2(606743782, 1208156098); + int2 b2 = int2(2063397938, 1060167409); + bool2 r2 = bool2(false, false); + TestUtils.AreEqual(r2, a2 == b2); + + int2 a3 = int2(1023640014, 1038468316); + int2 b3 = int2(362592601, 2097545362); + bool2 r3 = bool2(false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void int2_operator_equal_wide_scalar() + { + int2 a0 = int2(437822262, 2020661134); + int b0 = (1332833578); + bool2 r0 = bool2(false, false); + TestUtils.AreEqual(r0, a0 == b0); + + int2 a1 = int2(541786900, 23716499); + int b1 = (853113810); + bool2 r1 = bool2(false, false); + TestUtils.AreEqual(r1, a1 == b1); + + int2 a2 = int2(179951405, 948838849); + int b2 = (1409026299); + bool2 r2 = bool2(false, false); + TestUtils.AreEqual(r2, a2 == b2); + + int2 a3 = int2(953202998, 1926262965); + int b3 = (691955848); + bool2 r3 = bool2(false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void int2_operator_equal_scalar_wide() + { + int a0 = (542329200); + int2 b0 = int2(1115584594, 684107773); + bool2 r0 = bool2(false, false); + TestUtils.AreEqual(r0, a0 == b0); + + int a1 = (1928988941); + int2 b1 = int2(890709324, 641152437); + bool2 r1 = bool2(false, false); + TestUtils.AreEqual(r1, a1 == b1); + + int a2 = (1410341302); + int2 b2 = int2(497505660, 1068223109); + bool2 r2 = bool2(false, false); + TestUtils.AreEqual(r2, a2 == b2); + + int a3 = (2014009435); + int2 b3 = int2(213835595, 1592428361); + bool2 r3 = bool2(false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void int2_operator_not_equal_wide_wide() + { + int2 a0 = int2(1977284100, 1293292704); + int2 b0 = int2(1514195556, 957972049); + bool2 r0 = bool2(true, true); + TestUtils.AreEqual(r0, a0 != b0); + + int2 a1 = int2(1547283851, 422428953); + int2 b1 = int2(507667364, 581861672); + bool2 r1 = bool2(true, true); + TestUtils.AreEqual(r1, a1 != b1); + + int2 a2 = int2(195833190, 1711544892); + int2 b2 = int2(1128094576, 940096636); + bool2 r2 = bool2(true, true); + TestUtils.AreEqual(r2, a2 != b2); + + int2 a3 = int2(5606053, 737069074); + int2 b3 = int2(57559040, 181752616); + bool2 r3 = bool2(true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void int2_operator_not_equal_wide_scalar() + { + int2 a0 = int2(1038269360, 1427812625); + int b0 = (768873026); + bool2 r0 = bool2(true, true); + TestUtils.AreEqual(r0, a0 != b0); + + int2 a1 = int2(103361237, 1523584313); + int b1 = (1347017023); + bool2 r1 = bool2(true, true); + TestUtils.AreEqual(r1, a1 != b1); + + int2 a2 = int2(150442802, 719113717); + int b2 = (660334527); + bool2 r2 = bool2(true, true); + TestUtils.AreEqual(r2, a2 != b2); + + int2 a3 = int2(262959423, 506946952); + int b3 = (484398043); + bool2 r3 = bool2(true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void int2_operator_not_equal_scalar_wide() + { + int a0 = (1652127596); + int2 b0 = int2(953791238, 271722683); + bool2 r0 = bool2(true, true); + TestUtils.AreEqual(r0, a0 != b0); + + int a1 = (1278885987); + int2 b1 = int2(735128017, 112416504); + bool2 r1 = bool2(true, true); + TestUtils.AreEqual(r1, a1 != b1); + + int a2 = (25967222); + int2 b2 = int2(1761444475, 1844594536); + bool2 r2 = bool2(true, true); + TestUtils.AreEqual(r2, a2 != b2); + + int a3 = (1199122922); + int2 b3 = int2(634219279, 942501101); + bool2 r3 = bool2(true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void int2_operator_less_wide_wide() + { + int2 a0 = int2(1486550609, 1779244308); + int2 b0 = int2(97842578, 536551311); + bool2 r0 = bool2(false, false); + TestUtils.AreEqual(r0, a0 < b0); + + int2 a1 = int2(1602148045, 1614085440); + int2 b1 = int2(413528975, 1838293684); + bool2 r1 = bool2(false, true); + TestUtils.AreEqual(r1, a1 < b1); + + int2 a2 = int2(1975613414, 942838342); + int2 b2 = int2(1283898480, 1456599961); + bool2 r2 = bool2(false, true); + TestUtils.AreEqual(r2, a2 < b2); + + int2 a3 = int2(1092279031, 373677431); + int2 b3 = int2(1080278602, 529676676); + bool2 r3 = bool2(false, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void int2_operator_less_wide_scalar() + { + int2 a0 = int2(796797557, 670113454); + int b0 = (746564682); + bool2 r0 = bool2(false, true); + TestUtils.AreEqual(r0, a0 < b0); + + int2 a1 = int2(933579492, 318174822); + int b1 = (278884514); + bool2 r1 = bool2(false, false); + TestUtils.AreEqual(r1, a1 < b1); + + int2 a2 = int2(1117630673, 1990922600); + int b2 = (741886928); + bool2 r2 = bool2(false, false); + TestUtils.AreEqual(r2, a2 < b2); + + int2 a3 = int2(1030849597, 1718582899); + int b3 = (1546212312); + bool2 r3 = bool2(true, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void int2_operator_less_scalar_wide() + { + int a0 = (186400299); + int2 b0 = int2(1881344229, 813834467); + bool2 r0 = bool2(true, true); + TestUtils.AreEqual(r0, a0 < b0); + + int a1 = (1254886626); + int2 b1 = int2(1353590345, 1412343685); + bool2 r1 = bool2(true, true); + TestUtils.AreEqual(r1, a1 < b1); + + int a2 = (1555571443); + int2 b2 = int2(1540508298, 1735458634); + bool2 r2 = bool2(false, true); + TestUtils.AreEqual(r2, a2 < b2); + + int a3 = (135888070); + int2 b3 = int2(1643818742, 248291654); + bool2 r3 = bool2(true, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void int2_operator_greater_wide_wide() + { + int2 a0 = int2(2087717754, 1725569452); + int2 b0 = int2(85148514, 293632137); + bool2 r0 = bool2(true, true); + TestUtils.AreEqual(r0, a0 > b0); + + int2 a1 = int2(1298066182, 1693943616); + int2 b1 = int2(1151128249, 409440398); + bool2 r1 = bool2(true, true); + TestUtils.AreEqual(r1, a1 > b1); + + int2 a2 = int2(1319019629, 70674491); + int2 b2 = int2(1115020183, 1508500597); + bool2 r2 = bool2(true, false); + TestUtils.AreEqual(r2, a2 > b2); + + int2 a3 = int2(1042499725, 1002821508); + int2 b3 = int2(1834583302, 1755218534); + bool2 r3 = bool2(false, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void int2_operator_greater_wide_scalar() + { + int2 a0 = int2(1208626274, 239697208); + int b0 = (1715176566); + bool2 r0 = bool2(false, false); + TestUtils.AreEqual(r0, a0 > b0); + + int2 a1 = int2(1979453345, 1590192876); + int b1 = (1253474001); + bool2 r1 = bool2(true, true); + TestUtils.AreEqual(r1, a1 > b1); + + int2 a2 = int2(1487911635, 1662650098); + int b2 = (1673945595); + bool2 r2 = bool2(false, false); + TestUtils.AreEqual(r2, a2 > b2); + + int2 a3 = int2(222749855, 566635217); + int b3 = (1433540517); + bool2 r3 = bool2(false, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void int2_operator_greater_scalar_wide() + { + int a0 = (480938827); + int2 b0 = int2(1824731899, 921496110); + bool2 r0 = bool2(false, false); + TestUtils.AreEqual(r0, a0 > b0); + + int a1 = (586859044); + int2 b1 = int2(946430596, 1231356727); + bool2 r1 = bool2(false, false); + TestUtils.AreEqual(r1, a1 > b1); + + int a2 = (1390167458); + int2 b2 = int2(1785807092, 28949024); + bool2 r2 = bool2(false, true); + TestUtils.AreEqual(r2, a2 > b2); + + int a3 = (2037899283); + int2 b3 = int2(595656760, 1778095771); + bool2 r3 = bool2(true, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void int2_operator_less_equal_wide_wide() + { + int2 a0 = int2(154092149, 1515170149); + int2 b0 = int2(77984380, 1712054191); + bool2 r0 = bool2(false, true); + TestUtils.AreEqual(r0, a0 <= b0); + + int2 a1 = int2(1083970332, 785807178); + int2 b1 = int2(1566203809, 254834519); + bool2 r1 = bool2(true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + int2 a2 = int2(1401094881, 310537627); + int2 b2 = int2(450519938, 389457083); + bool2 r2 = bool2(false, true); + TestUtils.AreEqual(r2, a2 <= b2); + + int2 a3 = int2(868328962, 1990816725); + int2 b3 = int2(1298669505, 207343167); + bool2 r3 = bool2(true, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void int2_operator_less_equal_wide_scalar() + { + int2 a0 = int2(1479531977, 1427983411); + int b0 = (2004563877); + bool2 r0 = bool2(true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + int2 a1 = int2(415250630, 1112546666); + int b1 = (1245345407); + bool2 r1 = bool2(true, true); + TestUtils.AreEqual(r1, a1 <= b1); + + int2 a2 = int2(1072990632, 101048307); + int b2 = (1579912858); + bool2 r2 = bool2(true, true); + TestUtils.AreEqual(r2, a2 <= b2); + + int2 a3 = int2(1070894375, 1910488590); + int b3 = (509818792); + bool2 r3 = bool2(false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void int2_operator_less_equal_scalar_wide() + { + int a0 = (1899193992); + int2 b0 = int2(915011820, 980913757); + bool2 r0 = bool2(false, false); + TestUtils.AreEqual(r0, a0 <= b0); + + int a1 = (1337699683); + int2 b1 = int2(1476321359, 1102143668); + bool2 r1 = bool2(true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + int a2 = (660493983); + int2 b2 = int2(184664508, 381579707); + bool2 r2 = bool2(false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + int a3 = (1954892821); + int2 b3 = int2(1295090571, 1440368586); + bool2 r3 = bool2(false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void int2_operator_greater_equal_wide_wide() + { + int2 a0 = int2(8538378, 2131749726); + int2 b0 = int2(903145828, 1697992986); + bool2 r0 = bool2(false, true); + TestUtils.AreEqual(r0, a0 >= b0); + + int2 a1 = int2(265427108, 523609761); + int2 b1 = int2(1432491982, 169789504); + bool2 r1 = bool2(false, true); + TestUtils.AreEqual(r1, a1 >= b1); + + int2 a2 = int2(994991818, 839709564); + int2 b2 = int2(1059357300, 1744255222); + bool2 r2 = bool2(false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + int2 a3 = int2(101288202, 1886280970); + int2 b3 = int2(1606584463, 1905414425); + bool2 r3 = bool2(false, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void int2_operator_greater_equal_wide_scalar() + { + int2 a0 = int2(2049236663, 182691143); + int b0 = (1061998015); + bool2 r0 = bool2(true, false); + TestUtils.AreEqual(r0, a0 >= b0); + + int2 a1 = int2(634973382, 439837565); + int b1 = (1197012109); + bool2 r1 = bool2(false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + int2 a2 = int2(1367606469, 351147187); + int b2 = (1108037359); + bool2 r2 = bool2(true, false); + TestUtils.AreEqual(r2, a2 >= b2); + + int2 a3 = int2(1898505669, 1998610091); + int b3 = (411667685); + bool2 r3 = bool2(true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void int2_operator_greater_equal_scalar_wide() + { + int a0 = (1859811087); + int2 b0 = int2(1070365918, 1783869452); + bool2 r0 = bool2(true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + int a1 = (830091760); + int2 b1 = int2(377157428, 327199016); + bool2 r1 = bool2(true, true); + TestUtils.AreEqual(r1, a1 >= b1); + + int a2 = (90384229); + int2 b2 = int2(1154649706, 376758501); + bool2 r2 = bool2(false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + int a3 = (1079802834); + int2 b3 = int2(2054742898, 1328349472); + bool2 r3 = bool2(false, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void int2_operator_add_wide_wide() + { + int2 a0 = int2(2135171378, 21433296); + int2 b0 = int2(1013431952, 366718162); + int2 r0 = int2(-1146363966, 388151458); + TestUtils.AreEqual(r0, a0 + b0); + + int2 a1 = int2(1954723494, 683604307); + int2 b1 = int2(359290756, 1393163294); + int2 r1 = int2(-1980953046, 2076767601); + TestUtils.AreEqual(r1, a1 + b1); + + int2 a2 = int2(1054212315, 1762680995); + int2 b2 = int2(1962236872, 1263270041); + int2 r2 = int2(-1278518109, -1269016260); + TestUtils.AreEqual(r2, a2 + b2); + + int2 a3 = int2(1963655852, 1257853062); + int2 b3 = int2(1862666629, 1077447887); + int2 r3 = int2(-468644815, -1959666347); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void int2_operator_add_wide_scalar() + { + int2 a0 = int2(665815972, 1783729250); + int b0 = (1334043849); + int2 r0 = int2(1999859821, -1177194197); + TestUtils.AreEqual(r0, a0 + b0); + + int2 a1 = int2(1591678394, 977850224); + int b1 = (1284528538); + int2 r1 = int2(-1418760364, -2032588534); + TestUtils.AreEqual(r1, a1 + b1); + + int2 a2 = int2(71069732, 1200356017); + int b2 = (1138577680); + int2 r2 = int2(1209647412, -1956033599); + TestUtils.AreEqual(r2, a2 + b2); + + int2 a3 = int2(565982008, 1088001167); + int b3 = (1246759684); + int2 r3 = int2(1812741692, -1960206445); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void int2_operator_add_scalar_wide() + { + int a0 = (359966320); + int2 b0 = int2(2146146202, 767103309); + int2 r0 = int2(-1788854774, 1127069629); + TestUtils.AreEqual(r0, a0 + b0); + + int a1 = (851002415); + int2 b1 = int2(311531406, 1491262941); + int2 r1 = int2(1162533821, -1952701940); + TestUtils.AreEqual(r1, a1 + b1); + + int a2 = (1016891373); + int2 b2 = int2(1954228994, 1671335850); + int2 r2 = int2(-1323846929, -1606740073); + TestUtils.AreEqual(r2, a2 + b2); + + int a3 = (727870747); + int2 b3 = int2(551151834, 1390261152); + int2 r3 = int2(1279022581, 2118131899); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void int2_operator_sub_wide_wide() + { + int2 a0 = int2(1410318491, 1097280168); + int2 b0 = int2(1315897366, 799052018); + int2 r0 = int2(94421125, 298228150); + TestUtils.AreEqual(r0, a0 - b0); + + int2 a1 = int2(1827039044, 28881338); + int2 b1 = int2(1580289673, 1094686261); + int2 r1 = int2(246749371, -1065804923); + TestUtils.AreEqual(r1, a1 - b1); + + int2 a2 = int2(328720965, 875487868); + int2 b2 = int2(1954325726, 1197734816); + int2 r2 = int2(-1625604761, -322246948); + TestUtils.AreEqual(r2, a2 - b2); + + int2 a3 = int2(212936325, 231977215); + int2 b3 = int2(229886366, 915679176); + int2 r3 = int2(-16950041, -683701961); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void int2_operator_sub_wide_scalar() + { + int2 a0 = int2(1508669340, 1594795463); + int b0 = (998008471); + int2 r0 = int2(510660869, 596786992); + TestUtils.AreEqual(r0, a0 - b0); + + int2 a1 = int2(266707545, 287705008); + int b1 = (643102647); + int2 r1 = int2(-376395102, -355397639); + TestUtils.AreEqual(r1, a1 - b1); + + int2 a2 = int2(1475644328, 979450511); + int b2 = (1113286221); + int2 r2 = int2(362358107, -133835710); + TestUtils.AreEqual(r2, a2 - b2); + + int2 a3 = int2(2082174113, 304369206); + int b3 = (1108005498); + int2 r3 = int2(974168615, -803636292); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void int2_operator_sub_scalar_wide() + { + int a0 = (893369501); + int2 b0 = int2(2051906184, 1699714311); + int2 r0 = int2(-1158536683, -806344810); + TestUtils.AreEqual(r0, a0 - b0); + + int a1 = (442603706); + int2 b1 = int2(1735141684, 274533585); + int2 r1 = int2(-1292537978, 168070121); + TestUtils.AreEqual(r1, a1 - b1); + + int a2 = (811580259); + int2 b2 = int2(1196354320, 1524097023); + int2 r2 = int2(-384774061, -712516764); + TestUtils.AreEqual(r2, a2 - b2); + + int a3 = (533621527); + int2 b3 = int2(2080845793, 143958837); + int2 r3 = int2(-1547224266, 389662690); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void int2_operator_mul_wide_wide() + { + int2 a0 = int2(61417577, 219585476); + int2 b0 = int2(578042444, 1620527213); + int2 r0 = int2(-1426863828, 1326150260); + TestUtils.AreEqual(r0, a0 * b0); + + int2 a1 = int2(1362520891, 1511084277); + int2 b1 = int2(200516468, 309339115); + int2 r1 = int2(-990894148, -1322856473); + TestUtils.AreEqual(r1, a1 * b1); + + int2 a2 = int2(1481211272, 58211871); + int2 b2 = int2(542853019, 299467282); + int2 r2 = int2(1973926232, 88546350); + TestUtils.AreEqual(r2, a2 * b2); + + int2 a3 = int2(1459591173, 567624644); + int2 b3 = int2(1479641221, 1428338601); + int2 r3 = int2(-863919463, -582821788); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void int2_operator_mul_wide_scalar() + { + int2 a0 = int2(871746615, 492532311); + int b0 = (442064533); + int2 r0 = int2(338365955, 1081376419); + TestUtils.AreEqual(r0, a0 * b0); + + int2 a1 = int2(570557670, 1610315153); + int b1 = (2142306629); + int2 r1 = int2(-1449773058, 310198549); + TestUtils.AreEqual(r1, a1 * b1); + + int2 a2 = int2(1526163563, 257439514); + int b2 = (118471734); + int2 r2 = int2(-333210990, -174540932); + TestUtils.AreEqual(r2, a2 * b2); + + int2 a3 = int2(364291059, 1584938026); + int b3 = (1186560810); + int2 r3 = int2(1029154526, 989596900); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void int2_operator_mul_scalar_wide() + { + int a0 = (1152242766); + int2 b0 = int2(1276636134, 2105929407); + int2 r0 = int2(-2129504236, 999811634); + TestUtils.AreEqual(r0, a0 * b0); + + int a1 = (499007702); + int2 b1 = int2(124002565, 1956335172); + int2 r1 = int2(1219156526, 400321752); + TestUtils.AreEqual(r1, a1 * b1); + + int a2 = (1288034953); + int2 b2 = int2(832676555, 337389733); + int2 r2 = int2(-1101529949, 10961485); + TestUtils.AreEqual(r2, a2 * b2); + + int a3 = (99268757); + int2 b3 = int2(2005055247, 2011389505); + int2 r3 = int2(559764411, -1619094571); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void int2_operator_div_wide_wide() + { + int2 a0 = int2(333171510, 858154903); + int2 b0 = int2(698897823, 440199998); + int2 r0 = int2(0, 1); + TestUtils.AreEqual(r0, a0 / b0); + + int2 a1 = int2(1181365836, 671357749); + int2 b1 = int2(655557473, 1658534285); + int2 r1 = int2(1, 0); + TestUtils.AreEqual(r1, a1 / b1); + + int2 a2 = int2(1090606752, 803759420); + int2 b2 = int2(2127220100, 315653188); + int2 r2 = int2(0, 2); + TestUtils.AreEqual(r2, a2 / b2); + + int2 a3 = int2(788404166, 296807814); + int2 b3 = int2(1814290360, 992173243); + int2 r3 = int2(0, 0); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void int2_operator_div_wide_scalar() + { + int2 a0 = int2(1433072926, 1073958635); + int b0 = (1434025872); + int2 r0 = int2(0, 0); + TestUtils.AreEqual(r0, a0 / b0); + + int2 a1 = int2(1195142312, 1274375693); + int b1 = (536596719); + int2 r1 = int2(2, 2); + TestUtils.AreEqual(r1, a1 / b1); + + int2 a2 = int2(464756346, 906504670); + int b2 = (806462546); + int2 r2 = int2(0, 1); + TestUtils.AreEqual(r2, a2 / b2); + + int2 a3 = int2(1380905136, 1196815948); + int b3 = (25493909); + int2 r3 = int2(54, 46); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void int2_operator_div_scalar_wide() + { + int a0 = (519165704); + int2 b0 = int2(1295178177, 775214121); + int2 r0 = int2(0, 0); + TestUtils.AreEqual(r0, a0 / b0); + + int a1 = (467772046); + int2 b1 = int2(1156881598, 310396565); + int2 r1 = int2(0, 1); + TestUtils.AreEqual(r1, a1 / b1); + + int a2 = (759759959); + int2 b2 = int2(243837702, 1616314235); + int2 r2 = int2(3, 0); + TestUtils.AreEqual(r2, a2 / b2); + + int a3 = (1053470225); + int2 b3 = int2(1320630160, 378773841); + int2 r3 = int2(0, 2); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void int2_operator_mod_wide_wide() + { + int2 a0 = int2(258342924, 1454754891); + int2 b0 = int2(1990080167, 1197348066); + int2 r0 = int2(258342924, 257406825); + TestUtils.AreEqual(r0, a0 % b0); + + int2 a1 = int2(723352342, 1981431473); + int2 b1 = int2(651970512, 1659454050); + int2 r1 = int2(71381830, 321977423); + TestUtils.AreEqual(r1, a1 % b1); + + int2 a2 = int2(531756042, 716993627); + int2 b2 = int2(241005212, 1866255454); + int2 r2 = int2(49745618, 716993627); + TestUtils.AreEqual(r2, a2 % b2); + + int2 a3 = int2(1667903349, 1331097004); + int2 b3 = int2(1440101415, 595220963); + int2 r3 = int2(227801934, 140655078); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void int2_operator_mod_wide_scalar() + { + int2 a0 = int2(560988938, 629524514); + int b0 = (1156862367); + int2 r0 = int2(560988938, 629524514); + TestUtils.AreEqual(r0, a0 % b0); + + int2 a1 = int2(767711194, 1399805893); + int b1 = (434281967); + int2 r1 = int2(333429227, 96959992); + TestUtils.AreEqual(r1, a1 % b1); + + int2 a2 = int2(792916846, 598661916); + int b2 = (1663690927); + int2 r2 = int2(792916846, 598661916); + TestUtils.AreEqual(r2, a2 % b2); + + int2 a3 = int2(1776636144, 1743722161); + int b3 = (1287035793); + int2 r3 = int2(489600351, 456686368); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void int2_operator_mod_scalar_wide() + { + int a0 = (933347930); + int2 b0 = int2(549923387, 243114953); + int2 r0 = int2(383424543, 204003071); + TestUtils.AreEqual(r0, a0 % b0); + + int a1 = (1884274390); + int2 b1 = int2(1428033594, 655531454); + int2 r1 = int2(456240796, 573211482); + TestUtils.AreEqual(r1, a1 % b1); + + int a2 = (1622674954); + int2 b2 = int2(1107563514, 1614111094); + int2 r2 = int2(515111440, 8563860); + TestUtils.AreEqual(r2, a2 % b2); + + int a3 = (914801920); + int2 b3 = int2(1432263179, 564431096); + int2 r3 = int2(914801920, 350370824); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void int2_operator_plus() + { + int2 a0 = int2(195392567, 222719748); + int2 r0 = int2(195392567, 222719748); + TestUtils.AreEqual(r0, +a0); + + int2 a1 = int2(1002351013, 109389333); + int2 r1 = int2(1002351013, 109389333); + TestUtils.AreEqual(r1, +a1); + + int2 a2 = int2(1515950277, 291471785); + int2 r2 = int2(1515950277, 291471785); + TestUtils.AreEqual(r2, +a2); + + int2 a3 = int2(264115671, 195779102); + int2 r3 = int2(264115671, 195779102); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void int2_operator_neg() + { + int2 a0 = int2(1385088677, 94114564); + int2 r0 = int2(-1385088677, -94114564); + TestUtils.AreEqual(r0, -a0); + + int2 a1 = int2(1350664872, 2067164853); + int2 r1 = int2(-1350664872, -2067164853); + TestUtils.AreEqual(r1, -a1); + + int2 a2 = int2(218122493, 270553961); + int2 r2 = int2(-218122493, -270553961); + TestUtils.AreEqual(r2, -a2); + + int2 a3 = int2(446497525, 1928771252); + int2 r3 = int2(-446497525, -1928771252); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void int2_operator_prefix_inc() + { + int2 a0 = int2(780471723, 954741756); + int2 r0 = int2(780471724, 954741757); + TestUtils.AreEqual(r0, ++a0); + + int2 a1 = int2(272723451, 606294309); + int2 r1 = int2(272723452, 606294310); + TestUtils.AreEqual(r1, ++a1); + + int2 a2 = int2(1514814550, 444189162); + int2 r2 = int2(1514814551, 444189163); + TestUtils.AreEqual(r2, ++a2); + + int2 a3 = int2(1833356994, 1348278302); + int2 r3 = int2(1833356995, 1348278303); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void int2_operator_postfix_inc() + { + int2 a0 = int2(241865086, 2145821641); + int2 r0 = int2(241865086, 2145821641); + TestUtils.AreEqual(r0, a0++); + + int2 a1 = int2(1596166022, 529551271); + int2 r1 = int2(1596166022, 529551271); + TestUtils.AreEqual(r1, a1++); + + int2 a2 = int2(1656767229, 1213663244); + int2 r2 = int2(1656767229, 1213663244); + TestUtils.AreEqual(r2, a2++); + + int2 a3 = int2(1425753247, 389844650); + int2 r3 = int2(1425753247, 389844650); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void int2_operator_prefix_dec() + { + int2 a0 = int2(1331961415, 1612382200); + int2 r0 = int2(1331961414, 1612382199); + TestUtils.AreEqual(r0, --a0); + + int2 a1 = int2(1401591249, 1757136546); + int2 r1 = int2(1401591248, 1757136545); + TestUtils.AreEqual(r1, --a1); + + int2 a2 = int2(1895858159, 578341664); + int2 r2 = int2(1895858158, 578341663); + TestUtils.AreEqual(r2, --a2); + + int2 a3 = int2(1336115745, 1169239112); + int2 r3 = int2(1336115744, 1169239111); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void int2_operator_postfix_dec() + { + int2 a0 = int2(1870005937, 1708534798); + int2 r0 = int2(1870005937, 1708534798); + TestUtils.AreEqual(r0, a0--); + + int2 a1 = int2(704493460, 2060593573); + int2 r1 = int2(704493460, 2060593573); + TestUtils.AreEqual(r1, a1--); + + int2 a2 = int2(228744869, 1818778351); + int2 r2 = int2(228744869, 1818778351); + TestUtils.AreEqual(r2, a2--); + + int2 a3 = int2(1015253889, 1401191870); + int2 r3 = int2(1015253889, 1401191870); + TestUtils.AreEqual(r3, a3--); + } + + [TestCompiler] + public static void int2_operator_bitwise_and_wide_wide() + { + int2 a0 = int2(1055241304, 859321394); + int2 b0 = int2(749698416, 748105424); + int2 r0 = int2(749024336, 537928720); + TestUtils.AreEqual(r0, a0 & b0); + + int2 a1 = int2(1088358961, 2090949513); + int2 b1 = int2(1842764797, 9990577); + int2 r1 = int2(1087769137, 8409473); + TestUtils.AreEqual(r1, a1 & b1); + + int2 a2 = int2(300561740, 651904515); + int2 b2 = int2(1989102105, 1666634755); + int2 r2 = int2(277479432, 575816707); + TestUtils.AreEqual(r2, a2 & b2); + + int2 a3 = int2(1331035868, 2012752753); + int2 b3 = int2(58116798, 868036607); + int2 r3 = int2(55888540, 867707761); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void int2_operator_bitwise_and_wide_scalar() + { + int2 a0 = int2(1513158868, 284695609); + int b0 = (1173647397); + int2 r0 = int2(1076916228, 15732769); + TestUtils.AreEqual(r0, a0 & b0); + + int2 a1 = int2(734595037, 1601252476); + int b1 = (1566510707); + int2 r1 = int2(155780689, 1565592688); + TestUtils.AreEqual(r1, a1 & b1); + + int2 a2 = int2(84213838, 430856908); + int b2 = (314333543); + int2 r2 = int2(262214, 279730244); + TestUtils.AreEqual(r2, a2 & b2); + + int2 a3 = int2(753481263, 1619794917); + int b3 = (327392481); + int2 r3 = int2(8459297, 8394977); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void int2_operator_bitwise_and_scalar_wide() + { + int a0 = (477163326); + int2 b0 = int2(110453385, 703240362); + int2 r0 = int2(68182536, 140544042); + TestUtils.AreEqual(r0, a0 & b0); + + int a1 = (2075630560); + int2 b1 = int2(1884904031, 1734899436); + int2 r1 = int2(1880169024, 1663046368); + TestUtils.AreEqual(r1, a1 & b1); + + int a2 = (947945203); + int2 b2 = int2(1664399051, 458879298); + int2 r2 = int2(536884931, 402681922); + TestUtils.AreEqual(r2, a2 & b2); + + int a3 = (158491426); + int2 b3 = int2(79772356, 2054527944); + int2 r3 = int2(4203008, 141558528); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void int2_operator_bitwise_or_wide_wide() + { + int2 a0 = int2(1920951869, 1750772852); + int2 b0 = int2(214585254, 275414367); + int2 r0 = int2(2130669503, 2021326207); + TestUtils.AreEqual(r0, a0 | b0); + + int2 a1 = int2(1420019191, 732977093); + int2 b1 = int2(858759675, 190211455); + int2 r1 = int2(2008016383, 737572863); + TestUtils.AreEqual(r1, a1 | b1); + + int2 a2 = int2(1169579447, 229437930); + int2 b2 = int2(1218691723, 2129565457); + int2 r2 = int2(1303895999, 2146367483); + TestUtils.AreEqual(r2, a2 | b2); + + int2 a3 = int2(1966721348, 2039812323); + int2 b3 = int2(1862809466, 495728846); + int2 r3 = int2(2134507390, 2107455727); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void int2_operator_bitwise_or_wide_scalar() + { + int2 a0 = int2(1295304853, 1307252624); + int b0 = (1305527136); + int2 r0 = int2(1307888629, 1308350448); + TestUtils.AreEqual(r0, a0 | b0); + + int2 a1 = int2(350194630, 1774824542); + int b1 = (1128063578); + int2 r1 = int2(1476389854, 1811803742); + TestUtils.AreEqual(r1, a1 | b1); + + int2 a2 = int2(2085245467, 999162350); + int b2 = (1988423804); + int2 r2 = int2(2127491711, 2140074494); + TestUtils.AreEqual(r2, a2 | b2); + + int2 a3 = int2(2110327307, 341855232); + int b3 = (1050875188); + int2 r3 = int2(2146115391, 1055087924); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void int2_operator_bitwise_or_scalar_wide() + { + int a0 = (1768627592); + int2 b0 = int2(1849658052, 1759912154); + int2 r0 = int2(1870634956, 1777286618); + TestUtils.AreEqual(r0, a0 | b0); + + int a1 = (729979455); + int2 b1 = int2(975926310, 1987690876); + int2 r1 = int2(1001127487, 2147212159); + TestUtils.AreEqual(r1, a1 | b1); + + int a2 = (1809506714); + int2 b2 = int2(1160695341, 408963395); + int2 r2 = int2(1878978495, 2080041435); + TestUtils.AreEqual(r2, a2 | b2); + + int a3 = (314072711); + int2 b3 = int2(1560007537, 1709003416); + int2 r3 = int2(1593565175, 2013093535); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void int2_operator_bitwise_xor_wide_wide() + { + int2 a0 = int2(1843655608, 362425681); + int2 b0 = int2(1422803441, 1234691140); + int2 r0 = int2(959296073, 1544407317); + TestUtils.AreEqual(r0, a0 ^ b0); + + int2 a1 = int2(640805534, 1342040268); + int2 b1 = int2(119589253, 1101464929); + int2 r1 = int2(554771227, 240840109); + TestUtils.AreEqual(r1, a1 ^ b1); + + int2 a2 = int2(945678755, 980321850); + int2 b2 = int2(121896337, 1880109018); + int2 r2 = int2(1058935858, 1249815008); + TestUtils.AreEqual(r2, a2 ^ b2); + + int2 a3 = int2(390165019, 1682422658); + int2 b3 = int2(1000210266, 1718938232); + int2 r3 = int2(752651585, 36917754); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void int2_operator_bitwise_xor_wide_scalar() + { + int2 a0 = int2(169345668, 176087064); + int b0 = (354464228); + int2 r0 = int2(523809632, 526275068); + TestUtils.AreEqual(r0, a0 ^ b0); + + int2 a1 = int2(2084362901, 193851255); + int b1 = (1663924004); + int2 r1 = int2(521252273, 1755355219); + TestUtils.AreEqual(r1, a1 ^ b1); + + int2 a2 = int2(517476661, 863800783); + int b2 = (905336222); + int2 r2 = int2(724452523, 109762641); + TestUtils.AreEqual(r2, a2 ^ b2); + + int2 a3 = int2(365003873, 954341348); + int b3 = (835837496); + int2 r3 = int2(605051481, 154388956); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void int2_operator_bitwise_xor_scalar_wide() + { + int a0 = (1361775641); + int2 b0 = int2(1452773578, 459050892); + int2 r0 = int2(129801427, 1249346453); + TestUtils.AreEqual(r0, a0 ^ b0); + + int a1 = (1986218254); + int2 b1 = int2(1689037698, 999278344); + int2 r1 = int2(315613836, 1307348486); + TestUtils.AreEqual(r1, a1 ^ b1); + + int a2 = (1229114508); + int2 b2 = int2(1087843538, 733699740); + int2 r2 = int2(160817246, 1660523024); + TestUtils.AreEqual(r2, a2 ^ b2); + + int a3 = (106187872); + int2 b3 = int2(1533632738, 1107817672); + int2 r3 = int2(1564290178, 1146337448); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void int2_operator_left_shift() + { + int2 a0 = int2(1129100049, 829482269); + int b0 = (218351941); + int2 r0 = int2(1771463200, 773628832); + TestUtils.AreEqual(r0, a0 << b0); + + int2 a1 = int2(1571297368, 1872142968); + int b1 = (443753193); + int2 r1 = int2(1345368064, 759492608); + TestUtils.AreEqual(r1, a1 << b1); + + int2 a2 = int2(249554593, 980302862); + int b2 = (892627436); + int2 r2 = int2(-26603520, -473899008); + TestUtils.AreEqual(r2, a2 << b2); + + int2 a3 = int2(62369727, 1271350845); + int b3 = (849916599); + int2 r3 = int2(-545259520, 511705088); + TestUtils.AreEqual(r3, a3 << b3); + } + + [TestCompiler] + public static void int2_operator_right_shift() + { + int2 a0 = int2(809126085, 908563670); + int b0 = (994800051); + int2 r0 = int2(1543, 1732); + TestUtils.AreEqual(r0, a0 >> b0); + + int2 a1 = int2(763568837, 1174507510); + int b1 = (1986717290); + int2 r1 = int2(745672, 1146979); + TestUtils.AreEqual(r1, a1 >> b1); + + int2 a2 = int2(646821842, 390811632); + int b2 = (1242726074); + int2 r2 = int2(9, 5); + TestUtils.AreEqual(r2, a2 >> b2); + + int2 a3 = int2(1521420393, 102096936); + int b3 = (1923166649); + int2 r3 = int2(45, 3); + TestUtils.AreEqual(r3, a3 >> b3); + } + + [TestCompiler] + public static void int2_operator_bitwise_not() + { + int2 a0 = int2(111796841, 603562399); + int2 r0 = int2(-111796842, -603562400); + TestUtils.AreEqual(r0, ~a0); + + int2 a1 = int2(745091931, 1110916612); + int2 r1 = int2(-745091932, -1110916613); + TestUtils.AreEqual(r1, ~a1); + + int2 a2 = int2(381888399, 1506860135); + int2 r2 = int2(-381888400, -1506860136); + TestUtils.AreEqual(r2, ~a2); + + int2 a3 = int2(771210628, 875964607); + int2 r3 = int2(-771210629, -875964608); + TestUtils.AreEqual(r3, ~a3); + } + + [TestCompiler] + public static void int2_shuffle_result_1() + { + int2 a = int2(0, 1); + int2 b = int2(2, 3); + + TestUtils.AreEqual((0), shuffle(a, b, ShuffleComponent.LeftX)); + TestUtils.AreEqual((1), shuffle(a, b, ShuffleComponent.LeftY)); + TestUtils.AreEqual((2), shuffle(a, b, ShuffleComponent.RightX)); + TestUtils.AreEqual((3), shuffle(a, b, ShuffleComponent.RightY)); + } + + [TestCompiler] + public static void int2_shuffle_result_2() + { + int2 a = int2(0, 1); + int2 b = int2(2, 3); + + TestUtils.AreEqual(int2(0, 0), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.LeftX)); + TestUtils.AreEqual(int2(1, 0), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.LeftX)); + TestUtils.AreEqual(int2(2, 0), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftX)); + TestUtils.AreEqual(int2(3, 0), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftX)); + TestUtils.AreEqual(int2(0, 1), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.LeftY)); + TestUtils.AreEqual(int2(1, 1), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.LeftY)); + TestUtils.AreEqual(int2(2, 1), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftY)); + TestUtils.AreEqual(int2(3, 1), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftY)); + TestUtils.AreEqual(int2(0, 2), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.RightX)); + TestUtils.AreEqual(int2(1, 2), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.RightX)); + TestUtils.AreEqual(int2(2, 2), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightX)); + TestUtils.AreEqual(int2(3, 2), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightX)); + TestUtils.AreEqual(int2(0, 3), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.RightY)); + TestUtils.AreEqual(int2(1, 3), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.RightY)); + TestUtils.AreEqual(int2(2, 3), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightY)); + TestUtils.AreEqual(int2(3, 3), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightY)); + } + + [TestCompiler] + public static void int2_shuffle_result_3() + { + int2 a = int2(0, 1); + int2 b = int2(2, 3); + + TestUtils.AreEqual(int3(2, 3, 3), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightY, ShuffleComponent.RightY)); + TestUtils.AreEqual(int3(2, 0, 2), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftX, ShuffleComponent.RightX)); + TestUtils.AreEqual(int3(3, 1, 3), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftY, ShuffleComponent.RightY)); + TestUtils.AreEqual(int3(1, 1, 1), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.LeftY, ShuffleComponent.LeftY)); + TestUtils.AreEqual(int3(2, 1, 3), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftY, ShuffleComponent.RightY)); + TestUtils.AreEqual(int3(0, 3, 3), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.RightY, ShuffleComponent.RightY)); + TestUtils.AreEqual(int3(2, 1, 3), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftY, ShuffleComponent.RightY)); + TestUtils.AreEqual(int3(3, 3, 0), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightY, ShuffleComponent.LeftX)); + TestUtils.AreEqual(int3(2, 2, 3), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightX, ShuffleComponent.RightY)); + TestUtils.AreEqual(int3(2, 2, 0), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightX, ShuffleComponent.LeftX)); + TestUtils.AreEqual(int3(0, 1, 1), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.LeftY, ShuffleComponent.LeftY)); + TestUtils.AreEqual(int3(3, 2, 3), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightX, ShuffleComponent.RightY)); + TestUtils.AreEqual(int3(0, 1, 1), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.LeftY, ShuffleComponent.LeftY)); + TestUtils.AreEqual(int3(3, 2, 2), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightX, ShuffleComponent.RightX)); + TestUtils.AreEqual(int3(0, 1, 3), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.LeftY, ShuffleComponent.RightY)); + TestUtils.AreEqual(int3(3, 1, 1), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftY, ShuffleComponent.LeftY)); + } + + [TestCompiler] + public static void int2_shuffle_result_4() + { + int2 a = int2(0, 1); + int2 b = int2(2, 3); + + TestUtils.AreEqual(int4(0, 0, 1, 2), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.LeftX, ShuffleComponent.LeftY, ShuffleComponent.RightX)); + TestUtils.AreEqual(int4(2, 1, 0, 3), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftY, ShuffleComponent.LeftX, ShuffleComponent.RightY)); + TestUtils.AreEqual(int4(3, 2, 3, 2), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightX, ShuffleComponent.RightY, ShuffleComponent.RightX)); + TestUtils.AreEqual(int4(2, 0, 3, 3), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftX, ShuffleComponent.RightY, ShuffleComponent.RightY)); + TestUtils.AreEqual(int4(0, 3, 0, 2), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.RightY, ShuffleComponent.LeftX, ShuffleComponent.RightX)); + TestUtils.AreEqual(int4(3, 0, 3, 1), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftX, ShuffleComponent.RightY, ShuffleComponent.LeftY)); + TestUtils.AreEqual(int4(2, 2, 3, 0), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightX, ShuffleComponent.RightY, ShuffleComponent.LeftX)); + TestUtils.AreEqual(int4(2, 2, 0, 3), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightX, ShuffleComponent.LeftX, ShuffleComponent.RightY)); + TestUtils.AreEqual(int4(0, 1, 2, 1), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.LeftY, ShuffleComponent.RightX, ShuffleComponent.LeftY)); + TestUtils.AreEqual(int4(2, 1, 3, 3), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftY, ShuffleComponent.RightY, ShuffleComponent.RightY)); + TestUtils.AreEqual(int4(3, 3, 3, 1), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightY, ShuffleComponent.RightY, ShuffleComponent.LeftY)); + TestUtils.AreEqual(int4(2, 2, 1, 1), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightX, ShuffleComponent.LeftY, ShuffleComponent.LeftY)); + TestUtils.AreEqual(int4(3, 0, 0, 0), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftX, ShuffleComponent.LeftX, ShuffleComponent.LeftX)); + TestUtils.AreEqual(int4(2, 2, 2, 3), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightX, ShuffleComponent.RightX, ShuffleComponent.RightY)); + TestUtils.AreEqual(int4(0, 3, 0, 3), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.RightY, ShuffleComponent.LeftX, ShuffleComponent.RightY)); + TestUtils.AreEqual(int4(2, 0, 0, 0), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftX, ShuffleComponent.LeftX, ShuffleComponent.LeftX)); + } + + [TestCase /* For player builds */] + public static void int2_EqualsObjectOverride() + { + TestUtils.IsFalse(new int2().Equals((object)new int())); + TestUtils.IsTrue(new int2().Equals((object)new int2())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestInt2.gen.cs.meta b/src/Tests/Tests/Shared/TestInt2.gen.cs.meta new file mode 100644 index 00000000..e48561bf --- /dev/null +++ b/src/Tests/Tests/Shared/TestInt2.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a60a1141ea2c3bc49b14be2842a73f00 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestInt2x2.gen.cs b/src/Tests/Tests/Shared/TestInt2x2.gen.cs new file mode 100644 index 00000000..754451d3 --- /dev/null +++ b/src/Tests/Tests/Shared/TestInt2x2.gen.cs @@ -0,0 +1,1241 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestInt2x2 + { + [TestCompiler] + public static void int2x2_zero() + { + TestUtils.AreEqual(0, int2x2.zero.c0.x); + TestUtils.AreEqual(0, int2x2.zero.c0.y); + TestUtils.AreEqual(0, int2x2.zero.c1.x); + TestUtils.AreEqual(0, int2x2.zero.c1.y); + } + + [TestCompiler] + public static void int2x2_identity() + { + TestUtils.AreEqual(1, int2x2.identity.c0.x); + TestUtils.AreEqual(0, int2x2.identity.c0.y); + TestUtils.AreEqual(0, int2x2.identity.c1.x); + TestUtils.AreEqual(1, int2x2.identity.c1.y); + } + + [TestCompiler] + public static void int2x2_operator_equal_wide_wide() + { + int2x2 a0 = int2x2(2105871082, 35218899, 1550755093, 764676020); + int2x2 b0 = int2x2(1477587886, 579629692, 540974792, 208405066); + bool2x2 r0 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + int2x2 a1 = int2x2(606743782, 1208156098, 1023640014, 1038468316); + int2x2 b1 = int2x2(2063397938, 1060167409, 362592601, 2097545362); + bool2x2 r1 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + int2x2 a2 = int2x2(1416064367, 727143393, 2061243891, 184669837); + int2x2 b2 = int2x2(277670088, 426944490, 901076223, 857900673); + bool2x2 r2 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + int2x2 a3 = int2x2(1303661760, 2044073738, 370395888, 1822916805); + int2x2 b3 = int2x2(1548779757, 325265488, 312658571, 176373760); + bool2x2 r3 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void int2x2_operator_equal_wide_scalar() + { + int2x2 a0 = int2x2(437822262, 2020661134, 541786900, 853113810); + int b0 = (1332833578); + bool2x2 r0 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + int2x2 a1 = int2x2(23716499, 1409026299, 948838849, 953202998); + int b1 = (179951405); + bool2x2 r1 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + int2x2 a2 = int2x2(691955848, 1851546137, 712957637, 2028784869); + int b2 = (1926262965); + bool2x2 r2 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + int2x2 a3 = int2x2(1049962241, 1016802970, 390120467, 464814777); + int b3 = (1836975611); + bool2x2 r3 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void int2x2_operator_equal_scalar_wide() + { + int a0 = (542329200); + int2x2 b0 = int2x2(1115584594, 684107773, 1928988941, 890709324); + bool2x2 r0 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + int a1 = (641152437); + int2x2 b1 = int2x2(1410341302, 497505660, 1068223109, 2014009435); + bool2x2 r1 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + int a2 = (213835595); + int2x2 b2 = int2x2(1592428361, 1819361470, 448650623, 1942175642); + bool2x2 r2 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + int a3 = (64377057); + int2x2 b3 = int2x2(1485938610, 1146305380, 1312317120, 263290348); + bool2x2 r3 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void int2x2_operator_not_equal_wide_wide() + { + int2x2 a0 = int2x2(1977284100, 1293292704, 1547283851, 422428953); + int2x2 b0 = int2x2(1514195556, 957972049, 507667364, 581861672); + bool2x2 r0 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + int2x2 a1 = int2x2(195833190, 1711544892, 5606053, 737069074); + int2x2 b1 = int2x2(1128094576, 940096636, 57559040, 181752616); + bool2x2 r1 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + int2x2 a2 = int2x2(647386678, 13079405, 1413841590, 1076166545); + int2x2 b2 = int2x2(962017320, 1762015406, 1107218953, 2042026522); + bool2x2 r2 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + int2x2 a3 = int2x2(1211445174, 1289303469, 1436402489, 1129570126); + int2x2 b3 = int2x2(836002288, 570272309, 2112081980, 1500634658); + bool2x2 r3 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void int2x2_operator_not_equal_wide_scalar() + { + int2x2 a0 = int2x2(1038269360, 1427812625, 103361237, 1347017023); + int b0 = (768873026); + bool2x2 r0 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + int2x2 a1 = int2x2(1523584313, 660334527, 719113717, 262959423); + int b1 = (150442802); + bool2x2 r1 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + int2x2 a2 = int2x2(484398043, 226568494, 507918242, 1702162286); + int b2 = (506946952); + bool2x2 r2 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + int2x2 a3 = int2x2(923269270, 114581840, 1045389187, 1648095254); + int b3 = (166187260); + bool2x2 r3 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void int2x2_operator_not_equal_scalar_wide() + { + int a0 = (1652127596); + int2x2 b0 = int2x2(953791238, 271722683, 1278885987, 735128017); + bool2x2 r0 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + int a1 = (112416504); + int2x2 b1 = int2x2(25967222, 1761444475, 1844594536, 1199122922); + bool2x2 r1 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + int a2 = (634219279); + int2x2 b2 = int2x2(942501101, 67161343, 969944293, 833229499); + bool2x2 r2 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + int a3 = (1304301133); + int2x2 b3 = int2x2(704045745, 345012334, 1253134152, 325772538); + bool2x2 r3 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void int2x2_operator_less_wide_wide() + { + int2x2 a0 = int2x2(1486550609, 1779244308, 1602148045, 1614085440); + int2x2 b0 = int2x2(97842578, 536551311, 413528975, 1838293684); + bool2x2 r0 = bool2x2(false, false, false, true); + TestUtils.AreEqual(r0, a0 < b0); + + int2x2 a1 = int2x2(1975613414, 942838342, 1092279031, 373677431); + int2x2 b1 = int2x2(1283898480, 1456599961, 1080278602, 529676676); + bool2x2 r1 = bool2x2(false, true, false, true); + TestUtils.AreEqual(r1, a1 < b1); + + int2x2 a2 = int2x2(1419098312, 337757077, 1081797900, 1336745069); + int2x2 b2 = int2x2(156584048, 117348799, 246927124, 1916615924); + bool2x2 r2 = bool2x2(false, false, false, true); + TestUtils.AreEqual(r2, a2 < b2); + + int2x2 a3 = int2x2(840685445, 1220554047, 2013681746, 192965012); + int2x2 b3 = int2x2(1731071394, 1328098431, 1014995792, 480319327); + bool2x2 r3 = bool2x2(true, true, false, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void int2x2_operator_less_wide_scalar() + { + int2x2 a0 = int2x2(796797557, 670113454, 933579492, 278884514); + int b0 = (746564682); + bool2x2 r0 = bool2x2(false, true, false, true); + TestUtils.AreEqual(r0, a0 < b0); + + int2x2 a1 = int2x2(318174822, 741886928, 1990922600, 1030849597); + int b1 = (1117630673); + bool2x2 r1 = bool2x2(true, true, false, true); + TestUtils.AreEqual(r1, a1 < b1); + + int2x2 a2 = int2x2(1546212312, 1648393417, 1857132231, 1909506562); + int b2 = (1718582899); + bool2x2 r2 = bool2x2(true, true, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + int2x2 a3 = int2x2(1294006045, 1303736668, 845460171, 979430272); + int b3 = (952084157); + bool2x2 r3 = bool2x2(false, false, true, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void int2x2_operator_less_scalar_wide() + { + int a0 = (186400299); + int2x2 b0 = int2x2(1881344229, 813834467, 1254886626, 1353590345); + bool2x2 r0 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r0, a0 < b0); + + int a1 = (1412343685); + int2x2 b1 = int2x2(1555571443, 1540508298, 1735458634, 135888070); + bool2x2 r1 = bool2x2(true, true, true, false); + TestUtils.AreEqual(r1, a1 < b1); + + int a2 = (1643818742); + int2x2 b2 = int2x2(248291654, 1739560105, 728539891, 480507742); + bool2x2 r2 = bool2x2(false, true, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + int a3 = (1696553040); + int2x2 b3 = int2x2(540223931, 1840493353, 146833656, 798115946); + bool2x2 r3 = bool2x2(false, true, false, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void int2x2_operator_greater_wide_wide() + { + int2x2 a0 = int2x2(2087717754, 1725569452, 1298066182, 1693943616); + int2x2 b0 = int2x2(85148514, 293632137, 1151128249, 409440398); + bool2x2 r0 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r0, a0 > b0); + + int2x2 a1 = int2x2(1319019629, 70674491, 1042499725, 1002821508); + int2x2 b1 = int2x2(1115020183, 1508500597, 1834583302, 1755218534); + bool2x2 r1 = bool2x2(true, false, false, false); + TestUtils.AreEqual(r1, a1 > b1); + + int2x2 a2 = int2x2(1021857133, 1744374599, 821751047, 467646903); + int2x2 b2 = int2x2(1788761753, 1128238489, 834223713, 1578743290); + bool2x2 r2 = bool2x2(false, true, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + int2x2 a3 = int2x2(2029731638, 1377214212, 1207816926, 474621063); + int2x2 b3 = int2x2(1647150256, 1756397855, 1131080201, 1208965204); + bool2x2 r3 = bool2x2(true, false, true, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void int2x2_operator_greater_wide_scalar() + { + int2x2 a0 = int2x2(1208626274, 239697208, 1979453345, 1253474001); + int b0 = (1715176566); + bool2x2 r0 = bool2x2(false, false, true, false); + TestUtils.AreEqual(r0, a0 > b0); + + int2x2 a1 = int2x2(1590192876, 1673945595, 1662650098, 222749855); + int b1 = (1487911635); + bool2x2 r1 = bool2x2(true, true, true, false); + TestUtils.AreEqual(r1, a1 > b1); + + int2x2 a2 = int2x2(1433540517, 1773305960, 1850273578, 206147145); + int b2 = (566635217); + bool2x2 r2 = bool2x2(true, true, true, false); + TestUtils.AreEqual(r2, a2 > b2); + + int2x2 a3 = int2x2(325913453, 1905567362, 2053577491, 570397194); + int b3 = (333381537); + bool2x2 r3 = bool2x2(false, true, true, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void int2x2_operator_greater_scalar_wide() + { + int a0 = (480938827); + int2x2 b0 = int2x2(1824731899, 921496110, 586859044, 946430596); + bool2x2 r0 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + int a1 = (1231356727); + int2x2 b1 = int2x2(1390167458, 1785807092, 28949024, 2037899283); + bool2x2 r1 = bool2x2(false, false, true, false); + TestUtils.AreEqual(r1, a1 > b1); + + int a2 = (595656760); + int2x2 b2 = int2x2(1778095771, 1233500439, 1696302238, 1445965340); + bool2x2 r2 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + int a3 = (484020151); + int2x2 b3 = int2x2(1586962841, 1361740714, 265628948, 2003122957); + bool2x2 r3 = bool2x2(false, false, true, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void int2x2_operator_less_equal_wide_wide() + { + int2x2 a0 = int2x2(154092149, 1515170149, 1083970332, 785807178); + int2x2 b0 = int2x2(77984380, 1712054191, 1566203809, 254834519); + bool2x2 r0 = bool2x2(false, true, true, false); + TestUtils.AreEqual(r0, a0 <= b0); + + int2x2 a1 = int2x2(1401094881, 310537627, 868328962, 1990816725); + int2x2 b1 = int2x2(450519938, 389457083, 1298669505, 207343167); + bool2x2 r1 = bool2x2(false, true, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + int2x2 a2 = int2x2(2035349541, 457043352, 1123282035, 1001842946); + int2x2 b2 = int2x2(1214449047, 2059561026, 896534357, 1897470050); + bool2x2 r2 = bool2x2(false, true, false, true); + TestUtils.AreEqual(r2, a2 <= b2); + + int2x2 a3 = int2x2(1387761992, 195272789, 659549000, 888761458); + int2x2 b3 = int2x2(521075677, 1848221945, 374708019, 1573731118); + bool2x2 r3 = bool2x2(false, true, false, true); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void int2x2_operator_less_equal_wide_scalar() + { + int2x2 a0 = int2x2(1479531977, 1427983411, 415250630, 1245345407); + int b0 = (2004563877); + bool2x2 r0 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + int2x2 a1 = int2x2(1112546666, 1579912858, 101048307, 1070894375); + int b1 = (1072990632); + bool2x2 r1 = bool2x2(false, false, true, true); + TestUtils.AreEqual(r1, a1 <= b1); + + int2x2 a2 = int2x2(509818792, 85452501, 518127023, 1246249980); + int b2 = (1910488590); + bool2x2 r2 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r2, a2 <= b2); + + int2x2 a3 = int2x2(1097326500, 1968139888, 1191853379, 662096238); + int b3 = (1964410699); + bool2x2 r3 = bool2x2(true, false, true, true); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void int2x2_operator_less_equal_scalar_wide() + { + int a0 = (1899193992); + int2x2 b0 = int2x2(915011820, 980913757, 1337699683, 1476321359); + bool2x2 r0 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r0, a0 <= b0); + + int a1 = (1102143668); + int2x2 b1 = int2x2(660493983, 184664508, 381579707, 1954892821); + bool2x2 r1 = bool2x2(false, false, false, true); + TestUtils.AreEqual(r1, a1 <= b1); + + int a2 = (1295090571); + int2x2 b2 = int2x2(1440368586, 1696003686, 88708652, 1332251857); + bool2x2 r2 = bool2x2(true, true, false, true); + TestUtils.AreEqual(r2, a2 <= b2); + + int a3 = (1310713644); + int2x2 b3 = int2x2(2112132784, 48951945, 1888568027, 39340955); + bool2x2 r3 = bool2x2(true, false, true, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void int2x2_operator_greater_equal_wide_wide() + { + int2x2 a0 = int2x2(8538378, 2131749726, 265427108, 523609761); + int2x2 b0 = int2x2(903145828, 1697992986, 1432491982, 169789504); + bool2x2 r0 = bool2x2(false, true, false, true); + TestUtils.AreEqual(r0, a0 >= b0); + + int2x2 a1 = int2x2(994991818, 839709564, 101288202, 1886280970); + int2x2 b1 = int2x2(1059357300, 1744255222, 1606584463, 1905414425); + bool2x2 r1 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + int2x2 a2 = int2x2(2032074826, 631221455, 1456286159, 961342752); + int2x2 b2 = int2x2(1448794969, 136181998, 1678754836, 2069656857); + bool2x2 r2 = bool2x2(true, true, false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + int2x2 a3 = int2x2(424526026, 788481984, 1662488497, 870326690); + int2x2 b3 = int2x2(398982689, 243317404, 740939613, 1894753119); + bool2x2 r3 = bool2x2(true, true, true, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void int2x2_operator_greater_equal_wide_scalar() + { + int2x2 a0 = int2x2(2049236663, 182691143, 634973382, 1197012109); + int b0 = (1061998015); + bool2x2 r0 = bool2x2(true, false, false, true); + TestUtils.AreEqual(r0, a0 >= b0); + + int2x2 a1 = int2x2(439837565, 1108037359, 351147187, 1898505669); + int b1 = (1367606469); + bool2x2 r1 = bool2x2(false, false, false, true); + TestUtils.AreEqual(r1, a1 >= b1); + + int2x2 a2 = int2x2(411667685, 4652390, 996159180, 2111455181); + int b2 = (1998610091); + bool2x2 r2 = bool2x2(false, false, false, true); + TestUtils.AreEqual(r2, a2 >= b2); + + int2x2 a3 = int2x2(727766399, 814085575, 1525995206, 1293933760); + int b3 = (96217144); + bool2x2 r3 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void int2x2_operator_greater_equal_scalar_wide() + { + int a0 = (1859811087); + int2x2 b0 = int2x2(1070365918, 1783869452, 830091760, 377157428); + bool2x2 r0 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + int a1 = (327199016); + int2x2 b1 = int2x2(90384229, 1154649706, 376758501, 1079802834); + bool2x2 r1 = bool2x2(true, false, false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + int a2 = (2054742898); + int2x2 b2 = int2x2(1328349472, 434061447, 951207723, 598695892); + bool2x2 r2 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r2, a2 >= b2); + + int a3 = (975131651); + int2x2 b3 = int2x2(1714007943, 177416473, 1267232721, 31082860); + bool2x2 r3 = bool2x2(false, true, false, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void int2x2_operator_add_wide_wide() + { + int2x2 a0 = int2x2(2135171378, 21433296, 1954723494, 683604307); + int2x2 b0 = int2x2(1013431952, 366718162, 359290756, 1393163294); + int2x2 r0 = int2x2(-1146363966, 388151458, -1980953046, 2076767601); + TestUtils.AreEqual(r0, a0 + b0); + + int2x2 a1 = int2x2(1054212315, 1762680995, 1963655852, 1257853062); + int2x2 b1 = int2x2(1962236872, 1263270041, 1862666629, 1077447887); + int2x2 r1 = int2x2(-1278518109, -1269016260, -468644815, -1959666347); + TestUtils.AreEqual(r1, a1 + b1); + + int2x2 a2 = int2x2(2043493600, 976898058, 1915056423, 121374462); + int2x2 b2 = int2x2(821693806, 487316539, 350922520, 1583012528); + int2x2 r2 = int2x2(-1429779890, 1464214597, -2028988353, 1704386990); + TestUtils.AreEqual(r2, a2 + b2); + + int2x2 a3 = int2x2(1218855698, 700538222, 1702057277, 1788251699); + int2x2 b3 = int2x2(1951595076, 1024851344, 874302782, 1383969588); + int2x2 r3 = int2x2(-1124516522, 1725389566, -1718607237, -1122746009); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void int2x2_operator_add_wide_scalar() + { + int2x2 a0 = int2x2(665815972, 1783729250, 1591678394, 1284528538); + int b0 = (1334043849); + int2x2 r0 = int2x2(1999859821, -1177194197, -1369245053, -1676394909); + TestUtils.AreEqual(r0, a0 + b0); + + int2x2 a1 = int2x2(977850224, 1138577680, 1200356017, 565982008); + int b1 = (71069732); + int2x2 r1 = int2x2(1048919956, 1209647412, 1271425749, 637051740); + TestUtils.AreEqual(r1, a1 + b1); + + int2x2 a2 = int2x2(1246759684, 57252642, 678921480, 625943813); + int b2 = (1088001167); + int2x2 r2 = int2x2(-1960206445, 1145253809, 1766922647, 1713944980); + TestUtils.AreEqual(r2, a2 + b2); + + int2x2 a3 = int2x2(512157429, 1490096953, 1467033531, 182608093); + int b3 = (1470648741); + int2x2 r3 = int2x2(1982806170, -1334221602, -1357285024, 1653256834); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void int2x2_operator_add_scalar_wide() + { + int a0 = (359966320); + int2x2 b0 = int2x2(2146146202, 767103309, 851002415, 311531406); + int2x2 r0 = int2x2(-1788854774, 1127069629, 1210968735, 671497726); + TestUtils.AreEqual(r0, a0 + b0); + + int a1 = (1491262941); + int2x2 b1 = int2x2(1016891373, 1954228994, 1671335850, 727870747); + int2x2 r1 = int2x2(-1786812982, -849475361, -1132368505, -2075833608); + TestUtils.AreEqual(r1, a1 + b1); + + int a2 = (551151834); + int2x2 b2 = int2x2(1390261152, 1699060326, 115021619, 1964440175); + int2x2 r2 = int2x2(1941412986, -2044755136, 666173453, -1779375287); + TestUtils.AreEqual(r2, a2 + b2); + + int a3 = (440700758); + int2x2 b3 = int2x2(1556692550, 185414255, 933106731, 1217866784); + int2x2 r3 = int2x2(1997393308, 626115013, 1373807489, 1658567542); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void int2x2_operator_sub_wide_wide() + { + int2x2 a0 = int2x2(1410318491, 1097280168, 1827039044, 28881338); + int2x2 b0 = int2x2(1315897366, 799052018, 1580289673, 1094686261); + int2x2 r0 = int2x2(94421125, 298228150, 246749371, -1065804923); + TestUtils.AreEqual(r0, a0 - b0); + + int2x2 a1 = int2x2(328720965, 875487868, 212936325, 231977215); + int2x2 b1 = int2x2(1954325726, 1197734816, 229886366, 915679176); + int2x2 r1 = int2x2(-1625604761, -322246948, -16950041, -683701961); + TestUtils.AreEqual(r1, a1 - b1); + + int2x2 a2 = int2x2(1740021315, 2011295463, 48079003, 591379285); + int2x2 b2 = int2x2(1746884850, 918743925, 1007797419, 257421324); + int2x2 r2 = int2x2(-6863535, 1092551538, -959718416, 333957961); + TestUtils.AreEqual(r2, a2 - b2); + + int2x2 a3 = int2x2(1125909359, 1842588095, 848561896, 614448464); + int2x2 b3 = int2x2(287249342, 1617287463, 1653916102, 123586847); + int2x2 r3 = int2x2(838660017, 225300632, -805354206, 490861617); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void int2x2_operator_sub_wide_scalar() + { + int2x2 a0 = int2x2(1508669340, 1594795463, 266707545, 643102647); + int b0 = (998008471); + int2x2 r0 = int2x2(510660869, 596786992, -731300926, -354905824); + TestUtils.AreEqual(r0, a0 - b0); + + int2x2 a1 = int2x2(287705008, 1113286221, 979450511, 2082174113); + int b1 = (1475644328); + int2x2 r1 = int2x2(-1187939320, -362358107, -496193817, 606529785); + TestUtils.AreEqual(r1, a1 - b1); + + int2x2 a2 = int2x2(1108005498, 999244508, 1806482044, 1994553647); + int b2 = (304369206); + int2x2 r2 = int2x2(803636292, 694875302, 1502112838, 1690184441); + TestUtils.AreEqual(r2, a2 - b2); + + int2x2 a3 = int2x2(2101812429, 266654115, 1470212363, 1190349300); + int b3 = (1482736902); + int2x2 r3 = int2x2(619075527, -1216082787, -12524539, -292387602); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void int2x2_operator_sub_scalar_wide() + { + int a0 = (893369501); + int2x2 b0 = int2x2(2051906184, 1699714311, 442603706, 1735141684); + int2x2 r0 = int2x2(-1158536683, -806344810, 450765795, -841772183); + TestUtils.AreEqual(r0, a0 - b0); + + int a1 = (274533585); + int2x2 b1 = int2x2(811580259, 1196354320, 1524097023, 533621527); + int2x2 r1 = int2x2(-537046674, -921820735, -1249563438, -259087942); + TestUtils.AreEqual(r1, a1 - b1); + + int a2 = (2080845793); + int2x2 b2 = int2x2(143958837, 1620668660, 1135989346, 1367044745); + int2x2 r2 = int2x2(1936886956, 460177133, 944856447, 713801048); + TestUtils.AreEqual(r2, a2 - b2); + + int a3 = (554088609); + int2x2 b3 = int2x2(552670373, 1265516124, 1254902543, 1857695581); + int2x2 r3 = int2x2(1418236, -711427515, -700813934, -1303606972); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void int2x2_operator_mul_wide_wide() + { + int2x2 a0 = int2x2(61417577, 219585476, 1362520891, 1511084277); + int2x2 b0 = int2x2(578042444, 1620527213, 200516468, 309339115); + int2x2 r0 = int2x2(-1426863828, 1326150260, -990894148, -1322856473); + TestUtils.AreEqual(r0, a0 * b0); + + int2x2 a1 = int2x2(1481211272, 58211871, 1459591173, 567624644); + int2x2 b1 = int2x2(542853019, 299467282, 1479641221, 1428338601); + int2x2 r1 = int2x2(1973926232, 88546350, -863919463, -582821788); + TestUtils.AreEqual(r1, a1 * b1); + + int2x2 a2 = int2x2(1169935583, 1835691886, 385626539, 85934842); + int2x2 b2 = int2x2(1497302909, 1596889147, 427413842, 265122693); + int2x2 r2 = int2x2(556671459, 1098186330, 1848083398, -58320414); + TestUtils.AreEqual(r2, a2 * b2); + + int2x2 a3 = int2x2(522856538, 278370196, 289217012, 2083410174); + int2x2 b3 = int2x2(689376654, 1120457204, 516903000, 873091659); + int2x2 r3 = int2x2(2005201900, 651971856, -1721160736, -110160278); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void int2x2_operator_mul_wide_scalar() + { + int2x2 a0 = int2x2(871746615, 492532311, 570557670, 2142306629); + int b0 = (442064533); + int2x2 r0 = int2x2(338365955, 1081376419, -1729147426, -1015409879); + TestUtils.AreEqual(r0, a0 * b0); + + int2x2 a1 = int2x2(1610315153, 118471734, 257439514, 364291059); + int b1 = (1526163563); + int2x2 r1 = int2x2(-1362883685, -333210990, -1906862114, -479838575); + TestUtils.AreEqual(r1, a1 * b1); + + int2x2 a2 = int2x2(1186560810, 1357601203, 638897141, 268562104); + int b2 = (1584938026); + int2x2 r2 = int2x2(989596900, 898280286, -1341201870, -1971041744); + TestUtils.AreEqual(r2, a2 * b2); + + int2x2 a3 = int2x2(1007838321, 1619806399, 1444659979, 1127580168); + int b3 = (1163240135); + int2x2 r3 = int2x2(610309591, 1971350137, 984126349, 1871258680); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void int2x2_operator_mul_scalar_wide() + { + int a0 = (1152242766); + int2x2 b0 = int2x2(1276636134, 2105929407, 499007702, 124002565); + int2x2 r0 = int2x2(-2129504236, 999811634, 1179056436, -801426554); + TestUtils.AreEqual(r0, a0 * b0); + + int a1 = (1956335172); + int2x2 b1 = int2x2(1288034953, 832676555, 337389733, 99268757); + int2x2 r1 = int2x2(303483492, -76408852, 1271140820, 1556966804); + TestUtils.AreEqual(r1, a1 * b1); + + int a2 = (2005055247); + int2x2 b2 = int2x2(2011389505, 1348110859, 399689191, 2007606374); + int2x2 r2 = int2x2(-1565197105, -1533938779, -249579127, 759270394); + TestUtils.AreEqual(r2, a2 * b2); + + int a3 = (2076691289); + int2x2 b3 = int2x2(1825721194, 769885235, 153314735, 1066325369); + int2x2 r3 = int2x2(609175002, -1567463749, 1593384663, 1878927889); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void int2x2_operator_div_wide_wide() + { + int2x2 a0 = int2x2(333171510, 858154903, 1181365836, 671357749); + int2x2 b0 = int2x2(698897823, 440199998, 655557473, 1658534285); + int2x2 r0 = int2x2(0, 1, 1, 0); + TestUtils.AreEqual(r0, a0 / b0); + + int2x2 a1 = int2x2(1090606752, 803759420, 788404166, 296807814); + int2x2 b1 = int2x2(2127220100, 315653188, 1814290360, 992173243); + int2x2 r1 = int2x2(0, 2, 0, 0); + TestUtils.AreEqual(r1, a1 / b1); + + int2x2 a2 = int2x2(575260195, 166625280, 1493729000, 1831739736); + int2x2 b2 = int2x2(914851653, 664340325, 224323977, 246981573); + int2x2 r2 = int2x2(0, 0, 6, 7); + TestUtils.AreEqual(r2, a2 / b2); + + int2x2 a3 = int2x2(200852358, 129983172, 500176108, 472051781); + int2x2 b3 = int2x2(285573983, 819471609, 2012476015, 1783179572); + int2x2 r3 = int2x2(0, 0, 0, 0); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void int2x2_operator_div_wide_scalar() + { + int2x2 a0 = int2x2(1433072926, 1073958635, 1195142312, 536596719); + int b0 = (1434025872); + int2x2 r0 = int2x2(0, 0, 0, 0); + TestUtils.AreEqual(r0, a0 / b0); + + int2x2 a1 = int2x2(1274375693, 806462546, 906504670, 1380905136); + int b1 = (464756346); + int2x2 r1 = int2x2(2, 1, 1, 2); + TestUtils.AreEqual(r1, a1 / b1); + + int2x2 a2 = int2x2(25493909, 123300377, 643754735, 2084019932); + int b2 = (1196815948); + int2x2 r2 = int2x2(0, 0, 0, 1); + TestUtils.AreEqual(r2, a2 / b2); + + int2x2 a3 = int2x2(2047825037, 741331531, 466443901, 2110004616); + int b3 = (458304263); + int2x2 r3 = int2x2(4, 1, 1, 4); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void int2x2_operator_div_scalar_wide() + { + int a0 = (519165704); + int2x2 b0 = int2x2(1295178177, 775214121, 467772046, 1156881598); + int2x2 r0 = int2x2(0, 0, 1, 0); + TestUtils.AreEqual(r0, a0 / b0); + + int a1 = (310396565); + int2x2 b1 = int2x2(759759959, 243837702, 1616314235, 1053470225); + int2x2 r1 = int2x2(0, 1, 0, 0); + TestUtils.AreEqual(r1, a1 / b1); + + int a2 = (1320630160); + int2x2 b2 = int2x2(378773841, 4223608, 1971105754, 2054406020); + int2x2 r2 = int2x2(3, 312, 0, 0); + TestUtils.AreEqual(r2, a2 / b2); + + int a3 = (219939614); + int2x2 b3 = int2x2(1603672651, 2006134295, 888535397, 1493077923); + int2x2 r3 = int2x2(0, 0, 0, 0); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void int2x2_operator_mod_wide_wide() + { + int2x2 a0 = int2x2(258342924, 1454754891, 723352342, 1981431473); + int2x2 b0 = int2x2(1990080167, 1197348066, 651970512, 1659454050); + int2x2 r0 = int2x2(258342924, 257406825, 71381830, 321977423); + TestUtils.AreEqual(r0, a0 % b0); + + int2x2 a1 = int2x2(531756042, 716993627, 1667903349, 1331097004); + int2x2 b1 = int2x2(241005212, 1866255454, 1440101415, 595220963); + int2x2 r1 = int2x2(49745618, 716993627, 227801934, 140655078); + TestUtils.AreEqual(r1, a1 % b1); + + int2x2 a2 = int2x2(1776856101, 17598216, 1474345080, 1681376293); + int2x2 b2 = int2x2(408818410, 198222574, 549504274, 239973807); + int2x2 r2 = int2x2(141582461, 17598216, 375336532, 1559644); + TestUtils.AreEqual(r2, a2 % b2); + + int2x2 a3 = int2x2(813624265, 1617478722, 498370451, 780075943); + int2x2 b3 = int2x2(321398087, 658171840, 1511495237, 1048325585); + int2x2 r3 = int2x2(170828091, 301135042, 498370451, 780075943); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void int2x2_operator_mod_wide_scalar() + { + int2x2 a0 = int2x2(560988938, 629524514, 767711194, 434281967); + int b0 = (1156862367); + int2x2 r0 = int2x2(560988938, 629524514, 767711194, 434281967); + TestUtils.AreEqual(r0, a0 % b0); + + int2x2 a1 = int2x2(1399805893, 1663690927, 598661916, 1776636144); + int b1 = (792916846); + int2x2 r1 = int2x2(606889047, 77857235, 598661916, 190802452); + TestUtils.AreEqual(r1, a1 % b1); + + int2x2 a2 = int2x2(1287035793, 475209785, 327476870, 1617696916); + int b2 = (1743722161); + int2x2 r2 = int2x2(1287035793, 475209785, 327476870, 1617696916); + TestUtils.AreEqual(r2, a2 % b2); + + int2x2 a3 = int2x2(379853074, 858399046, 712734431, 1506629323); + int b3 = (477430114); + int2x2 r3 = int2x2(379853074, 380968932, 235304317, 74338981); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void int2x2_operator_mod_scalar_wide() + { + int a0 = (933347930); + int2x2 b0 = int2x2(549923387, 243114953, 1884274390, 1428033594); + int2x2 r0 = int2x2(383424543, 204003071, 933347930, 933347930); + TestUtils.AreEqual(r0, a0 % b0); + + int a1 = (655531454); + int2x2 b1 = int2x2(1622674954, 1107563514, 1614111094, 914801920); + int2x2 r1 = int2x2(655531454, 655531454, 655531454, 655531454); + TestUtils.AreEqual(r1, a1 % b1); + + int a2 = (1432263179); + int2x2 b2 = int2x2(564431096, 1967013901, 1709750152, 1080102613); + int2x2 r2 = int2x2(303400987, 1432263179, 1432263179, 352160566); + TestUtils.AreEqual(r2, a2 % b2); + + int a3 = (13120773); + int2x2 b3 = int2x2(2042535998, 1505698002, 1640058084, 974167554); + int2x2 r3 = int2x2(13120773, 13120773, 13120773, 13120773); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void int2x2_operator_plus() + { + int2x2 a0 = int2x2(195392567, 222719748, 1002351013, 1570765263); + int2x2 r0 = int2x2(195392567, 222719748, 1002351013, 1570765263); + TestUtils.AreEqual(r0, +a0); + + int2x2 a1 = int2x2(109389333, 1689763402, 291471785, 264115671); + int2x2 r1 = int2x2(109389333, 1689763402, 291471785, 264115671); + TestUtils.AreEqual(r1, +a1); + + int2x2 a2 = int2x2(1084131995, 2131702223, 715660442, 1995564647); + int2x2 r2 = int2x2(1084131995, 2131702223, 715660442, 1995564647); + TestUtils.AreEqual(r2, +a2); + + int2x2 a3 = int2x2(69731564, 1957501908, 531426536, 2012985092); + int2x2 r3 = int2x2(69731564, 1957501908, 531426536, 2012985092); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void int2x2_operator_neg() + { + int2x2 a0 = int2x2(1385088677, 94114564, 1350664872, 1458616659); + int2x2 r0 = int2x2(-1385088677, -94114564, -1350664872, -1458616659); + TestUtils.AreEqual(r0, -a0); + + int2x2 a1 = int2x2(2067164853, 958484951, 270553961, 446497525); + int2x2 r1 = int2x2(-2067164853, -958484951, -270553961, -446497525); + TestUtils.AreEqual(r1, -a1); + + int2x2 a2 = int2x2(270503114, 1427605822, 2051940607, 1434247484); + int2x2 r2 = int2x2(-270503114, -1427605822, -2051940607, -1434247484); + TestUtils.AreEqual(r2, -a2); + + int2x2 a3 = int2x2(485368391, 1742096480, 990033169, 1368056141); + int2x2 r3 = int2x2(-485368391, -1742096480, -990033169, -1368056141); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void int2x2_operator_prefix_inc() + { + int2x2 a0 = int2x2(780471723, 954741756, 272723451, 2142862245); + int2x2 r0 = int2x2(780471724, 954741757, 272723452, 2142862246); + TestUtils.AreEqual(r0, ++a0); + + int2x2 a1 = int2x2(606294309, 250124151, 444189162, 1833356994); + int2x2 r1 = int2x2(606294310, 250124152, 444189163, 1833356995); + TestUtils.AreEqual(r1, ++a1); + + int2x2 a2 = int2x2(1915989169, 129540735, 1584496757, 1170613526); + int2x2 r2 = int2x2(1915989170, 129540736, 1584496758, 1170613527); + TestUtils.AreEqual(r2, ++a2); + + int2x2 a3 = int2x2(986715680, 1397451003, 483952900, 1494652811); + int2x2 r3 = int2x2(986715681, 1397451004, 483952901, 1494652812); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void int2x2_operator_postfix_inc() + { + int2x2 a0 = int2x2(241865086, 2145821641, 1596166022, 803592338); + int2x2 r0 = int2x2(241865086, 2145821641, 1596166022, 803592338); + TestUtils.AreEqual(r0, a0++); + + int2x2 a1 = int2x2(529551271, 903047443, 1213663244, 1425753247); + int2x2 r1 = int2x2(529551271, 903047443, 1213663244, 1425753247); + TestUtils.AreEqual(r1, a1++); + + int2x2 a2 = int2x2(1384002775, 1159795446, 1343289659, 1227160199); + int2x2 r2 = int2x2(1384002775, 1159795446, 1343289659, 1227160199); + TestUtils.AreEqual(r2, a2++); + + int2x2 a3 = int2x2(947635082, 451018043, 1634297552, 2009552507); + int2x2 r3 = int2x2(947635082, 451018043, 1634297552, 2009552507); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void int2x2_operator_prefix_dec() + { + int2x2 a0 = int2x2(1331961415, 1612382200, 1401591249, 2042075388); + int2x2 r0 = int2x2(1331961414, 1612382199, 1401591248, 2042075387); + TestUtils.AreEqual(r0, --a0); + + int2x2 a1 = int2x2(1757136546, 1467742422, 578341664, 1336115745); + int2x2 r1 = int2x2(1757136545, 1467742421, 578341663, 1336115744); + TestUtils.AreEqual(r1, --a1); + + int2x2 a2 = int2x2(2059077641, 1862369220, 312317355, 1027543764); + int2x2 r2 = int2x2(2059077640, 1862369219, 312317354, 1027543763); + TestUtils.AreEqual(r2, --a2); + + int2x2 a3 = int2x2(1595492535, 1426620468, 674685792, 1423852012); + int2x2 r3 = int2x2(1595492534, 1426620467, 674685791, 1423852011); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void int2x2_operator_postfix_dec() + { + int2x2 a0 = int2x2(1870005937, 1708534798, 704493460, 462940703); + int2x2 r0 = int2x2(1870005937, 1708534798, 704493460, 462940703); + TestUtils.AreEqual(r0, a0--); + + int2x2 a1 = int2x2(2060593573, 940247280, 1818778351, 1015253889); + int2x2 r1 = int2x2(2060593573, 940247280, 1818778351, 1015253889); + TestUtils.AreEqual(r1, a1--); + + int2x2 a2 = int2x2(862428933, 2080259851, 653673271, 140452688); + int2x2 r2 = int2x2(862428933, 2080259851, 653673271, 140452688); + TestUtils.AreEqual(r2, a2--); + + int2x2 a3 = int2x2(1928164223, 1174531383, 634036198, 993137684); + int2x2 r3 = int2x2(1928164223, 1174531383, 634036198, 993137684); + TestUtils.AreEqual(r3, a3--); + } + + [TestCompiler] + public static void int2x2_operator_bitwise_and_wide_wide() + { + int2x2 a0 = int2x2(1055241304, 859321394, 1088358961, 2090949513); + int2x2 b0 = int2x2(749698416, 748105424, 1842764797, 9990577); + int2x2 r0 = int2x2(749024336, 537928720, 1087769137, 8409473); + TestUtils.AreEqual(r0, a0 & b0); + + int2x2 a1 = int2x2(300561740, 651904515, 1331035868, 2012752753); + int2x2 b1 = int2x2(1989102105, 1666634755, 58116798, 868036607); + int2x2 r1 = int2x2(277479432, 575816707, 55888540, 867707761); + TestUtils.AreEqual(r1, a1 & b1); + + int2x2 a2 = int2x2(1298126656, 53199569, 1752363533, 1303061302); + int2x2 b2 = int2x2(1420638875, 1308767169, 564040763, 478617502); + int2x2 r2 = int2x2(1141707264, 33686209, 538087433, 209912598); + TestUtils.AreEqual(r2, a2 & b2); + + int2x2 a3 = int2x2(1929998247, 1504941434, 470682792, 713577376); + int2x2 b3 = int2x2(806150474, 674015378, 1505309955, 36064977); + int2x2 r3 = int2x2(805855490, 136347666, 403178496, 33571456); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void int2x2_operator_bitwise_and_wide_scalar() + { + int2x2 a0 = int2x2(1513158868, 284695609, 734595037, 1566510707); + int b0 = (1173647397); + int2x2 r0 = int2x2(1076916228, 15732769, 29360133, 1163132961); + TestUtils.AreEqual(r0, a0 & b0); + + int2x2 a1 = int2x2(1601252476, 314333543, 430856908, 753481263); + int b1 = (84213838); + int2x2 r1 = int2x2(83951692, 262214, 17039436, 67174414); + TestUtils.AreEqual(r1, a1 & b1); + + int2x2 a2 = int2x2(327392481, 2143619546, 1873208293, 126982769); + int b2 = (1619794917); + int2x2 r2 = int2x2(8394977, 1619265984, 1619264485, 8395361); + TestUtils.AreEqual(r2, a2 & b2); + + int2x2 a3 = int2x2(651482651, 1689107088, 1368301071, 366962092); + int b3 = (1383096952); + int2x2 r3 = int2x2(38814232, 1075847696, 1342177800, 273702952); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void int2x2_operator_bitwise_and_scalar_wide() + { + int a0 = (477163326); + int2x2 b0 = int2x2(110453385, 703240362, 2075630560, 1884904031); + int2x2 r0 = int2x2(68182536, 140544042, 405834528, 273697310); + TestUtils.AreEqual(r0, a0 & b0); + + int a1 = (1734899436); + int2x2 b1 = int2x2(947945203, 1664399051, 458879298, 158491426); + int2x2 r1 = int2x2(536901344, 1663055560, 55078976, 23093792); + TestUtils.AreEqual(r1, a1 & b1); + + int a2 = (79772356); + int2x2 b2 = int2x2(2054527944, 202228212, 359225061, 639811396); + int2x2 r2 = int2x2(4266688, 67174596, 71373508, 67123780); + TestUtils.AreEqual(r2, a2 & b2); + + int a3 = (1821945318); + int2x2 b3 = int2x2(1821303024, 2030124055, 1985961756, 579780373); + int2x2 r3 = int2x2(1820893408, 1744841734, 1679297796, 545828100); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void int2x2_operator_bitwise_or_wide_wide() + { + int2x2 a0 = int2x2(1920951869, 1750772852, 1420019191, 732977093); + int2x2 b0 = int2x2(214585254, 275414367, 858759675, 190211455); + int2x2 r0 = int2x2(2130669503, 2021326207, 2008016383, 737572863); + TestUtils.AreEqual(r0, a0 | b0); + + int2x2 a1 = int2x2(1169579447, 229437930, 1966721348, 2039812323); + int2x2 b1 = int2x2(1218691723, 2129565457, 1862809466, 495728846); + int2x2 r1 = int2x2(1303895999, 2146367483, 2134507390, 2107455727); + TestUtils.AreEqual(r1, a1 | b1); + + int2x2 a2 = int2x2(113550869, 1912038362, 1569990624, 1490718227); + int2x2 b2 = int2x2(868064152, 1756913766, 933656055, 247722084); + int2x2 r2 = int2x2(939376541, 2046780414, 2142664695, 1591475831); + TestUtils.AreEqual(r2, a2 | b2); + + int2x2 a3 = int2x2(1686257697, 2137727522, 1569900650, 856504729); + int2x2 b3 = int2x2(1884195075, 1804207631, 1913174711, 1815920856); + int2x2 r3 = int2x2(1959708963, 2146117167, 2140863231, 2134768089); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void int2x2_operator_bitwise_or_wide_scalar() + { + int2x2 a0 = int2x2(1295304853, 1307252624, 350194630, 1128063578); + int b0 = (1305527136); + int2x2 r0 = int2x2(1307888629, 1308350448, 1574947814, 1341973370); + TestUtils.AreEqual(r0, a0 | b0); + + int2x2 a1 = int2x2(1774824542, 1988423804, 999162350, 2110327307); + int b1 = (2085245467); + int2x2 r1 = int2x2(2110520927, 2127491711, 2144228351, 2110478875); + TestUtils.AreEqual(r1, a1 | b1); + + int2x2 a2 = int2x2(1050875188, 1317039676, 228656898, 41280811); + int b2 = (341855232); + int2x2 r2 = int2x2(1055087924, 1591766588, 501305090, 376827179); + TestUtils.AreEqual(r2, a2 | b2); + + int2x2 a3 = int2x2(1536908787, 1739461580, 2040936581, 1350320187); + int b3 = (606786773); + int2x2 r3 = int2x2(2143018487, 1739511773, 2108619989, 1954469119); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void int2x2_operator_bitwise_or_scalar_wide() + { + int a0 = (1768627592); + int2x2 b0 = int2x2(1849658052, 1759912154, 729979455, 975926310); + int2x2 r0 = int2x2(1870634956, 1777286618, 1810603967, 2070642094); + TestUtils.AreEqual(r0, a0 | b0); + + int a1 = (1987690876); + int2x2 b1 = int2x2(1809506714, 1160695341, 408963395, 314072711); + int2x2 r1 = int2x2(2147213822, 2004864893, 2121910655, 1996087295); + TestUtils.AreEqual(r1, a1 | b1); + + int a2 = (1560007537); + int2x2 b2 = int2x2(1709003416, 977086639, 1448375596, 1689568808); + int2x2 r2 = int2x2(2113917945, 2130705407, 1593833341, 2097141625); + TestUtils.AreEqual(r2, a2 | b2); + + int a3 = (595543345); + int2x2 b3 = int2x2(559778387, 621080913, 438994183, 1742637145); + int2x2 r3 = int2x2(595578739, 662697329, 998229303, 1744817529); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void int2x2_operator_bitwise_xor_wide_wide() + { + int2x2 a0 = int2x2(1843655608, 362425681, 640805534, 1342040268); + int2x2 b0 = int2x2(1422803441, 1234691140, 119589253, 1101464929); + int2x2 r0 = int2x2(959296073, 1544407317, 554771227, 240840109); + TestUtils.AreEqual(r0, a0 ^ b0); + + int2x2 a1 = int2x2(945678755, 980321850, 390165019, 1682422658); + int2x2 b1 = int2x2(121896337, 1880109018, 1000210266, 1718938232); + int2x2 r1 = int2x2(1058935858, 1249815008, 752651585, 36917754); + TestUtils.AreEqual(r1, a1 ^ b1); + + int2x2 a2 = int2x2(303897251, 230477768, 1103646442, 1503102919); + int2x2 b2 = int2x2(464406940, 884337881, 34199854, 1430659227); + int2x2 r2 = int2x2(162747199, 956900113, 1136760772, 215066460); + TestUtils.AreEqual(r2, a2 ^ b2); + + int2x2 a3 = int2x2(26631152, 1016475570, 1862440929, 379588576); + int2x2 b3 = int2x2(126415540, 1069919967, 1810763253, 2082802224); + int2x2 r3 = int2x2(102672708, 55804269, 82614804, 1787102672); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void int2x2_operator_bitwise_xor_wide_scalar() + { + int2x2 a0 = int2x2(169345668, 176087064, 2084362901, 1663924004); + int b0 = (354464228); + int2x2 r0 = int2x2(523809632, 526275068, 1763470193, 1980614336); + TestUtils.AreEqual(r0, a0 ^ b0); + + int2x2 a1 = int2x2(193851255, 905336222, 863800783, 365003873); + int b1 = (517476661); + int2x2 r1 = int2x2(357957186, 724452523, 765762810, 186226004); + TestUtils.AreEqual(r1, a1 ^ b1); + + int2x2 a2 = int2x2(835837496, 1464576786, 625604047, 1700827127); + int b2 = (954341348); + int2x2 r2 = int2x2(154388956, 1873394934, 497803819, 1568839699); + TestUtils.AreEqual(r2, a2 ^ b2); + + int2x2 a3 = int2x2(2003392824, 1077374714, 1043379893, 1991576049); + int b3 = (1481813598); + int2x2 r3 = int2x2(792459110, 409321636, 1717704939, 786933679); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void int2x2_operator_bitwise_xor_scalar_wide() + { + int a0 = (1361775641); + int2x2 b0 = int2x2(1452773578, 459050892, 1986218254, 1689037698); + int2x2 r0 = int2x2(129801427, 1249346453, 659047703, 898082715); + TestUtils.AreEqual(r0, a0 ^ b0); + + int a1 = (999278344); + int2x2 b1 = int2x2(1229114508, 1087843538, 733699740, 106187872); + int2x2 r1 = int2x2(1926040452, 2069425114, 271882644, 1037798248); + TestUtils.AreEqual(r1, a1 ^ b1); + + int a2 = (1533632738); + int2x2 b2 = int2x2(1107817672, 492506236, 597602329, 1439603382); + int2x2 r2 = int2x2(426677290, 1177709726, 2029506811, 245889620); + TestUtils.AreEqual(r2, a2 ^ b2); + + int a3 = (1001169118); + int2x2 b3 = int2x2(1231718216, 1693179077, 1050897427, 1796435561); + int2x2 r3 = int2x2(1925588886, 1598520347, 84921549, 1354747575); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void int2x2_operator_left_shift() + { + int2x2 a0 = int2x2(1129100049, 829482269, 1571297368, 443753193); + int b0 = (218351941); + int2x2 r0 = int2x2(1771463200, 773628832, -1258091776, 1315200288); + TestUtils.AreEqual(r0, a0 << b0); + + int2x2 a1 = int2x2(1872142968, 892627436, 980302862, 62369727); + int b1 = (249554593); + int2x2 r1 = int2x2(-550681360, 1785254872, 1960605724, 124739454); + TestUtils.AreEqual(r1, a1 << b1); + + int2x2 a2 = int2x2(849916599, 108441902, 1959056531, 1779118882); + int b2 = (1271350845); + int2x2 r2 = int2x2(-536870912, -1073741824, 1610612736, 1073741824); + TestUtils.AreEqual(r2, a2 << b2); + + int2x2 a3 = int2x2(1451674188, 1149883636, 1380536034, 186532735); + int b3 = (2082026915); + int2x2 r3 = int2x2(-1271508384, 609134496, -1840613616, 1492261880); + TestUtils.AreEqual(r3, a3 << b3); + } + + [TestCompiler] + public static void int2x2_operator_right_shift() + { + int2x2 a0 = int2x2(809126085, 908563670, 763568837, 1986717290); + int b0 = (994800051); + int2x2 r0 = int2x2(1543, 1732, 1456, 3789); + TestUtils.AreEqual(r0, a0 >> b0); + + int2x2 a1 = int2x2(1174507510, 1242726074, 390811632, 1521420393); + int b1 = (646821842); + int2x2 r1 = int2x2(4480, 4740, 1490, 5803); + TestUtils.AreEqual(r1, a1 >> b1); + + int2x2 a2 = int2x2(1923166649, 400863878, 667378673, 1611921244); + int b2 = (102096936); + int2x2 r2 = int2x2(7512369, 1565874, 2606947, 6296567); + TestUtils.AreEqual(r2, a2 >> b2); + + int2x2 a3 = int2x2(307750782, 2014389412, 1673938174, 1075916177); + int b3 = (479442287); + int2x2 r3 = int2x2(9391, 61474, 51084, 32834); + TestUtils.AreEqual(r3, a3 >> b3); + } + + [TestCompiler] + public static void int2x2_operator_bitwise_not() + { + int2x2 a0 = int2x2(111796841, 603562399, 745091931, 853183268); + int2x2 r0 = int2x2(-111796842, -603562400, -745091932, -853183269); + TestUtils.AreEqual(r0, ~a0); + + int2x2 a1 = int2x2(1110916612, 1891338755, 1506860135, 771210628); + int2x2 r1 = int2x2(-1110916613, -1891338756, -1506860136, -771210629); + TestUtils.AreEqual(r1, ~a1); + + int2x2 a2 = int2x2(787710759, 96456785, 916013379, 203444882); + int2x2 r2 = int2x2(-787710760, -96456786, -916013380, -203444883); + TestUtils.AreEqual(r2, ~a2); + + int2x2 a3 = int2x2(1172294211, 683852713, 375158799, 881353367); + int2x2 r3 = int2x2(-1172294212, -683852714, -375158800, -881353368); + TestUtils.AreEqual(r3, ~a3); + } + + [TestCase /* For player builds */] + public static void int2x2_EqualsObjectOverride() + { + TestUtils.IsFalse(new int2x2().Equals((object)new int())); + TestUtils.IsTrue(new int2x2().Equals((object)new int2x2())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestInt2x2.gen.cs.meta b/src/Tests/Tests/Shared/TestInt2x2.gen.cs.meta new file mode 100644 index 00000000..7bdf7418 --- /dev/null +++ b/src/Tests/Tests/Shared/TestInt2x2.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 041eb9518baf7a846bd945a05063b142 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestInt2x3.gen.cs b/src/Tests/Tests/Shared/TestInt2x3.gen.cs new file mode 100644 index 00000000..8e25e359 --- /dev/null +++ b/src/Tests/Tests/Shared/TestInt2x3.gen.cs @@ -0,0 +1,1234 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestInt2x3 + { + [TestCompiler] + public static void int2x3_zero() + { + TestUtils.AreEqual(0, int2x3.zero.c0.x); + TestUtils.AreEqual(0, int2x3.zero.c0.y); + TestUtils.AreEqual(0, int2x3.zero.c1.x); + TestUtils.AreEqual(0, int2x3.zero.c1.y); + TestUtils.AreEqual(0, int2x3.zero.c2.x); + TestUtils.AreEqual(0, int2x3.zero.c2.y); + } + + [TestCompiler] + public static void int2x3_operator_equal_wide_wide() + { + int2x3 a0 = int2x3(2105871082, 35218899, 1550755093, 764676020, 606743782, 1208156098); + int2x3 b0 = int2x3(1477587886, 579629692, 540974792, 208405066, 2063397938, 1060167409); + bool2x3 r0 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + int2x3 a1 = int2x3(1023640014, 1038468316, 1416064367, 727143393, 2061243891, 184669837); + int2x3 b1 = int2x3(362592601, 2097545362, 277670088, 426944490, 901076223, 857900673); + bool2x3 r1 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + int2x3 a2 = int2x3(1303661760, 2044073738, 370395888, 1822916805, 1076983135, 345215866); + int2x3 b2 = int2x3(1548779757, 325265488, 312658571, 176373760, 2052378097, 858156597); + bool2x3 r2 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + int2x3 a3 = int2x3(833676277, 1987782708, 1481088614, 1364754268, 93639636, 1850596922); + int2x3 b3 = int2x3(982817797, 1252095508, 882634538, 1959142806, 72495800, 1077678183); + bool2x3 r3 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void int2x3_operator_equal_wide_scalar() + { + int2x3 a0 = int2x3(437822262, 2020661134, 541786900, 853113810, 23716499, 179951405); + int b0 = (1332833578); + bool2x3 r0 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + int2x3 a1 = int2x3(1409026299, 953202998, 691955848, 1926262965, 1851546137, 712957637); + int b1 = (948838849); + bool2x3 r1 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + int2x3 a2 = int2x3(2028784869, 1836975611, 1016802970, 390120467, 464814777, 1451642042); + int b2 = (1049962241); + bool2x3 r2 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + int2x3 a3 = int2x3(289137869, 808355440, 660053867, 597354173, 67320270, 151461188); + int b3 = (152339338); + bool2x3 r3 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void int2x3_operator_equal_scalar_wide() + { + int a0 = (542329200); + int2x3 b0 = int2x3(1115584594, 684107773, 1928988941, 890709324, 641152437, 1410341302); + bool2x3 r0 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + int a1 = (497505660); + int2x3 b1 = int2x3(1068223109, 2014009435, 213835595, 1592428361, 1819361470, 448650623); + bool2x3 r1 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + int a2 = (1942175642); + int2x3 b2 = int2x3(64377057, 1485938610, 1146305380, 1312317120, 263290348, 812663708); + bool2x3 r2 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + int a3 = (1585209188); + int2x3 b3 = int2x3(40646617, 1378718922, 1957797737, 873652576, 1780082094, 1513270921); + bool2x3 r3 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void int2x3_operator_not_equal_wide_wide() + { + int2x3 a0 = int2x3(1977284100, 1293292704, 1547283851, 422428953, 195833190, 1711544892); + int2x3 b0 = int2x3(1514195556, 957972049, 507667364, 581861672, 1128094576, 940096636); + bool2x3 r0 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + int2x3 a1 = int2x3(5606053, 737069074, 647386678, 13079405, 1413841590, 1076166545); + int2x3 b1 = int2x3(57559040, 181752616, 962017320, 1762015406, 1107218953, 2042026522); + bool2x3 r1 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + int2x3 a2 = int2x3(1211445174, 1289303469, 1436402489, 1129570126, 1566836685, 1343313905); + int2x3 b2 = int2x3(836002288, 570272309, 2112081980, 1500634658, 1787808345, 566425667); + bool2x3 r2 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + int2x3 a3 = int2x3(329259205, 1774944480, 33906739, 2055853627, 2035015372, 1702756001); + int2x3 b3 = int2x3(2037529609, 1520589840, 266793699, 538816359, 2075474643, 553571317); + bool2x3 r3 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void int2x3_operator_not_equal_wide_scalar() + { + int2x3 a0 = int2x3(1038269360, 1427812625, 103361237, 1347017023, 1523584313, 150442802); + int b0 = (768873026); + bool2x3 r0 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + int2x3 a1 = int2x3(660334527, 262959423, 484398043, 506946952, 226568494, 507918242); + int b1 = (719113717); + bool2x3 r1 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + int2x3 a2 = int2x3(1702162286, 166187260, 114581840, 1045389187, 1648095254, 1461803977); + int b2 = (923269270); + bool2x3 r2 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + int2x3 a3 = int2x3(61801615, 2146927809, 1557151164, 1284033253, 1345705546, 1747302566); + int b3 = (1317840133); + bool2x3 r3 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void int2x3_operator_not_equal_scalar_wide() + { + int a0 = (1652127596); + int2x3 b0 = int2x3(953791238, 271722683, 1278885987, 735128017, 112416504, 25967222); + bool2x3 r0 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + int a1 = (1761444475); + int2x3 b1 = int2x3(1844594536, 1199122922, 634219279, 942501101, 67161343, 969944293); + bool2x3 r1 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + int a2 = (833229499); + int2x3 b2 = int2x3(1304301133, 704045745, 345012334, 1253134152, 325772538, 855127202); + bool2x3 r2 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + int a3 = (793668881); + int2x3 b3 = int2x3(1584481616, 1101301152, 276853534, 987168816, 1258105989, 362645228); + bool2x3 r3 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void int2x3_operator_less_wide_wide() + { + int2x3 a0 = int2x3(1486550609, 1779244308, 1602148045, 1614085440, 1975613414, 942838342); + int2x3 b0 = int2x3(97842578, 536551311, 413528975, 1838293684, 1283898480, 1456599961); + bool2x3 r0 = bool2x3(false, false, false, true, false, true); + TestUtils.AreEqual(r0, a0 < b0); + + int2x3 a1 = int2x3(1092279031, 373677431, 1419098312, 337757077, 1081797900, 1336745069); + int2x3 b1 = int2x3(1080278602, 529676676, 156584048, 117348799, 246927124, 1916615924); + bool2x3 r1 = bool2x3(false, true, false, false, false, true); + TestUtils.AreEqual(r1, a1 < b1); + + int2x3 a2 = int2x3(840685445, 1220554047, 2013681746, 192965012, 532043965, 1000693402); + int2x3 b2 = int2x3(1731071394, 1328098431, 1014995792, 480319327, 1765937053, 1333997067); + bool2x3 r2 = bool2x3(true, true, false, true, true, true); + TestUtils.AreEqual(r2, a2 < b2); + + int2x3 a3 = int2x3(927236048, 1215860000, 780607596, 1882056852, 1354146545, 2135295778); + int2x3 b3 = int2x3(688515308, 1856106947, 1303906227, 646821776, 1169473993, 316770064); + bool2x3 r3 = bool2x3(false, true, true, false, false, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void int2x3_operator_less_wide_scalar() + { + int2x3 a0 = int2x3(796797557, 670113454, 933579492, 278884514, 318174822, 1117630673); + int b0 = (746564682); + bool2x3 r0 = bool2x3(false, true, false, true, true, false); + TestUtils.AreEqual(r0, a0 < b0); + + int2x3 a1 = int2x3(741886928, 1030849597, 1546212312, 1718582899, 1648393417, 1857132231); + int b1 = (1990922600); + bool2x3 r1 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 < b1); + + int2x3 a2 = int2x3(1909506562, 952084157, 1303736668, 845460171, 979430272, 1368236640); + int b2 = (1294006045); + bool2x3 r2 = bool2x3(false, true, false, true, true, false); + TestUtils.AreEqual(r2, a2 < b2); + + int2x3 a3 = int2x3(24980695, 659552739, 1058492383, 165694933, 1204097259, 922212691); + int b3 = (1434668705); + bool2x3 r3 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void int2x3_operator_less_scalar_wide() + { + int a0 = (186400299); + int2x3 b0 = int2x3(1881344229, 813834467, 1254886626, 1353590345, 1412343685, 1555571443); + bool2x3 r0 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 < b0); + + int a1 = (1540508298); + int2x3 b1 = int2x3(1735458634, 135888070, 1643818742, 248291654, 1739560105, 728539891); + bool2x3 r1 = bool2x3(true, false, true, false, true, false); + TestUtils.AreEqual(r1, a1 < b1); + + int a2 = (480507742); + int2x3 b2 = int2x3(1696553040, 540223931, 1840493353, 146833656, 798115946, 2002002066); + bool2x3 r2 = bool2x3(true, true, true, false, true, true); + TestUtils.AreEqual(r2, a2 < b2); + + int a3 = (1011261705); + int2x3 b3 = int2x3(783550942, 1093071215, 598253401, 1432416562, 1863582169, 103622950); + bool2x3 r3 = bool2x3(false, true, false, true, true, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void int2x3_operator_greater_wide_wide() + { + int2x3 a0 = int2x3(2087717754, 1725569452, 1298066182, 1693943616, 1319019629, 70674491); + int2x3 b0 = int2x3(85148514, 293632137, 1151128249, 409440398, 1115020183, 1508500597); + bool2x3 r0 = bool2x3(true, true, true, true, true, false); + TestUtils.AreEqual(r0, a0 > b0); + + int2x3 a1 = int2x3(1042499725, 1002821508, 1021857133, 1744374599, 821751047, 467646903); + int2x3 b1 = int2x3(1834583302, 1755218534, 1788761753, 1128238489, 834223713, 1578743290); + bool2x3 r1 = bool2x3(false, false, false, true, false, false); + TestUtils.AreEqual(r1, a1 > b1); + + int2x3 a2 = int2x3(2029731638, 1377214212, 1207816926, 474621063, 20781266, 366593779); + int2x3 b2 = int2x3(1647150256, 1756397855, 1131080201, 1208965204, 1495161099, 1283714281); + bool2x3 r2 = bool2x3(true, false, true, false, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + int2x3 a3 = int2x3(2068457387, 10181449, 793634464, 144474612, 99947390, 930377263); + int2x3 b3 = int2x3(908051907, 412849651, 815822687, 730271942, 40756039, 883326140); + bool2x3 r3 = bool2x3(true, false, false, false, true, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void int2x3_operator_greater_wide_scalar() + { + int2x3 a0 = int2x3(1208626274, 239697208, 1979453345, 1253474001, 1590192876, 1487911635); + int b0 = (1715176566); + bool2x3 r0 = bool2x3(false, false, true, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + int2x3 a1 = int2x3(1673945595, 222749855, 1433540517, 566635217, 1773305960, 1850273578); + int b1 = (1662650098); + bool2x3 r1 = bool2x3(true, false, false, false, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + int2x3 a2 = int2x3(206147145, 333381537, 1905567362, 2053577491, 570397194, 2128431130); + int b2 = (325913453); + bool2x3 r2 = bool2x3(false, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 > b2); + + int2x3 a3 = int2x3(1735325311, 1663525234, 1972984241, 1587865063, 488268523, 121921923); + int b3 = (529971908); + bool2x3 r3 = bool2x3(true, true, true, true, false, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void int2x3_operator_greater_scalar_wide() + { + int a0 = (480938827); + int2x3 b0 = int2x3(1824731899, 921496110, 586859044, 946430596, 1231356727, 1390167458); + bool2x3 r0 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + int a1 = (1785807092); + int2x3 b1 = int2x3(28949024, 2037899283, 595656760, 1778095771, 1233500439, 1696302238); + bool2x3 r1 = bool2x3(true, false, true, true, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + int a2 = (1445965340); + int2x3 b2 = int2x3(484020151, 1586962841, 1361740714, 265628948, 2003122957, 332267433); + bool2x3 r2 = bool2x3(true, false, true, true, false, true); + TestUtils.AreEqual(r2, a2 > b2); + + int a3 = (1128353075); + int2x3 b3 = int2x3(377919478, 982113135, 1117675960, 630865591, 1550679736, 895945757); + bool2x3 r3 = bool2x3(true, true, true, true, false, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void int2x3_operator_less_equal_wide_wide() + { + int2x3 a0 = int2x3(154092149, 1515170149, 1083970332, 785807178, 1401094881, 310537627); + int2x3 b0 = int2x3(77984380, 1712054191, 1566203809, 254834519, 450519938, 389457083); + bool2x3 r0 = bool2x3(false, true, true, false, false, true); + TestUtils.AreEqual(r0, a0 <= b0); + + int2x3 a1 = int2x3(868328962, 1990816725, 2035349541, 457043352, 1123282035, 1001842946); + int2x3 b1 = int2x3(1298669505, 207343167, 1214449047, 2059561026, 896534357, 1897470050); + bool2x3 r1 = bool2x3(true, false, false, true, false, true); + TestUtils.AreEqual(r1, a1 <= b1); + + int2x3 a2 = int2x3(1387761992, 195272789, 659549000, 888761458, 283706617, 1790185840); + int2x3 b2 = int2x3(521075677, 1848221945, 374708019, 1573731118, 2093466449, 1660210829); + bool2x3 r2 = bool2x3(false, true, false, true, true, false); + TestUtils.AreEqual(r2, a2 <= b2); + + int2x3 a3 = int2x3(899029812, 848317418, 1743712447, 1504407474, 1798441490, 1902791952); + int2x3 b3 = int2x3(1568778785, 1352157589, 1212771905, 1457525058, 1493446008, 1784768208); + bool2x3 r3 = bool2x3(true, true, false, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void int2x3_operator_less_equal_wide_scalar() + { + int2x3 a0 = int2x3(1479531977, 1427983411, 415250630, 1245345407, 1112546666, 1072990632); + int b0 = (2004563877); + bool2x3 r0 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + int2x3 a1 = int2x3(1579912858, 1070894375, 509818792, 1910488590, 85452501, 518127023); + int b1 = (101048307); + bool2x3 r1 = bool2x3(false, false, false, false, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + int2x3 a2 = int2x3(1246249980, 1964410699, 1968139888, 1191853379, 662096238, 1140643434); + int b2 = (1097326500); + bool2x3 r2 = bool2x3(false, false, false, false, true, false); + TestUtils.AreEqual(r2, a2 <= b2); + + int2x3 a3 = int2x3(754434551, 995927387, 974873240, 1773400038, 497436329, 1825940497); + int b3 = (155343473); + bool2x3 r3 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void int2x3_operator_less_equal_scalar_wide() + { + int a0 = (1899193992); + int2x3 b0 = int2x3(915011820, 980913757, 1337699683, 1476321359, 1102143668, 660493983); + bool2x3 r0 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 <= b0); + + int a1 = (184664508); + int2x3 b1 = int2x3(381579707, 1954892821, 1295090571, 1440368586, 1696003686, 88708652); + bool2x3 r1 = bool2x3(true, true, true, true, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + int a2 = (1332251857); + int2x3 b2 = int2x3(1310713644, 2112132784, 48951945, 1888568027, 39340955, 1108242207); + bool2x3 r2 = bool2x3(false, true, false, true, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + int a3 = (260777425); + int2x3 b3 = int2x3(593122164, 291471959, 253457314, 1264570386, 699618012, 927735863); + bool2x3 r3 = bool2x3(true, true, false, true, true, true); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void int2x3_operator_greater_equal_wide_wide() + { + int2x3 a0 = int2x3(8538378, 2131749726, 265427108, 523609761, 994991818, 839709564); + int2x3 b0 = int2x3(903145828, 1697992986, 1432491982, 169789504, 1059357300, 1744255222); + bool2x3 r0 = bool2x3(false, true, false, true, false, false); + TestUtils.AreEqual(r0, a0 >= b0); + + int2x3 a1 = int2x3(101288202, 1886280970, 2032074826, 631221455, 1456286159, 961342752); + int2x3 b1 = int2x3(1606584463, 1905414425, 1448794969, 136181998, 1678754836, 2069656857); + bool2x3 r1 = bool2x3(false, false, true, true, false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + int2x3 a2 = int2x3(424526026, 788481984, 1662488497, 870326690, 708712581, 1260182701); + int2x3 b2 = int2x3(398982689, 243317404, 740939613, 1894753119, 301760792, 1260647988); + bool2x3 r2 = bool2x3(true, true, true, false, true, false); + TestUtils.AreEqual(r2, a2 >= b2); + + int2x3 a3 = int2x3(1165630721, 138247561, 1108650168, 1933222913, 672493999, 1541402159); + int2x3 b3 = int2x3(3608523, 52576030, 903420465, 1648820371, 627296845, 1679808907); + bool2x3 r3 = bool2x3(true, true, true, true, true, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void int2x3_operator_greater_equal_wide_scalar() + { + int2x3 a0 = int2x3(2049236663, 182691143, 634973382, 1197012109, 439837565, 1367606469); + int b0 = (1061998015); + bool2x3 r0 = bool2x3(true, false, false, true, false, true); + TestUtils.AreEqual(r0, a0 >= b0); + + int2x3 a1 = int2x3(1108037359, 1898505669, 411667685, 1998610091, 4652390, 996159180); + int b1 = (351147187); + bool2x3 r1 = bool2x3(true, true, true, true, false, true); + TestUtils.AreEqual(r1, a1 >= b1); + + int2x3 a2 = int2x3(2111455181, 96217144, 814085575, 1525995206, 1293933760, 1732973229); + int b2 = (727766399); + bool2x3 r2 = bool2x3(true, false, true, true, true, true); + TestUtils.AreEqual(r2, a2 >= b2); + + int2x3 a3 = int2x3(1473283041, 1023753195, 1373738074, 518164359, 717850464, 1765188600); + int b3 = (899444524); + bool2x3 r3 = bool2x3(true, true, true, false, false, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void int2x3_operator_greater_equal_scalar_wide() + { + int a0 = (1859811087); + int2x3 b0 = int2x3(1070365918, 1783869452, 830091760, 377157428, 327199016, 90384229); + bool2x3 r0 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + int a1 = (1154649706); + int2x3 b1 = int2x3(376758501, 1079802834, 2054742898, 1328349472, 434061447, 951207723); + bool2x3 r1 = bool2x3(true, true, false, false, true, true); + TestUtils.AreEqual(r1, a1 >= b1); + + int a2 = (598695892); + int2x3 b2 = int2x3(975131651, 1714007943, 177416473, 1267232721, 31082860, 216791741); + bool2x3 r2 = bool2x3(false, false, true, false, true, true); + TestUtils.AreEqual(r2, a2 >= b2); + + int a3 = (119054289); + int2x3 b3 = int2x3(1905107583, 89559116, 55041824, 691334141, 462326883, 1658303669); + bool2x3 r3 = bool2x3(false, true, true, false, false, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void int2x3_operator_add_wide_wide() + { + int2x3 a0 = int2x3(2135171378, 21433296, 1954723494, 683604307, 1054212315, 1762680995); + int2x3 b0 = int2x3(1013431952, 366718162, 359290756, 1393163294, 1962236872, 1263270041); + int2x3 r0 = int2x3(-1146363966, 388151458, -1980953046, 2076767601, -1278518109, -1269016260); + TestUtils.AreEqual(r0, a0 + b0); + + int2x3 a1 = int2x3(1963655852, 1257853062, 2043493600, 976898058, 1915056423, 121374462); + int2x3 b1 = int2x3(1862666629, 1077447887, 821693806, 487316539, 350922520, 1583012528); + int2x3 r1 = int2x3(-468644815, -1959666347, -1429779890, 1464214597, -2028988353, 1704386990); + TestUtils.AreEqual(r1, a1 + b1); + + int2x3 a2 = int2x3(1218855698, 700538222, 1702057277, 1788251699, 1534939160, 398651016); + int2x3 b2 = int2x3(1951595076, 1024851344, 874302782, 1383969588, 1767968088, 900721406); + int2x3 r2 = int2x3(-1124516522, 1725389566, -1718607237, -1122746009, -992060048, 1299372422); + TestUtils.AreEqual(r2, a2 + b2); + + int2x3 a3 = int2x3(1674272498, 374510467, 824322986, 1217622199, 1122376670, 642613771); + int2x3 b3 = int2x3(1659790033, 1792273749, 443844328, 633981449, 2010244807, 335566991); + int2x3 r3 = int2x3(-960904765, -2128183080, 1268167314, 1851603648, -1162345819, 978180762); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void int2x3_operator_add_wide_scalar() + { + int2x3 a0 = int2x3(665815972, 1783729250, 1591678394, 1284528538, 977850224, 71069732); + int b0 = (1334043849); + int2x3 r0 = int2x3(1999859821, -1177194197, -1369245053, -1676394909, -1983073223, 1405113581); + TestUtils.AreEqual(r0, a0 + b0); + + int2x3 a1 = int2x3(1138577680, 565982008, 1246759684, 1088001167, 57252642, 678921480); + int b1 = (1200356017); + int2x3 r1 = int2x3(-1956033599, 1766338025, -1847851595, -2006610112, 1257608659, 1879277497); + TestUtils.AreEqual(r1, a1 + b1); + + int2x3 a2 = int2x3(625943813, 1470648741, 1490096953, 1467033531, 182608093, 1707296407); + int b2 = (512157429); + int2x3 r2 = int2x3(1138101242, 1982806170, 2002254382, 1979190960, 694765522, -2075513460); + TestUtils.AreEqual(r2, a2 + b2); + + int2x3 a3 = int2x3(1703724354, 653973063, 1139546735, 1834005844, 184572739, 1980578280); + int b3 = (1333833947); + int2x3 r3 = int2x3(-1257408995, 1987807010, -1821586614, -1127127505, 1518406686, -980555069); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void int2x3_operator_add_scalar_wide() + { + int a0 = (359966320); + int2x3 b0 = int2x3(2146146202, 767103309, 851002415, 311531406, 1491262941, 1016891373); + int2x3 r0 = int2x3(-1788854774, 1127069629, 1210968735, 671497726, 1851229261, 1376857693); + TestUtils.AreEqual(r0, a0 + b0); + + int a1 = (1954228994); + int2x3 b1 = int2x3(1671335850, 727870747, 551151834, 1390261152, 1699060326, 115021619); + int2x3 r1 = int2x3(-669402452, -1612867555, -1789586468, -950477150, -641677976, 2069250613); + TestUtils.AreEqual(r1, a1 + b1); + + int a2 = (1964440175); + int2x3 b2 = int2x3(440700758, 1556692550, 185414255, 933106731, 1217866784, 729761881); + int2x3 r2 = int2x3(-1889826363, -773834571, -2145112866, -1397420390, -1112660337, -1600765240); + TestUtils.AreEqual(r2, a2 + b2); + + int a3 = (1742597318); + int2x3 b3 = int2x3(1090109152, 1467373815, 1066072609, 138237856, 634834665, 993603553); + int2x3 r3 = int2x3(-1462260826, -1084996163, -1486297369, 1880835174, -1917535313, -1558766425); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void int2x3_operator_sub_wide_wide() + { + int2x3 a0 = int2x3(1410318491, 1097280168, 1827039044, 28881338, 328720965, 875487868); + int2x3 b0 = int2x3(1315897366, 799052018, 1580289673, 1094686261, 1954325726, 1197734816); + int2x3 r0 = int2x3(94421125, 298228150, 246749371, -1065804923, -1625604761, -322246948); + TestUtils.AreEqual(r0, a0 - b0); + + int2x3 a1 = int2x3(212936325, 231977215, 1740021315, 2011295463, 48079003, 591379285); + int2x3 b1 = int2x3(229886366, 915679176, 1746884850, 918743925, 1007797419, 257421324); + int2x3 r1 = int2x3(-16950041, -683701961, -6863535, 1092551538, -959718416, 333957961); + TestUtils.AreEqual(r1, a1 - b1); + + int2x3 a2 = int2x3(1125909359, 1842588095, 848561896, 614448464, 2067598029, 1618238416); + int2x3 b2 = int2x3(287249342, 1617287463, 1653916102, 123586847, 502107404, 672875302); + int2x3 r2 = int2x3(838660017, 225300632, -805354206, 490861617, 1565490625, 945363114); + TestUtils.AreEqual(r2, a2 - b2); + + int2x3 a3 = int2x3(318516219, 1090119767, 1991095823, 949592162, 1951912339, 1457818751); + int2x3 b3 = int2x3(1256481116, 1975569142, 1794443030, 1327558915, 330955394, 1596041731); + int2x3 r3 = int2x3(-937964897, -885449375, 196652793, -377966753, 1620956945, -138222980); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void int2x3_operator_sub_wide_scalar() + { + int2x3 a0 = int2x3(1508669340, 1594795463, 266707545, 643102647, 287705008, 1475644328); + int b0 = (998008471); + int2x3 r0 = int2x3(510660869, 596786992, -731300926, -354905824, -710303463, 477635857); + TestUtils.AreEqual(r0, a0 - b0); + + int2x3 a1 = int2x3(1113286221, 2082174113, 1108005498, 304369206, 999244508, 1806482044); + int b1 = (979450511); + int2x3 r1 = int2x3(133835710, 1102723602, 128554987, -675081305, 19793997, 827031533); + TestUtils.AreEqual(r1, a1 - b1); + + int2x3 a2 = int2x3(1994553647, 1482736902, 266654115, 1470212363, 1190349300, 958542155); + int b2 = (2101812429); + int2x3 r2 = int2x3(-107258782, -619075527, -1835158314, -631600066, -911463129, -1143270274); + TestUtils.AreEqual(r2, a2 - b2); + + int2x3 a3 = int2x3(1185075537, 499527536, 1612473406, 1696960099, 1287292743, 1360229454); + int b3 = (1738124835); + int2x3 r3 = int2x3(-553049298, -1238597299, -125651429, -41164736, -450832092, -377895381); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void int2x3_operator_sub_scalar_wide() + { + int a0 = (893369501); + int2x3 b0 = int2x3(2051906184, 1699714311, 442603706, 1735141684, 274533585, 811580259); + int2x3 r0 = int2x3(-1158536683, -806344810, 450765795, -841772183, 618835916, 81789242); + TestUtils.AreEqual(r0, a0 - b0); + + int a1 = (1196354320); + int2x3 b1 = int2x3(1524097023, 533621527, 2080845793, 143958837, 1620668660, 1135989346); + int2x3 r1 = int2x3(-327742703, 662732793, -884491473, 1052395483, -424314340, 60364974); + TestUtils.AreEqual(r1, a1 - b1); + + int a2 = (1367044745); + int2x3 b2 = int2x3(554088609, 552670373, 1265516124, 1254902543, 1857695581, 1619865274); + int2x3 r2 = int2x3(812956136, 814374372, 101528621, 112142202, -490650836, -252820529); + TestUtils.AreEqual(r2, a2 - b2); + + int a3 = (1313559400); + int2x3 b3 = int2x3(99812999, 843597298, 420111239, 1299949060, 531009038, 1103306550); + int2x3 r3 = int2x3(1213746401, 469962102, 893448161, 13610340, 782550362, 210252850); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void int2x3_operator_mul_wide_wide() + { + int2x3 a0 = int2x3(61417577, 219585476, 1362520891, 1511084277, 1481211272, 58211871); + int2x3 b0 = int2x3(578042444, 1620527213, 200516468, 309339115, 542853019, 299467282); + int2x3 r0 = int2x3(-1426863828, 1326150260, -990894148, -1322856473, 1973926232, 88546350); + TestUtils.AreEqual(r0, a0 * b0); + + int2x3 a1 = int2x3(1459591173, 567624644, 1169935583, 1835691886, 385626539, 85934842); + int2x3 b1 = int2x3(1479641221, 1428338601, 1497302909, 1596889147, 427413842, 265122693); + int2x3 r1 = int2x3(-863919463, -582821788, 556671459, 1098186330, 1848083398, -58320414); + TestUtils.AreEqual(r1, a1 * b1); + + int2x3 a2 = int2x3(522856538, 278370196, 289217012, 2083410174, 1293162798, 1939730122); + int2x3 b2 = int2x3(689376654, 1120457204, 516903000, 873091659, 1353196495, 1384773500); + int2x3 r2 = int2x3(2005201900, 651971856, -1721160736, -110160278, -119429582, -536965160); + TestUtils.AreEqual(r2, a2 * b2); + + int2x3 a3 = int2x3(2075923048, 1116477212, 1686101741, 783310758, 248585944, 1093377716); + int2x3 b3 = int2x3(1596528529, 2122329305, 1033200564, 996795088, 1137754930, 232014195); + int2x3 r3 = int2x3(-2049587992, -759667012, 1443849636, 550781664, -959017424, -353108260); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void int2x3_operator_mul_wide_scalar() + { + int2x3 a0 = int2x3(871746615, 492532311, 570557670, 2142306629, 1610315153, 1526163563); + int b0 = (442064533); + int2x3 r0 = int2x3(338365955, 1081376419, -1729147426, -1015409879, -873485467, -175501241); + TestUtils.AreEqual(r0, a0 * b0); + + int2x3 a1 = int2x3(118471734, 364291059, 1186560810, 1584938026, 1357601203, 638897141); + int b1 = (257439514); + int2x3 r1 = int2x3(-174540932, 172874670, -725841852, -1852628412, 448041262, -853124638); + TestUtils.AreEqual(r1, a1 * b1); + + int2x3 a2 = int2x3(268562104, 1163240135, 1619806399, 1444659979, 1127580168, 464517916); + int b2 = (1007838321); + int2x3 r2 = int2x3(-1156956360, 610309591, 1271183439, 624387035, -1778809464, 784123740); + TestUtils.AreEqual(r2, a2 * b2); + + int2x3 a3 = int2x3(1508043166, 636691139, 1851670006, 357357967, 1095280227, 702779195); + int b3 = (745488654); + int2x3 r3 = int2x3(-79960924, 1705798058, 478992756, -1770900270, 757415018, 1348784186); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void int2x3_operator_mul_scalar_wide() + { + int a0 = (1152242766); + int2x3 b0 = int2x3(1276636134, 2105929407, 499007702, 124002565, 1956335172, 1288034953); + int2x3 r0 = int2x3(-2129504236, 999811634, 1179056436, -801426554, 404105400, 1339492798); + TestUtils.AreEqual(r0, a0 * b0); + + int a1 = (832676555); + int2x3 b1 = int2x3(337389733, 99268757, 2005055247, 2011389505, 1348110859, 399689191); + int2x3 r1 = int2x3(-388913961, -727472089, 2079172325, -1429086325, -284070727, -223994835); + TestUtils.AreEqual(r1, a1 * b1); + + int a2 = (2007606374); + int2x3 b2 = int2x3(2076691289, 1825721194, 769885235, 153314735, 1066325369, 84289667); + int2x3 r2 = int2x3(-324990602, 588510268, 67262546, -893018182, -7630282, -1780281294); + TestUtils.AreEqual(r2, a2 * b2); + + int a3 = (984486192); + int2x3 b3 = int2x3(1325213504, 1643957457, 1576395620, 2095980601, 907671947, 836919582); + int2x3 r3 = int2x3(-862807040, -1190246352, 673990336, 227005360, -118815472, 826880928); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void int2x3_operator_div_wide_wide() + { + int2x3 a0 = int2x3(333171510, 858154903, 1181365836, 671357749, 1090606752, 803759420); + int2x3 b0 = int2x3(698897823, 440199998, 655557473, 1658534285, 2127220100, 315653188); + int2x3 r0 = int2x3(0, 1, 1, 0, 0, 2); + TestUtils.AreEqual(r0, a0 / b0); + + int2x3 a1 = int2x3(788404166, 296807814, 575260195, 166625280, 1493729000, 1831739736); + int2x3 b1 = int2x3(1814290360, 992173243, 914851653, 664340325, 224323977, 246981573); + int2x3 r1 = int2x3(0, 0, 0, 0, 6, 7); + TestUtils.AreEqual(r1, a1 / b1); + + int2x3 a2 = int2x3(200852358, 129983172, 500176108, 472051781, 414699094, 1446535974); + int2x3 b2 = int2x3(285573983, 819471609, 2012476015, 1783179572, 223253978, 169515029); + int2x3 r2 = int2x3(0, 0, 0, 0, 1, 8); + TestUtils.AreEqual(r2, a2 / b2); + + int2x3 a3 = int2x3(1278480457, 930910505, 263295881, 1626759436, 450830871, 21439121); + int2x3 b3 = int2x3(1694929006, 1992168131, 1155972447, 1768506696, 422325410, 1508417406); + int2x3 r3 = int2x3(0, 0, 0, 0, 1, 0); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void int2x3_operator_div_wide_scalar() + { + int2x3 a0 = int2x3(1433072926, 1073958635, 1195142312, 536596719, 1274375693, 464756346); + int b0 = (1434025872); + int2x3 r0 = int2x3(0, 0, 0, 0, 0, 0); + TestUtils.AreEqual(r0, a0 / b0); + + int2x3 a1 = int2x3(806462546, 1380905136, 25493909, 1196815948, 123300377, 643754735); + int b1 = (906504670); + int2x3 r1 = int2x3(0, 1, 0, 1, 0, 0); + TestUtils.AreEqual(r1, a1 / b1); + + int2x3 a2 = int2x3(2084019932, 458304263, 741331531, 466443901, 2110004616, 1500687214); + int b2 = (2047825037); + int2x3 r2 = int2x3(1, 0, 0, 0, 1, 0); + TestUtils.AreEqual(r2, a2 / b2); + + int2x3 a3 = int2x3(1453264263, 2040203220, 2103351724, 485536709, 402141749, 1477264254); + int b3 = (1617154145); + int2x3 r3 = int2x3(0, 1, 1, 0, 0, 0); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void int2x3_operator_div_scalar_wide() + { + int a0 = (519165704); + int2x3 b0 = int2x3(1295178177, 775214121, 467772046, 1156881598, 310396565, 759759959); + int2x3 r0 = int2x3(0, 0, 1, 0, 1, 0); + TestUtils.AreEqual(r0, a0 / b0); + + int a1 = (243837702); + int2x3 b1 = int2x3(1616314235, 1053470225, 1320630160, 378773841, 4223608, 1971105754); + int2x3 r1 = int2x3(0, 0, 0, 0, 57, 0); + TestUtils.AreEqual(r1, a1 / b1); + + int a2 = (2054406020); + int2x3 b2 = int2x3(219939614, 1603672651, 2006134295, 888535397, 1493077923, 615835131); + int2x3 r2 = int2x3(9, 1, 1, 2, 1, 3); + TestUtils.AreEqual(r2, a2 / b2); + + int a3 = (1045603945); + int2x3 b3 = int2x3(452709946, 1074919059, 467037221, 1485241506, 1775728786, 481521341); + int2x3 r3 = int2x3(2, 0, 2, 0, 0, 2); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void int2x3_operator_mod_wide_wide() + { + int2x3 a0 = int2x3(258342924, 1454754891, 723352342, 1981431473, 531756042, 716993627); + int2x3 b0 = int2x3(1990080167, 1197348066, 651970512, 1659454050, 241005212, 1866255454); + int2x3 r0 = int2x3(258342924, 257406825, 71381830, 321977423, 49745618, 716993627); + TestUtils.AreEqual(r0, a0 % b0); + + int2x3 a1 = int2x3(1667903349, 1331097004, 1776856101, 17598216, 1474345080, 1681376293); + int2x3 b1 = int2x3(1440101415, 595220963, 408818410, 198222574, 549504274, 239973807); + int2x3 r1 = int2x3(227801934, 140655078, 141582461, 17598216, 375336532, 1559644); + TestUtils.AreEqual(r1, a1 % b1); + + int2x3 a2 = int2x3(813624265, 1617478722, 498370451, 780075943, 1754430321, 653235398); + int2x3 b2 = int2x3(321398087, 658171840, 1511495237, 1048325585, 1126739824, 666641241); + int2x3 r2 = int2x3(170828091, 301135042, 498370451, 780075943, 627690497, 653235398); + TestUtils.AreEqual(r2, a2 % b2); + + int2x3 a3 = int2x3(1517128354, 966216200, 590067427, 1283434795, 1910903650, 1125967790); + int2x3 b3 = int2x3(38017598, 418797691, 618700513, 1941062990, 158556432, 1081063558); + int2x3 r3 = int2x3(34442032, 128620818, 590067427, 1283434795, 8226466, 44904232); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void int2x3_operator_mod_wide_scalar() + { + int2x3 a0 = int2x3(560988938, 629524514, 767711194, 434281967, 1399805893, 792916846); + int b0 = (1156862367); + int2x3 r0 = int2x3(560988938, 629524514, 767711194, 434281967, 242943526, 792916846); + TestUtils.AreEqual(r0, a0 % b0); + + int2x3 a1 = int2x3(1663690927, 1776636144, 1287035793, 1743722161, 475209785, 327476870); + int b1 = (598661916); + int2x3 r1 = int2x3(466367095, 579312312, 89711961, 546398329, 475209785, 327476870); + TestUtils.AreEqual(r1, a1 % b1); + + int2x3 a2 = int2x3(1617696916, 477430114, 858399046, 712734431, 1506629323, 199829950); + int b2 = (379853074); + int2x3 r2 = int2x3(98284620, 97577040, 98692898, 332881357, 367070101, 199829950); + TestUtils.AreEqual(r2, a2 % b2); + + int2x3 a3 = int2x3(362269020, 1351725413, 1549678101, 431765276, 1315833792, 1664893153); + int b3 = (1986626876); + int2x3 r3 = int2x3(362269020, 1351725413, 1549678101, 431765276, 1315833792, 1664893153); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void int2x3_operator_mod_scalar_wide() + { + int a0 = (933347930); + int2x3 b0 = int2x3(549923387, 243114953, 1884274390, 1428033594, 655531454, 1622674954); + int2x3 r0 = int2x3(383424543, 204003071, 933347930, 933347930, 277816476, 933347930); + TestUtils.AreEqual(r0, a0 % b0); + + int a1 = (1107563514); + int2x3 b1 = int2x3(1614111094, 914801920, 1432263179, 564431096, 1967013901, 1709750152); + int2x3 r1 = int2x3(1107563514, 192761594, 1107563514, 543132418, 1107563514, 1107563514); + TestUtils.AreEqual(r1, a1 % b1); + + int a2 = (1080102613); + int2x3 b2 = int2x3(13120773, 2042535998, 1505698002, 1640058084, 974167554, 758635306); + int2x3 r2 = int2x3(4199227, 1080102613, 1080102613, 1080102613, 105935059, 321467307); + TestUtils.AreEqual(r2, a2 % b2); + + int a3 = (1387264978); + int2x3 b3 = int2x3(611743343, 1139002766, 1913935748, 1086810076, 991846486, 922870408); + int2x3 r3 = int2x3(163778292, 248262212, 1387264978, 300454902, 395418492, 464394570); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void int2x3_operator_plus() + { + int2x3 a0 = int2x3(195392567, 222719748, 1002351013, 1570765263, 109389333, 1515950277); + int2x3 r0 = int2x3(195392567, 222719748, 1002351013, 1570765263, 109389333, 1515950277); + TestUtils.AreEqual(r0, +a0); + + int2x3 a1 = int2x3(1689763402, 264115671, 1084131995, 195779102, 2131702223, 715660442); + int2x3 r1 = int2x3(1689763402, 264115671, 1084131995, 195779102, 2131702223, 715660442); + TestUtils.AreEqual(r1, +a1); + + int2x3 a2 = int2x3(1995564647, 1317851903, 1957501908, 531426536, 2012985092, 1334133318); + int2x3 r2 = int2x3(1995564647, 1317851903, 1957501908, 531426536, 2012985092, 1334133318); + TestUtils.AreEqual(r2, +a2); + + int2x3 a3 = int2x3(1539671418, 1575048895, 2119066258, 781435471, 1659000230, 1301861249); + int2x3 r3 = int2x3(1539671418, 1575048895, 2119066258, 781435471, 1659000230, 1301861249); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void int2x3_operator_neg() + { + int2x3 a0 = int2x3(1385088677, 94114564, 1350664872, 1458616659, 2067164853, 218122493); + int2x3 r0 = int2x3(-1385088677, -94114564, -1350664872, -1458616659, -2067164853, -218122493); + TestUtils.AreEqual(r0, -a0); + + int2x3 a1 = int2x3(958484951, 446497525, 270503114, 1928771252, 1427605822, 2051940607); + int2x3 r1 = int2x3(-958484951, -446497525, -270503114, -1928771252, -1427605822, -2051940607); + TestUtils.AreEqual(r1, -a1); + + int2x3 a2 = int2x3(1434247484, 908365416, 1742096480, 990033169, 1368056141, 1350976157); + int2x3 r2 = int2x3(-1434247484, -908365416, -1742096480, -990033169, -1368056141, -1350976157); + TestUtils.AreEqual(r2, -a2); + + int2x3 a3 = int2x3(12802586, 576597401, 785136322, 559205611, 1959833280, 162379661); + int2x3 r3 = int2x3(-12802586, -576597401, -785136322, -559205611, -1959833280, -162379661); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void int2x3_operator_prefix_inc() + { + int2x3 a0 = int2x3(780471723, 954741756, 272723451, 2142862245, 606294309, 1514814550); + int2x3 r0 = int2x3(780471724, 954741757, 272723452, 2142862246, 606294310, 1514814551); + TestUtils.AreEqual(r0, ++a0); + + int2x3 a1 = int2x3(250124151, 1833356994, 1915989169, 1348278302, 129540735, 1584496757); + int2x3 r1 = int2x3(250124152, 1833356995, 1915989170, 1348278303, 129540736, 1584496758); + TestUtils.AreEqual(r1, ++a1); + + int2x3 a2 = int2x3(1170613526, 1701179230, 1397451003, 483952900, 1494652811, 1268688387); + int2x3 r2 = int2x3(1170613527, 1701179231, 1397451004, 483952901, 1494652812, 1268688388); + TestUtils.AreEqual(r2, ++a2); + + int2x3 a3 = int2x3(2014528731, 1112537171, 621362788, 2063486914, 1612870531, 1161037742); + int2x3 r3 = int2x3(2014528732, 1112537172, 621362789, 2063486915, 1612870532, 1161037743); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void int2x3_operator_postfix_inc() + { + int2x3 a0 = int2x3(241865086, 2145821641, 1596166022, 803592338, 529551271, 1656767229); + int2x3 r0 = int2x3(241865086, 2145821641, 1596166022, 803592338, 529551271, 1656767229); + TestUtils.AreEqual(r0, a0++); + + int2x3 a1 = int2x3(903047443, 1425753247, 1384002775, 389844650, 1159795446, 1343289659); + int2x3 r1 = int2x3(903047443, 1425753247, 1384002775, 389844650, 1159795446, 1343289659); + TestUtils.AreEqual(r1, a1++); + + int2x3 a2 = int2x3(1227160199, 137930180, 451018043, 1634297552, 2009552507, 1176922170); + int2x3 r2 = int2x3(1227160199, 137930180, 451018043, 1634297552, 2009552507, 1176922170); + TestUtils.AreEqual(r2, a2++); + + int2x3 a3 = int2x3(388721494, 2062858295, 715101397, 1725384327, 446867079, 2101314783); + int2x3 r3 = int2x3(388721494, 2062858295, 715101397, 1725384327, 446867079, 2101314783); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void int2x3_operator_prefix_dec() + { + int2x3 a0 = int2x3(1331961415, 1612382200, 1401591249, 2042075388, 1757136546, 1895858159); + int2x3 r0 = int2x3(1331961414, 1612382199, 1401591248, 2042075387, 1757136545, 1895858158); + TestUtils.AreEqual(r0, --a0); + + int2x3 a1 = int2x3(1467742422, 1336115745, 2059077641, 1169239112, 1862369220, 312317355); + int2x3 r1 = int2x3(1467742421, 1336115744, 2059077640, 1169239111, 1862369219, 312317354); + TestUtils.AreEqual(r1, --a1); + + int2x3 a2 = int2x3(1027543764, 1426262619, 1426620468, 674685792, 1423852012, 1459529624); + int2x3 r2 = int2x3(1027543763, 1426262618, 1426620467, 674685791, 1423852011, 1459529623); + TestUtils.AreEqual(r2, --a2); + + int2x3 a3 = int2x3(2092317419, 1261583506, 512900840, 1496855314, 777588547, 617644613); + int2x3 r3 = int2x3(2092317418, 1261583505, 512900839, 1496855313, 777588546, 617644612); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void int2x3_operator_postfix_dec() + { + int2x3 a0 = int2x3(1870005937, 1708534798, 704493460, 462940703, 2060593573, 228744869); + int2x3 r0 = int2x3(1870005937, 1708534798, 704493460, 462940703, 2060593573, 228744869); + TestUtils.AreEqual(r0, a0--); + + int2x3 a1 = int2x3(940247280, 1015253889, 862428933, 1401191870, 2080259851, 653673271); + int2x3 r1 = int2x3(940247280, 1015253889, 862428933, 1401191870, 2080259851, 653673271); + TestUtils.AreEqual(r1, a1--); + + int2x3 a2 = int2x3(140452688, 1760916301, 1174531383, 634036198, 993137684, 1669210509); + int2x3 r2 = int2x3(140452688, 1760916301, 1174531383, 634036198, 993137684, 1669210509); + TestUtils.AreEqual(r2, a2--); + + int2x3 a3 = int2x3(874927437, 471308632, 620865961, 220103745, 1407678826, 319906934); + int2x3 r3 = int2x3(874927437, 471308632, 620865961, 220103745, 1407678826, 319906934); + TestUtils.AreEqual(r3, a3--); + } + + [TestCompiler] + public static void int2x3_operator_bitwise_and_wide_wide() + { + int2x3 a0 = int2x3(1055241304, 859321394, 1088358961, 2090949513, 300561740, 651904515); + int2x3 b0 = int2x3(749698416, 748105424, 1842764797, 9990577, 1989102105, 1666634755); + int2x3 r0 = int2x3(749024336, 537928720, 1087769137, 8409473, 277479432, 575816707); + TestUtils.AreEqual(r0, a0 & b0); + + int2x3 a1 = int2x3(1331035868, 2012752753, 1298126656, 53199569, 1752363533, 1303061302); + int2x3 b1 = int2x3(58116798, 868036607, 1420638875, 1308767169, 564040763, 478617502); + int2x3 r1 = int2x3(55888540, 867707761, 1141707264, 33686209, 538087433, 209912598); + TestUtils.AreEqual(r1, a1 & b1); + + int2x3 a2 = int2x3(1929998247, 1504941434, 470682792, 713577376, 1493231658, 1340884669); + int2x3 b2 = int2x3(806150474, 674015378, 1505309955, 36064977, 1779639327, 808650076); + int2x3 r2 = int2x3(805855490, 136347666, 403178496, 33571456, 1207967754, 2098204); + TestUtils.AreEqual(r2, a2 & b2); + + int2x3 a3 = int2x3(1577921467, 44846626, 1105094388, 1143008413, 333009589, 2116296009); + int2x3 b3 = int2x3(1634437037, 1997568501, 1930853951, 1901503461, 1508772523, 2010961769); + int2x3 r3 = int2x3(1074332585, 33572896, 1091986996, 1073782917, 298320545, 1979979081); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void int2x3_operator_bitwise_and_wide_scalar() + { + int2x3 a0 = int2x3(1513158868, 284695609, 734595037, 1566510707, 1601252476, 84213838); + int b0 = (1173647397); + int2x3 r0 = int2x3(1076916228, 15732769, 29360133, 1163132961, 1164976164, 84148228); + TestUtils.AreEqual(r0, a0 & b0); + + int2x3 a1 = int2x3(314333543, 753481263, 327392481, 1619794917, 2143619546, 1873208293); + int b1 = (430856908); + int2x3 r1 = int2x3(279730244, 145232396, 293738688, 9181892, 428083400, 161891012); + TestUtils.AreEqual(r1, a1 & b1); + + int2x3 a2 = int2x3(126982769, 1383096952, 1689107088, 1368301071, 366962092, 1729929586); + int b2 = (651482651); + int2x3 r2 = int2x3(110137873, 38814232, 612667920, 8689163, 81019912, 638877714); + TestUtils.AreEqual(r2, a2 & b2); + + int2x3 a3 = int2x3(989550739, 1592791064, 2047510829, 678485991, 586400261, 771972179); + int b3 = (1914435619); + int2x3 r3 = int2x3(840652803, 1376784384, 1913292833, 537974819, 571719681, 570644483); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void int2x3_operator_bitwise_and_scalar_wide() + { + int a0 = (477163326); + int2x3 b0 = int2x3(110453385, 703240362, 2075630560, 1884904031, 1734899436, 947945203); + int2x3 r0 = int2x3(68182536, 140544042, 405834528, 273697310, 73426476, 402681394); + TestUtils.AreEqual(r0, a0 & b0); + + int a1 = (1664399051); + int2x3 b1 = int2x3(458879298, 158491426, 79772356, 2054527944, 202228212, 359225061); + int2x3 r1 = int2x3(51425346, 19931650, 12992, 1647612616, 295104, 18880193); + TestUtils.AreEqual(r1, a1 & b1); + + int a2 = (639811396); + int2x3 b2 = int2x3(1821945318, 1821303024, 2030124055, 1985961756, 579780373, 2061831301); + int2x3 r2 = int2x3(604024132, 604151872, 536886276, 637673220, 570605316, 572525572); + TestUtils.AreEqual(r2, a2 & b2); + + int a3 = (1139618293); + int2x3 b3 = int2x3(1145191868, 1121606282, 1414714065, 688688277, 1508875606, 664318814); + int2x3 r3 = int2x3(1077948852, 1120407680, 1077940433, 17563797, 1106055508, 59257172); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void int2x3_operator_bitwise_or_wide_wide() + { + int2x3 a0 = int2x3(1920951869, 1750772852, 1420019191, 732977093, 1169579447, 229437930); + int2x3 b0 = int2x3(214585254, 275414367, 858759675, 190211455, 1218691723, 2129565457); + int2x3 r0 = int2x3(2130669503, 2021326207, 2008016383, 737572863, 1303895999, 2146367483); + TestUtils.AreEqual(r0, a0 | b0); + + int2x3 a1 = int2x3(1966721348, 2039812323, 113550869, 1912038362, 1569990624, 1490718227); + int2x3 b1 = int2x3(1862809466, 495728846, 868064152, 1756913766, 933656055, 247722084); + int2x3 r1 = int2x3(2134507390, 2107455727, 939376541, 2046780414, 2142664695, 1591475831); + TestUtils.AreEqual(r1, a1 | b1); + + int2x3 a2 = int2x3(1686257697, 2137727522, 1569900650, 856504729, 2033376384, 2086259889); + int2x3 b2 = int2x3(1884195075, 1804207631, 1913174711, 1815920856, 1226577606, 1696467642); + int2x3 r2 = int2x3(1959708963, 2146117167, 2140863231, 2134768089, 2034163398, 2103430843); + TestUtils.AreEqual(r2, a2 | b2); + + int2x3 a3 = int2x3(671790684, 1189001916, 1756048437, 417084592, 2024165808, 966008272); + int2x3 b3 = int2x3(186912044, 1778908130, 1461256625, 1142152181, 272117331, 1162254035); + int2x3 r3 = int2x3(724483964, 1860172798, 2142973365, 1558183925, 2025750515, 2111217619); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void int2x3_operator_bitwise_or_wide_scalar() + { + int2x3 a0 = int2x3(1295304853, 1307252624, 350194630, 1128063578, 1774824542, 2085245467); + int b0 = (1305527136); + int2x3 r0 = int2x3(1307888629, 1308350448, 1574947814, 1341973370, 1842999166, 2111492987); + TestUtils.AreEqual(r0, a0 | b0); + + int2x3 a1 = int2x3(1988423804, 2110327307, 1050875188, 341855232, 1317039676, 228656898); + int b1 = (999162350); + int2x3 r1 = int2x3(2140074494, 2144275439, 1068439038, 1072582126, 2140041214, 1068435438); + TestUtils.AreEqual(r1, a1 | b1); + + int2x3 a2 = int2x3(41280811, 606786773, 1739461580, 2040936581, 1350320187, 1377874553); + int b2 = (1536908787); + int2x3 r2 = int2x3(1543503355, 2143018487, 2143248383, 2076147191, 1543462395, 1539047419); + TestUtils.AreEqual(r2, a2 | b2); + + int2x3 a3 = int2x3(1522262112, 1732466858, 1535976093, 375675620, 1614193383, 226059393); + int b3 = (1496806239); + int2x3 r3 = int2x3(1539306367, 2138536959, 1539273695, 1601666047, 2033710079, 1568634847); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void int2x3_operator_bitwise_or_scalar_wide() + { + int a0 = (1768627592); + int2x3 b0 = int2x3(1849658052, 1759912154, 729979455, 975926310, 1987690876, 1809506714); + int2x3 r0 = int2x3(1870634956, 1777286618, 1810603967, 2070642094, 2138824188, 1811676570); + TestUtils.AreEqual(r0, a0 | b0); + + int a1 = (1160695341); + int2x3 b1 = int2x3(408963395, 314072711, 1560007537, 1709003416, 977086639, 1448375596); + int2x3 r1 = int2x3(1567543151, 1472126639, 1577049981, 1711267517, 2134896303, 1467940653); + TestUtils.AreEqual(r1, a1 | b1); + + int a2 = (1689568808); + int2x3 b2 = int2x3(595543345, 559778387, 621080913, 438994183, 1742637145, 1219409263); + int2x3 r2 = int2x3(1744815929, 1711132283, 1706358649, 2126432047, 1744752249, 1824454511); + TestUtils.AreEqual(r2, a2 | b2); + + int a3 = (1602932494); + int2x3 b3 = int2x3(1204461702, 2111538444, 836730895, 1207638621, 802100209, 1089077339); + int2x3 r3 = int2x3(1607135118, 2145111822, 2145373967, 1610342239, 2144329727, 1609224031); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void int2x3_operator_bitwise_xor_wide_wide() + { + int2x3 a0 = int2x3(1843655608, 362425681, 640805534, 1342040268, 945678755, 980321850); + int2x3 b0 = int2x3(1422803441, 1234691140, 119589253, 1101464929, 121896337, 1880109018); + int2x3 r0 = int2x3(959296073, 1544407317, 554771227, 240840109, 1058935858, 1249815008); + TestUtils.AreEqual(r0, a0 ^ b0); + + int2x3 a1 = int2x3(390165019, 1682422658, 303897251, 230477768, 1103646442, 1503102919); + int2x3 b1 = int2x3(1000210266, 1718938232, 464406940, 884337881, 34199854, 1430659227); + int2x3 r1 = int2x3(752651585, 36917754, 162747199, 956900113, 1136760772, 215066460); + TestUtils.AreEqual(r1, a1 ^ b1); + + int2x3 a2 = int2x3(26631152, 1016475570, 1862440929, 379588576, 1943580404, 691527166); + int2x3 b2 = int2x3(126415540, 1069919967, 1810763253, 2082802224, 941097951, 27782297); + int2x3 r2 = int2x3(102672708, 55804269, 82614804, 1787102672, 1270918443, 680538471); + TestUtils.AreEqual(r2, a2 ^ b2); + + int2x3 a3 = int2x3(723280696, 497086939, 1640104913, 893178410, 1596765788, 664096470); + int2x3 b3 = int2x3(156353074, 607061607, 470737131, 1151564598, 8268481, 434405645); + int2x3 r3 = int2x3(575512842, 965736380, 2110579514, 1906288924, 1599249565, 1047646171); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void int2x3_operator_bitwise_xor_wide_scalar() + { + int2x3 a0 = int2x3(169345668, 176087064, 2084362901, 1663924004, 193851255, 517476661); + int b0 = (354464228); + int2x3 r0 = int2x3(523809632, 526275068, 1763470193, 1980614336, 514678419, 200843473); + TestUtils.AreEqual(r0, a0 ^ b0); + + int2x3 a1 = int2x3(905336222, 365003873, 835837496, 954341348, 1464576786, 625604047); + int b1 = (863800783); + int2x3 r1 = int2x3(109762641, 649922990, 44913655, 194943531, 1681336029, 372602880); + TestUtils.AreEqual(r1, a1 ^ b1); + + int2x3 a2 = int2x3(1700827127, 1481813598, 1077374714, 1043379893, 1991576049, 781860967); + int b2 = (2003392824); + int2x3 r2 = int2x3(302634703, 792459110, 928921538, 1230630797, 31215817, 1509103967); + TestUtils.AreEqual(r2, a2 ^ b2); + + int2x3 a3 = int2x3(60088394, 858716109, 858484213, 178843494, 1223183458, 866652388); + int b3 = (1196907956); + int2x3 r3 = int2x3(1153678846, 1954130553, 1954295873, 1308603090, 264180182, 1962888528); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void int2x3_operator_bitwise_xor_scalar_wide() + { + int a0 = (1361775641); + int2x3 b0 = int2x3(1452773578, 459050892, 1986218254, 1689037698, 999278344, 1229114508); + int2x3 r0 = int2x3(129801427, 1249346453, 659047703, 898082715, 1789184785, 409583765); + TestUtils.AreEqual(r0, a0 ^ b0); + + int a1 = (1087843538); + int2x3 b1 = int2x3(733699740, 106187872, 1533632738, 1107817672, 492506236, 597602329); + int2x3 r1 = int2x3(1802269262, 1183015090, 465456176, 47241242, 1569464494, 1665768651); + TestUtils.AreEqual(r1, a1 ^ b1); + + int a2 = (1439603382); + int2x3 b2 = int2x3(1001169118, 1231718216, 1693179077, 1050897427, 1796435561, 1100532547); + int2x3 r2 = int2x3(1851931240, 480517630, 824526451, 1802368677, 1054733535, 341201397); + TestUtils.AreEqual(r2, a2 ^ b2); + + int a3 = (2106589181); + int2x3 b3 = int2x3(79691722, 851486414, 381749210, 1743618507, 2038827673, 1680906962); + int2x3 r3 = int2x3(2033188919, 1330600243, 1800337447, 442662454, 67761508, 431973679); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void int2x3_operator_left_shift() + { + int2x3 a0 = int2x3(1129100049, 829482269, 1571297368, 443753193, 1872142968, 249554593); + int b0 = (218351941); + int2x3 r0 = int2x3(1771463200, 773628832, -1258091776, 1315200288, -220967168, -604187616); + TestUtils.AreEqual(r0, a0 << b0); + + int2x3 a1 = int2x3(892627436, 62369727, 849916599, 1271350845, 108441902, 1959056531); + int b1 = (980302862); + int2x3 r1 = int2x3(444268544, -336609280, 749584384, -779141120, -1404338176, 891600896); + TestUtils.AreEqual(r1, a1 << b1); + + int2x3 a2 = int2x3(1779118882, 2082026915, 1149883636, 1380536034, 186532735, 1487486874); + int b2 = (1451674188); + int2x3 r2 = int2x3(-1288560640, -1822806016, -1655750656, -1796333568, -466096128, -1812357120); + TestUtils.AreEqual(r2, a2 << b2); + + int2x3 a3 = int2x3(1498738574, 1647167336, 772453640, 456967739, 947384545, 1463252873); + int b3 = (752067504); + int2x3 r3 = int2x3(-275906560, -949485568, -1257766912, -969211904, -253689856, 2005467136); + TestUtils.AreEqual(r3, a3 << b3); + } + + [TestCompiler] + public static void int2x3_operator_right_shift() + { + int2x3 a0 = int2x3(809126085, 908563670, 763568837, 1986717290, 1174507510, 646821842); + int b0 = (994800051); + int2x3 r0 = int2x3(1543, 1732, 1456, 3789, 2240, 1233); + TestUtils.AreEqual(r0, a0 >> b0); + + int2x3 a1 = int2x3(1242726074, 1521420393, 1923166649, 102096936, 400863878, 667378673); + int b1 = (390811632); + int2x3 r1 = int2x3(18962, 23215, 29345, 1557, 6116, 10183); + TestUtils.AreEqual(r1, a1 >> b1); + + int2x3 a2 = int2x3(1611921244, 479442287, 2014389412, 1673938174, 1075916177, 1248577253); + int b2 = (307750782); + int2x3 r2 = int2x3(1, 0, 1, 1, 1, 1); + TestUtils.AreEqual(r2, a2 >> b2); + + int2x3 a3 = int2x3(848199210, 848976170, 500930883, 662405800, 126875849, 1103917083); + int b3 = (813936577); + int2x3 r3 = int2x3(424099605, 424488085, 250465441, 331202900, 63437924, 551958541); + TestUtils.AreEqual(r3, a3 >> b3); + } + + [TestCompiler] + public static void int2x3_operator_bitwise_not() + { + int2x3 a0 = int2x3(111796841, 603562399, 745091931, 853183268, 1110916612, 381888399); + int2x3 r0 = int2x3(-111796842, -603562400, -745091932, -853183269, -1110916613, -381888400); + TestUtils.AreEqual(r0, ~a0); + + int2x3 a1 = int2x3(1891338755, 771210628, 787710759, 875964607, 96456785, 916013379); + int2x3 r1 = int2x3(-1891338756, -771210629, -787710760, -875964608, -96456786, -916013380); + TestUtils.AreEqual(r1, ~a1); + + int2x3 a2 = int2x3(203444882, 1020232736, 683852713, 375158799, 881353367, 1218471344); + int2x3 r2 = int2x3(-203444883, -1020232737, -683852714, -375158800, -881353368, -1218471345); + TestUtils.AreEqual(r2, ~a2); + + int2x3 a3 = int2x3(1174233245, 443427914, 1385118179, 215320517, 860122767, 1411266016); + int2x3 r3 = int2x3(-1174233246, -443427915, -1385118180, -215320518, -860122768, -1411266017); + TestUtils.AreEqual(r3, ~a3); + } + + [TestCase /* For player builds */] + public static void int2x3_EqualsObjectOverride() + { + TestUtils.IsFalse(new int2x3().Equals((object)new int())); + TestUtils.IsTrue(new int2x3().Equals((object)new int2x3())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestInt2x3.gen.cs.meta b/src/Tests/Tests/Shared/TestInt2x3.gen.cs.meta new file mode 100644 index 00000000..d64f81d4 --- /dev/null +++ b/src/Tests/Tests/Shared/TestInt2x3.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6a957081e92e7e5429649cd56b5453b0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestInt2x4.gen.cs b/src/Tests/Tests/Shared/TestInt2x4.gen.cs new file mode 100644 index 00000000..3fd7b8b3 --- /dev/null +++ b/src/Tests/Tests/Shared/TestInt2x4.gen.cs @@ -0,0 +1,1236 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestInt2x4 + { + [TestCompiler] + public static void int2x4_zero() + { + TestUtils.AreEqual(0, int2x4.zero.c0.x); + TestUtils.AreEqual(0, int2x4.zero.c0.y); + TestUtils.AreEqual(0, int2x4.zero.c1.x); + TestUtils.AreEqual(0, int2x4.zero.c1.y); + TestUtils.AreEqual(0, int2x4.zero.c2.x); + TestUtils.AreEqual(0, int2x4.zero.c2.y); + TestUtils.AreEqual(0, int2x4.zero.c3.x); + TestUtils.AreEqual(0, int2x4.zero.c3.y); + } + + [TestCompiler] + public static void int2x4_operator_equal_wide_wide() + { + int2x4 a0 = int2x4(2105871082, 35218899, 1550755093, 764676020, 606743782, 1208156098, 1023640014, 1038468316); + int2x4 b0 = int2x4(1477587886, 579629692, 540974792, 208405066, 2063397938, 1060167409, 362592601, 2097545362); + bool2x4 r0 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + int2x4 a1 = int2x4(1416064367, 727143393, 2061243891, 184669837, 1303661760, 2044073738, 370395888, 1822916805); + int2x4 b1 = int2x4(277670088, 426944490, 901076223, 857900673, 1548779757, 325265488, 312658571, 176373760); + bool2x4 r1 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + int2x4 a2 = int2x4(1076983135, 345215866, 833676277, 1987782708, 1481088614, 1364754268, 93639636, 1850596922); + int2x4 b2 = int2x4(2052378097, 858156597, 982817797, 1252095508, 882634538, 1959142806, 72495800, 1077678183); + bool2x4 r2 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + int2x4 a3 = int2x4(2073471507, 1745989448, 28118669, 1267554232, 1292918049, 1423451579, 644384701, 1985492825); + int2x4 b3 = int2x4(1729269763, 1607675346, 1813461519, 1204794859, 1324801873, 1975336, 439410532, 294085211); + bool2x4 r3 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void int2x4_operator_equal_wide_scalar() + { + int2x4 a0 = int2x4(437822262, 2020661134, 541786900, 853113810, 23716499, 179951405, 1409026299, 948838849); + int b0 = (1332833578); + bool2x4 r0 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + int2x4 a1 = int2x4(953202998, 1926262965, 1851546137, 712957637, 2028784869, 1049962241, 1836975611, 1016802970); + int b1 = (691955848); + bool2x4 r1 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + int2x4 a2 = int2x4(390120467, 1451642042, 289137869, 152339338, 808355440, 660053867, 597354173, 67320270); + int b2 = (464814777); + bool2x4 r2 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + int2x4 a3 = int2x4(151461188, 602895443, 186996278, 129611815, 1031574999, 1697392883, 1463742000, 857785521); + int b3 = (35153827); + bool2x4 r3 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void int2x4_operator_equal_scalar_wide() + { + int a0 = (542329200); + int2x4 b0 = int2x4(1115584594, 684107773, 1928988941, 890709324, 641152437, 1410341302, 497505660, 1068223109); + bool2x4 r0 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + int a1 = (2014009435); + int2x4 b1 = int2x4(213835595, 1592428361, 1819361470, 448650623, 1942175642, 64377057, 1485938610, 1146305380); + bool2x4 r1 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + int a2 = (1312317120); + int2x4 b2 = int2x4(263290348, 812663708, 1585209188, 40646617, 1378718922, 1957797737, 873652576, 1780082094); + bool2x4 r2 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + int a3 = (1513270921); + int2x4 b3 = int2x4(2095980581, 1413074719, 1387984261, 1547119354, 924385171, 1253636050, 1477542688, 969120167); + bool2x4 r3 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void int2x4_operator_not_equal_wide_wide() + { + int2x4 a0 = int2x4(1977284100, 1293292704, 1547283851, 422428953, 195833190, 1711544892, 5606053, 737069074); + int2x4 b0 = int2x4(1514195556, 957972049, 507667364, 581861672, 1128094576, 940096636, 57559040, 181752616); + bool2x4 r0 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + int2x4 a1 = int2x4(647386678, 13079405, 1413841590, 1076166545, 1211445174, 1289303469, 1436402489, 1129570126); + int2x4 b1 = int2x4(962017320, 1762015406, 1107218953, 2042026522, 836002288, 570272309, 2112081980, 1500634658); + bool2x4 r1 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + int2x4 a2 = int2x4(1566836685, 1343313905, 329259205, 1774944480, 33906739, 2055853627, 2035015372, 1702756001); + int2x4 b2 = int2x4(1787808345, 566425667, 2037529609, 1520589840, 266793699, 538816359, 2075474643, 553571317); + bool2x4 r2 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + int2x4 a3 = int2x4(1164186087, 329853698, 769052491, 1893312730, 438029011, 1894010522, 1365847542, 1292942830); + int2x4 b3 = int2x4(218264354, 654754196, 1392180230, 870065147, 1398749829, 711281563, 1999640291, 231234857); + bool2x4 r3 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void int2x4_operator_not_equal_wide_scalar() + { + int2x4 a0 = int2x4(1038269360, 1427812625, 103361237, 1347017023, 1523584313, 150442802, 660334527, 719113717); + int b0 = (768873026); + bool2x4 r0 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + int2x4 a1 = int2x4(262959423, 506946952, 226568494, 507918242, 1702162286, 923269270, 166187260, 114581840); + int b1 = (484398043); + bool2x4 r1 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + int2x4 a2 = int2x4(1045389187, 1461803977, 61801615, 1317840133, 2146927809, 1557151164, 1284033253, 1345705546); + int b2 = (1648095254); + bool2x4 r2 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + int2x4 a3 = int2x4(1747302566, 1368046109, 1848036266, 2025452920, 373992983, 289537519, 1388743060, 146455100); + int b3 = (611028295); + bool2x4 r3 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void int2x4_operator_not_equal_scalar_wide() + { + int a0 = (1652127596); + int2x4 b0 = int2x4(953791238, 271722683, 1278885987, 735128017, 112416504, 25967222, 1761444475, 1844594536); + bool2x4 r0 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + int a1 = (1199122922); + int2x4 b1 = int2x4(634219279, 942501101, 67161343, 969944293, 833229499, 1304301133, 704045745, 345012334); + bool2x4 r1 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + int a2 = (1253134152); + int2x4 b2 = int2x4(325772538, 855127202, 793668881, 1584481616, 1101301152, 276853534, 987168816, 1258105989); + bool2x4 r2 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + int a3 = (362645228); + int2x4 b3 = int2x4(293978043, 1772395973, 1692007315, 681268929, 1535518457, 595209334, 25745185, 1278016813); + bool2x4 r3 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void int2x4_operator_less_wide_wide() + { + int2x4 a0 = int2x4(1486550609, 1779244308, 1602148045, 1614085440, 1975613414, 942838342, 1092279031, 373677431); + int2x4 b0 = int2x4(97842578, 536551311, 413528975, 1838293684, 1283898480, 1456599961, 1080278602, 529676676); + bool2x4 r0 = bool2x4(false, false, false, true, false, true, false, true); + TestUtils.AreEqual(r0, a0 < b0); + + int2x4 a1 = int2x4(1419098312, 337757077, 1081797900, 1336745069, 840685445, 1220554047, 2013681746, 192965012); + int2x4 b1 = int2x4(156584048, 117348799, 246927124, 1916615924, 1731071394, 1328098431, 1014995792, 480319327); + bool2x4 r1 = bool2x4(false, false, false, true, true, true, false, true); + TestUtils.AreEqual(r1, a1 < b1); + + int2x4 a2 = int2x4(532043965, 1000693402, 927236048, 1215860000, 780607596, 1882056852, 1354146545, 2135295778); + int2x4 b2 = int2x4(1765937053, 1333997067, 688515308, 1856106947, 1303906227, 646821776, 1169473993, 316770064); + bool2x4 r2 = bool2x4(true, true, false, true, true, false, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + int2x4 a3 = int2x4(1145973790, 1938006975, 895882838, 2006524299, 908581156, 1843349513, 1340458575, 1972095585); + int2x4 b3 = int2x4(1518155802, 416732703, 529193056, 1239623485, 2010112031, 2018560298, 285987009, 960617622); + bool2x4 r3 = bool2x4(true, false, false, false, true, true, false, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void int2x4_operator_less_wide_scalar() + { + int2x4 a0 = int2x4(796797557, 670113454, 933579492, 278884514, 318174822, 1117630673, 741886928, 1990922600); + int b0 = (746564682); + bool2x4 r0 = bool2x4(false, true, false, true, true, false, true, false); + TestUtils.AreEqual(r0, a0 < b0); + + int2x4 a1 = int2x4(1030849597, 1718582899, 1648393417, 1857132231, 1909506562, 1294006045, 952084157, 1303736668); + int b1 = (1546212312); + bool2x4 r1 = bool2x4(true, false, false, false, false, true, true, true); + TestUtils.AreEqual(r1, a1 < b1); + + int2x4 a2 = int2x4(845460171, 1368236640, 24980695, 1434668705, 659552739, 1058492383, 165694933, 1204097259); + int b2 = (979430272); + bool2x4 r2 = bool2x4(true, false, true, false, true, false, true, false); + TestUtils.AreEqual(r2, a2 < b2); + + int2x4 a3 = int2x4(922212691, 24629507, 1386458568, 1325149699, 1498707004, 1650355158, 1213017950, 1650457461); + int b3 = (281328069); + bool2x4 r3 = bool2x4(false, true, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void int2x4_operator_less_scalar_wide() + { + int a0 = (186400299); + int2x4 b0 = int2x4(1881344229, 813834467, 1254886626, 1353590345, 1412343685, 1555571443, 1540508298, 1735458634); + bool2x4 r0 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 < b0); + + int a1 = (135888070); + int2x4 b1 = int2x4(1643818742, 248291654, 1739560105, 728539891, 480507742, 1696553040, 540223931, 1840493353); + bool2x4 r1 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 < b1); + + int a2 = (146833656); + int2x4 b2 = int2x4(798115946, 2002002066, 1011261705, 783550942, 1093071215, 598253401, 1432416562, 1863582169); + bool2x4 r2 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 < b2); + + int a3 = (103622950); + int2x4 b3 = int2x4(775175960, 116908309, 1213433625, 1428954824, 1760442490, 1208143947, 751820805, 1491872302); + bool2x4 r3 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void int2x4_operator_greater_wide_wide() + { + int2x4 a0 = int2x4(2087717754, 1725569452, 1298066182, 1693943616, 1319019629, 70674491, 1042499725, 1002821508); + int2x4 b0 = int2x4(85148514, 293632137, 1151128249, 409440398, 1115020183, 1508500597, 1834583302, 1755218534); + bool2x4 r0 = bool2x4(true, true, true, true, true, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + int2x4 a1 = int2x4(1021857133, 1744374599, 821751047, 467646903, 2029731638, 1377214212, 1207816926, 474621063); + int2x4 b1 = int2x4(1788761753, 1128238489, 834223713, 1578743290, 1647150256, 1756397855, 1131080201, 1208965204); + bool2x4 r1 = bool2x4(false, true, false, false, true, false, true, false); + TestUtils.AreEqual(r1, a1 > b1); + + int2x4 a2 = int2x4(20781266, 366593779, 2068457387, 10181449, 793634464, 144474612, 99947390, 930377263); + int2x4 b2 = int2x4(1495161099, 1283714281, 908051907, 412849651, 815822687, 730271942, 40756039, 883326140); + bool2x4 r2 = bool2x4(false, false, true, false, false, false, true, true); + TestUtils.AreEqual(r2, a2 > b2); + + int2x4 a3 = int2x4(683686232, 742803073, 918292048, 875621429, 1764985258, 411384146, 1921397684, 1349107119); + int2x4 b3 = int2x4(476260632, 1024136446, 1440596667, 1253494041, 146826162, 1798399573, 2085029408, 187939428); + bool2x4 r3 = bool2x4(true, false, false, false, true, false, false, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void int2x4_operator_greater_wide_scalar() + { + int2x4 a0 = int2x4(1208626274, 239697208, 1979453345, 1253474001, 1590192876, 1487911635, 1673945595, 1662650098); + int b0 = (1715176566); + bool2x4 r0 = bool2x4(false, false, true, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + int2x4 a1 = int2x4(222749855, 566635217, 1773305960, 1850273578, 206147145, 325913453, 333381537, 1905567362); + int b1 = (1433540517); + bool2x4 r1 = bool2x4(false, false, true, true, false, false, false, true); + TestUtils.AreEqual(r1, a1 > b1); + + int2x4 a2 = int2x4(2053577491, 2128431130, 1735325311, 529971908, 1663525234, 1972984241, 1587865063, 488268523); + int b2 = (570397194); + bool2x4 r2 = bool2x4(true, true, true, false, true, true, true, false); + TestUtils.AreEqual(r2, a2 > b2); + + int2x4 a3 = int2x4(121921923, 181082921, 1281638484, 1818357732, 116518997, 1397728785, 1924199337, 742950077); + int b3 = (812076921); + bool2x4 r3 = bool2x4(false, false, true, true, false, true, true, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void int2x4_operator_greater_scalar_wide() + { + int a0 = (480938827); + int2x4 b0 = int2x4(1824731899, 921496110, 586859044, 946430596, 1231356727, 1390167458, 1785807092, 28949024); + bool2x4 r0 = bool2x4(false, false, false, false, false, false, false, true); + TestUtils.AreEqual(r0, a0 > b0); + + int a1 = (2037899283); + int2x4 b1 = int2x4(595656760, 1778095771, 1233500439, 1696302238, 1445965340, 484020151, 1586962841, 1361740714); + bool2x4 r1 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + int a2 = (265628948); + int2x4 b2 = int2x4(2003122957, 332267433, 1128353075, 377919478, 982113135, 1117675960, 630865591, 1550679736); + bool2x4 r2 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + int a3 = (895945757); + int2x4 b3 = int2x4(287025687, 643452096, 660504007, 613135893, 633307118, 514276792, 1377364317, 84491736); + bool2x4 r3 = bool2x4(true, true, true, true, true, true, false, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void int2x4_operator_less_equal_wide_wide() + { + int2x4 a0 = int2x4(154092149, 1515170149, 1083970332, 785807178, 1401094881, 310537627, 868328962, 1990816725); + int2x4 b0 = int2x4(77984380, 1712054191, 1566203809, 254834519, 450519938, 389457083, 1298669505, 207343167); + bool2x4 r0 = bool2x4(false, true, true, false, false, true, true, false); + TestUtils.AreEqual(r0, a0 <= b0); + + int2x4 a1 = int2x4(2035349541, 457043352, 1123282035, 1001842946, 1387761992, 195272789, 659549000, 888761458); + int2x4 b1 = int2x4(1214449047, 2059561026, 896534357, 1897470050, 521075677, 1848221945, 374708019, 1573731118); + bool2x4 r1 = bool2x4(false, true, false, true, false, true, false, true); + TestUtils.AreEqual(r1, a1 <= b1); + + int2x4 a2 = int2x4(283706617, 1790185840, 899029812, 848317418, 1743712447, 1504407474, 1798441490, 1902791952); + int2x4 b2 = int2x4(2093466449, 1660210829, 1568778785, 1352157589, 1212771905, 1457525058, 1493446008, 1784768208); + bool2x4 r2 = bool2x4(true, false, true, true, false, false, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + int2x4 a3 = int2x4(606340844, 1994437705, 301831413, 654230470, 1223625081, 324292199, 1370931020, 1742769166); + int2x4 b3 = int2x4(1993422493, 1378671664, 1447376929, 1405041439, 1765183746, 562894655, 1085068880, 1026386862); + bool2x4 r3 = bool2x4(true, false, true, true, true, true, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void int2x4_operator_less_equal_wide_scalar() + { + int2x4 a0 = int2x4(1479531977, 1427983411, 415250630, 1245345407, 1112546666, 1072990632, 1579912858, 101048307); + int b0 = (2004563877); + bool2x4 r0 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + int2x4 a1 = int2x4(1070894375, 1910488590, 85452501, 518127023, 1246249980, 1097326500, 1964410699, 1968139888); + int b1 = (509818792); + bool2x4 r1 = bool2x4(false, false, true, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 <= b1); + + int2x4 a2 = int2x4(1191853379, 1140643434, 754434551, 155343473, 995927387, 974873240, 1773400038, 497436329); + int b2 = (662096238); + bool2x4 r2 = bool2x4(false, false, false, true, false, false, false, true); + TestUtils.AreEqual(r2, a2 <= b2); + + int2x4 a3 = int2x4(1825940497, 1477043363, 1378470734, 96190147, 37188105, 839762283, 781102710, 766321672); + int b3 = (527516420); + bool2x4 r3 = bool2x4(false, false, false, true, true, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void int2x4_operator_less_equal_scalar_wide() + { + int a0 = (1899193992); + int2x4 b0 = int2x4(915011820, 980913757, 1337699683, 1476321359, 1102143668, 660493983, 184664508, 381579707); + bool2x4 r0 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 <= b0); + + int a1 = (1954892821); + int2x4 b1 = int2x4(1295090571, 1440368586, 1696003686, 88708652, 1332251857, 1310713644, 2112132784, 48951945); + bool2x4 r1 = bool2x4(false, false, false, false, false, false, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + int a2 = (1888568027); + int2x4 b2 = int2x4(39340955, 1108242207, 260777425, 593122164, 291471959, 253457314, 1264570386, 699618012); + bool2x4 r2 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + int a3 = (927735863); + int2x4 b3 = int2x4(2063158939, 932253787, 1168754049, 749328788, 1882694892, 168499987, 378173027, 339963627); + bool2x4 r3 = bool2x4(true, true, true, false, true, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void int2x4_operator_greater_equal_wide_wide() + { + int2x4 a0 = int2x4(8538378, 2131749726, 265427108, 523609761, 994991818, 839709564, 101288202, 1886280970); + int2x4 b0 = int2x4(903145828, 1697992986, 1432491982, 169789504, 1059357300, 1744255222, 1606584463, 1905414425); + bool2x4 r0 = bool2x4(false, true, false, true, false, false, false, false); + TestUtils.AreEqual(r0, a0 >= b0); + + int2x4 a1 = int2x4(2032074826, 631221455, 1456286159, 961342752, 424526026, 788481984, 1662488497, 870326690); + int2x4 b1 = int2x4(1448794969, 136181998, 1678754836, 2069656857, 398982689, 243317404, 740939613, 1894753119); + bool2x4 r1 = bool2x4(true, true, false, false, true, true, true, false); + TestUtils.AreEqual(r1, a1 >= b1); + + int2x4 a2 = int2x4(708712581, 1260182701, 1165630721, 138247561, 1108650168, 1933222913, 672493999, 1541402159); + int2x4 b2 = int2x4(301760792, 1260647988, 3608523, 52576030, 903420465, 1648820371, 627296845, 1679808907); + bool2x4 r2 = bool2x4(true, false, true, true, true, true, true, false); + TestUtils.AreEqual(r2, a2 >= b2); + + int2x4 a3 = int2x4(1921596027, 1557351956, 147242547, 892772168, 2089286723, 1273466960, 644009998, 654784654); + int2x4 b3 = int2x4(1719102039, 1718081638, 655586949, 477267189, 62092869, 2013928066, 280292357, 254052205); + bool2x4 r3 = bool2x4(true, false, false, true, true, false, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void int2x4_operator_greater_equal_wide_scalar() + { + int2x4 a0 = int2x4(2049236663, 182691143, 634973382, 1197012109, 439837565, 1367606469, 1108037359, 351147187); + int b0 = (1061998015); + bool2x4 r0 = bool2x4(true, false, false, true, false, true, true, false); + TestUtils.AreEqual(r0, a0 >= b0); + + int2x4 a1 = int2x4(1898505669, 1998610091, 4652390, 996159180, 2111455181, 727766399, 96217144, 814085575); + int b1 = (411667685); + bool2x4 r1 = bool2x4(true, true, false, true, true, true, false, true); + TestUtils.AreEqual(r1, a1 >= b1); + + int2x4 a2 = int2x4(1525995206, 1732973229, 1473283041, 899444524, 1023753195, 1373738074, 518164359, 717850464); + int b2 = (1293933760); + bool2x4 r2 = bool2x4(true, true, true, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + int2x4 a3 = int2x4(1765188600, 527594558, 1816542874, 839185150, 1143596061, 1819554651, 160724539, 993212636); + int b3 = (1826820341); + bool2x4 r3 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void int2x4_operator_greater_equal_scalar_wide() + { + int a0 = (1859811087); + int2x4 b0 = int2x4(1070365918, 1783869452, 830091760, 377157428, 327199016, 90384229, 1154649706, 376758501); + bool2x4 r0 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + int a1 = (1079802834); + int2x4 b1 = int2x4(2054742898, 1328349472, 434061447, 951207723, 598695892, 975131651, 1714007943, 177416473); + bool2x4 r1 = bool2x4(false, false, true, true, true, true, false, true); + TestUtils.AreEqual(r1, a1 >= b1); + + int a2 = (1267232721); + int2x4 b2 = int2x4(31082860, 216791741, 119054289, 1905107583, 89559116, 55041824, 691334141, 462326883); + bool2x4 r2 = bool2x4(true, true, true, false, true, true, true, true); + TestUtils.AreEqual(r2, a2 >= b2); + + int a3 = (1658303669); + int2x4 b3 = int2x4(914628512, 1134364322, 1677134711, 1955614770, 2067009301, 1454405405, 299467282, 1584922149); + bool2x4 r3 = bool2x4(true, true, false, false, false, true, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void int2x4_operator_add_wide_wide() + { + int2x4 a0 = int2x4(2135171378, 21433296, 1954723494, 683604307, 1054212315, 1762680995, 1963655852, 1257853062); + int2x4 b0 = int2x4(1013431952, 366718162, 359290756, 1393163294, 1962236872, 1263270041, 1862666629, 1077447887); + int2x4 r0 = int2x4(-1146363966, 388151458, -1980953046, 2076767601, -1278518109, -1269016260, -468644815, -1959666347); + TestUtils.AreEqual(r0, a0 + b0); + + int2x4 a1 = int2x4(2043493600, 976898058, 1915056423, 121374462, 1218855698, 700538222, 1702057277, 1788251699); + int2x4 b1 = int2x4(821693806, 487316539, 350922520, 1583012528, 1951595076, 1024851344, 874302782, 1383969588); + int2x4 r1 = int2x4(-1429779890, 1464214597, -2028988353, 1704386990, -1124516522, 1725389566, -1718607237, -1122746009); + TestUtils.AreEqual(r1, a1 + b1); + + int2x4 a2 = int2x4(1534939160, 398651016, 1674272498, 374510467, 824322986, 1217622199, 1122376670, 642613771); + int2x4 b2 = int2x4(1767968088, 900721406, 1659790033, 1792273749, 443844328, 633981449, 2010244807, 335566991); + int2x4 r2 = int2x4(-992060048, 1299372422, -960904765, -2128183080, 1268167314, 1851603648, -1162345819, 978180762); + TestUtils.AreEqual(r2, a2 + b2); + + int2x4 a3 = int2x4(1097903998, 359042741, 929182687, 1713065399, 892057490, 1295346111, 1806236181, 1838589664); + int2x4 b3 = int2x4(521931102, 544297835, 1681549647, 1784248858, 585904415, 3128418, 1806236610, 179909533); + int2x4 r3 = int2x4(1619835100, 903340576, -1684234962, -797653039, 1477961905, 1298474529, -682494505, 2018499197); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void int2x4_operator_add_wide_scalar() + { + int2x4 a0 = int2x4(665815972, 1783729250, 1591678394, 1284528538, 977850224, 71069732, 1138577680, 1200356017); + int b0 = (1334043849); + int2x4 r0 = int2x4(1999859821, -1177194197, -1369245053, -1676394909, -1983073223, 1405113581, -1822345767, -1760567430); + TestUtils.AreEqual(r0, a0 + b0); + + int2x4 a1 = int2x4(565982008, 1088001167, 57252642, 678921480, 625943813, 512157429, 1470648741, 1490096953); + int b1 = (1246759684); + int2x4 r1 = int2x4(1812741692, -1960206445, 1304012326, 1925681164, 1872703497, 1758917113, -1577558871, -1558110659); + TestUtils.AreEqual(r1, a1 + b1); + + int2x4 a2 = int2x4(1467033531, 1707296407, 1703724354, 1333833947, 653973063, 1139546735, 1834005844, 184572739); + int b2 = (182608093); + int2x4 r2 = int2x4(1649641624, 1889904500, 1886332447, 1516442040, 836581156, 1322154828, 2016613937, 367180832); + TestUtils.AreEqual(r2, a2 + b2); + + int2x4 a3 = int2x4(1980578280, 97099208, 421437295, 1251829854, 166844260, 1568146789, 82548613, 533562157); + int b3 = (1858520040); + int2x4 r3 = int2x4(-455868976, 1955619248, -2015009961, -1184617402, 2025364300, -868300467, 1941068653, -1902885099); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void int2x4_operator_add_scalar_wide() + { + int a0 = (359966320); + int2x4 b0 = int2x4(2146146202, 767103309, 851002415, 311531406, 1491262941, 1016891373, 1954228994, 1671335850); + int2x4 r0 = int2x4(-1788854774, 1127069629, 1210968735, 671497726, 1851229261, 1376857693, -1980771982, 2031302170); + TestUtils.AreEqual(r0, a0 + b0); + + int a1 = (727870747); + int2x4 b1 = int2x4(551151834, 1390261152, 1699060326, 115021619, 1964440175, 440700758, 1556692550, 185414255); + int2x4 r1 = int2x4(1279022581, 2118131899, -1868036223, 842892366, -1602656374, 1168571505, -2010403999, 913285002); + TestUtils.AreEqual(r1, a1 + b1); + + int a2 = (933106731); + int2x4 b2 = int2x4(1217866784, 729761881, 1742597318, 1090109152, 1467373815, 1066072609, 138237856, 634834665); + int2x4 r2 = int2x4(-2143993781, 1662868612, -1619263247, 2023215883, -1894486750, 1999179340, 1071344587, 1567941396); + TestUtils.AreEqual(r2, a2 + b2); + + int a3 = (993603553); + int2x4 b3 = int2x4(347587889, 2050191349, 670698672, 1658205080, 1874808705, 2082982954, 869839589, 118460267); + int2x4 r3 = int2x4(1341191442, -1251172394, 1664302225, -1643158663, -1426555038, -1218380789, 1863443142, 1112063820); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void int2x4_operator_sub_wide_wide() + { + int2x4 a0 = int2x4(1410318491, 1097280168, 1827039044, 28881338, 328720965, 875487868, 212936325, 231977215); + int2x4 b0 = int2x4(1315897366, 799052018, 1580289673, 1094686261, 1954325726, 1197734816, 229886366, 915679176); + int2x4 r0 = int2x4(94421125, 298228150, 246749371, -1065804923, -1625604761, -322246948, -16950041, -683701961); + TestUtils.AreEqual(r0, a0 - b0); + + int2x4 a1 = int2x4(1740021315, 2011295463, 48079003, 591379285, 1125909359, 1842588095, 848561896, 614448464); + int2x4 b1 = int2x4(1746884850, 918743925, 1007797419, 257421324, 287249342, 1617287463, 1653916102, 123586847); + int2x4 r1 = int2x4(-6863535, 1092551538, -959718416, 333957961, 838660017, 225300632, -805354206, 490861617); + TestUtils.AreEqual(r1, a1 - b1); + + int2x4 a2 = int2x4(2067598029, 1618238416, 318516219, 1090119767, 1991095823, 949592162, 1951912339, 1457818751); + int2x4 b2 = int2x4(502107404, 672875302, 1256481116, 1975569142, 1794443030, 1327558915, 330955394, 1596041731); + int2x4 r2 = int2x4(1565490625, 945363114, -937964897, -885449375, 196652793, -377966753, 1620956945, -138222980); + TestUtils.AreEqual(r2, a2 - b2); + + int2x4 a3 = int2x4(1642553126, 2114366549, 1420516260, 596841760, 724518081, 1820626306, 1885185225, 246124365); + int2x4 b3 = int2x4(1069074732, 1120817099, 2076417364, 402521072, 839858844, 1539789702, 559077522, 822288510); + int2x4 r3 = int2x4(573478394, 993549450, -655901104, 194320688, -115340763, 280836604, 1326107703, -576164145); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void int2x4_operator_sub_wide_scalar() + { + int2x4 a0 = int2x4(1508669340, 1594795463, 266707545, 643102647, 287705008, 1475644328, 1113286221, 979450511); + int b0 = (998008471); + int2x4 r0 = int2x4(510660869, 596786992, -731300926, -354905824, -710303463, 477635857, 115277750, -18557960); + TestUtils.AreEqual(r0, a0 - b0); + + int2x4 a1 = int2x4(2082174113, 304369206, 999244508, 1806482044, 1994553647, 2101812429, 1482736902, 266654115); + int b1 = (1108005498); + int2x4 r1 = int2x4(974168615, -803636292, -108760990, 698476546, 886548149, 993806931, 374731404, -841351383); + TestUtils.AreEqual(r1, a1 - b1); + + int2x4 a2 = int2x4(1470212363, 958542155, 1185075537, 1738124835, 499527536, 1612473406, 1696960099, 1287292743); + int b2 = (1190349300); + int2x4 r2 = int2x4(279863063, -231807145, -5273763, 547775535, -690821764, 422124106, 506610799, 96943443); + TestUtils.AreEqual(r2, a2 - b2); + + int2x4 a3 = int2x4(1360229454, 1779621585, 964948785, 1739264125, 94254551, 968533883, 2075770560, 946189008); + int b3 = (1032360376); + int2x4 r3 = int2x4(327869078, 747261209, -67411591, 706903749, -938105825, -63826493, 1043410184, -86171368); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void int2x4_operator_sub_scalar_wide() + { + int a0 = (893369501); + int2x4 b0 = int2x4(2051906184, 1699714311, 442603706, 1735141684, 274533585, 811580259, 1196354320, 1524097023); + int2x4 r0 = int2x4(-1158536683, -806344810, 450765795, -841772183, 618835916, 81789242, -302984819, -630727522); + TestUtils.AreEqual(r0, a0 - b0); + + int a1 = (533621527); + int2x4 b1 = int2x4(2080845793, 143958837, 1620668660, 1135989346, 1367044745, 554088609, 552670373, 1265516124); + int2x4 r1 = int2x4(-1547224266, 389662690, -1087047133, -602367819, -833423218, -20467082, -19048846, -731894597); + TestUtils.AreEqual(r1, a1 - b1); + + int a2 = (1254902543); + int2x4 b2 = int2x4(1857695581, 1619865274, 1313559400, 99812999, 843597298, 420111239, 1299949060, 531009038); + int2x4 r2 = int2x4(-602793038, -364962731, -58656857, 1155089544, 411305245, 834791304, -45046517, 723893505); + TestUtils.AreEqual(r2, a2 - b2); + + int a3 = (1103306550); + int2x4 b3 = int2x4(104920105, 1137308312, 1207332725, 103438360, 1157123503, 1174401240, 701247193, 1498366995); + int2x4 r3 = int2x4(998386445, -34001762, -104026175, 999868190, -53816953, -71094690, 402059357, -395060445); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void int2x4_operator_mul_wide_wide() + { + int2x4 a0 = int2x4(61417577, 219585476, 1362520891, 1511084277, 1481211272, 58211871, 1459591173, 567624644); + int2x4 b0 = int2x4(578042444, 1620527213, 200516468, 309339115, 542853019, 299467282, 1479641221, 1428338601); + int2x4 r0 = int2x4(-1426863828, 1326150260, -990894148, -1322856473, 1973926232, 88546350, -863919463, -582821788); + TestUtils.AreEqual(r0, a0 * b0); + + int2x4 a1 = int2x4(1169935583, 1835691886, 385626539, 85934842, 522856538, 278370196, 289217012, 2083410174); + int2x4 b1 = int2x4(1497302909, 1596889147, 427413842, 265122693, 689376654, 1120457204, 516903000, 873091659); + int2x4 r1 = int2x4(556671459, 1098186330, 1848083398, -58320414, 2005201900, 651971856, -1721160736, -110160278); + TestUtils.AreEqual(r1, a1 * b1); + + int2x4 a2 = int2x4(1293162798, 1939730122, 2075923048, 1116477212, 1686101741, 783310758, 248585944, 1093377716); + int2x4 b2 = int2x4(1353196495, 1384773500, 1596528529, 2122329305, 1033200564, 996795088, 1137754930, 232014195); + int2x4 r2 = int2x4(-119429582, -536965160, -2049587992, -759667012, 1443849636, 550781664, -959017424, -353108260); + TestUtils.AreEqual(r2, a2 * b2); + + int2x4 a3 = int2x4(797038788, 1838048120, 1892922904, 1952024781, 492107602, 1097670675, 2069629919, 20122103); + int2x4 b3 = int2x4(1080950243, 1613216909, 463529448, 1781487382, 2101946430, 673144237, 390627073, 964308272); + int2x4 r3 = int2x4(-1093604916, 264300824, -121602624, 1825729694, -241519140, -1246587945, -2064143137, -251115184); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void int2x4_operator_mul_wide_scalar() + { + int2x4 a0 = int2x4(871746615, 492532311, 570557670, 2142306629, 1610315153, 1526163563, 118471734, 257439514); + int b0 = (442064533); + int2x4 r0 = int2x4(338365955, 1081376419, -1729147426, -1015409879, -873485467, -175501241, -838181010, 513646114); + TestUtils.AreEqual(r0, a0 * b0); + + int2x4 a1 = int2x4(364291059, 1584938026, 1357601203, 638897141, 268562104, 1007838321, 1163240135, 1619806399); + int b1 = (1186560810); + int2x4 r1 = int2x4(1029154526, 989596900, 521189470, -1619710670, 1627099696, 753911178, -1861135962, 167687254); + TestUtils.AreEqual(r1, a1 * b1); + + int2x4 a2 = int2x4(1444659979, 464517916, 1508043166, 745488654, 636691139, 1851670006, 357357967, 1095280227); + int b2 = (1127580168); + int2x4 r2 = int2x4(204516952, -1949298464, -1049655056, 73999472, -492889064, -2074682448, 679242360, 1245870360); + TestUtils.AreEqual(r2, a2 * b2); + + int2x4 a3 = int2x4(702779195, 1464398841, 51061000, 802418971, 407442471, 638315697, 1889264235, 584402164); + int b3 = (945802744); + int2x4 r3 = int2x4(-586547160, -76431816, -567056448, 1852387624, 241680584, -171571080, 1493698216, 2103324768); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void int2x4_operator_mul_scalar_wide() + { + int a0 = (1152242766); + int2x4 b0 = int2x4(1276636134, 2105929407, 499007702, 124002565, 1956335172, 1288034953, 832676555, 337389733); + int2x4 r0 = int2x4(-2129504236, 999811634, 1179056436, -801426554, 404105400, 1339492798, -381766182, -1111620026); + TestUtils.AreEqual(r0, a0 * b0); + + int a1 = (99268757); + int2x4 b1 = int2x4(2005055247, 2011389505, 1348110859, 399689191, 2007606374, 2076691289, 1825721194, 769885235); + int2x4 r1 = int2x4(559764411, -1619094571, 1022902375, -1005504653, -685637794, 1103844045, 2105414834, 302946735); + TestUtils.AreEqual(r1, a1 * b1); + + int a2 = (153314735); + int2x4 b2 = int2x4(1066325369, 84289667, 984486192, 1325213504, 1643957457, 1576395620, 2095980601, 907671947); + int2x4 r2 = int2x4(1030204087, 35283085, -749359152, 2102006976, 305231839, -663165604, -1035369481, 1010199813); + TestUtils.AreEqual(r2, a2 * b2); + + int a3 = (836919582); + int2x4 b3 = int2x4(1412159342, 2037926630, 366590562, 493177763, 2058824164, 497936968, 2136548816, 1211907591); + int2x4 r3 = int2x4(-1226838812, -175772428, 1537669500, -865230822, 1738427576, -71910288, -446284192, 1673391058); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void int2x4_operator_div_wide_wide() + { + int2x4 a0 = int2x4(333171510, 858154903, 1181365836, 671357749, 1090606752, 803759420, 788404166, 296807814); + int2x4 b0 = int2x4(698897823, 440199998, 655557473, 1658534285, 2127220100, 315653188, 1814290360, 992173243); + int2x4 r0 = int2x4(0, 1, 1, 0, 0, 2, 0, 0); + TestUtils.AreEqual(r0, a0 / b0); + + int2x4 a1 = int2x4(575260195, 166625280, 1493729000, 1831739736, 200852358, 129983172, 500176108, 472051781); + int2x4 b1 = int2x4(914851653, 664340325, 224323977, 246981573, 285573983, 819471609, 2012476015, 1783179572); + int2x4 r1 = int2x4(0, 0, 6, 7, 0, 0, 0, 0); + TestUtils.AreEqual(r1, a1 / b1); + + int2x4 a2 = int2x4(414699094, 1446535974, 1278480457, 930910505, 263295881, 1626759436, 450830871, 21439121); + int2x4 b2 = int2x4(223253978, 169515029, 1694929006, 1992168131, 1155972447, 1768506696, 422325410, 1508417406); + int2x4 r2 = int2x4(1, 8, 0, 0, 0, 0, 1, 0); + TestUtils.AreEqual(r2, a2 / b2); + + int2x4 a3 = int2x4(521337599, 127756712, 200601965, 412554396, 1014641734, 239347640, 525574301, 1158358177); + int2x4 b3 = int2x4(605462475, 66917170, 2014683461, 108847533, 611173330, 895791853, 1999369787, 1225614384); + int2x4 r3 = int2x4(0, 1, 0, 3, 1, 0, 0, 0); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void int2x4_operator_div_wide_scalar() + { + int2x4 a0 = int2x4(1433072926, 1073958635, 1195142312, 536596719, 1274375693, 464756346, 806462546, 906504670); + int b0 = (1434025872); + int2x4 r0 = int2x4(0, 0, 0, 0, 0, 0, 0, 0); + TestUtils.AreEqual(r0, a0 / b0); + + int2x4 a1 = int2x4(1380905136, 1196815948, 123300377, 643754735, 2084019932, 2047825037, 458304263, 741331531); + int b1 = (25493909); + int2x4 r1 = int2x4(54, 46, 4, 25, 81, 80, 17, 29); + TestUtils.AreEqual(r1, a1 / b1); + + int2x4 a2 = int2x4(466443901, 1500687214, 1453264263, 1617154145, 2040203220, 2103351724, 485536709, 402141749); + int b2 = (2110004616); + int2x4 r2 = int2x4(0, 0, 0, 0, 0, 0, 0, 0); + TestUtils.AreEqual(r2, a2 / b2); + + int2x4 a3 = int2x4(1477264254, 1549487015, 670594363, 2040479674, 155415284, 207130003, 1596922206, 1730223836); + int b3 = (1629069474); + int2x4 r3 = int2x4(0, 0, 0, 1, 0, 0, 0, 1); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void int2x4_operator_div_scalar_wide() + { + int a0 = (519165704); + int2x4 b0 = int2x4(1295178177, 775214121, 467772046, 1156881598, 310396565, 759759959, 243837702, 1616314235); + int2x4 r0 = int2x4(0, 0, 1, 0, 1, 0, 2, 0); + TestUtils.AreEqual(r0, a0 / b0); + + int a1 = (1053470225); + int2x4 b1 = int2x4(1320630160, 378773841, 4223608, 1971105754, 2054406020, 219939614, 1603672651, 2006134295); + int2x4 r1 = int2x4(0, 2, 249, 0, 0, 4, 0, 0); + TestUtils.AreEqual(r1, a1 / b1); + + int a2 = (888535397); + int2x4 b2 = int2x4(1493077923, 615835131, 1045603945, 452709946, 1074919059, 467037221, 1485241506, 1775728786); + int2x4 r2 = int2x4(0, 1, 0, 1, 0, 1, 0, 0); + TestUtils.AreEqual(r2, a2 / b2); + + int a3 = (481521341); + int2x4 b3 = int2x4(68149923, 80867357, 1294049272, 470535313, 1235850199, 631464286, 687722755, 412827650); + int2x4 r3 = int2x4(7, 5, 0, 1, 0, 0, 0, 1); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void int2x4_operator_mod_wide_wide() + { + int2x4 a0 = int2x4(258342924, 1454754891, 723352342, 1981431473, 531756042, 716993627, 1667903349, 1331097004); + int2x4 b0 = int2x4(1990080167, 1197348066, 651970512, 1659454050, 241005212, 1866255454, 1440101415, 595220963); + int2x4 r0 = int2x4(258342924, 257406825, 71381830, 321977423, 49745618, 716993627, 227801934, 140655078); + TestUtils.AreEqual(r0, a0 % b0); + + int2x4 a1 = int2x4(1776856101, 17598216, 1474345080, 1681376293, 813624265, 1617478722, 498370451, 780075943); + int2x4 b1 = int2x4(408818410, 198222574, 549504274, 239973807, 321398087, 658171840, 1511495237, 1048325585); + int2x4 r1 = int2x4(141582461, 17598216, 375336532, 1559644, 170828091, 301135042, 498370451, 780075943); + TestUtils.AreEqual(r1, a1 % b1); + + int2x4 a2 = int2x4(1754430321, 653235398, 1517128354, 966216200, 590067427, 1283434795, 1910903650, 1125967790); + int2x4 b2 = int2x4(1126739824, 666641241, 38017598, 418797691, 618700513, 1941062990, 158556432, 1081063558); + int2x4 r2 = int2x4(627690497, 653235398, 34442032, 128620818, 590067427, 1283434795, 8226466, 44904232); + TestUtils.AreEqual(r2, a2 % b2); + + int2x4 a3 = int2x4(1180537254, 308567230, 543945394, 483834400, 308703874, 383723801, 1181975437, 1161083599); + int2x4 b3 = int2x4(427329468, 148111230, 1251162672, 1856322297, 1214781084, 401954255, 1323259633, 1167744452); + int2x4 r3 = int2x4(325878318, 12344770, 543945394, 483834400, 308703874, 383723801, 1181975437, 1161083599); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void int2x4_operator_mod_wide_scalar() + { + int2x4 a0 = int2x4(560988938, 629524514, 767711194, 434281967, 1399805893, 792916846, 1663690927, 598661916); + int b0 = (1156862367); + int2x4 r0 = int2x4(560988938, 629524514, 767711194, 434281967, 242943526, 792916846, 506828560, 598661916); + TestUtils.AreEqual(r0, a0 % b0); + + int2x4 a1 = int2x4(1776636144, 1743722161, 475209785, 327476870, 1617696916, 379853074, 477430114, 858399046); + int b1 = (1287035793); + int2x4 r1 = int2x4(489600351, 456686368, 475209785, 327476870, 330661123, 379853074, 477430114, 858399046); + TestUtils.AreEqual(r1, a1 % b1); + + int2x4 a2 = int2x4(712734431, 199829950, 362269020, 1986626876, 1351725413, 1549678101, 431765276, 1315833792); + int b2 = (1506629323); + int2x4 r2 = int2x4(712734431, 199829950, 362269020, 479997553, 1351725413, 43048778, 431765276, 1315833792); + TestUtils.AreEqual(r2, a2 % b2); + + int2x4 a3 = int2x4(1664893153, 780055604, 104179235, 629966219, 1810536428, 1747026206, 1799535061, 875754431); + int b3 = (615834034); + int2x4 r3 = int2x4(433225085, 164221570, 104179235, 14132185, 578868360, 515358138, 567866993, 259920397); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void int2x4_operator_mod_scalar_wide() + { + int a0 = (933347930); + int2x4 b0 = int2x4(549923387, 243114953, 1884274390, 1428033594, 655531454, 1622674954, 1107563514, 1614111094); + int2x4 r0 = int2x4(383424543, 204003071, 933347930, 933347930, 277816476, 933347930, 933347930, 933347930); + TestUtils.AreEqual(r0, a0 % b0); + + int a1 = (914801920); + int2x4 b1 = int2x4(1432263179, 564431096, 1967013901, 1709750152, 1080102613, 13120773, 2042535998, 1505698002); + int2x4 r1 = int2x4(914801920, 350370824, 914801920, 914801920, 914801920, 9468583, 914801920, 914801920); + TestUtils.AreEqual(r1, a1 % b1); + + int a2 = (1640058084); + int2x4 b2 = int2x4(974167554, 758635306, 1387264978, 611743343, 1139002766, 1913935748, 1086810076, 991846486); + int2x4 r2 = int2x4(665890530, 122787472, 252793106, 416571398, 501055318, 1640058084, 553248008, 648211598); + TestUtils.AreEqual(r2, a2 % b2); + + int a3 = (922870408); + int2x4 b3 = int2x4(35007468, 891877602, 157349181, 83267982, 801093706, 546272767, 1665089132, 1889242068); + int2x4 r3 = int2x4(12676240, 30992806, 136124503, 6922606, 121776702, 376597641, 922870408, 922870408); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void int2x4_operator_plus() + { + int2x4 a0 = int2x4(195392567, 222719748, 1002351013, 1570765263, 109389333, 1515950277, 1689763402, 291471785); + int2x4 r0 = int2x4(195392567, 222719748, 1002351013, 1570765263, 109389333, 1515950277, 1689763402, 291471785); + TestUtils.AreEqual(r0, +a0); + + int2x4 a1 = int2x4(264115671, 195779102, 2131702223, 715660442, 1995564647, 69731564, 1317851903, 1957501908); + int2x4 r1 = int2x4(264115671, 195779102, 2131702223, 715660442, 1995564647, 69731564, 1317851903, 1957501908); + TestUtils.AreEqual(r1, +a1); + + int2x4 a2 = int2x4(531426536, 1334133318, 1539671418, 935436165, 1575048895, 2119066258, 781435471, 1659000230); + int2x4 r2 = int2x4(531426536, 1334133318, 1539671418, 935436165, 1575048895, 2119066258, 781435471, 1659000230); + TestUtils.AreEqual(r2, +a2); + + int2x4 a3 = int2x4(1301861249, 1360657696, 578750954, 150348334, 1791553179, 1288641627, 735146513, 328684789); + int2x4 r3 = int2x4(1301861249, 1360657696, 578750954, 150348334, 1791553179, 1288641627, 735146513, 328684789); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void int2x4_operator_neg() + { + int2x4 a0 = int2x4(1385088677, 94114564, 1350664872, 1458616659, 2067164853, 218122493, 958484951, 270553961); + int2x4 r0 = int2x4(-1385088677, -94114564, -1350664872, -1458616659, -2067164853, -218122493, -958484951, -270553961); + TestUtils.AreEqual(r0, -a0); + + int2x4 a1 = int2x4(446497525, 1928771252, 1427605822, 2051940607, 1434247484, 485368391, 908365416, 1742096480); + int2x4 r1 = int2x4(-446497525, -1928771252, -1427605822, -2051940607, -1434247484, -485368391, -908365416, -1742096480); + TestUtils.AreEqual(r1, -a1); + + int2x4 a2 = int2x4(990033169, 1350976157, 12802586, 1934372287, 576597401, 785136322, 559205611, 1959833280); + int2x4 r2 = int2x4(-990033169, -1350976157, -12802586, -1934372287, -576597401, -785136322, -559205611, -1959833280); + TestUtils.AreEqual(r2, -a2); + + int2x4 a3 = int2x4(162379661, 95281343, 1969004480, 1381288239, 252975075, 1961335692, 1607042487, 832886233); + int2x4 r3 = int2x4(-162379661, -95281343, -1969004480, -1381288239, -252975075, -1961335692, -1607042487, -832886233); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void int2x4_operator_prefix_inc() + { + int2x4 a0 = int2x4(780471723, 954741756, 272723451, 2142862245, 606294309, 1514814550, 250124151, 444189162); + int2x4 r0 = int2x4(780471724, 954741757, 272723452, 2142862246, 606294310, 1514814551, 250124152, 444189163); + TestUtils.AreEqual(r0, ++a0); + + int2x4 a1 = int2x4(1833356994, 1348278302, 129540735, 1584496757, 1170613526, 986715680, 1701179230, 1397451003); + int2x4 r1 = int2x4(1833356995, 1348278303, 129540736, 1584496758, 1170613527, 986715681, 1701179231, 1397451004); + TestUtils.AreEqual(r1, ++a1); + + int2x4 a2 = int2x4(483952900, 1268688387, 2014528731, 453850931, 1112537171, 621362788, 2063486914, 1612870531); + int2x4 r2 = int2x4(483952901, 1268688388, 2014528732, 453850932, 1112537172, 621362789, 2063486915, 1612870532); + TestUtils.AreEqual(r2, ++a2); + + int2x4 a3 = int2x4(1161037742, 1583359796, 82587894, 810087437, 72436569, 1094485773, 912422931, 1011314676); + int2x4 r3 = int2x4(1161037743, 1583359797, 82587895, 810087438, 72436570, 1094485774, 912422932, 1011314677); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void int2x4_operator_postfix_inc() + { + int2x4 a0 = int2x4(241865086, 2145821641, 1596166022, 803592338, 529551271, 1656767229, 903047443, 1213663244); + int2x4 r0 = int2x4(241865086, 2145821641, 1596166022, 803592338, 529551271, 1656767229, 903047443, 1213663244); + TestUtils.AreEqual(r0, a0++); + + int2x4 a1 = int2x4(1425753247, 389844650, 1159795446, 1343289659, 1227160199, 947635082, 137930180, 451018043); + int2x4 r1 = int2x4(1425753247, 389844650, 1159795446, 1343289659, 1227160199, 947635082, 137930180, 451018043); + TestUtils.AreEqual(r1, a1++); + + int2x4 a2 = int2x4(1634297552, 1176922170, 388721494, 2381860, 2062858295, 715101397, 1725384327, 446867079); + int2x4 r2 = int2x4(1634297552, 1176922170, 388721494, 2381860, 2062858295, 715101397, 1725384327, 446867079); + TestUtils.AreEqual(r2, a2++); + + int2x4 a3 = int2x4(2101314783, 1683365096, 1319511974, 1418603655, 1938539756, 592683318, 1576213022, 1150548583); + int2x4 r3 = int2x4(2101314783, 1683365096, 1319511974, 1418603655, 1938539756, 592683318, 1576213022, 1150548583); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void int2x4_operator_prefix_dec() + { + int2x4 a0 = int2x4(1331961415, 1612382200, 1401591249, 2042075388, 1757136546, 1895858159, 1467742422, 578341664); + int2x4 r0 = int2x4(1331961414, 1612382199, 1401591248, 2042075387, 1757136545, 1895858158, 1467742421, 578341663); + TestUtils.AreEqual(r0, --a0); + + int2x4 a1 = int2x4(1336115745, 1169239112, 1862369220, 312317355, 1027543764, 1595492535, 1426262619, 1426620468); + int2x4 r1 = int2x4(1336115744, 1169239111, 1862369219, 312317354, 1027543763, 1595492534, 1426262618, 1426620467); + TestUtils.AreEqual(r1, --a1); + + int2x4 a2 = int2x4(674685792, 1459529624, 2092317419, 107501474, 1261583506, 512900840, 1496855314, 777588547); + int2x4 r2 = int2x4(674685791, 1459529623, 2092317418, 107501473, 1261583505, 512900839, 1496855313, 777588546); + TestUtils.AreEqual(r2, --a2); + + int2x4 a3 = int2x4(617644613, 625907330, 1452782388, 804650978, 2076275981, 120447533, 262357170, 1887136873); + int2x4 r3 = int2x4(617644612, 625907329, 1452782387, 804650977, 2076275980, 120447532, 262357169, 1887136872); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void int2x4_operator_postfix_dec() + { + int2x4 a0 = int2x4(1870005937, 1708534798, 704493460, 462940703, 2060593573, 228744869, 940247280, 1818778351); + int2x4 r0 = int2x4(1870005937, 1708534798, 704493460, 462940703, 2060593573, 228744869, 940247280, 1818778351); + TestUtils.AreEqual(r0, a0--); + + int2x4 a1 = int2x4(1015253889, 1401191870, 2080259851, 653673271, 140452688, 1928164223, 1760916301, 1174531383); + int2x4 r1 = int2x4(1015253889, 1401191870, 2080259851, 653673271, 140452688, 1928164223, 1760916301, 1174531383); + TestUtils.AreEqual(r1, a1--); + + int2x4 a2 = int2x4(634036198, 1669210509, 874927437, 1393579866, 471308632, 620865961, 220103745, 1407678826); + int2x4 r2 = int2x4(634036198, 1669210509, 874927437, 1393579866, 471308632, 620865961, 220103745, 1407678826); + TestUtils.AreEqual(r2, a2--); + + int2x4 a3 = int2x4(319906934, 488775250, 1681733117, 1916879863, 2060905976, 636358505, 1379709480, 451326084); + int2x4 r3 = int2x4(319906934, 488775250, 1681733117, 1916879863, 2060905976, 636358505, 1379709480, 451326084); + TestUtils.AreEqual(r3, a3--); + } + + [TestCompiler] + public static void int2x4_operator_bitwise_and_wide_wide() + { + int2x4 a0 = int2x4(1055241304, 859321394, 1088358961, 2090949513, 300561740, 651904515, 1331035868, 2012752753); + int2x4 b0 = int2x4(749698416, 748105424, 1842764797, 9990577, 1989102105, 1666634755, 58116798, 868036607); + int2x4 r0 = int2x4(749024336, 537928720, 1087769137, 8409473, 277479432, 575816707, 55888540, 867707761); + TestUtils.AreEqual(r0, a0 & b0); + + int2x4 a1 = int2x4(1298126656, 53199569, 1752363533, 1303061302, 1929998247, 1504941434, 470682792, 713577376); + int2x4 b1 = int2x4(1420638875, 1308767169, 564040763, 478617502, 806150474, 674015378, 1505309955, 36064977); + int2x4 r1 = int2x4(1141707264, 33686209, 538087433, 209912598, 805855490, 136347666, 403178496, 33571456); + TestUtils.AreEqual(r1, a1 & b1); + + int2x4 a2 = int2x4(1493231658, 1340884669, 1577921467, 44846626, 1105094388, 1143008413, 333009589, 2116296009); + int2x4 b2 = int2x4(1779639327, 808650076, 1634437037, 1997568501, 1930853951, 1901503461, 1508772523, 2010961769); + int2x4 r2 = int2x4(1207967754, 2098204, 1074332585, 33572896, 1091986996, 1073782917, 298320545, 1979979081); + TestUtils.AreEqual(r2, a2 & b2); + + int2x4 a3 = int2x4(2067254825, 121795325, 2122365250, 1088796653, 1594120761, 965590824, 337823363, 1686791432); + int2x4 b3 = int2x4(1495957269, 1914669725, 1263994006, 491200541, 380703892, 282208487, 1416934135, 942735432); + int2x4 r3 = int2x4(1495420417, 33686173, 1241513986, 4530189, 369102864, 276834336, 337674883, 536870920); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void int2x4_operator_bitwise_and_wide_scalar() + { + int2x4 a0 = int2x4(1513158868, 284695609, 734595037, 1566510707, 1601252476, 84213838, 314333543, 430856908); + int b0 = (1173647397); + int2x4 r0 = int2x4(1076916228, 15732769, 29360133, 1163132961, 1164976164, 84148228, 11816997, 27545604); + TestUtils.AreEqual(r0, a0 & b0); + + int2x4 a1 = int2x4(753481263, 1619794917, 2143619546, 1873208293, 126982769, 651482651, 1383096952, 1689107088); + int b1 = (327392481); + int2x4 r1 = int2x4(8459297, 8394977, 327223488, 58884321, 58824801, 41980929, 301989984, 8493184); + TestUtils.AreEqual(r1, a1 & b1); + + int2x4 a2 = int2x4(1368301071, 1729929586, 989550739, 1914435619, 1592791064, 2047510829, 678485991, 586400261); + int b2 = (366962092); + int2x4 r2 = int2x4(294519820, 85729568, 282804352, 270229536, 349175816, 269091116, 5260708, 13844484); + TestUtils.AreEqual(r2, a2 & b2); + + int2x4 a3 = int2x4(771972179, 131945492, 1707451796, 394184188, 1943201012, 558008097, 1070093422, 34324916); + int b3 = (309059606); + int2x4 r3 = int2x4(33767442, 38354964, 4300820, 308985876, 306372628, 4358144, 306724870, 34324500); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void int2x4_operator_bitwise_and_scalar_wide() + { + int a0 = (477163326); + int2x4 b0 = int2x4(110453385, 703240362, 2075630560, 1884904031, 1734899436, 947945203, 1664399051, 458879298); + int2x4 r0 = int2x4(68182536, 140544042, 405834528, 273697310, 73426476, 402681394, 3188234, 407953666); + TestUtils.AreEqual(r0, a0 & b0); + + int a1 = (158491426); + int2x4 b1 = int2x4(79772356, 2054527944, 202228212, 359225061, 639811396, 1821945318, 1821303024, 2030124055); + int2x4 r1 = int2x4(4203008, 141558528, 134234400, 23085600, 2237184, 135274786, 134373408, 151003138); + TestUtils.AreEqual(r1, a1 & b1); + + int a2 = (1985961756); + int2x4 b2 = int2x4(579780373, 2061831301, 1139618293, 1145191868, 1121606282, 1414714065, 688688277, 1508875606); + int2x4 r2 = int2x4(571350804, 1917127684, 1112346900, 1145183516, 1113217544, 1414681104, 537660436, 1347362068); + TestUtils.AreEqual(r2, a2 & b2); + + int a3 = (664318814); + int2x4 b3 = int2x4(2092766410, 1010043618, 599967779, 47076367, 1325716015, 1119912335, 2083412385, 1805692137); + int2x4 r3 = int2x4(613945418, 605028930, 595623938, 42471438, 117477902, 41976078, 604508416, 595632200); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void int2x4_operator_bitwise_or_wide_wide() + { + int2x4 a0 = int2x4(1920951869, 1750772852, 1420019191, 732977093, 1169579447, 229437930, 1966721348, 2039812323); + int2x4 b0 = int2x4(214585254, 275414367, 858759675, 190211455, 1218691723, 2129565457, 1862809466, 495728846); + int2x4 r0 = int2x4(2130669503, 2021326207, 2008016383, 737572863, 1303895999, 2146367483, 2134507390, 2107455727); + TestUtils.AreEqual(r0, a0 | b0); + + int2x4 a1 = int2x4(113550869, 1912038362, 1569990624, 1490718227, 1686257697, 2137727522, 1569900650, 856504729); + int2x4 b1 = int2x4(868064152, 1756913766, 933656055, 247722084, 1884195075, 1804207631, 1913174711, 1815920856); + int2x4 r1 = int2x4(939376541, 2046780414, 2142664695, 1591475831, 1959708963, 2146117167, 2140863231, 2134768089); + TestUtils.AreEqual(r1, a1 | b1); + + int2x4 a2 = int2x4(2033376384, 2086259889, 671790684, 1189001916, 1756048437, 417084592, 2024165808, 966008272); + int2x4 b2 = int2x4(1226577606, 1696467642, 186912044, 1778908130, 1461256625, 1142152181, 272117331, 1162254035); + int2x4 r2 = int2x4(2034163398, 2103430843, 724483964, 1860172798, 2142973365, 1558183925, 2025750515, 2111217619); + TestUtils.AreEqual(r2, a2 | b2); + + int2x4 a3 = int2x4(2031026290, 1461019191, 1071959084, 1645847295, 871350674, 736640317, 868515800, 767794452); + int2x4 b3 = int2x4(870448102, 1845053992, 257334526, 987295814, 1503050768, 1683307763, 1076253109, 1403888383); + int2x4 r3 = int2x4(2079325174, 2147314239, 1073143038, 2061103871, 2080374162, 1878867455, 1944485885, 2146418687); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void int2x4_operator_bitwise_or_wide_scalar() + { + int2x4 a0 = int2x4(1295304853, 1307252624, 350194630, 1128063578, 1774824542, 2085245467, 1988423804, 999162350); + int b0 = (1305527136); + int2x4 r0 = int2x4(1307888629, 1308350448, 1574947814, 1341973370, 1842999166, 2111492987, 2144662396, 2145305582); + TestUtils.AreEqual(r0, a0 | b0); + + int2x4 a1 = int2x4(2110327307, 341855232, 1317039676, 228656898, 41280811, 1536908787, 606786773, 1739461580); + int b1 = (1050875188); + int2x4 r1 = int2x4(2146115391, 1055087924, 2124644156, 1067652918, 1056437567, 2142985719, 1051448821, 2142181372); + TestUtils.AreEqual(r1, a1 | b1); + + int2x4 a2 = int2x4(2040936581, 1377874553, 1522262112, 1496806239, 1732466858, 1535976093, 375675620, 1614193383); + int b2 = (1350320187); + int2x4 r2 = int2x4(2046720191, 1383920251, 1526718587, 1501524863, 2004834491, 1543332543, 1450990335, 1887363839); + TestUtils.AreEqual(r2, a2 | b2); + + int2x4 a3 = int2x4(226059393, 112556963, 1614163749, 1583289054, 1370656810, 1286074530, 1155438844, 1835671387); + int b3 = (697385997); + int2x4 r3 = int2x4(771318925, 800423855, 1773629229, 2145343199, 2041828399, 1840772271, 1843387645, 1845190495); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void int2x4_operator_bitwise_or_scalar_wide() + { + int a0 = (1768627592); + int2x4 b0 = int2x4(1849658052, 1759912154, 729979455, 975926310, 1987690876, 1809506714, 1160695341, 408963395); + int2x4 r0 = int2x4(1870634956, 1777286618, 1810603967, 2070642094, 2138824188, 1811676570, 1836048301, 2037079499); + TestUtils.AreEqual(r0, a0 | b0); + + int a1 = (314072711); + int2x4 b1 = int2x4(1560007537, 1709003416, 977086639, 1448375596, 1689568808, 595543345, 559778387, 621080913); + int2x4 r1 = int2x4(1593565175, 2013093535, 985497263, 1459388335, 1992089263, 872374199, 872275671, 935133143); + TestUtils.AreEqual(r1, a1 | b1); + + int a2 = (438994183); + int2x4 b2 = int2x4(1742637145, 1219409263, 1602932494, 1204461702, 2111538444, 836730895, 1207638621, 802100209); + int2x4 r2 = int2x4(2147388767, 1521399151, 1605029647, 1609213319, 2147190031, 1006601487, 1610325855, 1072666615); + TestUtils.AreEqual(r2, a2 | b2); + + int a3 = (1089077339); + int2x4 b3 = int2x4(1315030334, 249047666, 1604790897, 1848168086, 347254235, 1777613639, 1876731927, 842785732); + int2x4 r3 = int2x4(1324074367, 1325017723, 1609509499, 1860882143, 1425714651, 1778269023, 1878960223, 1929110495); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void int2x4_operator_bitwise_xor_wide_wide() + { + int2x4 a0 = int2x4(1843655608, 362425681, 640805534, 1342040268, 945678755, 980321850, 390165019, 1682422658); + int2x4 b0 = int2x4(1422803441, 1234691140, 119589253, 1101464929, 121896337, 1880109018, 1000210266, 1718938232); + int2x4 r0 = int2x4(959296073, 1544407317, 554771227, 240840109, 1058935858, 1249815008, 752651585, 36917754); + TestUtils.AreEqual(r0, a0 ^ b0); + + int2x4 a1 = int2x4(303897251, 230477768, 1103646442, 1503102919, 26631152, 1016475570, 1862440929, 379588576); + int2x4 b1 = int2x4(464406940, 884337881, 34199854, 1430659227, 126415540, 1069919967, 1810763253, 2082802224); + int2x4 r1 = int2x4(162747199, 956900113, 1136760772, 215066460, 102672708, 55804269, 82614804, 1787102672); + TestUtils.AreEqual(r1, a1 ^ b1); + + int2x4 a2 = int2x4(1943580404, 691527166, 723280696, 497086939, 1640104913, 893178410, 1596765788, 664096470); + int2x4 b2 = int2x4(941097951, 27782297, 156353074, 607061607, 470737131, 1151564598, 8268481, 434405645); + int2x4 r2 = int2x4(1270918443, 680538471, 575512842, 965736380, 2110579514, 1906288924, 1599249565, 1047646171); + TestUtils.AreEqual(r2, a2 ^ b2); + + int2x4 a3 = int2x4(2043360590, 799560121, 287637604, 696169196, 2067184169, 1208059988, 1250597330, 1386507647); + int2x4 b3 = int2x4(519003095, 1880915120, 608970922, 1809455754, 1079250101, 514389994, 272120301, 1282399149); + int2x4 r3 = int2x4(1730440857, 1605643529, 896084174, 1118087270, 996325020, 1453948862, 1521655871, 516667090); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void int2x4_operator_bitwise_xor_wide_scalar() + { + int2x4 a0 = int2x4(169345668, 176087064, 2084362901, 1663924004, 193851255, 517476661, 905336222, 863800783); + int b0 = (354464228); + int2x4 r0 = int2x4(523809632, 526275068, 1763470193, 1980614336, 514678419, 200843473, 550954106, 643578923); + TestUtils.AreEqual(r0, a0 ^ b0); + + int2x4 a1 = int2x4(365003873, 954341348, 1464576786, 625604047, 1700827127, 2003392824, 1481813598, 1077374714); + int b1 = (835837496); + int2x4 r1 = int2x4(605051481, 154388956, 1721398570, 345517047, 1420906959, 1186498304, 1770221670, 1910943938); + TestUtils.AreEqual(r1, a1 ^ b1); + + int2x4 a2 = int2x4(1043379893, 781860967, 60088394, 1196907956, 858716109, 858484213, 178843494, 1223183458); + int b2 = (1991576049); + int2x4 r2 = int2x4(1216724804, 1479494038, 1965156795, 836916293, 1167851068, 1168008196, 2082334359, 1046300051); + TestUtils.AreEqual(r2, a2 ^ b2); + + int2x4 a3 = int2x4(866652388, 1206307664, 2037729583, 1324393116, 497725784, 1367278685, 962962860, 906632547); + int b3 = (1771693181); + int2x4 r3 = int2x4(1513223321, 780087085, 283946322, 661210849, 1949521189, 954654752, 1358709201, 1603533086); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void int2x4_operator_bitwise_xor_scalar_wide() + { + int a0 = (1361775641); + int2x4 b0 = int2x4(1452773578, 459050892, 1986218254, 1689037698, 999278344, 1229114508, 1087843538, 733699740); + int2x4 r0 = int2x4(129801427, 1249346453, 659047703, 898082715, 1789184785, 409583765, 301736139, 2056278661); + TestUtils.AreEqual(r0, a0 ^ b0); + + int a1 = (106187872); + int2x4 b1 = int2x4(1533632738, 1107817672, 492506236, 597602329, 1439603382, 1001169118, 1231718216, 1693179077); + int2x4 r1 = int2x4(1564290178, 1146337448, 453984284, 634059897, 1402656470, 1039723710, 1329515304, 1656721573); + TestUtils.AreEqual(r1, a1 ^ b1); + + int a2 = (1050897427); + int2x4 b2 = int2x4(1796435561, 1100532547, 2106589181, 79691722, 851486414, 381749210, 1743618507, 2038827673); + int2x4 r2 = int2x4(1437598330, 2134615888, 1126994926, 974951385, 207866589, 677538761, 1498344920, 1193633418); + TestUtils.AreEqual(r2, a2 ^ b2); + + int a3 = (1680906962); + int2x4 b3 = int2x4(161437943, 171927307, 277703584, 1344718195, 1634011177, 28540247, 1205447252, 150341716); + int2x4 r3 = int2x4(1840235045, 1846541785, 1958605170, 873881505, 89494267, 1703143301, 602484870, 1824952966); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void int2x4_operator_left_shift() + { + int2x4 a0 = int2x4(1129100049, 829482269, 1571297368, 443753193, 1872142968, 249554593, 892627436, 980302862); + int b0 = (218351941); + int2x4 r0 = int2x4(1771463200, 773628832, -1258091776, 1315200288, -220967168, -604187616, -1500693120, 1304920512); + TestUtils.AreEqual(r0, a0 << b0); + + int2x4 a1 = int2x4(62369727, 1271350845, 108441902, 1959056531, 1779118882, 1451674188, 2082026915, 1149883636); + int b1 = (849916599); + int2x4 r1 = int2x4(-545259520, 511705088, -1761607680, 1233125376, -1862270976, 637534208, -780140544, 2046820352); + TestUtils.AreEqual(r1, a1 << b1); + + int2x4 a2 = int2x4(1380536034, 1487486874, 1498738574, 752067504, 1647167336, 772453640, 456967739, 947384545); + int b2 = (186532735); + int2x4 r2 = int2x4(0, 0, 0, 0, 0, 0, -2147483648, -2147483648); + TestUtils.AreEqual(r2, a2 << b2); + + int2x4 a3 = int2x4(1463252873, 640579158, 56630178, 1650899378, 2142944517, 565484033, 965161323, 1634169280); + int b3 = (1315516161); + int2x4 r3 = int2x4(-1368461550, 1281158316, 113260356, -993168540, -9078262, 1130968066, 1930322646, -1026628736); + TestUtils.AreEqual(r3, a3 << b3); + } + + [TestCompiler] + public static void int2x4_operator_right_shift() + { + int2x4 a0 = int2x4(809126085, 908563670, 763568837, 1986717290, 1174507510, 646821842, 1242726074, 390811632); + int b0 = (994800051); + int2x4 r0 = int2x4(1543, 1732, 1456, 3789, 2240, 1233, 2370, 745); + TestUtils.AreEqual(r0, a0 >> b0); + + int2x4 a1 = int2x4(1521420393, 102096936, 400863878, 667378673, 1611921244, 307750782, 479442287, 2014389412); + int b1 = (1923166649); + int2x4 r1 = int2x4(45, 3, 11, 19, 48, 9, 14, 60); + TestUtils.AreEqual(r1, a1 >> b1); + + int2x4 a2 = int2x4(1673938174, 1248577253, 848199210, 813936577, 848976170, 500930883, 662405800, 126875849); + int b2 = (1075916177); + int2x4 r2 = int2x4(12771, 9525, 6471, 6209, 6477, 3821, 5053, 967); + TestUtils.AreEqual(r2, a2 >> b2); + + int2x4 a3 = int2x4(1103917083, 955487090, 1013356510, 391605984, 185228398, 87452680, 2021602226, 1401766495); + int b3 = (1199000503); + int2x4 r3 = int2x4(131, 113, 120, 46, 22, 10, 240, 167); + TestUtils.AreEqual(r3, a3 >> b3); + } + + [TestCompiler] + public static void int2x4_operator_bitwise_not() + { + int2x4 a0 = int2x4(111796841, 603562399, 745091931, 853183268, 1110916612, 381888399, 1891338755, 1506860135); + int2x4 r0 = int2x4(-111796842, -603562400, -745091932, -853183269, -1110916613, -381888400, -1891338756, -1506860136); + TestUtils.AreEqual(r0, ~a0); + + int2x4 a1 = int2x4(771210628, 875964607, 96456785, 916013379, 203444882, 1172294211, 1020232736, 683852713); + int2x4 r1 = int2x4(-771210629, -875964608, -96456786, -916013380, -203444883, -1172294212, -1020232737, -683852714); + TestUtils.AreEqual(r1, ~a1); + + int2x4 a2 = int2x4(375158799, 1218471344, 1174233245, 592898220, 443427914, 1385118179, 215320517, 860122767); + int2x4 r2 = int2x4(-375158800, -1218471345, -1174233246, -592898221, -443427915, -1385118180, -215320518, -860122768); + TestUtils.AreEqual(r2, ~a2); + + int2x4 a3 = int2x4(1411266016, 686325107, 829984855, 191189901, 319233142, 156019905, 1467719681, 1193642973); + int2x4 r3 = int2x4(-1411266017, -686325108, -829984856, -191189902, -319233143, -156019906, -1467719682, -1193642974); + TestUtils.AreEqual(r3, ~a3); + } + + [TestCase /* For player builds */] + public static void int2x4_EqualsObjectOverride() + { + TestUtils.IsFalse(new int2x4().Equals((object)new int())); + TestUtils.IsTrue(new int2x4().Equals((object)new int2x4())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestInt2x4.gen.cs.meta b/src/Tests/Tests/Shared/TestInt2x4.gen.cs.meta new file mode 100644 index 00000000..c14b2a07 --- /dev/null +++ b/src/Tests/Tests/Shared/TestInt2x4.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 847ca3f6ecd472f43b9995db81c87807 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestInt3.gen.cs b/src/Tests/Tests/Shared/TestInt3.gen.cs new file mode 100644 index 00000000..7dac46ed --- /dev/null +++ b/src/Tests/Tests/Shared/TestInt3.gen.cs @@ -0,0 +1,1353 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestInt3 + { + [TestCompiler] + public static void int3_zero() + { + TestUtils.AreEqual(0, int3.zero.x); + TestUtils.AreEqual(0, int3.zero.y); + TestUtils.AreEqual(0, int3.zero.z); + } + + [TestCompiler] + public static void int3_constructor() + { + int3 a = new int3(1, 2, 3); + TestUtils.AreEqual(1, a.x); + TestUtils.AreEqual(2, a.y); + TestUtils.AreEqual(3, a.z); + } + + [TestCompiler] + public static void int3_scalar_constructor() + { + int3 a = new int3(17); + TestUtils.AreEqual(17, a.x); + TestUtils.AreEqual(17, a.y); + TestUtils.AreEqual(17, a.z); + } + + [TestCompiler] + public static void int3_static_constructor() + { + int3 a = int3(1, 2, 3); + TestUtils.AreEqual(1, a.x); + TestUtils.AreEqual(2, a.y); + TestUtils.AreEqual(3, a.z); + } + + [TestCompiler] + public static void int3_static_scalar_constructor() + { + int3 a = int3(17); + TestUtils.AreEqual(17, a.x); + TestUtils.AreEqual(17, a.y); + TestUtils.AreEqual(17, a.z); + } + + [TestCompiler] + public static void int3_operator_equal_wide_wide() + { + int3 a0 = int3(2105871082, 35218899, 1550755093); + int3 b0 = int3(1477587886, 579629692, 540974792); + bool3 r0 = bool3(false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + int3 a1 = int3(764676020, 606743782, 1208156098); + int3 b1 = int3(208405066, 2063397938, 1060167409); + bool3 r1 = bool3(false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + int3 a2 = int3(1023640014, 1038468316, 1416064367); + int3 b2 = int3(362592601, 2097545362, 277670088); + bool3 r2 = bool3(false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + int3 a3 = int3(727143393, 2061243891, 184669837); + int3 b3 = int3(426944490, 901076223, 857900673); + bool3 r3 = bool3(false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void int3_operator_equal_wide_scalar() + { + int3 a0 = int3(437822262, 2020661134, 541786900); + int b0 = (1332833578); + bool3 r0 = bool3(false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + int3 a1 = int3(853113810, 179951405, 1409026299); + int b1 = (23716499); + bool3 r1 = bool3(false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + int3 a2 = int3(948838849, 691955848, 1926262965); + int b2 = (953202998); + bool3 r2 = bool3(false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + int3 a3 = int3(1851546137, 2028784869, 1049962241); + int b3 = (712957637); + bool3 r3 = bool3(false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void int3_operator_equal_scalar_wide() + { + int a0 = (542329200); + int3 b0 = int3(1115584594, 684107773, 1928988941); + bool3 r0 = bool3(false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + int a1 = (890709324); + int3 b1 = int3(641152437, 1410341302, 497505660); + bool3 r1 = bool3(false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + int a2 = (1068223109); + int3 b2 = int3(2014009435, 213835595, 1592428361); + bool3 r2 = bool3(false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + int a3 = (1819361470); + int3 b3 = int3(448650623, 1942175642, 64377057); + bool3 r3 = bool3(false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void int3_operator_not_equal_wide_wide() + { + int3 a0 = int3(1977284100, 1293292704, 1547283851); + int3 b0 = int3(1514195556, 957972049, 507667364); + bool3 r0 = bool3(true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + int3 a1 = int3(422428953, 195833190, 1711544892); + int3 b1 = int3(581861672, 1128094576, 940096636); + bool3 r1 = bool3(true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + int3 a2 = int3(5606053, 737069074, 647386678); + int3 b2 = int3(57559040, 181752616, 962017320); + bool3 r2 = bool3(true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + int3 a3 = int3(13079405, 1413841590, 1076166545); + int3 b3 = int3(1762015406, 1107218953, 2042026522); + bool3 r3 = bool3(true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void int3_operator_not_equal_wide_scalar() + { + int3 a0 = int3(1038269360, 1427812625, 103361237); + int b0 = (768873026); + bool3 r0 = bool3(true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + int3 a1 = int3(1347017023, 150442802, 660334527); + int b1 = (1523584313); + bool3 r1 = bool3(true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + int3 a2 = int3(719113717, 484398043, 506946952); + int b2 = (262959423); + bool3 r2 = bool3(true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + int3 a3 = int3(226568494, 1702162286, 923269270); + int b3 = (507918242); + bool3 r3 = bool3(true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void int3_operator_not_equal_scalar_wide() + { + int a0 = (1652127596); + int3 b0 = int3(953791238, 271722683, 1278885987); + bool3 r0 = bool3(true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + int a1 = (735128017); + int3 b1 = int3(112416504, 25967222, 1761444475); + bool3 r1 = bool3(true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + int a2 = (1844594536); + int3 b2 = int3(1199122922, 634219279, 942501101); + bool3 r2 = bool3(true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + int a3 = (67161343); + int3 b3 = int3(969944293, 833229499, 1304301133); + bool3 r3 = bool3(true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void int3_operator_less_wide_wide() + { + int3 a0 = int3(1486550609, 1779244308, 1602148045); + int3 b0 = int3(97842578, 536551311, 413528975); + bool3 r0 = bool3(false, false, false); + TestUtils.AreEqual(r0, a0 < b0); + + int3 a1 = int3(1614085440, 1975613414, 942838342); + int3 b1 = int3(1838293684, 1283898480, 1456599961); + bool3 r1 = bool3(true, false, true); + TestUtils.AreEqual(r1, a1 < b1); + + int3 a2 = int3(1092279031, 373677431, 1419098312); + int3 b2 = int3(1080278602, 529676676, 156584048); + bool3 r2 = bool3(false, true, false); + TestUtils.AreEqual(r2, a2 < b2); + + int3 a3 = int3(337757077, 1081797900, 1336745069); + int3 b3 = int3(117348799, 246927124, 1916615924); + bool3 r3 = bool3(false, false, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void int3_operator_less_wide_scalar() + { + int3 a0 = int3(796797557, 670113454, 933579492); + int b0 = (746564682); + bool3 r0 = bool3(false, true, false); + TestUtils.AreEqual(r0, a0 < b0); + + int3 a1 = int3(278884514, 1117630673, 741886928); + int b1 = (318174822); + bool3 r1 = bool3(true, false, false); + TestUtils.AreEqual(r1, a1 < b1); + + int3 a2 = int3(1990922600, 1546212312, 1718582899); + int b2 = (1030849597); + bool3 r2 = bool3(false, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + int3 a3 = int3(1648393417, 1909506562, 1294006045); + int b3 = (1857132231); + bool3 r3 = bool3(true, false, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void int3_operator_less_scalar_wide() + { + int a0 = (186400299); + int3 b0 = int3(1881344229, 813834467, 1254886626); + bool3 r0 = bool3(true, true, true); + TestUtils.AreEqual(r0, a0 < b0); + + int a1 = (1353590345); + int3 b1 = int3(1412343685, 1555571443, 1540508298); + bool3 r1 = bool3(true, true, true); + TestUtils.AreEqual(r1, a1 < b1); + + int a2 = (1735458634); + int3 b2 = int3(135888070, 1643818742, 248291654); + bool3 r2 = bool3(false, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + int a3 = (1739560105); + int3 b3 = int3(728539891, 480507742, 1696553040); + bool3 r3 = bool3(false, false, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void int3_operator_greater_wide_wide() + { + int3 a0 = int3(2087717754, 1725569452, 1298066182); + int3 b0 = int3(85148514, 293632137, 1151128249); + bool3 r0 = bool3(true, true, true); + TestUtils.AreEqual(r0, a0 > b0); + + int3 a1 = int3(1693943616, 1319019629, 70674491); + int3 b1 = int3(409440398, 1115020183, 1508500597); + bool3 r1 = bool3(true, true, false); + TestUtils.AreEqual(r1, a1 > b1); + + int3 a2 = int3(1042499725, 1002821508, 1021857133); + int3 b2 = int3(1834583302, 1755218534, 1788761753); + bool3 r2 = bool3(false, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + int3 a3 = int3(1744374599, 821751047, 467646903); + int3 b3 = int3(1128238489, 834223713, 1578743290); + bool3 r3 = bool3(true, false, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void int3_operator_greater_wide_scalar() + { + int3 a0 = int3(1208626274, 239697208, 1979453345); + int b0 = (1715176566); + bool3 r0 = bool3(false, false, true); + TestUtils.AreEqual(r0, a0 > b0); + + int3 a1 = int3(1253474001, 1487911635, 1673945595); + int b1 = (1590192876); + bool3 r1 = bool3(false, false, true); + TestUtils.AreEqual(r1, a1 > b1); + + int3 a2 = int3(1662650098, 1433540517, 566635217); + int b2 = (222749855); + bool3 r2 = bool3(true, true, true); + TestUtils.AreEqual(r2, a2 > b2); + + int3 a3 = int3(1773305960, 206147145, 325913453); + int b3 = (1850273578); + bool3 r3 = bool3(false, false, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void int3_operator_greater_scalar_wide() + { + int a0 = (480938827); + int3 b0 = int3(1824731899, 921496110, 586859044); + bool3 r0 = bool3(false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + int a1 = (946430596); + int3 b1 = int3(1231356727, 1390167458, 1785807092); + bool3 r1 = bool3(false, false, false); + TestUtils.AreEqual(r1, a1 > b1); + + int a2 = (28949024); + int3 b2 = int3(2037899283, 595656760, 1778095771); + bool3 r2 = bool3(false, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + int a3 = (1233500439); + int3 b3 = int3(1696302238, 1445965340, 484020151); + bool3 r3 = bool3(false, false, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void int3_operator_less_equal_wide_wide() + { + int3 a0 = int3(154092149, 1515170149, 1083970332); + int3 b0 = int3(77984380, 1712054191, 1566203809); + bool3 r0 = bool3(false, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + int3 a1 = int3(785807178, 1401094881, 310537627); + int3 b1 = int3(254834519, 450519938, 389457083); + bool3 r1 = bool3(false, false, true); + TestUtils.AreEqual(r1, a1 <= b1); + + int3 a2 = int3(868328962, 1990816725, 2035349541); + int3 b2 = int3(1298669505, 207343167, 1214449047); + bool3 r2 = bool3(true, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + int3 a3 = int3(457043352, 1123282035, 1001842946); + int3 b3 = int3(2059561026, 896534357, 1897470050); + bool3 r3 = bool3(true, false, true); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void int3_operator_less_equal_wide_scalar() + { + int3 a0 = int3(1479531977, 1427983411, 415250630); + int b0 = (2004563877); + bool3 r0 = bool3(true, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + int3 a1 = int3(1245345407, 1072990632, 1579912858); + int b1 = (1112546666); + bool3 r1 = bool3(false, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + int3 a2 = int3(101048307, 509818792, 1910488590); + int b2 = (1070894375); + bool3 r2 = bool3(true, true, false); + TestUtils.AreEqual(r2, a2 <= b2); + + int3 a3 = int3(85452501, 1246249980, 1097326500); + int b3 = (518127023); + bool3 r3 = bool3(true, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void int3_operator_less_equal_scalar_wide() + { + int a0 = (1899193992); + int3 b0 = int3(915011820, 980913757, 1337699683); + bool3 r0 = bool3(false, false, false); + TestUtils.AreEqual(r0, a0 <= b0); + + int a1 = (1476321359); + int3 b1 = int3(1102143668, 660493983, 184664508); + bool3 r1 = bool3(false, false, false); + TestUtils.AreEqual(r1, a1 <= b1); + + int a2 = (381579707); + int3 b2 = int3(1954892821, 1295090571, 1440368586); + bool3 r2 = bool3(true, true, true); + TestUtils.AreEqual(r2, a2 <= b2); + + int a3 = (1696003686); + int3 b3 = int3(88708652, 1332251857, 1310713644); + bool3 r3 = bool3(false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void int3_operator_greater_equal_wide_wide() + { + int3 a0 = int3(8538378, 2131749726, 265427108); + int3 b0 = int3(903145828, 1697992986, 1432491982); + bool3 r0 = bool3(false, true, false); + TestUtils.AreEqual(r0, a0 >= b0); + + int3 a1 = int3(523609761, 994991818, 839709564); + int3 b1 = int3(169789504, 1059357300, 1744255222); + bool3 r1 = bool3(true, false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + int3 a2 = int3(101288202, 1886280970, 2032074826); + int3 b2 = int3(1606584463, 1905414425, 1448794969); + bool3 r2 = bool3(false, false, true); + TestUtils.AreEqual(r2, a2 >= b2); + + int3 a3 = int3(631221455, 1456286159, 961342752); + int3 b3 = int3(136181998, 1678754836, 2069656857); + bool3 r3 = bool3(true, false, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void int3_operator_greater_equal_wide_scalar() + { + int3 a0 = int3(2049236663, 182691143, 634973382); + int b0 = (1061998015); + bool3 r0 = bool3(true, false, false); + TestUtils.AreEqual(r0, a0 >= b0); + + int3 a1 = int3(1197012109, 1367606469, 1108037359); + int b1 = (439837565); + bool3 r1 = bool3(true, true, true); + TestUtils.AreEqual(r1, a1 >= b1); + + int3 a2 = int3(351147187, 411667685, 1998610091); + int b2 = (1898505669); + bool3 r2 = bool3(false, false, true); + TestUtils.AreEqual(r2, a2 >= b2); + + int3 a3 = int3(4652390, 2111455181, 727766399); + int b3 = (996159180); + bool3 r3 = bool3(false, true, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void int3_operator_greater_equal_scalar_wide() + { + int a0 = (1859811087); + int3 b0 = int3(1070365918, 1783869452, 830091760); + bool3 r0 = bool3(true, true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + int a1 = (377157428); + int3 b1 = int3(327199016, 90384229, 1154649706); + bool3 r1 = bool3(true, true, false); + TestUtils.AreEqual(r1, a1 >= b1); + + int a2 = (376758501); + int3 b2 = int3(1079802834, 2054742898, 1328349472); + bool3 r2 = bool3(false, false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + int a3 = (434061447); + int3 b3 = int3(951207723, 598695892, 975131651); + bool3 r3 = bool3(false, false, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void int3_operator_add_wide_wide() + { + int3 a0 = int3(2135171378, 21433296, 1954723494); + int3 b0 = int3(1013431952, 366718162, 359290756); + int3 r0 = int3(-1146363966, 388151458, -1980953046); + TestUtils.AreEqual(r0, a0 + b0); + + int3 a1 = int3(683604307, 1054212315, 1762680995); + int3 b1 = int3(1393163294, 1962236872, 1263270041); + int3 r1 = int3(2076767601, -1278518109, -1269016260); + TestUtils.AreEqual(r1, a1 + b1); + + int3 a2 = int3(1963655852, 1257853062, 2043493600); + int3 b2 = int3(1862666629, 1077447887, 821693806); + int3 r2 = int3(-468644815, -1959666347, -1429779890); + TestUtils.AreEqual(r2, a2 + b2); + + int3 a3 = int3(976898058, 1915056423, 121374462); + int3 b3 = int3(487316539, 350922520, 1583012528); + int3 r3 = int3(1464214597, -2028988353, 1704386990); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void int3_operator_add_wide_scalar() + { + int3 a0 = int3(665815972, 1783729250, 1591678394); + int b0 = (1334043849); + int3 r0 = int3(1999859821, -1177194197, -1369245053); + TestUtils.AreEqual(r0, a0 + b0); + + int3 a1 = int3(1284528538, 71069732, 1138577680); + int b1 = (977850224); + int3 r1 = int3(-2032588534, 1048919956, 2116427904); + TestUtils.AreEqual(r1, a1 + b1); + + int3 a2 = int3(1200356017, 1246759684, 1088001167); + int b2 = (565982008); + int3 r2 = int3(1766338025, 1812741692, 1653983175); + TestUtils.AreEqual(r2, a2 + b2); + + int3 a3 = int3(57252642, 625943813, 512157429); + int b3 = (678921480); + int3 r3 = int3(736174122, 1304865293, 1191078909); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void int3_operator_add_scalar_wide() + { + int a0 = (359966320); + int3 b0 = int3(2146146202, 767103309, 851002415); + int3 r0 = int3(-1788854774, 1127069629, 1210968735); + TestUtils.AreEqual(r0, a0 + b0); + + int a1 = (311531406); + int3 b1 = int3(1491262941, 1016891373, 1954228994); + int3 r1 = int3(1802794347, 1328422779, -2029206896); + TestUtils.AreEqual(r1, a1 + b1); + + int a2 = (1671335850); + int3 b2 = int3(727870747, 551151834, 1390261152); + int3 r2 = int3(-1895760699, -2072479612, -1233370294); + TestUtils.AreEqual(r2, a2 + b2); + + int a3 = (1699060326); + int3 b3 = int3(115021619, 1964440175, 440700758); + int3 r3 = int3(1814081945, -631466795, 2139761084); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void int3_operator_sub_wide_wide() + { + int3 a0 = int3(1410318491, 1097280168, 1827039044); + int3 b0 = int3(1315897366, 799052018, 1580289673); + int3 r0 = int3(94421125, 298228150, 246749371); + TestUtils.AreEqual(r0, a0 - b0); + + int3 a1 = int3(28881338, 328720965, 875487868); + int3 b1 = int3(1094686261, 1954325726, 1197734816); + int3 r1 = int3(-1065804923, -1625604761, -322246948); + TestUtils.AreEqual(r1, a1 - b1); + + int3 a2 = int3(212936325, 231977215, 1740021315); + int3 b2 = int3(229886366, 915679176, 1746884850); + int3 r2 = int3(-16950041, -683701961, -6863535); + TestUtils.AreEqual(r2, a2 - b2); + + int3 a3 = int3(2011295463, 48079003, 591379285); + int3 b3 = int3(918743925, 1007797419, 257421324); + int3 r3 = int3(1092551538, -959718416, 333957961); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void int3_operator_sub_wide_scalar() + { + int3 a0 = int3(1508669340, 1594795463, 266707545); + int b0 = (998008471); + int3 r0 = int3(510660869, 596786992, -731300926); + TestUtils.AreEqual(r0, a0 - b0); + + int3 a1 = int3(643102647, 1475644328, 1113286221); + int b1 = (287705008); + int3 r1 = int3(355397639, 1187939320, 825581213); + TestUtils.AreEqual(r1, a1 - b1); + + int3 a2 = int3(979450511, 1108005498, 304369206); + int b2 = (2082174113); + int3 r2 = int3(-1102723602, -974168615, -1777804907); + TestUtils.AreEqual(r2, a2 - b2); + + int3 a3 = int3(999244508, 1994553647, 2101812429); + int b3 = (1806482044); + int3 r3 = int3(-807237536, 188071603, 295330385); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void int3_operator_sub_scalar_wide() + { + int a0 = (893369501); + int3 b0 = int3(2051906184, 1699714311, 442603706); + int3 r0 = int3(-1158536683, -806344810, 450765795); + TestUtils.AreEqual(r0, a0 - b0); + + int a1 = (1735141684); + int3 b1 = int3(274533585, 811580259, 1196354320); + int3 r1 = int3(1460608099, 923561425, 538787364); + TestUtils.AreEqual(r1, a1 - b1); + + int a2 = (1524097023); + int3 b2 = int3(533621527, 2080845793, 143958837); + int3 r2 = int3(990475496, -556748770, 1380138186); + TestUtils.AreEqual(r2, a2 - b2); + + int a3 = (1620668660); + int3 b3 = int3(1135989346, 1367044745, 554088609); + int3 r3 = int3(484679314, 253623915, 1066580051); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void int3_operator_mul_wide_wide() + { + int3 a0 = int3(61417577, 219585476, 1362520891); + int3 b0 = int3(578042444, 1620527213, 200516468); + int3 r0 = int3(-1426863828, 1326150260, -990894148); + TestUtils.AreEqual(r0, a0 * b0); + + int3 a1 = int3(1511084277, 1481211272, 58211871); + int3 b1 = int3(309339115, 542853019, 299467282); + int3 r1 = int3(-1322856473, 1973926232, 88546350); + TestUtils.AreEqual(r1, a1 * b1); + + int3 a2 = int3(1459591173, 567624644, 1169935583); + int3 b2 = int3(1479641221, 1428338601, 1497302909); + int3 r2 = int3(-863919463, -582821788, 556671459); + TestUtils.AreEqual(r2, a2 * b2); + + int3 a3 = int3(1835691886, 385626539, 85934842); + int3 b3 = int3(1596889147, 427413842, 265122693); + int3 r3 = int3(1098186330, 1848083398, -58320414); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void int3_operator_mul_wide_scalar() + { + int3 a0 = int3(871746615, 492532311, 570557670); + int b0 = (442064533); + int3 r0 = int3(338365955, 1081376419, -1729147426); + TestUtils.AreEqual(r0, a0 * b0); + + int3 a1 = int3(2142306629, 1526163563, 118471734); + int b1 = (1610315153); + int3 r1 = int3(310198549, -1362883685, -1008711530); + TestUtils.AreEqual(r1, a1 * b1); + + int3 a2 = int3(257439514, 1186560810, 1584938026); + int b2 = (364291059); + int3 r2 = int3(172874670, 1029154526, 1917573598); + TestUtils.AreEqual(r2, a2 * b2); + + int3 a3 = int3(1357601203, 268562104, 1007838321); + int b3 = (638897141); + int3 r3 = int3(-1520842417, -796565992, -1307329755); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void int3_operator_mul_scalar_wide() + { + int a0 = (1152242766); + int3 b0 = int3(1276636134, 2105929407, 499007702); + int3 r0 = int3(-2129504236, 999811634, 1179056436); + TestUtils.AreEqual(r0, a0 * b0); + + int a1 = (124002565); + int3 b1 = int3(1956335172, 1288034953, 832676555); + int3 r1 = int3(-1162917036, 495775149, -227518217); + TestUtils.AreEqual(r1, a1 * b1); + + int a2 = (337389733); + int3 b2 = int3(99268757, 2005055247, 2011389505); + int3 r2 = int3(1366048777, -1518447445, 794945509); + TestUtils.AreEqual(r2, a2 * b2); + + int a3 = (1348110859); + int3 b3 = int3(399689191, 2007606374, 2076691289); + int3 r3 = int3(1743980269, 1120210018, 1383970515); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void int3_operator_div_wide_wide() + { + int3 a0 = int3(333171510, 858154903, 1181365836); + int3 b0 = int3(698897823, 440199998, 655557473); + int3 r0 = int3(0, 1, 1); + TestUtils.AreEqual(r0, a0 / b0); + + int3 a1 = int3(671357749, 1090606752, 803759420); + int3 b1 = int3(1658534285, 2127220100, 315653188); + int3 r1 = int3(0, 0, 2); + TestUtils.AreEqual(r1, a1 / b1); + + int3 a2 = int3(788404166, 296807814, 575260195); + int3 b2 = int3(1814290360, 992173243, 914851653); + int3 r2 = int3(0, 0, 0); + TestUtils.AreEqual(r2, a2 / b2); + + int3 a3 = int3(166625280, 1493729000, 1831739736); + int3 b3 = int3(664340325, 224323977, 246981573); + int3 r3 = int3(0, 6, 7); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void int3_operator_div_wide_scalar() + { + int3 a0 = int3(1433072926, 1073958635, 1195142312); + int b0 = (1434025872); + int3 r0 = int3(0, 0, 0); + TestUtils.AreEqual(r0, a0 / b0); + + int3 a1 = int3(536596719, 464756346, 806462546); + int b1 = (1274375693); + int3 r1 = int3(0, 0, 0); + TestUtils.AreEqual(r1, a1 / b1); + + int3 a2 = int3(906504670, 25493909, 1196815948); + int b2 = (1380905136); + int3 r2 = int3(0, 0, 0); + TestUtils.AreEqual(r2, a2 / b2); + + int3 a3 = int3(123300377, 2084019932, 2047825037); + int b3 = (643754735); + int3 r3 = int3(0, 3, 3); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void int3_operator_div_scalar_wide() + { + int a0 = (519165704); + int3 b0 = int3(1295178177, 775214121, 467772046); + int3 r0 = int3(0, 0, 1); + TestUtils.AreEqual(r0, a0 / b0); + + int a1 = (1156881598); + int3 b1 = int3(310396565, 759759959, 243837702); + int3 r1 = int3(3, 1, 4); + TestUtils.AreEqual(r1, a1 / b1); + + int a2 = (1616314235); + int3 b2 = int3(1053470225, 1320630160, 378773841); + int3 r2 = int3(1, 1, 4); + TestUtils.AreEqual(r2, a2 / b2); + + int a3 = (4223608); + int3 b3 = int3(1971105754, 2054406020, 219939614); + int3 r3 = int3(0, 0, 0); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void int3_operator_mod_wide_wide() + { + int3 a0 = int3(258342924, 1454754891, 723352342); + int3 b0 = int3(1990080167, 1197348066, 651970512); + int3 r0 = int3(258342924, 257406825, 71381830); + TestUtils.AreEqual(r0, a0 % b0); + + int3 a1 = int3(1981431473, 531756042, 716993627); + int3 b1 = int3(1659454050, 241005212, 1866255454); + int3 r1 = int3(321977423, 49745618, 716993627); + TestUtils.AreEqual(r1, a1 % b1); + + int3 a2 = int3(1667903349, 1331097004, 1776856101); + int3 b2 = int3(1440101415, 595220963, 408818410); + int3 r2 = int3(227801934, 140655078, 141582461); + TestUtils.AreEqual(r2, a2 % b2); + + int3 a3 = int3(17598216, 1474345080, 1681376293); + int3 b3 = int3(198222574, 549504274, 239973807); + int3 r3 = int3(17598216, 375336532, 1559644); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void int3_operator_mod_wide_scalar() + { + int3 a0 = int3(560988938, 629524514, 767711194); + int b0 = (1156862367); + int3 r0 = int3(560988938, 629524514, 767711194); + TestUtils.AreEqual(r0, a0 % b0); + + int3 a1 = int3(434281967, 792916846, 1663690927); + int b1 = (1399805893); + int3 r1 = int3(434281967, 792916846, 263885034); + TestUtils.AreEqual(r1, a1 % b1); + + int3 a2 = int3(598661916, 1287035793, 1743722161); + int b2 = (1776636144); + int3 r2 = int3(598661916, 1287035793, 1743722161); + TestUtils.AreEqual(r2, a2 % b2); + + int3 a3 = int3(475209785, 1617696916, 379853074); + int b3 = (327476870); + int3 r3 = int3(147732915, 307789436, 52376204); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void int3_operator_mod_scalar_wide() + { + int a0 = (933347930); + int3 b0 = int3(549923387, 243114953, 1884274390); + int3 r0 = int3(383424543, 204003071, 933347930); + TestUtils.AreEqual(r0, a0 % b0); + + int a1 = (1428033594); + int3 b1 = int3(655531454, 1622674954, 1107563514); + int3 r1 = int3(116970686, 1428033594, 320470080); + TestUtils.AreEqual(r1, a1 % b1); + + int a2 = (1614111094); + int3 b2 = int3(914801920, 1432263179, 564431096); + int3 r2 = int3(699309174, 181847915, 485248902); + TestUtils.AreEqual(r2, a2 % b2); + + int a3 = (1967013901); + int3 b3 = int3(1709750152, 1080102613, 13120773); + int3 r3 = int3(257263749, 886911288, 12018724); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void int3_operator_plus() + { + int3 a0 = int3(195392567, 222719748, 1002351013); + int3 r0 = int3(195392567, 222719748, 1002351013); + TestUtils.AreEqual(r0, +a0); + + int3 a1 = int3(1570765263, 1515950277, 1689763402); + int3 r1 = int3(1570765263, 1515950277, 1689763402); + TestUtils.AreEqual(r1, +a1); + + int3 a2 = int3(291471785, 1084131995, 195779102); + int3 r2 = int3(291471785, 1084131995, 195779102); + TestUtils.AreEqual(r2, +a2); + + int3 a3 = int3(2131702223, 1995564647, 69731564); + int3 r3 = int3(2131702223, 1995564647, 69731564); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void int3_operator_neg() + { + int3 a0 = int3(1385088677, 94114564, 1350664872); + int3 r0 = int3(-1385088677, -94114564, -1350664872); + TestUtils.AreEqual(r0, -a0); + + int3 a1 = int3(1458616659, 218122493, 958484951); + int3 r1 = int3(-1458616659, -218122493, -958484951); + TestUtils.AreEqual(r1, -a1); + + int3 a2 = int3(270553961, 270503114, 1928771252); + int3 r2 = int3(-270553961, -270503114, -1928771252); + TestUtils.AreEqual(r2, -a2); + + int3 a3 = int3(1427605822, 1434247484, 485368391); + int3 r3 = int3(-1427605822, -1434247484, -485368391); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void int3_operator_prefix_inc() + { + int3 a0 = int3(780471723, 954741756, 272723451); + int3 r0 = int3(780471724, 954741757, 272723452); + TestUtils.AreEqual(r0, ++a0); + + int3 a1 = int3(2142862245, 1514814550, 250124151); + int3 r1 = int3(2142862246, 1514814551, 250124152); + TestUtils.AreEqual(r1, ++a1); + + int3 a2 = int3(444189162, 1915989169, 1348278302); + int3 r2 = int3(444189163, 1915989170, 1348278303); + TestUtils.AreEqual(r2, ++a2); + + int3 a3 = int3(129540735, 1170613526, 986715680); + int3 r3 = int3(129540736, 1170613527, 986715681); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void int3_operator_postfix_inc() + { + int3 a0 = int3(241865086, 2145821641, 1596166022); + int3 r0 = int3(241865086, 2145821641, 1596166022); + TestUtils.AreEqual(r0, a0++); + + int3 a1 = int3(803592338, 1656767229, 903047443); + int3 r1 = int3(803592338, 1656767229, 903047443); + TestUtils.AreEqual(r1, a1++); + + int3 a2 = int3(1213663244, 1384002775, 389844650); + int3 r2 = int3(1213663244, 1384002775, 389844650); + TestUtils.AreEqual(r2, a2++); + + int3 a3 = int3(1159795446, 1227160199, 947635082); + int3 r3 = int3(1159795446, 1227160199, 947635082); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void int3_operator_prefix_dec() + { + int3 a0 = int3(1331961415, 1612382200, 1401591249); + int3 r0 = int3(1331961414, 1612382199, 1401591248); + TestUtils.AreEqual(r0, --a0); + + int3 a1 = int3(2042075388, 1895858159, 1467742422); + int3 r1 = int3(2042075387, 1895858158, 1467742421); + TestUtils.AreEqual(r1, --a1); + + int3 a2 = int3(578341664, 2059077641, 1169239112); + int3 r2 = int3(578341663, 2059077640, 1169239111); + TestUtils.AreEqual(r2, --a2); + + int3 a3 = int3(1862369220, 1027543764, 1595492535); + int3 r3 = int3(1862369219, 1027543763, 1595492534); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void int3_operator_postfix_dec() + { + int3 a0 = int3(1870005937, 1708534798, 704493460); + int3 r0 = int3(1870005937, 1708534798, 704493460); + TestUtils.AreEqual(r0, a0--); + + int3 a1 = int3(462940703, 228744869, 940247280); + int3 r1 = int3(462940703, 228744869, 940247280); + TestUtils.AreEqual(r1, a1--); + + int3 a2 = int3(1818778351, 862428933, 1401191870); + int3 r2 = int3(1818778351, 862428933, 1401191870); + TestUtils.AreEqual(r2, a2--); + + int3 a3 = int3(2080259851, 140452688, 1928164223); + int3 r3 = int3(2080259851, 140452688, 1928164223); + TestUtils.AreEqual(r3, a3--); + } + + [TestCompiler] + public static void int3_operator_bitwise_and_wide_wide() + { + int3 a0 = int3(1055241304, 859321394, 1088358961); + int3 b0 = int3(749698416, 748105424, 1842764797); + int3 r0 = int3(749024336, 537928720, 1087769137); + TestUtils.AreEqual(r0, a0 & b0); + + int3 a1 = int3(2090949513, 300561740, 651904515); + int3 b1 = int3(9990577, 1989102105, 1666634755); + int3 r1 = int3(8409473, 277479432, 575816707); + TestUtils.AreEqual(r1, a1 & b1); + + int3 a2 = int3(1331035868, 2012752753, 1298126656); + int3 b2 = int3(58116798, 868036607, 1420638875); + int3 r2 = int3(55888540, 867707761, 1141707264); + TestUtils.AreEqual(r2, a2 & b2); + + int3 a3 = int3(53199569, 1752363533, 1303061302); + int3 b3 = int3(1308767169, 564040763, 478617502); + int3 r3 = int3(33686209, 538087433, 209912598); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void int3_operator_bitwise_and_wide_scalar() + { + int3 a0 = int3(1513158868, 284695609, 734595037); + int b0 = (1173647397); + int3 r0 = int3(1076916228, 15732769, 29360133); + TestUtils.AreEqual(r0, a0 & b0); + + int3 a1 = int3(1566510707, 84213838, 314333543); + int b1 = (1601252476); + int3 r1 = int3(1565592688, 83951692, 305137764); + TestUtils.AreEqual(r1, a1 & b1); + + int3 a2 = int3(430856908, 327392481, 1619794917); + int b2 = (753481263); + int3 r2 = int3(145232396, 8459297, 545788453); + TestUtils.AreEqual(r2, a2 & b2); + + int3 a3 = int3(2143619546, 126982769, 651482651); + int b3 = (1873208293); + int3 r3 = int3(1870922176, 125862497, 646234625); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void int3_operator_bitwise_and_scalar_wide() + { + int a0 = (477163326); + int3 b0 = int3(110453385, 703240362, 2075630560); + int3 r0 = int3(68182536, 140544042, 405834528); + TestUtils.AreEqual(r0, a0 & b0); + + int a1 = (1884904031); + int3 b1 = int3(1734899436, 947945203, 1664399051); + int3 r1 = int3(1615352396, 805329491, 1611665995); + TestUtils.AreEqual(r1, a1 & b1); + + int a2 = (458879298); + int3 b2 = int3(158491426, 79772356, 2054527944); + int3 r2 = int3(156262658, 4272192, 441553216); + TestUtils.AreEqual(r2, a2 & b2); + + int a3 = (202228212); + int3 b3 = int3(359225061, 639811396, 1821945318); + int3 r3 = int3(67715300, 67141956, 201884132); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void int3_operator_bitwise_or_wide_wide() + { + int3 a0 = int3(1920951869, 1750772852, 1420019191); + int3 b0 = int3(214585254, 275414367, 858759675); + int3 r0 = int3(2130669503, 2021326207, 2008016383); + TestUtils.AreEqual(r0, a0 | b0); + + int3 a1 = int3(732977093, 1169579447, 229437930); + int3 b1 = int3(190211455, 1218691723, 2129565457); + int3 r1 = int3(737572863, 1303895999, 2146367483); + TestUtils.AreEqual(r1, a1 | b1); + + int3 a2 = int3(1966721348, 2039812323, 113550869); + int3 b2 = int3(1862809466, 495728846, 868064152); + int3 r2 = int3(2134507390, 2107455727, 939376541); + TestUtils.AreEqual(r2, a2 | b2); + + int3 a3 = int3(1912038362, 1569990624, 1490718227); + int3 b3 = int3(1756913766, 933656055, 247722084); + int3 r3 = int3(2046780414, 2142664695, 1591475831); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void int3_operator_bitwise_or_wide_scalar() + { + int3 a0 = int3(1295304853, 1307252624, 350194630); + int b0 = (1305527136); + int3 r0 = int3(1307888629, 1308350448, 1574947814); + TestUtils.AreEqual(r0, a0 | b0); + + int3 a1 = int3(1128063578, 2085245467, 1988423804); + int b1 = (1774824542); + int3 r1 = int3(1811803742, 2110520927, 2144205950); + TestUtils.AreEqual(r1, a1 | b1); + + int3 a2 = int3(999162350, 1050875188, 341855232); + int b2 = (2110327307); + int3 r2 = int3(2144275439, 2146115391, 2112441867); + TestUtils.AreEqual(r2, a2 | b2); + + int3 a3 = int3(1317039676, 41280811, 1536908787); + int b3 = (228656898); + int3 r3 = int3(1335979838, 267773739, 1606115315); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void int3_operator_bitwise_or_scalar_wide() + { + int a0 = (1768627592); + int3 b0 = int3(1849658052, 1759912154, 729979455); + int3 r0 = int3(1870634956, 1777286618, 1810603967); + TestUtils.AreEqual(r0, a0 | b0); + + int a1 = (975926310); + int3 b1 = int3(1987690876, 1809506714, 1160695341); + int3 r1 = int3(2122052990, 2080110014, 2133851695); + TestUtils.AreEqual(r1, a1 | b1); + + int a2 = (408963395); + int3 b2 = int3(314072711, 1560007537, 1709003416); + int3 r2 = int3(452485063, 1560009587, 2113756123); + TestUtils.AreEqual(r2, a2 | b2); + + int a3 = (977086639); + int3 b3 = int3(1448375596, 1689568808, 595543345); + int3 r3 = int3(2122153391, 2126376623, 998206911); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void int3_operator_bitwise_xor_wide_wide() + { + int3 a0 = int3(1843655608, 362425681, 640805534); + int3 b0 = int3(1422803441, 1234691140, 119589253); + int3 r0 = int3(959296073, 1544407317, 554771227); + TestUtils.AreEqual(r0, a0 ^ b0); + + int3 a1 = int3(1342040268, 945678755, 980321850); + int3 b1 = int3(1101464929, 121896337, 1880109018); + int3 r1 = int3(240840109, 1058935858, 1249815008); + TestUtils.AreEqual(r1, a1 ^ b1); + + int3 a2 = int3(390165019, 1682422658, 303897251); + int3 b2 = int3(1000210266, 1718938232, 464406940); + int3 r2 = int3(752651585, 36917754, 162747199); + TestUtils.AreEqual(r2, a2 ^ b2); + + int3 a3 = int3(230477768, 1103646442, 1503102919); + int3 b3 = int3(884337881, 34199854, 1430659227); + int3 r3 = int3(956900113, 1136760772, 215066460); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void int3_operator_bitwise_xor_wide_scalar() + { + int3 a0 = int3(169345668, 176087064, 2084362901); + int b0 = (354464228); + int3 r0 = int3(523809632, 526275068, 1763470193); + TestUtils.AreEqual(r0, a0 ^ b0); + + int3 a1 = int3(1663924004, 517476661, 905336222); + int b1 = (193851255); + int3 r1 = int3(1755355219, 357957186, 1048296169); + TestUtils.AreEqual(r1, a1 ^ b1); + + int3 a2 = int3(863800783, 835837496, 954341348); + int b2 = (365003873); + int3 r2 = int3(649922990, 605051481, 757306245); + TestUtils.AreEqual(r2, a2 ^ b2); + + int3 a3 = int3(1464576786, 1700827127, 2003392824); + int b3 = (625604047); + int3 r3 = int3(1912757981, 1076460088, 1377873143); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void int3_operator_bitwise_xor_scalar_wide() + { + int a0 = (1361775641); + int3 b0 = int3(1452773578, 459050892, 1986218254); + int3 r0 = int3(129801427, 1249346453, 659047703); + TestUtils.AreEqual(r0, a0 ^ b0); + + int a1 = (1689037698); + int3 b1 = int3(999278344, 1229114508, 1087843538); + int3 r1 = int3(1596157066, 770598670, 612075344); + TestUtils.AreEqual(r1, a1 ^ b1); + + int a2 = (733699740); + int3 b2 = int3(106187872, 1533632738, 1107817672); + int3 r2 = int3(770642684, 1892826750, 1773972052); + TestUtils.AreEqual(r2, a2 ^ b2); + + int a3 = (492506236); + int3 b3 = int3(597602329, 1439603382, 1001169118); + int3 r3 = int3(1053146213, 1217763018, 653765794); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void int3_operator_left_shift() + { + int3 a0 = int3(1129100049, 829482269, 1571297368); + int b0 = (218351941); + int3 r0 = int3(1771463200, 773628832, -1258091776); + TestUtils.AreEqual(r0, a0 << b0); + + int3 a1 = int3(443753193, 249554593, 892627436); + int b1 = (1872142968); + int3 r1 = int3(-385875968, -1593835520, -335544320); + TestUtils.AreEqual(r1, a1 << b1); + + int3 a2 = int3(980302862, 849916599, 1271350845); + int b2 = (62369727); + int3 r2 = int3(0, -2147483648, -2147483648); + TestUtils.AreEqual(r2, a2 << b2); + + int3 a3 = int3(108441902, 1779118882, 1451674188); + int b3 = (1959056531); + int3 r3 = int3(-1989148672, -1727004672, 1382023168); + TestUtils.AreEqual(r3, a3 << b3); + } + + [TestCompiler] + public static void int3_operator_right_shift() + { + int3 a0 = int3(809126085, 908563670, 763568837); + int b0 = (994800051); + int3 r0 = int3(1543, 1732, 1456); + TestUtils.AreEqual(r0, a0 >> b0); + + int3 a1 = int3(1986717290, 646821842, 1242726074); + int b1 = (1174507510); + int3 r1 = int3(473, 154, 296); + TestUtils.AreEqual(r1, a1 >> b1); + + int3 a2 = int3(390811632, 1923166649, 102096936); + int b2 = (1521420393); + int3 r2 = int3(763303, 3756184, 199408); + TestUtils.AreEqual(r2, a2 >> b2); + + int3 a3 = int3(400863878, 1611921244, 307750782); + int b3 = (667378673); + int3 r3 = int3(3058, 12297, 2347); + TestUtils.AreEqual(r3, a3 >> b3); + } + + [TestCompiler] + public static void int3_operator_bitwise_not() + { + int3 a0 = int3(111796841, 603562399, 745091931); + int3 r0 = int3(-111796842, -603562400, -745091932); + TestUtils.AreEqual(r0, ~a0); + + int3 a1 = int3(853183268, 381888399, 1891338755); + int3 r1 = int3(-853183269, -381888400, -1891338756); + TestUtils.AreEqual(r1, ~a1); + + int3 a2 = int3(1506860135, 787710759, 875964607); + int3 r2 = int3(-1506860136, -787710760, -875964608); + TestUtils.AreEqual(r2, ~a2); + + int3 a3 = int3(96456785, 203444882, 1172294211); + int3 r3 = int3(-96456786, -203444883, -1172294212); + TestUtils.AreEqual(r3, ~a3); + } + + [TestCompiler] + public static void int3_shuffle_result_1() + { + int3 a = int3(0, 1, 2); + int3 b = int3(3, 4, 5); + + TestUtils.AreEqual((0), shuffle(a, b, ShuffleComponent.LeftX)); + TestUtils.AreEqual((1), shuffle(a, b, ShuffleComponent.LeftY)); + TestUtils.AreEqual((2), shuffle(a, b, ShuffleComponent.LeftZ)); + TestUtils.AreEqual((3), shuffle(a, b, ShuffleComponent.RightX)); + TestUtils.AreEqual((4), shuffle(a, b, ShuffleComponent.RightY)); + TestUtils.AreEqual((5), shuffle(a, b, ShuffleComponent.RightZ)); + } + + [TestCompiler] + public static void int3_shuffle_result_2() + { + int3 a = int3(0, 1, 2); + int3 b = int3(3, 4, 5); + + TestUtils.AreEqual(int2(4, 4), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightY)); + TestUtils.AreEqual(int2(4, 3), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightX)); + TestUtils.AreEqual(int2(1, 3), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.RightX)); + TestUtils.AreEqual(int2(5, 2), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(int2(5, 1), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.LeftY)); + TestUtils.AreEqual(int2(1, 2), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(int2(3, 2), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(int2(5, 0), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.LeftX)); + TestUtils.AreEqual(int2(5, 5), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.RightZ)); + TestUtils.AreEqual(int2(4, 1), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftY)); + TestUtils.AreEqual(int2(4, 5), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightZ)); + TestUtils.AreEqual(int2(5, 0), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.LeftX)); + TestUtils.AreEqual(int2(4, 3), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightX)); + TestUtils.AreEqual(int2(5, 4), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.RightY)); + TestUtils.AreEqual(int2(3, 0), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftX)); + TestUtils.AreEqual(int2(1, 2), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.LeftZ)); + } + + [TestCompiler] + public static void int3_shuffle_result_3() + { + int3 a = int3(0, 1, 2); + int3 b = int3(3, 4, 5); + + TestUtils.AreEqual(int3(1, 5, 3), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.RightZ, ShuffleComponent.RightX)); + TestUtils.AreEqual(int3(4, 0, 2), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftX, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(int3(2, 5, 3), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.RightZ, ShuffleComponent.RightX)); + TestUtils.AreEqual(int3(4, 0, 1), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftX, ShuffleComponent.LeftY)); + TestUtils.AreEqual(int3(5, 4, 2), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.RightY, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(int3(2, 0, 1), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.LeftX, ShuffleComponent.LeftY)); + TestUtils.AreEqual(int3(2, 4, 3), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.RightY, ShuffleComponent.RightX)); + TestUtils.AreEqual(int3(2, 1, 5), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.LeftY, ShuffleComponent.RightZ)); + TestUtils.AreEqual(int3(4, 4, 5), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightY, ShuffleComponent.RightZ)); + TestUtils.AreEqual(int3(4, 3, 1), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightX, ShuffleComponent.LeftY)); + TestUtils.AreEqual(int3(5, 5, 0), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.RightZ, ShuffleComponent.LeftX)); + TestUtils.AreEqual(int3(5, 1, 3), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.LeftY, ShuffleComponent.RightX)); + TestUtils.AreEqual(int3(4, 1, 5), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftY, ShuffleComponent.RightZ)); + TestUtils.AreEqual(int3(2, 3, 4), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.RightX, ShuffleComponent.RightY)); + TestUtils.AreEqual(int3(4, 0, 4), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftX, ShuffleComponent.RightY)); + TestUtils.AreEqual(int3(4, 0, 5), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftX, ShuffleComponent.RightZ)); + } + + [TestCompiler] + public static void int3_shuffle_result_4() + { + int3 a = int3(0, 1, 2); + int3 b = int3(3, 4, 5); + + TestUtils.AreEqual(int4(1, 2, 3, 1), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.LeftZ, ShuffleComponent.RightX, ShuffleComponent.LeftY)); + TestUtils.AreEqual(int4(4, 2, 5, 4), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftZ, ShuffleComponent.RightZ, ShuffleComponent.RightY)); + TestUtils.AreEqual(int4(4, 4, 5, 1), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightY, ShuffleComponent.RightZ, ShuffleComponent.LeftY)); + TestUtils.AreEqual(int4(3, 3, 1, 1), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightX, ShuffleComponent.LeftY, ShuffleComponent.LeftY)); + TestUtils.AreEqual(int4(4, 1, 1, 0), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftY, ShuffleComponent.LeftY, ShuffleComponent.LeftX)); + TestUtils.AreEqual(int4(3, 4, 3, 5), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightY, ShuffleComponent.RightX, ShuffleComponent.RightZ)); + TestUtils.AreEqual(int4(1, 5, 0, 5), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.RightZ, ShuffleComponent.LeftX, ShuffleComponent.RightZ)); + TestUtils.AreEqual(int4(4, 0, 0, 0), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftX, ShuffleComponent.LeftX, ShuffleComponent.LeftX)); + TestUtils.AreEqual(int4(3, 5, 2, 0), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightZ, ShuffleComponent.LeftZ, ShuffleComponent.LeftX)); + TestUtils.AreEqual(int4(4, 3, 1, 3), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightX, ShuffleComponent.LeftY, ShuffleComponent.RightX)); + TestUtils.AreEqual(int4(0, 2, 5, 0), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.LeftZ, ShuffleComponent.RightZ, ShuffleComponent.LeftX)); + TestUtils.AreEqual(int4(1, 4, 5, 5), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.RightY, ShuffleComponent.RightZ, ShuffleComponent.RightZ)); + TestUtils.AreEqual(int4(2, 3, 1, 3), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.RightX, ShuffleComponent.LeftY, ShuffleComponent.RightX)); + TestUtils.AreEqual(int4(3, 0, 1, 2), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftX, ShuffleComponent.LeftY, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(int4(5, 3, 0, 4), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.RightX, ShuffleComponent.LeftX, ShuffleComponent.RightY)); + TestUtils.AreEqual(int4(2, 5, 0, 4), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.RightZ, ShuffleComponent.LeftX, ShuffleComponent.RightY)); + } + + [TestCase /* For player builds */] + public static void int3_EqualsObjectOverride() + { + TestUtils.IsFalse(new int3().Equals((object)new int())); + TestUtils.IsTrue(new int3().Equals((object)new int3())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestInt3.gen.cs.meta b/src/Tests/Tests/Shared/TestInt3.gen.cs.meta new file mode 100644 index 00000000..03b32ecc --- /dev/null +++ b/src/Tests/Tests/Shared/TestInt3.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 749525b6f2a189a42bddcde8b3f6a88e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestInt3x2.gen.cs b/src/Tests/Tests/Shared/TestInt3x2.gen.cs new file mode 100644 index 00000000..db159df9 --- /dev/null +++ b/src/Tests/Tests/Shared/TestInt3x2.gen.cs @@ -0,0 +1,1234 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestInt3x2 + { + [TestCompiler] + public static void int3x2_zero() + { + TestUtils.AreEqual(0, int3x2.zero.c0.x); + TestUtils.AreEqual(0, int3x2.zero.c0.y); + TestUtils.AreEqual(0, int3x2.zero.c0.z); + TestUtils.AreEqual(0, int3x2.zero.c1.x); + TestUtils.AreEqual(0, int3x2.zero.c1.y); + TestUtils.AreEqual(0, int3x2.zero.c1.z); + } + + [TestCompiler] + public static void int3x2_operator_equal_wide_wide() + { + int3x2 a0 = int3x2(2105871082, 35218899, 1550755093, 764676020, 606743782, 1208156098); + int3x2 b0 = int3x2(1477587886, 579629692, 540974792, 208405066, 2063397938, 1060167409); + bool3x2 r0 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + int3x2 a1 = int3x2(1023640014, 1038468316, 1416064367, 727143393, 2061243891, 184669837); + int3x2 b1 = int3x2(362592601, 2097545362, 277670088, 426944490, 901076223, 857900673); + bool3x2 r1 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + int3x2 a2 = int3x2(1303661760, 2044073738, 370395888, 1822916805, 1076983135, 345215866); + int3x2 b2 = int3x2(1548779757, 325265488, 312658571, 176373760, 2052378097, 858156597); + bool3x2 r2 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + int3x2 a3 = int3x2(833676277, 1987782708, 1481088614, 1364754268, 93639636, 1850596922); + int3x2 b3 = int3x2(982817797, 1252095508, 882634538, 1959142806, 72495800, 1077678183); + bool3x2 r3 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void int3x2_operator_equal_wide_scalar() + { + int3x2 a0 = int3x2(437822262, 2020661134, 541786900, 853113810, 23716499, 179951405); + int b0 = (1332833578); + bool3x2 r0 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + int3x2 a1 = int3x2(1409026299, 953202998, 691955848, 1926262965, 1851546137, 712957637); + int b1 = (948838849); + bool3x2 r1 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + int3x2 a2 = int3x2(2028784869, 1836975611, 1016802970, 390120467, 464814777, 1451642042); + int b2 = (1049962241); + bool3x2 r2 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + int3x2 a3 = int3x2(289137869, 808355440, 660053867, 597354173, 67320270, 151461188); + int b3 = (152339338); + bool3x2 r3 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void int3x2_operator_equal_scalar_wide() + { + int a0 = (542329200); + int3x2 b0 = int3x2(1115584594, 684107773, 1928988941, 890709324, 641152437, 1410341302); + bool3x2 r0 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + int a1 = (497505660); + int3x2 b1 = int3x2(1068223109, 2014009435, 213835595, 1592428361, 1819361470, 448650623); + bool3x2 r1 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + int a2 = (1942175642); + int3x2 b2 = int3x2(64377057, 1485938610, 1146305380, 1312317120, 263290348, 812663708); + bool3x2 r2 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + int a3 = (1585209188); + int3x2 b3 = int3x2(40646617, 1378718922, 1957797737, 873652576, 1780082094, 1513270921); + bool3x2 r3 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void int3x2_operator_not_equal_wide_wide() + { + int3x2 a0 = int3x2(1977284100, 1293292704, 1547283851, 422428953, 195833190, 1711544892); + int3x2 b0 = int3x2(1514195556, 957972049, 507667364, 581861672, 1128094576, 940096636); + bool3x2 r0 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + int3x2 a1 = int3x2(5606053, 737069074, 647386678, 13079405, 1413841590, 1076166545); + int3x2 b1 = int3x2(57559040, 181752616, 962017320, 1762015406, 1107218953, 2042026522); + bool3x2 r1 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + int3x2 a2 = int3x2(1211445174, 1289303469, 1436402489, 1129570126, 1566836685, 1343313905); + int3x2 b2 = int3x2(836002288, 570272309, 2112081980, 1500634658, 1787808345, 566425667); + bool3x2 r2 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + int3x2 a3 = int3x2(329259205, 1774944480, 33906739, 2055853627, 2035015372, 1702756001); + int3x2 b3 = int3x2(2037529609, 1520589840, 266793699, 538816359, 2075474643, 553571317); + bool3x2 r3 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void int3x2_operator_not_equal_wide_scalar() + { + int3x2 a0 = int3x2(1038269360, 1427812625, 103361237, 1347017023, 1523584313, 150442802); + int b0 = (768873026); + bool3x2 r0 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + int3x2 a1 = int3x2(660334527, 262959423, 484398043, 506946952, 226568494, 507918242); + int b1 = (719113717); + bool3x2 r1 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + int3x2 a2 = int3x2(1702162286, 166187260, 114581840, 1045389187, 1648095254, 1461803977); + int b2 = (923269270); + bool3x2 r2 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + int3x2 a3 = int3x2(61801615, 2146927809, 1557151164, 1284033253, 1345705546, 1747302566); + int b3 = (1317840133); + bool3x2 r3 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void int3x2_operator_not_equal_scalar_wide() + { + int a0 = (1652127596); + int3x2 b0 = int3x2(953791238, 271722683, 1278885987, 735128017, 112416504, 25967222); + bool3x2 r0 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + int a1 = (1761444475); + int3x2 b1 = int3x2(1844594536, 1199122922, 634219279, 942501101, 67161343, 969944293); + bool3x2 r1 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + int a2 = (833229499); + int3x2 b2 = int3x2(1304301133, 704045745, 345012334, 1253134152, 325772538, 855127202); + bool3x2 r2 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + int a3 = (793668881); + int3x2 b3 = int3x2(1584481616, 1101301152, 276853534, 987168816, 1258105989, 362645228); + bool3x2 r3 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void int3x2_operator_less_wide_wide() + { + int3x2 a0 = int3x2(1486550609, 1779244308, 1602148045, 1614085440, 1975613414, 942838342); + int3x2 b0 = int3x2(97842578, 536551311, 413528975, 1838293684, 1283898480, 1456599961); + bool3x2 r0 = bool3x2(false, false, false, true, false, true); + TestUtils.AreEqual(r0, a0 < b0); + + int3x2 a1 = int3x2(1092279031, 373677431, 1419098312, 337757077, 1081797900, 1336745069); + int3x2 b1 = int3x2(1080278602, 529676676, 156584048, 117348799, 246927124, 1916615924); + bool3x2 r1 = bool3x2(false, true, false, false, false, true); + TestUtils.AreEqual(r1, a1 < b1); + + int3x2 a2 = int3x2(840685445, 1220554047, 2013681746, 192965012, 532043965, 1000693402); + int3x2 b2 = int3x2(1731071394, 1328098431, 1014995792, 480319327, 1765937053, 1333997067); + bool3x2 r2 = bool3x2(true, true, false, true, true, true); + TestUtils.AreEqual(r2, a2 < b2); + + int3x2 a3 = int3x2(927236048, 1215860000, 780607596, 1882056852, 1354146545, 2135295778); + int3x2 b3 = int3x2(688515308, 1856106947, 1303906227, 646821776, 1169473993, 316770064); + bool3x2 r3 = bool3x2(false, true, true, false, false, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void int3x2_operator_less_wide_scalar() + { + int3x2 a0 = int3x2(796797557, 670113454, 933579492, 278884514, 318174822, 1117630673); + int b0 = (746564682); + bool3x2 r0 = bool3x2(false, true, false, true, true, false); + TestUtils.AreEqual(r0, a0 < b0); + + int3x2 a1 = int3x2(741886928, 1030849597, 1546212312, 1718582899, 1648393417, 1857132231); + int b1 = (1990922600); + bool3x2 r1 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 < b1); + + int3x2 a2 = int3x2(1909506562, 952084157, 1303736668, 845460171, 979430272, 1368236640); + int b2 = (1294006045); + bool3x2 r2 = bool3x2(false, true, false, true, true, false); + TestUtils.AreEqual(r2, a2 < b2); + + int3x2 a3 = int3x2(24980695, 659552739, 1058492383, 165694933, 1204097259, 922212691); + int b3 = (1434668705); + bool3x2 r3 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void int3x2_operator_less_scalar_wide() + { + int a0 = (186400299); + int3x2 b0 = int3x2(1881344229, 813834467, 1254886626, 1353590345, 1412343685, 1555571443); + bool3x2 r0 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 < b0); + + int a1 = (1540508298); + int3x2 b1 = int3x2(1735458634, 135888070, 1643818742, 248291654, 1739560105, 728539891); + bool3x2 r1 = bool3x2(true, false, true, false, true, false); + TestUtils.AreEqual(r1, a1 < b1); + + int a2 = (480507742); + int3x2 b2 = int3x2(1696553040, 540223931, 1840493353, 146833656, 798115946, 2002002066); + bool3x2 r2 = bool3x2(true, true, true, false, true, true); + TestUtils.AreEqual(r2, a2 < b2); + + int a3 = (1011261705); + int3x2 b3 = int3x2(783550942, 1093071215, 598253401, 1432416562, 1863582169, 103622950); + bool3x2 r3 = bool3x2(false, true, false, true, true, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void int3x2_operator_greater_wide_wide() + { + int3x2 a0 = int3x2(2087717754, 1725569452, 1298066182, 1693943616, 1319019629, 70674491); + int3x2 b0 = int3x2(85148514, 293632137, 1151128249, 409440398, 1115020183, 1508500597); + bool3x2 r0 = bool3x2(true, true, true, true, true, false); + TestUtils.AreEqual(r0, a0 > b0); + + int3x2 a1 = int3x2(1042499725, 1002821508, 1021857133, 1744374599, 821751047, 467646903); + int3x2 b1 = int3x2(1834583302, 1755218534, 1788761753, 1128238489, 834223713, 1578743290); + bool3x2 r1 = bool3x2(false, false, false, true, false, false); + TestUtils.AreEqual(r1, a1 > b1); + + int3x2 a2 = int3x2(2029731638, 1377214212, 1207816926, 474621063, 20781266, 366593779); + int3x2 b2 = int3x2(1647150256, 1756397855, 1131080201, 1208965204, 1495161099, 1283714281); + bool3x2 r2 = bool3x2(true, false, true, false, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + int3x2 a3 = int3x2(2068457387, 10181449, 793634464, 144474612, 99947390, 930377263); + int3x2 b3 = int3x2(908051907, 412849651, 815822687, 730271942, 40756039, 883326140); + bool3x2 r3 = bool3x2(true, false, false, false, true, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void int3x2_operator_greater_wide_scalar() + { + int3x2 a0 = int3x2(1208626274, 239697208, 1979453345, 1253474001, 1590192876, 1487911635); + int b0 = (1715176566); + bool3x2 r0 = bool3x2(false, false, true, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + int3x2 a1 = int3x2(1673945595, 222749855, 1433540517, 566635217, 1773305960, 1850273578); + int b1 = (1662650098); + bool3x2 r1 = bool3x2(true, false, false, false, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + int3x2 a2 = int3x2(206147145, 333381537, 1905567362, 2053577491, 570397194, 2128431130); + int b2 = (325913453); + bool3x2 r2 = bool3x2(false, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 > b2); + + int3x2 a3 = int3x2(1735325311, 1663525234, 1972984241, 1587865063, 488268523, 121921923); + int b3 = (529971908); + bool3x2 r3 = bool3x2(true, true, true, true, false, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void int3x2_operator_greater_scalar_wide() + { + int a0 = (480938827); + int3x2 b0 = int3x2(1824731899, 921496110, 586859044, 946430596, 1231356727, 1390167458); + bool3x2 r0 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + int a1 = (1785807092); + int3x2 b1 = int3x2(28949024, 2037899283, 595656760, 1778095771, 1233500439, 1696302238); + bool3x2 r1 = bool3x2(true, false, true, true, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + int a2 = (1445965340); + int3x2 b2 = int3x2(484020151, 1586962841, 1361740714, 265628948, 2003122957, 332267433); + bool3x2 r2 = bool3x2(true, false, true, true, false, true); + TestUtils.AreEqual(r2, a2 > b2); + + int a3 = (1128353075); + int3x2 b3 = int3x2(377919478, 982113135, 1117675960, 630865591, 1550679736, 895945757); + bool3x2 r3 = bool3x2(true, true, true, true, false, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void int3x2_operator_less_equal_wide_wide() + { + int3x2 a0 = int3x2(154092149, 1515170149, 1083970332, 785807178, 1401094881, 310537627); + int3x2 b0 = int3x2(77984380, 1712054191, 1566203809, 254834519, 450519938, 389457083); + bool3x2 r0 = bool3x2(false, true, true, false, false, true); + TestUtils.AreEqual(r0, a0 <= b0); + + int3x2 a1 = int3x2(868328962, 1990816725, 2035349541, 457043352, 1123282035, 1001842946); + int3x2 b1 = int3x2(1298669505, 207343167, 1214449047, 2059561026, 896534357, 1897470050); + bool3x2 r1 = bool3x2(true, false, false, true, false, true); + TestUtils.AreEqual(r1, a1 <= b1); + + int3x2 a2 = int3x2(1387761992, 195272789, 659549000, 888761458, 283706617, 1790185840); + int3x2 b2 = int3x2(521075677, 1848221945, 374708019, 1573731118, 2093466449, 1660210829); + bool3x2 r2 = bool3x2(false, true, false, true, true, false); + TestUtils.AreEqual(r2, a2 <= b2); + + int3x2 a3 = int3x2(899029812, 848317418, 1743712447, 1504407474, 1798441490, 1902791952); + int3x2 b3 = int3x2(1568778785, 1352157589, 1212771905, 1457525058, 1493446008, 1784768208); + bool3x2 r3 = bool3x2(true, true, false, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void int3x2_operator_less_equal_wide_scalar() + { + int3x2 a0 = int3x2(1479531977, 1427983411, 415250630, 1245345407, 1112546666, 1072990632); + int b0 = (2004563877); + bool3x2 r0 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + int3x2 a1 = int3x2(1579912858, 1070894375, 509818792, 1910488590, 85452501, 518127023); + int b1 = (101048307); + bool3x2 r1 = bool3x2(false, false, false, false, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + int3x2 a2 = int3x2(1246249980, 1964410699, 1968139888, 1191853379, 662096238, 1140643434); + int b2 = (1097326500); + bool3x2 r2 = bool3x2(false, false, false, false, true, false); + TestUtils.AreEqual(r2, a2 <= b2); + + int3x2 a3 = int3x2(754434551, 995927387, 974873240, 1773400038, 497436329, 1825940497); + int b3 = (155343473); + bool3x2 r3 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void int3x2_operator_less_equal_scalar_wide() + { + int a0 = (1899193992); + int3x2 b0 = int3x2(915011820, 980913757, 1337699683, 1476321359, 1102143668, 660493983); + bool3x2 r0 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 <= b0); + + int a1 = (184664508); + int3x2 b1 = int3x2(381579707, 1954892821, 1295090571, 1440368586, 1696003686, 88708652); + bool3x2 r1 = bool3x2(true, true, true, true, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + int a2 = (1332251857); + int3x2 b2 = int3x2(1310713644, 2112132784, 48951945, 1888568027, 39340955, 1108242207); + bool3x2 r2 = bool3x2(false, true, false, true, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + int a3 = (260777425); + int3x2 b3 = int3x2(593122164, 291471959, 253457314, 1264570386, 699618012, 927735863); + bool3x2 r3 = bool3x2(true, true, false, true, true, true); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void int3x2_operator_greater_equal_wide_wide() + { + int3x2 a0 = int3x2(8538378, 2131749726, 265427108, 523609761, 994991818, 839709564); + int3x2 b0 = int3x2(903145828, 1697992986, 1432491982, 169789504, 1059357300, 1744255222); + bool3x2 r0 = bool3x2(false, true, false, true, false, false); + TestUtils.AreEqual(r0, a0 >= b0); + + int3x2 a1 = int3x2(101288202, 1886280970, 2032074826, 631221455, 1456286159, 961342752); + int3x2 b1 = int3x2(1606584463, 1905414425, 1448794969, 136181998, 1678754836, 2069656857); + bool3x2 r1 = bool3x2(false, false, true, true, false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + int3x2 a2 = int3x2(424526026, 788481984, 1662488497, 870326690, 708712581, 1260182701); + int3x2 b2 = int3x2(398982689, 243317404, 740939613, 1894753119, 301760792, 1260647988); + bool3x2 r2 = bool3x2(true, true, true, false, true, false); + TestUtils.AreEqual(r2, a2 >= b2); + + int3x2 a3 = int3x2(1165630721, 138247561, 1108650168, 1933222913, 672493999, 1541402159); + int3x2 b3 = int3x2(3608523, 52576030, 903420465, 1648820371, 627296845, 1679808907); + bool3x2 r3 = bool3x2(true, true, true, true, true, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void int3x2_operator_greater_equal_wide_scalar() + { + int3x2 a0 = int3x2(2049236663, 182691143, 634973382, 1197012109, 439837565, 1367606469); + int b0 = (1061998015); + bool3x2 r0 = bool3x2(true, false, false, true, false, true); + TestUtils.AreEqual(r0, a0 >= b0); + + int3x2 a1 = int3x2(1108037359, 1898505669, 411667685, 1998610091, 4652390, 996159180); + int b1 = (351147187); + bool3x2 r1 = bool3x2(true, true, true, true, false, true); + TestUtils.AreEqual(r1, a1 >= b1); + + int3x2 a2 = int3x2(2111455181, 96217144, 814085575, 1525995206, 1293933760, 1732973229); + int b2 = (727766399); + bool3x2 r2 = bool3x2(true, false, true, true, true, true); + TestUtils.AreEqual(r2, a2 >= b2); + + int3x2 a3 = int3x2(1473283041, 1023753195, 1373738074, 518164359, 717850464, 1765188600); + int b3 = (899444524); + bool3x2 r3 = bool3x2(true, true, true, false, false, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void int3x2_operator_greater_equal_scalar_wide() + { + int a0 = (1859811087); + int3x2 b0 = int3x2(1070365918, 1783869452, 830091760, 377157428, 327199016, 90384229); + bool3x2 r0 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + int a1 = (1154649706); + int3x2 b1 = int3x2(376758501, 1079802834, 2054742898, 1328349472, 434061447, 951207723); + bool3x2 r1 = bool3x2(true, true, false, false, true, true); + TestUtils.AreEqual(r1, a1 >= b1); + + int a2 = (598695892); + int3x2 b2 = int3x2(975131651, 1714007943, 177416473, 1267232721, 31082860, 216791741); + bool3x2 r2 = bool3x2(false, false, true, false, true, true); + TestUtils.AreEqual(r2, a2 >= b2); + + int a3 = (119054289); + int3x2 b3 = int3x2(1905107583, 89559116, 55041824, 691334141, 462326883, 1658303669); + bool3x2 r3 = bool3x2(false, true, true, false, false, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void int3x2_operator_add_wide_wide() + { + int3x2 a0 = int3x2(2135171378, 21433296, 1954723494, 683604307, 1054212315, 1762680995); + int3x2 b0 = int3x2(1013431952, 366718162, 359290756, 1393163294, 1962236872, 1263270041); + int3x2 r0 = int3x2(-1146363966, 388151458, -1980953046, 2076767601, -1278518109, -1269016260); + TestUtils.AreEqual(r0, a0 + b0); + + int3x2 a1 = int3x2(1963655852, 1257853062, 2043493600, 976898058, 1915056423, 121374462); + int3x2 b1 = int3x2(1862666629, 1077447887, 821693806, 487316539, 350922520, 1583012528); + int3x2 r1 = int3x2(-468644815, -1959666347, -1429779890, 1464214597, -2028988353, 1704386990); + TestUtils.AreEqual(r1, a1 + b1); + + int3x2 a2 = int3x2(1218855698, 700538222, 1702057277, 1788251699, 1534939160, 398651016); + int3x2 b2 = int3x2(1951595076, 1024851344, 874302782, 1383969588, 1767968088, 900721406); + int3x2 r2 = int3x2(-1124516522, 1725389566, -1718607237, -1122746009, -992060048, 1299372422); + TestUtils.AreEqual(r2, a2 + b2); + + int3x2 a3 = int3x2(1674272498, 374510467, 824322986, 1217622199, 1122376670, 642613771); + int3x2 b3 = int3x2(1659790033, 1792273749, 443844328, 633981449, 2010244807, 335566991); + int3x2 r3 = int3x2(-960904765, -2128183080, 1268167314, 1851603648, -1162345819, 978180762); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void int3x2_operator_add_wide_scalar() + { + int3x2 a0 = int3x2(665815972, 1783729250, 1591678394, 1284528538, 977850224, 71069732); + int b0 = (1334043849); + int3x2 r0 = int3x2(1999859821, -1177194197, -1369245053, -1676394909, -1983073223, 1405113581); + TestUtils.AreEqual(r0, a0 + b0); + + int3x2 a1 = int3x2(1138577680, 565982008, 1246759684, 1088001167, 57252642, 678921480); + int b1 = (1200356017); + int3x2 r1 = int3x2(-1956033599, 1766338025, -1847851595, -2006610112, 1257608659, 1879277497); + TestUtils.AreEqual(r1, a1 + b1); + + int3x2 a2 = int3x2(625943813, 1470648741, 1490096953, 1467033531, 182608093, 1707296407); + int b2 = (512157429); + int3x2 r2 = int3x2(1138101242, 1982806170, 2002254382, 1979190960, 694765522, -2075513460); + TestUtils.AreEqual(r2, a2 + b2); + + int3x2 a3 = int3x2(1703724354, 653973063, 1139546735, 1834005844, 184572739, 1980578280); + int b3 = (1333833947); + int3x2 r3 = int3x2(-1257408995, 1987807010, -1821586614, -1127127505, 1518406686, -980555069); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void int3x2_operator_add_scalar_wide() + { + int a0 = (359966320); + int3x2 b0 = int3x2(2146146202, 767103309, 851002415, 311531406, 1491262941, 1016891373); + int3x2 r0 = int3x2(-1788854774, 1127069629, 1210968735, 671497726, 1851229261, 1376857693); + TestUtils.AreEqual(r0, a0 + b0); + + int a1 = (1954228994); + int3x2 b1 = int3x2(1671335850, 727870747, 551151834, 1390261152, 1699060326, 115021619); + int3x2 r1 = int3x2(-669402452, -1612867555, -1789586468, -950477150, -641677976, 2069250613); + TestUtils.AreEqual(r1, a1 + b1); + + int a2 = (1964440175); + int3x2 b2 = int3x2(440700758, 1556692550, 185414255, 933106731, 1217866784, 729761881); + int3x2 r2 = int3x2(-1889826363, -773834571, -2145112866, -1397420390, -1112660337, -1600765240); + TestUtils.AreEqual(r2, a2 + b2); + + int a3 = (1742597318); + int3x2 b3 = int3x2(1090109152, 1467373815, 1066072609, 138237856, 634834665, 993603553); + int3x2 r3 = int3x2(-1462260826, -1084996163, -1486297369, 1880835174, -1917535313, -1558766425); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void int3x2_operator_sub_wide_wide() + { + int3x2 a0 = int3x2(1410318491, 1097280168, 1827039044, 28881338, 328720965, 875487868); + int3x2 b0 = int3x2(1315897366, 799052018, 1580289673, 1094686261, 1954325726, 1197734816); + int3x2 r0 = int3x2(94421125, 298228150, 246749371, -1065804923, -1625604761, -322246948); + TestUtils.AreEqual(r0, a0 - b0); + + int3x2 a1 = int3x2(212936325, 231977215, 1740021315, 2011295463, 48079003, 591379285); + int3x2 b1 = int3x2(229886366, 915679176, 1746884850, 918743925, 1007797419, 257421324); + int3x2 r1 = int3x2(-16950041, -683701961, -6863535, 1092551538, -959718416, 333957961); + TestUtils.AreEqual(r1, a1 - b1); + + int3x2 a2 = int3x2(1125909359, 1842588095, 848561896, 614448464, 2067598029, 1618238416); + int3x2 b2 = int3x2(287249342, 1617287463, 1653916102, 123586847, 502107404, 672875302); + int3x2 r2 = int3x2(838660017, 225300632, -805354206, 490861617, 1565490625, 945363114); + TestUtils.AreEqual(r2, a2 - b2); + + int3x2 a3 = int3x2(318516219, 1090119767, 1991095823, 949592162, 1951912339, 1457818751); + int3x2 b3 = int3x2(1256481116, 1975569142, 1794443030, 1327558915, 330955394, 1596041731); + int3x2 r3 = int3x2(-937964897, -885449375, 196652793, -377966753, 1620956945, -138222980); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void int3x2_operator_sub_wide_scalar() + { + int3x2 a0 = int3x2(1508669340, 1594795463, 266707545, 643102647, 287705008, 1475644328); + int b0 = (998008471); + int3x2 r0 = int3x2(510660869, 596786992, -731300926, -354905824, -710303463, 477635857); + TestUtils.AreEqual(r0, a0 - b0); + + int3x2 a1 = int3x2(1113286221, 2082174113, 1108005498, 304369206, 999244508, 1806482044); + int b1 = (979450511); + int3x2 r1 = int3x2(133835710, 1102723602, 128554987, -675081305, 19793997, 827031533); + TestUtils.AreEqual(r1, a1 - b1); + + int3x2 a2 = int3x2(1994553647, 1482736902, 266654115, 1470212363, 1190349300, 958542155); + int b2 = (2101812429); + int3x2 r2 = int3x2(-107258782, -619075527, -1835158314, -631600066, -911463129, -1143270274); + TestUtils.AreEqual(r2, a2 - b2); + + int3x2 a3 = int3x2(1185075537, 499527536, 1612473406, 1696960099, 1287292743, 1360229454); + int b3 = (1738124835); + int3x2 r3 = int3x2(-553049298, -1238597299, -125651429, -41164736, -450832092, -377895381); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void int3x2_operator_sub_scalar_wide() + { + int a0 = (893369501); + int3x2 b0 = int3x2(2051906184, 1699714311, 442603706, 1735141684, 274533585, 811580259); + int3x2 r0 = int3x2(-1158536683, -806344810, 450765795, -841772183, 618835916, 81789242); + TestUtils.AreEqual(r0, a0 - b0); + + int a1 = (1196354320); + int3x2 b1 = int3x2(1524097023, 533621527, 2080845793, 143958837, 1620668660, 1135989346); + int3x2 r1 = int3x2(-327742703, 662732793, -884491473, 1052395483, -424314340, 60364974); + TestUtils.AreEqual(r1, a1 - b1); + + int a2 = (1367044745); + int3x2 b2 = int3x2(554088609, 552670373, 1265516124, 1254902543, 1857695581, 1619865274); + int3x2 r2 = int3x2(812956136, 814374372, 101528621, 112142202, -490650836, -252820529); + TestUtils.AreEqual(r2, a2 - b2); + + int a3 = (1313559400); + int3x2 b3 = int3x2(99812999, 843597298, 420111239, 1299949060, 531009038, 1103306550); + int3x2 r3 = int3x2(1213746401, 469962102, 893448161, 13610340, 782550362, 210252850); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void int3x2_operator_mul_wide_wide() + { + int3x2 a0 = int3x2(61417577, 219585476, 1362520891, 1511084277, 1481211272, 58211871); + int3x2 b0 = int3x2(578042444, 1620527213, 200516468, 309339115, 542853019, 299467282); + int3x2 r0 = int3x2(-1426863828, 1326150260, -990894148, -1322856473, 1973926232, 88546350); + TestUtils.AreEqual(r0, a0 * b0); + + int3x2 a1 = int3x2(1459591173, 567624644, 1169935583, 1835691886, 385626539, 85934842); + int3x2 b1 = int3x2(1479641221, 1428338601, 1497302909, 1596889147, 427413842, 265122693); + int3x2 r1 = int3x2(-863919463, -582821788, 556671459, 1098186330, 1848083398, -58320414); + TestUtils.AreEqual(r1, a1 * b1); + + int3x2 a2 = int3x2(522856538, 278370196, 289217012, 2083410174, 1293162798, 1939730122); + int3x2 b2 = int3x2(689376654, 1120457204, 516903000, 873091659, 1353196495, 1384773500); + int3x2 r2 = int3x2(2005201900, 651971856, -1721160736, -110160278, -119429582, -536965160); + TestUtils.AreEqual(r2, a2 * b2); + + int3x2 a3 = int3x2(2075923048, 1116477212, 1686101741, 783310758, 248585944, 1093377716); + int3x2 b3 = int3x2(1596528529, 2122329305, 1033200564, 996795088, 1137754930, 232014195); + int3x2 r3 = int3x2(-2049587992, -759667012, 1443849636, 550781664, -959017424, -353108260); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void int3x2_operator_mul_wide_scalar() + { + int3x2 a0 = int3x2(871746615, 492532311, 570557670, 2142306629, 1610315153, 1526163563); + int b0 = (442064533); + int3x2 r0 = int3x2(338365955, 1081376419, -1729147426, -1015409879, -873485467, -175501241); + TestUtils.AreEqual(r0, a0 * b0); + + int3x2 a1 = int3x2(118471734, 364291059, 1186560810, 1584938026, 1357601203, 638897141); + int b1 = (257439514); + int3x2 r1 = int3x2(-174540932, 172874670, -725841852, -1852628412, 448041262, -853124638); + TestUtils.AreEqual(r1, a1 * b1); + + int3x2 a2 = int3x2(268562104, 1163240135, 1619806399, 1444659979, 1127580168, 464517916); + int b2 = (1007838321); + int3x2 r2 = int3x2(-1156956360, 610309591, 1271183439, 624387035, -1778809464, 784123740); + TestUtils.AreEqual(r2, a2 * b2); + + int3x2 a3 = int3x2(1508043166, 636691139, 1851670006, 357357967, 1095280227, 702779195); + int b3 = (745488654); + int3x2 r3 = int3x2(-79960924, 1705798058, 478992756, -1770900270, 757415018, 1348784186); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void int3x2_operator_mul_scalar_wide() + { + int a0 = (1152242766); + int3x2 b0 = int3x2(1276636134, 2105929407, 499007702, 124002565, 1956335172, 1288034953); + int3x2 r0 = int3x2(-2129504236, 999811634, 1179056436, -801426554, 404105400, 1339492798); + TestUtils.AreEqual(r0, a0 * b0); + + int a1 = (832676555); + int3x2 b1 = int3x2(337389733, 99268757, 2005055247, 2011389505, 1348110859, 399689191); + int3x2 r1 = int3x2(-388913961, -727472089, 2079172325, -1429086325, -284070727, -223994835); + TestUtils.AreEqual(r1, a1 * b1); + + int a2 = (2007606374); + int3x2 b2 = int3x2(2076691289, 1825721194, 769885235, 153314735, 1066325369, 84289667); + int3x2 r2 = int3x2(-324990602, 588510268, 67262546, -893018182, -7630282, -1780281294); + TestUtils.AreEqual(r2, a2 * b2); + + int a3 = (984486192); + int3x2 b3 = int3x2(1325213504, 1643957457, 1576395620, 2095980601, 907671947, 836919582); + int3x2 r3 = int3x2(-862807040, -1190246352, 673990336, 227005360, -118815472, 826880928); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void int3x2_operator_div_wide_wide() + { + int3x2 a0 = int3x2(333171510, 858154903, 1181365836, 671357749, 1090606752, 803759420); + int3x2 b0 = int3x2(698897823, 440199998, 655557473, 1658534285, 2127220100, 315653188); + int3x2 r0 = int3x2(0, 1, 1, 0, 0, 2); + TestUtils.AreEqual(r0, a0 / b0); + + int3x2 a1 = int3x2(788404166, 296807814, 575260195, 166625280, 1493729000, 1831739736); + int3x2 b1 = int3x2(1814290360, 992173243, 914851653, 664340325, 224323977, 246981573); + int3x2 r1 = int3x2(0, 0, 0, 0, 6, 7); + TestUtils.AreEqual(r1, a1 / b1); + + int3x2 a2 = int3x2(200852358, 129983172, 500176108, 472051781, 414699094, 1446535974); + int3x2 b2 = int3x2(285573983, 819471609, 2012476015, 1783179572, 223253978, 169515029); + int3x2 r2 = int3x2(0, 0, 0, 0, 1, 8); + TestUtils.AreEqual(r2, a2 / b2); + + int3x2 a3 = int3x2(1278480457, 930910505, 263295881, 1626759436, 450830871, 21439121); + int3x2 b3 = int3x2(1694929006, 1992168131, 1155972447, 1768506696, 422325410, 1508417406); + int3x2 r3 = int3x2(0, 0, 0, 0, 1, 0); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void int3x2_operator_div_wide_scalar() + { + int3x2 a0 = int3x2(1433072926, 1073958635, 1195142312, 536596719, 1274375693, 464756346); + int b0 = (1434025872); + int3x2 r0 = int3x2(0, 0, 0, 0, 0, 0); + TestUtils.AreEqual(r0, a0 / b0); + + int3x2 a1 = int3x2(806462546, 1380905136, 25493909, 1196815948, 123300377, 643754735); + int b1 = (906504670); + int3x2 r1 = int3x2(0, 1, 0, 1, 0, 0); + TestUtils.AreEqual(r1, a1 / b1); + + int3x2 a2 = int3x2(2084019932, 458304263, 741331531, 466443901, 2110004616, 1500687214); + int b2 = (2047825037); + int3x2 r2 = int3x2(1, 0, 0, 0, 1, 0); + TestUtils.AreEqual(r2, a2 / b2); + + int3x2 a3 = int3x2(1453264263, 2040203220, 2103351724, 485536709, 402141749, 1477264254); + int b3 = (1617154145); + int3x2 r3 = int3x2(0, 1, 1, 0, 0, 0); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void int3x2_operator_div_scalar_wide() + { + int a0 = (519165704); + int3x2 b0 = int3x2(1295178177, 775214121, 467772046, 1156881598, 310396565, 759759959); + int3x2 r0 = int3x2(0, 0, 1, 0, 1, 0); + TestUtils.AreEqual(r0, a0 / b0); + + int a1 = (243837702); + int3x2 b1 = int3x2(1616314235, 1053470225, 1320630160, 378773841, 4223608, 1971105754); + int3x2 r1 = int3x2(0, 0, 0, 0, 57, 0); + TestUtils.AreEqual(r1, a1 / b1); + + int a2 = (2054406020); + int3x2 b2 = int3x2(219939614, 1603672651, 2006134295, 888535397, 1493077923, 615835131); + int3x2 r2 = int3x2(9, 1, 1, 2, 1, 3); + TestUtils.AreEqual(r2, a2 / b2); + + int a3 = (1045603945); + int3x2 b3 = int3x2(452709946, 1074919059, 467037221, 1485241506, 1775728786, 481521341); + int3x2 r3 = int3x2(2, 0, 2, 0, 0, 2); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void int3x2_operator_mod_wide_wide() + { + int3x2 a0 = int3x2(258342924, 1454754891, 723352342, 1981431473, 531756042, 716993627); + int3x2 b0 = int3x2(1990080167, 1197348066, 651970512, 1659454050, 241005212, 1866255454); + int3x2 r0 = int3x2(258342924, 257406825, 71381830, 321977423, 49745618, 716993627); + TestUtils.AreEqual(r0, a0 % b0); + + int3x2 a1 = int3x2(1667903349, 1331097004, 1776856101, 17598216, 1474345080, 1681376293); + int3x2 b1 = int3x2(1440101415, 595220963, 408818410, 198222574, 549504274, 239973807); + int3x2 r1 = int3x2(227801934, 140655078, 141582461, 17598216, 375336532, 1559644); + TestUtils.AreEqual(r1, a1 % b1); + + int3x2 a2 = int3x2(813624265, 1617478722, 498370451, 780075943, 1754430321, 653235398); + int3x2 b2 = int3x2(321398087, 658171840, 1511495237, 1048325585, 1126739824, 666641241); + int3x2 r2 = int3x2(170828091, 301135042, 498370451, 780075943, 627690497, 653235398); + TestUtils.AreEqual(r2, a2 % b2); + + int3x2 a3 = int3x2(1517128354, 966216200, 590067427, 1283434795, 1910903650, 1125967790); + int3x2 b3 = int3x2(38017598, 418797691, 618700513, 1941062990, 158556432, 1081063558); + int3x2 r3 = int3x2(34442032, 128620818, 590067427, 1283434795, 8226466, 44904232); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void int3x2_operator_mod_wide_scalar() + { + int3x2 a0 = int3x2(560988938, 629524514, 767711194, 434281967, 1399805893, 792916846); + int b0 = (1156862367); + int3x2 r0 = int3x2(560988938, 629524514, 767711194, 434281967, 242943526, 792916846); + TestUtils.AreEqual(r0, a0 % b0); + + int3x2 a1 = int3x2(1663690927, 1776636144, 1287035793, 1743722161, 475209785, 327476870); + int b1 = (598661916); + int3x2 r1 = int3x2(466367095, 579312312, 89711961, 546398329, 475209785, 327476870); + TestUtils.AreEqual(r1, a1 % b1); + + int3x2 a2 = int3x2(1617696916, 477430114, 858399046, 712734431, 1506629323, 199829950); + int b2 = (379853074); + int3x2 r2 = int3x2(98284620, 97577040, 98692898, 332881357, 367070101, 199829950); + TestUtils.AreEqual(r2, a2 % b2); + + int3x2 a3 = int3x2(362269020, 1351725413, 1549678101, 431765276, 1315833792, 1664893153); + int b3 = (1986626876); + int3x2 r3 = int3x2(362269020, 1351725413, 1549678101, 431765276, 1315833792, 1664893153); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void int3x2_operator_mod_scalar_wide() + { + int a0 = (933347930); + int3x2 b0 = int3x2(549923387, 243114953, 1884274390, 1428033594, 655531454, 1622674954); + int3x2 r0 = int3x2(383424543, 204003071, 933347930, 933347930, 277816476, 933347930); + TestUtils.AreEqual(r0, a0 % b0); + + int a1 = (1107563514); + int3x2 b1 = int3x2(1614111094, 914801920, 1432263179, 564431096, 1967013901, 1709750152); + int3x2 r1 = int3x2(1107563514, 192761594, 1107563514, 543132418, 1107563514, 1107563514); + TestUtils.AreEqual(r1, a1 % b1); + + int a2 = (1080102613); + int3x2 b2 = int3x2(13120773, 2042535998, 1505698002, 1640058084, 974167554, 758635306); + int3x2 r2 = int3x2(4199227, 1080102613, 1080102613, 1080102613, 105935059, 321467307); + TestUtils.AreEqual(r2, a2 % b2); + + int a3 = (1387264978); + int3x2 b3 = int3x2(611743343, 1139002766, 1913935748, 1086810076, 991846486, 922870408); + int3x2 r3 = int3x2(163778292, 248262212, 1387264978, 300454902, 395418492, 464394570); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void int3x2_operator_plus() + { + int3x2 a0 = int3x2(195392567, 222719748, 1002351013, 1570765263, 109389333, 1515950277); + int3x2 r0 = int3x2(195392567, 222719748, 1002351013, 1570765263, 109389333, 1515950277); + TestUtils.AreEqual(r0, +a0); + + int3x2 a1 = int3x2(1689763402, 264115671, 1084131995, 195779102, 2131702223, 715660442); + int3x2 r1 = int3x2(1689763402, 264115671, 1084131995, 195779102, 2131702223, 715660442); + TestUtils.AreEqual(r1, +a1); + + int3x2 a2 = int3x2(1995564647, 1317851903, 1957501908, 531426536, 2012985092, 1334133318); + int3x2 r2 = int3x2(1995564647, 1317851903, 1957501908, 531426536, 2012985092, 1334133318); + TestUtils.AreEqual(r2, +a2); + + int3x2 a3 = int3x2(1539671418, 1575048895, 2119066258, 781435471, 1659000230, 1301861249); + int3x2 r3 = int3x2(1539671418, 1575048895, 2119066258, 781435471, 1659000230, 1301861249); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void int3x2_operator_neg() + { + int3x2 a0 = int3x2(1385088677, 94114564, 1350664872, 1458616659, 2067164853, 218122493); + int3x2 r0 = int3x2(-1385088677, -94114564, -1350664872, -1458616659, -2067164853, -218122493); + TestUtils.AreEqual(r0, -a0); + + int3x2 a1 = int3x2(958484951, 446497525, 270503114, 1928771252, 1427605822, 2051940607); + int3x2 r1 = int3x2(-958484951, -446497525, -270503114, -1928771252, -1427605822, -2051940607); + TestUtils.AreEqual(r1, -a1); + + int3x2 a2 = int3x2(1434247484, 908365416, 1742096480, 990033169, 1368056141, 1350976157); + int3x2 r2 = int3x2(-1434247484, -908365416, -1742096480, -990033169, -1368056141, -1350976157); + TestUtils.AreEqual(r2, -a2); + + int3x2 a3 = int3x2(12802586, 576597401, 785136322, 559205611, 1959833280, 162379661); + int3x2 r3 = int3x2(-12802586, -576597401, -785136322, -559205611, -1959833280, -162379661); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void int3x2_operator_prefix_inc() + { + int3x2 a0 = int3x2(780471723, 954741756, 272723451, 2142862245, 606294309, 1514814550); + int3x2 r0 = int3x2(780471724, 954741757, 272723452, 2142862246, 606294310, 1514814551); + TestUtils.AreEqual(r0, ++a0); + + int3x2 a1 = int3x2(250124151, 1833356994, 1915989169, 1348278302, 129540735, 1584496757); + int3x2 r1 = int3x2(250124152, 1833356995, 1915989170, 1348278303, 129540736, 1584496758); + TestUtils.AreEqual(r1, ++a1); + + int3x2 a2 = int3x2(1170613526, 1701179230, 1397451003, 483952900, 1494652811, 1268688387); + int3x2 r2 = int3x2(1170613527, 1701179231, 1397451004, 483952901, 1494652812, 1268688388); + TestUtils.AreEqual(r2, ++a2); + + int3x2 a3 = int3x2(2014528731, 1112537171, 621362788, 2063486914, 1612870531, 1161037742); + int3x2 r3 = int3x2(2014528732, 1112537172, 621362789, 2063486915, 1612870532, 1161037743); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void int3x2_operator_postfix_inc() + { + int3x2 a0 = int3x2(241865086, 2145821641, 1596166022, 803592338, 529551271, 1656767229); + int3x2 r0 = int3x2(241865086, 2145821641, 1596166022, 803592338, 529551271, 1656767229); + TestUtils.AreEqual(r0, a0++); + + int3x2 a1 = int3x2(903047443, 1425753247, 1384002775, 389844650, 1159795446, 1343289659); + int3x2 r1 = int3x2(903047443, 1425753247, 1384002775, 389844650, 1159795446, 1343289659); + TestUtils.AreEqual(r1, a1++); + + int3x2 a2 = int3x2(1227160199, 137930180, 451018043, 1634297552, 2009552507, 1176922170); + int3x2 r2 = int3x2(1227160199, 137930180, 451018043, 1634297552, 2009552507, 1176922170); + TestUtils.AreEqual(r2, a2++); + + int3x2 a3 = int3x2(388721494, 2062858295, 715101397, 1725384327, 446867079, 2101314783); + int3x2 r3 = int3x2(388721494, 2062858295, 715101397, 1725384327, 446867079, 2101314783); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void int3x2_operator_prefix_dec() + { + int3x2 a0 = int3x2(1331961415, 1612382200, 1401591249, 2042075388, 1757136546, 1895858159); + int3x2 r0 = int3x2(1331961414, 1612382199, 1401591248, 2042075387, 1757136545, 1895858158); + TestUtils.AreEqual(r0, --a0); + + int3x2 a1 = int3x2(1467742422, 1336115745, 2059077641, 1169239112, 1862369220, 312317355); + int3x2 r1 = int3x2(1467742421, 1336115744, 2059077640, 1169239111, 1862369219, 312317354); + TestUtils.AreEqual(r1, --a1); + + int3x2 a2 = int3x2(1027543764, 1426262619, 1426620468, 674685792, 1423852012, 1459529624); + int3x2 r2 = int3x2(1027543763, 1426262618, 1426620467, 674685791, 1423852011, 1459529623); + TestUtils.AreEqual(r2, --a2); + + int3x2 a3 = int3x2(2092317419, 1261583506, 512900840, 1496855314, 777588547, 617644613); + int3x2 r3 = int3x2(2092317418, 1261583505, 512900839, 1496855313, 777588546, 617644612); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void int3x2_operator_postfix_dec() + { + int3x2 a0 = int3x2(1870005937, 1708534798, 704493460, 462940703, 2060593573, 228744869); + int3x2 r0 = int3x2(1870005937, 1708534798, 704493460, 462940703, 2060593573, 228744869); + TestUtils.AreEqual(r0, a0--); + + int3x2 a1 = int3x2(940247280, 1015253889, 862428933, 1401191870, 2080259851, 653673271); + int3x2 r1 = int3x2(940247280, 1015253889, 862428933, 1401191870, 2080259851, 653673271); + TestUtils.AreEqual(r1, a1--); + + int3x2 a2 = int3x2(140452688, 1760916301, 1174531383, 634036198, 993137684, 1669210509); + int3x2 r2 = int3x2(140452688, 1760916301, 1174531383, 634036198, 993137684, 1669210509); + TestUtils.AreEqual(r2, a2--); + + int3x2 a3 = int3x2(874927437, 471308632, 620865961, 220103745, 1407678826, 319906934); + int3x2 r3 = int3x2(874927437, 471308632, 620865961, 220103745, 1407678826, 319906934); + TestUtils.AreEqual(r3, a3--); + } + + [TestCompiler] + public static void int3x2_operator_bitwise_and_wide_wide() + { + int3x2 a0 = int3x2(1055241304, 859321394, 1088358961, 2090949513, 300561740, 651904515); + int3x2 b0 = int3x2(749698416, 748105424, 1842764797, 9990577, 1989102105, 1666634755); + int3x2 r0 = int3x2(749024336, 537928720, 1087769137, 8409473, 277479432, 575816707); + TestUtils.AreEqual(r0, a0 & b0); + + int3x2 a1 = int3x2(1331035868, 2012752753, 1298126656, 53199569, 1752363533, 1303061302); + int3x2 b1 = int3x2(58116798, 868036607, 1420638875, 1308767169, 564040763, 478617502); + int3x2 r1 = int3x2(55888540, 867707761, 1141707264, 33686209, 538087433, 209912598); + TestUtils.AreEqual(r1, a1 & b1); + + int3x2 a2 = int3x2(1929998247, 1504941434, 470682792, 713577376, 1493231658, 1340884669); + int3x2 b2 = int3x2(806150474, 674015378, 1505309955, 36064977, 1779639327, 808650076); + int3x2 r2 = int3x2(805855490, 136347666, 403178496, 33571456, 1207967754, 2098204); + TestUtils.AreEqual(r2, a2 & b2); + + int3x2 a3 = int3x2(1577921467, 44846626, 1105094388, 1143008413, 333009589, 2116296009); + int3x2 b3 = int3x2(1634437037, 1997568501, 1930853951, 1901503461, 1508772523, 2010961769); + int3x2 r3 = int3x2(1074332585, 33572896, 1091986996, 1073782917, 298320545, 1979979081); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void int3x2_operator_bitwise_and_wide_scalar() + { + int3x2 a0 = int3x2(1513158868, 284695609, 734595037, 1566510707, 1601252476, 84213838); + int b0 = (1173647397); + int3x2 r0 = int3x2(1076916228, 15732769, 29360133, 1163132961, 1164976164, 84148228); + TestUtils.AreEqual(r0, a0 & b0); + + int3x2 a1 = int3x2(314333543, 753481263, 327392481, 1619794917, 2143619546, 1873208293); + int b1 = (430856908); + int3x2 r1 = int3x2(279730244, 145232396, 293738688, 9181892, 428083400, 161891012); + TestUtils.AreEqual(r1, a1 & b1); + + int3x2 a2 = int3x2(126982769, 1383096952, 1689107088, 1368301071, 366962092, 1729929586); + int b2 = (651482651); + int3x2 r2 = int3x2(110137873, 38814232, 612667920, 8689163, 81019912, 638877714); + TestUtils.AreEqual(r2, a2 & b2); + + int3x2 a3 = int3x2(989550739, 1592791064, 2047510829, 678485991, 586400261, 771972179); + int b3 = (1914435619); + int3x2 r3 = int3x2(840652803, 1376784384, 1913292833, 537974819, 571719681, 570644483); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void int3x2_operator_bitwise_and_scalar_wide() + { + int a0 = (477163326); + int3x2 b0 = int3x2(110453385, 703240362, 2075630560, 1884904031, 1734899436, 947945203); + int3x2 r0 = int3x2(68182536, 140544042, 405834528, 273697310, 73426476, 402681394); + TestUtils.AreEqual(r0, a0 & b0); + + int a1 = (1664399051); + int3x2 b1 = int3x2(458879298, 158491426, 79772356, 2054527944, 202228212, 359225061); + int3x2 r1 = int3x2(51425346, 19931650, 12992, 1647612616, 295104, 18880193); + TestUtils.AreEqual(r1, a1 & b1); + + int a2 = (639811396); + int3x2 b2 = int3x2(1821945318, 1821303024, 2030124055, 1985961756, 579780373, 2061831301); + int3x2 r2 = int3x2(604024132, 604151872, 536886276, 637673220, 570605316, 572525572); + TestUtils.AreEqual(r2, a2 & b2); + + int a3 = (1139618293); + int3x2 b3 = int3x2(1145191868, 1121606282, 1414714065, 688688277, 1508875606, 664318814); + int3x2 r3 = int3x2(1077948852, 1120407680, 1077940433, 17563797, 1106055508, 59257172); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void int3x2_operator_bitwise_or_wide_wide() + { + int3x2 a0 = int3x2(1920951869, 1750772852, 1420019191, 732977093, 1169579447, 229437930); + int3x2 b0 = int3x2(214585254, 275414367, 858759675, 190211455, 1218691723, 2129565457); + int3x2 r0 = int3x2(2130669503, 2021326207, 2008016383, 737572863, 1303895999, 2146367483); + TestUtils.AreEqual(r0, a0 | b0); + + int3x2 a1 = int3x2(1966721348, 2039812323, 113550869, 1912038362, 1569990624, 1490718227); + int3x2 b1 = int3x2(1862809466, 495728846, 868064152, 1756913766, 933656055, 247722084); + int3x2 r1 = int3x2(2134507390, 2107455727, 939376541, 2046780414, 2142664695, 1591475831); + TestUtils.AreEqual(r1, a1 | b1); + + int3x2 a2 = int3x2(1686257697, 2137727522, 1569900650, 856504729, 2033376384, 2086259889); + int3x2 b2 = int3x2(1884195075, 1804207631, 1913174711, 1815920856, 1226577606, 1696467642); + int3x2 r2 = int3x2(1959708963, 2146117167, 2140863231, 2134768089, 2034163398, 2103430843); + TestUtils.AreEqual(r2, a2 | b2); + + int3x2 a3 = int3x2(671790684, 1189001916, 1756048437, 417084592, 2024165808, 966008272); + int3x2 b3 = int3x2(186912044, 1778908130, 1461256625, 1142152181, 272117331, 1162254035); + int3x2 r3 = int3x2(724483964, 1860172798, 2142973365, 1558183925, 2025750515, 2111217619); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void int3x2_operator_bitwise_or_wide_scalar() + { + int3x2 a0 = int3x2(1295304853, 1307252624, 350194630, 1128063578, 1774824542, 2085245467); + int b0 = (1305527136); + int3x2 r0 = int3x2(1307888629, 1308350448, 1574947814, 1341973370, 1842999166, 2111492987); + TestUtils.AreEqual(r0, a0 | b0); + + int3x2 a1 = int3x2(1988423804, 2110327307, 1050875188, 341855232, 1317039676, 228656898); + int b1 = (999162350); + int3x2 r1 = int3x2(2140074494, 2144275439, 1068439038, 1072582126, 2140041214, 1068435438); + TestUtils.AreEqual(r1, a1 | b1); + + int3x2 a2 = int3x2(41280811, 606786773, 1739461580, 2040936581, 1350320187, 1377874553); + int b2 = (1536908787); + int3x2 r2 = int3x2(1543503355, 2143018487, 2143248383, 2076147191, 1543462395, 1539047419); + TestUtils.AreEqual(r2, a2 | b2); + + int3x2 a3 = int3x2(1522262112, 1732466858, 1535976093, 375675620, 1614193383, 226059393); + int b3 = (1496806239); + int3x2 r3 = int3x2(1539306367, 2138536959, 1539273695, 1601666047, 2033710079, 1568634847); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void int3x2_operator_bitwise_or_scalar_wide() + { + int a0 = (1768627592); + int3x2 b0 = int3x2(1849658052, 1759912154, 729979455, 975926310, 1987690876, 1809506714); + int3x2 r0 = int3x2(1870634956, 1777286618, 1810603967, 2070642094, 2138824188, 1811676570); + TestUtils.AreEqual(r0, a0 | b0); + + int a1 = (1160695341); + int3x2 b1 = int3x2(408963395, 314072711, 1560007537, 1709003416, 977086639, 1448375596); + int3x2 r1 = int3x2(1567543151, 1472126639, 1577049981, 1711267517, 2134896303, 1467940653); + TestUtils.AreEqual(r1, a1 | b1); + + int a2 = (1689568808); + int3x2 b2 = int3x2(595543345, 559778387, 621080913, 438994183, 1742637145, 1219409263); + int3x2 r2 = int3x2(1744815929, 1711132283, 1706358649, 2126432047, 1744752249, 1824454511); + TestUtils.AreEqual(r2, a2 | b2); + + int a3 = (1602932494); + int3x2 b3 = int3x2(1204461702, 2111538444, 836730895, 1207638621, 802100209, 1089077339); + int3x2 r3 = int3x2(1607135118, 2145111822, 2145373967, 1610342239, 2144329727, 1609224031); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void int3x2_operator_bitwise_xor_wide_wide() + { + int3x2 a0 = int3x2(1843655608, 362425681, 640805534, 1342040268, 945678755, 980321850); + int3x2 b0 = int3x2(1422803441, 1234691140, 119589253, 1101464929, 121896337, 1880109018); + int3x2 r0 = int3x2(959296073, 1544407317, 554771227, 240840109, 1058935858, 1249815008); + TestUtils.AreEqual(r0, a0 ^ b0); + + int3x2 a1 = int3x2(390165019, 1682422658, 303897251, 230477768, 1103646442, 1503102919); + int3x2 b1 = int3x2(1000210266, 1718938232, 464406940, 884337881, 34199854, 1430659227); + int3x2 r1 = int3x2(752651585, 36917754, 162747199, 956900113, 1136760772, 215066460); + TestUtils.AreEqual(r1, a1 ^ b1); + + int3x2 a2 = int3x2(26631152, 1016475570, 1862440929, 379588576, 1943580404, 691527166); + int3x2 b2 = int3x2(126415540, 1069919967, 1810763253, 2082802224, 941097951, 27782297); + int3x2 r2 = int3x2(102672708, 55804269, 82614804, 1787102672, 1270918443, 680538471); + TestUtils.AreEqual(r2, a2 ^ b2); + + int3x2 a3 = int3x2(723280696, 497086939, 1640104913, 893178410, 1596765788, 664096470); + int3x2 b3 = int3x2(156353074, 607061607, 470737131, 1151564598, 8268481, 434405645); + int3x2 r3 = int3x2(575512842, 965736380, 2110579514, 1906288924, 1599249565, 1047646171); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void int3x2_operator_bitwise_xor_wide_scalar() + { + int3x2 a0 = int3x2(169345668, 176087064, 2084362901, 1663924004, 193851255, 517476661); + int b0 = (354464228); + int3x2 r0 = int3x2(523809632, 526275068, 1763470193, 1980614336, 514678419, 200843473); + TestUtils.AreEqual(r0, a0 ^ b0); + + int3x2 a1 = int3x2(905336222, 365003873, 835837496, 954341348, 1464576786, 625604047); + int b1 = (863800783); + int3x2 r1 = int3x2(109762641, 649922990, 44913655, 194943531, 1681336029, 372602880); + TestUtils.AreEqual(r1, a1 ^ b1); + + int3x2 a2 = int3x2(1700827127, 1481813598, 1077374714, 1043379893, 1991576049, 781860967); + int b2 = (2003392824); + int3x2 r2 = int3x2(302634703, 792459110, 928921538, 1230630797, 31215817, 1509103967); + TestUtils.AreEqual(r2, a2 ^ b2); + + int3x2 a3 = int3x2(60088394, 858716109, 858484213, 178843494, 1223183458, 866652388); + int b3 = (1196907956); + int3x2 r3 = int3x2(1153678846, 1954130553, 1954295873, 1308603090, 264180182, 1962888528); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void int3x2_operator_bitwise_xor_scalar_wide() + { + int a0 = (1361775641); + int3x2 b0 = int3x2(1452773578, 459050892, 1986218254, 1689037698, 999278344, 1229114508); + int3x2 r0 = int3x2(129801427, 1249346453, 659047703, 898082715, 1789184785, 409583765); + TestUtils.AreEqual(r0, a0 ^ b0); + + int a1 = (1087843538); + int3x2 b1 = int3x2(733699740, 106187872, 1533632738, 1107817672, 492506236, 597602329); + int3x2 r1 = int3x2(1802269262, 1183015090, 465456176, 47241242, 1569464494, 1665768651); + TestUtils.AreEqual(r1, a1 ^ b1); + + int a2 = (1439603382); + int3x2 b2 = int3x2(1001169118, 1231718216, 1693179077, 1050897427, 1796435561, 1100532547); + int3x2 r2 = int3x2(1851931240, 480517630, 824526451, 1802368677, 1054733535, 341201397); + TestUtils.AreEqual(r2, a2 ^ b2); + + int a3 = (2106589181); + int3x2 b3 = int3x2(79691722, 851486414, 381749210, 1743618507, 2038827673, 1680906962); + int3x2 r3 = int3x2(2033188919, 1330600243, 1800337447, 442662454, 67761508, 431973679); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void int3x2_operator_left_shift() + { + int3x2 a0 = int3x2(1129100049, 829482269, 1571297368, 443753193, 1872142968, 249554593); + int b0 = (218351941); + int3x2 r0 = int3x2(1771463200, 773628832, -1258091776, 1315200288, -220967168, -604187616); + TestUtils.AreEqual(r0, a0 << b0); + + int3x2 a1 = int3x2(892627436, 62369727, 849916599, 1271350845, 108441902, 1959056531); + int b1 = (980302862); + int3x2 r1 = int3x2(444268544, -336609280, 749584384, -779141120, -1404338176, 891600896); + TestUtils.AreEqual(r1, a1 << b1); + + int3x2 a2 = int3x2(1779118882, 2082026915, 1149883636, 1380536034, 186532735, 1487486874); + int b2 = (1451674188); + int3x2 r2 = int3x2(-1288560640, -1822806016, -1655750656, -1796333568, -466096128, -1812357120); + TestUtils.AreEqual(r2, a2 << b2); + + int3x2 a3 = int3x2(1498738574, 1647167336, 772453640, 456967739, 947384545, 1463252873); + int b3 = (752067504); + int3x2 r3 = int3x2(-275906560, -949485568, -1257766912, -969211904, -253689856, 2005467136); + TestUtils.AreEqual(r3, a3 << b3); + } + + [TestCompiler] + public static void int3x2_operator_right_shift() + { + int3x2 a0 = int3x2(809126085, 908563670, 763568837, 1986717290, 1174507510, 646821842); + int b0 = (994800051); + int3x2 r0 = int3x2(1543, 1732, 1456, 3789, 2240, 1233); + TestUtils.AreEqual(r0, a0 >> b0); + + int3x2 a1 = int3x2(1242726074, 1521420393, 1923166649, 102096936, 400863878, 667378673); + int b1 = (390811632); + int3x2 r1 = int3x2(18962, 23215, 29345, 1557, 6116, 10183); + TestUtils.AreEqual(r1, a1 >> b1); + + int3x2 a2 = int3x2(1611921244, 479442287, 2014389412, 1673938174, 1075916177, 1248577253); + int b2 = (307750782); + int3x2 r2 = int3x2(1, 0, 1, 1, 1, 1); + TestUtils.AreEqual(r2, a2 >> b2); + + int3x2 a3 = int3x2(848199210, 848976170, 500930883, 662405800, 126875849, 1103917083); + int b3 = (813936577); + int3x2 r3 = int3x2(424099605, 424488085, 250465441, 331202900, 63437924, 551958541); + TestUtils.AreEqual(r3, a3 >> b3); + } + + [TestCompiler] + public static void int3x2_operator_bitwise_not() + { + int3x2 a0 = int3x2(111796841, 603562399, 745091931, 853183268, 1110916612, 381888399); + int3x2 r0 = int3x2(-111796842, -603562400, -745091932, -853183269, -1110916613, -381888400); + TestUtils.AreEqual(r0, ~a0); + + int3x2 a1 = int3x2(1891338755, 771210628, 787710759, 875964607, 96456785, 916013379); + int3x2 r1 = int3x2(-1891338756, -771210629, -787710760, -875964608, -96456786, -916013380); + TestUtils.AreEqual(r1, ~a1); + + int3x2 a2 = int3x2(203444882, 1020232736, 683852713, 375158799, 881353367, 1218471344); + int3x2 r2 = int3x2(-203444883, -1020232737, -683852714, -375158800, -881353368, -1218471345); + TestUtils.AreEqual(r2, ~a2); + + int3x2 a3 = int3x2(1174233245, 443427914, 1385118179, 215320517, 860122767, 1411266016); + int3x2 r3 = int3x2(-1174233246, -443427915, -1385118180, -215320518, -860122768, -1411266017); + TestUtils.AreEqual(r3, ~a3); + } + + [TestCase /* For player builds */] + public static void int3x2_EqualsObjectOverride() + { + TestUtils.IsFalse(new int3x2().Equals((object)new int())); + TestUtils.IsTrue(new int3x2().Equals((object)new int3x2())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestInt3x2.gen.cs.meta b/src/Tests/Tests/Shared/TestInt3x2.gen.cs.meta new file mode 100644 index 00000000..d34b6dfa --- /dev/null +++ b/src/Tests/Tests/Shared/TestInt3x2.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a70be02e3e9e4764494cdb824f94da34 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestInt3x3.gen.cs b/src/Tests/Tests/Shared/TestInt3x3.gen.cs new file mode 100644 index 00000000..5d82264a --- /dev/null +++ b/src/Tests/Tests/Shared/TestInt3x3.gen.cs @@ -0,0 +1,1251 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestInt3x3 + { + [TestCompiler] + public static void int3x3_zero() + { + TestUtils.AreEqual(0, int3x3.zero.c0.x); + TestUtils.AreEqual(0, int3x3.zero.c0.y); + TestUtils.AreEqual(0, int3x3.zero.c0.z); + TestUtils.AreEqual(0, int3x3.zero.c1.x); + TestUtils.AreEqual(0, int3x3.zero.c1.y); + TestUtils.AreEqual(0, int3x3.zero.c1.z); + TestUtils.AreEqual(0, int3x3.zero.c2.x); + TestUtils.AreEqual(0, int3x3.zero.c2.y); + TestUtils.AreEqual(0, int3x3.zero.c2.z); + } + + [TestCompiler] + public static void int3x3_identity() + { + TestUtils.AreEqual(1, int3x3.identity.c0.x); + TestUtils.AreEqual(0, int3x3.identity.c0.y); + TestUtils.AreEqual(0, int3x3.identity.c0.z); + TestUtils.AreEqual(0, int3x3.identity.c1.x); + TestUtils.AreEqual(1, int3x3.identity.c1.y); + TestUtils.AreEqual(0, int3x3.identity.c1.z); + TestUtils.AreEqual(0, int3x3.identity.c2.x); + TestUtils.AreEqual(0, int3x3.identity.c2.y); + TestUtils.AreEqual(1, int3x3.identity.c2.z); + } + + [TestCompiler] + public static void int3x3_operator_equal_wide_wide() + { + int3x3 a0 = int3x3(2105871082, 35218899, 1550755093, 764676020, 606743782, 1208156098, 1023640014, 1038468316, 1416064367); + int3x3 b0 = int3x3(1477587886, 579629692, 540974792, 208405066, 2063397938, 1060167409, 362592601, 2097545362, 277670088); + bool3x3 r0 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + int3x3 a1 = int3x3(727143393, 2061243891, 184669837, 1303661760, 2044073738, 370395888, 1822916805, 1076983135, 345215866); + int3x3 b1 = int3x3(426944490, 901076223, 857900673, 1548779757, 325265488, 312658571, 176373760, 2052378097, 858156597); + bool3x3 r1 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + int3x3 a2 = int3x3(833676277, 1987782708, 1481088614, 1364754268, 93639636, 1850596922, 2073471507, 1745989448, 28118669); + int3x3 b2 = int3x3(982817797, 1252095508, 882634538, 1959142806, 72495800, 1077678183, 1729269763, 1607675346, 1813461519); + bool3x3 r2 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + int3x3 a3 = int3x3(1267554232, 1292918049, 1423451579, 644384701, 1985492825, 240481133, 2130667921, 17376735, 1263869085); + int3x3 b3 = int3x3(1204794859, 1324801873, 1975336, 439410532, 294085211, 1031782338, 1118745564, 180311719, 433246570); + bool3x3 r3 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void int3x3_operator_equal_wide_scalar() + { + int3x3 a0 = int3x3(437822262, 2020661134, 541786900, 853113810, 23716499, 179951405, 1409026299, 948838849, 953202998); + int b0 = (1332833578); + bool3x3 r0 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + int3x3 a1 = int3x3(691955848, 1851546137, 712957637, 2028784869, 1049962241, 1836975611, 1016802970, 390120467, 464814777); + int b1 = (1926262965); + bool3x3 r1 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + int3x3 a2 = int3x3(1451642042, 152339338, 808355440, 660053867, 597354173, 67320270, 151461188, 35153827, 602895443); + int b2 = (289137869); + bool3x3 r2 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + int3x3 a3 = int3x3(186996278, 1031574999, 1697392883, 1463742000, 857785521, 611116281, 594150729, 375387566, 1984352551); + int b3 = (129611815); + bool3x3 r3 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void int3x3_operator_equal_scalar_wide() + { + int a0 = (542329200); + int3x3 b0 = int3x3(1115584594, 684107773, 1928988941, 890709324, 641152437, 1410341302, 497505660, 1068223109, 2014009435); + bool3x3 r0 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + int a1 = (213835595); + int3x3 b1 = int3x3(1592428361, 1819361470, 448650623, 1942175642, 64377057, 1485938610, 1146305380, 1312317120, 263290348); + bool3x3 r1 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + int a2 = (812663708); + int3x3 b2 = int3x3(1585209188, 40646617, 1378718922, 1957797737, 873652576, 1780082094, 1513270921, 2095980581, 1413074719); + bool3x3 r2 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + int a3 = (1387984261); + int3x3 b3 = int3x3(1547119354, 924385171, 1253636050, 1477542688, 969120167, 591812191, 856880926, 1114040166, 2107388425); + bool3x3 r3 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void int3x3_operator_not_equal_wide_wide() + { + int3x3 a0 = int3x3(1977284100, 1293292704, 1547283851, 422428953, 195833190, 1711544892, 5606053, 737069074, 647386678); + int3x3 b0 = int3x3(1514195556, 957972049, 507667364, 581861672, 1128094576, 940096636, 57559040, 181752616, 962017320); + bool3x3 r0 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + int3x3 a1 = int3x3(13079405, 1413841590, 1076166545, 1211445174, 1289303469, 1436402489, 1129570126, 1566836685, 1343313905); + int3x3 b1 = int3x3(1762015406, 1107218953, 2042026522, 836002288, 570272309, 2112081980, 1500634658, 1787808345, 566425667); + bool3x3 r1 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + int3x3 a2 = int3x3(329259205, 1774944480, 33906739, 2055853627, 2035015372, 1702756001, 1164186087, 329853698, 769052491); + int3x3 b2 = int3x3(2037529609, 1520589840, 266793699, 538816359, 2075474643, 553571317, 218264354, 654754196, 1392180230); + bool3x3 r2 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + int3x3 a3 = int3x3(1893312730, 438029011, 1894010522, 1365847542, 1292942830, 2146008097, 1520743598, 861728782, 1999977058); + int3x3 b3 = int3x3(870065147, 1398749829, 711281563, 1999640291, 231234857, 210910234, 365281355, 170643407, 757340716); + bool3x3 r3 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void int3x3_operator_not_equal_wide_scalar() + { + int3x3 a0 = int3x3(1038269360, 1427812625, 103361237, 1347017023, 1523584313, 150442802, 660334527, 719113717, 262959423); + int b0 = (768873026); + bool3x3 r0 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + int3x3 a1 = int3x3(484398043, 226568494, 507918242, 1702162286, 923269270, 166187260, 114581840, 1045389187, 1648095254); + int b1 = (506946952); + bool3x3 r1 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + int3x3 a2 = int3x3(1461803977, 1317840133, 2146927809, 1557151164, 1284033253, 1345705546, 1747302566, 611028295, 1368046109); + int b2 = (61801615); + bool3x3 r2 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + int3x3 a3 = int3x3(1848036266, 373992983, 289537519, 1388743060, 146455100, 1854553487, 872755032, 2113020512, 1062447442); + int b3 = (2025452920); + bool3x3 r3 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void int3x3_operator_not_equal_scalar_wide() + { + int a0 = (1652127596); + int3x3 b0 = int3x3(953791238, 271722683, 1278885987, 735128017, 112416504, 25967222, 1761444475, 1844594536, 1199122922); + bool3x3 r0 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + int a1 = (634219279); + int3x3 b1 = int3x3(942501101, 67161343, 969944293, 833229499, 1304301133, 704045745, 345012334, 1253134152, 325772538); + bool3x3 r1 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + int a2 = (855127202); + int3x3 b2 = int3x3(793668881, 1584481616, 1101301152, 276853534, 987168816, 1258105989, 362645228, 293978043, 1772395973); + bool3x3 r2 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + int a3 = (1692007315); + int3x3 b3 = int3x3(681268929, 1535518457, 595209334, 25745185, 1278016813, 2125682481, 2037751005, 1405297618, 1825546885); + bool3x3 r3 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void int3x3_operator_less_wide_wide() + { + int3x3 a0 = int3x3(1486550609, 1779244308, 1602148045, 1614085440, 1975613414, 942838342, 1092279031, 373677431, 1419098312); + int3x3 b0 = int3x3(97842578, 536551311, 413528975, 1838293684, 1283898480, 1456599961, 1080278602, 529676676, 156584048); + bool3x3 r0 = bool3x3(false, false, false, true, false, true, false, true, false); + TestUtils.AreEqual(r0, a0 < b0); + + int3x3 a1 = int3x3(337757077, 1081797900, 1336745069, 840685445, 1220554047, 2013681746, 192965012, 532043965, 1000693402); + int3x3 b1 = int3x3(117348799, 246927124, 1916615924, 1731071394, 1328098431, 1014995792, 480319327, 1765937053, 1333997067); + bool3x3 r1 = bool3x3(false, false, true, true, true, false, true, true, true); + TestUtils.AreEqual(r1, a1 < b1); + + int3x3 a2 = int3x3(927236048, 1215860000, 780607596, 1882056852, 1354146545, 2135295778, 1145973790, 1938006975, 895882838); + int3x3 b2 = int3x3(688515308, 1856106947, 1303906227, 646821776, 1169473993, 316770064, 1518155802, 416732703, 529193056); + bool3x3 r2 = bool3x3(false, true, true, false, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + int3x3 a3 = int3x3(2006524299, 908581156, 1843349513, 1340458575, 1972095585, 1090933468, 924555996, 79585200, 1749924275); + int3x3 b3 = int3x3(1239623485, 2010112031, 2018560298, 285987009, 960617622, 462519015, 1473825625, 1187164011, 730583004); + bool3x3 r3 = bool3x3(false, true, true, false, false, false, true, true, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void int3x3_operator_less_wide_scalar() + { + int3x3 a0 = int3x3(796797557, 670113454, 933579492, 278884514, 318174822, 1117630673, 741886928, 1990922600, 1030849597); + int b0 = (746564682); + bool3x3 r0 = bool3x3(false, true, false, true, true, false, true, false, false); + TestUtils.AreEqual(r0, a0 < b0); + + int3x3 a1 = int3x3(1546212312, 1648393417, 1857132231, 1909506562, 1294006045, 952084157, 1303736668, 845460171, 979430272); + int b1 = (1718582899); + bool3x3 r1 = bool3x3(true, true, false, false, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 < b1); + + int3x3 a2 = int3x3(1368236640, 1434668705, 659552739, 1058492383, 165694933, 1204097259, 922212691, 281328069, 24629507); + int b2 = (24980695); + bool3x3 r2 = bool3x3(false, false, false, false, false, false, false, false, true); + TestUtils.AreEqual(r2, a2 < b2); + + int3x3 a3 = int3x3(1386458568, 1498707004, 1650355158, 1213017950, 1650457461, 759932777, 1542997846, 1227393490, 1520634374); + int b3 = (1325149699); + bool3x3 r3 = bool3x3(false, false, false, true, false, true, false, true, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void int3x3_operator_less_scalar_wide() + { + int a0 = (186400299); + int3x3 b0 = int3x3(1881344229, 813834467, 1254886626, 1353590345, 1412343685, 1555571443, 1540508298, 1735458634, 135888070); + bool3x3 r0 = bool3x3(true, true, true, true, true, true, true, true, false); + TestUtils.AreEqual(r0, a0 < b0); + + int a1 = (1643818742); + int3x3 b1 = int3x3(248291654, 1739560105, 728539891, 480507742, 1696553040, 540223931, 1840493353, 146833656, 798115946); + bool3x3 r1 = bool3x3(false, true, false, false, true, false, true, false, false); + TestUtils.AreEqual(r1, a1 < b1); + + int a2 = (2002002066); + int3x3 b2 = int3x3(1011261705, 783550942, 1093071215, 598253401, 1432416562, 1863582169, 103622950, 775175960, 116908309); + bool3x3 r2 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + int a3 = (1213433625); + int3x3 b3 = int3x3(1428954824, 1760442490, 1208143947, 751820805, 1491872302, 560004484, 2065157473, 310839658, 697329242); + bool3x3 r3 = bool3x3(true, true, false, false, true, false, true, false, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void int3x3_operator_greater_wide_wide() + { + int3x3 a0 = int3x3(2087717754, 1725569452, 1298066182, 1693943616, 1319019629, 70674491, 1042499725, 1002821508, 1021857133); + int3x3 b0 = int3x3(85148514, 293632137, 1151128249, 409440398, 1115020183, 1508500597, 1834583302, 1755218534, 1788761753); + bool3x3 r0 = bool3x3(true, true, true, true, true, false, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + int3x3 a1 = int3x3(1744374599, 821751047, 467646903, 2029731638, 1377214212, 1207816926, 474621063, 20781266, 366593779); + int3x3 b1 = int3x3(1128238489, 834223713, 1578743290, 1647150256, 1756397855, 1131080201, 1208965204, 1495161099, 1283714281); + bool3x3 r1 = bool3x3(true, false, false, true, false, true, false, false, false); + TestUtils.AreEqual(r1, a1 > b1); + + int3x3 a2 = int3x3(2068457387, 10181449, 793634464, 144474612, 99947390, 930377263, 683686232, 742803073, 918292048); + int3x3 b2 = int3x3(908051907, 412849651, 815822687, 730271942, 40756039, 883326140, 476260632, 1024136446, 1440596667); + bool3x3 r2 = bool3x3(true, false, false, false, true, true, true, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + int3x3 a3 = int3x3(875621429, 1764985258, 411384146, 1921397684, 1349107119, 640399120, 1487719331, 1467989523, 1834244794); + int3x3 b3 = int3x3(1253494041, 146826162, 1798399573, 2085029408, 187939428, 1009192934, 1694822273, 1866590874, 113805226); + bool3x3 r3 = bool3x3(false, true, false, false, true, false, false, false, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void int3x3_operator_greater_wide_scalar() + { + int3x3 a0 = int3x3(1208626274, 239697208, 1979453345, 1253474001, 1590192876, 1487911635, 1673945595, 1662650098, 222749855); + int b0 = (1715176566); + bool3x3 r0 = bool3x3(false, false, true, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + int3x3 a1 = int3x3(1433540517, 1773305960, 1850273578, 206147145, 325913453, 333381537, 1905567362, 2053577491, 570397194); + int b1 = (566635217); + bool3x3 r1 = bool3x3(true, true, true, false, false, false, true, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + int3x3 a2 = int3x3(2128431130, 529971908, 1663525234, 1972984241, 1587865063, 488268523, 121921923, 812076921, 181082921); + int b2 = (1735325311); + bool3x3 r2 = bool3x3(true, false, false, true, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + int3x3 a3 = int3x3(1281638484, 116518997, 1397728785, 1924199337, 742950077, 1463993051, 1598027926, 842851852, 160842093); + int b3 = (1818357732); + bool3x3 r3 = bool3x3(false, false, false, true, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void int3x3_operator_greater_scalar_wide() + { + int a0 = (480938827); + int3x3 b0 = int3x3(1824731899, 921496110, 586859044, 946430596, 1231356727, 1390167458, 1785807092, 28949024, 2037899283); + bool3x3 r0 = bool3x3(false, false, false, false, false, false, false, true, false); + TestUtils.AreEqual(r0, a0 > b0); + + int a1 = (595656760); + int3x3 b1 = int3x3(1778095771, 1233500439, 1696302238, 1445965340, 484020151, 1586962841, 1361740714, 265628948, 2003122957); + bool3x3 r1 = bool3x3(false, false, false, false, true, false, false, true, false); + TestUtils.AreEqual(r1, a1 > b1); + + int a2 = (332267433); + int3x3 b2 = int3x3(1128353075, 377919478, 982113135, 1117675960, 630865591, 1550679736, 895945757, 287025687, 643452096); + bool3x3 r2 = bool3x3(false, false, false, false, false, false, false, true, false); + TestUtils.AreEqual(r2, a2 > b2); + + int a3 = (660504007); + int3x3 b3 = int3x3(613135893, 633307118, 514276792, 1377364317, 84491736, 746768197, 1282879723, 589415384, 363082240); + bool3x3 r3 = bool3x3(true, true, true, false, true, false, false, true, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void int3x3_operator_less_equal_wide_wide() + { + int3x3 a0 = int3x3(154092149, 1515170149, 1083970332, 785807178, 1401094881, 310537627, 868328962, 1990816725, 2035349541); + int3x3 b0 = int3x3(77984380, 1712054191, 1566203809, 254834519, 450519938, 389457083, 1298669505, 207343167, 1214449047); + bool3x3 r0 = bool3x3(false, true, true, false, false, true, true, false, false); + TestUtils.AreEqual(r0, a0 <= b0); + + int3x3 a1 = int3x3(457043352, 1123282035, 1001842946, 1387761992, 195272789, 659549000, 888761458, 283706617, 1790185840); + int3x3 b1 = int3x3(2059561026, 896534357, 1897470050, 521075677, 1848221945, 374708019, 1573731118, 2093466449, 1660210829); + bool3x3 r1 = bool3x3(true, false, true, false, true, false, true, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + int3x3 a2 = int3x3(899029812, 848317418, 1743712447, 1504407474, 1798441490, 1902791952, 606340844, 1994437705, 301831413); + int3x3 b2 = int3x3(1568778785, 1352157589, 1212771905, 1457525058, 1493446008, 1784768208, 1993422493, 1378671664, 1447376929); + bool3x3 r2 = bool3x3(true, true, false, false, false, false, true, false, true); + TestUtils.AreEqual(r2, a2 <= b2); + + int3x3 a3 = int3x3(654230470, 1223625081, 324292199, 1370931020, 1742769166, 1709242127, 105750466, 1655967312, 1455797002); + int3x3 b3 = int3x3(1405041439, 1765183746, 562894655, 1085068880, 1026386862, 884290156, 922346160, 330605896, 466570756); + bool3x3 r3 = bool3x3(true, true, true, false, false, false, true, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void int3x3_operator_less_equal_wide_scalar() + { + int3x3 a0 = int3x3(1479531977, 1427983411, 415250630, 1245345407, 1112546666, 1072990632, 1579912858, 101048307, 1070894375); + int b0 = (2004563877); + bool3x3 r0 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + int3x3 a1 = int3x3(509818792, 85452501, 518127023, 1246249980, 1097326500, 1964410699, 1968139888, 1191853379, 662096238); + int b1 = (1910488590); + bool3x3 r1 = bool3x3(true, true, true, true, true, false, false, true, true); + TestUtils.AreEqual(r1, a1 <= b1); + + int3x3 a2 = int3x3(1140643434, 155343473, 995927387, 974873240, 1773400038, 497436329, 1825940497, 527516420, 1477043363); + int b2 = (754434551); + bool3x3 r2 = bool3x3(false, true, false, false, false, true, false, true, false); + TestUtils.AreEqual(r2, a2 <= b2); + + int3x3 a3 = int3x3(1378470734, 37188105, 839762283, 781102710, 766321672, 1145011483, 139031840, 127837780, 817806943); + int b3 = (96190147); + bool3x3 r3 = bool3x3(false, true, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void int3x3_operator_less_equal_scalar_wide() + { + int a0 = (1899193992); + int3x3 b0 = int3x3(915011820, 980913757, 1337699683, 1476321359, 1102143668, 660493983, 184664508, 381579707, 1954892821); + bool3x3 r0 = bool3x3(false, false, false, false, false, false, false, false, true); + TestUtils.AreEqual(r0, a0 <= b0); + + int a1 = (1295090571); + int3x3 b1 = int3x3(1440368586, 1696003686, 88708652, 1332251857, 1310713644, 2112132784, 48951945, 1888568027, 39340955); + bool3x3 r1 = bool3x3(true, true, false, true, true, true, false, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + int a2 = (1108242207); + int3x3 b2 = int3x3(260777425, 593122164, 291471959, 253457314, 1264570386, 699618012, 927735863, 2063158939, 932253787); + bool3x3 r2 = bool3x3(false, false, false, false, true, false, false, true, false); + TestUtils.AreEqual(r2, a2 <= b2); + + int a3 = (1168754049); + int3x3 b3 = int3x3(749328788, 1882694892, 168499987, 378173027, 339963627, 832906712, 559482768, 53067420, 1895722478); + bool3x3 r3 = bool3x3(false, true, false, false, false, false, false, false, true); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void int3x3_operator_greater_equal_wide_wide() + { + int3x3 a0 = int3x3(8538378, 2131749726, 265427108, 523609761, 994991818, 839709564, 101288202, 1886280970, 2032074826); + int3x3 b0 = int3x3(903145828, 1697992986, 1432491982, 169789504, 1059357300, 1744255222, 1606584463, 1905414425, 1448794969); + bool3x3 r0 = bool3x3(false, true, false, true, false, false, false, false, true); + TestUtils.AreEqual(r0, a0 >= b0); + + int3x3 a1 = int3x3(631221455, 1456286159, 961342752, 424526026, 788481984, 1662488497, 870326690, 708712581, 1260182701); + int3x3 b1 = int3x3(136181998, 1678754836, 2069656857, 398982689, 243317404, 740939613, 1894753119, 301760792, 1260647988); + bool3x3 r1 = bool3x3(true, false, false, true, true, true, false, true, false); + TestUtils.AreEqual(r1, a1 >= b1); + + int3x3 a2 = int3x3(1165630721, 138247561, 1108650168, 1933222913, 672493999, 1541402159, 1921596027, 1557351956, 147242547); + int3x3 b2 = int3x3(3608523, 52576030, 903420465, 1648820371, 627296845, 1679808907, 1719102039, 1718081638, 655586949); + bool3x3 r2 = bool3x3(true, true, true, true, true, false, true, false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + int3x3 a3 = int3x3(892772168, 2089286723, 1273466960, 644009998, 654784654, 189030610, 1035542641, 346401762, 739783704); + int3x3 b3 = int3x3(477267189, 62092869, 2013928066, 280292357, 254052205, 1092440092, 1947011057, 625632982, 2028466303); + bool3x3 r3 = bool3x3(true, true, false, true, true, false, false, false, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void int3x3_operator_greater_equal_wide_scalar() + { + int3x3 a0 = int3x3(2049236663, 182691143, 634973382, 1197012109, 439837565, 1367606469, 1108037359, 351147187, 1898505669); + int b0 = (1061998015); + bool3x3 r0 = bool3x3(true, false, false, true, false, true, true, false, true); + TestUtils.AreEqual(r0, a0 >= b0); + + int3x3 a1 = int3x3(411667685, 4652390, 996159180, 2111455181, 727766399, 96217144, 814085575, 1525995206, 1293933760); + int b1 = (1998610091); + bool3x3 r1 = bool3x3(false, false, false, true, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + int3x3 a2 = int3x3(1732973229, 899444524, 1023753195, 1373738074, 518164359, 717850464, 1765188600, 1826820341, 527594558); + int b2 = (1473283041); + bool3x3 r2 = bool3x3(true, false, false, false, false, false, true, true, false); + TestUtils.AreEqual(r2, a2 >= b2); + + int3x3 a3 = int3x3(1816542874, 1143596061, 1819554651, 160724539, 993212636, 878086499, 363122662, 1989978759, 2145562949); + int b3 = (839185150); + bool3x3 r3 = bool3x3(true, true, true, false, true, true, false, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void int3x3_operator_greater_equal_scalar_wide() + { + int a0 = (1859811087); + int3x3 b0 = int3x3(1070365918, 1783869452, 830091760, 377157428, 327199016, 90384229, 1154649706, 376758501, 1079802834); + bool3x3 r0 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + int a1 = (2054742898); + int3x3 b1 = int3x3(1328349472, 434061447, 951207723, 598695892, 975131651, 1714007943, 177416473, 1267232721, 31082860); + bool3x3 r1 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 >= b1); + + int a2 = (216791741); + int3x3 b2 = int3x3(119054289, 1905107583, 89559116, 55041824, 691334141, 462326883, 1658303669, 914628512, 1134364322); + bool3x3 r2 = bool3x3(true, false, true, true, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + int a3 = (1677134711); + int3x3 b3 = int3x3(1955614770, 2067009301, 1454405405, 299467282, 1584922149, 561776357, 564147844, 398216936, 1478439642); + bool3x3 r3 = bool3x3(false, false, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void int3x3_operator_add_wide_wide() + { + int3x3 a0 = int3x3(2135171378, 21433296, 1954723494, 683604307, 1054212315, 1762680995, 1963655852, 1257853062, 2043493600); + int3x3 b0 = int3x3(1013431952, 366718162, 359290756, 1393163294, 1962236872, 1263270041, 1862666629, 1077447887, 821693806); + int3x3 r0 = int3x3(-1146363966, 388151458, -1980953046, 2076767601, -1278518109, -1269016260, -468644815, -1959666347, -1429779890); + TestUtils.AreEqual(r0, a0 + b0); + + int3x3 a1 = int3x3(976898058, 1915056423, 121374462, 1218855698, 700538222, 1702057277, 1788251699, 1534939160, 398651016); + int3x3 b1 = int3x3(487316539, 350922520, 1583012528, 1951595076, 1024851344, 874302782, 1383969588, 1767968088, 900721406); + int3x3 r1 = int3x3(1464214597, -2028988353, 1704386990, -1124516522, 1725389566, -1718607237, -1122746009, -992060048, 1299372422); + TestUtils.AreEqual(r1, a1 + b1); + + int3x3 a2 = int3x3(1674272498, 374510467, 824322986, 1217622199, 1122376670, 642613771, 1097903998, 359042741, 929182687); + int3x3 b2 = int3x3(1659790033, 1792273749, 443844328, 633981449, 2010244807, 335566991, 521931102, 544297835, 1681549647); + int3x3 r2 = int3x3(-960904765, -2128183080, 1268167314, 1851603648, -1162345819, 978180762, 1619835100, 903340576, -1684234962); + TestUtils.AreEqual(r2, a2 + b2); + + int3x3 a3 = int3x3(1713065399, 892057490, 1295346111, 1806236181, 1838589664, 173985173, 1875814528, 1464015613, 1550659036); + int3x3 b3 = int3x3(1784248858, 585904415, 3128418, 1806236610, 179909533, 378711407, 195687764, 357131656, 383703567); + int3x3 r3 = int3x3(-797653039, 1477961905, 1298474529, -682494505, 2018499197, 552696580, 2071502292, 1821147269, 1934362603); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void int3x3_operator_add_wide_scalar() + { + int3x3 a0 = int3x3(665815972, 1783729250, 1591678394, 1284528538, 977850224, 71069732, 1138577680, 1200356017, 565982008); + int b0 = (1334043849); + int3x3 r0 = int3x3(1999859821, -1177194197, -1369245053, -1676394909, -1983073223, 1405113581, -1822345767, -1760567430, 1900025857); + TestUtils.AreEqual(r0, a0 + b0); + + int3x3 a1 = int3x3(1246759684, 57252642, 678921480, 625943813, 512157429, 1470648741, 1490096953, 1467033531, 182608093); + int b1 = (1088001167); + int3x3 r1 = int3x3(-1960206445, 1145253809, 1766922647, 1713944980, 1600158596, -1736317388, -1716869176, -1739932598, 1270609260); + TestUtils.AreEqual(r1, a1 + b1); + + int3x3 a2 = int3x3(1707296407, 1333833947, 653973063, 1139546735, 1834005844, 184572739, 1980578280, 1858520040, 97099208); + int b2 = (1703724354); + int3x3 r2 = int3x3(-883946535, -1257408995, -1937269879, -1451696207, -757237098, 1888297093, -610664662, -732722902, 1800823562); + TestUtils.AreEqual(r2, a2 + b2); + + int3x3 a3 = int3x3(421437295, 166844260, 1568146789, 82548613, 533562157, 1464065228, 716600557, 831997894, 861575416); + int b3 = (1251829854); + int3x3 r3 = int3x3(1673267149, 1418674114, -1474990653, 1334378467, 1785392011, -1579072214, 1968430411, 2083827748, 2113405270); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void int3x3_operator_add_scalar_wide() + { + int a0 = (359966320); + int3x3 b0 = int3x3(2146146202, 767103309, 851002415, 311531406, 1491262941, 1016891373, 1954228994, 1671335850, 727870747); + int3x3 r0 = int3x3(-1788854774, 1127069629, 1210968735, 671497726, 1851229261, 1376857693, -1980771982, 2031302170, 1087837067); + TestUtils.AreEqual(r0, a0 + b0); + + int a1 = (551151834); + int3x3 b1 = int3x3(1390261152, 1699060326, 115021619, 1964440175, 440700758, 1556692550, 185414255, 933106731, 1217866784); + int3x3 r1 = int3x3(1941412986, -2044755136, 666173453, -1779375287, 991852592, 2107844384, 736566089, 1484258565, 1769018618); + TestUtils.AreEqual(r1, a1 + b1); + + int a2 = (729761881); + int3x3 b2 = int3x3(1742597318, 1090109152, 1467373815, 1066072609, 138237856, 634834665, 993603553, 347587889, 2050191349); + int3x3 r2 = int3x3(-1822608097, 1819871033, -2097831600, 1795834490, 867999737, 1364596546, 1723365434, 1077349770, -1515014066); + TestUtils.AreEqual(r2, a2 + b2); + + int a3 = (670698672); + int3x3 b3 = int3x3(1658205080, 1874808705, 2082982954, 869839589, 118460267, 2126166073, 1826004041, 1976984739, 1612682951); + int3x3 r3 = int3x3(-1966063544, -1749459919, -1541285670, 1540538261, 789158939, -1498102551, -1798264583, -1647283885, -2011585673); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void int3x3_operator_sub_wide_wide() + { + int3x3 a0 = int3x3(1410318491, 1097280168, 1827039044, 28881338, 328720965, 875487868, 212936325, 231977215, 1740021315); + int3x3 b0 = int3x3(1315897366, 799052018, 1580289673, 1094686261, 1954325726, 1197734816, 229886366, 915679176, 1746884850); + int3x3 r0 = int3x3(94421125, 298228150, 246749371, -1065804923, -1625604761, -322246948, -16950041, -683701961, -6863535); + TestUtils.AreEqual(r0, a0 - b0); + + int3x3 a1 = int3x3(2011295463, 48079003, 591379285, 1125909359, 1842588095, 848561896, 614448464, 2067598029, 1618238416); + int3x3 b1 = int3x3(918743925, 1007797419, 257421324, 287249342, 1617287463, 1653916102, 123586847, 502107404, 672875302); + int3x3 r1 = int3x3(1092551538, -959718416, 333957961, 838660017, 225300632, -805354206, 490861617, 1565490625, 945363114); + TestUtils.AreEqual(r1, a1 - b1); + + int3x3 a2 = int3x3(318516219, 1090119767, 1991095823, 949592162, 1951912339, 1457818751, 1642553126, 2114366549, 1420516260); + int3x3 b2 = int3x3(1256481116, 1975569142, 1794443030, 1327558915, 330955394, 1596041731, 1069074732, 1120817099, 2076417364); + int3x3 r2 = int3x3(-937964897, -885449375, 196652793, -377966753, 1620956945, -138222980, 573478394, 993549450, -655901104); + TestUtils.AreEqual(r2, a2 - b2); + + int3x3 a3 = int3x3(596841760, 724518081, 1820626306, 1885185225, 246124365, 1339877262, 1277620434, 759131597, 597162957); + int3x3 b3 = int3x3(402521072, 839858844, 1539789702, 559077522, 822288510, 751901021, 1858312568, 1706585560, 483540199); + int3x3 r3 = int3x3(194320688, -115340763, 280836604, 1326107703, -576164145, 587976241, -580692134, -947453963, 113622758); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void int3x3_operator_sub_wide_scalar() + { + int3x3 a0 = int3x3(1508669340, 1594795463, 266707545, 643102647, 287705008, 1475644328, 1113286221, 979450511, 2082174113); + int b0 = (998008471); + int3x3 r0 = int3x3(510660869, 596786992, -731300926, -354905824, -710303463, 477635857, 115277750, -18557960, 1084165642); + TestUtils.AreEqual(r0, a0 - b0); + + int3x3 a1 = int3x3(1108005498, 999244508, 1806482044, 1994553647, 2101812429, 1482736902, 266654115, 1470212363, 1190349300); + int b1 = (304369206); + int3x3 r1 = int3x3(803636292, 694875302, 1502112838, 1690184441, 1797443223, 1178367696, -37715091, 1165843157, 885980094); + TestUtils.AreEqual(r1, a1 - b1); + + int3x3 a2 = int3x3(958542155, 1738124835, 499527536, 1612473406, 1696960099, 1287292743, 1360229454, 1032360376, 1779621585); + int b2 = (1185075537); + int3x3 r2 = int3x3(-226533382, 553049298, -685548001, 427397869, 511884562, 102217206, 175153917, -152715161, 594546048); + TestUtils.AreEqual(r2, a2 - b2); + + int3x3 a3 = int3x3(964948785, 94254551, 968533883, 2075770560, 946189008, 1074604044, 1171596880, 1033389665, 1905912138); + int b3 = (1739264125); + int3x3 r3 = int3x3(-774315340, -1645009574, -770730242, 336506435, -793075117, -664660081, -567667245, -705874460, 166648013); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void int3x3_operator_sub_scalar_wide() + { + int a0 = (893369501); + int3x3 b0 = int3x3(2051906184, 1699714311, 442603706, 1735141684, 274533585, 811580259, 1196354320, 1524097023, 533621527); + int3x3 r0 = int3x3(-1158536683, -806344810, 450765795, -841772183, 618835916, 81789242, -302984819, -630727522, 359747974); + TestUtils.AreEqual(r0, a0 - b0); + + int a1 = (2080845793); + int3x3 b1 = int3x3(143958837, 1620668660, 1135989346, 1367044745, 554088609, 552670373, 1265516124, 1254902543, 1857695581); + int3x3 r1 = int3x3(1936886956, 460177133, 944856447, 713801048, 1526757184, 1528175420, 815329669, 825943250, 223150212); + TestUtils.AreEqual(r1, a1 - b1); + + int a2 = (1619865274); + int3x3 b2 = int3x3(1313559400, 99812999, 843597298, 420111239, 1299949060, 531009038, 1103306550, 104920105, 1137308312); + int3x3 r2 = int3x3(306305874, 1520052275, 776267976, 1199754035, 319916214, 1088856236, 516558724, 1514945169, 482556962); + TestUtils.AreEqual(r2, a2 - b2); + + int a3 = (1207332725); + int3x3 b3 = int3x3(103438360, 1157123503, 1174401240, 701247193, 1498366995, 467017290, 109208355, 1594646461, 1252691221); + int3x3 r3 = int3x3(1103894365, 50209222, 32931485, 506085532, -291034270, 740315435, 1098124370, -387313736, -45358496); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void int3x3_operator_mul_wide_wide() + { + int3x3 a0 = int3x3(61417577, 219585476, 1362520891, 1511084277, 1481211272, 58211871, 1459591173, 567624644, 1169935583); + int3x3 b0 = int3x3(578042444, 1620527213, 200516468, 309339115, 542853019, 299467282, 1479641221, 1428338601, 1497302909); + int3x3 r0 = int3x3(-1426863828, 1326150260, -990894148, -1322856473, 1973926232, 88546350, -863919463, -582821788, 556671459); + TestUtils.AreEqual(r0, a0 * b0); + + int3x3 a1 = int3x3(1835691886, 385626539, 85934842, 522856538, 278370196, 289217012, 2083410174, 1293162798, 1939730122); + int3x3 b1 = int3x3(1596889147, 427413842, 265122693, 689376654, 1120457204, 516903000, 873091659, 1353196495, 1384773500); + int3x3 r1 = int3x3(1098186330, 1848083398, -58320414, 2005201900, 651971856, -1721160736, -110160278, -119429582, -536965160); + TestUtils.AreEqual(r1, a1 * b1); + + int3x3 a2 = int3x3(2075923048, 1116477212, 1686101741, 783310758, 248585944, 1093377716, 797038788, 1838048120, 1892922904); + int3x3 b2 = int3x3(1596528529, 2122329305, 1033200564, 996795088, 1137754930, 232014195, 1080950243, 1613216909, 463529448); + int3x3 r2 = int3x3(-2049587992, -759667012, 1443849636, 550781664, -959017424, -353108260, -1093604916, 264300824, -121602624); + TestUtils.AreEqual(r2, a2 * b2); + + int3x3 a3 = int3x3(1952024781, 492107602, 1097670675, 2069629919, 20122103, 606926492, 1153788131, 1687394746, 1499899200); + int3x3 b3 = int3x3(1781487382, 2101946430, 673144237, 390627073, 964308272, 1332603859, 106394678, 1330334791, 1720890701); + int3x3 r3 = int3x3(1825729694, -241519140, -1246587945, -2064143137, -251115184, 1004304020, -330302494, 638638742, 892728384); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void int3x3_operator_mul_wide_scalar() + { + int3x3 a0 = int3x3(871746615, 492532311, 570557670, 2142306629, 1610315153, 1526163563, 118471734, 257439514, 364291059); + int b0 = (442064533); + int3x3 r0 = int3x3(338365955, 1081376419, -1729147426, -1015409879, -873485467, -175501241, -838181010, 513646114, 1627104879); + TestUtils.AreEqual(r0, a0 * b0); + + int3x3 a1 = int3x3(1186560810, 1357601203, 638897141, 268562104, 1007838321, 1163240135, 1619806399, 1444659979, 1127580168); + int b1 = (1584938026); + int3x3 r1 = int3x3(989596900, 898280286, -1341201870, -1971041744, -1115228534, -780445530, -208096426, 426546126, 1963013456); + TestUtils.AreEqual(r1, a1 * b1); + + int3x3 a2 = int3x3(464517916, 745488654, 636691139, 1851670006, 357357967, 1095280227, 702779195, 945802744, 1464398841); + int b2 = (1508043166); + int3x3 r2 = int3x3(-1394510008, -79960924, 836300634, 498803668, -558928574, -1196635110, -320530070, 176674576, 937833646); + TestUtils.AreEqual(r2, a2 * b2); + + int3x3 a3 = int3x3(51061000, 407442471, 638315697, 1889264235, 584402164, 1343048690, 2144106255, 1634890111, 425282134); + int b3 = (802418971); + int3x3 r3 = int3x3(2111636440, 550688541, -772302933, -473392055, 327416252, -61090682, -654135915, -526940315, -901264110); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void int3x3_operator_mul_scalar_wide() + { + int a0 = (1152242766); + int3x3 b0 = int3x3(1276636134, 2105929407, 499007702, 124002565, 1956335172, 1288034953, 832676555, 337389733, 99268757); + int3x3 r0 = int3x3(-2129504236, 999811634, 1179056436, -801426554, 404105400, 1339492798, -381766182, -1111620026, 2131796326); + TestUtils.AreEqual(r0, a0 * b0); + + int a1 = (2005055247); + int3x3 b1 = int3x3(2011389505, 1348110859, 399689191, 2007606374, 2076691289, 1825721194, 769885235, 153314735, 1066325369); + int3x3 r1 = int3x3(-1565197105, -1533938779, -249579127, 759270394, -1253865161, 1175400758, 716911613, -761196991, 2053767447); + TestUtils.AreEqual(r1, a1 * b1); + + int a2 = (84289667); + int3x3 b2 = int3x3(984486192, 1325213504, 1643957457, 1576395620, 2095980601, 907671947, 836919582, 1412159342, 2037926630); + int3x3 r2 = int3x3(-1864217712, 623711680, -2042398989, -927794132, 20538667, 1317693985, -1028103590, 514616650, 866534322); + TestUtils.AreEqual(r2, a2 * b2); + + int a3 = (366590562); + int3x3 b3 = int3x3(493177763, 2058824164, 497936968, 2136548816, 1211907591, 2113626509, 345443734, 353147704, 688487056); + int3x3 r3 = int3x3(1441161830, 1154593096, 936640400, -1561749088, -1827679058, 547408378, 1943547756, 1645353840, 1287490336); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void int3x3_operator_div_wide_wide() + { + int3x3 a0 = int3x3(333171510, 858154903, 1181365836, 671357749, 1090606752, 803759420, 788404166, 296807814, 575260195); + int3x3 b0 = int3x3(698897823, 440199998, 655557473, 1658534285, 2127220100, 315653188, 1814290360, 992173243, 914851653); + int3x3 r0 = int3x3(0, 1, 1, 0, 0, 2, 0, 0, 0); + TestUtils.AreEqual(r0, a0 / b0); + + int3x3 a1 = int3x3(166625280, 1493729000, 1831739736, 200852358, 129983172, 500176108, 472051781, 414699094, 1446535974); + int3x3 b1 = int3x3(664340325, 224323977, 246981573, 285573983, 819471609, 2012476015, 1783179572, 223253978, 169515029); + int3x3 r1 = int3x3(0, 6, 7, 0, 0, 0, 0, 1, 8); + TestUtils.AreEqual(r1, a1 / b1); + + int3x3 a2 = int3x3(1278480457, 930910505, 263295881, 1626759436, 450830871, 21439121, 521337599, 127756712, 200601965); + int3x3 b2 = int3x3(1694929006, 1992168131, 1155972447, 1768506696, 422325410, 1508417406, 605462475, 66917170, 2014683461); + int3x3 r2 = int3x3(0, 0, 0, 0, 1, 0, 0, 1, 0); + TestUtils.AreEqual(r2, a2 / b2); + + int3x3 a3 = int3x3(412554396, 1014641734, 239347640, 525574301, 1158358177, 1655168319, 2048437741, 367754386, 1861176433); + int3x3 b3 = int3x3(108847533, 611173330, 895791853, 1999369787, 1225614384, 1168063495, 565150188, 127292785, 1027814836); + int3x3 r3 = int3x3(3, 1, 0, 0, 0, 1, 3, 2, 1); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void int3x3_operator_div_wide_scalar() + { + int3x3 a0 = int3x3(1433072926, 1073958635, 1195142312, 536596719, 1274375693, 464756346, 806462546, 906504670, 1380905136); + int b0 = (1434025872); + int3x3 r0 = int3x3(0, 0, 0, 0, 0, 0, 0, 0, 0); + TestUtils.AreEqual(r0, a0 / b0); + + int3x3 a1 = int3x3(25493909, 123300377, 643754735, 2084019932, 2047825037, 458304263, 741331531, 466443901, 2110004616); + int b1 = (1196815948); + int3x3 r1 = int3x3(0, 0, 0, 1, 1, 0, 0, 0, 1); + TestUtils.AreEqual(r1, a1 / b1); + + int3x3 a2 = int3x3(1500687214, 1617154145, 2040203220, 2103351724, 485536709, 402141749, 1477264254, 1629069474, 1549487015); + int b2 = (1453264263); + int3x3 r2 = int3x3(1, 1, 1, 1, 0, 0, 1, 1, 1); + TestUtils.AreEqual(r2, a2 / b2); + + int3x3 a3 = int3x3(670594363, 155415284, 207130003, 1596922206, 1730223836, 1528374182, 1878500631, 1245757182, 1471308702); + int b3 = (2040479674); + int3x3 r3 = int3x3(0, 0, 0, 0, 0, 0, 0, 0, 0); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void int3x3_operator_div_scalar_wide() + { + int a0 = (519165704); + int3x3 b0 = int3x3(1295178177, 775214121, 467772046, 1156881598, 310396565, 759759959, 243837702, 1616314235, 1053470225); + int3x3 r0 = int3x3(0, 0, 1, 0, 1, 0, 2, 0, 0); + TestUtils.AreEqual(r0, a0 / b0); + + int a1 = (1320630160); + int3x3 b1 = int3x3(378773841, 4223608, 1971105754, 2054406020, 219939614, 1603672651, 2006134295, 888535397, 1493077923); + int3x3 r1 = int3x3(3, 312, 0, 0, 6, 0, 0, 1, 0); + TestUtils.AreEqual(r1, a1 / b1); + + int a2 = (615835131); + int3x3 b2 = int3x3(1045603945, 452709946, 1074919059, 467037221, 1485241506, 1775728786, 481521341, 68149923, 80867357); + int3x3 r2 = int3x3(0, 1, 0, 1, 0, 0, 1, 9, 7); + TestUtils.AreEqual(r2, a2 / b2); + + int a3 = (1294049272); + int3x3 b3 = int3x3(470535313, 1235850199, 631464286, 687722755, 412827650, 1258012095, 1286792622, 1799223034, 766890491); + int3x3 r3 = int3x3(2, 1, 2, 1, 3, 1, 1, 0, 1); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void int3x3_operator_mod_wide_wide() + { + int3x3 a0 = int3x3(258342924, 1454754891, 723352342, 1981431473, 531756042, 716993627, 1667903349, 1331097004, 1776856101); + int3x3 b0 = int3x3(1990080167, 1197348066, 651970512, 1659454050, 241005212, 1866255454, 1440101415, 595220963, 408818410); + int3x3 r0 = int3x3(258342924, 257406825, 71381830, 321977423, 49745618, 716993627, 227801934, 140655078, 141582461); + TestUtils.AreEqual(r0, a0 % b0); + + int3x3 a1 = int3x3(17598216, 1474345080, 1681376293, 813624265, 1617478722, 498370451, 780075943, 1754430321, 653235398); + int3x3 b1 = int3x3(198222574, 549504274, 239973807, 321398087, 658171840, 1511495237, 1048325585, 1126739824, 666641241); + int3x3 r1 = int3x3(17598216, 375336532, 1559644, 170828091, 301135042, 498370451, 780075943, 627690497, 653235398); + TestUtils.AreEqual(r1, a1 % b1); + + int3x3 a2 = int3x3(1517128354, 966216200, 590067427, 1283434795, 1910903650, 1125967790, 1180537254, 308567230, 543945394); + int3x3 b2 = int3x3(38017598, 418797691, 618700513, 1941062990, 158556432, 1081063558, 427329468, 148111230, 1251162672); + int3x3 r2 = int3x3(34442032, 128620818, 590067427, 1283434795, 8226466, 44904232, 325878318, 12344770, 543945394); + TestUtils.AreEqual(r2, a2 % b2); + + int3x3 a3 = int3x3(483834400, 308703874, 383723801, 1181975437, 1161083599, 1608412916, 111825133, 786866017, 1225576256); + int3x3 b3 = int3x3(1856322297, 1214781084, 401954255, 1323259633, 1167744452, 1816151689, 541163525, 664455763, 1738838503); + int3x3 r3 = int3x3(483834400, 308703874, 383723801, 1181975437, 1161083599, 1608412916, 111825133, 122410254, 1225576256); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void int3x3_operator_mod_wide_scalar() + { + int3x3 a0 = int3x3(560988938, 629524514, 767711194, 434281967, 1399805893, 792916846, 1663690927, 598661916, 1776636144); + int b0 = (1156862367); + int3x3 r0 = int3x3(560988938, 629524514, 767711194, 434281967, 242943526, 792916846, 506828560, 598661916, 619773777); + TestUtils.AreEqual(r0, a0 % b0); + + int3x3 a1 = int3x3(1287035793, 475209785, 327476870, 1617696916, 379853074, 477430114, 858399046, 712734431, 1506629323); + int b1 = (1743722161); + int3x3 r1 = int3x3(1287035793, 475209785, 327476870, 1617696916, 379853074, 477430114, 858399046, 712734431, 1506629323); + TestUtils.AreEqual(r1, a1 % b1); + + int3x3 a2 = int3x3(199829950, 1986626876, 1351725413, 1549678101, 431765276, 1315833792, 1664893153, 615834034, 780055604); + int b2 = (362269020); + int3x3 r2 = int3x3(199829950, 175281776, 264918353, 100602021, 69496256, 229026732, 215817073, 253565014, 55517564); + TestUtils.AreEqual(r2, a2 % b2); + + int3x3 a3 = int3x3(104179235, 1810536428, 1747026206, 1799535061, 875754431, 2049775667, 303673867, 93301056, 1944511005); + int b3 = (629966219); + int3x3 r3 = int3x3(104179235, 550603990, 487093768, 539602623, 245788212, 159877010, 303673867, 93301056, 54612348); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void int3x3_operator_mod_scalar_wide() + { + int a0 = (933347930); + int3x3 b0 = int3x3(549923387, 243114953, 1884274390, 1428033594, 655531454, 1622674954, 1107563514, 1614111094, 914801920); + int3x3 r0 = int3x3(383424543, 204003071, 933347930, 933347930, 277816476, 933347930, 933347930, 933347930, 18546010); + TestUtils.AreEqual(r0, a0 % b0); + + int a1 = (1432263179); + int3x3 b1 = int3x3(564431096, 1967013901, 1709750152, 1080102613, 13120773, 2042535998, 1505698002, 1640058084, 974167554); + int3x3 r1 = int3x3(303400987, 1432263179, 1432263179, 352160566, 2098922, 1432263179, 1432263179, 1432263179, 458095625); + TestUtils.AreEqual(r1, a1 % b1); + + int a2 = (758635306); + int3x3 b2 = int3x3(1387264978, 611743343, 1139002766, 1913935748, 1086810076, 991846486, 922870408, 35007468, 891877602); + int3x3 r2 = int3x3(758635306, 146891963, 758635306, 758635306, 758635306, 758635306, 758635306, 23478478, 758635306); + TestUtils.AreEqual(r2, a2 % b2); + + int a3 = (157349181); + int3x3 b3 = int3x3(83267982, 801093706, 546272767, 1665089132, 1889242068, 1179889796, 1690033703, 1333252321, 1960636489); + int3x3 r3 = int3x3(74081199, 157349181, 157349181, 157349181, 157349181, 157349181, 157349181, 157349181, 157349181); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void int3x3_operator_plus() + { + int3x3 a0 = int3x3(195392567, 222719748, 1002351013, 1570765263, 109389333, 1515950277, 1689763402, 291471785, 264115671); + int3x3 r0 = int3x3(195392567, 222719748, 1002351013, 1570765263, 109389333, 1515950277, 1689763402, 291471785, 264115671); + TestUtils.AreEqual(r0, +a0); + + int3x3 a1 = int3x3(1084131995, 2131702223, 715660442, 1995564647, 69731564, 1317851903, 1957501908, 531426536, 2012985092); + int3x3 r1 = int3x3(1084131995, 2131702223, 715660442, 1995564647, 69731564, 1317851903, 1957501908, 531426536, 2012985092); + TestUtils.AreEqual(r1, +a1); + + int3x3 a2 = int3x3(1334133318, 935436165, 1575048895, 2119066258, 781435471, 1659000230, 1301861249, 1153431944, 1360657696); + int3x3 r2 = int3x3(1334133318, 935436165, 1575048895, 2119066258, 781435471, 1659000230, 1301861249, 1153431944, 1360657696); + TestUtils.AreEqual(r2, +a2); + + int3x3 a3 = int3x3(578750954, 1791553179, 1288641627, 735146513, 328684789, 1370099515, 1575634098, 36481877, 1832055170); + int3x3 r3 = int3x3(578750954, 1791553179, 1288641627, 735146513, 328684789, 1370099515, 1575634098, 36481877, 1832055170); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void int3x3_operator_neg() + { + int3x3 a0 = int3x3(1385088677, 94114564, 1350664872, 1458616659, 2067164853, 218122493, 958484951, 270553961, 446497525); + int3x3 r0 = int3x3(-1385088677, -94114564, -1350664872, -1458616659, -2067164853, -218122493, -958484951, -270553961, -446497525); + TestUtils.AreEqual(r0, -a0); + + int3x3 a1 = int3x3(270503114, 1427605822, 2051940607, 1434247484, 485368391, 908365416, 1742096480, 990033169, 1368056141); + int3x3 r1 = int3x3(-270503114, -1427605822, -2051940607, -1434247484, -485368391, -908365416, -1742096480, -990033169, -1368056141); + TestUtils.AreEqual(r1, -a1); + + int3x3 a2 = int3x3(1350976157, 1934372287, 576597401, 785136322, 559205611, 1959833280, 162379661, 1200036971, 95281343); + int3x3 r2 = int3x3(-1350976157, -1934372287, -576597401, -785136322, -559205611, -1959833280, -162379661, -1200036971, -95281343); + TestUtils.AreEqual(r2, -a2); + + int3x3 a3 = int3x3(1969004480, 252975075, 1961335692, 1607042487, 832886233, 1300359361, 8438338, 431498011, 1534415387); + int3x3 r3 = int3x3(-1969004480, -252975075, -1961335692, -1607042487, -832886233, -1300359361, -8438338, -431498011, -1534415387); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void int3x3_operator_prefix_inc() + { + int3x3 a0 = int3x3(780471723, 954741756, 272723451, 2142862245, 606294309, 1514814550, 250124151, 444189162, 1833356994); + int3x3 r0 = int3x3(780471724, 954741757, 272723452, 2142862246, 606294310, 1514814551, 250124152, 444189163, 1833356995); + TestUtils.AreEqual(r0, ++a0); + + int3x3 a1 = int3x3(1915989169, 129540735, 1584496757, 1170613526, 986715680, 1701179230, 1397451003, 483952900, 1494652811); + int3x3 r1 = int3x3(1915989170, 129540736, 1584496758, 1170613527, 986715681, 1701179231, 1397451004, 483952901, 1494652812); + TestUtils.AreEqual(r1, ++a1); + + int3x3 a2 = int3x3(1268688387, 453850931, 1112537171, 621362788, 2063486914, 1612870531, 1161037742, 1083861484, 1583359796); + int3x3 r2 = int3x3(1268688388, 453850932, 1112537172, 621362789, 2063486915, 1612870532, 1161037743, 1083861485, 1583359797); + TestUtils.AreEqual(r2, ++a2); + + int3x3 a3 = int3x3(82587894, 72436569, 1094485773, 912422931, 1011314676, 261771874, 2042016403, 1102472175, 976635804); + int3x3 r3 = int3x3(82587895, 72436570, 1094485774, 912422932, 1011314677, 261771875, 2042016404, 1102472176, 976635805); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void int3x3_operator_postfix_inc() + { + int3x3 a0 = int3x3(241865086, 2145821641, 1596166022, 803592338, 529551271, 1656767229, 903047443, 1213663244, 1425753247); + int3x3 r0 = int3x3(241865086, 2145821641, 1596166022, 803592338, 529551271, 1656767229, 903047443, 1213663244, 1425753247); + TestUtils.AreEqual(r0, a0++); + + int3x3 a1 = int3x3(1384002775, 1159795446, 1343289659, 1227160199, 947635082, 137930180, 451018043, 1634297552, 2009552507); + int3x3 r1 = int3x3(1384002775, 1159795446, 1343289659, 1227160199, 947635082, 137930180, 451018043, 1634297552, 2009552507); + TestUtils.AreEqual(r1, a1++); + + int3x3 a2 = int3x3(1176922170, 2381860, 2062858295, 715101397, 1725384327, 446867079, 2101314783, 1460883320, 1683365096); + int3x3 r2 = int3x3(1176922170, 2381860, 2062858295, 715101397, 1725384327, 446867079, 2101314783, 1460883320, 1683365096); + TestUtils.AreEqual(r2, a2++); + + int3x3 a3 = int3x3(1319511974, 1938539756, 592683318, 1576213022, 1150548583, 904484472, 253685095, 70826818, 1423673637); + int3x3 r3 = int3x3(1319511974, 1938539756, 592683318, 1576213022, 1150548583, 904484472, 253685095, 70826818, 1423673637); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void int3x3_operator_prefix_dec() + { + int3x3 a0 = int3x3(1331961415, 1612382200, 1401591249, 2042075388, 1757136546, 1895858159, 1467742422, 578341664, 1336115745); + int3x3 r0 = int3x3(1331961414, 1612382199, 1401591248, 2042075387, 1757136545, 1895858158, 1467742421, 578341663, 1336115744); + TestUtils.AreEqual(r0, --a0); + + int3x3 a1 = int3x3(2059077641, 1862369220, 312317355, 1027543764, 1595492535, 1426262619, 1426620468, 674685792, 1423852012); + int3x3 r1 = int3x3(2059077640, 1862369219, 312317354, 1027543763, 1595492534, 1426262618, 1426620467, 674685791, 1423852011); + TestUtils.AreEqual(r1, --a1); + + int3x3 a2 = int3x3(1459529624, 107501474, 1261583506, 512900840, 1496855314, 777588547, 617644613, 1487639376, 625907330); + int3x3 r2 = int3x3(1459529623, 107501473, 1261583505, 512900839, 1496855313, 777588546, 617644612, 1487639375, 625907329); + TestUtils.AreEqual(r2, --a2); + + int3x3 a3 = int3x3(1452782388, 2076275981, 120447533, 262357170, 1887136873, 412907314, 846648478, 473291493, 286048219); + int3x3 r3 = int3x3(1452782387, 2076275980, 120447532, 262357169, 1887136872, 412907313, 846648477, 473291492, 286048218); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void int3x3_operator_postfix_dec() + { + int3x3 a0 = int3x3(1870005937, 1708534798, 704493460, 462940703, 2060593573, 228744869, 940247280, 1818778351, 1015253889); + int3x3 r0 = int3x3(1870005937, 1708534798, 704493460, 462940703, 2060593573, 228744869, 940247280, 1818778351, 1015253889); + TestUtils.AreEqual(r0, a0--); + + int3x3 a1 = int3x3(862428933, 2080259851, 653673271, 140452688, 1928164223, 1760916301, 1174531383, 634036198, 993137684); + int3x3 r1 = int3x3(862428933, 2080259851, 653673271, 140452688, 1928164223, 1760916301, 1174531383, 634036198, 993137684); + TestUtils.AreEqual(r1, a1--); + + int3x3 a2 = int3x3(1669210509, 1393579866, 471308632, 620865961, 220103745, 1407678826, 319906934, 1426931482, 488775250); + int3x3 r2 = int3x3(1669210509, 1393579866, 471308632, 620865961, 220103745, 1407678826, 319906934, 1426931482, 488775250); + TestUtils.AreEqual(r2, a2--); + + int3x3 a3 = int3x3(1681733117, 2060905976, 636358505, 1379709480, 451326084, 497925052, 549367303, 925145385, 55306458); + int3x3 r3 = int3x3(1681733117, 2060905976, 636358505, 1379709480, 451326084, 497925052, 549367303, 925145385, 55306458); + TestUtils.AreEqual(r3, a3--); + } + + [TestCompiler] + public static void int3x3_operator_bitwise_and_wide_wide() + { + int3x3 a0 = int3x3(1055241304, 859321394, 1088358961, 2090949513, 300561740, 651904515, 1331035868, 2012752753, 1298126656); + int3x3 b0 = int3x3(749698416, 748105424, 1842764797, 9990577, 1989102105, 1666634755, 58116798, 868036607, 1420638875); + int3x3 r0 = int3x3(749024336, 537928720, 1087769137, 8409473, 277479432, 575816707, 55888540, 867707761, 1141707264); + TestUtils.AreEqual(r0, a0 & b0); + + int3x3 a1 = int3x3(53199569, 1752363533, 1303061302, 1929998247, 1504941434, 470682792, 713577376, 1493231658, 1340884669); + int3x3 b1 = int3x3(1308767169, 564040763, 478617502, 806150474, 674015378, 1505309955, 36064977, 1779639327, 808650076); + int3x3 r1 = int3x3(33686209, 538087433, 209912598, 805855490, 136347666, 403178496, 33571456, 1207967754, 2098204); + TestUtils.AreEqual(r1, a1 & b1); + + int3x3 a2 = int3x3(1577921467, 44846626, 1105094388, 1143008413, 333009589, 2116296009, 2067254825, 121795325, 2122365250); + int3x3 b2 = int3x3(1634437037, 1997568501, 1930853951, 1901503461, 1508772523, 2010961769, 1495957269, 1914669725, 1263994006); + int3x3 r2 = int3x3(1074332585, 33572896, 1091986996, 1073782917, 298320545, 1979979081, 1495420417, 33686173, 1241513986); + TestUtils.AreEqual(r2, a2 & b2); + + int3x3 a3 = int3x3(1088796653, 1594120761, 965590824, 337823363, 1686791432, 1275524729, 173403097, 864715776, 1437598787); + int3x3 b3 = int3x3(491200541, 380703892, 282208487, 1416934135, 942735432, 615839538, 1698880188, 1204102677, 1811173266); + int3x3 r3 = int3x3(4530189, 369102864, 276834336, 337674883, 536870920, 67434032, 4246168, 58721280, 1102054402); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void int3x3_operator_bitwise_and_wide_scalar() + { + int3x3 a0 = int3x3(1513158868, 284695609, 734595037, 1566510707, 1601252476, 84213838, 314333543, 430856908, 753481263); + int b0 = (1173647397); + int3x3 r0 = int3x3(1076916228, 15732769, 29360133, 1163132961, 1164976164, 84148228, 11816997, 27545604, 81801253); + TestUtils.AreEqual(r0, a0 & b0); + + int3x3 a1 = int3x3(327392481, 2143619546, 1873208293, 126982769, 651482651, 1383096952, 1689107088, 1368301071, 366962092); + int b1 = (1619794917); + int3x3 r1 = int3x3(8394977, 1619265984, 1619264485, 8395361, 545526273, 1073742432, 1619794560, 1082923525, 9175460); + TestUtils.AreEqual(r1, a1 & b1); + + int3x3 a2 = int3x3(1729929586, 1914435619, 1592791064, 2047510829, 678485991, 586400261, 771972179, 309059606, 131945492); + int b2 = (989550739); + int3x3 r2 = int3x3(571998226, 840652803, 451940368, 973735937, 678451331, 586366977, 704862227, 309018642, 47796240); + TestUtils.AreEqual(r2, a2 & b2); + + int3x3 a3 = int3x3(1707451796, 1943201012, 558008097, 1070093422, 34324916, 258102213, 1800249857, 922911179, 1719705954); + int b3 = (394184188); + int3x3 r3 = int3x3(88376724, 324191476, 21136672, 390612076, 34259380, 123879876, 55345152, 386040264, 100696416); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void int3x3_operator_bitwise_and_scalar_wide() + { + int a0 = (477163326); + int3x3 b0 = int3x3(110453385, 703240362, 2075630560, 1884904031, 1734899436, 947945203, 1664399051, 458879298, 158491426); + int3x3 r0 = int3x3(68182536, 140544042, 405834528, 273697310, 73426476, 402681394, 3188234, 407953666, 141583138); + TestUtils.AreEqual(r0, a0 & b0); + + int a1 = (79772356); + int3x3 b1 = int3x3(2054527944, 202228212, 359225061, 639811396, 1821945318, 1821303024, 2030124055, 1985961756, 579780373); + int3x3 r1 = int3x3(4266688, 67174596, 71373508, 67123780, 75507908, 75505856, 79876, 71375364, 8403460); + TestUtils.AreEqual(r1, a1 & b1); + + int a2 = (2061831301); + int3x3 b2 = int3x3(1139618293, 1145191868, 1121606282, 1414714065, 688688277, 1508875606, 664318814, 2092766410, 1010043618); + int3x3 r2 = int3x3(1122304133, 1077939332, 1119881344, 1346371713, 671353989, 1491405828, 578813956, 2024080512, 941885568); + TestUtils.AreEqual(r2, a2 & b2); + + int a3 = (599967779); + int3x3 b3 = int3x3(47076367, 1325716015, 1119912335, 2083412385, 1805692137, 1689798540, 265665838, 1616867488, 244288538); + int3x3 r3 = int3x3(46284803, 50380835, 46170115, 537020449, 595626017, 545275904, 62949410, 541212704, 42108930); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void int3x3_operator_bitwise_or_wide_wide() + { + int3x3 a0 = int3x3(1920951869, 1750772852, 1420019191, 732977093, 1169579447, 229437930, 1966721348, 2039812323, 113550869); + int3x3 b0 = int3x3(214585254, 275414367, 858759675, 190211455, 1218691723, 2129565457, 1862809466, 495728846, 868064152); + int3x3 r0 = int3x3(2130669503, 2021326207, 2008016383, 737572863, 1303895999, 2146367483, 2134507390, 2107455727, 939376541); + TestUtils.AreEqual(r0, a0 | b0); + + int3x3 a1 = int3x3(1912038362, 1569990624, 1490718227, 1686257697, 2137727522, 1569900650, 856504729, 2033376384, 2086259889); + int3x3 b1 = int3x3(1756913766, 933656055, 247722084, 1884195075, 1804207631, 1913174711, 1815920856, 1226577606, 1696467642); + int3x3 r1 = int3x3(2046780414, 2142664695, 1591475831, 1959708963, 2146117167, 2140863231, 2134768089, 2034163398, 2103430843); + TestUtils.AreEqual(r1, a1 | b1); + + int3x3 a2 = int3x3(671790684, 1189001916, 1756048437, 417084592, 2024165808, 966008272, 2031026290, 1461019191, 1071959084); + int3x3 b2 = int3x3(186912044, 1778908130, 1461256625, 1142152181, 272117331, 1162254035, 870448102, 1845053992, 257334526); + int3x3 r2 = int3x3(724483964, 1860172798, 2142973365, 1558183925, 2025750515, 2111217619, 2079325174, 2147314239, 1073143038); + TestUtils.AreEqual(r2, a2 | b2); + + int3x3 a3 = int3x3(1645847295, 871350674, 736640317, 868515800, 767794452, 362186994, 96189073, 1924033224, 1971421809); + int3x3 b3 = int3x3(987295814, 1503050768, 1683307763, 1076253109, 1403888383, 561000721, 740143742, 343344681, 2074122472); + int3x3 r3 = int3x3(2061103871, 2080374162, 1878867455, 1944485885, 2146418687, 905361907, 767539967, 1996451561, 2141297401); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void int3x3_operator_bitwise_or_wide_scalar() + { + int3x3 a0 = int3x3(1295304853, 1307252624, 350194630, 1128063578, 1774824542, 2085245467, 1988423804, 999162350, 2110327307); + int b0 = (1305527136); + int3x3 r0 = int3x3(1307888629, 1308350448, 1574947814, 1341973370, 1842999166, 2111492987, 2144662396, 2145305582, 2111425387); + TestUtils.AreEqual(r0, a0 | b0); + + int3x3 a1 = int3x3(1050875188, 1317039676, 228656898, 41280811, 1536908787, 606786773, 1739461580, 2040936581, 1350320187); + int b1 = (341855232); + int3x3 r1 = int3x3(1055087924, 1591766588, 501305090, 376827179, 1610309107, 879418581, 2012110796, 2112257157, 1417432123); + TestUtils.AreEqual(r1, a1 | b1); + + int3x3 a2 = int3x3(1377874553, 1496806239, 1732466858, 1535976093, 375675620, 1614193383, 226059393, 697385997, 112556963); + int b2 = (1522262112); + int3x3 r2 = int3x3(1522266745, 1539306367, 2147219690, 1539302141, 1593834212, 2059395815, 1610343649, 2075911277, 1589640163); + TestUtils.AreEqual(r2, a2 | b2); + + int3x3 a3 = int3x3(1614163749, 1370656810, 1286074530, 1155438844, 1835671387, 440002979, 1569359727, 5393691, 774282482); + int b3 = (1583289054); + int3x3 r3 = int3x3(2122268671, 1610584830, 1593832190, 1591712510, 2139037663, 1585445887, 1608488959, 1583308767, 2122292990); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void int3x3_operator_bitwise_or_scalar_wide() + { + int a0 = (1768627592); + int3x3 b0 = int3x3(1849658052, 1759912154, 729979455, 975926310, 1987690876, 1809506714, 1160695341, 408963395, 314072711); + int3x3 r0 = int3x3(1870634956, 1777286618, 1810603967, 2070642094, 2138824188, 1811676570, 1836048301, 2037079499, 2080071567); + TestUtils.AreEqual(r0, a0 | b0); + + int a1 = (1560007537); + int3x3 b1 = int3x3(1709003416, 977086639, 1448375596, 1689568808, 595543345, 559778387, 621080913, 438994183, 1742637145); + int3x3 r1 = int3x3(2113917945, 2130705407, 1593833341, 2097141625, 2147473265, 2113919859, 2113926001, 1593562999, 2147474297); + TestUtils.AreEqual(r1, a1 | b1); + + int a2 = (1219409263); + int3x3 b2 = int3x3(1602932494, 1204461702, 2111538444, 836730895, 1207638621, 802100209, 1089077339, 1315030334, 249047666); + int3x3 r2 = int3x3(1605304175, 1341044207, 2113910127, 2046801263, 1342160767, 1877981183, 1223603583, 1324348799, 1325318015); + TestUtils.AreEqual(r2, a2 | b2); + + int a3 = (1604790897); + int3x3 b3 = int3x3(1848168086, 347254235, 1777613639, 1876731927, 842785732, 1023558747, 1567635900, 1888818835, 1681286114); + int3x3 r3 = int3x3(2142236407, 1605873659, 2146909047, 2147461751, 2143284213, 2141679227, 1610038269, 2142715635, 2142727155); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void int3x3_operator_bitwise_xor_wide_wide() + { + int3x3 a0 = int3x3(1843655608, 362425681, 640805534, 1342040268, 945678755, 980321850, 390165019, 1682422658, 303897251); + int3x3 b0 = int3x3(1422803441, 1234691140, 119589253, 1101464929, 121896337, 1880109018, 1000210266, 1718938232, 464406940); + int3x3 r0 = int3x3(959296073, 1544407317, 554771227, 240840109, 1058935858, 1249815008, 752651585, 36917754, 162747199); + TestUtils.AreEqual(r0, a0 ^ b0); + + int3x3 a1 = int3x3(230477768, 1103646442, 1503102919, 26631152, 1016475570, 1862440929, 379588576, 1943580404, 691527166); + int3x3 b1 = int3x3(884337881, 34199854, 1430659227, 126415540, 1069919967, 1810763253, 2082802224, 941097951, 27782297); + int3x3 r1 = int3x3(956900113, 1136760772, 215066460, 102672708, 55804269, 82614804, 1787102672, 1270918443, 680538471); + TestUtils.AreEqual(r1, a1 ^ b1); + + int3x3 a2 = int3x3(723280696, 497086939, 1640104913, 893178410, 1596765788, 664096470, 2043360590, 799560121, 287637604); + int3x3 b2 = int3x3(156353074, 607061607, 470737131, 1151564598, 8268481, 434405645, 519003095, 1880915120, 608970922); + int3x3 r2 = int3x3(575512842, 965736380, 2110579514, 1906288924, 1599249565, 1047646171, 1730440857, 1605643529, 896084174); + TestUtils.AreEqual(r2, a2 ^ b2); + + int3x3 a3 = int3x3(696169196, 2067184169, 1208059988, 1250597330, 1386507647, 1889791408, 2084012261, 308683100, 995657536); + int3x3 b3 = int3x3(1809455754, 1079250101, 514389994, 272120301, 1282399149, 1045003273, 1596550715, 1654640361, 147544177); + int3x3 r3 = int3x3(1118087270, 996325020, 1453948862, 1521655871, 516667090, 1323995577, 589229790, 1895428021, 865328945); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void int3x3_operator_bitwise_xor_wide_scalar() + { + int3x3 a0 = int3x3(169345668, 176087064, 2084362901, 1663924004, 193851255, 517476661, 905336222, 863800783, 365003873); + int b0 = (354464228); + int3x3 r0 = int3x3(523809632, 526275068, 1763470193, 1980614336, 514678419, 200843473, 550954106, 643578923, 14759301); + TestUtils.AreEqual(r0, a0 ^ b0); + + int3x3 a1 = int3x3(835837496, 1464576786, 625604047, 1700827127, 2003392824, 1481813598, 1077374714, 1043379893, 1991576049); + int b1 = (954341348); + int3x3 r1 = int3x3(154388956, 1873394934, 497803819, 1568839699, 1334529756, 1622194618, 2027256094, 114467153, 1314332181); + TestUtils.AreEqual(r1, a1 ^ b1); + + int3x3 a2 = int3x3(781860967, 1196907956, 858716109, 858484213, 178843494, 1223183458, 866652388, 1771693181, 1206307664); + int b2 = (60088394); + int3x3 r2 = int3x3(755933229, 1153678846, 817502087, 817860031, 154930988, 1266461736, 809300142, 1779237943, 1148332826); + TestUtils.AreEqual(r2, a2 ^ b2); + + int3x3 a3 = int3x3(2037729583, 497725784, 1367278685, 962962860, 906632547, 1570278596, 1744797352, 574677361, 1363709514); + int b3 = (1324393116); + int3x3 r3 = int3x3(931523507, 1398412228, 529508033, 2006255408, 2029699071, 325594712, 688905268, 1823491053, 532163798); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void int3x3_operator_bitwise_xor_scalar_wide() + { + int a0 = (1361775641); + int3x3 b0 = int3x3(1452773578, 459050892, 1986218254, 1689037698, 999278344, 1229114508, 1087843538, 733699740, 106187872); + int3x3 r0 = int3x3(129801427, 1249346453, 659047703, 898082715, 1789184785, 409583765, 301736139, 2056278661, 1467957369); + TestUtils.AreEqual(r0, a0 ^ b0); + + int a1 = (1533632738); + int3x3 b1 = int3x3(1107817672, 492506236, 597602329, 1439603382, 1001169118, 1231718216, 1693179077, 1050897427, 1796435561); + int3x3 r1 = int3x3(426677290, 1177709726, 2029506811, 245889620, 1623572540, 302245802, 1065532455, 1707740401, 813305483); + TestUtils.AreEqual(r1, a1 ^ b1); + + int a2 = (1100532547); + int3x3 b2 = int3x3(2106589181, 79691722, 851486414, 381749210, 1743618507, 2038827673, 1680906962, 161437943, 171927307); + int3x3 r2 = int3x3(1008153790, 1160197257, 1935175053, 1465502873, 645221000, 941539802, 631787921, 1208456116, 1269279816); + TestUtils.AreEqual(r2, a2 ^ b2); + + int a3 = (277703584); + int3x3 b3 = int3x3(1344718195, 1634011177, 28540247, 1205447252, 150341716, 899457210, 1927941858, 1213321665, 1943899052); + int3x3 r3 = int3x3(1084993235, 1911055241, 289281783, 1465172468, 410739700, 621923098, 1650943298, 1490860641, 1666244620); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void int3x3_operator_left_shift() + { + int3x3 a0 = int3x3(1129100049, 829482269, 1571297368, 443753193, 1872142968, 249554593, 892627436, 980302862, 62369727); + int b0 = (218351941); + int3x3 r0 = int3x3(1771463200, 773628832, -1258091776, 1315200288, -220967168, -604187616, -1500693120, 1304920512, 1995831264); + TestUtils.AreEqual(r0, a0 << b0); + + int3x3 a1 = int3x3(849916599, 108441902, 1959056531, 1779118882, 1451674188, 2082026915, 1149883636, 1380536034, 186532735); + int b1 = (1271350845); + int3x3 r1 = int3x3(-536870912, -1073741824, 1610612736, 1073741824, -2147483648, 1610612736, -2147483648, 1073741824, -536870912); + TestUtils.AreEqual(r1, a1 << b1); + + int3x3 a2 = int3x3(1487486874, 752067504, 1647167336, 772453640, 456967739, 947384545, 1463252873, 1315516161, 640579158); + int b2 = (1498738574); + int3x3 r2 = int3x3(1340506112, -387186688, 1910112256, -1388183552, 831438848, -63422464, -572375040, 1270890496, -1651146752); + TestUtils.AreEqual(r2, a2 << b2); + + int3x3 a3 = int3x3(56630178, 2142944517, 565484033, 965161323, 1634169280, 1821547426, 1959741996, 1189216014, 2088913234); + int b3 = (1650899378); + int3x3 r3 = int3x3(1854406656, -200015872, 1745092608, -978583552, -956301312, 1854406656, 682622976, -63438848, 625475584); + TestUtils.AreEqual(r3, a3 << b3); + } + + [TestCompiler] + public static void int3x3_operator_right_shift() + { + int3x3 a0 = int3x3(809126085, 908563670, 763568837, 1986717290, 1174507510, 646821842, 1242726074, 390811632, 1521420393); + int b0 = (994800051); + int3x3 r0 = int3x3(1543, 1732, 1456, 3789, 2240, 1233, 2370, 745, 2901); + TestUtils.AreEqual(r0, a0 >> b0); + + int3x3 a1 = int3x3(1923166649, 400863878, 667378673, 1611921244, 307750782, 479442287, 2014389412, 1673938174, 1075916177); + int b1 = (102096936); + int3x3 r1 = int3x3(7512369, 1565874, 2606947, 6296567, 1202151, 1872821, 7868708, 6538820, 4202797); + TestUtils.AreEqual(r1, a1 >> b1); + + int3x3 a2 = int3x3(1248577253, 813936577, 848976170, 500930883, 662405800, 126875849, 1103917083, 1199000503, 955487090); + int b2 = (848199210); + int3x3 r2 = int3x3(1219313, 794859, 829078, 489190, 646880, 123902, 1078044, 1170898, 933092); + TestUtils.AreEqual(r2, a2 >> b2); + + int3x3 a3 = int3x3(1013356510, 185228398, 87452680, 2021602226, 1401766495, 275199908, 664576720, 363706280, 1600231415); + int b3 = (391605984); + int3x3 r3 = int3x3(1013356510, 185228398, 87452680, 2021602226, 1401766495, 275199908, 664576720, 363706280, 1600231415); + TestUtils.AreEqual(r3, a3 >> b3); + } + + [TestCompiler] + public static void int3x3_operator_bitwise_not() + { + int3x3 a0 = int3x3(111796841, 603562399, 745091931, 853183268, 1110916612, 381888399, 1891338755, 1506860135, 771210628); + int3x3 r0 = int3x3(-111796842, -603562400, -745091932, -853183269, -1110916613, -381888400, -1891338756, -1506860136, -771210629); + TestUtils.AreEqual(r0, ~a0); + + int3x3 a1 = int3x3(787710759, 96456785, 916013379, 203444882, 1172294211, 1020232736, 683852713, 375158799, 881353367); + int3x3 r1 = int3x3(-787710760, -96456786, -916013380, -203444883, -1172294212, -1020232737, -683852714, -375158800, -881353368); + TestUtils.AreEqual(r1, ~a1); + + int3x3 a2 = int3x3(1218471344, 592898220, 443427914, 1385118179, 215320517, 860122767, 1411266016, 1349739899, 686325107); + int3x3 r2 = int3x3(-1218471345, -592898221, -443427915, -1385118180, -215320518, -860122768, -1411266017, -1349739900, -686325108); + TestUtils.AreEqual(r2, ~a2); + + int3x3 a3 = int3x3(829984855, 319233142, 156019905, 1467719681, 1193642973, 957020051, 610113447, 1906177458, 1022824453); + int3x3 r3 = int3x3(-829984856, -319233143, -156019906, -1467719682, -1193642974, -957020052, -610113448, -1906177459, -1022824454); + TestUtils.AreEqual(r3, ~a3); + } + + [TestCase /* For player builds */] + public static void int3x3_EqualsObjectOverride() + { + TestUtils.IsFalse(new int3x3().Equals((object)new int())); + TestUtils.IsTrue(new int3x3().Equals((object)new int3x3())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestInt3x3.gen.cs.meta b/src/Tests/Tests/Shared/TestInt3x3.gen.cs.meta new file mode 100644 index 00000000..c709a889 --- /dev/null +++ b/src/Tests/Tests/Shared/TestInt3x3.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1e50b53d0c552004db62a39d61d06297 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestInt3x4.gen.cs b/src/Tests/Tests/Shared/TestInt3x4.gen.cs new file mode 100644 index 00000000..f9b43392 --- /dev/null +++ b/src/Tests/Tests/Shared/TestInt3x4.gen.cs @@ -0,0 +1,1240 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestInt3x4 + { + [TestCompiler] + public static void int3x4_zero() + { + TestUtils.AreEqual(0, int3x4.zero.c0.x); + TestUtils.AreEqual(0, int3x4.zero.c0.y); + TestUtils.AreEqual(0, int3x4.zero.c0.z); + TestUtils.AreEqual(0, int3x4.zero.c1.x); + TestUtils.AreEqual(0, int3x4.zero.c1.y); + TestUtils.AreEqual(0, int3x4.zero.c1.z); + TestUtils.AreEqual(0, int3x4.zero.c2.x); + TestUtils.AreEqual(0, int3x4.zero.c2.y); + TestUtils.AreEqual(0, int3x4.zero.c2.z); + TestUtils.AreEqual(0, int3x4.zero.c3.x); + TestUtils.AreEqual(0, int3x4.zero.c3.y); + TestUtils.AreEqual(0, int3x4.zero.c3.z); + } + + [TestCompiler] + public static void int3x4_operator_equal_wide_wide() + { + int3x4 a0 = int3x4(2105871082, 35218899, 1550755093, 764676020, 606743782, 1208156098, 1023640014, 1038468316, 1416064367, 727143393, 2061243891, 184669837); + int3x4 b0 = int3x4(1477587886, 579629692, 540974792, 208405066, 2063397938, 1060167409, 362592601, 2097545362, 277670088, 426944490, 901076223, 857900673); + bool3x4 r0 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + int3x4 a1 = int3x4(1303661760, 2044073738, 370395888, 1822916805, 1076983135, 345215866, 833676277, 1987782708, 1481088614, 1364754268, 93639636, 1850596922); + int3x4 b1 = int3x4(1548779757, 325265488, 312658571, 176373760, 2052378097, 858156597, 982817797, 1252095508, 882634538, 1959142806, 72495800, 1077678183); + bool3x4 r1 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + int3x4 a2 = int3x4(2073471507, 1745989448, 28118669, 1267554232, 1292918049, 1423451579, 644384701, 1985492825, 240481133, 2130667921, 17376735, 1263869085); + int3x4 b2 = int3x4(1729269763, 1607675346, 1813461519, 1204794859, 1324801873, 1975336, 439410532, 294085211, 1031782338, 1118745564, 180311719, 433246570); + bool3x4 r2 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + int3x4 a3 = int3x4(437371027, 1093339523, 1683805602, 764261037, 1845666482, 399277628, 714152770, 148255091, 784823865, 1712722195, 1706849865, 607710807); + int3x4 b3 = int3x4(1622531532, 1178609353, 373010678, 1231165960, 966395555, 788609772, 215241459, 1411005263, 1287904654, 1656358051, 1985807372, 1041678082); + bool3x4 r3 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void int3x4_operator_equal_wide_scalar() + { + int3x4 a0 = int3x4(437822262, 2020661134, 541786900, 853113810, 23716499, 179951405, 1409026299, 948838849, 953202998, 691955848, 1926262965, 1851546137); + int b0 = (1332833578); + bool3x4 r0 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + int3x4 a1 = int3x4(712957637, 1049962241, 1836975611, 1016802970, 390120467, 464814777, 1451642042, 289137869, 152339338, 808355440, 660053867, 597354173); + int b1 = (2028784869); + bool3x4 r1 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + int3x4 a2 = int3x4(67320270, 35153827, 602895443, 186996278, 129611815, 1031574999, 1697392883, 1463742000, 857785521, 611116281, 594150729, 375387566); + int b2 = (151461188); + bool3x4 r2 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + int3x4 a3 = int3x4(1984352551, 570698441, 1872629381, 1263218472, 315982238, 122473806, 1404530826, 43943273, 1695786992, 2085125114, 432271298, 465353570); + int b3 = (1925707182); + bool3x4 r3 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void int3x4_operator_equal_scalar_wide() + { + int a0 = (542329200); + int3x4 b0 = int3x4(1115584594, 684107773, 1928988941, 890709324, 641152437, 1410341302, 497505660, 1068223109, 2014009435, 213835595, 1592428361, 1819361470); + bool3x4 r0 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + int a1 = (448650623); + int3x4 b1 = int3x4(1942175642, 64377057, 1485938610, 1146305380, 1312317120, 263290348, 812663708, 1585209188, 40646617, 1378718922, 1957797737, 873652576); + bool3x4 r1 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + int a2 = (1780082094); + int3x4 b2 = int3x4(1513270921, 2095980581, 1413074719, 1387984261, 1547119354, 924385171, 1253636050, 1477542688, 969120167, 591812191, 856880926, 1114040166); + bool3x4 r2 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + int a3 = (2107388425); + int3x4 b3 = int3x4(1368188588, 512677295, 1337925727, 2076181515, 1317314747, 299981273, 601822512, 1079453890, 125277108, 1257151509, 1915342590, 1034639325); + bool3x4 r3 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void int3x4_operator_not_equal_wide_wide() + { + int3x4 a0 = int3x4(1977284100, 1293292704, 1547283851, 422428953, 195833190, 1711544892, 5606053, 737069074, 647386678, 13079405, 1413841590, 1076166545); + int3x4 b0 = int3x4(1514195556, 957972049, 507667364, 581861672, 1128094576, 940096636, 57559040, 181752616, 962017320, 1762015406, 1107218953, 2042026522); + bool3x4 r0 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + int3x4 a1 = int3x4(1211445174, 1289303469, 1436402489, 1129570126, 1566836685, 1343313905, 329259205, 1774944480, 33906739, 2055853627, 2035015372, 1702756001); + int3x4 b1 = int3x4(836002288, 570272309, 2112081980, 1500634658, 1787808345, 566425667, 2037529609, 1520589840, 266793699, 538816359, 2075474643, 553571317); + bool3x4 r1 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + int3x4 a2 = int3x4(1164186087, 329853698, 769052491, 1893312730, 438029011, 1894010522, 1365847542, 1292942830, 2146008097, 1520743598, 861728782, 1999977058); + int3x4 b2 = int3x4(218264354, 654754196, 1392180230, 870065147, 1398749829, 711281563, 1999640291, 231234857, 210910234, 365281355, 170643407, 757340716); + bool3x4 r2 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + int3x4 a3 = int3x4(1334556487, 1728108667, 1198848973, 7011150, 1280729934, 1553569869, 1782228282, 731582167, 2041979262, 128396656, 143519087, 154742298); + int3x4 b3 = int3x4(639973212, 1147047891, 537350186, 1283454178, 735732152, 1218138135, 474815930, 174656455, 473248758, 1077993023, 1063662917, 181750095); + bool3x4 r3 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void int3x4_operator_not_equal_wide_scalar() + { + int3x4 a0 = int3x4(1038269360, 1427812625, 103361237, 1347017023, 1523584313, 150442802, 660334527, 719113717, 262959423, 484398043, 506946952, 226568494); + int b0 = (768873026); + bool3x4 r0 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + int3x4 a1 = int3x4(507918242, 923269270, 166187260, 114581840, 1045389187, 1648095254, 1461803977, 61801615, 1317840133, 2146927809, 1557151164, 1284033253); + int b1 = (1702162286); + bool3x4 r1 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + int3x4 a2 = int3x4(1345705546, 611028295, 1368046109, 1848036266, 2025452920, 373992983, 289537519, 1388743060, 146455100, 1854553487, 872755032, 2113020512); + int b2 = (1747302566); + bool3x4 r2 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + int3x4 a3 = int3x4(1062447442, 109864030, 1583997921, 1732461790, 1276630817, 721080697, 922945173, 1528002730, 282331576, 1372281893, 167200566, 1271483982); + int b3 = (632285066); + bool3x4 r3 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void int3x4_operator_not_equal_scalar_wide() + { + int a0 = (1652127596); + int3x4 b0 = int3x4(953791238, 271722683, 1278885987, 735128017, 112416504, 25967222, 1761444475, 1844594536, 1199122922, 634219279, 942501101, 67161343); + bool3x4 r0 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + int a1 = (969944293); + int3x4 b1 = int3x4(833229499, 1304301133, 704045745, 345012334, 1253134152, 325772538, 855127202, 793668881, 1584481616, 1101301152, 276853534, 987168816); + bool3x4 r1 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + int a2 = (1258105989); + int3x4 b2 = int3x4(362645228, 293978043, 1772395973, 1692007315, 681268929, 1535518457, 595209334, 25745185, 1278016813, 2125682481, 2037751005, 1405297618); + bool3x4 r2 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + int a3 = (1825546885); + int3x4 b3 = int3x4(1584424742, 1779859088, 1262387250, 936213998, 739749071, 1934808433, 1333711144, 571211509, 445791940, 43428024, 1509344718, 1643255886); + bool3x4 r3 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void int3x4_operator_less_wide_wide() + { + int3x4 a0 = int3x4(1486550609, 1779244308, 1602148045, 1614085440, 1975613414, 942838342, 1092279031, 373677431, 1419098312, 337757077, 1081797900, 1336745069); + int3x4 b0 = int3x4(97842578, 536551311, 413528975, 1838293684, 1283898480, 1456599961, 1080278602, 529676676, 156584048, 117348799, 246927124, 1916615924); + bool3x4 r0 = bool3x4(false, false, false, true, false, true, false, true, false, false, false, true); + TestUtils.AreEqual(r0, a0 < b0); + + int3x4 a1 = int3x4(840685445, 1220554047, 2013681746, 192965012, 532043965, 1000693402, 927236048, 1215860000, 780607596, 1882056852, 1354146545, 2135295778); + int3x4 b1 = int3x4(1731071394, 1328098431, 1014995792, 480319327, 1765937053, 1333997067, 688515308, 1856106947, 1303906227, 646821776, 1169473993, 316770064); + bool3x4 r1 = bool3x4(true, true, false, true, true, true, false, true, true, false, false, false); + TestUtils.AreEqual(r1, a1 < b1); + + int3x4 a2 = int3x4(1145973790, 1938006975, 895882838, 2006524299, 908581156, 1843349513, 1340458575, 1972095585, 1090933468, 924555996, 79585200, 1749924275); + int3x4 b2 = int3x4(1518155802, 416732703, 529193056, 1239623485, 2010112031, 2018560298, 285987009, 960617622, 462519015, 1473825625, 1187164011, 730583004); + bool3x4 r2 = bool3x4(true, false, false, false, true, true, false, false, false, true, true, false); + TestUtils.AreEqual(r2, a2 < b2); + + int3x4 a3 = int3x4(1088207695, 1484224850, 512353919, 562469379, 1743259263, 182124641, 1224472464, 1731920136, 1906896401, 425415911, 992649442, 515648372); + int3x4 b3 = int3x4(629133777, 1925375320, 689923293, 1818695099, 903783983, 495525944, 1923715956, 2850909, 1908553564, 1064607664, 1344783349, 494620587); + bool3x4 r3 = bool3x4(false, true, true, true, false, true, true, false, true, true, true, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void int3x4_operator_less_wide_scalar() + { + int3x4 a0 = int3x4(796797557, 670113454, 933579492, 278884514, 318174822, 1117630673, 741886928, 1990922600, 1030849597, 1546212312, 1718582899, 1648393417); + int b0 = (746564682); + bool3x4 r0 = bool3x4(false, true, false, true, true, false, true, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 < b0); + + int3x4 a1 = int3x4(1857132231, 1294006045, 952084157, 1303736668, 845460171, 979430272, 1368236640, 24980695, 1434668705, 659552739, 1058492383, 165694933); + int b1 = (1909506562); + bool3x4 r1 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 < b1); + + int3x4 a2 = int3x4(1204097259, 281328069, 24629507, 1386458568, 1325149699, 1498707004, 1650355158, 1213017950, 1650457461, 759932777, 1542997846, 1227393490); + int b2 = (922212691); + bool3x4 r2 = bool3x4(false, true, true, false, false, false, false, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + int3x4 a3 = int3x4(1520634374, 1951142425, 1956860037, 681224518, 1889763470, 1915403219, 850845857, 1871934613, 1882514458, 1326783898, 1044736383, 24899250); + int b3 = (1750827258); + bool3x4 r3 = bool3x4(true, false, false, true, false, false, true, false, false, true, true, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void int3x4_operator_less_scalar_wide() + { + int a0 = (186400299); + int3x4 b0 = int3x4(1881344229, 813834467, 1254886626, 1353590345, 1412343685, 1555571443, 1540508298, 1735458634, 135888070, 1643818742, 248291654, 1739560105); + bool3x4 r0 = bool3x4(true, true, true, true, true, true, true, true, false, true, true, true); + TestUtils.AreEqual(r0, a0 < b0); + + int a1 = (728539891); + int3x4 b1 = int3x4(480507742, 1696553040, 540223931, 1840493353, 146833656, 798115946, 2002002066, 1011261705, 783550942, 1093071215, 598253401, 1432416562); + bool3x4 r1 = bool3x4(false, true, false, true, false, true, true, true, true, true, false, true); + TestUtils.AreEqual(r1, a1 < b1); + + int a2 = (1863582169); + int3x4 b2 = int3x4(103622950, 775175960, 116908309, 1213433625, 1428954824, 1760442490, 1208143947, 751820805, 1491872302, 560004484, 2065157473, 310839658); + bool3x4 r2 = bool3x4(false, false, false, false, false, false, false, false, false, false, true, false); + TestUtils.AreEqual(r2, a2 < b2); + + int a3 = (697329242); + int3x4 b3 = int3x4(898786601, 1448893980, 1204091943, 1933043135, 828031833, 1737703663, 1672512847, 1112905025, 1666248737, 1352503217, 406395888, 1734008932); + bool3x4 r3 = bool3x4(true, true, true, true, true, true, true, true, true, true, false, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void int3x4_operator_greater_wide_wide() + { + int3x4 a0 = int3x4(2087717754, 1725569452, 1298066182, 1693943616, 1319019629, 70674491, 1042499725, 1002821508, 1021857133, 1744374599, 821751047, 467646903); + int3x4 b0 = int3x4(85148514, 293632137, 1151128249, 409440398, 1115020183, 1508500597, 1834583302, 1755218534, 1788761753, 1128238489, 834223713, 1578743290); + bool3x4 r0 = bool3x4(true, true, true, true, true, false, false, false, false, true, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + int3x4 a1 = int3x4(2029731638, 1377214212, 1207816926, 474621063, 20781266, 366593779, 2068457387, 10181449, 793634464, 144474612, 99947390, 930377263); + int3x4 b1 = int3x4(1647150256, 1756397855, 1131080201, 1208965204, 1495161099, 1283714281, 908051907, 412849651, 815822687, 730271942, 40756039, 883326140); + bool3x4 r1 = bool3x4(true, false, true, false, false, false, true, false, false, false, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + int3x4 a2 = int3x4(683686232, 742803073, 918292048, 875621429, 1764985258, 411384146, 1921397684, 1349107119, 640399120, 1487719331, 1467989523, 1834244794); + int3x4 b2 = int3x4(476260632, 1024136446, 1440596667, 1253494041, 146826162, 1798399573, 2085029408, 187939428, 1009192934, 1694822273, 1866590874, 113805226); + bool3x4 r2 = bool3x4(true, false, false, false, true, false, false, true, false, false, false, true); + TestUtils.AreEqual(r2, a2 > b2); + + int3x4 a3 = int3x4(1778580304, 334604025, 689749101, 1478795900, 716772993, 1072711623, 388277128, 290673156, 619539670, 1666212670, 496667761, 638935614); + int3x4 b3 = int3x4(1331524948, 5928360, 1884858608, 1988975599, 493888072, 731556294, 1597968264, 727668246, 1260583385, 1921631225, 359265523, 856088703); + bool3x4 r3 = bool3x4(true, true, false, false, true, true, false, false, false, false, true, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void int3x4_operator_greater_wide_scalar() + { + int3x4 a0 = int3x4(1208626274, 239697208, 1979453345, 1253474001, 1590192876, 1487911635, 1673945595, 1662650098, 222749855, 1433540517, 566635217, 1773305960); + int b0 = (1715176566); + bool3x4 r0 = bool3x4(false, false, true, false, false, false, false, false, false, false, false, true); + TestUtils.AreEqual(r0, a0 > b0); + + int3x4 a1 = int3x4(1850273578, 325913453, 333381537, 1905567362, 2053577491, 570397194, 2128431130, 1735325311, 529971908, 1663525234, 1972984241, 1587865063); + int b1 = (206147145); + bool3x4 r1 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + int3x4 a2 = int3x4(488268523, 812076921, 181082921, 1281638484, 1818357732, 116518997, 1397728785, 1924199337, 742950077, 1463993051, 1598027926, 842851852); + int b2 = (121921923); + bool3x4 r2 = bool3x4(true, true, true, true, true, false, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 > b2); + + int3x4 a3 = int3x4(160842093, 540338405, 174088887, 1609299242, 425486336, 1462766889, 651513452, 1122649822, 771802057, 839323192, 325778683, 406189885); + int b3 = (1226313895); + bool3x4 r3 = bool3x4(false, false, false, true, false, true, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void int3x4_operator_greater_scalar_wide() + { + int a0 = (480938827); + int3x4 b0 = int3x4(1824731899, 921496110, 586859044, 946430596, 1231356727, 1390167458, 1785807092, 28949024, 2037899283, 595656760, 1778095771, 1233500439); + bool3x4 r0 = bool3x4(false, false, false, false, false, false, false, true, false, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + int a1 = (1696302238); + int3x4 b1 = int3x4(1445965340, 484020151, 1586962841, 1361740714, 265628948, 2003122957, 332267433, 1128353075, 377919478, 982113135, 1117675960, 630865591); + bool3x4 r1 = bool3x4(true, true, true, true, true, false, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + int a2 = (1550679736); + int3x4 b2 = int3x4(895945757, 287025687, 643452096, 660504007, 613135893, 633307118, 514276792, 1377364317, 84491736, 746768197, 1282879723, 589415384); + bool3x4 r2 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 > b2); + + int a3 = (363082240); + int3x4 b3 = int3x4(1774333756, 741005890, 413100725, 702141547, 1434366582, 1489794027, 1710601432, 1914069735, 1811684885, 1007116016, 1883396218, 318035497); + bool3x4 r3 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void int3x4_operator_less_equal_wide_wide() + { + int3x4 a0 = int3x4(154092149, 1515170149, 1083970332, 785807178, 1401094881, 310537627, 868328962, 1990816725, 2035349541, 457043352, 1123282035, 1001842946); + int3x4 b0 = int3x4(77984380, 1712054191, 1566203809, 254834519, 450519938, 389457083, 1298669505, 207343167, 1214449047, 2059561026, 896534357, 1897470050); + bool3x4 r0 = bool3x4(false, true, true, false, false, true, true, false, false, true, false, true); + TestUtils.AreEqual(r0, a0 <= b0); + + int3x4 a1 = int3x4(1387761992, 195272789, 659549000, 888761458, 283706617, 1790185840, 899029812, 848317418, 1743712447, 1504407474, 1798441490, 1902791952); + int3x4 b1 = int3x4(521075677, 1848221945, 374708019, 1573731118, 2093466449, 1660210829, 1568778785, 1352157589, 1212771905, 1457525058, 1493446008, 1784768208); + bool3x4 r1 = bool3x4(false, true, false, true, true, false, true, true, false, false, false, false); + TestUtils.AreEqual(r1, a1 <= b1); + + int3x4 a2 = int3x4(606340844, 1994437705, 301831413, 654230470, 1223625081, 324292199, 1370931020, 1742769166, 1709242127, 105750466, 1655967312, 1455797002); + int3x4 b2 = int3x4(1993422493, 1378671664, 1447376929, 1405041439, 1765183746, 562894655, 1085068880, 1026386862, 884290156, 922346160, 330605896, 466570756); + bool3x4 r2 = bool3x4(true, false, true, true, true, true, false, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + int3x4 a3 = int3x4(366131629, 315848579, 1539610530, 99028560, 765767372, 1241881101, 527753961, 1271899705, 1439235979, 436585748, 1244486586, 2128710216); + int3x4 b3 = int3x4(1252369410, 2057993777, 1691801535, 2041799631, 557988228, 813610154, 1657573441, 983813335, 385144401, 1281329713, 285422763, 658643567); + bool3x4 r3 = bool3x4(true, true, true, true, false, false, true, false, false, true, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void int3x4_operator_less_equal_wide_scalar() + { + int3x4 a0 = int3x4(1479531977, 1427983411, 415250630, 1245345407, 1112546666, 1072990632, 1579912858, 101048307, 1070894375, 509818792, 1910488590, 85452501); + int b0 = (2004563877); + bool3x4 r0 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + int3x4 a1 = int3x4(518127023, 1097326500, 1964410699, 1968139888, 1191853379, 662096238, 1140643434, 754434551, 155343473, 995927387, 974873240, 1773400038); + int b1 = (1246249980); + bool3x4 r1 = bool3x4(true, true, false, false, true, true, true, true, true, true, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + int3x4 a2 = int3x4(497436329, 527516420, 1477043363, 1378470734, 96190147, 37188105, 839762283, 781102710, 766321672, 1145011483, 139031840, 127837780); + int b2 = (1825940497); + bool3x4 r2 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 <= b2); + + int3x4 a3 = int3x4(817806943, 649140851, 913173654, 1530989756, 856611228, 479496140, 287809619, 626008542, 2075114788, 269756518, 1123999963, 1061241170); + int b3 = (1248492707); + bool3x4 r3 = bool3x4(true, true, true, false, true, true, true, true, false, true, true, true); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void int3x4_operator_less_equal_scalar_wide() + { + int a0 = (1899193992); + int3x4 b0 = int3x4(915011820, 980913757, 1337699683, 1476321359, 1102143668, 660493983, 184664508, 381579707, 1954892821, 1295090571, 1440368586, 1696003686); + bool3x4 r0 = bool3x4(false, false, false, false, false, false, false, false, true, false, false, false); + TestUtils.AreEqual(r0, a0 <= b0); + + int a1 = (88708652); + int3x4 b1 = int3x4(1332251857, 1310713644, 2112132784, 48951945, 1888568027, 39340955, 1108242207, 260777425, 593122164, 291471959, 253457314, 1264570386); + bool3x4 r1 = bool3x4(true, true, true, false, true, false, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 <= b1); + + int a2 = (699618012); + int3x4 b2 = int3x4(927735863, 2063158939, 932253787, 1168754049, 749328788, 1882694892, 168499987, 378173027, 339963627, 832906712, 559482768, 53067420); + bool3x4 r2 = bool3x4(true, true, true, true, true, true, false, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + int a3 = (1895722478); + int3x4 b3 = int3x4(809981860, 591790551, 1680760399, 653274934, 1664284538, 1283249545, 767500110, 1334099884, 1271622829, 1270706578, 56782179, 505839576); + bool3x4 r3 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void int3x4_operator_greater_equal_wide_wide() + { + int3x4 a0 = int3x4(8538378, 2131749726, 265427108, 523609761, 994991818, 839709564, 101288202, 1886280970, 2032074826, 631221455, 1456286159, 961342752); + int3x4 b0 = int3x4(903145828, 1697992986, 1432491982, 169789504, 1059357300, 1744255222, 1606584463, 1905414425, 1448794969, 136181998, 1678754836, 2069656857); + bool3x4 r0 = bool3x4(false, true, false, true, false, false, false, false, true, true, false, false); + TestUtils.AreEqual(r0, a0 >= b0); + + int3x4 a1 = int3x4(424526026, 788481984, 1662488497, 870326690, 708712581, 1260182701, 1165630721, 138247561, 1108650168, 1933222913, 672493999, 1541402159); + int3x4 b1 = int3x4(398982689, 243317404, 740939613, 1894753119, 301760792, 1260647988, 3608523, 52576030, 903420465, 1648820371, 627296845, 1679808907); + bool3x4 r1 = bool3x4(true, true, true, false, true, false, true, true, true, true, true, false); + TestUtils.AreEqual(r1, a1 >= b1); + + int3x4 a2 = int3x4(1921596027, 1557351956, 147242547, 892772168, 2089286723, 1273466960, 644009998, 654784654, 189030610, 1035542641, 346401762, 739783704); + int3x4 b2 = int3x4(1719102039, 1718081638, 655586949, 477267189, 62092869, 2013928066, 280292357, 254052205, 1092440092, 1947011057, 625632982, 2028466303); + bool3x4 r2 = bool3x4(true, false, false, true, true, false, true, true, false, false, false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + int3x4 a3 = int3x4(1310547408, 1175015477, 1893015570, 1397162858, 1005064177, 469205024, 1331071304, 1747510572, 1556472271, 1318844912, 877625210, 1556049679); + int3x4 b3 = int3x4(578645425, 552865694, 1460006028, 1944712828, 1256156724, 2090870105, 1299728699, 53125632, 782915512, 1103537852, 271803142, 828357811); + bool3x4 r3 = bool3x4(true, true, true, false, false, false, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void int3x4_operator_greater_equal_wide_scalar() + { + int3x4 a0 = int3x4(2049236663, 182691143, 634973382, 1197012109, 439837565, 1367606469, 1108037359, 351147187, 1898505669, 411667685, 1998610091, 4652390); + int b0 = (1061998015); + bool3x4 r0 = bool3x4(true, false, false, true, false, true, true, false, true, false, true, false); + TestUtils.AreEqual(r0, a0 >= b0); + + int3x4 a1 = int3x4(996159180, 727766399, 96217144, 814085575, 1525995206, 1293933760, 1732973229, 1473283041, 899444524, 1023753195, 1373738074, 518164359); + int b1 = (2111455181); + bool3x4 r1 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + int3x4 a2 = int3x4(717850464, 1826820341, 527594558, 1816542874, 839185150, 1143596061, 1819554651, 160724539, 993212636, 878086499, 363122662, 1989978759); + int b2 = (1765188600); + bool3x4 r2 = bool3x4(false, true, false, true, false, false, true, false, false, false, false, true); + TestUtils.AreEqual(r2, a2 >= b2); + + int3x4 a3 = int3x4(2145562949, 122055824, 1432184946, 690328424, 638547285, 403700518, 569358695, 1988815901, 933324785, 1709851817, 1451640349, 1782506169); + int b3 = (491416140); + bool3x4 r3 = bool3x4(true, false, true, true, true, false, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void int3x4_operator_greater_equal_scalar_wide() + { + int a0 = (1859811087); + int3x4 b0 = int3x4(1070365918, 1783869452, 830091760, 377157428, 327199016, 90384229, 1154649706, 376758501, 1079802834, 2054742898, 1328349472, 434061447); + bool3x4 r0 = bool3x4(true, true, true, true, true, true, true, true, true, false, true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + int a1 = (951207723); + int3x4 b1 = int3x4(598695892, 975131651, 1714007943, 177416473, 1267232721, 31082860, 216791741, 119054289, 1905107583, 89559116, 55041824, 691334141); + bool3x4 r1 = bool3x4(true, false, false, true, false, true, true, true, false, true, true, true); + TestUtils.AreEqual(r1, a1 >= b1); + + int a2 = (462326883); + int3x4 b2 = int3x4(1658303669, 914628512, 1134364322, 1677134711, 1955614770, 2067009301, 1454405405, 299467282, 1584922149, 561776357, 564147844, 398216936); + bool3x4 r2 = bool3x4(false, false, false, false, false, false, false, true, false, false, false, true); + TestUtils.AreEqual(r2, a2 >= b2); + + int a3 = (1478439642); + int3x4 b3 = int3x4(958973988, 725612832, 1586062302, 1992817431, 732550238, 1151725147, 11183347, 643483664, 1846311608, 999376922, 1029876878, 1092702918); + bool3x4 r3 = bool3x4(true, true, false, false, true, true, true, true, false, true, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void int3x4_operator_add_wide_wide() + { + int3x4 a0 = int3x4(2135171378, 21433296, 1954723494, 683604307, 1054212315, 1762680995, 1963655852, 1257853062, 2043493600, 976898058, 1915056423, 121374462); + int3x4 b0 = int3x4(1013431952, 366718162, 359290756, 1393163294, 1962236872, 1263270041, 1862666629, 1077447887, 821693806, 487316539, 350922520, 1583012528); + int3x4 r0 = int3x4(-1146363966, 388151458, -1980953046, 2076767601, -1278518109, -1269016260, -468644815, -1959666347, -1429779890, 1464214597, -2028988353, 1704386990); + TestUtils.AreEqual(r0, a0 + b0); + + int3x4 a1 = int3x4(1218855698, 700538222, 1702057277, 1788251699, 1534939160, 398651016, 1674272498, 374510467, 824322986, 1217622199, 1122376670, 642613771); + int3x4 b1 = int3x4(1951595076, 1024851344, 874302782, 1383969588, 1767968088, 900721406, 1659790033, 1792273749, 443844328, 633981449, 2010244807, 335566991); + int3x4 r1 = int3x4(-1124516522, 1725389566, -1718607237, -1122746009, -992060048, 1299372422, -960904765, -2128183080, 1268167314, 1851603648, -1162345819, 978180762); + TestUtils.AreEqual(r1, a1 + b1); + + int3x4 a2 = int3x4(1097903998, 359042741, 929182687, 1713065399, 892057490, 1295346111, 1806236181, 1838589664, 173985173, 1875814528, 1464015613, 1550659036); + int3x4 b2 = int3x4(521931102, 544297835, 1681549647, 1784248858, 585904415, 3128418, 1806236610, 179909533, 378711407, 195687764, 357131656, 383703567); + int3x4 r2 = int3x4(1619835100, 903340576, -1684234962, -797653039, 1477961905, 1298474529, -682494505, 2018499197, 552696580, 2071502292, 1821147269, 1934362603); + TestUtils.AreEqual(r2, a2 + b2); + + int3x4 a3 = int3x4(447183339, 1810477200, 1280783968, 460635858, 1308981305, 2074430993, 515260041, 454786901, 54902689, 8663916, 364443922, 2133521215); + int3x4 b3 = int3x4(1332107956, 1471212095, 1634876660, 1356094538, 364971231, 1180126175, 1243953864, 2000873160, 761885805, 1088368083, 371382049, 1165570023); + int3x4 r3 = int3x4(1779291295, -1013278001, -1379306668, 1816730396, 1673952536, -1040410128, 1759213905, -1839307235, 816788494, 1097031999, 735825971, -995876058); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void int3x4_operator_add_wide_scalar() + { + int3x4 a0 = int3x4(665815972, 1783729250, 1591678394, 1284528538, 977850224, 71069732, 1138577680, 1200356017, 565982008, 1246759684, 1088001167, 57252642); + int b0 = (1334043849); + int3x4 r0 = int3x4(1999859821, -1177194197, -1369245053, -1676394909, -1983073223, 1405113581, -1822345767, -1760567430, 1900025857, -1714163763, -1872922280, 1391296491); + TestUtils.AreEqual(r0, a0 + b0); + + int3x4 a1 = int3x4(678921480, 512157429, 1470648741, 1490096953, 1467033531, 182608093, 1707296407, 1703724354, 1333833947, 653973063, 1139546735, 1834005844); + int b1 = (625943813); + int3x4 r1 = int3x4(1304865293, 1138101242, 2096592554, 2116040766, 2092977344, 808551906, -1961727076, -1965299129, 1959777760, 1279916876, 1765490548, -1835017639); + TestUtils.AreEqual(r1, a1 + b1); + + int3x4 a2 = int3x4(184572739, 1858520040, 97099208, 421437295, 1251829854, 166844260, 1568146789, 82548613, 533562157, 1464065228, 716600557, 831997894); + int b2 = (1980578280); + int3x4 r2 = int3x4(-2129816277, -455868976, 2077677488, -1892951721, -1062559162, 2147422540, -746242227, 2063126893, -1780826859, -850323788, -1597788459, -1482391122); + TestUtils.AreEqual(r2, a2 + b2); + + int3x4 a3 = int3x4(861575416, 1590793088, 240051362, 656307111, 1116911778, 1508531454, 1488841996, 651080626, 850104335, 697550029, 1501177275, 308656842); + int b3 = (1614335536); + int3x4 r3 = int3x4(-1819056344, -1089838672, 1854386898, -2024324649, -1563719982, -1172100306, -1191789764, -2029551134, -1830527425, -1983081731, -1179454485, 1922992378); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void int3x4_operator_add_scalar_wide() + { + int a0 = (359966320); + int3x4 b0 = int3x4(2146146202, 767103309, 851002415, 311531406, 1491262941, 1016891373, 1954228994, 1671335850, 727870747, 551151834, 1390261152, 1699060326); + int3x4 r0 = int3x4(-1788854774, 1127069629, 1210968735, 671497726, 1851229261, 1376857693, -1980771982, 2031302170, 1087837067, 911118154, 1750227472, 2059026646); + TestUtils.AreEqual(r0, a0 + b0); + + int a1 = (115021619); + int3x4 b1 = int3x4(1964440175, 440700758, 1556692550, 185414255, 933106731, 1217866784, 729761881, 1742597318, 1090109152, 1467373815, 1066072609, 138237856); + int3x4 r1 = int3x4(2079461794, 555722377, 1671714169, 300435874, 1048128350, 1332888403, 844783500, 1857618937, 1205130771, 1582395434, 1181094228, 253259475); + TestUtils.AreEqual(r1, a1 + b1); + + int a2 = (634834665); + int3x4 b2 = int3x4(993603553, 347587889, 2050191349, 670698672, 1658205080, 1874808705, 2082982954, 869839589, 118460267, 2126166073, 1826004041, 1976984739); + int3x4 r2 = int3x4(1628438218, 982422554, -1609941282, 1305533337, -2001927551, -1785323926, -1577149677, 1504674254, 753294932, -1533966558, -1834128590, -1683147892); + TestUtils.AreEqual(r2, a2 + b2); + + int a3 = (1612682951); + int3x4 b3 = int3x4(1509218893, 283188530, 175981795, 290469072, 90401332, 92990995, 1697612984, 10695923, 584353656, 1985077669, 261483046, 1433592717); + int3x4 r3 = int3x4(-1173065452, 1895871481, 1788664746, 1903152023, 1703084283, 1705673946, -984671361, 1623378874, -2097930689, -697206676, 1874165997, -1248691628); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void int3x4_operator_sub_wide_wide() + { + int3x4 a0 = int3x4(1410318491, 1097280168, 1827039044, 28881338, 328720965, 875487868, 212936325, 231977215, 1740021315, 2011295463, 48079003, 591379285); + int3x4 b0 = int3x4(1315897366, 799052018, 1580289673, 1094686261, 1954325726, 1197734816, 229886366, 915679176, 1746884850, 918743925, 1007797419, 257421324); + int3x4 r0 = int3x4(94421125, 298228150, 246749371, -1065804923, -1625604761, -322246948, -16950041, -683701961, -6863535, 1092551538, -959718416, 333957961); + TestUtils.AreEqual(r0, a0 - b0); + + int3x4 a1 = int3x4(1125909359, 1842588095, 848561896, 614448464, 2067598029, 1618238416, 318516219, 1090119767, 1991095823, 949592162, 1951912339, 1457818751); + int3x4 b1 = int3x4(287249342, 1617287463, 1653916102, 123586847, 502107404, 672875302, 1256481116, 1975569142, 1794443030, 1327558915, 330955394, 1596041731); + int3x4 r1 = int3x4(838660017, 225300632, -805354206, 490861617, 1565490625, 945363114, -937964897, -885449375, 196652793, -377966753, 1620956945, -138222980); + TestUtils.AreEqual(r1, a1 - b1); + + int3x4 a2 = int3x4(1642553126, 2114366549, 1420516260, 596841760, 724518081, 1820626306, 1885185225, 246124365, 1339877262, 1277620434, 759131597, 597162957); + int3x4 b2 = int3x4(1069074732, 1120817099, 2076417364, 402521072, 839858844, 1539789702, 559077522, 822288510, 751901021, 1858312568, 1706585560, 483540199); + int3x4 r2 = int3x4(573478394, 993549450, -655901104, 194320688, -115340763, 280836604, 1326107703, -576164145, 587976241, -580692134, -947453963, 113622758); + TestUtils.AreEqual(r2, a2 - b2); + + int3x4 a3 = int3x4(656765083, 1075131749, 58205257, 452992632, 976914238, 2122217984, 1687033200, 850554234, 2052749291, 2095840868, 1583338457, 90383917); + int3x4 b3 = int3x4(35726321, 401119620, 1411304017, 794953965, 246546364, 1926970811, 1641115012, 2138664312, 1215717344, 1626141022, 1697813712, 1432018301); + int3x4 r3 = int3x4(621038762, 674012129, -1353098760, -341961333, 730367874, 195247173, 45918188, -1288110078, 837031947, 469699846, -114475255, -1341634384); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void int3x4_operator_sub_wide_scalar() + { + int3x4 a0 = int3x4(1508669340, 1594795463, 266707545, 643102647, 287705008, 1475644328, 1113286221, 979450511, 2082174113, 1108005498, 304369206, 999244508); + int b0 = (998008471); + int3x4 r0 = int3x4(510660869, 596786992, -731300926, -354905824, -710303463, 477635857, 115277750, -18557960, 1084165642, 109997027, -693639265, 1236037); + TestUtils.AreEqual(r0, a0 - b0); + + int3x4 a1 = int3x4(1806482044, 2101812429, 1482736902, 266654115, 1470212363, 1190349300, 958542155, 1185075537, 1738124835, 499527536, 1612473406, 1696960099); + int b1 = (1994553647); + int3x4 r1 = int3x4(-188071603, 107258782, -511816745, -1727899532, -524341284, -804204347, -1036011492, -809478110, -256428812, -1495026111, -382080241, -297593548); + TestUtils.AreEqual(r1, a1 - b1); + + int3x4 a2 = int3x4(1287292743, 1032360376, 1779621585, 964948785, 1739264125, 94254551, 968533883, 2075770560, 946189008, 1074604044, 1171596880, 1033389665); + int b2 = (1360229454); + int3x4 r2 = int3x4(-72936711, -327869078, 419392131, -395280669, 379034671, -1265974903, -391695571, 715541106, -414040446, -285625410, -188632574, -326839789); + TestUtils.AreEqual(r2, a2 - b2); + + int3x4 a3 = int3x4(1905912138, 372717946, 658343960, 572101777, 361378660, 1043302867, 1535109165, 695707807, 153321516, 1464557635, 308141270, 69622833); + int b3 = (1219683758); + int3x4 r3 = int3x4(686228380, -846965812, -561339798, -647581981, -858305098, -176380891, 315425407, -523975951, -1066362242, 244873877, -911542488, -1150060925); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void int3x4_operator_sub_scalar_wide() + { + int a0 = (893369501); + int3x4 b0 = int3x4(2051906184, 1699714311, 442603706, 1735141684, 274533585, 811580259, 1196354320, 1524097023, 533621527, 2080845793, 143958837, 1620668660); + int3x4 r0 = int3x4(-1158536683, -806344810, 450765795, -841772183, 618835916, 81789242, -302984819, -630727522, 359747974, -1187476292, 749410664, -727299159); + TestUtils.AreEqual(r0, a0 - b0); + + int a1 = (1135989346); + int3x4 b1 = int3x4(1367044745, 554088609, 552670373, 1265516124, 1254902543, 1857695581, 1619865274, 1313559400, 99812999, 843597298, 420111239, 1299949060); + int3x4 r1 = int3x4(-231055399, 581900737, 583318973, -129526778, -118913197, -721706235, -483875928, -177570054, 1036176347, 292392048, 715878107, -163959714); + TestUtils.AreEqual(r1, a1 - b1); + + int a2 = (531009038); + int3x4 b2 = int3x4(1103306550, 104920105, 1137308312, 1207332725, 103438360, 1157123503, 1174401240, 701247193, 1498366995, 467017290, 109208355, 1594646461); + int3x4 r2 = int3x4(-572297512, 426088933, -606299274, -676323687, 427570678, -626114465, -643392202, -170238155, -967357957, 63991748, 421800683, -1063637423); + TestUtils.AreEqual(r2, a2 - b2); + + int a3 = (1252691221); + int3x4 b3 = int3x4(919863765, 2826939, 1969148647, 1576198850, 2075870798, 1610641273, 1783880129, 59074246, 1766624573, 521313783, 1333637752, 509364704); + int3x4 r3 = int3x4(332827456, 1249864282, -716457426, -323507629, -823179577, -357950052, -531188908, 1193616975, -513933352, 731377438, -80946531, 743326517); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void int3x4_operator_mul_wide_wide() + { + int3x4 a0 = int3x4(61417577, 219585476, 1362520891, 1511084277, 1481211272, 58211871, 1459591173, 567624644, 1169935583, 1835691886, 385626539, 85934842); + int3x4 b0 = int3x4(578042444, 1620527213, 200516468, 309339115, 542853019, 299467282, 1479641221, 1428338601, 1497302909, 1596889147, 427413842, 265122693); + int3x4 r0 = int3x4(-1426863828, 1326150260, -990894148, -1322856473, 1973926232, 88546350, -863919463, -582821788, 556671459, 1098186330, 1848083398, -58320414); + TestUtils.AreEqual(r0, a0 * b0); + + int3x4 a1 = int3x4(522856538, 278370196, 289217012, 2083410174, 1293162798, 1939730122, 2075923048, 1116477212, 1686101741, 783310758, 248585944, 1093377716); + int3x4 b1 = int3x4(689376654, 1120457204, 516903000, 873091659, 1353196495, 1384773500, 1596528529, 2122329305, 1033200564, 996795088, 1137754930, 232014195); + int3x4 r1 = int3x4(2005201900, 651971856, -1721160736, -110160278, -119429582, -536965160, -2049587992, -759667012, 1443849636, 550781664, -959017424, -353108260); + TestUtils.AreEqual(r1, a1 * b1); + + int3x4 a2 = int3x4(797038788, 1838048120, 1892922904, 1952024781, 492107602, 1097670675, 2069629919, 20122103, 606926492, 1153788131, 1687394746, 1499899200); + int3x4 b2 = int3x4(1080950243, 1613216909, 463529448, 1781487382, 2101946430, 673144237, 390627073, 964308272, 1332603859, 106394678, 1330334791, 1720890701); + int3x4 r2 = int3x4(-1093604916, 264300824, -121602624, 1825729694, -241519140, -1246587945, -2064143137, -251115184, 1004304020, -330302494, 638638742, 892728384); + TestUtils.AreEqual(r2, a2 * b2); + + int3x4 a3 = int3x4(380825697, 2058271053, 1791586731, 16536749, 1743482585, 323418416, 826338527, 1127652402, 1548655361, 892665898, 498857854, 52699386); + int3x4 b3 = int3x4(1860846228, 1499909622, 1236623401, 1532585255, 46356001, 1355750416, 470193265, 829633350, 158242740, 2121460265, 443332975, 1295474668); + int3x4 r3 = int3x4(-1474954732, 1744222462, -976595869, -1560402085, -1646186503, 1971376896, 936606319, -24990804, -400518220, -1235785030, -276669022, -1790890888); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void int3x4_operator_mul_wide_scalar() + { + int3x4 a0 = int3x4(871746615, 492532311, 570557670, 2142306629, 1610315153, 1526163563, 118471734, 257439514, 364291059, 1186560810, 1584938026, 1357601203); + int b0 = (442064533); + int3x4 r0 = int3x4(338365955, 1081376419, -1729147426, -1015409879, -873485467, -175501241, -838181010, 513646114, 1627104879, 1523063666, 1353478258, -517607633); + TestUtils.AreEqual(r0, a0 * b0); + + int3x4 a1 = int3x4(638897141, 1007838321, 1163240135, 1619806399, 1444659979, 1127580168, 464517916, 1508043166, 745488654, 636691139, 1851670006, 357357967); + int b1 = (268562104); + int3x4 r1 = int3x4(-796565992, -1156956360, -2052521720, 154458952, 643000808, 258008512, 1024230432, 1508298128, 2139080208, -1546303960, -1890763568, -1961996088); + TestUtils.AreEqual(r1, a1 * b1); + + int3x4 a2 = int3x4(1095280227, 945802744, 1464398841, 51061000, 802418971, 407442471, 638315697, 1889264235, 584402164, 1343048690, 2144106255, 1634890111); + int b2 = (702779195); + int3x4 r2 = int3x4(91792849, -586547160, 350441827, 2098992344, -2022201799, -2001834499, -1477874741, -280497239, 1627861052, -99438906, -1544695435, 1566775621); + TestUtils.AreEqual(r2, a2 * b2); + + int3x4 a3 = int3x4(425282134, 676185747, 1562817045, 379402138, 866868743, 624571724, 889442510, 39498317, 219559094, 211033504, 2076045580, 1838674974); + int b3 = (997231492); + int3x4 r3 = int3x4(-452524456, -1002687284, -891995692, -677295768, 1887062172, -1573667024, 1014465592, 910409396, -810418216, -1099618688, 689032752, -1157224072); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void int3x4_operator_mul_scalar_wide() + { + int a0 = (1152242766); + int3x4 b0 = int3x4(1276636134, 2105929407, 499007702, 124002565, 1956335172, 1288034953, 832676555, 337389733, 99268757, 2005055247, 2011389505, 1348110859); + int3x4 r0 = int3x4(-2129504236, 999811634, 1179056436, -801426554, 404105400, 1339492798, -381766182, -1111620026, 2131796326, 1519334034, -952005682, -1420416166); + TestUtils.AreEqual(r0, a0 * b0); + + int a1 = (399689191); + int3x4 b1 = int3x4(2007606374, 2076691289, 1825721194, 769885235, 153314735, 1066325369, 84289667, 984486192, 1325213504, 1643957457, 1576395620, 2095980601); + int3x4 r1 = int3x4(-1958619638, 1053162063, 1757322918, -2082633467, -1631687703, 1080737071, 1177640245, 1336635984, 136489664, -1087658601, -2065423556, -2022903697); + TestUtils.AreEqual(r1, a1 * b1); + + int a2 = (907671947); + int3x4 b2 = int3x4(836919582, 1412159342, 2037926630, 366590562, 493177763, 2058824164, 497936968, 2136548816, 1211907591, 2113626509, 345443734, 353147704); + int3x4 r2 = int3x4(374270282, -1776945478, -912236318, -2095872714, 1098685569, -126450996, 1465269528, 1820252144, 1505328333, 774184079, 299976306, -1454784664); + TestUtils.AreEqual(r2, a2 * b2); + + int a3 = (688487056); + int3x4 b3 = int3x4(2038986981, 1991273614, 393095943, 838257274, 1646548338, 480051387, 1077685034, 421911953, 1757438926, 1584698689, 1237695787, 426426495); + int3x4 r3 = int3x4(1399726800, 1710668768, 1354271216, 1603930272, -936745952, -465795280, 216288160, 872201104, 470175712, 1493036688, 1155786288, 1195363696); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void int3x4_operator_div_wide_wide() + { + int3x4 a0 = int3x4(333171510, 858154903, 1181365836, 671357749, 1090606752, 803759420, 788404166, 296807814, 575260195, 166625280, 1493729000, 1831739736); + int3x4 b0 = int3x4(698897823, 440199998, 655557473, 1658534285, 2127220100, 315653188, 1814290360, 992173243, 914851653, 664340325, 224323977, 246981573); + int3x4 r0 = int3x4(0, 1, 1, 0, 0, 2, 0, 0, 0, 0, 6, 7); + TestUtils.AreEqual(r0, a0 / b0); + + int3x4 a1 = int3x4(200852358, 129983172, 500176108, 472051781, 414699094, 1446535974, 1278480457, 930910505, 263295881, 1626759436, 450830871, 21439121); + int3x4 b1 = int3x4(285573983, 819471609, 2012476015, 1783179572, 223253978, 169515029, 1694929006, 1992168131, 1155972447, 1768506696, 422325410, 1508417406); + int3x4 r1 = int3x4(0, 0, 0, 0, 1, 8, 0, 0, 0, 0, 1, 0); + TestUtils.AreEqual(r1, a1 / b1); + + int3x4 a2 = int3x4(521337599, 127756712, 200601965, 412554396, 1014641734, 239347640, 525574301, 1158358177, 1655168319, 2048437741, 367754386, 1861176433); + int3x4 b2 = int3x4(605462475, 66917170, 2014683461, 108847533, 611173330, 895791853, 1999369787, 1225614384, 1168063495, 565150188, 127292785, 1027814836); + int3x4 r2 = int3x4(0, 1, 0, 3, 1, 0, 0, 0, 1, 3, 2, 1); + TestUtils.AreEqual(r2, a2 / b2); + + int3x4 a3 = int3x4(2131424795, 401044444, 745048188, 1943634349, 264134862, 298134010, 1884719303, 1582577607, 1958183229, 1302356942, 1455581366, 1466593830); + int3x4 b3 = int3x4(321940796, 337756553, 63233040, 1926010595, 769049413, 2042197280, 405134611, 547499280, 1337688441, 667307127, 35118652, 411409741); + int3x4 r3 = int3x4(6, 1, 11, 1, 0, 0, 4, 2, 1, 1, 41, 3); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void int3x4_operator_div_wide_scalar() + { + int3x4 a0 = int3x4(1433072926, 1073958635, 1195142312, 536596719, 1274375693, 464756346, 806462546, 906504670, 1380905136, 25493909, 1196815948, 123300377); + int b0 = (1434025872); + int3x4 r0 = int3x4(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + TestUtils.AreEqual(r0, a0 / b0); + + int3x4 a1 = int3x4(643754735, 2047825037, 458304263, 741331531, 466443901, 2110004616, 1500687214, 1453264263, 1617154145, 2040203220, 2103351724, 485536709); + int b1 = (2084019932); + int3x4 r1 = int3x4(0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0); + TestUtils.AreEqual(r1, a1 / b1); + + int3x4 a2 = int3x4(402141749, 1629069474, 1549487015, 670594363, 2040479674, 155415284, 207130003, 1596922206, 1730223836, 1528374182, 1878500631, 1245757182); + int b2 = (1477264254); + int3x4 r2 = int3x4(0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0); + TestUtils.AreEqual(r2, a2 / b2); + + int3x4 a3 = int3x4(1471308702, 251821475, 1328085649, 1950145317, 794269329, 174603836, 678361822, 1820872200, 1455358409, 778273070, 2067965131, 127176068); + int b3 = (1733304186); + int3x4 r3 = int3x4(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void int3x4_operator_div_scalar_wide() + { + int a0 = (519165704); + int3x4 b0 = int3x4(1295178177, 775214121, 467772046, 1156881598, 310396565, 759759959, 243837702, 1616314235, 1053470225, 1320630160, 378773841, 4223608); + int3x4 r0 = int3x4(0, 0, 1, 0, 1, 0, 2, 0, 0, 0, 1, 122); + TestUtils.AreEqual(r0, a0 / b0); + + int a1 = (1971105754); + int3x4 b1 = int3x4(2054406020, 219939614, 1603672651, 2006134295, 888535397, 1493077923, 615835131, 1045603945, 452709946, 1074919059, 467037221, 1485241506); + int3x4 r1 = int3x4(0, 8, 1, 0, 2, 1, 3, 1, 4, 1, 4, 1); + TestUtils.AreEqual(r1, a1 / b1); + + int a2 = (1775728786); + int3x4 b2 = int3x4(481521341, 68149923, 80867357, 1294049272, 470535313, 1235850199, 631464286, 687722755, 412827650, 1258012095, 1286792622, 1799223034); + int3x4 r2 = int3x4(3, 26, 21, 1, 3, 1, 2, 2, 4, 1, 1, 0); + TestUtils.AreEqual(r2, a2 / b2); + + int a3 = (766890491); + int3x4 b3 = int3x4(2080374598, 711612151, 700420132, 1832408481, 1806438353, 237636410, 562498090, 1695805237, 2075783388, 2094216740, 1612536340, 885282904); + int3x4 r3 = int3x4(0, 1, 1, 0, 0, 3, 1, 0, 0, 0, 0, 0); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void int3x4_operator_mod_wide_wide() + { + int3x4 a0 = int3x4(258342924, 1454754891, 723352342, 1981431473, 531756042, 716993627, 1667903349, 1331097004, 1776856101, 17598216, 1474345080, 1681376293); + int3x4 b0 = int3x4(1990080167, 1197348066, 651970512, 1659454050, 241005212, 1866255454, 1440101415, 595220963, 408818410, 198222574, 549504274, 239973807); + int3x4 r0 = int3x4(258342924, 257406825, 71381830, 321977423, 49745618, 716993627, 227801934, 140655078, 141582461, 17598216, 375336532, 1559644); + TestUtils.AreEqual(r0, a0 % b0); + + int3x4 a1 = int3x4(813624265, 1617478722, 498370451, 780075943, 1754430321, 653235398, 1517128354, 966216200, 590067427, 1283434795, 1910903650, 1125967790); + int3x4 b1 = int3x4(321398087, 658171840, 1511495237, 1048325585, 1126739824, 666641241, 38017598, 418797691, 618700513, 1941062990, 158556432, 1081063558); + int3x4 r1 = int3x4(170828091, 301135042, 498370451, 780075943, 627690497, 653235398, 34442032, 128620818, 590067427, 1283434795, 8226466, 44904232); + TestUtils.AreEqual(r1, a1 % b1); + + int3x4 a2 = int3x4(1180537254, 308567230, 543945394, 483834400, 308703874, 383723801, 1181975437, 1161083599, 1608412916, 111825133, 786866017, 1225576256); + int3x4 b2 = int3x4(427329468, 148111230, 1251162672, 1856322297, 1214781084, 401954255, 1323259633, 1167744452, 1816151689, 541163525, 664455763, 1738838503); + int3x4 r2 = int3x4(325878318, 12344770, 543945394, 483834400, 308703874, 383723801, 1181975437, 1161083599, 1608412916, 111825133, 122410254, 1225576256); + TestUtils.AreEqual(r2, a2 % b2); + + int3x4 a3 = int3x4(1590085857, 1755638794, 1413553126, 476553804, 1342913944, 1625118233, 1202928007, 504380191, 642905424, 357937367, 1801777444, 1384305901); + int3x4 b3 = int3x4(1746284172, 855644567, 1887796950, 655067833, 536415164, 71040983, 631964713, 503267649, 944396748, 302347270, 564261945, 1414291441); + int3x4 r3 = int3x4(1590085857, 44349660, 1413553126, 476553804, 270083616, 62216607, 570963294, 1112542, 642905424, 55590097, 108991609, 1384305901); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void int3x4_operator_mod_wide_scalar() + { + int3x4 a0 = int3x4(560988938, 629524514, 767711194, 434281967, 1399805893, 792916846, 1663690927, 598661916, 1776636144, 1287035793, 1743722161, 475209785); + int b0 = (1156862367); + int3x4 r0 = int3x4(560988938, 629524514, 767711194, 434281967, 242943526, 792916846, 506828560, 598661916, 619773777, 130173426, 586859794, 475209785); + TestUtils.AreEqual(r0, a0 % b0); + + int3x4 a1 = int3x4(327476870, 379853074, 477430114, 858399046, 712734431, 1506629323, 199829950, 362269020, 1986626876, 1351725413, 1549678101, 431765276); + int b1 = (1617696916); + int3x4 r1 = int3x4(327476870, 379853074, 477430114, 858399046, 712734431, 1506629323, 199829950, 362269020, 368929960, 1351725413, 1549678101, 431765276); + TestUtils.AreEqual(r1, a1 % b1); + + int3x4 a2 = int3x4(1315833792, 615834034, 780055604, 104179235, 629966219, 1810536428, 1747026206, 1799535061, 875754431, 2049775667, 303673867, 93301056); + int b2 = (1664893153); + int3x4 r2 = int3x4(1315833792, 615834034, 780055604, 104179235, 629966219, 145643275, 82133053, 134641908, 875754431, 384882514, 303673867, 93301056); + TestUtils.AreEqual(r2, a2 % b2); + + int3x4 a3 = int3x4(1944511005, 1065919801, 1342701312, 1356734788, 1593032231, 475449806, 1983416442, 776300612, 591854273, 2061957684, 1865797266, 1982663429); + int b3 = (2135291183); + int3x4 r3 = int3x4(1944511005, 1065919801, 1342701312, 1356734788, 1593032231, 475449806, 1983416442, 776300612, 591854273, 2061957684, 1865797266, 1982663429); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void int3x4_operator_mod_scalar_wide() + { + int a0 = (933347930); + int3x4 b0 = int3x4(549923387, 243114953, 1884274390, 1428033594, 655531454, 1622674954, 1107563514, 1614111094, 914801920, 1432263179, 564431096, 1967013901); + int3x4 r0 = int3x4(383424543, 204003071, 933347930, 933347930, 277816476, 933347930, 933347930, 933347930, 18546010, 933347930, 368916834, 933347930); + TestUtils.AreEqual(r0, a0 % b0); + + int a1 = (1709750152); + int3x4 b1 = int3x4(1080102613, 13120773, 2042535998, 1505698002, 1640058084, 974167554, 758635306, 1387264978, 611743343, 1139002766, 1913935748, 1086810076); + int3x4 r1 = int3x4(629647539, 4049662, 1709750152, 204052150, 69692068, 735582598, 192479540, 322485174, 486263466, 570747386, 1709750152, 622940076); + TestUtils.AreEqual(r1, a1 % b1); + + int a2 = (991846486); + int3x4 b2 = int3x4(922870408, 35007468, 891877602, 157349181, 83267982, 801093706, 546272767, 1665089132, 1889242068, 1179889796, 1690033703, 1333252321); + int3x4 r2 = int3x4(68976078, 11637382, 99968884, 47751400, 75898684, 190752780, 445573719, 991846486, 991846486, 991846486, 991846486, 991846486); + TestUtils.AreEqual(r2, a2 % b2); + + int a3 = (1960636489); + int3x4 b3 = int3x4(960755248, 698650125, 313994074, 1830992514, 2049496523, 507742240, 739436968, 1012724736, 2089810815, 329356442, 384427687, 713578570); + int3x4 r3 = int3x4(39125993, 563336239, 76672045, 129643975, 1960636489, 437409769, 481762553, 947911753, 1960636489, 313854279, 38498054, 533479349); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void int3x4_operator_plus() + { + int3x4 a0 = int3x4(195392567, 222719748, 1002351013, 1570765263, 109389333, 1515950277, 1689763402, 291471785, 264115671, 1084131995, 195779102, 2131702223); + int3x4 r0 = int3x4(195392567, 222719748, 1002351013, 1570765263, 109389333, 1515950277, 1689763402, 291471785, 264115671, 1084131995, 195779102, 2131702223); + TestUtils.AreEqual(r0, +a0); + + int3x4 a1 = int3x4(715660442, 69731564, 1317851903, 1957501908, 531426536, 2012985092, 1334133318, 1539671418, 935436165, 1575048895, 2119066258, 781435471); + int3x4 r1 = int3x4(715660442, 69731564, 1317851903, 1957501908, 531426536, 2012985092, 1334133318, 1539671418, 935436165, 1575048895, 2119066258, 781435471); + TestUtils.AreEqual(r1, +a1); + + int3x4 a2 = int3x4(1659000230, 1153431944, 1360657696, 578750954, 150348334, 1791553179, 1288641627, 735146513, 328684789, 1370099515, 1575634098, 36481877); + int3x4 r2 = int3x4(1659000230, 1153431944, 1360657696, 578750954, 150348334, 1791553179, 1288641627, 735146513, 328684789, 1370099515, 1575634098, 36481877); + TestUtils.AreEqual(r2, +a2); + + int3x4 a3 = int3x4(1832055170, 1370934466, 1126708142, 511229253, 1297664549, 1444401655, 1292097101, 1377029046, 1680766483, 249526091, 656501406, 195015813); + int3x4 r3 = int3x4(1832055170, 1370934466, 1126708142, 511229253, 1297664549, 1444401655, 1292097101, 1377029046, 1680766483, 249526091, 656501406, 195015813); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void int3x4_operator_neg() + { + int3x4 a0 = int3x4(1385088677, 94114564, 1350664872, 1458616659, 2067164853, 218122493, 958484951, 270553961, 446497525, 270503114, 1928771252, 1427605822); + int3x4 r0 = int3x4(-1385088677, -94114564, -1350664872, -1458616659, -2067164853, -218122493, -958484951, -270553961, -446497525, -270503114, -1928771252, -1427605822); + TestUtils.AreEqual(r0, -a0); + + int3x4 a1 = int3x4(2051940607, 485368391, 908365416, 1742096480, 990033169, 1368056141, 1350976157, 12802586, 1934372287, 576597401, 785136322, 559205611); + int3x4 r1 = int3x4(-2051940607, -485368391, -908365416, -1742096480, -990033169, -1368056141, -1350976157, -12802586, -1934372287, -576597401, -785136322, -559205611); + TestUtils.AreEqual(r1, -a1); + + int3x4 a2 = int3x4(1959833280, 1200036971, 95281343, 1969004480, 1381288239, 252975075, 1961335692, 1607042487, 832886233, 1300359361, 8438338, 431498011); + int3x4 r2 = int3x4(-1959833280, -1200036971, -95281343, -1969004480, -1381288239, -252975075, -1961335692, -1607042487, -832886233, -1300359361, -8438338, -431498011); + TestUtils.AreEqual(r2, -a2); + + int3x4 a3 = int3x4(1534415387, 866625695, 2105773520, 1249998702, 1704935592, 59004141, 257619538, 392825753, 1868257049, 1472660509, 928823577, 2138036799); + int3x4 r3 = int3x4(-1534415387, -866625695, -2105773520, -1249998702, -1704935592, -59004141, -257619538, -392825753, -1868257049, -1472660509, -928823577, -2138036799); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void int3x4_operator_prefix_inc() + { + int3x4 a0 = int3x4(780471723, 954741756, 272723451, 2142862245, 606294309, 1514814550, 250124151, 444189162, 1833356994, 1915989169, 1348278302, 129540735); + int3x4 r0 = int3x4(780471724, 954741757, 272723452, 2142862246, 606294310, 1514814551, 250124152, 444189163, 1833356995, 1915989170, 1348278303, 129540736); + TestUtils.AreEqual(r0, ++a0); + + int3x4 a1 = int3x4(1584496757, 986715680, 1701179230, 1397451003, 483952900, 1494652811, 1268688387, 2014528731, 453850931, 1112537171, 621362788, 2063486914); + int3x4 r1 = int3x4(1584496758, 986715681, 1701179231, 1397451004, 483952901, 1494652812, 1268688388, 2014528732, 453850932, 1112537172, 621362789, 2063486915); + TestUtils.AreEqual(r1, ++a1); + + int3x4 a2 = int3x4(1612870531, 1083861484, 1583359796, 82587894, 810087437, 72436569, 1094485773, 912422931, 1011314676, 261771874, 2042016403, 1102472175); + int3x4 r2 = int3x4(1612870532, 1083861485, 1583359797, 82587895, 810087438, 72436570, 1094485774, 912422932, 1011314677, 261771875, 2042016404, 1102472176); + TestUtils.AreEqual(r2, ++a2); + + int3x4 a3 = int3x4(976635804, 607693651, 1788488571, 1912059986, 420746703, 1703260621, 501684292, 1809882373, 1989306461, 786299198, 1729269500, 411043860); + int3x4 r3 = int3x4(976635805, 607693652, 1788488572, 1912059987, 420746704, 1703260622, 501684293, 1809882374, 1989306462, 786299199, 1729269501, 411043861); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void int3x4_operator_postfix_inc() + { + int3x4 a0 = int3x4(241865086, 2145821641, 1596166022, 803592338, 529551271, 1656767229, 903047443, 1213663244, 1425753247, 1384002775, 389844650, 1159795446); + int3x4 r0 = int3x4(241865086, 2145821641, 1596166022, 803592338, 529551271, 1656767229, 903047443, 1213663244, 1425753247, 1384002775, 389844650, 1159795446); + TestUtils.AreEqual(r0, a0++); + + int3x4 a1 = int3x4(1343289659, 947635082, 137930180, 451018043, 1634297552, 2009552507, 1176922170, 388721494, 2381860, 2062858295, 715101397, 1725384327); + int3x4 r1 = int3x4(1343289659, 947635082, 137930180, 451018043, 1634297552, 2009552507, 1176922170, 388721494, 2381860, 2062858295, 715101397, 1725384327); + TestUtils.AreEqual(r1, a1++); + + int3x4 a2 = int3x4(446867079, 1460883320, 1683365096, 1319511974, 1418603655, 1938539756, 592683318, 1576213022, 1150548583, 904484472, 253685095, 70826818); + int3x4 r2 = int3x4(446867079, 1460883320, 1683365096, 1319511974, 1418603655, 1938539756, 592683318, 1576213022, 1150548583, 904484472, 253685095, 70826818); + TestUtils.AreEqual(r2, a2++); + + int3x4 a3 = int3x4(1423673637, 257117856, 964412816, 1148726183, 1820437224, 1087435092, 475319856, 1950385959, 1172607661, 1139700625, 1386106060, 612787013); + int3x4 r3 = int3x4(1423673637, 257117856, 964412816, 1148726183, 1820437224, 1087435092, 475319856, 1950385959, 1172607661, 1139700625, 1386106060, 612787013); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void int3x4_operator_prefix_dec() + { + int3x4 a0 = int3x4(1331961415, 1612382200, 1401591249, 2042075388, 1757136546, 1895858159, 1467742422, 578341664, 1336115745, 2059077641, 1169239112, 1862369220); + int3x4 r0 = int3x4(1331961414, 1612382199, 1401591248, 2042075387, 1757136545, 1895858158, 1467742421, 578341663, 1336115744, 2059077640, 1169239111, 1862369219); + TestUtils.AreEqual(r0, --a0); + + int3x4 a1 = int3x4(312317355, 1595492535, 1426262619, 1426620468, 674685792, 1423852012, 1459529624, 2092317419, 107501474, 1261583506, 512900840, 1496855314); + int3x4 r1 = int3x4(312317354, 1595492534, 1426262618, 1426620467, 674685791, 1423852011, 1459529623, 2092317418, 107501473, 1261583505, 512900839, 1496855313); + TestUtils.AreEqual(r1, --a1); + + int3x4 a2 = int3x4(777588547, 1487639376, 625907330, 1452782388, 804650978, 2076275981, 120447533, 262357170, 1887136873, 412907314, 846648478, 473291493); + int3x4 r2 = int3x4(777588546, 1487639375, 625907329, 1452782387, 804650977, 2076275980, 120447532, 262357169, 1887136872, 412907313, 846648477, 473291492); + TestUtils.AreEqual(r2, --a2); + + int3x4 a3 = int3x4(286048219, 1237897291, 1412498905, 346348942, 953070054, 2028727932, 2006551142, 1345994403, 1356250542, 1202345509, 497982699, 982734742); + int3x4 r3 = int3x4(286048218, 1237897290, 1412498904, 346348941, 953070053, 2028727931, 2006551141, 1345994402, 1356250541, 1202345508, 497982698, 982734741); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void int3x4_operator_postfix_dec() + { + int3x4 a0 = int3x4(1870005937, 1708534798, 704493460, 462940703, 2060593573, 228744869, 940247280, 1818778351, 1015253889, 862428933, 1401191870, 2080259851); + int3x4 r0 = int3x4(1870005937, 1708534798, 704493460, 462940703, 2060593573, 228744869, 940247280, 1818778351, 1015253889, 862428933, 1401191870, 2080259851); + TestUtils.AreEqual(r0, a0--); + + int3x4 a1 = int3x4(653673271, 1928164223, 1760916301, 1174531383, 634036198, 993137684, 1669210509, 874927437, 1393579866, 471308632, 620865961, 220103745); + int3x4 r1 = int3x4(653673271, 1928164223, 1760916301, 1174531383, 634036198, 993137684, 1669210509, 874927437, 1393579866, 471308632, 620865961, 220103745); + TestUtils.AreEqual(r1, a1--); + + int3x4 a2 = int3x4(1407678826, 1426931482, 488775250, 1681733117, 1916879863, 2060905976, 636358505, 1379709480, 451326084, 497925052, 549367303, 925145385); + int3x4 r2 = int3x4(1407678826, 1426931482, 488775250, 1681733117, 1916879863, 2060905976, 636358505, 1379709480, 451326084, 497925052, 549367303, 925145385); + TestUtils.AreEqual(r2, a2--); + + int3x4 a3 = int3x4(55306458, 18471540, 1907671409, 2010375112, 459674494, 1339288497, 548526029, 2061115550, 1130246689, 681734791, 1169678318, 640772261); + int3x4 r3 = int3x4(55306458, 18471540, 1907671409, 2010375112, 459674494, 1339288497, 548526029, 2061115550, 1130246689, 681734791, 1169678318, 640772261); + TestUtils.AreEqual(r3, a3--); + } + + [TestCompiler] + public static void int3x4_operator_bitwise_and_wide_wide() + { + int3x4 a0 = int3x4(1055241304, 859321394, 1088358961, 2090949513, 300561740, 651904515, 1331035868, 2012752753, 1298126656, 53199569, 1752363533, 1303061302); + int3x4 b0 = int3x4(749698416, 748105424, 1842764797, 9990577, 1989102105, 1666634755, 58116798, 868036607, 1420638875, 1308767169, 564040763, 478617502); + int3x4 r0 = int3x4(749024336, 537928720, 1087769137, 8409473, 277479432, 575816707, 55888540, 867707761, 1141707264, 33686209, 538087433, 209912598); + TestUtils.AreEqual(r0, a0 & b0); + + int3x4 a1 = int3x4(1929998247, 1504941434, 470682792, 713577376, 1493231658, 1340884669, 1577921467, 44846626, 1105094388, 1143008413, 333009589, 2116296009); + int3x4 b1 = int3x4(806150474, 674015378, 1505309955, 36064977, 1779639327, 808650076, 1634437037, 1997568501, 1930853951, 1901503461, 1508772523, 2010961769); + int3x4 r1 = int3x4(805855490, 136347666, 403178496, 33571456, 1207967754, 2098204, 1074332585, 33572896, 1091986996, 1073782917, 298320545, 1979979081); + TestUtils.AreEqual(r1, a1 & b1); + + int3x4 a2 = int3x4(2067254825, 121795325, 2122365250, 1088796653, 1594120761, 965590824, 337823363, 1686791432, 1275524729, 173403097, 864715776, 1437598787); + int3x4 b2 = int3x4(1495957269, 1914669725, 1263994006, 491200541, 380703892, 282208487, 1416934135, 942735432, 615839538, 1698880188, 1204102677, 1811173266); + int3x4 r2 = int3x4(1495420417, 33686173, 1241513986, 4530189, 369102864, 276834336, 337674883, 536870920, 67434032, 4246168, 58721280, 1102054402); + TestUtils.AreEqual(r2, a2 & b2); + + int3x4 a3 = int3x4(1375792249, 203672781, 1568515997, 145607913, 837338112, 754244200, 1383514630, 61183374, 690842674, 1362012962, 668846213, 1659745138); + int3x4 b3 = int3x4(203114715, 1968993229, 1549041488, 421225724, 1641463312, 1122209170, 946391298, 229237652, 849684128, 1197217575, 1910121786, 1835643900); + int3x4 r3 = int3x4(18521, 67125453, 1549018896, 134825192, 566264832, 14714880, 274776066, 27361668, 539304992, 1091306274, 567803904, 1617539952); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void int3x4_operator_bitwise_and_wide_scalar() + { + int3x4 a0 = int3x4(1513158868, 284695609, 734595037, 1566510707, 1601252476, 84213838, 314333543, 430856908, 753481263, 327392481, 1619794917, 2143619546); + int b0 = (1173647397); + int3x4 r0 = int3x4(1076916228, 15732769, 29360133, 1163132961, 1164976164, 84148228, 11816997, 27545604, 81801253, 25169953, 1082396709, 1170472960); + TestUtils.AreEqual(r0, a0 & b0); + + int3x4 a1 = int3x4(1873208293, 651482651, 1383096952, 1689107088, 1368301071, 366962092, 1729929586, 989550739, 1914435619, 1592791064, 2047510829, 678485991); + int b1 = (126982769); + int3x4 r1 = int3x4(125862497, 110137873, 34603632, 75602448, 25205249, 93388832, 118521968, 43063313, 34707489, 110104592, 33589281, 1088097); + TestUtils.AreEqual(r1, a1 & b1); + + int3x4 a2 = int3x4(586400261, 309059606, 131945492, 1707451796, 394184188, 1943201012, 558008097, 1070093422, 34324916, 258102213, 1800249857, 922911179); + int b2 = (771972179); + int3x4 r2 = int3x4(570638337, 33767442, 100750352, 604046352, 100811856, 570573904, 537003009, 771773506, 33767440, 235032641, 704708609, 637665347); + TestUtils.AreEqual(r2, a2 & b2); + + int3x4 a3 = int3x4(1719705954, 1162961184, 851638827, 889902874, 1622363409, 785352441, 1741477119, 452211039, 1144654389, 641588835, 1574197624, 568430284); + int b3 = (609219265); + int3x4 r3 = int3x4(604020800, 71393280, 541258241, 604688896, 537083905, 609190593, 609013953, 4468801, 67764737, 604885569, 71585856, 541164224); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void int3x4_operator_bitwise_and_scalar_wide() + { + int a0 = (477163326); + int3x4 b0 = int3x4(110453385, 703240362, 2075630560, 1884904031, 1734899436, 947945203, 1664399051, 458879298, 158491426, 79772356, 2054527944, 202228212); + int3x4 r0 = int3x4(68182536, 140544042, 405834528, 273697310, 73426476, 402681394, 3188234, 407953666, 141583138, 71313924, 410028808, 201376052); + TestUtils.AreEqual(r0, a0 & b0); + + int a1 = (359225061); + int3x4 b1 = int3x4(639811396, 1821945318, 1821303024, 2030124055, 1985961756, 579780373, 2061831301, 1139618293, 1145191868, 1121606282, 1414714065, 688688277); + int3x4 r1 = int3x4(69211716, 67634404, 67649760, 285283333, 340350468, 529925, 274793605, 23662821, 71308452, 4739712, 339759809, 17302661); + TestUtils.AreEqual(r1, a1 & b1); + + int a2 = (1508875606); + int3x4 b2 = int3x4(664318814, 2092766410, 1010043618, 599967779, 47076367, 1325716015, 1119912335, 2083412385, 1805692137, 1689798540, 265665838, 1616867488); + int3x4 r2 = int3x4(25727318, 1487737922, 405014594, 29526018, 13505542, 1225035782, 1086357766, 1479416064, 1235258432, 1084753156, 163945734, 1078923264); + TestUtils.AreEqual(r2, a2 & b2); + + int a3 = (244288538); + int3x4 b3 = int3x4(688929004, 1157047188, 1381359113, 1562107079, 944933664, 1994959125, 1413414673, 1280114143, 1373827711, 1107998701, 890185579, 195053206); + int3x4 r3 = int3x4(134219784, 75956240, 33917960, 202083330, 134383616, 109611024, 68062224, 202148890, 8552474, 34243592, 68092938, 176161810); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void int3x4_operator_bitwise_or_wide_wide() + { + int3x4 a0 = int3x4(1920951869, 1750772852, 1420019191, 732977093, 1169579447, 229437930, 1966721348, 2039812323, 113550869, 1912038362, 1569990624, 1490718227); + int3x4 b0 = int3x4(214585254, 275414367, 858759675, 190211455, 1218691723, 2129565457, 1862809466, 495728846, 868064152, 1756913766, 933656055, 247722084); + int3x4 r0 = int3x4(2130669503, 2021326207, 2008016383, 737572863, 1303895999, 2146367483, 2134507390, 2107455727, 939376541, 2046780414, 2142664695, 1591475831); + TestUtils.AreEqual(r0, a0 | b0); + + int3x4 a1 = int3x4(1686257697, 2137727522, 1569900650, 856504729, 2033376384, 2086259889, 671790684, 1189001916, 1756048437, 417084592, 2024165808, 966008272); + int3x4 b1 = int3x4(1884195075, 1804207631, 1913174711, 1815920856, 1226577606, 1696467642, 186912044, 1778908130, 1461256625, 1142152181, 272117331, 1162254035); + int3x4 r1 = int3x4(1959708963, 2146117167, 2140863231, 2134768089, 2034163398, 2103430843, 724483964, 1860172798, 2142973365, 1558183925, 2025750515, 2111217619); + TestUtils.AreEqual(r1, a1 | b1); + + int3x4 a2 = int3x4(2031026290, 1461019191, 1071959084, 1645847295, 871350674, 736640317, 868515800, 767794452, 362186994, 96189073, 1924033224, 1971421809); + int3x4 b2 = int3x4(870448102, 1845053992, 257334526, 987295814, 1503050768, 1683307763, 1076253109, 1403888383, 561000721, 740143742, 343344681, 2074122472); + int3x4 r2 = int3x4(2079325174, 2147314239, 1073143038, 2061103871, 2080374162, 1878867455, 1944485885, 2146418687, 905361907, 767539967, 1996451561, 2141297401); + TestUtils.AreEqual(r2, a2 | b2); + + int3x4 a3 = int3x4(1826545883, 865329, 516571463, 371039923, 918186803, 1920664988, 452155520, 743961772, 1728213958, 825116968, 1597755374, 910392330); + int3x4 b3 = int3x4(133130232, 108733999, 348566046, 1414140366, 975473487, 699452548, 1158934384, 1776041858, 1098964075, 1316223563, 1653177800, 679795328); + int3x4 r3 = int3x4(1879042043, 109000255, 516879199, 1449107455, 1052699519, 2080099740, 1609826288, 1843396526, 1736638447, 2139093867, 2143027182, 1053294218); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void int3x4_operator_bitwise_or_wide_scalar() + { + int3x4 a0 = int3x4(1295304853, 1307252624, 350194630, 1128063578, 1774824542, 2085245467, 1988423804, 999162350, 2110327307, 1050875188, 341855232, 1317039676); + int b0 = (1305527136); + int3x4 r0 = int3x4(1307888629, 1308350448, 1574947814, 1341973370, 1842999166, 2111492987, 2144662396, 2145305582, 2111425387, 2146686836, 1576062816, 1339092860); + TestUtils.AreEqual(r0, a0 | b0); + + int3x4 a1 = int3x4(228656898, 1536908787, 606786773, 1739461580, 2040936581, 1350320187, 1377874553, 1522262112, 1496806239, 1732466858, 1535976093, 375675620); + int b1 = (41280811); + int3x4 r1 = int3x4(267773739, 1543503355, 645920255, 1744828399, 2079849903, 1383982395, 1383462779, 1526719851, 1534588799, 1735916971, 1543366591, 376831983); + TestUtils.AreEqual(r1, a1 | b1); + + int3x4 a2 = int3x4(1614193383, 697385997, 112556963, 1614163749, 1583289054, 1370656810, 1286074530, 1155438844, 1835671387, 440002979, 1569359727, 5393691); + int b2 = (226059393); + int3x4 r2 = int3x4(1837098727, 771318925, 268271523, 1837068197, 1602189023, 1576793259, 1308619939, 1308622077, 1836810203, 528084387, 1576789999, 226192795); + TestUtils.AreEqual(r2, a2 | b2); + + int3x4 a3 = int3x4(774282482, 212144562, 1525899482, 463019249, 1531812233, 1944160603, 953179348, 1692078056, 1331652826, 183129856, 1305664018, 626899632); + int b3 = (1217128427); + int3x4 r3 = int3x4(1857028091, 1286600699, 1526458363, 1536950267, 1540358123, 2079059963, 2027683839, 1826353131, 1340076027, 1256978411, 1306263547, 1843396603); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void int3x4_operator_bitwise_or_scalar_wide() + { + int a0 = (1768627592); + int3x4 b0 = int3x4(1849658052, 1759912154, 729979455, 975926310, 1987690876, 1809506714, 1160695341, 408963395, 314072711, 1560007537, 1709003416, 977086639); + int3x4 r0 = int3x4(1870634956, 1777286618, 1810603967, 2070642094, 2138824188, 1811676570, 1836048301, 2037079499, 2080071567, 2113658873, 1845452696, 2071936431); + TestUtils.AreEqual(r0, a0 | b0); + + int a1 = (1448375596); + int3x4 b1 = int3x4(1689568808, 595543345, 559778387, 621080913, 438994183, 1742637145, 1219409263, 1602932494, 1204461702, 2111538444, 836730895, 1207638621); + int3x4 r1 = int3x4(1995765548, 2004841789, 2002648959, 2002056573, 1585378607, 2011102589, 1593767279, 1608449838, 1474229678, 2145383724, 2011165999, 1476362109); + TestUtils.AreEqual(r1, a1 | b1); + + int a2 = (802100209); + int3x4 b2 = int3x4(1089077339, 1315030334, 249047666, 1604790897, 1848168086, 347254235, 1777613639, 1876731927, 842785732, 1023558747, 1567635900, 1888818835); + int3x4 r2 = int3x4(1877939195, 1877989375, 803159027, 2146384881, 1877991415, 1073725435, 1878998007, 1876933623, 1073738741, 1070553083, 2147433469, 2145327091); + TestUtils.AreEqual(r2, a2 | b2); + + int a3 = (1681286114); + int3x4 b3 = int3x4(816160472, 669874393, 856364582, 957707703, 533888601, 707380794, 1472392035, 1658477097, 490006292, 1104319323, 1803275943, 1843251082); + int3x4 r3 = int3x4(1958215674, 1744796667, 2000648166, 2100787191, 2146861051, 1849681914, 2012670947, 1727953899, 2100750326, 1710683131, 1870655463, 1845487594); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void int3x4_operator_bitwise_xor_wide_wide() + { + int3x4 a0 = int3x4(1843655608, 362425681, 640805534, 1342040268, 945678755, 980321850, 390165019, 1682422658, 303897251, 230477768, 1103646442, 1503102919); + int3x4 b0 = int3x4(1422803441, 1234691140, 119589253, 1101464929, 121896337, 1880109018, 1000210266, 1718938232, 464406940, 884337881, 34199854, 1430659227); + int3x4 r0 = int3x4(959296073, 1544407317, 554771227, 240840109, 1058935858, 1249815008, 752651585, 36917754, 162747199, 956900113, 1136760772, 215066460); + TestUtils.AreEqual(r0, a0 ^ b0); + + int3x4 a1 = int3x4(26631152, 1016475570, 1862440929, 379588576, 1943580404, 691527166, 723280696, 497086939, 1640104913, 893178410, 1596765788, 664096470); + int3x4 b1 = int3x4(126415540, 1069919967, 1810763253, 2082802224, 941097951, 27782297, 156353074, 607061607, 470737131, 1151564598, 8268481, 434405645); + int3x4 r1 = int3x4(102672708, 55804269, 82614804, 1787102672, 1270918443, 680538471, 575512842, 965736380, 2110579514, 1906288924, 1599249565, 1047646171); + TestUtils.AreEqual(r1, a1 ^ b1); + + int3x4 a2 = int3x4(2043360590, 799560121, 287637604, 696169196, 2067184169, 1208059988, 1250597330, 1386507647, 1889791408, 2084012261, 308683100, 995657536); + int3x4 b2 = int3x4(519003095, 1880915120, 608970922, 1809455754, 1079250101, 514389994, 272120301, 1282399149, 1045003273, 1596550715, 1654640361, 147544177); + int3x4 r2 = int3x4(1730440857, 1605643529, 896084174, 1118087270, 996325020, 1453948862, 1521655871, 516667090, 1323995577, 589229790, 1895428021, 865328945); + TestUtils.AreEqual(r2, a2 ^ b2); + + int3x4 a3 = int3x4(2114803648, 1391716615, 1288505091, 1981377086, 1609802717, 1174043024, 1011203132, 1795164620, 244928755, 108081775, 1095776733, 1503947924); + int3x4 b3 = int3x4(1770899808, 632909311, 351538321, 18362671, 582069925, 1343437834, 646157103, 1334609482, 1029555059, 1791514242, 2130180592, 1367984612); + int3x4 r3 = int3x4(394305184, 2001372408, 1480133522, 1996577553, 2101480824, 367609242, 449195795, 613191558, 868520832, 1824089325, 1067958317, 137209200); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void int3x4_operator_bitwise_xor_wide_scalar() + { + int3x4 a0 = int3x4(169345668, 176087064, 2084362901, 1663924004, 193851255, 517476661, 905336222, 863800783, 365003873, 835837496, 954341348, 1464576786); + int b0 = (354464228); + int3x4 r0 = int3x4(523809632, 526275068, 1763470193, 1980614336, 514678419, 200843473, 550954106, 643578923, 14759301, 619802588, 767731200, 1114315510); + TestUtils.AreEqual(r0, a0 ^ b0); + + int3x4 a1 = int3x4(625604047, 2003392824, 1481813598, 1077374714, 1043379893, 1991576049, 781860967, 60088394, 1196907956, 858716109, 858484213, 178843494); + int b1 = (1700827127); + int3x4 r1 = int3x4(1076460088, 302634703, 1026695593, 626516237, 1531984194, 332760582, 1274728336, 1727295421, 574083651, 1447983162, 1447813634, 1875402897); + TestUtils.AreEqual(r1, a1 ^ b1); + + int3x4 a2 = int3x4(1223183458, 1771693181, 1206307664, 2037729583, 1324393116, 497725784, 1367278685, 962962860, 906632547, 1570278596, 1744797352, 574677361); + int b2 = (866652388); + int3x4 r2 = int3x4(2067815558, 1513223321, 1951325108, 1256020427, 2102964856, 771924412, 1658262713, 181253448, 94506375, 1848679456, 1415016012, 300478869); + TestUtils.AreEqual(r2, a2 ^ b2); + + int3x4 a3 = int3x4(1363709514, 801937870, 1010182360, 1851940033, 346084804, 1153678862, 443991213, 53881334, 2016754499, 1219039118, 98879165, 1431003548); + int b3 = (1256194849); + int3x4 r3 = int3x4(464031083, 1697422063, 1993747449, 612524000, 1581307621, 237223215, 1352058764, 1238772439, 852834402, 38341807, 1325712796, 531325629); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void int3x4_operator_bitwise_xor_scalar_wide() + { + int a0 = (1361775641); + int3x4 b0 = int3x4(1452773578, 459050892, 1986218254, 1689037698, 999278344, 1229114508, 1087843538, 733699740, 106187872, 1533632738, 1107817672, 492506236); + int3x4 r0 = int3x4(129801427, 1249346453, 659047703, 898082715, 1789184785, 409583765, 301736139, 2056278661, 1467957369, 172125435, 321714385, 1282408549); + TestUtils.AreEqual(r0, a0 ^ b0); + + int a1 = (597602329); + int3x4 b1 = int3x4(1439603382, 1001169118, 1231718216, 1693179077, 1050897427, 1796435561, 1100532547, 2106589181, 79691722, 851486414, 381749210, 1743618507); + int3x4 r1 = int3x4(1984965295, 405934279, 1794389841, 1198877916, 490593290, 1217257072, 1644591962, 1578192868, 656494547, 291378903, 895465411, 1148400082); + TestUtils.AreEqual(r1, a1 ^ b1); + + int a2 = (2038827673); + int3x4 b2 = int3x4(1680906962, 161437943, 171927307, 277703584, 1344718195, 1634011177, 28540247, 1205447252, 150341716, 899457210, 1927941858, 1213321665); + int3x4 r2 = int3x4(498503755, 1880707694, 1941532050, 1762353465, 698404842, 417530544, 2016769998, 1046454477, 1903166157, 1276815907, 191628411, 836229976); + TestUtils.AreEqual(r2, a2 ^ b2); + + int a3 = (1943899052); + int3x4 b3 = int3x4(1166699955, 244059986, 698605361, 770240668, 1451322609, 409403288, 227252138, 455879262, 1859170556, 2135312326, 436746325, 843204844); + int3x4 r3 = int3x4(911730207, 2102494462, 1518228637, 1580563248, 626845533, 1807447092, 2119572486, 1760666098, 487406416, 211537002, 1775612921, 1100989248); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void int3x4_operator_left_shift() + { + int3x4 a0 = int3x4(1129100049, 829482269, 1571297368, 443753193, 1872142968, 249554593, 892627436, 980302862, 62369727, 849916599, 1271350845, 108441902); + int b0 = (218351941); + int3x4 r0 = int3x4(1771463200, 773628832, -1258091776, 1315200288, -220967168, -604187616, -1500693120, 1304920512, 1995831264, 1427527392, 2028521376, -824826432); + TestUtils.AreEqual(r0, a0 << b0); + + int3x4 a1 = int3x4(1959056531, 1451674188, 2082026915, 1149883636, 1380536034, 186532735, 1487486874, 1498738574, 752067504, 1647167336, 772453640, 456967739); + int b1 = (1779118882); + int3x4 r1 = int3x4(-753708468, 1511729456, -261826932, 304567248, 1227176840, 746130940, 1654980200, 1699987000, -1286697280, -2001265248, -1205152736, 1827870956); + TestUtils.AreEqual(r1, a1 << b1); + + int3x4 a2 = int3x4(947384545, 1315516161, 640579158, 56630178, 1650899378, 2142944517, 565484033, 965161323, 1634169280, 1821547426, 1959741996, 1189216014); + int b2 = (1463252873); + int3x4 r2 = int3x4(-270417408, -765591040, 1559014400, -1070119936, -848075776, 1970932224, 1765016064, 241358336, -823951360, 624378880, -1634445312, -1006756864); + TestUtils.AreEqual(r2, a2 << b2); + + int3x4 a3 = int3x4(2088913234, 1765476869, 1716088059, 2042799042, 1560870407, 1332136179, 1595140080, 1067324801, 948699739, 1516035622, 1153563832, 1430593538); + int b3 = (331636352); + int3x4 r3 = int3x4(2088913234, 1765476869, 1716088059, 2042799042, 1560870407, 1332136179, 1595140080, 1067324801, 948699739, 1516035622, 1153563832, 1430593538); + TestUtils.AreEqual(r3, a3 << b3); + } + + [TestCompiler] + public static void int3x4_operator_right_shift() + { + int3x4 a0 = int3x4(809126085, 908563670, 763568837, 1986717290, 1174507510, 646821842, 1242726074, 390811632, 1521420393, 1923166649, 102096936, 400863878); + int b0 = (994800051); + int3x4 r0 = int3x4(1543, 1732, 1456, 3789, 2240, 1233, 2370, 745, 2901, 3668, 194, 764); + TestUtils.AreEqual(r0, a0 >> b0); + + int3x4 a1 = int3x4(667378673, 307750782, 479442287, 2014389412, 1673938174, 1075916177, 1248577253, 848199210, 813936577, 848976170, 500930883, 662405800); + int b1 = (1611921244); + int3x4 r1 = int3x4(2, 1, 1, 7, 6, 4, 4, 3, 3, 3, 1, 2); + TestUtils.AreEqual(r1, a1 >> b1); + + int3x4 a2 = int3x4(126875849, 1199000503, 955487090, 1013356510, 391605984, 185228398, 87452680, 2021602226, 1401766495, 275199908, 664576720, 363706280); + int b2 = (1103917083); + int3x4 r2 = int3x4(0, 8, 7, 7, 2, 1, 0, 15, 10, 2, 4, 2); + TestUtils.AreEqual(r2, a2 >> b2); + + int3x4 a3 = int3x4(1600231415, 1403250657, 1132760506, 388419548, 1563117590, 1786307084, 1386128491, 1614558171, 370772389, 47213745, 1348912303, 1452132416); + int b3 = (19835299); + int3x4 r3 = int3x4(200028926, 175406332, 141595063, 48552443, 195389698, 223288385, 173266061, 201819771, 46346548, 5901718, 168614037, 181516552); + TestUtils.AreEqual(r3, a3 >> b3); + } + + [TestCompiler] + public static void int3x4_operator_bitwise_not() + { + int3x4 a0 = int3x4(111796841, 603562399, 745091931, 853183268, 1110916612, 381888399, 1891338755, 1506860135, 771210628, 787710759, 875964607, 96456785); + int3x4 r0 = int3x4(-111796842, -603562400, -745091932, -853183269, -1110916613, -381888400, -1891338756, -1506860136, -771210629, -787710760, -875964608, -96456786); + TestUtils.AreEqual(r0, ~a0); + + int3x4 a1 = int3x4(916013379, 1172294211, 1020232736, 683852713, 375158799, 881353367, 1218471344, 1174233245, 592898220, 443427914, 1385118179, 215320517); + int3x4 r1 = int3x4(-916013380, -1172294212, -1020232737, -683852714, -375158800, -881353368, -1218471345, -1174233246, -592898221, -443427915, -1385118180, -215320518); + TestUtils.AreEqual(r1, ~a1); + + int3x4 a2 = int3x4(860122767, 1349739899, 686325107, 829984855, 191189901, 319233142, 156019905, 1467719681, 1193642973, 957020051, 610113447, 1906177458); + int3x4 r2 = int3x4(-860122768, -1349739900, -686325108, -829984856, -191189902, -319233143, -156019906, -1467719682, -1193642974, -957020052, -610113448, -1906177459); + TestUtils.AreEqual(r2, ~a2); + + int3x4 a3 = int3x4(1022824453, 1876376887, 479785538, 1454477141, 1062967600, 864049393, 916152339, 1644897753, 1624633488, 210894078, 759733457, 40062168); + int3x4 r3 = int3x4(-1022824454, -1876376888, -479785539, -1454477142, -1062967601, -864049394, -916152340, -1644897754, -1624633489, -210894079, -759733458, -40062169); + TestUtils.AreEqual(r3, ~a3); + } + + [TestCase /* For player builds */] + public static void int3x4_EqualsObjectOverride() + { + TestUtils.IsFalse(new int3x4().Equals((object)new int())); + TestUtils.IsTrue(new int3x4().Equals((object)new int3x4())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestInt3x4.gen.cs.meta b/src/Tests/Tests/Shared/TestInt3x4.gen.cs.meta new file mode 100644 index 00000000..281cb7b8 --- /dev/null +++ b/src/Tests/Tests/Shared/TestInt3x4.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f6cb6aa9b75ca25439dd64f10fe7d737 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestInt4.gen.cs b/src/Tests/Tests/Shared/TestInt4.gen.cs new file mode 100644 index 00000000..3c712b61 --- /dev/null +++ b/src/Tests/Tests/Shared/TestInt4.gen.cs @@ -0,0 +1,1360 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestInt4 + { + [TestCompiler] + public static void int4_zero() + { + TestUtils.AreEqual(0, int4.zero.x); + TestUtils.AreEqual(0, int4.zero.y); + TestUtils.AreEqual(0, int4.zero.z); + TestUtils.AreEqual(0, int4.zero.w); + } + + [TestCompiler] + public static void int4_constructor() + { + int4 a = new int4(1, 2, 3, 4); + TestUtils.AreEqual(1, a.x); + TestUtils.AreEqual(2, a.y); + TestUtils.AreEqual(3, a.z); + TestUtils.AreEqual(4, a.w); + } + + [TestCompiler] + public static void int4_scalar_constructor() + { + int4 a = new int4(17); + TestUtils.AreEqual(17, a.x); + TestUtils.AreEqual(17, a.y); + TestUtils.AreEqual(17, a.z); + TestUtils.AreEqual(17, a.w); + } + + [TestCompiler] + public static void int4_static_constructor() + { + int4 a = int4(1, 2, 3, 4); + TestUtils.AreEqual(1, a.x); + TestUtils.AreEqual(2, a.y); + TestUtils.AreEqual(3, a.z); + TestUtils.AreEqual(4, a.w); + } + + [TestCompiler] + public static void int4_static_scalar_constructor() + { + int4 a = int4(17); + TestUtils.AreEqual(17, a.x); + TestUtils.AreEqual(17, a.y); + TestUtils.AreEqual(17, a.z); + TestUtils.AreEqual(17, a.w); + } + + [TestCompiler] + public static void int4_operator_equal_wide_wide() + { + int4 a0 = int4(2105871082, 35218899, 1550755093, 764676020); + int4 b0 = int4(1477587886, 579629692, 540974792, 208405066); + bool4 r0 = bool4(false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + int4 a1 = int4(606743782, 1208156098, 1023640014, 1038468316); + int4 b1 = int4(2063397938, 1060167409, 362592601, 2097545362); + bool4 r1 = bool4(false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + int4 a2 = int4(1416064367, 727143393, 2061243891, 184669837); + int4 b2 = int4(277670088, 426944490, 901076223, 857900673); + bool4 r2 = bool4(false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + int4 a3 = int4(1303661760, 2044073738, 370395888, 1822916805); + int4 b3 = int4(1548779757, 325265488, 312658571, 176373760); + bool4 r3 = bool4(false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void int4_operator_equal_wide_scalar() + { + int4 a0 = int4(437822262, 2020661134, 541786900, 853113810); + int b0 = (1332833578); + bool4 r0 = bool4(false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + int4 a1 = int4(23716499, 1409026299, 948838849, 953202998); + int b1 = (179951405); + bool4 r1 = bool4(false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + int4 a2 = int4(691955848, 1851546137, 712957637, 2028784869); + int b2 = (1926262965); + bool4 r2 = bool4(false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + int4 a3 = int4(1049962241, 1016802970, 390120467, 464814777); + int b3 = (1836975611); + bool4 r3 = bool4(false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void int4_operator_equal_scalar_wide() + { + int a0 = (542329200); + int4 b0 = int4(1115584594, 684107773, 1928988941, 890709324); + bool4 r0 = bool4(false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + int a1 = (641152437); + int4 b1 = int4(1410341302, 497505660, 1068223109, 2014009435); + bool4 r1 = bool4(false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + int a2 = (213835595); + int4 b2 = int4(1592428361, 1819361470, 448650623, 1942175642); + bool4 r2 = bool4(false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + int a3 = (64377057); + int4 b3 = int4(1485938610, 1146305380, 1312317120, 263290348); + bool4 r3 = bool4(false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void int4_operator_not_equal_wide_wide() + { + int4 a0 = int4(1977284100, 1293292704, 1547283851, 422428953); + int4 b0 = int4(1514195556, 957972049, 507667364, 581861672); + bool4 r0 = bool4(true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + int4 a1 = int4(195833190, 1711544892, 5606053, 737069074); + int4 b1 = int4(1128094576, 940096636, 57559040, 181752616); + bool4 r1 = bool4(true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + int4 a2 = int4(647386678, 13079405, 1413841590, 1076166545); + int4 b2 = int4(962017320, 1762015406, 1107218953, 2042026522); + bool4 r2 = bool4(true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + int4 a3 = int4(1211445174, 1289303469, 1436402489, 1129570126); + int4 b3 = int4(836002288, 570272309, 2112081980, 1500634658); + bool4 r3 = bool4(true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void int4_operator_not_equal_wide_scalar() + { + int4 a0 = int4(1038269360, 1427812625, 103361237, 1347017023); + int b0 = (768873026); + bool4 r0 = bool4(true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + int4 a1 = int4(1523584313, 660334527, 719113717, 262959423); + int b1 = (150442802); + bool4 r1 = bool4(true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + int4 a2 = int4(484398043, 226568494, 507918242, 1702162286); + int b2 = (506946952); + bool4 r2 = bool4(true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + int4 a3 = int4(923269270, 114581840, 1045389187, 1648095254); + int b3 = (166187260); + bool4 r3 = bool4(true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void int4_operator_not_equal_scalar_wide() + { + int a0 = (1652127596); + int4 b0 = int4(953791238, 271722683, 1278885987, 735128017); + bool4 r0 = bool4(true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + int a1 = (112416504); + int4 b1 = int4(25967222, 1761444475, 1844594536, 1199122922); + bool4 r1 = bool4(true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + int a2 = (634219279); + int4 b2 = int4(942501101, 67161343, 969944293, 833229499); + bool4 r2 = bool4(true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + int a3 = (1304301133); + int4 b3 = int4(704045745, 345012334, 1253134152, 325772538); + bool4 r3 = bool4(true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void int4_operator_less_wide_wide() + { + int4 a0 = int4(1486550609, 1779244308, 1602148045, 1614085440); + int4 b0 = int4(97842578, 536551311, 413528975, 1838293684); + bool4 r0 = bool4(false, false, false, true); + TestUtils.AreEqual(r0, a0 < b0); + + int4 a1 = int4(1975613414, 942838342, 1092279031, 373677431); + int4 b1 = int4(1283898480, 1456599961, 1080278602, 529676676); + bool4 r1 = bool4(false, true, false, true); + TestUtils.AreEqual(r1, a1 < b1); + + int4 a2 = int4(1419098312, 337757077, 1081797900, 1336745069); + int4 b2 = int4(156584048, 117348799, 246927124, 1916615924); + bool4 r2 = bool4(false, false, false, true); + TestUtils.AreEqual(r2, a2 < b2); + + int4 a3 = int4(840685445, 1220554047, 2013681746, 192965012); + int4 b3 = int4(1731071394, 1328098431, 1014995792, 480319327); + bool4 r3 = bool4(true, true, false, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void int4_operator_less_wide_scalar() + { + int4 a0 = int4(796797557, 670113454, 933579492, 278884514); + int b0 = (746564682); + bool4 r0 = bool4(false, true, false, true); + TestUtils.AreEqual(r0, a0 < b0); + + int4 a1 = int4(318174822, 741886928, 1990922600, 1030849597); + int b1 = (1117630673); + bool4 r1 = bool4(true, true, false, true); + TestUtils.AreEqual(r1, a1 < b1); + + int4 a2 = int4(1546212312, 1648393417, 1857132231, 1909506562); + int b2 = (1718582899); + bool4 r2 = bool4(true, true, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + int4 a3 = int4(1294006045, 1303736668, 845460171, 979430272); + int b3 = (952084157); + bool4 r3 = bool4(false, false, true, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void int4_operator_less_scalar_wide() + { + int a0 = (186400299); + int4 b0 = int4(1881344229, 813834467, 1254886626, 1353590345); + bool4 r0 = bool4(true, true, true, true); + TestUtils.AreEqual(r0, a0 < b0); + + int a1 = (1412343685); + int4 b1 = int4(1555571443, 1540508298, 1735458634, 135888070); + bool4 r1 = bool4(true, true, true, false); + TestUtils.AreEqual(r1, a1 < b1); + + int a2 = (1643818742); + int4 b2 = int4(248291654, 1739560105, 728539891, 480507742); + bool4 r2 = bool4(false, true, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + int a3 = (1696553040); + int4 b3 = int4(540223931, 1840493353, 146833656, 798115946); + bool4 r3 = bool4(false, true, false, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void int4_operator_greater_wide_wide() + { + int4 a0 = int4(2087717754, 1725569452, 1298066182, 1693943616); + int4 b0 = int4(85148514, 293632137, 1151128249, 409440398); + bool4 r0 = bool4(true, true, true, true); + TestUtils.AreEqual(r0, a0 > b0); + + int4 a1 = int4(1319019629, 70674491, 1042499725, 1002821508); + int4 b1 = int4(1115020183, 1508500597, 1834583302, 1755218534); + bool4 r1 = bool4(true, false, false, false); + TestUtils.AreEqual(r1, a1 > b1); + + int4 a2 = int4(1021857133, 1744374599, 821751047, 467646903); + int4 b2 = int4(1788761753, 1128238489, 834223713, 1578743290); + bool4 r2 = bool4(false, true, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + int4 a3 = int4(2029731638, 1377214212, 1207816926, 474621063); + int4 b3 = int4(1647150256, 1756397855, 1131080201, 1208965204); + bool4 r3 = bool4(true, false, true, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void int4_operator_greater_wide_scalar() + { + int4 a0 = int4(1208626274, 239697208, 1979453345, 1253474001); + int b0 = (1715176566); + bool4 r0 = bool4(false, false, true, false); + TestUtils.AreEqual(r0, a0 > b0); + + int4 a1 = int4(1590192876, 1673945595, 1662650098, 222749855); + int b1 = (1487911635); + bool4 r1 = bool4(true, true, true, false); + TestUtils.AreEqual(r1, a1 > b1); + + int4 a2 = int4(1433540517, 1773305960, 1850273578, 206147145); + int b2 = (566635217); + bool4 r2 = bool4(true, true, true, false); + TestUtils.AreEqual(r2, a2 > b2); + + int4 a3 = int4(325913453, 1905567362, 2053577491, 570397194); + int b3 = (333381537); + bool4 r3 = bool4(false, true, true, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void int4_operator_greater_scalar_wide() + { + int a0 = (480938827); + int4 b0 = int4(1824731899, 921496110, 586859044, 946430596); + bool4 r0 = bool4(false, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + int a1 = (1231356727); + int4 b1 = int4(1390167458, 1785807092, 28949024, 2037899283); + bool4 r1 = bool4(false, false, true, false); + TestUtils.AreEqual(r1, a1 > b1); + + int a2 = (595656760); + int4 b2 = int4(1778095771, 1233500439, 1696302238, 1445965340); + bool4 r2 = bool4(false, false, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + int a3 = (484020151); + int4 b3 = int4(1586962841, 1361740714, 265628948, 2003122957); + bool4 r3 = bool4(false, false, true, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void int4_operator_less_equal_wide_wide() + { + int4 a0 = int4(154092149, 1515170149, 1083970332, 785807178); + int4 b0 = int4(77984380, 1712054191, 1566203809, 254834519); + bool4 r0 = bool4(false, true, true, false); + TestUtils.AreEqual(r0, a0 <= b0); + + int4 a1 = int4(1401094881, 310537627, 868328962, 1990816725); + int4 b1 = int4(450519938, 389457083, 1298669505, 207343167); + bool4 r1 = bool4(false, true, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + int4 a2 = int4(2035349541, 457043352, 1123282035, 1001842946); + int4 b2 = int4(1214449047, 2059561026, 896534357, 1897470050); + bool4 r2 = bool4(false, true, false, true); + TestUtils.AreEqual(r2, a2 <= b2); + + int4 a3 = int4(1387761992, 195272789, 659549000, 888761458); + int4 b3 = int4(521075677, 1848221945, 374708019, 1573731118); + bool4 r3 = bool4(false, true, false, true); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void int4_operator_less_equal_wide_scalar() + { + int4 a0 = int4(1479531977, 1427983411, 415250630, 1245345407); + int b0 = (2004563877); + bool4 r0 = bool4(true, true, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + int4 a1 = int4(1112546666, 1579912858, 101048307, 1070894375); + int b1 = (1072990632); + bool4 r1 = bool4(false, false, true, true); + TestUtils.AreEqual(r1, a1 <= b1); + + int4 a2 = int4(509818792, 85452501, 518127023, 1246249980); + int b2 = (1910488590); + bool4 r2 = bool4(true, true, true, true); + TestUtils.AreEqual(r2, a2 <= b2); + + int4 a3 = int4(1097326500, 1968139888, 1191853379, 662096238); + int b3 = (1964410699); + bool4 r3 = bool4(true, false, true, true); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void int4_operator_less_equal_scalar_wide() + { + int a0 = (1899193992); + int4 b0 = int4(915011820, 980913757, 1337699683, 1476321359); + bool4 r0 = bool4(false, false, false, false); + TestUtils.AreEqual(r0, a0 <= b0); + + int a1 = (1102143668); + int4 b1 = int4(660493983, 184664508, 381579707, 1954892821); + bool4 r1 = bool4(false, false, false, true); + TestUtils.AreEqual(r1, a1 <= b1); + + int a2 = (1295090571); + int4 b2 = int4(1440368586, 1696003686, 88708652, 1332251857); + bool4 r2 = bool4(true, true, false, true); + TestUtils.AreEqual(r2, a2 <= b2); + + int a3 = (1310713644); + int4 b3 = int4(2112132784, 48951945, 1888568027, 39340955); + bool4 r3 = bool4(true, false, true, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void int4_operator_greater_equal_wide_wide() + { + int4 a0 = int4(8538378, 2131749726, 265427108, 523609761); + int4 b0 = int4(903145828, 1697992986, 1432491982, 169789504); + bool4 r0 = bool4(false, true, false, true); + TestUtils.AreEqual(r0, a0 >= b0); + + int4 a1 = int4(994991818, 839709564, 101288202, 1886280970); + int4 b1 = int4(1059357300, 1744255222, 1606584463, 1905414425); + bool4 r1 = bool4(false, false, false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + int4 a2 = int4(2032074826, 631221455, 1456286159, 961342752); + int4 b2 = int4(1448794969, 136181998, 1678754836, 2069656857); + bool4 r2 = bool4(true, true, false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + int4 a3 = int4(424526026, 788481984, 1662488497, 870326690); + int4 b3 = int4(398982689, 243317404, 740939613, 1894753119); + bool4 r3 = bool4(true, true, true, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void int4_operator_greater_equal_wide_scalar() + { + int4 a0 = int4(2049236663, 182691143, 634973382, 1197012109); + int b0 = (1061998015); + bool4 r0 = bool4(true, false, false, true); + TestUtils.AreEqual(r0, a0 >= b0); + + int4 a1 = int4(439837565, 1108037359, 351147187, 1898505669); + int b1 = (1367606469); + bool4 r1 = bool4(false, false, false, true); + TestUtils.AreEqual(r1, a1 >= b1); + + int4 a2 = int4(411667685, 4652390, 996159180, 2111455181); + int b2 = (1998610091); + bool4 r2 = bool4(false, false, false, true); + TestUtils.AreEqual(r2, a2 >= b2); + + int4 a3 = int4(727766399, 814085575, 1525995206, 1293933760); + int b3 = (96217144); + bool4 r3 = bool4(true, true, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void int4_operator_greater_equal_scalar_wide() + { + int a0 = (1859811087); + int4 b0 = int4(1070365918, 1783869452, 830091760, 377157428); + bool4 r0 = bool4(true, true, true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + int a1 = (327199016); + int4 b1 = int4(90384229, 1154649706, 376758501, 1079802834); + bool4 r1 = bool4(true, false, false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + int a2 = (2054742898); + int4 b2 = int4(1328349472, 434061447, 951207723, 598695892); + bool4 r2 = bool4(true, true, true, true); + TestUtils.AreEqual(r2, a2 >= b2); + + int a3 = (975131651); + int4 b3 = int4(1714007943, 177416473, 1267232721, 31082860); + bool4 r3 = bool4(false, true, false, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void int4_operator_add_wide_wide() + { + int4 a0 = int4(2135171378, 21433296, 1954723494, 683604307); + int4 b0 = int4(1013431952, 366718162, 359290756, 1393163294); + int4 r0 = int4(-1146363966, 388151458, -1980953046, 2076767601); + TestUtils.AreEqual(r0, a0 + b0); + + int4 a1 = int4(1054212315, 1762680995, 1963655852, 1257853062); + int4 b1 = int4(1962236872, 1263270041, 1862666629, 1077447887); + int4 r1 = int4(-1278518109, -1269016260, -468644815, -1959666347); + TestUtils.AreEqual(r1, a1 + b1); + + int4 a2 = int4(2043493600, 976898058, 1915056423, 121374462); + int4 b2 = int4(821693806, 487316539, 350922520, 1583012528); + int4 r2 = int4(-1429779890, 1464214597, -2028988353, 1704386990); + TestUtils.AreEqual(r2, a2 + b2); + + int4 a3 = int4(1218855698, 700538222, 1702057277, 1788251699); + int4 b3 = int4(1951595076, 1024851344, 874302782, 1383969588); + int4 r3 = int4(-1124516522, 1725389566, -1718607237, -1122746009); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void int4_operator_add_wide_scalar() + { + int4 a0 = int4(665815972, 1783729250, 1591678394, 1284528538); + int b0 = (1334043849); + int4 r0 = int4(1999859821, -1177194197, -1369245053, -1676394909); + TestUtils.AreEqual(r0, a0 + b0); + + int4 a1 = int4(977850224, 1138577680, 1200356017, 565982008); + int b1 = (71069732); + int4 r1 = int4(1048919956, 1209647412, 1271425749, 637051740); + TestUtils.AreEqual(r1, a1 + b1); + + int4 a2 = int4(1246759684, 57252642, 678921480, 625943813); + int b2 = (1088001167); + int4 r2 = int4(-1960206445, 1145253809, 1766922647, 1713944980); + TestUtils.AreEqual(r2, a2 + b2); + + int4 a3 = int4(512157429, 1490096953, 1467033531, 182608093); + int b3 = (1470648741); + int4 r3 = int4(1982806170, -1334221602, -1357285024, 1653256834); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void int4_operator_add_scalar_wide() + { + int a0 = (359966320); + int4 b0 = int4(2146146202, 767103309, 851002415, 311531406); + int4 r0 = int4(-1788854774, 1127069629, 1210968735, 671497726); + TestUtils.AreEqual(r0, a0 + b0); + + int a1 = (1491262941); + int4 b1 = int4(1016891373, 1954228994, 1671335850, 727870747); + int4 r1 = int4(-1786812982, -849475361, -1132368505, -2075833608); + TestUtils.AreEqual(r1, a1 + b1); + + int a2 = (551151834); + int4 b2 = int4(1390261152, 1699060326, 115021619, 1964440175); + int4 r2 = int4(1941412986, -2044755136, 666173453, -1779375287); + TestUtils.AreEqual(r2, a2 + b2); + + int a3 = (440700758); + int4 b3 = int4(1556692550, 185414255, 933106731, 1217866784); + int4 r3 = int4(1997393308, 626115013, 1373807489, 1658567542); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void int4_operator_sub_wide_wide() + { + int4 a0 = int4(1410318491, 1097280168, 1827039044, 28881338); + int4 b0 = int4(1315897366, 799052018, 1580289673, 1094686261); + int4 r0 = int4(94421125, 298228150, 246749371, -1065804923); + TestUtils.AreEqual(r0, a0 - b0); + + int4 a1 = int4(328720965, 875487868, 212936325, 231977215); + int4 b1 = int4(1954325726, 1197734816, 229886366, 915679176); + int4 r1 = int4(-1625604761, -322246948, -16950041, -683701961); + TestUtils.AreEqual(r1, a1 - b1); + + int4 a2 = int4(1740021315, 2011295463, 48079003, 591379285); + int4 b2 = int4(1746884850, 918743925, 1007797419, 257421324); + int4 r2 = int4(-6863535, 1092551538, -959718416, 333957961); + TestUtils.AreEqual(r2, a2 - b2); + + int4 a3 = int4(1125909359, 1842588095, 848561896, 614448464); + int4 b3 = int4(287249342, 1617287463, 1653916102, 123586847); + int4 r3 = int4(838660017, 225300632, -805354206, 490861617); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void int4_operator_sub_wide_scalar() + { + int4 a0 = int4(1508669340, 1594795463, 266707545, 643102647); + int b0 = (998008471); + int4 r0 = int4(510660869, 596786992, -731300926, -354905824); + TestUtils.AreEqual(r0, a0 - b0); + + int4 a1 = int4(287705008, 1113286221, 979450511, 2082174113); + int b1 = (1475644328); + int4 r1 = int4(-1187939320, -362358107, -496193817, 606529785); + TestUtils.AreEqual(r1, a1 - b1); + + int4 a2 = int4(1108005498, 999244508, 1806482044, 1994553647); + int b2 = (304369206); + int4 r2 = int4(803636292, 694875302, 1502112838, 1690184441); + TestUtils.AreEqual(r2, a2 - b2); + + int4 a3 = int4(2101812429, 266654115, 1470212363, 1190349300); + int b3 = (1482736902); + int4 r3 = int4(619075527, -1216082787, -12524539, -292387602); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void int4_operator_sub_scalar_wide() + { + int a0 = (893369501); + int4 b0 = int4(2051906184, 1699714311, 442603706, 1735141684); + int4 r0 = int4(-1158536683, -806344810, 450765795, -841772183); + TestUtils.AreEqual(r0, a0 - b0); + + int a1 = (274533585); + int4 b1 = int4(811580259, 1196354320, 1524097023, 533621527); + int4 r1 = int4(-537046674, -921820735, -1249563438, -259087942); + TestUtils.AreEqual(r1, a1 - b1); + + int a2 = (2080845793); + int4 b2 = int4(143958837, 1620668660, 1135989346, 1367044745); + int4 r2 = int4(1936886956, 460177133, 944856447, 713801048); + TestUtils.AreEqual(r2, a2 - b2); + + int a3 = (554088609); + int4 b3 = int4(552670373, 1265516124, 1254902543, 1857695581); + int4 r3 = int4(1418236, -711427515, -700813934, -1303606972); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void int4_operator_mul_wide_wide() + { + int4 a0 = int4(61417577, 219585476, 1362520891, 1511084277); + int4 b0 = int4(578042444, 1620527213, 200516468, 309339115); + int4 r0 = int4(-1426863828, 1326150260, -990894148, -1322856473); + TestUtils.AreEqual(r0, a0 * b0); + + int4 a1 = int4(1481211272, 58211871, 1459591173, 567624644); + int4 b1 = int4(542853019, 299467282, 1479641221, 1428338601); + int4 r1 = int4(1973926232, 88546350, -863919463, -582821788); + TestUtils.AreEqual(r1, a1 * b1); + + int4 a2 = int4(1169935583, 1835691886, 385626539, 85934842); + int4 b2 = int4(1497302909, 1596889147, 427413842, 265122693); + int4 r2 = int4(556671459, 1098186330, 1848083398, -58320414); + TestUtils.AreEqual(r2, a2 * b2); + + int4 a3 = int4(522856538, 278370196, 289217012, 2083410174); + int4 b3 = int4(689376654, 1120457204, 516903000, 873091659); + int4 r3 = int4(2005201900, 651971856, -1721160736, -110160278); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void int4_operator_mul_wide_scalar() + { + int4 a0 = int4(871746615, 492532311, 570557670, 2142306629); + int b0 = (442064533); + int4 r0 = int4(338365955, 1081376419, -1729147426, -1015409879); + TestUtils.AreEqual(r0, a0 * b0); + + int4 a1 = int4(1610315153, 118471734, 257439514, 364291059); + int b1 = (1526163563); + int4 r1 = int4(-1362883685, -333210990, -1906862114, -479838575); + TestUtils.AreEqual(r1, a1 * b1); + + int4 a2 = int4(1186560810, 1357601203, 638897141, 268562104); + int b2 = (1584938026); + int4 r2 = int4(989596900, 898280286, -1341201870, -1971041744); + TestUtils.AreEqual(r2, a2 * b2); + + int4 a3 = int4(1007838321, 1619806399, 1444659979, 1127580168); + int b3 = (1163240135); + int4 r3 = int4(610309591, 1971350137, 984126349, 1871258680); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void int4_operator_mul_scalar_wide() + { + int a0 = (1152242766); + int4 b0 = int4(1276636134, 2105929407, 499007702, 124002565); + int4 r0 = int4(-2129504236, 999811634, 1179056436, -801426554); + TestUtils.AreEqual(r0, a0 * b0); + + int a1 = (1956335172); + int4 b1 = int4(1288034953, 832676555, 337389733, 99268757); + int4 r1 = int4(303483492, -76408852, 1271140820, 1556966804); + TestUtils.AreEqual(r1, a1 * b1); + + int a2 = (2005055247); + int4 b2 = int4(2011389505, 1348110859, 399689191, 2007606374); + int4 r2 = int4(-1565197105, -1533938779, -249579127, 759270394); + TestUtils.AreEqual(r2, a2 * b2); + + int a3 = (2076691289); + int4 b3 = int4(1825721194, 769885235, 153314735, 1066325369); + int4 r3 = int4(609175002, -1567463749, 1593384663, 1878927889); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void int4_operator_div_wide_wide() + { + int4 a0 = int4(333171510, 858154903, 1181365836, 671357749); + int4 b0 = int4(698897823, 440199998, 655557473, 1658534285); + int4 r0 = int4(0, 1, 1, 0); + TestUtils.AreEqual(r0, a0 / b0); + + int4 a1 = int4(1090606752, 803759420, 788404166, 296807814); + int4 b1 = int4(2127220100, 315653188, 1814290360, 992173243); + int4 r1 = int4(0, 2, 0, 0); + TestUtils.AreEqual(r1, a1 / b1); + + int4 a2 = int4(575260195, 166625280, 1493729000, 1831739736); + int4 b2 = int4(914851653, 664340325, 224323977, 246981573); + int4 r2 = int4(0, 0, 6, 7); + TestUtils.AreEqual(r2, a2 / b2); + + int4 a3 = int4(200852358, 129983172, 500176108, 472051781); + int4 b3 = int4(285573983, 819471609, 2012476015, 1783179572); + int4 r3 = int4(0, 0, 0, 0); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void int4_operator_div_wide_scalar() + { + int4 a0 = int4(1433072926, 1073958635, 1195142312, 536596719); + int b0 = (1434025872); + int4 r0 = int4(0, 0, 0, 0); + TestUtils.AreEqual(r0, a0 / b0); + + int4 a1 = int4(1274375693, 806462546, 906504670, 1380905136); + int b1 = (464756346); + int4 r1 = int4(2, 1, 1, 2); + TestUtils.AreEqual(r1, a1 / b1); + + int4 a2 = int4(25493909, 123300377, 643754735, 2084019932); + int b2 = (1196815948); + int4 r2 = int4(0, 0, 0, 1); + TestUtils.AreEqual(r2, a2 / b2); + + int4 a3 = int4(2047825037, 741331531, 466443901, 2110004616); + int b3 = (458304263); + int4 r3 = int4(4, 1, 1, 4); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void int4_operator_div_scalar_wide() + { + int a0 = (519165704); + int4 b0 = int4(1295178177, 775214121, 467772046, 1156881598); + int4 r0 = int4(0, 0, 1, 0); + TestUtils.AreEqual(r0, a0 / b0); + + int a1 = (310396565); + int4 b1 = int4(759759959, 243837702, 1616314235, 1053470225); + int4 r1 = int4(0, 1, 0, 0); + TestUtils.AreEqual(r1, a1 / b1); + + int a2 = (1320630160); + int4 b2 = int4(378773841, 4223608, 1971105754, 2054406020); + int4 r2 = int4(3, 312, 0, 0); + TestUtils.AreEqual(r2, a2 / b2); + + int a3 = (219939614); + int4 b3 = int4(1603672651, 2006134295, 888535397, 1493077923); + int4 r3 = int4(0, 0, 0, 0); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void int4_operator_mod_wide_wide() + { + int4 a0 = int4(258342924, 1454754891, 723352342, 1981431473); + int4 b0 = int4(1990080167, 1197348066, 651970512, 1659454050); + int4 r0 = int4(258342924, 257406825, 71381830, 321977423); + TestUtils.AreEqual(r0, a0 % b0); + + int4 a1 = int4(531756042, 716993627, 1667903349, 1331097004); + int4 b1 = int4(241005212, 1866255454, 1440101415, 595220963); + int4 r1 = int4(49745618, 716993627, 227801934, 140655078); + TestUtils.AreEqual(r1, a1 % b1); + + int4 a2 = int4(1776856101, 17598216, 1474345080, 1681376293); + int4 b2 = int4(408818410, 198222574, 549504274, 239973807); + int4 r2 = int4(141582461, 17598216, 375336532, 1559644); + TestUtils.AreEqual(r2, a2 % b2); + + int4 a3 = int4(813624265, 1617478722, 498370451, 780075943); + int4 b3 = int4(321398087, 658171840, 1511495237, 1048325585); + int4 r3 = int4(170828091, 301135042, 498370451, 780075943); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void int4_operator_mod_wide_scalar() + { + int4 a0 = int4(560988938, 629524514, 767711194, 434281967); + int b0 = (1156862367); + int4 r0 = int4(560988938, 629524514, 767711194, 434281967); + TestUtils.AreEqual(r0, a0 % b0); + + int4 a1 = int4(1399805893, 1663690927, 598661916, 1776636144); + int b1 = (792916846); + int4 r1 = int4(606889047, 77857235, 598661916, 190802452); + TestUtils.AreEqual(r1, a1 % b1); + + int4 a2 = int4(1287035793, 475209785, 327476870, 1617696916); + int b2 = (1743722161); + int4 r2 = int4(1287035793, 475209785, 327476870, 1617696916); + TestUtils.AreEqual(r2, a2 % b2); + + int4 a3 = int4(379853074, 858399046, 712734431, 1506629323); + int b3 = (477430114); + int4 r3 = int4(379853074, 380968932, 235304317, 74338981); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void int4_operator_mod_scalar_wide() + { + int a0 = (933347930); + int4 b0 = int4(549923387, 243114953, 1884274390, 1428033594); + int4 r0 = int4(383424543, 204003071, 933347930, 933347930); + TestUtils.AreEqual(r0, a0 % b0); + + int a1 = (655531454); + int4 b1 = int4(1622674954, 1107563514, 1614111094, 914801920); + int4 r1 = int4(655531454, 655531454, 655531454, 655531454); + TestUtils.AreEqual(r1, a1 % b1); + + int a2 = (1432263179); + int4 b2 = int4(564431096, 1967013901, 1709750152, 1080102613); + int4 r2 = int4(303400987, 1432263179, 1432263179, 352160566); + TestUtils.AreEqual(r2, a2 % b2); + + int a3 = (13120773); + int4 b3 = int4(2042535998, 1505698002, 1640058084, 974167554); + int4 r3 = int4(13120773, 13120773, 13120773, 13120773); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void int4_operator_plus() + { + int4 a0 = int4(195392567, 222719748, 1002351013, 1570765263); + int4 r0 = int4(195392567, 222719748, 1002351013, 1570765263); + TestUtils.AreEqual(r0, +a0); + + int4 a1 = int4(109389333, 1689763402, 291471785, 264115671); + int4 r1 = int4(109389333, 1689763402, 291471785, 264115671); + TestUtils.AreEqual(r1, +a1); + + int4 a2 = int4(1084131995, 2131702223, 715660442, 1995564647); + int4 r2 = int4(1084131995, 2131702223, 715660442, 1995564647); + TestUtils.AreEqual(r2, +a2); + + int4 a3 = int4(69731564, 1957501908, 531426536, 2012985092); + int4 r3 = int4(69731564, 1957501908, 531426536, 2012985092); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void int4_operator_neg() + { + int4 a0 = int4(1385088677, 94114564, 1350664872, 1458616659); + int4 r0 = int4(-1385088677, -94114564, -1350664872, -1458616659); + TestUtils.AreEqual(r0, -a0); + + int4 a1 = int4(2067164853, 958484951, 270553961, 446497525); + int4 r1 = int4(-2067164853, -958484951, -270553961, -446497525); + TestUtils.AreEqual(r1, -a1); + + int4 a2 = int4(270503114, 1427605822, 2051940607, 1434247484); + int4 r2 = int4(-270503114, -1427605822, -2051940607, -1434247484); + TestUtils.AreEqual(r2, -a2); + + int4 a3 = int4(485368391, 1742096480, 990033169, 1368056141); + int4 r3 = int4(-485368391, -1742096480, -990033169, -1368056141); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void int4_operator_prefix_inc() + { + int4 a0 = int4(780471723, 954741756, 272723451, 2142862245); + int4 r0 = int4(780471724, 954741757, 272723452, 2142862246); + TestUtils.AreEqual(r0, ++a0); + + int4 a1 = int4(606294309, 250124151, 444189162, 1833356994); + int4 r1 = int4(606294310, 250124152, 444189163, 1833356995); + TestUtils.AreEqual(r1, ++a1); + + int4 a2 = int4(1915989169, 129540735, 1584496757, 1170613526); + int4 r2 = int4(1915989170, 129540736, 1584496758, 1170613527); + TestUtils.AreEqual(r2, ++a2); + + int4 a3 = int4(986715680, 1397451003, 483952900, 1494652811); + int4 r3 = int4(986715681, 1397451004, 483952901, 1494652812); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void int4_operator_postfix_inc() + { + int4 a0 = int4(241865086, 2145821641, 1596166022, 803592338); + int4 r0 = int4(241865086, 2145821641, 1596166022, 803592338); + TestUtils.AreEqual(r0, a0++); + + int4 a1 = int4(529551271, 903047443, 1213663244, 1425753247); + int4 r1 = int4(529551271, 903047443, 1213663244, 1425753247); + TestUtils.AreEqual(r1, a1++); + + int4 a2 = int4(1384002775, 1159795446, 1343289659, 1227160199); + int4 r2 = int4(1384002775, 1159795446, 1343289659, 1227160199); + TestUtils.AreEqual(r2, a2++); + + int4 a3 = int4(947635082, 451018043, 1634297552, 2009552507); + int4 r3 = int4(947635082, 451018043, 1634297552, 2009552507); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void int4_operator_prefix_dec() + { + int4 a0 = int4(1331961415, 1612382200, 1401591249, 2042075388); + int4 r0 = int4(1331961414, 1612382199, 1401591248, 2042075387); + TestUtils.AreEqual(r0, --a0); + + int4 a1 = int4(1757136546, 1467742422, 578341664, 1336115745); + int4 r1 = int4(1757136545, 1467742421, 578341663, 1336115744); + TestUtils.AreEqual(r1, --a1); + + int4 a2 = int4(2059077641, 1862369220, 312317355, 1027543764); + int4 r2 = int4(2059077640, 1862369219, 312317354, 1027543763); + TestUtils.AreEqual(r2, --a2); + + int4 a3 = int4(1595492535, 1426620468, 674685792, 1423852012); + int4 r3 = int4(1595492534, 1426620467, 674685791, 1423852011); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void int4_operator_postfix_dec() + { + int4 a0 = int4(1870005937, 1708534798, 704493460, 462940703); + int4 r0 = int4(1870005937, 1708534798, 704493460, 462940703); + TestUtils.AreEqual(r0, a0--); + + int4 a1 = int4(2060593573, 940247280, 1818778351, 1015253889); + int4 r1 = int4(2060593573, 940247280, 1818778351, 1015253889); + TestUtils.AreEqual(r1, a1--); + + int4 a2 = int4(862428933, 2080259851, 653673271, 140452688); + int4 r2 = int4(862428933, 2080259851, 653673271, 140452688); + TestUtils.AreEqual(r2, a2--); + + int4 a3 = int4(1928164223, 1174531383, 634036198, 993137684); + int4 r3 = int4(1928164223, 1174531383, 634036198, 993137684); + TestUtils.AreEqual(r3, a3--); + } + + [TestCompiler] + public static void int4_operator_bitwise_and_wide_wide() + { + int4 a0 = int4(1055241304, 859321394, 1088358961, 2090949513); + int4 b0 = int4(749698416, 748105424, 1842764797, 9990577); + int4 r0 = int4(749024336, 537928720, 1087769137, 8409473); + TestUtils.AreEqual(r0, a0 & b0); + + int4 a1 = int4(300561740, 651904515, 1331035868, 2012752753); + int4 b1 = int4(1989102105, 1666634755, 58116798, 868036607); + int4 r1 = int4(277479432, 575816707, 55888540, 867707761); + TestUtils.AreEqual(r1, a1 & b1); + + int4 a2 = int4(1298126656, 53199569, 1752363533, 1303061302); + int4 b2 = int4(1420638875, 1308767169, 564040763, 478617502); + int4 r2 = int4(1141707264, 33686209, 538087433, 209912598); + TestUtils.AreEqual(r2, a2 & b2); + + int4 a3 = int4(1929998247, 1504941434, 470682792, 713577376); + int4 b3 = int4(806150474, 674015378, 1505309955, 36064977); + int4 r3 = int4(805855490, 136347666, 403178496, 33571456); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void int4_operator_bitwise_and_wide_scalar() + { + int4 a0 = int4(1513158868, 284695609, 734595037, 1566510707); + int b0 = (1173647397); + int4 r0 = int4(1076916228, 15732769, 29360133, 1163132961); + TestUtils.AreEqual(r0, a0 & b0); + + int4 a1 = int4(1601252476, 314333543, 430856908, 753481263); + int b1 = (84213838); + int4 r1 = int4(83951692, 262214, 17039436, 67174414); + TestUtils.AreEqual(r1, a1 & b1); + + int4 a2 = int4(327392481, 2143619546, 1873208293, 126982769); + int b2 = (1619794917); + int4 r2 = int4(8394977, 1619265984, 1619264485, 8395361); + TestUtils.AreEqual(r2, a2 & b2); + + int4 a3 = int4(651482651, 1689107088, 1368301071, 366962092); + int b3 = (1383096952); + int4 r3 = int4(38814232, 1075847696, 1342177800, 273702952); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void int4_operator_bitwise_and_scalar_wide() + { + int a0 = (477163326); + int4 b0 = int4(110453385, 703240362, 2075630560, 1884904031); + int4 r0 = int4(68182536, 140544042, 405834528, 273697310); + TestUtils.AreEqual(r0, a0 & b0); + + int a1 = (1734899436); + int4 b1 = int4(947945203, 1664399051, 458879298, 158491426); + int4 r1 = int4(536901344, 1663055560, 55078976, 23093792); + TestUtils.AreEqual(r1, a1 & b1); + + int a2 = (79772356); + int4 b2 = int4(2054527944, 202228212, 359225061, 639811396); + int4 r2 = int4(4266688, 67174596, 71373508, 67123780); + TestUtils.AreEqual(r2, a2 & b2); + + int a3 = (1821945318); + int4 b3 = int4(1821303024, 2030124055, 1985961756, 579780373); + int4 r3 = int4(1820893408, 1744841734, 1679297796, 545828100); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void int4_operator_bitwise_or_wide_wide() + { + int4 a0 = int4(1920951869, 1750772852, 1420019191, 732977093); + int4 b0 = int4(214585254, 275414367, 858759675, 190211455); + int4 r0 = int4(2130669503, 2021326207, 2008016383, 737572863); + TestUtils.AreEqual(r0, a0 | b0); + + int4 a1 = int4(1169579447, 229437930, 1966721348, 2039812323); + int4 b1 = int4(1218691723, 2129565457, 1862809466, 495728846); + int4 r1 = int4(1303895999, 2146367483, 2134507390, 2107455727); + TestUtils.AreEqual(r1, a1 | b1); + + int4 a2 = int4(113550869, 1912038362, 1569990624, 1490718227); + int4 b2 = int4(868064152, 1756913766, 933656055, 247722084); + int4 r2 = int4(939376541, 2046780414, 2142664695, 1591475831); + TestUtils.AreEqual(r2, a2 | b2); + + int4 a3 = int4(1686257697, 2137727522, 1569900650, 856504729); + int4 b3 = int4(1884195075, 1804207631, 1913174711, 1815920856); + int4 r3 = int4(1959708963, 2146117167, 2140863231, 2134768089); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void int4_operator_bitwise_or_wide_scalar() + { + int4 a0 = int4(1295304853, 1307252624, 350194630, 1128063578); + int b0 = (1305527136); + int4 r0 = int4(1307888629, 1308350448, 1574947814, 1341973370); + TestUtils.AreEqual(r0, a0 | b0); + + int4 a1 = int4(1774824542, 1988423804, 999162350, 2110327307); + int b1 = (2085245467); + int4 r1 = int4(2110520927, 2127491711, 2144228351, 2110478875); + TestUtils.AreEqual(r1, a1 | b1); + + int4 a2 = int4(1050875188, 1317039676, 228656898, 41280811); + int b2 = (341855232); + int4 r2 = int4(1055087924, 1591766588, 501305090, 376827179); + TestUtils.AreEqual(r2, a2 | b2); + + int4 a3 = int4(1536908787, 1739461580, 2040936581, 1350320187); + int b3 = (606786773); + int4 r3 = int4(2143018487, 1739511773, 2108619989, 1954469119); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void int4_operator_bitwise_or_scalar_wide() + { + int a0 = (1768627592); + int4 b0 = int4(1849658052, 1759912154, 729979455, 975926310); + int4 r0 = int4(1870634956, 1777286618, 1810603967, 2070642094); + TestUtils.AreEqual(r0, a0 | b0); + + int a1 = (1987690876); + int4 b1 = int4(1809506714, 1160695341, 408963395, 314072711); + int4 r1 = int4(2147213822, 2004864893, 2121910655, 1996087295); + TestUtils.AreEqual(r1, a1 | b1); + + int a2 = (1560007537); + int4 b2 = int4(1709003416, 977086639, 1448375596, 1689568808); + int4 r2 = int4(2113917945, 2130705407, 1593833341, 2097141625); + TestUtils.AreEqual(r2, a2 | b2); + + int a3 = (595543345); + int4 b3 = int4(559778387, 621080913, 438994183, 1742637145); + int4 r3 = int4(595578739, 662697329, 998229303, 1744817529); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void int4_operator_bitwise_xor_wide_wide() + { + int4 a0 = int4(1843655608, 362425681, 640805534, 1342040268); + int4 b0 = int4(1422803441, 1234691140, 119589253, 1101464929); + int4 r0 = int4(959296073, 1544407317, 554771227, 240840109); + TestUtils.AreEqual(r0, a0 ^ b0); + + int4 a1 = int4(945678755, 980321850, 390165019, 1682422658); + int4 b1 = int4(121896337, 1880109018, 1000210266, 1718938232); + int4 r1 = int4(1058935858, 1249815008, 752651585, 36917754); + TestUtils.AreEqual(r1, a1 ^ b1); + + int4 a2 = int4(303897251, 230477768, 1103646442, 1503102919); + int4 b2 = int4(464406940, 884337881, 34199854, 1430659227); + int4 r2 = int4(162747199, 956900113, 1136760772, 215066460); + TestUtils.AreEqual(r2, a2 ^ b2); + + int4 a3 = int4(26631152, 1016475570, 1862440929, 379588576); + int4 b3 = int4(126415540, 1069919967, 1810763253, 2082802224); + int4 r3 = int4(102672708, 55804269, 82614804, 1787102672); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void int4_operator_bitwise_xor_wide_scalar() + { + int4 a0 = int4(169345668, 176087064, 2084362901, 1663924004); + int b0 = (354464228); + int4 r0 = int4(523809632, 526275068, 1763470193, 1980614336); + TestUtils.AreEqual(r0, a0 ^ b0); + + int4 a1 = int4(193851255, 905336222, 863800783, 365003873); + int b1 = (517476661); + int4 r1 = int4(357957186, 724452523, 765762810, 186226004); + TestUtils.AreEqual(r1, a1 ^ b1); + + int4 a2 = int4(835837496, 1464576786, 625604047, 1700827127); + int b2 = (954341348); + int4 r2 = int4(154388956, 1873394934, 497803819, 1568839699); + TestUtils.AreEqual(r2, a2 ^ b2); + + int4 a3 = int4(2003392824, 1077374714, 1043379893, 1991576049); + int b3 = (1481813598); + int4 r3 = int4(792459110, 409321636, 1717704939, 786933679); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void int4_operator_bitwise_xor_scalar_wide() + { + int a0 = (1361775641); + int4 b0 = int4(1452773578, 459050892, 1986218254, 1689037698); + int4 r0 = int4(129801427, 1249346453, 659047703, 898082715); + TestUtils.AreEqual(r0, a0 ^ b0); + + int a1 = (999278344); + int4 b1 = int4(1229114508, 1087843538, 733699740, 106187872); + int4 r1 = int4(1926040452, 2069425114, 271882644, 1037798248); + TestUtils.AreEqual(r1, a1 ^ b1); + + int a2 = (1533632738); + int4 b2 = int4(1107817672, 492506236, 597602329, 1439603382); + int4 r2 = int4(426677290, 1177709726, 2029506811, 245889620); + TestUtils.AreEqual(r2, a2 ^ b2); + + int a3 = (1001169118); + int4 b3 = int4(1231718216, 1693179077, 1050897427, 1796435561); + int4 r3 = int4(1925588886, 1598520347, 84921549, 1354747575); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void int4_operator_left_shift() + { + int4 a0 = int4(1129100049, 829482269, 1571297368, 443753193); + int b0 = (218351941); + int4 r0 = int4(1771463200, 773628832, -1258091776, 1315200288); + TestUtils.AreEqual(r0, a0 << b0); + + int4 a1 = int4(1872142968, 892627436, 980302862, 62369727); + int b1 = (249554593); + int4 r1 = int4(-550681360, 1785254872, 1960605724, 124739454); + TestUtils.AreEqual(r1, a1 << b1); + + int4 a2 = int4(849916599, 108441902, 1959056531, 1779118882); + int b2 = (1271350845); + int4 r2 = int4(-536870912, -1073741824, 1610612736, 1073741824); + TestUtils.AreEqual(r2, a2 << b2); + + int4 a3 = int4(1451674188, 1149883636, 1380536034, 186532735); + int b3 = (2082026915); + int4 r3 = int4(-1271508384, 609134496, -1840613616, 1492261880); + TestUtils.AreEqual(r3, a3 << b3); + } + + [TestCompiler] + public static void int4_operator_right_shift() + { + int4 a0 = int4(809126085, 908563670, 763568837, 1986717290); + int b0 = (994800051); + int4 r0 = int4(1543, 1732, 1456, 3789); + TestUtils.AreEqual(r0, a0 >> b0); + + int4 a1 = int4(1174507510, 1242726074, 390811632, 1521420393); + int b1 = (646821842); + int4 r1 = int4(4480, 4740, 1490, 5803); + TestUtils.AreEqual(r1, a1 >> b1); + + int4 a2 = int4(1923166649, 400863878, 667378673, 1611921244); + int b2 = (102096936); + int4 r2 = int4(7512369, 1565874, 2606947, 6296567); + TestUtils.AreEqual(r2, a2 >> b2); + + int4 a3 = int4(307750782, 2014389412, 1673938174, 1075916177); + int b3 = (479442287); + int4 r3 = int4(9391, 61474, 51084, 32834); + TestUtils.AreEqual(r3, a3 >> b3); + } + + [TestCompiler] + public static void int4_operator_bitwise_not() + { + int4 a0 = int4(111796841, 603562399, 745091931, 853183268); + int4 r0 = int4(-111796842, -603562400, -745091932, -853183269); + TestUtils.AreEqual(r0, ~a0); + + int4 a1 = int4(1110916612, 1891338755, 1506860135, 771210628); + int4 r1 = int4(-1110916613, -1891338756, -1506860136, -771210629); + TestUtils.AreEqual(r1, ~a1); + + int4 a2 = int4(787710759, 96456785, 916013379, 203444882); + int4 r2 = int4(-787710760, -96456786, -916013380, -203444883); + TestUtils.AreEqual(r2, ~a2); + + int4 a3 = int4(1172294211, 683852713, 375158799, 881353367); + int4 r3 = int4(-1172294212, -683852714, -375158800, -881353368); + TestUtils.AreEqual(r3, ~a3); + } + + [TestCompiler] + public static void int4_shuffle_result_1() + { + int4 a = int4(0, 1, 2, 3); + int4 b = int4(4, 5, 6, 7); + + TestUtils.AreEqual((0), shuffle(a, b, ShuffleComponent.LeftX)); + TestUtils.AreEqual((1), shuffle(a, b, ShuffleComponent.LeftY)); + TestUtils.AreEqual((2), shuffle(a, b, ShuffleComponent.LeftZ)); + TestUtils.AreEqual((3), shuffle(a, b, ShuffleComponent.LeftW)); + TestUtils.AreEqual((4), shuffle(a, b, ShuffleComponent.RightX)); + TestUtils.AreEqual((5), shuffle(a, b, ShuffleComponent.RightY)); + TestUtils.AreEqual((6), shuffle(a, b, ShuffleComponent.RightZ)); + TestUtils.AreEqual((7), shuffle(a, b, ShuffleComponent.RightW)); + } + + [TestCompiler] + public static void int4_shuffle_result_2() + { + int4 a = int4(0, 1, 2, 3); + int4 b = int4(4, 5, 6, 7); + + TestUtils.AreEqual(int2(5, 6), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightZ)); + TestUtils.AreEqual(int2(6, 4), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.RightX)); + TestUtils.AreEqual(int2(1, 4), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.RightX)); + TestUtils.AreEqual(int2(7, 3), shuffle(a, b, ShuffleComponent.RightW, ShuffleComponent.LeftW)); + TestUtils.AreEqual(int2(7, 2), shuffle(a, b, ShuffleComponent.RightW, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(int2(2, 3), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.LeftW)); + TestUtils.AreEqual(int2(5, 3), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftW)); + TestUtils.AreEqual(int2(7, 0), shuffle(a, b, ShuffleComponent.RightW, ShuffleComponent.LeftX)); + TestUtils.AreEqual(int2(6, 7), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.RightW)); + TestUtils.AreEqual(int2(5, 2), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(int2(6, 6), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.RightZ)); + TestUtils.AreEqual(int2(7, 0), shuffle(a, b, ShuffleComponent.RightW, ShuffleComponent.LeftX)); + TestUtils.AreEqual(int2(5, 4), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightX)); + TestUtils.AreEqual(int2(7, 5), shuffle(a, b, ShuffleComponent.RightW, ShuffleComponent.RightY)); + TestUtils.AreEqual(int2(4, 0), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftX)); + TestUtils.AreEqual(int2(1, 3), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.LeftW)); + } + + [TestCompiler] + public static void int4_shuffle_result_3() + { + int4 a = int4(0, 1, 2, 3); + int4 b = int4(4, 5, 6, 7); + + TestUtils.AreEqual(int3(2, 7, 5), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.RightW, ShuffleComponent.RightY)); + TestUtils.AreEqual(int3(6, 0, 3), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.LeftX, ShuffleComponent.LeftW)); + TestUtils.AreEqual(int3(2, 7, 4), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.RightW, ShuffleComponent.RightX)); + TestUtils.AreEqual(int3(5, 0, 2), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftX, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(int3(7, 6, 2), shuffle(a, b, ShuffleComponent.RightW, ShuffleComponent.RightZ, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(int3(3, 1, 1), shuffle(a, b, ShuffleComponent.LeftW, ShuffleComponent.LeftY, ShuffleComponent.LeftY)); + TestUtils.AreEqual(int3(3, 5, 4), shuffle(a, b, ShuffleComponent.LeftW, ShuffleComponent.RightY, ShuffleComponent.RightX)); + TestUtils.AreEqual(int3(3, 1, 7), shuffle(a, b, ShuffleComponent.LeftW, ShuffleComponent.LeftY, ShuffleComponent.RightW)); + TestUtils.AreEqual(int3(6, 5, 6), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.RightY, ShuffleComponent.RightZ)); + TestUtils.AreEqual(int3(5, 4, 1), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightX, ShuffleComponent.LeftY)); + TestUtils.AreEqual(int3(7, 7, 0), shuffle(a, b, ShuffleComponent.RightW, ShuffleComponent.RightW, ShuffleComponent.LeftX)); + TestUtils.AreEqual(int3(6, 1, 5), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.LeftY, ShuffleComponent.RightY)); + TestUtils.AreEqual(int3(6, 1, 7), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.LeftY, ShuffleComponent.RightW)); + TestUtils.AreEqual(int3(3, 5, 5), shuffle(a, b, ShuffleComponent.LeftW, ShuffleComponent.RightY, ShuffleComponent.RightY)); + TestUtils.AreEqual(int3(6, 0, 5), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.LeftX, ShuffleComponent.RightY)); + TestUtils.AreEqual(int3(5, 1, 7), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftY, ShuffleComponent.RightW)); + } + + [TestCompiler] + public static void int4_shuffle_result_4() + { + int4 a = int4(0, 1, 2, 3); + int4 b = int4(4, 5, 6, 7); + + TestUtils.AreEqual(int4(1, 3, 4, 2), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.LeftW, ShuffleComponent.RightX, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(int4(5, 3, 6, 6), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftW, ShuffleComponent.RightZ, ShuffleComponent.RightZ)); + TestUtils.AreEqual(int4(6, 6, 7, 2), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.RightZ, ShuffleComponent.RightW, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(int4(4, 5, 2, 2), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightY, ShuffleComponent.LeftZ, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(int4(6, 1, 1, 0), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.LeftY, ShuffleComponent.LeftY, ShuffleComponent.LeftX)); + TestUtils.AreEqual(int4(4, 5, 5, 7), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightY, ShuffleComponent.RightY, ShuffleComponent.RightW)); + TestUtils.AreEqual(int4(1, 7, 0, 7), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.RightW, ShuffleComponent.LeftX, ShuffleComponent.RightW)); + TestUtils.AreEqual(int4(5, 0, 1, 0), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftX, ShuffleComponent.LeftY, ShuffleComponent.LeftX)); + TestUtils.AreEqual(int4(4, 7, 3, 1), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightW, ShuffleComponent.LeftW, ShuffleComponent.LeftY)); + TestUtils.AreEqual(int4(5, 4, 1, 4), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightX, ShuffleComponent.LeftY, ShuffleComponent.RightX)); + TestUtils.AreEqual(int4(0, 2, 6, 0), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.LeftZ, ShuffleComponent.RightZ, ShuffleComponent.LeftX)); + TestUtils.AreEqual(int4(2, 5, 7, 7), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.RightY, ShuffleComponent.RightW, ShuffleComponent.RightW)); + TestUtils.AreEqual(int4(3, 4, 2, 4), shuffle(a, b, ShuffleComponent.LeftW, ShuffleComponent.RightX, ShuffleComponent.LeftZ, ShuffleComponent.RightX)); + TestUtils.AreEqual(int4(4, 0, 2, 3), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftX, ShuffleComponent.LeftZ, ShuffleComponent.LeftW)); + TestUtils.AreEqual(int4(6, 4, 0, 5), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.RightX, ShuffleComponent.LeftX, ShuffleComponent.RightY)); + TestUtils.AreEqual(int4(3, 7, 1, 5), shuffle(a, b, ShuffleComponent.LeftW, ShuffleComponent.RightW, ShuffleComponent.LeftY, ShuffleComponent.RightY)); + } + + [TestCase /* For player builds */] + public static void int4_EqualsObjectOverride() + { + TestUtils.IsFalse(new int4().Equals((object)new int())); + TestUtils.IsTrue(new int4().Equals((object)new int4())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestInt4.gen.cs.meta b/src/Tests/Tests/Shared/TestInt4.gen.cs.meta new file mode 100644 index 00000000..af04e8fc --- /dev/null +++ b/src/Tests/Tests/Shared/TestInt4.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 682471010e9050444948ecc9c69b3b0c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestInt4x2.gen.cs b/src/Tests/Tests/Shared/TestInt4x2.gen.cs new file mode 100644 index 00000000..8eaa8828 --- /dev/null +++ b/src/Tests/Tests/Shared/TestInt4x2.gen.cs @@ -0,0 +1,1236 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestInt4x2 + { + [TestCompiler] + public static void int4x2_zero() + { + TestUtils.AreEqual(0, int4x2.zero.c0.x); + TestUtils.AreEqual(0, int4x2.zero.c0.y); + TestUtils.AreEqual(0, int4x2.zero.c0.z); + TestUtils.AreEqual(0, int4x2.zero.c0.w); + TestUtils.AreEqual(0, int4x2.zero.c1.x); + TestUtils.AreEqual(0, int4x2.zero.c1.y); + TestUtils.AreEqual(0, int4x2.zero.c1.z); + TestUtils.AreEqual(0, int4x2.zero.c1.w); + } + + [TestCompiler] + public static void int4x2_operator_equal_wide_wide() + { + int4x2 a0 = int4x2(2105871082, 35218899, 1550755093, 764676020, 606743782, 1208156098, 1023640014, 1038468316); + int4x2 b0 = int4x2(1477587886, 579629692, 540974792, 208405066, 2063397938, 1060167409, 362592601, 2097545362); + bool4x2 r0 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + int4x2 a1 = int4x2(1416064367, 727143393, 2061243891, 184669837, 1303661760, 2044073738, 370395888, 1822916805); + int4x2 b1 = int4x2(277670088, 426944490, 901076223, 857900673, 1548779757, 325265488, 312658571, 176373760); + bool4x2 r1 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + int4x2 a2 = int4x2(1076983135, 345215866, 833676277, 1987782708, 1481088614, 1364754268, 93639636, 1850596922); + int4x2 b2 = int4x2(2052378097, 858156597, 982817797, 1252095508, 882634538, 1959142806, 72495800, 1077678183); + bool4x2 r2 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + int4x2 a3 = int4x2(2073471507, 1745989448, 28118669, 1267554232, 1292918049, 1423451579, 644384701, 1985492825); + int4x2 b3 = int4x2(1729269763, 1607675346, 1813461519, 1204794859, 1324801873, 1975336, 439410532, 294085211); + bool4x2 r3 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void int4x2_operator_equal_wide_scalar() + { + int4x2 a0 = int4x2(437822262, 2020661134, 541786900, 853113810, 23716499, 179951405, 1409026299, 948838849); + int b0 = (1332833578); + bool4x2 r0 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + int4x2 a1 = int4x2(953202998, 1926262965, 1851546137, 712957637, 2028784869, 1049962241, 1836975611, 1016802970); + int b1 = (691955848); + bool4x2 r1 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + int4x2 a2 = int4x2(390120467, 1451642042, 289137869, 152339338, 808355440, 660053867, 597354173, 67320270); + int b2 = (464814777); + bool4x2 r2 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + int4x2 a3 = int4x2(151461188, 602895443, 186996278, 129611815, 1031574999, 1697392883, 1463742000, 857785521); + int b3 = (35153827); + bool4x2 r3 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void int4x2_operator_equal_scalar_wide() + { + int a0 = (542329200); + int4x2 b0 = int4x2(1115584594, 684107773, 1928988941, 890709324, 641152437, 1410341302, 497505660, 1068223109); + bool4x2 r0 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + int a1 = (2014009435); + int4x2 b1 = int4x2(213835595, 1592428361, 1819361470, 448650623, 1942175642, 64377057, 1485938610, 1146305380); + bool4x2 r1 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + int a2 = (1312317120); + int4x2 b2 = int4x2(263290348, 812663708, 1585209188, 40646617, 1378718922, 1957797737, 873652576, 1780082094); + bool4x2 r2 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + int a3 = (1513270921); + int4x2 b3 = int4x2(2095980581, 1413074719, 1387984261, 1547119354, 924385171, 1253636050, 1477542688, 969120167); + bool4x2 r3 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void int4x2_operator_not_equal_wide_wide() + { + int4x2 a0 = int4x2(1977284100, 1293292704, 1547283851, 422428953, 195833190, 1711544892, 5606053, 737069074); + int4x2 b0 = int4x2(1514195556, 957972049, 507667364, 581861672, 1128094576, 940096636, 57559040, 181752616); + bool4x2 r0 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + int4x2 a1 = int4x2(647386678, 13079405, 1413841590, 1076166545, 1211445174, 1289303469, 1436402489, 1129570126); + int4x2 b1 = int4x2(962017320, 1762015406, 1107218953, 2042026522, 836002288, 570272309, 2112081980, 1500634658); + bool4x2 r1 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + int4x2 a2 = int4x2(1566836685, 1343313905, 329259205, 1774944480, 33906739, 2055853627, 2035015372, 1702756001); + int4x2 b2 = int4x2(1787808345, 566425667, 2037529609, 1520589840, 266793699, 538816359, 2075474643, 553571317); + bool4x2 r2 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + int4x2 a3 = int4x2(1164186087, 329853698, 769052491, 1893312730, 438029011, 1894010522, 1365847542, 1292942830); + int4x2 b3 = int4x2(218264354, 654754196, 1392180230, 870065147, 1398749829, 711281563, 1999640291, 231234857); + bool4x2 r3 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void int4x2_operator_not_equal_wide_scalar() + { + int4x2 a0 = int4x2(1038269360, 1427812625, 103361237, 1347017023, 1523584313, 150442802, 660334527, 719113717); + int b0 = (768873026); + bool4x2 r0 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + int4x2 a1 = int4x2(262959423, 506946952, 226568494, 507918242, 1702162286, 923269270, 166187260, 114581840); + int b1 = (484398043); + bool4x2 r1 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + int4x2 a2 = int4x2(1045389187, 1461803977, 61801615, 1317840133, 2146927809, 1557151164, 1284033253, 1345705546); + int b2 = (1648095254); + bool4x2 r2 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + int4x2 a3 = int4x2(1747302566, 1368046109, 1848036266, 2025452920, 373992983, 289537519, 1388743060, 146455100); + int b3 = (611028295); + bool4x2 r3 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void int4x2_operator_not_equal_scalar_wide() + { + int a0 = (1652127596); + int4x2 b0 = int4x2(953791238, 271722683, 1278885987, 735128017, 112416504, 25967222, 1761444475, 1844594536); + bool4x2 r0 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + int a1 = (1199122922); + int4x2 b1 = int4x2(634219279, 942501101, 67161343, 969944293, 833229499, 1304301133, 704045745, 345012334); + bool4x2 r1 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + int a2 = (1253134152); + int4x2 b2 = int4x2(325772538, 855127202, 793668881, 1584481616, 1101301152, 276853534, 987168816, 1258105989); + bool4x2 r2 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + int a3 = (362645228); + int4x2 b3 = int4x2(293978043, 1772395973, 1692007315, 681268929, 1535518457, 595209334, 25745185, 1278016813); + bool4x2 r3 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void int4x2_operator_less_wide_wide() + { + int4x2 a0 = int4x2(1486550609, 1779244308, 1602148045, 1614085440, 1975613414, 942838342, 1092279031, 373677431); + int4x2 b0 = int4x2(97842578, 536551311, 413528975, 1838293684, 1283898480, 1456599961, 1080278602, 529676676); + bool4x2 r0 = bool4x2(false, false, false, true, false, true, false, true); + TestUtils.AreEqual(r0, a0 < b0); + + int4x2 a1 = int4x2(1419098312, 337757077, 1081797900, 1336745069, 840685445, 1220554047, 2013681746, 192965012); + int4x2 b1 = int4x2(156584048, 117348799, 246927124, 1916615924, 1731071394, 1328098431, 1014995792, 480319327); + bool4x2 r1 = bool4x2(false, false, false, true, true, true, false, true); + TestUtils.AreEqual(r1, a1 < b1); + + int4x2 a2 = int4x2(532043965, 1000693402, 927236048, 1215860000, 780607596, 1882056852, 1354146545, 2135295778); + int4x2 b2 = int4x2(1765937053, 1333997067, 688515308, 1856106947, 1303906227, 646821776, 1169473993, 316770064); + bool4x2 r2 = bool4x2(true, true, false, true, true, false, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + int4x2 a3 = int4x2(1145973790, 1938006975, 895882838, 2006524299, 908581156, 1843349513, 1340458575, 1972095585); + int4x2 b3 = int4x2(1518155802, 416732703, 529193056, 1239623485, 2010112031, 2018560298, 285987009, 960617622); + bool4x2 r3 = bool4x2(true, false, false, false, true, true, false, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void int4x2_operator_less_wide_scalar() + { + int4x2 a0 = int4x2(796797557, 670113454, 933579492, 278884514, 318174822, 1117630673, 741886928, 1990922600); + int b0 = (746564682); + bool4x2 r0 = bool4x2(false, true, false, true, true, false, true, false); + TestUtils.AreEqual(r0, a0 < b0); + + int4x2 a1 = int4x2(1030849597, 1718582899, 1648393417, 1857132231, 1909506562, 1294006045, 952084157, 1303736668); + int b1 = (1546212312); + bool4x2 r1 = bool4x2(true, false, false, false, false, true, true, true); + TestUtils.AreEqual(r1, a1 < b1); + + int4x2 a2 = int4x2(845460171, 1368236640, 24980695, 1434668705, 659552739, 1058492383, 165694933, 1204097259); + int b2 = (979430272); + bool4x2 r2 = bool4x2(true, false, true, false, true, false, true, false); + TestUtils.AreEqual(r2, a2 < b2); + + int4x2 a3 = int4x2(922212691, 24629507, 1386458568, 1325149699, 1498707004, 1650355158, 1213017950, 1650457461); + int b3 = (281328069); + bool4x2 r3 = bool4x2(false, true, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void int4x2_operator_less_scalar_wide() + { + int a0 = (186400299); + int4x2 b0 = int4x2(1881344229, 813834467, 1254886626, 1353590345, 1412343685, 1555571443, 1540508298, 1735458634); + bool4x2 r0 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 < b0); + + int a1 = (135888070); + int4x2 b1 = int4x2(1643818742, 248291654, 1739560105, 728539891, 480507742, 1696553040, 540223931, 1840493353); + bool4x2 r1 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 < b1); + + int a2 = (146833656); + int4x2 b2 = int4x2(798115946, 2002002066, 1011261705, 783550942, 1093071215, 598253401, 1432416562, 1863582169); + bool4x2 r2 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 < b2); + + int a3 = (103622950); + int4x2 b3 = int4x2(775175960, 116908309, 1213433625, 1428954824, 1760442490, 1208143947, 751820805, 1491872302); + bool4x2 r3 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void int4x2_operator_greater_wide_wide() + { + int4x2 a0 = int4x2(2087717754, 1725569452, 1298066182, 1693943616, 1319019629, 70674491, 1042499725, 1002821508); + int4x2 b0 = int4x2(85148514, 293632137, 1151128249, 409440398, 1115020183, 1508500597, 1834583302, 1755218534); + bool4x2 r0 = bool4x2(true, true, true, true, true, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + int4x2 a1 = int4x2(1021857133, 1744374599, 821751047, 467646903, 2029731638, 1377214212, 1207816926, 474621063); + int4x2 b1 = int4x2(1788761753, 1128238489, 834223713, 1578743290, 1647150256, 1756397855, 1131080201, 1208965204); + bool4x2 r1 = bool4x2(false, true, false, false, true, false, true, false); + TestUtils.AreEqual(r1, a1 > b1); + + int4x2 a2 = int4x2(20781266, 366593779, 2068457387, 10181449, 793634464, 144474612, 99947390, 930377263); + int4x2 b2 = int4x2(1495161099, 1283714281, 908051907, 412849651, 815822687, 730271942, 40756039, 883326140); + bool4x2 r2 = bool4x2(false, false, true, false, false, false, true, true); + TestUtils.AreEqual(r2, a2 > b2); + + int4x2 a3 = int4x2(683686232, 742803073, 918292048, 875621429, 1764985258, 411384146, 1921397684, 1349107119); + int4x2 b3 = int4x2(476260632, 1024136446, 1440596667, 1253494041, 146826162, 1798399573, 2085029408, 187939428); + bool4x2 r3 = bool4x2(true, false, false, false, true, false, false, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void int4x2_operator_greater_wide_scalar() + { + int4x2 a0 = int4x2(1208626274, 239697208, 1979453345, 1253474001, 1590192876, 1487911635, 1673945595, 1662650098); + int b0 = (1715176566); + bool4x2 r0 = bool4x2(false, false, true, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + int4x2 a1 = int4x2(222749855, 566635217, 1773305960, 1850273578, 206147145, 325913453, 333381537, 1905567362); + int b1 = (1433540517); + bool4x2 r1 = bool4x2(false, false, true, true, false, false, false, true); + TestUtils.AreEqual(r1, a1 > b1); + + int4x2 a2 = int4x2(2053577491, 2128431130, 1735325311, 529971908, 1663525234, 1972984241, 1587865063, 488268523); + int b2 = (570397194); + bool4x2 r2 = bool4x2(true, true, true, false, true, true, true, false); + TestUtils.AreEqual(r2, a2 > b2); + + int4x2 a3 = int4x2(121921923, 181082921, 1281638484, 1818357732, 116518997, 1397728785, 1924199337, 742950077); + int b3 = (812076921); + bool4x2 r3 = bool4x2(false, false, true, true, false, true, true, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void int4x2_operator_greater_scalar_wide() + { + int a0 = (480938827); + int4x2 b0 = int4x2(1824731899, 921496110, 586859044, 946430596, 1231356727, 1390167458, 1785807092, 28949024); + bool4x2 r0 = bool4x2(false, false, false, false, false, false, false, true); + TestUtils.AreEqual(r0, a0 > b0); + + int a1 = (2037899283); + int4x2 b1 = int4x2(595656760, 1778095771, 1233500439, 1696302238, 1445965340, 484020151, 1586962841, 1361740714); + bool4x2 r1 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + int a2 = (265628948); + int4x2 b2 = int4x2(2003122957, 332267433, 1128353075, 377919478, 982113135, 1117675960, 630865591, 1550679736); + bool4x2 r2 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + int a3 = (895945757); + int4x2 b3 = int4x2(287025687, 643452096, 660504007, 613135893, 633307118, 514276792, 1377364317, 84491736); + bool4x2 r3 = bool4x2(true, true, true, true, true, true, false, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void int4x2_operator_less_equal_wide_wide() + { + int4x2 a0 = int4x2(154092149, 1515170149, 1083970332, 785807178, 1401094881, 310537627, 868328962, 1990816725); + int4x2 b0 = int4x2(77984380, 1712054191, 1566203809, 254834519, 450519938, 389457083, 1298669505, 207343167); + bool4x2 r0 = bool4x2(false, true, true, false, false, true, true, false); + TestUtils.AreEqual(r0, a0 <= b0); + + int4x2 a1 = int4x2(2035349541, 457043352, 1123282035, 1001842946, 1387761992, 195272789, 659549000, 888761458); + int4x2 b1 = int4x2(1214449047, 2059561026, 896534357, 1897470050, 521075677, 1848221945, 374708019, 1573731118); + bool4x2 r1 = bool4x2(false, true, false, true, false, true, false, true); + TestUtils.AreEqual(r1, a1 <= b1); + + int4x2 a2 = int4x2(283706617, 1790185840, 899029812, 848317418, 1743712447, 1504407474, 1798441490, 1902791952); + int4x2 b2 = int4x2(2093466449, 1660210829, 1568778785, 1352157589, 1212771905, 1457525058, 1493446008, 1784768208); + bool4x2 r2 = bool4x2(true, false, true, true, false, false, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + int4x2 a3 = int4x2(606340844, 1994437705, 301831413, 654230470, 1223625081, 324292199, 1370931020, 1742769166); + int4x2 b3 = int4x2(1993422493, 1378671664, 1447376929, 1405041439, 1765183746, 562894655, 1085068880, 1026386862); + bool4x2 r3 = bool4x2(true, false, true, true, true, true, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void int4x2_operator_less_equal_wide_scalar() + { + int4x2 a0 = int4x2(1479531977, 1427983411, 415250630, 1245345407, 1112546666, 1072990632, 1579912858, 101048307); + int b0 = (2004563877); + bool4x2 r0 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + int4x2 a1 = int4x2(1070894375, 1910488590, 85452501, 518127023, 1246249980, 1097326500, 1964410699, 1968139888); + int b1 = (509818792); + bool4x2 r1 = bool4x2(false, false, true, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 <= b1); + + int4x2 a2 = int4x2(1191853379, 1140643434, 754434551, 155343473, 995927387, 974873240, 1773400038, 497436329); + int b2 = (662096238); + bool4x2 r2 = bool4x2(false, false, false, true, false, false, false, true); + TestUtils.AreEqual(r2, a2 <= b2); + + int4x2 a3 = int4x2(1825940497, 1477043363, 1378470734, 96190147, 37188105, 839762283, 781102710, 766321672); + int b3 = (527516420); + bool4x2 r3 = bool4x2(false, false, false, true, true, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void int4x2_operator_less_equal_scalar_wide() + { + int a0 = (1899193992); + int4x2 b0 = int4x2(915011820, 980913757, 1337699683, 1476321359, 1102143668, 660493983, 184664508, 381579707); + bool4x2 r0 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 <= b0); + + int a1 = (1954892821); + int4x2 b1 = int4x2(1295090571, 1440368586, 1696003686, 88708652, 1332251857, 1310713644, 2112132784, 48951945); + bool4x2 r1 = bool4x2(false, false, false, false, false, false, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + int a2 = (1888568027); + int4x2 b2 = int4x2(39340955, 1108242207, 260777425, 593122164, 291471959, 253457314, 1264570386, 699618012); + bool4x2 r2 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + int a3 = (927735863); + int4x2 b3 = int4x2(2063158939, 932253787, 1168754049, 749328788, 1882694892, 168499987, 378173027, 339963627); + bool4x2 r3 = bool4x2(true, true, true, false, true, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void int4x2_operator_greater_equal_wide_wide() + { + int4x2 a0 = int4x2(8538378, 2131749726, 265427108, 523609761, 994991818, 839709564, 101288202, 1886280970); + int4x2 b0 = int4x2(903145828, 1697992986, 1432491982, 169789504, 1059357300, 1744255222, 1606584463, 1905414425); + bool4x2 r0 = bool4x2(false, true, false, true, false, false, false, false); + TestUtils.AreEqual(r0, a0 >= b0); + + int4x2 a1 = int4x2(2032074826, 631221455, 1456286159, 961342752, 424526026, 788481984, 1662488497, 870326690); + int4x2 b1 = int4x2(1448794969, 136181998, 1678754836, 2069656857, 398982689, 243317404, 740939613, 1894753119); + bool4x2 r1 = bool4x2(true, true, false, false, true, true, true, false); + TestUtils.AreEqual(r1, a1 >= b1); + + int4x2 a2 = int4x2(708712581, 1260182701, 1165630721, 138247561, 1108650168, 1933222913, 672493999, 1541402159); + int4x2 b2 = int4x2(301760792, 1260647988, 3608523, 52576030, 903420465, 1648820371, 627296845, 1679808907); + bool4x2 r2 = bool4x2(true, false, true, true, true, true, true, false); + TestUtils.AreEqual(r2, a2 >= b2); + + int4x2 a3 = int4x2(1921596027, 1557351956, 147242547, 892772168, 2089286723, 1273466960, 644009998, 654784654); + int4x2 b3 = int4x2(1719102039, 1718081638, 655586949, 477267189, 62092869, 2013928066, 280292357, 254052205); + bool4x2 r3 = bool4x2(true, false, false, true, true, false, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void int4x2_operator_greater_equal_wide_scalar() + { + int4x2 a0 = int4x2(2049236663, 182691143, 634973382, 1197012109, 439837565, 1367606469, 1108037359, 351147187); + int b0 = (1061998015); + bool4x2 r0 = bool4x2(true, false, false, true, false, true, true, false); + TestUtils.AreEqual(r0, a0 >= b0); + + int4x2 a1 = int4x2(1898505669, 1998610091, 4652390, 996159180, 2111455181, 727766399, 96217144, 814085575); + int b1 = (411667685); + bool4x2 r1 = bool4x2(true, true, false, true, true, true, false, true); + TestUtils.AreEqual(r1, a1 >= b1); + + int4x2 a2 = int4x2(1525995206, 1732973229, 1473283041, 899444524, 1023753195, 1373738074, 518164359, 717850464); + int b2 = (1293933760); + bool4x2 r2 = bool4x2(true, true, true, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + int4x2 a3 = int4x2(1765188600, 527594558, 1816542874, 839185150, 1143596061, 1819554651, 160724539, 993212636); + int b3 = (1826820341); + bool4x2 r3 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void int4x2_operator_greater_equal_scalar_wide() + { + int a0 = (1859811087); + int4x2 b0 = int4x2(1070365918, 1783869452, 830091760, 377157428, 327199016, 90384229, 1154649706, 376758501); + bool4x2 r0 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + int a1 = (1079802834); + int4x2 b1 = int4x2(2054742898, 1328349472, 434061447, 951207723, 598695892, 975131651, 1714007943, 177416473); + bool4x2 r1 = bool4x2(false, false, true, true, true, true, false, true); + TestUtils.AreEqual(r1, a1 >= b1); + + int a2 = (1267232721); + int4x2 b2 = int4x2(31082860, 216791741, 119054289, 1905107583, 89559116, 55041824, 691334141, 462326883); + bool4x2 r2 = bool4x2(true, true, true, false, true, true, true, true); + TestUtils.AreEqual(r2, a2 >= b2); + + int a3 = (1658303669); + int4x2 b3 = int4x2(914628512, 1134364322, 1677134711, 1955614770, 2067009301, 1454405405, 299467282, 1584922149); + bool4x2 r3 = bool4x2(true, true, false, false, false, true, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void int4x2_operator_add_wide_wide() + { + int4x2 a0 = int4x2(2135171378, 21433296, 1954723494, 683604307, 1054212315, 1762680995, 1963655852, 1257853062); + int4x2 b0 = int4x2(1013431952, 366718162, 359290756, 1393163294, 1962236872, 1263270041, 1862666629, 1077447887); + int4x2 r0 = int4x2(-1146363966, 388151458, -1980953046, 2076767601, -1278518109, -1269016260, -468644815, -1959666347); + TestUtils.AreEqual(r0, a0 + b0); + + int4x2 a1 = int4x2(2043493600, 976898058, 1915056423, 121374462, 1218855698, 700538222, 1702057277, 1788251699); + int4x2 b1 = int4x2(821693806, 487316539, 350922520, 1583012528, 1951595076, 1024851344, 874302782, 1383969588); + int4x2 r1 = int4x2(-1429779890, 1464214597, -2028988353, 1704386990, -1124516522, 1725389566, -1718607237, -1122746009); + TestUtils.AreEqual(r1, a1 + b1); + + int4x2 a2 = int4x2(1534939160, 398651016, 1674272498, 374510467, 824322986, 1217622199, 1122376670, 642613771); + int4x2 b2 = int4x2(1767968088, 900721406, 1659790033, 1792273749, 443844328, 633981449, 2010244807, 335566991); + int4x2 r2 = int4x2(-992060048, 1299372422, -960904765, -2128183080, 1268167314, 1851603648, -1162345819, 978180762); + TestUtils.AreEqual(r2, a2 + b2); + + int4x2 a3 = int4x2(1097903998, 359042741, 929182687, 1713065399, 892057490, 1295346111, 1806236181, 1838589664); + int4x2 b3 = int4x2(521931102, 544297835, 1681549647, 1784248858, 585904415, 3128418, 1806236610, 179909533); + int4x2 r3 = int4x2(1619835100, 903340576, -1684234962, -797653039, 1477961905, 1298474529, -682494505, 2018499197); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void int4x2_operator_add_wide_scalar() + { + int4x2 a0 = int4x2(665815972, 1783729250, 1591678394, 1284528538, 977850224, 71069732, 1138577680, 1200356017); + int b0 = (1334043849); + int4x2 r0 = int4x2(1999859821, -1177194197, -1369245053, -1676394909, -1983073223, 1405113581, -1822345767, -1760567430); + TestUtils.AreEqual(r0, a0 + b0); + + int4x2 a1 = int4x2(565982008, 1088001167, 57252642, 678921480, 625943813, 512157429, 1470648741, 1490096953); + int b1 = (1246759684); + int4x2 r1 = int4x2(1812741692, -1960206445, 1304012326, 1925681164, 1872703497, 1758917113, -1577558871, -1558110659); + TestUtils.AreEqual(r1, a1 + b1); + + int4x2 a2 = int4x2(1467033531, 1707296407, 1703724354, 1333833947, 653973063, 1139546735, 1834005844, 184572739); + int b2 = (182608093); + int4x2 r2 = int4x2(1649641624, 1889904500, 1886332447, 1516442040, 836581156, 1322154828, 2016613937, 367180832); + TestUtils.AreEqual(r2, a2 + b2); + + int4x2 a3 = int4x2(1980578280, 97099208, 421437295, 1251829854, 166844260, 1568146789, 82548613, 533562157); + int b3 = (1858520040); + int4x2 r3 = int4x2(-455868976, 1955619248, -2015009961, -1184617402, 2025364300, -868300467, 1941068653, -1902885099); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void int4x2_operator_add_scalar_wide() + { + int a0 = (359966320); + int4x2 b0 = int4x2(2146146202, 767103309, 851002415, 311531406, 1491262941, 1016891373, 1954228994, 1671335850); + int4x2 r0 = int4x2(-1788854774, 1127069629, 1210968735, 671497726, 1851229261, 1376857693, -1980771982, 2031302170); + TestUtils.AreEqual(r0, a0 + b0); + + int a1 = (727870747); + int4x2 b1 = int4x2(551151834, 1390261152, 1699060326, 115021619, 1964440175, 440700758, 1556692550, 185414255); + int4x2 r1 = int4x2(1279022581, 2118131899, -1868036223, 842892366, -1602656374, 1168571505, -2010403999, 913285002); + TestUtils.AreEqual(r1, a1 + b1); + + int a2 = (933106731); + int4x2 b2 = int4x2(1217866784, 729761881, 1742597318, 1090109152, 1467373815, 1066072609, 138237856, 634834665); + int4x2 r2 = int4x2(-2143993781, 1662868612, -1619263247, 2023215883, -1894486750, 1999179340, 1071344587, 1567941396); + TestUtils.AreEqual(r2, a2 + b2); + + int a3 = (993603553); + int4x2 b3 = int4x2(347587889, 2050191349, 670698672, 1658205080, 1874808705, 2082982954, 869839589, 118460267); + int4x2 r3 = int4x2(1341191442, -1251172394, 1664302225, -1643158663, -1426555038, -1218380789, 1863443142, 1112063820); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void int4x2_operator_sub_wide_wide() + { + int4x2 a0 = int4x2(1410318491, 1097280168, 1827039044, 28881338, 328720965, 875487868, 212936325, 231977215); + int4x2 b0 = int4x2(1315897366, 799052018, 1580289673, 1094686261, 1954325726, 1197734816, 229886366, 915679176); + int4x2 r0 = int4x2(94421125, 298228150, 246749371, -1065804923, -1625604761, -322246948, -16950041, -683701961); + TestUtils.AreEqual(r0, a0 - b0); + + int4x2 a1 = int4x2(1740021315, 2011295463, 48079003, 591379285, 1125909359, 1842588095, 848561896, 614448464); + int4x2 b1 = int4x2(1746884850, 918743925, 1007797419, 257421324, 287249342, 1617287463, 1653916102, 123586847); + int4x2 r1 = int4x2(-6863535, 1092551538, -959718416, 333957961, 838660017, 225300632, -805354206, 490861617); + TestUtils.AreEqual(r1, a1 - b1); + + int4x2 a2 = int4x2(2067598029, 1618238416, 318516219, 1090119767, 1991095823, 949592162, 1951912339, 1457818751); + int4x2 b2 = int4x2(502107404, 672875302, 1256481116, 1975569142, 1794443030, 1327558915, 330955394, 1596041731); + int4x2 r2 = int4x2(1565490625, 945363114, -937964897, -885449375, 196652793, -377966753, 1620956945, -138222980); + TestUtils.AreEqual(r2, a2 - b2); + + int4x2 a3 = int4x2(1642553126, 2114366549, 1420516260, 596841760, 724518081, 1820626306, 1885185225, 246124365); + int4x2 b3 = int4x2(1069074732, 1120817099, 2076417364, 402521072, 839858844, 1539789702, 559077522, 822288510); + int4x2 r3 = int4x2(573478394, 993549450, -655901104, 194320688, -115340763, 280836604, 1326107703, -576164145); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void int4x2_operator_sub_wide_scalar() + { + int4x2 a0 = int4x2(1508669340, 1594795463, 266707545, 643102647, 287705008, 1475644328, 1113286221, 979450511); + int b0 = (998008471); + int4x2 r0 = int4x2(510660869, 596786992, -731300926, -354905824, -710303463, 477635857, 115277750, -18557960); + TestUtils.AreEqual(r0, a0 - b0); + + int4x2 a1 = int4x2(2082174113, 304369206, 999244508, 1806482044, 1994553647, 2101812429, 1482736902, 266654115); + int b1 = (1108005498); + int4x2 r1 = int4x2(974168615, -803636292, -108760990, 698476546, 886548149, 993806931, 374731404, -841351383); + TestUtils.AreEqual(r1, a1 - b1); + + int4x2 a2 = int4x2(1470212363, 958542155, 1185075537, 1738124835, 499527536, 1612473406, 1696960099, 1287292743); + int b2 = (1190349300); + int4x2 r2 = int4x2(279863063, -231807145, -5273763, 547775535, -690821764, 422124106, 506610799, 96943443); + TestUtils.AreEqual(r2, a2 - b2); + + int4x2 a3 = int4x2(1360229454, 1779621585, 964948785, 1739264125, 94254551, 968533883, 2075770560, 946189008); + int b3 = (1032360376); + int4x2 r3 = int4x2(327869078, 747261209, -67411591, 706903749, -938105825, -63826493, 1043410184, -86171368); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void int4x2_operator_sub_scalar_wide() + { + int a0 = (893369501); + int4x2 b0 = int4x2(2051906184, 1699714311, 442603706, 1735141684, 274533585, 811580259, 1196354320, 1524097023); + int4x2 r0 = int4x2(-1158536683, -806344810, 450765795, -841772183, 618835916, 81789242, -302984819, -630727522); + TestUtils.AreEqual(r0, a0 - b0); + + int a1 = (533621527); + int4x2 b1 = int4x2(2080845793, 143958837, 1620668660, 1135989346, 1367044745, 554088609, 552670373, 1265516124); + int4x2 r1 = int4x2(-1547224266, 389662690, -1087047133, -602367819, -833423218, -20467082, -19048846, -731894597); + TestUtils.AreEqual(r1, a1 - b1); + + int a2 = (1254902543); + int4x2 b2 = int4x2(1857695581, 1619865274, 1313559400, 99812999, 843597298, 420111239, 1299949060, 531009038); + int4x2 r2 = int4x2(-602793038, -364962731, -58656857, 1155089544, 411305245, 834791304, -45046517, 723893505); + TestUtils.AreEqual(r2, a2 - b2); + + int a3 = (1103306550); + int4x2 b3 = int4x2(104920105, 1137308312, 1207332725, 103438360, 1157123503, 1174401240, 701247193, 1498366995); + int4x2 r3 = int4x2(998386445, -34001762, -104026175, 999868190, -53816953, -71094690, 402059357, -395060445); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void int4x2_operator_mul_wide_wide() + { + int4x2 a0 = int4x2(61417577, 219585476, 1362520891, 1511084277, 1481211272, 58211871, 1459591173, 567624644); + int4x2 b0 = int4x2(578042444, 1620527213, 200516468, 309339115, 542853019, 299467282, 1479641221, 1428338601); + int4x2 r0 = int4x2(-1426863828, 1326150260, -990894148, -1322856473, 1973926232, 88546350, -863919463, -582821788); + TestUtils.AreEqual(r0, a0 * b0); + + int4x2 a1 = int4x2(1169935583, 1835691886, 385626539, 85934842, 522856538, 278370196, 289217012, 2083410174); + int4x2 b1 = int4x2(1497302909, 1596889147, 427413842, 265122693, 689376654, 1120457204, 516903000, 873091659); + int4x2 r1 = int4x2(556671459, 1098186330, 1848083398, -58320414, 2005201900, 651971856, -1721160736, -110160278); + TestUtils.AreEqual(r1, a1 * b1); + + int4x2 a2 = int4x2(1293162798, 1939730122, 2075923048, 1116477212, 1686101741, 783310758, 248585944, 1093377716); + int4x2 b2 = int4x2(1353196495, 1384773500, 1596528529, 2122329305, 1033200564, 996795088, 1137754930, 232014195); + int4x2 r2 = int4x2(-119429582, -536965160, -2049587992, -759667012, 1443849636, 550781664, -959017424, -353108260); + TestUtils.AreEqual(r2, a2 * b2); + + int4x2 a3 = int4x2(797038788, 1838048120, 1892922904, 1952024781, 492107602, 1097670675, 2069629919, 20122103); + int4x2 b3 = int4x2(1080950243, 1613216909, 463529448, 1781487382, 2101946430, 673144237, 390627073, 964308272); + int4x2 r3 = int4x2(-1093604916, 264300824, -121602624, 1825729694, -241519140, -1246587945, -2064143137, -251115184); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void int4x2_operator_mul_wide_scalar() + { + int4x2 a0 = int4x2(871746615, 492532311, 570557670, 2142306629, 1610315153, 1526163563, 118471734, 257439514); + int b0 = (442064533); + int4x2 r0 = int4x2(338365955, 1081376419, -1729147426, -1015409879, -873485467, -175501241, -838181010, 513646114); + TestUtils.AreEqual(r0, a0 * b0); + + int4x2 a1 = int4x2(364291059, 1584938026, 1357601203, 638897141, 268562104, 1007838321, 1163240135, 1619806399); + int b1 = (1186560810); + int4x2 r1 = int4x2(1029154526, 989596900, 521189470, -1619710670, 1627099696, 753911178, -1861135962, 167687254); + TestUtils.AreEqual(r1, a1 * b1); + + int4x2 a2 = int4x2(1444659979, 464517916, 1508043166, 745488654, 636691139, 1851670006, 357357967, 1095280227); + int b2 = (1127580168); + int4x2 r2 = int4x2(204516952, -1949298464, -1049655056, 73999472, -492889064, -2074682448, 679242360, 1245870360); + TestUtils.AreEqual(r2, a2 * b2); + + int4x2 a3 = int4x2(702779195, 1464398841, 51061000, 802418971, 407442471, 638315697, 1889264235, 584402164); + int b3 = (945802744); + int4x2 r3 = int4x2(-586547160, -76431816, -567056448, 1852387624, 241680584, -171571080, 1493698216, 2103324768); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void int4x2_operator_mul_scalar_wide() + { + int a0 = (1152242766); + int4x2 b0 = int4x2(1276636134, 2105929407, 499007702, 124002565, 1956335172, 1288034953, 832676555, 337389733); + int4x2 r0 = int4x2(-2129504236, 999811634, 1179056436, -801426554, 404105400, 1339492798, -381766182, -1111620026); + TestUtils.AreEqual(r0, a0 * b0); + + int a1 = (99268757); + int4x2 b1 = int4x2(2005055247, 2011389505, 1348110859, 399689191, 2007606374, 2076691289, 1825721194, 769885235); + int4x2 r1 = int4x2(559764411, -1619094571, 1022902375, -1005504653, -685637794, 1103844045, 2105414834, 302946735); + TestUtils.AreEqual(r1, a1 * b1); + + int a2 = (153314735); + int4x2 b2 = int4x2(1066325369, 84289667, 984486192, 1325213504, 1643957457, 1576395620, 2095980601, 907671947); + int4x2 r2 = int4x2(1030204087, 35283085, -749359152, 2102006976, 305231839, -663165604, -1035369481, 1010199813); + TestUtils.AreEqual(r2, a2 * b2); + + int a3 = (836919582); + int4x2 b3 = int4x2(1412159342, 2037926630, 366590562, 493177763, 2058824164, 497936968, 2136548816, 1211907591); + int4x2 r3 = int4x2(-1226838812, -175772428, 1537669500, -865230822, 1738427576, -71910288, -446284192, 1673391058); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void int4x2_operator_div_wide_wide() + { + int4x2 a0 = int4x2(333171510, 858154903, 1181365836, 671357749, 1090606752, 803759420, 788404166, 296807814); + int4x2 b0 = int4x2(698897823, 440199998, 655557473, 1658534285, 2127220100, 315653188, 1814290360, 992173243); + int4x2 r0 = int4x2(0, 1, 1, 0, 0, 2, 0, 0); + TestUtils.AreEqual(r0, a0 / b0); + + int4x2 a1 = int4x2(575260195, 166625280, 1493729000, 1831739736, 200852358, 129983172, 500176108, 472051781); + int4x2 b1 = int4x2(914851653, 664340325, 224323977, 246981573, 285573983, 819471609, 2012476015, 1783179572); + int4x2 r1 = int4x2(0, 0, 6, 7, 0, 0, 0, 0); + TestUtils.AreEqual(r1, a1 / b1); + + int4x2 a2 = int4x2(414699094, 1446535974, 1278480457, 930910505, 263295881, 1626759436, 450830871, 21439121); + int4x2 b2 = int4x2(223253978, 169515029, 1694929006, 1992168131, 1155972447, 1768506696, 422325410, 1508417406); + int4x2 r2 = int4x2(1, 8, 0, 0, 0, 0, 1, 0); + TestUtils.AreEqual(r2, a2 / b2); + + int4x2 a3 = int4x2(521337599, 127756712, 200601965, 412554396, 1014641734, 239347640, 525574301, 1158358177); + int4x2 b3 = int4x2(605462475, 66917170, 2014683461, 108847533, 611173330, 895791853, 1999369787, 1225614384); + int4x2 r3 = int4x2(0, 1, 0, 3, 1, 0, 0, 0); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void int4x2_operator_div_wide_scalar() + { + int4x2 a0 = int4x2(1433072926, 1073958635, 1195142312, 536596719, 1274375693, 464756346, 806462546, 906504670); + int b0 = (1434025872); + int4x2 r0 = int4x2(0, 0, 0, 0, 0, 0, 0, 0); + TestUtils.AreEqual(r0, a0 / b0); + + int4x2 a1 = int4x2(1380905136, 1196815948, 123300377, 643754735, 2084019932, 2047825037, 458304263, 741331531); + int b1 = (25493909); + int4x2 r1 = int4x2(54, 46, 4, 25, 81, 80, 17, 29); + TestUtils.AreEqual(r1, a1 / b1); + + int4x2 a2 = int4x2(466443901, 1500687214, 1453264263, 1617154145, 2040203220, 2103351724, 485536709, 402141749); + int b2 = (2110004616); + int4x2 r2 = int4x2(0, 0, 0, 0, 0, 0, 0, 0); + TestUtils.AreEqual(r2, a2 / b2); + + int4x2 a3 = int4x2(1477264254, 1549487015, 670594363, 2040479674, 155415284, 207130003, 1596922206, 1730223836); + int b3 = (1629069474); + int4x2 r3 = int4x2(0, 0, 0, 1, 0, 0, 0, 1); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void int4x2_operator_div_scalar_wide() + { + int a0 = (519165704); + int4x2 b0 = int4x2(1295178177, 775214121, 467772046, 1156881598, 310396565, 759759959, 243837702, 1616314235); + int4x2 r0 = int4x2(0, 0, 1, 0, 1, 0, 2, 0); + TestUtils.AreEqual(r0, a0 / b0); + + int a1 = (1053470225); + int4x2 b1 = int4x2(1320630160, 378773841, 4223608, 1971105754, 2054406020, 219939614, 1603672651, 2006134295); + int4x2 r1 = int4x2(0, 2, 249, 0, 0, 4, 0, 0); + TestUtils.AreEqual(r1, a1 / b1); + + int a2 = (888535397); + int4x2 b2 = int4x2(1493077923, 615835131, 1045603945, 452709946, 1074919059, 467037221, 1485241506, 1775728786); + int4x2 r2 = int4x2(0, 1, 0, 1, 0, 1, 0, 0); + TestUtils.AreEqual(r2, a2 / b2); + + int a3 = (481521341); + int4x2 b3 = int4x2(68149923, 80867357, 1294049272, 470535313, 1235850199, 631464286, 687722755, 412827650); + int4x2 r3 = int4x2(7, 5, 0, 1, 0, 0, 0, 1); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void int4x2_operator_mod_wide_wide() + { + int4x2 a0 = int4x2(258342924, 1454754891, 723352342, 1981431473, 531756042, 716993627, 1667903349, 1331097004); + int4x2 b0 = int4x2(1990080167, 1197348066, 651970512, 1659454050, 241005212, 1866255454, 1440101415, 595220963); + int4x2 r0 = int4x2(258342924, 257406825, 71381830, 321977423, 49745618, 716993627, 227801934, 140655078); + TestUtils.AreEqual(r0, a0 % b0); + + int4x2 a1 = int4x2(1776856101, 17598216, 1474345080, 1681376293, 813624265, 1617478722, 498370451, 780075943); + int4x2 b1 = int4x2(408818410, 198222574, 549504274, 239973807, 321398087, 658171840, 1511495237, 1048325585); + int4x2 r1 = int4x2(141582461, 17598216, 375336532, 1559644, 170828091, 301135042, 498370451, 780075943); + TestUtils.AreEqual(r1, a1 % b1); + + int4x2 a2 = int4x2(1754430321, 653235398, 1517128354, 966216200, 590067427, 1283434795, 1910903650, 1125967790); + int4x2 b2 = int4x2(1126739824, 666641241, 38017598, 418797691, 618700513, 1941062990, 158556432, 1081063558); + int4x2 r2 = int4x2(627690497, 653235398, 34442032, 128620818, 590067427, 1283434795, 8226466, 44904232); + TestUtils.AreEqual(r2, a2 % b2); + + int4x2 a3 = int4x2(1180537254, 308567230, 543945394, 483834400, 308703874, 383723801, 1181975437, 1161083599); + int4x2 b3 = int4x2(427329468, 148111230, 1251162672, 1856322297, 1214781084, 401954255, 1323259633, 1167744452); + int4x2 r3 = int4x2(325878318, 12344770, 543945394, 483834400, 308703874, 383723801, 1181975437, 1161083599); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void int4x2_operator_mod_wide_scalar() + { + int4x2 a0 = int4x2(560988938, 629524514, 767711194, 434281967, 1399805893, 792916846, 1663690927, 598661916); + int b0 = (1156862367); + int4x2 r0 = int4x2(560988938, 629524514, 767711194, 434281967, 242943526, 792916846, 506828560, 598661916); + TestUtils.AreEqual(r0, a0 % b0); + + int4x2 a1 = int4x2(1776636144, 1743722161, 475209785, 327476870, 1617696916, 379853074, 477430114, 858399046); + int b1 = (1287035793); + int4x2 r1 = int4x2(489600351, 456686368, 475209785, 327476870, 330661123, 379853074, 477430114, 858399046); + TestUtils.AreEqual(r1, a1 % b1); + + int4x2 a2 = int4x2(712734431, 199829950, 362269020, 1986626876, 1351725413, 1549678101, 431765276, 1315833792); + int b2 = (1506629323); + int4x2 r2 = int4x2(712734431, 199829950, 362269020, 479997553, 1351725413, 43048778, 431765276, 1315833792); + TestUtils.AreEqual(r2, a2 % b2); + + int4x2 a3 = int4x2(1664893153, 780055604, 104179235, 629966219, 1810536428, 1747026206, 1799535061, 875754431); + int b3 = (615834034); + int4x2 r3 = int4x2(433225085, 164221570, 104179235, 14132185, 578868360, 515358138, 567866993, 259920397); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void int4x2_operator_mod_scalar_wide() + { + int a0 = (933347930); + int4x2 b0 = int4x2(549923387, 243114953, 1884274390, 1428033594, 655531454, 1622674954, 1107563514, 1614111094); + int4x2 r0 = int4x2(383424543, 204003071, 933347930, 933347930, 277816476, 933347930, 933347930, 933347930); + TestUtils.AreEqual(r0, a0 % b0); + + int a1 = (914801920); + int4x2 b1 = int4x2(1432263179, 564431096, 1967013901, 1709750152, 1080102613, 13120773, 2042535998, 1505698002); + int4x2 r1 = int4x2(914801920, 350370824, 914801920, 914801920, 914801920, 9468583, 914801920, 914801920); + TestUtils.AreEqual(r1, a1 % b1); + + int a2 = (1640058084); + int4x2 b2 = int4x2(974167554, 758635306, 1387264978, 611743343, 1139002766, 1913935748, 1086810076, 991846486); + int4x2 r2 = int4x2(665890530, 122787472, 252793106, 416571398, 501055318, 1640058084, 553248008, 648211598); + TestUtils.AreEqual(r2, a2 % b2); + + int a3 = (922870408); + int4x2 b3 = int4x2(35007468, 891877602, 157349181, 83267982, 801093706, 546272767, 1665089132, 1889242068); + int4x2 r3 = int4x2(12676240, 30992806, 136124503, 6922606, 121776702, 376597641, 922870408, 922870408); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void int4x2_operator_plus() + { + int4x2 a0 = int4x2(195392567, 222719748, 1002351013, 1570765263, 109389333, 1515950277, 1689763402, 291471785); + int4x2 r0 = int4x2(195392567, 222719748, 1002351013, 1570765263, 109389333, 1515950277, 1689763402, 291471785); + TestUtils.AreEqual(r0, +a0); + + int4x2 a1 = int4x2(264115671, 195779102, 2131702223, 715660442, 1995564647, 69731564, 1317851903, 1957501908); + int4x2 r1 = int4x2(264115671, 195779102, 2131702223, 715660442, 1995564647, 69731564, 1317851903, 1957501908); + TestUtils.AreEqual(r1, +a1); + + int4x2 a2 = int4x2(531426536, 1334133318, 1539671418, 935436165, 1575048895, 2119066258, 781435471, 1659000230); + int4x2 r2 = int4x2(531426536, 1334133318, 1539671418, 935436165, 1575048895, 2119066258, 781435471, 1659000230); + TestUtils.AreEqual(r2, +a2); + + int4x2 a3 = int4x2(1301861249, 1360657696, 578750954, 150348334, 1791553179, 1288641627, 735146513, 328684789); + int4x2 r3 = int4x2(1301861249, 1360657696, 578750954, 150348334, 1791553179, 1288641627, 735146513, 328684789); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void int4x2_operator_neg() + { + int4x2 a0 = int4x2(1385088677, 94114564, 1350664872, 1458616659, 2067164853, 218122493, 958484951, 270553961); + int4x2 r0 = int4x2(-1385088677, -94114564, -1350664872, -1458616659, -2067164853, -218122493, -958484951, -270553961); + TestUtils.AreEqual(r0, -a0); + + int4x2 a1 = int4x2(446497525, 1928771252, 1427605822, 2051940607, 1434247484, 485368391, 908365416, 1742096480); + int4x2 r1 = int4x2(-446497525, -1928771252, -1427605822, -2051940607, -1434247484, -485368391, -908365416, -1742096480); + TestUtils.AreEqual(r1, -a1); + + int4x2 a2 = int4x2(990033169, 1350976157, 12802586, 1934372287, 576597401, 785136322, 559205611, 1959833280); + int4x2 r2 = int4x2(-990033169, -1350976157, -12802586, -1934372287, -576597401, -785136322, -559205611, -1959833280); + TestUtils.AreEqual(r2, -a2); + + int4x2 a3 = int4x2(162379661, 95281343, 1969004480, 1381288239, 252975075, 1961335692, 1607042487, 832886233); + int4x2 r3 = int4x2(-162379661, -95281343, -1969004480, -1381288239, -252975075, -1961335692, -1607042487, -832886233); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void int4x2_operator_prefix_inc() + { + int4x2 a0 = int4x2(780471723, 954741756, 272723451, 2142862245, 606294309, 1514814550, 250124151, 444189162); + int4x2 r0 = int4x2(780471724, 954741757, 272723452, 2142862246, 606294310, 1514814551, 250124152, 444189163); + TestUtils.AreEqual(r0, ++a0); + + int4x2 a1 = int4x2(1833356994, 1348278302, 129540735, 1584496757, 1170613526, 986715680, 1701179230, 1397451003); + int4x2 r1 = int4x2(1833356995, 1348278303, 129540736, 1584496758, 1170613527, 986715681, 1701179231, 1397451004); + TestUtils.AreEqual(r1, ++a1); + + int4x2 a2 = int4x2(483952900, 1268688387, 2014528731, 453850931, 1112537171, 621362788, 2063486914, 1612870531); + int4x2 r2 = int4x2(483952901, 1268688388, 2014528732, 453850932, 1112537172, 621362789, 2063486915, 1612870532); + TestUtils.AreEqual(r2, ++a2); + + int4x2 a3 = int4x2(1161037742, 1583359796, 82587894, 810087437, 72436569, 1094485773, 912422931, 1011314676); + int4x2 r3 = int4x2(1161037743, 1583359797, 82587895, 810087438, 72436570, 1094485774, 912422932, 1011314677); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void int4x2_operator_postfix_inc() + { + int4x2 a0 = int4x2(241865086, 2145821641, 1596166022, 803592338, 529551271, 1656767229, 903047443, 1213663244); + int4x2 r0 = int4x2(241865086, 2145821641, 1596166022, 803592338, 529551271, 1656767229, 903047443, 1213663244); + TestUtils.AreEqual(r0, a0++); + + int4x2 a1 = int4x2(1425753247, 389844650, 1159795446, 1343289659, 1227160199, 947635082, 137930180, 451018043); + int4x2 r1 = int4x2(1425753247, 389844650, 1159795446, 1343289659, 1227160199, 947635082, 137930180, 451018043); + TestUtils.AreEqual(r1, a1++); + + int4x2 a2 = int4x2(1634297552, 1176922170, 388721494, 2381860, 2062858295, 715101397, 1725384327, 446867079); + int4x2 r2 = int4x2(1634297552, 1176922170, 388721494, 2381860, 2062858295, 715101397, 1725384327, 446867079); + TestUtils.AreEqual(r2, a2++); + + int4x2 a3 = int4x2(2101314783, 1683365096, 1319511974, 1418603655, 1938539756, 592683318, 1576213022, 1150548583); + int4x2 r3 = int4x2(2101314783, 1683365096, 1319511974, 1418603655, 1938539756, 592683318, 1576213022, 1150548583); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void int4x2_operator_prefix_dec() + { + int4x2 a0 = int4x2(1331961415, 1612382200, 1401591249, 2042075388, 1757136546, 1895858159, 1467742422, 578341664); + int4x2 r0 = int4x2(1331961414, 1612382199, 1401591248, 2042075387, 1757136545, 1895858158, 1467742421, 578341663); + TestUtils.AreEqual(r0, --a0); + + int4x2 a1 = int4x2(1336115745, 1169239112, 1862369220, 312317355, 1027543764, 1595492535, 1426262619, 1426620468); + int4x2 r1 = int4x2(1336115744, 1169239111, 1862369219, 312317354, 1027543763, 1595492534, 1426262618, 1426620467); + TestUtils.AreEqual(r1, --a1); + + int4x2 a2 = int4x2(674685792, 1459529624, 2092317419, 107501474, 1261583506, 512900840, 1496855314, 777588547); + int4x2 r2 = int4x2(674685791, 1459529623, 2092317418, 107501473, 1261583505, 512900839, 1496855313, 777588546); + TestUtils.AreEqual(r2, --a2); + + int4x2 a3 = int4x2(617644613, 625907330, 1452782388, 804650978, 2076275981, 120447533, 262357170, 1887136873); + int4x2 r3 = int4x2(617644612, 625907329, 1452782387, 804650977, 2076275980, 120447532, 262357169, 1887136872); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void int4x2_operator_postfix_dec() + { + int4x2 a0 = int4x2(1870005937, 1708534798, 704493460, 462940703, 2060593573, 228744869, 940247280, 1818778351); + int4x2 r0 = int4x2(1870005937, 1708534798, 704493460, 462940703, 2060593573, 228744869, 940247280, 1818778351); + TestUtils.AreEqual(r0, a0--); + + int4x2 a1 = int4x2(1015253889, 1401191870, 2080259851, 653673271, 140452688, 1928164223, 1760916301, 1174531383); + int4x2 r1 = int4x2(1015253889, 1401191870, 2080259851, 653673271, 140452688, 1928164223, 1760916301, 1174531383); + TestUtils.AreEqual(r1, a1--); + + int4x2 a2 = int4x2(634036198, 1669210509, 874927437, 1393579866, 471308632, 620865961, 220103745, 1407678826); + int4x2 r2 = int4x2(634036198, 1669210509, 874927437, 1393579866, 471308632, 620865961, 220103745, 1407678826); + TestUtils.AreEqual(r2, a2--); + + int4x2 a3 = int4x2(319906934, 488775250, 1681733117, 1916879863, 2060905976, 636358505, 1379709480, 451326084); + int4x2 r3 = int4x2(319906934, 488775250, 1681733117, 1916879863, 2060905976, 636358505, 1379709480, 451326084); + TestUtils.AreEqual(r3, a3--); + } + + [TestCompiler] + public static void int4x2_operator_bitwise_and_wide_wide() + { + int4x2 a0 = int4x2(1055241304, 859321394, 1088358961, 2090949513, 300561740, 651904515, 1331035868, 2012752753); + int4x2 b0 = int4x2(749698416, 748105424, 1842764797, 9990577, 1989102105, 1666634755, 58116798, 868036607); + int4x2 r0 = int4x2(749024336, 537928720, 1087769137, 8409473, 277479432, 575816707, 55888540, 867707761); + TestUtils.AreEqual(r0, a0 & b0); + + int4x2 a1 = int4x2(1298126656, 53199569, 1752363533, 1303061302, 1929998247, 1504941434, 470682792, 713577376); + int4x2 b1 = int4x2(1420638875, 1308767169, 564040763, 478617502, 806150474, 674015378, 1505309955, 36064977); + int4x2 r1 = int4x2(1141707264, 33686209, 538087433, 209912598, 805855490, 136347666, 403178496, 33571456); + TestUtils.AreEqual(r1, a1 & b1); + + int4x2 a2 = int4x2(1493231658, 1340884669, 1577921467, 44846626, 1105094388, 1143008413, 333009589, 2116296009); + int4x2 b2 = int4x2(1779639327, 808650076, 1634437037, 1997568501, 1930853951, 1901503461, 1508772523, 2010961769); + int4x2 r2 = int4x2(1207967754, 2098204, 1074332585, 33572896, 1091986996, 1073782917, 298320545, 1979979081); + TestUtils.AreEqual(r2, a2 & b2); + + int4x2 a3 = int4x2(2067254825, 121795325, 2122365250, 1088796653, 1594120761, 965590824, 337823363, 1686791432); + int4x2 b3 = int4x2(1495957269, 1914669725, 1263994006, 491200541, 380703892, 282208487, 1416934135, 942735432); + int4x2 r3 = int4x2(1495420417, 33686173, 1241513986, 4530189, 369102864, 276834336, 337674883, 536870920); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void int4x2_operator_bitwise_and_wide_scalar() + { + int4x2 a0 = int4x2(1513158868, 284695609, 734595037, 1566510707, 1601252476, 84213838, 314333543, 430856908); + int b0 = (1173647397); + int4x2 r0 = int4x2(1076916228, 15732769, 29360133, 1163132961, 1164976164, 84148228, 11816997, 27545604); + TestUtils.AreEqual(r0, a0 & b0); + + int4x2 a1 = int4x2(753481263, 1619794917, 2143619546, 1873208293, 126982769, 651482651, 1383096952, 1689107088); + int b1 = (327392481); + int4x2 r1 = int4x2(8459297, 8394977, 327223488, 58884321, 58824801, 41980929, 301989984, 8493184); + TestUtils.AreEqual(r1, a1 & b1); + + int4x2 a2 = int4x2(1368301071, 1729929586, 989550739, 1914435619, 1592791064, 2047510829, 678485991, 586400261); + int b2 = (366962092); + int4x2 r2 = int4x2(294519820, 85729568, 282804352, 270229536, 349175816, 269091116, 5260708, 13844484); + TestUtils.AreEqual(r2, a2 & b2); + + int4x2 a3 = int4x2(771972179, 131945492, 1707451796, 394184188, 1943201012, 558008097, 1070093422, 34324916); + int b3 = (309059606); + int4x2 r3 = int4x2(33767442, 38354964, 4300820, 308985876, 306372628, 4358144, 306724870, 34324500); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void int4x2_operator_bitwise_and_scalar_wide() + { + int a0 = (477163326); + int4x2 b0 = int4x2(110453385, 703240362, 2075630560, 1884904031, 1734899436, 947945203, 1664399051, 458879298); + int4x2 r0 = int4x2(68182536, 140544042, 405834528, 273697310, 73426476, 402681394, 3188234, 407953666); + TestUtils.AreEqual(r0, a0 & b0); + + int a1 = (158491426); + int4x2 b1 = int4x2(79772356, 2054527944, 202228212, 359225061, 639811396, 1821945318, 1821303024, 2030124055); + int4x2 r1 = int4x2(4203008, 141558528, 134234400, 23085600, 2237184, 135274786, 134373408, 151003138); + TestUtils.AreEqual(r1, a1 & b1); + + int a2 = (1985961756); + int4x2 b2 = int4x2(579780373, 2061831301, 1139618293, 1145191868, 1121606282, 1414714065, 688688277, 1508875606); + int4x2 r2 = int4x2(571350804, 1917127684, 1112346900, 1145183516, 1113217544, 1414681104, 537660436, 1347362068); + TestUtils.AreEqual(r2, a2 & b2); + + int a3 = (664318814); + int4x2 b3 = int4x2(2092766410, 1010043618, 599967779, 47076367, 1325716015, 1119912335, 2083412385, 1805692137); + int4x2 r3 = int4x2(613945418, 605028930, 595623938, 42471438, 117477902, 41976078, 604508416, 595632200); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void int4x2_operator_bitwise_or_wide_wide() + { + int4x2 a0 = int4x2(1920951869, 1750772852, 1420019191, 732977093, 1169579447, 229437930, 1966721348, 2039812323); + int4x2 b0 = int4x2(214585254, 275414367, 858759675, 190211455, 1218691723, 2129565457, 1862809466, 495728846); + int4x2 r0 = int4x2(2130669503, 2021326207, 2008016383, 737572863, 1303895999, 2146367483, 2134507390, 2107455727); + TestUtils.AreEqual(r0, a0 | b0); + + int4x2 a1 = int4x2(113550869, 1912038362, 1569990624, 1490718227, 1686257697, 2137727522, 1569900650, 856504729); + int4x2 b1 = int4x2(868064152, 1756913766, 933656055, 247722084, 1884195075, 1804207631, 1913174711, 1815920856); + int4x2 r1 = int4x2(939376541, 2046780414, 2142664695, 1591475831, 1959708963, 2146117167, 2140863231, 2134768089); + TestUtils.AreEqual(r1, a1 | b1); + + int4x2 a2 = int4x2(2033376384, 2086259889, 671790684, 1189001916, 1756048437, 417084592, 2024165808, 966008272); + int4x2 b2 = int4x2(1226577606, 1696467642, 186912044, 1778908130, 1461256625, 1142152181, 272117331, 1162254035); + int4x2 r2 = int4x2(2034163398, 2103430843, 724483964, 1860172798, 2142973365, 1558183925, 2025750515, 2111217619); + TestUtils.AreEqual(r2, a2 | b2); + + int4x2 a3 = int4x2(2031026290, 1461019191, 1071959084, 1645847295, 871350674, 736640317, 868515800, 767794452); + int4x2 b3 = int4x2(870448102, 1845053992, 257334526, 987295814, 1503050768, 1683307763, 1076253109, 1403888383); + int4x2 r3 = int4x2(2079325174, 2147314239, 1073143038, 2061103871, 2080374162, 1878867455, 1944485885, 2146418687); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void int4x2_operator_bitwise_or_wide_scalar() + { + int4x2 a0 = int4x2(1295304853, 1307252624, 350194630, 1128063578, 1774824542, 2085245467, 1988423804, 999162350); + int b0 = (1305527136); + int4x2 r0 = int4x2(1307888629, 1308350448, 1574947814, 1341973370, 1842999166, 2111492987, 2144662396, 2145305582); + TestUtils.AreEqual(r0, a0 | b0); + + int4x2 a1 = int4x2(2110327307, 341855232, 1317039676, 228656898, 41280811, 1536908787, 606786773, 1739461580); + int b1 = (1050875188); + int4x2 r1 = int4x2(2146115391, 1055087924, 2124644156, 1067652918, 1056437567, 2142985719, 1051448821, 2142181372); + TestUtils.AreEqual(r1, a1 | b1); + + int4x2 a2 = int4x2(2040936581, 1377874553, 1522262112, 1496806239, 1732466858, 1535976093, 375675620, 1614193383); + int b2 = (1350320187); + int4x2 r2 = int4x2(2046720191, 1383920251, 1526718587, 1501524863, 2004834491, 1543332543, 1450990335, 1887363839); + TestUtils.AreEqual(r2, a2 | b2); + + int4x2 a3 = int4x2(226059393, 112556963, 1614163749, 1583289054, 1370656810, 1286074530, 1155438844, 1835671387); + int b3 = (697385997); + int4x2 r3 = int4x2(771318925, 800423855, 1773629229, 2145343199, 2041828399, 1840772271, 1843387645, 1845190495); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void int4x2_operator_bitwise_or_scalar_wide() + { + int a0 = (1768627592); + int4x2 b0 = int4x2(1849658052, 1759912154, 729979455, 975926310, 1987690876, 1809506714, 1160695341, 408963395); + int4x2 r0 = int4x2(1870634956, 1777286618, 1810603967, 2070642094, 2138824188, 1811676570, 1836048301, 2037079499); + TestUtils.AreEqual(r0, a0 | b0); + + int a1 = (314072711); + int4x2 b1 = int4x2(1560007537, 1709003416, 977086639, 1448375596, 1689568808, 595543345, 559778387, 621080913); + int4x2 r1 = int4x2(1593565175, 2013093535, 985497263, 1459388335, 1992089263, 872374199, 872275671, 935133143); + TestUtils.AreEqual(r1, a1 | b1); + + int a2 = (438994183); + int4x2 b2 = int4x2(1742637145, 1219409263, 1602932494, 1204461702, 2111538444, 836730895, 1207638621, 802100209); + int4x2 r2 = int4x2(2147388767, 1521399151, 1605029647, 1609213319, 2147190031, 1006601487, 1610325855, 1072666615); + TestUtils.AreEqual(r2, a2 | b2); + + int a3 = (1089077339); + int4x2 b3 = int4x2(1315030334, 249047666, 1604790897, 1848168086, 347254235, 1777613639, 1876731927, 842785732); + int4x2 r3 = int4x2(1324074367, 1325017723, 1609509499, 1860882143, 1425714651, 1778269023, 1878960223, 1929110495); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void int4x2_operator_bitwise_xor_wide_wide() + { + int4x2 a0 = int4x2(1843655608, 362425681, 640805534, 1342040268, 945678755, 980321850, 390165019, 1682422658); + int4x2 b0 = int4x2(1422803441, 1234691140, 119589253, 1101464929, 121896337, 1880109018, 1000210266, 1718938232); + int4x2 r0 = int4x2(959296073, 1544407317, 554771227, 240840109, 1058935858, 1249815008, 752651585, 36917754); + TestUtils.AreEqual(r0, a0 ^ b0); + + int4x2 a1 = int4x2(303897251, 230477768, 1103646442, 1503102919, 26631152, 1016475570, 1862440929, 379588576); + int4x2 b1 = int4x2(464406940, 884337881, 34199854, 1430659227, 126415540, 1069919967, 1810763253, 2082802224); + int4x2 r1 = int4x2(162747199, 956900113, 1136760772, 215066460, 102672708, 55804269, 82614804, 1787102672); + TestUtils.AreEqual(r1, a1 ^ b1); + + int4x2 a2 = int4x2(1943580404, 691527166, 723280696, 497086939, 1640104913, 893178410, 1596765788, 664096470); + int4x2 b2 = int4x2(941097951, 27782297, 156353074, 607061607, 470737131, 1151564598, 8268481, 434405645); + int4x2 r2 = int4x2(1270918443, 680538471, 575512842, 965736380, 2110579514, 1906288924, 1599249565, 1047646171); + TestUtils.AreEqual(r2, a2 ^ b2); + + int4x2 a3 = int4x2(2043360590, 799560121, 287637604, 696169196, 2067184169, 1208059988, 1250597330, 1386507647); + int4x2 b3 = int4x2(519003095, 1880915120, 608970922, 1809455754, 1079250101, 514389994, 272120301, 1282399149); + int4x2 r3 = int4x2(1730440857, 1605643529, 896084174, 1118087270, 996325020, 1453948862, 1521655871, 516667090); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void int4x2_operator_bitwise_xor_wide_scalar() + { + int4x2 a0 = int4x2(169345668, 176087064, 2084362901, 1663924004, 193851255, 517476661, 905336222, 863800783); + int b0 = (354464228); + int4x2 r0 = int4x2(523809632, 526275068, 1763470193, 1980614336, 514678419, 200843473, 550954106, 643578923); + TestUtils.AreEqual(r0, a0 ^ b0); + + int4x2 a1 = int4x2(365003873, 954341348, 1464576786, 625604047, 1700827127, 2003392824, 1481813598, 1077374714); + int b1 = (835837496); + int4x2 r1 = int4x2(605051481, 154388956, 1721398570, 345517047, 1420906959, 1186498304, 1770221670, 1910943938); + TestUtils.AreEqual(r1, a1 ^ b1); + + int4x2 a2 = int4x2(1043379893, 781860967, 60088394, 1196907956, 858716109, 858484213, 178843494, 1223183458); + int b2 = (1991576049); + int4x2 r2 = int4x2(1216724804, 1479494038, 1965156795, 836916293, 1167851068, 1168008196, 2082334359, 1046300051); + TestUtils.AreEqual(r2, a2 ^ b2); + + int4x2 a3 = int4x2(866652388, 1206307664, 2037729583, 1324393116, 497725784, 1367278685, 962962860, 906632547); + int b3 = (1771693181); + int4x2 r3 = int4x2(1513223321, 780087085, 283946322, 661210849, 1949521189, 954654752, 1358709201, 1603533086); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void int4x2_operator_bitwise_xor_scalar_wide() + { + int a0 = (1361775641); + int4x2 b0 = int4x2(1452773578, 459050892, 1986218254, 1689037698, 999278344, 1229114508, 1087843538, 733699740); + int4x2 r0 = int4x2(129801427, 1249346453, 659047703, 898082715, 1789184785, 409583765, 301736139, 2056278661); + TestUtils.AreEqual(r0, a0 ^ b0); + + int a1 = (106187872); + int4x2 b1 = int4x2(1533632738, 1107817672, 492506236, 597602329, 1439603382, 1001169118, 1231718216, 1693179077); + int4x2 r1 = int4x2(1564290178, 1146337448, 453984284, 634059897, 1402656470, 1039723710, 1329515304, 1656721573); + TestUtils.AreEqual(r1, a1 ^ b1); + + int a2 = (1050897427); + int4x2 b2 = int4x2(1796435561, 1100532547, 2106589181, 79691722, 851486414, 381749210, 1743618507, 2038827673); + int4x2 r2 = int4x2(1437598330, 2134615888, 1126994926, 974951385, 207866589, 677538761, 1498344920, 1193633418); + TestUtils.AreEqual(r2, a2 ^ b2); + + int a3 = (1680906962); + int4x2 b3 = int4x2(161437943, 171927307, 277703584, 1344718195, 1634011177, 28540247, 1205447252, 150341716); + int4x2 r3 = int4x2(1840235045, 1846541785, 1958605170, 873881505, 89494267, 1703143301, 602484870, 1824952966); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void int4x2_operator_left_shift() + { + int4x2 a0 = int4x2(1129100049, 829482269, 1571297368, 443753193, 1872142968, 249554593, 892627436, 980302862); + int b0 = (218351941); + int4x2 r0 = int4x2(1771463200, 773628832, -1258091776, 1315200288, -220967168, -604187616, -1500693120, 1304920512); + TestUtils.AreEqual(r0, a0 << b0); + + int4x2 a1 = int4x2(62369727, 1271350845, 108441902, 1959056531, 1779118882, 1451674188, 2082026915, 1149883636); + int b1 = (849916599); + int4x2 r1 = int4x2(-545259520, 511705088, -1761607680, 1233125376, -1862270976, 637534208, -780140544, 2046820352); + TestUtils.AreEqual(r1, a1 << b1); + + int4x2 a2 = int4x2(1380536034, 1487486874, 1498738574, 752067504, 1647167336, 772453640, 456967739, 947384545); + int b2 = (186532735); + int4x2 r2 = int4x2(0, 0, 0, 0, 0, 0, -2147483648, -2147483648); + TestUtils.AreEqual(r2, a2 << b2); + + int4x2 a3 = int4x2(1463252873, 640579158, 56630178, 1650899378, 2142944517, 565484033, 965161323, 1634169280); + int b3 = (1315516161); + int4x2 r3 = int4x2(-1368461550, 1281158316, 113260356, -993168540, -9078262, 1130968066, 1930322646, -1026628736); + TestUtils.AreEqual(r3, a3 << b3); + } + + [TestCompiler] + public static void int4x2_operator_right_shift() + { + int4x2 a0 = int4x2(809126085, 908563670, 763568837, 1986717290, 1174507510, 646821842, 1242726074, 390811632); + int b0 = (994800051); + int4x2 r0 = int4x2(1543, 1732, 1456, 3789, 2240, 1233, 2370, 745); + TestUtils.AreEqual(r0, a0 >> b0); + + int4x2 a1 = int4x2(1521420393, 102096936, 400863878, 667378673, 1611921244, 307750782, 479442287, 2014389412); + int b1 = (1923166649); + int4x2 r1 = int4x2(45, 3, 11, 19, 48, 9, 14, 60); + TestUtils.AreEqual(r1, a1 >> b1); + + int4x2 a2 = int4x2(1673938174, 1248577253, 848199210, 813936577, 848976170, 500930883, 662405800, 126875849); + int b2 = (1075916177); + int4x2 r2 = int4x2(12771, 9525, 6471, 6209, 6477, 3821, 5053, 967); + TestUtils.AreEqual(r2, a2 >> b2); + + int4x2 a3 = int4x2(1103917083, 955487090, 1013356510, 391605984, 185228398, 87452680, 2021602226, 1401766495); + int b3 = (1199000503); + int4x2 r3 = int4x2(131, 113, 120, 46, 22, 10, 240, 167); + TestUtils.AreEqual(r3, a3 >> b3); + } + + [TestCompiler] + public static void int4x2_operator_bitwise_not() + { + int4x2 a0 = int4x2(111796841, 603562399, 745091931, 853183268, 1110916612, 381888399, 1891338755, 1506860135); + int4x2 r0 = int4x2(-111796842, -603562400, -745091932, -853183269, -1110916613, -381888400, -1891338756, -1506860136); + TestUtils.AreEqual(r0, ~a0); + + int4x2 a1 = int4x2(771210628, 875964607, 96456785, 916013379, 203444882, 1172294211, 1020232736, 683852713); + int4x2 r1 = int4x2(-771210629, -875964608, -96456786, -916013380, -203444883, -1172294212, -1020232737, -683852714); + TestUtils.AreEqual(r1, ~a1); + + int4x2 a2 = int4x2(375158799, 1218471344, 1174233245, 592898220, 443427914, 1385118179, 215320517, 860122767); + int4x2 r2 = int4x2(-375158800, -1218471345, -1174233246, -592898221, -443427915, -1385118180, -215320518, -860122768); + TestUtils.AreEqual(r2, ~a2); + + int4x2 a3 = int4x2(1411266016, 686325107, 829984855, 191189901, 319233142, 156019905, 1467719681, 1193642973); + int4x2 r3 = int4x2(-1411266017, -686325108, -829984856, -191189902, -319233143, -156019906, -1467719682, -1193642974); + TestUtils.AreEqual(r3, ~a3); + } + + [TestCase /* For player builds */] + public static void int4x2_EqualsObjectOverride() + { + TestUtils.IsFalse(new int4x2().Equals((object)new int())); + TestUtils.IsTrue(new int4x2().Equals((object)new int4x2())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestInt4x2.gen.cs.meta b/src/Tests/Tests/Shared/TestInt4x2.gen.cs.meta new file mode 100644 index 00000000..fb8905d4 --- /dev/null +++ b/src/Tests/Tests/Shared/TestInt4x2.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a22ace1f6a955624aa145878a9d31bd2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestInt4x3.gen.cs b/src/Tests/Tests/Shared/TestInt4x3.gen.cs new file mode 100644 index 00000000..c8662413 --- /dev/null +++ b/src/Tests/Tests/Shared/TestInt4x3.gen.cs @@ -0,0 +1,1240 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestInt4x3 + { + [TestCompiler] + public static void int4x3_zero() + { + TestUtils.AreEqual(0, int4x3.zero.c0.x); + TestUtils.AreEqual(0, int4x3.zero.c0.y); + TestUtils.AreEqual(0, int4x3.zero.c0.z); + TestUtils.AreEqual(0, int4x3.zero.c0.w); + TestUtils.AreEqual(0, int4x3.zero.c1.x); + TestUtils.AreEqual(0, int4x3.zero.c1.y); + TestUtils.AreEqual(0, int4x3.zero.c1.z); + TestUtils.AreEqual(0, int4x3.zero.c1.w); + TestUtils.AreEqual(0, int4x3.zero.c2.x); + TestUtils.AreEqual(0, int4x3.zero.c2.y); + TestUtils.AreEqual(0, int4x3.zero.c2.z); + TestUtils.AreEqual(0, int4x3.zero.c2.w); + } + + [TestCompiler] + public static void int4x3_operator_equal_wide_wide() + { + int4x3 a0 = int4x3(2105871082, 35218899, 1550755093, 764676020, 606743782, 1208156098, 1023640014, 1038468316, 1416064367, 727143393, 2061243891, 184669837); + int4x3 b0 = int4x3(1477587886, 579629692, 540974792, 208405066, 2063397938, 1060167409, 362592601, 2097545362, 277670088, 426944490, 901076223, 857900673); + bool4x3 r0 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + int4x3 a1 = int4x3(1303661760, 2044073738, 370395888, 1822916805, 1076983135, 345215866, 833676277, 1987782708, 1481088614, 1364754268, 93639636, 1850596922); + int4x3 b1 = int4x3(1548779757, 325265488, 312658571, 176373760, 2052378097, 858156597, 982817797, 1252095508, 882634538, 1959142806, 72495800, 1077678183); + bool4x3 r1 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + int4x3 a2 = int4x3(2073471507, 1745989448, 28118669, 1267554232, 1292918049, 1423451579, 644384701, 1985492825, 240481133, 2130667921, 17376735, 1263869085); + int4x3 b2 = int4x3(1729269763, 1607675346, 1813461519, 1204794859, 1324801873, 1975336, 439410532, 294085211, 1031782338, 1118745564, 180311719, 433246570); + bool4x3 r2 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + int4x3 a3 = int4x3(437371027, 1093339523, 1683805602, 764261037, 1845666482, 399277628, 714152770, 148255091, 784823865, 1712722195, 1706849865, 607710807); + int4x3 b3 = int4x3(1622531532, 1178609353, 373010678, 1231165960, 966395555, 788609772, 215241459, 1411005263, 1287904654, 1656358051, 1985807372, 1041678082); + bool4x3 r3 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void int4x3_operator_equal_wide_scalar() + { + int4x3 a0 = int4x3(437822262, 2020661134, 541786900, 853113810, 23716499, 179951405, 1409026299, 948838849, 953202998, 691955848, 1926262965, 1851546137); + int b0 = (1332833578); + bool4x3 r0 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + int4x3 a1 = int4x3(712957637, 1049962241, 1836975611, 1016802970, 390120467, 464814777, 1451642042, 289137869, 152339338, 808355440, 660053867, 597354173); + int b1 = (2028784869); + bool4x3 r1 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + int4x3 a2 = int4x3(67320270, 35153827, 602895443, 186996278, 129611815, 1031574999, 1697392883, 1463742000, 857785521, 611116281, 594150729, 375387566); + int b2 = (151461188); + bool4x3 r2 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + int4x3 a3 = int4x3(1984352551, 570698441, 1872629381, 1263218472, 315982238, 122473806, 1404530826, 43943273, 1695786992, 2085125114, 432271298, 465353570); + int b3 = (1925707182); + bool4x3 r3 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void int4x3_operator_equal_scalar_wide() + { + int a0 = (542329200); + int4x3 b0 = int4x3(1115584594, 684107773, 1928988941, 890709324, 641152437, 1410341302, 497505660, 1068223109, 2014009435, 213835595, 1592428361, 1819361470); + bool4x3 r0 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + int a1 = (448650623); + int4x3 b1 = int4x3(1942175642, 64377057, 1485938610, 1146305380, 1312317120, 263290348, 812663708, 1585209188, 40646617, 1378718922, 1957797737, 873652576); + bool4x3 r1 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + int a2 = (1780082094); + int4x3 b2 = int4x3(1513270921, 2095980581, 1413074719, 1387984261, 1547119354, 924385171, 1253636050, 1477542688, 969120167, 591812191, 856880926, 1114040166); + bool4x3 r2 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + int a3 = (2107388425); + int4x3 b3 = int4x3(1368188588, 512677295, 1337925727, 2076181515, 1317314747, 299981273, 601822512, 1079453890, 125277108, 1257151509, 1915342590, 1034639325); + bool4x3 r3 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void int4x3_operator_not_equal_wide_wide() + { + int4x3 a0 = int4x3(1977284100, 1293292704, 1547283851, 422428953, 195833190, 1711544892, 5606053, 737069074, 647386678, 13079405, 1413841590, 1076166545); + int4x3 b0 = int4x3(1514195556, 957972049, 507667364, 581861672, 1128094576, 940096636, 57559040, 181752616, 962017320, 1762015406, 1107218953, 2042026522); + bool4x3 r0 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + int4x3 a1 = int4x3(1211445174, 1289303469, 1436402489, 1129570126, 1566836685, 1343313905, 329259205, 1774944480, 33906739, 2055853627, 2035015372, 1702756001); + int4x3 b1 = int4x3(836002288, 570272309, 2112081980, 1500634658, 1787808345, 566425667, 2037529609, 1520589840, 266793699, 538816359, 2075474643, 553571317); + bool4x3 r1 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + int4x3 a2 = int4x3(1164186087, 329853698, 769052491, 1893312730, 438029011, 1894010522, 1365847542, 1292942830, 2146008097, 1520743598, 861728782, 1999977058); + int4x3 b2 = int4x3(218264354, 654754196, 1392180230, 870065147, 1398749829, 711281563, 1999640291, 231234857, 210910234, 365281355, 170643407, 757340716); + bool4x3 r2 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + int4x3 a3 = int4x3(1334556487, 1728108667, 1198848973, 7011150, 1280729934, 1553569869, 1782228282, 731582167, 2041979262, 128396656, 143519087, 154742298); + int4x3 b3 = int4x3(639973212, 1147047891, 537350186, 1283454178, 735732152, 1218138135, 474815930, 174656455, 473248758, 1077993023, 1063662917, 181750095); + bool4x3 r3 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void int4x3_operator_not_equal_wide_scalar() + { + int4x3 a0 = int4x3(1038269360, 1427812625, 103361237, 1347017023, 1523584313, 150442802, 660334527, 719113717, 262959423, 484398043, 506946952, 226568494); + int b0 = (768873026); + bool4x3 r0 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + int4x3 a1 = int4x3(507918242, 923269270, 166187260, 114581840, 1045389187, 1648095254, 1461803977, 61801615, 1317840133, 2146927809, 1557151164, 1284033253); + int b1 = (1702162286); + bool4x3 r1 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + int4x3 a2 = int4x3(1345705546, 611028295, 1368046109, 1848036266, 2025452920, 373992983, 289537519, 1388743060, 146455100, 1854553487, 872755032, 2113020512); + int b2 = (1747302566); + bool4x3 r2 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + int4x3 a3 = int4x3(1062447442, 109864030, 1583997921, 1732461790, 1276630817, 721080697, 922945173, 1528002730, 282331576, 1372281893, 167200566, 1271483982); + int b3 = (632285066); + bool4x3 r3 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void int4x3_operator_not_equal_scalar_wide() + { + int a0 = (1652127596); + int4x3 b0 = int4x3(953791238, 271722683, 1278885987, 735128017, 112416504, 25967222, 1761444475, 1844594536, 1199122922, 634219279, 942501101, 67161343); + bool4x3 r0 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + int a1 = (969944293); + int4x3 b1 = int4x3(833229499, 1304301133, 704045745, 345012334, 1253134152, 325772538, 855127202, 793668881, 1584481616, 1101301152, 276853534, 987168816); + bool4x3 r1 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + int a2 = (1258105989); + int4x3 b2 = int4x3(362645228, 293978043, 1772395973, 1692007315, 681268929, 1535518457, 595209334, 25745185, 1278016813, 2125682481, 2037751005, 1405297618); + bool4x3 r2 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + int a3 = (1825546885); + int4x3 b3 = int4x3(1584424742, 1779859088, 1262387250, 936213998, 739749071, 1934808433, 1333711144, 571211509, 445791940, 43428024, 1509344718, 1643255886); + bool4x3 r3 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void int4x3_operator_less_wide_wide() + { + int4x3 a0 = int4x3(1486550609, 1779244308, 1602148045, 1614085440, 1975613414, 942838342, 1092279031, 373677431, 1419098312, 337757077, 1081797900, 1336745069); + int4x3 b0 = int4x3(97842578, 536551311, 413528975, 1838293684, 1283898480, 1456599961, 1080278602, 529676676, 156584048, 117348799, 246927124, 1916615924); + bool4x3 r0 = bool4x3(false, false, false, true, false, true, false, true, false, false, false, true); + TestUtils.AreEqual(r0, a0 < b0); + + int4x3 a1 = int4x3(840685445, 1220554047, 2013681746, 192965012, 532043965, 1000693402, 927236048, 1215860000, 780607596, 1882056852, 1354146545, 2135295778); + int4x3 b1 = int4x3(1731071394, 1328098431, 1014995792, 480319327, 1765937053, 1333997067, 688515308, 1856106947, 1303906227, 646821776, 1169473993, 316770064); + bool4x3 r1 = bool4x3(true, true, false, true, true, true, false, true, true, false, false, false); + TestUtils.AreEqual(r1, a1 < b1); + + int4x3 a2 = int4x3(1145973790, 1938006975, 895882838, 2006524299, 908581156, 1843349513, 1340458575, 1972095585, 1090933468, 924555996, 79585200, 1749924275); + int4x3 b2 = int4x3(1518155802, 416732703, 529193056, 1239623485, 2010112031, 2018560298, 285987009, 960617622, 462519015, 1473825625, 1187164011, 730583004); + bool4x3 r2 = bool4x3(true, false, false, false, true, true, false, false, false, true, true, false); + TestUtils.AreEqual(r2, a2 < b2); + + int4x3 a3 = int4x3(1088207695, 1484224850, 512353919, 562469379, 1743259263, 182124641, 1224472464, 1731920136, 1906896401, 425415911, 992649442, 515648372); + int4x3 b3 = int4x3(629133777, 1925375320, 689923293, 1818695099, 903783983, 495525944, 1923715956, 2850909, 1908553564, 1064607664, 1344783349, 494620587); + bool4x3 r3 = bool4x3(false, true, true, true, false, true, true, false, true, true, true, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void int4x3_operator_less_wide_scalar() + { + int4x3 a0 = int4x3(796797557, 670113454, 933579492, 278884514, 318174822, 1117630673, 741886928, 1990922600, 1030849597, 1546212312, 1718582899, 1648393417); + int b0 = (746564682); + bool4x3 r0 = bool4x3(false, true, false, true, true, false, true, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 < b0); + + int4x3 a1 = int4x3(1857132231, 1294006045, 952084157, 1303736668, 845460171, 979430272, 1368236640, 24980695, 1434668705, 659552739, 1058492383, 165694933); + int b1 = (1909506562); + bool4x3 r1 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 < b1); + + int4x3 a2 = int4x3(1204097259, 281328069, 24629507, 1386458568, 1325149699, 1498707004, 1650355158, 1213017950, 1650457461, 759932777, 1542997846, 1227393490); + int b2 = (922212691); + bool4x3 r2 = bool4x3(false, true, true, false, false, false, false, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + int4x3 a3 = int4x3(1520634374, 1951142425, 1956860037, 681224518, 1889763470, 1915403219, 850845857, 1871934613, 1882514458, 1326783898, 1044736383, 24899250); + int b3 = (1750827258); + bool4x3 r3 = bool4x3(true, false, false, true, false, false, true, false, false, true, true, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void int4x3_operator_less_scalar_wide() + { + int a0 = (186400299); + int4x3 b0 = int4x3(1881344229, 813834467, 1254886626, 1353590345, 1412343685, 1555571443, 1540508298, 1735458634, 135888070, 1643818742, 248291654, 1739560105); + bool4x3 r0 = bool4x3(true, true, true, true, true, true, true, true, false, true, true, true); + TestUtils.AreEqual(r0, a0 < b0); + + int a1 = (728539891); + int4x3 b1 = int4x3(480507742, 1696553040, 540223931, 1840493353, 146833656, 798115946, 2002002066, 1011261705, 783550942, 1093071215, 598253401, 1432416562); + bool4x3 r1 = bool4x3(false, true, false, true, false, true, true, true, true, true, false, true); + TestUtils.AreEqual(r1, a1 < b1); + + int a2 = (1863582169); + int4x3 b2 = int4x3(103622950, 775175960, 116908309, 1213433625, 1428954824, 1760442490, 1208143947, 751820805, 1491872302, 560004484, 2065157473, 310839658); + bool4x3 r2 = bool4x3(false, false, false, false, false, false, false, false, false, false, true, false); + TestUtils.AreEqual(r2, a2 < b2); + + int a3 = (697329242); + int4x3 b3 = int4x3(898786601, 1448893980, 1204091943, 1933043135, 828031833, 1737703663, 1672512847, 1112905025, 1666248737, 1352503217, 406395888, 1734008932); + bool4x3 r3 = bool4x3(true, true, true, true, true, true, true, true, true, true, false, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void int4x3_operator_greater_wide_wide() + { + int4x3 a0 = int4x3(2087717754, 1725569452, 1298066182, 1693943616, 1319019629, 70674491, 1042499725, 1002821508, 1021857133, 1744374599, 821751047, 467646903); + int4x3 b0 = int4x3(85148514, 293632137, 1151128249, 409440398, 1115020183, 1508500597, 1834583302, 1755218534, 1788761753, 1128238489, 834223713, 1578743290); + bool4x3 r0 = bool4x3(true, true, true, true, true, false, false, false, false, true, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + int4x3 a1 = int4x3(2029731638, 1377214212, 1207816926, 474621063, 20781266, 366593779, 2068457387, 10181449, 793634464, 144474612, 99947390, 930377263); + int4x3 b1 = int4x3(1647150256, 1756397855, 1131080201, 1208965204, 1495161099, 1283714281, 908051907, 412849651, 815822687, 730271942, 40756039, 883326140); + bool4x3 r1 = bool4x3(true, false, true, false, false, false, true, false, false, false, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + int4x3 a2 = int4x3(683686232, 742803073, 918292048, 875621429, 1764985258, 411384146, 1921397684, 1349107119, 640399120, 1487719331, 1467989523, 1834244794); + int4x3 b2 = int4x3(476260632, 1024136446, 1440596667, 1253494041, 146826162, 1798399573, 2085029408, 187939428, 1009192934, 1694822273, 1866590874, 113805226); + bool4x3 r2 = bool4x3(true, false, false, false, true, false, false, true, false, false, false, true); + TestUtils.AreEqual(r2, a2 > b2); + + int4x3 a3 = int4x3(1778580304, 334604025, 689749101, 1478795900, 716772993, 1072711623, 388277128, 290673156, 619539670, 1666212670, 496667761, 638935614); + int4x3 b3 = int4x3(1331524948, 5928360, 1884858608, 1988975599, 493888072, 731556294, 1597968264, 727668246, 1260583385, 1921631225, 359265523, 856088703); + bool4x3 r3 = bool4x3(true, true, false, false, true, true, false, false, false, false, true, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void int4x3_operator_greater_wide_scalar() + { + int4x3 a0 = int4x3(1208626274, 239697208, 1979453345, 1253474001, 1590192876, 1487911635, 1673945595, 1662650098, 222749855, 1433540517, 566635217, 1773305960); + int b0 = (1715176566); + bool4x3 r0 = bool4x3(false, false, true, false, false, false, false, false, false, false, false, true); + TestUtils.AreEqual(r0, a0 > b0); + + int4x3 a1 = int4x3(1850273578, 325913453, 333381537, 1905567362, 2053577491, 570397194, 2128431130, 1735325311, 529971908, 1663525234, 1972984241, 1587865063); + int b1 = (206147145); + bool4x3 r1 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + int4x3 a2 = int4x3(488268523, 812076921, 181082921, 1281638484, 1818357732, 116518997, 1397728785, 1924199337, 742950077, 1463993051, 1598027926, 842851852); + int b2 = (121921923); + bool4x3 r2 = bool4x3(true, true, true, true, true, false, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 > b2); + + int4x3 a3 = int4x3(160842093, 540338405, 174088887, 1609299242, 425486336, 1462766889, 651513452, 1122649822, 771802057, 839323192, 325778683, 406189885); + int b3 = (1226313895); + bool4x3 r3 = bool4x3(false, false, false, true, false, true, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void int4x3_operator_greater_scalar_wide() + { + int a0 = (480938827); + int4x3 b0 = int4x3(1824731899, 921496110, 586859044, 946430596, 1231356727, 1390167458, 1785807092, 28949024, 2037899283, 595656760, 1778095771, 1233500439); + bool4x3 r0 = bool4x3(false, false, false, false, false, false, false, true, false, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + int a1 = (1696302238); + int4x3 b1 = int4x3(1445965340, 484020151, 1586962841, 1361740714, 265628948, 2003122957, 332267433, 1128353075, 377919478, 982113135, 1117675960, 630865591); + bool4x3 r1 = bool4x3(true, true, true, true, true, false, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + int a2 = (1550679736); + int4x3 b2 = int4x3(895945757, 287025687, 643452096, 660504007, 613135893, 633307118, 514276792, 1377364317, 84491736, 746768197, 1282879723, 589415384); + bool4x3 r2 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 > b2); + + int a3 = (363082240); + int4x3 b3 = int4x3(1774333756, 741005890, 413100725, 702141547, 1434366582, 1489794027, 1710601432, 1914069735, 1811684885, 1007116016, 1883396218, 318035497); + bool4x3 r3 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void int4x3_operator_less_equal_wide_wide() + { + int4x3 a0 = int4x3(154092149, 1515170149, 1083970332, 785807178, 1401094881, 310537627, 868328962, 1990816725, 2035349541, 457043352, 1123282035, 1001842946); + int4x3 b0 = int4x3(77984380, 1712054191, 1566203809, 254834519, 450519938, 389457083, 1298669505, 207343167, 1214449047, 2059561026, 896534357, 1897470050); + bool4x3 r0 = bool4x3(false, true, true, false, false, true, true, false, false, true, false, true); + TestUtils.AreEqual(r0, a0 <= b0); + + int4x3 a1 = int4x3(1387761992, 195272789, 659549000, 888761458, 283706617, 1790185840, 899029812, 848317418, 1743712447, 1504407474, 1798441490, 1902791952); + int4x3 b1 = int4x3(521075677, 1848221945, 374708019, 1573731118, 2093466449, 1660210829, 1568778785, 1352157589, 1212771905, 1457525058, 1493446008, 1784768208); + bool4x3 r1 = bool4x3(false, true, false, true, true, false, true, true, false, false, false, false); + TestUtils.AreEqual(r1, a1 <= b1); + + int4x3 a2 = int4x3(606340844, 1994437705, 301831413, 654230470, 1223625081, 324292199, 1370931020, 1742769166, 1709242127, 105750466, 1655967312, 1455797002); + int4x3 b2 = int4x3(1993422493, 1378671664, 1447376929, 1405041439, 1765183746, 562894655, 1085068880, 1026386862, 884290156, 922346160, 330605896, 466570756); + bool4x3 r2 = bool4x3(true, false, true, true, true, true, false, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + int4x3 a3 = int4x3(366131629, 315848579, 1539610530, 99028560, 765767372, 1241881101, 527753961, 1271899705, 1439235979, 436585748, 1244486586, 2128710216); + int4x3 b3 = int4x3(1252369410, 2057993777, 1691801535, 2041799631, 557988228, 813610154, 1657573441, 983813335, 385144401, 1281329713, 285422763, 658643567); + bool4x3 r3 = bool4x3(true, true, true, true, false, false, true, false, false, true, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void int4x3_operator_less_equal_wide_scalar() + { + int4x3 a0 = int4x3(1479531977, 1427983411, 415250630, 1245345407, 1112546666, 1072990632, 1579912858, 101048307, 1070894375, 509818792, 1910488590, 85452501); + int b0 = (2004563877); + bool4x3 r0 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + int4x3 a1 = int4x3(518127023, 1097326500, 1964410699, 1968139888, 1191853379, 662096238, 1140643434, 754434551, 155343473, 995927387, 974873240, 1773400038); + int b1 = (1246249980); + bool4x3 r1 = bool4x3(true, true, false, false, true, true, true, true, true, true, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + int4x3 a2 = int4x3(497436329, 527516420, 1477043363, 1378470734, 96190147, 37188105, 839762283, 781102710, 766321672, 1145011483, 139031840, 127837780); + int b2 = (1825940497); + bool4x3 r2 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 <= b2); + + int4x3 a3 = int4x3(817806943, 649140851, 913173654, 1530989756, 856611228, 479496140, 287809619, 626008542, 2075114788, 269756518, 1123999963, 1061241170); + int b3 = (1248492707); + bool4x3 r3 = bool4x3(true, true, true, false, true, true, true, true, false, true, true, true); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void int4x3_operator_less_equal_scalar_wide() + { + int a0 = (1899193992); + int4x3 b0 = int4x3(915011820, 980913757, 1337699683, 1476321359, 1102143668, 660493983, 184664508, 381579707, 1954892821, 1295090571, 1440368586, 1696003686); + bool4x3 r0 = bool4x3(false, false, false, false, false, false, false, false, true, false, false, false); + TestUtils.AreEqual(r0, a0 <= b0); + + int a1 = (88708652); + int4x3 b1 = int4x3(1332251857, 1310713644, 2112132784, 48951945, 1888568027, 39340955, 1108242207, 260777425, 593122164, 291471959, 253457314, 1264570386); + bool4x3 r1 = bool4x3(true, true, true, false, true, false, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 <= b1); + + int a2 = (699618012); + int4x3 b2 = int4x3(927735863, 2063158939, 932253787, 1168754049, 749328788, 1882694892, 168499987, 378173027, 339963627, 832906712, 559482768, 53067420); + bool4x3 r2 = bool4x3(true, true, true, true, true, true, false, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + int a3 = (1895722478); + int4x3 b3 = int4x3(809981860, 591790551, 1680760399, 653274934, 1664284538, 1283249545, 767500110, 1334099884, 1271622829, 1270706578, 56782179, 505839576); + bool4x3 r3 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void int4x3_operator_greater_equal_wide_wide() + { + int4x3 a0 = int4x3(8538378, 2131749726, 265427108, 523609761, 994991818, 839709564, 101288202, 1886280970, 2032074826, 631221455, 1456286159, 961342752); + int4x3 b0 = int4x3(903145828, 1697992986, 1432491982, 169789504, 1059357300, 1744255222, 1606584463, 1905414425, 1448794969, 136181998, 1678754836, 2069656857); + bool4x3 r0 = bool4x3(false, true, false, true, false, false, false, false, true, true, false, false); + TestUtils.AreEqual(r0, a0 >= b0); + + int4x3 a1 = int4x3(424526026, 788481984, 1662488497, 870326690, 708712581, 1260182701, 1165630721, 138247561, 1108650168, 1933222913, 672493999, 1541402159); + int4x3 b1 = int4x3(398982689, 243317404, 740939613, 1894753119, 301760792, 1260647988, 3608523, 52576030, 903420465, 1648820371, 627296845, 1679808907); + bool4x3 r1 = bool4x3(true, true, true, false, true, false, true, true, true, true, true, false); + TestUtils.AreEqual(r1, a1 >= b1); + + int4x3 a2 = int4x3(1921596027, 1557351956, 147242547, 892772168, 2089286723, 1273466960, 644009998, 654784654, 189030610, 1035542641, 346401762, 739783704); + int4x3 b2 = int4x3(1719102039, 1718081638, 655586949, 477267189, 62092869, 2013928066, 280292357, 254052205, 1092440092, 1947011057, 625632982, 2028466303); + bool4x3 r2 = bool4x3(true, false, false, true, true, false, true, true, false, false, false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + int4x3 a3 = int4x3(1310547408, 1175015477, 1893015570, 1397162858, 1005064177, 469205024, 1331071304, 1747510572, 1556472271, 1318844912, 877625210, 1556049679); + int4x3 b3 = int4x3(578645425, 552865694, 1460006028, 1944712828, 1256156724, 2090870105, 1299728699, 53125632, 782915512, 1103537852, 271803142, 828357811); + bool4x3 r3 = bool4x3(true, true, true, false, false, false, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void int4x3_operator_greater_equal_wide_scalar() + { + int4x3 a0 = int4x3(2049236663, 182691143, 634973382, 1197012109, 439837565, 1367606469, 1108037359, 351147187, 1898505669, 411667685, 1998610091, 4652390); + int b0 = (1061998015); + bool4x3 r0 = bool4x3(true, false, false, true, false, true, true, false, true, false, true, false); + TestUtils.AreEqual(r0, a0 >= b0); + + int4x3 a1 = int4x3(996159180, 727766399, 96217144, 814085575, 1525995206, 1293933760, 1732973229, 1473283041, 899444524, 1023753195, 1373738074, 518164359); + int b1 = (2111455181); + bool4x3 r1 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + int4x3 a2 = int4x3(717850464, 1826820341, 527594558, 1816542874, 839185150, 1143596061, 1819554651, 160724539, 993212636, 878086499, 363122662, 1989978759); + int b2 = (1765188600); + bool4x3 r2 = bool4x3(false, true, false, true, false, false, true, false, false, false, false, true); + TestUtils.AreEqual(r2, a2 >= b2); + + int4x3 a3 = int4x3(2145562949, 122055824, 1432184946, 690328424, 638547285, 403700518, 569358695, 1988815901, 933324785, 1709851817, 1451640349, 1782506169); + int b3 = (491416140); + bool4x3 r3 = bool4x3(true, false, true, true, true, false, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void int4x3_operator_greater_equal_scalar_wide() + { + int a0 = (1859811087); + int4x3 b0 = int4x3(1070365918, 1783869452, 830091760, 377157428, 327199016, 90384229, 1154649706, 376758501, 1079802834, 2054742898, 1328349472, 434061447); + bool4x3 r0 = bool4x3(true, true, true, true, true, true, true, true, true, false, true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + int a1 = (951207723); + int4x3 b1 = int4x3(598695892, 975131651, 1714007943, 177416473, 1267232721, 31082860, 216791741, 119054289, 1905107583, 89559116, 55041824, 691334141); + bool4x3 r1 = bool4x3(true, false, false, true, false, true, true, true, false, true, true, true); + TestUtils.AreEqual(r1, a1 >= b1); + + int a2 = (462326883); + int4x3 b2 = int4x3(1658303669, 914628512, 1134364322, 1677134711, 1955614770, 2067009301, 1454405405, 299467282, 1584922149, 561776357, 564147844, 398216936); + bool4x3 r2 = bool4x3(false, false, false, false, false, false, false, true, false, false, false, true); + TestUtils.AreEqual(r2, a2 >= b2); + + int a3 = (1478439642); + int4x3 b3 = int4x3(958973988, 725612832, 1586062302, 1992817431, 732550238, 1151725147, 11183347, 643483664, 1846311608, 999376922, 1029876878, 1092702918); + bool4x3 r3 = bool4x3(true, true, false, false, true, true, true, true, false, true, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void int4x3_operator_add_wide_wide() + { + int4x3 a0 = int4x3(2135171378, 21433296, 1954723494, 683604307, 1054212315, 1762680995, 1963655852, 1257853062, 2043493600, 976898058, 1915056423, 121374462); + int4x3 b0 = int4x3(1013431952, 366718162, 359290756, 1393163294, 1962236872, 1263270041, 1862666629, 1077447887, 821693806, 487316539, 350922520, 1583012528); + int4x3 r0 = int4x3(-1146363966, 388151458, -1980953046, 2076767601, -1278518109, -1269016260, -468644815, -1959666347, -1429779890, 1464214597, -2028988353, 1704386990); + TestUtils.AreEqual(r0, a0 + b0); + + int4x3 a1 = int4x3(1218855698, 700538222, 1702057277, 1788251699, 1534939160, 398651016, 1674272498, 374510467, 824322986, 1217622199, 1122376670, 642613771); + int4x3 b1 = int4x3(1951595076, 1024851344, 874302782, 1383969588, 1767968088, 900721406, 1659790033, 1792273749, 443844328, 633981449, 2010244807, 335566991); + int4x3 r1 = int4x3(-1124516522, 1725389566, -1718607237, -1122746009, -992060048, 1299372422, -960904765, -2128183080, 1268167314, 1851603648, -1162345819, 978180762); + TestUtils.AreEqual(r1, a1 + b1); + + int4x3 a2 = int4x3(1097903998, 359042741, 929182687, 1713065399, 892057490, 1295346111, 1806236181, 1838589664, 173985173, 1875814528, 1464015613, 1550659036); + int4x3 b2 = int4x3(521931102, 544297835, 1681549647, 1784248858, 585904415, 3128418, 1806236610, 179909533, 378711407, 195687764, 357131656, 383703567); + int4x3 r2 = int4x3(1619835100, 903340576, -1684234962, -797653039, 1477961905, 1298474529, -682494505, 2018499197, 552696580, 2071502292, 1821147269, 1934362603); + TestUtils.AreEqual(r2, a2 + b2); + + int4x3 a3 = int4x3(447183339, 1810477200, 1280783968, 460635858, 1308981305, 2074430993, 515260041, 454786901, 54902689, 8663916, 364443922, 2133521215); + int4x3 b3 = int4x3(1332107956, 1471212095, 1634876660, 1356094538, 364971231, 1180126175, 1243953864, 2000873160, 761885805, 1088368083, 371382049, 1165570023); + int4x3 r3 = int4x3(1779291295, -1013278001, -1379306668, 1816730396, 1673952536, -1040410128, 1759213905, -1839307235, 816788494, 1097031999, 735825971, -995876058); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void int4x3_operator_add_wide_scalar() + { + int4x3 a0 = int4x3(665815972, 1783729250, 1591678394, 1284528538, 977850224, 71069732, 1138577680, 1200356017, 565982008, 1246759684, 1088001167, 57252642); + int b0 = (1334043849); + int4x3 r0 = int4x3(1999859821, -1177194197, -1369245053, -1676394909, -1983073223, 1405113581, -1822345767, -1760567430, 1900025857, -1714163763, -1872922280, 1391296491); + TestUtils.AreEqual(r0, a0 + b0); + + int4x3 a1 = int4x3(678921480, 512157429, 1470648741, 1490096953, 1467033531, 182608093, 1707296407, 1703724354, 1333833947, 653973063, 1139546735, 1834005844); + int b1 = (625943813); + int4x3 r1 = int4x3(1304865293, 1138101242, 2096592554, 2116040766, 2092977344, 808551906, -1961727076, -1965299129, 1959777760, 1279916876, 1765490548, -1835017639); + TestUtils.AreEqual(r1, a1 + b1); + + int4x3 a2 = int4x3(184572739, 1858520040, 97099208, 421437295, 1251829854, 166844260, 1568146789, 82548613, 533562157, 1464065228, 716600557, 831997894); + int b2 = (1980578280); + int4x3 r2 = int4x3(-2129816277, -455868976, 2077677488, -1892951721, -1062559162, 2147422540, -746242227, 2063126893, -1780826859, -850323788, -1597788459, -1482391122); + TestUtils.AreEqual(r2, a2 + b2); + + int4x3 a3 = int4x3(861575416, 1590793088, 240051362, 656307111, 1116911778, 1508531454, 1488841996, 651080626, 850104335, 697550029, 1501177275, 308656842); + int b3 = (1614335536); + int4x3 r3 = int4x3(-1819056344, -1089838672, 1854386898, -2024324649, -1563719982, -1172100306, -1191789764, -2029551134, -1830527425, -1983081731, -1179454485, 1922992378); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void int4x3_operator_add_scalar_wide() + { + int a0 = (359966320); + int4x3 b0 = int4x3(2146146202, 767103309, 851002415, 311531406, 1491262941, 1016891373, 1954228994, 1671335850, 727870747, 551151834, 1390261152, 1699060326); + int4x3 r0 = int4x3(-1788854774, 1127069629, 1210968735, 671497726, 1851229261, 1376857693, -1980771982, 2031302170, 1087837067, 911118154, 1750227472, 2059026646); + TestUtils.AreEqual(r0, a0 + b0); + + int a1 = (115021619); + int4x3 b1 = int4x3(1964440175, 440700758, 1556692550, 185414255, 933106731, 1217866784, 729761881, 1742597318, 1090109152, 1467373815, 1066072609, 138237856); + int4x3 r1 = int4x3(2079461794, 555722377, 1671714169, 300435874, 1048128350, 1332888403, 844783500, 1857618937, 1205130771, 1582395434, 1181094228, 253259475); + TestUtils.AreEqual(r1, a1 + b1); + + int a2 = (634834665); + int4x3 b2 = int4x3(993603553, 347587889, 2050191349, 670698672, 1658205080, 1874808705, 2082982954, 869839589, 118460267, 2126166073, 1826004041, 1976984739); + int4x3 r2 = int4x3(1628438218, 982422554, -1609941282, 1305533337, -2001927551, -1785323926, -1577149677, 1504674254, 753294932, -1533966558, -1834128590, -1683147892); + TestUtils.AreEqual(r2, a2 + b2); + + int a3 = (1612682951); + int4x3 b3 = int4x3(1509218893, 283188530, 175981795, 290469072, 90401332, 92990995, 1697612984, 10695923, 584353656, 1985077669, 261483046, 1433592717); + int4x3 r3 = int4x3(-1173065452, 1895871481, 1788664746, 1903152023, 1703084283, 1705673946, -984671361, 1623378874, -2097930689, -697206676, 1874165997, -1248691628); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void int4x3_operator_sub_wide_wide() + { + int4x3 a0 = int4x3(1410318491, 1097280168, 1827039044, 28881338, 328720965, 875487868, 212936325, 231977215, 1740021315, 2011295463, 48079003, 591379285); + int4x3 b0 = int4x3(1315897366, 799052018, 1580289673, 1094686261, 1954325726, 1197734816, 229886366, 915679176, 1746884850, 918743925, 1007797419, 257421324); + int4x3 r0 = int4x3(94421125, 298228150, 246749371, -1065804923, -1625604761, -322246948, -16950041, -683701961, -6863535, 1092551538, -959718416, 333957961); + TestUtils.AreEqual(r0, a0 - b0); + + int4x3 a1 = int4x3(1125909359, 1842588095, 848561896, 614448464, 2067598029, 1618238416, 318516219, 1090119767, 1991095823, 949592162, 1951912339, 1457818751); + int4x3 b1 = int4x3(287249342, 1617287463, 1653916102, 123586847, 502107404, 672875302, 1256481116, 1975569142, 1794443030, 1327558915, 330955394, 1596041731); + int4x3 r1 = int4x3(838660017, 225300632, -805354206, 490861617, 1565490625, 945363114, -937964897, -885449375, 196652793, -377966753, 1620956945, -138222980); + TestUtils.AreEqual(r1, a1 - b1); + + int4x3 a2 = int4x3(1642553126, 2114366549, 1420516260, 596841760, 724518081, 1820626306, 1885185225, 246124365, 1339877262, 1277620434, 759131597, 597162957); + int4x3 b2 = int4x3(1069074732, 1120817099, 2076417364, 402521072, 839858844, 1539789702, 559077522, 822288510, 751901021, 1858312568, 1706585560, 483540199); + int4x3 r2 = int4x3(573478394, 993549450, -655901104, 194320688, -115340763, 280836604, 1326107703, -576164145, 587976241, -580692134, -947453963, 113622758); + TestUtils.AreEqual(r2, a2 - b2); + + int4x3 a3 = int4x3(656765083, 1075131749, 58205257, 452992632, 976914238, 2122217984, 1687033200, 850554234, 2052749291, 2095840868, 1583338457, 90383917); + int4x3 b3 = int4x3(35726321, 401119620, 1411304017, 794953965, 246546364, 1926970811, 1641115012, 2138664312, 1215717344, 1626141022, 1697813712, 1432018301); + int4x3 r3 = int4x3(621038762, 674012129, -1353098760, -341961333, 730367874, 195247173, 45918188, -1288110078, 837031947, 469699846, -114475255, -1341634384); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void int4x3_operator_sub_wide_scalar() + { + int4x3 a0 = int4x3(1508669340, 1594795463, 266707545, 643102647, 287705008, 1475644328, 1113286221, 979450511, 2082174113, 1108005498, 304369206, 999244508); + int b0 = (998008471); + int4x3 r0 = int4x3(510660869, 596786992, -731300926, -354905824, -710303463, 477635857, 115277750, -18557960, 1084165642, 109997027, -693639265, 1236037); + TestUtils.AreEqual(r0, a0 - b0); + + int4x3 a1 = int4x3(1806482044, 2101812429, 1482736902, 266654115, 1470212363, 1190349300, 958542155, 1185075537, 1738124835, 499527536, 1612473406, 1696960099); + int b1 = (1994553647); + int4x3 r1 = int4x3(-188071603, 107258782, -511816745, -1727899532, -524341284, -804204347, -1036011492, -809478110, -256428812, -1495026111, -382080241, -297593548); + TestUtils.AreEqual(r1, a1 - b1); + + int4x3 a2 = int4x3(1287292743, 1032360376, 1779621585, 964948785, 1739264125, 94254551, 968533883, 2075770560, 946189008, 1074604044, 1171596880, 1033389665); + int b2 = (1360229454); + int4x3 r2 = int4x3(-72936711, -327869078, 419392131, -395280669, 379034671, -1265974903, -391695571, 715541106, -414040446, -285625410, -188632574, -326839789); + TestUtils.AreEqual(r2, a2 - b2); + + int4x3 a3 = int4x3(1905912138, 372717946, 658343960, 572101777, 361378660, 1043302867, 1535109165, 695707807, 153321516, 1464557635, 308141270, 69622833); + int b3 = (1219683758); + int4x3 r3 = int4x3(686228380, -846965812, -561339798, -647581981, -858305098, -176380891, 315425407, -523975951, -1066362242, 244873877, -911542488, -1150060925); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void int4x3_operator_sub_scalar_wide() + { + int a0 = (893369501); + int4x3 b0 = int4x3(2051906184, 1699714311, 442603706, 1735141684, 274533585, 811580259, 1196354320, 1524097023, 533621527, 2080845793, 143958837, 1620668660); + int4x3 r0 = int4x3(-1158536683, -806344810, 450765795, -841772183, 618835916, 81789242, -302984819, -630727522, 359747974, -1187476292, 749410664, -727299159); + TestUtils.AreEqual(r0, a0 - b0); + + int a1 = (1135989346); + int4x3 b1 = int4x3(1367044745, 554088609, 552670373, 1265516124, 1254902543, 1857695581, 1619865274, 1313559400, 99812999, 843597298, 420111239, 1299949060); + int4x3 r1 = int4x3(-231055399, 581900737, 583318973, -129526778, -118913197, -721706235, -483875928, -177570054, 1036176347, 292392048, 715878107, -163959714); + TestUtils.AreEqual(r1, a1 - b1); + + int a2 = (531009038); + int4x3 b2 = int4x3(1103306550, 104920105, 1137308312, 1207332725, 103438360, 1157123503, 1174401240, 701247193, 1498366995, 467017290, 109208355, 1594646461); + int4x3 r2 = int4x3(-572297512, 426088933, -606299274, -676323687, 427570678, -626114465, -643392202, -170238155, -967357957, 63991748, 421800683, -1063637423); + TestUtils.AreEqual(r2, a2 - b2); + + int a3 = (1252691221); + int4x3 b3 = int4x3(919863765, 2826939, 1969148647, 1576198850, 2075870798, 1610641273, 1783880129, 59074246, 1766624573, 521313783, 1333637752, 509364704); + int4x3 r3 = int4x3(332827456, 1249864282, -716457426, -323507629, -823179577, -357950052, -531188908, 1193616975, -513933352, 731377438, -80946531, 743326517); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void int4x3_operator_mul_wide_wide() + { + int4x3 a0 = int4x3(61417577, 219585476, 1362520891, 1511084277, 1481211272, 58211871, 1459591173, 567624644, 1169935583, 1835691886, 385626539, 85934842); + int4x3 b0 = int4x3(578042444, 1620527213, 200516468, 309339115, 542853019, 299467282, 1479641221, 1428338601, 1497302909, 1596889147, 427413842, 265122693); + int4x3 r0 = int4x3(-1426863828, 1326150260, -990894148, -1322856473, 1973926232, 88546350, -863919463, -582821788, 556671459, 1098186330, 1848083398, -58320414); + TestUtils.AreEqual(r0, a0 * b0); + + int4x3 a1 = int4x3(522856538, 278370196, 289217012, 2083410174, 1293162798, 1939730122, 2075923048, 1116477212, 1686101741, 783310758, 248585944, 1093377716); + int4x3 b1 = int4x3(689376654, 1120457204, 516903000, 873091659, 1353196495, 1384773500, 1596528529, 2122329305, 1033200564, 996795088, 1137754930, 232014195); + int4x3 r1 = int4x3(2005201900, 651971856, -1721160736, -110160278, -119429582, -536965160, -2049587992, -759667012, 1443849636, 550781664, -959017424, -353108260); + TestUtils.AreEqual(r1, a1 * b1); + + int4x3 a2 = int4x3(797038788, 1838048120, 1892922904, 1952024781, 492107602, 1097670675, 2069629919, 20122103, 606926492, 1153788131, 1687394746, 1499899200); + int4x3 b2 = int4x3(1080950243, 1613216909, 463529448, 1781487382, 2101946430, 673144237, 390627073, 964308272, 1332603859, 106394678, 1330334791, 1720890701); + int4x3 r2 = int4x3(-1093604916, 264300824, -121602624, 1825729694, -241519140, -1246587945, -2064143137, -251115184, 1004304020, -330302494, 638638742, 892728384); + TestUtils.AreEqual(r2, a2 * b2); + + int4x3 a3 = int4x3(380825697, 2058271053, 1791586731, 16536749, 1743482585, 323418416, 826338527, 1127652402, 1548655361, 892665898, 498857854, 52699386); + int4x3 b3 = int4x3(1860846228, 1499909622, 1236623401, 1532585255, 46356001, 1355750416, 470193265, 829633350, 158242740, 2121460265, 443332975, 1295474668); + int4x3 r3 = int4x3(-1474954732, 1744222462, -976595869, -1560402085, -1646186503, 1971376896, 936606319, -24990804, -400518220, -1235785030, -276669022, -1790890888); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void int4x3_operator_mul_wide_scalar() + { + int4x3 a0 = int4x3(871746615, 492532311, 570557670, 2142306629, 1610315153, 1526163563, 118471734, 257439514, 364291059, 1186560810, 1584938026, 1357601203); + int b0 = (442064533); + int4x3 r0 = int4x3(338365955, 1081376419, -1729147426, -1015409879, -873485467, -175501241, -838181010, 513646114, 1627104879, 1523063666, 1353478258, -517607633); + TestUtils.AreEqual(r0, a0 * b0); + + int4x3 a1 = int4x3(638897141, 1007838321, 1163240135, 1619806399, 1444659979, 1127580168, 464517916, 1508043166, 745488654, 636691139, 1851670006, 357357967); + int b1 = (268562104); + int4x3 r1 = int4x3(-796565992, -1156956360, -2052521720, 154458952, 643000808, 258008512, 1024230432, 1508298128, 2139080208, -1546303960, -1890763568, -1961996088); + TestUtils.AreEqual(r1, a1 * b1); + + int4x3 a2 = int4x3(1095280227, 945802744, 1464398841, 51061000, 802418971, 407442471, 638315697, 1889264235, 584402164, 1343048690, 2144106255, 1634890111); + int b2 = (702779195); + int4x3 r2 = int4x3(91792849, -586547160, 350441827, 2098992344, -2022201799, -2001834499, -1477874741, -280497239, 1627861052, -99438906, -1544695435, 1566775621); + TestUtils.AreEqual(r2, a2 * b2); + + int4x3 a3 = int4x3(425282134, 676185747, 1562817045, 379402138, 866868743, 624571724, 889442510, 39498317, 219559094, 211033504, 2076045580, 1838674974); + int b3 = (997231492); + int4x3 r3 = int4x3(-452524456, -1002687284, -891995692, -677295768, 1887062172, -1573667024, 1014465592, 910409396, -810418216, -1099618688, 689032752, -1157224072); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void int4x3_operator_mul_scalar_wide() + { + int a0 = (1152242766); + int4x3 b0 = int4x3(1276636134, 2105929407, 499007702, 124002565, 1956335172, 1288034953, 832676555, 337389733, 99268757, 2005055247, 2011389505, 1348110859); + int4x3 r0 = int4x3(-2129504236, 999811634, 1179056436, -801426554, 404105400, 1339492798, -381766182, -1111620026, 2131796326, 1519334034, -952005682, -1420416166); + TestUtils.AreEqual(r0, a0 * b0); + + int a1 = (399689191); + int4x3 b1 = int4x3(2007606374, 2076691289, 1825721194, 769885235, 153314735, 1066325369, 84289667, 984486192, 1325213504, 1643957457, 1576395620, 2095980601); + int4x3 r1 = int4x3(-1958619638, 1053162063, 1757322918, -2082633467, -1631687703, 1080737071, 1177640245, 1336635984, 136489664, -1087658601, -2065423556, -2022903697); + TestUtils.AreEqual(r1, a1 * b1); + + int a2 = (907671947); + int4x3 b2 = int4x3(836919582, 1412159342, 2037926630, 366590562, 493177763, 2058824164, 497936968, 2136548816, 1211907591, 2113626509, 345443734, 353147704); + int4x3 r2 = int4x3(374270282, -1776945478, -912236318, -2095872714, 1098685569, -126450996, 1465269528, 1820252144, 1505328333, 774184079, 299976306, -1454784664); + TestUtils.AreEqual(r2, a2 * b2); + + int a3 = (688487056); + int4x3 b3 = int4x3(2038986981, 1991273614, 393095943, 838257274, 1646548338, 480051387, 1077685034, 421911953, 1757438926, 1584698689, 1237695787, 426426495); + int4x3 r3 = int4x3(1399726800, 1710668768, 1354271216, 1603930272, -936745952, -465795280, 216288160, 872201104, 470175712, 1493036688, 1155786288, 1195363696); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void int4x3_operator_div_wide_wide() + { + int4x3 a0 = int4x3(333171510, 858154903, 1181365836, 671357749, 1090606752, 803759420, 788404166, 296807814, 575260195, 166625280, 1493729000, 1831739736); + int4x3 b0 = int4x3(698897823, 440199998, 655557473, 1658534285, 2127220100, 315653188, 1814290360, 992173243, 914851653, 664340325, 224323977, 246981573); + int4x3 r0 = int4x3(0, 1, 1, 0, 0, 2, 0, 0, 0, 0, 6, 7); + TestUtils.AreEqual(r0, a0 / b0); + + int4x3 a1 = int4x3(200852358, 129983172, 500176108, 472051781, 414699094, 1446535974, 1278480457, 930910505, 263295881, 1626759436, 450830871, 21439121); + int4x3 b1 = int4x3(285573983, 819471609, 2012476015, 1783179572, 223253978, 169515029, 1694929006, 1992168131, 1155972447, 1768506696, 422325410, 1508417406); + int4x3 r1 = int4x3(0, 0, 0, 0, 1, 8, 0, 0, 0, 0, 1, 0); + TestUtils.AreEqual(r1, a1 / b1); + + int4x3 a2 = int4x3(521337599, 127756712, 200601965, 412554396, 1014641734, 239347640, 525574301, 1158358177, 1655168319, 2048437741, 367754386, 1861176433); + int4x3 b2 = int4x3(605462475, 66917170, 2014683461, 108847533, 611173330, 895791853, 1999369787, 1225614384, 1168063495, 565150188, 127292785, 1027814836); + int4x3 r2 = int4x3(0, 1, 0, 3, 1, 0, 0, 0, 1, 3, 2, 1); + TestUtils.AreEqual(r2, a2 / b2); + + int4x3 a3 = int4x3(2131424795, 401044444, 745048188, 1943634349, 264134862, 298134010, 1884719303, 1582577607, 1958183229, 1302356942, 1455581366, 1466593830); + int4x3 b3 = int4x3(321940796, 337756553, 63233040, 1926010595, 769049413, 2042197280, 405134611, 547499280, 1337688441, 667307127, 35118652, 411409741); + int4x3 r3 = int4x3(6, 1, 11, 1, 0, 0, 4, 2, 1, 1, 41, 3); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void int4x3_operator_div_wide_scalar() + { + int4x3 a0 = int4x3(1433072926, 1073958635, 1195142312, 536596719, 1274375693, 464756346, 806462546, 906504670, 1380905136, 25493909, 1196815948, 123300377); + int b0 = (1434025872); + int4x3 r0 = int4x3(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + TestUtils.AreEqual(r0, a0 / b0); + + int4x3 a1 = int4x3(643754735, 2047825037, 458304263, 741331531, 466443901, 2110004616, 1500687214, 1453264263, 1617154145, 2040203220, 2103351724, 485536709); + int b1 = (2084019932); + int4x3 r1 = int4x3(0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0); + TestUtils.AreEqual(r1, a1 / b1); + + int4x3 a2 = int4x3(402141749, 1629069474, 1549487015, 670594363, 2040479674, 155415284, 207130003, 1596922206, 1730223836, 1528374182, 1878500631, 1245757182); + int b2 = (1477264254); + int4x3 r2 = int4x3(0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0); + TestUtils.AreEqual(r2, a2 / b2); + + int4x3 a3 = int4x3(1471308702, 251821475, 1328085649, 1950145317, 794269329, 174603836, 678361822, 1820872200, 1455358409, 778273070, 2067965131, 127176068); + int b3 = (1733304186); + int4x3 r3 = int4x3(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void int4x3_operator_div_scalar_wide() + { + int a0 = (519165704); + int4x3 b0 = int4x3(1295178177, 775214121, 467772046, 1156881598, 310396565, 759759959, 243837702, 1616314235, 1053470225, 1320630160, 378773841, 4223608); + int4x3 r0 = int4x3(0, 0, 1, 0, 1, 0, 2, 0, 0, 0, 1, 122); + TestUtils.AreEqual(r0, a0 / b0); + + int a1 = (1971105754); + int4x3 b1 = int4x3(2054406020, 219939614, 1603672651, 2006134295, 888535397, 1493077923, 615835131, 1045603945, 452709946, 1074919059, 467037221, 1485241506); + int4x3 r1 = int4x3(0, 8, 1, 0, 2, 1, 3, 1, 4, 1, 4, 1); + TestUtils.AreEqual(r1, a1 / b1); + + int a2 = (1775728786); + int4x3 b2 = int4x3(481521341, 68149923, 80867357, 1294049272, 470535313, 1235850199, 631464286, 687722755, 412827650, 1258012095, 1286792622, 1799223034); + int4x3 r2 = int4x3(3, 26, 21, 1, 3, 1, 2, 2, 4, 1, 1, 0); + TestUtils.AreEqual(r2, a2 / b2); + + int a3 = (766890491); + int4x3 b3 = int4x3(2080374598, 711612151, 700420132, 1832408481, 1806438353, 237636410, 562498090, 1695805237, 2075783388, 2094216740, 1612536340, 885282904); + int4x3 r3 = int4x3(0, 1, 1, 0, 0, 3, 1, 0, 0, 0, 0, 0); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void int4x3_operator_mod_wide_wide() + { + int4x3 a0 = int4x3(258342924, 1454754891, 723352342, 1981431473, 531756042, 716993627, 1667903349, 1331097004, 1776856101, 17598216, 1474345080, 1681376293); + int4x3 b0 = int4x3(1990080167, 1197348066, 651970512, 1659454050, 241005212, 1866255454, 1440101415, 595220963, 408818410, 198222574, 549504274, 239973807); + int4x3 r0 = int4x3(258342924, 257406825, 71381830, 321977423, 49745618, 716993627, 227801934, 140655078, 141582461, 17598216, 375336532, 1559644); + TestUtils.AreEqual(r0, a0 % b0); + + int4x3 a1 = int4x3(813624265, 1617478722, 498370451, 780075943, 1754430321, 653235398, 1517128354, 966216200, 590067427, 1283434795, 1910903650, 1125967790); + int4x3 b1 = int4x3(321398087, 658171840, 1511495237, 1048325585, 1126739824, 666641241, 38017598, 418797691, 618700513, 1941062990, 158556432, 1081063558); + int4x3 r1 = int4x3(170828091, 301135042, 498370451, 780075943, 627690497, 653235398, 34442032, 128620818, 590067427, 1283434795, 8226466, 44904232); + TestUtils.AreEqual(r1, a1 % b1); + + int4x3 a2 = int4x3(1180537254, 308567230, 543945394, 483834400, 308703874, 383723801, 1181975437, 1161083599, 1608412916, 111825133, 786866017, 1225576256); + int4x3 b2 = int4x3(427329468, 148111230, 1251162672, 1856322297, 1214781084, 401954255, 1323259633, 1167744452, 1816151689, 541163525, 664455763, 1738838503); + int4x3 r2 = int4x3(325878318, 12344770, 543945394, 483834400, 308703874, 383723801, 1181975437, 1161083599, 1608412916, 111825133, 122410254, 1225576256); + TestUtils.AreEqual(r2, a2 % b2); + + int4x3 a3 = int4x3(1590085857, 1755638794, 1413553126, 476553804, 1342913944, 1625118233, 1202928007, 504380191, 642905424, 357937367, 1801777444, 1384305901); + int4x3 b3 = int4x3(1746284172, 855644567, 1887796950, 655067833, 536415164, 71040983, 631964713, 503267649, 944396748, 302347270, 564261945, 1414291441); + int4x3 r3 = int4x3(1590085857, 44349660, 1413553126, 476553804, 270083616, 62216607, 570963294, 1112542, 642905424, 55590097, 108991609, 1384305901); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void int4x3_operator_mod_wide_scalar() + { + int4x3 a0 = int4x3(560988938, 629524514, 767711194, 434281967, 1399805893, 792916846, 1663690927, 598661916, 1776636144, 1287035793, 1743722161, 475209785); + int b0 = (1156862367); + int4x3 r0 = int4x3(560988938, 629524514, 767711194, 434281967, 242943526, 792916846, 506828560, 598661916, 619773777, 130173426, 586859794, 475209785); + TestUtils.AreEqual(r0, a0 % b0); + + int4x3 a1 = int4x3(327476870, 379853074, 477430114, 858399046, 712734431, 1506629323, 199829950, 362269020, 1986626876, 1351725413, 1549678101, 431765276); + int b1 = (1617696916); + int4x3 r1 = int4x3(327476870, 379853074, 477430114, 858399046, 712734431, 1506629323, 199829950, 362269020, 368929960, 1351725413, 1549678101, 431765276); + TestUtils.AreEqual(r1, a1 % b1); + + int4x3 a2 = int4x3(1315833792, 615834034, 780055604, 104179235, 629966219, 1810536428, 1747026206, 1799535061, 875754431, 2049775667, 303673867, 93301056); + int b2 = (1664893153); + int4x3 r2 = int4x3(1315833792, 615834034, 780055604, 104179235, 629966219, 145643275, 82133053, 134641908, 875754431, 384882514, 303673867, 93301056); + TestUtils.AreEqual(r2, a2 % b2); + + int4x3 a3 = int4x3(1944511005, 1065919801, 1342701312, 1356734788, 1593032231, 475449806, 1983416442, 776300612, 591854273, 2061957684, 1865797266, 1982663429); + int b3 = (2135291183); + int4x3 r3 = int4x3(1944511005, 1065919801, 1342701312, 1356734788, 1593032231, 475449806, 1983416442, 776300612, 591854273, 2061957684, 1865797266, 1982663429); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void int4x3_operator_mod_scalar_wide() + { + int a0 = (933347930); + int4x3 b0 = int4x3(549923387, 243114953, 1884274390, 1428033594, 655531454, 1622674954, 1107563514, 1614111094, 914801920, 1432263179, 564431096, 1967013901); + int4x3 r0 = int4x3(383424543, 204003071, 933347930, 933347930, 277816476, 933347930, 933347930, 933347930, 18546010, 933347930, 368916834, 933347930); + TestUtils.AreEqual(r0, a0 % b0); + + int a1 = (1709750152); + int4x3 b1 = int4x3(1080102613, 13120773, 2042535998, 1505698002, 1640058084, 974167554, 758635306, 1387264978, 611743343, 1139002766, 1913935748, 1086810076); + int4x3 r1 = int4x3(629647539, 4049662, 1709750152, 204052150, 69692068, 735582598, 192479540, 322485174, 486263466, 570747386, 1709750152, 622940076); + TestUtils.AreEqual(r1, a1 % b1); + + int a2 = (991846486); + int4x3 b2 = int4x3(922870408, 35007468, 891877602, 157349181, 83267982, 801093706, 546272767, 1665089132, 1889242068, 1179889796, 1690033703, 1333252321); + int4x3 r2 = int4x3(68976078, 11637382, 99968884, 47751400, 75898684, 190752780, 445573719, 991846486, 991846486, 991846486, 991846486, 991846486); + TestUtils.AreEqual(r2, a2 % b2); + + int a3 = (1960636489); + int4x3 b3 = int4x3(960755248, 698650125, 313994074, 1830992514, 2049496523, 507742240, 739436968, 1012724736, 2089810815, 329356442, 384427687, 713578570); + int4x3 r3 = int4x3(39125993, 563336239, 76672045, 129643975, 1960636489, 437409769, 481762553, 947911753, 1960636489, 313854279, 38498054, 533479349); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void int4x3_operator_plus() + { + int4x3 a0 = int4x3(195392567, 222719748, 1002351013, 1570765263, 109389333, 1515950277, 1689763402, 291471785, 264115671, 1084131995, 195779102, 2131702223); + int4x3 r0 = int4x3(195392567, 222719748, 1002351013, 1570765263, 109389333, 1515950277, 1689763402, 291471785, 264115671, 1084131995, 195779102, 2131702223); + TestUtils.AreEqual(r0, +a0); + + int4x3 a1 = int4x3(715660442, 69731564, 1317851903, 1957501908, 531426536, 2012985092, 1334133318, 1539671418, 935436165, 1575048895, 2119066258, 781435471); + int4x3 r1 = int4x3(715660442, 69731564, 1317851903, 1957501908, 531426536, 2012985092, 1334133318, 1539671418, 935436165, 1575048895, 2119066258, 781435471); + TestUtils.AreEqual(r1, +a1); + + int4x3 a2 = int4x3(1659000230, 1153431944, 1360657696, 578750954, 150348334, 1791553179, 1288641627, 735146513, 328684789, 1370099515, 1575634098, 36481877); + int4x3 r2 = int4x3(1659000230, 1153431944, 1360657696, 578750954, 150348334, 1791553179, 1288641627, 735146513, 328684789, 1370099515, 1575634098, 36481877); + TestUtils.AreEqual(r2, +a2); + + int4x3 a3 = int4x3(1832055170, 1370934466, 1126708142, 511229253, 1297664549, 1444401655, 1292097101, 1377029046, 1680766483, 249526091, 656501406, 195015813); + int4x3 r3 = int4x3(1832055170, 1370934466, 1126708142, 511229253, 1297664549, 1444401655, 1292097101, 1377029046, 1680766483, 249526091, 656501406, 195015813); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void int4x3_operator_neg() + { + int4x3 a0 = int4x3(1385088677, 94114564, 1350664872, 1458616659, 2067164853, 218122493, 958484951, 270553961, 446497525, 270503114, 1928771252, 1427605822); + int4x3 r0 = int4x3(-1385088677, -94114564, -1350664872, -1458616659, -2067164853, -218122493, -958484951, -270553961, -446497525, -270503114, -1928771252, -1427605822); + TestUtils.AreEqual(r0, -a0); + + int4x3 a1 = int4x3(2051940607, 485368391, 908365416, 1742096480, 990033169, 1368056141, 1350976157, 12802586, 1934372287, 576597401, 785136322, 559205611); + int4x3 r1 = int4x3(-2051940607, -485368391, -908365416, -1742096480, -990033169, -1368056141, -1350976157, -12802586, -1934372287, -576597401, -785136322, -559205611); + TestUtils.AreEqual(r1, -a1); + + int4x3 a2 = int4x3(1959833280, 1200036971, 95281343, 1969004480, 1381288239, 252975075, 1961335692, 1607042487, 832886233, 1300359361, 8438338, 431498011); + int4x3 r2 = int4x3(-1959833280, -1200036971, -95281343, -1969004480, -1381288239, -252975075, -1961335692, -1607042487, -832886233, -1300359361, -8438338, -431498011); + TestUtils.AreEqual(r2, -a2); + + int4x3 a3 = int4x3(1534415387, 866625695, 2105773520, 1249998702, 1704935592, 59004141, 257619538, 392825753, 1868257049, 1472660509, 928823577, 2138036799); + int4x3 r3 = int4x3(-1534415387, -866625695, -2105773520, -1249998702, -1704935592, -59004141, -257619538, -392825753, -1868257049, -1472660509, -928823577, -2138036799); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void int4x3_operator_prefix_inc() + { + int4x3 a0 = int4x3(780471723, 954741756, 272723451, 2142862245, 606294309, 1514814550, 250124151, 444189162, 1833356994, 1915989169, 1348278302, 129540735); + int4x3 r0 = int4x3(780471724, 954741757, 272723452, 2142862246, 606294310, 1514814551, 250124152, 444189163, 1833356995, 1915989170, 1348278303, 129540736); + TestUtils.AreEqual(r0, ++a0); + + int4x3 a1 = int4x3(1584496757, 986715680, 1701179230, 1397451003, 483952900, 1494652811, 1268688387, 2014528731, 453850931, 1112537171, 621362788, 2063486914); + int4x3 r1 = int4x3(1584496758, 986715681, 1701179231, 1397451004, 483952901, 1494652812, 1268688388, 2014528732, 453850932, 1112537172, 621362789, 2063486915); + TestUtils.AreEqual(r1, ++a1); + + int4x3 a2 = int4x3(1612870531, 1083861484, 1583359796, 82587894, 810087437, 72436569, 1094485773, 912422931, 1011314676, 261771874, 2042016403, 1102472175); + int4x3 r2 = int4x3(1612870532, 1083861485, 1583359797, 82587895, 810087438, 72436570, 1094485774, 912422932, 1011314677, 261771875, 2042016404, 1102472176); + TestUtils.AreEqual(r2, ++a2); + + int4x3 a3 = int4x3(976635804, 607693651, 1788488571, 1912059986, 420746703, 1703260621, 501684292, 1809882373, 1989306461, 786299198, 1729269500, 411043860); + int4x3 r3 = int4x3(976635805, 607693652, 1788488572, 1912059987, 420746704, 1703260622, 501684293, 1809882374, 1989306462, 786299199, 1729269501, 411043861); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void int4x3_operator_postfix_inc() + { + int4x3 a0 = int4x3(241865086, 2145821641, 1596166022, 803592338, 529551271, 1656767229, 903047443, 1213663244, 1425753247, 1384002775, 389844650, 1159795446); + int4x3 r0 = int4x3(241865086, 2145821641, 1596166022, 803592338, 529551271, 1656767229, 903047443, 1213663244, 1425753247, 1384002775, 389844650, 1159795446); + TestUtils.AreEqual(r0, a0++); + + int4x3 a1 = int4x3(1343289659, 947635082, 137930180, 451018043, 1634297552, 2009552507, 1176922170, 388721494, 2381860, 2062858295, 715101397, 1725384327); + int4x3 r1 = int4x3(1343289659, 947635082, 137930180, 451018043, 1634297552, 2009552507, 1176922170, 388721494, 2381860, 2062858295, 715101397, 1725384327); + TestUtils.AreEqual(r1, a1++); + + int4x3 a2 = int4x3(446867079, 1460883320, 1683365096, 1319511974, 1418603655, 1938539756, 592683318, 1576213022, 1150548583, 904484472, 253685095, 70826818); + int4x3 r2 = int4x3(446867079, 1460883320, 1683365096, 1319511974, 1418603655, 1938539756, 592683318, 1576213022, 1150548583, 904484472, 253685095, 70826818); + TestUtils.AreEqual(r2, a2++); + + int4x3 a3 = int4x3(1423673637, 257117856, 964412816, 1148726183, 1820437224, 1087435092, 475319856, 1950385959, 1172607661, 1139700625, 1386106060, 612787013); + int4x3 r3 = int4x3(1423673637, 257117856, 964412816, 1148726183, 1820437224, 1087435092, 475319856, 1950385959, 1172607661, 1139700625, 1386106060, 612787013); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void int4x3_operator_prefix_dec() + { + int4x3 a0 = int4x3(1331961415, 1612382200, 1401591249, 2042075388, 1757136546, 1895858159, 1467742422, 578341664, 1336115745, 2059077641, 1169239112, 1862369220); + int4x3 r0 = int4x3(1331961414, 1612382199, 1401591248, 2042075387, 1757136545, 1895858158, 1467742421, 578341663, 1336115744, 2059077640, 1169239111, 1862369219); + TestUtils.AreEqual(r0, --a0); + + int4x3 a1 = int4x3(312317355, 1595492535, 1426262619, 1426620468, 674685792, 1423852012, 1459529624, 2092317419, 107501474, 1261583506, 512900840, 1496855314); + int4x3 r1 = int4x3(312317354, 1595492534, 1426262618, 1426620467, 674685791, 1423852011, 1459529623, 2092317418, 107501473, 1261583505, 512900839, 1496855313); + TestUtils.AreEqual(r1, --a1); + + int4x3 a2 = int4x3(777588547, 1487639376, 625907330, 1452782388, 804650978, 2076275981, 120447533, 262357170, 1887136873, 412907314, 846648478, 473291493); + int4x3 r2 = int4x3(777588546, 1487639375, 625907329, 1452782387, 804650977, 2076275980, 120447532, 262357169, 1887136872, 412907313, 846648477, 473291492); + TestUtils.AreEqual(r2, --a2); + + int4x3 a3 = int4x3(286048219, 1237897291, 1412498905, 346348942, 953070054, 2028727932, 2006551142, 1345994403, 1356250542, 1202345509, 497982699, 982734742); + int4x3 r3 = int4x3(286048218, 1237897290, 1412498904, 346348941, 953070053, 2028727931, 2006551141, 1345994402, 1356250541, 1202345508, 497982698, 982734741); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void int4x3_operator_postfix_dec() + { + int4x3 a0 = int4x3(1870005937, 1708534798, 704493460, 462940703, 2060593573, 228744869, 940247280, 1818778351, 1015253889, 862428933, 1401191870, 2080259851); + int4x3 r0 = int4x3(1870005937, 1708534798, 704493460, 462940703, 2060593573, 228744869, 940247280, 1818778351, 1015253889, 862428933, 1401191870, 2080259851); + TestUtils.AreEqual(r0, a0--); + + int4x3 a1 = int4x3(653673271, 1928164223, 1760916301, 1174531383, 634036198, 993137684, 1669210509, 874927437, 1393579866, 471308632, 620865961, 220103745); + int4x3 r1 = int4x3(653673271, 1928164223, 1760916301, 1174531383, 634036198, 993137684, 1669210509, 874927437, 1393579866, 471308632, 620865961, 220103745); + TestUtils.AreEqual(r1, a1--); + + int4x3 a2 = int4x3(1407678826, 1426931482, 488775250, 1681733117, 1916879863, 2060905976, 636358505, 1379709480, 451326084, 497925052, 549367303, 925145385); + int4x3 r2 = int4x3(1407678826, 1426931482, 488775250, 1681733117, 1916879863, 2060905976, 636358505, 1379709480, 451326084, 497925052, 549367303, 925145385); + TestUtils.AreEqual(r2, a2--); + + int4x3 a3 = int4x3(55306458, 18471540, 1907671409, 2010375112, 459674494, 1339288497, 548526029, 2061115550, 1130246689, 681734791, 1169678318, 640772261); + int4x3 r3 = int4x3(55306458, 18471540, 1907671409, 2010375112, 459674494, 1339288497, 548526029, 2061115550, 1130246689, 681734791, 1169678318, 640772261); + TestUtils.AreEqual(r3, a3--); + } + + [TestCompiler] + public static void int4x3_operator_bitwise_and_wide_wide() + { + int4x3 a0 = int4x3(1055241304, 859321394, 1088358961, 2090949513, 300561740, 651904515, 1331035868, 2012752753, 1298126656, 53199569, 1752363533, 1303061302); + int4x3 b0 = int4x3(749698416, 748105424, 1842764797, 9990577, 1989102105, 1666634755, 58116798, 868036607, 1420638875, 1308767169, 564040763, 478617502); + int4x3 r0 = int4x3(749024336, 537928720, 1087769137, 8409473, 277479432, 575816707, 55888540, 867707761, 1141707264, 33686209, 538087433, 209912598); + TestUtils.AreEqual(r0, a0 & b0); + + int4x3 a1 = int4x3(1929998247, 1504941434, 470682792, 713577376, 1493231658, 1340884669, 1577921467, 44846626, 1105094388, 1143008413, 333009589, 2116296009); + int4x3 b1 = int4x3(806150474, 674015378, 1505309955, 36064977, 1779639327, 808650076, 1634437037, 1997568501, 1930853951, 1901503461, 1508772523, 2010961769); + int4x3 r1 = int4x3(805855490, 136347666, 403178496, 33571456, 1207967754, 2098204, 1074332585, 33572896, 1091986996, 1073782917, 298320545, 1979979081); + TestUtils.AreEqual(r1, a1 & b1); + + int4x3 a2 = int4x3(2067254825, 121795325, 2122365250, 1088796653, 1594120761, 965590824, 337823363, 1686791432, 1275524729, 173403097, 864715776, 1437598787); + int4x3 b2 = int4x3(1495957269, 1914669725, 1263994006, 491200541, 380703892, 282208487, 1416934135, 942735432, 615839538, 1698880188, 1204102677, 1811173266); + int4x3 r2 = int4x3(1495420417, 33686173, 1241513986, 4530189, 369102864, 276834336, 337674883, 536870920, 67434032, 4246168, 58721280, 1102054402); + TestUtils.AreEqual(r2, a2 & b2); + + int4x3 a3 = int4x3(1375792249, 203672781, 1568515997, 145607913, 837338112, 754244200, 1383514630, 61183374, 690842674, 1362012962, 668846213, 1659745138); + int4x3 b3 = int4x3(203114715, 1968993229, 1549041488, 421225724, 1641463312, 1122209170, 946391298, 229237652, 849684128, 1197217575, 1910121786, 1835643900); + int4x3 r3 = int4x3(18521, 67125453, 1549018896, 134825192, 566264832, 14714880, 274776066, 27361668, 539304992, 1091306274, 567803904, 1617539952); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void int4x3_operator_bitwise_and_wide_scalar() + { + int4x3 a0 = int4x3(1513158868, 284695609, 734595037, 1566510707, 1601252476, 84213838, 314333543, 430856908, 753481263, 327392481, 1619794917, 2143619546); + int b0 = (1173647397); + int4x3 r0 = int4x3(1076916228, 15732769, 29360133, 1163132961, 1164976164, 84148228, 11816997, 27545604, 81801253, 25169953, 1082396709, 1170472960); + TestUtils.AreEqual(r0, a0 & b0); + + int4x3 a1 = int4x3(1873208293, 651482651, 1383096952, 1689107088, 1368301071, 366962092, 1729929586, 989550739, 1914435619, 1592791064, 2047510829, 678485991); + int b1 = (126982769); + int4x3 r1 = int4x3(125862497, 110137873, 34603632, 75602448, 25205249, 93388832, 118521968, 43063313, 34707489, 110104592, 33589281, 1088097); + TestUtils.AreEqual(r1, a1 & b1); + + int4x3 a2 = int4x3(586400261, 309059606, 131945492, 1707451796, 394184188, 1943201012, 558008097, 1070093422, 34324916, 258102213, 1800249857, 922911179); + int b2 = (771972179); + int4x3 r2 = int4x3(570638337, 33767442, 100750352, 604046352, 100811856, 570573904, 537003009, 771773506, 33767440, 235032641, 704708609, 637665347); + TestUtils.AreEqual(r2, a2 & b2); + + int4x3 a3 = int4x3(1719705954, 1162961184, 851638827, 889902874, 1622363409, 785352441, 1741477119, 452211039, 1144654389, 641588835, 1574197624, 568430284); + int b3 = (609219265); + int4x3 r3 = int4x3(604020800, 71393280, 541258241, 604688896, 537083905, 609190593, 609013953, 4468801, 67764737, 604885569, 71585856, 541164224); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void int4x3_operator_bitwise_and_scalar_wide() + { + int a0 = (477163326); + int4x3 b0 = int4x3(110453385, 703240362, 2075630560, 1884904031, 1734899436, 947945203, 1664399051, 458879298, 158491426, 79772356, 2054527944, 202228212); + int4x3 r0 = int4x3(68182536, 140544042, 405834528, 273697310, 73426476, 402681394, 3188234, 407953666, 141583138, 71313924, 410028808, 201376052); + TestUtils.AreEqual(r0, a0 & b0); + + int a1 = (359225061); + int4x3 b1 = int4x3(639811396, 1821945318, 1821303024, 2030124055, 1985961756, 579780373, 2061831301, 1139618293, 1145191868, 1121606282, 1414714065, 688688277); + int4x3 r1 = int4x3(69211716, 67634404, 67649760, 285283333, 340350468, 529925, 274793605, 23662821, 71308452, 4739712, 339759809, 17302661); + TestUtils.AreEqual(r1, a1 & b1); + + int a2 = (1508875606); + int4x3 b2 = int4x3(664318814, 2092766410, 1010043618, 599967779, 47076367, 1325716015, 1119912335, 2083412385, 1805692137, 1689798540, 265665838, 1616867488); + int4x3 r2 = int4x3(25727318, 1487737922, 405014594, 29526018, 13505542, 1225035782, 1086357766, 1479416064, 1235258432, 1084753156, 163945734, 1078923264); + TestUtils.AreEqual(r2, a2 & b2); + + int a3 = (244288538); + int4x3 b3 = int4x3(688929004, 1157047188, 1381359113, 1562107079, 944933664, 1994959125, 1413414673, 1280114143, 1373827711, 1107998701, 890185579, 195053206); + int4x3 r3 = int4x3(134219784, 75956240, 33917960, 202083330, 134383616, 109611024, 68062224, 202148890, 8552474, 34243592, 68092938, 176161810); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void int4x3_operator_bitwise_or_wide_wide() + { + int4x3 a0 = int4x3(1920951869, 1750772852, 1420019191, 732977093, 1169579447, 229437930, 1966721348, 2039812323, 113550869, 1912038362, 1569990624, 1490718227); + int4x3 b0 = int4x3(214585254, 275414367, 858759675, 190211455, 1218691723, 2129565457, 1862809466, 495728846, 868064152, 1756913766, 933656055, 247722084); + int4x3 r0 = int4x3(2130669503, 2021326207, 2008016383, 737572863, 1303895999, 2146367483, 2134507390, 2107455727, 939376541, 2046780414, 2142664695, 1591475831); + TestUtils.AreEqual(r0, a0 | b0); + + int4x3 a1 = int4x3(1686257697, 2137727522, 1569900650, 856504729, 2033376384, 2086259889, 671790684, 1189001916, 1756048437, 417084592, 2024165808, 966008272); + int4x3 b1 = int4x3(1884195075, 1804207631, 1913174711, 1815920856, 1226577606, 1696467642, 186912044, 1778908130, 1461256625, 1142152181, 272117331, 1162254035); + int4x3 r1 = int4x3(1959708963, 2146117167, 2140863231, 2134768089, 2034163398, 2103430843, 724483964, 1860172798, 2142973365, 1558183925, 2025750515, 2111217619); + TestUtils.AreEqual(r1, a1 | b1); + + int4x3 a2 = int4x3(2031026290, 1461019191, 1071959084, 1645847295, 871350674, 736640317, 868515800, 767794452, 362186994, 96189073, 1924033224, 1971421809); + int4x3 b2 = int4x3(870448102, 1845053992, 257334526, 987295814, 1503050768, 1683307763, 1076253109, 1403888383, 561000721, 740143742, 343344681, 2074122472); + int4x3 r2 = int4x3(2079325174, 2147314239, 1073143038, 2061103871, 2080374162, 1878867455, 1944485885, 2146418687, 905361907, 767539967, 1996451561, 2141297401); + TestUtils.AreEqual(r2, a2 | b2); + + int4x3 a3 = int4x3(1826545883, 865329, 516571463, 371039923, 918186803, 1920664988, 452155520, 743961772, 1728213958, 825116968, 1597755374, 910392330); + int4x3 b3 = int4x3(133130232, 108733999, 348566046, 1414140366, 975473487, 699452548, 1158934384, 1776041858, 1098964075, 1316223563, 1653177800, 679795328); + int4x3 r3 = int4x3(1879042043, 109000255, 516879199, 1449107455, 1052699519, 2080099740, 1609826288, 1843396526, 1736638447, 2139093867, 2143027182, 1053294218); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void int4x3_operator_bitwise_or_wide_scalar() + { + int4x3 a0 = int4x3(1295304853, 1307252624, 350194630, 1128063578, 1774824542, 2085245467, 1988423804, 999162350, 2110327307, 1050875188, 341855232, 1317039676); + int b0 = (1305527136); + int4x3 r0 = int4x3(1307888629, 1308350448, 1574947814, 1341973370, 1842999166, 2111492987, 2144662396, 2145305582, 2111425387, 2146686836, 1576062816, 1339092860); + TestUtils.AreEqual(r0, a0 | b0); + + int4x3 a1 = int4x3(228656898, 1536908787, 606786773, 1739461580, 2040936581, 1350320187, 1377874553, 1522262112, 1496806239, 1732466858, 1535976093, 375675620); + int b1 = (41280811); + int4x3 r1 = int4x3(267773739, 1543503355, 645920255, 1744828399, 2079849903, 1383982395, 1383462779, 1526719851, 1534588799, 1735916971, 1543366591, 376831983); + TestUtils.AreEqual(r1, a1 | b1); + + int4x3 a2 = int4x3(1614193383, 697385997, 112556963, 1614163749, 1583289054, 1370656810, 1286074530, 1155438844, 1835671387, 440002979, 1569359727, 5393691); + int b2 = (226059393); + int4x3 r2 = int4x3(1837098727, 771318925, 268271523, 1837068197, 1602189023, 1576793259, 1308619939, 1308622077, 1836810203, 528084387, 1576789999, 226192795); + TestUtils.AreEqual(r2, a2 | b2); + + int4x3 a3 = int4x3(774282482, 212144562, 1525899482, 463019249, 1531812233, 1944160603, 953179348, 1692078056, 1331652826, 183129856, 1305664018, 626899632); + int b3 = (1217128427); + int4x3 r3 = int4x3(1857028091, 1286600699, 1526458363, 1536950267, 1540358123, 2079059963, 2027683839, 1826353131, 1340076027, 1256978411, 1306263547, 1843396603); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void int4x3_operator_bitwise_or_scalar_wide() + { + int a0 = (1768627592); + int4x3 b0 = int4x3(1849658052, 1759912154, 729979455, 975926310, 1987690876, 1809506714, 1160695341, 408963395, 314072711, 1560007537, 1709003416, 977086639); + int4x3 r0 = int4x3(1870634956, 1777286618, 1810603967, 2070642094, 2138824188, 1811676570, 1836048301, 2037079499, 2080071567, 2113658873, 1845452696, 2071936431); + TestUtils.AreEqual(r0, a0 | b0); + + int a1 = (1448375596); + int4x3 b1 = int4x3(1689568808, 595543345, 559778387, 621080913, 438994183, 1742637145, 1219409263, 1602932494, 1204461702, 2111538444, 836730895, 1207638621); + int4x3 r1 = int4x3(1995765548, 2004841789, 2002648959, 2002056573, 1585378607, 2011102589, 1593767279, 1608449838, 1474229678, 2145383724, 2011165999, 1476362109); + TestUtils.AreEqual(r1, a1 | b1); + + int a2 = (802100209); + int4x3 b2 = int4x3(1089077339, 1315030334, 249047666, 1604790897, 1848168086, 347254235, 1777613639, 1876731927, 842785732, 1023558747, 1567635900, 1888818835); + int4x3 r2 = int4x3(1877939195, 1877989375, 803159027, 2146384881, 1877991415, 1073725435, 1878998007, 1876933623, 1073738741, 1070553083, 2147433469, 2145327091); + TestUtils.AreEqual(r2, a2 | b2); + + int a3 = (1681286114); + int4x3 b3 = int4x3(816160472, 669874393, 856364582, 957707703, 533888601, 707380794, 1472392035, 1658477097, 490006292, 1104319323, 1803275943, 1843251082); + int4x3 r3 = int4x3(1958215674, 1744796667, 2000648166, 2100787191, 2146861051, 1849681914, 2012670947, 1727953899, 2100750326, 1710683131, 1870655463, 1845487594); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void int4x3_operator_bitwise_xor_wide_wide() + { + int4x3 a0 = int4x3(1843655608, 362425681, 640805534, 1342040268, 945678755, 980321850, 390165019, 1682422658, 303897251, 230477768, 1103646442, 1503102919); + int4x3 b0 = int4x3(1422803441, 1234691140, 119589253, 1101464929, 121896337, 1880109018, 1000210266, 1718938232, 464406940, 884337881, 34199854, 1430659227); + int4x3 r0 = int4x3(959296073, 1544407317, 554771227, 240840109, 1058935858, 1249815008, 752651585, 36917754, 162747199, 956900113, 1136760772, 215066460); + TestUtils.AreEqual(r0, a0 ^ b0); + + int4x3 a1 = int4x3(26631152, 1016475570, 1862440929, 379588576, 1943580404, 691527166, 723280696, 497086939, 1640104913, 893178410, 1596765788, 664096470); + int4x3 b1 = int4x3(126415540, 1069919967, 1810763253, 2082802224, 941097951, 27782297, 156353074, 607061607, 470737131, 1151564598, 8268481, 434405645); + int4x3 r1 = int4x3(102672708, 55804269, 82614804, 1787102672, 1270918443, 680538471, 575512842, 965736380, 2110579514, 1906288924, 1599249565, 1047646171); + TestUtils.AreEqual(r1, a1 ^ b1); + + int4x3 a2 = int4x3(2043360590, 799560121, 287637604, 696169196, 2067184169, 1208059988, 1250597330, 1386507647, 1889791408, 2084012261, 308683100, 995657536); + int4x3 b2 = int4x3(519003095, 1880915120, 608970922, 1809455754, 1079250101, 514389994, 272120301, 1282399149, 1045003273, 1596550715, 1654640361, 147544177); + int4x3 r2 = int4x3(1730440857, 1605643529, 896084174, 1118087270, 996325020, 1453948862, 1521655871, 516667090, 1323995577, 589229790, 1895428021, 865328945); + TestUtils.AreEqual(r2, a2 ^ b2); + + int4x3 a3 = int4x3(2114803648, 1391716615, 1288505091, 1981377086, 1609802717, 1174043024, 1011203132, 1795164620, 244928755, 108081775, 1095776733, 1503947924); + int4x3 b3 = int4x3(1770899808, 632909311, 351538321, 18362671, 582069925, 1343437834, 646157103, 1334609482, 1029555059, 1791514242, 2130180592, 1367984612); + int4x3 r3 = int4x3(394305184, 2001372408, 1480133522, 1996577553, 2101480824, 367609242, 449195795, 613191558, 868520832, 1824089325, 1067958317, 137209200); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void int4x3_operator_bitwise_xor_wide_scalar() + { + int4x3 a0 = int4x3(169345668, 176087064, 2084362901, 1663924004, 193851255, 517476661, 905336222, 863800783, 365003873, 835837496, 954341348, 1464576786); + int b0 = (354464228); + int4x3 r0 = int4x3(523809632, 526275068, 1763470193, 1980614336, 514678419, 200843473, 550954106, 643578923, 14759301, 619802588, 767731200, 1114315510); + TestUtils.AreEqual(r0, a0 ^ b0); + + int4x3 a1 = int4x3(625604047, 2003392824, 1481813598, 1077374714, 1043379893, 1991576049, 781860967, 60088394, 1196907956, 858716109, 858484213, 178843494); + int b1 = (1700827127); + int4x3 r1 = int4x3(1076460088, 302634703, 1026695593, 626516237, 1531984194, 332760582, 1274728336, 1727295421, 574083651, 1447983162, 1447813634, 1875402897); + TestUtils.AreEqual(r1, a1 ^ b1); + + int4x3 a2 = int4x3(1223183458, 1771693181, 1206307664, 2037729583, 1324393116, 497725784, 1367278685, 962962860, 906632547, 1570278596, 1744797352, 574677361); + int b2 = (866652388); + int4x3 r2 = int4x3(2067815558, 1513223321, 1951325108, 1256020427, 2102964856, 771924412, 1658262713, 181253448, 94506375, 1848679456, 1415016012, 300478869); + TestUtils.AreEqual(r2, a2 ^ b2); + + int4x3 a3 = int4x3(1363709514, 801937870, 1010182360, 1851940033, 346084804, 1153678862, 443991213, 53881334, 2016754499, 1219039118, 98879165, 1431003548); + int b3 = (1256194849); + int4x3 r3 = int4x3(464031083, 1697422063, 1993747449, 612524000, 1581307621, 237223215, 1352058764, 1238772439, 852834402, 38341807, 1325712796, 531325629); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void int4x3_operator_bitwise_xor_scalar_wide() + { + int a0 = (1361775641); + int4x3 b0 = int4x3(1452773578, 459050892, 1986218254, 1689037698, 999278344, 1229114508, 1087843538, 733699740, 106187872, 1533632738, 1107817672, 492506236); + int4x3 r0 = int4x3(129801427, 1249346453, 659047703, 898082715, 1789184785, 409583765, 301736139, 2056278661, 1467957369, 172125435, 321714385, 1282408549); + TestUtils.AreEqual(r0, a0 ^ b0); + + int a1 = (597602329); + int4x3 b1 = int4x3(1439603382, 1001169118, 1231718216, 1693179077, 1050897427, 1796435561, 1100532547, 2106589181, 79691722, 851486414, 381749210, 1743618507); + int4x3 r1 = int4x3(1984965295, 405934279, 1794389841, 1198877916, 490593290, 1217257072, 1644591962, 1578192868, 656494547, 291378903, 895465411, 1148400082); + TestUtils.AreEqual(r1, a1 ^ b1); + + int a2 = (2038827673); + int4x3 b2 = int4x3(1680906962, 161437943, 171927307, 277703584, 1344718195, 1634011177, 28540247, 1205447252, 150341716, 899457210, 1927941858, 1213321665); + int4x3 r2 = int4x3(498503755, 1880707694, 1941532050, 1762353465, 698404842, 417530544, 2016769998, 1046454477, 1903166157, 1276815907, 191628411, 836229976); + TestUtils.AreEqual(r2, a2 ^ b2); + + int a3 = (1943899052); + int4x3 b3 = int4x3(1166699955, 244059986, 698605361, 770240668, 1451322609, 409403288, 227252138, 455879262, 1859170556, 2135312326, 436746325, 843204844); + int4x3 r3 = int4x3(911730207, 2102494462, 1518228637, 1580563248, 626845533, 1807447092, 2119572486, 1760666098, 487406416, 211537002, 1775612921, 1100989248); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void int4x3_operator_left_shift() + { + int4x3 a0 = int4x3(1129100049, 829482269, 1571297368, 443753193, 1872142968, 249554593, 892627436, 980302862, 62369727, 849916599, 1271350845, 108441902); + int b0 = (218351941); + int4x3 r0 = int4x3(1771463200, 773628832, -1258091776, 1315200288, -220967168, -604187616, -1500693120, 1304920512, 1995831264, 1427527392, 2028521376, -824826432); + TestUtils.AreEqual(r0, a0 << b0); + + int4x3 a1 = int4x3(1959056531, 1451674188, 2082026915, 1149883636, 1380536034, 186532735, 1487486874, 1498738574, 752067504, 1647167336, 772453640, 456967739); + int b1 = (1779118882); + int4x3 r1 = int4x3(-753708468, 1511729456, -261826932, 304567248, 1227176840, 746130940, 1654980200, 1699987000, -1286697280, -2001265248, -1205152736, 1827870956); + TestUtils.AreEqual(r1, a1 << b1); + + int4x3 a2 = int4x3(947384545, 1315516161, 640579158, 56630178, 1650899378, 2142944517, 565484033, 965161323, 1634169280, 1821547426, 1959741996, 1189216014); + int b2 = (1463252873); + int4x3 r2 = int4x3(-270417408, -765591040, 1559014400, -1070119936, -848075776, 1970932224, 1765016064, 241358336, -823951360, 624378880, -1634445312, -1006756864); + TestUtils.AreEqual(r2, a2 << b2); + + int4x3 a3 = int4x3(2088913234, 1765476869, 1716088059, 2042799042, 1560870407, 1332136179, 1595140080, 1067324801, 948699739, 1516035622, 1153563832, 1430593538); + int b3 = (331636352); + int4x3 r3 = int4x3(2088913234, 1765476869, 1716088059, 2042799042, 1560870407, 1332136179, 1595140080, 1067324801, 948699739, 1516035622, 1153563832, 1430593538); + TestUtils.AreEqual(r3, a3 << b3); + } + + [TestCompiler] + public static void int4x3_operator_right_shift() + { + int4x3 a0 = int4x3(809126085, 908563670, 763568837, 1986717290, 1174507510, 646821842, 1242726074, 390811632, 1521420393, 1923166649, 102096936, 400863878); + int b0 = (994800051); + int4x3 r0 = int4x3(1543, 1732, 1456, 3789, 2240, 1233, 2370, 745, 2901, 3668, 194, 764); + TestUtils.AreEqual(r0, a0 >> b0); + + int4x3 a1 = int4x3(667378673, 307750782, 479442287, 2014389412, 1673938174, 1075916177, 1248577253, 848199210, 813936577, 848976170, 500930883, 662405800); + int b1 = (1611921244); + int4x3 r1 = int4x3(2, 1, 1, 7, 6, 4, 4, 3, 3, 3, 1, 2); + TestUtils.AreEqual(r1, a1 >> b1); + + int4x3 a2 = int4x3(126875849, 1199000503, 955487090, 1013356510, 391605984, 185228398, 87452680, 2021602226, 1401766495, 275199908, 664576720, 363706280); + int b2 = (1103917083); + int4x3 r2 = int4x3(0, 8, 7, 7, 2, 1, 0, 15, 10, 2, 4, 2); + TestUtils.AreEqual(r2, a2 >> b2); + + int4x3 a3 = int4x3(1600231415, 1403250657, 1132760506, 388419548, 1563117590, 1786307084, 1386128491, 1614558171, 370772389, 47213745, 1348912303, 1452132416); + int b3 = (19835299); + int4x3 r3 = int4x3(200028926, 175406332, 141595063, 48552443, 195389698, 223288385, 173266061, 201819771, 46346548, 5901718, 168614037, 181516552); + TestUtils.AreEqual(r3, a3 >> b3); + } + + [TestCompiler] + public static void int4x3_operator_bitwise_not() + { + int4x3 a0 = int4x3(111796841, 603562399, 745091931, 853183268, 1110916612, 381888399, 1891338755, 1506860135, 771210628, 787710759, 875964607, 96456785); + int4x3 r0 = int4x3(-111796842, -603562400, -745091932, -853183269, -1110916613, -381888400, -1891338756, -1506860136, -771210629, -787710760, -875964608, -96456786); + TestUtils.AreEqual(r0, ~a0); + + int4x3 a1 = int4x3(916013379, 1172294211, 1020232736, 683852713, 375158799, 881353367, 1218471344, 1174233245, 592898220, 443427914, 1385118179, 215320517); + int4x3 r1 = int4x3(-916013380, -1172294212, -1020232737, -683852714, -375158800, -881353368, -1218471345, -1174233246, -592898221, -443427915, -1385118180, -215320518); + TestUtils.AreEqual(r1, ~a1); + + int4x3 a2 = int4x3(860122767, 1349739899, 686325107, 829984855, 191189901, 319233142, 156019905, 1467719681, 1193642973, 957020051, 610113447, 1906177458); + int4x3 r2 = int4x3(-860122768, -1349739900, -686325108, -829984856, -191189902, -319233143, -156019906, -1467719682, -1193642974, -957020052, -610113448, -1906177459); + TestUtils.AreEqual(r2, ~a2); + + int4x3 a3 = int4x3(1022824453, 1876376887, 479785538, 1454477141, 1062967600, 864049393, 916152339, 1644897753, 1624633488, 210894078, 759733457, 40062168); + int4x3 r3 = int4x3(-1022824454, -1876376888, -479785539, -1454477142, -1062967601, -864049394, -916152340, -1644897754, -1624633489, -210894079, -759733458, -40062169); + TestUtils.AreEqual(r3, ~a3); + } + + [TestCase /* For player builds */] + public static void int4x3_EqualsObjectOverride() + { + TestUtils.IsFalse(new int4x3().Equals((object)new int())); + TestUtils.IsTrue(new int4x3().Equals((object)new int4x3())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestInt4x3.gen.cs.meta b/src/Tests/Tests/Shared/TestInt4x3.gen.cs.meta new file mode 100644 index 00000000..2a973318 --- /dev/null +++ b/src/Tests/Tests/Shared/TestInt4x3.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5ffba8e003136db4abab4542f240e632 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestInt4x4.gen.cs b/src/Tests/Tests/Shared/TestInt4x4.gen.cs new file mode 100644 index 00000000..408529a2 --- /dev/null +++ b/src/Tests/Tests/Shared/TestInt4x4.gen.cs @@ -0,0 +1,1265 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestInt4x4 + { + [TestCompiler] + public static void int4x4_zero() + { + TestUtils.AreEqual(0, int4x4.zero.c0.x); + TestUtils.AreEqual(0, int4x4.zero.c0.y); + TestUtils.AreEqual(0, int4x4.zero.c0.z); + TestUtils.AreEqual(0, int4x4.zero.c0.w); + TestUtils.AreEqual(0, int4x4.zero.c1.x); + TestUtils.AreEqual(0, int4x4.zero.c1.y); + TestUtils.AreEqual(0, int4x4.zero.c1.z); + TestUtils.AreEqual(0, int4x4.zero.c1.w); + TestUtils.AreEqual(0, int4x4.zero.c2.x); + TestUtils.AreEqual(0, int4x4.zero.c2.y); + TestUtils.AreEqual(0, int4x4.zero.c2.z); + TestUtils.AreEqual(0, int4x4.zero.c2.w); + TestUtils.AreEqual(0, int4x4.zero.c3.x); + TestUtils.AreEqual(0, int4x4.zero.c3.y); + TestUtils.AreEqual(0, int4x4.zero.c3.z); + TestUtils.AreEqual(0, int4x4.zero.c3.w); + } + + [TestCompiler] + public static void int4x4_identity() + { + TestUtils.AreEqual(1, int4x4.identity.c0.x); + TestUtils.AreEqual(0, int4x4.identity.c0.y); + TestUtils.AreEqual(0, int4x4.identity.c0.z); + TestUtils.AreEqual(0, int4x4.identity.c0.w); + TestUtils.AreEqual(0, int4x4.identity.c1.x); + TestUtils.AreEqual(1, int4x4.identity.c1.y); + TestUtils.AreEqual(0, int4x4.identity.c1.z); + TestUtils.AreEqual(0, int4x4.identity.c1.w); + TestUtils.AreEqual(0, int4x4.identity.c2.x); + TestUtils.AreEqual(0, int4x4.identity.c2.y); + TestUtils.AreEqual(1, int4x4.identity.c2.z); + TestUtils.AreEqual(0, int4x4.identity.c2.w); + TestUtils.AreEqual(0, int4x4.identity.c3.x); + TestUtils.AreEqual(0, int4x4.identity.c3.y); + TestUtils.AreEqual(0, int4x4.identity.c3.z); + TestUtils.AreEqual(1, int4x4.identity.c3.w); + } + + [TestCompiler] + public static void int4x4_operator_equal_wide_wide() + { + int4x4 a0 = int4x4(2105871082, 35218899, 1550755093, 764676020, 606743782, 1208156098, 1023640014, 1038468316, 1416064367, 727143393, 2061243891, 184669837, 1303661760, 2044073738, 370395888, 1822916805); + int4x4 b0 = int4x4(1477587886, 579629692, 540974792, 208405066, 2063397938, 1060167409, 362592601, 2097545362, 277670088, 426944490, 901076223, 857900673, 1548779757, 325265488, 312658571, 176373760); + bool4x4 r0 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + int4x4 a1 = int4x4(1076983135, 345215866, 833676277, 1987782708, 1481088614, 1364754268, 93639636, 1850596922, 2073471507, 1745989448, 28118669, 1267554232, 1292918049, 1423451579, 644384701, 1985492825); + int4x4 b1 = int4x4(2052378097, 858156597, 982817797, 1252095508, 882634538, 1959142806, 72495800, 1077678183, 1729269763, 1607675346, 1813461519, 1204794859, 1324801873, 1975336, 439410532, 294085211); + bool4x4 r1 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + int4x4 a2 = int4x4(240481133, 2130667921, 17376735, 1263869085, 437371027, 1093339523, 1683805602, 764261037, 1845666482, 399277628, 714152770, 148255091, 784823865, 1712722195, 1706849865, 607710807); + int4x4 b2 = int4x4(1031782338, 1118745564, 180311719, 433246570, 1622531532, 1178609353, 373010678, 1231165960, 966395555, 788609772, 215241459, 1411005263, 1287904654, 1656358051, 1985807372, 1041678082); + bool4x4 r2 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + int4x4 a3 = int4x4(1044625360, 1718661673, 89311526, 1060301448, 465400678, 1170304319, 720121996, 1668472904, 560540836, 303792501, 40132904, 1727416088, 883527247, 333921699, 615073171, 873880352); + int4x4 b3 = int4x4(1070669057, 1209340945, 731851358, 1893159788, 1312742878, 553070784, 88944879, 919907371, 192285619, 1825472793, 1196883053, 25239674, 719662658, 876955728, 1754994681, 599047302); + bool4x4 r3 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void int4x4_operator_equal_wide_scalar() + { + int4x4 a0 = int4x4(437822262, 2020661134, 541786900, 853113810, 23716499, 179951405, 1409026299, 948838849, 953202998, 691955848, 1926262965, 1851546137, 712957637, 2028784869, 1049962241, 1836975611); + int b0 = (1332833578); + bool4x4 r0 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + int4x4 a1 = int4x4(1016802970, 464814777, 1451642042, 289137869, 152339338, 808355440, 660053867, 597354173, 67320270, 151461188, 35153827, 602895443, 186996278, 129611815, 1031574999, 1697392883); + int b1 = (390120467); + bool4x4 r1 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + int4x4 a2 = int4x4(1463742000, 611116281, 594150729, 375387566, 1984352551, 1925707182, 570698441, 1872629381, 1263218472, 315982238, 122473806, 1404530826, 43943273, 1695786992, 2085125114, 432271298); + int b2 = (857785521); + bool4x4 r2 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + int4x4 a3 = int4x4(465353570, 841947061, 2115740248, 148684393, 1180494240, 1212305694, 2029216680, 255759637, 2103879876, 28490217, 1373872472, 345943406, 766206720, 562344033, 894687966, 154153254); + int b3 = (1315431335); + bool4x4 r3 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void int4x4_operator_equal_scalar_wide() + { + int a0 = (542329200); + int4x4 b0 = int4x4(1115584594, 684107773, 1928988941, 890709324, 641152437, 1410341302, 497505660, 1068223109, 2014009435, 213835595, 1592428361, 1819361470, 448650623, 1942175642, 64377057, 1485938610); + bool4x4 r0 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + int a1 = (1146305380); + int4x4 b1 = int4x4(1312317120, 263290348, 812663708, 1585209188, 40646617, 1378718922, 1957797737, 873652576, 1780082094, 1513270921, 2095980581, 1413074719, 1387984261, 1547119354, 924385171, 1253636050); + bool4x4 r1 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + int a2 = (1477542688); + int4x4 b2 = int4x4(969120167, 591812191, 856880926, 1114040166, 2107388425, 1368188588, 512677295, 1337925727, 2076181515, 1317314747, 299981273, 601822512, 1079453890, 125277108, 1257151509, 1915342590); + bool4x4 r2 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + int a3 = (1034639325); + int4x4 b3 = int4x4(456730344, 1005099225, 1071115483, 1104603659, 1074937977, 1452872498, 2118674851, 17056748, 1008553990, 2044554028, 549008726, 1802632037, 626025174, 814199888, 668043190, 565725420); + bool4x4 r3 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void int4x4_operator_not_equal_wide_wide() + { + int4x4 a0 = int4x4(1977284100, 1293292704, 1547283851, 422428953, 195833190, 1711544892, 5606053, 737069074, 647386678, 13079405, 1413841590, 1076166545, 1211445174, 1289303469, 1436402489, 1129570126); + int4x4 b0 = int4x4(1514195556, 957972049, 507667364, 581861672, 1128094576, 940096636, 57559040, 181752616, 962017320, 1762015406, 1107218953, 2042026522, 836002288, 570272309, 2112081980, 1500634658); + bool4x4 r0 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + int4x4 a1 = int4x4(1566836685, 1343313905, 329259205, 1774944480, 33906739, 2055853627, 2035015372, 1702756001, 1164186087, 329853698, 769052491, 1893312730, 438029011, 1894010522, 1365847542, 1292942830); + int4x4 b1 = int4x4(1787808345, 566425667, 2037529609, 1520589840, 266793699, 538816359, 2075474643, 553571317, 218264354, 654754196, 1392180230, 870065147, 1398749829, 711281563, 1999640291, 231234857); + bool4x4 r1 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + int4x4 a2 = int4x4(2146008097, 1520743598, 861728782, 1999977058, 1334556487, 1728108667, 1198848973, 7011150, 1280729934, 1553569869, 1782228282, 731582167, 2041979262, 128396656, 143519087, 154742298); + int4x4 b2 = int4x4(210910234, 365281355, 170643407, 757340716, 639973212, 1147047891, 537350186, 1283454178, 735732152, 1218138135, 474815930, 174656455, 473248758, 1077993023, 1063662917, 181750095); + bool4x4 r2 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + int4x4 a3 = int4x4(1121334516, 540291909, 554731045, 1839326182, 365770943, 1467681356, 1811555210, 1818699821, 1391738679, 1578035276, 446070422, 596490222, 1626811714, 470785740, 42246751, 613821629); + int4x4 b3 = int4x4(1824618770, 1824105138, 1337474646, 993542680, 1719996629, 129079279, 746264839, 2048162472, 610556344, 630115390, 74804695, 1671192167, 1346087143, 388480024, 921984035, 270893570); + bool4x4 r3 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void int4x4_operator_not_equal_wide_scalar() + { + int4x4 a0 = int4x4(1038269360, 1427812625, 103361237, 1347017023, 1523584313, 150442802, 660334527, 719113717, 262959423, 484398043, 506946952, 226568494, 507918242, 1702162286, 923269270, 166187260); + int b0 = (768873026); + bool4x4 r0 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + int4x4 a1 = int4x4(114581840, 1648095254, 1461803977, 61801615, 1317840133, 2146927809, 1557151164, 1284033253, 1345705546, 1747302566, 611028295, 1368046109, 1848036266, 2025452920, 373992983, 289537519); + int b1 = (1045389187); + bool4x4 r1 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + int4x4 a2 = int4x4(1388743060, 1854553487, 872755032, 2113020512, 1062447442, 632285066, 109864030, 1583997921, 1732461790, 1276630817, 721080697, 922945173, 1528002730, 282331576, 1372281893, 167200566); + int b2 = (146455100); + bool4x4 r2 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + int4x4 a3 = int4x4(1271483982, 1782181919, 659215598, 976467745, 1598516540, 1428368463, 693693720, 62983770, 177878767, 550623883, 49306232, 1498551255, 562406804, 606428770, 132953969, 2084514622); + int b3 = (1769269391); + bool4x4 r3 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void int4x4_operator_not_equal_scalar_wide() + { + int a0 = (1652127596); + int4x4 b0 = int4x4(953791238, 271722683, 1278885987, 735128017, 112416504, 25967222, 1761444475, 1844594536, 1199122922, 634219279, 942501101, 67161343, 969944293, 833229499, 1304301133, 704045745); + bool4x4 r0 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + int a1 = (345012334); + int4x4 b1 = int4x4(1253134152, 325772538, 855127202, 793668881, 1584481616, 1101301152, 276853534, 987168816, 1258105989, 362645228, 293978043, 1772395973, 1692007315, 681268929, 1535518457, 595209334); + bool4x4 r1 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + int a2 = (25745185); + int4x4 b2 = int4x4(1278016813, 2125682481, 2037751005, 1405297618, 1825546885, 1584424742, 1779859088, 1262387250, 936213998, 739749071, 1934808433, 1333711144, 571211509, 445791940, 43428024, 1509344718); + bool4x4 r2 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + int a3 = (1643255886); + int4x4 b3 = int4x4(383699707, 2040544421, 408607994, 858458715, 1516793269, 1317905178, 1002032453, 1895442848, 1001794162, 1810805641, 1467466432, 72198563, 1654599254, 2100433997, 1554466291, 1619435656); + bool4x4 r3 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void int4x4_operator_less_wide_wide() + { + int4x4 a0 = int4x4(1486550609, 1779244308, 1602148045, 1614085440, 1975613414, 942838342, 1092279031, 373677431, 1419098312, 337757077, 1081797900, 1336745069, 840685445, 1220554047, 2013681746, 192965012); + int4x4 b0 = int4x4(97842578, 536551311, 413528975, 1838293684, 1283898480, 1456599961, 1080278602, 529676676, 156584048, 117348799, 246927124, 1916615924, 1731071394, 1328098431, 1014995792, 480319327); + bool4x4 r0 = bool4x4(false, false, false, true, false, true, false, true, false, false, false, true, true, true, false, true); + TestUtils.AreEqual(r0, a0 < b0); + + int4x4 a1 = int4x4(532043965, 1000693402, 927236048, 1215860000, 780607596, 1882056852, 1354146545, 2135295778, 1145973790, 1938006975, 895882838, 2006524299, 908581156, 1843349513, 1340458575, 1972095585); + int4x4 b1 = int4x4(1765937053, 1333997067, 688515308, 1856106947, 1303906227, 646821776, 1169473993, 316770064, 1518155802, 416732703, 529193056, 1239623485, 2010112031, 2018560298, 285987009, 960617622); + bool4x4 r1 = bool4x4(true, true, false, true, true, false, false, false, true, false, false, false, true, true, false, false); + TestUtils.AreEqual(r1, a1 < b1); + + int4x4 a2 = int4x4(1090933468, 924555996, 79585200, 1749924275, 1088207695, 1484224850, 512353919, 562469379, 1743259263, 182124641, 1224472464, 1731920136, 1906896401, 425415911, 992649442, 515648372); + int4x4 b2 = int4x4(462519015, 1473825625, 1187164011, 730583004, 629133777, 1925375320, 689923293, 1818695099, 903783983, 495525944, 1923715956, 2850909, 1908553564, 1064607664, 1344783349, 494620587); + bool4x4 r2 = bool4x4(false, true, true, false, false, true, true, true, false, true, true, false, true, true, true, false); + TestUtils.AreEqual(r2, a2 < b2); + + int4x4 a3 = int4x4(1479294289, 1703371955, 244917997, 237184864, 1915715174, 1476008655, 1192451853, 727269566, 1447642652, 275301035, 103862368, 1883628805, 878082526, 1714412871, 761748100, 1885417209); + int4x4 b3 = int4x4(921439230, 891627530, 661470153, 2106293426, 1207423971, 266749061, 81148979, 218657863, 24654414, 436674592, 1476569641, 1314701159, 921705087, 318515283, 685316611, 1890907993); + bool4x4 r3 = bool4x4(false, false, true, true, false, false, false, false, false, true, true, false, true, false, false, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void int4x4_operator_less_wide_scalar() + { + int4x4 a0 = int4x4(796797557, 670113454, 933579492, 278884514, 318174822, 1117630673, 741886928, 1990922600, 1030849597, 1546212312, 1718582899, 1648393417, 1857132231, 1909506562, 1294006045, 952084157); + int b0 = (746564682); + bool4x4 r0 = bool4x4(false, true, false, true, true, false, true, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 < b0); + + int4x4 a1 = int4x4(1303736668, 979430272, 1368236640, 24980695, 1434668705, 659552739, 1058492383, 165694933, 1204097259, 922212691, 281328069, 24629507, 1386458568, 1325149699, 1498707004, 1650355158); + int b1 = (845460171); + bool4x4 r1 = bool4x4(false, false, false, true, false, true, false, true, false, false, true, true, false, false, false, false); + TestUtils.AreEqual(r1, a1 < b1); + + int4x4 a2 = int4x4(1213017950, 759932777, 1542997846, 1227393490, 1520634374, 1750827258, 1951142425, 1956860037, 681224518, 1889763470, 1915403219, 850845857, 1871934613, 1882514458, 1326783898, 1044736383); + int b2 = (1650457461); + bool4x4 r2 = bool4x4(true, true, true, true, true, false, false, false, true, false, false, true, false, false, true, true); + TestUtils.AreEqual(r2, a2 < b2); + + int4x4 a3 = int4x4(24899250, 1979593332, 1345719300, 771816862, 1459379624, 10560715, 2022570756, 113189581, 1261561210, 195417982, 460558859, 1966293093, 1791874676, 221062613, 219875895, 2145521906); + int b3 = (2096162636); + bool4x4 r3 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void int4x4_operator_less_scalar_wide() + { + int a0 = (186400299); + int4x4 b0 = int4x4(1881344229, 813834467, 1254886626, 1353590345, 1412343685, 1555571443, 1540508298, 1735458634, 135888070, 1643818742, 248291654, 1739560105, 728539891, 480507742, 1696553040, 540223931); + bool4x4 r0 = bool4x4(true, true, true, true, true, true, true, true, false, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 < b0); + + int a1 = (1840493353); + int4x4 b1 = int4x4(146833656, 798115946, 2002002066, 1011261705, 783550942, 1093071215, 598253401, 1432416562, 1863582169, 103622950, 775175960, 116908309, 1213433625, 1428954824, 1760442490, 1208143947); + bool4x4 r1 = bool4x4(false, false, true, false, false, false, false, false, true, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 < b1); + + int a2 = (751820805); + int4x4 b2 = int4x4(1491872302, 560004484, 2065157473, 310839658, 697329242, 898786601, 1448893980, 1204091943, 1933043135, 828031833, 1737703663, 1672512847, 1112905025, 1666248737, 1352503217, 406395888); + bool4x4 r2 = bool4x4(true, false, true, false, false, true, true, true, true, true, true, true, true, true, true, false); + TestUtils.AreEqual(r2, a2 < b2); + + int a3 = (1734008932); + int4x4 b3 = int4x4(1237327481, 1318771944, 791935677, 1322622241, 1097793287, 1868246899, 656633225, 2068657430, 1696245163, 1451948493, 765332338, 1618550325, 1069938092, 214863918, 635332811, 531416158); + bool4x4 r3 = bool4x4(false, false, false, false, false, true, false, true, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void int4x4_operator_greater_wide_wide() + { + int4x4 a0 = int4x4(2087717754, 1725569452, 1298066182, 1693943616, 1319019629, 70674491, 1042499725, 1002821508, 1021857133, 1744374599, 821751047, 467646903, 2029731638, 1377214212, 1207816926, 474621063); + int4x4 b0 = int4x4(85148514, 293632137, 1151128249, 409440398, 1115020183, 1508500597, 1834583302, 1755218534, 1788761753, 1128238489, 834223713, 1578743290, 1647150256, 1756397855, 1131080201, 1208965204); + bool4x4 r0 = bool4x4(true, true, true, true, true, false, false, false, false, true, false, false, true, false, true, false); + TestUtils.AreEqual(r0, a0 > b0); + + int4x4 a1 = int4x4(20781266, 366593779, 2068457387, 10181449, 793634464, 144474612, 99947390, 930377263, 683686232, 742803073, 918292048, 875621429, 1764985258, 411384146, 1921397684, 1349107119); + int4x4 b1 = int4x4(1495161099, 1283714281, 908051907, 412849651, 815822687, 730271942, 40756039, 883326140, 476260632, 1024136446, 1440596667, 1253494041, 146826162, 1798399573, 2085029408, 187939428); + bool4x4 r1 = bool4x4(false, false, true, false, false, false, true, true, true, false, false, false, true, false, false, true); + TestUtils.AreEqual(r1, a1 > b1); + + int4x4 a2 = int4x4(640399120, 1487719331, 1467989523, 1834244794, 1778580304, 334604025, 689749101, 1478795900, 716772993, 1072711623, 388277128, 290673156, 619539670, 1666212670, 496667761, 638935614); + int4x4 b2 = int4x4(1009192934, 1694822273, 1866590874, 113805226, 1331524948, 5928360, 1884858608, 1988975599, 493888072, 731556294, 1597968264, 727668246, 1260583385, 1921631225, 359265523, 856088703); + bool4x4 r2 = bool4x4(false, false, false, true, true, true, false, false, true, true, false, false, false, false, true, false); + TestUtils.AreEqual(r2, a2 > b2); + + int4x4 a3 = int4x4(1614199215, 89872822, 700520355, 1562820264, 789499485, 1393039789, 1105992642, 563744940, 815513909, 1081626580, 1012317785, 1947145947, 718519778, 1075282603, 200378204, 1764621112); + int4x4 b3 = int4x4(2104018831, 1238238103, 1383038637, 964579005, 628997847, 1734250747, 869693069, 2027610297, 569892194, 1427509612, 617550825, 1189914503, 760051085, 207406138, 2060097216, 1419314781); + bool4x4 r3 = bool4x4(false, false, false, true, true, false, true, false, true, false, true, true, false, true, false, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void int4x4_operator_greater_wide_scalar() + { + int4x4 a0 = int4x4(1208626274, 239697208, 1979453345, 1253474001, 1590192876, 1487911635, 1673945595, 1662650098, 222749855, 1433540517, 566635217, 1773305960, 1850273578, 206147145, 325913453, 333381537); + int b0 = (1715176566); + bool4x4 r0 = bool4x4(false, false, true, false, false, false, false, false, false, false, false, true, true, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + int4x4 a1 = int4x4(1905567362, 570397194, 2128431130, 1735325311, 529971908, 1663525234, 1972984241, 1587865063, 488268523, 121921923, 812076921, 181082921, 1281638484, 1818357732, 116518997, 1397728785); + int b1 = (2053577491); + bool4x4 r1 = bool4x4(false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 > b1); + + int4x4 a2 = int4x4(1924199337, 1463993051, 1598027926, 842851852, 160842093, 1226313895, 540338405, 174088887, 1609299242, 425486336, 1462766889, 651513452, 1122649822, 771802057, 839323192, 325778683); + int b2 = (742950077); + bool4x4 r2 = bool4x4(true, true, true, true, false, true, false, false, true, false, true, false, true, true, true, false); + TestUtils.AreEqual(r2, a2 > b2); + + int4x4 a3 = int4x4(406189885, 2101738734, 432896271, 1620784610, 1185204658, 723655621, 6469104, 1813092585, 1101924353, 1365989712, 861868674, 1481567177, 1088595018, 1762666432, 450116220, 375577175); + int b3 = (1676059941); + bool4x4 r3 = bool4x4(false, true, false, false, false, false, false, true, false, false, false, false, false, true, false, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void int4x4_operator_greater_scalar_wide() + { + int a0 = (480938827); + int4x4 b0 = int4x4(1824731899, 921496110, 586859044, 946430596, 1231356727, 1390167458, 1785807092, 28949024, 2037899283, 595656760, 1778095771, 1233500439, 1696302238, 1445965340, 484020151, 1586962841); + bool4x4 r0 = bool4x4(false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + int a1 = (1361740714); + int4x4 b1 = int4x4(265628948, 2003122957, 332267433, 1128353075, 377919478, 982113135, 1117675960, 630865591, 1550679736, 895945757, 287025687, 643452096, 660504007, 613135893, 633307118, 514276792); + bool4x4 r1 = bool4x4(true, false, true, true, true, true, true, true, false, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + int a2 = (1377364317); + int4x4 b2 = int4x4(84491736, 746768197, 1282879723, 589415384, 363082240, 1774333756, 741005890, 413100725, 702141547, 1434366582, 1489794027, 1710601432, 1914069735, 1811684885, 1007116016, 1883396218); + bool4x4 r2 = bool4x4(true, true, true, true, true, false, true, true, true, false, false, false, false, false, true, false); + TestUtils.AreEqual(r2, a2 > b2); + + int a3 = (318035497); + int4x4 b3 = int4x4(25535571, 1971931803, 1966772446, 1500069399, 1446812421, 2086866622, 1616666731, 315565005, 1828160638, 494221701, 1498781405, 1532980575, 1377395276, 2130004514, 1144788653, 719223647); + bool4x4 r3 = bool4x4(true, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void int4x4_operator_less_equal_wide_wide() + { + int4x4 a0 = int4x4(154092149, 1515170149, 1083970332, 785807178, 1401094881, 310537627, 868328962, 1990816725, 2035349541, 457043352, 1123282035, 1001842946, 1387761992, 195272789, 659549000, 888761458); + int4x4 b0 = int4x4(77984380, 1712054191, 1566203809, 254834519, 450519938, 389457083, 1298669505, 207343167, 1214449047, 2059561026, 896534357, 1897470050, 521075677, 1848221945, 374708019, 1573731118); + bool4x4 r0 = bool4x4(false, true, true, false, false, true, true, false, false, true, false, true, false, true, false, true); + TestUtils.AreEqual(r0, a0 <= b0); + + int4x4 a1 = int4x4(283706617, 1790185840, 899029812, 848317418, 1743712447, 1504407474, 1798441490, 1902791952, 606340844, 1994437705, 301831413, 654230470, 1223625081, 324292199, 1370931020, 1742769166); + int4x4 b1 = int4x4(2093466449, 1660210829, 1568778785, 1352157589, 1212771905, 1457525058, 1493446008, 1784768208, 1993422493, 1378671664, 1447376929, 1405041439, 1765183746, 562894655, 1085068880, 1026386862); + bool4x4 r1 = bool4x4(true, false, true, true, false, false, false, false, true, false, true, true, true, true, false, false); + TestUtils.AreEqual(r1, a1 <= b1); + + int4x4 a2 = int4x4(1709242127, 105750466, 1655967312, 1455797002, 366131629, 315848579, 1539610530, 99028560, 765767372, 1241881101, 527753961, 1271899705, 1439235979, 436585748, 1244486586, 2128710216); + int4x4 b2 = int4x4(884290156, 922346160, 330605896, 466570756, 1252369410, 2057993777, 1691801535, 2041799631, 557988228, 813610154, 1657573441, 983813335, 385144401, 1281329713, 285422763, 658643567); + bool4x4 r2 = bool4x4(false, true, false, false, true, true, true, true, false, false, true, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + int4x4 a3 = int4x4(1617486386, 1895766578, 1387695542, 128800896, 537625491, 1012540035, 1131528350, 2012914556, 1666155186, 1944610930, 1990671426, 498632901, 1759874098, 1630593828, 2041503795, 1369567817); + int4x4 b3 = int4x4(478020612, 914151334, 980445792, 275734948, 1527866949, 1196945650, 743720340, 1679307193, 429976215, 812942792, 929159012, 51668686, 1269420778, 1270822911, 174467289, 80708866); + bool4x4 r3 = bool4x4(false, false, false, true, true, true, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void int4x4_operator_less_equal_wide_scalar() + { + int4x4 a0 = int4x4(1479531977, 1427983411, 415250630, 1245345407, 1112546666, 1072990632, 1579912858, 101048307, 1070894375, 509818792, 1910488590, 85452501, 518127023, 1246249980, 1097326500, 1964410699); + int b0 = (2004563877); + bool4x4 r0 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + int4x4 a1 = int4x4(1968139888, 662096238, 1140643434, 754434551, 155343473, 995927387, 974873240, 1773400038, 497436329, 1825940497, 527516420, 1477043363, 1378470734, 96190147, 37188105, 839762283); + int b1 = (1191853379); + bool4x4 r1 = bool4x4(false, true, true, true, true, true, true, false, true, false, true, false, false, true, true, true); + TestUtils.AreEqual(r1, a1 <= b1); + + int4x4 a2 = int4x4(781102710, 1145011483, 139031840, 127837780, 817806943, 1248492707, 649140851, 913173654, 1530989756, 856611228, 479496140, 287809619, 626008542, 2075114788, 269756518, 1123999963); + int b2 = (766321672); + bool4x4 r2 = bool4x4(false, false, true, true, false, false, true, false, false, false, true, true, true, false, true, false); + TestUtils.AreEqual(r2, a2 <= b2); + + int4x4 a3 = int4x4(1061241170, 1419753922, 827050063, 725097426, 1849220404, 432056024, 1587861037, 1619429016, 615110337, 1394533782, 1052396438, 771488591, 1839907288, 413628645, 1873300485, 1393173865); + int b3 = (478230935); + bool4x4 r3 = bool4x4(false, false, false, false, false, true, false, false, false, false, false, false, false, true, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void int4x4_operator_less_equal_scalar_wide() + { + int a0 = (1899193992); + int4x4 b0 = int4x4(915011820, 980913757, 1337699683, 1476321359, 1102143668, 660493983, 184664508, 381579707, 1954892821, 1295090571, 1440368586, 1696003686, 88708652, 1332251857, 1310713644, 2112132784); + bool4x4 r0 = bool4x4(false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, true); + TestUtils.AreEqual(r0, a0 <= b0); + + int a1 = (48951945); + int4x4 b1 = int4x4(1888568027, 39340955, 1108242207, 260777425, 593122164, 291471959, 253457314, 1264570386, 699618012, 927735863, 2063158939, 932253787, 1168754049, 749328788, 1882694892, 168499987); + bool4x4 r1 = bool4x4(true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 <= b1); + + int a2 = (378173027); + int4x4 b2 = int4x4(339963627, 832906712, 559482768, 53067420, 1895722478, 809981860, 591790551, 1680760399, 653274934, 1664284538, 1283249545, 767500110, 1334099884, 1271622829, 1270706578, 56782179); + bool4x4 r2 = bool4x4(false, true, true, false, true, true, true, true, true, true, true, true, true, true, true, false); + TestUtils.AreEqual(r2, a2 <= b2); + + int a3 = (505839576); + int4x4 b3 = int4x4(416548761, 1604253810, 438515054, 1638416567, 321889656, 689441798, 1084242369, 211750973, 402525656, 1880241767, 268989216, 1596809567, 786138772, 545761783, 1705157341, 1527503699); + bool4x4 r3 = bool4x4(false, true, false, true, false, true, true, false, false, true, false, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void int4x4_operator_greater_equal_wide_wide() + { + int4x4 a0 = int4x4(8538378, 2131749726, 265427108, 523609761, 994991818, 839709564, 101288202, 1886280970, 2032074826, 631221455, 1456286159, 961342752, 424526026, 788481984, 1662488497, 870326690); + int4x4 b0 = int4x4(903145828, 1697992986, 1432491982, 169789504, 1059357300, 1744255222, 1606584463, 1905414425, 1448794969, 136181998, 1678754836, 2069656857, 398982689, 243317404, 740939613, 1894753119); + bool4x4 r0 = bool4x4(false, true, false, true, false, false, false, false, true, true, false, false, true, true, true, false); + TestUtils.AreEqual(r0, a0 >= b0); + + int4x4 a1 = int4x4(708712581, 1260182701, 1165630721, 138247561, 1108650168, 1933222913, 672493999, 1541402159, 1921596027, 1557351956, 147242547, 892772168, 2089286723, 1273466960, 644009998, 654784654); + int4x4 b1 = int4x4(301760792, 1260647988, 3608523, 52576030, 903420465, 1648820371, 627296845, 1679808907, 1719102039, 1718081638, 655586949, 477267189, 62092869, 2013928066, 280292357, 254052205); + bool4x4 r1 = bool4x4(true, false, true, true, true, true, true, false, true, false, false, true, true, false, true, true); + TestUtils.AreEqual(r1, a1 >= b1); + + int4x4 a2 = int4x4(189030610, 1035542641, 346401762, 739783704, 1310547408, 1175015477, 1893015570, 1397162858, 1005064177, 469205024, 1331071304, 1747510572, 1556472271, 1318844912, 877625210, 1556049679); + int4x4 b2 = int4x4(1092440092, 1947011057, 625632982, 2028466303, 578645425, 552865694, 1460006028, 1944712828, 1256156724, 2090870105, 1299728699, 53125632, 782915512, 1103537852, 271803142, 828357811); + bool4x4 r2 = bool4x4(false, false, false, false, true, true, true, false, false, false, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 >= b2); + + int4x4 a3 = int4x4(248635811, 1459789761, 1739237851, 1333407145, 979318335, 407534230, 1628055119, 731735266, 812413658, 1008863889, 1958570980, 1070464548, 1492413167, 390538786, 1454271717, 1150841093); + int4x4 b3 = int4x4(1679170708, 1727537554, 1741874749, 1295963045, 1676369300, 1716080769, 339906474, 629280695, 1476237779, 1535336921, 711398196, 1036785558, 982417009, 1710969897, 1783729499, 1038744266); + bool4x4 r3 = bool4x4(false, false, false, true, false, false, true, true, false, false, true, true, true, false, false, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void int4x4_operator_greater_equal_wide_scalar() + { + int4x4 a0 = int4x4(2049236663, 182691143, 634973382, 1197012109, 439837565, 1367606469, 1108037359, 351147187, 1898505669, 411667685, 1998610091, 4652390, 996159180, 2111455181, 727766399, 96217144); + int b0 = (1061998015); + bool4x4 r0 = bool4x4(true, false, false, true, false, true, true, false, true, false, true, false, false, true, false, false); + TestUtils.AreEqual(r0, a0 >= b0); + + int4x4 a1 = int4x4(814085575, 1293933760, 1732973229, 1473283041, 899444524, 1023753195, 1373738074, 518164359, 717850464, 1765188600, 1826820341, 527594558, 1816542874, 839185150, 1143596061, 1819554651); + int b1 = (1525995206); + bool4x4 r1 = bool4x4(false, false, true, false, false, false, false, false, false, true, true, false, true, false, false, true); + TestUtils.AreEqual(r1, a1 >= b1); + + int4x4 a2 = int4x4(160724539, 878086499, 363122662, 1989978759, 2145562949, 491416140, 122055824, 1432184946, 690328424, 638547285, 403700518, 569358695, 1988815901, 933324785, 1709851817, 1451640349); + int b2 = (993212636); + bool4x4 r2 = bool4x4(false, false, false, true, true, false, false, true, false, false, false, false, true, false, true, true); + TestUtils.AreEqual(r2, a2 >= b2); + + int4x4 a3 = int4x4(1782506169, 1298885111, 22631046, 575953622, 162553491, 1306421595, 1408718955, 678847750, 1869470748, 1749901516, 1428700665, 1971036276, 81962795, 1719966182, 855014030, 332581386); + int b3 = (896666795); + bool4x4 r3 = bool4x4(true, true, false, false, false, true, true, false, true, true, true, true, false, true, false, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void int4x4_operator_greater_equal_scalar_wide() + { + int a0 = (1859811087); + int4x4 b0 = int4x4(1070365918, 1783869452, 830091760, 377157428, 327199016, 90384229, 1154649706, 376758501, 1079802834, 2054742898, 1328349472, 434061447, 951207723, 598695892, 975131651, 1714007943); + bool4x4 r0 = bool4x4(true, true, true, true, true, true, true, true, true, false, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + int a1 = (177416473); + int4x4 b1 = int4x4(1267232721, 31082860, 216791741, 119054289, 1905107583, 89559116, 55041824, 691334141, 462326883, 1658303669, 914628512, 1134364322, 1677134711, 1955614770, 2067009301, 1454405405); + bool4x4 r1 = bool4x4(false, true, false, true, false, true, true, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + int a2 = (299467282); + int4x4 b2 = int4x4(1584922149, 561776357, 564147844, 398216936, 1478439642, 958973988, 725612832, 1586062302, 1992817431, 732550238, 1151725147, 11183347, 643483664, 1846311608, 999376922, 1029876878); + bool4x4 r2 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + int a3 = (1092702918); + int4x4 b3 = int4x4(281884284, 1033936590, 1197933362, 1740756798, 1312741982, 1694310336, 775049936, 1833306934, 2012355780, 579564207, 240021194, 1389877826, 1550151770, 99128128, 1408823818, 1127139689); + bool4x4 r3 = bool4x4(true, true, false, false, false, false, true, false, false, true, true, false, false, true, false, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void int4x4_operator_add_wide_wide() + { + int4x4 a0 = int4x4(2135171378, 21433296, 1954723494, 683604307, 1054212315, 1762680995, 1963655852, 1257853062, 2043493600, 976898058, 1915056423, 121374462, 1218855698, 700538222, 1702057277, 1788251699); + int4x4 b0 = int4x4(1013431952, 366718162, 359290756, 1393163294, 1962236872, 1263270041, 1862666629, 1077447887, 821693806, 487316539, 350922520, 1583012528, 1951595076, 1024851344, 874302782, 1383969588); + int4x4 r0 = int4x4(-1146363966, 388151458, -1980953046, 2076767601, -1278518109, -1269016260, -468644815, -1959666347, -1429779890, 1464214597, -2028988353, 1704386990, -1124516522, 1725389566, -1718607237, -1122746009); + TestUtils.AreEqual(r0, a0 + b0); + + int4x4 a1 = int4x4(1534939160, 398651016, 1674272498, 374510467, 824322986, 1217622199, 1122376670, 642613771, 1097903998, 359042741, 929182687, 1713065399, 892057490, 1295346111, 1806236181, 1838589664); + int4x4 b1 = int4x4(1767968088, 900721406, 1659790033, 1792273749, 443844328, 633981449, 2010244807, 335566991, 521931102, 544297835, 1681549647, 1784248858, 585904415, 3128418, 1806236610, 179909533); + int4x4 r1 = int4x4(-992060048, 1299372422, -960904765, -2128183080, 1268167314, 1851603648, -1162345819, 978180762, 1619835100, 903340576, -1684234962, -797653039, 1477961905, 1298474529, -682494505, 2018499197); + TestUtils.AreEqual(r1, a1 + b1); + + int4x4 a2 = int4x4(173985173, 1875814528, 1464015613, 1550659036, 447183339, 1810477200, 1280783968, 460635858, 1308981305, 2074430993, 515260041, 454786901, 54902689, 8663916, 364443922, 2133521215); + int4x4 b2 = int4x4(378711407, 195687764, 357131656, 383703567, 1332107956, 1471212095, 1634876660, 1356094538, 364971231, 1180126175, 1243953864, 2000873160, 761885805, 1088368083, 371382049, 1165570023); + int4x4 r2 = int4x4(552696580, 2071502292, 1821147269, 1934362603, 1779291295, -1013278001, -1379306668, 1816730396, 1673952536, -1040410128, 1759213905, -1839307235, 816788494, 1097031999, 735825971, -995876058); + TestUtils.AreEqual(r2, a2 + b2); + + int4x4 a3 = int4x4(752738311, 459996276, 134430279, 1019035025, 1118755713, 97114496, 2018556094, 503464890, 125268557, 841630760, 1879289264, 1812133139, 2071408153, 140785075, 348467740, 19259645); + int4x4 b3 = int4x4(1037712666, 743665263, 446926007, 740772342, 2122822821, 1744558378, 241853304, 1404664477, 2086735220, 1441264950, 658463489, 1077514956, 2022425015, 702129808, 462290953, 75801290); + int4x4 r3 = int4x4(1790450977, 1203661539, 581356286, 1759807367, -1053388762, 1841672874, -2034557898, 1908129367, -2082963519, -2012071586, -1757214543, -1405319201, -201134128, 842914883, 810758693, 95060935); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void int4x4_operator_add_wide_scalar() + { + int4x4 a0 = int4x4(665815972, 1783729250, 1591678394, 1284528538, 977850224, 71069732, 1138577680, 1200356017, 565982008, 1246759684, 1088001167, 57252642, 678921480, 625943813, 512157429, 1470648741); + int b0 = (1334043849); + int4x4 r0 = int4x4(1999859821, -1177194197, -1369245053, -1676394909, -1983073223, 1405113581, -1822345767, -1760567430, 1900025857, -1714163763, -1872922280, 1391296491, 2012965329, 1959987662, 1846201278, -1490274706); + TestUtils.AreEqual(r0, a0 + b0); + + int4x4 a1 = int4x4(1490096953, 182608093, 1707296407, 1703724354, 1333833947, 653973063, 1139546735, 1834005844, 184572739, 1980578280, 1858520040, 97099208, 421437295, 1251829854, 166844260, 1568146789); + int b1 = (1467033531); + int4x4 r1 = int4x4(-1337836812, 1649641624, -1120637358, -1124209411, -1494099818, 2121006594, -1688387030, -993927921, 1651606270, -847355485, -969413725, 1564132739, 1888470826, -1576103911, 1633877791, -1259786976); + TestUtils.AreEqual(r1, a1 + b1); + + int4x4 a2 = int4x4(82548613, 1464065228, 716600557, 831997894, 861575416, 1614335536, 1590793088, 240051362, 656307111, 1116911778, 1508531454, 1488841996, 651080626, 850104335, 697550029, 1501177275); + int b2 = (533562157); + int4x4 r2 = int4x4(616110770, 1997627385, 1250162714, 1365560051, 1395137573, -2147069603, 2124355245, 773613519, 1189869268, 1650473935, 2042093611, 2022404153, 1184642783, 1383666492, 1231112186, 2034739432); + TestUtils.AreEqual(r2, a2 + b2); + + int4x4 a3 = int4x4(308656842, 1236049353, 1462299846, 1109575265, 209902, 1129756187, 452131659, 1598006341, 793277485, 237975099, 1427541287, 1103256809, 144544713, 2142413477, 921156907, 636589500); + int b3 = (1397806846); + int4x4 r3 = int4x4(1706463688, -1661111097, -1434860604, -1787585185, 1398016748, -1767404263, 1849938505, -1299154109, -2103882965, 1635781945, -1469619163, -1793903641, 1542351559, -754746973, -1976003543, 2034396346); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void int4x4_operator_add_scalar_wide() + { + int a0 = (359966320); + int4x4 b0 = int4x4(2146146202, 767103309, 851002415, 311531406, 1491262941, 1016891373, 1954228994, 1671335850, 727870747, 551151834, 1390261152, 1699060326, 115021619, 1964440175, 440700758, 1556692550); + int4x4 r0 = int4x4(-1788854774, 1127069629, 1210968735, 671497726, 1851229261, 1376857693, -1980771982, 2031302170, 1087837067, 911118154, 1750227472, 2059026646, 474987939, -1970560801, 800667078, 1916658870); + TestUtils.AreEqual(r0, a0 + b0); + + int a1 = (185414255); + int4x4 b1 = int4x4(933106731, 1217866784, 729761881, 1742597318, 1090109152, 1467373815, 1066072609, 138237856, 634834665, 993603553, 347587889, 2050191349, 670698672, 1658205080, 1874808705, 2082982954); + int4x4 r1 = int4x4(1118520986, 1403281039, 915176136, 1928011573, 1275523407, 1652788070, 1251486864, 323652111, 820248920, 1179017808, 533002144, -2059361692, 856112927, 1843619335, 2060222960, -2026570087); + TestUtils.AreEqual(r1, a1 + b1); + + int a2 = (869839589); + int4x4 b2 = int4x4(118460267, 2126166073, 1826004041, 1976984739, 1612682951, 1509218893, 283188530, 175981795, 290469072, 90401332, 92990995, 1697612984, 10695923, 584353656, 1985077669, 261483046); + int4x4 r2 = int4x4(988299856, -1298961634, -1599123666, -1448142968, -1812444756, -1915908814, 1153028119, 1045821384, 1160308661, 960240921, 962830584, -1727514723, 880535512, 1454193245, -1440050038, 1131322635); + TestUtils.AreEqual(r2, a2 + b2); + + int a3 = (1433592717); + int4x4 b3 = int4x4(1587664734, 1494226579, 1815078437, 764852649, 1056037050, 1447213141, 1932413453, 173293550, 856428276, 23287820, 1606641105, 1768628148, 57172075, 1040430401, 1662936094, 1763561019); + int4x4 r3 = int4x4(-1273709845, -1367148000, -1046296142, -2096521930, -1805337529, -1414161438, -928961126, 1606886267, -2004946303, 1456880537, -1254733474, -1092746431, 1490764792, -1820944178, -1198438485, -1097813560); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void int4x4_operator_sub_wide_wide() + { + int4x4 a0 = int4x4(1410318491, 1097280168, 1827039044, 28881338, 328720965, 875487868, 212936325, 231977215, 1740021315, 2011295463, 48079003, 591379285, 1125909359, 1842588095, 848561896, 614448464); + int4x4 b0 = int4x4(1315897366, 799052018, 1580289673, 1094686261, 1954325726, 1197734816, 229886366, 915679176, 1746884850, 918743925, 1007797419, 257421324, 287249342, 1617287463, 1653916102, 123586847); + int4x4 r0 = int4x4(94421125, 298228150, 246749371, -1065804923, -1625604761, -322246948, -16950041, -683701961, -6863535, 1092551538, -959718416, 333957961, 838660017, 225300632, -805354206, 490861617); + TestUtils.AreEqual(r0, a0 - b0); + + int4x4 a1 = int4x4(2067598029, 1618238416, 318516219, 1090119767, 1991095823, 949592162, 1951912339, 1457818751, 1642553126, 2114366549, 1420516260, 596841760, 724518081, 1820626306, 1885185225, 246124365); + int4x4 b1 = int4x4(502107404, 672875302, 1256481116, 1975569142, 1794443030, 1327558915, 330955394, 1596041731, 1069074732, 1120817099, 2076417364, 402521072, 839858844, 1539789702, 559077522, 822288510); + int4x4 r1 = int4x4(1565490625, 945363114, -937964897, -885449375, 196652793, -377966753, 1620956945, -138222980, 573478394, 993549450, -655901104, 194320688, -115340763, 280836604, 1326107703, -576164145); + TestUtils.AreEqual(r1, a1 - b1); + + int4x4 a2 = int4x4(1339877262, 1277620434, 759131597, 597162957, 656765083, 1075131749, 58205257, 452992632, 976914238, 2122217984, 1687033200, 850554234, 2052749291, 2095840868, 1583338457, 90383917); + int4x4 b2 = int4x4(751901021, 1858312568, 1706585560, 483540199, 35726321, 401119620, 1411304017, 794953965, 246546364, 1926970811, 1641115012, 2138664312, 1215717344, 1626141022, 1697813712, 1432018301); + int4x4 r2 = int4x4(587976241, -580692134, -947453963, 113622758, 621038762, 674012129, -1353098760, -341961333, 730367874, 195247173, 45918188, -1288110078, 837031947, 469699846, -114475255, -1341634384); + TestUtils.AreEqual(r2, a2 - b2); + + int4x4 a3 = int4x4(1548318665, 2135165300, 1200818607, 836910134, 471911775, 464052016, 1001285615, 344315815, 386866212, 562875464, 584343185, 1282738957, 2048830434, 1953046924, 1758228339, 1047685389); + int4x4 b3 = int4x4(127303652, 1200011318, 1746989830, 2083451213, 1630826350, 1384789939, 195722140, 1460697711, 1025672341, 1638638861, 466637201, 1846245897, 1286439769, 1690897900, 1118505582, 1106435018); + int4x4 r3 = int4x4(1421015013, 935153982, -546171223, -1246541079, -1158914575, -920737923, 805563475, -1116381896, -638806129, -1075763397, 117705984, -563506940, 762390665, 262149024, 639722757, -58749629); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void int4x4_operator_sub_wide_scalar() + { + int4x4 a0 = int4x4(1508669340, 1594795463, 266707545, 643102647, 287705008, 1475644328, 1113286221, 979450511, 2082174113, 1108005498, 304369206, 999244508, 1806482044, 1994553647, 2101812429, 1482736902); + int b0 = (998008471); + int4x4 r0 = int4x4(510660869, 596786992, -731300926, -354905824, -710303463, 477635857, 115277750, -18557960, 1084165642, 109997027, -693639265, 1236037, 808473573, 996545176, 1103803958, 484728431); + TestUtils.AreEqual(r0, a0 - b0); + + int4x4 a1 = int4x4(266654115, 1190349300, 958542155, 1185075537, 1738124835, 499527536, 1612473406, 1696960099, 1287292743, 1360229454, 1032360376, 1779621585, 964948785, 1739264125, 94254551, 968533883); + int b1 = (1470212363); + int4x4 r1 = int4x4(-1203558248, -279863063, -511670208, -285136826, 267912472, -970684827, 142261043, 226747736, -182919620, -109982909, -437851987, 309409222, -505263578, 269051762, -1375957812, -501678480); + TestUtils.AreEqual(r1, a1 - b1); + + int4x4 a2 = int4x4(2075770560, 1074604044, 1171596880, 1033389665, 1905912138, 1219683758, 372717946, 658343960, 572101777, 361378660, 1043302867, 1535109165, 695707807, 153321516, 1464557635, 308141270); + int b2 = (946189008); + int4x4 r2 = int4x4(1129581552, 128415036, 225407872, 87200657, 959723130, 273494750, -573471062, -287845048, -374087231, -584810348, 97113859, 588920157, -250481201, -792867492, 518368627, -638047738); + TestUtils.AreEqual(r2, a2 - b2); + + int4x4 a3 = int4x4(69622833, 1194454863, 1717370179, 323593803, 1407367283, 1095267927, 801717786, 1093626195, 1147895912, 115414874, 80925845, 1347312573, 1117225328, 1516225020, 210114655, 30710625); + int b3 = (668515891); + int4x4 r3 = int4x4(-598893058, 525938972, 1048854288, -344922088, 738851392, 426752036, 133201895, 425110304, 479380021, -553101017, -587590046, 678796682, 448709437, 847709129, -458401236, -637805266); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void int4x4_operator_sub_scalar_wide() + { + int a0 = (893369501); + int4x4 b0 = int4x4(2051906184, 1699714311, 442603706, 1735141684, 274533585, 811580259, 1196354320, 1524097023, 533621527, 2080845793, 143958837, 1620668660, 1135989346, 1367044745, 554088609, 552670373); + int4x4 r0 = int4x4(-1158536683, -806344810, 450765795, -841772183, 618835916, 81789242, -302984819, -630727522, 359747974, -1187476292, 749410664, -727299159, -242619845, -473675244, 339280892, 340699128); + TestUtils.AreEqual(r0, a0 - b0); + + int a1 = (1265516124); + int4x4 b1 = int4x4(1254902543, 1857695581, 1619865274, 1313559400, 99812999, 843597298, 420111239, 1299949060, 531009038, 1103306550, 104920105, 1137308312, 1207332725, 103438360, 1157123503, 1174401240); + int4x4 r1 = int4x4(10613581, -592179457, -354349150, -48043276, 1165703125, 421918826, 845404885, -34432936, 734507086, 162209574, 1160596019, 128207812, 58183399, 1162077764, 108392621, 91114884); + TestUtils.AreEqual(r1, a1 - b1); + + int a2 = (701247193); + int4x4 b2 = int4x4(1498366995, 467017290, 109208355, 1594646461, 1252691221, 919863765, 2826939, 1969148647, 1576198850, 2075870798, 1610641273, 1783880129, 59074246, 1766624573, 521313783, 1333637752); + int4x4 r2 = int4x4(-797119802, 234229903, 592038838, -893399268, -551444028, -218616572, 698420254, -1267901454, -874951657, -1374623605, -909394080, -1082632936, 642172947, -1065377380, 179933410, -632390559); + TestUtils.AreEqual(r2, a2 - b2); + + int a3 = (509364704); + int4x4 b3 = int4x4(516658115, 2089980466, 436174846, 1727293748, 1952093185, 856117013, 22492467, 435192624, 1891008194, 1855757356, 1091434215, 386788711, 1473772449, 1977407433, 1134318981, 446267420); + int4x4 r3 = int4x4(-7293411, -1580615762, 73189858, -1217929044, -1442728481, -346752309, 486872237, 74172080, -1381643490, -1346392652, -582069511, 122575993, -964407745, -1468042729, -624954277, 63097284); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void int4x4_operator_mul_wide_wide() + { + int4x4 a0 = int4x4(61417577, 219585476, 1362520891, 1511084277, 1481211272, 58211871, 1459591173, 567624644, 1169935583, 1835691886, 385626539, 85934842, 522856538, 278370196, 289217012, 2083410174); + int4x4 b0 = int4x4(578042444, 1620527213, 200516468, 309339115, 542853019, 299467282, 1479641221, 1428338601, 1497302909, 1596889147, 427413842, 265122693, 689376654, 1120457204, 516903000, 873091659); + int4x4 r0 = int4x4(-1426863828, 1326150260, -990894148, -1322856473, 1973926232, 88546350, -863919463, -582821788, 556671459, 1098186330, 1848083398, -58320414, 2005201900, 651971856, -1721160736, -110160278); + TestUtils.AreEqual(r0, a0 * b0); + + int4x4 a1 = int4x4(1293162798, 1939730122, 2075923048, 1116477212, 1686101741, 783310758, 248585944, 1093377716, 797038788, 1838048120, 1892922904, 1952024781, 492107602, 1097670675, 2069629919, 20122103); + int4x4 b1 = int4x4(1353196495, 1384773500, 1596528529, 2122329305, 1033200564, 996795088, 1137754930, 232014195, 1080950243, 1613216909, 463529448, 1781487382, 2101946430, 673144237, 390627073, 964308272); + int4x4 r1 = int4x4(-119429582, -536965160, -2049587992, -759667012, 1443849636, 550781664, -959017424, -353108260, -1093604916, 264300824, -121602624, 1825729694, -241519140, -1246587945, -2064143137, -251115184); + TestUtils.AreEqual(r1, a1 * b1); + + int4x4 a2 = int4x4(606926492, 1153788131, 1687394746, 1499899200, 380825697, 2058271053, 1791586731, 16536749, 1743482585, 323418416, 826338527, 1127652402, 1548655361, 892665898, 498857854, 52699386); + int4x4 b2 = int4x4(1332603859, 106394678, 1330334791, 1720890701, 1860846228, 1499909622, 1236623401, 1532585255, 46356001, 1355750416, 470193265, 829633350, 158242740, 2121460265, 443332975, 1295474668); + int4x4 r2 = int4x4(1004304020, -330302494, 638638742, 892728384, -1474954732, 1744222462, -976595869, -1560402085, -1646186503, 1971376896, 936606319, -24990804, -400518220, -1235785030, -276669022, -1790890888); + TestUtils.AreEqual(r2, a2 * b2); + + int4x4 a3 = int4x4(1013078461, 389868596, 2131450446, 692103096, 1728534690, 1232391212, 552742042, 2137384298, 2085409681, 1077145299, 67208657, 137969745, 204951457, 705222964, 437668893, 1222032847); + int4x4 b3 = int4x4(1966486133, 1063465732, 986983038, 1614187644, 117157419, 32076676, 452115159, 1402967848, 1712569067, 2023273918, 811855334, 136733227, 324154781, 1529152006, 1525922582, 2084976369); + int4x4 r3 = int4x4(492301665, -1541534512, -654360988, -1210458848, -11534538, 1476201136, 1834965334, -585933168, 1711312923, 330198938, -233589050, 1614991259, 1710893757, -294944968, -116737666, 147610079); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void int4x4_operator_mul_wide_scalar() + { + int4x4 a0 = int4x4(871746615, 492532311, 570557670, 2142306629, 1610315153, 1526163563, 118471734, 257439514, 364291059, 1186560810, 1584938026, 1357601203, 638897141, 268562104, 1007838321, 1163240135); + int b0 = (442064533); + int4x4 r0 = int4x4(338365955, 1081376419, -1729147426, -1015409879, -873485467, -175501241, -838181010, 513646114, 1627104879, 1523063666, 1353478258, -517607633, -1758745703, -1262517992, 484373445, -1714696237); + TestUtils.AreEqual(r0, a0 * b0); + + int4x4 a1 = int4x4(1619806399, 1127580168, 464517916, 1508043166, 745488654, 636691139, 1851670006, 357357967, 1095280227, 702779195, 945802744, 1464398841, 51061000, 802418971, 407442471, 638315697); + int b1 = (1444659979); + int4x4 r1 = int4x4(-678060747, 204516952, 550116916, 1818059722, 936342938, 25036641, -1271854190, 1880770085, -213020863, 270145673, 1865007528, -1287903565, -948206760, -23335639, -275082579, 611909275); + TestUtils.AreEqual(r1, a1 * b1); + + int4x4 a2 = int4x4(1889264235, 1343048690, 2144106255, 1634890111, 425282134, 997231492, 676185747, 1562817045, 379402138, 866868743, 624571724, 889442510, 39498317, 219559094, 211033504, 2076045580); + int b2 = (584402164); + int4x4 r2 = int4x4(1438595580, 691186344, 737965644, -1813714676, 644329976, 690489808, -785428452, 94916612, 130016968, -299730260, 1642003568, -1568687016, -371235484, 1721275768, 992656512, -1945309328); + TestUtils.AreEqual(r2, a2 * b2); + + int4x4 a3 = int4x4(1838674974, 680562697, 469850888, 1511187096, 1844059526, 2003324819, 866371311, 1784948662, 515034926, 823384368, 1320152637, 940524320, 313230059, 384141839, 1177495555, 719285506); + int b3 = (1056841954); + int4x4 r3 = int4x4(946684540, -124893198, 646143248, -2083583440, 189976652, 31629254, 1385529086, -336212308, 660907676, -330580896, -1684147750, -1080212928, -1158614154, -2067283650, 1201386150, 1792703428); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void int4x4_operator_mul_scalar_wide() + { + int a0 = (1152242766); + int4x4 b0 = int4x4(1276636134, 2105929407, 499007702, 124002565, 1956335172, 1288034953, 832676555, 337389733, 99268757, 2005055247, 2011389505, 1348110859, 399689191, 2007606374, 2076691289, 1825721194); + int4x4 r0 = int4x4(-2129504236, 999811634, 1179056436, -801426554, 404105400, 1339492798, -381766182, -1111620026, 2131796326, 1519334034, -952005682, -1420416166, -415852446, 583175956, 980068638, 1831387724); + TestUtils.AreEqual(r0, a0 * b0); + + int a1 = (769885235); + int4x4 b1 = int4x4(153314735, 1066325369, 84289667, 984486192, 1325213504, 1643957457, 1576395620, 2095980601, 907671947, 836919582, 1412159342, 2037926630, 366590562, 493177763, 2058824164, 497936968); + int4x4 r1 = int4x4(-5734947, -556668133, 541498905, 521809040, 1382797760, 961253795, -1226318612, 1134088027, -518430031, 231133434, -1134910742, 294093778, 492874118, -826860167, 490924140, -62206888); + TestUtils.AreEqual(r1, a1 * b1); + + int a2 = (2136548816); + int4x4 b2 = int4x4(1211907591, 2113626509, 345443734, 353147704, 688487056, 2038986981, 1991273614, 393095943, 838257274, 1646548338, 480051387, 1077685034, 421911953, 1757438926, 1584698689, 1237695787); + int4x4 r2 = int4x4(1868064944, -1906465904, -1294485536, -1423624832, -1032166144, 452481808, 510048608, 1680472240, 775038240, 1082189472, -156328208, -1162206176, -567084336, -816063136, -1159419440, -1644959248); + TestUtils.AreEqual(r2, a2 * b2); + + int a3 = (426426495); + int4x4 b3 = int4x4(272190940, 792362979, 710924244, 167756574, 2098906277, 461971950, 1070095729, 175505611, 1048663225, 451115371, 1568000860, 446946750, 1880161842, 1511877484, 2100048988, 850173891); + int4x4 r3 = int4x4(-1075142620, 1827516829, -114093524, -2136716318, -1391112741, -855223022, -1538974961, -667900747, 659408839, -1422427115, -435363164, 2084929858, 2043124430, -874427756, -364185180, -852262467); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void int4x4_operator_div_wide_wide() + { + int4x4 a0 = int4x4(333171510, 858154903, 1181365836, 671357749, 1090606752, 803759420, 788404166, 296807814, 575260195, 166625280, 1493729000, 1831739736, 200852358, 129983172, 500176108, 472051781); + int4x4 b0 = int4x4(698897823, 440199998, 655557473, 1658534285, 2127220100, 315653188, 1814290360, 992173243, 914851653, 664340325, 224323977, 246981573, 285573983, 819471609, 2012476015, 1783179572); + int4x4 r0 = int4x4(0, 1, 1, 0, 0, 2, 0, 0, 0, 0, 6, 7, 0, 0, 0, 0); + TestUtils.AreEqual(r0, a0 / b0); + + int4x4 a1 = int4x4(414699094, 1446535974, 1278480457, 930910505, 263295881, 1626759436, 450830871, 21439121, 521337599, 127756712, 200601965, 412554396, 1014641734, 239347640, 525574301, 1158358177); + int4x4 b1 = int4x4(223253978, 169515029, 1694929006, 1992168131, 1155972447, 1768506696, 422325410, 1508417406, 605462475, 66917170, 2014683461, 108847533, 611173330, 895791853, 1999369787, 1225614384); + int4x4 r1 = int4x4(1, 8, 0, 0, 0, 0, 1, 0, 0, 1, 0, 3, 1, 0, 0, 0); + TestUtils.AreEqual(r1, a1 / b1); + + int4x4 a2 = int4x4(1655168319, 2048437741, 367754386, 1861176433, 2131424795, 401044444, 745048188, 1943634349, 264134862, 298134010, 1884719303, 1582577607, 1958183229, 1302356942, 1455581366, 1466593830); + int4x4 b2 = int4x4(1168063495, 565150188, 127292785, 1027814836, 321940796, 337756553, 63233040, 1926010595, 769049413, 2042197280, 405134611, 547499280, 1337688441, 667307127, 35118652, 411409741); + int4x4 r2 = int4x4(1, 3, 2, 1, 6, 1, 11, 1, 0, 0, 4, 2, 1, 1, 41, 3); + TestUtils.AreEqual(r2, a2 / b2); + + int4x4 a3 = int4x4(2145097917, 113338377, 521371316, 1140663020, 891769689, 82976022, 1613639017, 1511282992, 815022628, 631656991, 1701235777, 1488378728, 1732969535, 754450606, 972419490, 1719717117); + int4x4 b3 = int4x4(401145052, 1430251023, 1603772580, 394044814, 1247425523, 2026144816, 74797843, 951408694, 460820692, 1904008535, 1263644544, 1250033708, 1500938461, 1177549592, 1193869306, 2096306143); + int4x4 r3 = int4x4(5, 0, 0, 2, 0, 0, 21, 1, 1, 0, 1, 1, 1, 0, 0, 0); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void int4x4_operator_div_wide_scalar() + { + int4x4 a0 = int4x4(1433072926, 1073958635, 1195142312, 536596719, 1274375693, 464756346, 806462546, 906504670, 1380905136, 25493909, 1196815948, 123300377, 643754735, 2084019932, 2047825037, 458304263); + int b0 = (1434025872); + int4x4 r0 = int4x4(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0); + TestUtils.AreEqual(r0, a0 / b0); + + int4x4 a1 = int4x4(741331531, 2110004616, 1500687214, 1453264263, 1617154145, 2040203220, 2103351724, 485536709, 402141749, 1477264254, 1629069474, 1549487015, 670594363, 2040479674, 155415284, 207130003); + int b1 = (466443901); + int4x4 r1 = int4x4(1, 4, 3, 3, 3, 4, 4, 1, 0, 3, 3, 3, 1, 4, 0, 0); + TestUtils.AreEqual(r1, a1 / b1); + + int4x4 a2 = int4x4(1596922206, 1528374182, 1878500631, 1245757182, 1471308702, 1733304186, 251821475, 1328085649, 1950145317, 794269329, 174603836, 678361822, 1820872200, 1455358409, 778273070, 2067965131); + int b2 = (1730223836); + int4x4 r2 = int4x4(0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1); + TestUtils.AreEqual(r2, a2 / b2); + + int4x4 a3 = int4x4(127176068, 610271655, 2044746707, 2127292310, 1964355374, 1181239062, 1239274235, 51060010, 872233944, 1134975739, 1324876719, 1504501302, 710310773, 132497882, 1041400664, 2063654021); + int b3 = (1891892641); + int4x4 r3 = int4x4(0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void int4x4_operator_div_scalar_wide() + { + int a0 = (519165704); + int4x4 b0 = int4x4(1295178177, 775214121, 467772046, 1156881598, 310396565, 759759959, 243837702, 1616314235, 1053470225, 1320630160, 378773841, 4223608, 1971105754, 2054406020, 219939614, 1603672651); + int4x4 r0 = int4x4(0, 0, 1, 0, 1, 0, 2, 0, 0, 0, 1, 122, 0, 0, 2, 0); + TestUtils.AreEqual(r0, a0 / b0); + + int a1 = (2006134295); + int4x4 b1 = int4x4(888535397, 1493077923, 615835131, 1045603945, 452709946, 1074919059, 467037221, 1485241506, 1775728786, 481521341, 68149923, 80867357, 1294049272, 470535313, 1235850199, 631464286); + int4x4 r1 = int4x4(2, 1, 3, 1, 4, 1, 4, 1, 1, 4, 29, 24, 1, 4, 1, 3); + TestUtils.AreEqual(r1, a1 / b1); + + int a2 = (687722755); + int4x4 b2 = int4x4(412827650, 1258012095, 1286792622, 1799223034, 766890491, 2080374598, 711612151, 700420132, 1832408481, 1806438353, 237636410, 562498090, 1695805237, 2075783388, 2094216740, 1612536340); + int4x4 r2 = int4x4(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0); + TestUtils.AreEqual(r2, a2 / b2); + + int a3 = (885282904); + int4x4 b3 = int4x4(762931601, 1888184154, 1235090956, 1621045406, 842468231, 1847778709, 734825, 1819123739, 682151426, 278238618, 175687779, 1535446878, 1906904600, 850094847, 1290407289, 1520242969); + int4x4 r3 = int4x4(1, 0, 0, 0, 1, 0, 1204, 0, 1, 3, 5, 0, 0, 1, 0, 0); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void int4x4_operator_mod_wide_wide() + { + int4x4 a0 = int4x4(258342924, 1454754891, 723352342, 1981431473, 531756042, 716993627, 1667903349, 1331097004, 1776856101, 17598216, 1474345080, 1681376293, 813624265, 1617478722, 498370451, 780075943); + int4x4 b0 = int4x4(1990080167, 1197348066, 651970512, 1659454050, 241005212, 1866255454, 1440101415, 595220963, 408818410, 198222574, 549504274, 239973807, 321398087, 658171840, 1511495237, 1048325585); + int4x4 r0 = int4x4(258342924, 257406825, 71381830, 321977423, 49745618, 716993627, 227801934, 140655078, 141582461, 17598216, 375336532, 1559644, 170828091, 301135042, 498370451, 780075943); + TestUtils.AreEqual(r0, a0 % b0); + + int4x4 a1 = int4x4(1754430321, 653235398, 1517128354, 966216200, 590067427, 1283434795, 1910903650, 1125967790, 1180537254, 308567230, 543945394, 483834400, 308703874, 383723801, 1181975437, 1161083599); + int4x4 b1 = int4x4(1126739824, 666641241, 38017598, 418797691, 618700513, 1941062990, 158556432, 1081063558, 427329468, 148111230, 1251162672, 1856322297, 1214781084, 401954255, 1323259633, 1167744452); + int4x4 r1 = int4x4(627690497, 653235398, 34442032, 128620818, 590067427, 1283434795, 8226466, 44904232, 325878318, 12344770, 543945394, 483834400, 308703874, 383723801, 1181975437, 1161083599); + TestUtils.AreEqual(r1, a1 % b1); + + int4x4 a2 = int4x4(1608412916, 111825133, 786866017, 1225576256, 1590085857, 1755638794, 1413553126, 476553804, 1342913944, 1625118233, 1202928007, 504380191, 642905424, 357937367, 1801777444, 1384305901); + int4x4 b2 = int4x4(1816151689, 541163525, 664455763, 1738838503, 1746284172, 855644567, 1887796950, 655067833, 536415164, 71040983, 631964713, 503267649, 944396748, 302347270, 564261945, 1414291441); + int4x4 r2 = int4x4(1608412916, 111825133, 122410254, 1225576256, 1590085857, 44349660, 1413553126, 476553804, 270083616, 62216607, 570963294, 1112542, 642905424, 55590097, 108991609, 1384305901); + TestUtils.AreEqual(r2, a2 % b2); + + int4x4 a3 = int4x4(1605100561, 332650074, 46731299, 294197541, 1349236859, 705509020, 1643007525, 442769171, 738227280, 1206523958, 1845625047, 2112300092, 1311771498, 2045741748, 306518396, 2084544706); + int4x4 b3 = int4x4(115690343, 94751961, 584804265, 516081491, 717212374, 945144869, 1775673480, 568390571, 1876139615, 645560273, 1090042616, 976448203, 1756041131, 1989952916, 923228986, 1025823912); + int4x4 r3 = int4x4(101126102, 48394191, 46731299, 294197541, 632024485, 705509020, 1643007525, 442769171, 738227280, 560963685, 755582431, 159403686, 1311771498, 55788832, 306518396, 32896882); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void int4x4_operator_mod_wide_scalar() + { + int4x4 a0 = int4x4(560988938, 629524514, 767711194, 434281967, 1399805893, 792916846, 1663690927, 598661916, 1776636144, 1287035793, 1743722161, 475209785, 327476870, 1617696916, 379853074, 477430114); + int b0 = (1156862367); + int4x4 r0 = int4x4(560988938, 629524514, 767711194, 434281967, 242943526, 792916846, 506828560, 598661916, 619773777, 130173426, 586859794, 475209785, 327476870, 460834549, 379853074, 477430114); + TestUtils.AreEqual(r0, a0 % b0); + + int4x4 a1 = int4x4(858399046, 1506629323, 199829950, 362269020, 1986626876, 1351725413, 1549678101, 431765276, 1315833792, 1664893153, 615834034, 780055604, 104179235, 629966219, 1810536428, 1747026206); + int b1 = (712734431); + int4x4 r1 = int4x4(145664615, 81160461, 199829950, 362269020, 561158014, 638990982, 124209239, 431765276, 603099361, 239424291, 615834034, 67321173, 104179235, 629966219, 385067566, 321557344); + TestUtils.AreEqual(r1, a1 % b1); + + int4x4 a2 = int4x4(1799535061, 2049775667, 303673867, 93301056, 1944511005, 2135291183, 1065919801, 1342701312, 1356734788, 1593032231, 475449806, 1983416442, 776300612, 591854273, 2061957684, 1865797266); + int b2 = (875754431); + int4x4 r2 = int4x4(48026199, 298266805, 303673867, 93301056, 193002143, 383782321, 190165370, 466946881, 480980357, 717277800, 475449806, 231907580, 776300612, 591854273, 310448822, 114288404); + TestUtils.AreEqual(r2, a2 % b2); + + int4x4 a3 = int4x4(1982663429, 374639153, 1919268329, 198719918, 1317719138, 1425282748, 1365516740, 2516691, 83972101, 1275507340, 1047856893, 1966089959, 1672456909, 657069574, 2080669380, 875667226); + int b3 = (865181949); + int4x4 r3 = int4x4(252299531, 374639153, 188904431, 198719918, 452537189, 560100799, 500334791, 2516691, 83972101, 410325391, 182674944, 235726061, 807274960, 657069574, 350305482, 10485277); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void int4x4_operator_mod_scalar_wide() + { + int a0 = (933347930); + int4x4 b0 = int4x4(549923387, 243114953, 1884274390, 1428033594, 655531454, 1622674954, 1107563514, 1614111094, 914801920, 1432263179, 564431096, 1967013901, 1709750152, 1080102613, 13120773, 2042535998); + int4x4 r0 = int4x4(383424543, 204003071, 933347930, 933347930, 277816476, 933347930, 933347930, 933347930, 18546010, 933347930, 368916834, 933347930, 933347930, 933347930, 1773047, 933347930); + TestUtils.AreEqual(r0, a0 % b0); + + int a1 = (1505698002); + int4x4 b1 = int4x4(1640058084, 974167554, 758635306, 1387264978, 611743343, 1139002766, 1913935748, 1086810076, 991846486, 922870408, 35007468, 891877602, 157349181, 83267982, 801093706, 546272767); + int4x4 r1 = int4x4(1505698002, 531530448, 747062696, 118433024, 282211316, 366695236, 1505698002, 418887926, 513851516, 582827594, 376878, 613820400, 89555373, 6874326, 704604296, 413152468); + TestUtils.AreEqual(r1, a1 % b1); + + int a2 = (1665089132); + int4x4 b2 = int4x4(1889242068, 1179889796, 1690033703, 1333252321, 1960636489, 960755248, 698650125, 313994074, 1830992514, 2049496523, 507742240, 739436968, 1012724736, 2089810815, 329356442, 384427687); + int4x4 r2 = int4x4(1665089132, 485199336, 1665089132, 331836811, 1665089132, 704333884, 267788882, 95118762, 1665089132, 1665089132, 141862412, 186215196, 652364396, 1665089132, 18306922, 127378384); + TestUtils.AreEqual(r2, a2 % b2); + + int a3 = (713578570); + int4x4 b3 = int4x4(443562339, 938288481, 1912612259, 1693566599, 2085663691, 1251595834, 2117822289, 341223518, 1811168615, 699804546, 1072556046, 722233492, 757452739, 1348995197, 1910821037, 1420741134); + int4x4 r3 = int4x4(270016231, 713578570, 713578570, 713578570, 713578570, 713578570, 713578570, 31131534, 713578570, 13774024, 713578570, 713578570, 713578570, 713578570, 713578570, 713578570); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void int4x4_operator_plus() + { + int4x4 a0 = int4x4(195392567, 222719748, 1002351013, 1570765263, 109389333, 1515950277, 1689763402, 291471785, 264115671, 1084131995, 195779102, 2131702223, 715660442, 1995564647, 69731564, 1317851903); + int4x4 r0 = int4x4(195392567, 222719748, 1002351013, 1570765263, 109389333, 1515950277, 1689763402, 291471785, 264115671, 1084131995, 195779102, 2131702223, 715660442, 1995564647, 69731564, 1317851903); + TestUtils.AreEqual(r0, +a0); + + int4x4 a1 = int4x4(1957501908, 2012985092, 1334133318, 1539671418, 935436165, 1575048895, 2119066258, 781435471, 1659000230, 1301861249, 1153431944, 1360657696, 578750954, 150348334, 1791553179, 1288641627); + int4x4 r1 = int4x4(1957501908, 2012985092, 1334133318, 1539671418, 935436165, 1575048895, 2119066258, 781435471, 1659000230, 1301861249, 1153431944, 1360657696, 578750954, 150348334, 1791553179, 1288641627); + TestUtils.AreEqual(r1, +a1); + + int4x4 a2 = int4x4(735146513, 1370099515, 1575634098, 36481877, 1832055170, 1043119761, 1370934466, 1126708142, 511229253, 1297664549, 1444401655, 1292097101, 1377029046, 1680766483, 249526091, 656501406); + int4x4 r2 = int4x4(735146513, 1370099515, 1575634098, 36481877, 1832055170, 1043119761, 1370934466, 1126708142, 511229253, 1297664549, 1444401655, 1292097101, 1377029046, 1680766483, 249526091, 656501406); + TestUtils.AreEqual(r2, +a2); + + int4x4 a3 = int4x4(195015813, 1562997921, 1927957096, 803204796, 1747288691, 795154500, 1030768402, 789329792, 597872750, 214089028, 536331458, 1078297736, 1832848364, 933783661, 551709570, 843060596); + int4x4 r3 = int4x4(195015813, 1562997921, 1927957096, 803204796, 1747288691, 795154500, 1030768402, 789329792, 597872750, 214089028, 536331458, 1078297736, 1832848364, 933783661, 551709570, 843060596); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void int4x4_operator_neg() + { + int4x4 a0 = int4x4(1385088677, 94114564, 1350664872, 1458616659, 2067164853, 218122493, 958484951, 270553961, 446497525, 270503114, 1928771252, 1427605822, 2051940607, 1434247484, 485368391, 908365416); + int4x4 r0 = int4x4(-1385088677, -94114564, -1350664872, -1458616659, -2067164853, -218122493, -958484951, -270553961, -446497525, -270503114, -1928771252, -1427605822, -2051940607, -1434247484, -485368391, -908365416); + TestUtils.AreEqual(r0, -a0); + + int4x4 a1 = int4x4(1742096480, 1368056141, 1350976157, 12802586, 1934372287, 576597401, 785136322, 559205611, 1959833280, 162379661, 1200036971, 95281343, 1969004480, 1381288239, 252975075, 1961335692); + int4x4 r1 = int4x4(-1742096480, -1368056141, -1350976157, -12802586, -1934372287, -576597401, -785136322, -559205611, -1959833280, -162379661, -1200036971, -95281343, -1969004480, -1381288239, -252975075, -1961335692); + TestUtils.AreEqual(r1, -a1); + + int4x4 a2 = int4x4(1607042487, 1300359361, 8438338, 431498011, 1534415387, 2069192669, 866625695, 2105773520, 1249998702, 1704935592, 59004141, 257619538, 392825753, 1868257049, 1472660509, 928823577); + int4x4 r2 = int4x4(-1607042487, -1300359361, -8438338, -431498011, -1534415387, -2069192669, -866625695, -2105773520, -1249998702, -1704935592, -59004141, -257619538, -392825753, -1868257049, -1472660509, -928823577); + TestUtils.AreEqual(r2, -a2); + + int4x4 a3 = int4x4(2138036799, 1587572134, 1974711458, 1372286091, 170185840, 1665000810, 565528550, 899411048, 107331573, 55742832, 1905931627, 175272618, 624976692, 1036698522, 1675796177, 1613753777); + int4x4 r3 = int4x4(-2138036799, -1587572134, -1974711458, -1372286091, -170185840, -1665000810, -565528550, -899411048, -107331573, -55742832, -1905931627, -175272618, -624976692, -1036698522, -1675796177, -1613753777); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void int4x4_operator_prefix_inc() + { + int4x4 a0 = int4x4(780471723, 954741756, 272723451, 2142862245, 606294309, 1514814550, 250124151, 444189162, 1833356994, 1915989169, 1348278302, 129540735, 1584496757, 1170613526, 986715680, 1701179230); + int4x4 r0 = int4x4(780471724, 954741757, 272723452, 2142862246, 606294310, 1514814551, 250124152, 444189163, 1833356995, 1915989170, 1348278303, 129540736, 1584496758, 1170613527, 986715681, 1701179231); + TestUtils.AreEqual(r0, ++a0); + + int4x4 a1 = int4x4(1397451003, 1494652811, 1268688387, 2014528731, 453850931, 1112537171, 621362788, 2063486914, 1612870531, 1161037742, 1083861484, 1583359796, 82587894, 810087437, 72436569, 1094485773); + int4x4 r1 = int4x4(1397451004, 1494652812, 1268688388, 2014528732, 453850932, 1112537172, 621362789, 2063486915, 1612870532, 1161037743, 1083861485, 1583359797, 82587895, 810087438, 72436570, 1094485774); + TestUtils.AreEqual(r1, ++a1); + + int4x4 a2 = int4x4(912422931, 261771874, 2042016403, 1102472175, 976635804, 1261156013, 607693651, 1788488571, 1912059986, 420746703, 1703260621, 501684292, 1809882373, 1989306461, 786299198, 1729269500); + int4x4 r2 = int4x4(912422932, 261771875, 2042016404, 1102472176, 976635805, 1261156014, 607693652, 1788488572, 1912059987, 420746704, 1703260622, 501684293, 1809882374, 1989306462, 786299199, 1729269501); + TestUtils.AreEqual(r2, ++a2); + + int4x4 a3 = int4x4(411043860, 145863296, 877006815, 913426639, 1056275934, 1989688232, 1798844310, 79375331, 1140907425, 353776808, 1313746314, 1008313013, 1750769100, 1105901732, 1275841733, 1182538609); + int4x4 r3 = int4x4(411043861, 145863297, 877006816, 913426640, 1056275935, 1989688233, 1798844311, 79375332, 1140907426, 353776809, 1313746315, 1008313014, 1750769101, 1105901733, 1275841734, 1182538610); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void int4x4_operator_postfix_inc() + { + int4x4 a0 = int4x4(241865086, 2145821641, 1596166022, 803592338, 529551271, 1656767229, 903047443, 1213663244, 1425753247, 1384002775, 389844650, 1159795446, 1343289659, 1227160199, 947635082, 137930180); + int4x4 r0 = int4x4(241865086, 2145821641, 1596166022, 803592338, 529551271, 1656767229, 903047443, 1213663244, 1425753247, 1384002775, 389844650, 1159795446, 1343289659, 1227160199, 947635082, 137930180); + TestUtils.AreEqual(r0, a0++); + + int4x4 a1 = int4x4(451018043, 2009552507, 1176922170, 388721494, 2381860, 2062858295, 715101397, 1725384327, 446867079, 2101314783, 1460883320, 1683365096, 1319511974, 1418603655, 1938539756, 592683318); + int4x4 r1 = int4x4(451018043, 2009552507, 1176922170, 388721494, 2381860, 2062858295, 715101397, 1725384327, 446867079, 2101314783, 1460883320, 1683365096, 1319511974, 1418603655, 1938539756, 592683318); + TestUtils.AreEqual(r1, a1++); + + int4x4 a2 = int4x4(1576213022, 904484472, 253685095, 70826818, 1423673637, 463104653, 257117856, 964412816, 1148726183, 1820437224, 1087435092, 475319856, 1950385959, 1172607661, 1139700625, 1386106060); + int4x4 r2 = int4x4(1576213022, 904484472, 253685095, 70826818, 1423673637, 463104653, 257117856, 964412816, 1148726183, 1820437224, 1087435092, 475319856, 1950385959, 1172607661, 1139700625, 1386106060); + TestUtils.AreEqual(r2, a2++); + + int4x4 a3 = int4x4(612787013, 2015267118, 1005487805, 2000627239, 804783244, 82963346, 881064625, 1225691658, 82684192, 1702936093, 1589647770, 1677781795, 106241273, 2112882767, 598788541, 567112128); + int4x4 r3 = int4x4(612787013, 2015267118, 1005487805, 2000627239, 804783244, 82963346, 881064625, 1225691658, 82684192, 1702936093, 1589647770, 1677781795, 106241273, 2112882767, 598788541, 567112128); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void int4x4_operator_prefix_dec() + { + int4x4 a0 = int4x4(1331961415, 1612382200, 1401591249, 2042075388, 1757136546, 1895858159, 1467742422, 578341664, 1336115745, 2059077641, 1169239112, 1862369220, 312317355, 1027543764, 1595492535, 1426262619); + int4x4 r0 = int4x4(1331961414, 1612382199, 1401591248, 2042075387, 1757136545, 1895858158, 1467742421, 578341663, 1336115744, 2059077640, 1169239111, 1862369219, 312317354, 1027543763, 1595492534, 1426262618); + TestUtils.AreEqual(r0, --a0); + + int4x4 a1 = int4x4(1426620468, 1423852012, 1459529624, 2092317419, 107501474, 1261583506, 512900840, 1496855314, 777588547, 617644613, 1487639376, 625907330, 1452782388, 804650978, 2076275981, 120447533); + int4x4 r1 = int4x4(1426620467, 1423852011, 1459529623, 2092317418, 107501473, 1261583505, 512900839, 1496855313, 777588546, 617644612, 1487639375, 625907329, 1452782387, 804650977, 2076275980, 120447532); + TestUtils.AreEqual(r1, --a1); + + int4x4 a2 = int4x4(262357170, 412907314, 846648478, 473291493, 286048219, 890018786, 1237897291, 1412498905, 346348942, 953070054, 2028727932, 2006551142, 1345994403, 1356250542, 1202345509, 497982699); + int4x4 r2 = int4x4(262357169, 412907313, 846648477, 473291492, 286048218, 890018785, 1237897290, 1412498904, 346348941, 953070053, 2028727931, 2006551141, 1345994402, 1356250541, 1202345508, 497982698); + TestUtils.AreEqual(r2, --a2); + + int4x4 a3 = int4x4(982734742, 1517311883, 735646686, 1387127643, 1263392561, 350798694, 888690409, 545220074, 979547999, 1278213546, 2127586693, 2099917981, 2030817004, 1254426663, 1240446778, 1741921687); + int4x4 r3 = int4x4(982734741, 1517311882, 735646685, 1387127642, 1263392560, 350798693, 888690408, 545220073, 979547998, 1278213545, 2127586692, 2099917980, 2030817003, 1254426662, 1240446777, 1741921686); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void int4x4_operator_postfix_dec() + { + int4x4 a0 = int4x4(1870005937, 1708534798, 704493460, 462940703, 2060593573, 228744869, 940247280, 1818778351, 1015253889, 862428933, 1401191870, 2080259851, 653673271, 140452688, 1928164223, 1760916301); + int4x4 r0 = int4x4(1870005937, 1708534798, 704493460, 462940703, 2060593573, 228744869, 940247280, 1818778351, 1015253889, 862428933, 1401191870, 2080259851, 653673271, 140452688, 1928164223, 1760916301); + TestUtils.AreEqual(r0, a0--); + + int4x4 a1 = int4x4(1174531383, 993137684, 1669210509, 874927437, 1393579866, 471308632, 620865961, 220103745, 1407678826, 319906934, 1426931482, 488775250, 1681733117, 1916879863, 2060905976, 636358505); + int4x4 r1 = int4x4(1174531383, 993137684, 1669210509, 874927437, 1393579866, 471308632, 620865961, 220103745, 1407678826, 319906934, 1426931482, 488775250, 1681733117, 1916879863, 2060905976, 636358505); + TestUtils.AreEqual(r1, a1--); + + int4x4 a2 = int4x4(1379709480, 497925052, 549367303, 925145385, 55306458, 358414755, 18471540, 1907671409, 2010375112, 459674494, 1339288497, 548526029, 2061115550, 1130246689, 681734791, 1169678318); + int4x4 r2 = int4x4(1379709480, 497925052, 549367303, 925145385, 55306458, 358414755, 18471540, 1907671409, 2010375112, 459674494, 1339288497, 548526029, 2061115550, 1130246689, 681734791, 1169678318); + TestUtils.AreEqual(r2, a2--); + + int4x4 a3 = int4x4(640772261, 337750282, 880417560, 995078500, 1313900720, 1237226166, 83627499, 242836958, 652914747, 2056321582, 1660799445, 1330003101, 1481004419, 1093032717, 1487769541, 1443901346); + int4x4 r3 = int4x4(640772261, 337750282, 880417560, 995078500, 1313900720, 1237226166, 83627499, 242836958, 652914747, 2056321582, 1660799445, 1330003101, 1481004419, 1093032717, 1487769541, 1443901346); + TestUtils.AreEqual(r3, a3--); + } + + [TestCompiler] + public static void int4x4_operator_bitwise_and_wide_wide() + { + int4x4 a0 = int4x4(1055241304, 859321394, 1088358961, 2090949513, 300561740, 651904515, 1331035868, 2012752753, 1298126656, 53199569, 1752363533, 1303061302, 1929998247, 1504941434, 470682792, 713577376); + int4x4 b0 = int4x4(749698416, 748105424, 1842764797, 9990577, 1989102105, 1666634755, 58116798, 868036607, 1420638875, 1308767169, 564040763, 478617502, 806150474, 674015378, 1505309955, 36064977); + int4x4 r0 = int4x4(749024336, 537928720, 1087769137, 8409473, 277479432, 575816707, 55888540, 867707761, 1141707264, 33686209, 538087433, 209912598, 805855490, 136347666, 403178496, 33571456); + TestUtils.AreEqual(r0, a0 & b0); + + int4x4 a1 = int4x4(1493231658, 1340884669, 1577921467, 44846626, 1105094388, 1143008413, 333009589, 2116296009, 2067254825, 121795325, 2122365250, 1088796653, 1594120761, 965590824, 337823363, 1686791432); + int4x4 b1 = int4x4(1779639327, 808650076, 1634437037, 1997568501, 1930853951, 1901503461, 1508772523, 2010961769, 1495957269, 1914669725, 1263994006, 491200541, 380703892, 282208487, 1416934135, 942735432); + int4x4 r1 = int4x4(1207967754, 2098204, 1074332585, 33572896, 1091986996, 1073782917, 298320545, 1979979081, 1495420417, 33686173, 1241513986, 4530189, 369102864, 276834336, 337674883, 536870920); + TestUtils.AreEqual(r1, a1 & b1); + + int4x4 a2 = int4x4(1275524729, 173403097, 864715776, 1437598787, 1375792249, 203672781, 1568515997, 145607913, 837338112, 754244200, 1383514630, 61183374, 690842674, 1362012962, 668846213, 1659745138); + int4x4 b2 = int4x4(615839538, 1698880188, 1204102677, 1811173266, 203114715, 1968993229, 1549041488, 421225724, 1641463312, 1122209170, 946391298, 229237652, 849684128, 1197217575, 1910121786, 1835643900); + int4x4 r2 = int4x4(67434032, 4246168, 58721280, 1102054402, 18521, 67125453, 1549018896, 134825192, 566264832, 14714880, 274776066, 27361668, 539304992, 1091306274, 567803904, 1617539952); + TestUtils.AreEqual(r2, a2 & b2); + + int4x4 a3 = int4x4(244062519, 625978732, 1335369426, 1146245993, 58358482, 538877476, 1060321225, 1070168191, 235095979, 1592354022, 662689935, 1706704449, 554656164, 1008037514, 1989573362, 1142327053); + int4x4 b3 = int4x4(200272981, 1864653698, 417415821, 863152148, 458105706, 1919250535, 1267287071, 45079273, 544365100, 843843698, 564582262, 329133431, 2091649092, 15031648, 240381212, 1613154110); + int4x4 r3 = int4x4(176949269, 621021440, 142606976, 5373952, 55190082, 537137188, 184615945, 42555497, 148008, 306708578, 556191750, 26881089, 537657348, 347136, 101869584, 1074169612); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void int4x4_operator_bitwise_and_wide_scalar() + { + int4x4 a0 = int4x4(1513158868, 284695609, 734595037, 1566510707, 1601252476, 84213838, 314333543, 430856908, 753481263, 327392481, 1619794917, 2143619546, 1873208293, 126982769, 651482651, 1383096952); + int b0 = (1173647397); + int4x4 r0 = int4x4(1076916228, 15732769, 29360133, 1163132961, 1164976164, 84148228, 11816997, 27545604, 81801253, 25169953, 1082396709, 1170472960, 1168400421, 93327393, 81022977, 1081106464); + TestUtils.AreEqual(r0, a0 & b0); + + int4x4 a1 = int4x4(1689107088, 366962092, 1729929586, 989550739, 1914435619, 1592791064, 2047510829, 678485991, 586400261, 771972179, 309059606, 131945492, 1707451796, 394184188, 1943201012, 558008097); + int b1 = (1368301071); + int4x4 r1 = int4x4(1082956288, 294519820, 1091338242, 277485571, 1342871555, 1350569992, 1342867469, 40455, 8552965, 138243, 269123590, 25957380, 1099203588, 286163980, 1367507972, 16942593); + TestUtils.AreEqual(r1, a1 & b1); + + int4x4 a2 = int4x4(1070093422, 258102213, 1800249857, 922911179, 1719705954, 609219265, 1162961184, 851638827, 889902874, 1622363409, 785352441, 1741477119, 452211039, 1144654389, 641588835, 1574197624); + int b2 = (34324916); + int4x4 r2 = int4x4(34095140, 33702276, 34177024, 33718656, 33587488, 770176, 82208, 33734688, 704784, 213264, 34308272, 34128052, 33554708, 655412, 34193440, 16688); + TestUtils.AreEqual(r2, a2 & b2); + + int4x4 a3 = int4x4(568430284, 349792636, 1088197642, 523608129, 1406695425, 839388192, 834567855, 888024716, 1014852215, 1459725306, 5273937, 298911416, 1193513114, 2080691940, 1824077552, 1585611449); + int b3 = (1840697362); + int4x4 r3 = int4x4(564166656, 76562448, 1083478018, 221544448, 1099976704, 536870912, 565596162, 614858752, 741621778, 1157660690, 1069072, 26214416, 1159893010, 1812254720, 1823477776, 1283620880); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void int4x4_operator_bitwise_and_scalar_wide() + { + int a0 = (477163326); + int4x4 b0 = int4x4(110453385, 703240362, 2075630560, 1884904031, 1734899436, 947945203, 1664399051, 458879298, 158491426, 79772356, 2054527944, 202228212, 359225061, 639811396, 1821945318, 1821303024); + int4x4 r0 = int4x4(68182536, 140544042, 405834528, 273697310, 73426476, 402681394, 3188234, 407953666, 141583138, 71313924, 410028808, 201376052, 341853732, 69250820, 202419494, 201383984); + TestUtils.AreEqual(r0, a0 & b0); + + int a1 = (2030124055); + int4x4 b1 = int4x4(1985961756, 579780373, 2061831301, 1139618293, 1145191868, 1121606282, 1414714065, 688688277, 1508875606, 664318814, 2092766410, 1010043618, 599967779, 47076367, 1325716015, 1119912335); + int4x4 r1 = int4x4(1879120916, 536886293, 2013334533, 1090596885, 1073757204, 1073747970, 1342181393, 687868949, 1493244950, 553660438, 2013336578, 939526146, 553650179, 5127, 1224740871, 1073741831); + TestUtils.AreEqual(r1, a1 & b1); + + int a2 = (2083412385); + int4x4 b2 = int4x4(1805692137, 1689798540, 265665838, 1616867488, 244288538, 688929004, 1157047188, 1381359113, 1562107079, 944933664, 1994959125, 1413414673, 1280114143, 1373827711, 1107998701, 890185579); + int4x4 r2 = int4x4(1746929825, 1680359808, 201595168, 1611550880, 202246144, 671094944, 1143341440, 1342461953, 1544181889, 939657504, 1948780801, 1412323585, 1275877761, 1344426017, 1074401697, 873333025); + TestUtils.AreEqual(r2, a2 & b2); + + int a3 = (195053206); + int4x4 b3 = int4x4(1877717925, 2063436477, 878745806, 1485028680, 1112745164, 1729117727, 660916495, 1196215754, 226023830, 283626389, 1719116288, 1596319327, 1706007294, 32695989, 728811929, 1229799524); + int4x4 r3 = int4x4(195035780, 178258580, 2097286, 142607360, 33555588, 50333206, 52445190, 50349186, 153108630, 10502804, 35652096, 186664470, 27263638, 27281044, 186663056, 151011332); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void int4x4_operator_bitwise_or_wide_wide() + { + int4x4 a0 = int4x4(1920951869, 1750772852, 1420019191, 732977093, 1169579447, 229437930, 1966721348, 2039812323, 113550869, 1912038362, 1569990624, 1490718227, 1686257697, 2137727522, 1569900650, 856504729); + int4x4 b0 = int4x4(214585254, 275414367, 858759675, 190211455, 1218691723, 2129565457, 1862809466, 495728846, 868064152, 1756913766, 933656055, 247722084, 1884195075, 1804207631, 1913174711, 1815920856); + int4x4 r0 = int4x4(2130669503, 2021326207, 2008016383, 737572863, 1303895999, 2146367483, 2134507390, 2107455727, 939376541, 2046780414, 2142664695, 1591475831, 1959708963, 2146117167, 2140863231, 2134768089); + TestUtils.AreEqual(r0, a0 | b0); + + int4x4 a1 = int4x4(2033376384, 2086259889, 671790684, 1189001916, 1756048437, 417084592, 2024165808, 966008272, 2031026290, 1461019191, 1071959084, 1645847295, 871350674, 736640317, 868515800, 767794452); + int4x4 b1 = int4x4(1226577606, 1696467642, 186912044, 1778908130, 1461256625, 1142152181, 272117331, 1162254035, 870448102, 1845053992, 257334526, 987295814, 1503050768, 1683307763, 1076253109, 1403888383); + int4x4 r1 = int4x4(2034163398, 2103430843, 724483964, 1860172798, 2142973365, 1558183925, 2025750515, 2111217619, 2079325174, 2147314239, 1073143038, 2061103871, 2080374162, 1878867455, 1944485885, 2146418687); + TestUtils.AreEqual(r1, a1 | b1); + + int4x4 a2 = int4x4(362186994, 96189073, 1924033224, 1971421809, 1826545883, 865329, 516571463, 371039923, 918186803, 1920664988, 452155520, 743961772, 1728213958, 825116968, 1597755374, 910392330); + int4x4 b2 = int4x4(561000721, 740143742, 343344681, 2074122472, 133130232, 108733999, 348566046, 1414140366, 975473487, 699452548, 1158934384, 1776041858, 1098964075, 1316223563, 1653177800, 679795328); + int4x4 r2 = int4x4(905361907, 767539967, 1996451561, 2141297401, 1879042043, 109000255, 516879199, 1449107455, 1052699519, 2080099740, 1609826288, 1843396526, 1736638447, 2139093867, 2143027182, 1053294218); + TestUtils.AreEqual(r2, a2 | b2); + + int4x4 a3 = int4x4(693462173, 779965187, 175928258, 1385704458, 1046509940, 18508109, 256469197, 470724351, 1132010845, 765120960, 1303071768, 951732863, 1964522596, 1159413431, 1665711360, 476367098); + int4x4 b3 = int4x4(1160679856, 1463165087, 225864530, 1687681609, 1534380366, 938828852, 1537113296, 522784628, 1469983598, 2040525960, 68341904, 1350736257, 467630862, 825069149, 655198246, 173368083); + int4x4 r3 = int4x4(1837102525, 2139059103, 259947474, 1990196811, 2138372478, 939486589, 1608482013, 523218943, 1476345727, 2107635144, 1304157336, 2025511935, 2145353582, 1967111935, 1733147942, 511044603); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void int4x4_operator_bitwise_or_wide_scalar() + { + int4x4 a0 = int4x4(1295304853, 1307252624, 350194630, 1128063578, 1774824542, 2085245467, 1988423804, 999162350, 2110327307, 1050875188, 341855232, 1317039676, 228656898, 41280811, 1536908787, 606786773); + int b0 = (1305527136); + int4x4 r0 = int4x4(1307888629, 1308350448, 1574947814, 1341973370, 1842999166, 2111492987, 2144662396, 2145305582, 2111425387, 2146686836, 1576062816, 1339092860, 1307690850, 1341515627, 1608245235, 1845155829); + TestUtils.AreEqual(r0, a0 | b0); + + int4x4 a1 = int4x4(1739461580, 1350320187, 1377874553, 1522262112, 1496806239, 1732466858, 1535976093, 375675620, 1614193383, 226059393, 697385997, 112556963, 1614163749, 1583289054, 1370656810, 1286074530); + int b1 = (2040936581); + int4x4 r1 = int4x4(2142125005, 2046720191, 2074524413, 2076178661, 2042067935, 2145876143, 2075081373, 2145811173, 2042018535, 2113895557, 2042068109, 2142731175, 2041986981, 2147433183, 2042017967, 2108160167); + TestUtils.AreEqual(r1, a1 | b1); + + int4x4 a2 = int4x4(1155438844, 440002979, 1569359727, 5393691, 774282482, 1217128427, 212144562, 1525899482, 463019249, 1531812233, 1944160603, 953179348, 1692078056, 1331652826, 183129856, 1305664018); + int b2 = (1835671387); + int4x4 r2 = int4x4(1845403647, 2138832891, 2112528255, 1836736347, 1869520891, 1844183035, 1844387835, 2147188699, 2147164155, 2138021851, 2146148187, 2113560543, 1845174267, 1870626779, 1877630811, 1845157723); + TestUtils.AreEqual(r2, a2 | b2); + + int4x4 a3 = int4x4(626899632, 2094300112, 1737365603, 1920526388, 1956204544, 1722269413, 961702184, 752387958, 160631159, 1859186074, 1291037807, 886605387, 496163558, 1615069781, 1118682069, 30965146); + int b3 = (1403426207); + int4x4 r3 = int4x4(2013249471, 2146893791, 2007932415, 1946090943, 2009060767, 2007482367, 2079784383, 2147391487, 1538760191, 2146893215, 1610071551, 2013173727, 1605820415, 1944491999, 1404026847, 1409219999); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void int4x4_operator_bitwise_or_scalar_wide() + { + int a0 = (1768627592); + int4x4 b0 = int4x4(1849658052, 1759912154, 729979455, 975926310, 1987690876, 1809506714, 1160695341, 408963395, 314072711, 1560007537, 1709003416, 977086639, 1448375596, 1689568808, 595543345, 559778387); + int4x4 r0 = int4x4(1870634956, 1777286618, 1810603967, 2070642094, 2138824188, 1811676570, 1836048301, 2037079499, 2080071567, 2113658873, 1845452696, 2071936431, 2139061676, 1845485480, 1803509177, 1769971675); + TestUtils.AreEqual(r0, a0 | b0); + + int a1 = (621080913); + int4x4 b1 = int4x4(438994183, 1742637145, 1219409263, 1602932494, 1204461702, 2111538444, 836730895, 1207638621, 802100209, 1089077339, 1315030334, 249047666, 1604790897, 1848168086, 347254235, 1777613639); + int4x4 r1 = int4x4(1060042071, 1742666073, 1840182655, 2140077919, 1741615575, 2111829341, 903868767, 1744829277, 802157553, 1710158171, 1868952959, 803011443, 2141715313, 1865220055, 901184987, 1844771671); + TestUtils.AreEqual(r1, a1 | b1); + + int a2 = (1876731927); + int4x4 b2 = int4x4(842785732, 1023558747, 1567635900, 1888818835, 1681286114, 816160472, 669874393, 856364582, 957707703, 533888601, 707380794, 1472392035, 1658477097, 490006292, 1104319323, 1803275943); + int4x4 r2 = int4x4(2147478487, 2145315935, 2147269055, 2145238679, 1878977527, 2147335903, 1878915295, 2145369655, 2145254839, 2145320543, 1878912575, 2145315703, 1876884031, 2147282711, 1876867935, 1879043767); + TestUtils.AreEqual(r2, a2 | b2); + + int a3 = (1843251082); + int4x4 b3 = int4x4(1971735860, 1170365407, 938567231, 165695098, 645196350, 1795857357, 2040732207, 1915771336, 1185590667, 720429375, 1993148654, 159915729, 856765461, 1859323098, 1361749181, 1346956647); + int4x4 r3 = int4x4(2111819710, 1843388383, 2147346367, 1845350394, 1878912958, 1876942799, 2113920943, 2147344330, 1879043979, 1878910911, 2145243118, 1843257307, 2145253279, 1876936666, 2113923007, 2111696879); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void int4x4_operator_bitwise_xor_wide_wide() + { + int4x4 a0 = int4x4(1843655608, 362425681, 640805534, 1342040268, 945678755, 980321850, 390165019, 1682422658, 303897251, 230477768, 1103646442, 1503102919, 26631152, 1016475570, 1862440929, 379588576); + int4x4 b0 = int4x4(1422803441, 1234691140, 119589253, 1101464929, 121896337, 1880109018, 1000210266, 1718938232, 464406940, 884337881, 34199854, 1430659227, 126415540, 1069919967, 1810763253, 2082802224); + int4x4 r0 = int4x4(959296073, 1544407317, 554771227, 240840109, 1058935858, 1249815008, 752651585, 36917754, 162747199, 956900113, 1136760772, 215066460, 102672708, 55804269, 82614804, 1787102672); + TestUtils.AreEqual(r0, a0 ^ b0); + + int4x4 a1 = int4x4(1943580404, 691527166, 723280696, 497086939, 1640104913, 893178410, 1596765788, 664096470, 2043360590, 799560121, 287637604, 696169196, 2067184169, 1208059988, 1250597330, 1386507647); + int4x4 b1 = int4x4(941097951, 27782297, 156353074, 607061607, 470737131, 1151564598, 8268481, 434405645, 519003095, 1880915120, 608970922, 1809455754, 1079250101, 514389994, 272120301, 1282399149); + int4x4 r1 = int4x4(1270918443, 680538471, 575512842, 965736380, 2110579514, 1906288924, 1599249565, 1047646171, 1730440857, 1605643529, 896084174, 1118087270, 996325020, 1453948862, 1521655871, 516667090); + TestUtils.AreEqual(r1, a1 ^ b1); + + int4x4 a2 = int4x4(1889791408, 2084012261, 308683100, 995657536, 2114803648, 1391716615, 1288505091, 1981377086, 1609802717, 1174043024, 1011203132, 1795164620, 244928755, 108081775, 1095776733, 1503947924); + int4x4 b2 = int4x4(1045003273, 1596550715, 1654640361, 147544177, 1770899808, 632909311, 351538321, 18362671, 582069925, 1343437834, 646157103, 1334609482, 1029555059, 1791514242, 2130180592, 1367984612); + int4x4 r2 = int4x4(1323995577, 589229790, 1895428021, 865328945, 394305184, 2001372408, 1480133522, 1996577553, 2101480824, 367609242, 449195795, 613191558, 868520832, 1824089325, 1067958317, 137209200); + TestUtils.AreEqual(r2, a2 ^ b2); + + int4x4 a3 = int4x4(1231713131, 1409256837, 71739867, 125722545, 1670829206, 1913595119, 1364737954, 520950663, 1245356662, 1052070924, 1245560924, 271196017, 1397322300, 1351621960, 1546558586, 1199251091); + int4x4 b3 = int4x4(1758262908, 551762515, 1215029402, 388720229, 652015944, 664221443, 63259885, 1715645848, 1189697317, 668527405, 43069813, 1243634305, 749402779, 1426611688, 1351626941, 2132106703); + int4x4 r3 = int4x4(564561175, 1931261910, 1278036289, 274020820, 1162489310, 1436029932, 1386052431, 2035269151, 215217491, 426622753, 1219293481, 1510622704, 2145618087, 93864096, 213822663, 946750300); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void int4x4_operator_bitwise_xor_wide_scalar() + { + int4x4 a0 = int4x4(169345668, 176087064, 2084362901, 1663924004, 193851255, 517476661, 905336222, 863800783, 365003873, 835837496, 954341348, 1464576786, 625604047, 1700827127, 2003392824, 1481813598); + int b0 = (354464228); + int4x4 r0 = int4x4(523809632, 526275068, 1763470193, 1980614336, 514678419, 200843473, 550954106, 643578923, 14759301, 619802588, 767731200, 1114315510, 812205099, 1883258387, 1649010908, 1299324858); + TestUtils.AreEqual(r0, a0 ^ b0); + + int4x4 a1 = int4x4(1077374714, 1991576049, 781860967, 60088394, 1196907956, 858716109, 858484213, 178843494, 1223183458, 866652388, 1771693181, 1206307664, 2037729583, 1324393116, 497725784, 1367278685); + int b1 = (1043379893); + int4x4 r1 = int4x4(2114443343, 1216724804, 279639762, 1034180351, 2036853505, 220086648, 219929408, 882399699, 1993931479, 228107857, 1470714568, 2044100069, 1195769754, 1891636265, 597297133, 1867494120); + TestUtils.AreEqual(r1, a1 ^ b1); + + int4x4 a2 = int4x4(962962860, 1570278596, 1744797352, 574677361, 1363709514, 1256194849, 801937870, 1010182360, 1851940033, 346084804, 1153678862, 443991213, 53881334, 2016754499, 1219039118, 98879165); + int b2 = (906632547); + int4x4 r2 = int4x4(258980047, 1804767655, 1375036363, 340458514, 1732416297, 2095717954, 432440493, 171718075, 1483227554, 581617831, 1925817197, 746379726, 893138069, 1312761376, 2124616429, 871291870); + TestUtils.AreEqual(r2, a2 ^ b2); + + int4x4 a3 = int4x4(1431003548, 1357679092, 1348322929, 109257274, 1305039919, 1464854602, 1225878688, 1485080510, 1118151444, 1798307920, 1281126688, 1804976766, 474757937, 1658928027, 456615564, 97298101); + int b3 = (1566042386); + int4x4 r3 = int4x4(136087694, 230383846, 218771299, 1540672296, 278838589, 169345368, 340166066, 97742508, 535972358, 912779586, 285972530, 918694764, 1092342307, 1068946057, 1180733342, 1486573479); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void int4x4_operator_bitwise_xor_scalar_wide() + { + int a0 = (1361775641); + int4x4 b0 = int4x4(1452773578, 459050892, 1986218254, 1689037698, 999278344, 1229114508, 1087843538, 733699740, 106187872, 1533632738, 1107817672, 492506236, 597602329, 1439603382, 1001169118, 1231718216); + int4x4 r0 = int4x4(129801427, 1249346453, 659047703, 898082715, 1789184785, 409583765, 301736139, 2056278661, 1467957369, 172125435, 321714385, 1282408549, 1924512768, 82155183, 1787276487, 406948689); + TestUtils.AreEqual(r0, a0 ^ b0); + + int a1 = (1693179077); + int4x4 b1 = int4x4(1050897427, 1796435561, 1100532547, 2106589181, 79691722, 851486414, 381749210, 1743618507, 2038827673, 1680906962, 161437943, 171927307, 277703584, 1344718195, 1634011177, 28540247); + int4x4 r1 = int4x4(1514713302, 267956908, 628299654, 425993016, 1616126735, 1445689867, 1915411231, 50748686, 493737564, 14370327, 1836352562, 1859435470, 1952888677, 885856694, 93246700, 1700307346); + TestUtils.AreEqual(r1, a1 ^ b1); + + int a2 = (1205447252); + int4x4 b2 = int4x4(150341716, 899457210, 1927941858, 1213321665, 1943899052, 1166699955, 244059986, 698605361, 770240668, 1451322609, 409403288, 227252138, 455879262, 1859170556, 2135312326, 436746325); + int4x4 r2 = int4x4(1328521728, 1917127406, 892576950, 260602773, 872686072, 39045095, 1230349574, 1853519205, 1781619400, 291030693, 1606374860, 1246903806, 1559592970, 688462504, 950005138, 1574015489); + TestUtils.AreEqual(r2, a2 ^ b2); + + int a3 = (843204844); + int4x4 b3 = int4x4(52615461, 2078810590, 1178449600, 1402670107, 1373081856, 1755048125, 1604469044, 2092902838, 1107934318, 1695691193, 926405595, 561772433, 1975967935, 188914543, 1621290142, 463965989); + int4x4 r3 = int4x4(828412361, 1235904818, 1954545196, 1641628919, 1670765036, 1524211793, 1843399128, 1325228378, 1884025986, 1464891733, 91593527, 322551677, 1199876179, 956355459, 1390453874, 702924745); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void int4x4_operator_left_shift() + { + int4x4 a0 = int4x4(1129100049, 829482269, 1571297368, 443753193, 1872142968, 249554593, 892627436, 980302862, 62369727, 849916599, 1271350845, 108441902, 1959056531, 1779118882, 1451674188, 2082026915); + int b0 = (218351941); + int4x4 r0 = int4x4(1771463200, 773628832, -1258091776, 1315200288, -220967168, -604187616, -1500693120, 1304920512, 1995831264, 1427527392, 2028521376, -824826432, -1734700448, 1097229376, -791066240, -2094615456); + TestUtils.AreEqual(r0, a0 << b0); + + int4x4 a1 = int4x4(1149883636, 186532735, 1487486874, 1498738574, 752067504, 1647167336, 772453640, 456967739, 947384545, 1463252873, 1315516161, 640579158, 56630178, 1650899378, 2142944517, 565484033); + int b1 = (1380536034); + int4x4 r1 = int4x4(304567248, 746130940, 1654980200, 1699987000, -1286697280, -2001265248, -1205152736, 1827870956, -505429116, 1558044196, 967097348, -1732650664, 226520712, -1986337080, -18156524, -2033031164); + TestUtils.AreEqual(r1, a1 << b1); + + int4x4 a2 = int4x4(965161323, 1821547426, 1959741996, 1189216014, 2088913234, 331636352, 1765476869, 1716088059, 2042799042, 1560870407, 1332136179, 1595140080, 1067324801, 948699739, 1516035622, 1153563832); + int b2 = (1634169280); + int4x4 r2 = int4x4(965161323, 1821547426, 1959741996, 1189216014, 2088913234, 331636352, 1765476869, 1716088059, 2042799042, 1560870407, 1332136179, 1595140080, 1067324801, 948699739, 1516035622, 1153563832); + TestUtils.AreEqual(r2, a2 << b2); + + int4x4 a3 = int4x4(1430593538, 229486560, 1384761698, 1777845122, 1613768084, 1329798580, 798843728, 2134269101, 924758423, 933785367, 1724594922, 339723704, 5739549, 1346500868, 1275889975, 1690441516); + int b3 = (1594641896); + int4x4 r3 = int4x4(1159725568, -1380982784, -1983290880, -138182144, 807769088, 1126020096, -1654435840, 912043264, 514955008, -1469114624, -885331456, 1069922304, 1469324544, 1106838528, 210319104, -1038668800); + TestUtils.AreEqual(r3, a3 << b3); + } + + [TestCompiler] + public static void int4x4_operator_right_shift() + { + int4x4 a0 = int4x4(809126085, 908563670, 763568837, 1986717290, 1174507510, 646821842, 1242726074, 390811632, 1521420393, 1923166649, 102096936, 400863878, 667378673, 1611921244, 307750782, 479442287); + int b0 = (994800051); + int4x4 r0 = int4x4(1543, 1732, 1456, 3789, 2240, 1233, 2370, 745, 2901, 3668, 194, 764, 1272, 3074, 586, 914); + TestUtils.AreEqual(r0, a0 >> b0); + + int4x4 a1 = int4x4(2014389412, 1075916177, 1248577253, 848199210, 813936577, 848976170, 500930883, 662405800, 126875849, 1103917083, 1199000503, 955487090, 1013356510, 391605984, 185228398, 87452680); + int b1 = (1673938174); + int4x4 r1 = int4x4(1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0); + TestUtils.AreEqual(r1, a1 >> b1); + + int4x4 a2 = int4x4(2021602226, 275199908, 664576720, 363706280, 1600231415, 19835299, 1403250657, 1132760506, 388419548, 1563117590, 1786307084, 1386128491, 1614558171, 370772389, 47213745, 1348912303); + int b2 = (1401766495); + int4x4 r2 = int4x4(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + TestUtils.AreEqual(r2, a2 >> b2); + + int4x4 a3 = int4x4(1452132416, 1998929045, 455362165, 2108410522, 180863474, 59587500, 262637954, 1324311490, 1047631661, 1690388406, 43725571, 1582808189, 508063883, 1531560665, 2064352185, 313411198); + int b3 = (241508868); + int4x4 r3 = int4x4(90758276, 124933065, 28460135, 131775657, 11303967, 3724218, 16414872, 82769468, 65476978, 105649275, 2732848, 98925511, 31753992, 95722541, 129022011, 19588199); + TestUtils.AreEqual(r3, a3 >> b3); + } + + [TestCompiler] + public static void int4x4_operator_bitwise_not() + { + int4x4 a0 = int4x4(111796841, 603562399, 745091931, 853183268, 1110916612, 381888399, 1891338755, 1506860135, 771210628, 787710759, 875964607, 96456785, 916013379, 203444882, 1172294211, 1020232736); + int4x4 r0 = int4x4(-111796842, -603562400, -745091932, -853183269, -1110916613, -381888400, -1891338756, -1506860136, -771210629, -787710760, -875964608, -96456786, -916013380, -203444883, -1172294212, -1020232737); + TestUtils.AreEqual(r0, ~a0); + + int4x4 a1 = int4x4(683852713, 881353367, 1218471344, 1174233245, 592898220, 443427914, 1385118179, 215320517, 860122767, 1411266016, 1349739899, 686325107, 829984855, 191189901, 319233142, 156019905); + int4x4 r1 = int4x4(-683852714, -881353368, -1218471345, -1174233246, -592898221, -443427915, -1385118180, -215320518, -860122768, -1411266017, -1349739900, -686325108, -829984856, -191189902, -319233143, -156019906); + TestUtils.AreEqual(r1, ~a1); + + int4x4 a2 = int4x4(1467719681, 957020051, 610113447, 1906177458, 1022824453, 1413628073, 1876376887, 479785538, 1454477141, 1062967600, 864049393, 916152339, 1644897753, 1624633488, 210894078, 759733457); + int4x4 r2 = int4x4(-1467719682, -957020052, -610113448, -1906177459, -1022824454, -1413628074, -1876376888, -479785539, -1454477142, -1062967601, -864049394, -916152340, -1644897754, -1624633489, -210894079, -759733458); + TestUtils.AreEqual(r2, ~a2); + + int4x4 a3 = int4x4(40062168, 316098272, 360895484, 1085047243, 142465498, 160134485, 1507457399, 637862751, 250793845, 1118106030, 541598856, 820535028, 2088709420, 596520858, 556731465, 2087920527); + int4x4 r3 = int4x4(-40062169, -316098273, -360895485, -1085047244, -142465499, -160134486, -1507457400, -637862752, -250793846, -1118106031, -541598857, -820535029, -2088709421, -596520859, -556731466, -2087920528); + TestUtils.AreEqual(r3, ~a3); + } + + [TestCase /* For player builds */] + public static void int4x4_EqualsObjectOverride() + { + TestUtils.IsFalse(new int4x4().Equals((object)new int())); + TestUtils.IsTrue(new int4x4().Equals((object)new int4x4())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestInt4x4.gen.cs.meta b/src/Tests/Tests/Shared/TestInt4x4.gen.cs.meta new file mode 100644 index 00000000..e4939a30 --- /dev/null +++ b/src/Tests/Tests/Shared/TestInt4x4.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 17b4cf050aaf4e44e965ec9de78ce8bd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestMath.cs b/src/Tests/Tests/Shared/TestMath.cs new file mode 100644 index 00000000..d22d82a7 --- /dev/null +++ b/src/Tests/Tests/Shared/TestMath.cs @@ -0,0 +1,4200 @@ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; +using System; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public partial class TestMath + { + [TestCompiler] + public static void asint_uint() + { + TestUtils.AreEqual(0, asint(0u)); + TestUtils.AreEqual(0x12345678, asint(0x12345678u)); + TestUtils.AreEqual(0x7FFFFFFF, asint(0x7FFFFFFFu)); + TestUtils.AreEqual(-2147483648, asint(0x80000000u)); + TestUtils.AreEqual(-2023406815, asint(0x87654321u)); + TestUtils.AreEqual(-1, asint(0xFFFFFFFFu)); + } + + [TestCompiler] + public static void asint_uint2() + { + TestUtils.AreEqual(int2(0, 0x12345678), asint(uint2(0u, 0x12345678u))); + TestUtils.AreEqual(int2(0x7FFFFFFF, -2147483648), asint(uint2(0x7FFFFFFFu, 0x80000000u))); + TestUtils.AreEqual(int2(-2023406815, -1), asint(uint2(0x87654321u, 0xFFFFFFFFu))); + } + + [TestCompiler] + public static void asint_uint3() + { + TestUtils.AreEqual(int3(0, 0x12345678, 0x7FFFFFFF), asint(uint3(0u, 0x12345678u, 0x7FFFFFFFu))); + TestUtils.AreEqual(int3(-2147483648, -2023406815, -1), asint(uint3(0x80000000u, 0x87654321u, 0xFFFFFFFFu))); + } + + [TestCompiler] + public static void asint_uint4() + { + TestUtils.AreEqual(int4(0, 0x12345678, 0x7FFFFFFF, -2147483648), asint(uint4(0u, 0x12345678u, 0x7FFFFFFFu, 0x80000000u))); + TestUtils.AreEqual(int4(-2023406815, -1, 0, 0), asint(uint4(0x87654321u, 0xFFFFFFFFu, 0u, 0u))); + } + + [TestCompiler] + public static void asint_float() + { + TestUtils.AreEqual(0, asint(0.0f)); + TestUtils.AreEqual(0x3F800000, asint(1.0f)); + TestUtils.AreEqual(0x449A51EC, asint(1234.56f)); + TestUtils.AreEqual(0x7F800000, asint(float.PositiveInfinity)); + TestUtils.AreEqual(unchecked((int)0xFFC00000), asint(TestUtils.SignedFloatQNaN())); + TestUtils.AreEqual(unchecked((int)0x7FC00000), asint(TestUtils.UnsignedFloatQNaN())); + + TestUtils.AreEqual(unchecked((int)0xBF800000), asint(-1.0f)); + TestUtils.AreEqual(unchecked((int)0xC49A51EC), asint(-1234.56f)); + TestUtils.AreEqual(unchecked((int)0xFF800000), asint(float.NegativeInfinity)); + } + + [TestCompiler] + [WindowsOnly("Mono on linux ignores signed zero.")] + public static void asint_float_signed_zero() + { + TestUtils.AreEqual(unchecked((int)0x80000000), asint(TestUtils.SignedFloatZero())); + } + + [TestCompiler] + public static void asint_float2() + { + TestUtils.AreEqual(int2(0, 0x3F800000), asint(float2(0.0f, 1.0f))); + TestUtils.AreEqual(int2(0x449A51EC, 0x7F800000), asint(float2(1234.56f, float.PositiveInfinity))); + TestUtils.AreEqual(int2(unchecked((int)0xFFC00000), unchecked((int)0xBF800000)), asint(float2(TestUtils.SignedFloatQNaN(), -1.0f))); + TestUtils.AreEqual(int2(unchecked((int)0x7FC00000), unchecked((int)0xBF800000)), asint(float2(TestUtils.UnsignedFloatQNaN(), -1.0f))); + + TestUtils.AreEqual(int2(unchecked((int)0xC49A51EC), unchecked((int)0xFF800000)), asint(float2(-1234.56f, float.NegativeInfinity))); + TestUtils.AreEqual(int2(0, 0), asint(float2(0.0f, 0.0f))); + } + + [TestCompiler] + [WindowsOnly("Mono on linux ignores signed zero.")] + public static void asint_float2_signed_zero() + { + TestUtils.AreEqual(int2(unchecked((int)0x80000000), unchecked((int)0x80000000)), asint(float2(TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero()))); + } + + [TestCompiler] + public static void asint_float3() + { + TestUtils.AreEqual(int3(0, 0x3F800000, 0x449A51EC), asint(float3(0.0f, 1.0f, 1234.56f))); + TestUtils.AreEqual(int3(0x7F800000, unchecked((int)0xFFC00000), unchecked((int)0xBF800000)), asint(float3(float.PositiveInfinity, TestUtils.SignedFloatQNaN(), -1.0f))); + TestUtils.AreEqual(int3(0x7F800000, unchecked((int)0x7FC00000), unchecked((int)0xBF800000)), asint(float3(float.PositiveInfinity, TestUtils.UnsignedFloatQNaN(), -1.0f))); + TestUtils.AreEqual(int3(unchecked((int)0xC49A51EC), unchecked((int)0xFF800000), 0), asint(float3(-1234.56f, float.NegativeInfinity, 0.0f))); + } + + [TestCompiler] + [WindowsOnly("Mono on linux ignores signed zero.")] + public static void asint_float3_signed_zero() + { + TestUtils.AreEqual(int3(unchecked((int)0x80000000), unchecked((int)0x80000000), unchecked((int)0x80000000)), asint(float3(TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero()))); + } + + [TestCompiler] + public static void asint_float4() + { + TestUtils.AreEqual(int4(0, 0x3F800000, 0x449A51EC, 0x7F800000), asint(float4(0.0f, 1.0f, 1234.56f, float.PositiveInfinity))); + TestUtils.AreEqual(int4(unchecked((int)0xFFC00000), unchecked((int)0xBF800000), unchecked((int)0xC49A51EC), unchecked((int)0xFF800000)), asint(float4(TestUtils.SignedFloatQNaN(), -1.0f, -1234.56f, float.NegativeInfinity))); + TestUtils.AreEqual(int4(unchecked((int)0x7FC00000), unchecked((int)0xBF800000), unchecked((int)0xC49A51EC), unchecked((int)0xFF800000)), asint(float4(TestUtils.UnsignedFloatQNaN(), -1.0f, -1234.56f, float.NegativeInfinity))); + } + + [TestCompiler] + [WindowsOnly("Mono on linux ignores signed zero.")] + public static void asint_float4_signed_zero() + { + TestUtils.AreEqual(int4(unchecked((int)0x80000000), unchecked((int)0x80000000), unchecked((int)0x80000000), unchecked((int)0x80000000)), asint(float4(TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero()))); + } + + [TestCompiler] + public static void asuint_int() + { + TestUtils.AreEqual(0u, asuint(0)); + TestUtils.AreEqual(0x12345678u, asuint(0x12345678)); + TestUtils.AreEqual(0x7FFFFFFFu, asuint(0x7FFFFFFF)); + TestUtils.AreEqual(0x80000000u, asuint(-2147483648)); + TestUtils.AreEqual(0x87654321u, asuint(-2023406815)); + TestUtils.AreEqual(0xFFFFFFFFu, asuint(-1)); + } + + [TestCompiler] + public static void asuint_int2() + { + TestUtils.AreEqual(uint2(0u, 0x12345678u), asuint(int2(0, 0x12345678))); + TestUtils.AreEqual(uint2(0x7FFFFFFFu, 0x80000000u), asuint(int2(0x7FFFFFFF, -2147483648))); + TestUtils.AreEqual(uint2(0x87654321u, 0xFFFFFFFFu), asuint(int2(-2023406815, -1))); + } + + [TestCompiler] + public static void asuint_int3() + { + TestUtils.AreEqual(uint3(0u, 0x12345678u, 0x7FFFFFFFu), asuint(int3(0, 0x12345678, 0x7FFFFFFF))); + TestUtils.AreEqual(uint3(0x80000000u, 0x87654321u, 0xFFFFFFFFu), asuint(int3(-2147483648, -2023406815, -1))); + } + + [TestCompiler] + public static void asuint_int4() + { + TestUtils.AreEqual(uint4(0u, 0x12345678u, 0x7FFFFFFFu, 0x80000000u), asuint(int4(0, 0x12345678, 0x7FFFFFFF, -2147483648))); + TestUtils.AreEqual(uint4(0x87654321u, 0xFFFFFFFFu, 0u, 0u), asuint(int4(-2023406815, -1, 0, 0))); + } + + [TestCompiler] + public static void asuint_float() + { + TestUtils.AreEqual(0u, asuint(0.0f)); + TestUtils.AreEqual(0x3F800000u, asuint(1.0f)); + TestUtils.AreEqual(0x449A51ECu, asuint(1234.56f)); + TestUtils.AreEqual(0x7F800000u, asuint(float.PositiveInfinity)); + TestUtils.AreEqual(0xFFC00000u, asuint(TestUtils.SignedFloatQNaN())); + TestUtils.AreEqual(0x7FC00000u, asuint(TestUtils.UnsignedFloatQNaN())); + + TestUtils.AreEqual(0xBF800000u, asuint(-1.0f)); + TestUtils.AreEqual(0xC49A51ECu, asuint(-1234.56f)); + TestUtils.AreEqual(0xFF800000u, asuint(float.NegativeInfinity)); + } + + [TestCompiler] + [WindowsOnly("Mono on linux ignores signed zero.")] + public static void asuint_float_signed_zero() + { + TestUtils.AreEqual(0x80000000u, asuint(TestUtils.SignedFloatZero())); + } + + [TestCompiler] + public static void asuint_float2() + { + TestUtils.AreEqual(uint2(0u, 0x3F800000u), asuint(float2(0.0f, 1.0f))); + TestUtils.AreEqual(uint2(0x449A51Ecu, 0x7F800000u), asuint(float2(1234.56f, float.PositiveInfinity))); + TestUtils.AreEqual(uint2(0xFFC00000u, 0xBF800000u), asuint(float2(TestUtils.SignedFloatQNaN(), -1.0f))); + TestUtils.AreEqual(uint2(0x7FC00000u, 0xBF800000u), asuint(float2(TestUtils.UnsignedFloatQNaN(), -1.0f))); + + TestUtils.AreEqual(uint2(0xC49A51ECu, 0xFF800000u), asuint(float2(-1234.56f, float.NegativeInfinity))); + } + + [TestCompiler] + [WindowsOnly("Mono on linux ignores signed zero.")] + public static void asuint_float2_signed_zero() + { + TestUtils.AreEqual(uint2(0x80000000u, 0x80000000u), asuint(float2(TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero()))); + } + + [TestCompiler] + public static void asuint_float3() + { + TestUtils.AreEqual(uint3(0u, 0x3F800000u, 0x449A51ECu), asuint(float3(0.0f, 1.0f, 1234.56f))); + TestUtils.AreEqual(uint3(0x7F800000u, 0xFFC00000u, 0xBF800000u), asuint(float3(float.PositiveInfinity, TestUtils.SignedFloatQNaN(), -1.0f))); + TestUtils.AreEqual(uint3(0x7F800000u, 0x7FC00000u, 0xBF800000u), asuint(float3(float.PositiveInfinity, TestUtils.UnsignedFloatQNaN(), -1.0f))); + TestUtils.AreEqual(uint3(0xC49A51ECu, 0xff800000u, 0u), asuint(float3(-1234.56f, float.NegativeInfinity, 0.0f))); + } + + [TestCompiler] + [WindowsOnly("Mono on linux ignores signed zero.")] + public static void asuint_float3_signed_zero() + { + TestUtils.AreEqual(uint3(0x80000000u, 0x80000000u, 0x80000000u), asuint(float3(TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero()))); + } + + [TestCompiler] + public static void asuint_float4() + { + TestUtils.AreEqual(uint4(0u, 0x3F800000u, 0x449A51ECu, 0x7F800000u), asuint(float4(0.0f, 1.0f, 1234.56f, float.PositiveInfinity))); + TestUtils.AreEqual(uint4(0xFFC00000u, 0xBF800000u, 0xC49A51ECu, 0xFF800000u), asuint(float4(TestUtils.SignedFloatQNaN(), -1.0f, -1234.56f, float.NegativeInfinity))); + TestUtils.AreEqual(uint4(0x7FC00000u, 0xBF800000u, 0xC49A51ECu, 0xFF800000u), asuint(float4(TestUtils.UnsignedFloatQNaN(), -1.0f, -1234.56f, float.NegativeInfinity))); + } + + [TestCompiler] + [WindowsOnly("Mono on linux ignores signed zero.")] + public static void asuint_float4_singed_zero() + { + TestUtils.AreEqual(uint4(0x80000000u, 0x80000000u, 0x80000000u, 0x80000000u), asuint(float4(TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero()))); + } + + [TestCompiler] + public static void aslong_ulong() + { + TestUtils.AreEqual(0L, aslong(0ul)); + TestUtils.AreEqual(0x0123456789ABCDEFL, aslong(0x0123456789ABCDEFul)); + TestUtils.AreEqual(0x7FFFFFFFFFFFFFFFL, aslong(0x7FFFFFFFFFFFFFFFul)); + TestUtils.AreEqual(-9223372036854775808L, aslong(0x8000000000000000ul)); + TestUtils.AreEqual(-81985529216486896L, aslong(0xFEDCBA9876543210ul)); + TestUtils.AreEqual(-1L, aslong(0xFFFFFFFFFFFFFFFFul)); + } + + [TestCompiler] + public static void aslong_double() + { + TestUtils.AreEqual(0L, aslong(0.0)); + TestUtils.AreEqual(0x3FF0000000000000L, aslong(1.0)); + TestUtils.AreEqual(0x40934A3D70A3D70AL, aslong(1234.56)); + TestUtils.AreEqual(0x7FF0000000000000L, aslong(double.PositiveInfinity)); + TestUtils.AreEqual(unchecked((long)0xFFF8000000000000UL), aslong(TestUtils.SignedDoubleQNaN())); + + TestUtils.AreEqual(unchecked((long)0xBFF0000000000000UL), aslong(-1.0)); + TestUtils.AreEqual(unchecked((long)0xC0934A3D70A3D70AUL), aslong(-1234.56)); + TestUtils.AreEqual(unchecked((long)0xFFF0000000000000UL), aslong(double.NegativeInfinity)); + } + + [TestCompiler] + [WindowsOnly("Mono on linux ignores signed zero.")] + public static void aslong_double_signed_zero() + { + TestUtils.AreEqual(unchecked((long)0x8000000000000000UL), aslong(TestUtils.SignedDoubleZero())); + } + + [TestCompiler] + public static void asulong_long() + { + TestUtils.AreEqual(0ul, asulong(0L)); + TestUtils.AreEqual(0x0123456789ABCDEFul, asulong(0x0123456789ABCDEFL)); + TestUtils.AreEqual(0x7FFFFFFFFFFFFFFFul, asulong(0x7FFFFFFFFFFFFFFFL)); + TestUtils.AreEqual(0x8000000000000000ul, asulong(-9223372036854775808L)); + TestUtils.AreEqual(0xFEDCBA9876543210ul, asulong(-81985529216486896L)); + TestUtils.AreEqual(0xFFFFFFFFFFFFFFFFul, asulong(-1L)); + } + + [TestCompiler] + public static void asulong_double() + { + TestUtils.AreEqual(0UL, asulong(0.0)); + TestUtils.AreEqual(0x3FF0000000000000UL, asulong(1.0)); + TestUtils.AreEqual(0x40934A3D70A3D70AUL, asulong(1234.56)); + TestUtils.AreEqual(0x7FF0000000000000UL, asulong(double.PositiveInfinity)); + TestUtils.AreEqual(0xFFF8000000000000UL, asulong(TestUtils.SignedDoubleQNaN())); + + TestUtils.AreEqual(0xBFF0000000000000UL, asulong(-1.0)); + TestUtils.AreEqual(0xC0934A3D70A3D70AUL, asulong(-1234.56)); + TestUtils.AreEqual(0xFFF0000000000000UL, asulong(double.NegativeInfinity)); + } + + [TestCompiler] + [WindowsOnly("Mono on linux ignores signed zero.")] + public static void asulong_double_signed_zero() + { + TestUtils.AreEqual(0x8000000000000000UL, asulong(TestUtils.SignedDoubleZero())); + } + + [TestCompiler] + public static void asfloat_int() + { + TestUtils.AreEqual(0.0f, asfloat(0)); + TestUtils.AreEqual(1.0f, asfloat(0x3F800000)); + TestUtils.AreEqual(1234.56f, asfloat(0x449A51EC)); + TestUtils.AreEqual(float.PositiveInfinity, asfloat(0x7F800000)); + TestUtils.AreEqual(-0.0f, asfloat(unchecked((int)0x80000000))); + TestUtils.AreEqual(-1.0f, asfloat(unchecked((int)0xBF800000))); + TestUtils.AreEqual(-1234.56f, asfloat(unchecked((int)0xC49A51EC))); + TestUtils.AreEqual(float.NegativeInfinity, asfloat(unchecked((int)0xFF800000))); + + TestUtils.AreEqual(asuint(TestUtils.SignedFloatQNaN()), asuint(asfloat(unchecked((int)0xFFC00000)))); + TestUtils.AreEqual(asuint(TestUtils.UnsignedFloatQNaN()), asuint(asfloat(unchecked((int)0x7FC00000)))); + } + + [TestCompiler] + public static void asfloat_int2() + { + TestUtils.AreEqual(float2(0.0f, 1.0f), asfloat(int2(0, 0x3F800000))); + TestUtils.AreEqual(float2(1234.56f, float.PositiveInfinity), asfloat(int2(0x449A51EC, 0x7F800000))); + TestUtils.AreEqual(float2(-0.0f, -1.0f), asfloat(int2(unchecked((int)0x80000000), unchecked((int)0xBF800000)))); + + TestUtils.AreEqual(float2(-1234.56f, float.NegativeInfinity), asfloat(int2(unchecked((int)0xC49A51EC), unchecked((int)0xFF800000)))); + TestUtils.AreEqual(asuint(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN())), asuint(asfloat(int2(unchecked((int)0xFFC00000), unchecked((int)0xFFC00000))))); + TestUtils.AreEqual(asuint(float2(TestUtils.UnsignedFloatQNaN(), TestUtils.UnsignedFloatQNaN())), asuint(asfloat(int2(unchecked((int)0x7FC00000), unchecked((int)0x7FC00000))))); + } + + [TestCompiler] + public static void asfloat_int3() + { + TestUtils.AreEqual(float3(0.0f, 1.0f, 1234.56f), asfloat(int3(0, 0x3F800000, 0x449A51EC))); + TestUtils.AreEqual(float3(float.PositiveInfinity, -0.0f, -1.0f), asfloat(int3(0x7F800000, unchecked((int)0x80000000), unchecked((int)0xBF800000)))); + + TestUtils.AreEqual(float3(-1234.56f, float.NegativeInfinity, 0.0f), asfloat(int3(unchecked((int)0xC49A51EC), unchecked((int)0xFF800000), 0))); + TestUtils.AreEqual(asuint(float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN())), asuint(asfloat(int3(unchecked((int)0xFFC00000), unchecked((int)0xFFC00000), unchecked((int)0xFFC00000))))); + TestUtils.AreEqual(asuint(float3(TestUtils.UnsignedFloatQNaN(), TestUtils.UnsignedFloatQNaN(), TestUtils.UnsignedFloatQNaN())), asuint(asfloat(int3(unchecked((int)0x7FC00000), unchecked((int)0x7FC00000), unchecked((int)0x7FC00000))))); + } + + [TestCompiler] + public static void asfloat_int4() + { + TestUtils.AreEqual(float4(0.0f, 1.0f, 1234.56f, float.PositiveInfinity), asfloat(int4(0, 0x3F800000, 0x449A51EC, 0x7F800000))); + TestUtils.AreEqual(float4(-0.0f, -1.0f, -1234.56f, float.NegativeInfinity), asfloat(int4(unchecked((int)0x80000000), unchecked((int)0xBF800000), unchecked((int)0xC49A51EC), unchecked((int)0xFF800000)))); + + TestUtils.AreEqual(asuint(float4(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN())), asuint(asfloat(int4(unchecked((int)0xFFC00000), unchecked((int)0xFFC00000), unchecked((int)0xFFC00000), unchecked((int)0xFFC00000))))); + TestUtils.AreEqual(asuint(float4(TestUtils.UnsignedFloatQNaN(), TestUtils.UnsignedFloatQNaN(), TestUtils.UnsignedFloatQNaN(), TestUtils.UnsignedFloatQNaN())), asuint(asfloat(int4(unchecked((int)0x7FC00000), unchecked((int)0x7FC00000), unchecked((int)0x7FC00000), unchecked((int)0x7FC00000))))); + } + + [TestCompiler] + public static void asfloat_uint() + { + TestUtils.AreEqual(0.0f, asfloat(0u)); + TestUtils.AreEqual(1.0f, asfloat(0x3F800000u)); + TestUtils.AreEqual(1234.56f, asfloat(0x449A51ECu)); + TestUtils.AreEqual(float.PositiveInfinity, asfloat(0x7F800000u)); + TestUtils.AreEqual(-0.0f, asfloat(0x80000000u)); + TestUtils.AreEqual(-1.0f, asfloat(0xBF800000u)); + TestUtils.AreEqual(-1234.56f, asfloat(0xC49A51ECu)); + TestUtils.AreEqual(float.NegativeInfinity, asfloat(0xFF800000u)); + + TestUtils.AreEqual(asuint(TestUtils.SignedFloatQNaN()), asuint(asfloat(0xFFC00000u))); + TestUtils.AreEqual(asuint(TestUtils.UnsignedFloatQNaN()), asuint(asfloat(0x7FC00000u))); + } + + [TestCompiler] + public static void asfloat_uint2() + { + TestUtils.AreEqual(float2(0.0f, 1.0f), asfloat(uint2(0u, 0x3F800000u))); + TestUtils.AreEqual(float2(1234.56f, float.PositiveInfinity), asfloat(uint2(0x449A51ECu, 0x7F800000u))); + TestUtils.AreEqual(float2(-0.0f, -1.0f), asfloat(uint2(0x80000000u, 0xBF800000u))); + + TestUtils.AreEqual(float2(-1234.56f, float.NegativeInfinity), asfloat(uint2(0xC49A51ECu, 0xFF800000u))); + TestUtils.AreEqual(asuint(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN())), asuint(asfloat(uint2(0xFFC00000u, 0xFFC00000u)))); + TestUtils.AreEqual(asuint(float2(TestUtils.UnsignedFloatQNaN(), TestUtils.UnsignedFloatQNaN())), asuint(asfloat(uint2(0x7FC00000u, 0x7FC00000u)))); + } + + [TestCompiler] + public static void asfloat_uint3() + { + TestUtils.AreEqual(float3(0.0f, 1.0f, 1234.56f), asfloat(uint3(0u, 0x3F800000u, 0x449A51ECu))); + TestUtils.AreEqual(float3(float.PositiveInfinity, -0.0f, -1.0f), asfloat(uint3(0x7F800000u, 0x80000000u, 0xBF800000u))); + + TestUtils.AreEqual(float3(-1234.56f, float.NegativeInfinity, 0.0f), asfloat(uint3(0xC49A51ECu, 0xFF800000u, 0u))); + TestUtils.AreEqual(asuint(float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN())), asuint(asfloat(uint3(0xFFC00000u, 0xFFC00000u, 0xFFC00000u)))); + TestUtils.AreEqual(asuint(float3(TestUtils.UnsignedFloatQNaN(), TestUtils.UnsignedFloatQNaN(), TestUtils.UnsignedFloatQNaN())), asuint(asfloat(uint3(0x7FC00000u, 0x7FC00000u, 0x7FC00000u)))); + } + + [TestCompiler] + public static void asfloat_uint4() + { + TestUtils.AreEqual(float4(0.0f, 1.0f, 1234.56f, float.PositiveInfinity), asfloat(uint4(0u, 0x3F800000u, 0x449A51ECu, 0x7F800000u))); + TestUtils.AreEqual(float4(-0.0f, -1.0f, -1234.56f, float.NegativeInfinity), asfloat(uint4(0x80000000u, 0xBF800000u, 0xC49A51ECu, 0xFF800000u))); + + TestUtils.AreEqual(asuint(float4(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN())), asuint(asfloat(uint4(0xFFC00000u, 0xFFC00000u, 0xFFC00000u, 0xFFC00000u)))); + TestUtils.AreEqual(asuint(float4(TestUtils.UnsignedFloatQNaN(), TestUtils.UnsignedFloatQNaN(), TestUtils.UnsignedFloatQNaN(), TestUtils.UnsignedFloatQNaN())), asuint(asfloat(uint4(0x7FC00000u, 0x7FC00000u, 0x7FC00000u, 0x7FC00000u)))); + } + + [TestCompiler] + public static void asdouble_long() + { + TestUtils.AreEqual(0.0, asdouble(0L)); + TestUtils.AreEqual(1.0, asdouble(0x3FF0000000000000L)); + TestUtils.AreEqual(1234.56, asdouble(0x40934A3D70A3D70AL)); + TestUtils.AreEqual(double.PositiveInfinity, asdouble(0x7FF0000000000000L)); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), asdouble(unchecked((long)0xFFF8000000000000UL))); + + TestUtils.AreEqual(-0.0, asdouble(unchecked((long)0x8000000000000000UL))); + TestUtils.AreEqual(-1.0, asdouble(unchecked((long)0xBFF0000000000000UL))); + TestUtils.AreEqual(-1234.56, asdouble(unchecked((long)0xC0934A3D70A3D70AUL))); + TestUtils.AreEqual(double.NegativeInfinity, asdouble(unchecked((long)0xFFF0000000000000UL))); + } + + [TestCompiler] + public static void asdouble_ulong() + { + TestUtils.AreEqual(0.0, asdouble(0UL)); + TestUtils.AreEqual(1.0, asdouble(0x3FF0000000000000UL)); + TestUtils.AreEqual(1234.56, asdouble(0x40934A3D70A3D70AUL)); + TestUtils.AreEqual(double.PositiveInfinity, asdouble(0x7FF0000000000000UL)); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), asdouble(0xFFF8000000000000UL)); + + TestUtils.AreEqual(-0.0, asdouble(0x8000000000000000UL)); + TestUtils.AreEqual(-1.0, asdouble(0xBFF0000000000000UL)); + TestUtils.AreEqual(-1234.56, asdouble(0xC0934A3D70A3D70AUL)); + TestUtils.AreEqual(double.NegativeInfinity, asdouble(0xFFF0000000000000UL)); + } + + [TestCompiler] + public static void faceforward_float2() + { + TestUtils.AreEqual(float2(-3.5f, 4.5f), faceforward(float2(3.5f, -4.5f), float2(1.0f, -2.0f), float2(3.0f, -4.0f))); + TestUtils.AreEqual(float2(3.5f, -4.5f), faceforward(float2(3.5f, -4.5f), float2(1.0f, -2.0f), float2(-3.0f, 4.0f))); + TestUtils.AreEqual(float2(-3.5f, 4.5f), faceforward(float2(3.5f, -4.5f), float2(1.0f, -2.0f), float2(0.0f, 0.0f))); + } + + [TestCompiler] + public static void faceforward_float3() + { + TestUtils.AreEqual(float3(-3.5f, 4.5f, -5.5f), faceforward(float3(3.5f, -4.5f, 5.5f), float3(1.0f, -2.0f, 3.0f), float3(3.0f, -4.0f, 5.0f))); + TestUtils.AreEqual(float3(3.5f, -4.5f, 5.5f), faceforward(float3(3.5f, -4.5f, 5.5f), float3(1.0f, -2.0f, 3.0f), float3(-3.0f, 4.0f, -5.0f))); + TestUtils.AreEqual(float3(-3.5f, 4.5f, -5.5f), faceforward(float3(3.5f, -4.5f, 5.5f), float3(1.0f, -2.0f, 3.0f), float3(0.0f, 0.0f, 0.0f))); + } + + [TestCompiler] + public static void faceforward_float4() + { + TestUtils.AreEqual(float4(-3.5f, 4.5f, -5.5f, 6.5f), faceforward(float4(3.5f, -4.5f, 5.5f, -6.5f), float4(1.0f, -2.0f, 3.0f, -4.0f), float4(3.0f, -4.0f, 5.0f, -6.0f))); + TestUtils.AreEqual(float4(3.5f, -4.5f, 5.5f, -6.5f), faceforward(float4(3.5f, -4.5f, 5.5f, -6.5f), float4(1.0f, -2.0f, 3.0f, -4.0f), float4(-3.0f, 4.0f, -5.0f, 6.0f))); + TestUtils.AreEqual(float4(-3.5f, 4.5f, -5.5f, 6.5f), faceforward(float4(3.5f, -4.5f, 5.5f, -6.5f), float4(1.0f, -2.0f, 3.0f, -4.0f), float4(0.0f, 0.0f, 0.0f, 0.0f))); + } + + [TestCompiler] + public static void faceforward_double2() + { + TestUtils.AreEqual(double2(-3.5, 4.5), faceforward(double2(3.5, -4.5), double2(1.0, -2.0), double2(3.0, -4.0))); + TestUtils.AreEqual(double2(3.5, -4.5), faceforward(double2(3.5, -4.5), double2(1.0, -2.0), double2(-3.0, 4.0))); + TestUtils.AreEqual(double2(-3.5, 4.5), faceforward(double2(3.5, -4.5), double2(1.0, -2.0), double2(0.0, 0.0))); + } + + [TestCompiler] + public static void faceforward_double3() + { + TestUtils.AreEqual(double3(-3.5, 4.5, -5.5), faceforward(double3(3.5, -4.5, 5.5), double3(1.0, -2.0, 3.0), double3(3.0, -4.0, 5.0))); + TestUtils.AreEqual(double3(3.5, -4.5, 5.5), faceforward(double3(3.5, -4.5, 5.5), double3(1.0, -2.0, 3.0), double3(-3.0, 4.0, -5.0))); + TestUtils.AreEqual(double3(-3.5, 4.5, -5.5), faceforward(double3(3.5, -4.5, 5.5), double3(1.0, -2.0, 3.0), double3(0.0, 0.0, 0.0))); + } + + [TestCompiler] + public static void faceforward_double4() + { + TestUtils.AreEqual(double4(-3.5, 4.5, -5.5, 6.5), faceforward(double4(3.5, -4.5, 5.5, -6.5), double4(1.0, -2.0, 3.0, -4.0), double4(3.0, -4.0, 5.0, -6.0))); + TestUtils.AreEqual(double4(3.5, -4.5, 5.5, -6.5), faceforward(double4(3.5, -4.5, 5.5, -6.5), double4(1.0, -2.0, 3.0, -4.0), double4(-3.0, 4.0, -5.0, 6.0))); + TestUtils.AreEqual(double4(-3.5, 4.5, -5.5, 6.5), faceforward(double4(3.5, -4.5, 5.5, -6.5), double4(1.0, -2.0, 3.0, -4.0), double4(0.0, 0.0, 0.0, 0.0))); + } + + [TestCompiler] + public static void modf_float() + { + float f, i; + f = modf(313.75f, out i); + TestUtils.AreEqual(313.0f, i); + TestUtils.AreEqual(0.75f, f); + + f = modf(-313.25f, out i); + TestUtils.AreEqual(-313.0f, i); + TestUtils.AreEqual(-0.25f, f); + + f = modf(-314.0f, out i); + TestUtils.AreEqual(-314.0f, i); + TestUtils.AreEqual(0.0f, f); + } + + [TestCompiler] + public static void modf_float2() + { + float2 f, i; + f = modf(float2(313.75f, -313.25f), out i); + TestUtils.AreEqual(float2(313.0f, -313.0f), i); + TestUtils.AreEqual(float2(0.75f, -0.25f), f); + + f = modf(float2(-314.0f, 7.5f), out i); + TestUtils.AreEqual(float2(-314.0f, 7.0f), i); + TestUtils.AreEqual(float2(0.0f, 0.5f), f); + } + + [TestCompiler] + public static void modf_float3() + { + float3 f, i; + f = modf(float3(313.75f, -313.25f, -314.0f), out i); + TestUtils.AreEqual(float3(313.0f, -313.0f, -314.0f), i); + TestUtils.AreEqual(float3(0.75f, -0.25f, 0.0f), f); + } + + [TestCompiler] + public static void modf_float4() + { + float4 f, i; + f = modf(float4(313.75f, -313.25f, -314.0f, 7.5f), out i); + TestUtils.AreEqual(float4(313.0f, -313.0f, -314.0f, 7.0f), i); + TestUtils.AreEqual(float4(0.75f, -0.25f, 0.0f, 0.5f), f); + } + + [TestCompiler] + public static void modf_double() + { + double f, i; + f = modf(313.75, out i); + TestUtils.AreEqual(313.0, i); + TestUtils.AreEqual(0.75, f); + + f = modf(-313.25, out i); + TestUtils.AreEqual(-313.0, i); + TestUtils.AreEqual(-0.25, f); + + f = modf(-314.0, out i); + TestUtils.AreEqual(-314.0, i); + TestUtils.AreEqual(0.0, f); + } + + [TestCompiler] + public static void modf_double2() + { + double2 f, i; + f = modf(double2(313.75, -313.25), out i); + TestUtils.AreEqual(double2(313.0, -313.0), i); + TestUtils.AreEqual(double2(0.75, -0.25), f); + + f = modf(double2(-314.0, 7.5), out i); + TestUtils.AreEqual(double2(-314.0, 7.0), i); + TestUtils.AreEqual(double2(0.0, 0.5), f); + } + + [TestCompiler] + public static void modf_double3() + { + double3 f, i; + f = modf(double3(313.75, -313.25, -314.0), out i); + TestUtils.AreEqual(double3(313.0, -313.0, -314.0), i); + TestUtils.AreEqual(double3(0.75, -0.25, 0.0), f); + } + + [TestCompiler] + public static void modf_double4() + { + double4 f, i; + f = modf(double4(313.75, -313.25, -314.0, 7.5), out i); + TestUtils.AreEqual(double4(313.0, -313.0, -314.0, 7.0), i); + TestUtils.AreEqual(double4(0.75, -0.25, 0.0, 0.5f), f); + } + + [TestCompiler] + public static void normalize_float2() + { + TestUtils.AreEqual(float2(0.504883f, -0.863188f), normalize(float2(3.1f, -5.3f)), 0.0001f); + TestUtils.AreEqual(true, all(isnan(normalize(float2(0.0f, 0.0f))))); + } + + [TestCompiler] + public static void normalize_float3() + { + TestUtils.AreEqual(float3(0.464916f, -0.794861f, 0.389932f), normalizesafe(float3(3.1f, -5.3f, 2.6f)), 0.0001f); + TestUtils.AreEqual(true, all(isnan(normalize(float3(0.0f, 0.0f, 0.0f))))); + } + + [TestCompiler] + public static void normalize_float4() + { + TestUtils.AreEqual(float4(0.234727f, -0.401308f, 0.196868f, 0.863191f), normalizesafe(float4(3.1f, -5.3f, 2.6f, 11.4f)), 0.0001f); + TestUtils.AreEqual(true, all(isnan(normalize(float4(0.0f, 0.0f, 0.0f, 0.0f))))); + } + + + [TestCompiler] + public static void normalize_double2() + { + TestUtils.AreEqual(double2(0.504883, -0.863188), normalize(double2(3.1, -5.3)), 0.0001); + TestUtils.AreEqual(true, all(isnan(normalize(double2(0.0, 0.0))))); + } + + [TestCompiler] + public static void normalize_double3() + { + TestUtils.AreEqual(double3(0.464916, -0.794861, 0.389932), normalizesafe(double3(3.1, -5.3, 2.6)), 0.0001); + TestUtils.AreEqual(true, all(isnan(normalize(double3(0.0, 0.0, 0.0))))); + } + + [TestCompiler] + public static void normalize_double4() + { + TestUtils.AreEqual(double4(0.234727, -0.401308, 0.196868, 0.863191), normalizesafe(double4(3.1, -5.3, 2.6, 11.4)), 0.0001); + TestUtils.AreEqual(true, all(isnan(normalize(double4(0.0, 0.0, 0.0, 0.0f))))); + } + + [TestCompiler] + public static void normalize_quaternion() + { + TestUtils.AreEqual(quaternion(0.234727f, -0.401308f, 0.196868f, 0.863191f), normalizesafe(quaternion(3.1f, -5.3f, 2.6f, 11.4f)), 0.0001f); + TestUtils.AreEqual(true, all(isnan(normalize(quaternion(0.0f, 0.0f, 0.0f, 0.0f)).value))); + } + + + [TestCompiler] + public static void normalizesafe_float2() + { + TestUtils.AreEqual(float2(0.504883f, -0.863188f), normalizesafe(float2(3.1f, -5.3f)), 0.0001f); + TestUtils.AreEqual(float2(0.0f, 0.0f), normalizesafe(float2(0.0f, 0.0f))); + TestUtils.AreEqual(float2(1.0f, 2.0f), normalizesafe(float2(0.0f, 0.0f), float2(1.0f, 2.0f))); + TestUtils.AreEqual(float2(0.447214f, 0.894427f), normalizesafe(float2(1e-18f, 2e-18f)), 0.0001f); + TestUtils.AreEqual(float2(1.0f, 2.0f), normalizesafe(float2(7.66e-20f, 7.66e-20f), float2(1.0f, 2.0f))); + } + + [TestCompiler] + public static void normalizesafe_float3() + { + TestUtils.AreEqual(float3(0.464916f, -0.794861f, 0.389932f), normalizesafe(float3(3.1f, -5.3f, 2.6f)), 0.0001f); + TestUtils.AreEqual(float3(0.0f, 0.0f, 0.0f), normalizesafe(float3(0.0f, 0.0f, 0.0f))); + TestUtils.AreEqual(float3(1.0f, 2.0f, 3.0f), normalizesafe(float3(0.0f, 0.0f, 0.0f), float3(1.0f, 2.0f, 3.0f))); + TestUtils.AreEqual(float3(0.267261f, 0.534523f, 0.801784f), normalizesafe(float3(1e-19f, 2e-19f, 3e-19f)), 0.0001f); + TestUtils.AreEqual(float3(1.0f, 2.0f, 3.0f), normalizesafe(float3(6.25e-20f, 6.25e-20f, 6.25e-20f), float3(1.0f, 2.0f, 3.0f))); + } + + [TestCompiler] + public static void normalizesafe_float4() + { + TestUtils.AreEqual(float4(0.234727f, -0.401308f, 0.196868f, 0.863191f), normalizesafe(float4(3.1f, -5.3f, 2.6f, 11.4f)), 0.0001f); + TestUtils.AreEqual(float4(0.0f, 0.0f, 0.0f, 0.0f), normalizesafe(float4(0.0f, 0.0f, 0.0f, 0.0f))); + TestUtils.AreEqual(float4(1.0f, 2.0f, 3.0f, 4.0f), normalizesafe(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(1.0f, 2.0f, 3.0f, 4.0f))); + TestUtils.AreEqual(float4(0.182574f, 0.3651484f, 0.547723f, 0.730297f), normalizesafe(float4(1e-19f, 2e-19f, 3e-19f, 4e-19f)), 0.0001f); + TestUtils.AreEqual(float4(1.0f, 2.0f, 3.0f, 4.0f), normalizesafe(float4(5.42e-20f, 5.42e-20f, 5.42e-20f, 5.42e-20f), float4(1.0f, 2.0f, 3.0f, 4.0f))); + } + + + [TestCompiler] + public static void normalizesafe_double2() + { + TestUtils.AreEqual(double2(0.504883, -0.863188), normalizesafe(double2(3.1, -5.3)), 0.0001); + TestUtils.AreEqual(double2(0.0, 0.0), normalizesafe(double2(0.0, 0.0))); + TestUtils.AreEqual(double2(1.0, 2.0), normalizesafe(double2(0.0, 0.0), double2(1.0, 2.0))); + TestUtils.AreEqual(double2(0.447214, 0.894427), normalizesafe(double2(1e-18, 2e-18)), 0.0001); + TestUtils.AreEqual(double2(1.0, 2.0), normalizesafe(double2(1.05e-154, 1.05e-154), double2(1.0, 2.0))); + } + + [TestCompiler] + public static void normalizesafe_double3() + { + TestUtils.AreEqual(double3(0.464916, -0.794861, 0.389932), normalizesafe(double3(3.1, -5.3, 2.6)), 0.0001); + TestUtils.AreEqual(double3(0.0, 0.0, 0.0), normalizesafe(double3(0.0, 0.0, 0.0))); + TestUtils.AreEqual(double3(1.0, 2.0, 3.0), normalizesafe(double3(0.0, 0.0, 0.0), double3(1.0, 2.0, 3.0))); + TestUtils.AreEqual(double3(0.267261, 0.534523, 0.801784), normalizesafe(double3(1e-19, 2e-19, 3e-19)), 0.0001); + TestUtils.AreEqual(double3(1.0, 2.0, 3.0), normalizesafe(double3(8.61e-155, 8.61e-155, 8.61e-155), double3(1.0, 2.0, 3.0))); + } + + [TestCompiler] + public static void normalizesafe_double4() + { + TestUtils.AreEqual(double4(0.234727, -0.401308, 0.196868, 0.863191), normalizesafe(double4(3.1, -5.3, 2.6, 11.4)), 0.0001); + TestUtils.AreEqual(double4(0.0, 0.0, 0.0, 0.0), normalizesafe(double4(0.0, 0.0, 0.0, 0.0))); + TestUtils.AreEqual(double4(1.0, 2.0, 3.0, 4.0), normalizesafe(double4(0.0, 0.0, 0.0, 0.0), double4(1.0, 2.0, 3.0, 4.0))); + TestUtils.AreEqual(double4(0.182574, 0.3651484, 0.547723, 0.730297), normalizesafe(double4(1e-19, 2e-19, 3e-19, 4e-19)), 0.0001); + TestUtils.AreEqual(double4(1.0, 2.0, 3.0, 4.0), normalizesafe(double4(7.45e-155, 7.45e-155, 7.45e-155, 7.45e-155), double4(1.0, 2.0, 3.0, 4.0))); + } + + [TestCompiler] + public static void normalizesafe_quaternion() + { + TestUtils.AreEqual(quaternion(0.234727f, -0.401308f, 0.196868f, 0.863191f), normalizesafe(quaternion(3.1f, -5.3f, 2.6f, 11.4f)), 0.0001f); + TestUtils.AreEqual(quaternion(0.0f, 0.0f, 0.0f, 1.0f), normalizesafe(quaternion(0.0f, 0.0f, 0.0f, 0.0f))); + TestUtils.AreEqual(quaternion(1.0f, 2.0f, 3.0f, 4.0f), normalizesafe(quaternion(0.0f, 0.0f, 0.0f, 0.0f), quaternion(1.0f, 2.0f, 3.0f, 4.0f))); + TestUtils.AreEqual(quaternion(0.182574f, 0.3651484f, 0.547723f, 0.730297f), normalizesafe(quaternion(1e-19f, 2e-19f, 3e-19f, 4e-19f)), 0.0001f); + TestUtils.AreEqual(quaternion(1.0f, 2.0f, 3.0f, 4.0f), normalizesafe(quaternion(5.42e-20f, 5.42e-20f, 5.42e-20f, 5.42e-20f), quaternion(1.0f, 2.0f, 3.0f, 4.0f))); + } + + [TestCompiler] + public static void f16tof32_float() + { + TestUtils.AreEqual(0x00000000, asuint(f16tof32(0x0000))); + TestUtils.AreEqual(0x3800C000, asuint(f16tof32(0x0203))); + TestUtils.AreEqual(0x40642000, asuint(f16tof32(0x4321))); + TestUtils.AreEqual(0x477FE000, asuint(f16tof32(0x7BFF))); + TestUtils.AreEqual(0x7F800000, asuint(f16tof32(0x7C00))); + TestUtils.AreEqual(true, isnan(f16tof32(0x7C01))); + + TestUtils.AreEqual(0x80000000, asuint(f16tof32(0x8000))); + TestUtils.AreEqual(0xB800C000, asuint(f16tof32(0x8203))); + TestUtils.AreEqual(0xC0642000, asuint(f16tof32(0xC321))); + TestUtils.AreEqual(0xC77FE000, asuint(f16tof32(0xFBFF))); + TestUtils.AreEqual(0xFF800000, asuint(f16tof32(0xFC00))); + TestUtils.AreEqual(true, isnan(f16tof32(0xFC01))); + } + + [TestCompiler] + public static void f16tof32_float2() + { + TestUtils.AreEqual(uint2(0x00000000, 0x3800C000), asuint(f16tof32(uint2(0x0000, 0x0203)))); + TestUtils.AreEqual(uint2(0x40642000, 0x477FE000), asuint(f16tof32(uint2(0x4321, 0x7BFF)))); + TestUtils.AreEqual(uint2(0x7F800000, 0x7F800000), asuint(f16tof32(uint2(0x7C00, 0x7C00)))); + TestUtils.AreEqual(true, all(isnan(f16tof32(uint2(0x7C01, 0x7C01))))); + + TestUtils.AreEqual(uint2(0x80000000, 0xB800C000), asuint(f16tof32(uint2(0x8000, 0x8203)))); + TestUtils.AreEqual(uint2(0xC0642000, 0xC77FE000), asuint(f16tof32(uint2(0xC321, 0xFBFF)))); + TestUtils.AreEqual(uint2(0xFF800000, 0xFF800000), asuint(f16tof32(uint2(0xFC00, 0xFC00)))); + TestUtils.AreEqual(true, all(isnan(f16tof32(uint2(0xFC01, 0xFC01))))); + } + + [TestCompiler] + public static void f16tof32_float3() + { + TestUtils.AreEqual(uint3(0x00000000, 0x3800C000, 0x40642000), asuint(f16tof32(uint3(0x0000, 0x0203, 0x4321)))); + TestUtils.AreEqual(uint3(0x477FE000, 0x7F800000, 0x7F800000), asuint(f16tof32(uint3(0x7BFF, 0x7C00, 0x7C00)))); + TestUtils.AreEqual(true, all(isnan(f16tof32(uint3(0x7C01, 0x7C01, 0x7C01))))); + + TestUtils.AreEqual(uint3(0x80000000, 0xB800C000, 0xC0642000), asuint(f16tof32(uint3(0x8000, 0x8203, 0xC321)))); + TestUtils.AreEqual(uint3(0xC77FE000, 0xFF800000, 0xFF800000), asuint(f16tof32(uint3(0xFBFF, 0xFC00, 0xFC00)))); + TestUtils.AreEqual(true, all(isnan(f16tof32(uint3(0xFC01, 0xFC01, 0xFC01))))); + } + + [TestCompiler] + public static void f16tof32_float4() + { + TestUtils.AreEqual(uint4(0x00000000, 0x3800C000, 0x40642000, 0x477FE000), asuint(f16tof32(uint4(0x0000, 0x0203, 0x4321, 0x7BFF)))); + TestUtils.AreEqual(uint4(0x7F800000, 0x7F800000, 0x7F800000, 0x7F800000), asuint(f16tof32(uint4(0x7C00, 0x7C00, 0x7C00, 0x7C00)))); + TestUtils.AreEqual(true, all(isnan(f16tof32(uint4(0x7C01, 0x7C01, 0x7C01, 0x7C01))))); + + TestUtils.AreEqual(uint4(0x80000000, 0xB800C000, 0xC0642000, 0xC77FE000), asuint(f16tof32(uint4(0x8000, 0x8203, 0xC321, 0xFBFF)))); + TestUtils.AreEqual(uint4(0xFF800000, 0xFF800000, 0xFF800000, 0xFF800000), asuint(f16tof32(uint4(0xFC00, 0xFC00, 0xFC00, 0xFC00)))); + TestUtils.AreEqual(true, all(isnan(f16tof32(uint4(0xFC01, 0xFC01, 0xFC01, 0xFC01))))); + } + + [TestCompiler] + public static void f32tof16_float() + { + TestUtils.AreEqual(0x0000, f32tof16(0.0f)); + TestUtils.AreEqual(0x0000, f32tof16(2.98e-08f)); + TestUtils.AreEqual(0x0001, f32tof16(5.96046448e-08f)); + TestUtils.AreEqual(0x57B6, f32tof16(123.4f)); + TestUtils.AreEqual(0x7BFF, f32tof16(65504.0f)); + TestUtils.AreEqual(0x7C00, f32tof16(65520.0f)); + TestUtils.AreEqual(0x7C00, f32tof16(float.PositiveInfinity)); + TestUtils.AreEqual(0xFE00, f32tof16(TestUtils.SignedFloatQNaN())); + + TestUtils.AreEqual(0x8000, f32tof16(-2.98e-08f)); + TestUtils.AreEqual(0x8001, f32tof16(-5.96046448e-08f)); + TestUtils.AreEqual(0xD7B6, f32tof16(-123.4f)); + TestUtils.AreEqual(0xFBFF, f32tof16(-65504.0f)); + TestUtils.AreEqual(0xFC00, f32tof16(-65520.0f)); + TestUtils.AreEqual(0xFC00, f32tof16(float.NegativeInfinity)); + } + + [TestCompiler] + [WindowsOnly("Mono on linux ignores signed zero.")] + public static void f32tof16_float_signed_zero() + { + TestUtils.AreEqual(0x8000, f32tof16(TestUtils.SignedFloatZero())); + } + + [TestCompiler] + public static void f32tof16_float2() + { + TestUtils.AreEqual(uint2(0x0000, 0x0000), f32tof16(float2(0.0f, 2.98e-08f))); + TestUtils.AreEqual(uint2(0x0001, 0x57B6), f32tof16(float2(5.96046448e-08f, 123.4f))); + TestUtils.AreEqual(uint2(0x7BFF, 0x7C00), f32tof16(float2(65504.0f, 65520.0f))); + TestUtils.AreEqual(uint2(0x7C00, 0xFE00), f32tof16(float2(float.PositiveInfinity, TestUtils.SignedFloatQNaN()))); + + TestUtils.AreEqual(uint2(0x8000, 0x8001), f32tof16(float2(-2.98e-08f, -5.96046448e-08f))); + TestUtils.AreEqual(uint2(0xD7B6, 0xFBFF), f32tof16(float2(-123.4f, -65504.0f))); + TestUtils.AreEqual(uint2(0xFC00, 0xFC00), f32tof16(float2(-65520.0f, float.NegativeInfinity))); + TestUtils.AreEqual(uint2(0xFC00, 0x0000), f32tof16(float2(float.NegativeInfinity, 0.0f))); + } + + [TestCompiler] + [WindowsOnly("Mono on linux ignores signed zero.")] + public static void f32tof16_float2_signed_zero() + { + TestUtils.AreEqual(uint2(0x8000, 0x8000), f32tof16(float2(TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero()))); + } + + [TestCompiler] + public static void f32tof16_float3() + { + TestUtils.AreEqual(uint3(0x0000, 0x0000, 0x0001), f32tof16(float3(0.0f, 2.98e-08f, 5.96046448e-08f))); + TestUtils.AreEqual(uint3(0x57B6, 0x7BFF, 0x7C00), f32tof16(float3(123.4f, 65504.0f, 65520.0f))); + TestUtils.AreEqual(uint3(0x7C00, 0xFE00, 0x8000), f32tof16(float3(float.PositiveInfinity, TestUtils.SignedFloatQNaN(), -2.98e-08f))); + + TestUtils.AreEqual(uint3(0x8001, 0xD7B6, 0xFBFF), f32tof16(float3(-5.96046448e-08f, -123.4f, -65504.0f))); + TestUtils.AreEqual(uint3(0xFC00, 0xFC00, 0x0000), f32tof16(float3(-65520.0f, float.NegativeInfinity, 0.0f))); + } + + [TestCompiler] + [WindowsOnly("Mono on linux ignores signed zero.")] + public static void f32tof16_float3_signed_zero() + { + TestUtils.AreEqual(uint3(0x8000, 0x8000, 0x8000), f32tof16(float3(TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero()))); + } + + [TestCompiler] + public static void f32tof16_float4() + { + TestUtils.AreEqual(uint4(0x0000, 0x0000, 0x0001, 0x57B6), f32tof16(float4(0.0f, 2.98e-08f, 5.96046448e-08f, 123.4f))); + TestUtils.AreEqual(uint4(0x7BFF, 0x7C00, 0x7C00, 0xFE00), f32tof16(float4(65504.0f, 65520.0f, float.PositiveInfinity, TestUtils.SignedFloatQNaN()))); + TestUtils.AreEqual(uint4(0x8000, 0x8001, 0xD7B6, 0xFBFF), f32tof16(float4(-2.98e-08f, -5.96046448e-08f, -123.4f, -65504.0f))); + TestUtils.AreEqual(uint4(0xFC00, 0xFC00, 0xFC00, 0x0000), f32tof16(float4(-65520.0f, float.NegativeInfinity, float.NegativeInfinity, 0.0f))); + } + + [TestCompiler] + [WindowsOnly("Mono on linux ignores signed zero.")] + public static void f32tof16_float4_signed_zero() + { + TestUtils.AreEqual(uint4(0x8000, 0x8000, 0x8000, 0x8000), f32tof16(float4(TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero()))); + } + + [TestCompiler] + public static void reflect_float2() + { + TestUtils.AreEqual(float2(9.84f, -3.888f), reflect(float2(1.2f, 3.6f), float2(1.5f, -1.3f)), 8, false); + TestUtils.AreEqual(float2(-9.84f, -3.888f), reflect(float2(-1.2f, 3.6f), float2(-1.5f, -1.3f)), 8, false); + TestUtils.AreEqual(float2(-1.2f, 3.6f), reflect(float2(-1.2f, 3.6f), float2(0.0f, 0.0f))); + TestUtils.AreEqual(float2(0.0f, 0.0f), reflect(float2(0.0f, 0.0f), float2(-1.5f, -1.3f)), 8, false); + } + + [TestCompiler] + public static void reflect_float3() + { + TestUtils.AreEqual(float3(35.88f, -26.456f, 68.872f), reflect(float3(1.2f, 3.6f, -2.8f), float3(1.5f, -1.3f, 3.1f)), 8, false); + TestUtils.AreEqual(float3(-35.88f, -26.456f, 68.872f), reflect(float3(-1.2f, 3.6f, -2.8f), float3(-1.5f, -1.3f, 3.1f)), 8, false); + TestUtils.AreEqual(float3(-1.2f, 3.6f, -2.8f), reflect(float3(-1.2f, 3.6f, -2.8f), float3(0.0f, 0.0f, 0.0f))); + TestUtils.AreEqual(float3(0.0f, 0.0f, 0.0f), reflect(float3(0.0f, 0.0f, 0.0f), float3(-1.5f, -1.3f, 3.1f)), 8, false); + } + + [TestCompiler] + public static void reflect_float4() + { + TestUtils.AreEqual(float4(36.51f, -27.002f, 70.174f, -16.178f), reflect(float4(1.2f, 3.6f, -2.8f, 0.3f), float4(1.5f, -1.3f, 3.1f, -0.7f)), 8, false); + TestUtils.AreEqual(float4(-36.51f, -27.002f, 70.174f, -16.178f), reflect(float4(-1.2f, 3.6f, -2.8f, 0.3f), float4(-1.5f, -1.3f, 3.1f, -0.7f)), 8, false); + TestUtils.AreEqual(float4(-1.2f, 3.6f, -2.8f, 0.3f), reflect(float4(-1.2f, 3.6f, -2.8f, 0.3f), float4(0.0f, 0.0f, 0.0f, 0.0f))); + TestUtils.AreEqual(float4(0.0f, 0.0f, 0.0f, 0.0f), reflect(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(-1.5f, -1.3f, 3.1f, -0.7f)), 8, false); + } + + + [TestCompiler] + public static void reflect_double2() + { + TestUtils.AreEqual(double2(9.84, -3.888), reflect(double2(1.2, 3.6), double2(1.5, -1.3)), 8, false); + TestUtils.AreEqual(double2(-9.84, -3.888), reflect(double2(-1.2, 3.6), double2(-1.5, -1.3)), 8, false); + TestUtils.AreEqual(double2(-1.2, 3.6), reflect(double2(-1.2, 3.6), double2(0.0, 0.0))); + TestUtils.AreEqual(double2(0.0, 0.0), reflect(double2(0.0, 0.0), double2(-1.5, -1.3)), 8, false); + } + + [TestCompiler] + public static void reflect_double3() + { + TestUtils.AreEqual(double3(35.88, -26.456, 68.872), reflect(double3(1.2, 3.6, -2.8), double3(1.5, -1.3, 3.1)), 8, false); + TestUtils.AreEqual(double3(-35.88, -26.456, 68.872), reflect(double3(-1.2, 3.6, -2.8), double3(-1.5, -1.3, 3.1)), 8, false); + TestUtils.AreEqual(double3(-1.2, 3.6, -2.8), reflect(double3(-1.2, 3.6, -2.8), double3(0.0, 0.0, 0.0))); + TestUtils.AreEqual(double3(0.0, 0.0, 0.0), reflect(double3(0.0, 0.0, 0.0), double3(-1.5f, -1.3, 3.1)), 8, false); + } + + [TestCompiler] + public static void reflect_double4() + { + TestUtils.AreEqual(double4(36.51, -27.002, 70.174, -16.178), reflect(double4(1.2, 3.6, -2.8, 0.3), double4(1.5, -1.3, 3.1, -0.7)), 8, false); + TestUtils.AreEqual(double4(-36.51, -27.002, 70.174, -16.178), reflect(double4(-1.2, 3.6, -2.8, 0.3), double4(-1.5, -1.3, 3.1, -0.7)), 8, false); + TestUtils.AreEqual(double4(-1.2, 3.6, -2.8, 0.3), reflect(double4(-1.2, 3.6, -2.8, 0.3), double4(0.0, 0.0, 0.0, 0.0))); + TestUtils.AreEqual(double4(0.0, 0.0, 0.0, 0.0), reflect(double4(0.0, 0.0, 0.0, 0.0), double4(-1.5, -1.3, 3.1, -0.7)), 8, false); + } + + + [TestCompiler] + public static void refract_float2() + { + TestUtils.AreEqual(float2(-0.3676186f, 0.9299768f), refract(float2(0.316228f, 0.948683f), float2(0.755689f, -0.654931f), 0.5f), 8, false); + TestUtils.AreEqual(float2(0.4523711f, 0.8918296f), refract(float2(0.316228f, 0.948683f), float2(0.755689f, -0.654931f), 1.05f), 8, false); + TestUtils.AreEqual(float2(0.0f, 0.0f), refract(float2(0.316228f, 0.948683f), float2(0.755689f, -0.654931f), 1.5f)); + } + + [TestCompiler] + public static void refract_float3() + { + TestUtils.AreEqual(float3(-0.2863437f, 0.8056898f, -0.5185286f), refract(float3(0.288375f, 0.865125f, -0.410365f), float3(0.662147f, -0.573861f, 0.481919f), 0.5f), 8, false); + TestUtils.AreEqual(float3(0.3743219f, 0.8463902f, -0.3788242f), refract(float3(0.288375f, 0.865125f, -0.410365f), float3(0.662147f, -0.573861f, 0.481919f), 1.05f), 8, false); + TestUtils.AreEqual(float3(0.0f, 0.0f, 0.0f), refract(float3(0.288375f, 0.865125f, -0.410365f), float3(0.662147f, -0.573861f, 0.481919f), 1.5f)); + } + + [TestCompiler] + public static void refract_float4() + { + TestUtils.AreEqual(float4(-0.302029191645545f, 0.799522577847971f, -0.518952508802814f, -0.015196476378571f), refract(float4(0.278154f, 0.834461f, -0.39582f, -0.26388f), float4(0.652208f, -0.565247f, 0.474685f, -0.1726139f), 0.5f), 16, false); + TestUtils.AreEqual(float4(0.378159678850401f, 0.801565792862319f, -0.352947832589293f, -0.299860642333894f), refract(float4(0.278154f, 0.834461f, -0.39582f, -0.26388f), float4(0.652208f, -0.565247f, 0.474685f, -0.172613f), 1.05f), 16, false); + TestUtils.AreEqual(float4(0.0f, 0.0f, 0.0f, 0.0f), refract(float4(0.278154f, 0.834461f, -0.39582f, -0.26388f), float4(0.652208f, -0.565247f, 0.474685f, -0.172613f), 1.5f)); + } + + + [TestCompiler] + public static void refract_double2() + { + TestUtils.AreEqual(double2(-0.367618540673032, 0.929976739623085), refract(double2(0.316228, 0.948683), double2(0.755689, -0.654931), 0.5), 8, false); + TestUtils.AreEqual(double2(0.452371226326029, 0.891829482258995), refract(double2(0.316228, 0.948683), double2(0.755689, -0.654931), 1.05), 8, false); + TestUtils.AreEqual(double2(0.0, 0.0), refract(double2(0.316228, 0.948683), double2(0.755689, -0.654931), 1.5)); + } + + [TestCompiler] + public static void refract_double3() + { + TestUtils.AreEqual(double3(-0.286343746291412, 0.805689753507206, -0.518528611485079), refract(double3(0.288375, 0.865125, -0.410365), double3(0.662147, -0.573861, 0.481919), 0.5), 8, false); + TestUtils.AreEqual(double3(0.374321889019825, 0.846390167376268, -0.378824161567529), refract(double3(0.288375, 0.865125, -0.410365), double3(0.662147, -0.573861, 0.481919), 1.05), 8, false); + TestUtils.AreEqual(double3(0.0, 0.0, 0.0), refract(double3(0.288375, 0.865125, -0.410365), double3(0.662147, -0.573861, 0.481919), 1.5)); + } + + [TestCompiler] + public static void refract_double4() + { + TestUtils.AreEqual(double4(-0.302029191645545, 0.799522577847971, -0.518952508802814, -0.015196476378571), refract(double4(0.278154, 0.834461, -0.39582, -0.26388), double4(0.652208, -0.565247, 0.474685, -0.1726139), 0.5), 16, false); + TestUtils.AreEqual(double4(0.378159678850401, 0.801565792862319, -0.352947832589293, -0.299860642333894), refract(double4(0.278154, 0.834461, -0.39582, -0.26388), double4(0.652208, -0.565247, 0.474685, -0.172613), 1.05), 16, false); + TestUtils.AreEqual(double4(0.0, 0.0, 0.0, 0.0), refract(double4(0.278154, 0.834461, -0.39582, -0.26388), double4(0.652208, -0.565247, 0.474685, -0.172613), 1.5)); + } + + [TestCompiler] + public static void project_float2() + { + var a = float2(-0.161021441221237182617f, 0.429202795028686523438f); + var b = float2(-0.0599312856793403625488f, -0.150524005293846130371f); + TestUtils.AreEqual(float2(0.125471457839012145996f, 0.315135329961776733398f), project(a, b), 1, true); + TestUtils.AreEqual(float2(1.0f, 0.0f), project(float2(1.0f), float2(1.0f, 0.0f))); + } + + [TestCompiler] + public static void project_float3() + { + var a = float3(0.394884318113327026367f, 0.148208647966384887695f, -0.264224529266357421875f); + var b = float3(-0.101686701178550720215f, 0.206427112221717834473f, 0.232919931411743164063f); + TestUtils.AreEqual(float3(0.0674439668655395507813f, -0.136913314461708068848f, -0.15448474884033203125f), project(a, b), 1, true); + TestUtils.AreEqual(float3(1.0f, 0.0f, 0.0f), project(float3(1.0f), float3(1.0f, 0.0f, 0.0f))); + } + + [TestCompiler] + public static void project_float4() + { + var a = float4(0.122686818242073059082f, 0.465182095766067504883f, -0.388583064079284667969f, -0.15201015770435333252f); + var b = float4(-0.309838652610778808594f, -0.456567704677581787109f, 0.36733195185661315918f, -0.222711801528930664063f); + TestUtils.AreEqual(float4(0.227654770016670227051f, 0.335464328527450561523f, -0.269898116588592529297f, 0.163638085126876831055f), project(a, b), 1, true); + TestUtils.AreEqual(float4(1.0f, 0.0f, 0.0f, 0.0f), project(float4(1.0f), float4(1.0f, 0.0f, 0.0f, 0.0f))); + } + + [TestCompiler] + public static void projectsafe_float2() + { + var a = float2(-0.161021441221237182617f, 0.429202795028686523438f); + var b = float2(-0.0599312856793403625488f, -0.150524005293846130371f); + TestUtils.AreEqual(float2(0.125471457839012145996f, 0.315135329961776733398f), projectsafe(a, b), 1, true); + TestUtils.AreEqual(float2(1.0f, 0.0f), projectsafe(float2(1.0f), float2(1.0f, 0.0f))); + TestUtils.AreEqual(float2(1.0f), projectsafe(a, float2(FLT_MIN_NORMAL), float2(1.0f))); + TestUtils.AreEqual(float2(3.0f), projectsafe(float2(Single.MaxValue), float2(1.0f), float2(3.0f))); + TestUtils.AreEqual(float2(4.0f), projectsafe(float2(NAN), float2(0.0f), float2(4.0f))); + } + + [TestCompiler] + public static void projectsafe_float3() + { + var a = float3(0.394884318113327026367f, 0.148208647966384887695f, -0.264224529266357421875f); + var b = float3(-0.101686701178550720215f, 0.206427112221717834473f, 0.232919931411743164063f); + TestUtils.AreEqual(float3(0.0674439668655395507813f, -0.136913314461708068848f, -0.15448474884033203125f), projectsafe(a, b), 1, true); + TestUtils.AreEqual(float3(1.0f, 0.0f, 0.0f), projectsafe(float3(1.0f), float3(1.0f, 0.0f, 0.0f))); + TestUtils.AreEqual(float3(1.0f), projectsafe(a, float3(FLT_MIN_NORMAL), float3(1.0f))); + TestUtils.AreEqual(float3(3.0f), projectsafe(float3(Single.MaxValue), float3(1.0f), float3(3.0f))); + TestUtils.AreEqual(float3(4.0f), projectsafe(float3(NAN), float3(0.0f), float3(4.0f))); + } + + [TestCompiler] + public static void projectsafe_float4() + { + var a = float4(0.122686818242073059082f, 0.465182095766067504883f, -0.388583064079284667969f, -0.15201015770435333252f); + var b = float4(-0.309838652610778808594f, -0.456567704677581787109f, 0.36733195185661315918f, -0.222711801528930664063f); + TestUtils.AreEqual(float4(0.227654770016670227051f, 0.335464328527450561523f, -0.269898116588592529297f, 0.163638085126876831055f), projectsafe(a, b), 1, true); + TestUtils.AreEqual(float4(1.0f, 0.0f, 0.0f, 0.0f), projectsafe(float4(1.0f), float4(1.0f, 0.0f, 0.0f, 0.0f))); + TestUtils.AreEqual(float4(1.0f), projectsafe(a, float4(FLT_MIN_NORMAL), float4(1.0f))); + TestUtils.AreEqual(float4(3.0f), projectsafe(float4(Single.MaxValue), float4(1.0f), float4(3.0f))); + TestUtils.AreEqual(float4(4.0f), projectsafe(float4(NAN), float4(0.0f), float4(4.0f))); + } + + [TestCompiler] + public static void project_double2() + { + var a = double2(-0.435219509355847911092, -0.359623376546357509387); + var b = double2(-0.332390389310175893289, 0.358699148796679301299); + TestUtils.AreEqual(double2(-0.0217742941367157077925, 0.0234977334594353125252), project(a, b), 1, true); + TestUtils.AreEqual(double2(1.0, 0.0), project(double2(1.0), double2(1.0, 0.0))); + TestUtils.AreEqual(double2.zero, projectsafe(a, double2(DBL_MIN_NORMAL))); + } + + [TestCompiler] + public static void project_double3() + { + var a = double3(-0.3102470377532390855, -0.255432695780735075086, -0.180834679740036918805); + var b = double3(-0.203341282534090506129, -0.470673723467076310367, -0.488817492459550251294); + TestUtils.AreEqual(double3(-0.110096727918742851027, -0.254840710284045091072, -0.26466443900892921981), project(a, b), 1, true); + TestUtils.AreEqual(double3(1.0, 0.0, 0.0), project(double3(1.0), double3(1.0, 0.0, 0.0))); + TestUtils.AreEqual(double3.zero, projectsafe(a, double3(DBL_MIN_NORMAL))); + } + + [TestCompiler] + public static void project_double4() + { + var a = double4(0.452051837682779789063, -0.0365627422588526429514, 0.236716008642456676725, 0.397823192622046239997); + var b = double4(0.294256018645240757792, 0.062793063668604487404, 0.0790497661060386436205, 0.396864526681538709596); + TestUtils.AreEqual(double4(0.355631654768521932031, 0.0758903802316912984294, 0.0955378899598586933672, 0.479642146293154714165), project(a, b), 1, true); + TestUtils.AreEqual(double4(1.0, 0.0, 0.0, 0.0), project(double4(1.0), double4(1.0, 0.0, 0.0, 0.0))); + TestUtils.AreEqual(double4.zero, projectsafe(a, double4(DBL_MIN_NORMAL))); + } + + [TestCompiler] + public static void projectsafe_double2() + { + var a = double2(-0.435219509355847911092, -0.359623376546357509387); + var b = double2(-0.332390389310175893289, 0.358699148796679301299); + TestUtils.AreEqual(double2(-0.0217742941367157077925, 0.0234977334594353125252), projectsafe(a, b), 1, true); + TestUtils.AreEqual(double2(1.0, 0.0), projectsafe(double2(1.0), double2(1.0, 0.0))); + TestUtils.AreEqual(double2(1.0), projectsafe(a, double2(DBL_MIN_NORMAL), double2(1.0))); + TestUtils.AreEqual(double2(3.0), projectsafe(double2(Double.MaxValue), double2(1.0), double2(3.0))); + TestUtils.AreEqual(double2(4.0), projectsafe(double2(NAN_DBL), double2(0.0), double2(4.0))); + } + + [TestCompiler] + public static void projectsafe_double3() + { + var a = double3(-0.3102470377532390855, -0.255432695780735075086, -0.180834679740036918805); + var b = double3(-0.203341282534090506129, -0.470673723467076310367, -0.488817492459550251294); + TestUtils.AreEqual(double3(-0.110096727918742851027, -0.254840710284045091072, -0.26466443900892921981), projectsafe(a, b), 1, true); + TestUtils.AreEqual(double3(1.0, 0.0, 0.0), projectsafe(double3(1.0), double3(1.0, 0.0, 0.0))); + TestUtils.AreEqual(double3(1.0), projectsafe(a, double3(DBL_MIN_NORMAL), double3(1.0))); + TestUtils.AreEqual(double3(3.0), projectsafe(double3(Double.MaxValue), double3(1.0), double3(3.0))); + TestUtils.AreEqual(double3(4.0), projectsafe(double3(NAN_DBL), double3(0.0), double3(4.0))); + } + + [TestCompiler] + public static void projectsafe_double4() + { + var a = double4(0.452051837682779789063, -0.0365627422588526429514, 0.236716008642456676725, 0.397823192622046239997); + var b = double4(0.294256018645240757792, 0.062793063668604487404, 0.0790497661060386436205, 0.396864526681538709596); + TestUtils.AreEqual(double4(0.355631654768521932031, 0.0758903802316912984294, 0.0955378899598586933672, 0.479642146293154714165), projectsafe(a, b), 1, true); + TestUtils.AreEqual(double4(1.0, 0.0, 0.0, 0.0), projectsafe(double4(1.0), double4(1.0, 0.0, 0.0, 0.0))); + TestUtils.AreEqual(double4(1.0), projectsafe(a, double4(DBL_MIN_NORMAL), double4(1.0))); + TestUtils.AreEqual(double4(3.0), projectsafe(double4(Double.MaxValue), double4(1.0), double4(3.0))); + TestUtils.AreEqual(double4(4.0), projectsafe(double4(NAN_DBL), double4(0.0), double4(4.0))); + } + + [TestCompiler] + public static void sincos_float() + { + float s, c; + + sincos(-1000000f, out s, out c); + TestUtils.AreEqual(0.3499935f, s, 1, false); + TestUtils.AreEqual(0.936752141f, c, 8, false); + + sincos(-1.2f, out s, out c); + TestUtils.AreEqual(-0.9320391f, s, 1, false); + TestUtils.AreEqual(0.362357765f, c, 8, false); + + sincos(0f, out s, out c); + TestUtils.AreEqual(0f, s, 1, false); + TestUtils.AreEqual(1f, c, 8, false); + + sincos(1.2f, out s, out c); + TestUtils.AreEqual(0.9320391f, s, 1, false); + TestUtils.AreEqual(0.362357765f, c, 8, false); + + sincos(1000000f, out s, out c); + TestUtils.AreEqual(-0.3499935f, s, 1, false); + TestUtils.AreEqual(0.936752141f, c, 8, false); + + sincos(float.NegativeInfinity, out s, out c); + TestUtils.AreEqual(float.NaN, s, 1, false); + TestUtils.AreEqual(float.NaN, c, 8, false); + + sincos(float.NaN, out s, out c); + TestUtils.AreEqual(float.NaN, s, 1, false); + TestUtils.AreEqual(float.NaN, c, 8, false); + + sincos(float.PositiveInfinity, out s, out c); + TestUtils.AreEqual(float.NaN, s, 1, false); + TestUtils.AreEqual(float.NaN, c, 8, false); + } + + + [TestCompiler] + public static void sincos_float2() + { + float2 s, c; + + sincos(float2(-1000000f, -1.2f), out s, out c); + TestUtils.AreEqual(float2(0.3499935f, -0.9320391f), s, 1, false); + TestUtils.AreEqual(float2(0.936752141f, 0.362357765f), c, 8, false); + + sincos(float2(0f, 1.2f), out s, out c); + TestUtils.AreEqual(float2(0f, 0.9320391f), s, 1, false); + TestUtils.AreEqual(float2(1f, 0.362357765f), c, 8, false); + + sincos(float2(1000000f, float.NegativeInfinity), out s, out c); + TestUtils.AreEqual(float2(-0.3499935f, float.NaN), s, 1, false); + TestUtils.AreEqual(float2(0.936752141f, float.NaN), c, 8, false); + + sincos(float2(float.NaN, float.PositiveInfinity), out s, out c); + TestUtils.AreEqual(float2(float.NaN, float.NaN), s, 1, false); + TestUtils.AreEqual(float2(float.NaN, float.NaN), c, 8, false); + } + + [TestCompiler] + public static void sincos_float3() + { + float3 s, c; + + sincos(float3(-1000000f, -1.2f, 0f), out s, out c); + TestUtils.AreEqual(float3(0.3499935f, -0.9320391f, 0f), s, 1, false); + TestUtils.AreEqual(float3(0.936752141f, 0.362357765f, 1f), c, 8, false); + + sincos(float3(1.2f, 1000000f, float.NegativeInfinity), out s, out c); + TestUtils.AreEqual(float3(0.9320391f, -0.3499935f, float.NaN), s, 1, false); + TestUtils.AreEqual(float3(0.362357765f, 0.936752141f, float.NaN), c, 8, false); + + sincos(float3(float.NaN, float.PositiveInfinity, float.PositiveInfinity), out s, out c); + TestUtils.AreEqual(float3(float.NaN, float.NaN, float.NaN), s, 1, false); + TestUtils.AreEqual(float3(float.NaN, float.NaN, float.NaN), c, 8, false); + } + + [TestCompiler] + public static void sincos_float4() + { + float4 s, c; + + sincos(float4(-1000000f, -1.2f, 0f, 1.2f), out s, out c); + TestUtils.AreEqual(float4(0.3499935f, -0.9320391f, 0f, 0.9320391f), s, 1, false); + TestUtils.AreEqual(float4(0.936752141f, 0.362357765f, 1f, 0.362357765f), c, 8, false); + + sincos(float4(1000000f, float.NegativeInfinity, float.NaN, float.PositiveInfinity), out s, out c); + TestUtils.AreEqual(float4(-0.3499935f, float.NaN, float.NaN, float.NaN), s, 1, false); + TestUtils.AreEqual(float4(0.936752141f, float.NaN, float.NaN, float.NaN), c, 8, false); + } + + [TestCompiler] + public static void sincos_double() + { + double s, c; + sincos(-1000000.0, out s, out c); + TestUtils.AreEqual(0.34999350217129294, s, 32, false); + TestUtils.AreEqual(0.93675212753314474, c, 32, false); + + sincos(-1.2, out s, out c); + TestUtils.AreEqual(-0.9320390859672264, s, 32, false); + TestUtils.AreEqual(0.36235775447667357, c, 32, false); + + sincos(0.0, out s, out c); + TestUtils.AreEqual(0.0, s, 32, false); + TestUtils.AreEqual(1.0, c, 32, false); + + sincos(1.2, out s, out c); + TestUtils.AreEqual(0.9320390859672264, s, 32, false); + TestUtils.AreEqual(0.36235775447667357, c, 32, false); + + sincos(1000000.0, out s, out c); + TestUtils.AreEqual(-0.34999350217129294, s, 32, false); + TestUtils.AreEqual(0.93675212753314474, c, 32, false); + + sincos(double.NegativeInfinity, out s, out c); + TestUtils.AreEqual(double.NaN, s, 32, false); + TestUtils.AreEqual(double.NaN, c, 32, false); + + sincos(double.NaN, out s, out c); + TestUtils.AreEqual(double.NaN, s, 32, false); + TestUtils.AreEqual(double.NaN, c, 32, false); + + sincos(double.NaN, out s, out c); + TestUtils.AreEqual(double.NaN, s, 32, false); + TestUtils.AreEqual(double.NaN, c, 32, false); + } + + [TestCompiler] + public static void sincos_double2() + { + double2 s, c; + sincos(double2(-1000000.0, -1.2), out s, out c); + TestUtils.AreEqual(double2(0.34999350217129294, -0.9320390859672264), s, 32, false); + TestUtils.AreEqual(double2(0.93675212753314474, 0.36235775447667357), c, 32, false); + + sincos(double2(0.0, 1.2), out s, out c); + TestUtils.AreEqual(double2(0.0, 0.9320390859672264), s, 32, false); + TestUtils.AreEqual(double2(1.0, 0.36235775447667357), c, 32, false); + + sincos(double2(1000000.0, double.NegativeInfinity), out s, out c); + TestUtils.AreEqual(double2(-0.34999350217129294, double.NaN), s, 32, false); + TestUtils.AreEqual(double2(0.93675212753314474, double.NaN), c, 32, false); + + sincos(double2(double.NaN, double.PositiveInfinity), out s, out c); + TestUtils.AreEqual(double2(double.NaN, double.NaN), s, 32, false); + TestUtils.AreEqual(double2(double.NaN, double.NaN), c, 32, false); + } + + [TestCompiler] + public static void sincos_double3() + { + double3 s, c; + + sincos(double3(-1000000.0, -1.2, 0.0), out s, out c); + TestUtils.AreEqual(double3(0.34999350217129294, -0.9320390859672264, 0.0), s, 32, false); + TestUtils.AreEqual(double3(0.93675212753314474, 0.36235775447667357, 1.0), c, 32, false); + + sincos(double3(1.2, 1000000.0, double.NegativeInfinity), out s, out c); + TestUtils.AreEqual(double3(0.9320390859672264, -0.34999350217129294, double.NaN), s, 32, false); + TestUtils.AreEqual(double3(0.36235775447667357, 0.93675212753314474, double.NaN), c, 32, false); + + sincos(double3(double.NaN, double.PositiveInfinity, double.PositiveInfinity), out s, out c); + TestUtils.AreEqual(double3(double.NaN, double.NaN, double.NaN), s, 32, false); + TestUtils.AreEqual(double3(double.NaN, double.NaN, double.NaN), c, 32, false); + } + + [TestCompiler] + public static void sincos_double4() + { + double4 s, c; + + sincos(double4(-1000000.0, -1.2, 0.0, 1.2), out s, out c); + TestUtils.AreEqual(double4(0.34999350217129294, -0.9320390859672264, 0.0, 0.9320390859672264), s, 32, false); + TestUtils.AreEqual(double4(0.93675212753314474, 0.36235775447667357, 1.0, 0.36235775447667357), c, 32, false); + + sincos(double4(1000000.0, double.NegativeInfinity, double.NaN, double.PositiveInfinity), out s, out c); + TestUtils.AreEqual(double4(-0.34999350217129294, double.NaN, double.NaN, double.NaN), s, 32, false); + TestUtils.AreEqual(double4(0.93675212753314474, double.NaN, double.NaN, double.NaN), c, 32, false); + } + + [TestCompiler] + public static void select_int() + { + TestUtils.AreEqual(-123456789, select(-123456789, 987654321, false)); + TestUtils.AreEqual(987654321, select(-123456789, 987654321, true)); + } + + [TestCompiler] + public static void select_int2() + { + TestUtils.AreEqual(int2(-123456789, -123456790), select(int2(-123456789, -123456790), int2(987654321, 987654322), false)); + TestUtils.AreEqual(int2(987654321, 987654322), select(int2(-123456789, -123456790), int2(987654321, 987654322), true)); + + TestUtils.AreEqual(int2(-123456789, -123456790), select(int2(-123456789, -123456790), int2(987654321, 987654322), bool2(false, false))); + TestUtils.AreEqual(int2(-123456789, 987654322), select(int2(-123456789, -123456790), int2(987654321, 987654322), bool2(false, true))); + TestUtils.AreEqual(int2(987654321, -123456790), select(int2(-123456789, -123456790), int2(987654321, 987654322), bool2(true, false))); + TestUtils.AreEqual(int2(987654321, 987654322), select(int2(-123456789, -123456790), int2(987654321, 987654322), bool2(true, true))); + } + + [TestCompiler] + public static void select_int3() + { + TestUtils.AreEqual(int3(-123456789, -123456790, -123456791), select(int3(-123456789, -123456790, -123456791), int3(987654321, 987654322, 987654323), false)); + TestUtils.AreEqual(int3(987654321, 987654322, 987654323), select(int3(-123456789, -123456790, -123456791), int3(987654321, 987654322, 987654323), true)); + + TestUtils.AreEqual(int3(-123456789, -123456790, -123456791), select(int3(-123456789, -123456790, -123456791), int3(987654321, 987654322, 987654323), bool3(false, false, false))); + TestUtils.AreEqual(int3(-123456789, -123456790, 987654323), select(int3(-123456789, -123456790, -123456791), int3(987654321, 987654322, 987654323), bool3(false, false, true))); + TestUtils.AreEqual(int3(-123456789, 987654322, -123456791), select(int3(-123456789, -123456790, -123456791), int3(987654321, 987654322, 987654323), bool3(false, true, false))); + TestUtils.AreEqual(int3(-123456789, 987654322, 987654323), select(int3(-123456789, -123456790, -123456791), int3(987654321, 987654322, 987654323), bool3(false, true, true))); + + TestUtils.AreEqual(int3(987654321, -123456790, -123456791), select(int3(-123456789, -123456790, -123456791), int3(987654321, 987654322, 987654323), bool3(true, false, false))); + TestUtils.AreEqual(int3(987654321, -123456790, 987654323), select(int3(-123456789, -123456790, -123456791), int3(987654321, 987654322, 987654323), bool3(true, false, true))); + TestUtils.AreEqual(int3(987654321, 987654322, -123456791), select(int3(-123456789, -123456790, -123456791), int3(987654321, 987654322, 987654323), bool3(true, true, false))); + TestUtils.AreEqual(int3(987654321, 987654322, 987654323), select(int3(-123456789, -123456790, -123456791), int3(987654321, 987654322, 987654323), bool3(true, true, true))); + } + + [TestCompiler] + public static void select_int4() + { + TestUtils.AreEqual(int4(-123456789, -123456790, -123456791, -123456792), select(int4(-123456789, -123456790, -123456791, -123456792), int4(987654321, 987654322, 987654323, 987654324), false)); + TestUtils.AreEqual(int4(987654321, 987654322, 987654323, 987654324), select(int4(-123456789, -123456790, -123456791, -123456792), int4(987654321, 987654322, 987654323, 987654324), true)); + + TestUtils.AreEqual(int4(-123456789, -123456790, -123456791, -123456792), select(int4(-123456789, -123456790, -123456791, -123456792), int4(987654321, 987654322, 987654323, 987654324), bool4(false, false, false, false))); + TestUtils.AreEqual(int4(-123456789, -123456790, -123456791, 987654324), select(int4(-123456789, -123456790, -123456791, -123456792), int4(987654321, 987654322, 987654323, 987654324), bool4(false, false, false, true))); + TestUtils.AreEqual(int4(-123456789, -123456790, 987654323, -123456792), select(int4(-123456789, -123456790, -123456791, -123456792), int4(987654321, 987654322, 987654323, 987654324), bool4(false, false, true, false))); + TestUtils.AreEqual(int4(-123456789, -123456790, 987654323, 987654324), select(int4(-123456789, -123456790, -123456791, -123456792), int4(987654321, 987654322, 987654323, 987654324), bool4(false, false, true, true))); + + TestUtils.AreEqual(int4(-123456789, 987654322, -123456791, -123456792), select(int4(-123456789, -123456790, -123456791, -123456792), int4(987654321, 987654322, 987654323, 987654324), bool4(false, true, false, false))); + TestUtils.AreEqual(int4(-123456789, 987654322, -123456791, 987654324), select(int4(-123456789, -123456790, -123456791, -123456792), int4(987654321, 987654322, 987654323, 987654324), bool4(false, true, false, true))); + TestUtils.AreEqual(int4(-123456789, 987654322, 987654323, -123456792), select(int4(-123456789, -123456790, -123456791, -123456792), int4(987654321, 987654322, 987654323, 987654324), bool4(false, true, true, false))); + TestUtils.AreEqual(int4(-123456789, 987654322, 987654323, 987654324), select(int4(-123456789, -123456790, -123456791, -123456792), int4(987654321, 987654322, 987654323, 987654324), bool4(false, true, true, true))); + + TestUtils.AreEqual(int4(987654321, -123456790, -123456791, -123456792), select(int4(-123456789, -123456790, -123456791, -123456792), int4(987654321, 987654322, 987654323, 987654324), bool4(true, false, false, false))); + TestUtils.AreEqual(int4(987654321, -123456790, -123456791, 987654324), select(int4(-123456789, -123456790, -123456791, -123456792), int4(987654321, 987654322, 987654323, 987654324), bool4(true, false, false, true))); + TestUtils.AreEqual(int4(987654321, -123456790, 987654323, -123456792), select(int4(-123456789, -123456790, -123456791, -123456792), int4(987654321, 987654322, 987654323, 987654324), bool4(true, false, true, false))); + TestUtils.AreEqual(int4(987654321, -123456790, 987654323, 987654324), select(int4(-123456789, -123456790, -123456791, -123456792), int4(987654321, 987654322, 987654323, 987654324), bool4(true, false, true, true))); + + TestUtils.AreEqual(int4(987654321, 987654322, -123456791, -123456792), select(int4(-123456789, -123456790, -123456791, -123456792), int4(987654321, 987654322, 987654323, 987654324), bool4(true, true, false, false))); + TestUtils.AreEqual(int4(987654321, 987654322, -123456791, 987654324), select(int4(-123456789, -123456790, -123456791, -123456792), int4(987654321, 987654322, 987654323, 987654324), bool4(true, true, false, true))); + TestUtils.AreEqual(int4(987654321, 987654322, 987654323, -123456792), select(int4(-123456789, -123456790, -123456791, -123456792), int4(987654321, 987654322, 987654323, 987654324), bool4(true, true, true, false))); + TestUtils.AreEqual(int4(987654321, 987654322, 987654323, 987654324), select(int4(-123456789, -123456790, -123456791, -123456792), int4(987654321, 987654322, 987654323, 987654324), bool4(true, true, true, true))); + } + + [TestCompiler] + public static void select_uint() + { + TestUtils.AreEqual(123456789u, select(123456789u, 987654321u, false)); + TestUtils.AreEqual(987654321u, select(123456789u, 987654321u, true)); + } + + [TestCompiler] + public static void select_uint2() + { + TestUtils.AreEqual(uint2(123456789u, 123456790u), select(uint2(123456789u, 123456790u), uint2(987654321u, 987654322u), false)); + TestUtils.AreEqual(uint2(987654321u, 987654322), select(uint2(123456789u, 123456790u), uint2(987654321u, 987654322u), true)); + + TestUtils.AreEqual(uint2(123456789u, 123456790u), select(uint2(123456789u, 123456790u), uint2(987654321u, 987654322u), bool2(false, false))); + TestUtils.AreEqual(uint2(123456789u, 987654322u), select(uint2(123456789u, 123456790u), uint2(987654321u, 987654322u), bool2(false, true))); + TestUtils.AreEqual(uint2(987654321u, 123456790u), select(uint2(123456789u, 123456790u), uint2(987654321u, 987654322u), bool2(true, false))); + TestUtils.AreEqual(uint2(987654321u, 987654322u), select(uint2(123456789u, 123456790u), uint2(987654321u, 987654322u), bool2(true, true))); + } + + [TestCompiler] + public static void select_uint3() + { + TestUtils.AreEqual(uint3(123456789u, 123456790u, 123456791u), select(uint3(123456789u, 123456790u, 123456791u), uint3(987654321u, 987654322u, 987654323u), false)); + TestUtils.AreEqual(uint3(987654321u, 987654322u, 987654323), select(uint3(123456789u, 123456790u, 123456791u), uint3(987654321u, 987654322u, 987654323u), true)); + + TestUtils.AreEqual(uint3(123456789u, 123456790u, 123456791u), select(uint3(123456789u, 123456790u, 123456791u), uint3(987654321u, 987654322u, 987654323u), bool3(false, false, false))); + TestUtils.AreEqual(uint3(123456789u, 123456790u, 987654323u), select(uint3(123456789u, 123456790u, 123456791u), uint3(987654321u, 987654322u, 987654323u), bool3(false, false, true))); + TestUtils.AreEqual(uint3(123456789u, 987654322u, 123456791u), select(uint3(123456789u, 123456790u, 123456791u), uint3(987654321u, 987654322u, 987654323u), bool3(false, true, false))); + TestUtils.AreEqual(uint3(123456789u, 987654322u, 987654323u), select(uint3(123456789u, 123456790u, 123456791u), uint3(987654321u, 987654322u, 987654323u), bool3(false, true, true))); + + TestUtils.AreEqual(uint3(987654321u, 123456790u, 123456791u), select(uint3(123456789u, 123456790u, 123456791u), uint3(987654321u, 987654322u, 987654323u), bool3(true, false, false))); + TestUtils.AreEqual(uint3(987654321u, 123456790u, 987654323u), select(uint3(123456789u, 123456790u, 123456791u), uint3(987654321u, 987654322u, 987654323u), bool3(true, false, true))); + TestUtils.AreEqual(uint3(987654321u, 987654322u, 123456791u), select(uint3(123456789u, 123456790u, 123456791u), uint3(987654321u, 987654322u, 987654323u), bool3(true, true, false))); + TestUtils.AreEqual(uint3(987654321u, 987654322u, 987654323u), select(uint3(123456789u, 123456790u, 123456791u), uint3(987654321u, 987654322u, 987654323u), bool3(true, true, true))); + } + + [TestCompiler] + public static void select_uint4() + { + TestUtils.AreEqual(uint4(123456789u, 123456790u, 123456791u, 123456792u), select(uint4(123456789u, 123456790u, 123456791u, 123456792u), uint4(987654321u, 987654322u, 987654323u, 987654324u), false)); + TestUtils.AreEqual(uint4(987654321u, 987654322u, 987654323u, 987654324u), select(uint4(123456789u, 123456790u, 123456791u, 123456792u), uint4(987654321u, 987654322u, 987654323u, 987654324u), true)); + + TestUtils.AreEqual(uint4(123456789u, 123456790u, 123456791u, 123456792u), select(uint4(123456789u, 123456790u, 123456791u, 123456792u), uint4(987654321u, 987654322u, 987654323u, 987654324u), bool4(false, false, false, false))); + TestUtils.AreEqual(uint4(123456789u, 123456790u, 123456791u, 987654324u), select(uint4(123456789u, 123456790u, 123456791u, 123456792u), uint4(987654321u, 987654322u, 987654323u, 987654324u), bool4(false, false, false, true))); + TestUtils.AreEqual(uint4(123456789u, 123456790u, 987654323u, 123456792u), select(uint4(123456789u, 123456790u, 123456791u, 123456792u), uint4(987654321u, 987654322u, 987654323u, 987654324u), bool4(false, false, true, false))); + TestUtils.AreEqual(uint4(123456789u, 123456790u, 987654323u, 987654324u), select(uint4(123456789u, 123456790u, 123456791u, 123456792u), uint4(987654321u, 987654322u, 987654323u, 987654324u), bool4(false, false, true, true))); + + TestUtils.AreEqual(uint4(123456789u, 987654322u, 123456791u, 123456792u), select(uint4(123456789u, 123456790u, 123456791u, 123456792u), uint4(987654321u, 987654322u, 987654323u, 987654324u), bool4(false, true, false, false))); + TestUtils.AreEqual(uint4(123456789u, 987654322u, 123456791u, 987654324u), select(uint4(123456789u, 123456790u, 123456791u, 123456792u), uint4(987654321u, 987654322u, 987654323u, 987654324u), bool4(false, true, false, true))); + TestUtils.AreEqual(uint4(123456789u, 987654322u, 987654323u, 123456792u), select(uint4(123456789u, 123456790u, 123456791u, 123456792u), uint4(987654321u, 987654322u, 987654323u, 987654324u), bool4(false, true, true, false))); + TestUtils.AreEqual(uint4(123456789u, 987654322u, 987654323u, 987654324u), select(uint4(123456789u, 123456790u, 123456791u, 123456792u), uint4(987654321u, 987654322u, 987654323u, 987654324u), bool4(false, true, true, true))); + + TestUtils.AreEqual(uint4(987654321u, 123456790u, 123456791u, 123456792u), select(uint4(123456789u, 123456790u, 123456791u, 123456792u), uint4(987654321u, 987654322u, 987654323u, 987654324u), bool4(true, false, false, false))); + TestUtils.AreEqual(uint4(987654321u, 123456790u, 123456791u, 987654324u), select(uint4(123456789u, 123456790u, 123456791u, 123456792u), uint4(987654321u, 987654322u, 987654323u, 987654324u), bool4(true, false, false, true))); + TestUtils.AreEqual(uint4(987654321u, 123456790u, 987654323u, 123456792u), select(uint4(123456789u, 123456790u, 123456791u, 123456792u), uint4(987654321u, 987654322u, 987654323u, 987654324u), bool4(true, false, true, false))); + TestUtils.AreEqual(uint4(987654321u, 123456790u, 987654323u, 987654324u), select(uint4(123456789u, 123456790u, 123456791u, 123456792u), uint4(987654321u, 987654322u, 987654323u, 987654324u), bool4(true, false, true, true))); + + TestUtils.AreEqual(uint4(987654321u, 987654322u, 123456791u, 123456792u), select(uint4(123456789u, 123456790u, 123456791u, 123456792u), uint4(987654321u, 987654322u, 987654323u, 987654324u), bool4(true, true, false, false))); + TestUtils.AreEqual(uint4(987654321u, 987654322u, 123456791u, 987654324u), select(uint4(123456789u, 123456790u, 123456791u, 123456792u), uint4(987654321u, 987654322u, 987654323u, 987654324u), bool4(true, true, false, true))); + TestUtils.AreEqual(uint4(987654321u, 987654322u, 987654323u, 123456792u), select(uint4(123456789u, 123456790u, 123456791u, 123456792u), uint4(987654321u, 987654322u, 987654323u, 987654324u), bool4(true, true, true, false))); + TestUtils.AreEqual(uint4(987654321u, 987654322u, 987654323u, 987654324u), select(uint4(123456789u, 123456790u, 123456791u, 123456792u), uint4(987654321u, 987654322u, 987654323u, 987654324u), bool4(true, true, true, true))); + } + + [TestCompiler] + public static void select_long() + { + TestUtils.AreEqual(-12345678910111314L, select(-12345678910111314L, 987654321011121314L, false)); + TestUtils.AreEqual(987654321011121314L, select(-12345678910111314L, 987654321011121314L, true)); + } + + [TestCompiler] + public static void select_ulong() + { + TestUtils.AreEqual(12345678910111314UL, select(12345678910111314UL, 987654321011121314UL, false)); + TestUtils.AreEqual(987654321011121314UL, select(12345678910111314UL, 987654321011121314UL, true)); + } + + + [TestCompiler] + public static void select_float() + { + TestUtils.AreEqual(-1234.5f, select(-1234.5f, 9876.25f, false)); + TestUtils.AreEqual(9876.25f, select(-1234.5f, 9876.25f, true)); + } + + [TestCompiler] + public static void select_float2() + { + TestUtils.AreEqual(float2(-1234.5f, -1235.5f), select(float2(-1234.5f, -1235.5f), float2(9876.25f, 9877.25f), false)); + TestUtils.AreEqual(float2(9876.25f, 9877.25f), select(float2(-1234.5f, -1235.5f), float2(9876.25f, 9877.25f), true)); + + TestUtils.AreEqual(float2(-1234.5f, -1235.5f), select(float2(-1234.5f, -1235.5f), float2(9876.25f, 9877.25f), bool2(false, false))); + TestUtils.AreEqual(float2(-1234.5f, 9877.25f), select(float2(-1234.5f, -1235.5f), float2(9876.25f, 9877.25f), bool2(false, true))); + TestUtils.AreEqual(float2(9876.25f, -1235.5f), select(float2(-1234.5f, -1235.5f), float2(9876.25f, 9877.25f), bool2(true, false))); + TestUtils.AreEqual(float2(9876.25f, 9877.25f), select(float2(-1234.5f, -1235.5f), float2(9876.25f, 9877.25f), bool2(true, true))); + } + + [TestCompiler] + public static void select_float3() + { + TestUtils.AreEqual(float3(-1234.5f, -1235.5f, -1236.5f), select(float3(-1234.5f, -1235.5f, -1236.5f), float3(9876.25f, 9877.25f, 9878.25f), false)); + TestUtils.AreEqual(float3(9876.25f, 9877.25f, 9878.25f), select(float3(-1234.5f, -1235.5f, -1236.5f), float3(9876.25f, 9877.25f, 9878.25f), true)); + + TestUtils.AreEqual(float3(-1234.5f, -1235.5f, -1236.5f), select(float3(-1234.5f, -1235.5f, -1236.5f), float3(9876.25f, 9877.25f, 9878.25f), bool3(false, false, false))); + TestUtils.AreEqual(float3(-1234.5f, -1235.5f, 9878.25f), select(float3(-1234.5f, -1235.5f, -1236.5f), float3(9876.25f, 9877.25f, 9878.25f), bool3(false, false, true))); + TestUtils.AreEqual(float3(-1234.5f, 9877.25f, -1236.5f), select(float3(-1234.5f, -1235.5f, -1236.5f), float3(9876.25f, 9877.25f, 9878.25f), bool3(false, true, false))); + TestUtils.AreEqual(float3(-1234.5f, 9877.25f, 9878.25f), select(float3(-1234.5f, -1235.5f, -1236.5f), float3(9876.25f, 9877.25f, 9878.25f), bool3(false, true, true))); + + TestUtils.AreEqual(float3(9876.25f, -1235.5f, -1236.5f), select(float3(-1234.5f, -1235.5f, -1236.5f), float3(9876.25f, 9877.25f, 9878.25f), bool3(true, false, false))); + TestUtils.AreEqual(float3(9876.25f, -1235.5f, 9878.25f), select(float3(-1234.5f, -1235.5f, -1236.5f), float3(9876.25f, 9877.25f, 9878.25f), bool3(true, false, true))); + TestUtils.AreEqual(float3(9876.25f, 9877.25f, -1236.5f), select(float3(-1234.5f, -1235.5f, -1236.5f), float3(9876.25f, 9877.25f, 9878.25f), bool3(true, true, false))); + TestUtils.AreEqual(float3(9876.25f, 9877.25f, 9878.25f), select(float3(-1234.5f, -1235.5f, -1236.5f), float3(9876.25f, 9877.25f, 9878.25f), bool3(true, true, true))); + } + + [TestCompiler] + public static void select_float4() + { + TestUtils.AreEqual(float4(-1234.5f, -1235.5f, -1236.5f, -1237.5f), select(float4(-1234.5f, -1235.5f, -1236.5f, -1237.5f), float4(9876.25f, 9877.25f, 9878.25f, 9879.25f), false)); + TestUtils.AreEqual(float4(9876.25f, 9877.25f, 9878.25f, 9879.25f), select(float4(-1234.5f, -1235.5f, -1236.5f, -1237.5f), float4(9876.25f, 9877.25f, 9878.25f, 9879.25f), true)); + + TestUtils.AreEqual(float4(-1234.5f, -1235.5f, -1236.5f, -1237.5f), select(float4(-1234.5f, -1235.5f, -1236.5f, -1237.5f), float4(9876.25f, 9877.25f, 9878.25f, 9879.25f), bool4(false, false, false, false))); + TestUtils.AreEqual(float4(-1234.5f, -1235.5f, -1236.5f, 9879.25f), select(float4(-1234.5f, -1235.5f, -1236.5f, -1237.5f), float4(9876.25f, 9877.25f, 9878.25f, 9879.25f), bool4(false, false, false, true))); + TestUtils.AreEqual(float4(-1234.5f, -1235.5f, 9878.25f, -1237.5f), select(float4(-1234.5f, -1235.5f, -1236.5f, -1237.5f), float4(9876.25f, 9877.25f, 9878.25f, 9879.25f), bool4(false, false, true, false))); + TestUtils.AreEqual(float4(-1234.5f, -1235.5f, 9878.25f, 9879.25f), select(float4(-1234.5f, -1235.5f, -1236.5f, -1237.5f), float4(9876.25f, 9877.25f, 9878.25f, 9879.25f), bool4(false, false, true, true))); + + TestUtils.AreEqual(float4(-1234.5f, 9877.25f, -1236.5f, -1237.5f), select(float4(-1234.5f, -1235.5f, -1236.5f, -1237.5f), float4(9876.25f, 9877.25f, 9878.25f, 9879.25f), bool4(false, true, false, false))); + TestUtils.AreEqual(float4(-1234.5f, 9877.25f, -1236.5f, 9879.25f), select(float4(-1234.5f, -1235.5f, -1236.5f, -1237.5f), float4(9876.25f, 9877.25f, 9878.25f, 9879.25f), bool4(false, true, false, true))); + TestUtils.AreEqual(float4(-1234.5f, 9877.25f, 9878.25f, -1237.5f), select(float4(-1234.5f, -1235.5f, -1236.5f, -1237.5f), float4(9876.25f, 9877.25f, 9878.25f, 9879.25f), bool4(false, true, true, false))); + TestUtils.AreEqual(float4(-1234.5f, 9877.25f, 9878.25f, 9879.25f), select(float4(-1234.5f, -1235.5f, -1236.5f, -1237.5f), float4(9876.25f, 9877.25f, 9878.25f, 9879.25f), bool4(false, true, true, true))); + + TestUtils.AreEqual(float4(9876.25f, -1235.5f, -1236.5f, -1237.5f), select(float4(-1234.5f, -1235.5f, -1236.5f, -1237.5f), float4(9876.25f, 9877.25f, 9878.25f, 9879.25f), bool4(true, false, false, false))); + TestUtils.AreEqual(float4(9876.25f, -1235.5f, -1236.5f, 9879.25f), select(float4(-1234.5f, -1235.5f, -1236.5f, -1237.5f), float4(9876.25f, 9877.25f, 9878.25f, 9879.25f), bool4(true, false, false, true))); + TestUtils.AreEqual(float4(9876.25f, -1235.5f, 9878.25f, -1237.5f), select(float4(-1234.5f, -1235.5f, -1236.5f, -1237.5f), float4(9876.25f, 9877.25f, 9878.25f, 9879.25f), bool4(true, false, true, false))); + TestUtils.AreEqual(float4(9876.25f, -1235.5f, 9878.25f, 9879.25f), select(float4(-1234.5f, -1235.5f, -1236.5f, -1237.5f), float4(9876.25f, 9877.25f, 9878.25f, 9879.25f), bool4(true, false, true, true))); + + TestUtils.AreEqual(float4(9876.25f, 9877.25f, -1236.5f, -1237.5f), select(float4(-1234.5f, -1235.5f, -1236.5f, -1237.5f), float4(9876.25f, 9877.25f, 9878.25f, 9879.25f), bool4(true, true, false, false))); + TestUtils.AreEqual(float4(9876.25f, 9877.25f, -1236.5f, 9879.25f), select(float4(-1234.5f, -1235.5f, -1236.5f, -1237.5f), float4(9876.25f, 9877.25f, 9878.25f, 9879.25f), bool4(true, true, false, true))); + TestUtils.AreEqual(float4(9876.25f, 9877.25f, 9878.25f, -1237.5f), select(float4(-1234.5f, -1235.5f, -1236.5f, -1237.5f), float4(9876.25f, 9877.25f, 9878.25f, 9879.25f), bool4(true, true, true, false))); + TestUtils.AreEqual(float4(9876.25f, 9877.25f, 9878.25f, 9879.25f), select(float4(-1234.5f, -1235.5f, -1236.5f, -1237.5f), float4(9876.25f, 9877.25f, 9878.25f, 9879.25f), bool4(true, true, true, true))); + } + + + [TestCompiler] + public static void select_double() + { + TestUtils.AreEqual(-1234.5, select(-1234.5, 9876.25, false)); + TestUtils.AreEqual(9876.25, select(-1234.5, 9876.25, true)); + } + + [TestCompiler] + public static void select_double2() + { + TestUtils.AreEqual(double2(-1234.5, -1235.5), select(double2(-1234.5, -1235.5), double2(9876.25, 9877.25), false)); + TestUtils.AreEqual(double2(9876.25, 9877.25), select(double2(-1234.5, -1235.5), double2(9876.25, 9877.25), true)); + + TestUtils.AreEqual(double2(-1234.5, -1235.5), select(double2(-1234.5, -1235.5), double2(9876.25, 9877.25), bool2(false, false))); + TestUtils.AreEqual(double2(-1234.5, 9877.25), select(double2(-1234.5, -1235.5), double2(9876.25, 9877.25), bool2(false, true))); + TestUtils.AreEqual(double2(9876.25, -1235.5), select(double2(-1234.5, -1235.5), double2(9876.25, 9877.25), bool2(true, false))); + TestUtils.AreEqual(double2(9876.25, 9877.25), select(double2(-1234.5, -1235.5), double2(9876.25, 9877.25), bool2(true, true))); + } + + [TestCompiler] + public static void select_double3() + { + TestUtils.AreEqual(double3(-1234.5, -1235.5, -1236.5), select(double3(-1234.5, -1235.5, -1236.5), double3(9876.25, 9877.25, 9878.25), false)); + TestUtils.AreEqual(double3(9876.25, 9877.25, 9878.25), select(double3(-1234.5, -1235.5, -1236.5), double3(9876.25, 9877.25, 9878.25), true)); + + TestUtils.AreEqual(double3(-1234.5, -1235.5, -1236.5), select(double3(-1234.5, -1235.5, -1236.5), double3(9876.25, 9877.25, 9878.25), bool3(false, false, false))); + TestUtils.AreEqual(double3(-1234.5, -1235.5, 9878.25), select(double3(-1234.5, -1235.5, -1236.5), double3(9876.25, 9877.25, 9878.25), bool3(false, false, true))); + TestUtils.AreEqual(double3(-1234.5, 9877.25, -1236.5), select(double3(-1234.5, -1235.5, -1236.5), double3(9876.25, 9877.25, 9878.25), bool3(false, true, false))); + TestUtils.AreEqual(double3(-1234.5, 9877.25, 9878.25), select(double3(-1234.5, -1235.5, -1236.5), double3(9876.25, 9877.25, 9878.25), bool3(false, true, true))); + + TestUtils.AreEqual(double3(9876.25, -1235.5, -1236.5), select(double3(-1234.5, -1235.5, -1236.5), double3(9876.25, 9877.25, 9878.25), bool3(true, false, false))); + TestUtils.AreEqual(double3(9876.25, -1235.5, 9878.25), select(double3(-1234.5, -1235.5, -1236.5), double3(9876.25, 9877.25, 9878.25), bool3(true, false, true))); + TestUtils.AreEqual(double3(9876.25, 9877.25, -1236.5), select(double3(-1234.5, -1235.5, -1236.5), double3(9876.25, 9877.25, 9878.25), bool3(true, true, false))); + TestUtils.AreEqual(double3(9876.25, 9877.25, 9878.25), select(double3(-1234.5, -1235.5, -1236.5), double3(9876.25, 9877.25, 9878.25), bool3(true, true, true))); + } + + [TestCompiler] + public static void select_double4() + { + TestUtils.AreEqual(double4(-1234.5, -1235.5, -1236.5, -1237.5), select(double4(-1234.5, -1235.5, -1236.5, -1237.5), double4(9876.25, 9877.25, 9878.25, 9879.25), false)); + TestUtils.AreEqual(double4(9876.25, 9877.25, 9878.25, 9879.25), select(double4(-1234.5, -1235.5, -1236.5, -1237.5), double4(9876.25, 9877.25, 9878.25, 9879.25), true)); + + TestUtils.AreEqual(double4(-1234.5, -1235.5, -1236.5, -1237.5), select(double4(-1234.5, -1235.5, -1236.5, -1237.5), double4(9876.25, 9877.25, 9878.25, 9879.25), bool4(false, false, false, false))); + TestUtils.AreEqual(double4(-1234.5, -1235.5, -1236.5, 9879.25), select(double4(-1234.5, -1235.5, -1236.5, -1237.5), double4(9876.25, 9877.25, 9878.25, 9879.25), bool4(false, false, false, true))); + TestUtils.AreEqual(double4(-1234.5, -1235.5, 9878.25, -1237.5), select(double4(-1234.5, -1235.5, -1236.5, -1237.5), double4(9876.25, 9877.25, 9878.25, 9879.25), bool4(false, false, true, false))); + TestUtils.AreEqual(double4(-1234.5, -1235.5, 9878.25, 9879.25), select(double4(-1234.5, -1235.5, -1236.5, -1237.5), double4(9876.25, 9877.25, 9878.25, 9879.25), bool4(false, false, true, true))); + + TestUtils.AreEqual(double4(-1234.5, 9877.25, -1236.5, -1237.5), select(double4(-1234.5, -1235.5, -1236.5, -1237.5), double4(9876.25, 9877.25, 9878.25, 9879.25), bool4(false, true, false, false))); + TestUtils.AreEqual(double4(-1234.5, 9877.25, -1236.5, 9879.25), select(double4(-1234.5, -1235.5, -1236.5, -1237.5), double4(9876.25, 9877.25, 9878.25, 9879.25), bool4(false, true, false, true))); + TestUtils.AreEqual(double4(-1234.5, 9877.25, 9878.25, -1237.5), select(double4(-1234.5, -1235.5, -1236.5, -1237.5), double4(9876.25, 9877.25, 9878.25, 9879.25), bool4(false, true, true, false))); + TestUtils.AreEqual(double4(-1234.5, 9877.25, 9878.25, 9879.25), select(double4(-1234.5, -1235.5, -1236.5, -1237.5), double4(9876.25, 9877.25, 9878.25, 9879.25), bool4(false, true, true, true))); + + TestUtils.AreEqual(double4(9876.25, -1235.5, -1236.5, -1237.5), select(double4(-1234.5, -1235.5, -1236.5, -1237.5), double4(9876.25, 9877.25, 9878.25, 9879.25), bool4(true, false, false, false))); + TestUtils.AreEqual(double4(9876.25, -1235.5, -1236.5, 9879.25), select(double4(-1234.5, -1235.5, -1236.5, -1237.5), double4(9876.25, 9877.25, 9878.25, 9879.25), bool4(true, false, false, true))); + TestUtils.AreEqual(double4(9876.25, -1235.5, 9878.25, -1237.5), select(double4(-1234.5, -1235.5, -1236.5, -1237.5), double4(9876.25, 9877.25, 9878.25, 9879.25), bool4(true, false, true, false))); + TestUtils.AreEqual(double4(9876.25, -1235.5, 9878.25, 9879.25), select(double4(-1234.5, -1235.5, -1236.5, -1237.5), double4(9876.25, 9877.25, 9878.25, 9879.25), bool4(true, false, true, true))); + + TestUtils.AreEqual(double4(9876.25, 9877.25, -1236.5, -1237.5), select(double4(-1234.5, -1235.5, -1236.5, -1237.5), double4(9876.25, 9877.25, 9878.25, 9879.25), bool4(true, true, false, false))); + TestUtils.AreEqual(double4(9876.25, 9877.25, -1236.5, 9879.25), select(double4(-1234.5, -1235.5, -1236.5, -1237.5), double4(9876.25, 9877.25, 9878.25, 9879.25), bool4(true, true, false, true))); + TestUtils.AreEqual(double4(9876.25, 9877.25, 9878.25, -1237.5), select(double4(-1234.5, -1235.5, -1236.5, -1237.5), double4(9876.25, 9877.25, 9878.25, 9879.25), bool4(true, true, true, false))); + TestUtils.AreEqual(double4(9876.25, 9877.25, 9878.25, 9879.25), select(double4(-1234.5, -1235.5, -1236.5, -1237.5), double4(9876.25, 9877.25, 9878.25, 9879.25), bool4(true, true, true, true))); + } + + + [TestCompiler] + public static void dot_int() + { + TestUtils.AreEqual(133, dot(7, 19)); + TestUtils.AreEqual(-133, dot(-7, 19)); + TestUtils.AreEqual(-1773654624, dot(61031, 41312)); + TestUtils.AreEqual(667585376, dot(61031, 81312)); + } + + [TestCompiler] + public static void dot_int2() + { + TestUtils.AreEqual(322, dot(int2(7, 9), int2(19, 21))); + TestUtils.AreEqual(-322, dot(int2(-7, 9), int2(19, -21))); + TestUtils.AreEqual(-1707074016, dot(int2(61031, 12534), int2(41312, 5312))); + TestUtils.AreEqual(1840235232, dot(int2(61031, -12534), int2(-41312, -5312))); + } + + [TestCompiler] + public static void dot_int3() + { + TestUtils.AreEqual(582, dot(int3(7, 9, 13), int3(19, 21, 20))); + TestUtils.AreEqual(-582, dot(int3(-7, 9, 13), int3(19, -21, -20))); + TestUtils.AreEqual(-1503299063, dot(int3(61031, 12534, 9211), int3(41312, 5312, 22123))); + TestUtils.AreEqual(1636460279, dot(int3(61031, -12534, 9211), int3(-41312, -5312, -22123))); + } + + [TestCompiler] + public static void dot_int4() + { + TestUtils.AreEqual(990, dot(int4(7, 9, 13, 17), int4(19, 21, 20, 24))); + TestUtils.AreEqual(-990, dot(int4(-7, 9, 13, -17), int4(19, -21, -20, 24))); + TestUtils.AreEqual(663641543, dot(int4(61031, 12534, 9211, 33122), int4(41312, 5312, 22123, 65423))); + TestUtils.AreEqual(-491566411, dot(int4(61031, -12534, 9211, 33122), int4(-41312, -5312, -22123, 65423))); + } + + + [TestCompiler] + public static void dot_uint() + { + TestUtils.AreEqual(133u, dot(7u, 19u)); + TestUtils.AreEqual(667585376u, dot(61031u, 81312u)); + } + + [TestCompiler] + public static void dot_uint2() + { + TestUtils.AreEqual(322, dot(uint2(7u, 9u), uint2(19u, 21u))); + TestUtils.AreEqual(734165984u, dot(uint2(61031u, 12534u), uint2(81312u, 5312u))); + } + + [TestCompiler] + public static void dot_uint3() + { + TestUtils.AreEqual(582u, dot(uint3(7u, 9u, 13u), uint3(19u, 21u, 20u))); + TestUtils.AreEqual(937940937u, dot(uint3(61031u, 12534u, 9211u), uint3(81312u, 5312u, 22123u))); + } + + [TestCompiler] + public static void dot_uint4() + { + TestUtils.AreEqual(990u, dot(uint4(7u, 9u, 13u, 17u), uint4(19u, 21u, 20u, 24u))); + TestUtils.AreEqual(3104881543u, dot(uint4(61031u, 12534u, 9211u, 33122u), uint4(81312u, 5312u, 22123u, 65423u))); + } + + + [TestCompiler] + public static void dot_float() + { + TestUtils.AreEqual(7.32f, dot(1.2f, 6.1f), 1, false); + TestUtils.AreEqual(-7.32f, dot(1.2f, -6.1f), 1, false); + TestUtils.AreEqual(7.32e37f, dot(1.2e19f, 6.1e18f), 1, false); + TestUtils.AreEqual(-7.32e37f, dot(-1.2e19f, 6.1e18f), 1, false); + TestUtils.AreEqual(float.PositiveInfinity, dot(1.2e19f, 6.1e19f), 0, false); + TestUtils.AreEqual(float.NegativeInfinity, dot(1.2e19f, -6.1e19f), 0, false); + } + + [TestCompiler] + public static void dot_float2() + { + TestUtils.AreEqual(57.92f, dot(float2(1.2f, 5.5f), float2(6.1f, 9.2f)), 1, false); + TestUtils.AreEqual(-57.92f, dot(float2(-1.2f, 5.5f), float2(6.1f, -9.2f)), 1, false); + TestUtils.AreEqual(5.792e37f, dot(float2(1.2e18f, 5.5e18f), float2(6.1e18f, 9.2e18f)), 1, false); + TestUtils.AreEqual(-5.792e37f, dot(float2(-1.2e18f, 5.5e18f), float2(6.1e18f, -9.2e18f)), 1, false); + TestUtils.AreEqual(float.PositiveInfinity, dot(float2(1.2e18f, 5.5e18f), float2(6.1e19f, 9.2e19f)), 1, false); + TestUtils.AreEqual(float.NegativeInfinity, dot(float2(-1.2e18f, 5.5e18f), float2(6.1e19f, -9.2e19f)), 1, false); + } + + [TestCompiler] + public static void dot_float3() + { + TestUtils.AreEqual(67.1f, dot(float3(1.2f, 5.5f, 3.4f), float3(6.1f, 9.2f, 2.7f)), 8, false); + TestUtils.AreEqual(-67.1f, dot(float3(-1.2f, 5.5f, -3.4f), float3(6.1f, -9.2f, 2.7f)), 8, false); + TestUtils.AreEqual(6.71e37f, dot(float3(1.2e18f, 5.5e18f, 3.4e18f), float3(6.1e18f, 9.2e18f, 2.7e18f)), 1, false); + TestUtils.AreEqual(-6.71e37f, dot(float3(-1.2e18f, 5.5e18f, 3.4e18f), float3(6.1e18f, -9.2e18f, -2.7e18f)), 1, false); + TestUtils.AreEqual(float.PositiveInfinity, dot(float3(1.2e18f, 5.5e18f, 3.4e18f), float3(6.1e19f, 9.2e19f, 2.7e19f)), 1, false); + TestUtils.AreEqual(float.NegativeInfinity, dot(float3(-1.2e18f, 5.5e18f, 3.4e18f), float3(6.1e19f, -9.2e19f, -2.7e19f)), 1, false); + } + + [TestCompiler] + public static void dot_float4() + { + TestUtils.AreEqual(68.57f, dot(float4(1.2f, 5.5f, 3.4f, 4.9f), float4(6.1f, 9.2f, 2.7f, 0.3f)), 8, false); + TestUtils.AreEqual(-68.57f, dot(float4(-1.2f, 5.5f, -3.4f, 4.9f), float4(6.1f, -9.2f, 2.7f, -0.3f)), 8, false); + TestUtils.AreEqual(6.857e37f, dot(float4(1.2e18f, 5.5e18f, 3.4e18f, 4.9e18f), float4(6.1e18f, 9.2e18f, 2.7e18f, 3e17f)), 1, false); + TestUtils.AreEqual(-6.857e37f, dot(float4(-1.2e18f, 5.5e18f, 3.4e18f, -4.9e18f), float4(6.1e18f, -9.2e18f, -2.7e18f, 3e17f)), 1, false); + TestUtils.AreEqual(float.PositiveInfinity, dot(float4(1.2e18f, 5.5e18f, 3.4e18f, 4.9e18f), float4(6.1e19f, 9.2e19f, 2.7e19f, 3e18f)), 1, false); + TestUtils.AreEqual(float.NegativeInfinity, dot(float4(-1.2e18f, 5.5e18f, 3.4e18f, -4.9e18f), float4(6.1e19f, -9.2e19f, -2.7e19f, 3e18f)), 1, false); + } + + + public static void dot_double() + { + TestUtils.AreEqual(7.32, dot(1.2, 6.1), 1, false); + TestUtils.AreEqual(-7.32, dot(1.2, -6.1), 1, false); + TestUtils.AreEqual(7.32e37, dot(1.2e19, 6.1e18), 1, false); + TestUtils.AreEqual(-7.32e37, dot(-1.2e19, 6.1e18), 1, false); + TestUtils.AreEqual(double.PositiveInfinity, dot(1.2e19, 6.1e19), 0, false); + TestUtils.AreEqual(double.NegativeInfinity, dot(1.2e19, -6.1e19), 0, false); + } + + [TestCompiler] + public static void dot_double2() + { + TestUtils.AreEqual(57.92, dot(double2(1.2, 5.5), double2(6.1, 9.2)), 1, false); + TestUtils.AreEqual(-57.92, dot(double2(-1.2, 5.5), double2(6.1, -9.2)), 1, false); + TestUtils.AreEqual(5.792e307, dot(double2(1.2e153, 5.5e153), double2(6.1e153, 9.2e153)), 1, false); + TestUtils.AreEqual(-5.792e307, dot(double2(-1.2e153, 5.5e153), double2(6.1e153, -9.2e153)), 1, false); + TestUtils.AreEqual(double.PositiveInfinity, dot(double2(1.2e153, 5.5e153), double2(6.1e154, 9.2e154)), 1, false); + TestUtils.AreEqual(double.NegativeInfinity, dot(double2(-1.2e153, 5.5e153), double2(6.1e154, -9.2e154)), 1, false); + } + + [TestCompiler] + public static void dot_double3() + { + TestUtils.AreEqual(67.1, dot(double3(1.2, 5.5, 3.4), double3(6.1, 9.2, 2.7)), 8, false); + TestUtils.AreEqual(-67.1, dot(double3(-1.2, 5.5, -3.4), double3(6.1, -9.2, 2.7)), 8, false); + TestUtils.AreEqual(6.71e307, dot(double3(1.2e153, 5.5e153, 3.4e153), double3(6.1e153, 9.2e153, 2.7e153)), 1, false); + TestUtils.AreEqual(-6.71e307, dot(double3(-1.2e153, 5.5e153, 3.4e153), double3(6.1e153, -9.2e153, -2.7e153)), 1, false); + TestUtils.AreEqual(double.PositiveInfinity, dot(double3(1.2e153, 5.5e153, 3.4e153), double3(6.1e154, 9.2e154, 2.7e154)), 1, false); + TestUtils.AreEqual(double.NegativeInfinity, dot(double3(-1.2e153, 5.5e153, 3.4e153), double3(6.1e154, -9.2e154, -2.7e154)), 1, false); + } + + [TestCompiler] + public static void dot_double4() + { + TestUtils.AreEqual(68.57, dot(double4(1.2, 5.5, 3.4, 4.9), double4(6.1, 9.2, 2.7, 0.3)), 8, false); + TestUtils.AreEqual(-68.57, dot(double4(-1.2, 5.5, -3.4, 4.9), double4(6.1, -9.2, 2.7, -0.3)), 8, false); + TestUtils.AreEqual(6.857e307, dot(double4(1.2e153, 5.5e153, 3.4e153, 4.9e153), double4(6.1e153, 9.2e153, 2.7e153, 3e152)), 1, false); + TestUtils.AreEqual(-6.857e307, dot(double4(-1.2e153, 5.5e153, 3.4e153, -4.9e153), double4(6.1e153, -9.2e153, -2.7e153, 3e152)), 1, false); + TestUtils.AreEqual(double.PositiveInfinity, dot(double4(1.2e153, 5.5e153, 3.4e153, 4.9e153), double4(6.1e154, 9.2e154, 2.7e154, 3e153)), 1, false); + TestUtils.AreEqual(double.NegativeInfinity, dot(double4(-1.2e153, 5.5e153, 3.4e153, -4.9e153), double4(6.1e154, -9.2e154, -2.7e154, 3e153)), 1, false); + } + + [TestCompiler] + public static void cmin_int2() + { + TestUtils.AreEqual(100, cmin(int2(100, 200))); + TestUtils.AreEqual(-200, cmin(int2(100, -200))); + TestUtils.AreEqual(0, cmin(int2(int.MaxValue, 0))); + TestUtils.AreEqual(int.MinValue, cmin(int2(int.MinValue, 0))); + TestUtils.AreEqual(int.MinValue, cmin(int2(int.MaxValue, int.MinValue))); + } + + + [TestCompiler] + public static void cmin_int3() + { + TestUtils.AreEqual(100, cmin(int3(100, 200, 300))); + TestUtils.AreEqual(-200, cmin(int3(100, -200, 300))); + TestUtils.AreEqual(0, cmin(int3(int.MaxValue, 0, 7))); + TestUtils.AreEqual(int.MinValue, cmin(int3(int.MinValue, 0, 7))); + TestUtils.AreEqual(int.MinValue, cmin(int3(int.MaxValue, int.MinValue, 0))); + } + + + [TestCompiler] + public static void cmin_int4() + { + TestUtils.AreEqual(100, cmin(int4(100, 200, 300, 400))); + TestUtils.AreEqual(-400, cmin(int4(100, -200, 300, -400))); + TestUtils.AreEqual(0, cmin(int4(int.MaxValue, 0, 7, 19))); + TestUtils.AreEqual(int.MinValue, cmin(int4(int.MinValue, 0, 7, 19))); + TestUtils.AreEqual(int.MinValue, cmin(int4(int.MaxValue, int.MinValue, 0, 19))); + } + + [TestCompiler] + public static void cmin_uint2() + { + TestUtils.AreEqual(100u, cmin(uint2(100u, 200u))); + TestUtils.AreEqual(100u, cmin(uint2(100u, uint.MaxValue))); + TestUtils.AreEqual(uint.MinValue, cmin(uint2(uint.MinValue, uint.MaxValue))); + } + + + [TestCompiler] + public static void cmin_uint3() + { + TestUtils.AreEqual(100u, cmin(uint3(100u, 200u, 300u))); + TestUtils.AreEqual(100u, cmin(uint3(uint.MaxValue, 100u, 300u))); + TestUtils.AreEqual(uint.MinValue, cmin(uint3(7u, uint.MinValue, uint.MaxValue))); + } + + + [TestCompiler] + public static void cmin_uint4() + { + TestUtils.AreEqual(100u, cmin(uint4(100u, 200u, 300u, 400u))); + TestUtils.AreEqual(100u, cmin(uint4(300u, 100u, uint.MaxValue, 200u))); + TestUtils.AreEqual(uint.MinValue, cmin(uint4(19u, uint.MinValue, uint.MaxValue, 7u))); + } + + [TestCompiler] + public static void cmin_float2() + { + TestUtils.AreEqual(-0.5f, cmin(float2(5.2f, -0.5f))); + TestUtils.AreEqual(float.NegativeInfinity, cmin(float2(float.NegativeInfinity, float.PositiveInfinity))); + TestUtils.AreEqual(float.NegativeInfinity, cmin(float2(float.NegativeInfinity, float.NaN))); + TestUtils.AreEqual(float.NegativeInfinity, cmin(float2(float.NegativeInfinity, 100.0f))); + TestUtils.AreEqual(100.0f, cmin(float2(float.PositiveInfinity, 100.0f))); + + TestUtils.AreEqual(1.0f, cmin(float2(1.0f, float.NaN))); + TestUtils.AreEqual(1.0f, cmin(float2(float.NaN, 1.0f))); + + TestUtils.AreEqual(float.PositiveInfinity, cmin(float2(float.PositiveInfinity, float.NaN))); + TestUtils.AreEqual(float.PositiveInfinity, cmin(float2(float.NaN, float.PositiveInfinity))); + + TestUtils.AreEqual(float.NegativeInfinity, cmin(float2(float.NegativeInfinity, float.NaN))); + TestUtils.AreEqual(float.NegativeInfinity, cmin(float2(float.NaN, float.NegativeInfinity))); + } + + [TestCompiler] + public static void cmin_float3() + { + TestUtils.AreEqual(-1.2f, cmin(float3(5.2f, -0.5f, -1.2f))); + TestUtils.AreEqual(float.NegativeInfinity, cmin(float3(float.NegativeInfinity, float.PositiveInfinity, 100.0f))); + TestUtils.AreEqual(float.NegativeInfinity, cmin(float3(float.NegativeInfinity, float.NaN, 100.0f))); + + TestUtils.AreEqual(1.0f, cmin(float3(1.0f, float.NaN, float.NaN))); + TestUtils.AreEqual(1.0f, cmin(float3(float.NaN, 1.0f, float.NaN))); + TestUtils.AreEqual(1.0f, cmin(float3(float.NaN, float.NaN, 1.0f))); + + TestUtils.AreEqual(float.PositiveInfinity, cmin(float3(float.PositiveInfinity, float.NaN, float.NaN))); + TestUtils.AreEqual(float.PositiveInfinity, cmin(float3(float.NaN, float.PositiveInfinity, float.NaN))); + TestUtils.AreEqual(float.PositiveInfinity, cmin(float3(float.NaN, float.NaN, float.PositiveInfinity))); + + TestUtils.AreEqual(float.NegativeInfinity, cmin(float3(float.NegativeInfinity, float.NaN, float.NaN))); + TestUtils.AreEqual(float.NegativeInfinity, cmin(float3(float.NaN, float.NegativeInfinity, float.NaN))); + TestUtils.AreEqual(float.NegativeInfinity, cmin(float3(float.NaN, float.NaN, float.NegativeInfinity))); + } + + [TestCompiler] + public static void cmin_float4() + { + TestUtils.AreEqual(-1.2f, cmin(float4(5.2f, -0.5f, -1.2f, 2.3f))); + TestUtils.AreEqual(float.NegativeInfinity, cmin(float4(float.NegativeInfinity, float.PositiveInfinity, 100.0f, float.NaN))); + + TestUtils.AreEqual(1.0f, cmin(float4(1.0f, float.NaN, float.NaN, float.NaN))); + TestUtils.AreEqual(1.0f, cmin(float4(float.NaN, 1.0f, float.NaN, float.NaN))); + TestUtils.AreEqual(1.0f, cmin(float4(float.NaN, float.NaN, 1.0f, float.NaN))); + TestUtils.AreEqual(1.0f, cmin(float4(float.NaN, float.NaN, float.NaN, 1.0f))); + + TestUtils.AreEqual(float.PositiveInfinity, cmin(float4(float.PositiveInfinity, float.NaN, float.NaN, float.NaN))); + TestUtils.AreEqual(float.PositiveInfinity, cmin(float4(float.NaN, float.PositiveInfinity, float.NaN, float.NaN))); + TestUtils.AreEqual(float.PositiveInfinity, cmin(float4(float.NaN, float.NaN, float.PositiveInfinity, float.NaN))); + TestUtils.AreEqual(float.PositiveInfinity, cmin(float4(float.NaN, float.NaN, float.NaN, float.PositiveInfinity))); + + TestUtils.AreEqual(float.NegativeInfinity, cmin(float4(float.NegativeInfinity, float.NaN, float.NaN, float.NaN))); + TestUtils.AreEqual(float.NegativeInfinity, cmin(float4(float.NaN, float.NegativeInfinity, float.NaN, float.NaN))); + TestUtils.AreEqual(float.NegativeInfinity, cmin(float4(float.NaN, float.NaN, float.NegativeInfinity, float.NaN))); + TestUtils.AreEqual(float.NegativeInfinity, cmin(float4(float.NaN, float.NaN, float.NaN, float.NegativeInfinity))); + } + + + [TestCompiler] + public static void cmin_double2() + { + TestUtils.AreEqual(-0.5, cmin(double2(5.2, -0.5))); + TestUtils.AreEqual(-0.5e100, cmin(double2(5.2e100, -0.5e100))); + TestUtils.AreEqual(double.NegativeInfinity, cmin(double2(double.NegativeInfinity, double.PositiveInfinity))); + TestUtils.AreEqual(double.NegativeInfinity, cmin(double2(double.NegativeInfinity, double.NaN))); + TestUtils.AreEqual(double.NegativeInfinity, cmin(double2(double.NegativeInfinity, 100.0))); + TestUtils.AreEqual(100.0, cmin(double2(double.PositiveInfinity, 100.0))); + + TestUtils.AreEqual(1.0, cmin(double2(1.0, double.NaN))); + TestUtils.AreEqual(1.0, cmin(double2(double.NaN, 1.0))); + + TestUtils.AreEqual(double.PositiveInfinity, cmin(double2(double.PositiveInfinity, double.NaN))); + TestUtils.AreEqual(double.PositiveInfinity, cmin(double2(double.NaN, double.PositiveInfinity))); + + TestUtils.AreEqual(double.NegativeInfinity, cmin(double2(double.NegativeInfinity, double.NaN))); + TestUtils.AreEqual(double.NegativeInfinity, cmin(double2(double.NaN, double.NegativeInfinity))); + } + + [TestCompiler] + public static void cmin_double3() + { + TestUtils.AreEqual(-1.2, cmin(double3(5.2, -0.5, -1.2))); + TestUtils.AreEqual(-1.2e100, cmin(double3(5.2e100, -0.5e100, -1.2e100))); + TestUtils.AreEqual(double.NegativeInfinity, cmin(double3(double.NegativeInfinity, double.PositiveInfinity, 100.0))); + TestUtils.AreEqual(double.NegativeInfinity, cmin(double3(double.NegativeInfinity, double.NaN, 100.0))); + + TestUtils.AreEqual(1.0, cmin(double3(1.0, double.NaN, double.NaN))); + TestUtils.AreEqual(1.0, cmin(double3(double.NaN, 1.0, double.NaN))); + TestUtils.AreEqual(1.0, cmin(double3(double.NaN, double.NaN, 1.0))); + + TestUtils.AreEqual(double.PositiveInfinity, cmin(double3(double.PositiveInfinity, double.NaN, double.NaN))); + TestUtils.AreEqual(double.PositiveInfinity, cmin(double3(double.NaN, double.PositiveInfinity, double.NaN))); + TestUtils.AreEqual(double.PositiveInfinity, cmin(double3(double.NaN, double.NaN, double.PositiveInfinity))); + + TestUtils.AreEqual(double.NegativeInfinity, cmin(double3(double.NegativeInfinity, double.NaN, double.NaN))); + TestUtils.AreEqual(double.NegativeInfinity, cmin(double3(double.NaN, double.NegativeInfinity, double.NaN))); + TestUtils.AreEqual(double.NegativeInfinity, cmin(double3(double.NaN, double.NaN, double.NegativeInfinity))); + } + + [TestCompiler] + public static void cmin_double4() + { + TestUtils.AreEqual(-1.2, cmin(double4(5.2, -0.5, -1.2, 2.3))); + TestUtils.AreEqual(-1.2e100, cmin(double4(5.2e100, -0.5e100, -1.2e100, 2.3e100))); + + TestUtils.AreEqual(double.NegativeInfinity, cmin(double4(double.NegativeInfinity, double.PositiveInfinity, 100.0, double.NaN))); + + TestUtils.AreEqual(1.0, cmin(double4(1.0, double.NaN, double.NaN, double.NaN))); + TestUtils.AreEqual(1.0f, cmin(double4(double.NaN, 1.0, double.NaN, double.NaN))); + TestUtils.AreEqual(1.0f, cmin(double4(double.NaN, double.NaN, 1.0, double.NaN))); + TestUtils.AreEqual(1.0f, cmin(double4(double.NaN, double.NaN, double.NaN, 1.0))); + + TestUtils.AreEqual(double.PositiveInfinity, cmin(double4(double.PositiveInfinity, double.NaN, double.NaN, double.NaN))); + TestUtils.AreEqual(double.PositiveInfinity, cmin(double4(double.NaN, double.PositiveInfinity, double.NaN, double.NaN))); + TestUtils.AreEqual(double.PositiveInfinity, cmin(double4(double.NaN, double.NaN, double.PositiveInfinity, double.NaN))); + TestUtils.AreEqual(double.PositiveInfinity, cmin(double4(double.NaN, double.NaN, double.NaN, double.PositiveInfinity))); + + TestUtils.AreEqual(double.NegativeInfinity, cmin(double4(double.NegativeInfinity, double.NaN, double.NaN, double.NaN))); + TestUtils.AreEqual(double.NegativeInfinity, cmin(double4(double.NaN, double.NegativeInfinity, double.NaN, double.NaN))); + TestUtils.AreEqual(double.NegativeInfinity, cmin(double4(double.NaN, double.NaN, double.NegativeInfinity, double.NaN))); + TestUtils.AreEqual(double.NegativeInfinity, cmin(double4(double.NaN, double.NaN, double.NaN, double.NegativeInfinity))); + } + + + [TestCompiler] + public static void cmax_int2() + { + TestUtils.AreEqual(200, cmax(int2(100, 200))); + TestUtils.AreEqual(100, cmax(int2(100, -200))); + TestUtils.AreEqual(int.MaxValue, cmax(int2(int.MaxValue, 0))); + TestUtils.AreEqual(0, cmax(int2(int.MinValue, 0))); + TestUtils.AreEqual(int.MaxValue, cmax(int2(int.MaxValue, int.MinValue))); + } + + + [TestCompiler] + public static void cmax_int3() + { + TestUtils.AreEqual(300, cmax(int3(100, 200, 300))); + TestUtils.AreEqual(300, cmax(int3(100, -200, 300))); + TestUtils.AreEqual(int.MaxValue, cmax(int3(int.MaxValue, 0, 7))); + TestUtils.AreEqual(7, cmax(int3(int.MinValue, 0, 7))); + TestUtils.AreEqual(int.MaxValue, cmax(int3(int.MaxValue, int.MinValue, 0))); + } + + + [TestCompiler] + public static void cmax_int4() + { + TestUtils.AreEqual(400, cmax(int4(100, 200, 300, 400))); + TestUtils.AreEqual(300, cmax(int4(100, -200, 300, -400))); + TestUtils.AreEqual(int.MaxValue, cmax(int4(int.MaxValue, 0, 7, 19))); + TestUtils.AreEqual(19, cmax(int4(int.MinValue, 0, 7, 19))); + TestUtils.AreEqual(int.MaxValue, cmax(int4(int.MaxValue, int.MinValue, 0, 19))); + } + + [TestCompiler] + public static void cmax_uint2() + { + TestUtils.AreEqual(200u, cmax(uint2(100u, 200u))); + TestUtils.AreEqual(uint.MaxValue, cmax(uint2(100u, uint.MaxValue))); + TestUtils.AreEqual(uint.MaxValue, cmax(uint2(uint.MinValue, uint.MaxValue))); + } + + + [TestCompiler] + public static void cmax_uint3() + { + TestUtils.AreEqual(300u, cmax(uint3(100u, 200u, 300u))); + TestUtils.AreEqual(uint.MaxValue, cmax(uint3(uint.MaxValue, 100u, 300u))); + TestUtils.AreEqual(uint.MaxValue, cmax(uint3(7u, uint.MinValue, uint.MaxValue))); + } + + + [TestCompiler] + public static void cmax_uint4() + { + TestUtils.AreEqual(400u, cmax(uint4(100u, 200u, 300u, 400u))); + TestUtils.AreEqual(uint.MaxValue, cmax(uint4(300u, 100u, uint.MaxValue, 200u))); + TestUtils.AreEqual(uint.MaxValue, cmax(uint4(19u, uint.MinValue, uint.MaxValue, 7u))); + } + + [TestCompiler] + public static void cmax_float2() + { + TestUtils.AreEqual(5.2f, cmax(float2(5.2f, -0.5f))); + TestUtils.AreEqual(float.PositiveInfinity, cmax(float2(float.NegativeInfinity, float.PositiveInfinity))); + TestUtils.AreEqual(float.NegativeInfinity, cmax(float2(float.NegativeInfinity, float.NaN))); + TestUtils.AreEqual(100.0f, cmax(float2(float.NegativeInfinity, 100.0f))); + TestUtils.AreEqual(float.PositiveInfinity, cmax(float2(float.PositiveInfinity, 100.0f))); + + TestUtils.AreEqual(1.0f, cmax(float2(1.0f, float.NaN))); + TestUtils.AreEqual(1.0f, cmax(float2(float.NaN, 1.0f))); + + TestUtils.AreEqual(float.PositiveInfinity, cmax(float2(float.PositiveInfinity, float.NaN))); + TestUtils.AreEqual(float.PositiveInfinity, cmax(float2(float.NaN, float.PositiveInfinity))); + + TestUtils.AreEqual(float.NegativeInfinity, cmax(float2(float.NegativeInfinity, float.NaN))); + TestUtils.AreEqual(float.NegativeInfinity, cmax(float2(float.NaN, float.NegativeInfinity))); + } + + [TestCompiler] + public static void cmax_float3() + { + TestUtils.AreEqual(5.2f, cmax(float3(5.2f, -0.5f, -1.2f))); + TestUtils.AreEqual(float.PositiveInfinity, cmax(float3(float.NegativeInfinity, float.PositiveInfinity, 100.0f))); + TestUtils.AreEqual(100.0f, cmax(float3(float.NegativeInfinity, float.NaN, 100.0f))); + + TestUtils.AreEqual(1.0f, cmax(float3(1.0f, float.NaN, float.NaN))); + TestUtils.AreEqual(1.0f, cmax(float3(float.NaN, 1.0f, float.NaN))); + TestUtils.AreEqual(1.0f, cmax(float3(float.NaN, float.NaN, 1.0f))); + + TestUtils.AreEqual(float.PositiveInfinity, cmax(float3(float.PositiveInfinity, float.NaN, float.NaN))); + TestUtils.AreEqual(float.PositiveInfinity, cmax(float3(float.NaN, float.PositiveInfinity, float.NaN))); + TestUtils.AreEqual(float.PositiveInfinity, cmax(float3(float.NaN, float.NaN, float.PositiveInfinity))); + + TestUtils.AreEqual(float.NegativeInfinity, cmax(float3(float.NegativeInfinity, float.NaN, float.NaN))); + TestUtils.AreEqual(float.NegativeInfinity, cmax(float3(float.NaN, float.NegativeInfinity, float.NaN))); + TestUtils.AreEqual(float.NegativeInfinity, cmax(float3(float.NaN, float.NaN, float.NegativeInfinity))); + } + + [TestCompiler] + public static void cmax_float4() + { + TestUtils.AreEqual(5.2f, cmax(float4(5.2f, -0.5f, -1.2f, 2.3f))); + TestUtils.AreEqual(float.PositiveInfinity, cmax(float4(float.NegativeInfinity, float.PositiveInfinity, 100.0f, float.NaN))); + + TestUtils.AreEqual(1.0f, cmax(float4(1.0f, float.NaN, float.NaN, float.NaN))); + TestUtils.AreEqual(1.0f, cmax(float4(float.NaN, 1.0f, float.NaN, float.NaN))); + TestUtils.AreEqual(1.0f, cmax(float4(float.NaN, float.NaN, 1.0f, float.NaN))); + TestUtils.AreEqual(1.0f, cmax(float4(float.NaN, float.NaN, float.NaN, 1.0f))); + + TestUtils.AreEqual(float.PositiveInfinity, cmax(float4(float.PositiveInfinity, float.NaN, float.NaN, float.NaN))); + TestUtils.AreEqual(float.PositiveInfinity, cmax(float4(float.NaN, float.PositiveInfinity, float.NaN, float.NaN))); + TestUtils.AreEqual(float.PositiveInfinity, cmax(float4(float.NaN, float.NaN, float.PositiveInfinity, float.NaN))); + TestUtils.AreEqual(float.PositiveInfinity, cmax(float4(float.NaN, float.NaN, float.NaN, float.PositiveInfinity))); + + TestUtils.AreEqual(float.NegativeInfinity, cmax(float4(float.NegativeInfinity, float.NaN, float.NaN, float.NaN))); + TestUtils.AreEqual(float.NegativeInfinity, cmax(float4(float.NaN, float.NegativeInfinity, float.NaN, float.NaN))); + TestUtils.AreEqual(float.NegativeInfinity, cmax(float4(float.NaN, float.NaN, float.NegativeInfinity, float.NaN))); + TestUtils.AreEqual(float.NegativeInfinity, cmax(float4(float.NaN, float.NaN, float.NaN, float.NegativeInfinity))); + } + + + [TestCompiler] + public static void cmax_double2() + { + TestUtils.AreEqual(5.2, cmax(double2(5.2, -0.5))); + TestUtils.AreEqual(5.2e100, cmax(double2(5.2e100, -0.5e100))); + TestUtils.AreEqual(double.PositiveInfinity, cmax(double2(double.NegativeInfinity, double.PositiveInfinity))); + TestUtils.AreEqual(double.NegativeInfinity, cmax(double2(double.NegativeInfinity, double.NaN))); + TestUtils.AreEqual(100.0, cmax(double2(double.NegativeInfinity, 100.0))); + TestUtils.AreEqual(double.PositiveInfinity, cmax(double2(double.PositiveInfinity, 100.0))); + + TestUtils.AreEqual(1.0, cmax(double2(1.0, double.NaN))); + TestUtils.AreEqual(1.0, cmax(double2(double.NaN, 1.0))); + + TestUtils.AreEqual(double.PositiveInfinity, cmax(double2(double.PositiveInfinity, double.NaN))); + TestUtils.AreEqual(double.PositiveInfinity, cmax(double2(double.NaN, double.PositiveInfinity))); + + TestUtils.AreEqual(double.NegativeInfinity, cmax(double2(double.NegativeInfinity, double.NaN))); + TestUtils.AreEqual(double.NegativeInfinity, cmax(double2(double.NaN, double.NegativeInfinity))); + } + + [TestCompiler] + public static void cmax_double3() + { + TestUtils.AreEqual(5.2, cmax(double3(5.2, -0.5, -1.2))); + TestUtils.AreEqual(5.2e100, cmax(double3(5.2e100, -0.5e100, -1.2e100))); + TestUtils.AreEqual(double.PositiveInfinity, cmax(double3(double.NegativeInfinity, double.PositiveInfinity, 100.0))); + TestUtils.AreEqual(100.0, cmax(double3(double.NegativeInfinity, double.NaN, 100.0))); + + TestUtils.AreEqual(1.0, cmax(double3(1.0, double.NaN, double.NaN))); + TestUtils.AreEqual(1.0, cmax(double3(double.NaN, 1.0, double.NaN))); + TestUtils.AreEqual(1.0, cmax(double3(double.NaN, double.NaN, 1.0))); + + TestUtils.AreEqual(double.PositiveInfinity, cmax(double3(double.PositiveInfinity, double.NaN, double.NaN))); + TestUtils.AreEqual(double.PositiveInfinity, cmax(double3(double.NaN, double.PositiveInfinity, double.NaN))); + TestUtils.AreEqual(double.PositiveInfinity, cmax(double3(double.NaN, double.NaN, double.PositiveInfinity))); + + TestUtils.AreEqual(double.NegativeInfinity, cmax(double3(double.NegativeInfinity, double.NaN, double.NaN))); + TestUtils.AreEqual(double.NegativeInfinity, cmax(double3(double.NaN, double.NegativeInfinity, double.NaN))); + TestUtils.AreEqual(double.NegativeInfinity, cmax(double3(double.NaN, double.NaN, double.NegativeInfinity))); + } + + [TestCompiler] + public static void cmax_double4() + { + TestUtils.AreEqual(5.2, cmax(double4(5.2, -0.5, -1.2, 2.3))); + TestUtils.AreEqual(5.2e100, cmax(double4(5.2e100, -0.5e100, -1.2e100, 2.3e100))); + + TestUtils.AreEqual(double.PositiveInfinity, cmax(double4(double.NegativeInfinity, double.PositiveInfinity, 100.0, double.NaN))); + + TestUtils.AreEqual(1.0, cmax(double4(1.0, double.NaN, double.NaN, double.NaN))); + TestUtils.AreEqual(1.0f, cmax(double4(double.NaN, 1.0, double.NaN, double.NaN))); + TestUtils.AreEqual(1.0f, cmax(double4(double.NaN, double.NaN, 1.0, double.NaN))); + TestUtils.AreEqual(1.0f, cmax(double4(double.NaN, double.NaN, double.NaN, 1.0))); + + TestUtils.AreEqual(double.PositiveInfinity, cmax(double4(double.PositiveInfinity, double.NaN, double.NaN, double.NaN))); + TestUtils.AreEqual(double.PositiveInfinity, cmax(double4(double.NaN, double.PositiveInfinity, double.NaN, double.NaN))); + TestUtils.AreEqual(double.PositiveInfinity, cmax(double4(double.NaN, double.NaN, double.PositiveInfinity, double.NaN))); + TestUtils.AreEqual(double.PositiveInfinity, cmax(double4(double.NaN, double.NaN, double.NaN, double.PositiveInfinity))); + + TestUtils.AreEqual(double.NegativeInfinity, cmax(double4(double.NegativeInfinity, double.NaN, double.NaN, double.NaN))); + TestUtils.AreEqual(double.NegativeInfinity, cmax(double4(double.NaN, double.NegativeInfinity, double.NaN, double.NaN))); + TestUtils.AreEqual(double.NegativeInfinity, cmax(double4(double.NaN, double.NaN, double.NegativeInfinity, double.NaN))); + TestUtils.AreEqual(double.NegativeInfinity, cmax(double4(double.NaN, double.NaN, double.NaN, double.NegativeInfinity))); + } + + [TestCompiler] + public static void csum_int2() + { + TestUtils.AreEqual(300, csum(int2(100, 200))); + TestUtils.AreEqual(-100, csum(int2(100, -200))); + TestUtils.AreEqual(int.MinValue + 6, csum(int2(int.MaxValue, 7))); + TestUtils.AreEqual(int.MaxValue - 6, csum(int2(int.MinValue, -7))); + TestUtils.AreEqual(-1, csum(int2(int.MaxValue, int.MinValue))); + } + + + [TestCompiler] + public static void csum_int3() + { + TestUtils.AreEqual(600, csum(int3(100, 200, 300))); + TestUtils.AreEqual(-400, csum(int3(100, -200, -300))); + TestUtils.AreEqual(int.MinValue + 17, csum(int3(int.MaxValue, 7, 11))); + TestUtils.AreEqual(int.MaxValue - 17, csum(int3(int.MinValue, -7, -11))); + TestUtils.AreEqual(-1, csum(int3(int.MaxValue, int.MinValue, 0))); + } + + + [TestCompiler] + public static void csum_int4() + { + TestUtils.AreEqual(1000, csum(int4(100, 200, 300, 400))); + TestUtils.AreEqual(-200, csum(int4(100, -200, 300, -400))); + TestUtils.AreEqual(int.MinValue + 36, csum(int4(int.MaxValue, 7, 11, 19))); + TestUtils.AreEqual(int.MaxValue - 36, csum(int4(int.MinValue, -7, -11, -19))); + TestUtils.AreEqual(-1, csum(int4(int.MaxValue, int.MinValue, 0, 0))); + } + + [TestCompiler] + public static void csum_uint2() + { + TestUtils.AreEqual(300u, csum(uint2(100u, 200u))); + TestUtils.AreEqual(6u, csum(uint2(uint.MaxValue, 7u))); + } + + + [TestCompiler] + public static void csum_uint3() + { + TestUtils.AreEqual(600u, csum(uint3(100u, 200u, 300u))); + TestUtils.AreEqual(25u, csum(uint3(uint.MaxValue, 7u, 19u))); + } + + + [TestCompiler] + public static void csum_uint4() + { + TestUtils.AreEqual(1000u, csum(uint4(100u, 200u, 300u, 400u))); + TestUtils.AreEqual(36u, csum(uint4(uint.MaxValue, 7u, 11u, 19u))); + } + + [TestCompiler] + public static void csum_float2() + { + TestUtils.AreEqual(0.7f, csum(float2(2.2f, -1.5f)), 4, false); + TestUtils.AreEqual(-7e37f, csum(float2(-2.2e38f, 1.5e38f)), 4, false); + TestUtils.AreEqual(float.NegativeInfinity, csum(float2(-2.2e38f, -1.5e38f)), 0, false); + TestUtils.AreEqual(float.PositiveInfinity, csum(float2( 2.2e38f, 1.5e38f)), 0, false); + + TestUtils.AreEqual(float.NaN, csum(float2(float.NegativeInfinity, float.PositiveInfinity)), 0, false); + TestUtils.AreEqual(float.NaN, csum(float2(float.NegativeInfinity, float.NaN)), 0, false); + TestUtils.AreEqual(float.NegativeInfinity, csum(float2(float.NegativeInfinity, 100.0f)), 0, false); + TestUtils.AreEqual(float.PositiveInfinity, csum(float2(float.PositiveInfinity, 100.0f)), 0, false); + + TestUtils.AreEqual(float.NaN, csum(float2(1.0f, float.NaN)), 0, false); + TestUtils.AreEqual(float.NaN, csum(float2(float.NaN, 1.0f)), 0, false); + + TestUtils.AreEqual(float.PositiveInfinity, csum(float2(float.PositiveInfinity, 1.0f)), 0, false); + TestUtils.AreEqual(float.PositiveInfinity, csum(float2(-1.0f, float.PositiveInfinity)), 0, false); + + TestUtils.AreEqual(float.NegativeInfinity, csum(float2(float.NegativeInfinity, 1.0f)), 0, false); + TestUtils.AreEqual(float.NegativeInfinity, csum(float2(-1.0f, float.NegativeInfinity)), 0, false); + } + + [TestCompiler] + public static void csum_float3() + { + TestUtils.AreEqual(1.9f, csum(float3(2.2f, -1.5f, 1.2f)), 4, false); + TestUtils.AreEqual(1.9e38f, csum(float3(2.2e38f, -1.5e38f, 1.2e38f)), 4, false); + TestUtils.AreEqual(float.NegativeInfinity, csum(float3(-2.2e38f, -1.5e38f, -1.2e38f)), 0, false); + TestUtils.AreEqual(float.PositiveInfinity, csum(float3(2.2e38f, 1.5e38f, 1.2e38f)), 0, false); + + TestUtils.AreEqual(float.NaN, csum(float3(float.NegativeInfinity, float.PositiveInfinity, 100.0f)), 0, false); + TestUtils.AreEqual(float.NaN, csum(float3(float.NegativeInfinity, float.NaN, 100.0f)), 0, false); + + TestUtils.AreEqual(float.NaN, csum(float3(float.NaN, 1.0f, 1.0f)), 0, false); + TestUtils.AreEqual(float.NaN, csum(float3(1.0f, float.NaN, 1.0f)), 0, false); + TestUtils.AreEqual(float.NaN, csum(float3(1.0f, 1.0f, float.NaN)), 0, false); + + TestUtils.AreEqual(float.PositiveInfinity, csum(float3(float.PositiveInfinity, 1.0f, -2.0f)), 0, false); + TestUtils.AreEqual(float.PositiveInfinity, csum(float3(1.0f, float.PositiveInfinity, -2.0f)), 0, false); + TestUtils.AreEqual(float.PositiveInfinity, csum(float3(-2.0f, 1.0f, float.PositiveInfinity)), 0, false); + + TestUtils.AreEqual(float.NegativeInfinity, csum(float3(float.NegativeInfinity, 1.0f, -2.0f)), 0, false); + TestUtils.AreEqual(float.NegativeInfinity, csum(float3(-1.0f, float.NegativeInfinity, 2.0f)), 0, false); + TestUtils.AreEqual(float.NegativeInfinity, csum(float3(-2.0f, 1.0f, float.NegativeInfinity)), 0, false); + } + + [TestCompiler] + public static void csum_float4() + { + TestUtils.AreEqual(1.2f, csum(float4(2.2f, -1.5f, 1.2f, -0.7f)), 4, false); + TestUtils.AreEqual(1.2e38f, csum(float4(2.2e38f, -1.5e38f, 1.2e38f, -0.7e38f)), 4, false); + TestUtils.AreEqual(float.NegativeInfinity, csum(float4(-2.2e38f, -1.5e38f, -1.2e38f, -0.7e38f)), 0, false); + TestUtils.AreEqual(float.PositiveInfinity, csum(float4(2.2e38f, 1.5e38f, 1.2e38f, 0.7e38f)), 0, false); + + TestUtils.AreEqual(float.NaN, csum(float4(float.NegativeInfinity, float.PositiveInfinity, 100.0f, 200.0f)), 0, false); + + TestUtils.AreEqual(float.NaN, csum(float4(float.NaN, 1.0f, 1.0f, 1.0f)), 0, false); + TestUtils.AreEqual(float.NaN, csum(float4(1.0f, float.NaN, 1.0f, 1.0f)), 0, false); + TestUtils.AreEqual(float.NaN, csum(float4(1.0f, 1.0f, float.NaN, 1.0f)), 0, false); + TestUtils.AreEqual(float.NaN, csum(float4(1.0f, 1.0f, 1.0f, float.NaN)), 0, false); + + TestUtils.AreEqual(float.PositiveInfinity, csum(float4(float.PositiveInfinity, 1.0f, -2.0f, 3.0f)), 0, false); + TestUtils.AreEqual(float.PositiveInfinity, csum(float4(1.0f, float.PositiveInfinity, -2.0f, 3.0f)), 0, false); + TestUtils.AreEqual(float.PositiveInfinity, csum(float4(1.0f, -2.0f, float.PositiveInfinity, 3.0f)), 0, false); + TestUtils.AreEqual(float.PositiveInfinity, csum(float4(1.0f, -2.0f, 3.0f, float.PositiveInfinity)), 0, false); + + TestUtils.AreEqual(float.NegativeInfinity, csum(float4(float.NegativeInfinity, 1.0f, -2.0f, 3.0f)), 0, false); + TestUtils.AreEqual(float.NegativeInfinity, csum(float4(1.0f, float.NegativeInfinity, -2.0f, 3.0f)), 0, false); + TestUtils.AreEqual(float.NegativeInfinity, csum(float4(1.0f, -2.0f, float.NegativeInfinity, 3.0f)), 0, false); + TestUtils.AreEqual(float.NegativeInfinity, csum(float4(1.0f, -2.0f, -3.0f, float.NegativeInfinity)), 0, false); + } + + + [TestCompiler] + public static void csum_double2() + { + TestUtils.AreEqual(0.7, csum(double2(2.2, -1.5)), 4, false); + TestUtils.AreEqual(-7e306, csum(double2(-2.2e307, 1.5e307)), 4, false); + TestUtils.AreEqual(double.NegativeInfinity, csum(double2(-1.2e308, -0.7e308))); + TestUtils.AreEqual(double.PositiveInfinity, csum(double2(1.2e308, 0.7e308))); + + TestUtils.AreEqual(double.NaN, csum(double2(double.NegativeInfinity, double.PositiveInfinity))); + TestUtils.AreEqual(double.NaN, csum(double2(double.NegativeInfinity, double.NaN))); + TestUtils.AreEqual(double.NegativeInfinity, csum(double2(double.NegativeInfinity, 100.0))); + TestUtils.AreEqual(double.PositiveInfinity, csum(double2(double.PositiveInfinity, 100.0))); + + TestUtils.AreEqual(double.NaN, csum(double2(1.0, double.NaN))); + TestUtils.AreEqual(double.NaN, csum(double2(double.NaN, 1.0))); + + TestUtils.AreEqual(double.PositiveInfinity, csum(double2(double.PositiveInfinity, 1.0))); + TestUtils.AreEqual(double.PositiveInfinity, csum(double2(-1.0, double.PositiveInfinity))); + + TestUtils.AreEqual(double.NegativeInfinity, csum(double2(double.NegativeInfinity, 1.0))); + TestUtils.AreEqual(double.NegativeInfinity, csum(double2(-1.0, double.NegativeInfinity))); + } + + [TestCompiler] + public static void csum_double3() + { + TestUtils.AreEqual(1.9, csum(double3(2.2, -1.5, 1.2)), 4, false); + TestUtils.AreEqual(1.9e307, csum(double3(2.2e307, -1.5e307, 1.2e307)), 4, false); + TestUtils.AreEqual(double.NegativeInfinity, csum(double3(-1.2e308, -0.7e308, -1.4e308))); + TestUtils.AreEqual(double.PositiveInfinity, csum(double3(1.2e308, 0.7e308, 1.4e308))); + + TestUtils.AreEqual(double.NaN, csum(double3(double.NegativeInfinity, double.PositiveInfinity, 100.0))); + TestUtils.AreEqual(double.NaN, csum(double3(double.NegativeInfinity, double.NaN, 100.0))); + + TestUtils.AreEqual(double.NaN, csum(double3(double.NaN, 1.0, 1.0))); + TestUtils.AreEqual(double.NaN, csum(double3(1.0, double.NaN, 1.0))); + TestUtils.AreEqual(double.NaN, csum(double3(1.0, 1.0, double.NaN))); + + TestUtils.AreEqual(double.PositiveInfinity, csum(double3(double.PositiveInfinity, 1.0, -2.0))); + TestUtils.AreEqual(double.PositiveInfinity, csum(double3(1.0, double.PositiveInfinity, -2.0))); + TestUtils.AreEqual(double.PositiveInfinity, csum(double3(-2.0, 1.0, double.PositiveInfinity))); + + TestUtils.AreEqual(double.NegativeInfinity, csum(double3(double.NegativeInfinity, 1.0, -2.0))); + TestUtils.AreEqual(double.NegativeInfinity, csum(double3(-1.0, double.NegativeInfinity, 2.0))); + TestUtils.AreEqual(double.NegativeInfinity, csum(double3(-2.0, 1.0, double.NegativeInfinity))); + } + + [TestCompiler] + public static void csum_double4() + { + TestUtils.AreEqual(1.2, csum(double4(2.2, -1.5, 1.2, -0.7)), 4, false); + TestUtils.AreEqual(1.2e307, csum(double4(2.2e307, -1.5e307, 1.2e307, -0.7e307)), 4, false); + TestUtils.AreEqual(double.NegativeInfinity, csum(double4(-1.2e308, -0.7e308, -1.4e308, -0.9e308))); + TestUtils.AreEqual(double.PositiveInfinity, csum(double4(1.2e308, 0.7e308, 1.4e308, 0.9e308))); + + TestUtils.AreEqual(double.NaN, csum(double4(double.NegativeInfinity, double.PositiveInfinity, 100.0, 200.0))); + + TestUtils.AreEqual(double.NaN, csum(double4(double.NaN, 1.0, 1.0, 1.0))); + TestUtils.AreEqual(double.NaN, csum(double4(1.0, double.NaN, 1.0, 1.0))); + TestUtils.AreEqual(double.NaN, csum(double4(1.0, 1.0, double.NaN, 1.0))); + TestUtils.AreEqual(double.NaN, csum(double4(1.0, 1.0, 1.0, double.NaN))); + + TestUtils.AreEqual(double.PositiveInfinity, csum(double4(double.PositiveInfinity, 1.0, -2.0, 3.0))); + TestUtils.AreEqual(double.PositiveInfinity, csum(double4(1.0, double.PositiveInfinity, -2.0, 3.0))); + TestUtils.AreEqual(double.PositiveInfinity, csum(double4(1.0, -2.0, double.PositiveInfinity, 3.0))); + TestUtils.AreEqual(double.PositiveInfinity, csum(double4(1.0, -2.0, 3.0, double.PositiveInfinity))); + + TestUtils.AreEqual(double.NegativeInfinity, csum(double4(double.NegativeInfinity, 1.0, -2.0, 3.0))); + TestUtils.AreEqual(double.NegativeInfinity, csum(double4(1.0, double.NegativeInfinity, -2.0, 3.0))); + TestUtils.AreEqual(double.NegativeInfinity, csum(double4(1.0, -2.0, double.NegativeInfinity, 3.0))); + TestUtils.AreEqual(double.NegativeInfinity, csum(double4(1.0, -2.0, 3.0, double.NegativeInfinity))); + } + + + [TestCompiler] + public static void any_bool2() + { + TestUtils.AreEqual(false, any(bool2(false, false))); + TestUtils.AreEqual(true, any(bool2(false, true))); + TestUtils.AreEqual(true, any(bool2(true, false))); + TestUtils.AreEqual(true, any(bool2(true, true))); + } + + [TestCompiler] + public static void any_bool3() + { + TestUtils.AreEqual(false, any(bool3(false, false, false))); + TestUtils.AreEqual(true, any(bool3(false, false, true))); + TestUtils.AreEqual(true, any(bool3(false, true, false))); + TestUtils.AreEqual(true, any(bool3(false, true, true))); + + TestUtils.AreEqual(true, any(bool3(true, false, false))); + TestUtils.AreEqual(true, any(bool3(true, false, true))); + TestUtils.AreEqual(true, any(bool3(true, true, false))); + TestUtils.AreEqual(true, any(bool3(true, true, true))); + } + + [TestCompiler] + public static void any_bool4() + { + TestUtils.AreEqual(false, any(bool4(false, false, false, false))); + TestUtils.AreEqual(true, any(bool4(false, false, false, true))); + TestUtils.AreEqual(true, any(bool4(false, false, true, false))); + TestUtils.AreEqual(true, any(bool4(false, false, true, true))); + + TestUtils.AreEqual(true, any(bool4(false, true, false, false))); + TestUtils.AreEqual(true, any(bool4(false, true, false, true))); + TestUtils.AreEqual(true, any(bool4(false, true, true, false))); + TestUtils.AreEqual(true, any(bool4(false, true, true, true))); + + TestUtils.AreEqual(true, any(bool4(true, false, false, false))); + TestUtils.AreEqual(true, any(bool4(true, false, false, true))); + TestUtils.AreEqual(true, any(bool4(true, false, true, false))); + TestUtils.AreEqual(true, any(bool4(true, false, true, true))); + + TestUtils.AreEqual(true, any(bool4(true, true, false, false))); + TestUtils.AreEqual(true, any(bool4(true, true, false, true))); + TestUtils.AreEqual(true, any(bool4(true, true, true, false))); + TestUtils.AreEqual(true, any(bool4(true, true, true, true))); + } + + [TestCompiler] + public static void any_int2() + { + TestUtils.AreEqual(false, any(int2(0, 0))); + TestUtils.AreEqual(true, any(int2(0, -1))); + TestUtils.AreEqual(true, any(int2(1, 0))); + TestUtils.AreEqual(true, any(int2(2, int.MinValue))); + } + + + [TestCompiler] + public static void any_int3() + { + TestUtils.AreEqual(false, any(int3(0, 0, 0))); + TestUtils.AreEqual(true, any(int3(0, 0, 1))); + TestUtils.AreEqual(true, any(int3(0, -1, 0))); + TestUtils.AreEqual(true, any(int3(0, int.MinValue, int.MaxValue))); + + TestUtils.AreEqual(true, any(int3(5, 0, 0))); + TestUtils.AreEqual(true, any(int3(11, 0, -11))); + TestUtils.AreEqual(true, any(int3(-100, -32, 0))); + TestUtils.AreEqual(true, any(int3(-121, 100, 322))); + } + + [TestCompiler] + public static void any_int4() + { + TestUtils.AreEqual(false, any(int4(0, 0, 0, 0))); + TestUtils.AreEqual(true, any(int4(0, 0, 0, 1))); + TestUtils.AreEqual(true, any(int4(0, 0, -1, 0))); + TestUtils.AreEqual(true, any(int4(0, 0, int.MinValue, int.MaxValue))); + + TestUtils.AreEqual(true, any(int4(0, 5, 0, 0))); + TestUtils.AreEqual(true, any(int4(0, 11, 0, -11))); + TestUtils.AreEqual(true, any(int4(0, 12, 55, 0))); + TestUtils.AreEqual(true, any(int4(0, 100, 102, 10123))); + + TestUtils.AreEqual(true, any(int4(-323, 0, 0, 0))); + TestUtils.AreEqual(true, any(int4(-564, 0, 0, 55))); + TestUtils.AreEqual(true, any(int4(23, 0, 12, 0))); + TestUtils.AreEqual(true, any(int4(100, 0, 55, 22))); + + TestUtils.AreEqual(true, any(int4(22, -99, 0, 0))); + TestUtils.AreEqual(true, any(int4(33, -88, 0, 100))); + TestUtils.AreEqual(true, any(int4(44, -77, 0x10000, 0))); + TestUtils.AreEqual(true, any(int4(55, -66, 0x20000, 0x30000))); + } + + + [TestCompiler] + public static void any_uint2() + { + TestUtils.AreEqual(false, any(uint2(0u, 0u))); + TestUtils.AreEqual(true, any(uint2(0u, 0xFFFFFFFFu))); + TestUtils.AreEqual(true, any(uint2(100u, 0u))); + TestUtils.AreEqual(true, any(uint2(200u, 1000u))); + } + + + [TestCompiler] + public static void any_uint3() + { + TestUtils.AreEqual(false, any(uint3(0u, 0u, 0u))); + TestUtils.AreEqual(true, any(uint3(0u, 0u, 1u))); + TestUtils.AreEqual(true, any(uint3(0u, 0xFFFFFFFFu, 0u))); + TestUtils.AreEqual(true, any(uint3(0u, uint.MinValue, uint.MaxValue))); + + TestUtils.AreEqual(true, any(uint3(5u, 0u, 0u))); + TestUtils.AreEqual(true, any(uint3(11u, 0u, 100u))); + TestUtils.AreEqual(true, any(uint3(100u, 32u, 0u))); + TestUtils.AreEqual(true, any(uint3(121u, 100u, 322u))); + } + + [TestCompiler] + public static void any_uint4() + { + TestUtils.AreEqual(false, any(uint4(0u, 0u, 0u, 0u))); + TestUtils.AreEqual(true, any(uint4(0u, 0u, 0u, 1u))); + TestUtils.AreEqual(true, any(uint4(0u, 0u, 0xFFFFFFFFu, 0u))); + TestUtils.AreEqual(true, any(uint4(0u, 0u, uint.MinValue, uint.MaxValue))); + + TestUtils.AreEqual(true, any(uint4(0u, 5u, 0u, 0u))); + TestUtils.AreEqual(true, any(uint4(0u, 11u, 0u, 22u))); + TestUtils.AreEqual(true, any(uint4(0u, 12u, 55u, 0u))); + TestUtils.AreEqual(true, any(uint4(0u, 100u, 102u, 10123u))); + + TestUtils.AreEqual(true, any(uint4(323u, 0u, 0u, 0u))); + TestUtils.AreEqual(true, any(uint4(564u, 0u, 0u, 55u))); + TestUtils.AreEqual(true, any(uint4(23u, 0u, 12u, 0u))); + TestUtils.AreEqual(true, any(uint4(100u, 0u, 55u, 22u))); + + TestUtils.AreEqual(true, any(uint4(22u, 99u, 0u, 0u))); + TestUtils.AreEqual(true, any(uint4(33u, 88u, 0u, 100u))); + TestUtils.AreEqual(true, any(uint4(44u, 77u, 0x10000, 0u))); + TestUtils.AreEqual(true, any(uint4(55u, 66u, 0x20000u, 0x30000u))); + } + + + [TestCompiler] + public static void any_float2() + { + //TestUtils.AreEqual(true, any(float2(0, float.NaN))); // TODO: doesn't work with burst + + TestUtils.AreEqual(false, any(float2(0, -0))); + //TestUtils.AreEqual(true, any(float2(0, float.NaN))); // TODO: doesn't work with burst + TestUtils.AreEqual(true, any(float2(-2.0f, 0))); + TestUtils.AreEqual(true, any(float2(float.PositiveInfinity, float.NegativeInfinity))); + } + + + [TestCompiler] + public static void any_float3() + { + //TestUtils.AreEqual(true, any(float3(0.0f, float.NaN, 0.0f))); // TODO: doesn't work with burst + + TestUtils.AreEqual(false, any(float3(0.0f, 0.0f, 0.0f))); + //TestUtils.AreEqual(true, any(float3(0.0f, 0.0f, float.NaN))); // TODO: doesn't work with burst + TestUtils.AreEqual(true, any(float3(0.0f, -1.0f, 0.0f))); + TestUtils.AreEqual(true, any(float3(0.0f, float.NegativeInfinity, float.PositiveInfinity))); + + TestUtils.AreEqual(true, any(float3(float.PositiveInfinity, 0.0f, 0.0f))); + TestUtils.AreEqual(true, any(float3(float.MaxValue, -0.0f, 1e38f))); + TestUtils.AreEqual(true, any(float3(-1.2e28f, 3.2f, 0.0f))); + TestUtils.AreEqual(true, any(float3(121.2f, 100.0f, -32.2f))); + } + + [TestCompiler] + public static void any_float4() + { + TestUtils.AreEqual(false, any(float4(0.0f, 0.0f, 0.0f, 0.0f))); + //TestUtils.AreEqual(true, any(float4(0.0f, 0.0f, 0.0f, float.NaN))); // TODO: doesn't work with burst + TestUtils.AreEqual(true, any(float4(0.0f, 0.0f, 1.0f, 0.0f))); + TestUtils.AreEqual(true, any(float4(0.0f, 0.0f, float.NegativeInfinity, float.PositiveInfinity))); + + TestUtils.AreEqual(true, any(float4(0.0f, float.PositiveInfinity, 0.0f, 0.0f))); + TestUtils.AreEqual(true, any(float4(0.0f, 11.2f, 0.0f, float.MinValue))); + TestUtils.AreEqual(true, any(float4(0.0f, -12.2f, float.MaxValue, 0u))); + TestUtils.AreEqual(true, any(float4(0.0f, -1.2e28f, -32.2f, 22.0f))); + + TestUtils.AreEqual(true, any(float4(323.2f, 0.0f, 0.0f, 0.0f))); + TestUtils.AreEqual(true, any(float4(-564.6f, 0.0f, 0.0f, 1113f))); + TestUtils.AreEqual(true, any(float4(-23.0f, 0.0f, 0.2f, 0.0f))); + TestUtils.AreEqual(true, any(float4(102.0f, 0.0f, 5.5f, -22.0f))); + + //TestUtils.AreEqual(true, any(float4(float.NaN, -99.0f, 0.0f, 0.0f))); // TODO: doesn't work with burst + TestUtils.AreEqual(true, any(float4(33.0f, 88.0f, 0.0f, 100.0f))); + TestUtils.AreEqual(true, any(float4(44.0f, 77.0f, -2000.0f, 0.0f))); + TestUtils.AreEqual(true, any(float4(55.0f, 66.0f, 5000.0f, 10000.2f))); + } + + [TestCompiler] + public static void any_double2() + { + //TestUtils.AreEqual(true, any(double2(0, double.NaN))); // TODO: doesn't work with burst. + + TestUtils.AreEqual(false, any(double2(0, -0))); + //TestUtils.AreEqual(true, any(double2(0, double.NaN))); // TODO: doesn't work with burst + TestUtils.AreEqual(true, any(double2(-2.0, 0))); + TestUtils.AreEqual(true, any(double2(double.PositiveInfinity, double.NegativeInfinity))); + } + + + [TestCompiler] + public static void any_double3() + { + //TestUtils.AreEqual(true, any(double3(0.0, double.NaN, 0.0))); // TODO: doesn't work with burst + + TestUtils.AreEqual(false, any(double3(0.0, 0.0, 0.0))); + //TestUtils.AreEqual(true, any(double3(0.0, 0.0, double.NaN))); // TODO: doesn't work with burst + TestUtils.AreEqual(true, any(double3(0.0, -1.0, 0.0))); + TestUtils.AreEqual(true, any(double3(0.0, double.NegativeInfinity, double.PositiveInfinity))); + + TestUtils.AreEqual(true, any(double3(double.PositiveInfinity, 0.0, 0.0))); + TestUtils.AreEqual(true, any(double3(double.MaxValue, -0.0, 1e108))); + TestUtils.AreEqual(true, any(double3(-1.2e128, 3.2, 0.0))); + TestUtils.AreEqual(true, any(double3(121.2, 100.0, -32.2))); + } + + [TestCompiler] + public static void any_double4() + { + TestUtils.AreEqual(false, any(double4(0.0, 0.0, 0.0, 0.0))); + //TestUtils.AreEqual(true, any(double4(0.0, 0.0, 0.0, double.NaN))); // TODO: doesn't work with burst + TestUtils.AreEqual(true, any(double4(0.0, 0.0, 1.0, 0.0))); + TestUtils.AreEqual(true, any(double4(0.0, 0.0, double.NegativeInfinity, double.PositiveInfinity))); + + TestUtils.AreEqual(true, any(double4(0.0, double.PositiveInfinity, 0.0, 0.0))); + TestUtils.AreEqual(true, any(double4(0.0, 11.2, 0.0, double.MinValue))); + TestUtils.AreEqual(true, any(double4(0.0, -12.2, double.MaxValue, 0.0))); + TestUtils.AreEqual(true, any(double4(0.0, -1.2e28, -32.2, 22.0))); + + TestUtils.AreEqual(true, any(double4(323.2, 0.0, 0.0, 0.0))); + TestUtils.AreEqual(true, any(double4(-564.6, 0.0, 0.0, 1113.0))); + TestUtils.AreEqual(true, any(double4(-23.0, 0.0, 0.2, 0.0))); + TestUtils.AreEqual(true, any(double4(102.0, 0.0, 5.5, -22.0))); + + //TestUtils.AreEqual(true, any(double4(double.NaN, -99.0, 0.0, 0.0))); // TODO: doesn't work with burst + TestUtils.AreEqual(true, any(double4(33.0, 88.0, 0.0, 100.0))); + TestUtils.AreEqual(true, any(double4(44.0, 77.0, -2000.0, 0.0))); + TestUtils.AreEqual(true, any(double4(55.0, 66.0, 5000.0, 10000.2))); + } + + + [TestCompiler] + public static void all_bool2() + { + TestUtils.AreEqual(false, all(bool2(false, false))); + TestUtils.AreEqual(false, all(bool2(false, true))); + TestUtils.AreEqual(false, all(bool2(true, false))); + TestUtils.AreEqual(true, all(bool2(true, true))); + } + + [TestCompiler] + public static void all_bool3() + { + TestUtils.AreEqual(false, all(bool3(false, false, false))); + TestUtils.AreEqual(false, all(bool3(false, false, true))); + TestUtils.AreEqual(false, all(bool3(false, true, false))); + TestUtils.AreEqual(false, all(bool3(false, true, true))); + + TestUtils.AreEqual(false, all(bool3(true, false, false))); + TestUtils.AreEqual(false, all(bool3(true, false, true))); + TestUtils.AreEqual(false, all(bool3(true, true, false))); + TestUtils.AreEqual(true, all(bool3(true, true, true))); + } + + [TestCompiler] + public static void all_bool4() + { + TestUtils.AreEqual(false, all(bool4(false, false, false, false))); + TestUtils.AreEqual(false, all(bool4(false, false, false, true))); + TestUtils.AreEqual(false, all(bool4(false, false, true, false))); + TestUtils.AreEqual(false, all(bool4(false, false, true, true))); + + TestUtils.AreEqual(false, all(bool4(false, true, false, false))); + TestUtils.AreEqual(false, all(bool4(false, true, false, true))); + TestUtils.AreEqual(false, all(bool4(false, true, true, false))); + TestUtils.AreEqual(false, all(bool4(false, true, true, true))); + + TestUtils.AreEqual(false, all(bool4(true, false, false, false))); + TestUtils.AreEqual(false, all(bool4(true, false, false, true))); + TestUtils.AreEqual(false, all(bool4(true, false, true, false))); + TestUtils.AreEqual(false, all(bool4(true, false, true, true))); + + TestUtils.AreEqual(false, all(bool4(true, true, false, false))); + TestUtils.AreEqual(false, all(bool4(true, true, false, true))); + TestUtils.AreEqual(false, all(bool4(true, true, true, false))); + TestUtils.AreEqual(true, all(bool4(true, true, true, true))); + } + + [TestCompiler] + public static void all_int2() + { + TestUtils.AreEqual(false, all(int2(0, 0))); + TestUtils.AreEqual(false, all(int2(0, -1))); + TestUtils.AreEqual(false, all(int2(1, 0))); + TestUtils.AreEqual(true, all(int2(2, int.MinValue))); + } + + [TestCompiler] + public static void all_int3() + { + TestUtils.AreEqual(false, all(int3(0, 0, 0))); + TestUtils.AreEqual(false, all(int3(0, 0, 1))); + TestUtils.AreEqual(false, all(int3(0, -1, 0))); + TestUtils.AreEqual(false, all(int3(0, int.MinValue, int.MaxValue))); + + TestUtils.AreEqual(false, all(int3(5, 0, 0))); + TestUtils.AreEqual(false, all(int3(11, 0, -11))); + TestUtils.AreEqual(false, all(int3(-100, -32, 0))); + TestUtils.AreEqual(true, all(int3(-121, 100, 322))); + } + + [TestCompiler] + public static void all_int4() + { + TestUtils.AreEqual(false, all(int4(0, 0, 0, 0))); + TestUtils.AreEqual(false, all(int4(0, 0, 0, 1))); + TestUtils.AreEqual(false, all(int4(0, 0, -1, 0))); + TestUtils.AreEqual(false, all(int4(0, 0, int.MinValue, int.MaxValue))); + + TestUtils.AreEqual(false, all(int4(0, 5, 0, 0))); + TestUtils.AreEqual(false, all(int4(0, 11, 0, -11))); + TestUtils.AreEqual(false, all(int4(0, 12, 55, 0))); + TestUtils.AreEqual(false, all(int4(0, 100, 102, 10123))); + + TestUtils.AreEqual(false, all(int4(-323, 0, 0, 0))); + TestUtils.AreEqual(false, all(int4(-564, 0, 0, 55))); + TestUtils.AreEqual(false, all(int4(23, 0, 12, 0))); + TestUtils.AreEqual(false, all(int4(100, 0, 55, 22))); + + TestUtils.AreEqual(false, all(int4(22, -99, 0, 0))); + TestUtils.AreEqual(false, all(int4(33, -88, 0, 100))); + TestUtils.AreEqual(false, all(int4(44, -77, 0x10000, 0))); + TestUtils.AreEqual(true, all(int4(55, -66, 0x20000, 0x30000))); + } + + + [TestCompiler] + public static void all_uint2() + { + TestUtils.AreEqual(false, all(uint2(0u, 0u))); + TestUtils.AreEqual(false, all(uint2(0u, 0xFFFFFFFFu))); + TestUtils.AreEqual(false, all(uint2(100u, 0u))); + TestUtils.AreEqual(true, all(uint2(200u, 1000u))); + } + + + [TestCompiler] + public static void all_uint3() + { + TestUtils.AreEqual(false, all(uint3(0u, 0u, 0u))); + TestUtils.AreEqual(false, all(uint3(0u, 0u, 1u))); + TestUtils.AreEqual(false, all(uint3(0u, 0xFFFFFFFFu, 0u))); + TestUtils.AreEqual(false, all(uint3(0u, uint.MinValue, uint.MaxValue))); + + TestUtils.AreEqual(false, all(uint3(5u, 0u, 0u))); + TestUtils.AreEqual(false, all(uint3(11u, 0u, 100u))); + TestUtils.AreEqual(false, all(uint3(100u, 32u, 0u))); + TestUtils.AreEqual(true, all(uint3(121u, 100u, 322u))); + } + + [TestCompiler] + public static void all_uint4() + { + TestUtils.AreEqual(false, all(uint4(0u, 0u, 0u, 0u))); + TestUtils.AreEqual(false, all(uint4(0u, 0u, 0u, 1u))); + TestUtils.AreEqual(false, all(uint4(0u, 0u, 0xFFFFFFFFu, 0u))); + TestUtils.AreEqual(false, all(uint4(0u, 0u, uint.MinValue, uint.MaxValue))); + + TestUtils.AreEqual(false, all(uint4(0u, 5u, 0u, 0u))); + TestUtils.AreEqual(false, all(uint4(0u, 11u, 0u, 22u))); + TestUtils.AreEqual(false, all(uint4(0u, 12u, 55u, 0u))); + TestUtils.AreEqual(false, all(uint4(0u, 100u, 102u, 10123u))); + + TestUtils.AreEqual(false, all(uint4(323u, 0u, 0u, 0u))); + TestUtils.AreEqual(false, all(uint4(564u, 0u, 0u, 55u))); + TestUtils.AreEqual(false, all(uint4(23u, 0u, 12u, 0u))); + TestUtils.AreEqual(false, all(uint4(100u, 0u, 55u, 22u))); + + TestUtils.AreEqual(false, all(uint4(22u, 99u, 0u, 0u))); + TestUtils.AreEqual(false, all(uint4(33u, 88u, 0u, 100u))); + TestUtils.AreEqual(false, all(uint4(44u, 77u, 0x10000, 0u))); + TestUtils.AreEqual(true, all(uint4(55u, 66u, 0x20000u, 0x30000u))); + } + + + [TestCompiler] + public static void all_float2() + { + TestUtils.AreEqual(true, all(float2(float.NaN, float.NaN))); + + TestUtils.AreEqual(false, all(float2(0, -0))); + TestUtils.AreEqual(false, all(float2(0, float.NaN))); + TestUtils.AreEqual(false, all(float2(-2.0f, 0))); + TestUtils.AreEqual(true, all(float2(float.PositiveInfinity, float.NegativeInfinity))); + } + + + [TestCompiler] + public static void all_float3() + { + TestUtils.AreEqual(true, all(float3(float.NaN, float.NaN, float.NaN))); + + TestUtils.AreEqual(false, all(float3(0.0f, 0.0f, 0.0f))); + TestUtils.AreEqual(false, all(float3(0.0f, 0.0f, float.NaN))); + TestUtils.AreEqual(false, all(float3(0.0f, -1.0f, 0.0f))); + TestUtils.AreEqual(false, all(float3(0.0f, float.NegativeInfinity, float.PositiveInfinity))); + + TestUtils.AreEqual(false, all(float3(float.PositiveInfinity, 0.0f, 0.0f))); + TestUtils.AreEqual(false, all(float3(float.MaxValue, -0.0f, 1e38f))); + TestUtils.AreEqual(false, all(float3(-1.2e28f, 3.2f, 0.0f))); + TestUtils.AreEqual(true, all(float3(121.2f, 100.0f, -32.2f))); + } + + [TestCompiler] + public static void all_float4() + { + TestUtils.AreEqual(true, all(float4(float.NaN, float.NaN, float.NaN, float.NaN))); + + TestUtils.AreEqual(false, all(float4(0.0f, 0.0f, 0.0f, 0.0f))); + TestUtils.AreEqual(false, all(float4(0.0f, 0.0f, 0.0f, float.NaN))); + TestUtils.AreEqual(false, all(float4(0.0f, 0.0f, 1.0f, 0.0f))); + TestUtils.AreEqual(false, all(float4(0.0f, 0.0f, float.NegativeInfinity, float.PositiveInfinity))); + + TestUtils.AreEqual(false, all(float4(0.0f, float.PositiveInfinity, 0.0f, 0.0f))); + TestUtils.AreEqual(false, all(float4(0.0f, 11.2f, 0.0f, float.MinValue))); + TestUtils.AreEqual(false, all(float4(0.0f, -12.2f, float.MaxValue, 0u))); + TestUtils.AreEqual(false, all(float4(0.0f, -1.2e28f, -32.2f, 22.0f))); + + TestUtils.AreEqual(false, all(float4(323.2f, 0.0f, 0.0f, 0.0f))); + TestUtils.AreEqual(false, all(float4(-564.6f, 0.0f, 0.0f, 1113f))); + TestUtils.AreEqual(false, all(float4(-23.0f, 0.0f, 0.2f, 0.0f))); + TestUtils.AreEqual(false, all(float4(102.0f, 0.0f, 5.5f, -22.0f))); + + TestUtils.AreEqual(false, all(float4(float.NaN, -99.0f, 0.0f, 0.0f))); + TestUtils.AreEqual(false, all(float4(33.0f, 88.0f, 0.0f, 100.0f))); + TestUtils.AreEqual(false, all(float4(44.0f, 77.0f, -2000.0f, 0.0f))); + TestUtils.AreEqual(true, all(float4(55.0f, 66.0f, 5000.0f, 10000.2f))); + } + + [TestCompiler] + public static void all_double2() + { + TestUtils.AreEqual(true, all(double2(double.NaN, double.NaN))); + + TestUtils.AreEqual(false, all(double2(0, -0))); + TestUtils.AreEqual(false, all(double2(0, double.NaN))); + TestUtils.AreEqual(false, all(double2(-2.0, 0))); + TestUtils.AreEqual(true, all(double2(double.PositiveInfinity, double.NegativeInfinity))); + } + + + [TestCompiler] + public static void all_double3() + { + TestUtils.AreEqual(true, all(double3(double.NaN, double.NaN, double.NaN))); + + TestUtils.AreEqual(false, all(double3(0.0, 0.0, 0.0))); + TestUtils.AreEqual(false, all(double3(0.0, 0.0, double.NaN))); + TestUtils.AreEqual(false, all(double3(0.0, -1.0, 0.0))); + TestUtils.AreEqual(false, all(double3(0.0, double.NegativeInfinity, double.PositiveInfinity))); + + TestUtils.AreEqual(false, all(double3(double.PositiveInfinity, 0.0, 0.0))); + TestUtils.AreEqual(false, all(double3(double.MaxValue, -0.0, 1e108))); + TestUtils.AreEqual(false, all(double3(-1.2e128, 3.2, 0.0))); + TestUtils.AreEqual(true, all(double3(121.2, 100.0, -32.2))); + } + + [TestCompiler] + public static void all_double4() + { + TestUtils.AreEqual(true, all(double4(double.NaN, double.NaN, double.NaN, double.NaN))); + + TestUtils.AreEqual(false, all(double4(0.0, 0.0, 0.0, 0.0))); + TestUtils.AreEqual(false, all(double4(0.0, 0.0, 0.0, double.NaN))); + TestUtils.AreEqual(false, all(double4(0.0, 0.0, 1.0, 0.0))); + TestUtils.AreEqual(false, all(double4(0.0, 0.0, double.NegativeInfinity, double.PositiveInfinity))); + + TestUtils.AreEqual(false, all(double4(0.0, double.PositiveInfinity, 0.0, 0.0))); + TestUtils.AreEqual(false, all(double4(0.0, 11.2, 0.0, double.MinValue))); + TestUtils.AreEqual(false, all(double4(0.0, -12.2, double.MaxValue, 0.0))); + TestUtils.AreEqual(false, all(double4(0.0, -1.2e28, -32.2, 22.0))); + + TestUtils.AreEqual(false, all(double4(323.2, 0.0, 0.0, 0.0))); + TestUtils.AreEqual(false, all(double4(-564.6, 0.0, 0.0, 1113.0))); + TestUtils.AreEqual(false, all(double4(-23.0, 0.0, 0.2, 0.0))); + TestUtils.AreEqual(false, all(double4(102.0, 0.0, 5.5, -22.0))); + + TestUtils.AreEqual(false, all(double4(double.NaN, -99.0, 0.0, 0.0))); + TestUtils.AreEqual(false, all(double4(33.0, 88.0, 0.0, 100.0))); + TestUtils.AreEqual(false, all(double4(44.0, 77.0, -2000.0, 0.0))); + TestUtils.AreEqual(true, all(double4(55.0, 66.0, 5000.0, 10000.2))); + } + + + [TestCompiler] + public static void length_float2() + { + TestUtils.AreEqual(0.0f, length(float2(0.0f, 0.0f)), 0, false); + TestUtils.AreEqual(2.86356421265527063f, length(float2(1.2f, -2.6f)), 8, false); + TestUtils.AreEqual(float.NaN, length(float2(1.2f, float.NaN)), 0, false); + TestUtils.AreEqual(float.PositiveInfinity, length(float2(1.2f, float.PositiveInfinity)), 0, false); + TestUtils.AreEqual(float.PositiveInfinity, length(float2(1.2f, float.NegativeInfinity)), 0, false); + + TestUtils.AreEqual(2.863564e18f, length(float2(-1.2e18f, 2.6e18f)), 8, false); + TestUtils.AreEqual(double.PositiveInfinity, length(float2(-1.2e19f, -2.6e19f)), 8, false); + } + + [TestCompiler] + public static void length_float3() + { + TestUtils.AreEqual(0.0f, length(float3(0.0f, 0.0f, 0.0f)), 0, false); + TestUtils.AreEqual(3.611094f, length(float3(1.2f, -2.6f, 2.2f)), 8, false); + TestUtils.AreEqual(float.NaN, length(float3(1.2f, float.NaN, 2.2f)), 0, false); + TestUtils.AreEqual(float.PositiveInfinity, length(float3(1.2f, float.PositiveInfinity, 2.2f)), 0, false); + TestUtils.AreEqual(float.PositiveInfinity, length(float3(1.2f, float.NegativeInfinity, 2.2f)), 0, false); + + TestUtils.AreEqual(3.611094e18f, length(float3(-1.2e18f, 2.6e18f, 2.2e18f)), 8, false); + TestUtils.AreEqual(float.PositiveInfinity, length(float3(-1.2e19f, -2.6e19f, 2.2e19f)), 8, false); + } + + [TestCompiler] + public static void length_float4() + { + TestUtils.AreEqual(0.0f, length(float4(0.0f, 0.0f, 0.0f, 0.0f)), 0, false); + TestUtils.AreEqual(5.538953f, length(float4(1.2f, -2.6f, 2.2f, -4.2f)), 8, false); + TestUtils.AreEqual(float.NaN, length(float4(1.2f, float.NaN, 2.2f, -4.2f)), 0, false); + TestUtils.AreEqual(float.PositiveInfinity, length(float4(1.2f, float.PositiveInfinity, 2.2f, -4.2f)), 0, false); + TestUtils.AreEqual(float.PositiveInfinity, length(float4(1.2f, float.NegativeInfinity, 2.2f, -4.2f)), 0, false); + + TestUtils.AreEqual(5.538953e18f, length(float4(-1.2e18f, 2.6e18f, 2.2e18f, -4.2e18f)), 8, false); + TestUtils.AreEqual(float.PositiveInfinity, length(float4(-1.2e19f, -2.6e19f, 2.2e19f, -4.2e19f)), 8, false); + } + + + [TestCompiler] + public static void length_double2() + { + TestUtils.AreEqual(0.0, length(double2(0.0, 0.0)), 0, false); + TestUtils.AreEqual(2.86356421265527063, length(double2(1.2, -2.6)), 8, false); + TestUtils.AreEqual(double.NaN, length(double2(1.2, double.NaN)), 0, false); + TestUtils.AreEqual(double.PositiveInfinity, length(double2(1.2, double.PositiveInfinity)), 0, false); + TestUtils.AreEqual(double.PositiveInfinity, length(double2(1.2, double.NegativeInfinity)), 0, false); + + TestUtils.AreEqual(2.86356421265527063e153, length(double2(-1.2e153, 2.6e153)), 8, false); + } + + [TestCompiler] + public static void length_double3() + { + TestUtils.AreEqual(0.0, length(double3(0.0, 0.0, 0.0)), 0, false); + TestUtils.AreEqual(3.6110940170535577, length(double3(1.2, -2.6, 2.2)), 8, false); + TestUtils.AreEqual(double.NaN, length(double3(1.2, double.NaN, 2.2)), 0, false); + TestUtils.AreEqual(double.PositiveInfinity, length(double3(1.2, double.PositiveInfinity, 2.2)), 0, false); + TestUtils.AreEqual(double.PositiveInfinity, length(double3(1.2, double.NegativeInfinity, 2.2)), 0, false); + + TestUtils.AreEqual(3.6110940170535577e153, length(double3(-1.2e153, 2.6e153, 2.2e153)), 8, false); + } + + [TestCompiler] + public static void length_double4() + { + TestUtils.AreEqual(0.0, length(double4(0.0, 0.0, 0.0, 0.0)), 0, false); + TestUtils.AreEqual(5.5389529696504916, length(double4(1.2, -2.6, 2.2, -4.2)), 8, false); + TestUtils.AreEqual(double.NaN, length(double4(1.2, double.NaN, 2.2, -4.2)), 0, false); + TestUtils.AreEqual(double.PositiveInfinity, length(double4(1.2, double.PositiveInfinity, 2.2, -4.2)), 0, false); + TestUtils.AreEqual(double.PositiveInfinity, length(double4(1.2, double.NegativeInfinity, 2.2, -4.2)), 0, false); + + TestUtils.AreEqual(5.5389529696504916e153, length(double4(-1.2e153, 2.6e153, 2.2e153, -4.2e153)), 8, false); + } + + + [TestCompiler] + public static void lengthsq_float2() + { + TestUtils.AreEqual(0.0f, lengthsq(float2(0.0f, 0.0f)), 0, false); + TestUtils.AreEqual(8.2f, lengthsq(float2(1.2f, -2.6f)), 8, false); + TestUtils.AreEqual(float.NaN, lengthsq(float2(1.2f, float.NaN)), 0, false); + TestUtils.AreEqual(float.PositiveInfinity, lengthsq(float2(1.2f, float.PositiveInfinity)), 0, false); + TestUtils.AreEqual(float.PositiveInfinity, lengthsq(float2(1.2f, float.NegativeInfinity)), 0, false); + + TestUtils.AreEqual(8.2e36f, lengthsq(float2(-1.2e18f, 2.6e18f)), 8, false); + } + + [TestCompiler] + public static void lengthsq_float3() + { + TestUtils.AreEqual(0.0f, lengthsq(float3(0.0f, 0.0f, 0.0f)), 0, false); + TestUtils.AreEqual(13.04f, lengthsq(float3(1.2f, -2.6f, 2.2f)), 8, false); + TestUtils.AreEqual(float.NaN, lengthsq(float3(1.2f, float.NaN, 2.2f)), 0, false); + TestUtils.AreEqual(float.PositiveInfinity, lengthsq(float3(1.2f, float.PositiveInfinity, 2.2f)), 0, false); + TestUtils.AreEqual(float.PositiveInfinity, lengthsq(float3(1.2f, float.NegativeInfinity, 2.2f)), 0, false); + + TestUtils.AreEqual(1.304e37f, lengthsq(float3(-1.2e18f, 2.6e18f, 2.2e18f)), 8, false); + TestUtils.AreEqual(float.PositiveInfinity, lengthsq(float3(-1.2e19f, -2.6e19f, 2.2e19f)), 8, false); + } + + [TestCompiler] + public static void lengthsq_float4() + { + TestUtils.AreEqual(0.0f, lengthsq(float4(0.0f, 0.0f, 0.0f, 0.0f)), 0, false); + TestUtils.AreEqual(30.68f, lengthsq(float4(1.2f, -2.6f, 2.2f, -4.2f)), 8, false); + TestUtils.AreEqual(float.NaN, lengthsq(float4(1.2f, float.NaN, 2.2f, -4.2f)), 0, false); + TestUtils.AreEqual(float.PositiveInfinity, lengthsq(float4(1.2f, float.PositiveInfinity, 2.2f, -4.2f)), 0, false); + TestUtils.AreEqual(float.PositiveInfinity, lengthsq(float4(1.2f, float.NegativeInfinity, 2.2f, -4.2f)), 0, false); + + TestUtils.AreEqual(3.068e37f, lengthsq(float4(-1.2e18f, 2.6e18f, 2.2e18f, -4.2e18f)), 8, false); + TestUtils.AreEqual(float.PositiveInfinity, lengthsq(float4(-1.2e19f, -2.6e19f, 2.2e19f, -4.2e19f)), 8, false); + } + + + [TestCompiler] + public static void lengthsq_double2() + { + TestUtils.AreEqual(0.0, lengthsq(double2(0.0, 0.0)), 0, false); + TestUtils.AreEqual(8.2, lengthsq(double2(1.2, -2.6)), 8, false); + TestUtils.AreEqual(double.NaN, lengthsq(double2(1.2, double.NaN)), 0, false); + TestUtils.AreEqual(double.PositiveInfinity, lengthsq(double2(1.2, double.PositiveInfinity)), 0, false); + TestUtils.AreEqual(double.PositiveInfinity, lengthsq(double2(1.2, double.NegativeInfinity)), 0, false); + + TestUtils.AreEqual(8.2e306, lengthsq(double2(-1.2e153, 2.6e153)), 8, false); + TestUtils.AreEqual(double.PositiveInfinity, lengthsq(double2(-1.2e154, -2.6e154)), 8, false); + } + + [TestCompiler] + public static void lengthsq_double3() + { + TestUtils.AreEqual(0.0, lengthsq(double3(0.0, 0.0, 0.0)), 0, false); + TestUtils.AreEqual(13.04, lengthsq(double3(1.2, -2.6, 2.2)), 8, false); + TestUtils.AreEqual(double.NaN, lengthsq(double3(1.2, double.NaN, 2.2)), 0, false); + TestUtils.AreEqual(double.PositiveInfinity, lengthsq(double3(1.2, double.PositiveInfinity, 2.2)), 0, false); + TestUtils.AreEqual(double.PositiveInfinity, lengthsq(double3(1.2, double.NegativeInfinity, 2.2)), 0, false); + + TestUtils.AreEqual(1.304e307, lengthsq(double3(-1.2e153, 2.6e153, 2.2e153)), 8, false); + TestUtils.AreEqual(double.PositiveInfinity, lengthsq(double3(-1.2e154, -2.6e154, 2.2e154)), 8, false); + } + + [TestCompiler] + public static void lengthsq_double4() + { + TestUtils.AreEqual(0.0, lengthsq(double4(0.0, 0.0, 0.0, 0.0)), 0, false); + TestUtils.AreEqual(30.68, lengthsq(double4(1.2, -2.6, 2.2, -4.2)), 8, false); + TestUtils.AreEqual(double.NaN, lengthsq(double4(1.2, double.NaN, 2.2, -4.2)), 0, false); + TestUtils.AreEqual(double.PositiveInfinity, lengthsq(double4(1.2, double.PositiveInfinity, 2.2, -4.2)), 0, false); + TestUtils.AreEqual(double.PositiveInfinity, lengthsq(double4(1.2, double.NegativeInfinity, 2.2, -4.2)), 0, false); + + TestUtils.AreEqual(3.068e307, lengthsq(double4(-1.2e153, 2.6e153, 2.2e153, -4.2e153)), 8, false); + TestUtils.AreEqual(double.PositiveInfinity, lengthsq(double4(-1.2e154, -2.6e154, 2.2e154, -4.2e154)), 0, false); + } + + + + + [TestCompiler] + public static void distance_float2() + { + TestUtils.AreEqual(0.0f, distance(float2(1.3f, -2.4f), float2(1.3f, -2.4f)), 0, false); + + TestUtils.AreEqual(9.404786f, distance(float2(1.3f, -2.4f), float2(-5.3f, 4.3f)), 8, false); + TestUtils.AreEqual(9.404786e18f, distance(float2(1.3e18f, -2.4e18f), float2(-5.3e18f, 4.3e18f)), 8, false); + TestUtils.AreEqual(float.PositiveInfinity, distance(float2(1.3e19f, -2.4e19f), float2(-5.3e19f, 4.3e19f)), 0, false); + + TestUtils.AreEqual(float.NaN, distance(float2(1.3f, -2.4f), float2(float.NaN, 4.3f)), 0, false); + TestUtils.AreEqual(float.PositiveInfinity, distance(float2(1.3f, -2.4f), float2(-5.3f, float.PositiveInfinity)), 0, false); + TestUtils.AreEqual(float.PositiveInfinity, distance(float2(1.3f, float.NegativeInfinity), float2(-5.3f, 4.3f)), 0, false); + } + + [TestCompiler] + public static void distance_float3() + { + TestUtils.AreEqual(0.0f, distance(float2(1.3f, -2.4f), float2(1.3f, -2.4f)), 0, false); + + TestUtils.AreEqual(9.404786f, distance(float2(1.3f, -2.4f), float2(-5.3f, 4.3f)), 8, false); + TestUtils.AreEqual(9.404786e18f, distance(float2(1.3e18f, -2.4e18f), float2(-5.3e18f, 4.3e18f)), 8, false); + TestUtils.AreEqual(float.PositiveInfinity, distance(float2(1.3e19f, -2.4e19f), float2(-5.3e19f, 4.3e19f)), 0, false); + + TestUtils.AreEqual(float.NaN, distance(float2(1.3f, -2.4f), float2(float.NaN, 4.3f)), 0, false); + TestUtils.AreEqual(float.PositiveInfinity, distance(float2(1.3f, -2.4f), float2(-5.3f, float.PositiveInfinity)), 0, false); + TestUtils.AreEqual(float.PositiveInfinity, distance(float2(1.3f, float.NegativeInfinity), float2(-5.3f, 4.3f)), 0, false); + } + + [TestCompiler] + public static void distance_float4() + { + TestUtils.AreEqual(0.0, distance(float4(1.3f, -2.4f, 5.7f, 3.1f), float4(1.3f, -2.4f, 5.7f, 3.1f)), 0, false); + + TestUtils.AreEqual(9.863569f, distance(float4(1.3f, -2.4f, 5.7f, 3.1f), float4(-5.3f, 4.3f, 4.7f, 0.3f)), 8, false); + TestUtils.AreEqual(9.863569e18f, distance(float4(1.3e18f, -2.4e18f, 5.7e18f, 3.1e18f), float4(-5.3e18f, 4.3e18f, 4.7e18f, 3e17f)), 8, false); + TestUtils.AreEqual(float.PositiveInfinity, distance(float4(1.3e19f, -2.4e19f, 5.7e19f, 3.1e19f), float4(-5.3e19f, 4.3e19f, 4.7e19f, 3e18f)), 0, false); + + TestUtils.AreEqual(float.NaN, distance(float4(1.3f, -2.4f, 5.7f, 3.1f), float4(float.NaN, 4.3f, 4.7f, 0.3f)), 0, false); + TestUtils.AreEqual(float.PositiveInfinity, distance(float4(1.3f, -2.4f, 5.7f, 3.1f), float4(-5.3f, float.PositiveInfinity, 4.7f, 0.3f)), 0, false); + TestUtils.AreEqual(float.PositiveInfinity, distance(float4(1.3f, float.NegativeInfinity, 5.7f, 3.1f), double4(-5.3f, 4.3f, 4.7f, 0.3f)), 0, false); + } + + + [TestCompiler] + public static void distance_double2() + { + TestUtils.AreEqual(0.0, distance(double2(1.3, -2.4), double2(1.3, -2.4)), 0, false); + + TestUtils.AreEqual(9.4047860156411852, distance(double2(1.3, -2.4), double2(-5.3, 4.3)), 8, false); + TestUtils.AreEqual(9.4047860156411852e153, distance(double2(1.3e153, -2.4e153), double2(-5.3e153, 4.3e153)), 8, false); + TestUtils.AreEqual(double.PositiveInfinity, distance(double2(1.3e154, -2.4e154), double2(-5.3e154, 4.3e154)), 8, false); + + TestUtils.AreEqual(double.NaN, distance(double2(1.3, -2.4), double2(double.NaN, 4.3)), 0, false); + TestUtils.AreEqual(double.PositiveInfinity, distance(double2(1.3, -2.4), double2(-5.3, double.PositiveInfinity)), 0, false); + } + + [TestCompiler] + public static void distance_double3() + { + TestUtils.AreEqual(0.0, distance(double2(1.3, -2.4), double2(1.3, -2.4)), 0, false); + + TestUtils.AreEqual(9.4047860156411852, distance(double2(1.3, -2.4), double2(-5.3, 4.3)), 8, false); + TestUtils.AreEqual(9.4047860156411852e153, distance(double2(1.3e153, -2.4e153), double2(-5.3e153, 4.3e153)), 8, false); + TestUtils.AreEqual(double.PositiveInfinity, distance(double2(1.3e154, -2.4e154), double2(-5.3e154, 4.3e154)), 8, false); + + TestUtils.AreEqual(double.NaN, distance(double2(1.3, -2.4), double2(double.NaN, 4.3)), 0, false); + TestUtils.AreEqual(double.PositiveInfinity, distance(double2(1.3, -2.4), double2(-5.3, double.PositiveInfinity)), 0, false); + } + + [TestCompiler] + public static void distance_double4() + { + TestUtils.AreEqual(0.0, distance(double4(1.3, -2.4, 5.7, 3.1), double4(1.3, -2.4, 5.7, 3.1)), 0, false); + + TestUtils.AreEqual(9.8635693336641579, distance(double4(1.3, -2.4, 5.7, 3.1), double4(-5.3, 4.3, 4.7, 0.3)), 8, false); + TestUtils.AreEqual(9.8635693336641579e153, distance(double4(1.3e153, -2.4e153, 5.7e153, 3.1e153), double4(-5.3e153, 4.3e153, 4.7e153, 3e152)), 8, false); + + TestUtils.AreEqual(double.NaN, distance(double4(1.3, -2.4, 5.7, 3.1), double4(double.NaN, 4.3, 4.7, 0.3)), 0, false); + TestUtils.AreEqual(double.PositiveInfinity, distance(double4(1.3, -2.4, 5.7, 3.1), double4(-5.3, double.PositiveInfinity, 4.7, 0.3)), 0, false); + } + + + [TestCompiler] + public static void distancesq_float2() + { + TestUtils.AreEqual(0.0f, distancesq(float2(1.3f, -2.4f), float2(1.3f, -2.4f)), 0, false); + + TestUtils.AreEqual(88.45f, distancesq(float2(1.3f, -2.4f), float2(-5.3f, 4.3f)), 8, false); + TestUtils.AreEqual(8.845e37f, distancesq(float2(1.3e18f, -2.4e18f), float2(-5.3e18f, 4.3e18f)), 8, false); + + TestUtils.AreEqual(float.NaN, distancesq(float2(1.3f, -2.4f), float2(float.NaN, 4.3f)), 0, false); + TestUtils.AreEqual(float.PositiveInfinity, distancesq(float2(1.3f, -2.4f), float2(-5.3f, float.PositiveInfinity)), 0, false); + } + + [TestCompiler] + public static void distancesq_float3() + { + TestUtils.AreEqual(0.0f, distancesq(float3(1.3f, -2.4f, 5.7f), float3(1.3f, -2.4f, 5.7f)), 0, false); + + TestUtils.AreEqual(89.45f, distancesq(float3(1.3f, -2.4f, 5.7f), float3(-5.3f, 4.3f, 4.7f)), 8, false); + TestUtils.AreEqual(8.945e37f, distancesq(float3(1.3e18f, -2.4e18f, 5.7e18f), float3(-5.3e18f, 4.3e18f, 4.7e18f)), 8, false); + TestUtils.AreEqual(float.PositiveInfinity, distancesq(float3(1.3e19f, -2.4e19f, 5.7e19f), float3(-5.3e19f, 4.3e19f, 4.7e19f)), 8, false); + + TestUtils.AreEqual(float.NaN, distancesq(float3(1.3f, -2.4f, 5.7f), float3(float.NaN, 4.3f, 4.7f)), 0, false); + TestUtils.AreEqual(float.PositiveInfinity, distancesq(float3(1.3f, -2.4f, 5.7f), float3(-5.3f, float.PositiveInfinity, 4.7f)), 0, false); + } + + [TestCompiler] + public static void distancesq_float4() + { + TestUtils.AreEqual(0.0f, distancesq(float4(1.3f, -2.4f, 5.7f, 3.1f), float4(1.3f, -2.4f, 5.7f, 3.1f)), 0, false); + + TestUtils.AreEqual(97.29f, distancesq(float4(1.3f, -2.4f, 5.7f, 3.1f), float4(-5.3f, 4.3f, 4.7f, 0.3f)), 8, false); + TestUtils.AreEqual(9.729e37f, distancesq(float4(1.3e18f, -2.4e18f, 5.7e18f, 3.1e18f), float4(-5.3e18f, 4.3e18f, 4.7e18f, 3e17f)), 8, false); + + TestUtils.AreEqual(float.NaN, distancesq(float4(1.3f, -2.4f, 5.7f, 3.1f), float4(float.NaN, 4.3f, 4.7f, 0.3f)), 0, false); + TestUtils.AreEqual(float.PositiveInfinity, distancesq(float4(1.3f, -2.4f, 5.7f, 3.1f), float4(-5.3f, float.PositiveInfinity, 4.7f, 0.3f)), 0, false); + } + + + [TestCompiler] + public static void distancesq_double2() + { + TestUtils.AreEqual(0.0, distancesq(double2(1.3, -2.4), double2(1.3, -2.4)), 0, false); + + TestUtils.AreEqual(88.45, distancesq(double2(1.3, -2.4), double2(-5.3, 4.3)), 8, false); + TestUtils.AreEqual(8.845e307, distancesq(double2(1.3e153, -2.4e153), double2(-5.3e153, 4.3e153)), 8, false); + TestUtils.AreEqual(double.PositiveInfinity, distancesq(double2(1.3e154, -2.4e154), double2(-5.3e154, 4.3e154)), 8, false); + + TestUtils.AreEqual(double.NaN, distancesq(double2(1.3, -2.4), double2(double.NaN, 4.3)), 0, false); + TestUtils.AreEqual(double.PositiveInfinity, distancesq(double2(1.3, -2.4), double2(-5.3, double.PositiveInfinity)), 8, false); + TestUtils.AreEqual(double.PositiveInfinity, distancesq(double2(1.3, double.NegativeInfinity), double2(-5.3, 4.3)), 8, false); + } + + [TestCompiler] + public static void distancesq_double3() + { + TestUtils.AreEqual(0.0, distancesq(double3(1.3, -2.4, 5.7), double3(1.3, -2.4, 5.7)), 0, false); + + TestUtils.AreEqual(89.45, distancesq(double3(1.3, -2.4, 5.7), double3(-5.3, 4.3, 4.7)), 8, false); + TestUtils.AreEqual(8.945e307, distancesq(double3(1.3e153, -2.4e153, 5.7e153), double3(-5.3e153, 4.3e153, 4.7e153)), 8, false); + TestUtils.AreEqual(double.PositiveInfinity, distancesq(double3(1.3e154, -2.4e154, 5.7e154), double3(-5.3e154, 4.3e154, 4.7e154)), 8, false); + + TestUtils.AreEqual(double.NaN, distancesq(double3(1.3, -2.4, 5.7), double3(double.NaN, 4.3, 4.7)), 0, false); + TestUtils.AreEqual(double.PositiveInfinity, distancesq(double3(1.3, -2.4, 5.7), double3(-5.3, double.PositiveInfinity, 4.7)), 8, false); + TestUtils.AreEqual(double.PositiveInfinity, distancesq(double3(1.3, double.NegativeInfinity, 5.7), double3(-5.3, 4.3, 4.7)), 8, false); + } + + [TestCompiler] + public static void distancesq_double4() + { + TestUtils.AreEqual(0.0, distancesq(double4(1.3, -2.4, 5.7, 3.1), double4(1.3, -2.4, 5.7, 3.1)), 0, false); + + TestUtils.AreEqual(97.29, distancesq(double4(1.3, -2.4, 5.7, 3.1), double4(-5.3, 4.3, 4.7, 0.3)), 8, false); + TestUtils.AreEqual(9.729e307, distancesq(double4(1.3e153, -2.4e153, 5.7e153, 3.1e153), double4(-5.3e153, 4.3e153, 4.7e153, 3e152)), 8, false); + TestUtils.AreEqual(double.PositiveInfinity, distancesq(double4(1.3e154, -2.4e154, 5.7e154, 3.1e153), double4(-5.3e154, 4.3e154, 4.7e154, 3e153)), 8, false); + + TestUtils.AreEqual(double.NaN, distancesq(double4(1.3, -2.4, 5.7, 3.1), double4(double.NaN, 4.3, 4.7, 0.3)), 0, false); + TestUtils.AreEqual(double.PositiveInfinity, distancesq(double4(1.3, -2.4, 5.7, 3.1), double4(-5.3, double.PositiveInfinity, 4.7, 0.3)), 8, false); + TestUtils.AreEqual(double.PositiveInfinity, distancesq(double4(1.3, double.NegativeInfinity, 5.7, 3.1), double4(-5.3, 4.3, 4.7, 0.3)), 8, false); + } + + [TestCompiler] + public static void epsilon_float() + { + float next = asfloat(asuint(1.0f) + 1); + float computed_epsilon = next - 1.0f; + TestUtils.AreEqual(computed_epsilon, EPSILON, 0.0f); + TestUtils.IsTrue(Single.Epsilon != EPSILON); + } + + [TestCompiler] + public static void epsilon_double() + { + double next = asdouble(aslong(1.0) + 1); + double computed_epsilon = next - 1.0; + TestUtils.AreEqual(computed_epsilon, EPSILON_DBL, 0.0); + TestUtils.IsTrue(Double.Epsilon != EPSILON_DBL); + } + + [TestCompiler] + public static void nan_float() + { + TestUtils.IsFalse(0.0f == NAN); + TestUtils.IsFalse(INFINITY == NAN); + TestUtils.IsFalse(isfinite(NAN)); + TestUtils.IsTrue(isnan(NAN)); + + TestUtils.IsFalse(NAN < 0.0f); + TestUtils.IsFalse(NAN <= 0.0f); + TestUtils.IsFalse(NAN == 0.0f); + TestUtils.IsFalse(NAN >= 0.0f); + TestUtils.IsFalse(NAN > 0.0f); + TestUtils.IsTrue(NAN != 0.0f); + + float nan1 = NAN; + float nan2 = NAN; + TestUtils.IsFalse(nan1 < nan2); + TestUtils.IsFalse(nan1 <= nan2); + TestUtils.IsFalse(nan1 == nan2); + TestUtils.IsFalse(nan1 >= nan2); + TestUtils.IsFalse(nan1 > nan2); + TestUtils.IsTrue(nan1 != nan2); + } + + [TestCompiler] + public static void nan_double() + { + TestUtils.IsFalse(0.0 == NAN_DBL); + TestUtils.IsFalse(INFINITY_DBL == NAN_DBL); + TestUtils.IsFalse(isfinite(NAN_DBL)); + TestUtils.IsTrue(isnan(NAN_DBL)); + + TestUtils.IsFalse(NAN_DBL < 0.0); + TestUtils.IsFalse(NAN_DBL <= 0.0); + TestUtils.IsFalse(NAN_DBL == 0.0); + TestUtils.IsFalse(NAN_DBL >= 0.0); + TestUtils.IsFalse(NAN_DBL > 0.0); + TestUtils.IsTrue(NAN_DBL != 0.0); + + double nan1 = NAN_DBL; + double nan2 = NAN_DBL; + TestUtils.IsFalse(nan1 < nan2); + TestUtils.IsFalse(nan1 <= nan2); + TestUtils.IsFalse(nan1 == nan2); + TestUtils.IsFalse(nan1 >= nan2); + TestUtils.IsFalse(nan1 > nan2); + TestUtils.IsTrue(nan1 != nan2); + } + + [TestCompiler] + public static void infinity_float() + { + TestUtils.IsTrue(-INFINITY != INFINITY); + TestUtils.IsTrue(isinf(INFINITY)); + TestUtils.IsFalse(isfinite(INFINITY)); + } + + [TestCompiler] + public static void infinity_double() + { + TestUtils.IsTrue(-INFINITY_DBL != INFINITY_DBL); + TestUtils.IsTrue(isinf(INFINITY_DBL)); + TestUtils.IsFalse(isfinite(INFINITY_DBL)); + } + + [TestCompiler] + public static void helper_axes() + { + TestUtils.AreEqual(float3(1.0f, 0.0f, 0.0f), right()); + TestUtils.AreEqual(float3(-1.0f, 0.0f, 0.0f), left()); + TestUtils.AreEqual(float3(0.0f, 1.0f, 0.0f), up()); + TestUtils.AreEqual(float3(0.0f, -1.0f, 0.0f), down()); + TestUtils.AreEqual(float3(0.0f, 0.0f, 1.0f), forward()); + TestUtils.AreEqual(float3(0.0f, 0.0f, -1.0f), back()); + } + + [TestCompiler] + [WindowsOnly("Mono on linux ignores signed zero.")] + public static void rcp_float_signed_zero() + { + TestUtils.AreEqual(float.NegativeInfinity, rcp(TestUtils.SignedFloatZero())); + TestUtils.AreEqual(TestUtils.SignedFloatZero(), rcp(float.NegativeInfinity)); + } + + [TestCompiler] + [WindowsOnly("Mono on linux ignores signed zero.")] + public static void rcp_float2_signed_zero() + { + TestUtils.AreEqual(float2(float.NegativeInfinity, TestUtils.SignedFloatZero()), rcp(float2(TestUtils.SignedFloatZero(), float.NegativeInfinity))); + } + + [TestCompiler] + [WindowsOnly("Mono on linux ignores signed zero.")] + public static void rcp_float3_signed_zero() + { + TestUtils.AreEqual(float3(float.NegativeInfinity, TestUtils.SignedFloatZero(), float.NegativeInfinity), rcp(float3(TestUtils.SignedFloatZero(), float.NegativeInfinity, TestUtils.SignedFloatZero()))); + } + + [TestCompiler] + [WindowsOnly("Mono on linux ignores signed zero.")] + public static void rcp_float4_signed_zero() + { + TestUtils.AreEqual(float4(float.NegativeInfinity, TestUtils.SignedFloatZero(), float.NegativeInfinity, TestUtils.SignedFloatZero()), rcp(float4(TestUtils.SignedFloatZero(), float.NegativeInfinity, TestUtils.SignedFloatZero(), float.NegativeInfinity))); + } + + + [TestCompiler] + [WindowsOnly("Mono on linux ignores signed zero.")] + public static void rcp_double_signed_zero() + { + TestUtils.AreEqual(double.NegativeInfinity, rcp(TestUtils.SignedDoubleZero())); + TestUtils.AreEqual(TestUtils.SignedDoubleZero(), rcp(double.NegativeInfinity)); + } + + [TestCompiler] + [WindowsOnly("Mono on linux ignores signed zero.")] + public static void rcp_double2_signed_zero() + { + TestUtils.AreEqual(double2(double.NegativeInfinity, TestUtils.SignedDoubleZero()), rcp(double2(TestUtils.SignedDoubleZero(), double.NegativeInfinity))); + } + + [TestCompiler] + [WindowsOnly("Mono on linux ignores signed zero.")] + public static void rcp_double3_signed_zero() + { + TestUtils.AreEqual(double3(double.NegativeInfinity, TestUtils.SignedDoubleZero(), double.NegativeInfinity), rcp(double3(TestUtils.SignedDoubleZero(), double.NegativeInfinity, TestUtils.SignedDoubleZero()))); + } + + [TestCompiler] + [WindowsOnly("Mono on linux ignores signed zero.")] + public static void rcp_double4_signed_zero() + { + TestUtils.AreEqual(double4(double.NegativeInfinity, TestUtils.SignedDoubleZero(), double.NegativeInfinity, TestUtils.SignedDoubleZero()), rcp(double4(TestUtils.SignedDoubleZero(), double.NegativeInfinity, TestUtils.SignedDoubleZero(), double.NegativeInfinity))); + } + + [TestCompiler] + unsafe public static void compress_test() + { + int4 value = int4(0x12345678, 0x2468ACE0, 0x369BE147, 0x48C059D1); + + int ptrOffset = 4; + int* dest = stackalloc int[16]; + int* ptr = dest + ptrOffset; + + for(int offset = -4; offset <= 4; offset++) + { + for (int m = 0; m < 16; m++) + { + for (int i = 0; i < 16; i++) + dest[i] = 0; + + bool4 mask = bool4((m & 1) != 0, (m & 2) != 0, (m & 4) != 0, (m & 8) != 0); + int expectedOutputIndex = offset; + + if (mask.x) ++expectedOutputIndex; + if (mask.y) ++expectedOutputIndex; + if (mask.z) ++expectedOutputIndex; + if (mask.w) ++expectedOutputIndex; + + int actualOutputIndex = compress(ptr, offset, value, mask); + + for(int i = 0; i < 16; i++) + { + int vectorIdx = i - (ptrOffset + offset); + + int v = 0; + if (vectorIdx >= 0 && vectorIdx < 4) + { + for(int k = 0; k < 4; k++) + { + if (mask[k] && vectorIdx-- == 0) + v = value[k]; + } + } + TestUtils.AreEqual(v, dest[i]); + TestUtils.AreEqual(expectedOutputIndex, actualOutputIndex); + } + } + } + } + + [TestCompiler] + unsafe public static void compress_uint4_test() + { + uint4 value = uint4(0x12345678u, 0x2468ACE0u, 0x369BE147u, 0x48C059D1u); + + int ptrOffset = 4; + uint* dest = stackalloc uint[16]; + uint* ptr = dest + ptrOffset; + + for(int offset = -4; offset <= 4; offset++) + { + for (int m = 0; m < 16; m++) + { + for (int i = 0; i < 16; i++) + dest[i] = 0; + + bool4 mask = bool4((m & 1) != 0, (m & 2) != 0, (m & 4) != 0, (m & 8) != 0); + int expectedOutputIndex = offset; + + if (mask.x) ++expectedOutputIndex; + if (mask.y) ++expectedOutputIndex; + if (mask.z) ++expectedOutputIndex; + if (mask.w) ++expectedOutputIndex; + + int actualOutputIndex = compress(ptr, offset, value, mask); + + for(int i = 0; i < 16; i++) + { + int vectorIdx = i - (ptrOffset + offset); + + float v = 0; + if (vectorIdx >= 0 && vectorIdx < 4) + { + for(int k = 0; k < 4; k++) + { + if (mask[k] && vectorIdx-- == 0) + v = value[k]; + } + } + TestUtils.AreEqual(v, dest[i]); + TestUtils.AreEqual(expectedOutputIndex, actualOutputIndex); + } + } + } + } + + [TestCompiler] + unsafe public static void compress_float4_test() + { + float4 value = float4(float.PositiveInfinity, EPSILON, PI, -0.25f); + + int ptrOffset = 4; + float* dest = stackalloc float[16]; + float* ptr = dest + ptrOffset; + + for(int offset = -4; offset <= 4; offset++) + { + for (int m = 0; m < 16; m++) + { + for (int i = 0; i < 16; i++) + dest[i] = 0; + + bool4 mask = bool4((m & 1) != 0, (m & 2) != 0, (m & 4) != 0, (m & 8) != 0); + int expectedOutputIndex = offset; + + if (mask.x) ++expectedOutputIndex; + if (mask.y) ++expectedOutputIndex; + if (mask.z) ++expectedOutputIndex; + if (mask.w) ++expectedOutputIndex; + + int actualOutputIndex = compress(ptr, offset, value, mask); + + for(int i = 0; i < 16; i++) + { + int vectorIdx = i - (ptrOffset + offset); + + float v = 0; + if (vectorIdx >= 0 && vectorIdx < 4) + { + for(int k = 0; k < 4; k++) + { + if (mask[k] && vectorIdx-- == 0) + v = value[k]; + } + } + TestUtils.AreEqual(v, dest[i]); + TestUtils.AreEqual(expectedOutputIndex, actualOutputIndex); + } + } + } + } + + [TestCompiler] + public static void square_float() + { + TestUtils.AreEqual(0.0f, math.square(0.0f)); + TestUtils.AreEqual(0.25f, math.square(0.5f)); + TestUtils.AreEqual(1.0f, math.square(1.0f)); + TestUtils.AreEqual(4.0f, math.square(2.0f)); + TestUtils.AreEqual(9.0f, math.square(3.0f)); + TestUtils.AreEqual(0.0f, math.square(-0.0f)); + TestUtils.AreEqual(0.25f, math.square(-0.5f)); + TestUtils.AreEqual(1.0f, math.square(-1.0f)); + TestUtils.AreEqual(4.0f, math.square(-2.0f)); + TestUtils.AreEqual(9.0f, math.square(-3.0f)); + TestUtils.AreEqual(0.0331537127494812011719f, math.square(0.182081609964370727539f)); + TestUtils.AreEqual(0.0331537127494812011719f, math.square(-0.182081609964370727539f)); + TestUtils.AreEqual(225642.59375f, math.square(475.018524169921875f)); + TestUtils.AreEqual(225642.59375f, math.square(-475.018524169921875f)); + TestUtils.IsTrue(math.isnan(math.square(float.NaN))); + + // Square the largest finite number that will still produce a finite result. + TestUtils.AreEqual(3.4028232635611925616e+38f, math.square(18446742974197923840.0f)); + TestUtils.AreEqual(3.4028232635611925616e+38f, math.square(-18446742974197923840.0f)); + + // Square the smallest finite number that will produce a non-finite result. + TestUtils.AreEqual(float.PositiveInfinity, math.square(18446744073709551616.0f)); + TestUtils.AreEqual(float.PositiveInfinity, math.square(-18446744073709551616.0f)); + } + + [TestCompiler] + public static void square_float2() + { + TestUtils.AreEqual(new float2(0.0f), math.square(new float2(0.0f))); + TestUtils.AreEqual(new float2(0.25f), math.square(new float2(0.5f))); + TestUtils.AreEqual(new float2(1.0f), math.square(new float2(1.0f))); + TestUtils.AreEqual(new float2(4.0f), math.square(new float2(2.0f))); + TestUtils.AreEqual(new float2(9.0f), math.square(new float2(3.0f))); + TestUtils.AreEqual(new float2(0.0f), math.square(new float2(-0.0f))); + TestUtils.AreEqual(new float2(0.25f), math.square(new float2(-0.5f))); + TestUtils.AreEqual(new float2(1.0f), math.square(new float2(-1.0f))); + TestUtils.AreEqual(new float2(4.0f), math.square(new float2(-2.0f))); + TestUtils.AreEqual(new float2(9.0f), math.square(new float2(-3.0f))); + TestUtils.AreEqual(new float2(0.0331537127494812011719f), math.square(new float2(0.182081609964370727539f))); + TestUtils.AreEqual(new float2(0.0331537127494812011719f), math.square(new float2(-0.182081609964370727539f))); + TestUtils.AreEqual(new float2(225642.59375f), math.square(new float2(475.018524169921875f))); + TestUtils.AreEqual(new float2(225642.59375f), math.square(new float2(-475.018524169921875f))); + TestUtils.IsTrue(math.all(math.isnan(math.square(new float2(float.NaN))))); + + // Square the largest finite number that will still produce a finite result. + TestUtils.AreEqual(new float2(3.4028232635611925616e+38f), math.square(new float2(18446742974197923840.0f))); + TestUtils.AreEqual(new float2(3.4028232635611925616e+38f), math.square(new float2(-18446742974197923840.0f))); + + // Square the smallest finite number that will produce a non-finite result. + TestUtils.AreEqual(new float2(float.PositiveInfinity), math.square(new float2(18446744073709551616.0f))); + TestUtils.AreEqual(new float2(float.PositiveInfinity), math.square(new float2(-18446744073709551616.0f))); + + // Random inputs. + TestUtils.AreEqual(new float2(0.272176146507263183594f, 96307.6015625f), math.square(new float2(0.521705031394958496094f, -310.33465576171875f))); + } + + [TestCompiler] + public static void square_float3() + { + TestUtils.AreEqual(new float3(0.0f), math.square(new float3(0.0f))); + TestUtils.AreEqual(new float3(0.25f), math.square(new float3(0.5f))); + TestUtils.AreEqual(new float3(1.0f), math.square(new float3(1.0f))); + TestUtils.AreEqual(new float3(4.0f), math.square(new float3(2.0f))); + TestUtils.AreEqual(new float3(9.0f), math.square(new float3(3.0f))); + TestUtils.AreEqual(new float3(0.0f), math.square(new float3(-0.0f))); + TestUtils.AreEqual(new float3(0.25f), math.square(new float3(-0.5f))); + TestUtils.AreEqual(new float3(1.0f), math.square(new float3(-1.0f))); + TestUtils.AreEqual(new float3(4.0f), math.square(new float3(-2.0f))); + TestUtils.AreEqual(new float3(9.0f), math.square(new float3(-3.0f))); + TestUtils.AreEqual(new float3(0.0331537127494812011719f), math.square(new float3(0.182081609964370727539f))); + TestUtils.AreEqual(new float3(0.0331537127494812011719f), math.square(new float3(-0.182081609964370727539f))); + TestUtils.AreEqual(new float3(225642.59375f), math.square(new float3(475.018524169921875f))); + TestUtils.AreEqual(new float3(225642.59375f), math.square(new float3(-475.018524169921875f))); + TestUtils.IsTrue(math.all(math.isnan(math.square(new float3(float.NaN))))); + + // Square the largest finite number that will still produce a finite result. + TestUtils.AreEqual(new float3(3.4028232635611925616e+38f), math.square(new float3(18446742974197923840.0f))); + TestUtils.AreEqual(new float3(3.4028232635611925616e+38f), math.square(new float3(-18446742974197923840.0f))); + + // Square the smallest finite number that will produce a non-finite result. + TestUtils.AreEqual(new float3(float.PositiveInfinity), math.square(new float3(18446744073709551616.0f))); + TestUtils.AreEqual(new float3(float.PositiveInfinity), math.square(new float3(-18446744073709551616.0f))); + + // Random inputs. + TestUtils.AreEqual(new float3(0.272176146507263183594f, 96307.6015625f, 5591.6337890625f), math.square(new float3(0.521705031394958496094f, -310.33465576171875f, -74.77722930908203125f))); + } + + [TestCompiler] + public static void square_float4() + { + TestUtils.AreEqual(new float4(0.0f), math.square(new float4(0.0f))); + TestUtils.AreEqual(new float4(0.25f), math.square(new float4(0.5f))); + TestUtils.AreEqual(new float4(1.0f), math.square(new float4(1.0f))); + TestUtils.AreEqual(new float4(4.0f), math.square(new float4(2.0f))); + TestUtils.AreEqual(new float4(9.0f), math.square(new float4(3.0f))); + TestUtils.AreEqual(new float4(0.0f), math.square(new float4(-0.0f))); + TestUtils.AreEqual(new float4(0.25f), math.square(new float4(-0.5f))); + TestUtils.AreEqual(new float4(1.0f), math.square(new float4(-1.0f))); + TestUtils.AreEqual(new float4(4.0f), math.square(new float4(-2.0f))); + TestUtils.AreEqual(new float4(9.0f), math.square(new float4(-3.0f))); + TestUtils.AreEqual(new float4(0.0331537127494812011719f), math.square(new float4(0.182081609964370727539f))); + TestUtils.AreEqual(new float4(0.0331537127494812011719f), math.square(new float4(-0.182081609964370727539f))); + TestUtils.AreEqual(new float4(225642.59375f), math.square(new float4(475.018524169921875f))); + TestUtils.AreEqual(new float4(225642.59375f), math.square(new float4(-475.018524169921875f))); + TestUtils.IsTrue(math.all(math.isnan(math.square(new float4(float.NaN))))); + + // Square the largest finite number that will still produce a finite result. + TestUtils.AreEqual(new float4(3.4028232635611925616e+38f), math.square(new float4(18446742974197923840.0f))); + TestUtils.AreEqual(new float4(3.4028232635611925616e+38f), math.square(new float4(-18446742974197923840.0f))); + + // Square the smallest finite number that will produce a non-finite result. + TestUtils.AreEqual(new float4(float.PositiveInfinity), math.square(new float4(18446744073709551616.0f))); + TestUtils.AreEqual(new float4(float.PositiveInfinity), math.square(new float4(-18446744073709551616.0f))); + + // Random inputs. + TestUtils.AreEqual(new float4(0.272176146507263183594f, 96307.6015625f, 5591.6337890625f, 152764.28125f), math.square(new float4(0.521705031394958496094f, -310.33465576171875f, -74.77722930908203125f, 390.8507080078125f))); + } + + [TestCompiler] + public static void square_double() + { + TestUtils.AreEqual(0.0, math.square(0.0)); + TestUtils.AreEqual(0.25, math.square(0.5)); + TestUtils.AreEqual(1.0, math.square(1.0)); + TestUtils.AreEqual(4.0, math.square(2.0)); + TestUtils.AreEqual(9.0, math.square(3.0)); + TestUtils.AreEqual(0.0, math.square(-0.0)); + TestUtils.AreEqual(0.25, math.square(-0.5)); + TestUtils.AreEqual(1.0, math.square(-1.0)); + TestUtils.AreEqual(4.0, math.square(-2.0)); + TestUtils.AreEqual(9.0, math.square(-3.0)); + TestUtils.AreEqual(0.0331537126872172294156, math.square(0.182081609964370727539)); + TestUtils.AreEqual(0.0331537126872172294156, math.square(-0.182081609964370727539)); + TestUtils.AreEqual(225642.598304570652544, math.square(475.018524169921875)); + TestUtils.AreEqual(225642.598304570652544, math.square(-475.018524169921875)); + TestUtils.IsTrue(math.isnan(math.square(double.NaN))); + + // Square the largest finite number that will still produce a finite result. + TestUtils.AreEqual(1.79769313486231550856e+308, math.square(1.3407807929942595611e+154)); + TestUtils.AreEqual(1.79769313486231550856e+308, math.square(-1.3407807929942595611e+154)); + + // Square the smallest finite number that will produce a non-finite result. + TestUtils.AreEqual(double.PositiveInfinity, math.square(1.34078079299425970996e+154)); + TestUtils.AreEqual(double.PositiveInfinity, math.square(-1.34078079299425970996e+154)); + } + + [TestCompiler] + public static void square_double2() + { + TestUtils.AreEqual(new double2(0.0), math.square(new double2(0.0))); + TestUtils.AreEqual(new double2(0.25), math.square(new double2(0.5))); + TestUtils.AreEqual(new double2(1.0), math.square(new double2(1.0))); + TestUtils.AreEqual(new double2(4.0), math.square(new double2(2.0))); + TestUtils.AreEqual(new double2(9.0), math.square(new double2(3.0))); + TestUtils.AreEqual(new double2(0.0), math.square(new double2(-0.0))); + TestUtils.AreEqual(new double2(0.25), math.square(new double2(-0.5))); + TestUtils.AreEqual(new double2(1.0), math.square(new double2(-1.0))); + TestUtils.AreEqual(new double2(4.0), math.square(new double2(-2.0))); + TestUtils.AreEqual(new double2(9.0), math.square(new double2(-3.0))); + TestUtils.AreEqual(new double2(0.0331537126872172294156), math.square(new double2(0.182081609964370727539))); + TestUtils.AreEqual(new double2(0.0331537126872172294156), math.square(new double2(-0.182081609964370727539))); + TestUtils.AreEqual(new double2(225642.598304570652544), math.square(new double2(475.018524169921875))); + TestUtils.AreEqual(new double2(225642.598304570652544), math.square(new double2(-475.018524169921875))); + TestUtils.IsTrue(math.all(math.isnan(math.square(new double2(double.NaN))))); + + // Square the largest finite number that will still produce a finite result. + TestUtils.AreEqual(new double2(1.79769313486231550856e+308), math.square(new double2(1.3407807929942595611e+154))); + TestUtils.AreEqual(new double2(1.79769313486231550856e+308), math.square(new double2(-1.3407807929942595611e+154))); + + // Square the smallest finite number that will produce a non-finite result. + TestUtils.AreEqual(new double2(double.PositiveInfinity), math.square(new double2(1.34078079299425970996e+154))); + TestUtils.AreEqual(new double2(double.PositiveInfinity), math.square(new double2(-1.34078079299425970996e+154))); + + // Random inputs. + TestUtils.AreEqual(new double2(0.272176139782814630053, 96307.5985667444765568), math.square(new double2(0.521705031394958496094, -310.33465576171875))); + } + + [TestCompiler] + public static void square_double3() + { + TestUtils.AreEqual(new double3(0.0), math.square(new double3(0.0))); + TestUtils.AreEqual(new double3(0.25), math.square(new double3(0.5))); + TestUtils.AreEqual(new double3(1.0), math.square(new double3(1.0))); + TestUtils.AreEqual(new double3(4.0), math.square(new double3(2.0))); + TestUtils.AreEqual(new double3(9.0), math.square(new double3(3.0))); + TestUtils.AreEqual(new double3(0.0), math.square(new double3(-0.0))); + TestUtils.AreEqual(new double3(0.25), math.square(new double3(-0.5))); + TestUtils.AreEqual(new double3(1.0), math.square(new double3(-1.0))); + TestUtils.AreEqual(new double3(4.0), math.square(new double3(-2.0))); + TestUtils.AreEqual(new double3(9.0), math.square(new double3(-3.0))); + TestUtils.AreEqual(new double3(0.0331537126872172294156), math.square(new double3(0.182081609964370727539))); + TestUtils.AreEqual(new double3(0.0331537126872172294156), math.square(new double3(-0.182081609964370727539))); + TestUtils.AreEqual(new double3(225642.598304570652544), math.square(new double3(475.018524169921875))); + TestUtils.AreEqual(new double3(225642.598304570652544), math.square(new double3(-475.018524169921875))); + TestUtils.IsTrue(math.all(math.isnan(math.square(new double3(double.NaN))))); + + // Square the largest finite number that will still produce a finite result. + TestUtils.AreEqual(new double3(1.79769313486231550856e+308), math.square(new double3(1.3407807929942595611e+154))); + TestUtils.AreEqual(new double3(1.79769313486231550856e+308), math.square(new double3(-1.3407807929942595611e+154))); + + // Square the smallest finite number that will produce a non-finite result. + TestUtils.AreEqual(new double3(double.PositiveInfinity), math.square(new double3(1.34078079299425970996e+154))); + TestUtils.AreEqual(new double3(double.PositiveInfinity), math.square(new double3(-1.34078079299425970996e+154))); + + // Random inputs. + TestUtils.AreEqual(new double3(0.272176139782814630053, 96307.5985667444765568, 5591.63402314303675666), math.square(new double3(0.521705031394958496094, -310.33465576171875, -74.77722930908203125))); + } + + [TestCompiler] + public static void square_double4() + { + TestUtils.AreEqual(new double4(0.0), math.square(new double4(0.0))); + TestUtils.AreEqual(new double4(0.25), math.square(new double4(0.5))); + TestUtils.AreEqual(new double4(1.0), math.square(new double4(1.0))); + TestUtils.AreEqual(new double4(4.0), math.square(new double4(2.0))); + TestUtils.AreEqual(new double4(9.0), math.square(new double4(3.0))); + TestUtils.AreEqual(new double4(0.0), math.square(new double4(-0.0))); + TestUtils.AreEqual(new double4(0.25), math.square(new double4(-0.5))); + TestUtils.AreEqual(new double4(1.0), math.square(new double4(-1.0))); + TestUtils.AreEqual(new double4(4.0), math.square(new double4(-2.0))); + TestUtils.AreEqual(new double4(9.0), math.square(new double4(-3.0))); + TestUtils.AreEqual(new double4(0.0331537126872172294156), math.square(new double4(0.182081609964370727539))); + TestUtils.AreEqual(new double4(0.0331537126872172294156), math.square(new double4(-0.182081609964370727539))); + TestUtils.AreEqual(new double4(225642.598304570652544), math.square(new double4(475.018524169921875))); + TestUtils.AreEqual(new double4(225642.598304570652544), math.square(new double4(-475.018524169921875))); + TestUtils.IsTrue(math.all(math.isnan(math.square(new double4(double.NaN))))); + + // Square the largest finite number that will still produce a finite result. + TestUtils.AreEqual(new double4(1.79769313486231550856e+308), math.square(new double4(1.3407807929942595611e+154))); + TestUtils.AreEqual(new double4(1.79769313486231550856e+308), math.square(new double4(-1.3407807929942595611e+154))); + + // Square the smallest finite number that will produce a non-finite result. + TestUtils.AreEqual(new double4(double.PositiveInfinity), math.square(new double4(1.34078079299425970996e+154))); + TestUtils.AreEqual(new double4(double.PositiveInfinity), math.square(new double4(-1.34078079299425970996e+154))); + + // Random inputs. + TestUtils.AreEqual(new double4(0.272176139782814630053, 96307.5985667444765568 /*96307.5985667444765568*/, 5591.63402314303675666 /*5591.6337890625*/, 152764.275950208306313 /*152764.28125*/), math.square(new double4(0.521705031394958496094, -310.33465576171875, -74.77722930908203125, 390.8507080078125))); + } + + [TestCompiler] + public static void square_int() + { + TestUtils.AreEqual(0, math.square(0)); + TestUtils.AreEqual(1, math.square(-1)); + TestUtils.AreEqual(4, math.square(-2)); + TestUtils.AreEqual(9, math.square(-3)); + TestUtils.AreEqual(16, math.square(-4)); + TestUtils.AreEqual(152399025, math.square(-12345)); + TestUtils.AreEqual(2147395600, math.square(-46340)); + TestUtils.AreEqual(0, math.square(0)); + TestUtils.AreEqual(1, math.square(1)); + TestUtils.AreEqual(4, math.square(2)); + TestUtils.AreEqual(9, math.square(3)); + TestUtils.AreEqual(16, math.square(4)); + TestUtils.AreEqual(152399025, math.square(12345)); + TestUtils.AreEqual(2147395600, math.square(46340)); + + // Overflow cases. + TestUtils.AreEqual(-2147479015, math.square(46341)); + TestUtils.AreEqual(-2147479015, math.square(-46341)); + TestUtils.AreEqual(-1938485248, math.square(123456)); + TestUtils.AreEqual(-1938485248, math.square(-123456)); + TestUtils.AreEqual(1, math.square(2147483647)); + TestUtils.AreEqual(1, math.square(-2147483647)); + TestUtils.AreEqual(0, math.square(-2147483648)); + } + + [TestCompiler] + public static void square_int2() + { + TestUtils.AreEqual(new int2(0), math.square(new int2(0))); + TestUtils.AreEqual(new int2(1), math.square(new int2(-1))); + TestUtils.AreEqual(new int2(4), math.square(new int2(-2))); + TestUtils.AreEqual(new int2(9), math.square(new int2(-3))); + TestUtils.AreEqual(new int2(16), math.square(new int2(-4))); + TestUtils.AreEqual(new int2(152399025), math.square(new int2(-12345))); + TestUtils.AreEqual(new int2(2147395600), math.square(new int2(-46340))); + TestUtils.AreEqual(new int2(0), math.square(new int2(0))); + TestUtils.AreEqual(new int2(1), math.square(new int2(1))); + TestUtils.AreEqual(new int2(4), math.square(new int2(2))); + TestUtils.AreEqual(new int2(9), math.square(new int2(3))); + TestUtils.AreEqual(new int2(16), math.square(new int2(4))); + TestUtils.AreEqual(new int2(152399025), math.square(new int2(12345))); + TestUtils.AreEqual(new int2(2147395600), math.square(new int2(46340))); + + // Overflow cases. + TestUtils.AreEqual(new int2(-2147479015), math.square(new int2(46341))); + TestUtils.AreEqual(new int2(-2147479015), math.square(new int2(-46341))); + TestUtils.AreEqual(new int2(-1938485248), math.square(new int2(123456))); + TestUtils.AreEqual(new int2(-1938485248), math.square(new int2(-123456))); + TestUtils.AreEqual(new int2(1), math.square(new int2(2147483647))); + TestUtils.AreEqual(new int2(1), math.square(new int2(-2147483647))); + TestUtils.AreEqual(new int2(0), math.square(new int2(-2147483648))); + + // Random inputs. + TestUtils.AreEqual(new int2(2121580241, -685235535), math.square(new int2(-831443639, 1415191751))); + } + + [TestCompiler] + public static void square_int3() + { + TestUtils.AreEqual(new int3(0), math.square(new int3(0))); + TestUtils.AreEqual(new int3(1), math.square(new int3(-1))); + TestUtils.AreEqual(new int3(4), math.square(new int3(-2))); + TestUtils.AreEqual(new int3(9), math.square(new int3(-3))); + TestUtils.AreEqual(new int3(16), math.square(new int3(-4))); + TestUtils.AreEqual(new int3(152399025), math.square(new int3(-12345))); + TestUtils.AreEqual(new int3(2147395600), math.square(new int3(-46340))); + TestUtils.AreEqual(new int3(0), math.square(new int3(0))); + TestUtils.AreEqual(new int3(1), math.square(new int3(1))); + TestUtils.AreEqual(new int3(4), math.square(new int3(2))); + TestUtils.AreEqual(new int3(9), math.square(new int3(3))); + TestUtils.AreEqual(new int3(16), math.square(new int3(4))); + TestUtils.AreEqual(new int3(152399025), math.square(new int3(12345))); + TestUtils.AreEqual(new int3(2147395600), math.square(new int3(46340))); + + // Overflow cases. + TestUtils.AreEqual(new int3(-2147479015), math.square(new int3(46341))); + TestUtils.AreEqual(new int3(-2147479015), math.square(new int3(-46341))); + TestUtils.AreEqual(new int3(-1938485248), math.square(new int3(123456))); + TestUtils.AreEqual(new int3(-1938485248), math.square(new int3(-123456))); + TestUtils.AreEqual(new int3(1), math.square(new int3(2147483647))); + TestUtils.AreEqual(new int3(1), math.square(new int3(-2147483647))); + TestUtils.AreEqual(new int3(0), math.square(new int3(-2147483648))); + + // Random inputs. + TestUtils.AreEqual(new int3(2121580241, -685235535, 468048505), math.square(new int3(-831443639, 1415191751, -178100469))); + } + + [TestCompiler] + public static void square_int4() + { + TestUtils.AreEqual(new int4(0), math.square(new int4(0))); + TestUtils.AreEqual(new int4(1), math.square(new int4(-1))); + TestUtils.AreEqual(new int4(4), math.square(new int4(-2))); + TestUtils.AreEqual(new int4(9), math.square(new int4(-3))); + TestUtils.AreEqual(new int4(16), math.square(new int4(-4))); + TestUtils.AreEqual(new int4(152399025), math.square(new int4(-12345))); + TestUtils.AreEqual(new int4(2147395600), math.square(new int4(-46340))); + TestUtils.AreEqual(new int4(0), math.square(new int4(0))); + TestUtils.AreEqual(new int4(1), math.square(new int4(1))); + TestUtils.AreEqual(new int4(4), math.square(new int4(2))); + TestUtils.AreEqual(new int4(9), math.square(new int4(3))); + TestUtils.AreEqual(new int4(16), math.square(new int4(4))); + TestUtils.AreEqual(new int4(152399025), math.square(new int4(12345))); + TestUtils.AreEqual(new int4(2147395600), math.square(new int4(46340))); + + // Overflow cases. + TestUtils.AreEqual(new int4(-2147479015), math.square(new int4(46341))); + TestUtils.AreEqual(new int4(-2147479015), math.square(new int4(-46341))); + TestUtils.AreEqual(new int4(-1938485248), math.square(new int4(123456))); + TestUtils.AreEqual(new int4(-1938485248), math.square(new int4(-123456))); + TestUtils.AreEqual(new int4(1), math.square(new int4(2147483647))); + TestUtils.AreEqual(new int4(1), math.square(new int4(-2147483647))); + TestUtils.AreEqual(new int4(0), math.square(new int4(-2147483648))); + + // Random inputs. + TestUtils.AreEqual(new int4(2121580241, -685235535, 468048505, -1902728316), math.square(new int4(-831443639, 1415191751, -178100469, 1331775970))); + } + + [TestCompiler] + public static void square_uint() + { + TestUtils.AreEqual(0u, math.square(0u)); + TestUtils.AreEqual(1u, math.square(1u)); + TestUtils.AreEqual(4u, math.square(2u)); + TestUtils.AreEqual(9u, math.square(3u)); + TestUtils.AreEqual(16u, math.square(4u)); + TestUtils.AreEqual(152399025u, math.square(12345u)); + TestUtils.AreEqual(2147395600u, math.square(46340u)); + TestUtils.AreEqual(2147488281u, math.square(46341u)); + + // Overflow cases. + TestUtils.AreEqual(1u, math.square(4294967295u)); + TestUtils.AreEqual(1u, math.square(2147483647u)); + TestUtils.AreEqual(2356482048u, math.square(123456u)); + } + + [TestCompiler] + public static void square_uint2() + { + TestUtils.AreEqual(new uint2(0u), math.square(new uint2(0u))); + TestUtils.AreEqual(new uint2(1u), math.square(new uint2(1u))); + TestUtils.AreEqual(new uint2(4u), math.square(new uint2(2u))); + TestUtils.AreEqual(new uint2(9u), math.square(new uint2(3u))); + TestUtils.AreEqual(new uint2(16u), math.square(new uint2(4u))); + TestUtils.AreEqual(new uint2(152399025u), math.square(new uint2(12345u))); + TestUtils.AreEqual(new uint2(2147395600u), math.square(new uint2(46340u))); + TestUtils.AreEqual(new uint2(2147488281u), math.square(new uint2(46341u))); + + // Overflow cases. + TestUtils.AreEqual(new uint2(1u), math.square(new uint2(4294967295u))); + TestUtils.AreEqual(new uint2(1u), math.square(new uint2(2147483647u))); + TestUtils.AreEqual(new uint2(2356482048u), math.square(new uint2(123456u))); + + // Random inputs. + TestUtils.AreEqual(new uint2(3982663844u, 503153673u), math.square(new uint2(779359642u, 2488899075u))); + } + + [TestCompiler] + public static void square_uint3() + { + TestUtils.AreEqual(new uint3(0u), math.square(new uint3(0u))); + TestUtils.AreEqual(new uint3(1u), math.square(new uint3(1u))); + TestUtils.AreEqual(new uint3(4u), math.square(new uint3(2u))); + TestUtils.AreEqual(new uint3(9u), math.square(new uint3(3u))); + TestUtils.AreEqual(new uint3(16u), math.square(new uint3(4u))); + TestUtils.AreEqual(new uint3(152399025u), math.square(new uint3(12345u))); + TestUtils.AreEqual(new uint3(2147395600u), math.square(new uint3(46340u))); + TestUtils.AreEqual(new uint3(2147488281u), math.square(new uint3(46341u))); + + // Overflow cases. + TestUtils.AreEqual(new uint3(1u), math.square(new uint3(4294967295u))); + TestUtils.AreEqual(new uint3(1u), math.square(new uint3(2147483647u))); + TestUtils.AreEqual(new uint3(2356482048u), math.square(new uint3(123456u))); + + // Random inputs. + TestUtils.AreEqual(new uint3(3982663844u, 503153673u, 4101817232u), math.square(new uint3(779359642u, 2488899075u, 407772844u))); + } + + [TestCompiler] + public static void square_uint4() + { + TestUtils.AreEqual(new uint4(0u), math.square(new uint4(0u))); + TestUtils.AreEqual(new uint4(1u), math.square(new uint4(1u))); + TestUtils.AreEqual(new uint4(4u), math.square(new uint4(2u))); + TestUtils.AreEqual(new uint4(9u), math.square(new uint4(3u))); + TestUtils.AreEqual(new uint4(16u), math.square(new uint4(4u))); + TestUtils.AreEqual(new uint4(152399025u), math.square(new uint4(12345u))); + TestUtils.AreEqual(new uint4(2147395600u), math.square(new uint4(46340u))); + TestUtils.AreEqual(new uint4(2147488281u), math.square(new uint4(46341u))); + + // Overflow cases. + TestUtils.AreEqual(new uint4(1u), math.square(new uint4(4294967295u))); + TestUtils.AreEqual(new uint4(1u), math.square(new uint4(2147483647u))); + TestUtils.AreEqual(new uint4(2356482048u), math.square(new uint4(123456u))); + + // Random inputs. + TestUtils.AreEqual(new uint4(3982663844u, 503153673u, 4101817232u, 2726088561u), math.square(new uint4(779359642u, 2488899075u, 407772844u, 2862593383u))); + } + + // This utility function comes from footnote 1 of "Building an Orthonormal Basis, Revisited" by + // Duff, Burgess, Christensen, Hery, Kensler, Liani and Villemin. + // + // It simply computes the average squared error of the basis vectors by taking into account + // their lengths (which should be one) and dot products (which should be zero). + // + // https://graphics.pixar.com/library/OrthonormalB/paper.pdf + static double OrthonormalBasisSquaredError(double3 v1, double3 v2, double3 v3) + { + var d1 = math.length(v1) - 1.0; + var d2 = math.length(v2) - 1.0; + var d3 = math.length(v3) - 1.0; + var dot1 = math.dot(v1, v2); + var dot2 = math.dot(v1, v3); + var dot3 = math.dot(v2, v3); + + return ((d1 * d1) + (d2 * d2) + (d3 * d3) + (dot1 * dot1) + (dot2 * dot2) + (dot3 * dot3)) / 6.0; + } + + // The value chosen for tolerance here is the maximum error observed in + // "Building an Orthonormal Basis, Revisited" table 1. + private const double kOrthonormalBasisSqErrorTolerance = 1.04e-7d; + + [TestCompiler] + public static void orthonormal_basis_float() + { + var random = new Random(8189782u); + + for (int i = 0; i < 10000; ++i) + { + var v1 = random.NextFloat3Direction(); + var v2 = new float3(); + var v3 = new float3(); + math.orthonormal_basis(v1, out v2, out v3); + TestUtils.IsTrue(OrthonormalBasisSquaredError(v1, v2, v3) < kOrthonormalBasisSqErrorTolerance); + } + } + + [TestCompiler] + public static void orthonormal_basis_double() + { + var random = new Random(99917872u); + + for (int i = 0; i < 10000; ++i) + { + var v1 = random.NextDouble3Direction(); + var v2 = new double3(); + var v3 = new double3(); + math.orthonormal_basis(v1, out v2, out v3); + TestUtils.IsTrue(OrthonormalBasisSquaredError(v1, v2, v3) < kOrthonormalBasisSqErrorTolerance); + } + } + + [TestCompiler] + public static void chgsign_float() + { + float c = chgsign(1f, -1f); + TestUtils.AreEqual(-1f, c); + + c = chgsign(1f, 1f); + TestUtils.AreEqual(1f, c); + + c = chgsign(-1f, -1f); + TestUtils.AreEqual(1f, c); + + c = chgsign(-1f, 1f); + TestUtils.AreEqual(-1f, c); + + c = chgsign(-1f, 0f); + TestUtils.AreEqual(-1f, c); + + c = chgsign(-1f, -0f); + TestUtils.AreEqual(1f, c); + + c = chgsign(1f, TestUtils.SignedFloatQNaN()); + TestUtils.AreEqual(-1f, c); + + c = chgsign(-1f, TestUtils.SignedFloatQNaN()); + TestUtils.AreEqual(1f, c); + + c = chgsign(1f, TestUtils.UnsignedFloatQNaN()); + TestUtils.AreEqual(1f, c); + + c = chgsign(-1f, TestUtils.UnsignedFloatQNaN()); + TestUtils.AreEqual(-1f, c); + + c = chgsign(1f, INFINITY); + TestUtils.AreEqual(1f, c); + + c = chgsign(-1f, INFINITY); + TestUtils.AreEqual(-1f, c); + + c = chgsign(1f, -INFINITY); + TestUtils.AreEqual(-1f, c); + + c = chgsign(-1f, -INFINITY); + TestUtils.AreEqual(1f, c); + + c = chgsign(TestUtils.UnsignedFloatQNaN(), 1f); + TestUtils.IsTrue(isnan(c)); + TestUtils.AreEqual(asuint(TestUtils.UnsignedFloatQNaN()), asuint(c)); + + c = chgsign(TestUtils.UnsignedFloatQNaN(), -1f); + TestUtils.IsTrue(isnan(c)); + TestUtils.AreEqual(asuint(TestUtils.SignedFloatQNaN()), asuint(c)); + + c = chgsign(0f, 1f); + TestUtils.AreEqual(0f, c); + TestUtils.AreEqual(0u, asuint(c)); + + c = chgsign(0f, -1f); + TestUtils.AreEqual(0f, c); + TestUtils.AreEqual(asuint(TestUtils.SignedFloatZero()), asuint(c)); + } + + [TestCompiler] + public static void chgsign_float2() + { + float2 c = chgsign(float2(1f, -2f), float2(-1f, 23.548f)); + TestUtils.AreEqual(float2(-1f, -2f), c); + + c = chgsign(float2(-1f), float2(-1f, 1f)); + TestUtils.AreEqual(float2(1f, -1f), c); + + c = chgsign(float2(-1f), float2(1f, -1f)); + TestUtils.AreEqual(float2(-1f, 1f), c); + + c = chgsign(float2(-1f), float2(TestUtils.SignedFloatQNaN(), TestUtils.UnsignedFloatQNaN())); + TestUtils.AreEqual(float2(1f, -1f), c); + + c = chgsign(float2(-1f), float2(TestUtils.UnsignedFloatQNaN(), TestUtils.SignedFloatQNaN())); + TestUtils.AreEqual(float2(-1f, 1f), c); + + c = chgsign(float2(TestUtils.SignedFloatQNaN(), TestUtils.UnsignedFloatQNaN()), float2(-1f, 1f)); + TestUtils.IsTrue(all(isnan(c))); + TestUtils.AreEqual(asuint(float2(TestUtils.UnsignedFloatQNaN())), asuint(c)); + + c = chgsign(float2(TestUtils.SignedFloatQNaN(), TestUtils.UnsignedFloatQNaN()), float2(1f, -1f)); + TestUtils.IsTrue(all(isnan(c))); + TestUtils.AreEqual(asuint(float2(TestUtils.SignedFloatQNaN())), asuint(c)); + + c = chgsign(float2(TestUtils.SignedFloatZero(), 0f), float2(TestUtils.SignedFloatZero(), 0f)); + TestUtils.AreEqual(float2.zero, c); + TestUtils.AreEqual(uint2.zero, asuint(c)); + + c = chgsign(float2(TestUtils.SignedFloatZero(), 0f), float2(0f, TestUtils.SignedFloatZero())); + TestUtils.AreEqual(float2.zero, c); + TestUtils.AreEqual(asuint(math.float2(TestUtils.SignedFloatZero())), asuint(c)); + } + + [TestCompiler] + public static void chgsign_float3() + { + float3 c = chgsign(float3(1f, -2f, 3f), float3(-1f, 23.548f, -0f)); + TestUtils.AreEqual(float3(-1f, -2f, -3f), c); + + c = chgsign(float3(-1f), float3(-1f, 1f, -1f)); + TestUtils.AreEqual(float3(1f, -1f, 1f), c); + + c = chgsign(float3(-1f), float3(1f, -1f, 1f)); + TestUtils.AreEqual(float3(-1f, 1f, -1f), c); + + c = chgsign(float3(-1f), float3(TestUtils.SignedFloatQNaN(), TestUtils.UnsignedFloatQNaN(), TestUtils.SignedFloatQNaN())); + TestUtils.AreEqual(float3(1f, -1f, 1f), c); + + c = chgsign(float3(-1f), float3(TestUtils.UnsignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.UnsignedFloatQNaN())); + TestUtils.AreEqual(float3(-1f, 1f, -1f), c); + + c = chgsign(float3(TestUtils.SignedFloatQNaN(), TestUtils.UnsignedFloatQNaN(), TestUtils.SignedFloatQNaN()), float3(-1f, 1f, -1f)); + TestUtils.IsTrue(all(isnan(c))); + TestUtils.AreEqual(asuint(float3(TestUtils.UnsignedFloatQNaN())), asuint(c)); + + c = chgsign(float3(TestUtils.SignedFloatQNaN(), TestUtils.UnsignedFloatQNaN(), TestUtils.SignedFloatQNaN()), float3(1f, -1f, 1f)); + TestUtils.IsTrue(all(isnan(c))); + TestUtils.AreEqual(asuint(float3(TestUtils.SignedFloatQNaN())), asuint(c)); + + c = chgsign(float3(TestUtils.SignedFloatZero(), 0f, TestUtils.SignedFloatZero()), float3(TestUtils.SignedFloatZero(), 0f, TestUtils.SignedFloatZero())); + TestUtils.AreEqual(float3.zero, c); + TestUtils.AreEqual(uint3.zero, asuint(c)); + + c = chgsign(float3(TestUtils.SignedFloatZero(), 0f, TestUtils.SignedFloatZero()), float3(0f, TestUtils.SignedFloatZero(), 0f)); + TestUtils.AreEqual(float3.zero, c); + TestUtils.AreEqual(asuint(math.float3(TestUtils.SignedFloatZero())), asuint(c)); + } + + [TestCompiler] + public static void chgsign_float4() + { + float4 c = chgsign(float4(1f, 2f, 3f, -4f), float4(-1f, 0f, -0f, -23.56f)); + TestUtils.AreEqual(float4(-1f, 2f, -3f, 4f), c); + + c = chgsign(float4(-1f), float4(-1f, 1f, -1f, 1f)); + TestUtils.AreEqual(float4(1f, -1f, 1f, -1f), c); + + c = chgsign(float4(-1f), float4(1f, -1f, 1f, -1f)); + TestUtils.AreEqual(float4(-1f, 1f, -1f, 1f), c); + + c = chgsign(float4(-1f), float4(TestUtils.SignedFloatQNaN(), TestUtils.UnsignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.UnsignedFloatQNaN())); + TestUtils.AreEqual(float4(1f, -1f, 1f, -1f), c); + + c = chgsign(float4(-1f), float4(TestUtils.UnsignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.UnsignedFloatQNaN(), TestUtils.SignedFloatQNaN())); + TestUtils.AreEqual(float4(-1f, 1f, -1f, 1f), c); + + c = chgsign(float4(TestUtils.SignedFloatQNaN(), TestUtils.UnsignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.UnsignedFloatQNaN()), float4(-1f, 1f, -1f, 1f)); + TestUtils.IsTrue(all(isnan(c))); + TestUtils.AreEqual(asuint(float4(TestUtils.UnsignedFloatQNaN())), asuint(c)); + + c = chgsign(float4(TestUtils.SignedFloatQNaN(), TestUtils.UnsignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.UnsignedFloatQNaN()), float4(1f, -1f, 1f, -1f)); + TestUtils.IsTrue(all(isnan(c))); + TestUtils.AreEqual(asuint(float4(TestUtils.SignedFloatQNaN())), asuint(c)); + + c = chgsign(float4(TestUtils.SignedFloatZero(), 0f, TestUtils.SignedFloatZero(), 0f), float4(TestUtils.SignedFloatZero(), 0f, TestUtils.SignedFloatZero(), 0f)); + TestUtils.AreEqual(float4.zero, c); + TestUtils.AreEqual(uint4.zero, asuint(c)); + + c = chgsign(float4(TestUtils.SignedFloatZero(), 0f, TestUtils.SignedFloatZero(), 0f), float4(0f, TestUtils.SignedFloatZero(), 0f, TestUtils.SignedFloatZero())); + TestUtils.AreEqual(float4.zero, c); + TestUtils.AreEqual(asuint(math.float4(TestUtils.SignedFloatZero())), asuint(c)); + } + + [TestCompiler] + public static unsafe void quaternion_to_euler() + { + const float epsilon = 0.0045f; + const float PI_div_6 = PI / 6f; + const int testAngleCount = 13 * 13 * 13 * 20; + + float3* testAngles = stackalloc float3[testAngleCount]; + + int idx = 0; + for (int i = 0; i < 13; ++i) + { + float x = -PI + i * PI; + for (int j = 0; j < 13; ++j) + { + float y = -PI + j * PI_div_6; + for (int k = 0; k < 13; ++k) + { + float z = -PI + k * PI_div_6; + for (int l = 0; l < 20; ++l) + { + testAngles[idx++] = float3(x, y, z) * (0.99f + l * 0.001f); + } + } + } + } + + for (int order = 0; order < 6; ++order) + { + for (int i = 0; i < testAngleCount; ++i) + { + // We cannot directly compare Euler angles, as different angles may represent the same rotation, + // so we have to transform them back to quats to test. + // We also need to create our initial test quaternion, as what we generated was euler angles. + quaternion expected = TestRefEulerToQuat(testAngles[i], math.RotationOrder.Default); + + float3 actualEulers = Euler(expected, (math.RotationOrder)order); + quaternion actualQuat = TestRefEulerToQuat(actualEulers, (math.RotationOrder)order); + + float error = angle(expected, actualQuat); + TestUtils.AreEqual(0f, error, epsilon); + } + } + } + + static quaternion TestRefEulerToQuat(float3 angle, math.RotationOrder order) + { + float3 halfRot = angle * 0.5f; + sincos(halfRot, out float3 s, out float3 c); + + quaternion qX = quaternion(s.x, 0f, 0f, c.x); + quaternion qY = quaternion(0f, s.y, 0f, c.y); + quaternion qZ = quaternion(0f, 0f, s.z, c.z); + + switch (order) + { + case math.RotationOrder.XYZ: + return mul(mul(qZ, qY), qX); + case math.RotationOrder.XZY: + return mul(mul(qY, qZ), qX); + case math.RotationOrder.YXZ: + return mul(mul(qZ, qX), qY); + case math.RotationOrder.YZX: + return mul(mul(qX, qZ), qY); + case math.RotationOrder.ZXY: + return mul(mul(qY, qX), qZ); + case math.RotationOrder.ZYX: + return mul(mul(qX, qY), qZ); + default: + return quaternion(float4(1f)); + } + } + + [TestCompiler] + public static void mulScale() + { + var tolerance = 1e-5f; + + // Random matrix. + var m = new float3x3( + 0.891724169254302978516f, 0.156217902898788452148f, 0.492261469364166259766f, + 0.562758803367614746094f, 0.00122839550022035837173f, 0.437942296266555786133f, + 0.2576503753662109375f, 0.200372591614723205566f, 0.515525519847869873047f); + + // Random scale. + var scale = new float3(0.235540181398391723633f, 0.215966641902923583984f, 0.533130943775177001953f); + var actual = math.mulScale(m, scale); + var expected = new float3x3( + 0.210036873817443847656f, 0.0337378568947315216064f, 0.262439817190170288086f, + 0.132552310824394226074f, 0.000265292444964870810509f, 0.233480587601661682129f, + 0.0606870166957378387451f, 0.043273795396089553833f, 0.274842619895935058594f); + + TestUtils.AreEqual(expected, actual, tolerance); + } + + [TestCompiler] + public static void scaleMul() + { + var tolerance = 1e-5f; + + // Random matrix, same as in mulScale test. + var m = new float3x3( + 0.891724169254302978516f, 0.156217902898788452148f, 0.492261469364166259766f, + 0.562758803367614746094f, 0.00122839550022035837173f, 0.437942296266555786133f, + 0.2576503753662109375f, 0.200372591614723205566f, 0.515525519847869873047f); + + // Random scale, same as in mulScale test. + var scale = new float3(0.235540181398391723633f, 0.215966641902923583984f, 0.533130943775177001953f); + var actual = math.scaleMul(scale, m); + var expected = new float3x3( + 0.210036873817443847656f, 0.0367955937981605529785f, 0.115947358310222625732f, + 0.121537126600742340088f, 0.000265292444964870810509f, 0.0945809260010719299316f, + 0.137361392378807067871f, 0.106824830174446105957f, 0.274842619895935058594f); + + TestUtils.AreEqual(expected, actual, tolerance); + } + + [TestCompiler] + public static void piDoubleConstants() + { + var expectedPi = 3.141592653589793116; + TestUtils.AreEqual(expectedPi, PI_DBL); + TestUtils.AreEqual(expectedPi * 0.5, PIHALF_DBL); + TestUtils.AreEqual(expectedPi * 2.0, PI2_DBL); + TestUtils.AreEqual(expectedPi * 2.0, TAU_DBL); + } + + [TestCompiler] + public static void piSingleConstants() + { + var expectedPi = 3.141592653589793116f; + TestUtils.AreEqual(expectedPi, PI); + TestUtils.AreEqual(expectedPi * 0.5f, PIHALF); + TestUtils.AreEqual(expectedPi * 2.0f, PI2); + TestUtils.AreEqual(expectedPi * 2.0f, TAU); + } + + [TestCompiler] + public static void toDegreesConstants() + { + TestUtils.AreEqual(360.0, PI2_DBL * TODEGREES_DBL); + TestUtils.AreEqual(360.0, TAU_DBL * TODEGREES_DBL); + TestUtils.AreEqual(180.0, PI_DBL * TODEGREES_DBL); + TestUtils.AreEqual(90.0, PIHALF_DBL * TODEGREES_DBL); + + TestUtils.AreEqual(360.0f, PI2 * TODEGREES); + TestUtils.AreEqual(360.0f, TAU * TODEGREES); + TestUtils.AreEqual(180.0f, PI * TODEGREES); + TestUtils.AreEqual(90.0f, PIHALF * TODEGREES); + } + + [TestCompiler] + public static void toRadiansConstants() + { + TestUtils.AreEqual(PI2_DBL, 360.0 * TORADIANS_DBL); + TestUtils.AreEqual(TAU_DBL, 360.0 * TORADIANS_DBL); + TestUtils.AreEqual(PI_DBL, 180.0 * TORADIANS_DBL); + TestUtils.AreEqual(PIHALF_DBL, 90.0 * TORADIANS_DBL); + + TestUtils.AreEqual(PI2, 360.0f * TORADIANS); + TestUtils.AreEqual(TAU, 360.0f * TORADIANS); + TestUtils.AreEqual(PI, 180.0f * TORADIANS); + TestUtils.AreEqual(PIHALF, 90.0f * TORADIANS); + } + + [TestCompiler] + public static void degreesConversionGivesSameResult() + { + int n = 360; + + for (int i = 0; i <= n; ++i) + { + double radians = math.unlerp((double)0, (double)n, (double)i) * PI_DBL; + TestUtils.AreEqual(math.degrees(radians), radians * TODEGREES_DBL); + TestUtils.AreEqual(math.degrees((float)radians), (float)radians * TODEGREES); + } + } + + [TestCompiler] + public static void radiansConversionGivesSameResult() + { + int n = 360; + + for (int i = 0; i <= n; ++i) + { + double degrees = (double)i; + TestUtils.AreEqual(math.radians(degrees), degrees * TORADIANS_DBL); + TestUtils.AreEqual(math.radians((float)degrees), (float)degrees * TORADIANS); + } + } + } +} diff --git a/src/Tests/Tests/Shared/TestMath.cs.meta b/src/Tests/Tests/Shared/TestMath.cs.meta new file mode 100644 index 00000000..40ad0f27 --- /dev/null +++ b/src/Tests/Tests/Shared/TestMath.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4fca0e2ff0321404da5c0ab527bdc756 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestMath.gen.cs b/src/Tests/Tests/Shared/TestMath.gen.cs new file mode 100644 index 00000000..3a803b97 --- /dev/null +++ b/src/Tests/Tests/Shared/TestMath.gen.cs @@ -0,0 +1,4449 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public partial class TestMath + { + [TestCompiler] + public static void abs_int() + { + TestUtils.AreEqual(0, abs(0)); + TestUtils.AreEqual(7, abs(-7)); + TestUtils.AreEqual(11, abs(11)); + TestUtils.AreEqual(2147483647, abs(-2147483647)); + TestUtils.AreEqual(-2147483648, abs(-2147483648)); + } + + [TestCompiler] + public static void abs_int2() + { + TestUtils.AreEqual(int2(0, 7), abs(int2(0, -7))); + TestUtils.AreEqual(int2(11, 2147483647), abs(int2(11, -2147483647))); + TestUtils.AreEqual(int2(-2147483648, -2147483648), abs(int2(-2147483648, -2147483648))); + } + + [TestCompiler] + public static void abs_int3() + { + TestUtils.AreEqual(int3(0, 7, 11), abs(int3(0, -7, 11))); + TestUtils.AreEqual(int3(2147483647, -2147483648, -2147483648), abs(int3(-2147483647, -2147483648, -2147483648))); + } + + [TestCompiler] + public static void abs_int4() + { + TestUtils.AreEqual(int4(0, 7, 11, 2147483647), abs(int4(0, -7, 11, -2147483647))); + TestUtils.AreEqual(int4(-2147483648, -2147483648, -2147483648, -2147483648), abs(int4(-2147483648, -2147483648, -2147483648, -2147483648))); + } + + [TestCompiler] + public static void abs_float() + { + TestUtils.AreEqual(0f, abs(0f)); + TestUtils.AreEqual(1.1f, abs(-1.1f)); + TestUtils.AreEqual(2.2f, abs(2.2f)); + TestUtils.AreEqual(float.PositiveInfinity, abs(float.NegativeInfinity)); + TestUtils.AreEqual(float.PositiveInfinity, abs(float.PositiveInfinity)); + } + + [TestCompiler] + public static void abs_float2() + { + TestUtils.AreEqual(float2(0f, 1.1f), abs(float2(0f, -1.1f))); + TestUtils.AreEqual(float2(2.2f, float.PositiveInfinity), abs(float2(2.2f, float.NegativeInfinity))); + TestUtils.AreEqual(float2(float.PositiveInfinity, float.PositiveInfinity), abs(float2(float.PositiveInfinity, float.PositiveInfinity))); + } + + [TestCompiler] + public static void abs_float3() + { + TestUtils.AreEqual(float3(0f, 1.1f, 2.2f), abs(float3(0f, -1.1f, 2.2f))); + TestUtils.AreEqual(float3(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity), abs(float3(float.NegativeInfinity, float.PositiveInfinity, float.PositiveInfinity))); + } + + [TestCompiler] + public static void abs_float4() + { + TestUtils.AreEqual(float4(0f, 1.1f, 2.2f, float.PositiveInfinity), abs(float4(0f, -1.1f, 2.2f, float.NegativeInfinity))); + TestUtils.AreEqual(float4(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity), abs(float4(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity))); + } + + [TestCompiler] + public static void abs_double() + { + TestUtils.AreEqual(0.0, abs(0.0)); + TestUtils.AreEqual(1.1, abs(-1.1)); + TestUtils.AreEqual(2.2, abs(2.2)); + TestUtils.AreEqual(double.PositiveInfinity, abs(double.NegativeInfinity)); + TestUtils.AreEqual(double.PositiveInfinity, abs(double.PositiveInfinity)); + } + + [TestCompiler] + public static void abs_double2() + { + TestUtils.AreEqual(double2(0.0, 1.1), abs(double2(0.0, -1.1))); + TestUtils.AreEqual(double2(2.2, double.PositiveInfinity), abs(double2(2.2, double.NegativeInfinity))); + TestUtils.AreEqual(double2(double.PositiveInfinity, double.PositiveInfinity), abs(double2(double.PositiveInfinity, double.PositiveInfinity))); + } + + [TestCompiler] + public static void abs_double3() + { + TestUtils.AreEqual(double3(0.0, 1.1, 2.2), abs(double3(0.0, -1.1, 2.2))); + TestUtils.AreEqual(double3(double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity), abs(double3(double.NegativeInfinity, double.PositiveInfinity, double.PositiveInfinity))); + } + + [TestCompiler] + public static void abs_double4() + { + TestUtils.AreEqual(double4(0.0, 1.1, 2.2, double.PositiveInfinity), abs(double4(0.0, -1.1, 2.2, double.NegativeInfinity))); + TestUtils.AreEqual(double4(double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity), abs(double4(double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity))); + } + + [TestCompiler] + public static void isfinite_float() + { + TestUtils.AreEqual(false, isfinite(TestUtils.SignedFloatQNaN())); + TestUtils.AreEqual(false, isfinite(float.NegativeInfinity)); + TestUtils.AreEqual(true, isfinite(float.MinValue)); + TestUtils.AreEqual(true, isfinite(-1f)); + TestUtils.AreEqual(true, isfinite(0f)); + TestUtils.AreEqual(true, isfinite(1f)); + TestUtils.AreEqual(true, isfinite(float.MaxValue)); + TestUtils.AreEqual(false, isfinite(float.PositiveInfinity)); + TestUtils.AreEqual(false, isfinite(TestUtils.UnsignedFloatQNaN())); + } + + [TestCompiler] + public static void isfinite_float2() + { + TestUtils.AreEqual(bool2(false, false), isfinite(float2(TestUtils.SignedFloatQNaN(), float.NegativeInfinity))); + TestUtils.AreEqual(bool2(true, true), isfinite(float2(float.MinValue, -1f))); + TestUtils.AreEqual(bool2(true, true), isfinite(float2(0f, 1f))); + TestUtils.AreEqual(bool2(true, false), isfinite(float2(float.MaxValue, float.PositiveInfinity))); + TestUtils.AreEqual(bool2(false, false), isfinite(float2(TestUtils.UnsignedFloatQNaN(), TestUtils.UnsignedFloatQNaN()))); + } + + [TestCompiler] + public static void isfinite_float3() + { + TestUtils.AreEqual(bool3(false, false, true), isfinite(float3(TestUtils.SignedFloatQNaN(), float.NegativeInfinity, float.MinValue))); + TestUtils.AreEqual(bool3(true, true, true), isfinite(float3(-1f, 0f, 1f))); + TestUtils.AreEqual(bool3(true, false, false), isfinite(float3(float.MaxValue, float.PositiveInfinity, TestUtils.UnsignedFloatQNaN()))); + } + + [TestCompiler] + public static void isfinite_float4() + { + TestUtils.AreEqual(bool4(false, false, true, true), isfinite(float4(TestUtils.SignedFloatQNaN(), float.NegativeInfinity, float.MinValue, -1f))); + TestUtils.AreEqual(bool4(true, true, true, false), isfinite(float4(0f, 1f, float.MaxValue, float.PositiveInfinity))); + TestUtils.AreEqual(bool4(false, false, false, false), isfinite(float4(TestUtils.UnsignedFloatQNaN(), TestUtils.UnsignedFloatQNaN(), TestUtils.UnsignedFloatQNaN(), TestUtils.UnsignedFloatQNaN()))); + } + + [TestCompiler] + public static void isfinite_double() + { + TestUtils.AreEqual(false, isfinite(TestUtils.SignedDoubleQNaN())); + TestUtils.AreEqual(false, isfinite(double.NegativeInfinity)); + TestUtils.AreEqual(true, isfinite(double.MinValue)); + TestUtils.AreEqual(true, isfinite(-1.0)); + TestUtils.AreEqual(true, isfinite(0.0)); + TestUtils.AreEqual(true, isfinite(1.0)); + TestUtils.AreEqual(true, isfinite(double.MaxValue)); + TestUtils.AreEqual(false, isfinite(double.PositiveInfinity)); + TestUtils.AreEqual(false, isfinite(TestUtils.UnsignedDoubleQNaN())); + } + + [TestCompiler] + public static void isfinite_double2() + { + TestUtils.AreEqual(bool2(false, false), isfinite(double2(TestUtils.SignedDoubleQNaN(), double.NegativeInfinity))); + TestUtils.AreEqual(bool2(true, true), isfinite(double2(double.MinValue, -1.0))); + TestUtils.AreEqual(bool2(true, true), isfinite(double2(0.0, 1.0))); + TestUtils.AreEqual(bool2(true, false), isfinite(double2(double.MaxValue, double.PositiveInfinity))); + TestUtils.AreEqual(bool2(false, false), isfinite(double2(TestUtils.UnsignedDoubleQNaN(), TestUtils.UnsignedDoubleQNaN()))); + } + + [TestCompiler] + public static void isfinite_double3() + { + TestUtils.AreEqual(bool3(false, false, true), isfinite(double3(TestUtils.SignedDoubleQNaN(), double.NegativeInfinity, double.MinValue))); + TestUtils.AreEqual(bool3(true, true, true), isfinite(double3(-1.0, 0.0, 1.0))); + TestUtils.AreEqual(bool3(true, false, false), isfinite(double3(double.MaxValue, double.PositiveInfinity, TestUtils.UnsignedDoubleQNaN()))); + } + + [TestCompiler] + public static void isfinite_double4() + { + TestUtils.AreEqual(bool4(false, false, true, true), isfinite(double4(TestUtils.SignedDoubleQNaN(), double.NegativeInfinity, double.MinValue, -1.0))); + TestUtils.AreEqual(bool4(true, true, true, false), isfinite(double4(0.0, 1.0, double.MaxValue, double.PositiveInfinity))); + TestUtils.AreEqual(bool4(false, false, false, false), isfinite(double4(TestUtils.UnsignedDoubleQNaN(), TestUtils.UnsignedDoubleQNaN(), TestUtils.UnsignedDoubleQNaN(), TestUtils.UnsignedDoubleQNaN()))); + } + + [TestCompiler] + public static void isinf_float() + { + TestUtils.AreEqual(false, isinf(TestUtils.SignedFloatQNaN())); + TestUtils.AreEqual(true, isinf(float.NegativeInfinity)); + TestUtils.AreEqual(false, isinf(float.MinValue)); + TestUtils.AreEqual(false, isinf(-1f)); + TestUtils.AreEqual(false, isinf(0f)); + TestUtils.AreEqual(false, isinf(1f)); + TestUtils.AreEqual(false, isinf(float.MaxValue)); + TestUtils.AreEqual(true, isinf(float.PositiveInfinity)); + TestUtils.AreEqual(false, isinf(TestUtils.UnsignedFloatQNaN())); + } + + [TestCompiler] + public static void isinf_float2() + { + TestUtils.AreEqual(bool2(false, true), isinf(float2(TestUtils.SignedFloatQNaN(), float.NegativeInfinity))); + TestUtils.AreEqual(bool2(false, false), isinf(float2(float.MinValue, -1f))); + TestUtils.AreEqual(bool2(false, false), isinf(float2(0f, 1f))); + TestUtils.AreEqual(bool2(false, true), isinf(float2(float.MaxValue, float.PositiveInfinity))); + TestUtils.AreEqual(bool2(false, false), isinf(float2(TestUtils.UnsignedFloatQNaN(), TestUtils.UnsignedFloatQNaN()))); + } + + [TestCompiler] + public static void isinf_float3() + { + TestUtils.AreEqual(bool3(false, true, false), isinf(float3(TestUtils.SignedFloatQNaN(), float.NegativeInfinity, float.MinValue))); + TestUtils.AreEqual(bool3(false, false, false), isinf(float3(-1f, 0f, 1f))); + TestUtils.AreEqual(bool3(false, true, false), isinf(float3(float.MaxValue, float.PositiveInfinity, TestUtils.UnsignedFloatQNaN()))); + } + + [TestCompiler] + public static void isinf_float4() + { + TestUtils.AreEqual(bool4(false, true, false, false), isinf(float4(TestUtils.SignedFloatQNaN(), float.NegativeInfinity, float.MinValue, -1f))); + TestUtils.AreEqual(bool4(false, false, false, true), isinf(float4(0f, 1f, float.MaxValue, float.PositiveInfinity))); + TestUtils.AreEqual(bool4(false, false, false, false), isinf(float4(TestUtils.UnsignedFloatQNaN(), TestUtils.UnsignedFloatQNaN(), TestUtils.UnsignedFloatQNaN(), TestUtils.UnsignedFloatQNaN()))); + } + + [TestCompiler] + public static void isinf_double() + { + TestUtils.AreEqual(false, isinf(TestUtils.SignedDoubleQNaN())); + TestUtils.AreEqual(true, isinf(double.NegativeInfinity)); + TestUtils.AreEqual(false, isinf(double.MinValue)); + TestUtils.AreEqual(false, isinf(-1.0)); + TestUtils.AreEqual(false, isinf(0.0)); + TestUtils.AreEqual(false, isinf(1.0)); + TestUtils.AreEqual(false, isinf(double.MaxValue)); + TestUtils.AreEqual(true, isinf(double.PositiveInfinity)); + TestUtils.AreEqual(false, isinf(TestUtils.UnsignedDoubleQNaN())); + } + + [TestCompiler] + public static void isinf_double2() + { + TestUtils.AreEqual(bool2(false, true), isinf(double2(TestUtils.SignedDoubleQNaN(), double.NegativeInfinity))); + TestUtils.AreEqual(bool2(false, false), isinf(double2(double.MinValue, -1.0))); + TestUtils.AreEqual(bool2(false, false), isinf(double2(0.0, 1.0))); + TestUtils.AreEqual(bool2(false, true), isinf(double2(double.MaxValue, double.PositiveInfinity))); + TestUtils.AreEqual(bool2(false, false), isinf(double2(TestUtils.UnsignedDoubleQNaN(), TestUtils.UnsignedDoubleQNaN()))); + } + + [TestCompiler] + public static void isinf_double3() + { + TestUtils.AreEqual(bool3(false, true, false), isinf(double3(TestUtils.SignedDoubleQNaN(), double.NegativeInfinity, double.MinValue))); + TestUtils.AreEqual(bool3(false, false, false), isinf(double3(-1.0, 0.0, 1.0))); + TestUtils.AreEqual(bool3(false, true, false), isinf(double3(double.MaxValue, double.PositiveInfinity, TestUtils.UnsignedDoubleQNaN()))); + } + + [TestCompiler] + public static void isinf_double4() + { + TestUtils.AreEqual(bool4(false, true, false, false), isinf(double4(TestUtils.SignedDoubleQNaN(), double.NegativeInfinity, double.MinValue, -1.0))); + TestUtils.AreEqual(bool4(false, false, false, true), isinf(double4(0.0, 1.0, double.MaxValue, double.PositiveInfinity))); + TestUtils.AreEqual(bool4(false, false, false, false), isinf(double4(TestUtils.UnsignedDoubleQNaN(), TestUtils.UnsignedDoubleQNaN(), TestUtils.UnsignedDoubleQNaN(), TestUtils.UnsignedDoubleQNaN()))); + } + + [TestCompiler] + public static void isnan_float() + { + TestUtils.AreEqual(true, isnan(TestUtils.SignedFloatQNaN())); + TestUtils.AreEqual(false, isnan(float.NegativeInfinity)); + TestUtils.AreEqual(false, isnan(float.MinValue)); + TestUtils.AreEqual(false, isnan(-1f)); + TestUtils.AreEqual(false, isnan(0f)); + TestUtils.AreEqual(false, isnan(1f)); + TestUtils.AreEqual(false, isnan(float.MaxValue)); + TestUtils.AreEqual(false, isnan(float.PositiveInfinity)); + TestUtils.AreEqual(true, isnan(TestUtils.UnsignedFloatQNaN())); + } + + [TestCompiler] + public static void isnan_float2() + { + TestUtils.AreEqual(bool2(true, false), isnan(float2(TestUtils.SignedFloatQNaN(), float.NegativeInfinity))); + TestUtils.AreEqual(bool2(false, false), isnan(float2(float.MinValue, -1f))); + TestUtils.AreEqual(bool2(false, false), isnan(float2(0f, 1f))); + TestUtils.AreEqual(bool2(false, false), isnan(float2(float.MaxValue, float.PositiveInfinity))); + TestUtils.AreEqual(bool2(true, true), isnan(float2(TestUtils.UnsignedFloatQNaN(), TestUtils.UnsignedFloatQNaN()))); + } + + [TestCompiler] + public static void isnan_float3() + { + TestUtils.AreEqual(bool3(true, false, false), isnan(float3(TestUtils.SignedFloatQNaN(), float.NegativeInfinity, float.MinValue))); + TestUtils.AreEqual(bool3(false, false, false), isnan(float3(-1f, 0f, 1f))); + TestUtils.AreEqual(bool3(false, false, true), isnan(float3(float.MaxValue, float.PositiveInfinity, TestUtils.UnsignedFloatQNaN()))); + } + + [TestCompiler] + public static void isnan_float4() + { + TestUtils.AreEqual(bool4(true, false, false, false), isnan(float4(TestUtils.SignedFloatQNaN(), float.NegativeInfinity, float.MinValue, -1f))); + TestUtils.AreEqual(bool4(false, false, false, false), isnan(float4(0f, 1f, float.MaxValue, float.PositiveInfinity))); + TestUtils.AreEqual(bool4(true, true, true, true), isnan(float4(TestUtils.UnsignedFloatQNaN(), TestUtils.UnsignedFloatQNaN(), TestUtils.UnsignedFloatQNaN(), TestUtils.UnsignedFloatQNaN()))); + } + + [TestCompiler] + public static void isnan_double() + { + TestUtils.AreEqual(true, isnan(TestUtils.SignedDoubleQNaN())); + TestUtils.AreEqual(false, isnan(double.NegativeInfinity)); + TestUtils.AreEqual(false, isnan(double.MinValue)); + TestUtils.AreEqual(false, isnan(-1.0)); + TestUtils.AreEqual(false, isnan(0.0)); + TestUtils.AreEqual(false, isnan(1.0)); + TestUtils.AreEqual(false, isnan(double.MaxValue)); + TestUtils.AreEqual(false, isnan(double.PositiveInfinity)); + TestUtils.AreEqual(true, isnan(TestUtils.UnsignedDoubleQNaN())); + } + + [TestCompiler] + public static void isnan_double2() + { + TestUtils.AreEqual(bool2(true, false), isnan(double2(TestUtils.SignedDoubleQNaN(), double.NegativeInfinity))); + TestUtils.AreEqual(bool2(false, false), isnan(double2(double.MinValue, -1.0))); + TestUtils.AreEqual(bool2(false, false), isnan(double2(0.0, 1.0))); + TestUtils.AreEqual(bool2(false, false), isnan(double2(double.MaxValue, double.PositiveInfinity))); + TestUtils.AreEqual(bool2(true, true), isnan(double2(TestUtils.UnsignedDoubleQNaN(), TestUtils.UnsignedDoubleQNaN()))); + } + + [TestCompiler] + public static void isnan_double3() + { + TestUtils.AreEqual(bool3(true, false, false), isnan(double3(TestUtils.SignedDoubleQNaN(), double.NegativeInfinity, double.MinValue))); + TestUtils.AreEqual(bool3(false, false, false), isnan(double3(-1.0, 0.0, 1.0))); + TestUtils.AreEqual(bool3(false, false, true), isnan(double3(double.MaxValue, double.PositiveInfinity, TestUtils.UnsignedDoubleQNaN()))); + } + + [TestCompiler] + public static void isnan_double4() + { + TestUtils.AreEqual(bool4(true, false, false, false), isnan(double4(TestUtils.SignedDoubleQNaN(), double.NegativeInfinity, double.MinValue, -1.0))); + TestUtils.AreEqual(bool4(false, false, false, false), isnan(double4(0.0, 1.0, double.MaxValue, double.PositiveInfinity))); + TestUtils.AreEqual(bool4(true, true, true, true), isnan(double4(TestUtils.UnsignedDoubleQNaN(), TestUtils.UnsignedDoubleQNaN(), TestUtils.UnsignedDoubleQNaN(), TestUtils.UnsignedDoubleQNaN()))); + } + + [TestCompiler] + public static void sin_float() + { + TestUtils.AreEqual(0.3499935f, sin(-1000000f), 1, false); + TestUtils.AreEqual(-0.9320391f, sin(-1.2f), 1, false); + TestUtils.AreEqual(0f, sin(0f), 1, false); + TestUtils.AreEqual(0.9320391f, sin(1.2f), 1, false); + TestUtils.AreEqual(-0.3499935f, sin(1000000f), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), sin(float.NegativeInfinity), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), sin(TestUtils.SignedFloatQNaN()), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), sin(float.PositiveInfinity), 1, false); + } + + [TestCompiler] + public static void sin_float2() + { + TestUtils.AreEqual(float2(0.3499935f, -0.9320391f), sin(float2(-1000000f, -1.2f)), 1, false); + TestUtils.AreEqual(float2(0f, 0.9320391f), sin(float2(0f, 1.2f)), 1, false); + TestUtils.AreEqual(float2(-0.3499935f, TestUtils.SignedFloatQNaN()), sin(float2(1000000f, float.NegativeInfinity)), 1, false); + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), sin(float2(TestUtils.SignedFloatQNaN(), float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void sin_float3() + { + TestUtils.AreEqual(float3(0.3499935f, -0.9320391f, 0f), sin(float3(-1000000f, -1.2f, 0f)), 1, false); + TestUtils.AreEqual(float3(0.9320391f, -0.3499935f, TestUtils.SignedFloatQNaN()), sin(float3(1.2f, 1000000f, float.NegativeInfinity)), 1, false); + TestUtils.AreEqual(float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), sin(float3(TestUtils.SignedFloatQNaN(), float.PositiveInfinity, float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void sin_float4() + { + TestUtils.AreEqual(float4(0.3499935f, -0.9320391f, 0f, 0.9320391f), sin(float4(-1000000f, -1.2f, 0f, 1.2f)), 1, false); + TestUtils.AreEqual(float4(-0.3499935f, TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), sin(float4(1000000f, float.NegativeInfinity, TestUtils.SignedFloatQNaN(), float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void sin_double() + { + TestUtils.AreEqual(0.34999350217129294, sin(-1000000.0), 32, false); + TestUtils.AreEqual(-0.9320390859672264, sin(-1.2), 32, false); + TestUtils.AreEqual(0.0, sin(0.0), 32, false); + TestUtils.AreEqual(0.9320390859672264, sin(1.2), 32, false); + TestUtils.AreEqual(-0.34999350217129294, sin(1000000.0), 32, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), sin(double.NegativeInfinity), 32, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), sin(TestUtils.SignedDoubleQNaN()), 32, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), sin(double.PositiveInfinity), 32, false); + } + + [TestCompiler] + public static void sin_double2() + { + TestUtils.AreEqual(double2(0.34999350217129294, -0.9320390859672264), sin(double2(-1000000.0, -1.2)), 32, false); + TestUtils.AreEqual(double2(0.0, 0.9320390859672264), sin(double2(0.0, 1.2)), 32, false); + TestUtils.AreEqual(double2(-0.34999350217129294, TestUtils.SignedDoubleQNaN()), sin(double2(1000000.0, double.NegativeInfinity)), 32, false); + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), sin(double2(TestUtils.SignedDoubleQNaN(), double.PositiveInfinity)), 32, false); + } + + [TestCompiler] + public static void sin_double3() + { + TestUtils.AreEqual(double3(0.34999350217129294, -0.9320390859672264, 0.0), sin(double3(-1000000.0, -1.2, 0.0)), 32, false); + TestUtils.AreEqual(double3(0.9320390859672264, -0.34999350217129294, TestUtils.SignedDoubleQNaN()), sin(double3(1.2, 1000000.0, double.NegativeInfinity)), 32, false); + TestUtils.AreEqual(double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), sin(double3(TestUtils.SignedDoubleQNaN(), double.PositiveInfinity, double.PositiveInfinity)), 32, false); + } + + [TestCompiler] + public static void sin_double4() + { + TestUtils.AreEqual(double4(0.34999350217129294, -0.9320390859672264, 0.0, 0.9320390859672264), sin(double4(-1000000.0, -1.2, 0.0, 1.2)), 32, false); + TestUtils.AreEqual(double4(-0.34999350217129294, TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), sin(double4(1000000.0, double.NegativeInfinity, TestUtils.SignedDoubleQNaN(), double.PositiveInfinity)), 32, false); + } + + [TestCompiler] + public static void cos_float() + { + TestUtils.AreEqual(0.936752141f, cos(-1000000f), 8, false); + TestUtils.AreEqual(0.362357765f, cos(-1.2f), 8, false); + TestUtils.AreEqual(1f, cos(0f), 8, false); + TestUtils.AreEqual(0.362357765f, cos(1.2f), 8, false); + TestUtils.AreEqual(0.936752141f, cos(1000000f), 8, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), cos(float.NegativeInfinity), 8, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), cos(TestUtils.SignedFloatQNaN()), 8, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), cos(float.PositiveInfinity), 8, false); + } + + [TestCompiler] + public static void cos_float2() + { + TestUtils.AreEqual(float2(0.936752141f, 0.362357765f), cos(float2(-1000000f, -1.2f)), 8, false); + TestUtils.AreEqual(float2(1f, 0.362357765f), cos(float2(0f, 1.2f)), 8, false); + TestUtils.AreEqual(float2(0.936752141f, TestUtils.SignedFloatQNaN()), cos(float2(1000000f, float.NegativeInfinity)), 8, false); + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), cos(float2(TestUtils.SignedFloatQNaN(), float.PositiveInfinity)), 8, false); + } + + [TestCompiler] + public static void cos_float3() + { + TestUtils.AreEqual(float3(0.936752141f, 0.362357765f, 1f), cos(float3(-1000000f, -1.2f, 0f)), 8, false); + TestUtils.AreEqual(float3(0.362357765f, 0.936752141f, TestUtils.SignedFloatQNaN()), cos(float3(1.2f, 1000000f, float.NegativeInfinity)), 8, false); + TestUtils.AreEqual(float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), cos(float3(TestUtils.SignedFloatQNaN(), float.PositiveInfinity, float.PositiveInfinity)), 8, false); + } + + [TestCompiler] + public static void cos_float4() + { + TestUtils.AreEqual(float4(0.936752141f, 0.362357765f, 1f, 0.362357765f), cos(float4(-1000000f, -1.2f, 0f, 1.2f)), 8, false); + TestUtils.AreEqual(float4(0.936752141f, TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), cos(float4(1000000f, float.NegativeInfinity, TestUtils.SignedFloatQNaN(), float.PositiveInfinity)), 8, false); + } + + [TestCompiler] + public static void cos_double() + { + TestUtils.AreEqual(0.93675212753314474, cos(-1000000.0), 32, false); + TestUtils.AreEqual(0.36235775447667357, cos(-1.2), 32, false); + TestUtils.AreEqual(1.0, cos(0.0), 32, false); + TestUtils.AreEqual(0.36235775447667357, cos(1.2), 32, false); + TestUtils.AreEqual(0.93675212753314474, cos(1000000.0), 32, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), cos(double.NegativeInfinity), 32, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), cos(TestUtils.SignedDoubleQNaN()), 32, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), cos(double.PositiveInfinity), 32, false); + } + + [TestCompiler] + public static void cos_double2() + { + TestUtils.AreEqual(double2(0.93675212753314474, 0.36235775447667357), cos(double2(-1000000.0, -1.2)), 32, false); + TestUtils.AreEqual(double2(1.0, 0.36235775447667357), cos(double2(0.0, 1.2)), 32, false); + TestUtils.AreEqual(double2(0.93675212753314474, TestUtils.SignedDoubleQNaN()), cos(double2(1000000.0, double.NegativeInfinity)), 32, false); + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), cos(double2(TestUtils.SignedDoubleQNaN(), double.PositiveInfinity)), 32, false); + } + + [TestCompiler] + public static void cos_double3() + { + TestUtils.AreEqual(double3(0.93675212753314474, 0.36235775447667357, 1.0), cos(double3(-1000000.0, -1.2, 0.0)), 32, false); + TestUtils.AreEqual(double3(0.36235775447667357, 0.93675212753314474, TestUtils.SignedDoubleQNaN()), cos(double3(1.2, 1000000.0, double.NegativeInfinity)), 32, false); + TestUtils.AreEqual(double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), cos(double3(TestUtils.SignedDoubleQNaN(), double.PositiveInfinity, double.PositiveInfinity)), 32, false); + } + + [TestCompiler] + public static void cos_double4() + { + TestUtils.AreEqual(double4(0.93675212753314474, 0.36235775447667357, 1.0, 0.36235775447667357), cos(double4(-1000000.0, -1.2, 0.0, 1.2)), 32, false); + TestUtils.AreEqual(double4(0.93675212753314474, TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), cos(double4(1000000.0, double.NegativeInfinity, TestUtils.SignedDoubleQNaN(), double.PositiveInfinity)), 32, false); + } + + [TestCompiler] + public static void tan_float() + { + TestUtils.AreEqual(0.373624444f, tan(-1000000f), 1, false); + TestUtils.AreEqual(-2.57215166f, tan(-1.2f), 1, false); + TestUtils.AreEqual(0f, tan(0f), 1, false); + TestUtils.AreEqual(2.57215166f, tan(1.2f), 1, false); + TestUtils.AreEqual(-0.373624444f, tan(1000000f), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), tan(float.NegativeInfinity), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), tan(TestUtils.SignedFloatQNaN()), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), tan(float.PositiveInfinity), 1, false); + } + + [TestCompiler] + public static void tan_float2() + { + TestUtils.AreEqual(float2(0.373624444f, -2.57215166f), tan(float2(-1000000f, -1.2f)), 1, false); + TestUtils.AreEqual(float2(0f, 2.57215166f), tan(float2(0f, 1.2f)), 1, false); + TestUtils.AreEqual(float2(-0.373624444f, TestUtils.SignedFloatQNaN()), tan(float2(1000000f, float.NegativeInfinity)), 1, false); + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), tan(float2(TestUtils.SignedFloatQNaN(), float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void tan_float3() + { + TestUtils.AreEqual(float3(0.373624444f, -2.57215166f, 0f), tan(float3(-1000000f, -1.2f, 0f)), 1, false); + TestUtils.AreEqual(float3(2.57215166f, -0.373624444f, TestUtils.SignedFloatQNaN()), tan(float3(1.2f, 1000000f, float.NegativeInfinity)), 1, false); + TestUtils.AreEqual(float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), tan(float3(TestUtils.SignedFloatQNaN(), float.PositiveInfinity, float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void tan_float4() + { + TestUtils.AreEqual(float4(0.373624444f, -2.57215166f, 0f, 2.57215166f), tan(float4(-1000000f, -1.2f, 0f, 1.2f)), 1, false); + TestUtils.AreEqual(float4(-0.373624444f, TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), tan(float4(1000000f, float.NegativeInfinity, TestUtils.SignedFloatQNaN(), float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void tan_double() + { + TestUtils.AreEqual(0.373624453987599, tan(-1000000.0), 32, false); + TestUtils.AreEqual(-2.57215162212632, tan(-1.2), 32, false); + TestUtils.AreEqual(0.0, tan(0.0), 32, false); + TestUtils.AreEqual(2.57215162212632, tan(1.2), 32, false); + TestUtils.AreEqual(-0.373624453987599, tan(1000000.0), 32, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), tan(double.NegativeInfinity), 32, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), tan(TestUtils.SignedDoubleQNaN()), 32, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), tan(double.PositiveInfinity), 32, false); + } + + [TestCompiler] + public static void tan_double2() + { + TestUtils.AreEqual(double2(0.373624453987599, -2.57215162212632), tan(double2(-1000000.0, -1.2)), 32, false); + TestUtils.AreEqual(double2(0.0, 2.57215162212632), tan(double2(0.0, 1.2)), 32, false); + TestUtils.AreEqual(double2(-0.373624453987599, TestUtils.SignedDoubleQNaN()), tan(double2(1000000.0, double.NegativeInfinity)), 32, false); + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), tan(double2(TestUtils.SignedDoubleQNaN(), double.PositiveInfinity)), 32, false); + } + + [TestCompiler] + public static void tan_double3() + { + TestUtils.AreEqual(double3(0.373624453987599, -2.57215162212632, 0.0), tan(double3(-1000000.0, -1.2, 0.0)), 32, false); + TestUtils.AreEqual(double3(2.57215162212632, -0.373624453987599, TestUtils.SignedDoubleQNaN()), tan(double3(1.2, 1000000.0, double.NegativeInfinity)), 32, false); + TestUtils.AreEqual(double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), tan(double3(TestUtils.SignedDoubleQNaN(), double.PositiveInfinity, double.PositiveInfinity)), 32, false); + } + + [TestCompiler] + public static void tan_double4() + { + TestUtils.AreEqual(double4(0.373624453987599, -2.57215162212632, 0.0, 2.57215162212632), tan(double4(-1000000.0, -1.2, 0.0, 1.2)), 32, false); + TestUtils.AreEqual(double4(-0.373624453987599, TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), tan(double4(1000000.0, double.NegativeInfinity, TestUtils.SignedDoubleQNaN(), double.PositiveInfinity)), 32, false); + } + + [TestCompiler] + public static void atan_float() + { + TestUtils.AreEqual(-1.5707953f, atan(-1000000f), 1, false); + TestUtils.AreEqual(-0.876058042f, atan(-1.2f), 1, false); + TestUtils.AreEqual(0f, atan(0f), 1, false); + TestUtils.AreEqual(0.876058042f, atan(1.2f), 1, false); + TestUtils.AreEqual(1.5707953f, atan(1000000f), 1, false); + TestUtils.AreEqual(-1.57079637f, atan(float.NegativeInfinity), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), atan(TestUtils.SignedFloatQNaN()), 1, false); + TestUtils.AreEqual(1.57079637f, atan(float.PositiveInfinity), 1, false); + } + + [TestCompiler] + public static void atan_float2() + { + TestUtils.AreEqual(float2(-1.5707953f, -0.876058042f), atan(float2(-1000000f, -1.2f)), 1, false); + TestUtils.AreEqual(float2(0f, 0.876058042f), atan(float2(0f, 1.2f)), 1, false); + TestUtils.AreEqual(float2(1.5707953f, -1.57079637f), atan(float2(1000000f, float.NegativeInfinity)), 1, false); + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), 1.57079637f), atan(float2(TestUtils.SignedFloatQNaN(), float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void atan_float3() + { + TestUtils.AreEqual(float3(-1.5707953f, -0.876058042f, 0f), atan(float3(-1000000f, -1.2f, 0f)), 1, false); + TestUtils.AreEqual(float3(0.876058042f, 1.5707953f, -1.57079637f), atan(float3(1.2f, 1000000f, float.NegativeInfinity)), 1, false); + TestUtils.AreEqual(float3(TestUtils.SignedFloatQNaN(), 1.57079637f, 1.57079637f), atan(float3(TestUtils.SignedFloatQNaN(), float.PositiveInfinity, float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void atan_float4() + { + TestUtils.AreEqual(float4(-1.5707953f, -0.876058042f, 0f, 0.876058042f), atan(float4(-1000000f, -1.2f, 0f, 1.2f)), 1, false); + TestUtils.AreEqual(float4(1.5707953f, -1.57079637f, TestUtils.SignedFloatQNaN(), 1.57079637f), atan(float4(1000000f, float.NegativeInfinity, TestUtils.SignedFloatQNaN(), float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void atan_double() + { + TestUtils.AreEqual(-1.5707953267948971, atan(-1000000.0), 32, false); + TestUtils.AreEqual(-0.87605805059819342, atan(-1.2), 32, false); + TestUtils.AreEqual(0.0, atan(0.0), 32, false); + TestUtils.AreEqual(0.87605805059819342, atan(1.2), 32, false); + TestUtils.AreEqual(1.5707953267948971, atan(1000000.0), 32, false); + TestUtils.AreEqual(-1.570796326794897, atan(double.NegativeInfinity), 32, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), atan(TestUtils.SignedDoubleQNaN()), 32, false); + TestUtils.AreEqual(1.570796326794897, atan(double.PositiveInfinity), 32, false); + } + + [TestCompiler] + public static void atan_double2() + { + TestUtils.AreEqual(double2(-1.5707953267948971, -0.87605805059819342), atan(double2(-1000000.0, -1.2)), 32, false); + TestUtils.AreEqual(double2(0.0, 0.87605805059819342), atan(double2(0.0, 1.2)), 32, false); + TestUtils.AreEqual(double2(1.5707953267948971, -1.570796326794897), atan(double2(1000000.0, double.NegativeInfinity)), 32, false); + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), 1.570796326794897), atan(double2(TestUtils.SignedDoubleQNaN(), double.PositiveInfinity)), 32, false); + } + + [TestCompiler] + public static void atan_double3() + { + TestUtils.AreEqual(double3(-1.5707953267948971, -0.87605805059819342, 0.0), atan(double3(-1000000.0, -1.2, 0.0)), 32, false); + TestUtils.AreEqual(double3(0.87605805059819342, 1.5707953267948971, -1.570796326794897), atan(double3(1.2, 1000000.0, double.NegativeInfinity)), 32, false); + TestUtils.AreEqual(double3(TestUtils.SignedDoubleQNaN(), 1.570796326794897, 1.570796326794897), atan(double3(TestUtils.SignedDoubleQNaN(), double.PositiveInfinity, double.PositiveInfinity)), 32, false); + } + + [TestCompiler] + public static void atan_double4() + { + TestUtils.AreEqual(double4(-1.5707953267948971, -0.87605805059819342, 0.0, 0.87605805059819342), atan(double4(-1000000.0, -1.2, 0.0, 1.2)), 32, false); + TestUtils.AreEqual(double4(1.5707953267948971, -1.570796326794897, TestUtils.SignedDoubleQNaN(), 1.570796326794897), atan(double4(1000000.0, double.NegativeInfinity, TestUtils.SignedDoubleQNaN(), double.PositiveInfinity)), 32, false); + } + + [TestCompiler] + public static void atan2_float() + { + TestUtils.AreEqual(0.9119903f, atan2(3.1f, 2.4f), 1, false); + TestUtils.AreEqual(2.22960234f, atan2(3.1f, -2.4f), 1, false); + TestUtils.AreEqual(-0.9119903f, atan2(-3.1f, 2.4f), 1, false); + TestUtils.AreEqual(-2.22960234f, atan2(-3.1f, -2.4f), 1, false); + TestUtils.AreEqual(0f, atan2(0f, 0f), 1, false); + TestUtils.AreEqual(3.14159274f, atan2(1f, float.NegativeInfinity), 1, false); + TestUtils.AreEqual(0f, atan2(1f, float.PositiveInfinity), 1, false); + TestUtils.AreEqual(-1.57079637f, atan2(float.NegativeInfinity, 1f), 1, false); + TestUtils.AreEqual(1.57079637f, atan2(float.PositiveInfinity, 1f), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), atan2(1f, TestUtils.SignedFloatQNaN()), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), atan2(TestUtils.SignedFloatQNaN(), 1f), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), atan2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), 1, false); + } + + [TestCompiler] + public static void atan2_float2() + { + TestUtils.AreEqual(float2(0.9119903f, 2.22960234f), atan2(float2(3.1f, 3.1f), float2(2.4f, -2.4f)), 1, false); + TestUtils.AreEqual(float2(-0.9119903f, -2.22960234f), atan2(float2(-3.1f, -3.1f), float2(2.4f, -2.4f)), 1, false); + TestUtils.AreEqual(float2(0f, 3.14159274f), atan2(float2(0f, 1f), float2(0f, float.NegativeInfinity)), 1, false); + TestUtils.AreEqual(float2(0f, -1.57079637f), atan2(float2(1f, float.NegativeInfinity), float2(float.PositiveInfinity, 1f)), 1, false); + TestUtils.AreEqual(float2(1.57079637f, TestUtils.SignedFloatQNaN()), atan2(float2(float.PositiveInfinity, 1f), float2(1f, TestUtils.SignedFloatQNaN())), 1, false); + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), atan2(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), float2(1f, TestUtils.SignedFloatQNaN())), 1, false); + } + + [TestCompiler] + public static void atan2_float3() + { + TestUtils.AreEqual(float3(0.9119903f, 2.22960234f, -0.9119903f), atan2(float3(3.1f, 3.1f, -3.1f), float3(2.4f, -2.4f, 2.4f)), 1, false); + TestUtils.AreEqual(float3(-2.22960234f, 0f, 3.14159274f), atan2(float3(-3.1f, 0f, 1f), float3(-2.4f, 0f, float.NegativeInfinity)), 1, false); + TestUtils.AreEqual(float3(0f, -1.57079637f, 1.57079637f), atan2(float3(1f, float.NegativeInfinity, float.PositiveInfinity), float3(float.PositiveInfinity, 1f, 1f)), 1, false); + TestUtils.AreEqual(float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), atan2(float3(1f, TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), float3(TestUtils.SignedFloatQNaN(), 1f, TestUtils.SignedFloatQNaN())), 1, false); + } + + [TestCompiler] + public static void atan2_float4() + { + TestUtils.AreEqual(float4(0.9119903f, 2.22960234f, -0.9119903f, -2.22960234f), atan2(float4(3.1f, 3.1f, -3.1f, -3.1f), float4(2.4f, -2.4f, 2.4f, -2.4f)), 1, false); + TestUtils.AreEqual(float4(0f, 3.14159274f, 0f, -1.57079637f), atan2(float4(0f, 1f, 1f, float.NegativeInfinity), float4(0f, float.NegativeInfinity, float.PositiveInfinity, 1f)), 1, false); + TestUtils.AreEqual(float4(1.57079637f, TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), atan2(float4(float.PositiveInfinity, 1f, TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), float4(1f, TestUtils.SignedFloatQNaN(), 1f, TestUtils.SignedFloatQNaN())), 1, false); + } + + [TestCompiler] + public static void atan2_double() + { + TestUtils.AreEqual(0.91199029067742043, atan2(3.1, 2.4), 32, false); + TestUtils.AreEqual(2.2296023629123729, atan2(3.1, -2.4), 32, false); + TestUtils.AreEqual(-0.91199029067742043, atan2(-3.1, 2.4), 32, false); + TestUtils.AreEqual(-2.2296023629123729, atan2(-3.1, -2.4), 32, false); + TestUtils.AreEqual(0.0, atan2(0.0, 0.0), 32, false); + TestUtils.AreEqual(3.1415926535897931, atan2(1.0, double.NegativeInfinity), 32, false); + TestUtils.AreEqual(0.0, atan2(1.0, double.PositiveInfinity), 32, false); + TestUtils.AreEqual(-1.5707963267948966, atan2(double.NegativeInfinity, 1.0), 32, false); + TestUtils.AreEqual(1.5707963267948966, atan2(double.PositiveInfinity, 1.0), 32, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), atan2(1.0, TestUtils.SignedDoubleQNaN()), 32, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), atan2(TestUtils.SignedDoubleQNaN(), 1.0), 32, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), atan2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), 32, false); + } + + [TestCompiler] + public static void atan2_double2() + { + TestUtils.AreEqual(double2(0.91199029067742043, 2.2296023629123729), atan2(double2(3.1, 3.1), double2(2.4, -2.4)), 32, false); + TestUtils.AreEqual(double2(-0.91199029067742043, -2.2296023629123729), atan2(double2(-3.1, -3.1), double2(2.4, -2.4)), 32, false); + TestUtils.AreEqual(double2(0.0, 3.1415926535897931), atan2(double2(0.0, 1.0), double2(0.0, double.NegativeInfinity)), 32, false); + TestUtils.AreEqual(double2(0.0, -1.5707963267948966), atan2(double2(1.0, double.NegativeInfinity), double2(double.PositiveInfinity, 1.0)), 32, false); + TestUtils.AreEqual(double2(1.5707963267948966, TestUtils.SignedDoubleQNaN()), atan2(double2(double.PositiveInfinity, 1.0), double2(1.0, TestUtils.SignedDoubleQNaN())), 32, false); + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), atan2(double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), double2(1.0, TestUtils.SignedDoubleQNaN())), 32, false); + } + + [TestCompiler] + public static void atan2_double3() + { + TestUtils.AreEqual(double3(0.91199029067742043, 2.2296023629123729, -0.91199029067742043), atan2(double3(3.1, 3.1, -3.1), double3(2.4, -2.4, 2.4)), 32, false); + TestUtils.AreEqual(double3(-2.2296023629123729, 0.0, 3.1415926535897931), atan2(double3(-3.1, 0.0, 1.0), double3(-2.4, 0.0, double.NegativeInfinity)), 32, false); + TestUtils.AreEqual(double3(0.0, -1.5707963267948966, 1.5707963267948966), atan2(double3(1.0, double.NegativeInfinity, double.PositiveInfinity), double3(double.PositiveInfinity, 1.0, 1.0)), 32, false); + TestUtils.AreEqual(double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), atan2(double3(1.0, TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), double3(TestUtils.SignedDoubleQNaN(), 1.0, TestUtils.SignedDoubleQNaN())), 32, false); + } + + [TestCompiler] + public static void atan2_double4() + { + TestUtils.AreEqual(double4(0.91199029067742043, 2.2296023629123729, -0.91199029067742043, -2.2296023629123729), atan2(double4(3.1, 3.1, -3.1, -3.1), double4(2.4, -2.4, 2.4, -2.4)), 32, false); + TestUtils.AreEqual(double4(0.0, 3.1415926535897931, 0.0, -1.5707963267948966), atan2(double4(0.0, 1.0, 1.0, double.NegativeInfinity), double4(0.0, double.NegativeInfinity, double.PositiveInfinity, 1.0)), 32, false); + TestUtils.AreEqual(double4(1.5707963267948966, TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), atan2(double4(double.PositiveInfinity, 1.0, TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), double4(1.0, TestUtils.SignedDoubleQNaN(), 1.0, TestUtils.SignedDoubleQNaN())), 32, false); + } + + [TestCompiler] + public static void sinh_float() + { + TestUtils.AreEqual(-3.62686038f, sinh(-2f), 1, false); + TestUtils.AreEqual(-1.5094614f, sinh(-1.2f), 1, false); + TestUtils.AreEqual(0f, sinh(0f), 1, false); + TestUtils.AreEqual(1.5094614f, sinh(1.2f), 1, false); + TestUtils.AreEqual(3.62686038f, sinh(2f), 1, false); + TestUtils.AreEqual(float.NegativeInfinity, sinh(float.NegativeInfinity), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), sinh(TestUtils.SignedFloatQNaN()), 1, false); + TestUtils.AreEqual(float.PositiveInfinity, sinh(float.PositiveInfinity), 1, false); + } + + [TestCompiler] + public static void sinh_float2() + { + TestUtils.AreEqual(float2(-3.62686038f, -1.5094614f), sinh(float2(-2f, -1.2f)), 1, false); + TestUtils.AreEqual(float2(0f, 1.5094614f), sinh(float2(0f, 1.2f)), 1, false); + TestUtils.AreEqual(float2(3.62686038f, float.NegativeInfinity), sinh(float2(2f, float.NegativeInfinity)), 1, false); + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), float.PositiveInfinity), sinh(float2(TestUtils.SignedFloatQNaN(), float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void sinh_float3() + { + TestUtils.AreEqual(float3(-3.62686038f, -1.5094614f, 0f), sinh(float3(-2f, -1.2f, 0f)), 1, false); + TestUtils.AreEqual(float3(1.5094614f, 3.62686038f, float.NegativeInfinity), sinh(float3(1.2f, 2f, float.NegativeInfinity)), 1, false); + TestUtils.AreEqual(float3(TestUtils.SignedFloatQNaN(), float.PositiveInfinity, float.PositiveInfinity), sinh(float3(TestUtils.SignedFloatQNaN(), float.PositiveInfinity, float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void sinh_float4() + { + TestUtils.AreEqual(float4(-3.62686038f, -1.5094614f, 0f, 1.5094614f), sinh(float4(-2f, -1.2f, 0f, 1.2f)), 1, false); + TestUtils.AreEqual(float4(3.62686038f, float.NegativeInfinity, TestUtils.SignedFloatQNaN(), float.PositiveInfinity), sinh(float4(2f, float.NegativeInfinity, TestUtils.SignedFloatQNaN(), float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void sinh_double() + { + TestUtils.AreEqual(-3.6268604078470181, sinh(-2.0), 32, false); + TestUtils.AreEqual(-1.509461355412173, sinh(-1.2), 32, false); + TestUtils.AreEqual(0.0, sinh(0.0), 32, false); + TestUtils.AreEqual(1.509461355412173, sinh(1.2), 32, false); + TestUtils.AreEqual(3.6268604078470181, sinh(2.0), 32, false); + TestUtils.AreEqual(double.NegativeInfinity, sinh(double.NegativeInfinity), 32, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), sinh(TestUtils.SignedDoubleQNaN()), 32, false); + TestUtils.AreEqual(double.PositiveInfinity, sinh(double.PositiveInfinity), 32, false); + } + + [TestCompiler] + public static void sinh_double2() + { + TestUtils.AreEqual(double2(-3.6268604078470181, -1.509461355412173), sinh(double2(-2.0, -1.2)), 32, false); + TestUtils.AreEqual(double2(0.0, 1.509461355412173), sinh(double2(0.0, 1.2)), 32, false); + TestUtils.AreEqual(double2(3.6268604078470181, double.NegativeInfinity), sinh(double2(2.0, double.NegativeInfinity)), 32, false); + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), double.PositiveInfinity), sinh(double2(TestUtils.SignedDoubleQNaN(), double.PositiveInfinity)), 32, false); + } + + [TestCompiler] + public static void sinh_double3() + { + TestUtils.AreEqual(double3(-3.6268604078470181, -1.509461355412173, 0.0), sinh(double3(-2.0, -1.2, 0.0)), 32, false); + TestUtils.AreEqual(double3(1.509461355412173, 3.6268604078470181, double.NegativeInfinity), sinh(double3(1.2, 2.0, double.NegativeInfinity)), 32, false); + TestUtils.AreEqual(double3(TestUtils.SignedDoubleQNaN(), double.PositiveInfinity, double.PositiveInfinity), sinh(double3(TestUtils.SignedDoubleQNaN(), double.PositiveInfinity, double.PositiveInfinity)), 32, false); + } + + [TestCompiler] + public static void sinh_double4() + { + TestUtils.AreEqual(double4(-3.6268604078470181, -1.509461355412173, 0.0, 1.509461355412173), sinh(double4(-2.0, -1.2, 0.0, 1.2)), 32, false); + TestUtils.AreEqual(double4(3.6268604078470181, double.NegativeInfinity, TestUtils.SignedDoubleQNaN(), double.PositiveInfinity), sinh(double4(2.0, double.NegativeInfinity, TestUtils.SignedDoubleQNaN(), double.PositiveInfinity)), 32, false); + } + + [TestCompiler] + public static void cosh_float() + { + TestUtils.AreEqual(3.76219559f, cosh(-2f), 1, false); + TestUtils.AreEqual(1.81065559f, cosh(-1.2f), 1, false); + TestUtils.AreEqual(1f, cosh(0f), 1, false); + TestUtils.AreEqual(1.81065559f, cosh(1.2f), 1, false); + TestUtils.AreEqual(3.76219559f, cosh(2f), 1, false); + TestUtils.AreEqual(float.PositiveInfinity, cosh(float.NegativeInfinity), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), cosh(TestUtils.SignedFloatQNaN()), 1, false); + TestUtils.AreEqual(float.PositiveInfinity, cosh(float.PositiveInfinity), 1, false); + } + + [TestCompiler] + public static void cosh_float2() + { + TestUtils.AreEqual(float2(3.76219559f, 1.81065559f), cosh(float2(-2f, -1.2f)), 1, false); + TestUtils.AreEqual(float2(1f, 1.81065559f), cosh(float2(0f, 1.2f)), 1, false); + TestUtils.AreEqual(float2(3.76219559f, float.PositiveInfinity), cosh(float2(2f, float.NegativeInfinity)), 1, false); + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), float.PositiveInfinity), cosh(float2(TestUtils.SignedFloatQNaN(), float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void cosh_float3() + { + TestUtils.AreEqual(float3(3.76219559f, 1.81065559f, 1f), cosh(float3(-2f, -1.2f, 0f)), 1, false); + TestUtils.AreEqual(float3(1.81065559f, 3.76219559f, float.PositiveInfinity), cosh(float3(1.2f, 2f, float.NegativeInfinity)), 1, false); + TestUtils.AreEqual(float3(TestUtils.SignedFloatQNaN(), float.PositiveInfinity, float.PositiveInfinity), cosh(float3(TestUtils.SignedFloatQNaN(), float.PositiveInfinity, float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void cosh_float4() + { + TestUtils.AreEqual(float4(3.76219559f, 1.81065559f, 1f, 1.81065559f), cosh(float4(-2f, -1.2f, 0f, 1.2f)), 1, false); + TestUtils.AreEqual(float4(3.76219559f, float.PositiveInfinity, TestUtils.SignedFloatQNaN(), float.PositiveInfinity), cosh(float4(2f, float.NegativeInfinity, TestUtils.SignedFloatQNaN(), float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void cosh_double() + { + TestUtils.AreEqual(3.7621956910836314, cosh(-2.0), 32, false); + TestUtils.AreEqual(1.81065556732437, cosh(-1.2), 32, false); + TestUtils.AreEqual(1.0, cosh(0.0), 32, false); + TestUtils.AreEqual(1.81065556732437, cosh(1.2), 32, false); + TestUtils.AreEqual(3.7621956910836314, cosh(2.0), 32, false); + TestUtils.AreEqual(double.PositiveInfinity, cosh(double.NegativeInfinity), 32, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), cosh(TestUtils.SignedDoubleQNaN()), 32, false); + TestUtils.AreEqual(double.PositiveInfinity, cosh(double.PositiveInfinity), 32, false); + } + + [TestCompiler] + public static void cosh_double2() + { + TestUtils.AreEqual(double2(3.7621956910836314, 1.81065556732437), cosh(double2(-2.0, -1.2)), 32, false); + TestUtils.AreEqual(double2(1.0, 1.81065556732437), cosh(double2(0.0, 1.2)), 32, false); + TestUtils.AreEqual(double2(3.7621956910836314, double.PositiveInfinity), cosh(double2(2.0, double.NegativeInfinity)), 32, false); + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), double.PositiveInfinity), cosh(double2(TestUtils.SignedDoubleQNaN(), double.PositiveInfinity)), 32, false); + } + + [TestCompiler] + public static void cosh_double3() + { + TestUtils.AreEqual(double3(3.7621956910836314, 1.81065556732437, 1.0), cosh(double3(-2.0, -1.2, 0.0)), 32, false); + TestUtils.AreEqual(double3(1.81065556732437, 3.7621956910836314, double.PositiveInfinity), cosh(double3(1.2, 2.0, double.NegativeInfinity)), 32, false); + TestUtils.AreEqual(double3(TestUtils.SignedDoubleQNaN(), double.PositiveInfinity, double.PositiveInfinity), cosh(double3(TestUtils.SignedDoubleQNaN(), double.PositiveInfinity, double.PositiveInfinity)), 32, false); + } + + [TestCompiler] + public static void cosh_double4() + { + TestUtils.AreEqual(double4(3.7621956910836314, 1.81065556732437, 1.0, 1.81065556732437), cosh(double4(-2.0, -1.2, 0.0, 1.2)), 32, false); + TestUtils.AreEqual(double4(3.7621956910836314, double.PositiveInfinity, TestUtils.SignedDoubleQNaN(), double.PositiveInfinity), cosh(double4(2.0, double.NegativeInfinity, TestUtils.SignedDoubleQNaN(), double.PositiveInfinity)), 32, false); + } + + [TestCompiler] + public static void tanh_float() + { + TestUtils.AreEqual(-0.9640276f, tanh(-2f), 1, false); + TestUtils.AreEqual(-0.8336546f, tanh(-1.2f), 1, false); + TestUtils.AreEqual(0f, tanh(0f), 1, false); + TestUtils.AreEqual(0.8336546f, tanh(1.2f), 1, false); + TestUtils.AreEqual(0.9640276f, tanh(2f), 1, false); + TestUtils.AreEqual(-1f, tanh(float.NegativeInfinity), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), tanh(TestUtils.SignedFloatQNaN()), 1, false); + TestUtils.AreEqual(1f, tanh(float.PositiveInfinity), 1, false); + } + + [TestCompiler] + public static void tanh_float2() + { + TestUtils.AreEqual(float2(-0.9640276f, -0.8336546f), tanh(float2(-2f, -1.2f)), 1, false); + TestUtils.AreEqual(float2(0f, 0.8336546f), tanh(float2(0f, 1.2f)), 1, false); + TestUtils.AreEqual(float2(0.9640276f, -1f), tanh(float2(2f, float.NegativeInfinity)), 1, false); + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), 1f), tanh(float2(TestUtils.SignedFloatQNaN(), float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void tanh_float3() + { + TestUtils.AreEqual(float3(-0.9640276f, -0.8336546f, 0f), tanh(float3(-2f, -1.2f, 0f)), 1, false); + TestUtils.AreEqual(float3(0.8336546f, 0.9640276f, -1f), tanh(float3(1.2f, 2f, float.NegativeInfinity)), 1, false); + TestUtils.AreEqual(float3(TestUtils.SignedFloatQNaN(), 1f, 1f), tanh(float3(TestUtils.SignedFloatQNaN(), float.PositiveInfinity, float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void tanh_float4() + { + TestUtils.AreEqual(float4(-0.9640276f, -0.8336546f, 0f, 0.8336546f), tanh(float4(-2f, -1.2f, 0f, 1.2f)), 1, false); + TestUtils.AreEqual(float4(0.9640276f, -1f, TestUtils.SignedFloatQNaN(), 1f), tanh(float4(2f, float.NegativeInfinity, TestUtils.SignedFloatQNaN(), float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void tanh_double() + { + TestUtils.AreEqual(-0.9640275800758169, tanh(-2.0), 32, false); + TestUtils.AreEqual(-0.83365460701215521, tanh(-1.2), 32, false); + TestUtils.AreEqual(0.0, tanh(0.0), 32, false); + TestUtils.AreEqual(0.83365460701215521, tanh(1.2), 32, false); + TestUtils.AreEqual(0.9640275800758169, tanh(2.0), 32, false); + TestUtils.AreEqual(-1.0, tanh(double.NegativeInfinity), 32, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), tanh(TestUtils.SignedDoubleQNaN()), 32, false); + TestUtils.AreEqual(1.0, tanh(double.PositiveInfinity), 32, false); + } + + [TestCompiler] + public static void tanh_double2() + { + TestUtils.AreEqual(double2(-0.9640275800758169, -0.83365460701215521), tanh(double2(-2.0, -1.2)), 32, false); + TestUtils.AreEqual(double2(0.0, 0.83365460701215521), tanh(double2(0.0, 1.2)), 32, false); + TestUtils.AreEqual(double2(0.9640275800758169, -1.0), tanh(double2(2.0, double.NegativeInfinity)), 32, false); + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), 1.0), tanh(double2(TestUtils.SignedDoubleQNaN(), double.PositiveInfinity)), 32, false); + } + + [TestCompiler] + public static void tanh_double3() + { + TestUtils.AreEqual(double3(-0.9640275800758169, -0.83365460701215521, 0.0), tanh(double3(-2.0, -1.2, 0.0)), 32, false); + TestUtils.AreEqual(double3(0.83365460701215521, 0.9640275800758169, -1.0), tanh(double3(1.2, 2.0, double.NegativeInfinity)), 32, false); + TestUtils.AreEqual(double3(TestUtils.SignedDoubleQNaN(), 1.0, 1.0), tanh(double3(TestUtils.SignedDoubleQNaN(), double.PositiveInfinity, double.PositiveInfinity)), 32, false); + } + + [TestCompiler] + public static void tanh_double4() + { + TestUtils.AreEqual(double4(-0.9640275800758169, -0.83365460701215521, 0.0, 0.83365460701215521), tanh(double4(-2.0, -1.2, 0.0, 1.2)), 32, false); + TestUtils.AreEqual(double4(0.9640275800758169, -1.0, TestUtils.SignedDoubleQNaN(), 1.0), tanh(double4(2.0, double.NegativeInfinity, TestUtils.SignedDoubleQNaN(), double.PositiveInfinity)), 32, false); + } + + [TestCompiler] + public static void exp_float() + { + TestUtils.AreEqual(4.539993E-05f, exp(-10f), 1, false); + TestUtils.AreEqual(0.301194221f, exp(-1.2f), 1, false); + TestUtils.AreEqual(1f, exp(0f), 1, false); + TestUtils.AreEqual(3.320117f, exp(1.2f), 1, false); + TestUtils.AreEqual(0f, exp(float.NegativeInfinity), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), exp(TestUtils.SignedFloatQNaN()), 1, false); + TestUtils.AreEqual(float.PositiveInfinity, exp(float.PositiveInfinity), 1, false); + } + + [TestCompiler] + public static void exp_float2() + { + TestUtils.AreEqual(float2(4.539993E-05f, 0.301194221f), exp(float2(-10f, -1.2f)), 1, false); + TestUtils.AreEqual(float2(1f, 3.320117f), exp(float2(0f, 1.2f)), 1, false); + TestUtils.AreEqual(float2(0f, TestUtils.SignedFloatQNaN()), exp(float2(float.NegativeInfinity, TestUtils.SignedFloatQNaN())), 1, false); + TestUtils.AreEqual(float2(float.PositiveInfinity, float.PositiveInfinity), exp(float2(float.PositiveInfinity, float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void exp_float3() + { + TestUtils.AreEqual(float3(4.539993E-05f, 0.301194221f, 1f), exp(float3(-10f, -1.2f, 0f)), 1, false); + TestUtils.AreEqual(float3(3.320117f, 0f, TestUtils.SignedFloatQNaN()), exp(float3(1.2f, float.NegativeInfinity, TestUtils.SignedFloatQNaN())), 1, false); + TestUtils.AreEqual(float3(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity), exp(float3(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void exp_float4() + { + TestUtils.AreEqual(float4(4.539993E-05f, 0.301194221f, 1f, 3.320117f), exp(float4(-10f, -1.2f, 0f, 1.2f)), 1, false); + TestUtils.AreEqual(float4(0f, TestUtils.SignedFloatQNaN(), float.PositiveInfinity, float.PositiveInfinity), exp(float4(float.NegativeInfinity, TestUtils.SignedFloatQNaN(), float.PositiveInfinity, float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void exp_double() + { + TestUtils.AreEqual(4.5399929762484847E-05, exp(-10.0), 32, false); + TestUtils.AreEqual(0.30119421191220208, exp(-1.2), 32, false); + TestUtils.AreEqual(1.0, exp(0.0), 32, false); + TestUtils.AreEqual(3.3201169227365477, exp(1.2), 32, false); + TestUtils.AreEqual(0.0, exp(double.NegativeInfinity), 32, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), exp(TestUtils.SignedDoubleQNaN()), 32, false); + TestUtils.AreEqual(double.PositiveInfinity, exp(double.PositiveInfinity), 32, false); + } + + [TestCompiler] + public static void exp_double2() + { + TestUtils.AreEqual(double2(4.5399929762484847E-05, 0.30119421191220208), exp(double2(-10.0, -1.2)), 32, false); + TestUtils.AreEqual(double2(1.0, 3.3201169227365477), exp(double2(0.0, 1.2)), 32, false); + TestUtils.AreEqual(double2(0.0, TestUtils.SignedDoubleQNaN()), exp(double2(double.NegativeInfinity, TestUtils.SignedDoubleQNaN())), 32, false); + TestUtils.AreEqual(double2(double.PositiveInfinity, double.PositiveInfinity), exp(double2(double.PositiveInfinity, double.PositiveInfinity)), 32, false); + } + + [TestCompiler] + public static void exp_double3() + { + TestUtils.AreEqual(double3(4.5399929762484847E-05, 0.30119421191220208, 1.0), exp(double3(-10.0, -1.2, 0.0)), 32, false); + TestUtils.AreEqual(double3(3.3201169227365477, 0.0, TestUtils.SignedDoubleQNaN()), exp(double3(1.2, double.NegativeInfinity, TestUtils.SignedDoubleQNaN())), 32, false); + TestUtils.AreEqual(double3(double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity), exp(double3(double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity)), 32, false); + } + + [TestCompiler] + public static void exp_double4() + { + TestUtils.AreEqual(double4(4.5399929762484847E-05, 0.30119421191220208, 1.0, 3.3201169227365477), exp(double4(-10.0, -1.2, 0.0, 1.2)), 32, false); + TestUtils.AreEqual(double4(0.0, TestUtils.SignedDoubleQNaN(), double.PositiveInfinity, double.PositiveInfinity), exp(double4(double.NegativeInfinity, TestUtils.SignedDoubleQNaN(), double.PositiveInfinity, double.PositiveInfinity)), 32, false); + } + + [TestCompiler] + public static void exp2_float() + { + TestUtils.AreEqual(0.0009765625f, exp2(-10f), 1, false); + TestUtils.AreEqual(0.4352753f, exp2(-1.2f), 1, false); + TestUtils.AreEqual(1f, exp2(0f), 1, false); + TestUtils.AreEqual(2.29739666f, exp2(1.2f), 1, false); + TestUtils.AreEqual(0f, exp2(float.NegativeInfinity), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), exp2(TestUtils.SignedFloatQNaN()), 1, false); + TestUtils.AreEqual(float.PositiveInfinity, exp2(float.PositiveInfinity), 1, false); + } + + [TestCompiler] + public static void exp2_float2() + { + TestUtils.AreEqual(float2(0.0009765625f, 0.4352753f), exp2(float2(-10f, -1.2f)), 1, false); + TestUtils.AreEqual(float2(1f, 2.29739666f), exp2(float2(0f, 1.2f)), 1, false); + TestUtils.AreEqual(float2(0f, TestUtils.SignedFloatQNaN()), exp2(float2(float.NegativeInfinity, TestUtils.SignedFloatQNaN())), 1, false); + TestUtils.AreEqual(float2(float.PositiveInfinity, float.PositiveInfinity), exp2(float2(float.PositiveInfinity, float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void exp2_float3() + { + TestUtils.AreEqual(float3(0.0009765625f, 0.4352753f, 1f), exp2(float3(-10f, -1.2f, 0f)), 1, false); + TestUtils.AreEqual(float3(2.29739666f, 0f, TestUtils.SignedFloatQNaN()), exp2(float3(1.2f, float.NegativeInfinity, TestUtils.SignedFloatQNaN())), 1, false); + TestUtils.AreEqual(float3(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity), exp2(float3(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void exp2_float4() + { + TestUtils.AreEqual(float4(0.0009765625f, 0.4352753f, 1f, 2.29739666f), exp2(float4(-10f, -1.2f, 0f, 1.2f)), 1, false); + TestUtils.AreEqual(float4(0f, TestUtils.SignedFloatQNaN(), float.PositiveInfinity, float.PositiveInfinity), exp2(float4(float.NegativeInfinity, TestUtils.SignedFloatQNaN(), float.PositiveInfinity, float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void exp2_double() + { + TestUtils.AreEqual(0.0009765625, exp2(-10.0), 32, false); + TestUtils.AreEqual(0.435275281648062, exp2(-1.2), 32, false); + TestUtils.AreEqual(1.0, exp2(0.0), 32, false); + TestUtils.AreEqual(2.29739670999407, exp2(1.2), 32, false); + TestUtils.AreEqual(0.0, exp2(double.NegativeInfinity), 32, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), exp2(TestUtils.SignedDoubleQNaN()), 32, false); + TestUtils.AreEqual(double.PositiveInfinity, exp2(double.PositiveInfinity), 32, false); + } + + [TestCompiler] + public static void exp2_double2() + { + TestUtils.AreEqual(double2(0.0009765625, 0.435275281648062), exp2(double2(-10.0, -1.2)), 32, false); + TestUtils.AreEqual(double2(1.0, 2.29739670999407), exp2(double2(0.0, 1.2)), 32, false); + TestUtils.AreEqual(double2(0.0, TestUtils.SignedDoubleQNaN()), exp2(double2(double.NegativeInfinity, TestUtils.SignedDoubleQNaN())), 32, false); + TestUtils.AreEqual(double2(double.PositiveInfinity, double.PositiveInfinity), exp2(double2(double.PositiveInfinity, double.PositiveInfinity)), 32, false); + } + + [TestCompiler] + public static void exp2_double3() + { + TestUtils.AreEqual(double3(0.0009765625, 0.435275281648062, 1.0), exp2(double3(-10.0, -1.2, 0.0)), 32, false); + TestUtils.AreEqual(double3(2.29739670999407, 0.0, TestUtils.SignedDoubleQNaN()), exp2(double3(1.2, double.NegativeInfinity, TestUtils.SignedDoubleQNaN())), 32, false); + TestUtils.AreEqual(double3(double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity), exp2(double3(double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity)), 32, false); + } + + [TestCompiler] + public static void exp2_double4() + { + TestUtils.AreEqual(double4(0.0009765625, 0.435275281648062, 1.0, 2.29739670999407), exp2(double4(-10.0, -1.2, 0.0, 1.2)), 32, false); + TestUtils.AreEqual(double4(0.0, TestUtils.SignedDoubleQNaN(), double.PositiveInfinity, double.PositiveInfinity), exp2(double4(double.NegativeInfinity, TestUtils.SignedDoubleQNaN(), double.PositiveInfinity, double.PositiveInfinity)), 32, false); + } + + [TestCompiler] + public static void exp10_float() + { + TestUtils.AreEqual(1E-10f, exp10(-10f), 32, false); + TestUtils.AreEqual(0.06309573f, exp10(-1.2f), 32, false); + TestUtils.AreEqual(1f, exp10(0f), 32, false); + TestUtils.AreEqual(15.8489323f, exp10(1.2f), 32, false); + TestUtils.AreEqual(0f, exp10(float.NegativeInfinity), 32, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), exp10(TestUtils.SignedFloatQNaN()), 32, false); + TestUtils.AreEqual(float.PositiveInfinity, exp10(float.PositiveInfinity), 32, false); + } + + [TestCompiler] + public static void exp10_float2() + { + TestUtils.AreEqual(float2(1E-10f, 0.06309573f), exp10(float2(-10f, -1.2f)), 32, false); + TestUtils.AreEqual(float2(1f, 15.8489323f), exp10(float2(0f, 1.2f)), 32, false); + TestUtils.AreEqual(float2(0f, TestUtils.SignedFloatQNaN()), exp10(float2(float.NegativeInfinity, TestUtils.SignedFloatQNaN())), 32, false); + TestUtils.AreEqual(float2(float.PositiveInfinity, float.PositiveInfinity), exp10(float2(float.PositiveInfinity, float.PositiveInfinity)), 32, false); + } + + [TestCompiler] + public static void exp10_float3() + { + TestUtils.AreEqual(float3(1E-10f, 0.06309573f, 1f), exp10(float3(-10f, -1.2f, 0f)), 32, false); + TestUtils.AreEqual(float3(15.8489323f, 0f, TestUtils.SignedFloatQNaN()), exp10(float3(1.2f, float.NegativeInfinity, TestUtils.SignedFloatQNaN())), 32, false); + TestUtils.AreEqual(float3(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity), exp10(float3(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity)), 32, false); + } + + [TestCompiler] + public static void exp10_float4() + { + TestUtils.AreEqual(float4(1E-10f, 0.06309573f, 1f, 15.8489323f), exp10(float4(-10f, -1.2f, 0f, 1.2f)), 32, false); + TestUtils.AreEqual(float4(0f, TestUtils.SignedFloatQNaN(), float.PositiveInfinity, float.PositiveInfinity), exp10(float4(float.NegativeInfinity, TestUtils.SignedFloatQNaN(), float.PositiveInfinity, float.PositiveInfinity)), 32, false); + } + + [TestCompiler] + public static void exp10_double() + { + TestUtils.AreEqual(1E-10, exp10(-10.0), 32, false); + TestUtils.AreEqual(0.063095734448019331, exp10(-1.2), 32, false); + TestUtils.AreEqual(1.0, exp10(0.0), 32, false); + TestUtils.AreEqual(15.848931924611135, exp10(1.2), 32, false); + TestUtils.AreEqual(0.0, exp10(double.NegativeInfinity), 32, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), exp10(TestUtils.SignedDoubleQNaN()), 32, false); + TestUtils.AreEqual(double.PositiveInfinity, exp10(double.PositiveInfinity), 32, false); + } + + [TestCompiler] + public static void exp10_double2() + { + TestUtils.AreEqual(double2(1E-10, 0.063095734448019331), exp10(double2(-10.0, -1.2)), 32, false); + TestUtils.AreEqual(double2(1.0, 15.848931924611135), exp10(double2(0.0, 1.2)), 32, false); + TestUtils.AreEqual(double2(0.0, TestUtils.SignedDoubleQNaN()), exp10(double2(double.NegativeInfinity, TestUtils.SignedDoubleQNaN())), 32, false); + TestUtils.AreEqual(double2(double.PositiveInfinity, double.PositiveInfinity), exp10(double2(double.PositiveInfinity, double.PositiveInfinity)), 32, false); + } + + [TestCompiler] + public static void exp10_double3() + { + TestUtils.AreEqual(double3(1E-10, 0.063095734448019331, 1.0), exp10(double3(-10.0, -1.2, 0.0)), 32, false); + TestUtils.AreEqual(double3(15.848931924611135, 0.0, TestUtils.SignedDoubleQNaN()), exp10(double3(1.2, double.NegativeInfinity, TestUtils.SignedDoubleQNaN())), 32, false); + TestUtils.AreEqual(double3(double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity), exp10(double3(double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity)), 32, false); + } + + [TestCompiler] + public static void exp10_double4() + { + TestUtils.AreEqual(double4(1E-10, 0.063095734448019331, 1.0, 15.848931924611135), exp10(double4(-10.0, -1.2, 0.0, 1.2)), 32, false); + TestUtils.AreEqual(double4(0.0, TestUtils.SignedDoubleQNaN(), double.PositiveInfinity, double.PositiveInfinity), exp10(double4(double.NegativeInfinity, TestUtils.SignedDoubleQNaN(), double.PositiveInfinity, double.PositiveInfinity)), 32, false); + } + + [TestCompiler] + public static void log_float() + { + TestUtils.AreEqual(-20.5409451f, log(1.2E-09f), 1, false); + TestUtils.AreEqual(0f, log(1f), 1, false); + TestUtils.AreEqual(23.2081718f, log(1.2E+10f), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), log(-1f), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), log(float.NegativeInfinity), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), log(TestUtils.SignedFloatQNaN()), 1, false); + TestUtils.AreEqual(float.PositiveInfinity, log(float.PositiveInfinity), 1, false); + } + + [TestCompiler] + public static void log_float2() + { + TestUtils.AreEqual(float2(-20.5409451f, 0f), log(float2(1.2E-09f, 1f)), 1, false); + TestUtils.AreEqual(float2(23.2081718f, TestUtils.SignedFloatQNaN()), log(float2(1.2E+10f, -1f)), 1, false); + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), log(float2(float.NegativeInfinity, TestUtils.SignedFloatQNaN())), 1, false); + TestUtils.AreEqual(float2(float.PositiveInfinity, float.PositiveInfinity), log(float2(float.PositiveInfinity, float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void log_float3() + { + TestUtils.AreEqual(float3(-20.5409451f, 0f, 23.2081718f), log(float3(1.2E-09f, 1f, 1.2E+10f)), 1, false); + TestUtils.AreEqual(float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), log(float3(-1f, float.NegativeInfinity, TestUtils.SignedFloatQNaN())), 1, false); + TestUtils.AreEqual(float3(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity), log(float3(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void log_float4() + { + TestUtils.AreEqual(float4(-20.5409451f, 0f, 23.2081718f, TestUtils.SignedFloatQNaN()), log(float4(1.2E-09f, 1f, 1.2E+10f, -1f)), 1, false); + TestUtils.AreEqual(float4(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), float.PositiveInfinity, float.PositiveInfinity), log(float4(float.NegativeInfinity, TestUtils.SignedFloatQNaN(), float.PositiveInfinity, float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void log_double() + { + TestUtils.AreEqual(-20.540944280152456, log(1.2E-09), 32, false); + TestUtils.AreEqual(0.0, log(1.0), 32, false); + TestUtils.AreEqual(23.208172486734409, log(12000000000.0), 32, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), log(-1.0), 32, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), log(double.NegativeInfinity), 32, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), log(TestUtils.SignedDoubleQNaN()), 32, false); + TestUtils.AreEqual(double.PositiveInfinity, log(double.PositiveInfinity), 32, false); + } + + [TestCompiler] + public static void log_double2() + { + TestUtils.AreEqual(double2(-20.540944280152456, 0.0), log(double2(1.2E-09, 1.0)), 32, false); + TestUtils.AreEqual(double2(23.208172486734409, TestUtils.SignedDoubleQNaN()), log(double2(12000000000.0, -1.0)), 32, false); + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), log(double2(double.NegativeInfinity, TestUtils.SignedDoubleQNaN())), 32, false); + TestUtils.AreEqual(double2(double.PositiveInfinity, double.PositiveInfinity), log(double2(double.PositiveInfinity, double.PositiveInfinity)), 32, false); + } + + [TestCompiler] + public static void log_double3() + { + TestUtils.AreEqual(double3(-20.540944280152456, 0.0, 23.208172486734409), log(double3(1.2E-09, 1.0, 12000000000.0)), 32, false); + TestUtils.AreEqual(double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), log(double3(-1.0, double.NegativeInfinity, TestUtils.SignedDoubleQNaN())), 32, false); + TestUtils.AreEqual(double3(double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity), log(double3(double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity)), 32, false); + } + + [TestCompiler] + public static void log_double4() + { + TestUtils.AreEqual(double4(-20.540944280152456, 0.0, 23.208172486734409, TestUtils.SignedDoubleQNaN()), log(double4(1.2E-09, 1.0, 12000000000.0, -1.0)), 32, false); + TestUtils.AreEqual(double4(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), double.PositiveInfinity, double.PositiveInfinity), log(double4(double.NegativeInfinity, TestUtils.SignedDoubleQNaN(), double.PositiveInfinity, double.PositiveInfinity)), 32, false); + } + + [TestCompiler] + public static void log2_float() + { + TestUtils.AreEqual(-29.63432f, log2(1.2E-09f), 1, false); + TestUtils.AreEqual(0f, log2(1f), 1, false); + TestUtils.AreEqual(33.4823151f, log2(1.2E+10f), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), log2(-1f), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), log2(float.NegativeInfinity), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), log2(TestUtils.SignedFloatQNaN()), 1, false); + TestUtils.AreEqual(float.PositiveInfinity, log2(float.PositiveInfinity), 1, false); + } + + [TestCompiler] + public static void log2_float2() + { + TestUtils.AreEqual(float2(-29.63432f, 0f), log2(float2(1.2E-09f, 1f)), 1, false); + TestUtils.AreEqual(float2(33.4823151f, TestUtils.SignedFloatQNaN()), log2(float2(1.2E+10f, -1f)), 1, false); + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), log2(float2(float.NegativeInfinity, TestUtils.SignedFloatQNaN())), 1, false); + TestUtils.AreEqual(float2(float.PositiveInfinity, float.PositiveInfinity), log2(float2(float.PositiveInfinity, float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void log2_float3() + { + TestUtils.AreEqual(float3(-29.63432f, 0f, 33.4823151f), log2(float3(1.2E-09f, 1f, 1.2E+10f)), 1, false); + TestUtils.AreEqual(float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), log2(float3(-1f, float.NegativeInfinity, TestUtils.SignedFloatQNaN())), 1, false); + TestUtils.AreEqual(float3(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity), log2(float3(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void log2_float4() + { + TestUtils.AreEqual(float4(-29.63432f, 0f, 33.4823151f, TestUtils.SignedFloatQNaN()), log2(float4(1.2E-09f, 1f, 1.2E+10f, -1f)), 1, false); + TestUtils.AreEqual(float4(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), float.PositiveInfinity, float.PositiveInfinity), log2(float4(float.NegativeInfinity, TestUtils.SignedFloatQNaN(), float.PositiveInfinity, float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void log2_double() + { + TestUtils.AreEqual(-29.634318448152467, log2(1.2E-09), 32, false); + TestUtils.AreEqual(0.0, log2(1.0), 32, false); + TestUtils.AreEqual(33.482315354707417, log2(12000000000.0), 32, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), log2(-1.0), 32, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), log2(double.NegativeInfinity), 32, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), log2(TestUtils.SignedDoubleQNaN()), 32, false); + TestUtils.AreEqual(double.PositiveInfinity, log2(double.PositiveInfinity), 32, false); + } + + [TestCompiler] + public static void log2_double2() + { + TestUtils.AreEqual(double2(-29.634318448152467, 0.0), log2(double2(1.2E-09, 1.0)), 32, false); + TestUtils.AreEqual(double2(33.482315354707417, TestUtils.SignedDoubleQNaN()), log2(double2(12000000000.0, -1.0)), 32, false); + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), log2(double2(double.NegativeInfinity, TestUtils.SignedDoubleQNaN())), 32, false); + TestUtils.AreEqual(double2(double.PositiveInfinity, double.PositiveInfinity), log2(double2(double.PositiveInfinity, double.PositiveInfinity)), 32, false); + } + + [TestCompiler] + public static void log2_double3() + { + TestUtils.AreEqual(double3(-29.634318448152467, 0.0, 33.482315354707417), log2(double3(1.2E-09, 1.0, 12000000000.0)), 32, false); + TestUtils.AreEqual(double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), log2(double3(-1.0, double.NegativeInfinity, TestUtils.SignedDoubleQNaN())), 32, false); + TestUtils.AreEqual(double3(double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity), log2(double3(double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity)), 32, false); + } + + [TestCompiler] + public static void log2_double4() + { + TestUtils.AreEqual(double4(-29.634318448152467, 0.0, 33.482315354707417, TestUtils.SignedDoubleQNaN()), log2(double4(1.2E-09, 1.0, 12000000000.0, -1.0)), 32, false); + TestUtils.AreEqual(double4(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), double.PositiveInfinity, double.PositiveInfinity), log2(double4(double.NegativeInfinity, TestUtils.SignedDoubleQNaN(), double.PositiveInfinity, double.PositiveInfinity)), 32, false); + } + + [TestCompiler] + public static void log10_float() + { + TestUtils.AreEqual(-8.920818f, log10(1.2E-09f), 1, false); + TestUtils.AreEqual(0f, log10(1f), 1, false); + TestUtils.AreEqual(10.0791817f, log10(1.2E+10f), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), log10(-1f), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), log10(float.NegativeInfinity), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), log10(TestUtils.SignedFloatQNaN()), 1, false); + TestUtils.AreEqual(float.PositiveInfinity, log10(float.PositiveInfinity), 1, false); + } + + [TestCompiler] + public static void log10_float2() + { + TestUtils.AreEqual(float2(-8.920818f, 0f), log10(float2(1.2E-09f, 1f)), 1, false); + TestUtils.AreEqual(float2(10.0791817f, TestUtils.SignedFloatQNaN()), log10(float2(1.2E+10f, -1f)), 1, false); + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), log10(float2(float.NegativeInfinity, TestUtils.SignedFloatQNaN())), 1, false); + TestUtils.AreEqual(float2(float.PositiveInfinity, float.PositiveInfinity), log10(float2(float.PositiveInfinity, float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void log10_float3() + { + TestUtils.AreEqual(float3(-8.920818f, 0f, 10.0791817f), log10(float3(1.2E-09f, 1f, 1.2E+10f)), 1, false); + TestUtils.AreEqual(float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), log10(float3(-1f, float.NegativeInfinity, TestUtils.SignedFloatQNaN())), 1, false); + TestUtils.AreEqual(float3(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity), log10(float3(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void log10_float4() + { + TestUtils.AreEqual(float4(-8.920818f, 0f, 10.0791817f, TestUtils.SignedFloatQNaN()), log10(float4(1.2E-09f, 1f, 1.2E+10f, -1f)), 1, false); + TestUtils.AreEqual(float4(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), float.PositiveInfinity, float.PositiveInfinity), log10(float4(float.NegativeInfinity, TestUtils.SignedFloatQNaN(), float.PositiveInfinity, float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void log10_double() + { + TestUtils.AreEqual(-8.9208187539523749, log10(1.2E-09), 32, false); + TestUtils.AreEqual(0.0, log10(1.0), 32, false); + TestUtils.AreEqual(10.079181246047623, log10(12000000000.0), 32, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), log10(-1.0), 32, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), log10(double.NegativeInfinity), 32, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), log10(TestUtils.SignedDoubleQNaN()), 32, false); + TestUtils.AreEqual(double.PositiveInfinity, log10(double.PositiveInfinity), 32, false); + } + + [TestCompiler] + public static void log10_double2() + { + TestUtils.AreEqual(double2(-8.9208187539523749, 0.0), log10(double2(1.2E-09, 1.0)), 32, false); + TestUtils.AreEqual(double2(10.079181246047623, TestUtils.SignedDoubleQNaN()), log10(double2(12000000000.0, -1.0)), 32, false); + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), log10(double2(double.NegativeInfinity, TestUtils.SignedDoubleQNaN())), 32, false); + TestUtils.AreEqual(double2(double.PositiveInfinity, double.PositiveInfinity), log10(double2(double.PositiveInfinity, double.PositiveInfinity)), 32, false); + } + + [TestCompiler] + public static void log10_double3() + { + TestUtils.AreEqual(double3(-8.9208187539523749, 0.0, 10.079181246047623), log10(double3(1.2E-09, 1.0, 12000000000.0)), 32, false); + TestUtils.AreEqual(double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), log10(double3(-1.0, double.NegativeInfinity, TestUtils.SignedDoubleQNaN())), 32, false); + TestUtils.AreEqual(double3(double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity), log10(double3(double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity)), 32, false); + } + + [TestCompiler] + public static void log10_double4() + { + TestUtils.AreEqual(double4(-8.9208187539523749, 0.0, 10.079181246047623, TestUtils.SignedDoubleQNaN()), log10(double4(1.2E-09, 1.0, 12000000000.0, -1.0)), 32, false); + TestUtils.AreEqual(double4(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), double.PositiveInfinity, double.PositiveInfinity), log10(double4(double.NegativeInfinity, TestUtils.SignedDoubleQNaN(), double.PositiveInfinity, double.PositiveInfinity)), 32, false); + } + + [TestCompiler] + public static void radians_float() + { + TestUtils.AreEqual(-2.154609f, radians(-123.45f), 1, false); + TestUtils.AreEqual(0f, radians(0f), 1, false); + TestUtils.AreEqual(2.154609f, radians(123.45f), 1, false); + TestUtils.AreEqual(float.NegativeInfinity, radians(float.NegativeInfinity), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), radians(TestUtils.SignedFloatQNaN()), 1, false); + TestUtils.AreEqual(float.PositiveInfinity, radians(float.PositiveInfinity), 1, false); + } + + [TestCompiler] + public static void radians_float2() + { + TestUtils.AreEqual(float2(-2.154609f, 0f), radians(float2(-123.45f, 0f)), 1, false); + TestUtils.AreEqual(float2(2.154609f, float.NegativeInfinity), radians(float2(123.45f, float.NegativeInfinity)), 1, false); + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), float.PositiveInfinity), radians(float2(TestUtils.SignedFloatQNaN(), float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void radians_float3() + { + TestUtils.AreEqual(float3(-2.154609f, 0f, 2.154609f), radians(float3(-123.45f, 0f, 123.45f)), 1, false); + TestUtils.AreEqual(float3(float.NegativeInfinity, TestUtils.SignedFloatQNaN(), float.PositiveInfinity), radians(float3(float.NegativeInfinity, TestUtils.SignedFloatQNaN(), float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void radians_float4() + { + TestUtils.AreEqual(float4(-2.154609f, 0f, 2.154609f, float.NegativeInfinity), radians(float4(-123.45f, 0f, 123.45f, float.NegativeInfinity)), 1, false); + TestUtils.AreEqual(float4(TestUtils.SignedFloatQNaN(), float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity), radians(float4(TestUtils.SignedFloatQNaN(), float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void radians_double() + { + TestUtils.AreEqual(-2.154608961587, radians(-123.45), 1, false); + TestUtils.AreEqual(0.0, radians(0.0), 1, false); + TestUtils.AreEqual(2.154608961587, radians(123.45), 1, false); + TestUtils.AreEqual(double.NegativeInfinity, radians(double.NegativeInfinity), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), radians(TestUtils.SignedDoubleQNaN()), 1, false); + TestUtils.AreEqual(double.PositiveInfinity, radians(double.PositiveInfinity), 1, false); + } + + [TestCompiler] + public static void radians_double2() + { + TestUtils.AreEqual(double2(-2.154608961587, 0.0), radians(double2(-123.45, 0.0)), 1, false); + TestUtils.AreEqual(double2(2.154608961587, double.NegativeInfinity), radians(double2(123.45, double.NegativeInfinity)), 1, false); + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), double.PositiveInfinity), radians(double2(TestUtils.SignedDoubleQNaN(), double.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void radians_double3() + { + TestUtils.AreEqual(double3(-2.154608961587, 0.0, 2.154608961587), radians(double3(-123.45, 0.0, 123.45)), 1, false); + TestUtils.AreEqual(double3(double.NegativeInfinity, TestUtils.SignedDoubleQNaN(), double.PositiveInfinity), radians(double3(double.NegativeInfinity, TestUtils.SignedDoubleQNaN(), double.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void radians_double4() + { + TestUtils.AreEqual(double4(-2.154608961587, 0.0, 2.154608961587, double.NegativeInfinity), radians(double4(-123.45, 0.0, 123.45, double.NegativeInfinity)), 1, false); + TestUtils.AreEqual(double4(TestUtils.SignedDoubleQNaN(), double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity), radians(double4(TestUtils.SignedDoubleQNaN(), double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void degrees_float() + { + TestUtils.AreEqual(-7073.164f, degrees(-123.45f), 1, false); + TestUtils.AreEqual(0f, degrees(0f), 1, false); + TestUtils.AreEqual(7073.164f, degrees(123.45f), 1, false); + TestUtils.AreEqual(float.NegativeInfinity, degrees(float.NegativeInfinity), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), degrees(TestUtils.SignedFloatQNaN()), 1, false); + TestUtils.AreEqual(float.PositiveInfinity, degrees(float.PositiveInfinity), 1, false); + } + + [TestCompiler] + public static void degrees_float2() + { + TestUtils.AreEqual(float2(-7073.164f, 0f), degrees(float2(-123.45f, 0f)), 1, false); + TestUtils.AreEqual(float2(7073.164f, float.NegativeInfinity), degrees(float2(123.45f, float.NegativeInfinity)), 1, false); + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), float.PositiveInfinity), degrees(float2(TestUtils.SignedFloatQNaN(), float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void degrees_float3() + { + TestUtils.AreEqual(float3(-7073.164f, 0f, 7073.164f), degrees(float3(-123.45f, 0f, 123.45f)), 1, false); + TestUtils.AreEqual(float3(float.NegativeInfinity, TestUtils.SignedFloatQNaN(), float.PositiveInfinity), degrees(float3(float.NegativeInfinity, TestUtils.SignedFloatQNaN(), float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void degrees_float4() + { + TestUtils.AreEqual(float4(-7073.164f, 0f, 7073.164f, float.NegativeInfinity), degrees(float4(-123.45f, 0f, 123.45f, float.NegativeInfinity)), 1, false); + TestUtils.AreEqual(float4(TestUtils.SignedFloatQNaN(), float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity), degrees(float4(TestUtils.SignedFloatQNaN(), float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void degrees_double() + { + TestUtils.AreEqual(-7073.1639808900127, degrees(-123.45), 1, false); + TestUtils.AreEqual(0.0, degrees(0.0), 1, false); + TestUtils.AreEqual(7073.1639808900127, degrees(123.45), 1, false); + TestUtils.AreEqual(double.NegativeInfinity, degrees(double.NegativeInfinity), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), degrees(TestUtils.SignedDoubleQNaN()), 1, false); + TestUtils.AreEqual(double.PositiveInfinity, degrees(double.PositiveInfinity), 1, false); + } + + [TestCompiler] + public static void degrees_double2() + { + TestUtils.AreEqual(double2(-7073.1639808900127, 0.0), degrees(double2(-123.45, 0.0)), 1, false); + TestUtils.AreEqual(double2(7073.1639808900127, double.NegativeInfinity), degrees(double2(123.45, double.NegativeInfinity)), 1, false); + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), double.PositiveInfinity), degrees(double2(TestUtils.SignedDoubleQNaN(), double.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void degrees_double3() + { + TestUtils.AreEqual(double3(-7073.1639808900127, 0.0, 7073.1639808900127), degrees(double3(-123.45, 0.0, 123.45)), 1, false); + TestUtils.AreEqual(double3(double.NegativeInfinity, TestUtils.SignedDoubleQNaN(), double.PositiveInfinity), degrees(double3(double.NegativeInfinity, TestUtils.SignedDoubleQNaN(), double.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void degrees_double4() + { + TestUtils.AreEqual(double4(-7073.1639808900127, 0.0, 7073.1639808900127, double.NegativeInfinity), degrees(double4(-123.45, 0.0, 123.45, double.NegativeInfinity)), 1, false); + TestUtils.AreEqual(double4(TestUtils.SignedDoubleQNaN(), double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity), degrees(double4(TestUtils.SignedDoubleQNaN(), double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void sign_int() + { + TestUtils.AreEqual(-1, sign(-156)); + TestUtils.AreEqual(-1, sign(-214748346)); + TestUtils.AreEqual(0, sign(0)); + TestUtils.AreEqual(1, sign(214748346)); + TestUtils.AreEqual(1, sign(1537)); + TestUtils.AreEqual(1, sign(17)); + TestUtils.AreEqual(-1, sign(-39)); + TestUtils.AreEqual(0, sign(0)); + TestUtils.AreEqual(-1, sign(-15379)); + TestUtils.AreEqual(1, sign(64583)); + TestUtils.AreEqual(1, sign(2147483647)); + TestUtils.AreEqual(-1, sign(-2147483648)); + } + + [TestCompiler] + public static void sign_int2() + { + TestUtils.AreEqual(int2(-1, -1), sign(int2(-156, -214748346))); + TestUtils.AreEqual(int2(0, 1), sign(int2(0, 214748346))); + TestUtils.AreEqual(int2(1, 1), sign(int2(1537, 17))); + TestUtils.AreEqual(int2(-1, 0), sign(int2(-39, 0))); + TestUtils.AreEqual(int2(-1, 1), sign(int2(-15379, 64583))); + TestUtils.AreEqual(int2(1, -1), sign(int2(2147483647, -2147483648))); + } + + [TestCompiler] + public static void sign_int3() + { + TestUtils.AreEqual(int3(-1, -1, 0), sign(int3(-156, -214748346, 0))); + TestUtils.AreEqual(int3(1, 1, 1), sign(int3(214748346, 1537, 17))); + TestUtils.AreEqual(int3(-1, 0, -1), sign(int3(-39, 0, -15379))); + TestUtils.AreEqual(int3(1, 1, -1), sign(int3(64583, 2147483647, -2147483648))); + } + + [TestCompiler] + public static void sign_int4() + { + TestUtils.AreEqual(int4(-1, -1, 0, 1), sign(int4(-156, -214748346, 0, 214748346))); + TestUtils.AreEqual(int4(1, 1, -1, 0), sign(int4(1537, 17, -39, 0))); + TestUtils.AreEqual(int4(-1, 1, 1, -1), sign(int4(-15379, 64583, 2147483647, -2147483648))); + } + + [TestCompiler] + public static void sign_float() + { + TestUtils.AreEqual(-1f, sign(-123.45f)); + TestUtils.AreEqual(-1f, sign(-1E-20f)); + TestUtils.AreEqual(0f, sign(0f)); + TestUtils.AreEqual(1f, sign(1E-10f)); + TestUtils.AreEqual(1f, sign(123.45f)); + TestUtils.AreEqual(-1f, sign(float.NegativeInfinity)); + TestUtils.AreEqual(0f, sign(TestUtils.SignedFloatQNaN())); + TestUtils.AreEqual(1f, sign(float.PositiveInfinity)); + } + + [TestCompiler] + public static void sign_float2() + { + TestUtils.AreEqual(float2(-1f, -1f), sign(float2(-123.45f, -1E-20f))); + TestUtils.AreEqual(float2(0f, 1f), sign(float2(0f, 1E-10f))); + TestUtils.AreEqual(float2(1f, -1f), sign(float2(123.45f, float.NegativeInfinity))); + TestUtils.AreEqual(float2(0f, 1f), sign(float2(TestUtils.SignedFloatQNaN(), float.PositiveInfinity))); + } + + [TestCompiler] + public static void sign_float3() + { + TestUtils.AreEqual(float3(-1f, -1f, 0f), sign(float3(-123.45f, -1E-20f, 0f))); + TestUtils.AreEqual(float3(1f, 1f, -1f), sign(float3(1E-10f, 123.45f, float.NegativeInfinity))); + TestUtils.AreEqual(float3(0f, 1f, 1f), sign(float3(TestUtils.SignedFloatQNaN(), float.PositiveInfinity, float.PositiveInfinity))); + } + + [TestCompiler] + public static void sign_float4() + { + TestUtils.AreEqual(float4(-1f, -1f, 0f, 1f), sign(float4(-123.45f, -1E-20f, 0f, 1E-10f))); + TestUtils.AreEqual(float4(1f, -1f, 0f, 1f), sign(float4(123.45f, float.NegativeInfinity, TestUtils.SignedFloatQNaN(), float.PositiveInfinity))); + } + + [TestCompiler] + public static void sign_double() + { + TestUtils.AreEqual(-1.0, sign(-123.45)); + TestUtils.AreEqual(-1.0, sign(-1E-20)); + TestUtils.AreEqual(0.0, sign(0.0)); + TestUtils.AreEqual(1.0, sign(1E-10)); + TestUtils.AreEqual(1.0, sign(123.45)); + TestUtils.AreEqual(-1.0, sign(double.NegativeInfinity)); + TestUtils.AreEqual(0.0, sign(TestUtils.SignedDoubleQNaN())); + TestUtils.AreEqual(1.0, sign(double.PositiveInfinity)); + } + + [TestCompiler] + public static void sign_double2() + { + TestUtils.AreEqual(double2(-1.0, -1.0), sign(double2(-123.45, -1E-20))); + TestUtils.AreEqual(double2(0.0, 1.0), sign(double2(0.0, 1E-10))); + TestUtils.AreEqual(double2(1.0, -1.0), sign(double2(123.45, double.NegativeInfinity))); + TestUtils.AreEqual(double2(0.0, 1.0), sign(double2(TestUtils.SignedDoubleQNaN(), double.PositiveInfinity))); + } + + [TestCompiler] + public static void sign_double3() + { + TestUtils.AreEqual(double3(-1.0, -1.0, 0.0), sign(double3(-123.45, -1E-20, 0.0))); + TestUtils.AreEqual(double3(1.0, 1.0, -1.0), sign(double3(1E-10, 123.45, double.NegativeInfinity))); + TestUtils.AreEqual(double3(0.0, 1.0, 1.0), sign(double3(TestUtils.SignedDoubleQNaN(), double.PositiveInfinity, double.PositiveInfinity))); + } + + [TestCompiler] + public static void sign_double4() + { + TestUtils.AreEqual(double4(-1.0, -1.0, 0.0, 1.0), sign(double4(-123.45, -1E-20, 0.0, 1E-10))); + TestUtils.AreEqual(double4(1.0, -1.0, 0.0, 1.0), sign(double4(123.45, double.NegativeInfinity, TestUtils.SignedDoubleQNaN(), double.PositiveInfinity))); + } + + [TestCompiler] + public static void sqrt_float() + { + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), sqrt(-1f), 1, false); + TestUtils.AreEqual(0f, sqrt(0f), 1, false); + TestUtils.AreEqual(1E-05f, sqrt(1E-10f), 1, false); + TestUtils.AreEqual(11.1108055f, sqrt(123.45f), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), sqrt(float.NegativeInfinity), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), sqrt(TestUtils.SignedFloatQNaN()), 1, false); + TestUtils.AreEqual(float.PositiveInfinity, sqrt(float.PositiveInfinity), 1, false); + } + + [TestCompiler] + public static void sqrt_float2() + { + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), 0f), sqrt(float2(-1f, 0f)), 1, false); + TestUtils.AreEqual(float2(1E-05f, 11.1108055f), sqrt(float2(1E-10f, 123.45f)), 1, false); + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), sqrt(float2(float.NegativeInfinity, TestUtils.SignedFloatQNaN())), 1, false); + TestUtils.AreEqual(float2(float.PositiveInfinity, float.PositiveInfinity), sqrt(float2(float.PositiveInfinity, float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void sqrt_float3() + { + TestUtils.AreEqual(float3(TestUtils.SignedFloatQNaN(), 0f, 1E-05f), sqrt(float3(-1f, 0f, 1E-10f)), 1, false); + TestUtils.AreEqual(float3(11.1108055f, TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), sqrt(float3(123.45f, float.NegativeInfinity, TestUtils.SignedFloatQNaN())), 1, false); + TestUtils.AreEqual(float3(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity), sqrt(float3(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void sqrt_float4() + { + TestUtils.AreEqual(float4(TestUtils.SignedFloatQNaN(), 0f, 1E-05f, 11.1108055f), sqrt(float4(-1f, 0f, 1E-10f, 123.45f)), 1, false); + TestUtils.AreEqual(float4(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), float.PositiveInfinity, float.PositiveInfinity), sqrt(float4(float.NegativeInfinity, TestUtils.SignedFloatQNaN(), float.PositiveInfinity, float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void sqrt_double() + { + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), sqrt(-1.0), 1, false); + TestUtils.AreEqual(0.0, sqrt(0.0), 1, false); + TestUtils.AreEqual(1E-05, sqrt(1E-10), 1, false); + TestUtils.AreEqual(11.11080555135405, sqrt(123.45), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), sqrt(double.NegativeInfinity), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), sqrt(TestUtils.SignedDoubleQNaN()), 1, false); + TestUtils.AreEqual(double.PositiveInfinity, sqrt(double.PositiveInfinity), 1, false); + } + + [TestCompiler] + public static void sqrt_double2() + { + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), 0.0), sqrt(double2(-1.0, 0.0)), 1, false); + TestUtils.AreEqual(double2(1E-05, 11.11080555135405), sqrt(double2(1E-10, 123.45)), 1, false); + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), sqrt(double2(double.NegativeInfinity, TestUtils.SignedDoubleQNaN())), 1, false); + TestUtils.AreEqual(double2(double.PositiveInfinity, double.PositiveInfinity), sqrt(double2(double.PositiveInfinity, double.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void sqrt_double3() + { + TestUtils.AreEqual(double3(TestUtils.SignedDoubleQNaN(), 0.0, 1E-05), sqrt(double3(-1.0, 0.0, 1E-10)), 1, false); + TestUtils.AreEqual(double3(11.11080555135405, TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), sqrt(double3(123.45, double.NegativeInfinity, TestUtils.SignedDoubleQNaN())), 1, false); + TestUtils.AreEqual(double3(double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity), sqrt(double3(double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void sqrt_double4() + { + TestUtils.AreEqual(double4(TestUtils.SignedDoubleQNaN(), 0.0, 1E-05, 11.11080555135405), sqrt(double4(-1.0, 0.0, 1E-10, 123.45)), 1, false); + TestUtils.AreEqual(double4(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), double.PositiveInfinity, double.PositiveInfinity), sqrt(double4(double.NegativeInfinity, TestUtils.SignedDoubleQNaN(), double.PositiveInfinity, double.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void rsqrt_float() + { + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), rsqrt(-1f), 1, false); + TestUtils.AreEqual(float.PositiveInfinity, rsqrt(0f), 1, false); + TestUtils.AreEqual(1E-05f, rsqrt(1E+10f), 1, false); + TestUtils.AreEqual(0.09000248f, rsqrt(123.45f), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), rsqrt(float.NegativeInfinity), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), rsqrt(TestUtils.SignedFloatQNaN()), 1, false); + TestUtils.AreEqual(0f, rsqrt(float.PositiveInfinity), 1, false); + } + + [TestCompiler] + public static void rsqrt_float2() + { + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), float.PositiveInfinity), rsqrt(float2(-1f, 0f)), 1, false); + TestUtils.AreEqual(float2(1E-05f, 0.09000248f), rsqrt(float2(1E+10f, 123.45f)), 1, false); + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), rsqrt(float2(float.NegativeInfinity, TestUtils.SignedFloatQNaN())), 1, false); + TestUtils.AreEqual(float2(0f, 0f), rsqrt(float2(float.PositiveInfinity, float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void rsqrt_float3() + { + TestUtils.AreEqual(float3(TestUtils.SignedFloatQNaN(), float.PositiveInfinity, 1E-05f), rsqrt(float3(-1f, 0f, 1E+10f)), 1, false); + TestUtils.AreEqual(float3(0.09000248f, TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), rsqrt(float3(123.45f, float.NegativeInfinity, TestUtils.SignedFloatQNaN())), 1, false); + TestUtils.AreEqual(float3(0f, 0f, 0f), rsqrt(float3(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void rsqrt_float4() + { + TestUtils.AreEqual(float4(TestUtils.SignedFloatQNaN(), float.PositiveInfinity, 1E-05f, 0.09000248f), rsqrt(float4(-1f, 0f, 1E+10f, 123.45f)), 1, false); + TestUtils.AreEqual(float4(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), 0f, 0f), rsqrt(float4(float.NegativeInfinity, TestUtils.SignedFloatQNaN(), float.PositiveInfinity, float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void rsqrt_double() + { + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), rsqrt(-1.0), 1, false); + TestUtils.AreEqual(double.PositiveInfinity, rsqrt(0.0), 1, false); + TestUtils.AreEqual(1E-05, rsqrt(10000000000.0), 1, false); + TestUtils.AreEqual(0.090002475102098425, rsqrt(123.45), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), rsqrt(double.NegativeInfinity), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), rsqrt(TestUtils.SignedDoubleQNaN()), 1, false); + TestUtils.AreEqual(0.0, rsqrt(double.PositiveInfinity), 1, false); + } + + [TestCompiler] + public static void rsqrt_double2() + { + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), double.PositiveInfinity), rsqrt(double2(-1.0, 0.0)), 1, false); + TestUtils.AreEqual(double2(1E-05, 0.090002475102098425), rsqrt(double2(10000000000.0, 123.45)), 1, false); + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), rsqrt(double2(double.NegativeInfinity, TestUtils.SignedDoubleQNaN())), 1, false); + TestUtils.AreEqual(double2(0.0, 0.0), rsqrt(double2(double.PositiveInfinity, double.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void rsqrt_double3() + { + TestUtils.AreEqual(double3(TestUtils.SignedDoubleQNaN(), double.PositiveInfinity, 1E-05), rsqrt(double3(-1.0, 0.0, 10000000000.0)), 1, false); + TestUtils.AreEqual(double3(0.090002475102098425, TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), rsqrt(double3(123.45, double.NegativeInfinity, TestUtils.SignedDoubleQNaN())), 1, false); + TestUtils.AreEqual(double3(0.0, 0.0, 0.0), rsqrt(double3(double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void rsqrt_double4() + { + TestUtils.AreEqual(double4(TestUtils.SignedDoubleQNaN(), double.PositiveInfinity, 1E-05, 0.090002475102098425), rsqrt(double4(-1.0, 0.0, 10000000000.0, 123.45)), 1, false); + TestUtils.AreEqual(double4(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), 0.0, 0.0), rsqrt(double4(double.NegativeInfinity, TestUtils.SignedDoubleQNaN(), double.PositiveInfinity, double.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void rcp_float() + { + TestUtils.AreEqual(-0.008100445f, rcp(-123.45f), 1, false); + TestUtils.AreEqual(float.PositiveInfinity, rcp(0f), 1, false); + TestUtils.AreEqual(0.008100445f, rcp(123.45f), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), rcp(TestUtils.SignedFloatQNaN()), 1, false); + TestUtils.AreEqual(0f, rcp(float.PositiveInfinity), 1, false); + } + + [TestCompiler] + public static void rcp_float2() + { + TestUtils.AreEqual(float2(-0.008100445f, float.PositiveInfinity), rcp(float2(-123.45f, 0f)), 1, false); + TestUtils.AreEqual(float2(0.008100445f, TestUtils.SignedFloatQNaN()), rcp(float2(123.45f, TestUtils.SignedFloatQNaN())), 1, false); + TestUtils.AreEqual(float2(0f, 0f), rcp(float2(float.PositiveInfinity, float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void rcp_float3() + { + TestUtils.AreEqual(float3(-0.008100445f, float.PositiveInfinity, 0.008100445f), rcp(float3(-123.45f, 0f, 123.45f)), 1, false); + TestUtils.AreEqual(float3(TestUtils.SignedFloatQNaN(), 0f, 0f), rcp(float3(TestUtils.SignedFloatQNaN(), float.PositiveInfinity, float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void rcp_float4() + { + TestUtils.AreEqual(float4(-0.008100445f, float.PositiveInfinity, 0.008100445f, TestUtils.SignedFloatQNaN()), rcp(float4(-123.45f, 0f, 123.45f, TestUtils.SignedFloatQNaN())), 1, false); + TestUtils.AreEqual(float4(0f, 0f, 0f, 0f), rcp(float4(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void rcp_double() + { + TestUtils.AreEqual(-0.0081004455245038479, rcp(-123.45), 1, false); + TestUtils.AreEqual(double.PositiveInfinity, rcp(0.0), 1, false); + TestUtils.AreEqual(0.0081004455245038479, rcp(123.45), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), rcp(TestUtils.SignedDoubleQNaN()), 1, false); + TestUtils.AreEqual(0.0, rcp(double.PositiveInfinity), 1, false); + } + + [TestCompiler] + public static void rcp_double2() + { + TestUtils.AreEqual(double2(-0.0081004455245038479, double.PositiveInfinity), rcp(double2(-123.45, 0.0)), 1, false); + TestUtils.AreEqual(double2(0.0081004455245038479, TestUtils.SignedDoubleQNaN()), rcp(double2(123.45, TestUtils.SignedDoubleQNaN())), 1, false); + TestUtils.AreEqual(double2(0.0, 0.0), rcp(double2(double.PositiveInfinity, double.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void rcp_double3() + { + TestUtils.AreEqual(double3(-0.0081004455245038479, double.PositiveInfinity, 0.0081004455245038479), rcp(double3(-123.45, 0.0, 123.45)), 1, false); + TestUtils.AreEqual(double3(TestUtils.SignedDoubleQNaN(), 0.0, 0.0), rcp(double3(TestUtils.SignedDoubleQNaN(), double.PositiveInfinity, double.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void rcp_double4() + { + TestUtils.AreEqual(double4(-0.0081004455245038479, double.PositiveInfinity, 0.0081004455245038479, TestUtils.SignedDoubleQNaN()), rcp(double4(-123.45, 0.0, 123.45, TestUtils.SignedDoubleQNaN())), 1, false); + TestUtils.AreEqual(double4(0.0, 0.0, 0.0, 0.0), rcp(double4(double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity)), 1, false); + } + + [TestCompiler] + public static void floor_float() + { + TestUtils.AreEqual(float.NegativeInfinity, floor(float.NegativeInfinity)); + TestUtils.AreEqual(-101f, floor(-100.51f)); + TestUtils.AreEqual(-101f, floor(-100.5f)); + TestUtils.AreEqual(-101f, floor(-100.49f)); + TestUtils.AreEqual(0f, floor(0f)); + TestUtils.AreEqual(100f, floor(100.49f)); + TestUtils.AreEqual(100f, floor(100.5f)); + TestUtils.AreEqual(100f, floor(100.51f)); + TestUtils.AreEqual(float.PositiveInfinity, floor(float.PositiveInfinity)); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), floor(TestUtils.SignedFloatQNaN())); + } + + [TestCompiler] + public static void floor_float2() + { + TestUtils.AreEqual(float2(float.NegativeInfinity, -101f), floor(float2(float.NegativeInfinity, -100.51f))); + TestUtils.AreEqual(float2(-101f, -101f), floor(float2(-100.5f, -100.49f))); + TestUtils.AreEqual(float2(0f, 100f), floor(float2(0f, 100.49f))); + TestUtils.AreEqual(float2(100f, 100f), floor(float2(100.5f, 100.51f))); + TestUtils.AreEqual(float2(float.PositiveInfinity, TestUtils.SignedFloatQNaN()), floor(float2(float.PositiveInfinity, TestUtils.SignedFloatQNaN()))); + } + + [TestCompiler] + public static void floor_float3() + { + TestUtils.AreEqual(float3(float.NegativeInfinity, -101f, -101f), floor(float3(float.NegativeInfinity, -100.51f, -100.5f))); + TestUtils.AreEqual(float3(-101f, 0f, 100f), floor(float3(-100.49f, 0f, 100.49f))); + TestUtils.AreEqual(float3(100f, 100f, float.PositiveInfinity), floor(float3(100.5f, 100.51f, float.PositiveInfinity))); + TestUtils.AreEqual(float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), floor(float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()))); + } + + [TestCompiler] + public static void floor_float4() + { + TestUtils.AreEqual(float4(float.NegativeInfinity, -101f, -101f, -101f), floor(float4(float.NegativeInfinity, -100.51f, -100.5f, -100.49f))); + TestUtils.AreEqual(float4(0f, 100f, 100f, 100f), floor(float4(0f, 100.49f, 100.5f, 100.51f))); + TestUtils.AreEqual(float4(float.PositiveInfinity, TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), floor(float4(float.PositiveInfinity, TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()))); + } + + [TestCompiler] + public static void floor_double() + { + TestUtils.AreEqual(double.NegativeInfinity, floor(double.NegativeInfinity)); + TestUtils.AreEqual(-101.0, floor(-100.51)); + TestUtils.AreEqual(-101.0, floor(-100.5)); + TestUtils.AreEqual(-101.0, floor(-100.49)); + TestUtils.AreEqual(0.0, floor(0.0)); + TestUtils.AreEqual(100.0, floor(100.49)); + TestUtils.AreEqual(100.0, floor(100.5)); + TestUtils.AreEqual(100.0, floor(100.51)); + TestUtils.AreEqual(double.PositiveInfinity, floor(double.PositiveInfinity)); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), floor(TestUtils.SignedDoubleQNaN())); + } + + [TestCompiler] + public static void floor_double2() + { + TestUtils.AreEqual(double2(double.NegativeInfinity, -101.0), floor(double2(double.NegativeInfinity, -100.51))); + TestUtils.AreEqual(double2(-101.0, -101.0), floor(double2(-100.5, -100.49))); + TestUtils.AreEqual(double2(0.0, 100.0), floor(double2(0.0, 100.49))); + TestUtils.AreEqual(double2(100.0, 100.0), floor(double2(100.5, 100.51))); + TestUtils.AreEqual(double2(double.PositiveInfinity, TestUtils.SignedDoubleQNaN()), floor(double2(double.PositiveInfinity, TestUtils.SignedDoubleQNaN()))); + } + + [TestCompiler] + public static void floor_double3() + { + TestUtils.AreEqual(double3(double.NegativeInfinity, -101.0, -101.0), floor(double3(double.NegativeInfinity, -100.51, -100.5))); + TestUtils.AreEqual(double3(-101.0, 0.0, 100.0), floor(double3(-100.49, 0.0, 100.49))); + TestUtils.AreEqual(double3(100.0, 100.0, double.PositiveInfinity), floor(double3(100.5, 100.51, double.PositiveInfinity))); + TestUtils.AreEqual(double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), floor(double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()))); + } + + [TestCompiler] + public static void floor_double4() + { + TestUtils.AreEqual(double4(double.NegativeInfinity, -101.0, -101.0, -101.0), floor(double4(double.NegativeInfinity, -100.51, -100.5, -100.49))); + TestUtils.AreEqual(double4(0.0, 100.0, 100.0, 100.0), floor(double4(0.0, 100.49, 100.5, 100.51))); + TestUtils.AreEqual(double4(double.PositiveInfinity, TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), floor(double4(double.PositiveInfinity, TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()))); + } + + [TestCompiler] + public static void ceil_float() + { + TestUtils.AreEqual(float.NegativeInfinity, ceil(float.NegativeInfinity)); + TestUtils.AreEqual(-100f, ceil(-100.51f)); + TestUtils.AreEqual(-100f, ceil(-100.5f)); + TestUtils.AreEqual(-100f, ceil(-100.49f)); + TestUtils.AreEqual(0f, ceil(0f)); + TestUtils.AreEqual(101f, ceil(100.49f)); + TestUtils.AreEqual(101f, ceil(100.5f)); + TestUtils.AreEqual(101f, ceil(100.51f)); + TestUtils.AreEqual(float.PositiveInfinity, ceil(float.PositiveInfinity)); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), ceil(TestUtils.SignedFloatQNaN())); + } + + [TestCompiler] + public static void ceil_float2() + { + TestUtils.AreEqual(float2(float.NegativeInfinity, -100f), ceil(float2(float.NegativeInfinity, -100.51f))); + TestUtils.AreEqual(float2(-100f, -100f), ceil(float2(-100.5f, -100.49f))); + TestUtils.AreEqual(float2(0f, 101f), ceil(float2(0f, 100.49f))); + TestUtils.AreEqual(float2(101f, 101f), ceil(float2(100.5f, 100.51f))); + TestUtils.AreEqual(float2(float.PositiveInfinity, TestUtils.SignedFloatQNaN()), ceil(float2(float.PositiveInfinity, TestUtils.SignedFloatQNaN()))); + } + + [TestCompiler] + public static void ceil_float3() + { + TestUtils.AreEqual(float3(float.NegativeInfinity, -100f, -100f), ceil(float3(float.NegativeInfinity, -100.51f, -100.5f))); + TestUtils.AreEqual(float3(-100f, 0f, 101f), ceil(float3(-100.49f, 0f, 100.49f))); + TestUtils.AreEqual(float3(101f, 101f, float.PositiveInfinity), ceil(float3(100.5f, 100.51f, float.PositiveInfinity))); + TestUtils.AreEqual(float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), ceil(float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()))); + } + + [TestCompiler] + public static void ceil_float4() + { + TestUtils.AreEqual(float4(float.NegativeInfinity, -100f, -100f, -100f), ceil(float4(float.NegativeInfinity, -100.51f, -100.5f, -100.49f))); + TestUtils.AreEqual(float4(0f, 101f, 101f, 101f), ceil(float4(0f, 100.49f, 100.5f, 100.51f))); + TestUtils.AreEqual(float4(float.PositiveInfinity, TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), ceil(float4(float.PositiveInfinity, TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()))); + } + + [TestCompiler] + public static void ceil_double() + { + TestUtils.AreEqual(double.NegativeInfinity, ceil(double.NegativeInfinity)); + TestUtils.AreEqual(-100.0, ceil(-100.51)); + TestUtils.AreEqual(-100.0, ceil(-100.5)); + TestUtils.AreEqual(-100.0, ceil(-100.49)); + TestUtils.AreEqual(0.0, ceil(0.0)); + TestUtils.AreEqual(101.0, ceil(100.49)); + TestUtils.AreEqual(101.0, ceil(100.5)); + TestUtils.AreEqual(101.0, ceil(100.51)); + TestUtils.AreEqual(double.PositiveInfinity, ceil(double.PositiveInfinity)); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), ceil(TestUtils.SignedDoubleQNaN())); + } + + [TestCompiler] + public static void ceil_double2() + { + TestUtils.AreEqual(double2(double.NegativeInfinity, -100.0), ceil(double2(double.NegativeInfinity, -100.51))); + TestUtils.AreEqual(double2(-100.0, -100.0), ceil(double2(-100.5, -100.49))); + TestUtils.AreEqual(double2(0.0, 101.0), ceil(double2(0.0, 100.49))); + TestUtils.AreEqual(double2(101.0, 101.0), ceil(double2(100.5, 100.51))); + TestUtils.AreEqual(double2(double.PositiveInfinity, TestUtils.SignedDoubleQNaN()), ceil(double2(double.PositiveInfinity, TestUtils.SignedDoubleQNaN()))); + } + + [TestCompiler] + public static void ceil_double3() + { + TestUtils.AreEqual(double3(double.NegativeInfinity, -100.0, -100.0), ceil(double3(double.NegativeInfinity, -100.51, -100.5))); + TestUtils.AreEqual(double3(-100.0, 0.0, 101.0), ceil(double3(-100.49, 0.0, 100.49))); + TestUtils.AreEqual(double3(101.0, 101.0, double.PositiveInfinity), ceil(double3(100.5, 100.51, double.PositiveInfinity))); + TestUtils.AreEqual(double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), ceil(double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()))); + } + + [TestCompiler] + public static void ceil_double4() + { + TestUtils.AreEqual(double4(double.NegativeInfinity, -100.0, -100.0, -100.0), ceil(double4(double.NegativeInfinity, -100.51, -100.5, -100.49))); + TestUtils.AreEqual(double4(0.0, 101.0, 101.0, 101.0), ceil(double4(0.0, 100.49, 100.5, 100.51))); + TestUtils.AreEqual(double4(double.PositiveInfinity, TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), ceil(double4(double.PositiveInfinity, TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()))); + } + + [TestCompiler] + public static void round_float() + { + TestUtils.AreEqual(float.NegativeInfinity, round(float.NegativeInfinity)); + TestUtils.AreEqual(-101f, round(-100.51f)); + TestUtils.AreEqual(-100f, round(-100.5f)); + TestUtils.AreEqual(-100f, round(-100.49f)); + TestUtils.AreEqual(0f, round(0f)); + TestUtils.AreEqual(100f, round(100.49f)); + TestUtils.AreEqual(100f, round(100.5f)); + TestUtils.AreEqual(101f, round(100.51f)); + TestUtils.AreEqual(102f, round(101.5f)); + TestUtils.AreEqual(float.PositiveInfinity, round(float.PositiveInfinity)); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), round(TestUtils.SignedFloatQNaN())); + } + + [TestCompiler] + public static void round_float2() + { + TestUtils.AreEqual(float2(float.NegativeInfinity, -101f), round(float2(float.NegativeInfinity, -100.51f))); + TestUtils.AreEqual(float2(-100f, -100f), round(float2(-100.5f, -100.49f))); + TestUtils.AreEqual(float2(0f, 100f), round(float2(0f, 100.49f))); + TestUtils.AreEqual(float2(100f, 101f), round(float2(100.5f, 100.51f))); + TestUtils.AreEqual(float2(102f, float.PositiveInfinity), round(float2(101.5f, float.PositiveInfinity))); + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), round(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()))); + } + + [TestCompiler] + public static void round_float3() + { + TestUtils.AreEqual(float3(float.NegativeInfinity, -101f, -100f), round(float3(float.NegativeInfinity, -100.51f, -100.5f))); + TestUtils.AreEqual(float3(-100f, 0f, 100f), round(float3(-100.49f, 0f, 100.49f))); + TestUtils.AreEqual(float3(100f, 101f, 102f), round(float3(100.5f, 100.51f, 101.5f))); + TestUtils.AreEqual(float3(float.PositiveInfinity, TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), round(float3(float.PositiveInfinity, TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()))); + } + + [TestCompiler] + public static void round_float4() + { + TestUtils.AreEqual(float4(float.NegativeInfinity, -101f, -100f, -100f), round(float4(float.NegativeInfinity, -100.51f, -100.5f, -100.49f))); + TestUtils.AreEqual(float4(0f, 100f, 100f, 101f), round(float4(0f, 100.49f, 100.5f, 100.51f))); + TestUtils.AreEqual(float4(102f, float.PositiveInfinity, TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), round(float4(101.5f, float.PositiveInfinity, TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()))); + } + + [TestCompiler] + public static void round_double() + { + TestUtils.AreEqual(double.NegativeInfinity, round(double.NegativeInfinity)); + TestUtils.AreEqual(-101.0, round(-100.51)); + TestUtils.AreEqual(-100.0, round(-100.5)); + TestUtils.AreEqual(-100.0, round(-100.49)); + TestUtils.AreEqual(0.0, round(0.0)); + TestUtils.AreEqual(100.0, round(100.49)); + TestUtils.AreEqual(100.0, round(100.5)); + TestUtils.AreEqual(101.0, round(100.51)); + TestUtils.AreEqual(102.0, round(101.5)); + TestUtils.AreEqual(double.PositiveInfinity, round(double.PositiveInfinity)); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), round(TestUtils.SignedDoubleQNaN())); + } + + [TestCompiler] + public static void round_double2() + { + TestUtils.AreEqual(double2(double.NegativeInfinity, -101.0), round(double2(double.NegativeInfinity, -100.51))); + TestUtils.AreEqual(double2(-100.0, -100.0), round(double2(-100.5, -100.49))); + TestUtils.AreEqual(double2(0.0, 100.0), round(double2(0.0, 100.49))); + TestUtils.AreEqual(double2(100.0, 101.0), round(double2(100.5, 100.51))); + TestUtils.AreEqual(double2(102.0, double.PositiveInfinity), round(double2(101.5, double.PositiveInfinity))); + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), round(double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()))); + } + + [TestCompiler] + public static void round_double3() + { + TestUtils.AreEqual(double3(double.NegativeInfinity, -101.0, -100.0), round(double3(double.NegativeInfinity, -100.51, -100.5))); + TestUtils.AreEqual(double3(-100.0, 0.0, 100.0), round(double3(-100.49, 0.0, 100.49))); + TestUtils.AreEqual(double3(100.0, 101.0, 102.0), round(double3(100.5, 100.51, 101.5))); + TestUtils.AreEqual(double3(double.PositiveInfinity, TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), round(double3(double.PositiveInfinity, TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()))); + } + + [TestCompiler] + public static void round_double4() + { + TestUtils.AreEqual(double4(double.NegativeInfinity, -101.0, -100.0, -100.0), round(double4(double.NegativeInfinity, -100.51, -100.5, -100.49))); + TestUtils.AreEqual(double4(0.0, 100.0, 100.0, 101.0), round(double4(0.0, 100.49, 100.5, 100.51))); + TestUtils.AreEqual(double4(102.0, double.PositiveInfinity, TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), round(double4(101.5, double.PositiveInfinity, TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()))); + } + + [TestCompiler] + public static void trunc_float() + { + TestUtils.AreEqual(float.NegativeInfinity, trunc(float.NegativeInfinity)); + TestUtils.AreEqual(-100f, trunc(-100.51f)); + TestUtils.AreEqual(-100f, trunc(-100.5f)); + TestUtils.AreEqual(-100f, trunc(-100.49f)); + TestUtils.AreEqual(0f, trunc(0f)); + TestUtils.AreEqual(100f, trunc(100.49f)); + TestUtils.AreEqual(100f, trunc(100.5f)); + TestUtils.AreEqual(100f, trunc(100.51f)); + TestUtils.AreEqual(101f, trunc(101.5f)); + TestUtils.AreEqual(float.PositiveInfinity, trunc(float.PositiveInfinity)); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), trunc(TestUtils.SignedFloatQNaN())); + } + + [TestCompiler] + public static void trunc_float2() + { + TestUtils.AreEqual(float2(float.NegativeInfinity, -100f), trunc(float2(float.NegativeInfinity, -100.51f))); + TestUtils.AreEqual(float2(-100f, -100f), trunc(float2(-100.5f, -100.49f))); + TestUtils.AreEqual(float2(0f, 100f), trunc(float2(0f, 100.49f))); + TestUtils.AreEqual(float2(100f, 100f), trunc(float2(100.5f, 100.51f))); + TestUtils.AreEqual(float2(101f, float.PositiveInfinity), trunc(float2(101.5f, float.PositiveInfinity))); + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), trunc(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()))); + } + + [TestCompiler] + public static void trunc_float3() + { + TestUtils.AreEqual(float3(float.NegativeInfinity, -100f, -100f), trunc(float3(float.NegativeInfinity, -100.51f, -100.5f))); + TestUtils.AreEqual(float3(-100f, 0f, 100f), trunc(float3(-100.49f, 0f, 100.49f))); + TestUtils.AreEqual(float3(100f, 100f, 101f), trunc(float3(100.5f, 100.51f, 101.5f))); + TestUtils.AreEqual(float3(float.PositiveInfinity, TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), trunc(float3(float.PositiveInfinity, TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()))); + } + + [TestCompiler] + public static void trunc_float4() + { + TestUtils.AreEqual(float4(float.NegativeInfinity, -100f, -100f, -100f), trunc(float4(float.NegativeInfinity, -100.51f, -100.5f, -100.49f))); + TestUtils.AreEqual(float4(0f, 100f, 100f, 100f), trunc(float4(0f, 100.49f, 100.5f, 100.51f))); + TestUtils.AreEqual(float4(101f, float.PositiveInfinity, TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), trunc(float4(101.5f, float.PositiveInfinity, TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()))); + } + + [TestCompiler] + public static void trunc_double() + { + TestUtils.AreEqual(double.NegativeInfinity, trunc(double.NegativeInfinity)); + TestUtils.AreEqual(-100.0, trunc(-100.51)); + TestUtils.AreEqual(-100.0, trunc(-100.5)); + TestUtils.AreEqual(-100.0, trunc(-100.49)); + TestUtils.AreEqual(0.0, trunc(0.0)); + TestUtils.AreEqual(100.0, trunc(100.49)); + TestUtils.AreEqual(100.0, trunc(100.5)); + TestUtils.AreEqual(100.0, trunc(100.51)); + TestUtils.AreEqual(101.0, trunc(101.5)); + TestUtils.AreEqual(double.PositiveInfinity, trunc(double.PositiveInfinity)); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), trunc(TestUtils.SignedDoubleQNaN())); + } + + [TestCompiler] + public static void trunc_double2() + { + TestUtils.AreEqual(double2(double.NegativeInfinity, -100.0), trunc(double2(double.NegativeInfinity, -100.51))); + TestUtils.AreEqual(double2(-100.0, -100.0), trunc(double2(-100.5, -100.49))); + TestUtils.AreEqual(double2(0.0, 100.0), trunc(double2(0.0, 100.49))); + TestUtils.AreEqual(double2(100.0, 100.0), trunc(double2(100.5, 100.51))); + TestUtils.AreEqual(double2(101.0, double.PositiveInfinity), trunc(double2(101.5, double.PositiveInfinity))); + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), trunc(double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()))); + } + + [TestCompiler] + public static void trunc_double3() + { + TestUtils.AreEqual(double3(double.NegativeInfinity, -100.0, -100.0), trunc(double3(double.NegativeInfinity, -100.51, -100.5))); + TestUtils.AreEqual(double3(-100.0, 0.0, 100.0), trunc(double3(-100.49, 0.0, 100.49))); + TestUtils.AreEqual(double3(100.0, 100.0, 101.0), trunc(double3(100.5, 100.51, 101.5))); + TestUtils.AreEqual(double3(double.PositiveInfinity, TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), trunc(double3(double.PositiveInfinity, TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()))); + } + + [TestCompiler] + public static void trunc_double4() + { + TestUtils.AreEqual(double4(double.NegativeInfinity, -100.0, -100.0, -100.0), trunc(double4(double.NegativeInfinity, -100.51, -100.5, -100.49))); + TestUtils.AreEqual(double4(0.0, 100.0, 100.0, 100.0), trunc(double4(0.0, 100.49, 100.5, 100.51))); + TestUtils.AreEqual(double4(101.0, double.PositiveInfinity, TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), trunc(double4(101.5, double.PositiveInfinity, TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()))); + } + + [TestCompiler] + public static void frac_float() + { + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), frac(float.NegativeInfinity), 64, false); + TestUtils.AreEqual(0f, frac(-1E+20f), 64, false); + TestUtils.AreEqual(0.7f, frac(-100.3f), 64, false); + TestUtils.AreEqual(0f, frac(0f), 64, false); + TestUtils.AreEqual(0.8f, frac(100.8f), 64, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), frac(float.PositiveInfinity), 64, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), frac(TestUtils.SignedFloatQNaN()), 64, false); + } + + [TestCompiler] + public static void frac_float2() + { + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), 0f), frac(float2(float.NegativeInfinity, -1E+20f)), 64, false); + TestUtils.AreEqual(float2(0.7f, 0f), frac(float2(-100.3f, 0f)), 64, false); + TestUtils.AreEqual(float2(0.8f, TestUtils.SignedFloatQNaN()), frac(float2(100.8f, float.PositiveInfinity)), 64, false); + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), frac(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN())), 64, false); + } + + [TestCompiler] + public static void frac_float3() + { + TestUtils.AreEqual(float3(TestUtils.SignedFloatQNaN(), 0f, 0.7f), frac(float3(float.NegativeInfinity, -1E+20f, -100.3f)), 64, false); + TestUtils.AreEqual(float3(0f, 0.8f, TestUtils.SignedFloatQNaN()), frac(float3(0f, 100.8f, float.PositiveInfinity)), 64, false); + TestUtils.AreEqual(float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), frac(float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN())), 64, false); + } + + [TestCompiler] + public static void frac_float4() + { + TestUtils.AreEqual(float4(TestUtils.SignedFloatQNaN(), 0f, 0.7f, 0f), frac(float4(float.NegativeInfinity, -1E+20f, -100.3f, 0f)), 64, false); + TestUtils.AreEqual(float4(0.8f, TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), frac(float4(100.8f, float.PositiveInfinity, TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN())), 64, false); + } + + [TestCompiler] + public static void frac_double() + { + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), frac(double.NegativeInfinity), 64, false); + TestUtils.AreEqual(0.0, frac(-1E+20), 64, false); + TestUtils.AreEqual(0.7, frac(-100.3), 64, false); + TestUtils.AreEqual(0.0, frac(0.0), 64, false); + TestUtils.AreEqual(0.8, frac(100.8), 64, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), frac(double.PositiveInfinity), 64, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), frac(TestUtils.SignedDoubleQNaN()), 64, false); + } + + [TestCompiler] + public static void frac_double2() + { + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), 0.0), frac(double2(double.NegativeInfinity, -1E+20)), 64, false); + TestUtils.AreEqual(double2(0.7, 0.0), frac(double2(-100.3, 0.0)), 64, false); + TestUtils.AreEqual(double2(0.8, TestUtils.SignedDoubleQNaN()), frac(double2(100.8, double.PositiveInfinity)), 64, false); + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), frac(double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN())), 64, false); + } + + [TestCompiler] + public static void frac_double3() + { + TestUtils.AreEqual(double3(TestUtils.SignedDoubleQNaN(), 0.0, 0.7), frac(double3(double.NegativeInfinity, -1E+20, -100.3)), 64, false); + TestUtils.AreEqual(double3(0.0, 0.8, TestUtils.SignedDoubleQNaN()), frac(double3(0.0, 100.8, double.PositiveInfinity)), 64, false); + TestUtils.AreEqual(double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), frac(double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN())), 64, false); + } + + [TestCompiler] + public static void frac_double4() + { + TestUtils.AreEqual(double4(TestUtils.SignedDoubleQNaN(), 0.0, 0.7, 0.0), frac(double4(double.NegativeInfinity, -1E+20, -100.3, 0.0)), 64, false); + TestUtils.AreEqual(double4(0.8, TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), frac(double4(100.8, double.PositiveInfinity, TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN())), 64, false); + } + + [TestCompiler] + public static void lerp_float() + { + TestUtils.AreEqual(-967.77f, lerp(-123.45f, 439.43f, -1.5f), 1, false); + TestUtils.AreEqual(157.99f, lerp(-123.45f, 439.43f, 0.5f), 1, false); + TestUtils.AreEqual(2972.39f, lerp(-123.45f, 439.43f, 5.5f), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), lerp(-123.45f, 439.43f, TestUtils.SignedFloatQNaN()), 1, false); + } + + [TestCompiler] + public static void lerp_float2() + { + TestUtils.AreEqual(float2(-967.77f, 157.99f), lerp(float2(-123.45f, -123.45f), float2(439.43f, 439.43f), float2(-1.5f, 0.5f)), 1, false); + TestUtils.AreEqual(float2(2972.39f, TestUtils.SignedFloatQNaN()), lerp(float2(-123.45f, -123.45f), float2(439.43f, 439.43f), float2(5.5f, TestUtils.SignedFloatQNaN())), 1, false); + } + + [TestCompiler] + public static void lerp_float3() + { + TestUtils.AreEqual(float3(-967.77f, 157.99f, 2972.39f), lerp(float3(-123.45f, -123.45f, -123.45f), float3(439.43f, 439.43f, 439.43f), float3(-1.5f, 0.5f, 5.5f)), 1, false); + TestUtils.AreEqual(float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), lerp(float3(-123.45f, -123.45f, -123.45f), float3(439.43f, 439.43f, 439.43f), float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN())), 1, false); + } + + [TestCompiler] + public static void lerp_float4() + { + TestUtils.AreEqual(float4(-967.77f, 157.99f, 2972.39f, TestUtils.SignedFloatQNaN()), lerp(float4(-123.45f, -123.45f, -123.45f, -123.45f), float4(439.43f, 439.43f, 439.43f, 439.43f), float4(-1.5f, 0.5f, 5.5f, TestUtils.SignedFloatQNaN())), 1, false); + } + + [TestCompiler] + public static void lerp_double() + { + TestUtils.AreEqual(-967.77, lerp(-123.45, 439.43, -1.5), 1, false); + TestUtils.AreEqual(157.99, lerp(-123.45, 439.43, 0.5), 1, false); + TestUtils.AreEqual(2972.39, lerp(-123.45, 439.43, 5.5), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), lerp(-123.45, 439.43, TestUtils.SignedDoubleQNaN()), 1, false); + } + + [TestCompiler] + public static void lerp_double2() + { + TestUtils.AreEqual(double2(-967.77, 157.99), lerp(double2(-123.45, -123.45), double2(439.43, 439.43), double2(-1.5, 0.5)), 1, false); + TestUtils.AreEqual(double2(2972.39, TestUtils.SignedDoubleQNaN()), lerp(double2(-123.45, -123.45), double2(439.43, 439.43), double2(5.5, TestUtils.SignedDoubleQNaN())), 1, false); + } + + [TestCompiler] + public static void lerp_double3() + { + TestUtils.AreEqual(double3(-967.77, 157.99, 2972.39), lerp(double3(-123.45, -123.45, -123.45), double3(439.43, 439.43, 439.43), double3(-1.5, 0.5, 5.5)), 1, false); + TestUtils.AreEqual(double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), lerp(double3(-123.45, -123.45, -123.45), double3(439.43, 439.43, 439.43), double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN())), 1, false); + } + + [TestCompiler] + public static void lerp_double4() + { + TestUtils.AreEqual(double4(-967.77, 157.99, 2972.39, TestUtils.SignedDoubleQNaN()), lerp(double4(-123.45, -123.45, -123.45, -123.45), double4(439.43, 439.43, 439.43, 439.43), double4(-1.5, 0.5, 5.5, TestUtils.SignedDoubleQNaN())), 1, false); + } + + [TestCompiler] + public static void unlerp_float() + { + TestUtils.AreEqual(-0.232465178f, unlerp(-123.45f, 439.43f, -254.3f), 4, false); + TestUtils.AreEqual(0.219318509f, unlerp(-123.45f, 439.43f, 0f), 4, false); + TestUtils.AreEqual(1.34229326f, unlerp(-123.45f, 439.43f, 632.1f), 4, false); + TestUtils.AreEqual(float.NegativeInfinity, unlerp(123.4f, 123.4f, -430f), 4, false); + TestUtils.AreEqual(float.PositiveInfinity, unlerp(123.4f, 123.4f, 430f), 4, false); + TestUtils.AreEqual(1.23246515f, unlerp(439.43f, -123.45f, -254.3f), 4, false); + TestUtils.AreEqual(0.7806815f, unlerp(439.43f, -123.45f, 0f), 4, false); + TestUtils.AreEqual(-0.3422932f, unlerp(439.43f, -123.45f, 632.1f), 4, false); + } + + [TestCompiler] + public static void unlerp_float2() + { + TestUtils.AreEqual(float2(-0.232465178f, 0.219318509f), unlerp(float2(-123.45f, -123.45f), float2(439.43f, 439.43f), float2(-254.3f, 0f)), 4, false); + TestUtils.AreEqual(float2(1.34229326f, float.NegativeInfinity), unlerp(float2(-123.45f, 123.4f), float2(439.43f, 123.4f), float2(632.1f, -430f)), 4, false); + TestUtils.AreEqual(float2(float.PositiveInfinity, 1.23246515f), unlerp(float2(123.4f, 439.43f), float2(123.4f, -123.45f), float2(430f, -254.3f)), 4, false); + TestUtils.AreEqual(float2(0.7806815f, -0.3422932f), unlerp(float2(439.43f, 439.43f), float2(-123.45f, -123.45f), float2(0f, 632.1f)), 4, false); + } + + [TestCompiler] + public static void unlerp_float3() + { + TestUtils.AreEqual(float3(-0.232465178f, 0.219318509f, 1.34229326f), unlerp(float3(-123.45f, -123.45f, -123.45f), float3(439.43f, 439.43f, 439.43f), float3(-254.3f, 0f, 632.1f)), 4, false); + TestUtils.AreEqual(float3(float.NegativeInfinity, float.PositiveInfinity, 1.23246515f), unlerp(float3(123.4f, 123.4f, 439.43f), float3(123.4f, 123.4f, -123.45f), float3(-430f, 430f, -254.3f)), 4, false); + TestUtils.AreEqual(float3(0.7806815f, -0.3422932f, -0.3422932f), unlerp(float3(439.43f, 439.43f, 439.43f), float3(-123.45f, -123.45f, -123.45f), float3(0f, 632.1f, 632.1f)), 4, false); + } + + [TestCompiler] + public static void unlerp_float4() + { + TestUtils.AreEqual(float4(-0.232465178f, 0.219318509f, 1.34229326f, float.NegativeInfinity), unlerp(float4(-123.45f, -123.45f, -123.45f, 123.4f), float4(439.43f, 439.43f, 439.43f, 123.4f), float4(-254.3f, 0f, 632.1f, -430f)), 4, false); + TestUtils.AreEqual(float4(float.PositiveInfinity, 1.23246515f, 0.7806815f, -0.3422932f), unlerp(float4(123.4f, 439.43f, 439.43f, 439.43f), float4(123.4f, -123.45f, -123.45f, -123.45f), float4(430f, -254.3f, 0f, 632.1f)), 4, false); + } + + [TestCompiler] + public static void unlerp_double() + { + TestUtils.AreEqual(-0.23246517907902217, unlerp(-123.45, 439.43, -254.3), 4, false); + TestUtils.AreEqual(0.21931850483229107, unlerp(-123.45, 439.43, 0.0), 4, false); + TestUtils.AreEqual(1.3422932063672541, unlerp(-123.45, 439.43, 632.1), 4, false); + TestUtils.AreEqual(double.NegativeInfinity, unlerp(123.4, 123.4, -430.0), 4, false); + TestUtils.AreEqual(double.PositiveInfinity, unlerp(123.4, 123.4, 430.0), 4, false); + TestUtils.AreEqual(1.2324651790790222, unlerp(439.43, -123.45, -254.3), 4, false); + TestUtils.AreEqual(0.78068149516770891, unlerp(439.43, -123.45, 0.0), 4, false); + TestUtils.AreEqual(-0.34229320636725413, unlerp(439.43, -123.45, 632.1), 4, false); + } + + [TestCompiler] + public static void unlerp_double2() + { + TestUtils.AreEqual(double2(-0.23246517907902217, 0.21931850483229107), unlerp(double2(-123.45, -123.45), double2(439.43, 439.43), double2(-254.3, 0.0)), 4, false); + TestUtils.AreEqual(double2(1.3422932063672541, double.NegativeInfinity), unlerp(double2(-123.45, 123.4), double2(439.43, 123.4), double2(632.1, -430.0)), 4, false); + TestUtils.AreEqual(double2(double.PositiveInfinity, 1.2324651790790222), unlerp(double2(123.4, 439.43), double2(123.4, -123.45), double2(430.0, -254.3)), 4, false); + TestUtils.AreEqual(double2(0.78068149516770891, -0.34229320636725413), unlerp(double2(439.43, 439.43), double2(-123.45, -123.45), double2(0.0, 632.1)), 4, false); + } + + [TestCompiler] + public static void unlerp_double3() + { + TestUtils.AreEqual(double3(-0.23246517907902217, 0.21931850483229107, 1.3422932063672541), unlerp(double3(-123.45, -123.45, -123.45), double3(439.43, 439.43, 439.43), double3(-254.3, 0.0, 632.1)), 4, false); + TestUtils.AreEqual(double3(double.NegativeInfinity, double.PositiveInfinity, 1.2324651790790222), unlerp(double3(123.4, 123.4, 439.43), double3(123.4, 123.4, -123.45), double3(-430.0, 430.0, -254.3)), 4, false); + TestUtils.AreEqual(double3(0.78068149516770891, -0.34229320636725413, -0.34229320636725413), unlerp(double3(439.43, 439.43, 439.43), double3(-123.45, -123.45, -123.45), double3(0.0, 632.1, 632.1)), 4, false); + } + + [TestCompiler] + public static void unlerp_double4() + { + TestUtils.AreEqual(double4(-0.23246517907902217, 0.21931850483229107, 1.3422932063672541, double.NegativeInfinity), unlerp(double4(-123.45, -123.45, -123.45, 123.4), double4(439.43, 439.43, 439.43, 123.4), double4(-254.3, 0.0, 632.1, -430.0)), 4, false); + TestUtils.AreEqual(double4(double.PositiveInfinity, 1.2324651790790222, 0.78068149516770891, -0.34229320636725413), unlerp(double4(123.4, 439.43, 439.43, 439.43), double4(123.4, -123.45, -123.45, -123.45), double4(430.0, -254.3, 0.0, 632.1)), 4, false); + } + + [TestCompiler] + public static void remap_float() + { + TestUtils.AreEqual(529.0331f, remap(-123.45f, 439.43f, 541.3f, 631.5f, -200f), 4, false); + TestUtils.AreEqual(545.0578f, remap(-123.45f, 439.43f, 541.3f, 631.5f, -100f), 4, false); + TestUtils.AreEqual(641.2062f, remap(-123.45f, 439.43f, 541.3f, 631.5f, 500f), 4, false); + TestUtils.AreEqual(643.7669f, remap(439.43f, -123.45f, 541.3f, 631.5f, -200f), 4, false); + TestUtils.AreEqual(627.7422f, remap(439.43f, -123.45f, 541.3f, 631.5f, -100f), 4, false); + TestUtils.AreEqual(531.5938f, remap(439.43f, -123.45f, 541.3f, 631.5f, 500f), 4, false); + TestUtils.AreEqual(643.7669f, remap(-123.45f, 439.43f, 631.5f, 541.3f, -200f), 4, false); + TestUtils.AreEqual(627.7422f, remap(-123.45f, 439.43f, 631.5f, 541.3f, -100f), 4, false); + TestUtils.AreEqual(531.5938f, remap(-123.45f, 439.43f, 631.5f, 541.3f, 500f), 4, false); + TestUtils.AreEqual(float.NegativeInfinity, remap(-123.45f, -123.45f, 541.3f, 631.5f, -200f), 4, false); + TestUtils.AreEqual(float.PositiveInfinity, remap(-123.45f, -123.45f, 541.3f, 631.5f, -100f), 4, false); + } + + [TestCompiler] + public static void remap_float2() + { + TestUtils.AreEqual(float2(529.0331f, 545.0578f), remap(float2(-123.45f, -123.45f), float2(439.43f, 439.43f), float2(541.3f, 541.3f), float2(631.5f, 631.5f), float2(-200f, -100f)), 4, false); + TestUtils.AreEqual(float2(641.2062f, 643.7669f), remap(float2(-123.45f, 439.43f), float2(439.43f, -123.45f), float2(541.3f, 541.3f), float2(631.5f, 631.5f), float2(500f, -200f)), 4, false); + TestUtils.AreEqual(float2(627.7422f, 531.5938f), remap(float2(439.43f, 439.43f), float2(-123.45f, -123.45f), float2(541.3f, 541.3f), float2(631.5f, 631.5f), float2(-100f, 500f)), 4, false); + TestUtils.AreEqual(float2(643.7669f, 627.7422f), remap(float2(-123.45f, -123.45f), float2(439.43f, 439.43f), float2(631.5f, 631.5f), float2(541.3f, 541.3f), float2(-200f, -100f)), 4, false); + TestUtils.AreEqual(float2(531.5938f, float.NegativeInfinity), remap(float2(-123.45f, -123.45f), float2(439.43f, -123.45f), float2(631.5f, 541.3f), float2(541.3f, 631.5f), float2(500f, -200f)), 4, false); + TestUtils.AreEqual(float2(float.PositiveInfinity, float.PositiveInfinity), remap(float2(-123.45f, -123.45f), float2(-123.45f, -123.45f), float2(541.3f, 541.3f), float2(631.5f, 631.5f), float2(-100f, -100f)), 4, false); + } + + [TestCompiler] + public static void remap_float3() + { + TestUtils.AreEqual(float3(529.0331f, 545.0578f, 641.2062f), remap(float3(-123.45f, -123.45f, -123.45f), float3(439.43f, 439.43f, 439.43f), float3(541.3f, 541.3f, 541.3f), float3(631.5f, 631.5f, 631.5f), float3(-200f, -100f, 500f)), 4, false); + TestUtils.AreEqual(float3(643.7669f, 627.7422f, 531.5938f), remap(float3(439.43f, 439.43f, 439.43f), float3(-123.45f, -123.45f, -123.45f), float3(541.3f, 541.3f, 541.3f), float3(631.5f, 631.5f, 631.5f), float3(-200f, -100f, 500f)), 4, false); + TestUtils.AreEqual(float3(643.7669f, 627.7422f, 531.5938f), remap(float3(-123.45f, -123.45f, -123.45f), float3(439.43f, 439.43f, 439.43f), float3(631.5f, 631.5f, 631.5f), float3(541.3f, 541.3f, 541.3f), float3(-200f, -100f, 500f)), 4, false); + TestUtils.AreEqual(float3(float.NegativeInfinity, float.PositiveInfinity, float.PositiveInfinity), remap(float3(-123.45f, -123.45f, -123.45f), float3(-123.45f, -123.45f, -123.45f), float3(541.3f, 541.3f, 541.3f), float3(631.5f, 631.5f, 631.5f), float3(-200f, -100f, -100f)), 4, false); + } + + [TestCompiler] + public static void remap_float4() + { + TestUtils.AreEqual(float4(529.0331f, 545.0578f, 641.2062f, 643.7669f), remap(float4(-123.45f, -123.45f, -123.45f, 439.43f), float4(439.43f, 439.43f, 439.43f, -123.45f), float4(541.3f, 541.3f, 541.3f, 541.3f), float4(631.5f, 631.5f, 631.5f, 631.5f), float4(-200f, -100f, 500f, -200f)), 4, false); + TestUtils.AreEqual(float4(627.7422f, 531.5938f, 643.7669f, 627.7422f), remap(float4(439.43f, 439.43f, -123.45f, -123.45f), float4(-123.45f, -123.45f, 439.43f, 439.43f), float4(541.3f, 541.3f, 631.5f, 631.5f), float4(631.5f, 631.5f, 541.3f, 541.3f), float4(-100f, 500f, -200f, -100f)), 4, false); + TestUtils.AreEqual(float4(531.5938f, float.NegativeInfinity, float.PositiveInfinity, float.PositiveInfinity), remap(float4(-123.45f, -123.45f, -123.45f, -123.45f), float4(439.43f, -123.45f, -123.45f, -123.45f), float4(631.5f, 541.3f, 541.3f, 541.3f), float4(541.3f, 631.5f, 631.5f, 631.5f), float4(500f, -200f, -100f, -100f)), 4, false); + } + + [TestCompiler] + public static void remap_double() + { + TestUtils.AreEqual(529.03306921546334, remap(-123.45, 439.43, 541.3, 631.5, -200.0), 4, false); + TestUtils.AreEqual(545.057799175668, remap(-123.45, 439.43, 541.3, 631.5, -100.0), 4, false); + TestUtils.AreEqual(641.206178936896, remap(-123.45, 439.43, 541.3, 631.5, 500.0), 4, false); + TestUtils.AreEqual(643.76693078453673, remap(439.43, -123.45, 541.3, 631.5, -200.0), 4, false); + TestUtils.AreEqual(627.742200824332, remap(439.43, -123.45, 541.3, 631.5, -100.0), 4, false); + TestUtils.AreEqual(531.59382106310409, remap(439.43, -123.45, 541.3, 631.5, 500.0), 4, false); + TestUtils.AreEqual(643.76693078453673, remap(-123.45, 439.43, 631.5, 541.3, -200.0), 4, false); + TestUtils.AreEqual(627.742200824332, remap(-123.45, 439.43, 631.5, 541.3, -100.0), 4, false); + TestUtils.AreEqual(531.59382106310409, remap(-123.45, 439.43, 631.5, 541.3, 500.0), 4, false); + TestUtils.AreEqual(double.NegativeInfinity, remap(-123.45, -123.45, 541.3, 631.5, -200.0), 4, false); + TestUtils.AreEqual(double.PositiveInfinity, remap(-123.45, -123.45, 541.3, 631.5, -100.0), 4, false); + } + + [TestCompiler] + public static void remap_double2() + { + TestUtils.AreEqual(double2(529.03306921546334, 545.057799175668), remap(double2(-123.45, -123.45), double2(439.43, 439.43), double2(541.3, 541.3), double2(631.5, 631.5), double2(-200.0, -100.0)), 4, false); + TestUtils.AreEqual(double2(641.206178936896, 643.76693078453673), remap(double2(-123.45, 439.43), double2(439.43, -123.45), double2(541.3, 541.3), double2(631.5, 631.5), double2(500.0, -200.0)), 4, false); + TestUtils.AreEqual(double2(627.742200824332, 531.59382106310409), remap(double2(439.43, 439.43), double2(-123.45, -123.45), double2(541.3, 541.3), double2(631.5, 631.5), double2(-100.0, 500.0)), 4, false); + TestUtils.AreEqual(double2(643.76693078453673, 627.742200824332), remap(double2(-123.45, -123.45), double2(439.43, 439.43), double2(631.5, 631.5), double2(541.3, 541.3), double2(-200.0, -100.0)), 4, false); + TestUtils.AreEqual(double2(531.59382106310409, double.NegativeInfinity), remap(double2(-123.45, -123.45), double2(439.43, -123.45), double2(631.5, 541.3), double2(541.3, 631.5), double2(500.0, -200.0)), 4, false); + TestUtils.AreEqual(double2(double.PositiveInfinity, double.PositiveInfinity), remap(double2(-123.45, -123.45), double2(-123.45, -123.45), double2(541.3, 541.3), double2(631.5, 631.5), double2(-100.0, -100.0)), 4, false); + } + + [TestCompiler] + public static void remap_double3() + { + TestUtils.AreEqual(double3(529.03306921546334, 545.057799175668, 641.206178936896), remap(double3(-123.45, -123.45, -123.45), double3(439.43, 439.43, 439.43), double3(541.3, 541.3, 541.3), double3(631.5, 631.5, 631.5), double3(-200.0, -100.0, 500.0)), 4, false); + TestUtils.AreEqual(double3(643.76693078453673, 627.742200824332, 531.59382106310409), remap(double3(439.43, 439.43, 439.43), double3(-123.45, -123.45, -123.45), double3(541.3, 541.3, 541.3), double3(631.5, 631.5, 631.5), double3(-200.0, -100.0, 500.0)), 4, false); + TestUtils.AreEqual(double3(643.76693078453673, 627.742200824332, 531.59382106310409), remap(double3(-123.45, -123.45, -123.45), double3(439.43, 439.43, 439.43), double3(631.5, 631.5, 631.5), double3(541.3, 541.3, 541.3), double3(-200.0, -100.0, 500.0)), 4, false); + TestUtils.AreEqual(double3(double.NegativeInfinity, double.PositiveInfinity, double.PositiveInfinity), remap(double3(-123.45, -123.45, -123.45), double3(-123.45, -123.45, -123.45), double3(541.3, 541.3, 541.3), double3(631.5, 631.5, 631.5), double3(-200.0, -100.0, -100.0)), 4, false); + } + + [TestCompiler] + public static void remap_double4() + { + TestUtils.AreEqual(double4(529.03306921546334, 545.057799175668, 641.206178936896, 643.76693078453673), remap(double4(-123.45, -123.45, -123.45, 439.43), double4(439.43, 439.43, 439.43, -123.45), double4(541.3, 541.3, 541.3, 541.3), double4(631.5, 631.5, 631.5, 631.5), double4(-200.0, -100.0, 500.0, -200.0)), 4, false); + TestUtils.AreEqual(double4(627.742200824332, 531.59382106310409, 643.76693078453673, 627.742200824332), remap(double4(439.43, 439.43, -123.45, -123.45), double4(-123.45, -123.45, 439.43, 439.43), double4(541.3, 541.3, 631.5, 631.5), double4(631.5, 631.5, 541.3, 541.3), double4(-100.0, 500.0, -200.0, -100.0)), 4, false); + TestUtils.AreEqual(double4(531.59382106310409, double.NegativeInfinity, double.PositiveInfinity, double.PositiveInfinity), remap(double4(-123.45, -123.45, -123.45, -123.45), double4(439.43, -123.45, -123.45, -123.45), double4(631.5, 541.3, 541.3, 541.3), double4(541.3, 631.5, 631.5, 631.5), double4(500.0, -200.0, -100.0, -100.0)), 4, false); + } + + [TestCompiler] + public static void clamp_int() + { + TestUtils.AreEqual(-123, clamp(-2147483648, -123, 439)); + TestUtils.AreEqual(-123, clamp(-254, -123, 439)); + TestUtils.AreEqual(246, clamp(246, -123, 439)); + TestUtils.AreEqual(439, clamp(632, -123, 439)); + TestUtils.AreEqual(439, clamp(-254, 439, -123)); + TestUtils.AreEqual(439, clamp(246, 439, -123)); + TestUtils.AreEqual(439, clamp(632, 439, -123)); + TestUtils.AreEqual(439, clamp(2147483647, -123, 439)); + } + + [TestCompiler] + public static void clamp_int2() + { + TestUtils.AreEqual(int2(-123, -123), clamp(int2(-2147483648, -254), int2(-123, -123), int2(439, 439))); + TestUtils.AreEqual(int2(246, 439), clamp(int2(246, 632), int2(-123, -123), int2(439, 439))); + TestUtils.AreEqual(int2(439, 439), clamp(int2(-254, 246), int2(439, 439), int2(-123, -123))); + TestUtils.AreEqual(int2(439, 439), clamp(int2(632, 2147483647), int2(439, -123), int2(-123, 439))); + } + + [TestCompiler] + public static void clamp_int3() + { + TestUtils.AreEqual(int3(-123, -123, 246), clamp(int3(-2147483648, -254, 246), int3(-123, -123, -123), int3(439, 439, 439))); + TestUtils.AreEqual(int3(439, 439, 439), clamp(int3(632, -254, 246), int3(-123, 439, 439), int3(439, -123, -123))); + TestUtils.AreEqual(int3(439, 439, 439), clamp(int3(632, 2147483647, 2147483647), int3(439, -123, -123), int3(-123, 439, 439))); + } + + [TestCompiler] + public static void clamp_int4() + { + TestUtils.AreEqual(int4(-123, -123, 246, 439), clamp(int4(-2147483648, -254, 246, 632), int4(-123, -123, -123, -123), int4(439, 439, 439, 439))); + TestUtils.AreEqual(int4(439, 439, 439, 439), clamp(int4(-254, 246, 632, 2147483647), int4(439, 439, 439, -123), int4(-123, -123, -123, 439))); + } + + [TestCompiler] + public static void clamp_uint() + { + TestUtils.AreEqual(123u, clamp(0u, 123u, 439u)); + TestUtils.AreEqual(123u, clamp(54u, 123u, 439u)); + TestUtils.AreEqual(246u, clamp(246u, 123u, 439u)); + TestUtils.AreEqual(439u, clamp(632u, 123u, 439u)); + TestUtils.AreEqual(439u, clamp(54u, 439u, 123u)); + TestUtils.AreEqual(439u, clamp(246u, 439u, 123u)); + TestUtils.AreEqual(439u, clamp(632u, 439u, 123u)); + TestUtils.AreEqual(439u, clamp(4294967295u, 123u, 439u)); + } + + [TestCompiler] + public static void clamp_uint2() + { + TestUtils.AreEqual(uint2(123u, 123u), clamp(uint2(0u, 54u), uint2(123u, 123u), uint2(439u, 439u))); + TestUtils.AreEqual(uint2(246u, 439u), clamp(uint2(246u, 632u), uint2(123u, 123u), uint2(439u, 439u))); + TestUtils.AreEqual(uint2(439u, 439u), clamp(uint2(54u, 246u), uint2(439u, 439u), uint2(123u, 123u))); + TestUtils.AreEqual(uint2(439u, 439u), clamp(uint2(632u, 4294967295u), uint2(439u, 123u), uint2(123u, 439u))); + } + + [TestCompiler] + public static void clamp_uint3() + { + TestUtils.AreEqual(uint3(123u, 123u, 246u), clamp(uint3(0u, 54u, 246u), uint3(123u, 123u, 123u), uint3(439u, 439u, 439u))); + TestUtils.AreEqual(uint3(439u, 439u, 439u), clamp(uint3(632u, 54u, 246u), uint3(123u, 439u, 439u), uint3(439u, 123u, 123u))); + TestUtils.AreEqual(uint3(439u, 439u, 439u), clamp(uint3(632u, 4294967295u, 4294967295u), uint3(439u, 123u, 123u), uint3(123u, 439u, 439u))); + } + + [TestCompiler] + public static void clamp_uint4() + { + TestUtils.AreEqual(uint4(123u, 123u, 246u, 439u), clamp(uint4(0u, 54u, 246u, 632u), uint4(123u, 123u, 123u, 123u), uint4(439u, 439u, 439u, 439u))); + TestUtils.AreEqual(uint4(439u, 439u, 439u, 439u), clamp(uint4(54u, 246u, 632u, 4294967295u), uint4(439u, 439u, 439u, 123u), uint4(123u, 123u, 123u, 439u))); + } + + [TestCompiler] + public static void clamp_long() + { + TestUtils.AreEqual(-123L, clamp(-9223372036854775808L, -123L, 439L)); + TestUtils.AreEqual(-123L, clamp(-254L, -123L, 439L)); + TestUtils.AreEqual(246L, clamp(246L, -123L, 439L)); + TestUtils.AreEqual(439L, clamp(632L, -123L, 439L)); + TestUtils.AreEqual(439L, clamp(-254L, 439L, -123L)); + TestUtils.AreEqual(439L, clamp(246L, 439L, -123L)); + TestUtils.AreEqual(439L, clamp(632L, 439L, -123L)); + TestUtils.AreEqual(439L, clamp(9223372036854775807L, -123L, 439L)); + } + + [TestCompiler] + public static void clamp_ulong() + { + TestUtils.AreEqual(123UL, clamp(0UL, 123UL, 439UL)); + TestUtils.AreEqual(123UL, clamp(54UL, 123UL, 439UL)); + TestUtils.AreEqual(246UL, clamp(246UL, 123UL, 439UL)); + TestUtils.AreEqual(439UL, clamp(632UL, 123UL, 439UL)); + TestUtils.AreEqual(439UL, clamp(54UL, 439UL, 123UL)); + TestUtils.AreEqual(439UL, clamp(246UL, 439UL, 123UL)); + TestUtils.AreEqual(439UL, clamp(632UL, 439UL, 123UL)); + TestUtils.AreEqual(439UL, clamp(18446744073709551615UL, 123UL, 439UL)); + } + + [TestCompiler] + public static void clamp_float() + { + TestUtils.AreEqual(-123.45f, clamp(float.NegativeInfinity, -123.45f, 439.43f)); + TestUtils.AreEqual(-123.45f, clamp(-254.3f, -123.45f, 439.43f)); + TestUtils.AreEqual(246.3f, clamp(246.3f, -123.45f, 439.43f)); + TestUtils.AreEqual(439.43f, clamp(632.1f, -123.45f, 439.43f)); + TestUtils.AreEqual(439.43f, clamp(-254.3f, 439.43f, -123.45f)); + TestUtils.AreEqual(439.43f, clamp(246.3f, 439.43f, -123.45f)); + TestUtils.AreEqual(439.43f, clamp(632.1f, 439.43f, -123.45f)); + TestUtils.AreEqual(439.43f, clamp(float.PositiveInfinity, -123.45f, 439.43f)); + TestUtils.AreEqual(439.43f, clamp(TestUtils.SignedFloatQNaN(), -123.45f, 439.43f)); + } + + [TestCompiler] + public static void clamp_float2() + { + TestUtils.AreEqual(float2(-123.45f, -123.45f), clamp(float2(float.NegativeInfinity, -254.3f), float2(-123.45f, -123.45f), float2(439.43f, 439.43f))); + TestUtils.AreEqual(float2(246.3f, 439.43f), clamp(float2(246.3f, 632.1f), float2(-123.45f, -123.45f), float2(439.43f, 439.43f))); + TestUtils.AreEqual(float2(439.43f, 439.43f), clamp(float2(-254.3f, 246.3f), float2(439.43f, 439.43f), float2(-123.45f, -123.45f))); + TestUtils.AreEqual(float2(439.43f, 439.43f), clamp(float2(632.1f, float.PositiveInfinity), float2(439.43f, -123.45f), float2(-123.45f, 439.43f))); + TestUtils.AreEqual(float2(439.43f, 439.43f), clamp(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), float2(-123.45f, -123.45f), float2(439.43f, 439.43f))); + } + + [TestCompiler] + public static void clamp_float3() + { + TestUtils.AreEqual(float3(-123.45f, -123.45f, 246.3f), clamp(float3(float.NegativeInfinity, -254.3f, 246.3f), float3(-123.45f, -123.45f, -123.45f), float3(439.43f, 439.43f, 439.43f))); + TestUtils.AreEqual(float3(439.43f, 439.43f, 439.43f), clamp(float3(632.1f, -254.3f, 246.3f), float3(-123.45f, 439.43f, 439.43f), float3(439.43f, -123.45f, -123.45f))); + TestUtils.AreEqual(float3(439.43f, 439.43f, 439.43f), clamp(float3(632.1f, float.PositiveInfinity, TestUtils.SignedFloatQNaN()), float3(439.43f, -123.45f, -123.45f), float3(-123.45f, 439.43f, 439.43f))); + } + + [TestCompiler] + public static void clamp_float4() + { + TestUtils.AreEqual(float4(-123.45f, -123.45f, 246.3f, 439.43f), clamp(float4(float.NegativeInfinity, -254.3f, 246.3f, 632.1f), float4(-123.45f, -123.45f, -123.45f, -123.45f), float4(439.43f, 439.43f, 439.43f, 439.43f))); + TestUtils.AreEqual(float4(439.43f, 439.43f, 439.43f, 439.43f), clamp(float4(-254.3f, 246.3f, 632.1f, float.PositiveInfinity), float4(439.43f, 439.43f, 439.43f, -123.45f), float4(-123.45f, -123.45f, -123.45f, 439.43f))); + TestUtils.AreEqual(float4(439.43f, 439.43f, 439.43f, 439.43f), clamp(float4(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), float4(-123.45f, -123.45f, -123.45f, -123.45f), float4(439.43f, 439.43f, 439.43f, 439.43f))); + } + + [TestCompiler] + public static void clamp_double() + { + TestUtils.AreEqual(-123.45, clamp(double.NegativeInfinity, -123.45, 439.43)); + TestUtils.AreEqual(-123.45, clamp(-254.3, -123.45, 439.43)); + TestUtils.AreEqual(246.3, clamp(246.3, -123.45, 439.43)); + TestUtils.AreEqual(439.43, clamp(632.1, -123.45, 439.43)); + TestUtils.AreEqual(439.43, clamp(-254.3, 439.43, -123.45)); + TestUtils.AreEqual(439.43, clamp(246.3, 439.43, -123.45)); + TestUtils.AreEqual(439.43, clamp(632.1, 439.43, -123.45)); + TestUtils.AreEqual(439.43, clamp(double.PositiveInfinity, -123.45, 439.43)); + TestUtils.AreEqual(439.43, clamp(TestUtils.SignedDoubleQNaN(), -123.45, 439.43)); + } + + [TestCompiler] + public static void clamp_double2() + { + TestUtils.AreEqual(double2(-123.45, -123.45), clamp(double2(double.NegativeInfinity, -254.3), double2(-123.45, -123.45), double2(439.43, 439.43))); + TestUtils.AreEqual(double2(246.3, 439.43), clamp(double2(246.3, 632.1), double2(-123.45, -123.45), double2(439.43, 439.43))); + TestUtils.AreEqual(double2(439.43, 439.43), clamp(double2(-254.3, 246.3), double2(439.43, 439.43), double2(-123.45, -123.45))); + TestUtils.AreEqual(double2(439.43, 439.43), clamp(double2(632.1, double.PositiveInfinity), double2(439.43, -123.45), double2(-123.45, 439.43))); + TestUtils.AreEqual(double2(439.43, 439.43), clamp(double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), double2(-123.45, -123.45), double2(439.43, 439.43))); + } + + [TestCompiler] + public static void clamp_double3() + { + TestUtils.AreEqual(double3(-123.45, -123.45, 246.3), clamp(double3(double.NegativeInfinity, -254.3, 246.3), double3(-123.45, -123.45, -123.45), double3(439.43, 439.43, 439.43))); + TestUtils.AreEqual(double3(439.43, 439.43, 439.43), clamp(double3(632.1, -254.3, 246.3), double3(-123.45, 439.43, 439.43), double3(439.43, -123.45, -123.45))); + TestUtils.AreEqual(double3(439.43, 439.43, 439.43), clamp(double3(632.1, double.PositiveInfinity, TestUtils.SignedDoubleQNaN()), double3(439.43, -123.45, -123.45), double3(-123.45, 439.43, 439.43))); + } + + [TestCompiler] + public static void clamp_double4() + { + TestUtils.AreEqual(double4(-123.45, -123.45, 246.3, 439.43), clamp(double4(double.NegativeInfinity, -254.3, 246.3, 632.1), double4(-123.45, -123.45, -123.45, -123.45), double4(439.43, 439.43, 439.43, 439.43))); + TestUtils.AreEqual(double4(439.43, 439.43, 439.43, 439.43), clamp(double4(-254.3, 246.3, 632.1, double.PositiveInfinity), double4(439.43, 439.43, 439.43, -123.45), double4(-123.45, -123.45, -123.45, 439.43))); + TestUtils.AreEqual(double4(439.43, 439.43, 439.43, 439.43), clamp(double4(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), double4(-123.45, -123.45, -123.45, -123.45), double4(439.43, 439.43, 439.43, 439.43))); + } + + [TestCompiler] + public static void saturate_float() + { + TestUtils.AreEqual(0f, saturate(float.NegativeInfinity)); + TestUtils.AreEqual(0f, saturate(-123.45f)); + TestUtils.AreEqual(0f, saturate(0f)); + TestUtils.AreEqual(0.5f, saturate(0.5f)); + TestUtils.AreEqual(1f, saturate(1f)); + TestUtils.AreEqual(1f, saturate(123.45f)); + TestUtils.AreEqual(1f, saturate(float.PositiveInfinity)); + TestUtils.AreEqual(1f, saturate(TestUtils.SignedFloatQNaN())); + } + + [TestCompiler] + public static void saturate_float2() + { + TestUtils.AreEqual(float2(0f, 0f), saturate(float2(float.NegativeInfinity, -123.45f))); + TestUtils.AreEqual(float2(0f, 0.5f), saturate(float2(0f, 0.5f))); + TestUtils.AreEqual(float2(1f, 1f), saturate(float2(1f, 123.45f))); + TestUtils.AreEqual(float2(1f, 1f), saturate(float2(float.PositiveInfinity, TestUtils.SignedFloatQNaN()))); + } + + [TestCompiler] + public static void saturate_float3() + { + TestUtils.AreEqual(float3(0f, 0f, 0f), saturate(float3(float.NegativeInfinity, -123.45f, 0f))); + TestUtils.AreEqual(float3(0.5f, 1f, 1f), saturate(float3(0.5f, 1f, 123.45f))); + TestUtils.AreEqual(float3(1f, 1f, 1f), saturate(float3(float.PositiveInfinity, TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()))); + } + + [TestCompiler] + public static void saturate_float4() + { + TestUtils.AreEqual(float4(0f, 0f, 0f, 0.5f), saturate(float4(float.NegativeInfinity, -123.45f, 0f, 0.5f))); + TestUtils.AreEqual(float4(1f, 1f, 1f, 1f), saturate(float4(1f, 123.45f, float.PositiveInfinity, TestUtils.SignedFloatQNaN()))); + } + + [TestCompiler] + public static void saturate_double() + { + TestUtils.AreEqual(0.0, saturate(double.NegativeInfinity)); + TestUtils.AreEqual(0.0, saturate(-123.45)); + TestUtils.AreEqual(0.0, saturate(0.0)); + TestUtils.AreEqual(0.5, saturate(0.5)); + TestUtils.AreEqual(1.0, saturate(1.0)); + TestUtils.AreEqual(1.0, saturate(123.45)); + TestUtils.AreEqual(1.0, saturate(double.PositiveInfinity)); + TestUtils.AreEqual(1.0, saturate(TestUtils.SignedDoubleQNaN())); + } + + [TestCompiler] + public static void saturate_double2() + { + TestUtils.AreEqual(double2(0.0, 0.0), saturate(double2(double.NegativeInfinity, -123.45))); + TestUtils.AreEqual(double2(0.0, 0.5), saturate(double2(0.0, 0.5))); + TestUtils.AreEqual(double2(1.0, 1.0), saturate(double2(1.0, 123.45))); + TestUtils.AreEqual(double2(1.0, 1.0), saturate(double2(double.PositiveInfinity, TestUtils.SignedDoubleQNaN()))); + } + + [TestCompiler] + public static void saturate_double3() + { + TestUtils.AreEqual(double3(0.0, 0.0, 0.0), saturate(double3(double.NegativeInfinity, -123.45, 0.0))); + TestUtils.AreEqual(double3(0.5, 1.0, 1.0), saturate(double3(0.5, 1.0, 123.45))); + TestUtils.AreEqual(double3(1.0, 1.0, 1.0), saturate(double3(double.PositiveInfinity, TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()))); + } + + [TestCompiler] + public static void saturate_double4() + { + TestUtils.AreEqual(double4(0.0, 0.0, 0.0, 0.5), saturate(double4(double.NegativeInfinity, -123.45, 0.0, 0.5))); + TestUtils.AreEqual(double4(1.0, 1.0, 1.0, 1.0), saturate(double4(1.0, 123.45, double.PositiveInfinity, TestUtils.SignedDoubleQNaN()))); + } + + [TestCompiler] + public static void step_float() + { + TestUtils.AreEqual(0f, step(-123.45f, float.NegativeInfinity)); + TestUtils.AreEqual(0f, step(-123.45f, -200f)); + TestUtils.AreEqual(1f, step(-123.45f, 200f)); + TestUtils.AreEqual(1f, step(-123.45f, float.PositiveInfinity)); + TestUtils.AreEqual(0f, step(-123.45f, TestUtils.SignedFloatQNaN())); + TestUtils.AreEqual(0f, step(123.45f, float.NegativeInfinity)); + TestUtils.AreEqual(0f, step(123.45f, -200f)); + TestUtils.AreEqual(1f, step(123.45f, 200f)); + TestUtils.AreEqual(1f, step(123.45f, float.PositiveInfinity)); + TestUtils.AreEqual(0f, step(123.45f, TestUtils.SignedFloatQNaN())); + TestUtils.AreEqual(1f, step(float.NegativeInfinity, float.NegativeInfinity)); + TestUtils.AreEqual(1f, step(float.NegativeInfinity, -200f)); + TestUtils.AreEqual(1f, step(float.NegativeInfinity, 200f)); + TestUtils.AreEqual(1f, step(float.NegativeInfinity, float.PositiveInfinity)); + TestUtils.AreEqual(0f, step(float.NegativeInfinity, TestUtils.SignedFloatQNaN())); + TestUtils.AreEqual(0f, step(float.PositiveInfinity, float.NegativeInfinity)); + TestUtils.AreEqual(0f, step(float.PositiveInfinity, -200f)); + TestUtils.AreEqual(0f, step(float.PositiveInfinity, 200f)); + TestUtils.AreEqual(1f, step(float.PositiveInfinity, float.PositiveInfinity)); + TestUtils.AreEqual(0f, step(float.PositiveInfinity, TestUtils.SignedFloatQNaN())); + TestUtils.AreEqual(0f, step(TestUtils.SignedFloatQNaN(), float.NegativeInfinity)); + TestUtils.AreEqual(0f, step(TestUtils.SignedFloatQNaN(), -200f)); + TestUtils.AreEqual(0f, step(TestUtils.SignedFloatQNaN(), 200f)); + TestUtils.AreEqual(0f, step(TestUtils.SignedFloatQNaN(), float.PositiveInfinity)); + TestUtils.AreEqual(0f, step(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN())); + } + + [TestCompiler] + public static void step_float2() + { + TestUtils.AreEqual(float2(0f, 0f), step(float2(-123.45f, -123.45f), float2(float.NegativeInfinity, -200f))); + TestUtils.AreEqual(float2(1f, 1f), step(float2(-123.45f, -123.45f), float2(200f, float.PositiveInfinity))); + TestUtils.AreEqual(float2(0f, 0f), step(float2(-123.45f, 123.45f), float2(TestUtils.SignedFloatQNaN(), float.NegativeInfinity))); + TestUtils.AreEqual(float2(0f, 1f), step(float2(123.45f, 123.45f), float2(-200f, 200f))); + TestUtils.AreEqual(float2(1f, 0f), step(float2(123.45f, 123.45f), float2(float.PositiveInfinity, TestUtils.SignedFloatQNaN()))); + TestUtils.AreEqual(float2(1f, 1f), step(float2(float.NegativeInfinity, float.NegativeInfinity), float2(float.NegativeInfinity, -200f))); + TestUtils.AreEqual(float2(1f, 1f), step(float2(float.NegativeInfinity, float.NegativeInfinity), float2(200f, float.PositiveInfinity))); + TestUtils.AreEqual(float2(0f, 0f), step(float2(float.NegativeInfinity, float.PositiveInfinity), float2(TestUtils.SignedFloatQNaN(), float.NegativeInfinity))); + TestUtils.AreEqual(float2(0f, 0f), step(float2(float.PositiveInfinity, float.PositiveInfinity), float2(-200f, 200f))); + TestUtils.AreEqual(float2(1f, 0f), step(float2(float.PositiveInfinity, float.PositiveInfinity), float2(float.PositiveInfinity, TestUtils.SignedFloatQNaN()))); + TestUtils.AreEqual(float2(0f, 0f), step(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), float2(float.NegativeInfinity, -200f))); + TestUtils.AreEqual(float2(0f, 0f), step(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), float2(200f, float.PositiveInfinity))); + TestUtils.AreEqual(float2(0f, 0f), step(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()))); + } + + [TestCompiler] + public static void step_float3() + { + TestUtils.AreEqual(float3(0f, 0f, 1f), step(float3(-123.45f, -123.45f, -123.45f), float3(float.NegativeInfinity, -200f, 200f))); + TestUtils.AreEqual(float3(1f, 0f, 0f), step(float3(-123.45f, -123.45f, 123.45f), float3(float.PositiveInfinity, TestUtils.SignedFloatQNaN(), float.NegativeInfinity))); + TestUtils.AreEqual(float3(0f, 1f, 1f), step(float3(123.45f, 123.45f, 123.45f), float3(-200f, 200f, float.PositiveInfinity))); + TestUtils.AreEqual(float3(0f, 1f, 1f), step(float3(123.45f, float.NegativeInfinity, float.NegativeInfinity), float3(TestUtils.SignedFloatQNaN(), float.NegativeInfinity, -200f))); + TestUtils.AreEqual(float3(1f, 1f, 0f), step(float3(float.NegativeInfinity, float.NegativeInfinity, float.NegativeInfinity), float3(200f, float.PositiveInfinity, TestUtils.SignedFloatQNaN()))); + TestUtils.AreEqual(float3(0f, 0f, 0f), step(float3(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity), float3(float.NegativeInfinity, -200f, 200f))); + TestUtils.AreEqual(float3(1f, 0f, 0f), step(float3(float.PositiveInfinity, float.PositiveInfinity, TestUtils.SignedFloatQNaN()), float3(float.PositiveInfinity, TestUtils.SignedFloatQNaN(), float.NegativeInfinity))); + TestUtils.AreEqual(float3(0f, 0f, 0f), step(float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), float3(-200f, 200f, float.PositiveInfinity))); + TestUtils.AreEqual(float3(0f, 0f, 0f), step(float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()))); + } + + [TestCompiler] + public static void step_float4() + { + TestUtils.AreEqual(float4(0f, 0f, 1f, 1f), step(float4(-123.45f, -123.45f, -123.45f, -123.45f), float4(float.NegativeInfinity, -200f, 200f, float.PositiveInfinity))); + TestUtils.AreEqual(float4(0f, 0f, 0f, 1f), step(float4(-123.45f, 123.45f, 123.45f, 123.45f), float4(TestUtils.SignedFloatQNaN(), float.NegativeInfinity, -200f, 200f))); + TestUtils.AreEqual(float4(1f, 0f, 1f, 1f), step(float4(123.45f, 123.45f, float.NegativeInfinity, float.NegativeInfinity), float4(float.PositiveInfinity, TestUtils.SignedFloatQNaN(), float.NegativeInfinity, -200f))); + TestUtils.AreEqual(float4(1f, 1f, 0f, 0f), step(float4(float.NegativeInfinity, float.NegativeInfinity, float.NegativeInfinity, float.PositiveInfinity), float4(200f, float.PositiveInfinity, TestUtils.SignedFloatQNaN(), float.NegativeInfinity))); + TestUtils.AreEqual(float4(0f, 0f, 1f, 0f), step(float4(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity), float4(-200f, 200f, float.PositiveInfinity, TestUtils.SignedFloatQNaN()))); + TestUtils.AreEqual(float4(0f, 0f, 0f, 0f), step(float4(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), float4(float.NegativeInfinity, -200f, 200f, float.PositiveInfinity))); + TestUtils.AreEqual(float4(0f, 0f, 0f, 0f), step(float4(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), float4(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()))); + } + + [TestCompiler] + public static void step_double() + { + TestUtils.AreEqual(0.0, step(-123.45, double.NegativeInfinity)); + TestUtils.AreEqual(0.0, step(-123.45, -200.0)); + TestUtils.AreEqual(1.0, step(-123.45, 200.0)); + TestUtils.AreEqual(1.0, step(-123.45, double.PositiveInfinity)); + TestUtils.AreEqual(0.0, step(-123.45, TestUtils.SignedDoubleQNaN())); + TestUtils.AreEqual(0.0, step(123.45, double.NegativeInfinity)); + TestUtils.AreEqual(0.0, step(123.45, -200.0)); + TestUtils.AreEqual(1.0, step(123.45, 200.0)); + TestUtils.AreEqual(1.0, step(123.45, double.PositiveInfinity)); + TestUtils.AreEqual(0.0, step(123.45, TestUtils.SignedDoubleQNaN())); + TestUtils.AreEqual(1.0, step(double.NegativeInfinity, double.NegativeInfinity)); + TestUtils.AreEqual(1.0, step(double.NegativeInfinity, -200.0)); + TestUtils.AreEqual(1.0, step(double.NegativeInfinity, 200.0)); + TestUtils.AreEqual(1.0, step(double.NegativeInfinity, double.PositiveInfinity)); + TestUtils.AreEqual(0.0, step(double.NegativeInfinity, TestUtils.SignedDoubleQNaN())); + TestUtils.AreEqual(0.0, step(double.PositiveInfinity, double.NegativeInfinity)); + TestUtils.AreEqual(0.0, step(double.PositiveInfinity, -200.0)); + TestUtils.AreEqual(0.0, step(double.PositiveInfinity, 200.0)); + TestUtils.AreEqual(1.0, step(double.PositiveInfinity, double.PositiveInfinity)); + TestUtils.AreEqual(0.0, step(double.PositiveInfinity, TestUtils.SignedDoubleQNaN())); + TestUtils.AreEqual(0.0, step(TestUtils.SignedDoubleQNaN(), double.NegativeInfinity)); + TestUtils.AreEqual(0.0, step(TestUtils.SignedDoubleQNaN(), -200.0)); + TestUtils.AreEqual(0.0, step(TestUtils.SignedDoubleQNaN(), 200.0)); + TestUtils.AreEqual(0.0, step(TestUtils.SignedDoubleQNaN(), double.PositiveInfinity)); + TestUtils.AreEqual(0.0, step(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN())); + } + + [TestCompiler] + public static void step_double2() + { + TestUtils.AreEqual(double2(0.0, 0.0), step(double2(-123.45, -123.45), double2(double.NegativeInfinity, -200.0))); + TestUtils.AreEqual(double2(1.0, 1.0), step(double2(-123.45, -123.45), double2(200.0, double.PositiveInfinity))); + TestUtils.AreEqual(double2(0.0, 0.0), step(double2(-123.45, 123.45), double2(TestUtils.SignedDoubleQNaN(), double.NegativeInfinity))); + TestUtils.AreEqual(double2(0.0, 1.0), step(double2(123.45, 123.45), double2(-200.0, 200.0))); + TestUtils.AreEqual(double2(1.0, 0.0), step(double2(123.45, 123.45), double2(double.PositiveInfinity, TestUtils.SignedDoubleQNaN()))); + TestUtils.AreEqual(double2(1.0, 1.0), step(double2(double.NegativeInfinity, double.NegativeInfinity), double2(double.NegativeInfinity, -200.0))); + TestUtils.AreEqual(double2(1.0, 1.0), step(double2(double.NegativeInfinity, double.NegativeInfinity), double2(200.0, double.PositiveInfinity))); + TestUtils.AreEqual(double2(0.0, 0.0), step(double2(double.NegativeInfinity, double.PositiveInfinity), double2(TestUtils.SignedDoubleQNaN(), double.NegativeInfinity))); + TestUtils.AreEqual(double2(0.0, 0.0), step(double2(double.PositiveInfinity, double.PositiveInfinity), double2(-200.0, 200.0))); + TestUtils.AreEqual(double2(1.0, 0.0), step(double2(double.PositiveInfinity, double.PositiveInfinity), double2(double.PositiveInfinity, TestUtils.SignedDoubleQNaN()))); + TestUtils.AreEqual(double2(0.0, 0.0), step(double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), double2(double.NegativeInfinity, -200.0))); + TestUtils.AreEqual(double2(0.0, 0.0), step(double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), double2(200.0, double.PositiveInfinity))); + TestUtils.AreEqual(double2(0.0, 0.0), step(double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()))); + } + + [TestCompiler] + public static void step_double3() + { + TestUtils.AreEqual(double3(0.0, 0.0, 1.0), step(double3(-123.45, -123.45, -123.45), double3(double.NegativeInfinity, -200.0, 200.0))); + TestUtils.AreEqual(double3(1.0, 0.0, 0.0), step(double3(-123.45, -123.45, 123.45), double3(double.PositiveInfinity, TestUtils.SignedDoubleQNaN(), double.NegativeInfinity))); + TestUtils.AreEqual(double3(0.0, 1.0, 1.0), step(double3(123.45, 123.45, 123.45), double3(-200.0, 200.0, double.PositiveInfinity))); + TestUtils.AreEqual(double3(0.0, 1.0, 1.0), step(double3(123.45, double.NegativeInfinity, double.NegativeInfinity), double3(TestUtils.SignedDoubleQNaN(), double.NegativeInfinity, -200.0))); + TestUtils.AreEqual(double3(1.0, 1.0, 0.0), step(double3(double.NegativeInfinity, double.NegativeInfinity, double.NegativeInfinity), double3(200.0, double.PositiveInfinity, TestUtils.SignedDoubleQNaN()))); + TestUtils.AreEqual(double3(0.0, 0.0, 0.0), step(double3(double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity), double3(double.NegativeInfinity, -200.0, 200.0))); + TestUtils.AreEqual(double3(1.0, 0.0, 0.0), step(double3(double.PositiveInfinity, double.PositiveInfinity, TestUtils.SignedDoubleQNaN()), double3(double.PositiveInfinity, TestUtils.SignedDoubleQNaN(), double.NegativeInfinity))); + TestUtils.AreEqual(double3(0.0, 0.0, 0.0), step(double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), double3(-200.0, 200.0, double.PositiveInfinity))); + TestUtils.AreEqual(double3(0.0, 0.0, 0.0), step(double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()))); + } + + [TestCompiler] + public static void step_double4() + { + TestUtils.AreEqual(double4(0.0, 0.0, 1.0, 1.0), step(double4(-123.45, -123.45, -123.45, -123.45), double4(double.NegativeInfinity, -200.0, 200.0, double.PositiveInfinity))); + TestUtils.AreEqual(double4(0.0, 0.0, 0.0, 1.0), step(double4(-123.45, 123.45, 123.45, 123.45), double4(TestUtils.SignedDoubleQNaN(), double.NegativeInfinity, -200.0, 200.0))); + TestUtils.AreEqual(double4(1.0, 0.0, 1.0, 1.0), step(double4(123.45, 123.45, double.NegativeInfinity, double.NegativeInfinity), double4(double.PositiveInfinity, TestUtils.SignedDoubleQNaN(), double.NegativeInfinity, -200.0))); + TestUtils.AreEqual(double4(1.0, 1.0, 0.0, 0.0), step(double4(double.NegativeInfinity, double.NegativeInfinity, double.NegativeInfinity, double.PositiveInfinity), double4(200.0, double.PositiveInfinity, TestUtils.SignedDoubleQNaN(), double.NegativeInfinity))); + TestUtils.AreEqual(double4(0.0, 0.0, 1.0, 0.0), step(double4(double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity), double4(-200.0, 200.0, double.PositiveInfinity, TestUtils.SignedDoubleQNaN()))); + TestUtils.AreEqual(double4(0.0, 0.0, 0.0, 0.0), step(double4(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), double4(double.NegativeInfinity, -200.0, 200.0, double.PositiveInfinity))); + TestUtils.AreEqual(double4(0.0, 0.0, 0.0, 0.0), step(double4(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), double4(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()))); + } + + [TestCompiler] + public static void min_int() + { + TestUtils.AreEqual(-2147483648, min(-2147483648, -2147483648)); + TestUtils.AreEqual(-2147483648, min(-2147483648, -1)); + TestUtils.AreEqual(-2147483648, min(-1, -2147483648)); + TestUtils.AreEqual(-3456, min(-1234, -3456)); + TestUtils.AreEqual(-3456, min(-3456, -1234)); + TestUtils.AreEqual(-1234, min(-1234, 3456)); + TestUtils.AreEqual(-1234, min(3456, -1234)); + TestUtils.AreEqual(1234, min(1234, 3456)); + TestUtils.AreEqual(1234, min(3456, 1234)); + TestUtils.AreEqual(1, min(1, 2147483647)); + TestUtils.AreEqual(1, min(2147483647, 1)); + TestUtils.AreEqual(-2147483648, min(2147483647, -2147483648)); + TestUtils.AreEqual(2147483647, min(2147483647, 2147483647)); + } + + [TestCompiler] + public static void min_int2() + { + TestUtils.AreEqual(int2(-2147483648, -2147483648), min(int2(-2147483648, -2147483648), int2(-2147483648, -1))); + TestUtils.AreEqual(int2(-2147483648, -3456), min(int2(-1, -1234), int2(-2147483648, -3456))); + TestUtils.AreEqual(int2(-3456, -1234), min(int2(-3456, -1234), int2(-1234, 3456))); + TestUtils.AreEqual(int2(-1234, 1234), min(int2(3456, 1234), int2(-1234, 3456))); + TestUtils.AreEqual(int2(1234, 1), min(int2(3456, 1), int2(1234, 2147483647))); + TestUtils.AreEqual(int2(1, -2147483648), min(int2(2147483647, 2147483647), int2(1, -2147483648))); + TestUtils.AreEqual(int2(2147483647, 2147483647), min(int2(2147483647, 2147483647), int2(2147483647, 2147483647))); + } + + [TestCompiler] + public static void min_int3() + { + TestUtils.AreEqual(int3(-2147483648, -2147483648, -2147483648), min(int3(-2147483648, -2147483648, -1), int3(-2147483648, -1, -2147483648))); + TestUtils.AreEqual(int3(-3456, -3456, -1234), min(int3(-1234, -3456, -1234), int3(-3456, -1234, 3456))); + TestUtils.AreEqual(int3(-1234, 1234, 1234), min(int3(3456, 1234, 3456), int3(-1234, 3456, 1234))); + TestUtils.AreEqual(int3(1, 1, -2147483648), min(int3(1, 2147483647, 2147483647), int3(2147483647, 1, -2147483648))); + TestUtils.AreEqual(int3(2147483647, 2147483647, 2147483647), min(int3(2147483647, 2147483647, 2147483647), int3(2147483647, 2147483647, 2147483647))); + } + + [TestCompiler] + public static void min_int4() + { + TestUtils.AreEqual(int4(-2147483648, -2147483648, -2147483648, -3456), min(int4(-2147483648, -2147483648, -1, -1234), int4(-2147483648, -1, -2147483648, -3456))); + TestUtils.AreEqual(int4(-3456, -1234, -1234, 1234), min(int4(-3456, -1234, 3456, 1234), int4(-1234, 3456, -1234, 3456))); + TestUtils.AreEqual(int4(1234, 1, 1, -2147483648), min(int4(3456, 1, 2147483647, 2147483647), int4(1234, 2147483647, 1, -2147483648))); + TestUtils.AreEqual(int4(2147483647, 2147483647, 2147483647, 2147483647), min(int4(2147483647, 2147483647, 2147483647, 2147483647), int4(2147483647, 2147483647, 2147483647, 2147483647))); + } + + [TestCompiler] + public static void min_uint() + { + TestUtils.AreEqual(1234u, min(1234u, 3456u)); + TestUtils.AreEqual(1234u, min(3456u, 1234u)); + TestUtils.AreEqual(7u, min(4294967040u, 7u)); + TestUtils.AreEqual(7u, min(7u, 4294967040u)); + TestUtils.AreEqual(1u, min(1u, 4294967295u)); + TestUtils.AreEqual(1u, min(4294967295u, 1u)); + TestUtils.AreEqual(4294967295u, min(4294967295u, 4294967295u)); + } + + [TestCompiler] + public static void min_uint2() + { + TestUtils.AreEqual(uint2(1234u, 1234u), min(uint2(1234u, 3456u), uint2(3456u, 1234u))); + TestUtils.AreEqual(uint2(7u, 7u), min(uint2(4294967040u, 7u), uint2(7u, 4294967040u))); + TestUtils.AreEqual(uint2(1u, 1u), min(uint2(1u, 4294967295u), uint2(4294967295u, 1u))); + TestUtils.AreEqual(uint2(4294967295u, 4294967295u), min(uint2(4294967295u, 4294967295u), uint2(4294967295u, 4294967295u))); + } + + [TestCompiler] + public static void min_uint3() + { + TestUtils.AreEqual(uint3(1234u, 1234u, 7u), min(uint3(1234u, 3456u, 4294967040u), uint3(3456u, 1234u, 7u))); + TestUtils.AreEqual(uint3(7u, 1u, 1u), min(uint3(7u, 1u, 4294967295u), uint3(4294967040u, 4294967295u, 1u))); + TestUtils.AreEqual(uint3(4294967295u, 4294967295u, 4294967295u), min(uint3(4294967295u, 4294967295u, 4294967295u), uint3(4294967295u, 4294967295u, 4294967295u))); + } + + [TestCompiler] + public static void min_uint4() + { + TestUtils.AreEqual(uint4(1234u, 1234u, 7u, 7u), min(uint4(1234u, 3456u, 4294967040u, 7u), uint4(3456u, 1234u, 7u, 4294967040u))); + TestUtils.AreEqual(uint4(1u, 1u, 4294967295u, 4294967295u), min(uint4(1u, 4294967295u, 4294967295u, 4294967295u), uint4(4294967295u, 1u, 4294967295u, 4294967295u))); + } + + [TestCompiler] + public static void min_long() + { + TestUtils.AreEqual(-9223372036854775808L, min(-9223372036854775808L, -9223372036854775808L)); + TestUtils.AreEqual(-9223372036854775808L, min(-9223372036854775808L, -1L)); + TestUtils.AreEqual(-9223372036854775808L, min(-1L, -9223372036854775808L)); + TestUtils.AreEqual(-3456L, min(-1234L, -3456L)); + TestUtils.AreEqual(-3456L, min(-3456L, -1234L)); + TestUtils.AreEqual(-1234L, min(-1234L, 3456L)); + TestUtils.AreEqual(-1234L, min(3456L, -1234L)); + TestUtils.AreEqual(1234L, min(1234L, 3456L)); + TestUtils.AreEqual(1234L, min(3456L, 1234L)); + TestUtils.AreEqual(1L, min(1L, 9223372036854775807L)); + TestUtils.AreEqual(1L, min(9223372036854775807L, 1L)); + TestUtils.AreEqual(-9223372036854775808L, min(9223372036854775807L, -9223372036854775808L)); + TestUtils.AreEqual(9223372036854775807L, min(9223372036854775807L, 9223372036854775807L)); + } + + [TestCompiler] + public static void min_ulong() + { + TestUtils.AreEqual(1234UL, min(1234UL, 3456UL)); + TestUtils.AreEqual(1234UL, min(3456UL, 1234UL)); + TestUtils.AreEqual(7UL, min(18446744073709551360UL, 7UL)); + TestUtils.AreEqual(7UL, min(7UL, 18446744073709551360UL)); + TestUtils.AreEqual(1UL, min(1UL, 18446744073709551615UL)); + TestUtils.AreEqual(1UL, min(18446744073709551615UL, 1UL)); + TestUtils.AreEqual(18446744073709551615UL, min(18446744073709551615UL, 18446744073709551615UL)); + } + + [TestCompiler] + public static void min_float() + { + TestUtils.AreEqual(float.NegativeInfinity, min(float.NegativeInfinity, float.NegativeInfinity)); + TestUtils.AreEqual(float.NegativeInfinity, min(float.NegativeInfinity, -1f)); + TestUtils.AreEqual(float.NegativeInfinity, min(-1f, float.NegativeInfinity)); + TestUtils.AreEqual(-3456.7f, min(-1234.56f, -3456.7f)); + TestUtils.AreEqual(-3456.7f, min(-3456.7f, -1234.56f)); + TestUtils.AreEqual(-1234.56f, min(-1234.56f, 3456.7f)); + TestUtils.AreEqual(-1234.56f, min(3456.7f, -1234.56f)); + TestUtils.AreEqual(1234.56f, min(1234.56f, 3456.7f)); + TestUtils.AreEqual(1234.56f, min(3456.7f, 1234.56f)); + TestUtils.AreEqual(1f, min(1f, float.PositiveInfinity)); + TestUtils.AreEqual(1f, min(float.PositiveInfinity, 1f)); + TestUtils.AreEqual(float.NegativeInfinity, min(float.PositiveInfinity, float.NegativeInfinity)); + TestUtils.AreEqual(float.PositiveInfinity, min(float.PositiveInfinity, float.PositiveInfinity)); + TestUtils.AreEqual(2.3f, min(TestUtils.SignedFloatQNaN(), 2.3f)); + TestUtils.AreEqual(2.3f, min(2.3f, TestUtils.SignedFloatQNaN())); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), min(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN())); + } + + [TestCompiler] + public static void min_float2() + { + TestUtils.AreEqual(float2(float.NegativeInfinity, float.NegativeInfinity), min(float2(float.NegativeInfinity, float.NegativeInfinity), float2(float.NegativeInfinity, -1f))); + TestUtils.AreEqual(float2(float.NegativeInfinity, -3456.7f), min(float2(-1f, -1234.56f), float2(float.NegativeInfinity, -3456.7f))); + TestUtils.AreEqual(float2(-3456.7f, -1234.56f), min(float2(-3456.7f, -1234.56f), float2(-1234.56f, 3456.7f))); + TestUtils.AreEqual(float2(-1234.56f, 1234.56f), min(float2(3456.7f, 1234.56f), float2(-1234.56f, 3456.7f))); + TestUtils.AreEqual(float2(1234.56f, 1f), min(float2(3456.7f, 1f), float2(1234.56f, float.PositiveInfinity))); + TestUtils.AreEqual(float2(1f, float.NegativeInfinity), min(float2(float.PositiveInfinity, float.PositiveInfinity), float2(1f, float.NegativeInfinity))); + TestUtils.AreEqual(float2(float.PositiveInfinity, 2.3f), min(float2(float.PositiveInfinity, TestUtils.SignedFloatQNaN()), float2(float.PositiveInfinity, 2.3f))); + TestUtils.AreEqual(float2(2.3f, TestUtils.SignedFloatQNaN()), min(float2(2.3f, TestUtils.SignedFloatQNaN()), float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()))); + } + + [TestCompiler] + public static void min_float3() + { + TestUtils.AreEqual(float3(float.NegativeInfinity, float.NegativeInfinity, float.NegativeInfinity), min(float3(float.NegativeInfinity, float.NegativeInfinity, -1f), float3(float.NegativeInfinity, -1f, float.NegativeInfinity))); + TestUtils.AreEqual(float3(-3456.7f, -3456.7f, -1234.56f), min(float3(-1234.56f, -3456.7f, -1234.56f), float3(-3456.7f, -1234.56f, 3456.7f))); + TestUtils.AreEqual(float3(-1234.56f, 1234.56f, 1234.56f), min(float3(3456.7f, 1234.56f, 3456.7f), float3(-1234.56f, 3456.7f, 1234.56f))); + TestUtils.AreEqual(float3(1f, 1f, float.NegativeInfinity), min(float3(1f, float.PositiveInfinity, float.PositiveInfinity), float3(float.PositiveInfinity, 1f, float.NegativeInfinity))); + TestUtils.AreEqual(float3(float.PositiveInfinity, 2.3f, 2.3f), min(float3(float.PositiveInfinity, TestUtils.SignedFloatQNaN(), 2.3f), float3(float.PositiveInfinity, 2.3f, TestUtils.SignedFloatQNaN()))); + TestUtils.AreEqual(float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), min(float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()))); + } + + [TestCompiler] + public static void min_float4() + { + TestUtils.AreEqual(float4(float.NegativeInfinity, float.NegativeInfinity, float.NegativeInfinity, -3456.7f), min(float4(float.NegativeInfinity, float.NegativeInfinity, -1f, -1234.56f), float4(float.NegativeInfinity, -1f, float.NegativeInfinity, -3456.7f))); + TestUtils.AreEqual(float4(-3456.7f, -1234.56f, -1234.56f, 1234.56f), min(float4(-3456.7f, -1234.56f, 3456.7f, 1234.56f), float4(-1234.56f, 3456.7f, -1234.56f, 3456.7f))); + TestUtils.AreEqual(float4(1234.56f, 1f, 1f, float.NegativeInfinity), min(float4(3456.7f, 1f, float.PositiveInfinity, float.PositiveInfinity), float4(1234.56f, float.PositiveInfinity, 1f, float.NegativeInfinity))); + TestUtils.AreEqual(float4(float.PositiveInfinity, 2.3f, 2.3f, TestUtils.SignedFloatQNaN()), min(float4(float.PositiveInfinity, TestUtils.SignedFloatQNaN(), 2.3f, TestUtils.SignedFloatQNaN()), float4(float.PositiveInfinity, 2.3f, TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()))); + } + + [TestCompiler] + public static void min_double() + { + TestUtils.AreEqual(double.NegativeInfinity, min(double.NegativeInfinity, double.NegativeInfinity)); + TestUtils.AreEqual(double.NegativeInfinity, min(double.NegativeInfinity, -1.0)); + TestUtils.AreEqual(double.NegativeInfinity, min(-1.0, double.NegativeInfinity)); + TestUtils.AreEqual(-3456.7, min(-1234.56, -3456.7)); + TestUtils.AreEqual(-3456.7, min(-3456.7, -1234.56)); + TestUtils.AreEqual(-1234.56, min(-1234.56, 3456.7)); + TestUtils.AreEqual(-1234.56, min(3456.7, -1234.56)); + TestUtils.AreEqual(1234.56, min(1234.56, 3456.7)); + TestUtils.AreEqual(1234.56, min(3456.7, 1234.56)); + TestUtils.AreEqual(1.0, min(1.0, double.PositiveInfinity)); + TestUtils.AreEqual(1.0, min(double.PositiveInfinity, 1.0)); + TestUtils.AreEqual(double.NegativeInfinity, min(double.PositiveInfinity, double.NegativeInfinity)); + TestUtils.AreEqual(double.PositiveInfinity, min(double.PositiveInfinity, double.PositiveInfinity)); + TestUtils.AreEqual(2.3, min(TestUtils.SignedDoubleQNaN(), 2.3)); + TestUtils.AreEqual(2.3, min(2.3, TestUtils.SignedDoubleQNaN())); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), min(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN())); + } + + [TestCompiler] + public static void min_double2() + { + TestUtils.AreEqual(double2(double.NegativeInfinity, double.NegativeInfinity), min(double2(double.NegativeInfinity, double.NegativeInfinity), double2(double.NegativeInfinity, -1.0))); + TestUtils.AreEqual(double2(double.NegativeInfinity, -3456.7), min(double2(-1.0, -1234.56), double2(double.NegativeInfinity, -3456.7))); + TestUtils.AreEqual(double2(-3456.7, -1234.56), min(double2(-3456.7, -1234.56), double2(-1234.56, 3456.7))); + TestUtils.AreEqual(double2(-1234.56, 1234.56), min(double2(3456.7, 1234.56), double2(-1234.56, 3456.7))); + TestUtils.AreEqual(double2(1234.56, 1.0), min(double2(3456.7, 1.0), double2(1234.56, double.PositiveInfinity))); + TestUtils.AreEqual(double2(1.0, double.NegativeInfinity), min(double2(double.PositiveInfinity, double.PositiveInfinity), double2(1.0, double.NegativeInfinity))); + TestUtils.AreEqual(double2(double.PositiveInfinity, 2.3), min(double2(double.PositiveInfinity, TestUtils.SignedDoubleQNaN()), double2(double.PositiveInfinity, 2.3))); + TestUtils.AreEqual(double2(2.3, TestUtils.SignedDoubleQNaN()), min(double2(2.3, TestUtils.SignedDoubleQNaN()), double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()))); + } + + [TestCompiler] + public static void min_double3() + { + TestUtils.AreEqual(double3(double.NegativeInfinity, double.NegativeInfinity, double.NegativeInfinity), min(double3(double.NegativeInfinity, double.NegativeInfinity, -1.0), double3(double.NegativeInfinity, -1.0, double.NegativeInfinity))); + TestUtils.AreEqual(double3(-3456.7, -3456.7, -1234.56), min(double3(-1234.56, -3456.7, -1234.56), double3(-3456.7, -1234.56, 3456.7))); + TestUtils.AreEqual(double3(-1234.56, 1234.56, 1234.56), min(double3(3456.7, 1234.56, 3456.7), double3(-1234.56, 3456.7, 1234.56))); + TestUtils.AreEqual(double3(1.0, 1.0, double.NegativeInfinity), min(double3(1.0, double.PositiveInfinity, double.PositiveInfinity), double3(double.PositiveInfinity, 1.0, double.NegativeInfinity))); + TestUtils.AreEqual(double3(double.PositiveInfinity, 2.3, 2.3), min(double3(double.PositiveInfinity, TestUtils.SignedDoubleQNaN(), 2.3), double3(double.PositiveInfinity, 2.3, TestUtils.SignedDoubleQNaN()))); + TestUtils.AreEqual(double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), min(double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()))); + } + + [TestCompiler] + public static void min_double4() + { + TestUtils.AreEqual(double4(double.NegativeInfinity, double.NegativeInfinity, double.NegativeInfinity, -3456.7), min(double4(double.NegativeInfinity, double.NegativeInfinity, -1.0, -1234.56), double4(double.NegativeInfinity, -1.0, double.NegativeInfinity, -3456.7))); + TestUtils.AreEqual(double4(-3456.7, -1234.56, -1234.56, 1234.56), min(double4(-3456.7, -1234.56, 3456.7, 1234.56), double4(-1234.56, 3456.7, -1234.56, 3456.7))); + TestUtils.AreEqual(double4(1234.56, 1.0, 1.0, double.NegativeInfinity), min(double4(3456.7, 1.0, double.PositiveInfinity, double.PositiveInfinity), double4(1234.56, double.PositiveInfinity, 1.0, double.NegativeInfinity))); + TestUtils.AreEqual(double4(double.PositiveInfinity, 2.3, 2.3, TestUtils.SignedDoubleQNaN()), min(double4(double.PositiveInfinity, TestUtils.SignedDoubleQNaN(), 2.3, TestUtils.SignedDoubleQNaN()), double4(double.PositiveInfinity, 2.3, TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()))); + } + + [TestCompiler] + public static void max_int() + { + TestUtils.AreEqual(-2147483648, max(-2147483648, -2147483648)); + TestUtils.AreEqual(-1, max(-2147483648, -1)); + TestUtils.AreEqual(-1, max(-1, -2147483648)); + TestUtils.AreEqual(-1234, max(-1234, -3456)); + TestUtils.AreEqual(-1234, max(-3456, -1234)); + TestUtils.AreEqual(3456, max(-1234, 3456)); + TestUtils.AreEqual(3456, max(3456, -1234)); + TestUtils.AreEqual(3456, max(1234, 3456)); + TestUtils.AreEqual(3456, max(3456, 1234)); + TestUtils.AreEqual(2147483647, max(1, 2147483647)); + TestUtils.AreEqual(2147483647, max(2147483647, 1)); + TestUtils.AreEqual(2147483647, max(2147483647, -2147483648)); + TestUtils.AreEqual(2147483647, max(2147483647, 2147483647)); + } + + [TestCompiler] + public static void max_int2() + { + TestUtils.AreEqual(int2(-2147483648, -1), max(int2(-2147483648, -2147483648), int2(-2147483648, -1))); + TestUtils.AreEqual(int2(-1, -1234), max(int2(-1, -1234), int2(-2147483648, -3456))); + TestUtils.AreEqual(int2(-1234, 3456), max(int2(-3456, -1234), int2(-1234, 3456))); + TestUtils.AreEqual(int2(3456, 3456), max(int2(3456, 1234), int2(-1234, 3456))); + TestUtils.AreEqual(int2(3456, 2147483647), max(int2(3456, 1), int2(1234, 2147483647))); + TestUtils.AreEqual(int2(2147483647, 2147483647), max(int2(2147483647, 2147483647), int2(1, -2147483648))); + TestUtils.AreEqual(int2(2147483647, 2147483647), max(int2(2147483647, 2147483647), int2(2147483647, 2147483647))); + } + + [TestCompiler] + public static void max_int3() + { + TestUtils.AreEqual(int3(-2147483648, -1, -1), max(int3(-2147483648, -2147483648, -1), int3(-2147483648, -1, -2147483648))); + TestUtils.AreEqual(int3(-1234, -1234, 3456), max(int3(-1234, -3456, -1234), int3(-3456, -1234, 3456))); + TestUtils.AreEqual(int3(3456, 3456, 3456), max(int3(3456, 1234, 3456), int3(-1234, 3456, 1234))); + TestUtils.AreEqual(int3(2147483647, 2147483647, 2147483647), max(int3(1, 2147483647, 2147483647), int3(2147483647, 1, -2147483648))); + TestUtils.AreEqual(int3(2147483647, 2147483647, 2147483647), max(int3(2147483647, 2147483647, 2147483647), int3(2147483647, 2147483647, 2147483647))); + } + + [TestCompiler] + public static void max_int4() + { + TestUtils.AreEqual(int4(-2147483648, -1, -1, -1234), max(int4(-2147483648, -2147483648, -1, -1234), int4(-2147483648, -1, -2147483648, -3456))); + TestUtils.AreEqual(int4(-1234, 3456, 3456, 3456), max(int4(-3456, -1234, 3456, 1234), int4(-1234, 3456, -1234, 3456))); + TestUtils.AreEqual(int4(3456, 2147483647, 2147483647, 2147483647), max(int4(3456, 1, 2147483647, 2147483647), int4(1234, 2147483647, 1, -2147483648))); + TestUtils.AreEqual(int4(2147483647, 2147483647, 2147483647, 2147483647), max(int4(2147483647, 2147483647, 2147483647, 2147483647), int4(2147483647, 2147483647, 2147483647, 2147483647))); + } + + [TestCompiler] + public static void max_uint() + { + TestUtils.AreEqual(3456u, max(1234u, 3456u)); + TestUtils.AreEqual(3456u, max(3456u, 1234u)); + TestUtils.AreEqual(4294967040u, max(4294967040u, 7u)); + TestUtils.AreEqual(4294967040u, max(7u, 4294967040u)); + TestUtils.AreEqual(4294967295u, max(1u, 4294967295u)); + TestUtils.AreEqual(4294967295u, max(4294967295u, 1u)); + TestUtils.AreEqual(4294967295u, max(4294967295u, 4294967295u)); + } + + [TestCompiler] + public static void max_uint2() + { + TestUtils.AreEqual(uint2(3456u, 3456u), max(uint2(1234u, 3456u), uint2(3456u, 1234u))); + TestUtils.AreEqual(uint2(4294967040u, 4294967040u), max(uint2(4294967040u, 7u), uint2(7u, 4294967040u))); + TestUtils.AreEqual(uint2(4294967295u, 4294967295u), max(uint2(1u, 4294967295u), uint2(4294967295u, 1u))); + TestUtils.AreEqual(uint2(4294967295u, 4294967295u), max(uint2(4294967295u, 4294967295u), uint2(4294967295u, 4294967295u))); + } + + [TestCompiler] + public static void max_uint3() + { + TestUtils.AreEqual(uint3(3456u, 3456u, 4294967040u), max(uint3(1234u, 3456u, 4294967040u), uint3(3456u, 1234u, 7u))); + TestUtils.AreEqual(uint3(4294967040u, 4294967295u, 4294967295u), max(uint3(7u, 1u, 4294967295u), uint3(4294967040u, 4294967295u, 1u))); + TestUtils.AreEqual(uint3(4294967295u, 4294967295u, 4294967295u), max(uint3(4294967295u, 4294967295u, 4294967295u), uint3(4294967295u, 4294967295u, 4294967295u))); + } + + [TestCompiler] + public static void max_uint4() + { + TestUtils.AreEqual(uint4(3456u, 3456u, 4294967040u, 4294967040u), max(uint4(1234u, 3456u, 4294967040u, 7u), uint4(3456u, 1234u, 7u, 4294967040u))); + TestUtils.AreEqual(uint4(4294967295u, 4294967295u, 4294967295u, 4294967295u), max(uint4(1u, 4294967295u, 4294967295u, 4294967295u), uint4(4294967295u, 1u, 4294967295u, 4294967295u))); + } + + [TestCompiler] + public static void max_long() + { + TestUtils.AreEqual(-9223372036854775808L, max(-9223372036854775808L, -9223372036854775808L)); + TestUtils.AreEqual(-1L, max(-9223372036854775808L, -1L)); + TestUtils.AreEqual(-1L, max(-1L, -9223372036854775808L)); + TestUtils.AreEqual(-1234L, max(-1234L, -3456L)); + TestUtils.AreEqual(-1234L, max(-3456L, -1234L)); + TestUtils.AreEqual(3456L, max(-1234L, 3456L)); + TestUtils.AreEqual(3456L, max(3456L, -1234L)); + TestUtils.AreEqual(3456L, max(1234L, 3456L)); + TestUtils.AreEqual(3456L, max(3456L, 1234L)); + TestUtils.AreEqual(9223372036854775807L, max(1L, 9223372036854775807L)); + TestUtils.AreEqual(9223372036854775807L, max(9223372036854775807L, 1L)); + TestUtils.AreEqual(9223372036854775807L, max(9223372036854775807L, -9223372036854775808L)); + TestUtils.AreEqual(9223372036854775807L, max(9223372036854775807L, 9223372036854775807L)); + } + + [TestCompiler] + public static void max_ulong() + { + TestUtils.AreEqual(3456UL, max(1234UL, 3456UL)); + TestUtils.AreEqual(3456UL, max(3456UL, 1234UL)); + TestUtils.AreEqual(18446744073709551360UL, max(18446744073709551360UL, 7UL)); + TestUtils.AreEqual(18446744073709551360UL, max(7UL, 18446744073709551360UL)); + TestUtils.AreEqual(18446744073709551615UL, max(1UL, 18446744073709551615UL)); + TestUtils.AreEqual(18446744073709551615UL, max(18446744073709551615UL, 1UL)); + TestUtils.AreEqual(18446744073709551615UL, max(18446744073709551615UL, 18446744073709551615UL)); + } + + [TestCompiler] + public static void max_float() + { + TestUtils.AreEqual(float.NegativeInfinity, max(float.NegativeInfinity, float.NegativeInfinity)); + TestUtils.AreEqual(-1f, max(float.NegativeInfinity, -1f)); + TestUtils.AreEqual(-1f, max(-1f, float.NegativeInfinity)); + TestUtils.AreEqual(-1234.56f, max(-1234.56f, -3456.7f)); + TestUtils.AreEqual(-1234.56f, max(-3456.7f, -1234.56f)); + TestUtils.AreEqual(3456.7f, max(-1234.56f, 3456.7f)); + TestUtils.AreEqual(3456.7f, max(3456.7f, -1234.56f)); + TestUtils.AreEqual(3456.7f, max(1234.56f, 3456.7f)); + TestUtils.AreEqual(3456.7f, max(3456.7f, 1234.56f)); + TestUtils.AreEqual(float.PositiveInfinity, max(1f, float.PositiveInfinity)); + TestUtils.AreEqual(float.PositiveInfinity, max(float.PositiveInfinity, 1f)); + TestUtils.AreEqual(float.PositiveInfinity, max(float.PositiveInfinity, float.NegativeInfinity)); + TestUtils.AreEqual(float.PositiveInfinity, max(float.PositiveInfinity, float.PositiveInfinity)); + TestUtils.AreEqual(2.3f, max(TestUtils.SignedFloatQNaN(), 2.3f)); + TestUtils.AreEqual(2.3f, max(2.3f, TestUtils.SignedFloatQNaN())); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), max(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN())); + } + + [TestCompiler] + public static void max_float2() + { + TestUtils.AreEqual(float2(float.NegativeInfinity, -1f), max(float2(float.NegativeInfinity, float.NegativeInfinity), float2(float.NegativeInfinity, -1f))); + TestUtils.AreEqual(float2(-1f, -1234.56f), max(float2(-1f, -1234.56f), float2(float.NegativeInfinity, -3456.7f))); + TestUtils.AreEqual(float2(-1234.56f, 3456.7f), max(float2(-3456.7f, -1234.56f), float2(-1234.56f, 3456.7f))); + TestUtils.AreEqual(float2(3456.7f, 3456.7f), max(float2(3456.7f, 1234.56f), float2(-1234.56f, 3456.7f))); + TestUtils.AreEqual(float2(3456.7f, float.PositiveInfinity), max(float2(3456.7f, 1f), float2(1234.56f, float.PositiveInfinity))); + TestUtils.AreEqual(float2(float.PositiveInfinity, float.PositiveInfinity), max(float2(float.PositiveInfinity, float.PositiveInfinity), float2(1f, float.NegativeInfinity))); + TestUtils.AreEqual(float2(float.PositiveInfinity, 2.3f), max(float2(float.PositiveInfinity, TestUtils.SignedFloatQNaN()), float2(float.PositiveInfinity, 2.3f))); + TestUtils.AreEqual(float2(2.3f, TestUtils.SignedFloatQNaN()), max(float2(2.3f, TestUtils.SignedFloatQNaN()), float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()))); + } + + [TestCompiler] + public static void max_float3() + { + TestUtils.AreEqual(float3(float.NegativeInfinity, -1f, -1f), max(float3(float.NegativeInfinity, float.NegativeInfinity, -1f), float3(float.NegativeInfinity, -1f, float.NegativeInfinity))); + TestUtils.AreEqual(float3(-1234.56f, -1234.56f, 3456.7f), max(float3(-1234.56f, -3456.7f, -1234.56f), float3(-3456.7f, -1234.56f, 3456.7f))); + TestUtils.AreEqual(float3(3456.7f, 3456.7f, 3456.7f), max(float3(3456.7f, 1234.56f, 3456.7f), float3(-1234.56f, 3456.7f, 1234.56f))); + TestUtils.AreEqual(float3(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity), max(float3(1f, float.PositiveInfinity, float.PositiveInfinity), float3(float.PositiveInfinity, 1f, float.NegativeInfinity))); + TestUtils.AreEqual(float3(float.PositiveInfinity, 2.3f, 2.3f), max(float3(float.PositiveInfinity, TestUtils.SignedFloatQNaN(), 2.3f), float3(float.PositiveInfinity, 2.3f, TestUtils.SignedFloatQNaN()))); + TestUtils.AreEqual(float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), max(float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()))); + } + + [TestCompiler] + public static void max_float4() + { + TestUtils.AreEqual(float4(float.NegativeInfinity, -1f, -1f, -1234.56f), max(float4(float.NegativeInfinity, float.NegativeInfinity, -1f, -1234.56f), float4(float.NegativeInfinity, -1f, float.NegativeInfinity, -3456.7f))); + TestUtils.AreEqual(float4(-1234.56f, 3456.7f, 3456.7f, 3456.7f), max(float4(-3456.7f, -1234.56f, 3456.7f, 1234.56f), float4(-1234.56f, 3456.7f, -1234.56f, 3456.7f))); + TestUtils.AreEqual(float4(3456.7f, float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity), max(float4(3456.7f, 1f, float.PositiveInfinity, float.PositiveInfinity), float4(1234.56f, float.PositiveInfinity, 1f, float.NegativeInfinity))); + TestUtils.AreEqual(float4(float.PositiveInfinity, 2.3f, 2.3f, TestUtils.SignedFloatQNaN()), max(float4(float.PositiveInfinity, TestUtils.SignedFloatQNaN(), 2.3f, TestUtils.SignedFloatQNaN()), float4(float.PositiveInfinity, 2.3f, TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()))); + } + + [TestCompiler] + public static void max_double() + { + TestUtils.AreEqual(double.NegativeInfinity, max(double.NegativeInfinity, double.NegativeInfinity)); + TestUtils.AreEqual(-1.0, max(double.NegativeInfinity, -1.0)); + TestUtils.AreEqual(-1.0, max(-1.0, double.NegativeInfinity)); + TestUtils.AreEqual(-1234.56, max(-1234.56, -3456.7)); + TestUtils.AreEqual(-1234.56, max(-3456.7, -1234.56)); + TestUtils.AreEqual(3456.7, max(-1234.56, 3456.7)); + TestUtils.AreEqual(3456.7, max(3456.7, -1234.56)); + TestUtils.AreEqual(3456.7, max(1234.56, 3456.7)); + TestUtils.AreEqual(3456.7, max(3456.7, 1234.56)); + TestUtils.AreEqual(double.PositiveInfinity, max(1.0, double.PositiveInfinity)); + TestUtils.AreEqual(double.PositiveInfinity, max(double.PositiveInfinity, 1.0)); + TestUtils.AreEqual(double.PositiveInfinity, max(double.PositiveInfinity, double.NegativeInfinity)); + TestUtils.AreEqual(double.PositiveInfinity, max(double.PositiveInfinity, double.PositiveInfinity)); + TestUtils.AreEqual(2.3, max(TestUtils.SignedDoubleQNaN(), 2.3)); + TestUtils.AreEqual(2.3, max(2.3, TestUtils.SignedDoubleQNaN())); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), max(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN())); + } + + [TestCompiler] + public static void max_double2() + { + TestUtils.AreEqual(double2(double.NegativeInfinity, -1.0), max(double2(double.NegativeInfinity, double.NegativeInfinity), double2(double.NegativeInfinity, -1.0))); + TestUtils.AreEqual(double2(-1.0, -1234.56), max(double2(-1.0, -1234.56), double2(double.NegativeInfinity, -3456.7))); + TestUtils.AreEqual(double2(-1234.56, 3456.7), max(double2(-3456.7, -1234.56), double2(-1234.56, 3456.7))); + TestUtils.AreEqual(double2(3456.7, 3456.7), max(double2(3456.7, 1234.56), double2(-1234.56, 3456.7))); + TestUtils.AreEqual(double2(3456.7, double.PositiveInfinity), max(double2(3456.7, 1.0), double2(1234.56, double.PositiveInfinity))); + TestUtils.AreEqual(double2(double.PositiveInfinity, double.PositiveInfinity), max(double2(double.PositiveInfinity, double.PositiveInfinity), double2(1.0, double.NegativeInfinity))); + TestUtils.AreEqual(double2(double.PositiveInfinity, 2.3), max(double2(double.PositiveInfinity, TestUtils.SignedDoubleQNaN()), double2(double.PositiveInfinity, 2.3))); + TestUtils.AreEqual(double2(2.3, TestUtils.SignedDoubleQNaN()), max(double2(2.3, TestUtils.SignedDoubleQNaN()), double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()))); + } + + [TestCompiler] + public static void max_double3() + { + TestUtils.AreEqual(double3(double.NegativeInfinity, -1.0, -1.0), max(double3(double.NegativeInfinity, double.NegativeInfinity, -1.0), double3(double.NegativeInfinity, -1.0, double.NegativeInfinity))); + TestUtils.AreEqual(double3(-1234.56, -1234.56, 3456.7), max(double3(-1234.56, -3456.7, -1234.56), double3(-3456.7, -1234.56, 3456.7))); + TestUtils.AreEqual(double3(3456.7, 3456.7, 3456.7), max(double3(3456.7, 1234.56, 3456.7), double3(-1234.56, 3456.7, 1234.56))); + TestUtils.AreEqual(double3(double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity), max(double3(1.0, double.PositiveInfinity, double.PositiveInfinity), double3(double.PositiveInfinity, 1.0, double.NegativeInfinity))); + TestUtils.AreEqual(double3(double.PositiveInfinity, 2.3, 2.3), max(double3(double.PositiveInfinity, TestUtils.SignedDoubleQNaN(), 2.3), double3(double.PositiveInfinity, 2.3, TestUtils.SignedDoubleQNaN()))); + TestUtils.AreEqual(double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), max(double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()))); + } + + [TestCompiler] + public static void max_double4() + { + TestUtils.AreEqual(double4(double.NegativeInfinity, -1.0, -1.0, -1234.56), max(double4(double.NegativeInfinity, double.NegativeInfinity, -1.0, -1234.56), double4(double.NegativeInfinity, -1.0, double.NegativeInfinity, -3456.7))); + TestUtils.AreEqual(double4(-1234.56, 3456.7, 3456.7, 3456.7), max(double4(-3456.7, -1234.56, 3456.7, 1234.56), double4(-1234.56, 3456.7, -1234.56, 3456.7))); + TestUtils.AreEqual(double4(3456.7, double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity), max(double4(3456.7, 1.0, double.PositiveInfinity, double.PositiveInfinity), double4(1234.56, double.PositiveInfinity, 1.0, double.NegativeInfinity))); + TestUtils.AreEqual(double4(double.PositiveInfinity, 2.3, 2.3, TestUtils.SignedDoubleQNaN()), max(double4(double.PositiveInfinity, TestUtils.SignedDoubleQNaN(), 2.3, TestUtils.SignedDoubleQNaN()), double4(double.PositiveInfinity, 2.3, TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()))); + } + + [TestCompiler] + public static void smoothstep_float() + { + TestUtils.AreEqual(0f, smoothstep(-123.45f, 345.6f, float.NegativeInfinity), 8, false); + TestUtils.AreEqual(0f, smoothstep(-123.45f, 345.6f, -200f), 8, false); + TestUtils.AreEqual(0.00724848127f, smoothstep(-123.45f, 345.6f, -100f), 8, false); + TestUtils.AreEqual(1f, smoothstep(-123.45f, 345.6f, 400f), 8, false); + TestUtils.AreEqual(1f, smoothstep(-123.45f, 345.6f, float.PositiveInfinity), 8, false); + TestUtils.AreEqual(1f, smoothstep(-123.45f, 345.6f, TestUtils.SignedFloatQNaN()), 8, false); + TestUtils.AreEqual(1f, smoothstep(345.6f, -123.45f, float.NegativeInfinity), 8, false); + TestUtils.AreEqual(1f, smoothstep(345.6f, -123.45f, -200f), 8, false); + TestUtils.AreEqual(0.992751539f, smoothstep(345.6f, -123.45f, -100f), 8, false); + TestUtils.AreEqual(0f, smoothstep(345.6f, -123.45f, 400f), 8, false); + TestUtils.AreEqual(0f, smoothstep(345.6f, -123.45f, float.PositiveInfinity), 8, false); + TestUtils.AreEqual(1f, smoothstep(345.6f, -123.45f, TestUtils.SignedFloatQNaN()), 8, false); + } + + [TestCompiler] + public static void smoothstep_float2() + { + TestUtils.AreEqual(float2(0f, 0f), smoothstep(float2(-123.45f, -123.45f), float2(345.6f, 345.6f), float2(float.NegativeInfinity, -200f)), 8, false); + TestUtils.AreEqual(float2(0.00724848127f, 1f), smoothstep(float2(-123.45f, -123.45f), float2(345.6f, 345.6f), float2(-100f, 400f)), 8, false); + TestUtils.AreEqual(float2(1f, 1f), smoothstep(float2(-123.45f, -123.45f), float2(345.6f, 345.6f), float2(float.PositiveInfinity, TestUtils.SignedFloatQNaN())), 8, false); + TestUtils.AreEqual(float2(1f, 1f), smoothstep(float2(345.6f, 345.6f), float2(-123.45f, -123.45f), float2(float.NegativeInfinity, -200f)), 8, false); + TestUtils.AreEqual(float2(0.992751539f, 0f), smoothstep(float2(345.6f, 345.6f), float2(-123.45f, -123.45f), float2(-100f, 400f)), 8, false); + TestUtils.AreEqual(float2(0f, 1f), smoothstep(float2(345.6f, 345.6f), float2(-123.45f, -123.45f), float2(float.PositiveInfinity, TestUtils.SignedFloatQNaN())), 8, false); + } + + [TestCompiler] + public static void smoothstep_float3() + { + TestUtils.AreEqual(float3(0f, 0f, 0.00724848127f), smoothstep(float3(-123.45f, -123.45f, -123.45f), float3(345.6f, 345.6f, 345.6f), float3(float.NegativeInfinity, -200f, -100f)), 8, false); + TestUtils.AreEqual(float3(1f, 1f, 1f), smoothstep(float3(-123.45f, -123.45f, -123.45f), float3(345.6f, 345.6f, 345.6f), float3(400f, float.PositiveInfinity, TestUtils.SignedFloatQNaN())), 8, false); + TestUtils.AreEqual(float3(1f, 1f, 0.992751539f), smoothstep(float3(345.6f, 345.6f, 345.6f), float3(-123.45f, -123.45f, -123.45f), float3(float.NegativeInfinity, -200f, -100f)), 8, false); + TestUtils.AreEqual(float3(0f, 0f, 1f), smoothstep(float3(345.6f, 345.6f, 345.6f), float3(-123.45f, -123.45f, -123.45f), float3(400f, float.PositiveInfinity, TestUtils.SignedFloatQNaN())), 8, false); + } + + [TestCompiler] + public static void smoothstep_float4() + { + TestUtils.AreEqual(float4(0f, 0f, 0.00724848127f, 1f), smoothstep(float4(-123.45f, -123.45f, -123.45f, -123.45f), float4(345.6f, 345.6f, 345.6f, 345.6f), float4(float.NegativeInfinity, -200f, -100f, 400f)), 8, false); + TestUtils.AreEqual(float4(1f, 1f, 1f, 1f), smoothstep(float4(-123.45f, -123.45f, 345.6f, 345.6f), float4(345.6f, 345.6f, -123.45f, -123.45f), float4(float.PositiveInfinity, TestUtils.SignedFloatQNaN(), float.NegativeInfinity, -200f)), 8, false); + TestUtils.AreEqual(float4(0.992751539f, 0f, 0f, 1f), smoothstep(float4(345.6f, 345.6f, 345.6f, 345.6f), float4(-123.45f, -123.45f, -123.45f, -123.45f), float4(-100f, 400f, float.PositiveInfinity, TestUtils.SignedFloatQNaN())), 8, false); + } + + [TestCompiler] + public static void smoothstep_double() + { + TestUtils.AreEqual(0.0, smoothstep(-123.45, 345.6, double.NegativeInfinity), 8, false); + TestUtils.AreEqual(0.0, smoothstep(-123.45, 345.6, -200.0), 8, false); + TestUtils.AreEqual(0.0072484810488798995, smoothstep(-123.45, 345.6, -100.0), 8, false); + TestUtils.AreEqual(1.0, smoothstep(-123.45, 345.6, 400.0), 8, false); + TestUtils.AreEqual(1.0, smoothstep(-123.45, 345.6, double.PositiveInfinity), 8, false); + TestUtils.AreEqual(1.0, smoothstep(-123.45, 345.6, TestUtils.SignedDoubleQNaN()), 8, false); + TestUtils.AreEqual(1.0, smoothstep(345.6, -123.45, double.NegativeInfinity), 8, false); + TestUtils.AreEqual(1.0, smoothstep(345.6, -123.45, -200.0), 8, false); + TestUtils.AreEqual(0.99275151895112013, smoothstep(345.6, -123.45, -100.0), 8, false); + TestUtils.AreEqual(0.0, smoothstep(345.6, -123.45, 400.0), 8, false); + TestUtils.AreEqual(0.0, smoothstep(345.6, -123.45, double.PositiveInfinity), 8, false); + TestUtils.AreEqual(1.0, smoothstep(345.6, -123.45, TestUtils.SignedDoubleQNaN()), 8, false); + } + + [TestCompiler] + public static void smoothstep_double2() + { + TestUtils.AreEqual(double2(0.0, 0.0), smoothstep(double2(-123.45, -123.45), double2(345.6, 345.6), double2(double.NegativeInfinity, -200.0)), 8, false); + TestUtils.AreEqual(double2(0.0072484810488798995, 1.0), smoothstep(double2(-123.45, -123.45), double2(345.6, 345.6), double2(-100.0, 400.0)), 8, false); + TestUtils.AreEqual(double2(1.0, 1.0), smoothstep(double2(-123.45, -123.45), double2(345.6, 345.6), double2(double.PositiveInfinity, TestUtils.SignedDoubleQNaN())), 8, false); + TestUtils.AreEqual(double2(1.0, 1.0), smoothstep(double2(345.6, 345.6), double2(-123.45, -123.45), double2(double.NegativeInfinity, -200.0)), 8, false); + TestUtils.AreEqual(double2(0.99275151895112013, 0.0), smoothstep(double2(345.6, 345.6), double2(-123.45, -123.45), double2(-100.0, 400.0)), 8, false); + TestUtils.AreEqual(double2(0.0, 1.0), smoothstep(double2(345.6, 345.6), double2(-123.45, -123.45), double2(double.PositiveInfinity, TestUtils.SignedDoubleQNaN())), 8, false); + } + + [TestCompiler] + public static void smoothstep_double3() + { + TestUtils.AreEqual(double3(0.0, 0.0, 0.0072484810488798995), smoothstep(double3(-123.45, -123.45, -123.45), double3(345.6, 345.6, 345.6), double3(double.NegativeInfinity, -200.0, -100.0)), 8, false); + TestUtils.AreEqual(double3(1.0, 1.0, 1.0), smoothstep(double3(-123.45, -123.45, -123.45), double3(345.6, 345.6, 345.6), double3(400.0, double.PositiveInfinity, TestUtils.SignedDoubleQNaN())), 8, false); + TestUtils.AreEqual(double3(1.0, 1.0, 0.99275151895112013), smoothstep(double3(345.6, 345.6, 345.6), double3(-123.45, -123.45, -123.45), double3(double.NegativeInfinity, -200.0, -100.0)), 8, false); + TestUtils.AreEqual(double3(0.0, 0.0, 1.0), smoothstep(double3(345.6, 345.6, 345.6), double3(-123.45, -123.45, -123.45), double3(400.0, double.PositiveInfinity, TestUtils.SignedDoubleQNaN())), 8, false); + } + + [TestCompiler] + public static void smoothstep_double4() + { + TestUtils.AreEqual(double4(0.0, 0.0, 0.0072484810488798995, 1.0), smoothstep(double4(-123.45, -123.45, -123.45, -123.45), double4(345.6, 345.6, 345.6, 345.6), double4(double.NegativeInfinity, -200.0, -100.0, 400.0)), 8, false); + TestUtils.AreEqual(double4(1.0, 1.0, 1.0, 1.0), smoothstep(double4(-123.45, -123.45, 345.6, 345.6), double4(345.6, 345.6, -123.45, -123.45), double4(double.PositiveInfinity, TestUtils.SignedDoubleQNaN(), double.NegativeInfinity, -200.0)), 8, false); + TestUtils.AreEqual(double4(0.99275151895112013, 0.0, 0.0, 1.0), smoothstep(double4(345.6, 345.6, 345.6, 345.6), double4(-123.45, -123.45, -123.45, -123.45), double4(-100.0, 400.0, double.PositiveInfinity, TestUtils.SignedDoubleQNaN())), 8, false); + } + + [TestCompiler] + public static void mad_int() + { + TestUtils.AreEqual(7097663, mad(1234, 5678, 91011)); + TestUtils.AreEqual(6915641, mad(1234, 5678, -91011)); + TestUtils.AreEqual(-6915641, mad(1234, -5678, 91011)); + TestUtils.AreEqual(-7097663, mad(1234, -5678, -91011)); + TestUtils.AreEqual(-6915641, mad(-1234, 5678, 91011)); + TestUtils.AreEqual(-7097663, mad(-1234, 5678, -91011)); + TestUtils.AreEqual(7097663, mad(-1234, -5678, 91011)); + TestUtils.AreEqual(6915641, mad(-1234, -5678, -91011)); + TestUtils.AreEqual(1313889300, mad(98765, 56789, 91011)); + TestUtils.AreEqual(1313707278, mad(98765, 56789, -91011)); + TestUtils.AreEqual(-1313707278, mad(98765, -56789, 91011)); + TestUtils.AreEqual(-1313889300, mad(98765, -56789, -91011)); + TestUtils.AreEqual(-1313707278, mad(-98765, 56789, 91011)); + TestUtils.AreEqual(-1313889300, mad(-98765, 56789, -91011)); + TestUtils.AreEqual(1313889300, mad(-98765, -56789, 91011)); + TestUtils.AreEqual(1313707278, mad(-98765, -56789, -91011)); + } + + [TestCompiler] + public static void mad_int2() + { + TestUtils.AreEqual(int2(7097663, 6915641), mad(int2(1234, 1234), int2(5678, 5678), int2(91011, -91011))); + TestUtils.AreEqual(int2(-6915641, -7097663), mad(int2(1234, 1234), int2(-5678, -5678), int2(91011, -91011))); + TestUtils.AreEqual(int2(-6915641, -7097663), mad(int2(-1234, -1234), int2(5678, 5678), int2(91011, -91011))); + TestUtils.AreEqual(int2(7097663, 6915641), mad(int2(-1234, -1234), int2(-5678, -5678), int2(91011, -91011))); + TestUtils.AreEqual(int2(1313889300, 1313707278), mad(int2(98765, 98765), int2(56789, 56789), int2(91011, -91011))); + TestUtils.AreEqual(int2(-1313707278, -1313889300), mad(int2(98765, 98765), int2(-56789, -56789), int2(91011, -91011))); + TestUtils.AreEqual(int2(-1313707278, -1313889300), mad(int2(-98765, -98765), int2(56789, 56789), int2(91011, -91011))); + TestUtils.AreEqual(int2(1313889300, 1313707278), mad(int2(-98765, -98765), int2(-56789, -56789), int2(91011, -91011))); + } + + [TestCompiler] + public static void mad_int3() + { + TestUtils.AreEqual(int3(7097663, 6915641, -6915641), mad(int3(1234, 1234, 1234), int3(5678, 5678, -5678), int3(91011, -91011, 91011))); + TestUtils.AreEqual(int3(-7097663, -6915641, -7097663), mad(int3(1234, -1234, -1234), int3(-5678, 5678, 5678), int3(-91011, 91011, -91011))); + TestUtils.AreEqual(int3(7097663, 6915641, 1313889300), mad(int3(-1234, -1234, 98765), int3(-5678, -5678, 56789), int3(91011, -91011, 91011))); + TestUtils.AreEqual(int3(1313707278, -1313707278, -1313889300), mad(int3(98765, 98765, 98765), int3(56789, -56789, -56789), int3(-91011, 91011, -91011))); + TestUtils.AreEqual(int3(-1313707278, -1313889300, 1313889300), mad(int3(-98765, -98765, -98765), int3(56789, 56789, -56789), int3(91011, -91011, 91011))); + TestUtils.AreEqual(int3(1313707278, 1313707278, 1313707278), mad(int3(-98765, -98765, -98765), int3(-56789, -56789, -56789), int3(-91011, -91011, -91011))); + } + + [TestCompiler] + public static void mad_int4() + { + TestUtils.AreEqual(int4(7097663, 6915641, -6915641, -7097663), mad(int4(1234, 1234, 1234, 1234), int4(5678, 5678, -5678, -5678), int4(91011, -91011, 91011, -91011))); + TestUtils.AreEqual(int4(-6915641, -7097663, 7097663, 6915641), mad(int4(-1234, -1234, -1234, -1234), int4(5678, 5678, -5678, -5678), int4(91011, -91011, 91011, -91011))); + TestUtils.AreEqual(int4(1313889300, 1313707278, -1313707278, -1313889300), mad(int4(98765, 98765, 98765, 98765), int4(56789, 56789, -56789, -56789), int4(91011, -91011, 91011, -91011))); + TestUtils.AreEqual(int4(-1313707278, -1313889300, 1313889300, 1313707278), mad(int4(-98765, -98765, -98765, -98765), int4(56789, 56789, -56789, -56789), int4(91011, -91011, 91011, -91011))); + } + + [TestCompiler] + public static void mad_uint() + { + TestUtils.AreEqual(7097663u, mad(1234u, 5678u, 91011u)); + TestUtils.AreEqual(1313889300u, mad(98765u, 56789u, 91011u)); + } + + [TestCompiler] + public static void mad_uint2() + { + TestUtils.AreEqual(uint2(7097663u, 1313889300u), mad(uint2(1234u, 98765u), uint2(5678u, 56789u), uint2(91011u, 91011u))); + } + + [TestCompiler] + public static void mad_uint3() + { + TestUtils.AreEqual(uint3(7097663u, 1313889300u, 1313889300u), mad(uint3(1234u, 98765u, 98765u), uint3(5678u, 56789u, 56789u), uint3(91011u, 91011u, 91011u))); + } + + [TestCompiler] + public static void mad_uint4() + { + TestUtils.AreEqual(uint4(7097663u, 1313889300u, 1313889300u, 1313889300u), mad(uint4(1234u, 98765u, 98765u, 98765u), uint4(5678u, 56789u, 56789u, 56789u), uint4(91011u, 91011u, 91011u, 91011u))); + } + + [TestCompiler] + public static void mad_long() + { + TestUtils.AreEqual(7097663L, mad(1234L, 5678L, 91011L)); + TestUtils.AreEqual(6915641L, mad(1234L, 5678L, -91011L)); + TestUtils.AreEqual(-6915641L, mad(1234L, -5678L, 91011L)); + TestUtils.AreEqual(-7097663L, mad(1234L, -5678L, -91011L)); + TestUtils.AreEqual(-6915641L, mad(-1234L, 5678L, 91011L)); + TestUtils.AreEqual(-7097663L, mad(-1234L, 5678L, -91011L)); + TestUtils.AreEqual(7097663L, mad(-1234L, -5678L, 91011L)); + TestUtils.AreEqual(6915641L, mad(-1234L, -5678L, -91011L)); + TestUtils.AreEqual(747681210895778426L, mad(9876543210L, 5678901234L, 9101112134L)); + TestUtils.AreEqual(747681192693554158L, mad(9876543210L, 5678901234L, -9101112134L)); + TestUtils.AreEqual(-747681192693554158L, mad(9876543210L, -5678901234L, 9101112134L)); + TestUtils.AreEqual(-747681210895778426L, mad(9876543210L, -5678901234L, -9101112134L)); + TestUtils.AreEqual(-747681192693554158L, mad(-9876543210L, 5678901234L, 9101112134L)); + TestUtils.AreEqual(-747681210895778426L, mad(-9876543210L, 5678901234L, -9101112134L)); + TestUtils.AreEqual(747681210895778426L, mad(-9876543210L, -5678901234L, 9101112134L)); + TestUtils.AreEqual(747681192693554158L, mad(-9876543210L, -5678901234L, -9101112134L)); + } + + [TestCompiler] + public static void mad_ulong() + { + TestUtils.AreEqual(7097663L, mad(1234UL, 5678UL, 91011UL)); + TestUtils.AreEqual(747681210895778426L, mad(9876543210UL, 5678901234UL, 9101112134UL)); + } + + [TestCompiler] + public static void mad_float() + { + TestUtils.AreEqual(-42660f, mad(-123.45f, 345.6f, 4.321f), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), mad(TestUtils.SignedFloatQNaN(), 345.6f, 4.321f), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), mad(-123.45f, TestUtils.SignedFloatQNaN(), 4.321f), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), mad(-123.45f, 345.6f, TestUtils.SignedFloatQNaN()), 1, false); + } + + [TestCompiler] + public static void mad_float2() + { + TestUtils.AreEqual(float2(-42660f, TestUtils.SignedFloatQNaN()), mad(float2(-123.45f, TestUtils.SignedFloatQNaN()), float2(345.6f, 345.6f), float2(4.321f, 4.321f)), 1, false); + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), mad(float2(-123.45f, -123.45f), float2(TestUtils.SignedFloatQNaN(), 345.6f), float2(4.321f, TestUtils.SignedFloatQNaN())), 1, false); + } + + [TestCompiler] + public static void mad_float3() + { + TestUtils.AreEqual(float3(-42660f, TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), mad(float3(-123.45f, TestUtils.SignedFloatQNaN(), -123.45f), float3(345.6f, 345.6f, TestUtils.SignedFloatQNaN()), float3(4.321f, 4.321f, 4.321f)), 1, false); + TestUtils.AreEqual(float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), mad(float3(-123.45f, -123.45f, -123.45f), float3(345.6f, 345.6f, 345.6f), float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN())), 1, false); + } + + [TestCompiler] + public static void mad_float4() + { + TestUtils.AreEqual(float4(-42660f, TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), mad(float4(-123.45f, TestUtils.SignedFloatQNaN(), -123.45f, -123.45f), float4(345.6f, 345.6f, TestUtils.SignedFloatQNaN(), 345.6f), float4(4.321f, 4.321f, 4.321f, TestUtils.SignedFloatQNaN())), 1, false); + } + + [TestCompiler] + public static void mad_double() + { + TestUtils.AreEqual(-42659.999, mad(-123.45, 345.6, 4.321), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), mad(TestUtils.SignedDoubleQNaN(), 345.6, 4.321), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), mad(-123.45, TestUtils.SignedDoubleQNaN(), 4.321), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), mad(-123.45, 345.6, TestUtils.SignedDoubleQNaN()), 1, false); + } + + [TestCompiler] + public static void mad_double2() + { + TestUtils.AreEqual(double2(-42659.999, TestUtils.SignedDoubleQNaN()), mad(double2(-123.45, TestUtils.SignedDoubleQNaN()), double2(345.6, 345.6), double2(4.321, 4.321)), 1, false); + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), mad(double2(-123.45, -123.45), double2(TestUtils.SignedDoubleQNaN(), 345.6), double2(4.321, TestUtils.SignedDoubleQNaN())), 1, false); + } + + [TestCompiler] + public static void mad_double3() + { + TestUtils.AreEqual(double3(-42659.999, TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), mad(double3(-123.45, TestUtils.SignedDoubleQNaN(), -123.45), double3(345.6, 345.6, TestUtils.SignedDoubleQNaN()), double3(4.321, 4.321, 4.321)), 1, false); + TestUtils.AreEqual(double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), mad(double3(-123.45, -123.45, -123.45), double3(345.6, 345.6, 345.6), double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN())), 1, false); + } + + [TestCompiler] + public static void mad_double4() + { + TestUtils.AreEqual(double4(-42659.999, TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), mad(double4(-123.45, TestUtils.SignedDoubleQNaN(), -123.45, -123.45), double4(345.6, 345.6, TestUtils.SignedDoubleQNaN(), 345.6), double4(4.321, 4.321, 4.321, TestUtils.SignedDoubleQNaN())), 1, false); + } + + [TestCompiler] + public static void fmod_float() + { + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), fmod(float.NegativeInfinity, float.NegativeInfinity), 1, false); + TestUtils.AreEqual(-323.4f, fmod(-323.4f, float.NegativeInfinity), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatZero(), fmod(TestUtils.SignedFloatZero(), float.NegativeInfinity), 1, false); + TestUtils.AreEqual(0f, fmod(0f, float.NegativeInfinity), 1, false); + TestUtils.AreEqual(323.4f, fmod(323.4f, float.NegativeInfinity), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), fmod(float.PositiveInfinity, float.NegativeInfinity), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), fmod(TestUtils.SignedFloatQNaN(), float.NegativeInfinity), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), fmod(float.NegativeInfinity, -123.6f), 1, false); + TestUtils.AreEqual(-76.2f, fmod(-323.4f, -123.6f), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatZero(), fmod(TestUtils.SignedFloatZero(), -123.6f), 1, false); + TestUtils.AreEqual(0f, fmod(0f, -123.6f), 1, false); + TestUtils.AreEqual(76.2f, fmod(323.4f, -123.6f), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), fmod(float.PositiveInfinity, -123.6f), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), fmod(TestUtils.SignedFloatQNaN(), -123.6f), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), fmod(float.NegativeInfinity, TestUtils.SignedFloatZero()), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), fmod(-323.4f, TestUtils.SignedFloatZero()), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), fmod(TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero()), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), fmod(0f, TestUtils.SignedFloatZero()), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), fmod(323.4f, TestUtils.SignedFloatZero()), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), fmod(float.PositiveInfinity, TestUtils.SignedFloatZero()), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), fmod(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatZero()), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), fmod(float.NegativeInfinity, 0f), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), fmod(-323.4f, 0f), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), fmod(TestUtils.SignedFloatZero(), 0f), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), fmod(0f, 0f), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), fmod(323.4f, 0f), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), fmod(float.PositiveInfinity, 0f), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), fmod(TestUtils.SignedFloatQNaN(), 0f), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), fmod(float.NegativeInfinity, 123.6f), 1, false); + TestUtils.AreEqual(-76.2f, fmod(-323.4f, 123.6f), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatZero(), fmod(TestUtils.SignedFloatZero(), 123.6f), 1, false); + TestUtils.AreEqual(0f, fmod(0f, 123.6f), 1, false); + TestUtils.AreEqual(76.2f, fmod(323.4f, 123.6f), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), fmod(float.PositiveInfinity, 123.6f), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), fmod(TestUtils.SignedFloatQNaN(), 123.6f), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), fmod(float.NegativeInfinity, float.PositiveInfinity), 1, false); + TestUtils.AreEqual(-323.4f, fmod(-323.4f, float.PositiveInfinity), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatZero(), fmod(TestUtils.SignedFloatZero(), float.PositiveInfinity), 1, false); + TestUtils.AreEqual(0f, fmod(0f, float.PositiveInfinity), 1, false); + TestUtils.AreEqual(323.4f, fmod(323.4f, float.PositiveInfinity), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), fmod(float.PositiveInfinity, float.PositiveInfinity), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), fmod(TestUtils.SignedFloatQNaN(), float.PositiveInfinity), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), fmod(float.NegativeInfinity, TestUtils.SignedFloatQNaN()), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), fmod(-323.4f, TestUtils.SignedFloatQNaN()), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), fmod(TestUtils.SignedFloatZero(), TestUtils.SignedFloatQNaN()), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), fmod(0f, TestUtils.SignedFloatQNaN()), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), fmod(323.4f, TestUtils.SignedFloatQNaN()), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), fmod(float.PositiveInfinity, TestUtils.SignedFloatQNaN()), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), fmod(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), 1, false); + } + + [TestCompiler] + public static void fmod_float2() + { + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), -323.4f), fmod(float2(float.NegativeInfinity, -323.4f), float2(float.NegativeInfinity, float.NegativeInfinity)), 1, false); + TestUtils.AreEqual(float2(TestUtils.SignedFloatZero(), 0f), fmod(float2(TestUtils.SignedFloatZero(), 0f), float2(float.NegativeInfinity, float.NegativeInfinity)), 1, false); + TestUtils.AreEqual(float2(323.4f, TestUtils.SignedFloatQNaN()), fmod(float2(323.4f, float.PositiveInfinity), float2(float.NegativeInfinity, float.NegativeInfinity)), 1, false); + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), fmod(float2(TestUtils.SignedFloatQNaN(), float.NegativeInfinity), float2(float.NegativeInfinity, -123.6f)), 1, false); + TestUtils.AreEqual(float2(-76.2f, TestUtils.SignedFloatZero()), fmod(float2(-323.4f, TestUtils.SignedFloatZero()), float2(-123.6f, -123.6f)), 1, false); + TestUtils.AreEqual(float2(0f, 76.2f), fmod(float2(0f, 323.4f), float2(-123.6f, -123.6f)), 1, false); + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), fmod(float2(float.PositiveInfinity, TestUtils.SignedFloatQNaN()), float2(-123.6f, -123.6f)), 1, false); + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), fmod(float2(float.NegativeInfinity, -323.4f), float2(TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero())), 1, false); + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), fmod(float2(TestUtils.SignedFloatZero(), 0f), float2(TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero())), 1, false); + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), fmod(float2(323.4f, float.PositiveInfinity), float2(TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero())), 1, false); + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), fmod(float2(TestUtils.SignedFloatQNaN(), float.NegativeInfinity), float2(TestUtils.SignedFloatZero(), 0f)), 1, false); + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), fmod(float2(-323.4f, TestUtils.SignedFloatZero()), float2(0f, 0f)), 1, false); + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), fmod(float2(0f, 323.4f), float2(0f, 0f)), 1, false); + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), fmod(float2(float.PositiveInfinity, TestUtils.SignedFloatQNaN()), float2(0f, 0f)), 1, false); + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), -76.2f), fmod(float2(float.NegativeInfinity, -323.4f), float2(123.6f, 123.6f)), 1, false); + TestUtils.AreEqual(float2(TestUtils.SignedFloatZero(), 0f), fmod(float2(TestUtils.SignedFloatZero(), 0f), float2(123.6f, 123.6f)), 1, false); + TestUtils.AreEqual(float2(76.2f, TestUtils.SignedFloatQNaN()), fmod(float2(323.4f, float.PositiveInfinity), float2(123.6f, 123.6f)), 1, false); + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), fmod(float2(TestUtils.SignedFloatQNaN(), float.NegativeInfinity), float2(123.6f, float.PositiveInfinity)), 1, false); + TestUtils.AreEqual(float2(-323.4f, TestUtils.SignedFloatZero()), fmod(float2(-323.4f, TestUtils.SignedFloatZero()), float2(float.PositiveInfinity, float.PositiveInfinity)), 1, false); + TestUtils.AreEqual(float2(0f, 323.4f), fmod(float2(0f, 323.4f), float2(float.PositiveInfinity, float.PositiveInfinity)), 1, false); + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), fmod(float2(float.PositiveInfinity, TestUtils.SignedFloatQNaN()), float2(float.PositiveInfinity, float.PositiveInfinity)), 1, false); + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), fmod(float2(float.NegativeInfinity, -323.4f), float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN())), 1, false); + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), fmod(float2(TestUtils.SignedFloatZero(), 0f), float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN())), 1, false); + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), fmod(float2(323.4f, float.PositiveInfinity), float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN())), 1, false); + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), fmod(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN())), 1, false); + } + + [TestCompiler] + public static void fmod_float3() + { + TestUtils.AreEqual(float3(TestUtils.SignedFloatQNaN(), -323.4f, TestUtils.SignedFloatZero()), fmod(float3(float.NegativeInfinity, -323.4f, TestUtils.SignedFloatZero()), float3(float.NegativeInfinity, float.NegativeInfinity, float.NegativeInfinity)), 1, false); + TestUtils.AreEqual(float3(0f, 323.4f, TestUtils.SignedFloatQNaN()), fmod(float3(0f, 323.4f, float.PositiveInfinity), float3(float.NegativeInfinity, float.NegativeInfinity, float.NegativeInfinity)), 1, false); + TestUtils.AreEqual(float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), -76.2f), fmod(float3(TestUtils.SignedFloatQNaN(), float.NegativeInfinity, -323.4f), float3(float.NegativeInfinity, -123.6f, -123.6f)), 1, false); + TestUtils.AreEqual(float3(TestUtils.SignedFloatZero(), 0f, 76.2f), fmod(float3(TestUtils.SignedFloatZero(), 0f, 323.4f), float3(-123.6f, -123.6f, -123.6f)), 1, false); + TestUtils.AreEqual(float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), fmod(float3(float.PositiveInfinity, TestUtils.SignedFloatQNaN(), float.NegativeInfinity), float3(-123.6f, -123.6f, TestUtils.SignedFloatZero())), 1, false); + TestUtils.AreEqual(float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), fmod(float3(-323.4f, TestUtils.SignedFloatZero(), 0f), float3(TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero())), 1, false); + TestUtils.AreEqual(float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), fmod(float3(323.4f, float.PositiveInfinity, TestUtils.SignedFloatQNaN()), float3(TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero())), 1, false); + TestUtils.AreEqual(float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), fmod(float3(float.NegativeInfinity, -323.4f, TestUtils.SignedFloatZero()), float3(0f, 0f, 0f)), 1, false); + TestUtils.AreEqual(float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), fmod(float3(0f, 323.4f, float.PositiveInfinity), float3(0f, 0f, 0f)), 1, false); + TestUtils.AreEqual(float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), -76.2f), fmod(float3(TestUtils.SignedFloatQNaN(), float.NegativeInfinity, -323.4f), float3(0f, 123.6f, 123.6f)), 1, false); + TestUtils.AreEqual(float3(TestUtils.SignedFloatZero(), 0f, 76.2f), fmod(float3(TestUtils.SignedFloatZero(), 0f, 323.4f), float3(123.6f, 123.6f, 123.6f)), 1, false); + TestUtils.AreEqual(float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), fmod(float3(float.PositiveInfinity, TestUtils.SignedFloatQNaN(), float.NegativeInfinity), float3(123.6f, 123.6f, float.PositiveInfinity)), 1, false); + TestUtils.AreEqual(float3(-323.4f, TestUtils.SignedFloatZero(), 0f), fmod(float3(-323.4f, TestUtils.SignedFloatZero(), 0f), float3(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity)), 1, false); + TestUtils.AreEqual(float3(323.4f, TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), fmod(float3(323.4f, float.PositiveInfinity, TestUtils.SignedFloatQNaN()), float3(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity)), 1, false); + TestUtils.AreEqual(float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), fmod(float3(float.NegativeInfinity, -323.4f, TestUtils.SignedFloatZero()), float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN())), 1, false); + TestUtils.AreEqual(float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), fmod(float3(0f, 323.4f, float.PositiveInfinity), float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN())), 1, false); + TestUtils.AreEqual(float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), fmod(float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN())), 1, false); + } + + [TestCompiler] + public static void fmod_float4() + { + TestUtils.AreEqual(float4(TestUtils.SignedFloatQNaN(), -323.4f, TestUtils.SignedFloatZero(), 0f), fmod(float4(float.NegativeInfinity, -323.4f, TestUtils.SignedFloatZero(), 0f), float4(float.NegativeInfinity, float.NegativeInfinity, float.NegativeInfinity, float.NegativeInfinity)), 1, false); + TestUtils.AreEqual(float4(323.4f, TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), fmod(float4(323.4f, float.PositiveInfinity, TestUtils.SignedFloatQNaN(), float.NegativeInfinity), float4(float.NegativeInfinity, float.NegativeInfinity, float.NegativeInfinity, -123.6f)), 1, false); + TestUtils.AreEqual(float4(-76.2f, TestUtils.SignedFloatZero(), 0f, 76.2f), fmod(float4(-323.4f, TestUtils.SignedFloatZero(), 0f, 323.4f), float4(-123.6f, -123.6f, -123.6f, -123.6f)), 1, false); + TestUtils.AreEqual(float4(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), fmod(float4(float.PositiveInfinity, TestUtils.SignedFloatQNaN(), float.NegativeInfinity, -323.4f), float4(-123.6f, -123.6f, TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero())), 1, false); + TestUtils.AreEqual(float4(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), fmod(float4(TestUtils.SignedFloatZero(), 0f, 323.4f, float.PositiveInfinity), float4(TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero())), 1, false); + TestUtils.AreEqual(float4(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), fmod(float4(TestUtils.SignedFloatQNaN(), float.NegativeInfinity, -323.4f, TestUtils.SignedFloatZero()), float4(TestUtils.SignedFloatZero(), 0f, 0f, 0f)), 1, false); + TestUtils.AreEqual(float4(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), fmod(float4(0f, 323.4f, float.PositiveInfinity, TestUtils.SignedFloatQNaN()), float4(0f, 0f, 0f, 0f)), 1, false); + TestUtils.AreEqual(float4(TestUtils.SignedFloatQNaN(), -76.2f, TestUtils.SignedFloatZero(), 0f), fmod(float4(float.NegativeInfinity, -323.4f, TestUtils.SignedFloatZero(), 0f), float4(123.6f, 123.6f, 123.6f, 123.6f)), 1, false); + TestUtils.AreEqual(float4(76.2f, TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), fmod(float4(323.4f, float.PositiveInfinity, TestUtils.SignedFloatQNaN(), float.NegativeInfinity), float4(123.6f, 123.6f, 123.6f, float.PositiveInfinity)), 1, false); + TestUtils.AreEqual(float4(-323.4f, TestUtils.SignedFloatZero(), 0f, 323.4f), fmod(float4(-323.4f, TestUtils.SignedFloatZero(), 0f, 323.4f), float4(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity)), 1, false); + TestUtils.AreEqual(float4(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), fmod(float4(float.PositiveInfinity, TestUtils.SignedFloatQNaN(), float.NegativeInfinity, -323.4f), float4(float.PositiveInfinity, float.PositiveInfinity, TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN())), 1, false); + TestUtils.AreEqual(float4(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), fmod(float4(TestUtils.SignedFloatZero(), 0f, 323.4f, float.PositiveInfinity), float4(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN())), 1, false); + TestUtils.AreEqual(float4(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), fmod(float4(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), float4(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN())), 1, false); + } + + [TestCompiler] + public static void fmod_double() + { + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), fmod(double.NegativeInfinity, double.NegativeInfinity), 1, false); + TestUtils.AreEqual(-323.4, fmod(-323.4, double.NegativeInfinity), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleZero(), fmod(TestUtils.SignedDoubleZero(), double.NegativeInfinity), 1, false); + TestUtils.AreEqual(0.0, fmod(0.0, double.NegativeInfinity), 1, false); + TestUtils.AreEqual(323.4, fmod(323.4, double.NegativeInfinity), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), fmod(double.PositiveInfinity, double.NegativeInfinity), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), fmod(TestUtils.SignedDoubleQNaN(), double.NegativeInfinity), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), fmod(double.NegativeInfinity, -123.6), 1, false); + TestUtils.AreEqual(-76.2, fmod(-323.4, -123.6), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleZero(), fmod(TestUtils.SignedDoubleZero(), -123.6), 1, false); + TestUtils.AreEqual(0.0, fmod(0.0, -123.6), 1, false); + TestUtils.AreEqual(76.2, fmod(323.4, -123.6), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), fmod(double.PositiveInfinity, -123.6), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), fmod(TestUtils.SignedDoubleQNaN(), -123.6), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), fmod(double.NegativeInfinity, TestUtils.SignedDoubleZero()), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), fmod(-323.4, TestUtils.SignedDoubleZero()), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), fmod(TestUtils.SignedDoubleZero(), TestUtils.SignedDoubleZero()), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), fmod(0.0, TestUtils.SignedDoubleZero()), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), fmod(323.4, TestUtils.SignedDoubleZero()), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), fmod(double.PositiveInfinity, TestUtils.SignedDoubleZero()), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), fmod(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleZero()), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), fmod(double.NegativeInfinity, 0.0), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), fmod(-323.4, 0.0), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), fmod(TestUtils.SignedDoubleZero(), 0.0), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), fmod(0.0, 0.0), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), fmod(323.4, 0.0), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), fmod(double.PositiveInfinity, 0.0), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), fmod(TestUtils.SignedDoubleQNaN(), 0.0), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), fmod(double.NegativeInfinity, 123.6), 1, false); + TestUtils.AreEqual(-76.2, fmod(-323.4, 123.6), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleZero(), fmod(TestUtils.SignedDoubleZero(), 123.6), 1, false); + TestUtils.AreEqual(0.0, fmod(0.0, 123.6), 1, false); + TestUtils.AreEqual(76.2, fmod(323.4, 123.6), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), fmod(double.PositiveInfinity, 123.6), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), fmod(TestUtils.SignedDoubleQNaN(), 123.6), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), fmod(double.NegativeInfinity, double.PositiveInfinity), 1, false); + TestUtils.AreEqual(-323.4, fmod(-323.4, double.PositiveInfinity), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleZero(), fmod(TestUtils.SignedDoubleZero(), double.PositiveInfinity), 1, false); + TestUtils.AreEqual(0.0, fmod(0.0, double.PositiveInfinity), 1, false); + TestUtils.AreEqual(323.4, fmod(323.4, double.PositiveInfinity), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), fmod(double.PositiveInfinity, double.PositiveInfinity), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), fmod(TestUtils.SignedDoubleQNaN(), double.PositiveInfinity), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), fmod(double.NegativeInfinity, TestUtils.SignedDoubleQNaN()), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), fmod(-323.4, TestUtils.SignedDoubleQNaN()), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), fmod(TestUtils.SignedDoubleZero(), TestUtils.SignedDoubleQNaN()), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), fmod(0.0, TestUtils.SignedDoubleQNaN()), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), fmod(323.4, TestUtils.SignedDoubleQNaN()), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), fmod(double.PositiveInfinity, TestUtils.SignedDoubleQNaN()), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), fmod(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), 1, false); + } + + [TestCompiler] + public static void fmod_double2() + { + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), -323.4), fmod(double2(double.NegativeInfinity, -323.4), double2(double.NegativeInfinity, double.NegativeInfinity)), 1, false); + TestUtils.AreEqual(double2(TestUtils.SignedDoubleZero(), 0.0), fmod(double2(TestUtils.SignedDoubleZero(), 0.0), double2(double.NegativeInfinity, double.NegativeInfinity)), 1, false); + TestUtils.AreEqual(double2(323.4, TestUtils.SignedDoubleQNaN()), fmod(double2(323.4, double.PositiveInfinity), double2(double.NegativeInfinity, double.NegativeInfinity)), 1, false); + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), fmod(double2(TestUtils.SignedDoubleQNaN(), double.NegativeInfinity), double2(double.NegativeInfinity, -123.6)), 1, false); + TestUtils.AreEqual(double2(-76.2, TestUtils.SignedDoubleZero()), fmod(double2(-323.4, TestUtils.SignedDoubleZero()), double2(-123.6, -123.6)), 1, false); + TestUtils.AreEqual(double2(0.0, 76.2), fmod(double2(0.0, 323.4), double2(-123.6, -123.6)), 1, false); + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), fmod(double2(double.PositiveInfinity, TestUtils.SignedDoubleQNaN()), double2(-123.6, -123.6)), 1, false); + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), fmod(double2(double.NegativeInfinity, -323.4), double2(TestUtils.SignedDoubleZero(), TestUtils.SignedDoubleZero())), 1, false); + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), fmod(double2(TestUtils.SignedDoubleZero(), 0.0), double2(TestUtils.SignedDoubleZero(), TestUtils.SignedDoubleZero())), 1, false); + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), fmod(double2(323.4, double.PositiveInfinity), double2(TestUtils.SignedDoubleZero(), TestUtils.SignedDoubleZero())), 1, false); + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), fmod(double2(TestUtils.SignedDoubleQNaN(), double.NegativeInfinity), double2(TestUtils.SignedDoubleZero(), 0.0)), 1, false); + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), fmod(double2(-323.4, TestUtils.SignedDoubleZero()), double2(0.0, 0.0)), 1, false); + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), fmod(double2(0.0, 323.4), double2(0.0, 0.0)), 1, false); + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), fmod(double2(double.PositiveInfinity, TestUtils.SignedDoubleQNaN()), double2(0.0, 0.0)), 1, false); + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), -76.2), fmod(double2(double.NegativeInfinity, -323.4), double2(123.6, 123.6)), 1, false); + TestUtils.AreEqual(double2(TestUtils.SignedDoubleZero(), 0.0), fmod(double2(TestUtils.SignedDoubleZero(), 0.0), double2(123.6, 123.6)), 1, false); + TestUtils.AreEqual(double2(76.2, TestUtils.SignedDoubleQNaN()), fmod(double2(323.4, double.PositiveInfinity), double2(123.6, 123.6)), 1, false); + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), fmod(double2(TestUtils.SignedDoubleQNaN(), double.NegativeInfinity), double2(123.6, double.PositiveInfinity)), 1, false); + TestUtils.AreEqual(double2(-323.4, TestUtils.SignedDoubleZero()), fmod(double2(-323.4, TestUtils.SignedDoubleZero()), double2(double.PositiveInfinity, double.PositiveInfinity)), 1, false); + TestUtils.AreEqual(double2(0.0, 323.4), fmod(double2(0.0, 323.4), double2(double.PositiveInfinity, double.PositiveInfinity)), 1, false); + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), fmod(double2(double.PositiveInfinity, TestUtils.SignedDoubleQNaN()), double2(double.PositiveInfinity, double.PositiveInfinity)), 1, false); + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), fmod(double2(double.NegativeInfinity, -323.4), double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN())), 1, false); + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), fmod(double2(TestUtils.SignedDoubleZero(), 0.0), double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN())), 1, false); + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), fmod(double2(323.4, double.PositiveInfinity), double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN())), 1, false); + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), fmod(double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN())), 1, false); + } + + [TestCompiler] + public static void fmod_double3() + { + TestUtils.AreEqual(double3(TestUtils.SignedDoubleQNaN(), -323.4, TestUtils.SignedDoubleZero()), fmod(double3(double.NegativeInfinity, -323.4, TestUtils.SignedDoubleZero()), double3(double.NegativeInfinity, double.NegativeInfinity, double.NegativeInfinity)), 1, false); + TestUtils.AreEqual(double3(0.0, 323.4, TestUtils.SignedDoubleQNaN()), fmod(double3(0.0, 323.4, double.PositiveInfinity), double3(double.NegativeInfinity, double.NegativeInfinity, double.NegativeInfinity)), 1, false); + TestUtils.AreEqual(double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), -76.2), fmod(double3(TestUtils.SignedDoubleQNaN(), double.NegativeInfinity, -323.4), double3(double.NegativeInfinity, -123.6, -123.6)), 1, false); + TestUtils.AreEqual(double3(TestUtils.SignedDoubleZero(), 0.0, 76.2), fmod(double3(TestUtils.SignedDoubleZero(), 0.0, 323.4), double3(-123.6, -123.6, -123.6)), 1, false); + TestUtils.AreEqual(double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), fmod(double3(double.PositiveInfinity, TestUtils.SignedDoubleQNaN(), double.NegativeInfinity), double3(-123.6, -123.6, TestUtils.SignedDoubleZero())), 1, false); + TestUtils.AreEqual(double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), fmod(double3(-323.4, TestUtils.SignedDoubleZero(), 0.0), double3(TestUtils.SignedDoubleZero(), TestUtils.SignedDoubleZero(), TestUtils.SignedDoubleZero())), 1, false); + TestUtils.AreEqual(double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), fmod(double3(323.4, double.PositiveInfinity, TestUtils.SignedDoubleQNaN()), double3(TestUtils.SignedDoubleZero(), TestUtils.SignedDoubleZero(), TestUtils.SignedDoubleZero())), 1, false); + TestUtils.AreEqual(double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), fmod(double3(double.NegativeInfinity, -323.4, TestUtils.SignedDoubleZero()), double3(0.0, 0.0, 0.0)), 1, false); + TestUtils.AreEqual(double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), fmod(double3(0.0, 323.4, double.PositiveInfinity), double3(0.0, 0.0, 0.0)), 1, false); + TestUtils.AreEqual(double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), -76.2), fmod(double3(TestUtils.SignedDoubleQNaN(), double.NegativeInfinity, -323.4), double3(0.0, 123.6, 123.6)), 1, false); + TestUtils.AreEqual(double3(TestUtils.SignedDoubleZero(), 0.0, 76.2), fmod(double3(TestUtils.SignedDoubleZero(), 0.0, 323.4), double3(123.6, 123.6, 123.6)), 1, false); + TestUtils.AreEqual(double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), fmod(double3(double.PositiveInfinity, TestUtils.SignedDoubleQNaN(), double.NegativeInfinity), double3(123.6, 123.6, double.PositiveInfinity)), 1, false); + TestUtils.AreEqual(double3(-323.4, TestUtils.SignedDoubleZero(), 0.0), fmod(double3(-323.4, TestUtils.SignedDoubleZero(), 0.0), double3(double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity)), 1, false); + TestUtils.AreEqual(double3(323.4, TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), fmod(double3(323.4, double.PositiveInfinity, TestUtils.SignedDoubleQNaN()), double3(double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity)), 1, false); + TestUtils.AreEqual(double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), fmod(double3(double.NegativeInfinity, -323.4, TestUtils.SignedDoubleZero()), double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN())), 1, false); + TestUtils.AreEqual(double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), fmod(double3(0.0, 323.4, double.PositiveInfinity), double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN())), 1, false); + TestUtils.AreEqual(double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), fmod(double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN())), 1, false); + } + + [TestCompiler] + public static void fmod_double4() + { + TestUtils.AreEqual(double4(TestUtils.SignedDoubleQNaN(), -323.4, TestUtils.SignedDoubleZero(), 0.0), fmod(double4(double.NegativeInfinity, -323.4, TestUtils.SignedDoubleZero(), 0.0), double4(double.NegativeInfinity, double.NegativeInfinity, double.NegativeInfinity, double.NegativeInfinity)), 1, false); + TestUtils.AreEqual(double4(323.4, TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), fmod(double4(323.4, double.PositiveInfinity, TestUtils.SignedDoubleQNaN(), double.NegativeInfinity), double4(double.NegativeInfinity, double.NegativeInfinity, double.NegativeInfinity, -123.6)), 1, false); + TestUtils.AreEqual(double4(-76.2, TestUtils.SignedDoubleZero(), 0.0, 76.2), fmod(double4(-323.4, TestUtils.SignedDoubleZero(), 0.0, 323.4), double4(-123.6, -123.6, -123.6, -123.6)), 1, false); + TestUtils.AreEqual(double4(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), fmod(double4(double.PositiveInfinity, TestUtils.SignedDoubleQNaN(), double.NegativeInfinity, -323.4), double4(-123.6, -123.6, TestUtils.SignedDoubleZero(), TestUtils.SignedDoubleZero())), 1, false); + TestUtils.AreEqual(double4(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), fmod(double4(TestUtils.SignedDoubleZero(), 0.0, 323.4, double.PositiveInfinity), double4(TestUtils.SignedDoubleZero(), TestUtils.SignedDoubleZero(), TestUtils.SignedDoubleZero(), TestUtils.SignedDoubleZero())), 1, false); + TestUtils.AreEqual(double4(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), fmod(double4(TestUtils.SignedDoubleQNaN(), double.NegativeInfinity, -323.4, TestUtils.SignedDoubleZero()), double4(TestUtils.SignedDoubleZero(), 0.0, 0.0, 0.0)), 1, false); + TestUtils.AreEqual(double4(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), fmod(double4(0.0, 323.4, double.PositiveInfinity, TestUtils.SignedDoubleQNaN()), double4(0.0, 0.0, 0.0, 0.0)), 1, false); + TestUtils.AreEqual(double4(TestUtils.SignedDoubleQNaN(), -76.2, TestUtils.SignedDoubleZero(), 0.0), fmod(double4(double.NegativeInfinity, -323.4, TestUtils.SignedDoubleZero(), 0.0), double4(123.6, 123.6, 123.6, 123.6)), 1, false); + TestUtils.AreEqual(double4(76.2, TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), fmod(double4(323.4, double.PositiveInfinity, TestUtils.SignedDoubleQNaN(), double.NegativeInfinity), double4(123.6, 123.6, 123.6, double.PositiveInfinity)), 1, false); + TestUtils.AreEqual(double4(-323.4, TestUtils.SignedDoubleZero(), 0.0, 323.4), fmod(double4(-323.4, TestUtils.SignedDoubleZero(), 0.0, 323.4), double4(double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity)), 1, false); + TestUtils.AreEqual(double4(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), fmod(double4(double.PositiveInfinity, TestUtils.SignedDoubleQNaN(), double.NegativeInfinity, -323.4), double4(double.PositiveInfinity, double.PositiveInfinity, TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN())), 1, false); + TestUtils.AreEqual(double4(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), fmod(double4(TestUtils.SignedDoubleZero(), 0.0, 323.4, double.PositiveInfinity), double4(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN())), 1, false); + TestUtils.AreEqual(double4(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), fmod(double4(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), double4(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN())), 1, false); + } + + [TestCompiler] + public static void pow_float() + { + TestUtils.AreEqual(0f, pow(float.NegativeInfinity, float.NegativeInfinity), 1, false); + TestUtils.AreEqual(0f, pow(-3.4f, float.NegativeInfinity), 1, false); + TestUtils.AreEqual(float.PositiveInfinity, pow(TestUtils.SignedFloatZero(), float.NegativeInfinity), 1, false); + TestUtils.AreEqual(float.PositiveInfinity, pow(0f, float.NegativeInfinity), 1, false); + TestUtils.AreEqual(0f, pow(3.4f, float.NegativeInfinity), 1, false); + TestUtils.AreEqual(0f, pow(float.PositiveInfinity, float.NegativeInfinity), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), pow(TestUtils.SignedFloatQNaN(), float.NegativeInfinity), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), pow(-3.4f, -2.6f), 1, false); + TestUtils.AreEqual(float.PositiveInfinity, pow(TestUtils.SignedFloatZero(), -2.6f), 1, false); + TestUtils.AreEqual(float.PositiveInfinity, pow(0f, -2.6f), 1, false); + TestUtils.AreEqual(0.0415102f, pow(3.4f, -2.6f), 1, false); + TestUtils.AreEqual(0f, pow(float.PositiveInfinity, -2.6f), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), pow(TestUtils.SignedFloatQNaN(), -2.6f), 1, false); + TestUtils.AreEqual(1f, pow(float.NegativeInfinity, TestUtils.SignedFloatZero()), 1, false); + TestUtils.AreEqual(1f, pow(-3.4f, TestUtils.SignedFloatZero()), 1, false); + TestUtils.AreEqual(1f, pow(TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero()), 1, false); + TestUtils.AreEqual(1f, pow(0f, TestUtils.SignedFloatZero()), 1, false); + TestUtils.AreEqual(1f, pow(3.4f, TestUtils.SignedFloatZero()), 1, false); + TestUtils.AreEqual(1f, pow(float.PositiveInfinity, TestUtils.SignedFloatZero()), 1, false); + TestUtils.AreEqual(1f, pow(float.NegativeInfinity, 0f), 1, false); + TestUtils.AreEqual(1f, pow(-3.4f, 0f), 1, false); + TestUtils.AreEqual(1f, pow(TestUtils.SignedFloatZero(), 0f), 1, false); + TestUtils.AreEqual(1f, pow(0f, 0f), 1, false); + TestUtils.AreEqual(1f, pow(3.4f, 0f), 1, false); + TestUtils.AreEqual(1f, pow(float.PositiveInfinity, 0f), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), pow(-3.4f, 2.6f), 1, false); + TestUtils.AreEqual(0f, pow(TestUtils.SignedFloatZero(), 2.6f), 1, false); + TestUtils.AreEqual(0f, pow(0f, 2.6f), 1, false); + TestUtils.AreEqual(24.0904655f, pow(3.4f, 2.6f), 1, false); + TestUtils.AreEqual(float.PositiveInfinity, pow(float.PositiveInfinity, 2.6f), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), pow(TestUtils.SignedFloatQNaN(), 2.6f), 1, false); + TestUtils.AreEqual(float.PositiveInfinity, pow(float.NegativeInfinity, float.PositiveInfinity), 1, false); + TestUtils.AreEqual(float.PositiveInfinity, pow(-3.4f, float.PositiveInfinity), 1, false); + TestUtils.AreEqual(0f, pow(TestUtils.SignedFloatZero(), float.PositiveInfinity), 1, false); + TestUtils.AreEqual(0f, pow(0f, float.PositiveInfinity), 1, false); + TestUtils.AreEqual(float.PositiveInfinity, pow(3.4f, float.PositiveInfinity), 1, false); + TestUtils.AreEqual(float.PositiveInfinity, pow(float.PositiveInfinity, float.PositiveInfinity), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), pow(TestUtils.SignedFloatQNaN(), float.PositiveInfinity), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), pow(float.NegativeInfinity, TestUtils.SignedFloatQNaN()), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), pow(-3.4f, TestUtils.SignedFloatQNaN()), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), pow(TestUtils.SignedFloatZero(), TestUtils.SignedFloatQNaN()), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), pow(0f, TestUtils.SignedFloatQNaN()), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), pow(3.4f, TestUtils.SignedFloatQNaN()), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), pow(float.PositiveInfinity, TestUtils.SignedFloatQNaN()), 1, false); + TestUtils.AreEqual(TestUtils.SignedFloatQNaN(), pow(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), 1, false); + } + + [TestCompiler] + public static void pow_float2() + { + TestUtils.AreEqual(float2(0f, 0f), pow(float2(float.NegativeInfinity, -3.4f), float2(float.NegativeInfinity, float.NegativeInfinity)), 1, false); + TestUtils.AreEqual(float2(float.PositiveInfinity, float.PositiveInfinity), pow(float2(TestUtils.SignedFloatZero(), 0f), float2(float.NegativeInfinity, float.NegativeInfinity)), 1, false); + TestUtils.AreEqual(float2(0f, 0f), pow(float2(3.4f, float.PositiveInfinity), float2(float.NegativeInfinity, float.NegativeInfinity)), 1, false); + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), pow(float2(TestUtils.SignedFloatQNaN(), -3.4f), float2(float.NegativeInfinity, -2.6f)), 1, false); + TestUtils.AreEqual(float2(float.PositiveInfinity, float.PositiveInfinity), pow(float2(TestUtils.SignedFloatZero(), 0f), float2(-2.6f, -2.6f)), 1, false); + TestUtils.AreEqual(float2(0.0415102f, 0f), pow(float2(3.4f, float.PositiveInfinity), float2(-2.6f, -2.6f)), 1, false); + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), 1f), pow(float2(TestUtils.SignedFloatQNaN(), float.NegativeInfinity), float2(-2.6f, TestUtils.SignedFloatZero())), 1, false); + TestUtils.AreEqual(float2(1f, 1f), pow(float2(-3.4f, TestUtils.SignedFloatZero()), float2(TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero())), 1, false); + TestUtils.AreEqual(float2(1f, 1f), pow(float2(0f, 3.4f), float2(TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero())), 1, false); + TestUtils.AreEqual(float2(1f, 1f), pow(float2(float.PositiveInfinity, float.NegativeInfinity), float2(TestUtils.SignedFloatZero(), 0f)), 1, false); + TestUtils.AreEqual(float2(1f, 1f), pow(float2(-3.4f, TestUtils.SignedFloatZero()), float2(0f, 0f)), 1, false); + TestUtils.AreEqual(float2(1f, 1f), pow(float2(0f, 3.4f), float2(0f, 0f)), 1, false); + TestUtils.AreEqual(float2(1f, TestUtils.SignedFloatQNaN()), pow(float2(float.PositiveInfinity, -3.4f), float2(0f, 2.6f)), 1, false); + TestUtils.AreEqual(float2(0f, 0f), pow(float2(TestUtils.SignedFloatZero(), 0f), float2(2.6f, 2.6f)), 1, false); + TestUtils.AreEqual(float2(24.0904655f, float.PositiveInfinity), pow(float2(3.4f, float.PositiveInfinity), float2(2.6f, 2.6f)), 1, false); + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), float.PositiveInfinity), pow(float2(TestUtils.SignedFloatQNaN(), float.NegativeInfinity), float2(2.6f, float.PositiveInfinity)), 1, false); + TestUtils.AreEqual(float2(float.PositiveInfinity, 0f), pow(float2(-3.4f, TestUtils.SignedFloatZero()), float2(float.PositiveInfinity, float.PositiveInfinity)), 1, false); + TestUtils.AreEqual(float2(0f, float.PositiveInfinity), pow(float2(0f, 3.4f), float2(float.PositiveInfinity, float.PositiveInfinity)), 1, false); + TestUtils.AreEqual(float2(float.PositiveInfinity, TestUtils.SignedFloatQNaN()), pow(float2(float.PositiveInfinity, TestUtils.SignedFloatQNaN()), float2(float.PositiveInfinity, float.PositiveInfinity)), 1, false); + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), pow(float2(float.NegativeInfinity, -3.4f), float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN())), 1, false); + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), pow(float2(TestUtils.SignedFloatZero(), 0f), float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN())), 1, false); + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), pow(float2(3.4f, float.PositiveInfinity), float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN())), 1, false); + TestUtils.AreEqual(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), pow(float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), float2(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN())), 1, false); + } + + [TestCompiler] + public static void pow_float3() + { + TestUtils.AreEqual(float3(0f, 0f, float.PositiveInfinity), pow(float3(float.NegativeInfinity, -3.4f, TestUtils.SignedFloatZero()), float3(float.NegativeInfinity, float.NegativeInfinity, float.NegativeInfinity)), 1, false); + TestUtils.AreEqual(float3(float.PositiveInfinity, 0f, 0f), pow(float3(0f, 3.4f, float.PositiveInfinity), float3(float.NegativeInfinity, float.NegativeInfinity, float.NegativeInfinity)), 1, false); + TestUtils.AreEqual(float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), float.PositiveInfinity), pow(float3(TestUtils.SignedFloatQNaN(), -3.4f, TestUtils.SignedFloatZero()), float3(float.NegativeInfinity, -2.6f, -2.6f)), 1, false); + TestUtils.AreEqual(float3(float.PositiveInfinity, 0.0415102f, 0f), pow(float3(0f, 3.4f, float.PositiveInfinity), float3(-2.6f, -2.6f, -2.6f)), 1, false); + TestUtils.AreEqual(float3(TestUtils.SignedFloatQNaN(), 1f, 1f), pow(float3(TestUtils.SignedFloatQNaN(), float.NegativeInfinity, -3.4f), float3(-2.6f, TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero())), 1, false); + TestUtils.AreEqual(float3(1f, 1f, 1f), pow(float3(TestUtils.SignedFloatZero(), 0f, 3.4f), float3(TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero())), 1, false); + TestUtils.AreEqual(float3(1f, 1f, 1f), pow(float3(float.PositiveInfinity, float.NegativeInfinity, -3.4f), float3(TestUtils.SignedFloatZero(), 0f, 0f)), 1, false); + TestUtils.AreEqual(float3(1f, 1f, 1f), pow(float3(TestUtils.SignedFloatZero(), 0f, 3.4f), float3(0f, 0f, 0f)), 1, false); + TestUtils.AreEqual(float3(1f, TestUtils.SignedFloatQNaN(), 0f), pow(float3(float.PositiveInfinity, -3.4f, TestUtils.SignedFloatZero()), float3(0f, 2.6f, 2.6f)), 1, false); + TestUtils.AreEqual(float3(0f, 24.0904655f, float.PositiveInfinity), pow(float3(0f, 3.4f, float.PositiveInfinity), float3(2.6f, 2.6f, 2.6f)), 1, false); + TestUtils.AreEqual(float3(TestUtils.SignedFloatQNaN(), float.PositiveInfinity, float.PositiveInfinity), pow(float3(TestUtils.SignedFloatQNaN(), float.NegativeInfinity, -3.4f), float3(2.6f, float.PositiveInfinity, float.PositiveInfinity)), 1, false); + TestUtils.AreEqual(float3(0f, 0f, float.PositiveInfinity), pow(float3(TestUtils.SignedFloatZero(), 0f, 3.4f), float3(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity)), 1, false); + TestUtils.AreEqual(float3(float.PositiveInfinity, TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), pow(float3(float.PositiveInfinity, TestUtils.SignedFloatQNaN(), float.NegativeInfinity), float3(float.PositiveInfinity, float.PositiveInfinity, TestUtils.SignedFloatQNaN())), 1, false); + TestUtils.AreEqual(float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), pow(float3(-3.4f, TestUtils.SignedFloatZero(), 0f), float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN())), 1, false); + TestUtils.AreEqual(float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), pow(float3(3.4f, float.PositiveInfinity, TestUtils.SignedFloatQNaN()), float3(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN())), 1, false); + } + + [TestCompiler] + public static void pow_float4() + { + TestUtils.AreEqual(float4(0f, 0f, float.PositiveInfinity, float.PositiveInfinity), pow(float4(float.NegativeInfinity, -3.4f, TestUtils.SignedFloatZero(), 0f), float4(float.NegativeInfinity, float.NegativeInfinity, float.NegativeInfinity, float.NegativeInfinity)), 1, false); + TestUtils.AreEqual(float4(0f, 0f, TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), pow(float4(3.4f, float.PositiveInfinity, TestUtils.SignedFloatQNaN(), -3.4f), float4(float.NegativeInfinity, float.NegativeInfinity, float.NegativeInfinity, -2.6f)), 1, false); + TestUtils.AreEqual(float4(float.PositiveInfinity, float.PositiveInfinity, 0.0415102f, 0f), pow(float4(TestUtils.SignedFloatZero(), 0f, 3.4f, float.PositiveInfinity), float4(-2.6f, -2.6f, -2.6f, -2.6f)), 1, false); + TestUtils.AreEqual(float4(TestUtils.SignedFloatQNaN(), 1f, 1f, 1f), pow(float4(TestUtils.SignedFloatQNaN(), float.NegativeInfinity, -3.4f, TestUtils.SignedFloatZero()), float4(-2.6f, TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero())), 1, false); + TestUtils.AreEqual(float4(1f, 1f, 1f, 1f), pow(float4(0f, 3.4f, float.PositiveInfinity, float.NegativeInfinity), float4(TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero(), TestUtils.SignedFloatZero(), 0f)), 1, false); + TestUtils.AreEqual(float4(1f, 1f, 1f, 1f), pow(float4(-3.4f, TestUtils.SignedFloatZero(), 0f, 3.4f), float4(0f, 0f, 0f, 0f)), 1, false); + TestUtils.AreEqual(float4(1f, TestUtils.SignedFloatQNaN(), 0f, 0f), pow(float4(float.PositiveInfinity, -3.4f, TestUtils.SignedFloatZero(), 0f), float4(0f, 2.6f, 2.6f, 2.6f)), 1, false); + TestUtils.AreEqual(float4(24.0904655f, float.PositiveInfinity, TestUtils.SignedFloatQNaN(), float.PositiveInfinity), pow(float4(3.4f, float.PositiveInfinity, TestUtils.SignedFloatQNaN(), float.NegativeInfinity), float4(2.6f, 2.6f, 2.6f, float.PositiveInfinity)), 1, false); + TestUtils.AreEqual(float4(float.PositiveInfinity, 0f, 0f, float.PositiveInfinity), pow(float4(-3.4f, TestUtils.SignedFloatZero(), 0f, 3.4f), float4(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity)), 1, false); + TestUtils.AreEqual(float4(float.PositiveInfinity, TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), pow(float4(float.PositiveInfinity, TestUtils.SignedFloatQNaN(), float.NegativeInfinity, -3.4f), float4(float.PositiveInfinity, float.PositiveInfinity, TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN())), 1, false); + TestUtils.AreEqual(float4(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), pow(float4(TestUtils.SignedFloatZero(), 0f, 3.4f, float.PositiveInfinity), float4(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN())), 1, false); + TestUtils.AreEqual(float4(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), pow(float4(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN()), float4(TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN(), TestUtils.SignedFloatQNaN())), 1, false); + } + + [TestCompiler] + public static void pow_double() + { + TestUtils.AreEqual(0.0, pow(double.NegativeInfinity, double.NegativeInfinity), 1, false); + TestUtils.AreEqual(0.0, pow(-3.4, double.NegativeInfinity), 1, false); + TestUtils.AreEqual(double.PositiveInfinity, pow(TestUtils.SignedDoubleZero(), double.NegativeInfinity), 1, false); + TestUtils.AreEqual(double.PositiveInfinity, pow(0.0, double.NegativeInfinity), 1, false); + TestUtils.AreEqual(0.0, pow(3.4, double.NegativeInfinity), 1, false); + TestUtils.AreEqual(0.0, pow(double.PositiveInfinity, double.NegativeInfinity), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), pow(TestUtils.SignedDoubleQNaN(), double.NegativeInfinity), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), pow(-3.4, -2.6), 1, false); + TestUtils.AreEqual(double.PositiveInfinity, pow(TestUtils.SignedDoubleZero(), -2.6), 1, false); + TestUtils.AreEqual(double.PositiveInfinity, pow(0.0, -2.6), 1, false); + TestUtils.AreEqual(0.041510199028461224, pow(3.4, -2.6), 1, false); + TestUtils.AreEqual(0.0, pow(double.PositiveInfinity, -2.6), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), pow(TestUtils.SignedDoubleQNaN(), -2.6), 1, false); + TestUtils.AreEqual(1.0, pow(double.NegativeInfinity, TestUtils.SignedDoubleZero()), 1, false); + TestUtils.AreEqual(1.0, pow(-3.4, TestUtils.SignedDoubleZero()), 1, false); + TestUtils.AreEqual(1.0, pow(TestUtils.SignedDoubleZero(), TestUtils.SignedDoubleZero()), 1, false); + TestUtils.AreEqual(1.0, pow(0.0, TestUtils.SignedDoubleZero()), 1, false); + TestUtils.AreEqual(1.0, pow(3.4, TestUtils.SignedDoubleZero()), 1, false); + TestUtils.AreEqual(1.0, pow(double.PositiveInfinity, TestUtils.SignedDoubleZero()), 1, false); + TestUtils.AreEqual(1.0, pow(double.NegativeInfinity, 0.0), 1, false); + TestUtils.AreEqual(1.0, pow(-3.4, 0.0), 1, false); + TestUtils.AreEqual(1.0, pow(TestUtils.SignedDoubleZero(), 0.0), 1, false); + TestUtils.AreEqual(1.0, pow(0.0, 0.0), 1, false); + TestUtils.AreEqual(1.0, pow(3.4, 0.0), 1, false); + TestUtils.AreEqual(1.0, pow(double.PositiveInfinity, 0.0), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), pow(-3.4, 2.6), 1, false); + TestUtils.AreEqual(0.0, pow(TestUtils.SignedDoubleZero(), 2.6), 1, false); + TestUtils.AreEqual(0.0, pow(0.0, 2.6), 1, false); + TestUtils.AreEqual(24.090465076169735, pow(3.4, 2.6), 1, false); + TestUtils.AreEqual(double.PositiveInfinity, pow(double.PositiveInfinity, 2.6), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), pow(TestUtils.SignedDoubleQNaN(), 2.6), 1, false); + TestUtils.AreEqual(double.PositiveInfinity, pow(double.NegativeInfinity, double.PositiveInfinity), 1, false); + TestUtils.AreEqual(double.PositiveInfinity, pow(-3.4, double.PositiveInfinity), 1, false); + TestUtils.AreEqual(0.0, pow(TestUtils.SignedDoubleZero(), double.PositiveInfinity), 1, false); + TestUtils.AreEqual(0.0, pow(0.0, double.PositiveInfinity), 1, false); + TestUtils.AreEqual(double.PositiveInfinity, pow(3.4, double.PositiveInfinity), 1, false); + TestUtils.AreEqual(double.PositiveInfinity, pow(double.PositiveInfinity, double.PositiveInfinity), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), pow(TestUtils.SignedDoubleQNaN(), double.PositiveInfinity), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), pow(double.NegativeInfinity, TestUtils.SignedDoubleQNaN()), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), pow(-3.4, TestUtils.SignedDoubleQNaN()), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), pow(TestUtils.SignedDoubleZero(), TestUtils.SignedDoubleQNaN()), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), pow(0.0, TestUtils.SignedDoubleQNaN()), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), pow(3.4, TestUtils.SignedDoubleQNaN()), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), pow(double.PositiveInfinity, TestUtils.SignedDoubleQNaN()), 1, false); + TestUtils.AreEqual(TestUtils.SignedDoubleQNaN(), pow(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), 1, false); + } + + [TestCompiler] + public static void pow_double2() + { + TestUtils.AreEqual(double2(0.0, 0.0), pow(double2(double.NegativeInfinity, -3.4), double2(double.NegativeInfinity, double.NegativeInfinity)), 1, false); + TestUtils.AreEqual(double2(double.PositiveInfinity, double.PositiveInfinity), pow(double2(TestUtils.SignedDoubleZero(), 0.0), double2(double.NegativeInfinity, double.NegativeInfinity)), 1, false); + TestUtils.AreEqual(double2(0.0, 0.0), pow(double2(3.4, double.PositiveInfinity), double2(double.NegativeInfinity, double.NegativeInfinity)), 1, false); + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), pow(double2(TestUtils.SignedDoubleQNaN(), -3.4), double2(double.NegativeInfinity, -2.6)), 1, false); + TestUtils.AreEqual(double2(double.PositiveInfinity, double.PositiveInfinity), pow(double2(TestUtils.SignedDoubleZero(), 0.0), double2(-2.6, -2.6)), 1, false); + TestUtils.AreEqual(double2(0.041510199028461224, 0.0), pow(double2(3.4, double.PositiveInfinity), double2(-2.6, -2.6)), 1, false); + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), 1.0), pow(double2(TestUtils.SignedDoubleQNaN(), double.NegativeInfinity), double2(-2.6, TestUtils.SignedDoubleZero())), 1, false); + TestUtils.AreEqual(double2(1.0, 1.0), pow(double2(-3.4, TestUtils.SignedDoubleZero()), double2(TestUtils.SignedDoubleZero(), TestUtils.SignedDoubleZero())), 1, false); + TestUtils.AreEqual(double2(1.0, 1.0), pow(double2(0.0, 3.4), double2(TestUtils.SignedDoubleZero(), TestUtils.SignedDoubleZero())), 1, false); + TestUtils.AreEqual(double2(1.0, 1.0), pow(double2(double.PositiveInfinity, double.NegativeInfinity), double2(TestUtils.SignedDoubleZero(), 0.0)), 1, false); + TestUtils.AreEqual(double2(1.0, 1.0), pow(double2(-3.4, TestUtils.SignedDoubleZero()), double2(0.0, 0.0)), 1, false); + TestUtils.AreEqual(double2(1.0, 1.0), pow(double2(0.0, 3.4), double2(0.0, 0.0)), 1, false); + TestUtils.AreEqual(double2(1.0, TestUtils.SignedDoubleQNaN()), pow(double2(double.PositiveInfinity, -3.4), double2(0.0, 2.6)), 1, false); + TestUtils.AreEqual(double2(0.0, 0.0), pow(double2(TestUtils.SignedDoubleZero(), 0.0), double2(2.6, 2.6)), 1, false); + TestUtils.AreEqual(double2(24.090465076169735, double.PositiveInfinity), pow(double2(3.4, double.PositiveInfinity), double2(2.6, 2.6)), 1, false); + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), double.PositiveInfinity), pow(double2(TestUtils.SignedDoubleQNaN(), double.NegativeInfinity), double2(2.6, double.PositiveInfinity)), 1, false); + TestUtils.AreEqual(double2(double.PositiveInfinity, 0.0), pow(double2(-3.4, TestUtils.SignedDoubleZero()), double2(double.PositiveInfinity, double.PositiveInfinity)), 1, false); + TestUtils.AreEqual(double2(0.0, double.PositiveInfinity), pow(double2(0.0, 3.4), double2(double.PositiveInfinity, double.PositiveInfinity)), 1, false); + TestUtils.AreEqual(double2(double.PositiveInfinity, TestUtils.SignedDoubleQNaN()), pow(double2(double.PositiveInfinity, TestUtils.SignedDoubleQNaN()), double2(double.PositiveInfinity, double.PositiveInfinity)), 1, false); + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), pow(double2(double.NegativeInfinity, -3.4), double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN())), 1, false); + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), pow(double2(TestUtils.SignedDoubleZero(), 0.0), double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN())), 1, false); + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), pow(double2(3.4, double.PositiveInfinity), double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN())), 1, false); + TestUtils.AreEqual(double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), pow(double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), double2(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN())), 1, false); + } + + [TestCompiler] + public static void pow_double3() + { + TestUtils.AreEqual(double3(0.0, 0.0, double.PositiveInfinity), pow(double3(double.NegativeInfinity, -3.4, TestUtils.SignedDoubleZero()), double3(double.NegativeInfinity, double.NegativeInfinity, double.NegativeInfinity)), 1, false); + TestUtils.AreEqual(double3(double.PositiveInfinity, 0.0, 0.0), pow(double3(0.0, 3.4, double.PositiveInfinity), double3(double.NegativeInfinity, double.NegativeInfinity, double.NegativeInfinity)), 1, false); + TestUtils.AreEqual(double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), double.PositiveInfinity), pow(double3(TestUtils.SignedDoubleQNaN(), -3.4, TestUtils.SignedDoubleZero()), double3(double.NegativeInfinity, -2.6, -2.6)), 1, false); + TestUtils.AreEqual(double3(double.PositiveInfinity, 0.041510199028461224, 0.0), pow(double3(0.0, 3.4, double.PositiveInfinity), double3(-2.6, -2.6, -2.6)), 1, false); + TestUtils.AreEqual(double3(TestUtils.SignedDoubleQNaN(), 1.0, 1.0), pow(double3(TestUtils.SignedDoubleQNaN(), double.NegativeInfinity, -3.4), double3(-2.6, TestUtils.SignedDoubleZero(), TestUtils.SignedDoubleZero())), 1, false); + TestUtils.AreEqual(double3(1.0, 1.0, 1.0), pow(double3(TestUtils.SignedDoubleZero(), 0.0, 3.4), double3(TestUtils.SignedDoubleZero(), TestUtils.SignedDoubleZero(), TestUtils.SignedDoubleZero())), 1, false); + TestUtils.AreEqual(double3(1.0, 1.0, 1.0), pow(double3(double.PositiveInfinity, double.NegativeInfinity, -3.4), double3(TestUtils.SignedDoubleZero(), 0.0, 0.0)), 1, false); + TestUtils.AreEqual(double3(1.0, 1.0, 1.0), pow(double3(TestUtils.SignedDoubleZero(), 0.0, 3.4), double3(0.0, 0.0, 0.0)), 1, false); + TestUtils.AreEqual(double3(1.0, TestUtils.SignedDoubleQNaN(), 0.0), pow(double3(double.PositiveInfinity, -3.4, TestUtils.SignedDoubleZero()), double3(0.0, 2.6, 2.6)), 1, false); + TestUtils.AreEqual(double3(0.0, 24.090465076169735, double.PositiveInfinity), pow(double3(0.0, 3.4, double.PositiveInfinity), double3(2.6, 2.6, 2.6)), 1, false); + TestUtils.AreEqual(double3(TestUtils.SignedDoubleQNaN(), double.PositiveInfinity, double.PositiveInfinity), pow(double3(TestUtils.SignedDoubleQNaN(), double.NegativeInfinity, -3.4), double3(2.6, double.PositiveInfinity, double.PositiveInfinity)), 1, false); + TestUtils.AreEqual(double3(0.0, 0.0, double.PositiveInfinity), pow(double3(TestUtils.SignedDoubleZero(), 0.0, 3.4), double3(double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity)), 1, false); + TestUtils.AreEqual(double3(double.PositiveInfinity, TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), pow(double3(double.PositiveInfinity, TestUtils.SignedDoubleQNaN(), double.NegativeInfinity), double3(double.PositiveInfinity, double.PositiveInfinity, TestUtils.SignedDoubleQNaN())), 1, false); + TestUtils.AreEqual(double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), pow(double3(-3.4, TestUtils.SignedDoubleZero(), 0.0), double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN())), 1, false); + TestUtils.AreEqual(double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), pow(double3(3.4, double.PositiveInfinity, TestUtils.SignedDoubleQNaN()), double3(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN())), 1, false); + } + + [TestCompiler] + public static void pow_double4() + { + TestUtils.AreEqual(double4(0.0, 0.0, double.PositiveInfinity, double.PositiveInfinity), pow(double4(double.NegativeInfinity, -3.4, TestUtils.SignedDoubleZero(), 0.0), double4(double.NegativeInfinity, double.NegativeInfinity, double.NegativeInfinity, double.NegativeInfinity)), 1, false); + TestUtils.AreEqual(double4(0.0, 0.0, TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), pow(double4(3.4, double.PositiveInfinity, TestUtils.SignedDoubleQNaN(), -3.4), double4(double.NegativeInfinity, double.NegativeInfinity, double.NegativeInfinity, -2.6)), 1, false); + TestUtils.AreEqual(double4(double.PositiveInfinity, double.PositiveInfinity, 0.041510199028461224, 0.0), pow(double4(TestUtils.SignedDoubleZero(), 0.0, 3.4, double.PositiveInfinity), double4(-2.6, -2.6, -2.6, -2.6)), 1, false); + TestUtils.AreEqual(double4(TestUtils.SignedDoubleQNaN(), 1.0, 1.0, 1.0), pow(double4(TestUtils.SignedDoubleQNaN(), double.NegativeInfinity, -3.4, TestUtils.SignedDoubleZero()), double4(-2.6, TestUtils.SignedDoubleZero(), TestUtils.SignedDoubleZero(), TestUtils.SignedDoubleZero())), 1, false); + TestUtils.AreEqual(double4(1.0, 1.0, 1.0, 1.0), pow(double4(0.0, 3.4, double.PositiveInfinity, double.NegativeInfinity), double4(TestUtils.SignedDoubleZero(), TestUtils.SignedDoubleZero(), TestUtils.SignedDoubleZero(), 0.0)), 1, false); + TestUtils.AreEqual(double4(1.0, 1.0, 1.0, 1.0), pow(double4(-3.4, TestUtils.SignedDoubleZero(), 0.0, 3.4), double4(0.0, 0.0, 0.0, 0.0)), 1, false); + TestUtils.AreEqual(double4(1.0, TestUtils.SignedDoubleQNaN(), 0.0, 0.0), pow(double4(double.PositiveInfinity, -3.4, TestUtils.SignedDoubleZero(), 0.0), double4(0.0, 2.6, 2.6, 2.6)), 1, false); + TestUtils.AreEqual(double4(24.090465076169735, double.PositiveInfinity, TestUtils.SignedDoubleQNaN(), double.PositiveInfinity), pow(double4(3.4, double.PositiveInfinity, TestUtils.SignedDoubleQNaN(), double.NegativeInfinity), double4(2.6, 2.6, 2.6, double.PositiveInfinity)), 1, false); + TestUtils.AreEqual(double4(double.PositiveInfinity, 0.0, 0.0, double.PositiveInfinity), pow(double4(-3.4, TestUtils.SignedDoubleZero(), 0.0, 3.4), double4(double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity)), 1, false); + TestUtils.AreEqual(double4(double.PositiveInfinity, TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), pow(double4(double.PositiveInfinity, TestUtils.SignedDoubleQNaN(), double.NegativeInfinity, -3.4), double4(double.PositiveInfinity, double.PositiveInfinity, TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN())), 1, false); + TestUtils.AreEqual(double4(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), pow(double4(TestUtils.SignedDoubleZero(), 0.0, 3.4, double.PositiveInfinity), double4(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN())), 1, false); + TestUtils.AreEqual(double4(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), pow(double4(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN()), double4(TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN(), TestUtils.SignedDoubleQNaN())), 1, false); + } + + [TestCompiler] + public static void ceilpow2_int() + { + TestUtils.AreEqual(0, ceilpow2(0)); + TestUtils.AreEqual(1, ceilpow2(1)); + TestUtils.AreEqual(2, ceilpow2(2)); + TestUtils.AreEqual(4, ceilpow2(3)); + TestUtils.AreEqual(1073741824, ceilpow2(1019642234)); + TestUtils.AreEqual(-2147483648, ceilpow2(1823423423)); + TestUtils.AreEqual(0, ceilpow2(-2147483647)); + } + + [TestCompiler] + public static void ceilpow2_int2() + { + TestUtils.AreEqual(int2(0, 1), ceilpow2(int2(0, 1))); + TestUtils.AreEqual(int2(2, 4), ceilpow2(int2(2, 3))); + TestUtils.AreEqual(int2(1073741824, -2147483648), ceilpow2(int2(1019642234, 1823423423))); + TestUtils.AreEqual(int2(0, 0), ceilpow2(int2(-2147483647, -2147483647))); + } + + [TestCompiler] + public static void ceilpow2_int3() + { + TestUtils.AreEqual(int3(0, 1, 2), ceilpow2(int3(0, 1, 2))); + TestUtils.AreEqual(int3(4, 1073741824, -2147483648), ceilpow2(int3(3, 1019642234, 1823423423))); + TestUtils.AreEqual(int3(0, 0, 0), ceilpow2(int3(-2147483647, -2147483647, -2147483647))); + } + + [TestCompiler] + public static void ceilpow2_int4() + { + TestUtils.AreEqual(int4(0, 1, 2, 4), ceilpow2(int4(0, 1, 2, 3))); + TestUtils.AreEqual(int4(1073741824, -2147483648, 0, 0), ceilpow2(int4(1019642234, 1823423423, -2147483647, -2147483647))); + } + + [TestCompiler] + public static void ceilpow2_uint() + { + TestUtils.AreEqual(0u, ceilpow2(0u)); + TestUtils.AreEqual(1u, ceilpow2(1u)); + TestUtils.AreEqual(2u, ceilpow2(2u)); + TestUtils.AreEqual(4u, ceilpow2(3u)); + TestUtils.AreEqual(1073741824u, ceilpow2(1019642234u)); + TestUtils.AreEqual(2147483648u, ceilpow2(1823423423u)); + TestUtils.AreEqual(0u, ceilpow2(4294967295u)); + } + + [TestCompiler] + public static void ceilpow2_uint2() + { + TestUtils.AreEqual(uint2(0u, 1u), ceilpow2(uint2(0u, 1u))); + TestUtils.AreEqual(uint2(2u, 4u), ceilpow2(uint2(2u, 3u))); + TestUtils.AreEqual(uint2(1073741824u, 2147483648u), ceilpow2(uint2(1019642234u, 1823423423u))); + TestUtils.AreEqual(uint2(0u, 0u), ceilpow2(uint2(4294967295u, 4294967295u))); + } + + [TestCompiler] + public static void ceilpow2_uint3() + { + TestUtils.AreEqual(uint3(0u, 1u, 2u), ceilpow2(uint3(0u, 1u, 2u))); + TestUtils.AreEqual(uint3(4u, 1073741824u, 2147483648u), ceilpow2(uint3(3u, 1019642234u, 1823423423u))); + TestUtils.AreEqual(uint3(0u, 0u, 0u), ceilpow2(uint3(4294967295u, 4294967295u, 4294967295u))); + } + + [TestCompiler] + public static void ceilpow2_uint4() + { + TestUtils.AreEqual(uint4(0u, 1u, 2u, 4u), ceilpow2(uint4(0u, 1u, 2u, 3u))); + TestUtils.AreEqual(uint4(1073741824u, 2147483648u, 0u, 0u), ceilpow2(uint4(1019642234u, 1823423423u, 4294967295u, 4294967295u))); + } + + [TestCompiler] + public static void ceilpow2_long() + { + TestUtils.AreEqual(0L, ceilpow2(0L)); + TestUtils.AreEqual(1L, ceilpow2(1L)); + TestUtils.AreEqual(2L, ceilpow2(2L)); + TestUtils.AreEqual(4L, ceilpow2(3L)); + TestUtils.AreEqual(1073741824L, ceilpow2(1019642234L)); + TestUtils.AreEqual(2147483648L, ceilpow2(1823423423L)); + TestUtils.AreEqual(2147483648L, ceilpow2(2147483648L)); + TestUtils.AreEqual(4294967296L, ceilpow2(4294967295L)); + TestUtils.AreEqual(4294967296L, ceilpow2(4294967296L)); + TestUtils.AreEqual(-9223372036854775808L, ceilpow2(7227372236554874814L)); + TestUtils.AreEqual(0L, ceilpow2(-100L)); + } + + [TestCompiler] + public static void ceilpow2_ulong() + { + TestUtils.AreEqual(0UL, ceilpow2(0UL)); + TestUtils.AreEqual(1UL, ceilpow2(1UL)); + TestUtils.AreEqual(2UL, ceilpow2(2UL)); + TestUtils.AreEqual(4UL, ceilpow2(3UL)); + TestUtils.AreEqual(1073741824UL, ceilpow2(1019642234UL)); + TestUtils.AreEqual(2147483648UL, ceilpow2(1823423423UL)); + TestUtils.AreEqual(2147483648UL, ceilpow2(2147483648UL)); + TestUtils.AreEqual(4294967296UL, ceilpow2(4294967295UL)); + TestUtils.AreEqual(4294967296UL, ceilpow2(4294967296UL)); + TestUtils.AreEqual(9223372036854775808UL, ceilpow2(7227372236554874814UL)); + TestUtils.AreEqual(0UL, ceilpow2(10223372036854775808UL)); + } + + [TestCompiler] + public static void floorlog2_int() + { + TestUtils.AreEqual(0, floorlog2(1)); + TestUtils.AreEqual(1, floorlog2(2)); + TestUtils.AreEqual(1, floorlog2(3)); + TestUtils.AreEqual(2, floorlog2(4)); + TestUtils.AreEqual(2, floorlog2(5)); + TestUtils.AreEqual(14, floorlog2(32767)); + TestUtils.AreEqual(15, floorlog2(32768)); + TestUtils.AreEqual(15, floorlog2(32769)); + TestUtils.AreEqual(30, floorlog2(2147483647)); + } + + [TestCompiler] + public static void floorlog2_int2() + { + TestUtils.AreEqual(int2(0, 1), floorlog2(int2(1, 2))); + TestUtils.AreEqual(int2(1, 2), floorlog2(int2(3, 4))); + TestUtils.AreEqual(int2(2, 14), floorlog2(int2(5, 32767))); + TestUtils.AreEqual(int2(15, 15), floorlog2(int2(32768, 32769))); + TestUtils.AreEqual(int2(30, 30), floorlog2(int2(2147483647, 2147483647))); + } + + [TestCompiler] + public static void floorlog2_int3() + { + TestUtils.AreEqual(int3(0, 1, 1), floorlog2(int3(1, 2, 3))); + TestUtils.AreEqual(int3(2, 2, 14), floorlog2(int3(4, 5, 32767))); + TestUtils.AreEqual(int3(15, 15, 30), floorlog2(int3(32768, 32769, 2147483647))); + } + + [TestCompiler] + public static void floorlog2_int4() + { + TestUtils.AreEqual(int4(0, 1, 1, 2), floorlog2(int4(1, 2, 3, 4))); + TestUtils.AreEqual(int4(2, 14, 15, 15), floorlog2(int4(5, 32767, 32768, 32769))); + TestUtils.AreEqual(int4(30, 30, 30, 30), floorlog2(int4(2147483647, 2147483647, 2147483647, 2147483647))); + } + + [TestCompiler] + public static void floorlog2_uint() + { + TestUtils.AreEqual(0, floorlog2(1u)); + TestUtils.AreEqual(1, floorlog2(2u)); + TestUtils.AreEqual(1, floorlog2(3u)); + TestUtils.AreEqual(2, floorlog2(4u)); + TestUtils.AreEqual(2, floorlog2(5u)); + TestUtils.AreEqual(14, floorlog2(32767u)); + TestUtils.AreEqual(15, floorlog2(32768u)); + TestUtils.AreEqual(15, floorlog2(32769u)); + TestUtils.AreEqual(30, floorlog2(2147483647u)); + } + + [TestCompiler] + public static void floorlog2_uint2() + { + TestUtils.AreEqual(int2(0, 1), floorlog2(uint2(1u, 2u))); + TestUtils.AreEqual(int2(1, 2), floorlog2(uint2(3u, 4u))); + TestUtils.AreEqual(int2(2, 14), floorlog2(uint2(5u, 32767u))); + TestUtils.AreEqual(int2(15, 15), floorlog2(uint2(32768u, 32769u))); + TestUtils.AreEqual(int2(30, 30), floorlog2(uint2(2147483647u, 2147483647u))); + } + + [TestCompiler] + public static void floorlog2_uint3() + { + TestUtils.AreEqual(int3(0, 1, 1), floorlog2(uint3(1u, 2u, 3u))); + TestUtils.AreEqual(int3(2, 2, 14), floorlog2(uint3(4u, 5u, 32767u))); + TestUtils.AreEqual(int3(15, 15, 30), floorlog2(uint3(32768u, 32769u, 2147483647u))); + } + + [TestCompiler] + public static void floorlog2_uint4() + { + TestUtils.AreEqual(int4(0, 1, 1, 2), floorlog2(uint4(1u, 2u, 3u, 4u))); + TestUtils.AreEqual(int4(2, 14, 15, 15), floorlog2(uint4(5u, 32767u, 32768u, 32769u))); + TestUtils.AreEqual(int4(30, 30, 30, 30), floorlog2(uint4(2147483647u, 2147483647u, 2147483647u, 2147483647u))); + } + + [TestCompiler] + public static void ceillog2_int() + { + TestUtils.AreEqual(0, ceillog2(1)); + TestUtils.AreEqual(1, ceillog2(2)); + TestUtils.AreEqual(2, ceillog2(3)); + TestUtils.AreEqual(2, ceillog2(4)); + TestUtils.AreEqual(3, ceillog2(5)); + TestUtils.AreEqual(6, ceillog2(63)); + TestUtils.AreEqual(6, ceillog2(64)); + TestUtils.AreEqual(7, ceillog2(65)); + TestUtils.AreEqual(24, ceillog2(16777215)); + TestUtils.AreEqual(24, ceillog2(16777216)); + TestUtils.AreEqual(25, ceillog2(16777217)); + TestUtils.AreEqual(31, ceillog2(2147483646)); + TestUtils.AreEqual(31, ceillog2(2147483647)); + } + + [TestCompiler] + public static void ceillog2_int2() + { + TestUtils.AreEqual(int2(0, 1), ceillog2(int2(1, 2))); + TestUtils.AreEqual(int2(2, 2), ceillog2(int2(3, 4))); + TestUtils.AreEqual(int2(3, 6), ceillog2(int2(5, 63))); + TestUtils.AreEqual(int2(6, 7), ceillog2(int2(64, 65))); + TestUtils.AreEqual(int2(24, 24), ceillog2(int2(16777215, 16777216))); + TestUtils.AreEqual(int2(25, 31), ceillog2(int2(16777217, 2147483646))); + TestUtils.AreEqual(int2(31, 31), ceillog2(int2(2147483647, 2147483647))); + } + + [TestCompiler] + public static void ceillog2_int3() + { + TestUtils.AreEqual(int3(0, 1, 2), ceillog2(int3(1, 2, 3))); + TestUtils.AreEqual(int3(2, 3, 6), ceillog2(int3(4, 5, 63))); + TestUtils.AreEqual(int3(6, 7, 24), ceillog2(int3(64, 65, 16777215))); + TestUtils.AreEqual(int3(24, 25, 31), ceillog2(int3(16777216, 16777217, 2147483646))); + TestUtils.AreEqual(int3(31, 31, 31), ceillog2(int3(2147483647, 2147483647, 2147483647))); + } + + [TestCompiler] + public static void ceillog2_int4() + { + TestUtils.AreEqual(int4(0, 1, 2, 2), ceillog2(int4(1, 2, 3, 4))); + TestUtils.AreEqual(int4(3, 6, 6, 7), ceillog2(int4(5, 63, 64, 65))); + TestUtils.AreEqual(int4(24, 24, 25, 31), ceillog2(int4(16777215, 16777216, 16777217, 2147483646))); + TestUtils.AreEqual(int4(31, 31, 31, 31), ceillog2(int4(2147483647, 2147483647, 2147483647, 2147483647))); + } + + [TestCompiler] + public static void ceillog2_uint() + { + TestUtils.AreEqual(0, ceillog2(1u)); + TestUtils.AreEqual(1, ceillog2(2u)); + TestUtils.AreEqual(2, ceillog2(3u)); + TestUtils.AreEqual(2, ceillog2(4u)); + TestUtils.AreEqual(3, ceillog2(5u)); + TestUtils.AreEqual(6, ceillog2(63u)); + TestUtils.AreEqual(6, ceillog2(64u)); + TestUtils.AreEqual(7, ceillog2(65u)); + TestUtils.AreEqual(24, ceillog2(16777215u)); + TestUtils.AreEqual(24, ceillog2(16777216u)); + TestUtils.AreEqual(25, ceillog2(16777217u)); + TestUtils.AreEqual(32, ceillog2(4294967294u)); + TestUtils.AreEqual(32, ceillog2(4294967295u)); + } + + [TestCompiler] + public static void ceillog2_uint2() + { + TestUtils.AreEqual(int2(0, 1), ceillog2(uint2(1u, 2u))); + TestUtils.AreEqual(int2(2, 2), ceillog2(uint2(3u, 4u))); + TestUtils.AreEqual(int2(3, 6), ceillog2(uint2(5u, 63u))); + TestUtils.AreEqual(int2(6, 7), ceillog2(uint2(64u, 65u))); + TestUtils.AreEqual(int2(24, 24), ceillog2(uint2(16777215u, 16777216u))); + TestUtils.AreEqual(int2(25, 32), ceillog2(uint2(16777217u, 4294967294u))); + TestUtils.AreEqual(int2(32, 32), ceillog2(uint2(4294967295u, 4294967295u))); + } + + [TestCompiler] + public static void ceillog2_uint3() + { + TestUtils.AreEqual(int3(0, 1, 2), ceillog2(uint3(1u, 2u, 3u))); + TestUtils.AreEqual(int3(2, 3, 6), ceillog2(uint3(4u, 5u, 63u))); + TestUtils.AreEqual(int3(6, 7, 24), ceillog2(uint3(64u, 65u, 16777215u))); + TestUtils.AreEqual(int3(24, 25, 32), ceillog2(uint3(16777216u, 16777217u, 4294967294u))); + TestUtils.AreEqual(int3(32, 32, 32), ceillog2(uint3(4294967295u, 4294967295u, 4294967295u))); + } + + [TestCompiler] + public static void ceillog2_uint4() + { + TestUtils.AreEqual(int4(0, 1, 2, 2), ceillog2(uint4(1u, 2u, 3u, 4u))); + TestUtils.AreEqual(int4(3, 6, 6, 7), ceillog2(uint4(5u, 63u, 64u, 65u))); + TestUtils.AreEqual(int4(24, 24, 25, 32), ceillog2(uint4(16777215u, 16777216u, 16777217u, 4294967294u))); + TestUtils.AreEqual(int4(32, 32, 32, 32), ceillog2(uint4(4294967295u, 4294967295u, 4294967295u, 4294967295u))); + } + + [TestCompiler] + public static void ispow2_int() + { + TestUtils.AreEqual(false, ispow2(-3)); + TestUtils.AreEqual(false, ispow2(-2)); + TestUtils.AreEqual(false, ispow2(-1)); + TestUtils.AreEqual(false, ispow2(0)); + TestUtils.AreEqual(true, ispow2(1)); + TestUtils.AreEqual(true, ispow2(2)); + TestUtils.AreEqual(false, ispow2(3)); + TestUtils.AreEqual(true, ispow2(4)); + TestUtils.AreEqual(false, ispow2(32767)); + TestUtils.AreEqual(true, ispow2(32768)); + TestUtils.AreEqual(false, ispow2(32769)); + TestUtils.AreEqual(false, ispow2(2097151)); + TestUtils.AreEqual(true, ispow2(2097152)); + TestUtils.AreEqual(false, ispow2(268431360)); + } + + [TestCompiler] + public static void ispow2_int2() + { + TestUtils.AreEqual(bool2(false, false), ispow2(int2(-3, -2))); + TestUtils.AreEqual(bool2(false, false), ispow2(int2(-1, 0))); + TestUtils.AreEqual(bool2(true, true), ispow2(int2(1, 2))); + TestUtils.AreEqual(bool2(false, true), ispow2(int2(3, 4))); + TestUtils.AreEqual(bool2(false, true), ispow2(int2(32767, 32768))); + TestUtils.AreEqual(bool2(false, false), ispow2(int2(32769, 2097151))); + TestUtils.AreEqual(bool2(true, false), ispow2(int2(2097152, 268431360))); + } + + [TestCompiler] + public static void ispow2_int3() + { + TestUtils.AreEqual(bool3(false, false, false), ispow2(int3(-3, -2, -1))); + TestUtils.AreEqual(bool3(false, true, true), ispow2(int3(0, 1, 2))); + TestUtils.AreEqual(bool3(false, true, false), ispow2(int3(3, 4, 32767))); + TestUtils.AreEqual(bool3(true, false, false), ispow2(int3(32768, 32769, 2097151))); + TestUtils.AreEqual(bool3(true, false, false), ispow2(int3(2097152, 268431360, 268431360))); + } + + [TestCompiler] + public static void ispow2_int4() + { + TestUtils.AreEqual(bool4(false, false, false, false), ispow2(int4(-3, -2, -1, 0))); + TestUtils.AreEqual(bool4(true, true, false, true), ispow2(int4(1, 2, 3, 4))); + TestUtils.AreEqual(bool4(false, true, false, false), ispow2(int4(32767, 32768, 32769, 2097151))); + TestUtils.AreEqual(bool4(true, false, false, false), ispow2(int4(2097152, 268431360, 268431360, 268431360))); + } + + [TestCompiler] + public static void ispow2_uint() + { + TestUtils.AreEqual(false, ispow2(0u)); + TestUtils.AreEqual(true, ispow2(1u)); + TestUtils.AreEqual(true, ispow2(2u)); + TestUtils.AreEqual(false, ispow2(3u)); + TestUtils.AreEqual(true, ispow2(4u)); + TestUtils.AreEqual(false, ispow2(32767u)); + TestUtils.AreEqual(true, ispow2(32768u)); + TestUtils.AreEqual(false, ispow2(32769u)); + TestUtils.AreEqual(false, ispow2(2097151u)); + TestUtils.AreEqual(true, ispow2(2097152u)); + TestUtils.AreEqual(false, ispow2(2097153u)); + TestUtils.AreEqual(false, ispow2(268431360u)); + } + + [TestCompiler] + public static void ispow2_uint2() + { + TestUtils.AreEqual(bool2(false, true), ispow2(uint2(0u, 1u))); + TestUtils.AreEqual(bool2(true, false), ispow2(uint2(2u, 3u))); + TestUtils.AreEqual(bool2(true, false), ispow2(uint2(4u, 32767u))); + TestUtils.AreEqual(bool2(true, false), ispow2(uint2(32768u, 32769u))); + TestUtils.AreEqual(bool2(false, true), ispow2(uint2(2097151u, 2097152u))); + TestUtils.AreEqual(bool2(false, false), ispow2(uint2(2097153u, 268431360u))); + } + + [TestCompiler] + public static void ispow2_uint3() + { + TestUtils.AreEqual(bool3(false, true, true), ispow2(uint3(0u, 1u, 2u))); + TestUtils.AreEqual(bool3(false, true, false), ispow2(uint3(3u, 4u, 32767u))); + TestUtils.AreEqual(bool3(true, false, false), ispow2(uint3(32768u, 32769u, 2097151u))); + TestUtils.AreEqual(bool3(true, false, false), ispow2(uint3(2097152u, 2097153u, 268431360u))); + } + + [TestCompiler] + public static void ispow2_uint4() + { + TestUtils.AreEqual(bool4(false, true, true, false), ispow2(uint4(0u, 1u, 2u, 3u))); + TestUtils.AreEqual(bool4(true, false, true, false), ispow2(uint4(4u, 32767u, 32768u, 32769u))); + TestUtils.AreEqual(bool4(false, true, false, false), ispow2(uint4(2097151u, 2097152u, 2097153u, 268431360u))); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestMath.gen.cs.meta b/src/Tests/Tests/Shared/TestMath.gen.cs.meta new file mode 100644 index 00000000..429eec9a --- /dev/null +++ b/src/Tests/Tests/Shared/TestMath.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0a9baee454a793140a0be3d7d81d09ee +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestMatrix.cs b/src/Tests/Tests/Shared/TestMatrix.cs new file mode 100644 index 00000000..558ce482 --- /dev/null +++ b/src/Tests/Tests/Shared/TestMatrix.cs @@ -0,0 +1,1214 @@ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + class TestMatrix + { + [TestCompiler] + public static void float2x2_constructor_columns() + { + float2x2 a = float2x2(float2(1.0f, 2.0f), + float2(3.0f, 4.0f)); + + TestUtils.AreEqual(1.0f, a.c0.x); + TestUtils.AreEqual(2.0f, a.c0.y); + TestUtils.AreEqual(3.0f, a.c1.x); + TestUtils.AreEqual(4.0f, a.c1.y); + } + + [TestCompiler] + public static void float3x3_constructor_columns() + { + float3x3 a = float3x3(float3(1.0f, 2.0f, 3.0f), + float3(4.0f, 5.0f, 6.0f), + float3(7.0f, 8.0f, 9.0f)); + + TestUtils.AreEqual(1.0f, a.c0.x); + TestUtils.AreEqual(2.0f, a.c0.y); + TestUtils.AreEqual(3.0f, a.c0.z); + TestUtils.AreEqual(4.0f, a.c1.x); + TestUtils.AreEqual(5.0f, a.c1.y); + TestUtils.AreEqual(6.0f, a.c1.z); + TestUtils.AreEqual(7.0f, a.c2.x); + TestUtils.AreEqual(8.0f, a.c2.y); + TestUtils.AreEqual(9.0f, a.c2.z); + } + + [TestCompiler] + public static void float4x4_constructor_columns() + { + float4x4 a = float4x4(float4( 1.0f, 2.0f, 3.0f, 4.0f), + float4( 5.0f, 6.0f, 7.0f, 8.0f), + float4( 9.0f, 10.0f, 11.0f, 12.0f), + float4(13.0f, 14.0f, 15.0f, 16.0f)); + + TestUtils.AreEqual(1.0f, a.c0.x); + TestUtils.AreEqual(2.0f, a.c0.y); + TestUtils.AreEqual(3.0f, a.c0.z); + TestUtils.AreEqual(4.0f, a.c0.w); + TestUtils.AreEqual(5.0f, a.c1.x); + TestUtils.AreEqual(6.0f, a.c1.y); + TestUtils.AreEqual(7.0f, a.c1.z); + TestUtils.AreEqual(8.0f, a.c1.w); + TestUtils.AreEqual(9.0f, a.c2.x); + TestUtils.AreEqual(10.0f, a.c2.y); + TestUtils.AreEqual(11.0f, a.c2.z); + TestUtils.AreEqual(12.0f, a.c2.w); + TestUtils.AreEqual(13.0f, a.c3.x); + TestUtils.AreEqual(14.0f, a.c3.y); + TestUtils.AreEqual(15.0f, a.c3.z); + TestUtils.AreEqual(16.0f, a.c3.w); + } + + [TestCompiler] + public static void float2x2_constructor_scalars() + { + float2x2 a = float2x2(1.0f, 2.0f, + 3.0f, 4.0f); + + TestUtils.AreEqual(1.0f, a.c0.x); + TestUtils.AreEqual(2.0f, a.c1.x); + TestUtils.AreEqual(3.0f, a.c0.y); + TestUtils.AreEqual(4.0f, a.c1.y); + } + + [TestCompiler] + public static void float3x3_constructor_scalars() + { + float3x3 a = float3x3(1.0f, 2.0f, 3.0f, + 4.0f, 5.0f, 6.0f, + 7.0f, 8.0f, 9.0f); + + TestUtils.AreEqual(1.0f, a.c0.x); + TestUtils.AreEqual(2.0f, a.c1.x); + TestUtils.AreEqual(3.0f, a.c2.x); + TestUtils.AreEqual(4.0f, a.c0.y); + TestUtils.AreEqual(5.0f, a.c1.y); + TestUtils.AreEqual(6.0f, a.c2.y); + TestUtils.AreEqual(7.0f, a.c0.z); + TestUtils.AreEqual(8.0f, a.c1.z); + TestUtils.AreEqual(9.0f, a.c2.z); + } + + [TestCompiler] + public static void float4x4_constructor_scalars() + { + float4x4 a = float4x4( 1.0f, 2.0f, 3.0f, 4.0f, + 5.0f, 6.0f, 7.0f, 8.0f, + 9.0f, 10.0f, 11.0f, 12.0f, + 13.0f, 14.0f, 15.0f, 16.0f); + + TestUtils.AreEqual(1.0f, a.c0.x); + TestUtils.AreEqual(2.0f, a.c1.x); + TestUtils.AreEqual(3.0f, a.c2.x); + TestUtils.AreEqual(4.0f, a.c3.x); + TestUtils.AreEqual(5.0f, a.c0.y); + TestUtils.AreEqual(6.0f, a.c1.y); + TestUtils.AreEqual(7.0f, a.c2.y); + TestUtils.AreEqual(8.0f, a.c3.y); + TestUtils.AreEqual(9.0f, a.c0.z); + TestUtils.AreEqual(10.0f, a.c1.z); + TestUtils.AreEqual(11.0f, a.c2.z); + TestUtils.AreEqual(12.0f, a.c3.z); + TestUtils.AreEqual(13.0f, a.c0.w); + TestUtils.AreEqual(14.0f, a.c1.w); + TestUtils.AreEqual(15.0f, a.c2.w); + TestUtils.AreEqual(16.0f, a.c3.w); + } + + [TestCompiler] + public static void float4x4_constructor_float3x3() + { + float3x3 rot = float3x3(1.0f, 2.0f, 3.0f, + 4.0f, 5.0f, 6.0f, + 7.0f, 8.0f, 9.0f); + float3 pos = float3(10.0f, 11.0f, 12.0f); + float4x4 m = float4x4(rot, pos); + + float4x4 r = float4x4(1.0f, 2.0f, 3.0f, 10.0f, + 4.0f, 5.0f, 6.0f, 11.0f, + 7.0f, 8.0f, 9.0f, 12.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + TestUtils.AreEqual(r, m); + } + + + [TestCompiler] + public static void float3x3_constructor_quaternion() + { + float3x3 m = float3x3(normalize(quaternion(1.0f, 2.5f, 3.3f, 4.6f))); + + float3x3 r = float3x3( 0.12774f, -0.64529f, 0.75318f, + 0.89975f, 0.39491f, 0.18575f, + -0.41730f, 0.65394f, 0.63104f); + + TestUtils.AreEqual(r, m, 0.0001f); + } + + [TestCompiler] + public static void float4x4_constructor_quaternion_position() + { + float4x4 m = float4x4(normalize(quaternion(1.0f, 2.5f, 3.3f, 4.6f)), float3(1.0f, 2.0f, 3.0f)); + + float4x4 r = float4x4( 0.12774f, -0.64529f, 0.75318f, 1.0f, + 0.89975f, 0.39491f, 0.18575f, 2.0f, + -0.41730f, 0.65394f, 0.63104f, 3.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + + TestUtils.AreEqual(r, m, 0.0001f); + } + + [TestCompiler] + public static void float2x2_identity() + { + float2x2 a = float2x2.identity; + TestUtils.AreEqual(1.0f, a.c0.x); + TestUtils.AreEqual(0.0f, a.c1.x); + TestUtils.AreEqual(0.0f, a.c0.y); + TestUtils.AreEqual(1.0f, a.c1.y); + } + + [TestCompiler] + public static void float3x3_identity() + { + float3x3 a = float3x3.identity; + TestUtils.AreEqual(1.0f, a.c0.x); + TestUtils.AreEqual(0.0f, a.c1.x); + TestUtils.AreEqual(0.0f, a.c2.x); + TestUtils.AreEqual(0.0f, a.c0.y); + TestUtils.AreEqual(1.0f, a.c1.y); + TestUtils.AreEqual(0.0f, a.c2.y); + TestUtils.AreEqual(0.0f, a.c0.z); + TestUtils.AreEqual(0.0f, a.c1.z); + TestUtils.AreEqual(1.0f, a.c2.z); + } + + [TestCompiler] + public static void float4x4_identity() + { + float4x4 a = float4x4.identity; + TestUtils.AreEqual(1.0f, a.c0.x); + TestUtils.AreEqual(0.0f, a.c1.x); + TestUtils.AreEqual(0.0f, a.c2.x); + TestUtils.AreEqual(0.0f, a.c3.x); + TestUtils.AreEqual(0.0f, a.c0.y); + TestUtils.AreEqual(1.0f, a.c1.y); + TestUtils.AreEqual(0.0f, a.c2.y); + TestUtils.AreEqual(0.0f, a.c3.y); + TestUtils.AreEqual(0.0f, a.c0.z); + TestUtils.AreEqual(0.0f, a.c1.z); + TestUtils.AreEqual(1.0f, a.c2.z); + TestUtils.AreEqual(0.0f, a.c3.z); + TestUtils.AreEqual(0.0f, a.c0.w); + TestUtils.AreEqual(0.0f, a.c1.w); + TestUtils.AreEqual(0.0f, a.c2.w); + TestUtils.AreEqual(1.0f, a.c3.w); + } + + [TestCompiler] + public static void float2x2_rotate() + { + float epsilon = 0.0001f; + float angle = 10.3f; + float2x2 m = float2x2.Rotate(angle); + TestUtils.AreEqual(cos(angle), m.c0.x, epsilon); + TestUtils.AreEqual(sin(angle), m.c0.y, epsilon); + TestUtils.AreEqual(-sin(angle), m.c1.x, epsilon); + TestUtils.AreEqual(cos(angle), m.c1.y, epsilon); + } + + [TestCompiler] + public static void float3x3_axis_angle() + { + float3 axis = normalize(float3(1.1f, 2.3f, -3.6f)); + float angle = 2.7f; + + float3x3 r = float3x3(quaternion.AxisAngle(axis, angle)); + float3x3 m = float3x3.AxisAngle(axis, angle); + TestUtils.AreEqual(r, m, 0.00001f); + } + + [TestCompiler] + public static void float3x3_axis_angle_consistency() + { + TestUtils.AreEqual(float3x3.RotateX(1.0f), float3x3.AxisAngle(float3(1, 0, 0), 1.0f), 0.001f); + TestUtils.AreEqual(float3x3.RotateY(1.0f), float3x3.AxisAngle(float3(0, 1, 0), 1.0f), 0.001f); + TestUtils.AreEqual(float3x3.RotateZ(1.0f), float3x3.AxisAngle(float3(0, 0, 1), 1.0f), 0.001f); + } + + [TestCompiler] + public static void float3x3_rotate_x() + { + float epsilon = 0.0001f; + float angle = 10.3f; + float3x3 m = float3x3.RotateX(angle); + TestUtils.AreEqual(1.0f, m.c0.x, epsilon); + TestUtils.AreEqual(0.0f, m.c0.y, epsilon); + TestUtils.AreEqual(0.0f, m.c0.z, epsilon); + TestUtils.AreEqual(0.0f, m.c1.x, epsilon); + TestUtils.AreEqual(cos(angle), m.c1.y, epsilon); + TestUtils.AreEqual(sin(angle), m.c1.z, epsilon); + TestUtils.AreEqual(0.0f, m.c2.x, epsilon); + TestUtils.AreEqual(-sin(angle), m.c2.y, epsilon); + TestUtils.AreEqual(cos(angle), m.c2.z, epsilon); + } + + [TestCompiler] + public static void float3x3_rotate_y() + { + float epsilon = 0.0001f; + float angle = 10.3f; + float3x3 m = float3x3.RotateY(angle); + TestUtils.AreEqual(cos(angle), m.c0.x, epsilon); + TestUtils.AreEqual(0.0f, m.c0.y, epsilon); + TestUtils.AreEqual(-sin(angle), m.c0.z, epsilon); + TestUtils.AreEqual(0.0f, m.c1.x, epsilon); + TestUtils.AreEqual(1.0f, m.c1.y, epsilon); + TestUtils.AreEqual(0.0f, m.c1.z, epsilon); + TestUtils.AreEqual(sin(angle), m.c2.x, epsilon); + TestUtils.AreEqual(0.0f, m.c2.y, epsilon); + TestUtils.AreEqual(cos(angle), m.c2.z, epsilon); + } + + [TestCompiler] + public static void float3x3_rotate_z() + { + float epsilon = 0.0001f; + float angle = 10.3f; + float3x3 m = float3x3.RotateZ(angle); + TestUtils.AreEqual(cos(angle), m.c0.x, epsilon); + TestUtils.AreEqual(sin(angle), m.c0.y, epsilon); + TestUtils.AreEqual(0.0f, m.c0.z, epsilon); + TestUtils.AreEqual(-sin(angle), m.c1.x, epsilon); + TestUtils.AreEqual(cos(angle), m.c1.y, epsilon); + TestUtils.AreEqual(0.0f, m.c1.z, epsilon); + TestUtils.AreEqual(0.0f, m.c2.x, epsilon); + TestUtils.AreEqual(0.0f, m.c2.y, epsilon); + TestUtils.AreEqual(1.0f, m.c2.z, epsilon); + } + + [TestCompiler] + public static void float3x3_rotate_x_handedness() + { + float3 a = float3(0.0f, 0.3f, 0.7f); + float3x3 m = float3x3.RotateX(0.3f); + float3 b = mul(m, a); + float w = cross(a, b).x; + TestUtils.AreEqual(w > 0.0f, true); + } + + + [TestCompiler] + public static void float3x3_rotate_y_handedness() + { + float3 a = float3(0.3f, 0.0f, 0.7f); + float3x3 m = float3x3.RotateY(0.3f); + float3 b = mul(m, a); + float w = cross(a, b).y; + TestUtils.AreEqual(w > 0.0f, true); + } + + [TestCompiler] + public static void float3x3_rotate_z_handedness() + { + float3 a = float3(0.3f, 0.7f, 0.0f); + float3x3 m = float3x3.RotateZ(0.3f); + float3 b = mul(m, a); + float w = cross(a, b).z; + TestUtils.AreEqual(w > 0.0f, true); + } + + [TestCompiler] + public static void float4x4_axis_angle() + { + float3 axis = normalize(float3(1.1f, 2.3f, -3.6f)); + float angle = 2.7f; + + float4x4 r = float4x4(quaternion.AxisAngle(axis, angle), float3.zero); + float4x4 m = float4x4.AxisAngle(axis, angle); + TestUtils.AreEqual(r, m, 0.00001f); + } + + [TestCompiler] + public static void float4x4_axis_angle_consistency() + { + TestUtils.AreEqual(float4x4.RotateX(1.0f), float4x4.AxisAngle(float3(1, 0, 0), 1.0f), 0.001f); + TestUtils.AreEqual(float4x4.RotateY(1.0f), float4x4.AxisAngle(float3(0, 1, 0), 1.0f), 0.001f); + TestUtils.AreEqual(float4x4.RotateZ(1.0f), float4x4.AxisAngle(float3(0, 0, 1), 1.0f), 0.001f); + } + + [TestCompiler] + public static void float4x4_rotate_x() + { + float epsilon = 0.0001f; + float angle = 10.3f; + float4x4 m = float4x4.RotateX(angle); + TestUtils.AreEqual(1.0f, m.c0.x, epsilon); + TestUtils.AreEqual(0.0f, m.c0.y, epsilon); + TestUtils.AreEqual(0.0f, m.c0.z, epsilon); + TestUtils.AreEqual(0.0f, m.c0.w, epsilon); + TestUtils.AreEqual(0.0f, m.c1.x, epsilon); + TestUtils.AreEqual(cos(angle), m.c1.y, epsilon); + TestUtils.AreEqual(sin(angle), m.c1.z, epsilon); + TestUtils.AreEqual(0.0f, m.c1.w, epsilon); + TestUtils.AreEqual(0.0f, m.c2.x, epsilon); + TestUtils.AreEqual(-sin(angle), m.c2.y, epsilon); + TestUtils.AreEqual(cos(angle), m.c2.z, epsilon); + TestUtils.AreEqual(0.0f, m.c2.w, epsilon); + TestUtils.AreEqual(0.0f, m.c3.x, epsilon); + TestUtils.AreEqual(0.0f, m.c3.y, epsilon); + TestUtils.AreEqual(0.0f, m.c3.z, epsilon); + TestUtils.AreEqual(1.0f, m.c3.w, epsilon); + } + + [TestCompiler] + public static void float4x4_rotate_y() + { + float epsilon = 0.0001f; + float angle = 10.3f; + float4x4 m = float4x4.RotateY(angle); + TestUtils.AreEqual(cos(angle), m.c0.x, epsilon); + TestUtils.AreEqual(0.0f, m.c0.y, epsilon); + TestUtils.AreEqual(-sin(angle), m.c0.z, epsilon); + TestUtils.AreEqual(0.0f, m.c0.w, epsilon); + TestUtils.AreEqual(0.0f, m.c1.x, epsilon); + TestUtils.AreEqual(1.0f, m.c1.y, epsilon); + TestUtils.AreEqual(0.0f, m.c1.z, epsilon); + TestUtils.AreEqual(0.0f, m.c1.w, epsilon); + TestUtils.AreEqual(sin(angle), m.c2.x, epsilon); + TestUtils.AreEqual(0.0f, m.c2.y, epsilon); + TestUtils.AreEqual(cos(angle), m.c2.z, epsilon); + TestUtils.AreEqual(0.0f, m.c2.w); + TestUtils.AreEqual(0.0f, m.c3.x); + TestUtils.AreEqual(0.0f, m.c3.y); + TestUtils.AreEqual(0.0f, m.c3.z); + TestUtils.AreEqual(1.0f, m.c3.w); + } + + [TestCompiler] + public static void float4x4_rotate_z() + { + float epsilon = 0.0001f; + float angle = 10.3f; + float4x4 m = float4x4.RotateZ(angle); + TestUtils.AreEqual(cos(angle), m.c0.x, epsilon); + TestUtils.AreEqual(sin(angle), m.c0.y, epsilon); + TestUtils.AreEqual(0.0f, m.c0.z, epsilon); + TestUtils.AreEqual(0.0f, m.c0.w, epsilon); + TestUtils.AreEqual(-sin(angle), m.c1.x, epsilon); + TestUtils.AreEqual(cos(angle), m.c1.y, epsilon); + TestUtils.AreEqual(0.0f, m.c1.z, epsilon); + TestUtils.AreEqual(0.0f, m.c1.w, epsilon); + TestUtils.AreEqual(0.0f, m.c2.x, epsilon); + TestUtils.AreEqual(0.0f, m.c2.y, epsilon); + TestUtils.AreEqual(1.0f, m.c2.z, epsilon); + TestUtils.AreEqual(0.0f, m.c2.w, epsilon); + TestUtils.AreEqual(0.0f, m.c3.x, epsilon); + TestUtils.AreEqual(0.0f, m.c3.y, epsilon); + TestUtils.AreEqual(0.0f, m.c3.z, epsilon); + TestUtils.AreEqual(1.0f, m.c3.w, epsilon); + } + + [TestCompiler] + public static void float4x4_rotate_x_handedness() + { + float3 a = float3(0.0f, 0.3f, 0.7f); + float4x4 m = float4x4.RotateX(0.3f); + float3 b = rotate(m, a); + float w = cross(a, b).x; + TestUtils.AreEqual(w > 0.0f, true); + } + + + [TestCompiler] + public static void float4x4_rotate_y_handedness() + { + float3 a = float3(0.3f, 0.0f, 0.7f); + float4x4 m = float4x4.RotateY(0.3f); + float3 b = rotate(m, a); + float w = cross(a, b).y; + TestUtils.AreEqual(w > 0.0f, true); + } + + [TestCompiler] + public static void float4x4_rotate_z_handedness() + { + float3 a = float3(0.3f, 0.7f, 0.0f); + float4x4 m = float4x4.RotateZ(0.3f); + float3 b = rotate(m, a); + float w = cross(a, b).z; + TestUtils.AreEqual(w > 0.0f, true); + } + + + // rotation by (-50, 28, 39) degrees from Max + static internal readonly float3 test_angles = math.radians(float3(-50.0f, 28.0f, 39.0f)); + + static internal readonly float3x3 test3x3_xyz = new float3x3( 0.686179155968f, -0.684009078513f, -0.247567660300f, + 0.555656924414f, 0.273213475262f, 0.785238676636f, + -0.469471562786f, -0.676377097075f, 0.567547772692f); + + static internal readonly float3x3 test3x3_xzy = new float3x3( 0.686179155968f, -0.716805468125f, -0.123887395569f, + 0.629320391050f, 0.499539794942f, 0.595328345266f, + -0.364847929038f, -0.486466765705f, 0.793874092373f); + + static internal readonly float3x3 test3x3_yxz = new float3x3( 0.912505475649f, -0.404519349890f, -0.0608099701904f, + 0.276167195792f, 0.499539794942f, 0.8210917568930f, + -0.301770503659f, -0.766044443119f, 0.5675477726920f); + + static internal readonly float3x3 test3x3_yzx = new float3x3( 0.68617915596800f, -0.629320391050f, 0.364847929038f, + -0.00246669562435f, 0.499539794942f, 0.866287428445f, + -0.72742840288700f, -0.595328345266f, 0.341221453011f); + + static internal readonly float3x3 test3x3_zxy = new float3x3( 0.459852836288f, -0.835146653037f, 0.301770503659f, + 0.404519349890f, 0.499539794942f, 0.766044443119f, + -0.790505828266f, -0.230195701935f, 0.567547772692f); + + static internal readonly float3x3 test3x3_zyx = new float3x3( 0.686179155968f, -0.555656924414f, 0.469471562786f, + 0.125029621267f, 0.725866114623f, 0.676377097075f, + -0.716607116711f, -0.405418013897f, 0.567547772692f); + + + static internal readonly float4x4 test4x4_xyz = new float4x4(test3x3_xyz, new float3(0, 0, 0)); + static internal readonly float4x4 test4x4_xzy = new float4x4(test3x3_xzy, new float3(0, 0, 0)); + static internal readonly float4x4 test4x4_yxz = new float4x4(test3x3_yxz, new float3(0, 0, 0)); + static internal readonly float4x4 test4x4_yzx = new float4x4(test3x3_yzx, new float3(0, 0, 0)); + static internal readonly float4x4 test4x4_zxy = new float4x4(test3x3_zxy, new float3(0, 0, 0)); + static internal readonly float4x4 test4x4_zyx = new float4x4(test3x3_zyx, new float3(0, 0, 0)); + + + [TestCompiler] + public static void float3x3_euler() + { + float3x3 m0_xyz = float3x3.EulerXYZ(test_angles); + float3x3 m0_xzy = float3x3.EulerXZY(test_angles); + float3x3 m0_yxz = float3x3.EulerYXZ(test_angles); + float3x3 m0_yzx = float3x3.EulerYZX(test_angles); + float3x3 m0_zxy = float3x3.EulerZXY(test_angles); + float3x3 m0_zyx = float3x3.EulerZYX(test_angles); + + float3x3 m1 = float3x3.Euler(test_angles); + float3x3 m1_xyz = float3x3.Euler(test_angles, RotationOrder.XYZ); + float3x3 m1_xzy = float3x3.Euler(test_angles, RotationOrder.XZY); + float3x3 m1_yxz = float3x3.Euler(test_angles, RotationOrder.YXZ); + float3x3 m1_yzx = float3x3.Euler(test_angles, RotationOrder.YZX); + float3x3 m1_zxy = float3x3.Euler(test_angles, RotationOrder.ZXY); + float3x3 m1_zyx = float3x3.Euler(test_angles, RotationOrder.ZYX); + + + float3x3 m2_xyz = float3x3.EulerXYZ(test_angles.x, test_angles.y, test_angles.z); + float3x3 m2_xzy = float3x3.EulerXZY(test_angles.x, test_angles.y, test_angles.z); + float3x3 m2_yxz = float3x3.EulerYXZ(test_angles.x, test_angles.y, test_angles.z); + float3x3 m2_yzx = float3x3.EulerYZX(test_angles.x, test_angles.y, test_angles.z); + float3x3 m2_zxy = float3x3.EulerZXY(test_angles.x, test_angles.y, test_angles.z); + float3x3 m2_zyx = float3x3.EulerZYX(test_angles.x, test_angles.y, test_angles.z); + + float3x3 m3 = float3x3.Euler(test_angles.x, test_angles.y, test_angles.z); + float3x3 m3_xyz = float3x3.Euler(test_angles.x, test_angles.y, test_angles.z, RotationOrder.XYZ); + float3x3 m3_xzy = float3x3.Euler(test_angles.x, test_angles.y, test_angles.z, RotationOrder.XZY); + float3x3 m3_yxz = float3x3.Euler(test_angles.x, test_angles.y, test_angles.z, RotationOrder.YXZ); + float3x3 m3_yzx = float3x3.Euler(test_angles.x, test_angles.y, test_angles.z, RotationOrder.YZX); + float3x3 m3_zxy = float3x3.Euler(test_angles.x, test_angles.y, test_angles.z, RotationOrder.ZXY); + float3x3 m3_zyx = float3x3.Euler(test_angles.x, test_angles.y, test_angles.z, RotationOrder.ZYX); + + + TestUtils.AreEqual(test3x3_xyz, m0_xyz, 0.0001f); + TestUtils.AreEqual(test3x3_yzx, m0_yzx, 0.0001f); + TestUtils.AreEqual(test3x3_zxy, m0_zxy, 0.0001f); + TestUtils.AreEqual(test3x3_xzy, m0_xzy, 0.0001f); + TestUtils.AreEqual(test3x3_yxz, m0_yxz, 0.0001f); + TestUtils.AreEqual(test3x3_zyx, m0_zyx, 0.0001f); + + TestUtils.AreEqual(test3x3_zxy, m1, 0.0001f); + TestUtils.AreEqual(test3x3_xyz, m1_xyz, 0.0001f); + TestUtils.AreEqual(test3x3_yzx, m1_yzx, 0.0001f); + TestUtils.AreEqual(test3x3_zxy, m1_zxy, 0.0001f); + TestUtils.AreEqual(test3x3_xzy, m1_xzy, 0.0001f); + TestUtils.AreEqual(test3x3_yxz, m1_yxz, 0.0001f); + TestUtils.AreEqual(test3x3_zyx, m1_zyx, 0.0001f); + + + TestUtils.AreEqual(test3x3_xyz, m2_xyz, 0.0001f); + TestUtils.AreEqual(test3x3_yzx, m2_yzx, 0.0001f); + TestUtils.AreEqual(test3x3_zxy, m2_zxy, 0.0001f); + TestUtils.AreEqual(test3x3_xzy, m2_xzy, 0.0001f); + TestUtils.AreEqual(test3x3_yxz, m2_yxz, 0.0001f); + TestUtils.AreEqual(test3x3_zyx, m2_zyx, 0.0001f); + + TestUtils.AreEqual(test3x3_zxy, m3, 0.0001f); + TestUtils.AreEqual(test3x3_xyz, m3_xyz, 0.0001f); + TestUtils.AreEqual(test3x3_yzx, m3_yzx, 0.0001f); + TestUtils.AreEqual(test3x3_zxy, m3_zxy, 0.0001f); + TestUtils.AreEqual(test3x3_xzy, m3_xzy, 0.0001f); + TestUtils.AreEqual(test3x3_yxz, m3_yxz, 0.0001f); + TestUtils.AreEqual(test3x3_zyx, m3_zyx, 0.0001f); + } + + [TestCompiler] + public static void float4x4_euler() + { + float4x4 m0_xyz = float4x4.EulerXYZ(test_angles); + float4x4 m0_xzy = float4x4.EulerXZY(test_angles); + float4x4 m0_yxz = float4x4.EulerYXZ(test_angles); + float4x4 m0_yzx = float4x4.EulerYZX(test_angles); + float4x4 m0_zxy = float4x4.EulerZXY(test_angles); + float4x4 m0_zyx = float4x4.EulerZYX(test_angles); + + float4x4 m1 = float4x4.Euler(test_angles); + float4x4 m1_xyz = float4x4.Euler(test_angles, RotationOrder.XYZ); + float4x4 m1_xzy = float4x4.Euler(test_angles, RotationOrder.XZY); + float4x4 m1_yxz = float4x4.Euler(test_angles, RotationOrder.YXZ); + float4x4 m1_yzx = float4x4.Euler(test_angles, RotationOrder.YZX); + float4x4 m1_zxy = float4x4.Euler(test_angles, RotationOrder.ZXY); + float4x4 m1_zyx = float4x4.Euler(test_angles, RotationOrder.ZYX); + + + float4x4 m2_xyz = float4x4.EulerXYZ(test_angles.x, test_angles.y, test_angles.z); + float4x4 m2_xzy = float4x4.EulerXZY(test_angles.x, test_angles.y, test_angles.z); + float4x4 m2_yxz = float4x4.EulerYXZ(test_angles.x, test_angles.y, test_angles.z); + float4x4 m2_yzx = float4x4.EulerYZX(test_angles.x, test_angles.y, test_angles.z); + float4x4 m2_zxy = float4x4.EulerZXY(test_angles.x, test_angles.y, test_angles.z); + float4x4 m2_zyx = float4x4.EulerZYX(test_angles.x, test_angles.y, test_angles.z); + + float4x4 m3 = float4x4.Euler(test_angles.x, test_angles.y, test_angles.z); + float4x4 m3_xyz = float4x4.Euler(test_angles.x, test_angles.y, test_angles.z, RotationOrder.XYZ); + float4x4 m3_xzy = float4x4.Euler(test_angles.x, test_angles.y, test_angles.z, RotationOrder.XZY); + float4x4 m3_yxz = float4x4.Euler(test_angles.x, test_angles.y, test_angles.z, RotationOrder.YXZ); + float4x4 m3_yzx = float4x4.Euler(test_angles.x, test_angles.y, test_angles.z, RotationOrder.YZX); + float4x4 m3_zxy = float4x4.Euler(test_angles.x, test_angles.y, test_angles.z, RotationOrder.ZXY); + float4x4 m3_zyx = float4x4.Euler(test_angles.x, test_angles.y, test_angles.z, RotationOrder.ZYX); + + + TestUtils.AreEqual(test4x4_xyz, m0_xyz, 0.0001f); + TestUtils.AreEqual(test4x4_yzx, m0_yzx, 0.0001f); + TestUtils.AreEqual(test4x4_zxy, m0_zxy, 0.0001f); + TestUtils.AreEqual(test4x4_xzy, m0_xzy, 0.0001f); + TestUtils.AreEqual(test4x4_yxz, m0_yxz, 0.0001f); + TestUtils.AreEqual(test4x4_zyx, m0_zyx, 0.0001f); + + TestUtils.AreEqual(test4x4_zxy, m1, 0.0001f); + TestUtils.AreEqual(test4x4_xyz, m1_xyz, 0.0001f); + TestUtils.AreEqual(test4x4_yzx, m1_yzx, 0.0001f); + TestUtils.AreEqual(test4x4_zxy, m1_zxy, 0.0001f); + TestUtils.AreEqual(test4x4_xzy, m1_xzy, 0.0001f); + TestUtils.AreEqual(test4x4_yxz, m1_yxz, 0.0001f); + TestUtils.AreEqual(test4x4_zyx, m1_zyx, 0.0001f); + + + TestUtils.AreEqual(test4x4_xyz, m2_xyz, 0.0001f); + TestUtils.AreEqual(test4x4_yzx, m2_yzx, 0.0001f); + TestUtils.AreEqual(test4x4_zxy, m2_zxy, 0.0001f); + TestUtils.AreEqual(test4x4_xzy, m2_xzy, 0.0001f); + TestUtils.AreEqual(test4x4_yxz, m2_yxz, 0.0001f); + TestUtils.AreEqual(test4x4_zyx, m2_zyx, 0.0001f); + + TestUtils.AreEqual(test4x4_zxy, m3, 0.0001f); + TestUtils.AreEqual(test4x4_xyz, m3_xyz, 0.0001f); + TestUtils.AreEqual(test4x4_yzx, m3_yzx, 0.0001f); + TestUtils.AreEqual(test4x4_zxy, m3_zxy, 0.0001f); + TestUtils.AreEqual(test4x4_xzy, m3_xzy, 0.0001f); + TestUtils.AreEqual(test4x4_yxz, m3_yxz, 0.0001f); + TestUtils.AreEqual(test4x4_zyx, m3_zyx, 0.0001f); + } + + [TestCompiler] + public static void float2x2_scale() + { + float2x2 m = float2x2(1.0f, 2.0f, + 3.0f, 4.0f); + + float2x2 r0 = float2x2(2.0f, 4.0f, + 6.0f, 8.0f); + + float2x2 r1 = float2x2(2.0f, 4.0f, + 9.0f, 12.0f); + + float2x2 a = mul(float2x2.Scale(2.0f), m); + float2x2 b = mul(float2x2.Scale(2.0f, 3.0f), m); + float2x2 c = mul(float2x2.Scale(2.0f, 3.0f), m); + + TestUtils.AreEqual(r0, a); + TestUtils.AreEqual(r1, b); + TestUtils.AreEqual(r1, c); + } + + [TestCompiler] + public static void float3x3_scale() + { + float3x3 m = float3x3(1.0f, 2.0f, 3.0f, + 4.0f, 5.0f, 6.0f, + 7.0f, 8.0f, 9.0f); + + + float3x3 r0 = float3x3( 2.0f, 4.0f, 6.0f, + 8.0f, 10.0f, 12.0f, + 14.0f, 16.0f, 18.0f); + + float3x3 r1 = float3x3( 2.0f, 4.0f, 6.0f, + 12.0f, 15.0f, 18.0f, + 28.0f, 32.0f, 36.0f); + + + float3x3 a = mul(float3x3.Scale(2.0f), m); + float3x3 b = mul(float3x3.Scale(2.0f, 3.0f, 4.0f), m); + float3x3 c = mul(float3x3.Scale(2.0f, 3.0f, 4.0f), m); + + TestUtils.AreEqual(r0, a); + TestUtils.AreEqual(r1, b); + TestUtils.AreEqual(r1, c); + } + + [TestCompiler] + public static void float4x4_scale() + { + float4x4 m = float4x4( 1.0f, 2.0f, 3.0f, 4.0f, + 5.0f, 6.0f, 7.0f, 8.0f, + 9.0f, 10.0f, 11.0f, 12.0f, + 13.0f, 14.0f, 15.0f, 16.0f); + + float4x4 r0 = float4x4( 2.0f, 4.0f, 6.0f, 8.0f, + 10.0f, 12.0f, 14.0f, 16.0f, + 18.0f, 20.0f, 22.0f, 24.0f, + 13.0f, 14.0f, 15.0f, 16.0f); + + float4x4 r1 = float4x4( 2.0f, 4.0f, 6.0f, 8.0f, + 15.0f, 18.0f, 21.0f, 24.0f, + 36.0f, 40.0f, 44.0f, 48.0f, + 13.0f, 14.0f, 15.0f, 16.0f); + + float4x4 a = mul(float4x4.Scale(2.0f), m); + float4x4 b = mul(float4x4.Scale(2.0f, 3.0f, 4.0f), m); + float4x4 c = mul(float4x4.Scale(2.0f, 3.0f, 4.0f), m); + + TestUtils.AreEqual(r0, a); + TestUtils.AreEqual(r1, b); + TestUtils.AreEqual(r1, c); + } + + [TestCompiler] + public static void float2x2_matrix_mul() + { + // http://www.wolframalpha.com/input/?i=%5B%5B1,2%5D,%5B3,4%5D%5D*%5B%5B21,22%5D,%5B23,24%5D%5D + float2x2 a = float2x2(1.0f, 2.0f, + 3.0f, 4.0f); + + float2x2 b = float2x2(21.0f, 22.0f, + 23.0f, 24.0f); + + float2x2 c = mul(a, b); + TestUtils.AreEqual(67.0f, c.c0.x); + TestUtils.AreEqual(70.0f, c.c1.x); + + TestUtils.AreEqual(155.0f, c.c0.y); + TestUtils.AreEqual(162.0f, c.c1.y); + } + + [TestCompiler] + public static void float3x3_matrix_mul() + { + // http://www.wolframalpha.com/input/?i=%5B%5B1,2,3%5D,%5B4,5,6%5D,%5B7,8,9%5D%5D*%5B%5B21,22,23%5D,%5B24,25,26%5D,%5B27,28,29%5D%5D + float3x3 a = float3x3(1.0f, 2.0f, 3.0f, + 4.0f, 5.0f, 6.0f, + 7.0f, 8.0f, 9.0f); + + float3x3 b = float3x3(21.0f, 22.0f, 23.0f, + 24.0f, 25.0f, 26.0f, + 27.0f, 28.0f, 29.0f); + + float3x3 c = mul(a, b); + TestUtils.AreEqual(150.0f, c.c0.x); + TestUtils.AreEqual(156.0f, c.c1.x); + TestUtils.AreEqual(162.0f, c.c2.x); + + TestUtils.AreEqual(366.0f, c.c0.y); + TestUtils.AreEqual(381.0f, c.c1.y); + TestUtils.AreEqual(396.0f, c.c2.y); + + TestUtils.AreEqual(582.0f, c.c0.z); + TestUtils.AreEqual(606.0f, c.c1.z); + TestUtils.AreEqual(630.0f, c.c2.z); + } + + [TestCompiler] + public static void float4x4_matrix_mul() + { + // https://fogbugz.unity3d.com/f/cases/1041176/ + // http://www.wolframalpha.com/input/?i=%5B%5B1,2,3,4%5D,%5B5,6,7,8%5D,%5B9,10,11,12%5D,%5B13,14,15,16%5D%5D*%5B%5B21,22,23,24%5D,%5B25,26,27,28%5D,%5B29,30,31,32%5D,%5B33,34,35,36%5D%5D + float4x4 a = float4x4( 1.0f, 2.0f, 3.0f, 4.0f, + 5.0f, 6.0f, 7.0f, 8.0f, + 9.0f,10.0f,11.0f,12.0f, + 13.0f,14.0f,15.0f,16.0f); + + float4x4 b = float4x4(21.0f,22.0f,23.0f,24.0f, + 25.0f,26.0f,27.0f,28.0f, + 29.0f,30.0f,31.0f,32.0f, + 33.0f,34.0f,35.0f,36.0f); + + float4x4 c = mul(a, b); + TestUtils.AreEqual(290.0f, c.c0.x); + TestUtils.AreEqual(300.0f, c.c1.x); + TestUtils.AreEqual(310.0f, c.c2.x); + TestUtils.AreEqual(320.0f, c.c3.x); + + TestUtils.AreEqual(722.0f, c.c0.y); + TestUtils.AreEqual(748.0f, c.c1.y); + TestUtils.AreEqual(774.0f, c.c2.y); + TestUtils.AreEqual(800.0f, c.c3.y); + + TestUtils.AreEqual(1154.0f, c.c0.z); + TestUtils.AreEqual(1196.0f, c.c1.z); + TestUtils.AreEqual(1238.0f, c.c2.z); + TestUtils.AreEqual(1280.0f, c.c3.z); + + TestUtils.AreEqual(1586.0f, c.c0.w); + TestUtils.AreEqual(1644.0f, c.c1.w); + TestUtils.AreEqual(1702.0f, c.c2.w); + TestUtils.AreEqual(1760.0f, c.c3.w); + } + + [TestCompiler] + public static void float2x2_transpose() + { + float2x2 a = float2x2(1.0f, 2.0f, + 3.0f, 4.0f); + + float2x2 b = transpose(a); + + TestUtils.AreEqual(1.0f, b.c0.x); + TestUtils.AreEqual(3.0f, b.c1.x); + TestUtils.AreEqual(2.0f, b.c0.y); + TestUtils.AreEqual(4.0f, b.c1.y); + } + + [TestCompiler] + public static void float3x3_transpose() + { + float3x3 a = float3x3(1.0f, 2.0f, 3.0f, + 4.0f, 5.0f, 6.0f, + 7.0f, 8.0f, 9.0f); + + float3x3 b = transpose(a); + + TestUtils.AreEqual(1.0f, b.c0.x); + TestUtils.AreEqual(4.0f, b.c1.x); + TestUtils.AreEqual(7.0f, b.c2.x); + TestUtils.AreEqual(2.0f, b.c0.y); + TestUtils.AreEqual(5.0f, b.c1.y); + TestUtils.AreEqual(8.0f, b.c2.y); + TestUtils.AreEqual(3.0f, b.c0.z); + TestUtils.AreEqual(6.0f, b.c1.z); + TestUtils.AreEqual(9.0f, b.c2.z); + } + + [TestCompiler] + public static void float4x4_transpose() + { + float4x4 a = float4x4( 1.0f, 2.0f, 3.0f, 4.0f, + 5.0f, 6.0f, 7.0f, 8.0f, + 9.0f, 10.0f, 11.0f, 12.0f, + 13.0f, 14.0f, 15.0f, 16.0f); + + float4x4 b = transpose(a); + + TestUtils.AreEqual(1.0f, b.c0.x); + TestUtils.AreEqual(5.0f, b.c1.x); + TestUtils.AreEqual(9.0f, b.c2.x); + TestUtils.AreEqual(13.0f, b.c3.x); + TestUtils.AreEqual(2.0f, b.c0.y); + TestUtils.AreEqual(6.0f, b.c1.y); + TestUtils.AreEqual(10.0f, b.c2.y); + TestUtils.AreEqual(14.0f, b.c3.y); + TestUtils.AreEqual(3.0f, b.c0.z); + TestUtils.AreEqual(7.0f, b.c1.z); + TestUtils.AreEqual(11.0f, b.c2.z); + TestUtils.AreEqual(15.0f, b.c3.z); + TestUtils.AreEqual(4.0f, b.c0.w); + TestUtils.AreEqual(8.0f, b.c1.w); + TestUtils.AreEqual(12.0f, b.c2.w); + TestUtils.AreEqual(16.0f, b.c3.w); + } + + [TestCompiler] + public static void float2x2_inverse() + { + float2x2 a = float2x2( 0.542968f, 0.867379f, + -0.270153f, -0.912324f); + + float2x2 invA = float2x2( 3.49499f, 3.32281f, + -1.03492f, -2.08004f); + + float2x2 r = inverse(a); + + float epsilon = 0.0001f; + TestUtils.AreEqual(r.c0.x, invA.c0.x, epsilon); + TestUtils.AreEqual(r.c1.x, invA.c1.x, epsilon); + + TestUtils.AreEqual(r.c0.y, invA.c0.y, epsilon); + TestUtils.AreEqual(r.c1.y, invA.c1.y, epsilon); + } + + [TestCompiler] + public static void float3x3_inverse() + { + float3x3 a = float3x3( 0.542968f, 0.867379f, 0.526616f, + -0.270153f,-0.912324f, 0.148933f, + 0.816727f, 0.905933f, 0.902392f); + + float3x3 invA = float3x3(-15.91790f,-5.077350f,10.1273f, + 6.07051f, 0.994556f,-3.70676f, + 8.31247f, 3.596890f,-4.33645f); + + float3x3 r = inverse(a); + + float epsilon = 0.0001f; + TestUtils.AreEqual(r.c0.x, invA.c0.x, epsilon); + TestUtils.AreEqual(r.c1.x, invA.c1.x, epsilon); + TestUtils.AreEqual(r.c2.x, invA.c2.x, epsilon); + + TestUtils.AreEqual(r.c0.y, invA.c0.y, epsilon); + TestUtils.AreEqual(r.c1.y, invA.c1.y, epsilon); + TestUtils.AreEqual(r.c2.y, invA.c2.y, epsilon); + + TestUtils.AreEqual(r.c0.z, invA.c0.z, epsilon); + TestUtils.AreEqual(r.c1.z, invA.c1.z, epsilon); + TestUtils.AreEqual(r.c2.z, invA.c2.z, epsilon); + } + + [TestCompiler] + public static void float4x4_inverse() + { + float4x4 a = float4x4( 0.542968f, 0.867379f, 0.526616f,-0.943083f, + -0.270153f,-0.912324f, 0.148933f, 0.299995f, + 0.816727f, 0.905933f, 0.902392f,-0.060931f, + -0.254780f, 0.604543f, 0.563340f,-0.383911f); + + float4x4 invA = float4x4( 0.548951f, 0.126367f, 0.487260f,-1.327100f, + -0.582901f,-1.108000f, 0.188292f, 0.536211f, + 0.001968f, 0.970678f, 0.528701f, 0.669759f, + -1.279310f,-0.404277f, 0.748937f, 0.103102f); + + float4x4 r = inverse(a); + + float epsilon = 0.0001f; + TestUtils.AreEqual(r.c0.x, invA.c0.x, epsilon); + TestUtils.AreEqual(r.c1.x, invA.c1.x, epsilon); + TestUtils.AreEqual(r.c2.x, invA.c2.x, epsilon); + TestUtils.AreEqual(r.c3.x, invA.c3.x, epsilon); + + TestUtils.AreEqual(r.c0.y, invA.c0.y, epsilon); + TestUtils.AreEqual(r.c1.y, invA.c1.y, epsilon); + TestUtils.AreEqual(r.c2.y, invA.c2.y, epsilon); + TestUtils.AreEqual(r.c3.y, invA.c3.y, epsilon); + + TestUtils.AreEqual(r.c0.z, invA.c0.z, epsilon); + TestUtils.AreEqual(r.c1.z, invA.c1.z, epsilon); + TestUtils.AreEqual(r.c2.z, invA.c2.z, epsilon); + TestUtils.AreEqual(r.c3.z, invA.c3.z, epsilon); + + TestUtils.AreEqual(r.c0.w, invA.c0.w, epsilon); + TestUtils.AreEqual(r.c1.w, invA.c1.w, epsilon); + TestUtils.AreEqual(r.c2.w, invA.c2.w, epsilon); + TestUtils.AreEqual(r.c3.w, invA.c3.w, epsilon); + } + + [TestCompiler] + public static void float3x4_fastinverse() + { + float4x4 a = test4x4_xyz; + a.c3 = float4(1, 2, 3, 1); + + float3x4 b = float3x4(a.c0.xyz, a.c1.xyz, a.c2.xyz, a.c3.xyz); + + float4x4 invA = inverse(a); + float3x4 fastInvB = fastinverse(b); + + TestUtils.AreEqual(invA.c0.xyz, fastInvB.c0.xyz, 0.0001f); + TestUtils.AreEqual(invA.c1.xyz, fastInvB.c1.xyz, 0.0001f); + TestUtils.AreEqual(invA.c2.xyz, fastInvB.c2.xyz, 0.0001f); + TestUtils.AreEqual(invA.c3.xyz, fastInvB.c3.xyz, 0.0001f); + } + + [TestCompiler] + public static void float4x4_fastinverse() + { + float4x4 a = test4x4_xyz; + a.c3 = float4(1, 2, 3, 1); + + float4x4 invA = inverse(a); + float4x4 fastInvA = fastinverse(a); + + TestUtils.AreEqual(invA, fastInvA, 0.0001f); + } + + [TestCompiler] + public static void float2x2_determinant() + { + float2x2 a = float2x2(0.542968f, 0.867379f, + -0.270153f, -0.912324f); + + float det = determinant(a); + TestUtils.AreEqual(-0.2610378f, det, 0.0001f); + } + + [TestCompiler] + public static void float3x3_determinant() + { + float3x3 a = float3x3( 0.542968f, 0.867379f, 0.526616f, + -0.270153f, -0.912324f, 0.148933f, + 0.816727f, 0.905933f, 0.902392f); + + float det = determinant(a); + TestUtils.AreEqual(0.06019618f, det, 0.0001f); + } + + [TestCompiler] + public static void float4x4_determinant() + { + float4x4 a = float4x4( 0.542968f, 0.867379f, 0.526616f, -0.943083f, + -0.270153f, -0.912324f, 0.148933f, 0.299995f, + 0.816727f, 0.905933f, 0.902392f, -0.060931f, + -0.254780f, 0.604543f, 0.563340f, -0.383911f); + + float det = determinant(a); + TestUtils.AreEqual(0.5838502f, det, 0.0001f); + } + + [TestCompiler] + public static void float3x3_look_rotation() + { + float3 forward0 = normalize(float3(1.0f, 2.0f, 3.0f)); + float3 up0 = float3(0.0f, 1.0f, 0.0f); + float3x3 m0 = float3x3.LookRotation(forward0, up0); + TestUtils.AreEqual(float3x3( 0.948683f, -0.169031f, 0.267261f, + 0.000000f, 0.845154f, 0.534523f, + -0.316228f, -0.507093f, 0.801784f), m0, 0.001f); + TestUtils.AreEqual(float3x3(quaternion.LookRotation(forward0, up0)), m0, 0.001f); + + float3 forward1 = normalize(float3(-3.2f, 2.3f, -1.3f)); + float3 up1 = normalize(float3(1.0f, -3.2f, -1.5f)); + float3x3 m1 = float3x3.LookRotation(forward1, up1); + TestUtils.AreEqual(float3x3( 0.605102f, -0.197976f, -0.771140f, + 0.485036f, -0.676417f, 0.554257f, + -0.631342f, -0.709413f, -0.313276f), m1, 0.001f); + TestUtils.AreEqual(float3x3(quaternion.LookRotation(forward1, up1)), m1, 0.001f); + + float3 forward2 = normalize(float3(-2.6f, -5.2f, -1.1f)); + float3 up2 = normalize(float3(-4.2f, -1.2f, -4.5f)); + float3x3 m2 = float3x3.LookRotation(forward2, up2); + TestUtils.AreEqual(float3x3(-0.740918f, -0.507890f, -0.439418f, + 0.237577f, 0.413771f, -0.878835f, + 0.628170f, -0.755540f, -0.185907f), m2, 0.001f); + TestUtils.AreEqual(float3x3(quaternion.LookRotation(forward2, up2)), m2, 0.001f); + + float3 forward3 = normalize(float3(1.3f, 2.1f, 3.4f)); + float3 up3 = normalize(float3(0.2f, -1.0f, 0.3f)); + float3x3 m3 = float3x3.LookRotation(forward3, up3); + TestUtils.AreEqual(float3x3(-0.917727f, 0.249162f, 0.309349f, + -0.066040f, -0.863668f, 0.499717f, + 0.391685f, 0.438174f, 0.809065f), m3, 0.001f); + TestUtils.AreEqual(float3x3(quaternion.LookRotation(forward3, up3)), m3, 0.001f); + } + + [TestCompiler] + public static void float3x3_look_rotation_safe() + { + float3 forward0 = float3(-3.2f, 2.3f, -1.3f) * 1e-10f; + float3 up0 = float3(1.0f, -3.2f, -1.5f) * 1e10f; + float3x3 m0 = float3x3.LookRotationSafe(forward0, up0); + TestUtils.AreEqual(float3x3(0.605102f, -0.197976f, -0.771140f, + 0.485036f, -0.676417f, 0.554257f, + -0.631342f, -0.709413f, -0.313276f), m0, 0.001f); + + float3 forward1 = float3(-3.2f, 2.3f, -1.3f) * 1e-30f; + float3 up1 = float3(1.0f, -3.2f, -1.5f); + float3x3 m1 = float3x3.LookRotationSafe(forward1, up1); + TestUtils.AreEqual(float3x3.identity, m1, 0.001f); + } + + + [TestCompiler] + public static void float4x4_lookat() + { + float4x4 m = float4x4.LookAt(float3(0.3f, -0.5f, 3.0f), float3(3.2f, -3.1f, 0.2f), normalize(float3(0.3f, 1.0f, -3.0f))); + float4x4 r = float4x4( + -0.77374f, -0.18930f, 0.60456f, 0.30000f, + -0.57373f, 0.61404f, -0.54202f, -0.50000f, + -0.26862f, -0.76624f, -0.58371f, 3.00000f, + 0.00000f, 0.00000f, 0.00000f, 1.00000f + ); + TestUtils.AreEqual(r, m, 0.001f); + } + + + [TestCompiler] + public static void float4x4_ortho() + { + float4x4 m = float4x4.Ortho(2.0f, 3.0f, -3.0f, 7.0f); + float4x4 r = float4x4( + 1.00000f, 0.00000f, 0.00000f, 0.00000f, + 0.00000f, 0.66667f, 0.00000f, 0.00000f, + 0.00000f, 0.00000f, -0.20000f, -0.40000f, + 0.00000f, 0.00000f, 0.00000f, 1.00000f + ); + TestUtils.AreEqual(r, m, 0.001f); + } + + [TestCompiler] + public static void float4x4_orthoOffCenter() + { + float4x4 m = float4x4.OrthoOffCenter(-2.0f, 1.0f, -3.0f, -1.0f, -3.0f, 7.0f); + float4x4 r = float4x4( + 0.66667f, 0.00000f, 0.00000f, 0.33333f, + 0.00000f, 1.00000f, 0.00000f, 2.00000f, + 0.00000f, 0.00000f, -0.20000f, -0.40000f, + 0.00000f, 0.00000f, 0.00000f, 1.00000f + ); + TestUtils.AreEqual(r, m, 0.001f); + } + + [TestCompiler] + public static void float4x4_perspective() + { + float fovy = 1.6f; + float aspect = 1.3333f; + float near = 0.1f; + float far = 100.0f; + + float height = tan(fovy * 0.5f) * near; + float width = height * 1.3333f; + + float4x4 m = float4x4.PerspectiveFov(fovy, aspect, near, far); + float4x4 r = float4x4( + 0.72843f, 0.00000f, 0.00000f, 0.00000f, + 0.00000f, 0.97121f, 0.00000f, 0.00000f, + 0.00000f, 0.00000f, -1.00200f, -0.20020f, + 0.00000f, 0.00000f, -1.00000f, 0.00000f + ); + TestUtils.AreEqual(r, m, 0.001f); + + float4 p0 = mul(m, float4(-width, -height, -near, 1.0f)); + float4 pp0 = p0 / p0.w; + TestUtils.AreEqual(float3(-1.0f, -1.0f, -1.0f), pp0.xyz, 0.001f); + + float4 p1 = mul(m, float4(width / near * far, height / near * far, -far, 1.0f)); + float4 pp1 = p1 / p1.w; + TestUtils.AreEqual(float3(1.0f, 1.0f, 1.0f), pp1.xyz, 0.001f); + } + + [TestCompiler] + public static void float4x4_perspectiveOffCenter() + { + float fovy = 1.6f; + float aspect = 1.3333f; + float near = 0.1f; + float far = 100.0f; + + float4x4 r0 = float4x4.PerspectiveFov(fovy, aspect, near, far); + + float height = tan(fovy * 0.5f) * near; + float width = height * 1.3333f; + + float4x4 m0 = float4x4.PerspectiveOffCenter(-width, width, -height, height, 0.1f, 100.0f); + TestUtils.AreEqual(r0, m0, 0.001f); + + float left = -0.3f; + float right = -0.1f; + float bottom = -0.2f; + float top = 0.1f; + float4x4 m1 = float4x4.PerspectiveOffCenter(left, right, bottom, top, near, far); + float4 p0 = mul(m1, float4(left, bottom, -near, 1.0f)); + float4 pp0 = p0 / p0.w; + TestUtils.AreEqual(float3(-1.0f, -1.0f, -1.0f), pp0.xyz, 0.001f); + + float4 p1 = mul(m1, float4(right, top, -near, 1.0f)); + float4 pp1 = p1 / p1.w; + TestUtils.AreEqual(float3(1.0f, 1.0f, -1.0f), pp1.xyz, 0.001f); + + float4 p2 = mul(m1, float4(left*far/near, top * far / near, -far, 1.0f)); + float4 pp2 = p2 / p2.w; + TestUtils.AreEqual(float3(-1.0f, 1.0f, 1.0f), pp2.xyz, 0.001f); + } + + [TestCompiler] + public static void float4x4_TRS() + { + float3 scale = float3(1.2f, -0.4f, 2.3f); + quaternion rotation = TestQuaternion.test_q0; + float3 translation = float3(12.3f, -4.3f, 135.99f); + float4x4 r0 = mul(float4x4(quaternion.identity, translation), mul(float4x4(rotation, float3.zero), float4x4.Scale(scale))); + float4x4 m0 = float4x4.TRS(translation, rotation, scale); + TestUtils.AreEqual(r0, m0, 0.001f); + } + + [TestCompiler] + public static void float3x3_constructor_float4x4() + { + var f4x4 = new float4x4(new float4(1, 2, 3, 4), new float4(5, 6, 7, 8), new float4(9, 10, 11, 12), new float4(13, 14, 15, 16)); + var expected = new float3x3(new float3(1, 2, 3), new float3(5, 6, 7), new float3(9, 10, 11)); + + TestUtils.AreEqual(expected, new float3x3(f4x4)); + } + + [TestCompiler] + public static void float3x3_explicit_cast_float4x4() + { + var f4x4 = new float4x4(new float4(1, 2, 3, 4), new float4(5, 6, 7, 8), new float4(9, 10, 11, 12), new float4(13, 14, 15, 16)); + var expected = new float3x3(new float3(1, 2, 3), new float3(5, 6, 7), new float3(9, 10, 11)); + + TestUtils.AreEqual(expected, (float3x3)f4x4); + } + + [TestCompiler] + public static void float3x3_from_float4x4_without_new() + { + var f4x4 = new float4x4(new float4(1, 2, 3, 4), new float4(5, 6, 7, 8), new float4(9, 10, 11, 12), new float4(13, 14, 15, 16)); + var expected = new float3x3(new float3(1, 2, 3), new float3(5, 6, 7), new float3(9, 10, 11)); + + TestUtils.AreEqual(expected, float3x3(f4x4)); + } + + [TestCompiler] + public static void float3x3_pseudoinverse_non_singular() + { + const float kTolerance = 1e-5f; + + // A random 3x3 matrix, non-singular, generated from octave. + var a = new float3x3( + 0.806710600852966308594f, 0.985506594181060791016f, 0.593669593334197998047f, + 0.0869068726897239685059f, 0.754145503044128417969f, 0.222692146897315979004f, + 0.917483031749725341797f, 0.443894535303115844727f, 0.138771042227745056152f); + + // The regular inverse of a, as computed by octave. + var expected = new float3x3( + -0.0299495235085487365723f, -0.654392063617706298828f, 1.17825806140899658203f, + -0.992458224296569824219f, 2.23384380340576171875f, 0.661037027835845947266f, + 3.37264156341552734375f, -2.81901407241821289063f, -2.69841933250427246094f); + + TestUtils.AreEqual(expected, pseudoinverse(a), kTolerance); + TestUtils.AreEqual(expected, inverse(a), kTolerance); + } + + [TestCompiler] + public static void float3x3_pseudoinverse_singular() + { + const float kTolerance = 1e-5f; + + // A singular matrix. + var a = new float3x3( + 0.0548239313066005706787f, 0.462397903203964233398f, 0.0501357726752758026123f, + 0.0548239313066005706787f, 0.462397903203964233398f, 0.0501357726752758026123f, + 0.938165545463562011719f, 0.542225778102874755859f, 0.10684439539909362793f); + + // The pseudoinverse computed by octave. + var expected = new float3x3( + -0.675357639789581298828f, -0.675357699394226074219f, 1.14166188240051269531f, + 1.15268361568450927734f, 1.15268361568450927734f, -0.140613287687301635742f, + 0.0803283303976058959961f, 0.0803283303976058959961f, 0.0484490357339382171631f); + + TestUtils.AreEqual(expected, pseudoinverse(a), kTolerance); + } + } +} diff --git a/src/Tests/Tests/Shared/TestMatrix.cs.meta b/src/Tests/Tests/Shared/TestMatrix.cs.meta new file mode 100644 index 00000000..5e1f1b32 --- /dev/null +++ b/src/Tests/Tests/Shared/TestMatrix.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6216aa8a60396374dbab4fbd185eac26 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestMinMaxAABB.cs b/src/Tests/Tests/Shared/TestMinMaxAABB.cs new file mode 100644 index 00000000..7c5c5e8c --- /dev/null +++ b/src/Tests/Tests/Shared/TestMinMaxAABB.cs @@ -0,0 +1,536 @@ +using System; +using NUnit.Framework; +using static Unity.Mathematics.math; +using Unity.Mathematics.Geometry; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestMinMaxAABB + { + [TestCompiler] + public static void Encapsulate_float3_trivial() + { + var aabb = new MinMaxAABB(); + aabb.Encapsulate(float3.zero); + TestUtils.AreEqual(float3.zero, aabb.Min); + TestUtils.AreEqual(float3.zero, aabb.Max); + } + + [TestCompiler] + public static void Encapsulate_float3_new_max() + { + var aabb = new MinMaxAABB(); + aabb.Encapsulate(new float3(1.0f)); + TestUtils.AreEqual(float3.zero, aabb.Min); + TestUtils.AreEqual(new float3(1.0f), aabb.Max); + } + + [TestCompiler] + public static void Encapsulate_float3_new_min() + { + var aabb = new MinMaxAABB(); + aabb.Encapsulate(new float3(-1.0f)); + TestUtils.AreEqual(float3.zero, aabb.Max); + TestUtils.AreEqual(new float3(-1.0f), aabb.Min); + } + + [TestCompiler] + public static void Encapsulate_float3_new_minx_maxyz() + { + var aabb = new MinMaxAABB(); + aabb.Encapsulate(new float3(-1.0f, 1.0f, 1.0f)); + TestUtils.AreEqual(new float3(-1.0f, 0.0f, 0.0f), aabb.Min); + TestUtils.AreEqual(new float3(0.0f, 1.0f, 1.0f), aabb.Max); + } + + [TestCompiler] + public static void Encapsulate_float3_new_minxy_maxz() + { + var aabb = new MinMaxAABB(); + aabb.Encapsulate(new float3(-1.0f, -1.0f, 1.0f)); + TestUtils.AreEqual(new float3(-1.0f, -1.0f, 0.0f), aabb.Min); + TestUtils.AreEqual(new float3(0.0f, 0.0f, 1.0f), aabb.Max); + } + + [TestCompiler] + public static void Encapsulate_float3_new_minxz_maxy() + { + var aabb = new MinMaxAABB(); + aabb.Encapsulate(new float3(-1.0f, 1.0f, -1.0f)); + TestUtils.AreEqual(new float3(-1.0f, 0.0f, -1.0f), aabb.Min); + TestUtils.AreEqual(new float3(0.0f, 1.0f, 0.0f), aabb.Max); + } + + [TestCompiler] + public static void Encapsulate_float3_new_minz_maxxy() + { + var aabb = new MinMaxAABB(); + aabb.Encapsulate(new float3(1.0f, 1.0f, -1.0f)); + TestUtils.AreEqual(new float3(0.0f, 0.0f, -1.0f), aabb.Min); + TestUtils.AreEqual(new float3(1.0f, 1.0f, 0.0f), aabb.Max); + } + + [TestCompiler] + public static void Encapsulate_float3_new_miny_maxxz() + { + var aabb = new MinMaxAABB(); + aabb.Encapsulate(new float3(1.0f, -1.0f, 1.0f)); + TestUtils.AreEqual(new float3(0.0f, -1.0f, 0.0f), aabb.Min); + TestUtils.AreEqual(new float3(1.0f, 0.0f, 1.0f), aabb.Max); + } + + [TestCompiler] + public static void Encapsulate_MinMaxAABB_trivial() + { + var aabb = new MinMaxAABB(); + aabb.Encapsulate(new MinMaxAABB()); + TestUtils.AreEqual(float3.zero, aabb.Min); + TestUtils.AreEqual(float3.zero, aabb.Max); + } + + [TestCompiler] + public static void Encapsulate_MinMaxAABB_new_max() + { + var aabb = new MinMaxAABB(); + var p = new float3(1.0f); + aabb.Encapsulate(new MinMaxAABB { Max = p }); + TestUtils.AreEqual(float3.zero, aabb.Min); + TestUtils.AreEqual(p, aabb.Max); + } + + [TestCompiler] + public static void Encapsulate_MinMaxAABB_new_min() + { + var aabb = new MinMaxAABB(); + var p = new float3(-1.0f); + aabb.Encapsulate(new MinMaxAABB { Min = p }); + TestUtils.AreEqual(float3.zero, aabb.Max); + TestUtils.AreEqual(p, aabb.Min); + } + + [TestCompiler] + public static void Encapsulate_MinMaxAABB_new_minx_maxyz() + { + var aabb = new MinMaxAABB(); + aabb.Encapsulate(new MinMaxAABB { Min = new float3(-1.0f, 0.0f, 0.0f), Max = new float3(0.0f, 1.0f, 1.0f) }); + TestUtils.AreEqual(new float3(-1.0f, 0.0f, 0.0f), aabb.Min); + TestUtils.AreEqual(new float3(0.0f, 1.0f, 1.0f), aabb.Max); + } + + [TestCompiler] + public static void Encapsulate_MinMaxAABB_new_minxy_maxz() + { + var aabb = new MinMaxAABB(); + aabb.Encapsulate(new MinMaxAABB { Min = new float3(-1.0f, -1.0f, 0.0f), Max = new float3(0.0f, 0.0f, 1.0f) }); + TestUtils.AreEqual(new float3(-1.0f, -1.0f, 0.0f), aabb.Min); + TestUtils.AreEqual(new float3(0.0f, 0.0f, 1.0f), aabb.Max); + } + + [TestCompiler] + public static void Encapsulate_MinMaxAABB_new_minxz_maxy() + { + var aabb = new MinMaxAABB(); + aabb.Encapsulate(new MinMaxAABB { Min = new float3(-1.0f, 0.0f, -1.0f), Max = new float3(0.0f, 1.0f, 0.0f) }); + TestUtils.AreEqual(new float3(-1.0f, 0.0f, -1.0f), aabb.Min); + TestUtils.AreEqual(new float3(0.0f, 1.0f, 0.0f), aabb.Max); + } + + [TestCompiler] + public static void Encapsulate_MinMaxAABB_new_minz_maxxy() + { + var aabb = new MinMaxAABB(); + aabb.Encapsulate(new MinMaxAABB { Min = new float3(0.0f, 0.0f, -1.0f), Max = new float3(1.0f, 1.0f, 0.0f) }); + TestUtils.AreEqual(new float3(0.0f, 0.0f, -1.0f), aabb.Min); + TestUtils.AreEqual(new float3(1.0f, 1.0f, 0.0f), aabb.Max); + } + + [TestCompiler] + public static void Encapsulate_MinMaxAABB_new_miny_maxxz() + { + var aabb = new MinMaxAABB(); + aabb.Encapsulate(new MinMaxAABB { Min = new float3(0.0f, -1.0f, 0.0f), Max = new float3(1.0f, 0.0f, 1.0f) }); + TestUtils.AreEqual(new float3(0.0f, -1.0f, 0.0f), aabb.Min); + TestUtils.AreEqual(new float3(1.0f, 0.0f, 1.0f), aabb.Max); + } + + [TestCompiler] + public static void Equals_trivial() + { + MinMaxAABB aabb = new MinMaxAABB(); + TestUtils.IsTrue(aabb.Equals(aabb)); + } + + [TestCompiler] + public static void Equals() + { + MinMaxAABB aabb1 = new MinMaxAABB { Min = new float3(-123.0f, 0.5182f, 20.0f), Max = new float3(1.0f, -1.0f, 0.99191f) }; + MinMaxAABB aabb2 = aabb1; + TestUtils.IsTrue(aabb1.Equals(aabb2)); + TestUtils.IsTrue(aabb2.Equals(aabb1)); + } + + [TestCompiler] + public static void Equals_diff_minx() + { + MinMaxAABB aabb1 = new MinMaxAABB(); + MinMaxAABB aabb2 = new MinMaxAABB { Min = new float3(1.0f, 0.0f, 0.0f) }; + TestUtils.IsFalse(aabb1.Equals(aabb2)); + TestUtils.IsFalse(aabb2.Equals(aabb1)); + } + + [TestCompiler] + public static void Equals_diff_miny() + { + MinMaxAABB aabb1 = new MinMaxAABB(); + MinMaxAABB aabb2 = new MinMaxAABB { Min = new float3(0.0f, 1.0f, 0.0f) }; + TestUtils.IsFalse(aabb1.Equals(aabb2)); + TestUtils.IsFalse(aabb2.Equals(aabb1)); + } + + [TestCompiler] + public static void Equals_diff_minz() + { + MinMaxAABB aabb1 = new MinMaxAABB(); + MinMaxAABB aabb2 = new MinMaxAABB { Min = new float3(0.0f, 0.0f, 1.0f) }; + TestUtils.IsFalse(aabb1.Equals(aabb2)); + TestUtils.IsFalse(aabb2.Equals(aabb1)); + } + + [TestCompiler] + public static void Equals_diff_maxx() + { + MinMaxAABB aabb1 = new MinMaxAABB(); + MinMaxAABB aabb2 = new MinMaxAABB { Max = new float3(1.0f, 0.0f, 0.0f) }; + TestUtils.IsFalse(aabb1.Equals(aabb2)); + TestUtils.IsFalse(aabb2.Equals(aabb1)); + } + + [TestCompiler] + public static void Equals_diff_maxy() + { + MinMaxAABB aabb1 = new MinMaxAABB(); + MinMaxAABB aabb2 = new MinMaxAABB { Max = new float3(0.0f, 1.0f, 0.0f) }; + TestUtils.IsFalse(aabb1.Equals(aabb2)); + TestUtils.IsFalse(aabb2.Equals(aabb1)); + } + + [TestCompiler] + public static void Equals_diff_maxz() + { + MinMaxAABB aabb1 = new MinMaxAABB(); + MinMaxAABB aabb2 = new MinMaxAABB { Max = new float3(0.0f, 0.0f, 1.0f) }; + TestUtils.IsFalse(aabb1.Equals(aabb2)); + TestUtils.IsFalse(aabb2.Equals(aabb1)); + } + + [TestCompiler] + public static void SurfaceArea() + { + var min = new float3(-47.989063262939453125f, 28.037994384765625f, -9.756519317626953125f); + var max = new float3(43.84253692626953125f, 101.54019927978515625f, -7.03227138519287109375f); + var aabb = new MinMaxAABB { Min = min, Max = max }; + + TestUtils.AreEqual(14400.470703125f, aabb.SurfaceArea, 1, true); + } + + [TestCompiler] + public static void Extents() + { + var min = new float3(48.152984619140625f, -33.58978271484375f, -37.498805999755859375f); + var max = new float3(111.2894439697265625f, -9.473724365234375f, 25.39115142822265625f); + var aabb = new MinMaxAABB { Min = min, Max = max }; + var expected = new float3(63.1364593505859375f, 24.116058349609375f, 62.889957427978515625f); + + TestUtils.AreEqual(expected, aabb.Extents); + } + + [TestCompiler] + public static void Center() + { + var min = new float3(47.902675628662109375f, -34.302494049072265625f, 22.7147884368896484375f); + var max = new float3(84.1039886474609375f, 23.274578094482421875f, 58.204532623291015625f); + var aabb = new MinMaxAABB { Min = min, Max = max }; + var expected = new float3(66.00333404541015625f, -5.513957977294921875f, 40.459659576416015625f); + + TestUtils.AreEqual(expected, aabb.Center); + } + + [TestCompiler] + public static void HalfExtents() + { + var min = new float3(-14.3485383987426757813f, 28.68161773681640625f, -40.28060150146484375f); + var max = new float3(4.26444864273071289063f, 99.3212738037109375f, 27.9023494720458984375f); + var aabb = new MinMaxAABB { Min = min, Max = max }; + var expected = new float3(9.3064937591552734375f, 35.319828033447265625f, 34.0914764404296875f); + + TestUtils.AreEqual(expected, aabb.HalfExtents); + } + + [TestCompiler] + public static void Constructor() + { + var min = new float3(38.95940399169921875f, -24.644245147705078125f, 27.7903194427490234375f); + var max = new float3(71.30234527587890625f, 52.2211151123046875f, 99.07735443115234375f); + var aabb = new MinMaxAABB(min, max); + + TestUtils.AreEqual(min, aabb.Min); + TestUtils.AreEqual(max, aabb.Max); + } + + [TestCompiler] + public static void ContainsPoint() + { + var aabb = new MinMaxAABB(new float3(-1), new float3(1)); + + TestUtils.IsTrue(aabb.Contains(float3.zero)); + TestUtils.IsTrue(aabb.Contains(aabb.Min)); + TestUtils.IsTrue(aabb.Contains(aabb.Max)); + TestUtils.IsTrue(aabb.Contains(new float3(0.5f))); + TestUtils.IsTrue(aabb.Contains(new float3(-0.5f))); + TestUtils.IsTrue(aabb.Contains(new float3(-1.0f, 1.0f, 1.0f))); + TestUtils.IsTrue(aabb.Contains(new float3(1.0f, -1.0f, 1.0f))); + TestUtils.IsTrue(aabb.Contains(new float3(1.0f, 1.0f, -1.0f))); + + TestUtils.IsFalse(aabb.Contains(new float3(1.0f + EPSILON, 1.0f, 1.0f))); + TestUtils.IsFalse(aabb.Contains(new float3(1.0f, 1.0f + EPSILON, 1.0f))); + TestUtils.IsFalse(aabb.Contains(new float3(1.0f, 1.0f, 1.0f + EPSILON))); + TestUtils.IsFalse(aabb.Contains(new float3(-1.0f - EPSILON, -1.0f, -1.0f))); + TestUtils.IsFalse(aabb.Contains(new float3(-1.0f, -1.0f - EPSILON, -1.0f))); + TestUtils.IsFalse(aabb.Contains(new float3(-1.0f, -1.0f, -1.0f - EPSILON))); + } + + [TestCompiler] + public static void ContainsAabb_Trivial() + { + var aabb1 = new MinMaxAABB(); + var aabb2 = new MinMaxAABB(); + + TestUtils.IsTrue(aabb1.Contains(aabb2)); + TestUtils.IsTrue(aabb2.Contains(aabb1)); + } + + [TestCompiler] + public static void ContainsAabb() + { + var aabb1 = new MinMaxAABB(new float3(-1.0f), new float3(1.0f)); + var aabb2 = new MinMaxAABB(new float3(-0.5f), new float3(0.5f)); + + TestUtils.IsTrue(aabb1.Contains(aabb2)); + TestUtils.IsFalse(aabb2.Contains(aabb1)); + } + + [TestCompiler] + public static void ContainsAabb_BarelyNotContained() + { + var aabb1 = new MinMaxAABB(new float3(-1.0f), new float3(1.0f)); + var aabb2 = new MinMaxAABB(new float3(-1.0f), new float3(1.0f + EPSILON, 1.0f , 1.0f )); + var aabb3 = new MinMaxAABB(new float3(-1.0f), new float3(1.0f , 1.0f + EPSILON, 1.0f )); + var aabb4 = new MinMaxAABB(new float3(-1.0f), new float3(1.0f , 1.0f , 1.0f + EPSILON)); + var aabb5 = new MinMaxAABB(new float3(-1.0f - EPSILON, -1.0f , -1.0f ), new float3(1.0f)); + var aabb6 = new MinMaxAABB(new float3(-1.0f , -1.0f - EPSILON, -1.0f ), new float3(1.0f)); + var aabb7 = new MinMaxAABB(new float3(-1.0f , -1.0f , -1.0f - EPSILON), new float3(1.0f)); + + TestUtils.IsFalse(aabb1.Contains(aabb2)); + TestUtils.IsFalse(aabb1.Contains(aabb3)); + TestUtils.IsFalse(aabb1.Contains(aabb4)); + TestUtils.IsFalse(aabb1.Contains(aabb5)); + TestUtils.IsFalse(aabb1.Contains(aabb6)); + TestUtils.IsFalse(aabb1.Contains(aabb7)); + } + + [TestCompiler] + public static void Overlap_Trivial() + { + var aabb = new MinMaxAABB(); + + TestUtils.IsTrue(aabb.Overlaps(aabb)); + } + + [TestCompiler] + public static void Overlap_Corner() + { + var aabb = new MinMaxAABB(new float3(-1.0f), new float3(1.0f)); + + var corner1 = new float3(-1.0f, -1.0f, -1.0f); + var corner2 = new float3(-1.0f, -1.0f, 1.0f); + var corner3 = new float3(-1.0f, 1.0f, -1.0f); + var corner4 = new float3(-1.0f, 1.0f, 1.0f); + var corner5 = new float3( 1.0f, -1.0f, -1.0f); + var corner6 = new float3( 1.0f, -1.0f, 1.0f); + var corner7 = new float3( 1.0f, 1.0f, -1.0f); + var corner8 = new float3( 1.0f, 1.0f, 1.0f); + + var cornerAabb1 = new MinMaxAABB(corner1, corner1); + var cornerAabb2 = new MinMaxAABB(corner2, corner2); + var cornerAabb3 = new MinMaxAABB(corner3, corner3); + var cornerAabb4 = new MinMaxAABB(corner4, corner4); + var cornerAabb5 = new MinMaxAABB(corner5, corner5); + var cornerAabb6 = new MinMaxAABB(corner6, corner6); + var cornerAabb7 = new MinMaxAABB(corner7, corner7); + var cornerAabb8 = new MinMaxAABB(corner8, corner8); + + TestUtils.IsTrue(aabb.Overlaps(cornerAabb1)); + TestUtils.IsTrue(cornerAabb1.Overlaps(aabb)); + TestUtils.IsTrue(aabb.Overlaps(cornerAabb2)); + TestUtils.IsTrue(cornerAabb2.Overlaps(aabb)); + TestUtils.IsTrue(aabb.Overlaps(cornerAabb3)); + TestUtils.IsTrue(cornerAabb3.Overlaps(aabb)); + TestUtils.IsTrue(aabb.Overlaps(cornerAabb4)); + TestUtils.IsTrue(cornerAabb4.Overlaps(aabb)); + TestUtils.IsTrue(aabb.Overlaps(cornerAabb5)); + TestUtils.IsTrue(cornerAabb5.Overlaps(aabb)); + TestUtils.IsTrue(aabb.Overlaps(cornerAabb6)); + TestUtils.IsTrue(cornerAabb6.Overlaps(aabb)); + TestUtils.IsTrue(aabb.Overlaps(cornerAabb7)); + TestUtils.IsTrue(cornerAabb7.Overlaps(aabb)); + TestUtils.IsTrue(aabb.Overlaps(cornerAabb8)); + TestUtils.IsTrue(cornerAabb8.Overlaps(aabb)); + } + + [TestCompiler] + public static void NoOverlap_Corner() + { + var aabb = new MinMaxAABB(new float3(-1.0f), new float3(1.0f)); + + var corner1 = new float3(-1.0f - EPSILON, -1.0f - EPSILON, -1.0f - EPSILON); + var corner2 = new float3(-1.0f - EPSILON, -1.0f - EPSILON, 1.0f + EPSILON); + var corner3 = new float3(-1.0f - EPSILON, 1.0f + EPSILON, -1.0f - EPSILON); + var corner4 = new float3(-1.0f - EPSILON, 1.0f + EPSILON, 1.0f + EPSILON); + var corner5 = new float3( 1.0f + EPSILON, -1.0f - EPSILON, -1.0f - EPSILON); + var corner6 = new float3( 1.0f + EPSILON, -1.0f - EPSILON, 1.0f + EPSILON); + var corner7 = new float3( 1.0f + EPSILON, 1.0f + EPSILON, -1.0f - EPSILON); + var corner8 = new float3( 1.0f + EPSILON, 1.0f + EPSILON, 1.0f + EPSILON); + + var cornerAabb1 = new MinMaxAABB(corner1, corner1); + var cornerAabb2 = new MinMaxAABB(corner2, corner2); + var cornerAabb3 = new MinMaxAABB(corner3, corner3); + var cornerAabb4 = new MinMaxAABB(corner4, corner4); + var cornerAabb5 = new MinMaxAABB(corner5, corner5); + var cornerAabb6 = new MinMaxAABB(corner6, corner6); + var cornerAabb7 = new MinMaxAABB(corner7, corner7); + var cornerAabb8 = new MinMaxAABB(corner8, corner8); + + TestUtils.IsFalse(aabb.Overlaps(cornerAabb1)); + TestUtils.IsFalse(cornerAabb1.Overlaps(aabb)); + TestUtils.IsFalse(aabb.Overlaps(cornerAabb2)); + TestUtils.IsFalse(cornerAabb2.Overlaps(aabb)); + TestUtils.IsFalse(aabb.Overlaps(cornerAabb3)); + TestUtils.IsFalse(cornerAabb3.Overlaps(aabb)); + TestUtils.IsFalse(aabb.Overlaps(cornerAabb4)); + TestUtils.IsFalse(cornerAabb4.Overlaps(aabb)); + TestUtils.IsFalse(aabb.Overlaps(cornerAabb5)); + TestUtils.IsFalse(cornerAabb5.Overlaps(aabb)); + TestUtils.IsFalse(aabb.Overlaps(cornerAabb6)); + TestUtils.IsFalse(cornerAabb6.Overlaps(aabb)); + TestUtils.IsFalse(aabb.Overlaps(cornerAabb7)); + TestUtils.IsFalse(cornerAabb7.Overlaps(aabb)); + TestUtils.IsFalse(aabb.Overlaps(cornerAabb8)); + TestUtils.IsFalse(cornerAabb8.Overlaps(aabb)); + } + + [TestCompiler] + public static void Expand_PositiveDistance() + { + var aabb = new MinMaxAABB(new float3(-0.5f), new float3(0.5f)); + aabb.Expand(1.0f); + + TestUtils.AreEqual(new float3(-1.5f), aabb.Min); + TestUtils.AreEqual(new float3(1.5f), aabb.Max); + } + + [TestCompiler] + public static void Expand_NegativeDistance() + { + var aabb = new MinMaxAABB(new float3(-0.5f), new float3(0.5f)); + aabb.Expand(-1.0f); + + TestUtils.AreEqual(new float3(0.5f), aabb.Min); + TestUtils.AreEqual(new float3(-0.5f), aabb.Max); + } + + [TestCompiler] + public static void CreateFromCenterAndExtents() + { + var center = new float3(-29.2458133697509765625f, 1.21094369888305664063f, 34.281322479248046875f); + var extents = new float3(71.5140533447265625f, 33.691967010498046875f, 29.8891429901123046875f); + var expectedMin = new float3(-65.002838134765625f, -15.635040283203125f, 19.336750030517578125f); + var expectedMax = new float3(6.5112133026123046875f, 18.056926727294921875f, 49.225894927978515625f); + var aabb = MinMaxAABB.CreateFromCenterAndExtents(center, extents); + + TestUtils.AreEqual(expectedMin, aabb.Min); + TestUtils.AreEqual(expectedMax, aabb.Max); + } + + [TestCompiler] + public static void CreateFromCenterAndHalfExtents() + { + var center = new float3(-29.2458133697509765625f, 1.21094369888305664063f, 34.281322479248046875f); + var halfExtents = new float3(8.8238582611083984375f, 72.26158905029296875f, 47.658290863037109375f); + var expectedMin = new float3(-38.069671630859375f, -71.0506439208984375f, -13.3769683837890625f); + var expectedMax = new float3(-20.421955108642578125f, 73.4725341796875f, 81.93961334228515625f); + var aabb = MinMaxAABB.CreateFromCenterAndHalfExtents(center, halfExtents); + + TestUtils.AreEqual(expectedMin, aabb.Min); + TestUtils.AreEqual(expectedMax, aabb.Max); + } + + [TestCompiler] + public static void IsValid_Trivial() + { + TestUtils.IsTrue(new MinMaxAABB().IsValid); + TestUtils.IsFalse(new MinMaxAABB(new float3(1.0f), new float3(-1.0f)).IsValid); + } + + [TestCompiler] + public static void IsValid_OneComponentInvalid() + { + TestUtils.IsFalse(new MinMaxAABB(float3.zero, new float3(-1.0f, 0.0f, 0.0f)).IsValid); + TestUtils.IsFalse(new MinMaxAABB(float3.zero, new float3(0.0f, -1.0f, 0.0f)).IsValid); + TestUtils.IsFalse(new MinMaxAABB(float3.zero, new float3(0.0f, 0.0f, -1.0f)).IsValid); + TestUtils.IsFalse(new MinMaxAABB(new float3(1.0f, 0.0f, 0.0f), float3.zero).IsValid); + TestUtils.IsFalse(new MinMaxAABB(new float3(0.0f, 1.0f, 0.0f), float3.zero).IsValid); + TestUtils.IsFalse(new MinMaxAABB(new float3(0.0f, 0.0f, 1.0f), float3.zero).IsValid); + } + + [TestCompiler] + public static void Transform_RigidTransform() + { + var t = new RigidTransform(quaternion.EulerXYZ(PI * 0.25f), new float3(1.0f, 1.0f, 1.0f)); + var aabb = Unity.Mathematics.Geometry.Math.Transform(t, new MinMaxAABB(new float3(1.0f), new float3(3.0f))); + var expectedMin = new float3(1.914213562373095e+00f, 1.914213562373095e+00f, -1.213203435596422e-01f); + var expectedMax = new float3(4.914213562373095f, 4.914213562373095f, 3.292893218813453f); + + float tolerance = 1e-6f; + TestUtils.AreEqual(expectedMin, aabb.Min, tolerance); + TestUtils.AreEqual(expectedMax, aabb.Max, tolerance); + } + + [TestCompiler] + public static void Transform_float4x4() + { + var t = new float4x4(float3x3.EulerXYZ(PI * 0.25f), new float3(1.0f, 1.0f, 1.0f)); + var aabb = Unity.Mathematics.Geometry.Math.Transform(t, new MinMaxAABB(new float3(1.0f), new float3(3.0f))); + var expectedMin = new float3(1.914213562373095e+00f, 1.914213562373095e+00f, -1.213203435596422e-01f); + var expectedMax = new float3(4.914213562373095f, 4.914213562373095f, 3.292893218813453f); + + float tolerance = 1e-6f; + TestUtils.AreEqual(expectedMin, aabb.Min, tolerance); + TestUtils.AreEqual(expectedMax, aabb.Max, tolerance); + } + + [TestCompiler] + public static void Transform_float3x3() + { + var t = float3x3.EulerXYZ(PI * 0.25f); + var aabb = Unity.Mathematics.Geometry.Math.Transform(t, new MinMaxAABB(new float3(1.0f), new float3(3.0f))); + var expectedMin = new float3(9.142135623730949e-01f, 9.142135623730949e-01f, -1.121320343559642e+00f); + var expectedMax = new float3(3.914213562373095f, 3.914213562373095f, 2.292893218813453f); + + float tolerance = 1e-6f; + TestUtils.AreEqual(expectedMin, aabb.Min, tolerance); + TestUtils.AreEqual(expectedMax, aabb.Max, tolerance); + } + } +} diff --git a/src/Tests/Tests/Shared/TestMinMaxAABB.cs.meta b/src/Tests/Tests/Shared/TestMinMaxAABB.cs.meta new file mode 100644 index 00000000..28235b33 --- /dev/null +++ b/src/Tests/Tests/Shared/TestMinMaxAABB.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ff79137b66b3348278b1936f9080f495 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestPlane.cs b/src/Tests/Tests/Shared/TestPlane.cs new file mode 100644 index 00000000..2fbd3251 --- /dev/null +++ b/src/Tests/Tests/Shared/TestPlane.cs @@ -0,0 +1,266 @@ +using NUnit.Framework; +using Unity.Mathematics.Geometry; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestPlane + { + // An arbitrary tolerance. + const float Tolerance = 0.0000025f; + + [TestCompiler] + public static void Empty() + { + var p = new Plane(); + + TestUtils.AreEqual(float4.zero, p.NormalAndDistance); + TestUtils.AreEqual(float3.zero, p.Normal); + TestUtils.AreEqual(0.0f, p.Distance); + } + + [TestCompiler] + public static void GetNormal() + { + var p = new Plane { NormalAndDistance = new float4(1.0f, 2.0f, 3.0f, 4.0f) }; + + TestUtils.AreEqual(new float3(1.0f, 2.0f, 3.0f), p.Normal); + } + + [TestCompiler] + public static void GetDistance() + { + var p = new Plane { NormalAndDistance = new float4(1.0f, 2.0f, 3.0f, 4.0f) }; + + TestUtils.AreEqual(4.0f, p.Distance); + } + + [TestCompiler] + public static void SetNormal() + { + var p = new Plane { NormalAndDistance = new float4(1.0f, 2.0f, 3.0f, 4.0f) }; + p.Normal = new float3(-1.0f, -2.0f, -3.0f); + + TestUtils.AreEqual(new float3(-1.0f, -2.0f, -3.0f), p.Normal); + } + + [TestCompiler] + public static void SetDistance() + { + var p = new Plane { NormalAndDistance = new float4(1.0f, 2.0f, 3.0f, 4.0f) }; + p.Distance = -4.0f; + + TestUtils.AreEqual(-4.0f, p.Distance); + } + + [TestCompiler] + public static void ConstructWithNormalAndDistance() + { + var n = math.normalize(new float3(4.0f, -5.0f, 6.0f)); + var d = 123.0f; + var p = new Plane(n, d); + + TestUtils.AreEqual(new float4(n, d), p.NormalAndDistance); + TestUtils.AreEqual(n, p.Normal); + TestUtils.AreEqual(d, p.Distance); + } + + [TestCompiler] + public static void ConstructWithCoefficients_NonUnitLengthNormal() + { + var abcd = new float4(4.0f, -5.0f, 6.0f, 123.0f); + var p = new Plane(abcd.x, abcd.y, abcd.z, abcd.w); + var expected = abcd * math.rsqrt(math.lengthsq(abcd.xyz)); + + TestUtils.AreEqual(expected, p.NormalAndDistance, Tolerance); + TestUtils.AreEqual(expected.xyz, p.Normal); + TestUtils.AreEqual(expected.w, p.Distance); + } + + [TestCompiler] + public static void ConstructWithNormalAndPointInPlane_NegativeDistance() + { + var n = math.up(); + var pointInPlane = math.up(); + var p = new Plane(n, pointInPlane); + + TestUtils.AreEqual(new float4(math.up(), -1.0f), p.NormalAndDistance); + TestUtils.AreEqual(n, p.Normal); + TestUtils.AreEqual(-1.0f, p.Distance); + } + + [TestCompiler] + public static void ConstructWithNormalAndPointInPlane_PositiveDistance() + { + var n = math.down(); + var pointInPlane = math.up(); + var p = new Plane(n, pointInPlane); + + TestUtils.AreEqual(new float4(math.down(), 1.0f), p.NormalAndDistance); + TestUtils.AreEqual(n, p.Normal); + TestUtils.AreEqual(1.0f, p.Distance); + } + + [TestCompiler] + public static void ConstructWithNormalAndPointInPlane() + { + var normal = new float3(2.0f, 2.0f, 2.0f); + var pointInPlane = new float3(-2.0f, -2.0f, -2.0f); + var p = new Plane(normal, pointInPlane); + var expectedN = new float3(5.773502691896258e-01f); + var expectedD = 3.464101615137755f; + + TestUtils.AreEqual(new float4(expectedN, expectedD), p.NormalAndDistance); + TestUtils.AreEqual(expectedN, p.Normal); + TestUtils.AreEqual(expectedD, p.Distance); + } + + [TestCompiler] + public static void ConstructWithTwoVectorsAndOrigin_Trivial() + { + var v1 = new float3(1.0f, 0.0f, 0.0f); + var v2 = new float3(0.0f, 1.0f, 0.0f); + var p = new Plane(v1, v2, float3.zero); + + TestUtils.AreEqual(new float4(0.0f, 0.0f, 1.0f, 0.0f), p); + } + + [TestCompiler] + public static void ConstructWithTwoVectorsAndOrigin_NonZeroOrigin() + { + var v1 = new float3(5.0f, 0.0f, 0.0f); + var v2 = new float3(0.0f, 1.0f, 0.0f); + var p = new Plane(v2, v1, new float3(0.0f, 0.0f, 1.0f)); + + TestUtils.AreEqual(new float4(0.0f, 0.0f, -1.0f, 1.0f), p); + } + + [TestCompiler] + public static void SignedDistanceToPoint() + { + var vInPlane1 = new float3(2.0f, 1.0f, -0.18f); + var vInPlane2 = new float3(-0.9928f, 10.0f, 3.125f); + var n = math.normalize(math.cross(vInPlane1, vInPlane2)); + var pointInPlane = new float3(10.0f, -25.8918f, 1.0f); + var p = new Plane(vInPlane1, vInPlane2, pointInPlane); + + TestUtils.AreEqual(0.0f, p.SignedDistanceToPoint(pointInPlane), Tolerance); + TestUtils.AreEqual(0.0f, p.SignedDistanceToPoint(pointInPlane + vInPlane1), Tolerance); + TestUtils.AreEqual(0.0f, p.SignedDistanceToPoint(pointInPlane + vInPlane2), Tolerance); + TestUtils.AreEqual(1.0f, p.SignedDistanceToPoint(pointInPlane + n), Tolerance); + TestUtils.AreEqual(-1.0f, p.SignedDistanceToPoint(pointInPlane - n), Tolerance); + } + + [TestCompiler] + public static void SignedDistanceToPointTrivial() + { + var p = new Plane(math.up(), 0.0f); + + TestUtils.AreEqual(0.0f, p.SignedDistanceToPoint(float3.zero)); + TestUtils.AreEqual(0.0f, p.SignedDistanceToPoint(math.left())); + TestUtils.AreEqual(0.0f, p.SignedDistanceToPoint(math.right())); + TestUtils.AreEqual(0.0f, p.SignedDistanceToPoint(math.forward())); + TestUtils.AreEqual(0.0f, p.SignedDistanceToPoint(math.back())); + TestUtils.AreEqual(1.0f, p.SignedDistanceToPoint(math.up())); + TestUtils.AreEqual(1.0f, p.SignedDistanceToPoint(math.up() + math.left())); + TestUtils.AreEqual(1.0f, p.SignedDistanceToPoint(math.up() + math.right())); + TestUtils.AreEqual(1.0f, p.SignedDistanceToPoint(math.up() + math.back())); + TestUtils.AreEqual(1.0f, p.SignedDistanceToPoint(math.up() + math.forward())); + TestUtils.AreEqual(-1.0f, p.SignedDistanceToPoint(math.down())); + TestUtils.AreEqual(-1.0f, p.SignedDistanceToPoint(math.down() + math.left())); + TestUtils.AreEqual(-1.0f, p.SignedDistanceToPoint(math.down() + math.right())); + TestUtils.AreEqual(-1.0f, p.SignedDistanceToPoint(math.down() + math.back())); + TestUtils.AreEqual(-1.0f, p.SignedDistanceToPoint(math.down() + math.forward())); + } + + [TestCompiler] + public static void ProjectionTrivial() + { + var p = new Plane(math.up(), 0.0f); + var expected = math.left() + math.forward(); + + TestUtils.AreEqual(expected, p.Projection(math.up() + expected)); + } + + [TestCompiler] + public static void Projection() + { + var normal = new float3(1.0f); + var n = math.normalize(normal); + var d = -1.0f; + var p = new Plane(n, d); + var expected = new float3(math.sqrt(3.0f), 0.0f, 0.0f); + + TestUtils.AreEqual(expected, p.Projection(expected), math.EPSILON); + } + + [TestCompiler] + public static void Flipped() + { + var normal = new float3(1.0f); + var d = 1.0f; + var p = new Plane(normal, d); + var expectedD = -5.773502691896258e-01f; + var expectedN = new float3(-5.773502691896258e-01f); + + TestUtils.AreEqual(new float4(expectedN, expectedD), p.Flipped, Tolerance); + } + + [TestCompiler] + public static void ImplicitToFloat4() + { + var normal = new float3(1.1f, -20.0f, 15.182f); + var d = 18.9281f; + var p = new Plane(normal, d); + var expectedN = new float3(4.376593115243121e-02f, -7.957442027714765e-01f, 6.040494243238278e-01f); + var expectedD = 7.530962922239393e-01f; + float4 p_as_float4 = p; + + TestUtils.AreEqual(new float4(expectedN, expectedD), p_as_float4, Tolerance); + } + + [TestCompiler] + public static void NormalizeFloat4() + { + var p = new float4(8.215876543024162e-01f, 2.786574280629829e-01f, 8.121669997361285e-01f, 9.352839276497152e-01f); + var expected = new float4(6.913449765800294e-01f, 2.344830914500849e-01f, 6.834177369527146e-01f, 7.870174797181938e-01f); + + TestUtils.AreEqual(expected, Plane.Normalize(p), Tolerance); + } + + [TestCompiler] + public static void NormalizePlane() + { + var p = new Plane { NormalAndDistance = new float4(8.215876543024162e-01f, 2.786574280629829e-01f, 8.121669997361285e-01f, 9.352839276497152e-01f) }; + var normalized = Plane.Normalize(p); + var expected = new float4(6.913449765800294e-01f, 2.344830914500849e-01f, 6.834177369527146e-01f, 7.870174797181938e-01f); + + TestUtils.AreEqual(expected, normalized.NormalAndDistance, Tolerance); + TestUtils.AreEqual(expected.xyz, normalized.Normal, Tolerance); + TestUtils.AreEqual(expected.w, normalized.Distance, Tolerance); + } + + [TestCompiler] + public static void CreateFromUnitNormalAndDistance() + { + var n = new float3(9.108767140247756e-02f, 3.966831912609620e-01f, 9.134251375397404e-01f); + var d = 9.120230523544353e-01f; + var expected = new float4(n, d); + var p = Plane.CreateFromUnitNormalAndDistance(n, d); + + TestUtils.AreEqual(expected, p.NormalAndDistance); + } + + [TestCompiler] + public static void CreateFromUnitNormalAndPointInPlane() + { + var n = new float3(4.724920516359185e-01f, 1.444614284194820e-01f, 8.694148358751899e-01f); + var pointInPlane = new float3(9.395666432987706f, 3.818578457438728f, 4.283295215216710f); + var expected = new float4(n, -8.714975414445176f); + var p = Plane.CreateFromUnitNormalAndPointInPlane(n, pointInPlane); + + TestUtils.AreEqual(expected, p.NormalAndDistance, Tolerance); + } + } +} diff --git a/src/Tests/Tests/Shared/TestPlane.cs.meta b/src/Tests/Tests/Shared/TestPlane.cs.meta new file mode 100644 index 00000000..80d8e773 --- /dev/null +++ b/src/Tests/Tests/Shared/TestPlane.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f231ac420620f4127b2cb48aab2c41ef +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestQuaternion.cs b/src/Tests/Tests/Shared/TestQuaternion.cs new file mode 100644 index 00000000..301725ee --- /dev/null +++ b/src/Tests/Tests/Shared/TestQuaternion.cs @@ -0,0 +1,464 @@ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + class TestQuaternion + { + [TestCompiler] + public static void quaternion_basic_constructors() + { + quaternion q = quaternion(1.0f, 2.0f, 3.0f, 4.0f); + quaternion q2 = quaternion(float4(1.0f, 2.0f, 3.0f, 4.0f)); + + TestUtils.AreEqual(1.0f, q.value.x); + TestUtils.AreEqual(2.0f, q.value.y); + TestUtils.AreEqual(3.0f, q.value.z); + TestUtils.AreEqual(4.0f, q.value.w); + TestUtils.AreEqual(1.0f, q2.value.x); + TestUtils.AreEqual(2.0f, q2.value.y); + TestUtils.AreEqual(3.0f, q2.value.z); + TestUtils.AreEqual(4.0f, q2.value.w); + } + + [TestCompiler] + public static void quaternion_construct_from_matrix() + { + TestUtils.AreEqual(float3x3(quaternion(TestMatrix.test3x3_xyz)), TestMatrix.test3x3_xyz, 0.0001f); + TestUtils.AreEqual(float4x4(quaternion(TestMatrix.test4x4_xyz), float3.zero), TestMatrix.test4x4_xyz, 0.0001f); + + // Make sure to hit all 4 cases + float3x3 m0 = float3x3.AxisAngle(normalize(float3(1, 2, 3)), 1.0f); + float3x3 m1 = float3x3.AxisAngle(normalize(float3(3, 2, 1)), 3.0f); + float3x3 m2 = float3x3.AxisAngle(normalize(float3(1, 3, 2)), 3.0f); + float3x3 m3 = float3x3.AxisAngle(normalize(float3(1, 2, 3)), 3.0f); + quaternion q0 = quaternion(m0); + quaternion q1 = quaternion(m1); + quaternion q2 = quaternion(m2); + quaternion q3 = quaternion(m3); + TestUtils.AreEqual(quaternion(0.1281319f, 0.2562638f, 0.3843956f, 0.8775827f), q0, 0.0001f); + TestUtils.AreEqual(quaternion(0.7997754f, 0.5331835f, 0.2665918f, 0.0707372f), q1, 0.0001f); + TestUtils.AreEqual(quaternion(0.2665918f, 0.7997754f, 0.5331835f, 0.0707372f), q2, 0.0001f); + TestUtils.AreEqual(quaternion(0.2665918f, 0.5331835f, 0.7997754f, 0.0707372f), q3, 0.0001f); + } + + + [TestCompiler] + public static void quaternion_construct_from_matrix3x3_torture() + { + Random rnd = new Random(0x12345678); + for(int i = 0; i < 1000; i++) + { + float3x3 r = float3x3(rnd.NextQuaternionRotation()); + quaternion q = quaternion(r); + float3x3 t = float3x3(q); + TestUtils.AreEqual(r, t, 0.001f); + } + } + + [TestCompiler] + public static void quaternion_construct_from_matrix4x4_torture() + { + Random rnd = new Random(0x12345678); + for (int i = 0; i < 1000; i++) + { + float4x4 r = float4x4(rnd.NextQuaternionRotation(), float3.zero); + quaternion q = quaternion(r); + float4x4 t = float4x4(q, float3.zero); + TestUtils.AreEqual(r, t, 0.001f); + } + } + + [TestCompiler] + public static void quaternion_axis_angle() + { + quaternion q = quaternion.AxisAngle(normalize(float3(1.0f, 2.0f, 3.0f)), 10.0f); + + quaternion r = quaternion(-0.2562833f, -0.5125666f, -0.76885f, 0.2836622f); + TestUtils.AreEqual(r, q, 0.0001f); + } + + [TestCompiler] + public static void quaternion_axis_angle_consistency() + { + TestUtils.AreEqual(quaternion.RotateX(1.0f), quaternion.AxisAngle(float3(1, 0, 0), 1.0f), 0.001f); + TestUtils.AreEqual(quaternion.RotateY(1.0f), quaternion.AxisAngle(float3(0, 1, 0), 1.0f), 0.001f); + TestUtils.AreEqual(quaternion.RotateZ(1.0f), quaternion.AxisAngle(float3(0, 0, 1), 1.0f), 0.001f); + } + + [TestCompiler] + public static void euler_to_quaternion() + { + float3 test_angles = TestMatrix.test_angles; + quaternion q0 = quaternion.Euler(test_angles); + quaternion q0_xyz = quaternion.Euler(test_angles, RotationOrder.XYZ); + quaternion q0_xzy = quaternion.Euler(test_angles, RotationOrder.XZY); + quaternion q0_yxz = quaternion.Euler(test_angles, RotationOrder.YXZ); + quaternion q0_yzx = quaternion.Euler(test_angles, RotationOrder.YZX); + quaternion q0_zxy = quaternion.Euler(test_angles, RotationOrder.ZXY); + quaternion q0_zyx = quaternion.Euler(test_angles, RotationOrder.ZYX); + + quaternion q1 = quaternion.Euler(test_angles.x, test_angles.y, test_angles.z); + quaternion q1_xyz = quaternion.Euler(test_angles.x, test_angles.y, test_angles.z, RotationOrder.XYZ); + quaternion q1_xzy = quaternion.Euler(test_angles.x, test_angles.y, test_angles.z, RotationOrder.XZY); + quaternion q1_yxz = quaternion.Euler(test_angles.x, test_angles.y, test_angles.z, RotationOrder.YXZ); + quaternion q1_yzx = quaternion.Euler(test_angles.x, test_angles.y, test_angles.z, RotationOrder.YZX); + quaternion q1_zxy = quaternion.Euler(test_angles.x, test_angles.y, test_angles.z, RotationOrder.ZXY); + quaternion q1_zyx = quaternion.Euler(test_angles.x, test_angles.y, test_angles.z, RotationOrder.ZYX); + + float epsilon = 0.0001f; + TestUtils.AreEqual(quaternion(-0.3133549f, 0.3435619f, 0.3899215f, 0.7948176f), q0, epsilon); + TestUtils.AreEqual(quaternion(-0.4597331f, 0.06979711f, 0.3899215f, 0.7948176f), q0_xyz, epsilon); + TestUtils.AreEqual(quaternion(-0.3133549f, 0.06979711f, 0.3899215f, 0.8630749f), q0_xzy, epsilon); + TestUtils.AreEqual(quaternion(-0.4597331f, 0.06979711f, 0.1971690f, 0.8630748f), q0_yxz, epsilon); + TestUtils.AreEqual(quaternion(-0.4597331f, 0.34356190f, 0.1971690f, 0.7948176f), q0_yzx, epsilon); + TestUtils.AreEqual(quaternion(-0.3133549f, 0.34356190f, 0.3899215f, 0.7948176f), q0_zxy, epsilon); + TestUtils.AreEqual(quaternion(-0.3133549f, 0.34356190f, 0.1971690f, 0.8630749f), q0_zyx, epsilon); + + TestUtils.AreEqual(quaternion(-0.3133549f, 0.3435619f, 0.3899215f, 0.7948176f), q1, epsilon); + TestUtils.AreEqual(quaternion(-0.4597331f, 0.06979711f, 0.3899215f, 0.7948176f), q1_xyz, epsilon); + TestUtils.AreEqual(quaternion(-0.3133549f, 0.06979711f, 0.3899215f, 0.8630749f), q1_xzy, epsilon); + TestUtils.AreEqual(quaternion(-0.4597331f, 0.06979711f, 0.1971690f, 0.8630748f), q1_yxz, epsilon); + TestUtils.AreEqual(quaternion(-0.4597331f, 0.34356190f, 0.1971690f, 0.7948176f), q1_yzx, epsilon); + TestUtils.AreEqual(quaternion(-0.3133549f, 0.34356190f, 0.3899215f, 0.7948176f), q1_zxy, epsilon); + TestUtils.AreEqual(quaternion(-0.3133549f, 0.34356190f, 0.1971690f, 0.8630749f), q1_zyx, epsilon); + + float3x3 m0 = float3x3(q0); + float3x3 m0_xyz = float3x3(q0_xyz); + float3x3 m0_xzy = float3x3(q0_xzy); + float3x3 m0_yxz = float3x3(q0_yxz); + float3x3 m0_yzx = float3x3(q0_yzx); + float3x3 m0_zxy = float3x3(q0_zxy); + float3x3 m0_zyx = float3x3(q0_zyx); + + float3x3 m1 = float3x3(q1); + float3x3 m1_xyz = float3x3(q1_xyz); + float3x3 m1_xzy = float3x3(q1_xzy); + float3x3 m1_yxz = float3x3(q1_yxz); + float3x3 m1_yzx = float3x3(q1_yzx); + float3x3 m1_zxy = float3x3(q1_zxy); + float3x3 m1_zyx = float3x3(q1_zyx); + + TestUtils.AreEqual(TestMatrix.test3x3_zxy, m0, epsilon); + TestUtils.AreEqual(TestMatrix.test3x3_xyz, m0_xyz, epsilon); + TestUtils.AreEqual(TestMatrix.test3x3_yzx, m0_yzx, epsilon); + TestUtils.AreEqual(TestMatrix.test3x3_zxy, m0_zxy, epsilon); + TestUtils.AreEqual(TestMatrix.test3x3_xzy, m0_xzy, epsilon); + TestUtils.AreEqual(TestMatrix.test3x3_yxz, m0_yxz, epsilon); + TestUtils.AreEqual(TestMatrix.test3x3_zyx, m0_zyx, 0.0001f); + + TestUtils.AreEqual(TestMatrix.test3x3_zxy, m1, epsilon); + TestUtils.AreEqual(TestMatrix.test3x3_xyz, m1_xyz, epsilon); + TestUtils.AreEqual(TestMatrix.test3x3_yzx, m1_yzx, epsilon); + TestUtils.AreEqual(TestMatrix.test3x3_zxy, m1_zxy, epsilon); + TestUtils.AreEqual(TestMatrix.test3x3_xzy, m1_xzy, epsilon); + TestUtils.AreEqual(TestMatrix.test3x3_yxz, m1_yxz, epsilon); + TestUtils.AreEqual(TestMatrix.test3x3_zyx, m1_zyx, epsilon); + } + + [TestCompiler] + public static void quaternion_rotateX() + { + float angle = 2.3f; + quaternion q = quaternion.RotateX(angle); + + quaternion r = quaternion(0.91276394f, 0.0f, 0.0f, 0.40848744f); + TestUtils.AreEqual(r, q, 0.0001f); + } + + [TestCompiler] + public static void quaternion_rotateY() + { + float angle = 2.3f; + quaternion q = quaternion.RotateY(angle); + + quaternion r = quaternion(0.0f, 0.91276394f, 0.0f, 0.40848744f); + TestUtils.AreEqual(r, q, 0.0001f); + } + + [TestCompiler] + public static void quaternion_rotateZ() + { + float angle = 2.3f; + quaternion q = quaternion.RotateZ(angle); + + quaternion r = quaternion(0.0f, 0.0f, 0.91276394f, 0.40848744f); + TestUtils.AreEqual(r, q, 0.0001f); + } + + static internal readonly quaternion test_q0 = new quaternion(0.3270836f, 0.8449658f, -0.1090279f, 0.4088545f); + static internal readonly quaternion test_q1 = new quaternion(-0.05623216f, 0.731018f, -0.6747859f, -0.08434824f); + static internal readonly quaternion test_q2 = new quaternion(-0.2316205f, -0.6022133f, -0.7411857f, -0.1852964f); + static internal readonly quaternion test_q3 = new quaternion(0.3619499f, 0.8352691f, -0.1392115f, 0.3897922f); + + [TestCompiler] + public static void quaternion_conjugate() + { + quaternion q = quaternion(1.0f, -2.0f, 3.0f, -4.0f); + quaternion cq = conjugate(q); + quaternion r = quaternion(-1.0f, 2.0f, -3.0f, -4.0f); + + TestUtils.AreEqual(r, cq); + } + + [TestCompiler] + public static void quaternion_inverse() + { + quaternion q = quaternion(1.0f, -2.0f, 3.0f, -4.0f); + quaternion iq = inverse(q); + quaternion qiq = mul(iq, q); + + TestUtils.AreEqual(quaternion.identity, qiq, 0.00001f); + } + + [TestCompiler] + public static void quaternion_dot() + { + float dot01 = dot(test_q0, test_q1); + float dot02 = dot(test_q0, test_q2); + + TestUtils.AreEqual(0.6383769f, dot01, 0.00001f); + TestUtils.AreEqual(-0.5795583f, dot02, 0.00001f); + } + + [TestCompiler] + public static void quaternion_nlerp() + { + quaternion r0 = nlerp(test_q0, test_q1, 0.3f); + quaternion r1 = nlerp(test_q0, test_q1, -4.3f); + quaternion r2 = nlerp(test_q0, test_q1, 5.1f); + + TestUtils.AreEqual(quaternion(0.2302977f, 0.8803911f, -0.3026878f, 0.2832927f), r0, 0.0001f); + TestUtils.AreEqual(quaternion(0.4724294f, 0.3192692f, 0.5557517f, 0.604994f), r1, 0.0001f); + TestUtils.AreEqual(quaternion(-0.4054004f, 0.06570576f, -0.7457358f, -0.5246059f), r2, 0.0001f); + } + + [TestCompiler] + public static void quaternion_slerp() + { + quaternion r0 = slerp(test_q0, test_q1, 0.3f); + quaternion r1 = slerp(test_q0, test_q1, -4.3f); + quaternion r2 = slerp(test_q0, test_q1, 5.1f); + + TestUtils.AreEqual(quaternion(0.2261014f, 0.8806396f, -0.3100654f, 0.2778693f), r0, 0.0001f); + TestUtils.AreEqual(quaternion(-0.4676181f, -0.5321988f, -0.3789966f, -0.5953646f), r1, 0.0001f); + TestUtils.AreEqual(quaternion(0.2596942f, -0.4369303f, 0.7902023f, 0.34239f), r2, 0.0001f); + } + + [TestCompiler] + public static void quaternion_mul_vector() + { + float3x3 m = TestMatrix.test3x3_xyz; + quaternion q = quaternion(m); + + float3 vector = float3(1.1f, -2.2f, 3.5f); + + float3 mvector = mul(m, vector); + float3 qvector = mul(q, vector); + + TestUtils.AreEqual(mvector, qvector, 0.0001f); + } + + [TestCompiler] + public static void quaternion_log_exp_identity() + { + quaternion q = quaternion(1.2f, -2.6f, 3.1f, 6.0f); + quaternion log_q = log(q); + quaternion exp_log_q = exp(log_q); + TestUtils.AreEqual(q, exp_log_q, 0.0001f); + } + + [TestCompiler] + public static void quaternion_log_exp_rotation() + { + quaternion q = quaternion(TestMatrix.test3x3_xyz); + quaternion q3 = mul(q, mul(q, q)); + quaternion log_q = log(q); + quaternion t = exp(quaternion(log_q.value * 3.0f)); + TestUtils.AreEqual(q3, t, 0.0001f); + } + + [TestCompiler] + public static void quaternion_unitlog_unitexp_rotation() + { + quaternion q = quaternion(TestMatrix.test3x3_xyz); + quaternion q3 = mul(q, mul(q, q)); + quaternion log_q = unitlog(q); + quaternion t = unitexp(quaternion(log_q.value * 3.0f)); + TestUtils.AreEqual(q3, t, 0.0001f); + } + + [TestCompiler] + public static void quaternion_look_rotation() + { + // Exercise the 4 cases + float3 forward0 = normalize(float3(1.0f, 2.0f, 3.0f)); + float3 up0 = float3(0.0f, 1.0f, 0.0f); + quaternion q0 = quaternion.LookRotation(forward0, up0); + TestUtils.AreEqual(quaternion(-0.274657f, 0.153857f, 0.044571f, 0.948106f), q0, 0.001f); + TestUtils.AreEqual(float3x3.LookRotation(forward0, up0), float3x3(q0), 0.001f); + + float3 forward1 = normalize(float3(-3.2f, 2.3f, -1.3f)); + float3 up1 = normalize(float3(1.0f, -3.2f, -1.5f)); + quaternion q1 = quaternion.LookRotation(forward1, up1); + TestUtils.AreEqual(quaternion(0.805418f, 0.089103f, -0.435327f, -0.392240f), q1, 0.001f); + TestUtils.AreEqual(float3x3.LookRotation(forward1, up1), float3x3(q1), 0.001f); + + float3 forward2 = normalize(float3(-2.6f, -5.2f, -1.1f)); + float3 up2 = normalize(float3(-4.2f, -1.2f, -4.5f)); + quaternion q2 = quaternion.LookRotation(forward2, up2); + TestUtils.AreEqual(quaternion(-0.088343f, 0.764951f, -0.534144f, -0.348907f), q2, 0.001f); + TestUtils.AreEqual(float3x3.LookRotation(forward2, up2), float3x3(q2), 0.001f); + + float3 forward3 = normalize(float3(1.3f, 2.1f, 3.4f)); + float3 up3 = normalize(float3(0.2f, -1.0f, 0.3f)); + quaternion q3 = quaternion.LookRotation(forward3, up3); + TestUtils.AreEqual(quaternion(0.184984f, 0.247484f, 0.947425f, -0.083173f), q3, 0.001f); + TestUtils.AreEqual(float3x3.LookRotation(forward3, up3), float3x3(q3), 0.001f); + } + + [TestCompiler] + public static void quaternion_look_rotation_safe() + { + float3 forward0 = float3(-3.2f, 2.3f, -1.3f) * 1e-10f; + float3 up0 = float3(1.0f, -3.2f, -1.5f) * 1e10f; + quaternion q0 = quaternion.LookRotationSafe(forward0, up0); + TestUtils.AreEqual(quaternion(0.805418f, 0.089103f, -0.435327f, -0.392240f), q0, 0.001f); + + float3 forward1 = float3(-3.2f, 2.3f, -1.3f) * 1e-30f; + float3 up1 = float3(1.0f, -3.2f, -1.5f); + quaternion q1 = quaternion.LookRotationSafe(forward1, up1); + TestUtils.AreEqual(quaternion.identity, q1, 0.001f); + + float3 forward2 = float3(-3.2f, 2.3f, -1.3f); + float3 up2 = forward2; + quaternion q2 = quaternion.LookRotationSafe(forward2, up2); + TestUtils.AreEqual(quaternion.identity, q2, 0.001f); + } + + [TestCase] + public static void quaternion_EqualsObjectOverride() + { + TestUtils.IsFalse(new quaternion().Equals((object) new int())); + TestUtils.IsTrue(new quaternion().Equals((object) new quaternion())); + } + + [TestCase] + public static void quaternion_angle() + { + // Test variations of angles + for (int i = 0; i < 18; ++i) + { + for (int j = 0; j < 18; ++j) + { + float angle1 = radians(i * 10f); + float angle2 = radians(j * 10f); + + quaternion q1 = quaternion.Euler(0f, angle1, 0f); + quaternion q2 = quaternion.Euler(0f, angle2, 0f); + TestUtils.AreEqual(abs(angle2 - angle1), math.angle(q1, q2), 1e-5f); + } + } + + quaternion q = quaternion.identity; + float angle = math.angle(q, q); + TestUtils.AreEqual(0f, angle); + + quaternion nq = -q.value; + angle = math.angle(q, nq); + TestUtils.AreEqual(0f, angle); + + // Nearly normalized quaternion to self is zero + q = new quaternion(0.6244676f, -0.7761726f, -0.06790633f, -0.05463386f); // dot(q, q) = 0.999999816753 + angle = math.angle(q, q); + TestUtils.AreEqual(0f, angle); + + // Nearly normalized quaternion to negative self is zero + nq = -q.value; // dot(q, nq) = -0.999999816753 + angle = math.angle(q, nq); + TestUtils.AreEqual(0f, angle); + } + + [TestCompiler] + public static void quaternion_rotation_from_3x3_identity() + { + const float tolerance = 1e-5f; + var q = rotation(float3x3.identity); + TestUtils.AreEqual(quaternion.identity, q, tolerance); + } + + [TestCompiler] + public static void quaternion_rotation_from_3x3_with_uniform_scale() + { + const float tolerance = 1e-5f; + var random = new Random(6173u); + var expectedQuaternion = random.NextQuaternionRotation(); + var m = new float3x3(expectedQuaternion); + m = mul(m, float3x3.Scale(5.18f)); + var actualQuaternion = rotation(m); + TestUtils.AreEqual(0.0f, angle(actualQuaternion, expectedQuaternion) % PI * 2.0f, tolerance); + } + + [TestCompiler] + public static void quaternion_rotation_from_3x3_with_nonuniform_scale() + { + const float tolerance = 1e-5f; + var m = new float3x3( + 2.0f, 0.0f, 0.0f, + 0.0f, 1.5f, 0.0f, + 0.0f, 0.0f, 3.1f); + var q = rotation(m); + TestUtils.AreEqual(quaternion.identity, q, tolerance); + } + + [TestCompiler] + public static void quaternion_rotation_from_3x3_with_negative_scale_x() + { + const float tolerance = 1e-5f; + var random = new Random(281u); + var expectedQuaternion = random.NextQuaternionRotation(); + var m = new float3x3(expectedQuaternion); + m = mul(m, float3x3.Scale(-1.5f, 0.2f, 51.281f)); + var actualQuaternion = rotation(m); + TestUtils.AreEqual(0.0f, angle(actualQuaternion, expectedQuaternion) % PI * 2.0f, tolerance); + } + + [TestCompiler] + public static void quaternion_rotation_from_3x3_with_negative_scale_y() + { + const float tolerance = 1e-5f; + var random = new Random(10000u); + var expectedQuaternion = random.NextQuaternionRotation(); + var m = new float3x3(expectedQuaternion); + m = mul(m, float3x3.Scale(1.5f, -0.2f, 51.281f)); + var actualQuaternion = rotation(m); + TestUtils.AreEqual(0.0f, angle(actualQuaternion, expectedQuaternion) % PI * 2.0f, tolerance); + } + + [TestCompiler] + public static void quaternion_rotation_from_3x3_with_negative_scale_z() + { + const float tolerance = 1e-5f; + var random = new Random(9891712u); + var expectedQuaternion = random.NextQuaternionRotation(); + var m = new float3x3(expectedQuaternion); + m = mul(m, float3x3.Scale(1.5f, 0.2f, -51.281f)); + var actualQuaternion = rotation(m); + TestUtils.AreEqual(0.0f, angle(actualQuaternion, expectedQuaternion) % PI * 2.0f, tolerance); + } + + [TestCompiler] + public static void quaternion_rotation_from_3x3_with_negative_nonuniform_scale() + { + const float tolerance = 1e-5f; + var random = new Random(912u); + var expectedQuaternion = random.NextQuaternionRotation(); + var m = new float3x3(expectedQuaternion); + m = mul(m, float3x3.Scale(-1.5f, -0.2f, -51.281f)); + var actualQuaternion = rotation(m); + TestUtils.AreEqual(0.0f, angle(actualQuaternion, expectedQuaternion) % PI * 2.0f, tolerance); + } + } +} diff --git a/src/Tests/Tests/Shared/TestQuaternion.cs.meta b/src/Tests/Tests/Shared/TestQuaternion.cs.meta new file mode 100644 index 00000000..9ea60bc5 --- /dev/null +++ b/src/Tests/Tests/Shared/TestQuaternion.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 36c7224b1052973439eead9de857ea33 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestRigidTransform.cs b/src/Tests/Tests/Shared/TestRigidTransform.cs new file mode 100644 index 00000000..ac0d8060 --- /dev/null +++ b/src/Tests/Tests/Shared/TestRigidTransform.cs @@ -0,0 +1,170 @@ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + class TestRigidTransform + { + [TestCompiler] + public static void rigid_transform_construct_from_matrix() + { + float4x4 m4x4 = TestMatrix.test4x4_zyx; + + RigidTransform q4x4 = RigidTransform(m4x4); + + float4x4 mq4x4 = float4x4(q4x4); + + TestUtils.AreEqual(m4x4, mq4x4, 0.0001f); + } + + [TestCompiler] + public static void rigid_transform_axisAngle() + { + RigidTransform q = RigidTransform.AxisAngle(normalize(float3(1.0f, 2.0f, 3.0f)), 10.0f); + + RigidTransform r = RigidTransform(quaternion(-0.2562833f, -0.5125666f, -0.76885f, 0.2836622f), float3.zero); + TestUtils.AreEqual(r, q, 0.0001f); + } + + [TestCompiler] + public static void rigid_transform_euler() + { + float3 test_angles = TestMatrix.test_angles; + RigidTransform q0 = RigidTransform.Euler(test_angles); + RigidTransform q0_xyz = RigidTransform.Euler(test_angles, RotationOrder.XYZ); + RigidTransform q0_xzy = RigidTransform.Euler(test_angles, RotationOrder.XZY); + RigidTransform q0_yxz = RigidTransform.Euler(test_angles, RotationOrder.YXZ); + RigidTransform q0_yzx = RigidTransform.Euler(test_angles, RotationOrder.YZX); + RigidTransform q0_zxy = RigidTransform.Euler(test_angles, RotationOrder.ZXY); + RigidTransform q0_zyx = RigidTransform.Euler(test_angles, RotationOrder.ZYX); + + RigidTransform q1 = RigidTransform.Euler(test_angles.x, test_angles.y, test_angles.z); + RigidTransform q1_xyz = RigidTransform.Euler(test_angles.x, test_angles.y, test_angles.z, RotationOrder.XYZ); + RigidTransform q1_xzy = RigidTransform.Euler(test_angles.x, test_angles.y, test_angles.z, RotationOrder.XZY); + RigidTransform q1_yxz = RigidTransform.Euler(test_angles.x, test_angles.y, test_angles.z, RotationOrder.YXZ); + RigidTransform q1_yzx = RigidTransform.Euler(test_angles.x, test_angles.y, test_angles.z, RotationOrder.YZX); + RigidTransform q1_zxy = RigidTransform.Euler(test_angles.x, test_angles.y, test_angles.z, RotationOrder.ZXY); + RigidTransform q1_zyx = RigidTransform.Euler(test_angles.x, test_angles.y, test_angles.z, RotationOrder.ZYX); + + float epsilon = 0.0001f; + TestUtils.AreEqual(RigidTransform(quaternion(-0.3133549f, 0.3435619f, 0.3899215f, 0.7948176f), float3.zero), q0, epsilon); + TestUtils.AreEqual(RigidTransform(quaternion(-0.4597331f, 0.06979711f, 0.3899215f, 0.7948176f), float3.zero), q0_xyz, epsilon); + TestUtils.AreEqual(RigidTransform(quaternion(-0.3133549f, 0.06979711f, 0.3899215f, 0.8630749f), float3.zero), q0_xzy, epsilon); + TestUtils.AreEqual(RigidTransform(quaternion(-0.4597331f, 0.06979711f, 0.1971690f, 0.8630748f), float3.zero), q0_yxz, epsilon); + TestUtils.AreEqual(RigidTransform(quaternion(-0.4597331f, 0.34356190f, 0.1971690f, 0.7948176f), float3.zero), q0_yzx, epsilon); + TestUtils.AreEqual(RigidTransform(quaternion(-0.3133549f, 0.34356190f, 0.3899215f, 0.7948176f), float3.zero), q0_zxy, epsilon); + TestUtils.AreEqual(RigidTransform(quaternion(-0.3133549f, 0.34356190f, 0.1971690f, 0.8630749f), float3.zero), q0_zyx, epsilon); + + TestUtils.AreEqual(RigidTransform(quaternion(-0.3133549f, 0.3435619f, 0.3899215f, 0.7948176f), float3.zero), q1, epsilon); + TestUtils.AreEqual(RigidTransform(quaternion(-0.4597331f, 0.06979711f, 0.3899215f, 0.7948176f), float3.zero), q1_xyz, epsilon); + TestUtils.AreEqual(RigidTransform(quaternion(-0.3133549f, 0.06979711f, 0.3899215f, 0.8630749f), float3.zero), q1_xzy, epsilon); + TestUtils.AreEqual(RigidTransform(quaternion(-0.4597331f, 0.06979711f, 0.1971690f, 0.8630748f), float3.zero), q1_yxz, epsilon); + TestUtils.AreEqual(RigidTransform(quaternion(-0.4597331f, 0.34356190f, 0.1971690f, 0.7948176f), float3.zero), q1_yzx, epsilon); + TestUtils.AreEqual(RigidTransform(quaternion(-0.3133549f, 0.34356190f, 0.3899215f, 0.7948176f), float3.zero), q1_zxy, epsilon); + TestUtils.AreEqual(RigidTransform(quaternion(-0.3133549f, 0.34356190f, 0.1971690f, 0.8630749f), float3.zero), q1_zyx, epsilon); + + float3x3 m0 = float3x3(q0.rot); + float3x3 m0_xyz = float3x3(q0_xyz.rot); + float3x3 m0_xzy = float3x3(q0_xzy.rot); + float3x3 m0_yxz = float3x3(q0_yxz.rot); + float3x3 m0_yzx = float3x3(q0_yzx.rot); + float3x3 m0_zxy = float3x3(q0_zxy.rot); + float3x3 m0_zyx = float3x3(q0_zyx.rot); + + float3x3 m1 = float3x3(q1.rot); + float3x3 m1_xyz = float3x3(q1_xyz.rot); + float3x3 m1_xzy = float3x3(q1_xzy.rot); + float3x3 m1_yxz = float3x3(q1_yxz.rot); + float3x3 m1_yzx = float3x3(q1_yzx.rot); + float3x3 m1_zxy = float3x3(q1_zxy.rot); + float3x3 m1_zyx = float3x3(q1_zyx.rot); + + TestUtils.AreEqual(TestMatrix.test3x3_zxy, m0, epsilon); + TestUtils.AreEqual(TestMatrix.test3x3_xyz, m0_xyz, epsilon); + TestUtils.AreEqual(TestMatrix.test3x3_yzx, m0_yzx, epsilon); + TestUtils.AreEqual(TestMatrix.test3x3_zxy, m0_zxy, epsilon); + TestUtils.AreEqual(TestMatrix.test3x3_xzy, m0_xzy, epsilon); + TestUtils.AreEqual(TestMatrix.test3x3_yxz, m0_yxz, epsilon); + TestUtils.AreEqual(TestMatrix.test3x3_zyx, m0_zyx, 0.0001f); + + TestUtils.AreEqual(TestMatrix.test3x3_zxy, m1, epsilon); + TestUtils.AreEqual(TestMatrix.test3x3_xyz, m1_xyz, epsilon); + TestUtils.AreEqual(TestMatrix.test3x3_yzx, m1_yzx, epsilon); + TestUtils.AreEqual(TestMatrix.test3x3_zxy, m1_zxy, epsilon); + TestUtils.AreEqual(TestMatrix.test3x3_xzy, m1_xzy, epsilon); + TestUtils.AreEqual(TestMatrix.test3x3_yxz, m1_yxz, epsilon); + TestUtils.AreEqual(TestMatrix.test3x3_zyx, m1_zyx, epsilon); + } + + [TestCompiler] + public static void rigid_transform_rotateX() + { + float angle = 2.3f; + RigidTransform q = RigidTransform.RotateX(angle); + + RigidTransform r = RigidTransform(quaternion(0.91276394f, 0.0f, 0.0f, 0.40848744f), float3.zero); + TestUtils.AreEqual(r, q, 0.0001f); + } + + [TestCompiler] + public static void rigid_transform_rotateY() + { + float angle = 2.3f; + RigidTransform q = RigidTransform.RotateY(angle); + + RigidTransform r = RigidTransform(quaternion(0.0f, 0.91276394f, 0.0f, 0.40848744f), float3.zero); + TestUtils.AreEqual(r, q, 0.0001f); + } + + [TestCompiler] + public static void rigid_transform_rotateZ() + { + float angle = 2.3f; + RigidTransform q = RigidTransform.RotateZ(angle); + + RigidTransform r = RigidTransform(quaternion(0.0f, 0.0f, 0.91276394f, 0.40848744f), float3.zero); + TestUtils.AreEqual(r, q, 0.0001f); + } + + static internal readonly quaternion test_q0 = new quaternion(0.3270836f, 0.8449658f, -0.1090279f, 0.4088545f); + static internal readonly quaternion test_q1 = new quaternion(-0.05623216f, 0.731018f, -0.6747859f, -0.08434824f); + static internal readonly quaternion test_q2 = new quaternion(-0.2316205f, -0.6022133f, -0.7411857f, -0.1852964f); + static internal readonly quaternion test_q3 = new quaternion(0.3619499f, 0.8352691f, -0.1392115f, 0.3897922f); + + [TestCompiler] + public static void rigid_transform_inverse() + { + RigidTransform q = RigidTransform(quaternion(1.0f, -2.0f, 3.0f, -4.0f), float3(1,2,3)); + RigidTransform iq = inverse(q); + RigidTransform qiq = mul(iq, q); + + TestUtils.AreEqual(RigidTransform.identity, qiq, 0.00001f); + } + + [TestCompiler] + public static void rigid_transform_mul_vector() + { + float4x4 m = TestMatrix.test4x4_xyz; + RigidTransform q = RigidTransform(m); + + float3 vector = float3(1.1f, -2.2f, 3.5f); + + float4 mvector0 = mul(m, float4(vector, 0)); + float4 qvector0 = mul(q, float4(vector, 0)); + TestUtils.AreEqual(mvector0, qvector0, 0.0001f); + + float4 mvector1 = mul(m, float4(vector, 1)); + float4 qvector1 = mul(q, float4(vector, 1)); + TestUtils.AreEqual(mvector1, qvector1, 0.0001f); + } + + [TestCase] + public static void rigid_transform_EqualsObjectOverride() + { + TestUtils.IsFalse(new RigidTransform().Equals((object) new int())); + TestUtils.IsTrue(new RigidTransform().Equals((object) new RigidTransform())); + } + } +} diff --git a/src/Tests/Tests/Shared/TestRigidTransform.cs.meta b/src/Tests/Tests/Shared/TestRigidTransform.cs.meta new file mode 100644 index 00000000..2d5869d6 --- /dev/null +++ b/src/Tests/Tests/Shared/TestRigidTransform.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0ea7743c8ecbfba4abe11751b744207e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestSvd.cs b/src/Tests/Tests/Shared/TestSvd.cs new file mode 100644 index 00000000..e75cf04f --- /dev/null +++ b/src/Tests/Tests/Shared/TestSvd.cs @@ -0,0 +1,185 @@ +using System.Collections.Generic; +using NUnit.Framework; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestSvd + { + const float k_SVDTolerance = 1e-4f; + + static bool QuaternionEquals(quaternion expected, quaternion actual, float tolerance) => + (math.lengthsq(expected) == 0f && math.lengthsq(actual) == 0f) || math.abs(math.dot(expected, actual)) > (1f - tolerance); + + // Validate Penrose condition that [aba = a] + static void ValidatePenrose1(in float3x3 a, in float3x3 b) + { + var testA = math.mul(math.mul(a, b), a); + + TestUtils.AreEqual(a.c0.x, testA.c0.x, k_SVDTolerance); + TestUtils.AreEqual(a.c0.y, testA.c0.y, k_SVDTolerance); + TestUtils.AreEqual(a.c0.z, testA.c0.z, k_SVDTolerance); + TestUtils.AreEqual(a.c1.x, testA.c1.x, k_SVDTolerance); + TestUtils.AreEqual(a.c1.y, testA.c1.y, k_SVDTolerance); + TestUtils.AreEqual(a.c1.z, testA.c1.z, k_SVDTolerance); + TestUtils.AreEqual(a.c2.x, testA.c2.x, k_SVDTolerance); + TestUtils.AreEqual(a.c2.y, testA.c2.y, k_SVDTolerance); + TestUtils.AreEqual(a.c2.z, testA.c2.z, k_SVDTolerance); + } + + // Validate Penrose condition that [transpose(ab) = ab] + static void ValidatePenrose2(in float3x3 a, in float3x3 b) + { + var ab = math.mul(a, b); + var testAB = math.transpose(ab); + + TestUtils.AreEqual(ab.c0.x, testAB.c0.x, k_SVDTolerance); + TestUtils.AreEqual(ab.c0.y, testAB.c0.y, k_SVDTolerance); + TestUtils.AreEqual(ab.c0.z, testAB.c0.z, k_SVDTolerance); + TestUtils.AreEqual(ab.c1.x, testAB.c1.x, k_SVDTolerance); + TestUtils.AreEqual(ab.c1.y, testAB.c1.y, k_SVDTolerance); + TestUtils.AreEqual(ab.c1.z, testAB.c1.z, k_SVDTolerance); + TestUtils.AreEqual(ab.c2.x, testAB.c2.x, k_SVDTolerance); + TestUtils.AreEqual(ab.c2.y, testAB.c2.y, k_SVDTolerance); + TestUtils.AreEqual(ab.c2.z, testAB.c2.z, k_SVDTolerance); + } + + static void ValidateSingular(in float3x3 a) => + TestUtils.AreEqual(0.0f, math.determinant(a), k_SVDTolerance); + + [TestCompiler] + public static void CanSVDInverseNonSingularFloat3x3() + { + var mat = math.float3x3( + math.float3(9f, 1f, 2f), + math.float3(3f, 8f, 4f), + math.float3(5f, 6f, 7f) + ); + + var inv = svd.svdInverse(mat); + var testIdentity = math.mul(mat, inv); + + TestUtils.AreEqual(1f, testIdentity.c0.x, k_SVDTolerance); + TestUtils.AreEqual(0f, testIdentity.c0.y, k_SVDTolerance); + TestUtils.AreEqual(0f, testIdentity.c0.z, k_SVDTolerance); + TestUtils.AreEqual(0f, testIdentity.c1.x, k_SVDTolerance); + TestUtils.AreEqual(1f, testIdentity.c1.y, k_SVDTolerance); + TestUtils.AreEqual(0f, testIdentity.c1.z, k_SVDTolerance); + TestUtils.AreEqual(0f, testIdentity.c2.x, k_SVDTolerance); + TestUtils.AreEqual(0f, testIdentity.c2.y, k_SVDTolerance); + TestUtils.AreEqual(1f, testIdentity.c2.z, k_SVDTolerance); + } + + [TestCompiler] + public static void CanSVDInverseFloat3x3With_NullColumn() + { + var mat = math.float3x3( + math.float3(9f, 1f, 0f), + math.float3(3f, 8f, 0f), + math.float3(5f, 6f, 0f) + ); + + ValidateSingular(mat); + var inv = svd.svdInverse(mat); + + ValidatePenrose1(mat, inv); + ValidatePenrose1(inv, mat); + ValidatePenrose2(mat, inv); + ValidatePenrose2(inv, mat); + } + + [TestCompiler] + public static void CanSVDInverseFloat3x3With_NullRow() + { + var mat = math.float3x3( + math.float3(9f, 1f, 2f), + math.float3(0f, 0f, 0f), + math.float3(5f, 6f, 7f) + ); + + ValidateSingular(mat); + var inv = svd.svdInverse(mat); + + ValidatePenrose1(mat, inv); + ValidatePenrose1(inv, mat); + ValidatePenrose2(mat, inv); + ValidatePenrose2(inv, mat); + } + + [TestCompiler] + public static void CanSVDInverseFloat3x3With_LinearDependentColumn() + { + var mat = math.float3x3( + math.float3(9f, 4f, 2f), + math.float3(3f, 8f, 4f), + math.float3(5f, 14f, 7f) + ); + + ValidateSingular(mat); + var inv = svd.svdInverse(mat); + + ValidatePenrose1(mat, inv); + ValidatePenrose1(inv, mat); + ValidatePenrose2(mat, inv); + ValidatePenrose2(inv, mat); + } + + [TestCompiler] + public static void CanSVDInverseFloat3x3With_LinearDependentRow() + { + var mat = math.float3x3( + math.float3(9f, 1f, 2f), + math.float3(10f, 12f, 14f), + math.float3(5f, 6f, 7f) + ); + + ValidateSingular(mat); + var inv = svd.svdInverse(mat); + + ValidatePenrose1(mat, inv); + ValidatePenrose1(inv, mat); + ValidatePenrose2(mat, inv); + ValidatePenrose2(inv, mat); + } + + [TestCompiler] + public static void CanSVDInverseFloat3x3With_RotatedZeroScale() + { + var m102030 = math.float3x3(quaternion.Euler(math.radians(10f), math.radians(20f), math.radians(30f))); + var parent = math.mulScale(m102030, math.float3(1f, 1f, 0f)); + var mat = math.mul(parent, m102030); + + ValidateSingular(mat); + var inv = svd.svdInverse(mat); + + ValidatePenrose1(mat, inv); + ValidatePenrose1(inv, mat); + ValidatePenrose2(mat, inv); + ValidatePenrose2(inv, mat); + } + + // Case 928598: The errors appear, when GameObject has a child with ParticleSystem which is rotated along the y-axis to -180 and is moved + [TestCompiler] + public static void CanExtractSVDRotationFromFloat3x3With_X180_Y0_Z181() + { + var q = quaternion.Euler(math.radians(180f), math.radians(0f), math.radians(181f)); + var qSVD = svd.svdRotation(math.float3x3(q)); + + TestUtils.IsTrue(QuaternionEquals(q, qSVD, k_SVDTolerance)); + } + + // Case 938548: Assertion failed on expression: 'CompareApproximately(det, 1.0F, .005f)' when scaling system to 0 on at least 2 axes + [TestCompiler] + public static void CanExtractSVDRotationFromFloat3x3With_ZeroScaleXY() + { + var q0 = quaternion.Euler(math.radians(10f), math.radians(20f), math.radians(30f)); + var m0 = math.float3x3(q0); + var m0Scaled = math.mulScale(m0, math.float3(1f, 0f, 0f)); + var q1 = svd.svdRotation(m0Scaled); + var m1 = math.float3x3(q1); + + TestUtils.AreEqual(0.0f, math.length(m0.c0 - m1.c0), k_SVDTolerance); + } + } +} diff --git a/src/Tests/Tests/Shared/TestSvd.cs.meta b/src/Tests/Tests/Shared/TestSvd.cs.meta new file mode 100644 index 00000000..824a25f5 --- /dev/null +++ b/src/Tests/Tests/Shared/TestSvd.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8218cb7d87dac4432871cd5bd00fd333 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestUint2.gen.cs b/src/Tests/Tests/Shared/TestUint2.gen.cs new file mode 100644 index 00000000..d853e034 --- /dev/null +++ b/src/Tests/Tests/Shared/TestUint2.gen.cs @@ -0,0 +1,1346 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestUint2 + { + [TestCompiler] + public static void uint2_zero() + { + TestUtils.AreEqual(0u, uint2.zero.x); + TestUtils.AreEqual(0u, uint2.zero.y); + } + + [TestCompiler] + public static void uint2_constructor() + { + uint2 a = new uint2(1, 2); + TestUtils.AreEqual(1, a.x); + TestUtils.AreEqual(2, a.y); + } + + [TestCompiler] + public static void uint2_scalar_constructor() + { + uint2 a = new uint2(17u); + TestUtils.AreEqual(17u, a.x); + TestUtils.AreEqual(17u, a.y); + } + + [TestCompiler] + public static void uint2_static_constructor() + { + uint2 a = uint2(1, 2); + TestUtils.AreEqual(1, a.x); + TestUtils.AreEqual(2, a.y); + } + + [TestCompiler] + public static void uint2_static_scalar_constructor() + { + uint2 a = uint2(17u); + TestUtils.AreEqual(17u, a.x); + TestUtils.AreEqual(17u, a.y); + } + + [TestCompiler] + public static void uint2_operator_equal_wide_wide() + { + uint2 a0 = uint2(2105871082, 35218899); + uint2 b0 = uint2(1477587886, 579629692); + bool2 r0 = bool2(false, false); + TestUtils.AreEqual(r0, a0 == b0); + + uint2 a1 = uint2(1550755093, 764676020); + uint2 b1 = uint2(540974792, 208405066); + bool2 r1 = bool2(false, false); + TestUtils.AreEqual(r1, a1 == b1); + + uint2 a2 = uint2(606743782, 1208156098); + uint2 b2 = uint2(2063397938, 1060167409); + bool2 r2 = bool2(false, false); + TestUtils.AreEqual(r2, a2 == b2); + + uint2 a3 = uint2(1023640014, 1038468316); + uint2 b3 = uint2(362592601, 2097545362); + bool2 r3 = bool2(false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void uint2_operator_equal_wide_scalar() + { + uint2 a0 = uint2(437822262, 2020661134); + uint b0 = (1332833578); + bool2 r0 = bool2(false, false); + TestUtils.AreEqual(r0, a0 == b0); + + uint2 a1 = uint2(541786900, 23716499); + uint b1 = (853113810); + bool2 r1 = bool2(false, false); + TestUtils.AreEqual(r1, a1 == b1); + + uint2 a2 = uint2(179951405, 948838849); + uint b2 = (1409026299); + bool2 r2 = bool2(false, false); + TestUtils.AreEqual(r2, a2 == b2); + + uint2 a3 = uint2(953202998, 1926262965); + uint b3 = (691955848); + bool2 r3 = bool2(false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void uint2_operator_equal_scalar_wide() + { + uint a0 = (542329200); + uint2 b0 = uint2(1115584594, 684107773); + bool2 r0 = bool2(false, false); + TestUtils.AreEqual(r0, a0 == b0); + + uint a1 = (1928988941); + uint2 b1 = uint2(890709324, 641152437); + bool2 r1 = bool2(false, false); + TestUtils.AreEqual(r1, a1 == b1); + + uint a2 = (1410341302); + uint2 b2 = uint2(497505660, 1068223109); + bool2 r2 = bool2(false, false); + TestUtils.AreEqual(r2, a2 == b2); + + uint a3 = (2014009435); + uint2 b3 = uint2(213835595, 1592428361); + bool2 r3 = bool2(false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void uint2_operator_not_equal_wide_wide() + { + uint2 a0 = uint2(1977284100, 1293292704); + uint2 b0 = uint2(1514195556, 957972049); + bool2 r0 = bool2(true, true); + TestUtils.AreEqual(r0, a0 != b0); + + uint2 a1 = uint2(1547283851, 422428953); + uint2 b1 = uint2(507667364, 581861672); + bool2 r1 = bool2(true, true); + TestUtils.AreEqual(r1, a1 != b1); + + uint2 a2 = uint2(195833190, 1711544892); + uint2 b2 = uint2(1128094576, 940096636); + bool2 r2 = bool2(true, true); + TestUtils.AreEqual(r2, a2 != b2); + + uint2 a3 = uint2(5606053, 737069074); + uint2 b3 = uint2(57559040, 181752616); + bool2 r3 = bool2(true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void uint2_operator_not_equal_wide_scalar() + { + uint2 a0 = uint2(1038269360, 1427812625); + uint b0 = (768873026); + bool2 r0 = bool2(true, true); + TestUtils.AreEqual(r0, a0 != b0); + + uint2 a1 = uint2(103361237, 1523584313); + uint b1 = (1347017023); + bool2 r1 = bool2(true, true); + TestUtils.AreEqual(r1, a1 != b1); + + uint2 a2 = uint2(150442802, 719113717); + uint b2 = (660334527); + bool2 r2 = bool2(true, true); + TestUtils.AreEqual(r2, a2 != b2); + + uint2 a3 = uint2(262959423, 506946952); + uint b3 = (484398043); + bool2 r3 = bool2(true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void uint2_operator_not_equal_scalar_wide() + { + uint a0 = (1652127596); + uint2 b0 = uint2(953791238, 271722683); + bool2 r0 = bool2(true, true); + TestUtils.AreEqual(r0, a0 != b0); + + uint a1 = (1278885987); + uint2 b1 = uint2(735128017, 112416504); + bool2 r1 = bool2(true, true); + TestUtils.AreEqual(r1, a1 != b1); + + uint a2 = (25967222); + uint2 b2 = uint2(1761444475, 1844594536); + bool2 r2 = bool2(true, true); + TestUtils.AreEqual(r2, a2 != b2); + + uint a3 = (1199122922); + uint2 b3 = uint2(634219279, 942501101); + bool2 r3 = bool2(true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void uint2_operator_less_wide_wide() + { + uint2 a0 = uint2(1486550609, 1779244308); + uint2 b0 = uint2(97842578, 536551311); + bool2 r0 = bool2(false, false); + TestUtils.AreEqual(r0, a0 < b0); + + uint2 a1 = uint2(1602148045, 1614085440); + uint2 b1 = uint2(413528975, 1838293684); + bool2 r1 = bool2(false, true); + TestUtils.AreEqual(r1, a1 < b1); + + uint2 a2 = uint2(1975613414, 942838342); + uint2 b2 = uint2(1283898480, 1456599961); + bool2 r2 = bool2(false, true); + TestUtils.AreEqual(r2, a2 < b2); + + uint2 a3 = uint2(1092279031, 373677431); + uint2 b3 = uint2(1080278602, 529676676); + bool2 r3 = bool2(false, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void uint2_operator_less_wide_scalar() + { + uint2 a0 = uint2(796797557, 670113454); + uint b0 = (746564682); + bool2 r0 = bool2(false, true); + TestUtils.AreEqual(r0, a0 < b0); + + uint2 a1 = uint2(933579492, 318174822); + uint b1 = (278884514); + bool2 r1 = bool2(false, false); + TestUtils.AreEqual(r1, a1 < b1); + + uint2 a2 = uint2(1117630673, 1990922600); + uint b2 = (741886928); + bool2 r2 = bool2(false, false); + TestUtils.AreEqual(r2, a2 < b2); + + uint2 a3 = uint2(1030849597, 1718582899); + uint b3 = (1546212312); + bool2 r3 = bool2(true, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void uint2_operator_less_scalar_wide() + { + uint a0 = (186400299); + uint2 b0 = uint2(1881344229, 813834467); + bool2 r0 = bool2(true, true); + TestUtils.AreEqual(r0, a0 < b0); + + uint a1 = (1254886626); + uint2 b1 = uint2(1353590345, 1412343685); + bool2 r1 = bool2(true, true); + TestUtils.AreEqual(r1, a1 < b1); + + uint a2 = (1555571443); + uint2 b2 = uint2(1540508298, 1735458634); + bool2 r2 = bool2(false, true); + TestUtils.AreEqual(r2, a2 < b2); + + uint a3 = (135888070); + uint2 b3 = uint2(1643818742, 248291654); + bool2 r3 = bool2(true, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void uint2_operator_greater_wide_wide() + { + uint2 a0 = uint2(2087717754, 1725569452); + uint2 b0 = uint2(85148514, 293632137); + bool2 r0 = bool2(true, true); + TestUtils.AreEqual(r0, a0 > b0); + + uint2 a1 = uint2(1298066182, 1693943616); + uint2 b1 = uint2(1151128249, 409440398); + bool2 r1 = bool2(true, true); + TestUtils.AreEqual(r1, a1 > b1); + + uint2 a2 = uint2(1319019629, 70674491); + uint2 b2 = uint2(1115020183, 1508500597); + bool2 r2 = bool2(true, false); + TestUtils.AreEqual(r2, a2 > b2); + + uint2 a3 = uint2(1042499725, 1002821508); + uint2 b3 = uint2(1834583302, 1755218534); + bool2 r3 = bool2(false, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void uint2_operator_greater_wide_scalar() + { + uint2 a0 = uint2(1208626274, 239697208); + uint b0 = (1715176566); + bool2 r0 = bool2(false, false); + TestUtils.AreEqual(r0, a0 > b0); + + uint2 a1 = uint2(1979453345, 1590192876); + uint b1 = (1253474001); + bool2 r1 = bool2(true, true); + TestUtils.AreEqual(r1, a1 > b1); + + uint2 a2 = uint2(1487911635, 1662650098); + uint b2 = (1673945595); + bool2 r2 = bool2(false, false); + TestUtils.AreEqual(r2, a2 > b2); + + uint2 a3 = uint2(222749855, 566635217); + uint b3 = (1433540517); + bool2 r3 = bool2(false, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void uint2_operator_greater_scalar_wide() + { + uint a0 = (480938827); + uint2 b0 = uint2(1824731899, 921496110); + bool2 r0 = bool2(false, false); + TestUtils.AreEqual(r0, a0 > b0); + + uint a1 = (586859044); + uint2 b1 = uint2(946430596, 1231356727); + bool2 r1 = bool2(false, false); + TestUtils.AreEqual(r1, a1 > b1); + + uint a2 = (1390167458); + uint2 b2 = uint2(1785807092, 28949024); + bool2 r2 = bool2(false, true); + TestUtils.AreEqual(r2, a2 > b2); + + uint a3 = (2037899283); + uint2 b3 = uint2(595656760, 1778095771); + bool2 r3 = bool2(true, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void uint2_operator_less_equal_wide_wide() + { + uint2 a0 = uint2(154092149, 1515170149); + uint2 b0 = uint2(77984380, 1712054191); + bool2 r0 = bool2(false, true); + TestUtils.AreEqual(r0, a0 <= b0); + + uint2 a1 = uint2(1083970332, 785807178); + uint2 b1 = uint2(1566203809, 254834519); + bool2 r1 = bool2(true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + uint2 a2 = uint2(1401094881, 310537627); + uint2 b2 = uint2(450519938, 389457083); + bool2 r2 = bool2(false, true); + TestUtils.AreEqual(r2, a2 <= b2); + + uint2 a3 = uint2(868328962, 1990816725); + uint2 b3 = uint2(1298669505, 207343167); + bool2 r3 = bool2(true, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void uint2_operator_less_equal_wide_scalar() + { + uint2 a0 = uint2(1479531977, 1427983411); + uint b0 = (2004563877); + bool2 r0 = bool2(true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + uint2 a1 = uint2(415250630, 1112546666); + uint b1 = (1245345407); + bool2 r1 = bool2(true, true); + TestUtils.AreEqual(r1, a1 <= b1); + + uint2 a2 = uint2(1072990632, 101048307); + uint b2 = (1579912858); + bool2 r2 = bool2(true, true); + TestUtils.AreEqual(r2, a2 <= b2); + + uint2 a3 = uint2(1070894375, 1910488590); + uint b3 = (509818792); + bool2 r3 = bool2(false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void uint2_operator_less_equal_scalar_wide() + { + uint a0 = (1899193992); + uint2 b0 = uint2(915011820, 980913757); + bool2 r0 = bool2(false, false); + TestUtils.AreEqual(r0, a0 <= b0); + + uint a1 = (1337699683); + uint2 b1 = uint2(1476321359, 1102143668); + bool2 r1 = bool2(true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + uint a2 = (660493983); + uint2 b2 = uint2(184664508, 381579707); + bool2 r2 = bool2(false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + uint a3 = (1954892821); + uint2 b3 = uint2(1295090571, 1440368586); + bool2 r3 = bool2(false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void uint2_operator_greater_equal_wide_wide() + { + uint2 a0 = uint2(8538378, 2131749726); + uint2 b0 = uint2(903145828, 1697992986); + bool2 r0 = bool2(false, true); + TestUtils.AreEqual(r0, a0 >= b0); + + uint2 a1 = uint2(265427108, 523609761); + uint2 b1 = uint2(1432491982, 169789504); + bool2 r1 = bool2(false, true); + TestUtils.AreEqual(r1, a1 >= b1); + + uint2 a2 = uint2(994991818, 839709564); + uint2 b2 = uint2(1059357300, 1744255222); + bool2 r2 = bool2(false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + uint2 a3 = uint2(101288202, 1886280970); + uint2 b3 = uint2(1606584463, 1905414425); + bool2 r3 = bool2(false, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void uint2_operator_greater_equal_wide_scalar() + { + uint2 a0 = uint2(2049236663, 182691143); + uint b0 = (1061998015); + bool2 r0 = bool2(true, false); + TestUtils.AreEqual(r0, a0 >= b0); + + uint2 a1 = uint2(634973382, 439837565); + uint b1 = (1197012109); + bool2 r1 = bool2(false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + uint2 a2 = uint2(1367606469, 351147187); + uint b2 = (1108037359); + bool2 r2 = bool2(true, false); + TestUtils.AreEqual(r2, a2 >= b2); + + uint2 a3 = uint2(1898505669, 1998610091); + uint b3 = (411667685); + bool2 r3 = bool2(true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void uint2_operator_greater_equal_scalar_wide() + { + uint a0 = (1859811087); + uint2 b0 = uint2(1070365918, 1783869452); + bool2 r0 = bool2(true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + uint a1 = (830091760); + uint2 b1 = uint2(377157428, 327199016); + bool2 r1 = bool2(true, true); + TestUtils.AreEqual(r1, a1 >= b1); + + uint a2 = (90384229); + uint2 b2 = uint2(1154649706, 376758501); + bool2 r2 = bool2(false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + uint a3 = (1079802834); + uint2 b3 = uint2(2054742898, 1328349472); + bool2 r3 = bool2(false, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void uint2_operator_add_wide_wide() + { + uint2 a0 = uint2(2135171378, 21433296); + uint2 b0 = uint2(1013431952, 366718162); + uint2 r0 = uint2(3148603330, 388151458); + TestUtils.AreEqual(r0, a0 + b0); + + uint2 a1 = uint2(1954723494, 683604307); + uint2 b1 = uint2(359290756, 1393163294); + uint2 r1 = uint2(2314014250, 2076767601); + TestUtils.AreEqual(r1, a1 + b1); + + uint2 a2 = uint2(1054212315, 1762680995); + uint2 b2 = uint2(1962236872, 1263270041); + uint2 r2 = uint2(3016449187, 3025951036); + TestUtils.AreEqual(r2, a2 + b2); + + uint2 a3 = uint2(1963655852, 1257853062); + uint2 b3 = uint2(1862666629, 1077447887); + uint2 r3 = uint2(3826322481, 2335300949); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void uint2_operator_add_wide_scalar() + { + uint2 a0 = uint2(665815972, 1783729250); + uint b0 = (1334043849); + uint2 r0 = uint2(1999859821, 3117773099); + TestUtils.AreEqual(r0, a0 + b0); + + uint2 a1 = uint2(1591678394, 977850224); + uint b1 = (1284528538); + uint2 r1 = uint2(2876206932, 2262378762); + TestUtils.AreEqual(r1, a1 + b1); + + uint2 a2 = uint2(71069732, 1200356017); + uint b2 = (1138577680); + uint2 r2 = uint2(1209647412, 2338933697); + TestUtils.AreEqual(r2, a2 + b2); + + uint2 a3 = uint2(565982008, 1088001167); + uint b3 = (1246759684); + uint2 r3 = uint2(1812741692, 2334760851); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void uint2_operator_add_scalar_wide() + { + uint a0 = (359966320); + uint2 b0 = uint2(2146146202, 767103309); + uint2 r0 = uint2(2506112522, 1127069629); + TestUtils.AreEqual(r0, a0 + b0); + + uint a1 = (851002415); + uint2 b1 = uint2(311531406, 1491262941); + uint2 r1 = uint2(1162533821, 2342265356); + TestUtils.AreEqual(r1, a1 + b1); + + uint a2 = (1016891373); + uint2 b2 = uint2(1954228994, 1671335850); + uint2 r2 = uint2(2971120367, 2688227223); + TestUtils.AreEqual(r2, a2 + b2); + + uint a3 = (727870747); + uint2 b3 = uint2(551151834, 1390261152); + uint2 r3 = uint2(1279022581, 2118131899); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void uint2_operator_sub_wide_wide() + { + uint2 a0 = uint2(1410318491, 1097280168); + uint2 b0 = uint2(1315897366, 799052018); + uint2 r0 = uint2(94421125, 298228150); + TestUtils.AreEqual(r0, a0 - b0); + + uint2 a1 = uint2(1827039044, 28881338); + uint2 b1 = uint2(1580289673, 1094686261); + uint2 r1 = uint2(246749371, 3229162373); + TestUtils.AreEqual(r1, a1 - b1); + + uint2 a2 = uint2(328720965, 875487868); + uint2 b2 = uint2(1954325726, 1197734816); + uint2 r2 = uint2(2669362535, 3972720348); + TestUtils.AreEqual(r2, a2 - b2); + + uint2 a3 = uint2(212936325, 231977215); + uint2 b3 = uint2(229886366, 915679176); + uint2 r3 = uint2(4278017255, 3611265335); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void uint2_operator_sub_wide_scalar() + { + uint2 a0 = uint2(1508669340, 1594795463); + uint b0 = (998008471); + uint2 r0 = uint2(510660869, 596786992); + TestUtils.AreEqual(r0, a0 - b0); + + uint2 a1 = uint2(266707545, 287705008); + uint b1 = (643102647); + uint2 r1 = uint2(3918572194, 3939569657); + TestUtils.AreEqual(r1, a1 - b1); + + uint2 a2 = uint2(1475644328, 979450511); + uint b2 = (1113286221); + uint2 r2 = uint2(362358107, 4161131586); + TestUtils.AreEqual(r2, a2 - b2); + + uint2 a3 = uint2(2082174113, 304369206); + uint b3 = (1108005498); + uint2 r3 = uint2(974168615, 3491331004); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void uint2_operator_sub_scalar_wide() + { + uint a0 = (893369501); + uint2 b0 = uint2(2051906184, 1699714311); + uint2 r0 = uint2(3136430613, 3488622486); + TestUtils.AreEqual(r0, a0 - b0); + + uint a1 = (442603706); + uint2 b1 = uint2(1735141684, 274533585); + uint2 r1 = uint2(3002429318, 168070121); + TestUtils.AreEqual(r1, a1 - b1); + + uint a2 = (811580259); + uint2 b2 = uint2(1196354320, 1524097023); + uint2 r2 = uint2(3910193235, 3582450532); + TestUtils.AreEqual(r2, a2 - b2); + + uint a3 = (533621527); + uint2 b3 = uint2(2080845793, 143958837); + uint2 r3 = uint2(2747743030, 389662690); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void uint2_operator_mul_wide_wide() + { + uint2 a0 = uint2(61417577, 219585476); + uint2 b0 = uint2(578042444, 1620527213); + uint2 r0 = uint2(2868103468, 1326150260); + TestUtils.AreEqual(r0, a0 * b0); + + uint2 a1 = uint2(1362520891, 1511084277); + uint2 b1 = uint2(200516468, 309339115); + uint2 r1 = uint2(3304073148, 2972110823); + TestUtils.AreEqual(r1, a1 * b1); + + uint2 a2 = uint2(1481211272, 58211871); + uint2 b2 = uint2(542853019, 299467282); + uint2 r2 = uint2(1973926232, 88546350); + TestUtils.AreEqual(r2, a2 * b2); + + uint2 a3 = uint2(1459591173, 567624644); + uint2 b3 = uint2(1479641221, 1428338601); + uint2 r3 = uint2(3431047833, 3712145508); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void uint2_operator_mul_wide_scalar() + { + uint2 a0 = uint2(871746615, 492532311); + uint b0 = (442064533); + uint2 r0 = uint2(338365955, 1081376419); + TestUtils.AreEqual(r0, a0 * b0); + + uint2 a1 = uint2(570557670, 1610315153); + uint b1 = (2142306629); + uint2 r1 = uint2(2845194238, 310198549); + TestUtils.AreEqual(r1, a1 * b1); + + uint2 a2 = uint2(1526163563, 257439514); + uint b2 = (118471734); + uint2 r2 = uint2(3961756306, 4120426364); + TestUtils.AreEqual(r2, a2 * b2); + + uint2 a3 = uint2(364291059, 1584938026); + uint b3 = (1186560810); + uint2 r3 = uint2(1029154526, 989596900); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void uint2_operator_mul_scalar_wide() + { + uint a0 = (1152242766); + uint2 b0 = uint2(1276636134, 2105929407); + uint2 r0 = uint2(2165463060, 999811634); + TestUtils.AreEqual(r0, a0 * b0); + + uint a1 = (499007702); + uint2 b1 = uint2(124002565, 1956335172); + uint2 r1 = uint2(1219156526, 400321752); + TestUtils.AreEqual(r1, a1 * b1); + + uint a2 = (1288034953); + uint2 b2 = uint2(832676555, 337389733); + uint2 r2 = uint2(3193437347, 10961485); + TestUtils.AreEqual(r2, a2 * b2); + + uint a3 = (99268757); + uint2 b3 = uint2(2005055247, 2011389505); + uint2 r3 = uint2(559764411, 2675872725); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void uint2_operator_div_wide_wide() + { + uint2 a0 = uint2(333171510, 858154903); + uint2 b0 = uint2(698897823, 440199998); + uint2 r0 = uint2(0, 1); + TestUtils.AreEqual(r0, a0 / b0); + + uint2 a1 = uint2(1181365836, 671357749); + uint2 b1 = uint2(655557473, 1658534285); + uint2 r1 = uint2(1, 0); + TestUtils.AreEqual(r1, a1 / b1); + + uint2 a2 = uint2(1090606752, 803759420); + uint2 b2 = uint2(2127220100, 315653188); + uint2 r2 = uint2(0, 2); + TestUtils.AreEqual(r2, a2 / b2); + + uint2 a3 = uint2(788404166, 296807814); + uint2 b3 = uint2(1814290360, 992173243); + uint2 r3 = uint2(0, 0); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void uint2_operator_div_wide_scalar() + { + uint2 a0 = uint2(1433072926, 1073958635); + uint b0 = (1434025872); + uint2 r0 = uint2(0, 0); + TestUtils.AreEqual(r0, a0 / b0); + + uint2 a1 = uint2(1195142312, 1274375693); + uint b1 = (536596719); + uint2 r1 = uint2(2, 2); + TestUtils.AreEqual(r1, a1 / b1); + + uint2 a2 = uint2(464756346, 906504670); + uint b2 = (806462546); + uint2 r2 = uint2(0, 1); + TestUtils.AreEqual(r2, a2 / b2); + + uint2 a3 = uint2(1380905136, 1196815948); + uint b3 = (25493909); + uint2 r3 = uint2(54, 46); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void uint2_operator_div_scalar_wide() + { + uint a0 = (519165704); + uint2 b0 = uint2(1295178177, 775214121); + uint2 r0 = uint2(0, 0); + TestUtils.AreEqual(r0, a0 / b0); + + uint a1 = (467772046); + uint2 b1 = uint2(1156881598, 310396565); + uint2 r1 = uint2(0, 1); + TestUtils.AreEqual(r1, a1 / b1); + + uint a2 = (759759959); + uint2 b2 = uint2(243837702, 1616314235); + uint2 r2 = uint2(3, 0); + TestUtils.AreEqual(r2, a2 / b2); + + uint a3 = (1053470225); + uint2 b3 = uint2(1320630160, 378773841); + uint2 r3 = uint2(0, 2); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void uint2_operator_mod_wide_wide() + { + uint2 a0 = uint2(258342924, 1454754891); + uint2 b0 = uint2(1990080167, 1197348066); + uint2 r0 = uint2(258342924, 257406825); + TestUtils.AreEqual(r0, a0 % b0); + + uint2 a1 = uint2(723352342, 1981431473); + uint2 b1 = uint2(651970512, 1659454050); + uint2 r1 = uint2(71381830, 321977423); + TestUtils.AreEqual(r1, a1 % b1); + + uint2 a2 = uint2(531756042, 716993627); + uint2 b2 = uint2(241005212, 1866255454); + uint2 r2 = uint2(49745618, 716993627); + TestUtils.AreEqual(r2, a2 % b2); + + uint2 a3 = uint2(1667903349, 1331097004); + uint2 b3 = uint2(1440101415, 595220963); + uint2 r3 = uint2(227801934, 140655078); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void uint2_operator_mod_wide_scalar() + { + uint2 a0 = uint2(560988938, 629524514); + uint b0 = (1156862367); + uint2 r0 = uint2(560988938, 629524514); + TestUtils.AreEqual(r0, a0 % b0); + + uint2 a1 = uint2(767711194, 1399805893); + uint b1 = (434281967); + uint2 r1 = uint2(333429227, 96959992); + TestUtils.AreEqual(r1, a1 % b1); + + uint2 a2 = uint2(792916846, 598661916); + uint b2 = (1663690927); + uint2 r2 = uint2(792916846, 598661916); + TestUtils.AreEqual(r2, a2 % b2); + + uint2 a3 = uint2(1776636144, 1743722161); + uint b3 = (1287035793); + uint2 r3 = uint2(489600351, 456686368); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void uint2_operator_mod_scalar_wide() + { + uint a0 = (933347930); + uint2 b0 = uint2(549923387, 243114953); + uint2 r0 = uint2(383424543, 204003071); + TestUtils.AreEqual(r0, a0 % b0); + + uint a1 = (1884274390); + uint2 b1 = uint2(1428033594, 655531454); + uint2 r1 = uint2(456240796, 573211482); + TestUtils.AreEqual(r1, a1 % b1); + + uint a2 = (1622674954); + uint2 b2 = uint2(1107563514, 1614111094); + uint2 r2 = uint2(515111440, 8563860); + TestUtils.AreEqual(r2, a2 % b2); + + uint a3 = (914801920); + uint2 b3 = uint2(1432263179, 564431096); + uint2 r3 = uint2(914801920, 350370824); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void uint2_operator_plus() + { + uint2 a0 = uint2(195392567, 222719748); + uint2 r0 = uint2(195392567, 222719748); + TestUtils.AreEqual(r0, +a0); + + uint2 a1 = uint2(1002351013, 109389333); + uint2 r1 = uint2(1002351013, 109389333); + TestUtils.AreEqual(r1, +a1); + + uint2 a2 = uint2(1515950277, 291471785); + uint2 r2 = uint2(1515950277, 291471785); + TestUtils.AreEqual(r2, +a2); + + uint2 a3 = uint2(264115671, 195779102); + uint2 r3 = uint2(264115671, 195779102); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void uint2_operator_neg() + { + uint2 a0 = uint2(1385088677, 94114564); + uint2 r0 = uint2(2909878619, 4200852732); + TestUtils.AreEqual(r0, -a0); + + uint2 a1 = uint2(1350664872, 2067164853); + uint2 r1 = uint2(2944302424, 2227802443); + TestUtils.AreEqual(r1, -a1); + + uint2 a2 = uint2(218122493, 270553961); + uint2 r2 = uint2(4076844803, 4024413335); + TestUtils.AreEqual(r2, -a2); + + uint2 a3 = uint2(446497525, 1928771252); + uint2 r3 = uint2(3848469771, 2366196044); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void uint2_operator_prefix_inc() + { + uint2 a0 = uint2(780471723, 954741756); + uint2 r0 = uint2(780471724, 954741757); + TestUtils.AreEqual(r0, ++a0); + + uint2 a1 = uint2(272723451, 606294309); + uint2 r1 = uint2(272723452, 606294310); + TestUtils.AreEqual(r1, ++a1); + + uint2 a2 = uint2(1514814550, 444189162); + uint2 r2 = uint2(1514814551, 444189163); + TestUtils.AreEqual(r2, ++a2); + + uint2 a3 = uint2(1833356994, 1348278302); + uint2 r3 = uint2(1833356995, 1348278303); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void uint2_operator_postfix_inc() + { + uint2 a0 = uint2(241865086, 2145821641); + uint2 r0 = uint2(241865086, 2145821641); + TestUtils.AreEqual(r0, a0++); + + uint2 a1 = uint2(1596166022, 529551271); + uint2 r1 = uint2(1596166022, 529551271); + TestUtils.AreEqual(r1, a1++); + + uint2 a2 = uint2(1656767229, 1213663244); + uint2 r2 = uint2(1656767229, 1213663244); + TestUtils.AreEqual(r2, a2++); + + uint2 a3 = uint2(1425753247, 389844650); + uint2 r3 = uint2(1425753247, 389844650); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void uint2_operator_prefix_dec() + { + uint2 a0 = uint2(1331961415, 1612382200); + uint2 r0 = uint2(1331961414, 1612382199); + TestUtils.AreEqual(r0, --a0); + + uint2 a1 = uint2(1401591249, 1757136546); + uint2 r1 = uint2(1401591248, 1757136545); + TestUtils.AreEqual(r1, --a1); + + uint2 a2 = uint2(1895858159, 578341664); + uint2 r2 = uint2(1895858158, 578341663); + TestUtils.AreEqual(r2, --a2); + + uint2 a3 = uint2(1336115745, 1169239112); + uint2 r3 = uint2(1336115744, 1169239111); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void uint2_operator_postfix_dec() + { + uint2 a0 = uint2(1870005937, 1708534798); + uint2 r0 = uint2(1870005937, 1708534798); + TestUtils.AreEqual(r0, a0--); + + uint2 a1 = uint2(704493460, 2060593573); + uint2 r1 = uint2(704493460, 2060593573); + TestUtils.AreEqual(r1, a1--); + + uint2 a2 = uint2(228744869, 1818778351); + uint2 r2 = uint2(228744869, 1818778351); + TestUtils.AreEqual(r2, a2--); + + uint2 a3 = uint2(1015253889, 1401191870); + uint2 r3 = uint2(1015253889, 1401191870); + TestUtils.AreEqual(r3, a3--); + } + + [TestCompiler] + public static void uint2_operator_bitwise_and_wide_wide() + { + uint2 a0 = uint2(1055241304, 859321394); + uint2 b0 = uint2(749698416, 748105424); + uint2 r0 = uint2(749024336, 537928720); + TestUtils.AreEqual(r0, a0 & b0); + + uint2 a1 = uint2(1088358961, 2090949513); + uint2 b1 = uint2(1842764797, 9990577); + uint2 r1 = uint2(1087769137, 8409473); + TestUtils.AreEqual(r1, a1 & b1); + + uint2 a2 = uint2(300561740, 651904515); + uint2 b2 = uint2(1989102105, 1666634755); + uint2 r2 = uint2(277479432, 575816707); + TestUtils.AreEqual(r2, a2 & b2); + + uint2 a3 = uint2(1331035868, 2012752753); + uint2 b3 = uint2(58116798, 868036607); + uint2 r3 = uint2(55888540, 867707761); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void uint2_operator_bitwise_and_wide_scalar() + { + uint2 a0 = uint2(1513158868, 284695609); + uint b0 = (1173647397); + uint2 r0 = uint2(1076916228, 15732769); + TestUtils.AreEqual(r0, a0 & b0); + + uint2 a1 = uint2(734595037, 1601252476); + uint b1 = (1566510707); + uint2 r1 = uint2(155780689, 1565592688); + TestUtils.AreEqual(r1, a1 & b1); + + uint2 a2 = uint2(84213838, 430856908); + uint b2 = (314333543); + uint2 r2 = uint2(262214, 279730244); + TestUtils.AreEqual(r2, a2 & b2); + + uint2 a3 = uint2(753481263, 1619794917); + uint b3 = (327392481); + uint2 r3 = uint2(8459297, 8394977); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void uint2_operator_bitwise_and_scalar_wide() + { + uint a0 = (477163326); + uint2 b0 = uint2(110453385, 703240362); + uint2 r0 = uint2(68182536, 140544042); + TestUtils.AreEqual(r0, a0 & b0); + + uint a1 = (2075630560); + uint2 b1 = uint2(1884904031, 1734899436); + uint2 r1 = uint2(1880169024, 1663046368); + TestUtils.AreEqual(r1, a1 & b1); + + uint a2 = (947945203); + uint2 b2 = uint2(1664399051, 458879298); + uint2 r2 = uint2(536884931, 402681922); + TestUtils.AreEqual(r2, a2 & b2); + + uint a3 = (158491426); + uint2 b3 = uint2(79772356, 2054527944); + uint2 r3 = uint2(4203008, 141558528); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void uint2_operator_bitwise_or_wide_wide() + { + uint2 a0 = uint2(1920951869, 1750772852); + uint2 b0 = uint2(214585254, 275414367); + uint2 r0 = uint2(2130669503, 2021326207); + TestUtils.AreEqual(r0, a0 | b0); + + uint2 a1 = uint2(1420019191, 732977093); + uint2 b1 = uint2(858759675, 190211455); + uint2 r1 = uint2(2008016383, 737572863); + TestUtils.AreEqual(r1, a1 | b1); + + uint2 a2 = uint2(1169579447, 229437930); + uint2 b2 = uint2(1218691723, 2129565457); + uint2 r2 = uint2(1303895999, 2146367483); + TestUtils.AreEqual(r2, a2 | b2); + + uint2 a3 = uint2(1966721348, 2039812323); + uint2 b3 = uint2(1862809466, 495728846); + uint2 r3 = uint2(2134507390, 2107455727); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void uint2_operator_bitwise_or_wide_scalar() + { + uint2 a0 = uint2(1295304853, 1307252624); + uint b0 = (1305527136); + uint2 r0 = uint2(1307888629, 1308350448); + TestUtils.AreEqual(r0, a0 | b0); + + uint2 a1 = uint2(350194630, 1774824542); + uint b1 = (1128063578); + uint2 r1 = uint2(1476389854, 1811803742); + TestUtils.AreEqual(r1, a1 | b1); + + uint2 a2 = uint2(2085245467, 999162350); + uint b2 = (1988423804); + uint2 r2 = uint2(2127491711, 2140074494); + TestUtils.AreEqual(r2, a2 | b2); + + uint2 a3 = uint2(2110327307, 341855232); + uint b3 = (1050875188); + uint2 r3 = uint2(2146115391, 1055087924); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void uint2_operator_bitwise_or_scalar_wide() + { + uint a0 = (1768627592); + uint2 b0 = uint2(1849658052, 1759912154); + uint2 r0 = uint2(1870634956, 1777286618); + TestUtils.AreEqual(r0, a0 | b0); + + uint a1 = (729979455); + uint2 b1 = uint2(975926310, 1987690876); + uint2 r1 = uint2(1001127487, 2147212159); + TestUtils.AreEqual(r1, a1 | b1); + + uint a2 = (1809506714); + uint2 b2 = uint2(1160695341, 408963395); + uint2 r2 = uint2(1878978495, 2080041435); + TestUtils.AreEqual(r2, a2 | b2); + + uint a3 = (314072711); + uint2 b3 = uint2(1560007537, 1709003416); + uint2 r3 = uint2(1593565175, 2013093535); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void uint2_operator_bitwise_xor_wide_wide() + { + uint2 a0 = uint2(1843655608, 362425681); + uint2 b0 = uint2(1422803441, 1234691140); + uint2 r0 = uint2(959296073, 1544407317); + TestUtils.AreEqual(r0, a0 ^ b0); + + uint2 a1 = uint2(640805534, 1342040268); + uint2 b1 = uint2(119589253, 1101464929); + uint2 r1 = uint2(554771227, 240840109); + TestUtils.AreEqual(r1, a1 ^ b1); + + uint2 a2 = uint2(945678755, 980321850); + uint2 b2 = uint2(121896337, 1880109018); + uint2 r2 = uint2(1058935858, 1249815008); + TestUtils.AreEqual(r2, a2 ^ b2); + + uint2 a3 = uint2(390165019, 1682422658); + uint2 b3 = uint2(1000210266, 1718938232); + uint2 r3 = uint2(752651585, 36917754); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void uint2_operator_bitwise_xor_wide_scalar() + { + uint2 a0 = uint2(169345668, 176087064); + uint b0 = (354464228); + uint2 r0 = uint2(523809632, 526275068); + TestUtils.AreEqual(r0, a0 ^ b0); + + uint2 a1 = uint2(2084362901, 193851255); + uint b1 = (1663924004); + uint2 r1 = uint2(521252273, 1755355219); + TestUtils.AreEqual(r1, a1 ^ b1); + + uint2 a2 = uint2(517476661, 863800783); + uint b2 = (905336222); + uint2 r2 = uint2(724452523, 109762641); + TestUtils.AreEqual(r2, a2 ^ b2); + + uint2 a3 = uint2(365003873, 954341348); + uint b3 = (835837496); + uint2 r3 = uint2(605051481, 154388956); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void uint2_operator_bitwise_xor_scalar_wide() + { + uint a0 = (1361775641); + uint2 b0 = uint2(1452773578, 459050892); + uint2 r0 = uint2(129801427, 1249346453); + TestUtils.AreEqual(r0, a0 ^ b0); + + uint a1 = (1986218254); + uint2 b1 = uint2(1689037698, 999278344); + uint2 r1 = uint2(315613836, 1307348486); + TestUtils.AreEqual(r1, a1 ^ b1); + + uint a2 = (1229114508); + uint2 b2 = uint2(1087843538, 733699740); + uint2 r2 = uint2(160817246, 1660523024); + TestUtils.AreEqual(r2, a2 ^ b2); + + uint a3 = (106187872); + uint2 b3 = uint2(1533632738, 1107817672); + uint2 r3 = uint2(1564290178, 1146337448); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void uint2_operator_left_shift() + { + uint2 a0 = uint2(1129100049, 829482269); + int b0 = (218351941); + uint2 r0 = uint2(1771463200, 773628832); + TestUtils.AreEqual(r0, a0 << b0); + + uint2 a1 = uint2(1571297368, 1872142968); + int b1 = (443753193); + uint2 r1 = uint2(1345368064, 759492608); + TestUtils.AreEqual(r1, a1 << b1); + + uint2 a2 = uint2(249554593, 980302862); + int b2 = (892627436); + uint2 r2 = uint2(4268363776, 3821068288); + TestUtils.AreEqual(r2, a2 << b2); + + uint2 a3 = uint2(62369727, 1271350845); + int b3 = (849916599); + uint2 r3 = uint2(3749707776, 511705088); + TestUtils.AreEqual(r3, a3 << b3); + } + + [TestCompiler] + public static void uint2_operator_right_shift() + { + uint2 a0 = uint2(809126085, 908563670); + int b0 = (994800051); + uint2 r0 = uint2(1543, 1732); + TestUtils.AreEqual(r0, a0 >> b0); + + uint2 a1 = uint2(763568837, 1174507510); + int b1 = (1986717290); + uint2 r1 = uint2(745672, 1146979); + TestUtils.AreEqual(r1, a1 >> b1); + + uint2 a2 = uint2(646821842, 390811632); + int b2 = (1242726074); + uint2 r2 = uint2(9, 5); + TestUtils.AreEqual(r2, a2 >> b2); + + uint2 a3 = uint2(1521420393, 102096936); + int b3 = (1923166649); + uint2 r3 = uint2(45, 3); + TestUtils.AreEqual(r3, a3 >> b3); + } + + [TestCompiler] + public static void uint2_operator_bitwise_not() + { + uint2 a0 = uint2(111796841, 603562399); + uint2 r0 = uint2(4183170454, 3691404896); + TestUtils.AreEqual(r0, ~a0); + + uint2 a1 = uint2(745091931, 1110916612); + uint2 r1 = uint2(3549875364, 3184050683); + TestUtils.AreEqual(r1, ~a1); + + uint2 a2 = uint2(381888399, 1506860135); + uint2 r2 = uint2(3913078896, 2788107160); + TestUtils.AreEqual(r2, ~a2); + + uint2 a3 = uint2(771210628, 875964607); + uint2 r3 = uint2(3523756667, 3419002688); + TestUtils.AreEqual(r3, ~a3); + } + + [TestCompiler] + public static void uint2_shuffle_result_1() + { + uint2 a = uint2(0, 1); + uint2 b = uint2(2, 3); + + TestUtils.AreEqual((0), shuffle(a, b, ShuffleComponent.LeftX)); + TestUtils.AreEqual((1), shuffle(a, b, ShuffleComponent.LeftY)); + TestUtils.AreEqual((2), shuffle(a, b, ShuffleComponent.RightX)); + TestUtils.AreEqual((3), shuffle(a, b, ShuffleComponent.RightY)); + } + + [TestCompiler] + public static void uint2_shuffle_result_2() + { + uint2 a = uint2(0, 1); + uint2 b = uint2(2, 3); + + TestUtils.AreEqual(uint2(0, 0), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.LeftX)); + TestUtils.AreEqual(uint2(1, 0), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.LeftX)); + TestUtils.AreEqual(uint2(2, 0), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftX)); + TestUtils.AreEqual(uint2(3, 0), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftX)); + TestUtils.AreEqual(uint2(0, 1), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.LeftY)); + TestUtils.AreEqual(uint2(1, 1), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.LeftY)); + TestUtils.AreEqual(uint2(2, 1), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftY)); + TestUtils.AreEqual(uint2(3, 1), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftY)); + TestUtils.AreEqual(uint2(0, 2), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.RightX)); + TestUtils.AreEqual(uint2(1, 2), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.RightX)); + TestUtils.AreEqual(uint2(2, 2), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightX)); + TestUtils.AreEqual(uint2(3, 2), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightX)); + TestUtils.AreEqual(uint2(0, 3), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.RightY)); + TestUtils.AreEqual(uint2(1, 3), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.RightY)); + TestUtils.AreEqual(uint2(2, 3), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightY)); + TestUtils.AreEqual(uint2(3, 3), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightY)); + } + + [TestCompiler] + public static void uint2_shuffle_result_3() + { + uint2 a = uint2(0, 1); + uint2 b = uint2(2, 3); + + TestUtils.AreEqual(uint3(2, 3, 3), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightY, ShuffleComponent.RightY)); + TestUtils.AreEqual(uint3(2, 0, 2), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftX, ShuffleComponent.RightX)); + TestUtils.AreEqual(uint3(3, 1, 3), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftY, ShuffleComponent.RightY)); + TestUtils.AreEqual(uint3(1, 1, 1), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.LeftY, ShuffleComponent.LeftY)); + TestUtils.AreEqual(uint3(2, 1, 3), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftY, ShuffleComponent.RightY)); + TestUtils.AreEqual(uint3(0, 3, 3), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.RightY, ShuffleComponent.RightY)); + TestUtils.AreEqual(uint3(2, 1, 3), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftY, ShuffleComponent.RightY)); + TestUtils.AreEqual(uint3(3, 3, 0), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightY, ShuffleComponent.LeftX)); + TestUtils.AreEqual(uint3(2, 2, 3), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightX, ShuffleComponent.RightY)); + TestUtils.AreEqual(uint3(2, 2, 0), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightX, ShuffleComponent.LeftX)); + TestUtils.AreEqual(uint3(0, 1, 1), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.LeftY, ShuffleComponent.LeftY)); + TestUtils.AreEqual(uint3(3, 2, 3), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightX, ShuffleComponent.RightY)); + TestUtils.AreEqual(uint3(0, 1, 1), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.LeftY, ShuffleComponent.LeftY)); + TestUtils.AreEqual(uint3(3, 2, 2), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightX, ShuffleComponent.RightX)); + TestUtils.AreEqual(uint3(0, 1, 3), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.LeftY, ShuffleComponent.RightY)); + TestUtils.AreEqual(uint3(3, 1, 1), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftY, ShuffleComponent.LeftY)); + } + + [TestCompiler] + public static void uint2_shuffle_result_4() + { + uint2 a = uint2(0, 1); + uint2 b = uint2(2, 3); + + TestUtils.AreEqual(uint4(0, 0, 1, 2), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.LeftX, ShuffleComponent.LeftY, ShuffleComponent.RightX)); + TestUtils.AreEqual(uint4(2, 1, 0, 3), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftY, ShuffleComponent.LeftX, ShuffleComponent.RightY)); + TestUtils.AreEqual(uint4(3, 2, 3, 2), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightX, ShuffleComponent.RightY, ShuffleComponent.RightX)); + TestUtils.AreEqual(uint4(2, 0, 3, 3), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftX, ShuffleComponent.RightY, ShuffleComponent.RightY)); + TestUtils.AreEqual(uint4(0, 3, 0, 2), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.RightY, ShuffleComponent.LeftX, ShuffleComponent.RightX)); + TestUtils.AreEqual(uint4(3, 0, 3, 1), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftX, ShuffleComponent.RightY, ShuffleComponent.LeftY)); + TestUtils.AreEqual(uint4(2, 2, 3, 0), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightX, ShuffleComponent.RightY, ShuffleComponent.LeftX)); + TestUtils.AreEqual(uint4(2, 2, 0, 3), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightX, ShuffleComponent.LeftX, ShuffleComponent.RightY)); + TestUtils.AreEqual(uint4(0, 1, 2, 1), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.LeftY, ShuffleComponent.RightX, ShuffleComponent.LeftY)); + TestUtils.AreEqual(uint4(2, 1, 3, 3), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftY, ShuffleComponent.RightY, ShuffleComponent.RightY)); + TestUtils.AreEqual(uint4(3, 3, 3, 1), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightY, ShuffleComponent.RightY, ShuffleComponent.LeftY)); + TestUtils.AreEqual(uint4(2, 2, 1, 1), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightX, ShuffleComponent.LeftY, ShuffleComponent.LeftY)); + TestUtils.AreEqual(uint4(3, 0, 0, 0), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftX, ShuffleComponent.LeftX, ShuffleComponent.LeftX)); + TestUtils.AreEqual(uint4(2, 2, 2, 3), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightX, ShuffleComponent.RightX, ShuffleComponent.RightY)); + TestUtils.AreEqual(uint4(0, 3, 0, 3), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.RightY, ShuffleComponent.LeftX, ShuffleComponent.RightY)); + TestUtils.AreEqual(uint4(2, 0, 0, 0), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftX, ShuffleComponent.LeftX, ShuffleComponent.LeftX)); + } + + [TestCase /* For player builds */] + public static void uint2_EqualsObjectOverride() + { + TestUtils.IsFalse(new uint2().Equals((object)new int())); + TestUtils.IsTrue(new uint2().Equals((object)new uint2())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestUint2.gen.cs.meta b/src/Tests/Tests/Shared/TestUint2.gen.cs.meta new file mode 100644 index 00000000..ade3bfc6 --- /dev/null +++ b/src/Tests/Tests/Shared/TestUint2.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2b6fc6b61ea1f4f42944befb17029ea1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestUint2x2.gen.cs b/src/Tests/Tests/Shared/TestUint2x2.gen.cs new file mode 100644 index 00000000..012db8aa --- /dev/null +++ b/src/Tests/Tests/Shared/TestUint2x2.gen.cs @@ -0,0 +1,1241 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestUint2x2 + { + [TestCompiler] + public static void uint2x2_zero() + { + TestUtils.AreEqual(0u, uint2x2.zero.c0.x); + TestUtils.AreEqual(0u, uint2x2.zero.c0.y); + TestUtils.AreEqual(0u, uint2x2.zero.c1.x); + TestUtils.AreEqual(0u, uint2x2.zero.c1.y); + } + + [TestCompiler] + public static void uint2x2_identity() + { + TestUtils.AreEqual(1u, uint2x2.identity.c0.x); + TestUtils.AreEqual(0u, uint2x2.identity.c0.y); + TestUtils.AreEqual(0u, uint2x2.identity.c1.x); + TestUtils.AreEqual(1u, uint2x2.identity.c1.y); + } + + [TestCompiler] + public static void uint2x2_operator_equal_wide_wide() + { + uint2x2 a0 = uint2x2(2105871082, 35218899, 1550755093, 764676020); + uint2x2 b0 = uint2x2(1477587886, 579629692, 540974792, 208405066); + bool2x2 r0 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + uint2x2 a1 = uint2x2(606743782, 1208156098, 1023640014, 1038468316); + uint2x2 b1 = uint2x2(2063397938, 1060167409, 362592601, 2097545362); + bool2x2 r1 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + uint2x2 a2 = uint2x2(1416064367, 727143393, 2061243891, 184669837); + uint2x2 b2 = uint2x2(277670088, 426944490, 901076223, 857900673); + bool2x2 r2 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + uint2x2 a3 = uint2x2(1303661760, 2044073738, 370395888, 1822916805); + uint2x2 b3 = uint2x2(1548779757, 325265488, 312658571, 176373760); + bool2x2 r3 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void uint2x2_operator_equal_wide_scalar() + { + uint2x2 a0 = uint2x2(437822262, 2020661134, 541786900, 853113810); + uint b0 = (1332833578); + bool2x2 r0 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + uint2x2 a1 = uint2x2(23716499, 1409026299, 948838849, 953202998); + uint b1 = (179951405); + bool2x2 r1 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + uint2x2 a2 = uint2x2(691955848, 1851546137, 712957637, 2028784869); + uint b2 = (1926262965); + bool2x2 r2 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + uint2x2 a3 = uint2x2(1049962241, 1016802970, 390120467, 464814777); + uint b3 = (1836975611); + bool2x2 r3 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void uint2x2_operator_equal_scalar_wide() + { + uint a0 = (542329200); + uint2x2 b0 = uint2x2(1115584594, 684107773, 1928988941, 890709324); + bool2x2 r0 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + uint a1 = (641152437); + uint2x2 b1 = uint2x2(1410341302, 497505660, 1068223109, 2014009435); + bool2x2 r1 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + uint a2 = (213835595); + uint2x2 b2 = uint2x2(1592428361, 1819361470, 448650623, 1942175642); + bool2x2 r2 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + uint a3 = (64377057); + uint2x2 b3 = uint2x2(1485938610, 1146305380, 1312317120, 263290348); + bool2x2 r3 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void uint2x2_operator_not_equal_wide_wide() + { + uint2x2 a0 = uint2x2(1977284100, 1293292704, 1547283851, 422428953); + uint2x2 b0 = uint2x2(1514195556, 957972049, 507667364, 581861672); + bool2x2 r0 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + uint2x2 a1 = uint2x2(195833190, 1711544892, 5606053, 737069074); + uint2x2 b1 = uint2x2(1128094576, 940096636, 57559040, 181752616); + bool2x2 r1 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + uint2x2 a2 = uint2x2(647386678, 13079405, 1413841590, 1076166545); + uint2x2 b2 = uint2x2(962017320, 1762015406, 1107218953, 2042026522); + bool2x2 r2 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + uint2x2 a3 = uint2x2(1211445174, 1289303469, 1436402489, 1129570126); + uint2x2 b3 = uint2x2(836002288, 570272309, 2112081980, 1500634658); + bool2x2 r3 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void uint2x2_operator_not_equal_wide_scalar() + { + uint2x2 a0 = uint2x2(1038269360, 1427812625, 103361237, 1347017023); + uint b0 = (768873026); + bool2x2 r0 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + uint2x2 a1 = uint2x2(1523584313, 660334527, 719113717, 262959423); + uint b1 = (150442802); + bool2x2 r1 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + uint2x2 a2 = uint2x2(484398043, 226568494, 507918242, 1702162286); + uint b2 = (506946952); + bool2x2 r2 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + uint2x2 a3 = uint2x2(923269270, 114581840, 1045389187, 1648095254); + uint b3 = (166187260); + bool2x2 r3 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void uint2x2_operator_not_equal_scalar_wide() + { + uint a0 = (1652127596); + uint2x2 b0 = uint2x2(953791238, 271722683, 1278885987, 735128017); + bool2x2 r0 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + uint a1 = (112416504); + uint2x2 b1 = uint2x2(25967222, 1761444475, 1844594536, 1199122922); + bool2x2 r1 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + uint a2 = (634219279); + uint2x2 b2 = uint2x2(942501101, 67161343, 969944293, 833229499); + bool2x2 r2 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + uint a3 = (1304301133); + uint2x2 b3 = uint2x2(704045745, 345012334, 1253134152, 325772538); + bool2x2 r3 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void uint2x2_operator_less_wide_wide() + { + uint2x2 a0 = uint2x2(1486550609, 1779244308, 1602148045, 1614085440); + uint2x2 b0 = uint2x2(97842578, 536551311, 413528975, 1838293684); + bool2x2 r0 = bool2x2(false, false, false, true); + TestUtils.AreEqual(r0, a0 < b0); + + uint2x2 a1 = uint2x2(1975613414, 942838342, 1092279031, 373677431); + uint2x2 b1 = uint2x2(1283898480, 1456599961, 1080278602, 529676676); + bool2x2 r1 = bool2x2(false, true, false, true); + TestUtils.AreEqual(r1, a1 < b1); + + uint2x2 a2 = uint2x2(1419098312, 337757077, 1081797900, 1336745069); + uint2x2 b2 = uint2x2(156584048, 117348799, 246927124, 1916615924); + bool2x2 r2 = bool2x2(false, false, false, true); + TestUtils.AreEqual(r2, a2 < b2); + + uint2x2 a3 = uint2x2(840685445, 1220554047, 2013681746, 192965012); + uint2x2 b3 = uint2x2(1731071394, 1328098431, 1014995792, 480319327); + bool2x2 r3 = bool2x2(true, true, false, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void uint2x2_operator_less_wide_scalar() + { + uint2x2 a0 = uint2x2(796797557, 670113454, 933579492, 278884514); + uint b0 = (746564682); + bool2x2 r0 = bool2x2(false, true, false, true); + TestUtils.AreEqual(r0, a0 < b0); + + uint2x2 a1 = uint2x2(318174822, 741886928, 1990922600, 1030849597); + uint b1 = (1117630673); + bool2x2 r1 = bool2x2(true, true, false, true); + TestUtils.AreEqual(r1, a1 < b1); + + uint2x2 a2 = uint2x2(1546212312, 1648393417, 1857132231, 1909506562); + uint b2 = (1718582899); + bool2x2 r2 = bool2x2(true, true, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + uint2x2 a3 = uint2x2(1294006045, 1303736668, 845460171, 979430272); + uint b3 = (952084157); + bool2x2 r3 = bool2x2(false, false, true, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void uint2x2_operator_less_scalar_wide() + { + uint a0 = (186400299); + uint2x2 b0 = uint2x2(1881344229, 813834467, 1254886626, 1353590345); + bool2x2 r0 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r0, a0 < b0); + + uint a1 = (1412343685); + uint2x2 b1 = uint2x2(1555571443, 1540508298, 1735458634, 135888070); + bool2x2 r1 = bool2x2(true, true, true, false); + TestUtils.AreEqual(r1, a1 < b1); + + uint a2 = (1643818742); + uint2x2 b2 = uint2x2(248291654, 1739560105, 728539891, 480507742); + bool2x2 r2 = bool2x2(false, true, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + uint a3 = (1696553040); + uint2x2 b3 = uint2x2(540223931, 1840493353, 146833656, 798115946); + bool2x2 r3 = bool2x2(false, true, false, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void uint2x2_operator_greater_wide_wide() + { + uint2x2 a0 = uint2x2(2087717754, 1725569452, 1298066182, 1693943616); + uint2x2 b0 = uint2x2(85148514, 293632137, 1151128249, 409440398); + bool2x2 r0 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r0, a0 > b0); + + uint2x2 a1 = uint2x2(1319019629, 70674491, 1042499725, 1002821508); + uint2x2 b1 = uint2x2(1115020183, 1508500597, 1834583302, 1755218534); + bool2x2 r1 = bool2x2(true, false, false, false); + TestUtils.AreEqual(r1, a1 > b1); + + uint2x2 a2 = uint2x2(1021857133, 1744374599, 821751047, 467646903); + uint2x2 b2 = uint2x2(1788761753, 1128238489, 834223713, 1578743290); + bool2x2 r2 = bool2x2(false, true, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + uint2x2 a3 = uint2x2(2029731638, 1377214212, 1207816926, 474621063); + uint2x2 b3 = uint2x2(1647150256, 1756397855, 1131080201, 1208965204); + bool2x2 r3 = bool2x2(true, false, true, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void uint2x2_operator_greater_wide_scalar() + { + uint2x2 a0 = uint2x2(1208626274, 239697208, 1979453345, 1253474001); + uint b0 = (1715176566); + bool2x2 r0 = bool2x2(false, false, true, false); + TestUtils.AreEqual(r0, a0 > b0); + + uint2x2 a1 = uint2x2(1590192876, 1673945595, 1662650098, 222749855); + uint b1 = (1487911635); + bool2x2 r1 = bool2x2(true, true, true, false); + TestUtils.AreEqual(r1, a1 > b1); + + uint2x2 a2 = uint2x2(1433540517, 1773305960, 1850273578, 206147145); + uint b2 = (566635217); + bool2x2 r2 = bool2x2(true, true, true, false); + TestUtils.AreEqual(r2, a2 > b2); + + uint2x2 a3 = uint2x2(325913453, 1905567362, 2053577491, 570397194); + uint b3 = (333381537); + bool2x2 r3 = bool2x2(false, true, true, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void uint2x2_operator_greater_scalar_wide() + { + uint a0 = (480938827); + uint2x2 b0 = uint2x2(1824731899, 921496110, 586859044, 946430596); + bool2x2 r0 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + uint a1 = (1231356727); + uint2x2 b1 = uint2x2(1390167458, 1785807092, 28949024, 2037899283); + bool2x2 r1 = bool2x2(false, false, true, false); + TestUtils.AreEqual(r1, a1 > b1); + + uint a2 = (595656760); + uint2x2 b2 = uint2x2(1778095771, 1233500439, 1696302238, 1445965340); + bool2x2 r2 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + uint a3 = (484020151); + uint2x2 b3 = uint2x2(1586962841, 1361740714, 265628948, 2003122957); + bool2x2 r3 = bool2x2(false, false, true, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void uint2x2_operator_less_equal_wide_wide() + { + uint2x2 a0 = uint2x2(154092149, 1515170149, 1083970332, 785807178); + uint2x2 b0 = uint2x2(77984380, 1712054191, 1566203809, 254834519); + bool2x2 r0 = bool2x2(false, true, true, false); + TestUtils.AreEqual(r0, a0 <= b0); + + uint2x2 a1 = uint2x2(1401094881, 310537627, 868328962, 1990816725); + uint2x2 b1 = uint2x2(450519938, 389457083, 1298669505, 207343167); + bool2x2 r1 = bool2x2(false, true, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + uint2x2 a2 = uint2x2(2035349541, 457043352, 1123282035, 1001842946); + uint2x2 b2 = uint2x2(1214449047, 2059561026, 896534357, 1897470050); + bool2x2 r2 = bool2x2(false, true, false, true); + TestUtils.AreEqual(r2, a2 <= b2); + + uint2x2 a3 = uint2x2(1387761992, 195272789, 659549000, 888761458); + uint2x2 b3 = uint2x2(521075677, 1848221945, 374708019, 1573731118); + bool2x2 r3 = bool2x2(false, true, false, true); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void uint2x2_operator_less_equal_wide_scalar() + { + uint2x2 a0 = uint2x2(1479531977, 1427983411, 415250630, 1245345407); + uint b0 = (2004563877); + bool2x2 r0 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + uint2x2 a1 = uint2x2(1112546666, 1579912858, 101048307, 1070894375); + uint b1 = (1072990632); + bool2x2 r1 = bool2x2(false, false, true, true); + TestUtils.AreEqual(r1, a1 <= b1); + + uint2x2 a2 = uint2x2(509818792, 85452501, 518127023, 1246249980); + uint b2 = (1910488590); + bool2x2 r2 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r2, a2 <= b2); + + uint2x2 a3 = uint2x2(1097326500, 1968139888, 1191853379, 662096238); + uint b3 = (1964410699); + bool2x2 r3 = bool2x2(true, false, true, true); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void uint2x2_operator_less_equal_scalar_wide() + { + uint a0 = (1899193992); + uint2x2 b0 = uint2x2(915011820, 980913757, 1337699683, 1476321359); + bool2x2 r0 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r0, a0 <= b0); + + uint a1 = (1102143668); + uint2x2 b1 = uint2x2(660493983, 184664508, 381579707, 1954892821); + bool2x2 r1 = bool2x2(false, false, false, true); + TestUtils.AreEqual(r1, a1 <= b1); + + uint a2 = (1295090571); + uint2x2 b2 = uint2x2(1440368586, 1696003686, 88708652, 1332251857); + bool2x2 r2 = bool2x2(true, true, false, true); + TestUtils.AreEqual(r2, a2 <= b2); + + uint a3 = (1310713644); + uint2x2 b3 = uint2x2(2112132784, 48951945, 1888568027, 39340955); + bool2x2 r3 = bool2x2(true, false, true, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void uint2x2_operator_greater_equal_wide_wide() + { + uint2x2 a0 = uint2x2(8538378, 2131749726, 265427108, 523609761); + uint2x2 b0 = uint2x2(903145828, 1697992986, 1432491982, 169789504); + bool2x2 r0 = bool2x2(false, true, false, true); + TestUtils.AreEqual(r0, a0 >= b0); + + uint2x2 a1 = uint2x2(994991818, 839709564, 101288202, 1886280970); + uint2x2 b1 = uint2x2(1059357300, 1744255222, 1606584463, 1905414425); + bool2x2 r1 = bool2x2(false, false, false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + uint2x2 a2 = uint2x2(2032074826, 631221455, 1456286159, 961342752); + uint2x2 b2 = uint2x2(1448794969, 136181998, 1678754836, 2069656857); + bool2x2 r2 = bool2x2(true, true, false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + uint2x2 a3 = uint2x2(424526026, 788481984, 1662488497, 870326690); + uint2x2 b3 = uint2x2(398982689, 243317404, 740939613, 1894753119); + bool2x2 r3 = bool2x2(true, true, true, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void uint2x2_operator_greater_equal_wide_scalar() + { + uint2x2 a0 = uint2x2(2049236663, 182691143, 634973382, 1197012109); + uint b0 = (1061998015); + bool2x2 r0 = bool2x2(true, false, false, true); + TestUtils.AreEqual(r0, a0 >= b0); + + uint2x2 a1 = uint2x2(439837565, 1108037359, 351147187, 1898505669); + uint b1 = (1367606469); + bool2x2 r1 = bool2x2(false, false, false, true); + TestUtils.AreEqual(r1, a1 >= b1); + + uint2x2 a2 = uint2x2(411667685, 4652390, 996159180, 2111455181); + uint b2 = (1998610091); + bool2x2 r2 = bool2x2(false, false, false, true); + TestUtils.AreEqual(r2, a2 >= b2); + + uint2x2 a3 = uint2x2(727766399, 814085575, 1525995206, 1293933760); + uint b3 = (96217144); + bool2x2 r3 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void uint2x2_operator_greater_equal_scalar_wide() + { + uint a0 = (1859811087); + uint2x2 b0 = uint2x2(1070365918, 1783869452, 830091760, 377157428); + bool2x2 r0 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + uint a1 = (327199016); + uint2x2 b1 = uint2x2(90384229, 1154649706, 376758501, 1079802834); + bool2x2 r1 = bool2x2(true, false, false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + uint a2 = (2054742898); + uint2x2 b2 = uint2x2(1328349472, 434061447, 951207723, 598695892); + bool2x2 r2 = bool2x2(true, true, true, true); + TestUtils.AreEqual(r2, a2 >= b2); + + uint a3 = (975131651); + uint2x2 b3 = uint2x2(1714007943, 177416473, 1267232721, 31082860); + bool2x2 r3 = bool2x2(false, true, false, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void uint2x2_operator_add_wide_wide() + { + uint2x2 a0 = uint2x2(2135171378, 21433296, 1954723494, 683604307); + uint2x2 b0 = uint2x2(1013431952, 366718162, 359290756, 1393163294); + uint2x2 r0 = uint2x2(3148603330, 388151458, 2314014250, 2076767601); + TestUtils.AreEqual(r0, a0 + b0); + + uint2x2 a1 = uint2x2(1054212315, 1762680995, 1963655852, 1257853062); + uint2x2 b1 = uint2x2(1962236872, 1263270041, 1862666629, 1077447887); + uint2x2 r1 = uint2x2(3016449187, 3025951036, 3826322481, 2335300949); + TestUtils.AreEqual(r1, a1 + b1); + + uint2x2 a2 = uint2x2(2043493600, 976898058, 1915056423, 121374462); + uint2x2 b2 = uint2x2(821693806, 487316539, 350922520, 1583012528); + uint2x2 r2 = uint2x2(2865187406, 1464214597, 2265978943, 1704386990); + TestUtils.AreEqual(r2, a2 + b2); + + uint2x2 a3 = uint2x2(1218855698, 700538222, 1702057277, 1788251699); + uint2x2 b3 = uint2x2(1951595076, 1024851344, 874302782, 1383969588); + uint2x2 r3 = uint2x2(3170450774, 1725389566, 2576360059, 3172221287); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void uint2x2_operator_add_wide_scalar() + { + uint2x2 a0 = uint2x2(665815972, 1783729250, 1591678394, 1284528538); + uint b0 = (1334043849); + uint2x2 r0 = uint2x2(1999859821, 3117773099, 2925722243, 2618572387); + TestUtils.AreEqual(r0, a0 + b0); + + uint2x2 a1 = uint2x2(977850224, 1138577680, 1200356017, 565982008); + uint b1 = (71069732); + uint2x2 r1 = uint2x2(1048919956, 1209647412, 1271425749, 637051740); + TestUtils.AreEqual(r1, a1 + b1); + + uint2x2 a2 = uint2x2(1246759684, 57252642, 678921480, 625943813); + uint b2 = (1088001167); + uint2x2 r2 = uint2x2(2334760851, 1145253809, 1766922647, 1713944980); + TestUtils.AreEqual(r2, a2 + b2); + + uint2x2 a3 = uint2x2(512157429, 1490096953, 1467033531, 182608093); + uint b3 = (1470648741); + uint2x2 r3 = uint2x2(1982806170, 2960745694, 2937682272, 1653256834); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void uint2x2_operator_add_scalar_wide() + { + uint a0 = (359966320); + uint2x2 b0 = uint2x2(2146146202, 767103309, 851002415, 311531406); + uint2x2 r0 = uint2x2(2506112522, 1127069629, 1210968735, 671497726); + TestUtils.AreEqual(r0, a0 + b0); + + uint a1 = (1491262941); + uint2x2 b1 = uint2x2(1016891373, 1954228994, 1671335850, 727870747); + uint2x2 r1 = uint2x2(2508154314, 3445491935, 3162598791, 2219133688); + TestUtils.AreEqual(r1, a1 + b1); + + uint a2 = (551151834); + uint2x2 b2 = uint2x2(1390261152, 1699060326, 115021619, 1964440175); + uint2x2 r2 = uint2x2(1941412986, 2250212160, 666173453, 2515592009); + TestUtils.AreEqual(r2, a2 + b2); + + uint a3 = (440700758); + uint2x2 b3 = uint2x2(1556692550, 185414255, 933106731, 1217866784); + uint2x2 r3 = uint2x2(1997393308, 626115013, 1373807489, 1658567542); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void uint2x2_operator_sub_wide_wide() + { + uint2x2 a0 = uint2x2(1410318491, 1097280168, 1827039044, 28881338); + uint2x2 b0 = uint2x2(1315897366, 799052018, 1580289673, 1094686261); + uint2x2 r0 = uint2x2(94421125, 298228150, 246749371, 3229162373); + TestUtils.AreEqual(r0, a0 - b0); + + uint2x2 a1 = uint2x2(328720965, 875487868, 212936325, 231977215); + uint2x2 b1 = uint2x2(1954325726, 1197734816, 229886366, 915679176); + uint2x2 r1 = uint2x2(2669362535, 3972720348, 4278017255, 3611265335); + TestUtils.AreEqual(r1, a1 - b1); + + uint2x2 a2 = uint2x2(1740021315, 2011295463, 48079003, 591379285); + uint2x2 b2 = uint2x2(1746884850, 918743925, 1007797419, 257421324); + uint2x2 r2 = uint2x2(4288103761, 1092551538, 3335248880, 333957961); + TestUtils.AreEqual(r2, a2 - b2); + + uint2x2 a3 = uint2x2(1125909359, 1842588095, 848561896, 614448464); + uint2x2 b3 = uint2x2(287249342, 1617287463, 1653916102, 123586847); + uint2x2 r3 = uint2x2(838660017, 225300632, 3489613090, 490861617); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void uint2x2_operator_sub_wide_scalar() + { + uint2x2 a0 = uint2x2(1508669340, 1594795463, 266707545, 643102647); + uint b0 = (998008471); + uint2x2 r0 = uint2x2(510660869, 596786992, 3563666370, 3940061472); + TestUtils.AreEqual(r0, a0 - b0); + + uint2x2 a1 = uint2x2(287705008, 1113286221, 979450511, 2082174113); + uint b1 = (1475644328); + uint2x2 r1 = uint2x2(3107027976, 3932609189, 3798773479, 606529785); + TestUtils.AreEqual(r1, a1 - b1); + + uint2x2 a2 = uint2x2(1108005498, 999244508, 1806482044, 1994553647); + uint b2 = (304369206); + uint2x2 r2 = uint2x2(803636292, 694875302, 1502112838, 1690184441); + TestUtils.AreEqual(r2, a2 - b2); + + uint2x2 a3 = uint2x2(2101812429, 266654115, 1470212363, 1190349300); + uint b3 = (1482736902); + uint2x2 r3 = uint2x2(619075527, 3078884509, 4282442757, 4002579694); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void uint2x2_operator_sub_scalar_wide() + { + uint a0 = (893369501); + uint2x2 b0 = uint2x2(2051906184, 1699714311, 442603706, 1735141684); + uint2x2 r0 = uint2x2(3136430613, 3488622486, 450765795, 3453195113); + TestUtils.AreEqual(r0, a0 - b0); + + uint a1 = (274533585); + uint2x2 b1 = uint2x2(811580259, 1196354320, 1524097023, 533621527); + uint2x2 r1 = uint2x2(3757920622, 3373146561, 3045403858, 4035879354); + TestUtils.AreEqual(r1, a1 - b1); + + uint a2 = (2080845793); + uint2x2 b2 = uint2x2(143958837, 1620668660, 1135989346, 1367044745); + uint2x2 r2 = uint2x2(1936886956, 460177133, 944856447, 713801048); + TestUtils.AreEqual(r2, a2 - b2); + + uint a3 = (554088609); + uint2x2 b3 = uint2x2(552670373, 1265516124, 1254902543, 1857695581); + uint2x2 r3 = uint2x2(1418236, 3583539781, 3594153362, 2991360324); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void uint2x2_operator_mul_wide_wide() + { + uint2x2 a0 = uint2x2(61417577, 219585476, 1362520891, 1511084277); + uint2x2 b0 = uint2x2(578042444, 1620527213, 200516468, 309339115); + uint2x2 r0 = uint2x2(2868103468, 1326150260, 3304073148, 2972110823); + TestUtils.AreEqual(r0, a0 * b0); + + uint2x2 a1 = uint2x2(1481211272, 58211871, 1459591173, 567624644); + uint2x2 b1 = uint2x2(542853019, 299467282, 1479641221, 1428338601); + uint2x2 r1 = uint2x2(1973926232, 88546350, 3431047833, 3712145508); + TestUtils.AreEqual(r1, a1 * b1); + + uint2x2 a2 = uint2x2(1169935583, 1835691886, 385626539, 85934842); + uint2x2 b2 = uint2x2(1497302909, 1596889147, 427413842, 265122693); + uint2x2 r2 = uint2x2(556671459, 1098186330, 1848083398, 4236646882); + TestUtils.AreEqual(r2, a2 * b2); + + uint2x2 a3 = uint2x2(522856538, 278370196, 289217012, 2083410174); + uint2x2 b3 = uint2x2(689376654, 1120457204, 516903000, 873091659); + uint2x2 r3 = uint2x2(2005201900, 651971856, 2573806560, 4184807018); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void uint2x2_operator_mul_wide_scalar() + { + uint2x2 a0 = uint2x2(871746615, 492532311, 570557670, 2142306629); + uint b0 = (442064533); + uint2x2 r0 = uint2x2(338365955, 1081376419, 2565819870, 3279557417); + TestUtils.AreEqual(r0, a0 * b0); + + uint2x2 a1 = uint2x2(1610315153, 118471734, 257439514, 364291059); + uint b1 = (1526163563); + uint2x2 r1 = uint2x2(2932083611, 3961756306, 2388105182, 3815128721); + TestUtils.AreEqual(r1, a1 * b1); + + uint2x2 a2 = uint2x2(1186560810, 1357601203, 638897141, 268562104); + uint b2 = (1584938026); + uint2x2 r2 = uint2x2(989596900, 898280286, 2953765426, 2323925552); + TestUtils.AreEqual(r2, a2 * b2); + + uint2x2 a3 = uint2x2(1007838321, 1619806399, 1444659979, 1127580168); + uint b3 = (1163240135); + uint2x2 r3 = uint2x2(610309591, 1971350137, 984126349, 1871258680); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void uint2x2_operator_mul_scalar_wide() + { + uint a0 = (1152242766); + uint2x2 b0 = uint2x2(1276636134, 2105929407, 499007702, 124002565); + uint2x2 r0 = uint2x2(2165463060, 999811634, 1179056436, 3493540742); + TestUtils.AreEqual(r0, a0 * b0); + + uint a1 = (1956335172); + uint2x2 b1 = uint2x2(1288034953, 832676555, 337389733, 99268757); + uint2x2 r1 = uint2x2(303483492, 4218558444, 1271140820, 1556966804); + TestUtils.AreEqual(r1, a1 * b1); + + uint a2 = (2005055247); + uint2x2 b2 = uint2x2(2011389505, 1348110859, 399689191, 2007606374); + uint2x2 r2 = uint2x2(2729770191, 2761028517, 4045388169, 759270394); + TestUtils.AreEqual(r2, a2 * b2); + + uint a3 = (2076691289); + uint2x2 b3 = uint2x2(1825721194, 769885235, 153314735, 1066325369); + uint2x2 r3 = uint2x2(609175002, 2727503547, 1593384663, 1878927889); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void uint2x2_operator_div_wide_wide() + { + uint2x2 a0 = uint2x2(333171510, 858154903, 1181365836, 671357749); + uint2x2 b0 = uint2x2(698897823, 440199998, 655557473, 1658534285); + uint2x2 r0 = uint2x2(0, 1, 1, 0); + TestUtils.AreEqual(r0, a0 / b0); + + uint2x2 a1 = uint2x2(1090606752, 803759420, 788404166, 296807814); + uint2x2 b1 = uint2x2(2127220100, 315653188, 1814290360, 992173243); + uint2x2 r1 = uint2x2(0, 2, 0, 0); + TestUtils.AreEqual(r1, a1 / b1); + + uint2x2 a2 = uint2x2(575260195, 166625280, 1493729000, 1831739736); + uint2x2 b2 = uint2x2(914851653, 664340325, 224323977, 246981573); + uint2x2 r2 = uint2x2(0, 0, 6, 7); + TestUtils.AreEqual(r2, a2 / b2); + + uint2x2 a3 = uint2x2(200852358, 129983172, 500176108, 472051781); + uint2x2 b3 = uint2x2(285573983, 819471609, 2012476015, 1783179572); + uint2x2 r3 = uint2x2(0, 0, 0, 0); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void uint2x2_operator_div_wide_scalar() + { + uint2x2 a0 = uint2x2(1433072926, 1073958635, 1195142312, 536596719); + uint b0 = (1434025872); + uint2x2 r0 = uint2x2(0, 0, 0, 0); + TestUtils.AreEqual(r0, a0 / b0); + + uint2x2 a1 = uint2x2(1274375693, 806462546, 906504670, 1380905136); + uint b1 = (464756346); + uint2x2 r1 = uint2x2(2, 1, 1, 2); + TestUtils.AreEqual(r1, a1 / b1); + + uint2x2 a2 = uint2x2(25493909, 123300377, 643754735, 2084019932); + uint b2 = (1196815948); + uint2x2 r2 = uint2x2(0, 0, 0, 1); + TestUtils.AreEqual(r2, a2 / b2); + + uint2x2 a3 = uint2x2(2047825037, 741331531, 466443901, 2110004616); + uint b3 = (458304263); + uint2x2 r3 = uint2x2(4, 1, 1, 4); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void uint2x2_operator_div_scalar_wide() + { + uint a0 = (519165704); + uint2x2 b0 = uint2x2(1295178177, 775214121, 467772046, 1156881598); + uint2x2 r0 = uint2x2(0, 0, 1, 0); + TestUtils.AreEqual(r0, a0 / b0); + + uint a1 = (310396565); + uint2x2 b1 = uint2x2(759759959, 243837702, 1616314235, 1053470225); + uint2x2 r1 = uint2x2(0, 1, 0, 0); + TestUtils.AreEqual(r1, a1 / b1); + + uint a2 = (1320630160); + uint2x2 b2 = uint2x2(378773841, 4223608, 1971105754, 2054406020); + uint2x2 r2 = uint2x2(3, 312, 0, 0); + TestUtils.AreEqual(r2, a2 / b2); + + uint a3 = (219939614); + uint2x2 b3 = uint2x2(1603672651, 2006134295, 888535397, 1493077923); + uint2x2 r3 = uint2x2(0, 0, 0, 0); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void uint2x2_operator_mod_wide_wide() + { + uint2x2 a0 = uint2x2(258342924, 1454754891, 723352342, 1981431473); + uint2x2 b0 = uint2x2(1990080167, 1197348066, 651970512, 1659454050); + uint2x2 r0 = uint2x2(258342924, 257406825, 71381830, 321977423); + TestUtils.AreEqual(r0, a0 % b0); + + uint2x2 a1 = uint2x2(531756042, 716993627, 1667903349, 1331097004); + uint2x2 b1 = uint2x2(241005212, 1866255454, 1440101415, 595220963); + uint2x2 r1 = uint2x2(49745618, 716993627, 227801934, 140655078); + TestUtils.AreEqual(r1, a1 % b1); + + uint2x2 a2 = uint2x2(1776856101, 17598216, 1474345080, 1681376293); + uint2x2 b2 = uint2x2(408818410, 198222574, 549504274, 239973807); + uint2x2 r2 = uint2x2(141582461, 17598216, 375336532, 1559644); + TestUtils.AreEqual(r2, a2 % b2); + + uint2x2 a3 = uint2x2(813624265, 1617478722, 498370451, 780075943); + uint2x2 b3 = uint2x2(321398087, 658171840, 1511495237, 1048325585); + uint2x2 r3 = uint2x2(170828091, 301135042, 498370451, 780075943); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void uint2x2_operator_mod_wide_scalar() + { + uint2x2 a0 = uint2x2(560988938, 629524514, 767711194, 434281967); + uint b0 = (1156862367); + uint2x2 r0 = uint2x2(560988938, 629524514, 767711194, 434281967); + TestUtils.AreEqual(r0, a0 % b0); + + uint2x2 a1 = uint2x2(1399805893, 1663690927, 598661916, 1776636144); + uint b1 = (792916846); + uint2x2 r1 = uint2x2(606889047, 77857235, 598661916, 190802452); + TestUtils.AreEqual(r1, a1 % b1); + + uint2x2 a2 = uint2x2(1287035793, 475209785, 327476870, 1617696916); + uint b2 = (1743722161); + uint2x2 r2 = uint2x2(1287035793, 475209785, 327476870, 1617696916); + TestUtils.AreEqual(r2, a2 % b2); + + uint2x2 a3 = uint2x2(379853074, 858399046, 712734431, 1506629323); + uint b3 = (477430114); + uint2x2 r3 = uint2x2(379853074, 380968932, 235304317, 74338981); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void uint2x2_operator_mod_scalar_wide() + { + uint a0 = (933347930); + uint2x2 b0 = uint2x2(549923387, 243114953, 1884274390, 1428033594); + uint2x2 r0 = uint2x2(383424543, 204003071, 933347930, 933347930); + TestUtils.AreEqual(r0, a0 % b0); + + uint a1 = (655531454); + uint2x2 b1 = uint2x2(1622674954, 1107563514, 1614111094, 914801920); + uint2x2 r1 = uint2x2(655531454, 655531454, 655531454, 655531454); + TestUtils.AreEqual(r1, a1 % b1); + + uint a2 = (1432263179); + uint2x2 b2 = uint2x2(564431096, 1967013901, 1709750152, 1080102613); + uint2x2 r2 = uint2x2(303400987, 1432263179, 1432263179, 352160566); + TestUtils.AreEqual(r2, a2 % b2); + + uint a3 = (13120773); + uint2x2 b3 = uint2x2(2042535998, 1505698002, 1640058084, 974167554); + uint2x2 r3 = uint2x2(13120773, 13120773, 13120773, 13120773); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void uint2x2_operator_plus() + { + uint2x2 a0 = uint2x2(195392567, 222719748, 1002351013, 1570765263); + uint2x2 r0 = uint2x2(195392567, 222719748, 1002351013, 1570765263); + TestUtils.AreEqual(r0, +a0); + + uint2x2 a1 = uint2x2(109389333, 1689763402, 291471785, 264115671); + uint2x2 r1 = uint2x2(109389333, 1689763402, 291471785, 264115671); + TestUtils.AreEqual(r1, +a1); + + uint2x2 a2 = uint2x2(1084131995, 2131702223, 715660442, 1995564647); + uint2x2 r2 = uint2x2(1084131995, 2131702223, 715660442, 1995564647); + TestUtils.AreEqual(r2, +a2); + + uint2x2 a3 = uint2x2(69731564, 1957501908, 531426536, 2012985092); + uint2x2 r3 = uint2x2(69731564, 1957501908, 531426536, 2012985092); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void uint2x2_operator_neg() + { + uint2x2 a0 = uint2x2(1385088677, 94114564, 1350664872, 1458616659); + uint2x2 r0 = uint2x2(2909878619, 4200852732, 2944302424, 2836350637); + TestUtils.AreEqual(r0, -a0); + + uint2x2 a1 = uint2x2(2067164853, 958484951, 270553961, 446497525); + uint2x2 r1 = uint2x2(2227802443, 3336482345, 4024413335, 3848469771); + TestUtils.AreEqual(r1, -a1); + + uint2x2 a2 = uint2x2(270503114, 1427605822, 2051940607, 1434247484); + uint2x2 r2 = uint2x2(4024464182, 2867361474, 2243026689, 2860719812); + TestUtils.AreEqual(r2, -a2); + + uint2x2 a3 = uint2x2(485368391, 1742096480, 990033169, 1368056141); + uint2x2 r3 = uint2x2(3809598905, 2552870816, 3304934127, 2926911155); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void uint2x2_operator_prefix_inc() + { + uint2x2 a0 = uint2x2(780471723, 954741756, 272723451, 2142862245); + uint2x2 r0 = uint2x2(780471724, 954741757, 272723452, 2142862246); + TestUtils.AreEqual(r0, ++a0); + + uint2x2 a1 = uint2x2(606294309, 250124151, 444189162, 1833356994); + uint2x2 r1 = uint2x2(606294310, 250124152, 444189163, 1833356995); + TestUtils.AreEqual(r1, ++a1); + + uint2x2 a2 = uint2x2(1915989169, 129540735, 1584496757, 1170613526); + uint2x2 r2 = uint2x2(1915989170, 129540736, 1584496758, 1170613527); + TestUtils.AreEqual(r2, ++a2); + + uint2x2 a3 = uint2x2(986715680, 1397451003, 483952900, 1494652811); + uint2x2 r3 = uint2x2(986715681, 1397451004, 483952901, 1494652812); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void uint2x2_operator_postfix_inc() + { + uint2x2 a0 = uint2x2(241865086, 2145821641, 1596166022, 803592338); + uint2x2 r0 = uint2x2(241865086, 2145821641, 1596166022, 803592338); + TestUtils.AreEqual(r0, a0++); + + uint2x2 a1 = uint2x2(529551271, 903047443, 1213663244, 1425753247); + uint2x2 r1 = uint2x2(529551271, 903047443, 1213663244, 1425753247); + TestUtils.AreEqual(r1, a1++); + + uint2x2 a2 = uint2x2(1384002775, 1159795446, 1343289659, 1227160199); + uint2x2 r2 = uint2x2(1384002775, 1159795446, 1343289659, 1227160199); + TestUtils.AreEqual(r2, a2++); + + uint2x2 a3 = uint2x2(947635082, 451018043, 1634297552, 2009552507); + uint2x2 r3 = uint2x2(947635082, 451018043, 1634297552, 2009552507); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void uint2x2_operator_prefix_dec() + { + uint2x2 a0 = uint2x2(1331961415, 1612382200, 1401591249, 2042075388); + uint2x2 r0 = uint2x2(1331961414, 1612382199, 1401591248, 2042075387); + TestUtils.AreEqual(r0, --a0); + + uint2x2 a1 = uint2x2(1757136546, 1467742422, 578341664, 1336115745); + uint2x2 r1 = uint2x2(1757136545, 1467742421, 578341663, 1336115744); + TestUtils.AreEqual(r1, --a1); + + uint2x2 a2 = uint2x2(2059077641, 1862369220, 312317355, 1027543764); + uint2x2 r2 = uint2x2(2059077640, 1862369219, 312317354, 1027543763); + TestUtils.AreEqual(r2, --a2); + + uint2x2 a3 = uint2x2(1595492535, 1426620468, 674685792, 1423852012); + uint2x2 r3 = uint2x2(1595492534, 1426620467, 674685791, 1423852011); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void uint2x2_operator_postfix_dec() + { + uint2x2 a0 = uint2x2(1870005937, 1708534798, 704493460, 462940703); + uint2x2 r0 = uint2x2(1870005937, 1708534798, 704493460, 462940703); + TestUtils.AreEqual(r0, a0--); + + uint2x2 a1 = uint2x2(2060593573, 940247280, 1818778351, 1015253889); + uint2x2 r1 = uint2x2(2060593573, 940247280, 1818778351, 1015253889); + TestUtils.AreEqual(r1, a1--); + + uint2x2 a2 = uint2x2(862428933, 2080259851, 653673271, 140452688); + uint2x2 r2 = uint2x2(862428933, 2080259851, 653673271, 140452688); + TestUtils.AreEqual(r2, a2--); + + uint2x2 a3 = uint2x2(1928164223, 1174531383, 634036198, 993137684); + uint2x2 r3 = uint2x2(1928164223, 1174531383, 634036198, 993137684); + TestUtils.AreEqual(r3, a3--); + } + + [TestCompiler] + public static void uint2x2_operator_bitwise_and_wide_wide() + { + uint2x2 a0 = uint2x2(1055241304, 859321394, 1088358961, 2090949513); + uint2x2 b0 = uint2x2(749698416, 748105424, 1842764797, 9990577); + uint2x2 r0 = uint2x2(749024336, 537928720, 1087769137, 8409473); + TestUtils.AreEqual(r0, a0 & b0); + + uint2x2 a1 = uint2x2(300561740, 651904515, 1331035868, 2012752753); + uint2x2 b1 = uint2x2(1989102105, 1666634755, 58116798, 868036607); + uint2x2 r1 = uint2x2(277479432, 575816707, 55888540, 867707761); + TestUtils.AreEqual(r1, a1 & b1); + + uint2x2 a2 = uint2x2(1298126656, 53199569, 1752363533, 1303061302); + uint2x2 b2 = uint2x2(1420638875, 1308767169, 564040763, 478617502); + uint2x2 r2 = uint2x2(1141707264, 33686209, 538087433, 209912598); + TestUtils.AreEqual(r2, a2 & b2); + + uint2x2 a3 = uint2x2(1929998247, 1504941434, 470682792, 713577376); + uint2x2 b3 = uint2x2(806150474, 674015378, 1505309955, 36064977); + uint2x2 r3 = uint2x2(805855490, 136347666, 403178496, 33571456); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void uint2x2_operator_bitwise_and_wide_scalar() + { + uint2x2 a0 = uint2x2(1513158868, 284695609, 734595037, 1566510707); + uint b0 = (1173647397); + uint2x2 r0 = uint2x2(1076916228, 15732769, 29360133, 1163132961); + TestUtils.AreEqual(r0, a0 & b0); + + uint2x2 a1 = uint2x2(1601252476, 314333543, 430856908, 753481263); + uint b1 = (84213838); + uint2x2 r1 = uint2x2(83951692, 262214, 17039436, 67174414); + TestUtils.AreEqual(r1, a1 & b1); + + uint2x2 a2 = uint2x2(327392481, 2143619546, 1873208293, 126982769); + uint b2 = (1619794917); + uint2x2 r2 = uint2x2(8394977, 1619265984, 1619264485, 8395361); + TestUtils.AreEqual(r2, a2 & b2); + + uint2x2 a3 = uint2x2(651482651, 1689107088, 1368301071, 366962092); + uint b3 = (1383096952); + uint2x2 r3 = uint2x2(38814232, 1075847696, 1342177800, 273702952); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void uint2x2_operator_bitwise_and_scalar_wide() + { + uint a0 = (477163326); + uint2x2 b0 = uint2x2(110453385, 703240362, 2075630560, 1884904031); + uint2x2 r0 = uint2x2(68182536, 140544042, 405834528, 273697310); + TestUtils.AreEqual(r0, a0 & b0); + + uint a1 = (1734899436); + uint2x2 b1 = uint2x2(947945203, 1664399051, 458879298, 158491426); + uint2x2 r1 = uint2x2(536901344, 1663055560, 55078976, 23093792); + TestUtils.AreEqual(r1, a1 & b1); + + uint a2 = (79772356); + uint2x2 b2 = uint2x2(2054527944, 202228212, 359225061, 639811396); + uint2x2 r2 = uint2x2(4266688, 67174596, 71373508, 67123780); + TestUtils.AreEqual(r2, a2 & b2); + + uint a3 = (1821945318); + uint2x2 b3 = uint2x2(1821303024, 2030124055, 1985961756, 579780373); + uint2x2 r3 = uint2x2(1820893408, 1744841734, 1679297796, 545828100); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void uint2x2_operator_bitwise_or_wide_wide() + { + uint2x2 a0 = uint2x2(1920951869, 1750772852, 1420019191, 732977093); + uint2x2 b0 = uint2x2(214585254, 275414367, 858759675, 190211455); + uint2x2 r0 = uint2x2(2130669503, 2021326207, 2008016383, 737572863); + TestUtils.AreEqual(r0, a0 | b0); + + uint2x2 a1 = uint2x2(1169579447, 229437930, 1966721348, 2039812323); + uint2x2 b1 = uint2x2(1218691723, 2129565457, 1862809466, 495728846); + uint2x2 r1 = uint2x2(1303895999, 2146367483, 2134507390, 2107455727); + TestUtils.AreEqual(r1, a1 | b1); + + uint2x2 a2 = uint2x2(113550869, 1912038362, 1569990624, 1490718227); + uint2x2 b2 = uint2x2(868064152, 1756913766, 933656055, 247722084); + uint2x2 r2 = uint2x2(939376541, 2046780414, 2142664695, 1591475831); + TestUtils.AreEqual(r2, a2 | b2); + + uint2x2 a3 = uint2x2(1686257697, 2137727522, 1569900650, 856504729); + uint2x2 b3 = uint2x2(1884195075, 1804207631, 1913174711, 1815920856); + uint2x2 r3 = uint2x2(1959708963, 2146117167, 2140863231, 2134768089); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void uint2x2_operator_bitwise_or_wide_scalar() + { + uint2x2 a0 = uint2x2(1295304853, 1307252624, 350194630, 1128063578); + uint b0 = (1305527136); + uint2x2 r0 = uint2x2(1307888629, 1308350448, 1574947814, 1341973370); + TestUtils.AreEqual(r0, a0 | b0); + + uint2x2 a1 = uint2x2(1774824542, 1988423804, 999162350, 2110327307); + uint b1 = (2085245467); + uint2x2 r1 = uint2x2(2110520927, 2127491711, 2144228351, 2110478875); + TestUtils.AreEqual(r1, a1 | b1); + + uint2x2 a2 = uint2x2(1050875188, 1317039676, 228656898, 41280811); + uint b2 = (341855232); + uint2x2 r2 = uint2x2(1055087924, 1591766588, 501305090, 376827179); + TestUtils.AreEqual(r2, a2 | b2); + + uint2x2 a3 = uint2x2(1536908787, 1739461580, 2040936581, 1350320187); + uint b3 = (606786773); + uint2x2 r3 = uint2x2(2143018487, 1739511773, 2108619989, 1954469119); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void uint2x2_operator_bitwise_or_scalar_wide() + { + uint a0 = (1768627592); + uint2x2 b0 = uint2x2(1849658052, 1759912154, 729979455, 975926310); + uint2x2 r0 = uint2x2(1870634956, 1777286618, 1810603967, 2070642094); + TestUtils.AreEqual(r0, a0 | b0); + + uint a1 = (1987690876); + uint2x2 b1 = uint2x2(1809506714, 1160695341, 408963395, 314072711); + uint2x2 r1 = uint2x2(2147213822, 2004864893, 2121910655, 1996087295); + TestUtils.AreEqual(r1, a1 | b1); + + uint a2 = (1560007537); + uint2x2 b2 = uint2x2(1709003416, 977086639, 1448375596, 1689568808); + uint2x2 r2 = uint2x2(2113917945, 2130705407, 1593833341, 2097141625); + TestUtils.AreEqual(r2, a2 | b2); + + uint a3 = (595543345); + uint2x2 b3 = uint2x2(559778387, 621080913, 438994183, 1742637145); + uint2x2 r3 = uint2x2(595578739, 662697329, 998229303, 1744817529); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void uint2x2_operator_bitwise_xor_wide_wide() + { + uint2x2 a0 = uint2x2(1843655608, 362425681, 640805534, 1342040268); + uint2x2 b0 = uint2x2(1422803441, 1234691140, 119589253, 1101464929); + uint2x2 r0 = uint2x2(959296073, 1544407317, 554771227, 240840109); + TestUtils.AreEqual(r0, a0 ^ b0); + + uint2x2 a1 = uint2x2(945678755, 980321850, 390165019, 1682422658); + uint2x2 b1 = uint2x2(121896337, 1880109018, 1000210266, 1718938232); + uint2x2 r1 = uint2x2(1058935858, 1249815008, 752651585, 36917754); + TestUtils.AreEqual(r1, a1 ^ b1); + + uint2x2 a2 = uint2x2(303897251, 230477768, 1103646442, 1503102919); + uint2x2 b2 = uint2x2(464406940, 884337881, 34199854, 1430659227); + uint2x2 r2 = uint2x2(162747199, 956900113, 1136760772, 215066460); + TestUtils.AreEqual(r2, a2 ^ b2); + + uint2x2 a3 = uint2x2(26631152, 1016475570, 1862440929, 379588576); + uint2x2 b3 = uint2x2(126415540, 1069919967, 1810763253, 2082802224); + uint2x2 r3 = uint2x2(102672708, 55804269, 82614804, 1787102672); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void uint2x2_operator_bitwise_xor_wide_scalar() + { + uint2x2 a0 = uint2x2(169345668, 176087064, 2084362901, 1663924004); + uint b0 = (354464228); + uint2x2 r0 = uint2x2(523809632, 526275068, 1763470193, 1980614336); + TestUtils.AreEqual(r0, a0 ^ b0); + + uint2x2 a1 = uint2x2(193851255, 905336222, 863800783, 365003873); + uint b1 = (517476661); + uint2x2 r1 = uint2x2(357957186, 724452523, 765762810, 186226004); + TestUtils.AreEqual(r1, a1 ^ b1); + + uint2x2 a2 = uint2x2(835837496, 1464576786, 625604047, 1700827127); + uint b2 = (954341348); + uint2x2 r2 = uint2x2(154388956, 1873394934, 497803819, 1568839699); + TestUtils.AreEqual(r2, a2 ^ b2); + + uint2x2 a3 = uint2x2(2003392824, 1077374714, 1043379893, 1991576049); + uint b3 = (1481813598); + uint2x2 r3 = uint2x2(792459110, 409321636, 1717704939, 786933679); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void uint2x2_operator_bitwise_xor_scalar_wide() + { + uint a0 = (1361775641); + uint2x2 b0 = uint2x2(1452773578, 459050892, 1986218254, 1689037698); + uint2x2 r0 = uint2x2(129801427, 1249346453, 659047703, 898082715); + TestUtils.AreEqual(r0, a0 ^ b0); + + uint a1 = (999278344); + uint2x2 b1 = uint2x2(1229114508, 1087843538, 733699740, 106187872); + uint2x2 r1 = uint2x2(1926040452, 2069425114, 271882644, 1037798248); + TestUtils.AreEqual(r1, a1 ^ b1); + + uint a2 = (1533632738); + uint2x2 b2 = uint2x2(1107817672, 492506236, 597602329, 1439603382); + uint2x2 r2 = uint2x2(426677290, 1177709726, 2029506811, 245889620); + TestUtils.AreEqual(r2, a2 ^ b2); + + uint a3 = (1001169118); + uint2x2 b3 = uint2x2(1231718216, 1693179077, 1050897427, 1796435561); + uint2x2 r3 = uint2x2(1925588886, 1598520347, 84921549, 1354747575); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void uint2x2_operator_left_shift() + { + uint2x2 a0 = uint2x2(1129100049, 829482269, 1571297368, 443753193); + int b0 = (218351941); + uint2x2 r0 = uint2x2(1771463200, 773628832, 3036875520, 1315200288); + TestUtils.AreEqual(r0, a0 << b0); + + uint2x2 a1 = uint2x2(1872142968, 892627436, 980302862, 62369727); + int b1 = (249554593); + uint2x2 r1 = uint2x2(3744285936, 1785254872, 1960605724, 124739454); + TestUtils.AreEqual(r1, a1 << b1); + + uint2x2 a2 = uint2x2(849916599, 108441902, 1959056531, 1779118882); + int b2 = (1271350845); + uint2x2 r2 = uint2x2(3758096384, 3221225472, 1610612736, 1073741824); + TestUtils.AreEqual(r2, a2 << b2); + + uint2x2 a3 = uint2x2(1451674188, 1149883636, 1380536034, 186532735); + int b3 = (2082026915); + uint2x2 r3 = uint2x2(3023458912, 609134496, 2454353680, 1492261880); + TestUtils.AreEqual(r3, a3 << b3); + } + + [TestCompiler] + public static void uint2x2_operator_right_shift() + { + uint2x2 a0 = uint2x2(809126085, 908563670, 763568837, 1986717290); + int b0 = (994800051); + uint2x2 r0 = uint2x2(1543, 1732, 1456, 3789); + TestUtils.AreEqual(r0, a0 >> b0); + + uint2x2 a1 = uint2x2(1174507510, 1242726074, 390811632, 1521420393); + int b1 = (646821842); + uint2x2 r1 = uint2x2(4480, 4740, 1490, 5803); + TestUtils.AreEqual(r1, a1 >> b1); + + uint2x2 a2 = uint2x2(1923166649, 400863878, 667378673, 1611921244); + int b2 = (102096936); + uint2x2 r2 = uint2x2(7512369, 1565874, 2606947, 6296567); + TestUtils.AreEqual(r2, a2 >> b2); + + uint2x2 a3 = uint2x2(307750782, 2014389412, 1673938174, 1075916177); + int b3 = (479442287); + uint2x2 r3 = uint2x2(9391, 61474, 51084, 32834); + TestUtils.AreEqual(r3, a3 >> b3); + } + + [TestCompiler] + public static void uint2x2_operator_bitwise_not() + { + uint2x2 a0 = uint2x2(111796841, 603562399, 745091931, 853183268); + uint2x2 r0 = uint2x2(4183170454, 3691404896, 3549875364, 3441784027); + TestUtils.AreEqual(r0, ~a0); + + uint2x2 a1 = uint2x2(1110916612, 1891338755, 1506860135, 771210628); + uint2x2 r1 = uint2x2(3184050683, 2403628540, 2788107160, 3523756667); + TestUtils.AreEqual(r1, ~a1); + + uint2x2 a2 = uint2x2(787710759, 96456785, 916013379, 203444882); + uint2x2 r2 = uint2x2(3507256536, 4198510510, 3378953916, 4091522413); + TestUtils.AreEqual(r2, ~a2); + + uint2x2 a3 = uint2x2(1172294211, 683852713, 375158799, 881353367); + uint2x2 r3 = uint2x2(3122673084, 3611114582, 3919808496, 3413613928); + TestUtils.AreEqual(r3, ~a3); + } + + [TestCase /* For player builds */] + public static void uint2x2_EqualsObjectOverride() + { + TestUtils.IsFalse(new uint2x2().Equals((object)new int())); + TestUtils.IsTrue(new uint2x2().Equals((object)new uint2x2())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestUint2x2.gen.cs.meta b/src/Tests/Tests/Shared/TestUint2x2.gen.cs.meta new file mode 100644 index 00000000..998b402a --- /dev/null +++ b/src/Tests/Tests/Shared/TestUint2x2.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 103b5058df216b7488fb5bf96d18666e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestUint2x3.gen.cs b/src/Tests/Tests/Shared/TestUint2x3.gen.cs new file mode 100644 index 00000000..ac053495 --- /dev/null +++ b/src/Tests/Tests/Shared/TestUint2x3.gen.cs @@ -0,0 +1,1234 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestUint2x3 + { + [TestCompiler] + public static void uint2x3_zero() + { + TestUtils.AreEqual(0u, uint2x3.zero.c0.x); + TestUtils.AreEqual(0u, uint2x3.zero.c0.y); + TestUtils.AreEqual(0u, uint2x3.zero.c1.x); + TestUtils.AreEqual(0u, uint2x3.zero.c1.y); + TestUtils.AreEqual(0u, uint2x3.zero.c2.x); + TestUtils.AreEqual(0u, uint2x3.zero.c2.y); + } + + [TestCompiler] + public static void uint2x3_operator_equal_wide_wide() + { + uint2x3 a0 = uint2x3(2105871082, 35218899, 1550755093, 764676020, 606743782, 1208156098); + uint2x3 b0 = uint2x3(1477587886, 579629692, 540974792, 208405066, 2063397938, 1060167409); + bool2x3 r0 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + uint2x3 a1 = uint2x3(1023640014, 1038468316, 1416064367, 727143393, 2061243891, 184669837); + uint2x3 b1 = uint2x3(362592601, 2097545362, 277670088, 426944490, 901076223, 857900673); + bool2x3 r1 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + uint2x3 a2 = uint2x3(1303661760, 2044073738, 370395888, 1822916805, 1076983135, 345215866); + uint2x3 b2 = uint2x3(1548779757, 325265488, 312658571, 176373760, 2052378097, 858156597); + bool2x3 r2 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + uint2x3 a3 = uint2x3(833676277, 1987782708, 1481088614, 1364754268, 93639636, 1850596922); + uint2x3 b3 = uint2x3(982817797, 1252095508, 882634538, 1959142806, 72495800, 1077678183); + bool2x3 r3 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void uint2x3_operator_equal_wide_scalar() + { + uint2x3 a0 = uint2x3(437822262, 2020661134, 541786900, 853113810, 23716499, 179951405); + uint b0 = (1332833578); + bool2x3 r0 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + uint2x3 a1 = uint2x3(1409026299, 953202998, 691955848, 1926262965, 1851546137, 712957637); + uint b1 = (948838849); + bool2x3 r1 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + uint2x3 a2 = uint2x3(2028784869, 1836975611, 1016802970, 390120467, 464814777, 1451642042); + uint b2 = (1049962241); + bool2x3 r2 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + uint2x3 a3 = uint2x3(289137869, 808355440, 660053867, 597354173, 67320270, 151461188); + uint b3 = (152339338); + bool2x3 r3 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void uint2x3_operator_equal_scalar_wide() + { + uint a0 = (542329200); + uint2x3 b0 = uint2x3(1115584594, 684107773, 1928988941, 890709324, 641152437, 1410341302); + bool2x3 r0 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + uint a1 = (497505660); + uint2x3 b1 = uint2x3(1068223109, 2014009435, 213835595, 1592428361, 1819361470, 448650623); + bool2x3 r1 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + uint a2 = (1942175642); + uint2x3 b2 = uint2x3(64377057, 1485938610, 1146305380, 1312317120, 263290348, 812663708); + bool2x3 r2 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + uint a3 = (1585209188); + uint2x3 b3 = uint2x3(40646617, 1378718922, 1957797737, 873652576, 1780082094, 1513270921); + bool2x3 r3 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void uint2x3_operator_not_equal_wide_wide() + { + uint2x3 a0 = uint2x3(1977284100, 1293292704, 1547283851, 422428953, 195833190, 1711544892); + uint2x3 b0 = uint2x3(1514195556, 957972049, 507667364, 581861672, 1128094576, 940096636); + bool2x3 r0 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + uint2x3 a1 = uint2x3(5606053, 737069074, 647386678, 13079405, 1413841590, 1076166545); + uint2x3 b1 = uint2x3(57559040, 181752616, 962017320, 1762015406, 1107218953, 2042026522); + bool2x3 r1 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + uint2x3 a2 = uint2x3(1211445174, 1289303469, 1436402489, 1129570126, 1566836685, 1343313905); + uint2x3 b2 = uint2x3(836002288, 570272309, 2112081980, 1500634658, 1787808345, 566425667); + bool2x3 r2 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + uint2x3 a3 = uint2x3(329259205, 1774944480, 33906739, 2055853627, 2035015372, 1702756001); + uint2x3 b3 = uint2x3(2037529609, 1520589840, 266793699, 538816359, 2075474643, 553571317); + bool2x3 r3 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void uint2x3_operator_not_equal_wide_scalar() + { + uint2x3 a0 = uint2x3(1038269360, 1427812625, 103361237, 1347017023, 1523584313, 150442802); + uint b0 = (768873026); + bool2x3 r0 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + uint2x3 a1 = uint2x3(660334527, 262959423, 484398043, 506946952, 226568494, 507918242); + uint b1 = (719113717); + bool2x3 r1 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + uint2x3 a2 = uint2x3(1702162286, 166187260, 114581840, 1045389187, 1648095254, 1461803977); + uint b2 = (923269270); + bool2x3 r2 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + uint2x3 a3 = uint2x3(61801615, 2146927809, 1557151164, 1284033253, 1345705546, 1747302566); + uint b3 = (1317840133); + bool2x3 r3 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void uint2x3_operator_not_equal_scalar_wide() + { + uint a0 = (1652127596); + uint2x3 b0 = uint2x3(953791238, 271722683, 1278885987, 735128017, 112416504, 25967222); + bool2x3 r0 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + uint a1 = (1761444475); + uint2x3 b1 = uint2x3(1844594536, 1199122922, 634219279, 942501101, 67161343, 969944293); + bool2x3 r1 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + uint a2 = (833229499); + uint2x3 b2 = uint2x3(1304301133, 704045745, 345012334, 1253134152, 325772538, 855127202); + bool2x3 r2 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + uint a3 = (793668881); + uint2x3 b3 = uint2x3(1584481616, 1101301152, 276853534, 987168816, 1258105989, 362645228); + bool2x3 r3 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void uint2x3_operator_less_wide_wide() + { + uint2x3 a0 = uint2x3(1486550609, 1779244308, 1602148045, 1614085440, 1975613414, 942838342); + uint2x3 b0 = uint2x3(97842578, 536551311, 413528975, 1838293684, 1283898480, 1456599961); + bool2x3 r0 = bool2x3(false, false, false, true, false, true); + TestUtils.AreEqual(r0, a0 < b0); + + uint2x3 a1 = uint2x3(1092279031, 373677431, 1419098312, 337757077, 1081797900, 1336745069); + uint2x3 b1 = uint2x3(1080278602, 529676676, 156584048, 117348799, 246927124, 1916615924); + bool2x3 r1 = bool2x3(false, true, false, false, false, true); + TestUtils.AreEqual(r1, a1 < b1); + + uint2x3 a2 = uint2x3(840685445, 1220554047, 2013681746, 192965012, 532043965, 1000693402); + uint2x3 b2 = uint2x3(1731071394, 1328098431, 1014995792, 480319327, 1765937053, 1333997067); + bool2x3 r2 = bool2x3(true, true, false, true, true, true); + TestUtils.AreEqual(r2, a2 < b2); + + uint2x3 a3 = uint2x3(927236048, 1215860000, 780607596, 1882056852, 1354146545, 2135295778); + uint2x3 b3 = uint2x3(688515308, 1856106947, 1303906227, 646821776, 1169473993, 316770064); + bool2x3 r3 = bool2x3(false, true, true, false, false, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void uint2x3_operator_less_wide_scalar() + { + uint2x3 a0 = uint2x3(796797557, 670113454, 933579492, 278884514, 318174822, 1117630673); + uint b0 = (746564682); + bool2x3 r0 = bool2x3(false, true, false, true, true, false); + TestUtils.AreEqual(r0, a0 < b0); + + uint2x3 a1 = uint2x3(741886928, 1030849597, 1546212312, 1718582899, 1648393417, 1857132231); + uint b1 = (1990922600); + bool2x3 r1 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 < b1); + + uint2x3 a2 = uint2x3(1909506562, 952084157, 1303736668, 845460171, 979430272, 1368236640); + uint b2 = (1294006045); + bool2x3 r2 = bool2x3(false, true, false, true, true, false); + TestUtils.AreEqual(r2, a2 < b2); + + uint2x3 a3 = uint2x3(24980695, 659552739, 1058492383, 165694933, 1204097259, 922212691); + uint b3 = (1434668705); + bool2x3 r3 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void uint2x3_operator_less_scalar_wide() + { + uint a0 = (186400299); + uint2x3 b0 = uint2x3(1881344229, 813834467, 1254886626, 1353590345, 1412343685, 1555571443); + bool2x3 r0 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 < b0); + + uint a1 = (1540508298); + uint2x3 b1 = uint2x3(1735458634, 135888070, 1643818742, 248291654, 1739560105, 728539891); + bool2x3 r1 = bool2x3(true, false, true, false, true, false); + TestUtils.AreEqual(r1, a1 < b1); + + uint a2 = (480507742); + uint2x3 b2 = uint2x3(1696553040, 540223931, 1840493353, 146833656, 798115946, 2002002066); + bool2x3 r2 = bool2x3(true, true, true, false, true, true); + TestUtils.AreEqual(r2, a2 < b2); + + uint a3 = (1011261705); + uint2x3 b3 = uint2x3(783550942, 1093071215, 598253401, 1432416562, 1863582169, 103622950); + bool2x3 r3 = bool2x3(false, true, false, true, true, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void uint2x3_operator_greater_wide_wide() + { + uint2x3 a0 = uint2x3(2087717754, 1725569452, 1298066182, 1693943616, 1319019629, 70674491); + uint2x3 b0 = uint2x3(85148514, 293632137, 1151128249, 409440398, 1115020183, 1508500597); + bool2x3 r0 = bool2x3(true, true, true, true, true, false); + TestUtils.AreEqual(r0, a0 > b0); + + uint2x3 a1 = uint2x3(1042499725, 1002821508, 1021857133, 1744374599, 821751047, 467646903); + uint2x3 b1 = uint2x3(1834583302, 1755218534, 1788761753, 1128238489, 834223713, 1578743290); + bool2x3 r1 = bool2x3(false, false, false, true, false, false); + TestUtils.AreEqual(r1, a1 > b1); + + uint2x3 a2 = uint2x3(2029731638, 1377214212, 1207816926, 474621063, 20781266, 366593779); + uint2x3 b2 = uint2x3(1647150256, 1756397855, 1131080201, 1208965204, 1495161099, 1283714281); + bool2x3 r2 = bool2x3(true, false, true, false, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + uint2x3 a3 = uint2x3(2068457387, 10181449, 793634464, 144474612, 99947390, 930377263); + uint2x3 b3 = uint2x3(908051907, 412849651, 815822687, 730271942, 40756039, 883326140); + bool2x3 r3 = bool2x3(true, false, false, false, true, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void uint2x3_operator_greater_wide_scalar() + { + uint2x3 a0 = uint2x3(1208626274, 239697208, 1979453345, 1253474001, 1590192876, 1487911635); + uint b0 = (1715176566); + bool2x3 r0 = bool2x3(false, false, true, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + uint2x3 a1 = uint2x3(1673945595, 222749855, 1433540517, 566635217, 1773305960, 1850273578); + uint b1 = (1662650098); + bool2x3 r1 = bool2x3(true, false, false, false, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + uint2x3 a2 = uint2x3(206147145, 333381537, 1905567362, 2053577491, 570397194, 2128431130); + uint b2 = (325913453); + bool2x3 r2 = bool2x3(false, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 > b2); + + uint2x3 a3 = uint2x3(1735325311, 1663525234, 1972984241, 1587865063, 488268523, 121921923); + uint b3 = (529971908); + bool2x3 r3 = bool2x3(true, true, true, true, false, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void uint2x3_operator_greater_scalar_wide() + { + uint a0 = (480938827); + uint2x3 b0 = uint2x3(1824731899, 921496110, 586859044, 946430596, 1231356727, 1390167458); + bool2x3 r0 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + uint a1 = (1785807092); + uint2x3 b1 = uint2x3(28949024, 2037899283, 595656760, 1778095771, 1233500439, 1696302238); + bool2x3 r1 = bool2x3(true, false, true, true, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + uint a2 = (1445965340); + uint2x3 b2 = uint2x3(484020151, 1586962841, 1361740714, 265628948, 2003122957, 332267433); + bool2x3 r2 = bool2x3(true, false, true, true, false, true); + TestUtils.AreEqual(r2, a2 > b2); + + uint a3 = (1128353075); + uint2x3 b3 = uint2x3(377919478, 982113135, 1117675960, 630865591, 1550679736, 895945757); + bool2x3 r3 = bool2x3(true, true, true, true, false, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void uint2x3_operator_less_equal_wide_wide() + { + uint2x3 a0 = uint2x3(154092149, 1515170149, 1083970332, 785807178, 1401094881, 310537627); + uint2x3 b0 = uint2x3(77984380, 1712054191, 1566203809, 254834519, 450519938, 389457083); + bool2x3 r0 = bool2x3(false, true, true, false, false, true); + TestUtils.AreEqual(r0, a0 <= b0); + + uint2x3 a1 = uint2x3(868328962, 1990816725, 2035349541, 457043352, 1123282035, 1001842946); + uint2x3 b1 = uint2x3(1298669505, 207343167, 1214449047, 2059561026, 896534357, 1897470050); + bool2x3 r1 = bool2x3(true, false, false, true, false, true); + TestUtils.AreEqual(r1, a1 <= b1); + + uint2x3 a2 = uint2x3(1387761992, 195272789, 659549000, 888761458, 283706617, 1790185840); + uint2x3 b2 = uint2x3(521075677, 1848221945, 374708019, 1573731118, 2093466449, 1660210829); + bool2x3 r2 = bool2x3(false, true, false, true, true, false); + TestUtils.AreEqual(r2, a2 <= b2); + + uint2x3 a3 = uint2x3(899029812, 848317418, 1743712447, 1504407474, 1798441490, 1902791952); + uint2x3 b3 = uint2x3(1568778785, 1352157589, 1212771905, 1457525058, 1493446008, 1784768208); + bool2x3 r3 = bool2x3(true, true, false, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void uint2x3_operator_less_equal_wide_scalar() + { + uint2x3 a0 = uint2x3(1479531977, 1427983411, 415250630, 1245345407, 1112546666, 1072990632); + uint b0 = (2004563877); + bool2x3 r0 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + uint2x3 a1 = uint2x3(1579912858, 1070894375, 509818792, 1910488590, 85452501, 518127023); + uint b1 = (101048307); + bool2x3 r1 = bool2x3(false, false, false, false, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + uint2x3 a2 = uint2x3(1246249980, 1964410699, 1968139888, 1191853379, 662096238, 1140643434); + uint b2 = (1097326500); + bool2x3 r2 = bool2x3(false, false, false, false, true, false); + TestUtils.AreEqual(r2, a2 <= b2); + + uint2x3 a3 = uint2x3(754434551, 995927387, 974873240, 1773400038, 497436329, 1825940497); + uint b3 = (155343473); + bool2x3 r3 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void uint2x3_operator_less_equal_scalar_wide() + { + uint a0 = (1899193992); + uint2x3 b0 = uint2x3(915011820, 980913757, 1337699683, 1476321359, 1102143668, 660493983); + bool2x3 r0 = bool2x3(false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 <= b0); + + uint a1 = (184664508); + uint2x3 b1 = uint2x3(381579707, 1954892821, 1295090571, 1440368586, 1696003686, 88708652); + bool2x3 r1 = bool2x3(true, true, true, true, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + uint a2 = (1332251857); + uint2x3 b2 = uint2x3(1310713644, 2112132784, 48951945, 1888568027, 39340955, 1108242207); + bool2x3 r2 = bool2x3(false, true, false, true, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + uint a3 = (260777425); + uint2x3 b3 = uint2x3(593122164, 291471959, 253457314, 1264570386, 699618012, 927735863); + bool2x3 r3 = bool2x3(true, true, false, true, true, true); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void uint2x3_operator_greater_equal_wide_wide() + { + uint2x3 a0 = uint2x3(8538378, 2131749726, 265427108, 523609761, 994991818, 839709564); + uint2x3 b0 = uint2x3(903145828, 1697992986, 1432491982, 169789504, 1059357300, 1744255222); + bool2x3 r0 = bool2x3(false, true, false, true, false, false); + TestUtils.AreEqual(r0, a0 >= b0); + + uint2x3 a1 = uint2x3(101288202, 1886280970, 2032074826, 631221455, 1456286159, 961342752); + uint2x3 b1 = uint2x3(1606584463, 1905414425, 1448794969, 136181998, 1678754836, 2069656857); + bool2x3 r1 = bool2x3(false, false, true, true, false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + uint2x3 a2 = uint2x3(424526026, 788481984, 1662488497, 870326690, 708712581, 1260182701); + uint2x3 b2 = uint2x3(398982689, 243317404, 740939613, 1894753119, 301760792, 1260647988); + bool2x3 r2 = bool2x3(true, true, true, false, true, false); + TestUtils.AreEqual(r2, a2 >= b2); + + uint2x3 a3 = uint2x3(1165630721, 138247561, 1108650168, 1933222913, 672493999, 1541402159); + uint2x3 b3 = uint2x3(3608523, 52576030, 903420465, 1648820371, 627296845, 1679808907); + bool2x3 r3 = bool2x3(true, true, true, true, true, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void uint2x3_operator_greater_equal_wide_scalar() + { + uint2x3 a0 = uint2x3(2049236663, 182691143, 634973382, 1197012109, 439837565, 1367606469); + uint b0 = (1061998015); + bool2x3 r0 = bool2x3(true, false, false, true, false, true); + TestUtils.AreEqual(r0, a0 >= b0); + + uint2x3 a1 = uint2x3(1108037359, 1898505669, 411667685, 1998610091, 4652390, 996159180); + uint b1 = (351147187); + bool2x3 r1 = bool2x3(true, true, true, true, false, true); + TestUtils.AreEqual(r1, a1 >= b1); + + uint2x3 a2 = uint2x3(2111455181, 96217144, 814085575, 1525995206, 1293933760, 1732973229); + uint b2 = (727766399); + bool2x3 r2 = bool2x3(true, false, true, true, true, true); + TestUtils.AreEqual(r2, a2 >= b2); + + uint2x3 a3 = uint2x3(1473283041, 1023753195, 1373738074, 518164359, 717850464, 1765188600); + uint b3 = (899444524); + bool2x3 r3 = bool2x3(true, true, true, false, false, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void uint2x3_operator_greater_equal_scalar_wide() + { + uint a0 = (1859811087); + uint2x3 b0 = uint2x3(1070365918, 1783869452, 830091760, 377157428, 327199016, 90384229); + bool2x3 r0 = bool2x3(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + uint a1 = (1154649706); + uint2x3 b1 = uint2x3(376758501, 1079802834, 2054742898, 1328349472, 434061447, 951207723); + bool2x3 r1 = bool2x3(true, true, false, false, true, true); + TestUtils.AreEqual(r1, a1 >= b1); + + uint a2 = (598695892); + uint2x3 b2 = uint2x3(975131651, 1714007943, 177416473, 1267232721, 31082860, 216791741); + bool2x3 r2 = bool2x3(false, false, true, false, true, true); + TestUtils.AreEqual(r2, a2 >= b2); + + uint a3 = (119054289); + uint2x3 b3 = uint2x3(1905107583, 89559116, 55041824, 691334141, 462326883, 1658303669); + bool2x3 r3 = bool2x3(false, true, true, false, false, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void uint2x3_operator_add_wide_wide() + { + uint2x3 a0 = uint2x3(2135171378, 21433296, 1954723494, 683604307, 1054212315, 1762680995); + uint2x3 b0 = uint2x3(1013431952, 366718162, 359290756, 1393163294, 1962236872, 1263270041); + uint2x3 r0 = uint2x3(3148603330, 388151458, 2314014250, 2076767601, 3016449187, 3025951036); + TestUtils.AreEqual(r0, a0 + b0); + + uint2x3 a1 = uint2x3(1963655852, 1257853062, 2043493600, 976898058, 1915056423, 121374462); + uint2x3 b1 = uint2x3(1862666629, 1077447887, 821693806, 487316539, 350922520, 1583012528); + uint2x3 r1 = uint2x3(3826322481, 2335300949, 2865187406, 1464214597, 2265978943, 1704386990); + TestUtils.AreEqual(r1, a1 + b1); + + uint2x3 a2 = uint2x3(1218855698, 700538222, 1702057277, 1788251699, 1534939160, 398651016); + uint2x3 b2 = uint2x3(1951595076, 1024851344, 874302782, 1383969588, 1767968088, 900721406); + uint2x3 r2 = uint2x3(3170450774, 1725389566, 2576360059, 3172221287, 3302907248, 1299372422); + TestUtils.AreEqual(r2, a2 + b2); + + uint2x3 a3 = uint2x3(1674272498, 374510467, 824322986, 1217622199, 1122376670, 642613771); + uint2x3 b3 = uint2x3(1659790033, 1792273749, 443844328, 633981449, 2010244807, 335566991); + uint2x3 r3 = uint2x3(3334062531, 2166784216, 1268167314, 1851603648, 3132621477, 978180762); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void uint2x3_operator_add_wide_scalar() + { + uint2x3 a0 = uint2x3(665815972, 1783729250, 1591678394, 1284528538, 977850224, 71069732); + uint b0 = (1334043849); + uint2x3 r0 = uint2x3(1999859821, 3117773099, 2925722243, 2618572387, 2311894073, 1405113581); + TestUtils.AreEqual(r0, a0 + b0); + + uint2x3 a1 = uint2x3(1138577680, 565982008, 1246759684, 1088001167, 57252642, 678921480); + uint b1 = (1200356017); + uint2x3 r1 = uint2x3(2338933697, 1766338025, 2447115701, 2288357184, 1257608659, 1879277497); + TestUtils.AreEqual(r1, a1 + b1); + + uint2x3 a2 = uint2x3(625943813, 1470648741, 1490096953, 1467033531, 182608093, 1707296407); + uint b2 = (512157429); + uint2x3 r2 = uint2x3(1138101242, 1982806170, 2002254382, 1979190960, 694765522, 2219453836); + TestUtils.AreEqual(r2, a2 + b2); + + uint2x3 a3 = uint2x3(1703724354, 653973063, 1139546735, 1834005844, 184572739, 1980578280); + uint b3 = (1333833947); + uint2x3 r3 = uint2x3(3037558301, 1987807010, 2473380682, 3167839791, 1518406686, 3314412227); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void uint2x3_operator_add_scalar_wide() + { + uint a0 = (359966320); + uint2x3 b0 = uint2x3(2146146202, 767103309, 851002415, 311531406, 1491262941, 1016891373); + uint2x3 r0 = uint2x3(2506112522, 1127069629, 1210968735, 671497726, 1851229261, 1376857693); + TestUtils.AreEqual(r0, a0 + b0); + + uint a1 = (1954228994); + uint2x3 b1 = uint2x3(1671335850, 727870747, 551151834, 1390261152, 1699060326, 115021619); + uint2x3 r1 = uint2x3(3625564844, 2682099741, 2505380828, 3344490146, 3653289320, 2069250613); + TestUtils.AreEqual(r1, a1 + b1); + + uint a2 = (1964440175); + uint2x3 b2 = uint2x3(440700758, 1556692550, 185414255, 933106731, 1217866784, 729761881); + uint2x3 r2 = uint2x3(2405140933, 3521132725, 2149854430, 2897546906, 3182306959, 2694202056); + TestUtils.AreEqual(r2, a2 + b2); + + uint a3 = (1742597318); + uint2x3 b3 = uint2x3(1090109152, 1467373815, 1066072609, 138237856, 634834665, 993603553); + uint2x3 r3 = uint2x3(2832706470, 3209971133, 2808669927, 1880835174, 2377431983, 2736200871); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void uint2x3_operator_sub_wide_wide() + { + uint2x3 a0 = uint2x3(1410318491, 1097280168, 1827039044, 28881338, 328720965, 875487868); + uint2x3 b0 = uint2x3(1315897366, 799052018, 1580289673, 1094686261, 1954325726, 1197734816); + uint2x3 r0 = uint2x3(94421125, 298228150, 246749371, 3229162373, 2669362535, 3972720348); + TestUtils.AreEqual(r0, a0 - b0); + + uint2x3 a1 = uint2x3(212936325, 231977215, 1740021315, 2011295463, 48079003, 591379285); + uint2x3 b1 = uint2x3(229886366, 915679176, 1746884850, 918743925, 1007797419, 257421324); + uint2x3 r1 = uint2x3(4278017255, 3611265335, 4288103761, 1092551538, 3335248880, 333957961); + TestUtils.AreEqual(r1, a1 - b1); + + uint2x3 a2 = uint2x3(1125909359, 1842588095, 848561896, 614448464, 2067598029, 1618238416); + uint2x3 b2 = uint2x3(287249342, 1617287463, 1653916102, 123586847, 502107404, 672875302); + uint2x3 r2 = uint2x3(838660017, 225300632, 3489613090, 490861617, 1565490625, 945363114); + TestUtils.AreEqual(r2, a2 - b2); + + uint2x3 a3 = uint2x3(318516219, 1090119767, 1991095823, 949592162, 1951912339, 1457818751); + uint2x3 b3 = uint2x3(1256481116, 1975569142, 1794443030, 1327558915, 330955394, 1596041731); + uint2x3 r3 = uint2x3(3357002399, 3409517921, 196652793, 3917000543, 1620956945, 4156744316); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void uint2x3_operator_sub_wide_scalar() + { + uint2x3 a0 = uint2x3(1508669340, 1594795463, 266707545, 643102647, 287705008, 1475644328); + uint b0 = (998008471); + uint2x3 r0 = uint2x3(510660869, 596786992, 3563666370, 3940061472, 3584663833, 477635857); + TestUtils.AreEqual(r0, a0 - b0); + + uint2x3 a1 = uint2x3(1113286221, 2082174113, 1108005498, 304369206, 999244508, 1806482044); + uint b1 = (979450511); + uint2x3 r1 = uint2x3(133835710, 1102723602, 128554987, 3619885991, 19793997, 827031533); + TestUtils.AreEqual(r1, a1 - b1); + + uint2x3 a2 = uint2x3(1994553647, 1482736902, 266654115, 1470212363, 1190349300, 958542155); + uint b2 = (2101812429); + uint2x3 r2 = uint2x3(4187708514, 3675891769, 2459808982, 3663367230, 3383504167, 3151697022); + TestUtils.AreEqual(r2, a2 - b2); + + uint2x3 a3 = uint2x3(1185075537, 499527536, 1612473406, 1696960099, 1287292743, 1360229454); + uint b3 = (1738124835); + uint2x3 r3 = uint2x3(3741917998, 3056369997, 4169315867, 4253802560, 3844135204, 3917071915); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void uint2x3_operator_sub_scalar_wide() + { + uint a0 = (893369501); + uint2x3 b0 = uint2x3(2051906184, 1699714311, 442603706, 1735141684, 274533585, 811580259); + uint2x3 r0 = uint2x3(3136430613, 3488622486, 450765795, 3453195113, 618835916, 81789242); + TestUtils.AreEqual(r0, a0 - b0); + + uint a1 = (1196354320); + uint2x3 b1 = uint2x3(1524097023, 533621527, 2080845793, 143958837, 1620668660, 1135989346); + uint2x3 r1 = uint2x3(3967224593, 662732793, 3410475823, 1052395483, 3870652956, 60364974); + TestUtils.AreEqual(r1, a1 - b1); + + uint a2 = (1367044745); + uint2x3 b2 = uint2x3(554088609, 552670373, 1265516124, 1254902543, 1857695581, 1619865274); + uint2x3 r2 = uint2x3(812956136, 814374372, 101528621, 112142202, 3804316460, 4042146767); + TestUtils.AreEqual(r2, a2 - b2); + + uint a3 = (1313559400); + uint2x3 b3 = uint2x3(99812999, 843597298, 420111239, 1299949060, 531009038, 1103306550); + uint2x3 r3 = uint2x3(1213746401, 469962102, 893448161, 13610340, 782550362, 210252850); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void uint2x3_operator_mul_wide_wide() + { + uint2x3 a0 = uint2x3(61417577, 219585476, 1362520891, 1511084277, 1481211272, 58211871); + uint2x3 b0 = uint2x3(578042444, 1620527213, 200516468, 309339115, 542853019, 299467282); + uint2x3 r0 = uint2x3(2868103468, 1326150260, 3304073148, 2972110823, 1973926232, 88546350); + TestUtils.AreEqual(r0, a0 * b0); + + uint2x3 a1 = uint2x3(1459591173, 567624644, 1169935583, 1835691886, 385626539, 85934842); + uint2x3 b1 = uint2x3(1479641221, 1428338601, 1497302909, 1596889147, 427413842, 265122693); + uint2x3 r1 = uint2x3(3431047833, 3712145508, 556671459, 1098186330, 1848083398, 4236646882); + TestUtils.AreEqual(r1, a1 * b1); + + uint2x3 a2 = uint2x3(522856538, 278370196, 289217012, 2083410174, 1293162798, 1939730122); + uint2x3 b2 = uint2x3(689376654, 1120457204, 516903000, 873091659, 1353196495, 1384773500); + uint2x3 r2 = uint2x3(2005201900, 651971856, 2573806560, 4184807018, 4175537714, 3758002136); + TestUtils.AreEqual(r2, a2 * b2); + + uint2x3 a3 = uint2x3(2075923048, 1116477212, 1686101741, 783310758, 248585944, 1093377716); + uint2x3 b3 = uint2x3(1596528529, 2122329305, 1033200564, 996795088, 1137754930, 232014195); + uint2x3 r3 = uint2x3(2245379304, 3535300284, 1443849636, 550781664, 3335949872, 3941859036); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void uint2x3_operator_mul_wide_scalar() + { + uint2x3 a0 = uint2x3(871746615, 492532311, 570557670, 2142306629, 1610315153, 1526163563); + uint b0 = (442064533); + uint2x3 r0 = uint2x3(338365955, 1081376419, 2565819870, 3279557417, 3421481829, 4119466055); + TestUtils.AreEqual(r0, a0 * b0); + + uint2x3 a1 = uint2x3(118471734, 364291059, 1186560810, 1584938026, 1357601203, 638897141); + uint b1 = (257439514); + uint2x3 r1 = uint2x3(4120426364, 172874670, 3569125444, 2442338884, 448041262, 3441842658); + TestUtils.AreEqual(r1, a1 * b1); + + uint2x3 a2 = uint2x3(268562104, 1163240135, 1619806399, 1444659979, 1127580168, 464517916); + uint b2 = (1007838321); + uint2x3 r2 = uint2x3(3138010936, 610309591, 1271183439, 624387035, 2516157832, 784123740); + TestUtils.AreEqual(r2, a2 * b2); + + uint2x3 a3 = uint2x3(1508043166, 636691139, 1851670006, 357357967, 1095280227, 702779195); + uint b3 = (745488654); + uint2x3 r3 = uint2x3(4215006372, 1705798058, 478992756, 2524067026, 757415018, 1348784186); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void uint2x3_operator_mul_scalar_wide() + { + uint a0 = (1152242766); + uint2x3 b0 = uint2x3(1276636134, 2105929407, 499007702, 124002565, 1956335172, 1288034953); + uint2x3 r0 = uint2x3(2165463060, 999811634, 1179056436, 3493540742, 404105400, 1339492798); + TestUtils.AreEqual(r0, a0 * b0); + + uint a1 = (832676555); + uint2x3 b1 = uint2x3(337389733, 99268757, 2005055247, 2011389505, 1348110859, 399689191); + uint2x3 r1 = uint2x3(3906053335, 3567495207, 2079172325, 2865880971, 4010896569, 4070972461); + TestUtils.AreEqual(r1, a1 * b1); + + uint a2 = (2007606374); + uint2x3 b2 = uint2x3(2076691289, 1825721194, 769885235, 153314735, 1066325369, 84289667); + uint2x3 r2 = uint2x3(3969976694, 588510268, 67262546, 3401949114, 4287337014, 2514686002); + TestUtils.AreEqual(r2, a2 * b2); + + uint a3 = (984486192); + uint2x3 b3 = uint2x3(1325213504, 1643957457, 1576395620, 2095980601, 907671947, 836919582); + uint2x3 r3 = uint2x3(3432160256, 3104720944, 673990336, 227005360, 4176151824, 826880928); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void uint2x3_operator_div_wide_wide() + { + uint2x3 a0 = uint2x3(333171510, 858154903, 1181365836, 671357749, 1090606752, 803759420); + uint2x3 b0 = uint2x3(698897823, 440199998, 655557473, 1658534285, 2127220100, 315653188); + uint2x3 r0 = uint2x3(0, 1, 1, 0, 0, 2); + TestUtils.AreEqual(r0, a0 / b0); + + uint2x3 a1 = uint2x3(788404166, 296807814, 575260195, 166625280, 1493729000, 1831739736); + uint2x3 b1 = uint2x3(1814290360, 992173243, 914851653, 664340325, 224323977, 246981573); + uint2x3 r1 = uint2x3(0, 0, 0, 0, 6, 7); + TestUtils.AreEqual(r1, a1 / b1); + + uint2x3 a2 = uint2x3(200852358, 129983172, 500176108, 472051781, 414699094, 1446535974); + uint2x3 b2 = uint2x3(285573983, 819471609, 2012476015, 1783179572, 223253978, 169515029); + uint2x3 r2 = uint2x3(0, 0, 0, 0, 1, 8); + TestUtils.AreEqual(r2, a2 / b2); + + uint2x3 a3 = uint2x3(1278480457, 930910505, 263295881, 1626759436, 450830871, 21439121); + uint2x3 b3 = uint2x3(1694929006, 1992168131, 1155972447, 1768506696, 422325410, 1508417406); + uint2x3 r3 = uint2x3(0, 0, 0, 0, 1, 0); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void uint2x3_operator_div_wide_scalar() + { + uint2x3 a0 = uint2x3(1433072926, 1073958635, 1195142312, 536596719, 1274375693, 464756346); + uint b0 = (1434025872); + uint2x3 r0 = uint2x3(0, 0, 0, 0, 0, 0); + TestUtils.AreEqual(r0, a0 / b0); + + uint2x3 a1 = uint2x3(806462546, 1380905136, 25493909, 1196815948, 123300377, 643754735); + uint b1 = (906504670); + uint2x3 r1 = uint2x3(0, 1, 0, 1, 0, 0); + TestUtils.AreEqual(r1, a1 / b1); + + uint2x3 a2 = uint2x3(2084019932, 458304263, 741331531, 466443901, 2110004616, 1500687214); + uint b2 = (2047825037); + uint2x3 r2 = uint2x3(1, 0, 0, 0, 1, 0); + TestUtils.AreEqual(r2, a2 / b2); + + uint2x3 a3 = uint2x3(1453264263, 2040203220, 2103351724, 485536709, 402141749, 1477264254); + uint b3 = (1617154145); + uint2x3 r3 = uint2x3(0, 1, 1, 0, 0, 0); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void uint2x3_operator_div_scalar_wide() + { + uint a0 = (519165704); + uint2x3 b0 = uint2x3(1295178177, 775214121, 467772046, 1156881598, 310396565, 759759959); + uint2x3 r0 = uint2x3(0, 0, 1, 0, 1, 0); + TestUtils.AreEqual(r0, a0 / b0); + + uint a1 = (243837702); + uint2x3 b1 = uint2x3(1616314235, 1053470225, 1320630160, 378773841, 4223608, 1971105754); + uint2x3 r1 = uint2x3(0, 0, 0, 0, 57, 0); + TestUtils.AreEqual(r1, a1 / b1); + + uint a2 = (2054406020); + uint2x3 b2 = uint2x3(219939614, 1603672651, 2006134295, 888535397, 1493077923, 615835131); + uint2x3 r2 = uint2x3(9, 1, 1, 2, 1, 3); + TestUtils.AreEqual(r2, a2 / b2); + + uint a3 = (1045603945); + uint2x3 b3 = uint2x3(452709946, 1074919059, 467037221, 1485241506, 1775728786, 481521341); + uint2x3 r3 = uint2x3(2, 0, 2, 0, 0, 2); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void uint2x3_operator_mod_wide_wide() + { + uint2x3 a0 = uint2x3(258342924, 1454754891, 723352342, 1981431473, 531756042, 716993627); + uint2x3 b0 = uint2x3(1990080167, 1197348066, 651970512, 1659454050, 241005212, 1866255454); + uint2x3 r0 = uint2x3(258342924, 257406825, 71381830, 321977423, 49745618, 716993627); + TestUtils.AreEqual(r0, a0 % b0); + + uint2x3 a1 = uint2x3(1667903349, 1331097004, 1776856101, 17598216, 1474345080, 1681376293); + uint2x3 b1 = uint2x3(1440101415, 595220963, 408818410, 198222574, 549504274, 239973807); + uint2x3 r1 = uint2x3(227801934, 140655078, 141582461, 17598216, 375336532, 1559644); + TestUtils.AreEqual(r1, a1 % b1); + + uint2x3 a2 = uint2x3(813624265, 1617478722, 498370451, 780075943, 1754430321, 653235398); + uint2x3 b2 = uint2x3(321398087, 658171840, 1511495237, 1048325585, 1126739824, 666641241); + uint2x3 r2 = uint2x3(170828091, 301135042, 498370451, 780075943, 627690497, 653235398); + TestUtils.AreEqual(r2, a2 % b2); + + uint2x3 a3 = uint2x3(1517128354, 966216200, 590067427, 1283434795, 1910903650, 1125967790); + uint2x3 b3 = uint2x3(38017598, 418797691, 618700513, 1941062990, 158556432, 1081063558); + uint2x3 r3 = uint2x3(34442032, 128620818, 590067427, 1283434795, 8226466, 44904232); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void uint2x3_operator_mod_wide_scalar() + { + uint2x3 a0 = uint2x3(560988938, 629524514, 767711194, 434281967, 1399805893, 792916846); + uint b0 = (1156862367); + uint2x3 r0 = uint2x3(560988938, 629524514, 767711194, 434281967, 242943526, 792916846); + TestUtils.AreEqual(r0, a0 % b0); + + uint2x3 a1 = uint2x3(1663690927, 1776636144, 1287035793, 1743722161, 475209785, 327476870); + uint b1 = (598661916); + uint2x3 r1 = uint2x3(466367095, 579312312, 89711961, 546398329, 475209785, 327476870); + TestUtils.AreEqual(r1, a1 % b1); + + uint2x3 a2 = uint2x3(1617696916, 477430114, 858399046, 712734431, 1506629323, 199829950); + uint b2 = (379853074); + uint2x3 r2 = uint2x3(98284620, 97577040, 98692898, 332881357, 367070101, 199829950); + TestUtils.AreEqual(r2, a2 % b2); + + uint2x3 a3 = uint2x3(362269020, 1351725413, 1549678101, 431765276, 1315833792, 1664893153); + uint b3 = (1986626876); + uint2x3 r3 = uint2x3(362269020, 1351725413, 1549678101, 431765276, 1315833792, 1664893153); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void uint2x3_operator_mod_scalar_wide() + { + uint a0 = (933347930); + uint2x3 b0 = uint2x3(549923387, 243114953, 1884274390, 1428033594, 655531454, 1622674954); + uint2x3 r0 = uint2x3(383424543, 204003071, 933347930, 933347930, 277816476, 933347930); + TestUtils.AreEqual(r0, a0 % b0); + + uint a1 = (1107563514); + uint2x3 b1 = uint2x3(1614111094, 914801920, 1432263179, 564431096, 1967013901, 1709750152); + uint2x3 r1 = uint2x3(1107563514, 192761594, 1107563514, 543132418, 1107563514, 1107563514); + TestUtils.AreEqual(r1, a1 % b1); + + uint a2 = (1080102613); + uint2x3 b2 = uint2x3(13120773, 2042535998, 1505698002, 1640058084, 974167554, 758635306); + uint2x3 r2 = uint2x3(4199227, 1080102613, 1080102613, 1080102613, 105935059, 321467307); + TestUtils.AreEqual(r2, a2 % b2); + + uint a3 = (1387264978); + uint2x3 b3 = uint2x3(611743343, 1139002766, 1913935748, 1086810076, 991846486, 922870408); + uint2x3 r3 = uint2x3(163778292, 248262212, 1387264978, 300454902, 395418492, 464394570); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void uint2x3_operator_plus() + { + uint2x3 a0 = uint2x3(195392567, 222719748, 1002351013, 1570765263, 109389333, 1515950277); + uint2x3 r0 = uint2x3(195392567, 222719748, 1002351013, 1570765263, 109389333, 1515950277); + TestUtils.AreEqual(r0, +a0); + + uint2x3 a1 = uint2x3(1689763402, 264115671, 1084131995, 195779102, 2131702223, 715660442); + uint2x3 r1 = uint2x3(1689763402, 264115671, 1084131995, 195779102, 2131702223, 715660442); + TestUtils.AreEqual(r1, +a1); + + uint2x3 a2 = uint2x3(1995564647, 1317851903, 1957501908, 531426536, 2012985092, 1334133318); + uint2x3 r2 = uint2x3(1995564647, 1317851903, 1957501908, 531426536, 2012985092, 1334133318); + TestUtils.AreEqual(r2, +a2); + + uint2x3 a3 = uint2x3(1539671418, 1575048895, 2119066258, 781435471, 1659000230, 1301861249); + uint2x3 r3 = uint2x3(1539671418, 1575048895, 2119066258, 781435471, 1659000230, 1301861249); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void uint2x3_operator_neg() + { + uint2x3 a0 = uint2x3(1385088677, 94114564, 1350664872, 1458616659, 2067164853, 218122493); + uint2x3 r0 = uint2x3(2909878619, 4200852732, 2944302424, 2836350637, 2227802443, 4076844803); + TestUtils.AreEqual(r0, -a0); + + uint2x3 a1 = uint2x3(958484951, 446497525, 270503114, 1928771252, 1427605822, 2051940607); + uint2x3 r1 = uint2x3(3336482345, 3848469771, 4024464182, 2366196044, 2867361474, 2243026689); + TestUtils.AreEqual(r1, -a1); + + uint2x3 a2 = uint2x3(1434247484, 908365416, 1742096480, 990033169, 1368056141, 1350976157); + uint2x3 r2 = uint2x3(2860719812, 3386601880, 2552870816, 3304934127, 2926911155, 2943991139); + TestUtils.AreEqual(r2, -a2); + + uint2x3 a3 = uint2x3(12802586, 576597401, 785136322, 559205611, 1959833280, 162379661); + uint2x3 r3 = uint2x3(4282164710, 3718369895, 3509830974, 3735761685, 2335134016, 4132587635); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void uint2x3_operator_prefix_inc() + { + uint2x3 a0 = uint2x3(780471723, 954741756, 272723451, 2142862245, 606294309, 1514814550); + uint2x3 r0 = uint2x3(780471724, 954741757, 272723452, 2142862246, 606294310, 1514814551); + TestUtils.AreEqual(r0, ++a0); + + uint2x3 a1 = uint2x3(250124151, 1833356994, 1915989169, 1348278302, 129540735, 1584496757); + uint2x3 r1 = uint2x3(250124152, 1833356995, 1915989170, 1348278303, 129540736, 1584496758); + TestUtils.AreEqual(r1, ++a1); + + uint2x3 a2 = uint2x3(1170613526, 1701179230, 1397451003, 483952900, 1494652811, 1268688387); + uint2x3 r2 = uint2x3(1170613527, 1701179231, 1397451004, 483952901, 1494652812, 1268688388); + TestUtils.AreEqual(r2, ++a2); + + uint2x3 a3 = uint2x3(2014528731, 1112537171, 621362788, 2063486914, 1612870531, 1161037742); + uint2x3 r3 = uint2x3(2014528732, 1112537172, 621362789, 2063486915, 1612870532, 1161037743); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void uint2x3_operator_postfix_inc() + { + uint2x3 a0 = uint2x3(241865086, 2145821641, 1596166022, 803592338, 529551271, 1656767229); + uint2x3 r0 = uint2x3(241865086, 2145821641, 1596166022, 803592338, 529551271, 1656767229); + TestUtils.AreEqual(r0, a0++); + + uint2x3 a1 = uint2x3(903047443, 1425753247, 1384002775, 389844650, 1159795446, 1343289659); + uint2x3 r1 = uint2x3(903047443, 1425753247, 1384002775, 389844650, 1159795446, 1343289659); + TestUtils.AreEqual(r1, a1++); + + uint2x3 a2 = uint2x3(1227160199, 137930180, 451018043, 1634297552, 2009552507, 1176922170); + uint2x3 r2 = uint2x3(1227160199, 137930180, 451018043, 1634297552, 2009552507, 1176922170); + TestUtils.AreEqual(r2, a2++); + + uint2x3 a3 = uint2x3(388721494, 2062858295, 715101397, 1725384327, 446867079, 2101314783); + uint2x3 r3 = uint2x3(388721494, 2062858295, 715101397, 1725384327, 446867079, 2101314783); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void uint2x3_operator_prefix_dec() + { + uint2x3 a0 = uint2x3(1331961415, 1612382200, 1401591249, 2042075388, 1757136546, 1895858159); + uint2x3 r0 = uint2x3(1331961414, 1612382199, 1401591248, 2042075387, 1757136545, 1895858158); + TestUtils.AreEqual(r0, --a0); + + uint2x3 a1 = uint2x3(1467742422, 1336115745, 2059077641, 1169239112, 1862369220, 312317355); + uint2x3 r1 = uint2x3(1467742421, 1336115744, 2059077640, 1169239111, 1862369219, 312317354); + TestUtils.AreEqual(r1, --a1); + + uint2x3 a2 = uint2x3(1027543764, 1426262619, 1426620468, 674685792, 1423852012, 1459529624); + uint2x3 r2 = uint2x3(1027543763, 1426262618, 1426620467, 674685791, 1423852011, 1459529623); + TestUtils.AreEqual(r2, --a2); + + uint2x3 a3 = uint2x3(2092317419, 1261583506, 512900840, 1496855314, 777588547, 617644613); + uint2x3 r3 = uint2x3(2092317418, 1261583505, 512900839, 1496855313, 777588546, 617644612); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void uint2x3_operator_postfix_dec() + { + uint2x3 a0 = uint2x3(1870005937, 1708534798, 704493460, 462940703, 2060593573, 228744869); + uint2x3 r0 = uint2x3(1870005937, 1708534798, 704493460, 462940703, 2060593573, 228744869); + TestUtils.AreEqual(r0, a0--); + + uint2x3 a1 = uint2x3(940247280, 1015253889, 862428933, 1401191870, 2080259851, 653673271); + uint2x3 r1 = uint2x3(940247280, 1015253889, 862428933, 1401191870, 2080259851, 653673271); + TestUtils.AreEqual(r1, a1--); + + uint2x3 a2 = uint2x3(140452688, 1760916301, 1174531383, 634036198, 993137684, 1669210509); + uint2x3 r2 = uint2x3(140452688, 1760916301, 1174531383, 634036198, 993137684, 1669210509); + TestUtils.AreEqual(r2, a2--); + + uint2x3 a3 = uint2x3(874927437, 471308632, 620865961, 220103745, 1407678826, 319906934); + uint2x3 r3 = uint2x3(874927437, 471308632, 620865961, 220103745, 1407678826, 319906934); + TestUtils.AreEqual(r3, a3--); + } + + [TestCompiler] + public static void uint2x3_operator_bitwise_and_wide_wide() + { + uint2x3 a0 = uint2x3(1055241304, 859321394, 1088358961, 2090949513, 300561740, 651904515); + uint2x3 b0 = uint2x3(749698416, 748105424, 1842764797, 9990577, 1989102105, 1666634755); + uint2x3 r0 = uint2x3(749024336, 537928720, 1087769137, 8409473, 277479432, 575816707); + TestUtils.AreEqual(r0, a0 & b0); + + uint2x3 a1 = uint2x3(1331035868, 2012752753, 1298126656, 53199569, 1752363533, 1303061302); + uint2x3 b1 = uint2x3(58116798, 868036607, 1420638875, 1308767169, 564040763, 478617502); + uint2x3 r1 = uint2x3(55888540, 867707761, 1141707264, 33686209, 538087433, 209912598); + TestUtils.AreEqual(r1, a1 & b1); + + uint2x3 a2 = uint2x3(1929998247, 1504941434, 470682792, 713577376, 1493231658, 1340884669); + uint2x3 b2 = uint2x3(806150474, 674015378, 1505309955, 36064977, 1779639327, 808650076); + uint2x3 r2 = uint2x3(805855490, 136347666, 403178496, 33571456, 1207967754, 2098204); + TestUtils.AreEqual(r2, a2 & b2); + + uint2x3 a3 = uint2x3(1577921467, 44846626, 1105094388, 1143008413, 333009589, 2116296009); + uint2x3 b3 = uint2x3(1634437037, 1997568501, 1930853951, 1901503461, 1508772523, 2010961769); + uint2x3 r3 = uint2x3(1074332585, 33572896, 1091986996, 1073782917, 298320545, 1979979081); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void uint2x3_operator_bitwise_and_wide_scalar() + { + uint2x3 a0 = uint2x3(1513158868, 284695609, 734595037, 1566510707, 1601252476, 84213838); + uint b0 = (1173647397); + uint2x3 r0 = uint2x3(1076916228, 15732769, 29360133, 1163132961, 1164976164, 84148228); + TestUtils.AreEqual(r0, a0 & b0); + + uint2x3 a1 = uint2x3(314333543, 753481263, 327392481, 1619794917, 2143619546, 1873208293); + uint b1 = (430856908); + uint2x3 r1 = uint2x3(279730244, 145232396, 293738688, 9181892, 428083400, 161891012); + TestUtils.AreEqual(r1, a1 & b1); + + uint2x3 a2 = uint2x3(126982769, 1383096952, 1689107088, 1368301071, 366962092, 1729929586); + uint b2 = (651482651); + uint2x3 r2 = uint2x3(110137873, 38814232, 612667920, 8689163, 81019912, 638877714); + TestUtils.AreEqual(r2, a2 & b2); + + uint2x3 a3 = uint2x3(989550739, 1592791064, 2047510829, 678485991, 586400261, 771972179); + uint b3 = (1914435619); + uint2x3 r3 = uint2x3(840652803, 1376784384, 1913292833, 537974819, 571719681, 570644483); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void uint2x3_operator_bitwise_and_scalar_wide() + { + uint a0 = (477163326); + uint2x3 b0 = uint2x3(110453385, 703240362, 2075630560, 1884904031, 1734899436, 947945203); + uint2x3 r0 = uint2x3(68182536, 140544042, 405834528, 273697310, 73426476, 402681394); + TestUtils.AreEqual(r0, a0 & b0); + + uint a1 = (1664399051); + uint2x3 b1 = uint2x3(458879298, 158491426, 79772356, 2054527944, 202228212, 359225061); + uint2x3 r1 = uint2x3(51425346, 19931650, 12992, 1647612616, 295104, 18880193); + TestUtils.AreEqual(r1, a1 & b1); + + uint a2 = (639811396); + uint2x3 b2 = uint2x3(1821945318, 1821303024, 2030124055, 1985961756, 579780373, 2061831301); + uint2x3 r2 = uint2x3(604024132, 604151872, 536886276, 637673220, 570605316, 572525572); + TestUtils.AreEqual(r2, a2 & b2); + + uint a3 = (1139618293); + uint2x3 b3 = uint2x3(1145191868, 1121606282, 1414714065, 688688277, 1508875606, 664318814); + uint2x3 r3 = uint2x3(1077948852, 1120407680, 1077940433, 17563797, 1106055508, 59257172); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void uint2x3_operator_bitwise_or_wide_wide() + { + uint2x3 a0 = uint2x3(1920951869, 1750772852, 1420019191, 732977093, 1169579447, 229437930); + uint2x3 b0 = uint2x3(214585254, 275414367, 858759675, 190211455, 1218691723, 2129565457); + uint2x3 r0 = uint2x3(2130669503, 2021326207, 2008016383, 737572863, 1303895999, 2146367483); + TestUtils.AreEqual(r0, a0 | b0); + + uint2x3 a1 = uint2x3(1966721348, 2039812323, 113550869, 1912038362, 1569990624, 1490718227); + uint2x3 b1 = uint2x3(1862809466, 495728846, 868064152, 1756913766, 933656055, 247722084); + uint2x3 r1 = uint2x3(2134507390, 2107455727, 939376541, 2046780414, 2142664695, 1591475831); + TestUtils.AreEqual(r1, a1 | b1); + + uint2x3 a2 = uint2x3(1686257697, 2137727522, 1569900650, 856504729, 2033376384, 2086259889); + uint2x3 b2 = uint2x3(1884195075, 1804207631, 1913174711, 1815920856, 1226577606, 1696467642); + uint2x3 r2 = uint2x3(1959708963, 2146117167, 2140863231, 2134768089, 2034163398, 2103430843); + TestUtils.AreEqual(r2, a2 | b2); + + uint2x3 a3 = uint2x3(671790684, 1189001916, 1756048437, 417084592, 2024165808, 966008272); + uint2x3 b3 = uint2x3(186912044, 1778908130, 1461256625, 1142152181, 272117331, 1162254035); + uint2x3 r3 = uint2x3(724483964, 1860172798, 2142973365, 1558183925, 2025750515, 2111217619); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void uint2x3_operator_bitwise_or_wide_scalar() + { + uint2x3 a0 = uint2x3(1295304853, 1307252624, 350194630, 1128063578, 1774824542, 2085245467); + uint b0 = (1305527136); + uint2x3 r0 = uint2x3(1307888629, 1308350448, 1574947814, 1341973370, 1842999166, 2111492987); + TestUtils.AreEqual(r0, a0 | b0); + + uint2x3 a1 = uint2x3(1988423804, 2110327307, 1050875188, 341855232, 1317039676, 228656898); + uint b1 = (999162350); + uint2x3 r1 = uint2x3(2140074494, 2144275439, 1068439038, 1072582126, 2140041214, 1068435438); + TestUtils.AreEqual(r1, a1 | b1); + + uint2x3 a2 = uint2x3(41280811, 606786773, 1739461580, 2040936581, 1350320187, 1377874553); + uint b2 = (1536908787); + uint2x3 r2 = uint2x3(1543503355, 2143018487, 2143248383, 2076147191, 1543462395, 1539047419); + TestUtils.AreEqual(r2, a2 | b2); + + uint2x3 a3 = uint2x3(1522262112, 1732466858, 1535976093, 375675620, 1614193383, 226059393); + uint b3 = (1496806239); + uint2x3 r3 = uint2x3(1539306367, 2138536959, 1539273695, 1601666047, 2033710079, 1568634847); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void uint2x3_operator_bitwise_or_scalar_wide() + { + uint a0 = (1768627592); + uint2x3 b0 = uint2x3(1849658052, 1759912154, 729979455, 975926310, 1987690876, 1809506714); + uint2x3 r0 = uint2x3(1870634956, 1777286618, 1810603967, 2070642094, 2138824188, 1811676570); + TestUtils.AreEqual(r0, a0 | b0); + + uint a1 = (1160695341); + uint2x3 b1 = uint2x3(408963395, 314072711, 1560007537, 1709003416, 977086639, 1448375596); + uint2x3 r1 = uint2x3(1567543151, 1472126639, 1577049981, 1711267517, 2134896303, 1467940653); + TestUtils.AreEqual(r1, a1 | b1); + + uint a2 = (1689568808); + uint2x3 b2 = uint2x3(595543345, 559778387, 621080913, 438994183, 1742637145, 1219409263); + uint2x3 r2 = uint2x3(1744815929, 1711132283, 1706358649, 2126432047, 1744752249, 1824454511); + TestUtils.AreEqual(r2, a2 | b2); + + uint a3 = (1602932494); + uint2x3 b3 = uint2x3(1204461702, 2111538444, 836730895, 1207638621, 802100209, 1089077339); + uint2x3 r3 = uint2x3(1607135118, 2145111822, 2145373967, 1610342239, 2144329727, 1609224031); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void uint2x3_operator_bitwise_xor_wide_wide() + { + uint2x3 a0 = uint2x3(1843655608, 362425681, 640805534, 1342040268, 945678755, 980321850); + uint2x3 b0 = uint2x3(1422803441, 1234691140, 119589253, 1101464929, 121896337, 1880109018); + uint2x3 r0 = uint2x3(959296073, 1544407317, 554771227, 240840109, 1058935858, 1249815008); + TestUtils.AreEqual(r0, a0 ^ b0); + + uint2x3 a1 = uint2x3(390165019, 1682422658, 303897251, 230477768, 1103646442, 1503102919); + uint2x3 b1 = uint2x3(1000210266, 1718938232, 464406940, 884337881, 34199854, 1430659227); + uint2x3 r1 = uint2x3(752651585, 36917754, 162747199, 956900113, 1136760772, 215066460); + TestUtils.AreEqual(r1, a1 ^ b1); + + uint2x3 a2 = uint2x3(26631152, 1016475570, 1862440929, 379588576, 1943580404, 691527166); + uint2x3 b2 = uint2x3(126415540, 1069919967, 1810763253, 2082802224, 941097951, 27782297); + uint2x3 r2 = uint2x3(102672708, 55804269, 82614804, 1787102672, 1270918443, 680538471); + TestUtils.AreEqual(r2, a2 ^ b2); + + uint2x3 a3 = uint2x3(723280696, 497086939, 1640104913, 893178410, 1596765788, 664096470); + uint2x3 b3 = uint2x3(156353074, 607061607, 470737131, 1151564598, 8268481, 434405645); + uint2x3 r3 = uint2x3(575512842, 965736380, 2110579514, 1906288924, 1599249565, 1047646171); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void uint2x3_operator_bitwise_xor_wide_scalar() + { + uint2x3 a0 = uint2x3(169345668, 176087064, 2084362901, 1663924004, 193851255, 517476661); + uint b0 = (354464228); + uint2x3 r0 = uint2x3(523809632, 526275068, 1763470193, 1980614336, 514678419, 200843473); + TestUtils.AreEqual(r0, a0 ^ b0); + + uint2x3 a1 = uint2x3(905336222, 365003873, 835837496, 954341348, 1464576786, 625604047); + uint b1 = (863800783); + uint2x3 r1 = uint2x3(109762641, 649922990, 44913655, 194943531, 1681336029, 372602880); + TestUtils.AreEqual(r1, a1 ^ b1); + + uint2x3 a2 = uint2x3(1700827127, 1481813598, 1077374714, 1043379893, 1991576049, 781860967); + uint b2 = (2003392824); + uint2x3 r2 = uint2x3(302634703, 792459110, 928921538, 1230630797, 31215817, 1509103967); + TestUtils.AreEqual(r2, a2 ^ b2); + + uint2x3 a3 = uint2x3(60088394, 858716109, 858484213, 178843494, 1223183458, 866652388); + uint b3 = (1196907956); + uint2x3 r3 = uint2x3(1153678846, 1954130553, 1954295873, 1308603090, 264180182, 1962888528); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void uint2x3_operator_bitwise_xor_scalar_wide() + { + uint a0 = (1361775641); + uint2x3 b0 = uint2x3(1452773578, 459050892, 1986218254, 1689037698, 999278344, 1229114508); + uint2x3 r0 = uint2x3(129801427, 1249346453, 659047703, 898082715, 1789184785, 409583765); + TestUtils.AreEqual(r0, a0 ^ b0); + + uint a1 = (1087843538); + uint2x3 b1 = uint2x3(733699740, 106187872, 1533632738, 1107817672, 492506236, 597602329); + uint2x3 r1 = uint2x3(1802269262, 1183015090, 465456176, 47241242, 1569464494, 1665768651); + TestUtils.AreEqual(r1, a1 ^ b1); + + uint a2 = (1439603382); + uint2x3 b2 = uint2x3(1001169118, 1231718216, 1693179077, 1050897427, 1796435561, 1100532547); + uint2x3 r2 = uint2x3(1851931240, 480517630, 824526451, 1802368677, 1054733535, 341201397); + TestUtils.AreEqual(r2, a2 ^ b2); + + uint a3 = (2106589181); + uint2x3 b3 = uint2x3(79691722, 851486414, 381749210, 1743618507, 2038827673, 1680906962); + uint2x3 r3 = uint2x3(2033188919, 1330600243, 1800337447, 442662454, 67761508, 431973679); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void uint2x3_operator_left_shift() + { + uint2x3 a0 = uint2x3(1129100049, 829482269, 1571297368, 443753193, 1872142968, 249554593); + int b0 = (218351941); + uint2x3 r0 = uint2x3(1771463200, 773628832, 3036875520, 1315200288, 4074000128, 3690779680); + TestUtils.AreEqual(r0, a0 << b0); + + uint2x3 a1 = uint2x3(892627436, 62369727, 849916599, 1271350845, 108441902, 1959056531); + int b1 = (980302862); + uint2x3 r1 = uint2x3(444268544, 3958358016, 749584384, 3515826176, 2890629120, 891600896); + TestUtils.AreEqual(r1, a1 << b1); + + uint2x3 a2 = uint2x3(1779118882, 2082026915, 1149883636, 1380536034, 186532735, 1487486874); + int b2 = (1451674188); + uint2x3 r2 = uint2x3(3006406656, 2472161280, 2639216640, 2498633728, 3828871168, 2482610176); + TestUtils.AreEqual(r2, a2 << b2); + + uint2x3 a3 = uint2x3(1498738574, 1647167336, 772453640, 456967739, 947384545, 1463252873); + int b3 = (752067504); + uint2x3 r3 = uint2x3(4019060736, 3345481728, 3037200384, 3325755392, 4041277440, 2005467136); + TestUtils.AreEqual(r3, a3 << b3); + } + + [TestCompiler] + public static void uint2x3_operator_right_shift() + { + uint2x3 a0 = uint2x3(809126085, 908563670, 763568837, 1986717290, 1174507510, 646821842); + int b0 = (994800051); + uint2x3 r0 = uint2x3(1543, 1732, 1456, 3789, 2240, 1233); + TestUtils.AreEqual(r0, a0 >> b0); + + uint2x3 a1 = uint2x3(1242726074, 1521420393, 1923166649, 102096936, 400863878, 667378673); + int b1 = (390811632); + uint2x3 r1 = uint2x3(18962, 23215, 29345, 1557, 6116, 10183); + TestUtils.AreEqual(r1, a1 >> b1); + + uint2x3 a2 = uint2x3(1611921244, 479442287, 2014389412, 1673938174, 1075916177, 1248577253); + int b2 = (307750782); + uint2x3 r2 = uint2x3(1, 0, 1, 1, 1, 1); + TestUtils.AreEqual(r2, a2 >> b2); + + uint2x3 a3 = uint2x3(848199210, 848976170, 500930883, 662405800, 126875849, 1103917083); + int b3 = (813936577); + uint2x3 r3 = uint2x3(424099605, 424488085, 250465441, 331202900, 63437924, 551958541); + TestUtils.AreEqual(r3, a3 >> b3); + } + + [TestCompiler] + public static void uint2x3_operator_bitwise_not() + { + uint2x3 a0 = uint2x3(111796841, 603562399, 745091931, 853183268, 1110916612, 381888399); + uint2x3 r0 = uint2x3(4183170454, 3691404896, 3549875364, 3441784027, 3184050683, 3913078896); + TestUtils.AreEqual(r0, ~a0); + + uint2x3 a1 = uint2x3(1891338755, 771210628, 787710759, 875964607, 96456785, 916013379); + uint2x3 r1 = uint2x3(2403628540, 3523756667, 3507256536, 3419002688, 4198510510, 3378953916); + TestUtils.AreEqual(r1, ~a1); + + uint2x3 a2 = uint2x3(203444882, 1020232736, 683852713, 375158799, 881353367, 1218471344); + uint2x3 r2 = uint2x3(4091522413, 3274734559, 3611114582, 3919808496, 3413613928, 3076495951); + TestUtils.AreEqual(r2, ~a2); + + uint2x3 a3 = uint2x3(1174233245, 443427914, 1385118179, 215320517, 860122767, 1411266016); + uint2x3 r3 = uint2x3(3120734050, 3851539381, 2909849116, 4079646778, 3434844528, 2883701279); + TestUtils.AreEqual(r3, ~a3); + } + + [TestCase /* For player builds */] + public static void uint2x3_EqualsObjectOverride() + { + TestUtils.IsFalse(new uint2x3().Equals((object)new int())); + TestUtils.IsTrue(new uint2x3().Equals((object)new uint2x3())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestUint2x3.gen.cs.meta b/src/Tests/Tests/Shared/TestUint2x3.gen.cs.meta new file mode 100644 index 00000000..cdbcfb3d --- /dev/null +++ b/src/Tests/Tests/Shared/TestUint2x3.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 957fb6da77f246049898f0ef4647166d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestUint2x4.gen.cs b/src/Tests/Tests/Shared/TestUint2x4.gen.cs new file mode 100644 index 00000000..f9a8f210 --- /dev/null +++ b/src/Tests/Tests/Shared/TestUint2x4.gen.cs @@ -0,0 +1,1236 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestUint2x4 + { + [TestCompiler] + public static void uint2x4_zero() + { + TestUtils.AreEqual(0u, uint2x4.zero.c0.x); + TestUtils.AreEqual(0u, uint2x4.zero.c0.y); + TestUtils.AreEqual(0u, uint2x4.zero.c1.x); + TestUtils.AreEqual(0u, uint2x4.zero.c1.y); + TestUtils.AreEqual(0u, uint2x4.zero.c2.x); + TestUtils.AreEqual(0u, uint2x4.zero.c2.y); + TestUtils.AreEqual(0u, uint2x4.zero.c3.x); + TestUtils.AreEqual(0u, uint2x4.zero.c3.y); + } + + [TestCompiler] + public static void uint2x4_operator_equal_wide_wide() + { + uint2x4 a0 = uint2x4(2105871082, 35218899, 1550755093, 764676020, 606743782, 1208156098, 1023640014, 1038468316); + uint2x4 b0 = uint2x4(1477587886, 579629692, 540974792, 208405066, 2063397938, 1060167409, 362592601, 2097545362); + bool2x4 r0 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + uint2x4 a1 = uint2x4(1416064367, 727143393, 2061243891, 184669837, 1303661760, 2044073738, 370395888, 1822916805); + uint2x4 b1 = uint2x4(277670088, 426944490, 901076223, 857900673, 1548779757, 325265488, 312658571, 176373760); + bool2x4 r1 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + uint2x4 a2 = uint2x4(1076983135, 345215866, 833676277, 1987782708, 1481088614, 1364754268, 93639636, 1850596922); + uint2x4 b2 = uint2x4(2052378097, 858156597, 982817797, 1252095508, 882634538, 1959142806, 72495800, 1077678183); + bool2x4 r2 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + uint2x4 a3 = uint2x4(2073471507, 1745989448, 28118669, 1267554232, 1292918049, 1423451579, 644384701, 1985492825); + uint2x4 b3 = uint2x4(1729269763, 1607675346, 1813461519, 1204794859, 1324801873, 1975336, 439410532, 294085211); + bool2x4 r3 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void uint2x4_operator_equal_wide_scalar() + { + uint2x4 a0 = uint2x4(437822262, 2020661134, 541786900, 853113810, 23716499, 179951405, 1409026299, 948838849); + uint b0 = (1332833578); + bool2x4 r0 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + uint2x4 a1 = uint2x4(953202998, 1926262965, 1851546137, 712957637, 2028784869, 1049962241, 1836975611, 1016802970); + uint b1 = (691955848); + bool2x4 r1 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + uint2x4 a2 = uint2x4(390120467, 1451642042, 289137869, 152339338, 808355440, 660053867, 597354173, 67320270); + uint b2 = (464814777); + bool2x4 r2 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + uint2x4 a3 = uint2x4(151461188, 602895443, 186996278, 129611815, 1031574999, 1697392883, 1463742000, 857785521); + uint b3 = (35153827); + bool2x4 r3 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void uint2x4_operator_equal_scalar_wide() + { + uint a0 = (542329200); + uint2x4 b0 = uint2x4(1115584594, 684107773, 1928988941, 890709324, 641152437, 1410341302, 497505660, 1068223109); + bool2x4 r0 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + uint a1 = (2014009435); + uint2x4 b1 = uint2x4(213835595, 1592428361, 1819361470, 448650623, 1942175642, 64377057, 1485938610, 1146305380); + bool2x4 r1 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + uint a2 = (1312317120); + uint2x4 b2 = uint2x4(263290348, 812663708, 1585209188, 40646617, 1378718922, 1957797737, 873652576, 1780082094); + bool2x4 r2 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + uint a3 = (1513270921); + uint2x4 b3 = uint2x4(2095980581, 1413074719, 1387984261, 1547119354, 924385171, 1253636050, 1477542688, 969120167); + bool2x4 r3 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void uint2x4_operator_not_equal_wide_wide() + { + uint2x4 a0 = uint2x4(1977284100, 1293292704, 1547283851, 422428953, 195833190, 1711544892, 5606053, 737069074); + uint2x4 b0 = uint2x4(1514195556, 957972049, 507667364, 581861672, 1128094576, 940096636, 57559040, 181752616); + bool2x4 r0 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + uint2x4 a1 = uint2x4(647386678, 13079405, 1413841590, 1076166545, 1211445174, 1289303469, 1436402489, 1129570126); + uint2x4 b1 = uint2x4(962017320, 1762015406, 1107218953, 2042026522, 836002288, 570272309, 2112081980, 1500634658); + bool2x4 r1 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + uint2x4 a2 = uint2x4(1566836685, 1343313905, 329259205, 1774944480, 33906739, 2055853627, 2035015372, 1702756001); + uint2x4 b2 = uint2x4(1787808345, 566425667, 2037529609, 1520589840, 266793699, 538816359, 2075474643, 553571317); + bool2x4 r2 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + uint2x4 a3 = uint2x4(1164186087, 329853698, 769052491, 1893312730, 438029011, 1894010522, 1365847542, 1292942830); + uint2x4 b3 = uint2x4(218264354, 654754196, 1392180230, 870065147, 1398749829, 711281563, 1999640291, 231234857); + bool2x4 r3 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void uint2x4_operator_not_equal_wide_scalar() + { + uint2x4 a0 = uint2x4(1038269360, 1427812625, 103361237, 1347017023, 1523584313, 150442802, 660334527, 719113717); + uint b0 = (768873026); + bool2x4 r0 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + uint2x4 a1 = uint2x4(262959423, 506946952, 226568494, 507918242, 1702162286, 923269270, 166187260, 114581840); + uint b1 = (484398043); + bool2x4 r1 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + uint2x4 a2 = uint2x4(1045389187, 1461803977, 61801615, 1317840133, 2146927809, 1557151164, 1284033253, 1345705546); + uint b2 = (1648095254); + bool2x4 r2 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + uint2x4 a3 = uint2x4(1747302566, 1368046109, 1848036266, 2025452920, 373992983, 289537519, 1388743060, 146455100); + uint b3 = (611028295); + bool2x4 r3 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void uint2x4_operator_not_equal_scalar_wide() + { + uint a0 = (1652127596); + uint2x4 b0 = uint2x4(953791238, 271722683, 1278885987, 735128017, 112416504, 25967222, 1761444475, 1844594536); + bool2x4 r0 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + uint a1 = (1199122922); + uint2x4 b1 = uint2x4(634219279, 942501101, 67161343, 969944293, 833229499, 1304301133, 704045745, 345012334); + bool2x4 r1 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + uint a2 = (1253134152); + uint2x4 b2 = uint2x4(325772538, 855127202, 793668881, 1584481616, 1101301152, 276853534, 987168816, 1258105989); + bool2x4 r2 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + uint a3 = (362645228); + uint2x4 b3 = uint2x4(293978043, 1772395973, 1692007315, 681268929, 1535518457, 595209334, 25745185, 1278016813); + bool2x4 r3 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void uint2x4_operator_less_wide_wide() + { + uint2x4 a0 = uint2x4(1486550609, 1779244308, 1602148045, 1614085440, 1975613414, 942838342, 1092279031, 373677431); + uint2x4 b0 = uint2x4(97842578, 536551311, 413528975, 1838293684, 1283898480, 1456599961, 1080278602, 529676676); + bool2x4 r0 = bool2x4(false, false, false, true, false, true, false, true); + TestUtils.AreEqual(r0, a0 < b0); + + uint2x4 a1 = uint2x4(1419098312, 337757077, 1081797900, 1336745069, 840685445, 1220554047, 2013681746, 192965012); + uint2x4 b1 = uint2x4(156584048, 117348799, 246927124, 1916615924, 1731071394, 1328098431, 1014995792, 480319327); + bool2x4 r1 = bool2x4(false, false, false, true, true, true, false, true); + TestUtils.AreEqual(r1, a1 < b1); + + uint2x4 a2 = uint2x4(532043965, 1000693402, 927236048, 1215860000, 780607596, 1882056852, 1354146545, 2135295778); + uint2x4 b2 = uint2x4(1765937053, 1333997067, 688515308, 1856106947, 1303906227, 646821776, 1169473993, 316770064); + bool2x4 r2 = bool2x4(true, true, false, true, true, false, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + uint2x4 a3 = uint2x4(1145973790, 1938006975, 895882838, 2006524299, 908581156, 1843349513, 1340458575, 1972095585); + uint2x4 b3 = uint2x4(1518155802, 416732703, 529193056, 1239623485, 2010112031, 2018560298, 285987009, 960617622); + bool2x4 r3 = bool2x4(true, false, false, false, true, true, false, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void uint2x4_operator_less_wide_scalar() + { + uint2x4 a0 = uint2x4(796797557, 670113454, 933579492, 278884514, 318174822, 1117630673, 741886928, 1990922600); + uint b0 = (746564682); + bool2x4 r0 = bool2x4(false, true, false, true, true, false, true, false); + TestUtils.AreEqual(r0, a0 < b0); + + uint2x4 a1 = uint2x4(1030849597, 1718582899, 1648393417, 1857132231, 1909506562, 1294006045, 952084157, 1303736668); + uint b1 = (1546212312); + bool2x4 r1 = bool2x4(true, false, false, false, false, true, true, true); + TestUtils.AreEqual(r1, a1 < b1); + + uint2x4 a2 = uint2x4(845460171, 1368236640, 24980695, 1434668705, 659552739, 1058492383, 165694933, 1204097259); + uint b2 = (979430272); + bool2x4 r2 = bool2x4(true, false, true, false, true, false, true, false); + TestUtils.AreEqual(r2, a2 < b2); + + uint2x4 a3 = uint2x4(922212691, 24629507, 1386458568, 1325149699, 1498707004, 1650355158, 1213017950, 1650457461); + uint b3 = (281328069); + bool2x4 r3 = bool2x4(false, true, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void uint2x4_operator_less_scalar_wide() + { + uint a0 = (186400299); + uint2x4 b0 = uint2x4(1881344229, 813834467, 1254886626, 1353590345, 1412343685, 1555571443, 1540508298, 1735458634); + bool2x4 r0 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 < b0); + + uint a1 = (135888070); + uint2x4 b1 = uint2x4(1643818742, 248291654, 1739560105, 728539891, 480507742, 1696553040, 540223931, 1840493353); + bool2x4 r1 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 < b1); + + uint a2 = (146833656); + uint2x4 b2 = uint2x4(798115946, 2002002066, 1011261705, 783550942, 1093071215, 598253401, 1432416562, 1863582169); + bool2x4 r2 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 < b2); + + uint a3 = (103622950); + uint2x4 b3 = uint2x4(775175960, 116908309, 1213433625, 1428954824, 1760442490, 1208143947, 751820805, 1491872302); + bool2x4 r3 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void uint2x4_operator_greater_wide_wide() + { + uint2x4 a0 = uint2x4(2087717754, 1725569452, 1298066182, 1693943616, 1319019629, 70674491, 1042499725, 1002821508); + uint2x4 b0 = uint2x4(85148514, 293632137, 1151128249, 409440398, 1115020183, 1508500597, 1834583302, 1755218534); + bool2x4 r0 = bool2x4(true, true, true, true, true, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + uint2x4 a1 = uint2x4(1021857133, 1744374599, 821751047, 467646903, 2029731638, 1377214212, 1207816926, 474621063); + uint2x4 b1 = uint2x4(1788761753, 1128238489, 834223713, 1578743290, 1647150256, 1756397855, 1131080201, 1208965204); + bool2x4 r1 = bool2x4(false, true, false, false, true, false, true, false); + TestUtils.AreEqual(r1, a1 > b1); + + uint2x4 a2 = uint2x4(20781266, 366593779, 2068457387, 10181449, 793634464, 144474612, 99947390, 930377263); + uint2x4 b2 = uint2x4(1495161099, 1283714281, 908051907, 412849651, 815822687, 730271942, 40756039, 883326140); + bool2x4 r2 = bool2x4(false, false, true, false, false, false, true, true); + TestUtils.AreEqual(r2, a2 > b2); + + uint2x4 a3 = uint2x4(683686232, 742803073, 918292048, 875621429, 1764985258, 411384146, 1921397684, 1349107119); + uint2x4 b3 = uint2x4(476260632, 1024136446, 1440596667, 1253494041, 146826162, 1798399573, 2085029408, 187939428); + bool2x4 r3 = bool2x4(true, false, false, false, true, false, false, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void uint2x4_operator_greater_wide_scalar() + { + uint2x4 a0 = uint2x4(1208626274, 239697208, 1979453345, 1253474001, 1590192876, 1487911635, 1673945595, 1662650098); + uint b0 = (1715176566); + bool2x4 r0 = bool2x4(false, false, true, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + uint2x4 a1 = uint2x4(222749855, 566635217, 1773305960, 1850273578, 206147145, 325913453, 333381537, 1905567362); + uint b1 = (1433540517); + bool2x4 r1 = bool2x4(false, false, true, true, false, false, false, true); + TestUtils.AreEqual(r1, a1 > b1); + + uint2x4 a2 = uint2x4(2053577491, 2128431130, 1735325311, 529971908, 1663525234, 1972984241, 1587865063, 488268523); + uint b2 = (570397194); + bool2x4 r2 = bool2x4(true, true, true, false, true, true, true, false); + TestUtils.AreEqual(r2, a2 > b2); + + uint2x4 a3 = uint2x4(121921923, 181082921, 1281638484, 1818357732, 116518997, 1397728785, 1924199337, 742950077); + uint b3 = (812076921); + bool2x4 r3 = bool2x4(false, false, true, true, false, true, true, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void uint2x4_operator_greater_scalar_wide() + { + uint a0 = (480938827); + uint2x4 b0 = uint2x4(1824731899, 921496110, 586859044, 946430596, 1231356727, 1390167458, 1785807092, 28949024); + bool2x4 r0 = bool2x4(false, false, false, false, false, false, false, true); + TestUtils.AreEqual(r0, a0 > b0); + + uint a1 = (2037899283); + uint2x4 b1 = uint2x4(595656760, 1778095771, 1233500439, 1696302238, 1445965340, 484020151, 1586962841, 1361740714); + bool2x4 r1 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + uint a2 = (265628948); + uint2x4 b2 = uint2x4(2003122957, 332267433, 1128353075, 377919478, 982113135, 1117675960, 630865591, 1550679736); + bool2x4 r2 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + uint a3 = (895945757); + uint2x4 b3 = uint2x4(287025687, 643452096, 660504007, 613135893, 633307118, 514276792, 1377364317, 84491736); + bool2x4 r3 = bool2x4(true, true, true, true, true, true, false, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void uint2x4_operator_less_equal_wide_wide() + { + uint2x4 a0 = uint2x4(154092149, 1515170149, 1083970332, 785807178, 1401094881, 310537627, 868328962, 1990816725); + uint2x4 b0 = uint2x4(77984380, 1712054191, 1566203809, 254834519, 450519938, 389457083, 1298669505, 207343167); + bool2x4 r0 = bool2x4(false, true, true, false, false, true, true, false); + TestUtils.AreEqual(r0, a0 <= b0); + + uint2x4 a1 = uint2x4(2035349541, 457043352, 1123282035, 1001842946, 1387761992, 195272789, 659549000, 888761458); + uint2x4 b1 = uint2x4(1214449047, 2059561026, 896534357, 1897470050, 521075677, 1848221945, 374708019, 1573731118); + bool2x4 r1 = bool2x4(false, true, false, true, false, true, false, true); + TestUtils.AreEqual(r1, a1 <= b1); + + uint2x4 a2 = uint2x4(283706617, 1790185840, 899029812, 848317418, 1743712447, 1504407474, 1798441490, 1902791952); + uint2x4 b2 = uint2x4(2093466449, 1660210829, 1568778785, 1352157589, 1212771905, 1457525058, 1493446008, 1784768208); + bool2x4 r2 = bool2x4(true, false, true, true, false, false, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + uint2x4 a3 = uint2x4(606340844, 1994437705, 301831413, 654230470, 1223625081, 324292199, 1370931020, 1742769166); + uint2x4 b3 = uint2x4(1993422493, 1378671664, 1447376929, 1405041439, 1765183746, 562894655, 1085068880, 1026386862); + bool2x4 r3 = bool2x4(true, false, true, true, true, true, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void uint2x4_operator_less_equal_wide_scalar() + { + uint2x4 a0 = uint2x4(1479531977, 1427983411, 415250630, 1245345407, 1112546666, 1072990632, 1579912858, 101048307); + uint b0 = (2004563877); + bool2x4 r0 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + uint2x4 a1 = uint2x4(1070894375, 1910488590, 85452501, 518127023, 1246249980, 1097326500, 1964410699, 1968139888); + uint b1 = (509818792); + bool2x4 r1 = bool2x4(false, false, true, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 <= b1); + + uint2x4 a2 = uint2x4(1191853379, 1140643434, 754434551, 155343473, 995927387, 974873240, 1773400038, 497436329); + uint b2 = (662096238); + bool2x4 r2 = bool2x4(false, false, false, true, false, false, false, true); + TestUtils.AreEqual(r2, a2 <= b2); + + uint2x4 a3 = uint2x4(1825940497, 1477043363, 1378470734, 96190147, 37188105, 839762283, 781102710, 766321672); + uint b3 = (527516420); + bool2x4 r3 = bool2x4(false, false, false, true, true, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void uint2x4_operator_less_equal_scalar_wide() + { + uint a0 = (1899193992); + uint2x4 b0 = uint2x4(915011820, 980913757, 1337699683, 1476321359, 1102143668, 660493983, 184664508, 381579707); + bool2x4 r0 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 <= b0); + + uint a1 = (1954892821); + uint2x4 b1 = uint2x4(1295090571, 1440368586, 1696003686, 88708652, 1332251857, 1310713644, 2112132784, 48951945); + bool2x4 r1 = bool2x4(false, false, false, false, false, false, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + uint a2 = (1888568027); + uint2x4 b2 = uint2x4(39340955, 1108242207, 260777425, 593122164, 291471959, 253457314, 1264570386, 699618012); + bool2x4 r2 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + uint a3 = (927735863); + uint2x4 b3 = uint2x4(2063158939, 932253787, 1168754049, 749328788, 1882694892, 168499987, 378173027, 339963627); + bool2x4 r3 = bool2x4(true, true, true, false, true, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void uint2x4_operator_greater_equal_wide_wide() + { + uint2x4 a0 = uint2x4(8538378, 2131749726, 265427108, 523609761, 994991818, 839709564, 101288202, 1886280970); + uint2x4 b0 = uint2x4(903145828, 1697992986, 1432491982, 169789504, 1059357300, 1744255222, 1606584463, 1905414425); + bool2x4 r0 = bool2x4(false, true, false, true, false, false, false, false); + TestUtils.AreEqual(r0, a0 >= b0); + + uint2x4 a1 = uint2x4(2032074826, 631221455, 1456286159, 961342752, 424526026, 788481984, 1662488497, 870326690); + uint2x4 b1 = uint2x4(1448794969, 136181998, 1678754836, 2069656857, 398982689, 243317404, 740939613, 1894753119); + bool2x4 r1 = bool2x4(true, true, false, false, true, true, true, false); + TestUtils.AreEqual(r1, a1 >= b1); + + uint2x4 a2 = uint2x4(708712581, 1260182701, 1165630721, 138247561, 1108650168, 1933222913, 672493999, 1541402159); + uint2x4 b2 = uint2x4(301760792, 1260647988, 3608523, 52576030, 903420465, 1648820371, 627296845, 1679808907); + bool2x4 r2 = bool2x4(true, false, true, true, true, true, true, false); + TestUtils.AreEqual(r2, a2 >= b2); + + uint2x4 a3 = uint2x4(1921596027, 1557351956, 147242547, 892772168, 2089286723, 1273466960, 644009998, 654784654); + uint2x4 b3 = uint2x4(1719102039, 1718081638, 655586949, 477267189, 62092869, 2013928066, 280292357, 254052205); + bool2x4 r3 = bool2x4(true, false, false, true, true, false, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void uint2x4_operator_greater_equal_wide_scalar() + { + uint2x4 a0 = uint2x4(2049236663, 182691143, 634973382, 1197012109, 439837565, 1367606469, 1108037359, 351147187); + uint b0 = (1061998015); + bool2x4 r0 = bool2x4(true, false, false, true, false, true, true, false); + TestUtils.AreEqual(r0, a0 >= b0); + + uint2x4 a1 = uint2x4(1898505669, 1998610091, 4652390, 996159180, 2111455181, 727766399, 96217144, 814085575); + uint b1 = (411667685); + bool2x4 r1 = bool2x4(true, true, false, true, true, true, false, true); + TestUtils.AreEqual(r1, a1 >= b1); + + uint2x4 a2 = uint2x4(1525995206, 1732973229, 1473283041, 899444524, 1023753195, 1373738074, 518164359, 717850464); + uint b2 = (1293933760); + bool2x4 r2 = bool2x4(true, true, true, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + uint2x4 a3 = uint2x4(1765188600, 527594558, 1816542874, 839185150, 1143596061, 1819554651, 160724539, 993212636); + uint b3 = (1826820341); + bool2x4 r3 = bool2x4(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void uint2x4_operator_greater_equal_scalar_wide() + { + uint a0 = (1859811087); + uint2x4 b0 = uint2x4(1070365918, 1783869452, 830091760, 377157428, 327199016, 90384229, 1154649706, 376758501); + bool2x4 r0 = bool2x4(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + uint a1 = (1079802834); + uint2x4 b1 = uint2x4(2054742898, 1328349472, 434061447, 951207723, 598695892, 975131651, 1714007943, 177416473); + bool2x4 r1 = bool2x4(false, false, true, true, true, true, false, true); + TestUtils.AreEqual(r1, a1 >= b1); + + uint a2 = (1267232721); + uint2x4 b2 = uint2x4(31082860, 216791741, 119054289, 1905107583, 89559116, 55041824, 691334141, 462326883); + bool2x4 r2 = bool2x4(true, true, true, false, true, true, true, true); + TestUtils.AreEqual(r2, a2 >= b2); + + uint a3 = (1658303669); + uint2x4 b3 = uint2x4(914628512, 1134364322, 1677134711, 1955614770, 2067009301, 1454405405, 299467282, 1584922149); + bool2x4 r3 = bool2x4(true, true, false, false, false, true, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void uint2x4_operator_add_wide_wide() + { + uint2x4 a0 = uint2x4(2135171378, 21433296, 1954723494, 683604307, 1054212315, 1762680995, 1963655852, 1257853062); + uint2x4 b0 = uint2x4(1013431952, 366718162, 359290756, 1393163294, 1962236872, 1263270041, 1862666629, 1077447887); + uint2x4 r0 = uint2x4(3148603330, 388151458, 2314014250, 2076767601, 3016449187, 3025951036, 3826322481, 2335300949); + TestUtils.AreEqual(r0, a0 + b0); + + uint2x4 a1 = uint2x4(2043493600, 976898058, 1915056423, 121374462, 1218855698, 700538222, 1702057277, 1788251699); + uint2x4 b1 = uint2x4(821693806, 487316539, 350922520, 1583012528, 1951595076, 1024851344, 874302782, 1383969588); + uint2x4 r1 = uint2x4(2865187406, 1464214597, 2265978943, 1704386990, 3170450774, 1725389566, 2576360059, 3172221287); + TestUtils.AreEqual(r1, a1 + b1); + + uint2x4 a2 = uint2x4(1534939160, 398651016, 1674272498, 374510467, 824322986, 1217622199, 1122376670, 642613771); + uint2x4 b2 = uint2x4(1767968088, 900721406, 1659790033, 1792273749, 443844328, 633981449, 2010244807, 335566991); + uint2x4 r2 = uint2x4(3302907248, 1299372422, 3334062531, 2166784216, 1268167314, 1851603648, 3132621477, 978180762); + TestUtils.AreEqual(r2, a2 + b2); + + uint2x4 a3 = uint2x4(1097903998, 359042741, 929182687, 1713065399, 892057490, 1295346111, 1806236181, 1838589664); + uint2x4 b3 = uint2x4(521931102, 544297835, 1681549647, 1784248858, 585904415, 3128418, 1806236610, 179909533); + uint2x4 r3 = uint2x4(1619835100, 903340576, 2610732334, 3497314257, 1477961905, 1298474529, 3612472791, 2018499197); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void uint2x4_operator_add_wide_scalar() + { + uint2x4 a0 = uint2x4(665815972, 1783729250, 1591678394, 1284528538, 977850224, 71069732, 1138577680, 1200356017); + uint b0 = (1334043849); + uint2x4 r0 = uint2x4(1999859821, 3117773099, 2925722243, 2618572387, 2311894073, 1405113581, 2472621529, 2534399866); + TestUtils.AreEqual(r0, a0 + b0); + + uint2x4 a1 = uint2x4(565982008, 1088001167, 57252642, 678921480, 625943813, 512157429, 1470648741, 1490096953); + uint b1 = (1246759684); + uint2x4 r1 = uint2x4(1812741692, 2334760851, 1304012326, 1925681164, 1872703497, 1758917113, 2717408425, 2736856637); + TestUtils.AreEqual(r1, a1 + b1); + + uint2x4 a2 = uint2x4(1467033531, 1707296407, 1703724354, 1333833947, 653973063, 1139546735, 1834005844, 184572739); + uint b2 = (182608093); + uint2x4 r2 = uint2x4(1649641624, 1889904500, 1886332447, 1516442040, 836581156, 1322154828, 2016613937, 367180832); + TestUtils.AreEqual(r2, a2 + b2); + + uint2x4 a3 = uint2x4(1980578280, 97099208, 421437295, 1251829854, 166844260, 1568146789, 82548613, 533562157); + uint b3 = (1858520040); + uint2x4 r3 = uint2x4(3839098320, 1955619248, 2279957335, 3110349894, 2025364300, 3426666829, 1941068653, 2392082197); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void uint2x4_operator_add_scalar_wide() + { + uint a0 = (359966320); + uint2x4 b0 = uint2x4(2146146202, 767103309, 851002415, 311531406, 1491262941, 1016891373, 1954228994, 1671335850); + uint2x4 r0 = uint2x4(2506112522, 1127069629, 1210968735, 671497726, 1851229261, 1376857693, 2314195314, 2031302170); + TestUtils.AreEqual(r0, a0 + b0); + + uint a1 = (727870747); + uint2x4 b1 = uint2x4(551151834, 1390261152, 1699060326, 115021619, 1964440175, 440700758, 1556692550, 185414255); + uint2x4 r1 = uint2x4(1279022581, 2118131899, 2426931073, 842892366, 2692310922, 1168571505, 2284563297, 913285002); + TestUtils.AreEqual(r1, a1 + b1); + + uint a2 = (933106731); + uint2x4 b2 = uint2x4(1217866784, 729761881, 1742597318, 1090109152, 1467373815, 1066072609, 138237856, 634834665); + uint2x4 r2 = uint2x4(2150973515, 1662868612, 2675704049, 2023215883, 2400480546, 1999179340, 1071344587, 1567941396); + TestUtils.AreEqual(r2, a2 + b2); + + uint a3 = (993603553); + uint2x4 b3 = uint2x4(347587889, 2050191349, 670698672, 1658205080, 1874808705, 2082982954, 869839589, 118460267); + uint2x4 r3 = uint2x4(1341191442, 3043794902, 1664302225, 2651808633, 2868412258, 3076586507, 1863443142, 1112063820); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void uint2x4_operator_sub_wide_wide() + { + uint2x4 a0 = uint2x4(1410318491, 1097280168, 1827039044, 28881338, 328720965, 875487868, 212936325, 231977215); + uint2x4 b0 = uint2x4(1315897366, 799052018, 1580289673, 1094686261, 1954325726, 1197734816, 229886366, 915679176); + uint2x4 r0 = uint2x4(94421125, 298228150, 246749371, 3229162373, 2669362535, 3972720348, 4278017255, 3611265335); + TestUtils.AreEqual(r0, a0 - b0); + + uint2x4 a1 = uint2x4(1740021315, 2011295463, 48079003, 591379285, 1125909359, 1842588095, 848561896, 614448464); + uint2x4 b1 = uint2x4(1746884850, 918743925, 1007797419, 257421324, 287249342, 1617287463, 1653916102, 123586847); + uint2x4 r1 = uint2x4(4288103761, 1092551538, 3335248880, 333957961, 838660017, 225300632, 3489613090, 490861617); + TestUtils.AreEqual(r1, a1 - b1); + + uint2x4 a2 = uint2x4(2067598029, 1618238416, 318516219, 1090119767, 1991095823, 949592162, 1951912339, 1457818751); + uint2x4 b2 = uint2x4(502107404, 672875302, 1256481116, 1975569142, 1794443030, 1327558915, 330955394, 1596041731); + uint2x4 r2 = uint2x4(1565490625, 945363114, 3357002399, 3409517921, 196652793, 3917000543, 1620956945, 4156744316); + TestUtils.AreEqual(r2, a2 - b2); + + uint2x4 a3 = uint2x4(1642553126, 2114366549, 1420516260, 596841760, 724518081, 1820626306, 1885185225, 246124365); + uint2x4 b3 = uint2x4(1069074732, 1120817099, 2076417364, 402521072, 839858844, 1539789702, 559077522, 822288510); + uint2x4 r3 = uint2x4(573478394, 993549450, 3639066192, 194320688, 4179626533, 280836604, 1326107703, 3718803151); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void uint2x4_operator_sub_wide_scalar() + { + uint2x4 a0 = uint2x4(1508669340, 1594795463, 266707545, 643102647, 287705008, 1475644328, 1113286221, 979450511); + uint b0 = (998008471); + uint2x4 r0 = uint2x4(510660869, 596786992, 3563666370, 3940061472, 3584663833, 477635857, 115277750, 4276409336); + TestUtils.AreEqual(r0, a0 - b0); + + uint2x4 a1 = uint2x4(2082174113, 304369206, 999244508, 1806482044, 1994553647, 2101812429, 1482736902, 266654115); + uint b1 = (1108005498); + uint2x4 r1 = uint2x4(974168615, 3491331004, 4186206306, 698476546, 886548149, 993806931, 374731404, 3453615913); + TestUtils.AreEqual(r1, a1 - b1); + + uint2x4 a2 = uint2x4(1470212363, 958542155, 1185075537, 1738124835, 499527536, 1612473406, 1696960099, 1287292743); + uint b2 = (1190349300); + uint2x4 r2 = uint2x4(279863063, 4063160151, 4289693533, 547775535, 3604145532, 422124106, 506610799, 96943443); + TestUtils.AreEqual(r2, a2 - b2); + + uint2x4 a3 = uint2x4(1360229454, 1779621585, 964948785, 1739264125, 94254551, 968533883, 2075770560, 946189008); + uint b3 = (1032360376); + uint2x4 r3 = uint2x4(327869078, 747261209, 4227555705, 706903749, 3356861471, 4231140803, 1043410184, 4208795928); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void uint2x4_operator_sub_scalar_wide() + { + uint a0 = (893369501); + uint2x4 b0 = uint2x4(2051906184, 1699714311, 442603706, 1735141684, 274533585, 811580259, 1196354320, 1524097023); + uint2x4 r0 = uint2x4(3136430613, 3488622486, 450765795, 3453195113, 618835916, 81789242, 3991982477, 3664239774); + TestUtils.AreEqual(r0, a0 - b0); + + uint a1 = (533621527); + uint2x4 b1 = uint2x4(2080845793, 143958837, 1620668660, 1135989346, 1367044745, 554088609, 552670373, 1265516124); + uint2x4 r1 = uint2x4(2747743030, 389662690, 3207920163, 3692599477, 3461544078, 4274500214, 4275918450, 3563072699); + TestUtils.AreEqual(r1, a1 - b1); + + uint a2 = (1254902543); + uint2x4 b2 = uint2x4(1857695581, 1619865274, 1313559400, 99812999, 843597298, 420111239, 1299949060, 531009038); + uint2x4 r2 = uint2x4(3692174258, 3930004565, 4236310439, 1155089544, 411305245, 834791304, 4249920779, 723893505); + TestUtils.AreEqual(r2, a2 - b2); + + uint a3 = (1103306550); + uint2x4 b3 = uint2x4(104920105, 1137308312, 1207332725, 103438360, 1157123503, 1174401240, 701247193, 1498366995); + uint2x4 r3 = uint2x4(998386445, 4260965534, 4190941121, 999868190, 4241150343, 4223872606, 402059357, 3899906851); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void uint2x4_operator_mul_wide_wide() + { + uint2x4 a0 = uint2x4(61417577, 219585476, 1362520891, 1511084277, 1481211272, 58211871, 1459591173, 567624644); + uint2x4 b0 = uint2x4(578042444, 1620527213, 200516468, 309339115, 542853019, 299467282, 1479641221, 1428338601); + uint2x4 r0 = uint2x4(2868103468, 1326150260, 3304073148, 2972110823, 1973926232, 88546350, 3431047833, 3712145508); + TestUtils.AreEqual(r0, a0 * b0); + + uint2x4 a1 = uint2x4(1169935583, 1835691886, 385626539, 85934842, 522856538, 278370196, 289217012, 2083410174); + uint2x4 b1 = uint2x4(1497302909, 1596889147, 427413842, 265122693, 689376654, 1120457204, 516903000, 873091659); + uint2x4 r1 = uint2x4(556671459, 1098186330, 1848083398, 4236646882, 2005201900, 651971856, 2573806560, 4184807018); + TestUtils.AreEqual(r1, a1 * b1); + + uint2x4 a2 = uint2x4(1293162798, 1939730122, 2075923048, 1116477212, 1686101741, 783310758, 248585944, 1093377716); + uint2x4 b2 = uint2x4(1353196495, 1384773500, 1596528529, 2122329305, 1033200564, 996795088, 1137754930, 232014195); + uint2x4 r2 = uint2x4(4175537714, 3758002136, 2245379304, 3535300284, 1443849636, 550781664, 3335949872, 3941859036); + TestUtils.AreEqual(r2, a2 * b2); + + uint2x4 a3 = uint2x4(797038788, 1838048120, 1892922904, 1952024781, 492107602, 1097670675, 2069629919, 20122103); + uint2x4 b3 = uint2x4(1080950243, 1613216909, 463529448, 1781487382, 2101946430, 673144237, 390627073, 964308272); + uint2x4 r3 = uint2x4(3201362380, 264300824, 4173364672, 1825729694, 4053448156, 3048379351, 2230824159, 4043852112); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void uint2x4_operator_mul_wide_scalar() + { + uint2x4 a0 = uint2x4(871746615, 492532311, 570557670, 2142306629, 1610315153, 1526163563, 118471734, 257439514); + uint b0 = (442064533); + uint2x4 r0 = uint2x4(338365955, 1081376419, 2565819870, 3279557417, 3421481829, 4119466055, 3456786286, 513646114); + TestUtils.AreEqual(r0, a0 * b0); + + uint2x4 a1 = uint2x4(364291059, 1584938026, 1357601203, 638897141, 268562104, 1007838321, 1163240135, 1619806399); + uint b1 = (1186560810); + uint2x4 r1 = uint2x4(1029154526, 989596900, 521189470, 2675256626, 1627099696, 753911178, 2433831334, 167687254); + TestUtils.AreEqual(r1, a1 * b1); + + uint2x4 a2 = uint2x4(1444659979, 464517916, 1508043166, 745488654, 636691139, 1851670006, 357357967, 1095280227); + uint b2 = (1127580168); + uint2x4 r2 = uint2x4(204516952, 2345668832, 3245312240, 73999472, 3802078232, 2220284848, 679242360, 1245870360); + TestUtils.AreEqual(r2, a2 * b2); + + uint2x4 a3 = uint2x4(702779195, 1464398841, 51061000, 802418971, 407442471, 638315697, 1889264235, 584402164); + uint b3 = (945802744); + uint2x4 r3 = uint2x4(3708420136, 4218535480, 3727910848, 1852387624, 241680584, 4123396216, 1493698216, 2103324768); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void uint2x4_operator_mul_scalar_wide() + { + uint a0 = (1152242766); + uint2x4 b0 = uint2x4(1276636134, 2105929407, 499007702, 124002565, 1956335172, 1288034953, 832676555, 337389733); + uint2x4 r0 = uint2x4(2165463060, 999811634, 1179056436, 3493540742, 404105400, 1339492798, 3913201114, 3183347270); + TestUtils.AreEqual(r0, a0 * b0); + + uint a1 = (99268757); + uint2x4 b1 = uint2x4(2005055247, 2011389505, 1348110859, 399689191, 2007606374, 2076691289, 1825721194, 769885235); + uint2x4 r1 = uint2x4(559764411, 2675872725, 1022902375, 3289462643, 3609329502, 1103844045, 2105414834, 302946735); + TestUtils.AreEqual(r1, a1 * b1); + + uint a2 = (153314735); + uint2x4 b2 = uint2x4(1066325369, 84289667, 984486192, 1325213504, 1643957457, 1576395620, 2095980601, 907671947); + uint2x4 r2 = uint2x4(1030204087, 35283085, 3545608144, 2102006976, 305231839, 3631801692, 3259597815, 1010199813); + TestUtils.AreEqual(r2, a2 * b2); + + uint a3 = (836919582); + uint2x4 b3 = uint2x4(1412159342, 2037926630, 366590562, 493177763, 2058824164, 497936968, 2136548816, 1211907591); + uint2x4 r3 = uint2x4(3068128484, 4119194868, 1537669500, 3429736474, 1738427576, 4223057008, 3848683104, 1673391058); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void uint2x4_operator_div_wide_wide() + { + uint2x4 a0 = uint2x4(333171510, 858154903, 1181365836, 671357749, 1090606752, 803759420, 788404166, 296807814); + uint2x4 b0 = uint2x4(698897823, 440199998, 655557473, 1658534285, 2127220100, 315653188, 1814290360, 992173243); + uint2x4 r0 = uint2x4(0, 1, 1, 0, 0, 2, 0, 0); + TestUtils.AreEqual(r0, a0 / b0); + + uint2x4 a1 = uint2x4(575260195, 166625280, 1493729000, 1831739736, 200852358, 129983172, 500176108, 472051781); + uint2x4 b1 = uint2x4(914851653, 664340325, 224323977, 246981573, 285573983, 819471609, 2012476015, 1783179572); + uint2x4 r1 = uint2x4(0, 0, 6, 7, 0, 0, 0, 0); + TestUtils.AreEqual(r1, a1 / b1); + + uint2x4 a2 = uint2x4(414699094, 1446535974, 1278480457, 930910505, 263295881, 1626759436, 450830871, 21439121); + uint2x4 b2 = uint2x4(223253978, 169515029, 1694929006, 1992168131, 1155972447, 1768506696, 422325410, 1508417406); + uint2x4 r2 = uint2x4(1, 8, 0, 0, 0, 0, 1, 0); + TestUtils.AreEqual(r2, a2 / b2); + + uint2x4 a3 = uint2x4(521337599, 127756712, 200601965, 412554396, 1014641734, 239347640, 525574301, 1158358177); + uint2x4 b3 = uint2x4(605462475, 66917170, 2014683461, 108847533, 611173330, 895791853, 1999369787, 1225614384); + uint2x4 r3 = uint2x4(0, 1, 0, 3, 1, 0, 0, 0); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void uint2x4_operator_div_wide_scalar() + { + uint2x4 a0 = uint2x4(1433072926, 1073958635, 1195142312, 536596719, 1274375693, 464756346, 806462546, 906504670); + uint b0 = (1434025872); + uint2x4 r0 = uint2x4(0, 0, 0, 0, 0, 0, 0, 0); + TestUtils.AreEqual(r0, a0 / b0); + + uint2x4 a1 = uint2x4(1380905136, 1196815948, 123300377, 643754735, 2084019932, 2047825037, 458304263, 741331531); + uint b1 = (25493909); + uint2x4 r1 = uint2x4(54, 46, 4, 25, 81, 80, 17, 29); + TestUtils.AreEqual(r1, a1 / b1); + + uint2x4 a2 = uint2x4(466443901, 1500687214, 1453264263, 1617154145, 2040203220, 2103351724, 485536709, 402141749); + uint b2 = (2110004616); + uint2x4 r2 = uint2x4(0, 0, 0, 0, 0, 0, 0, 0); + TestUtils.AreEqual(r2, a2 / b2); + + uint2x4 a3 = uint2x4(1477264254, 1549487015, 670594363, 2040479674, 155415284, 207130003, 1596922206, 1730223836); + uint b3 = (1629069474); + uint2x4 r3 = uint2x4(0, 0, 0, 1, 0, 0, 0, 1); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void uint2x4_operator_div_scalar_wide() + { + uint a0 = (519165704); + uint2x4 b0 = uint2x4(1295178177, 775214121, 467772046, 1156881598, 310396565, 759759959, 243837702, 1616314235); + uint2x4 r0 = uint2x4(0, 0, 1, 0, 1, 0, 2, 0); + TestUtils.AreEqual(r0, a0 / b0); + + uint a1 = (1053470225); + uint2x4 b1 = uint2x4(1320630160, 378773841, 4223608, 1971105754, 2054406020, 219939614, 1603672651, 2006134295); + uint2x4 r1 = uint2x4(0, 2, 249, 0, 0, 4, 0, 0); + TestUtils.AreEqual(r1, a1 / b1); + + uint a2 = (888535397); + uint2x4 b2 = uint2x4(1493077923, 615835131, 1045603945, 452709946, 1074919059, 467037221, 1485241506, 1775728786); + uint2x4 r2 = uint2x4(0, 1, 0, 1, 0, 1, 0, 0); + TestUtils.AreEqual(r2, a2 / b2); + + uint a3 = (481521341); + uint2x4 b3 = uint2x4(68149923, 80867357, 1294049272, 470535313, 1235850199, 631464286, 687722755, 412827650); + uint2x4 r3 = uint2x4(7, 5, 0, 1, 0, 0, 0, 1); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void uint2x4_operator_mod_wide_wide() + { + uint2x4 a0 = uint2x4(258342924, 1454754891, 723352342, 1981431473, 531756042, 716993627, 1667903349, 1331097004); + uint2x4 b0 = uint2x4(1990080167, 1197348066, 651970512, 1659454050, 241005212, 1866255454, 1440101415, 595220963); + uint2x4 r0 = uint2x4(258342924, 257406825, 71381830, 321977423, 49745618, 716993627, 227801934, 140655078); + TestUtils.AreEqual(r0, a0 % b0); + + uint2x4 a1 = uint2x4(1776856101, 17598216, 1474345080, 1681376293, 813624265, 1617478722, 498370451, 780075943); + uint2x4 b1 = uint2x4(408818410, 198222574, 549504274, 239973807, 321398087, 658171840, 1511495237, 1048325585); + uint2x4 r1 = uint2x4(141582461, 17598216, 375336532, 1559644, 170828091, 301135042, 498370451, 780075943); + TestUtils.AreEqual(r1, a1 % b1); + + uint2x4 a2 = uint2x4(1754430321, 653235398, 1517128354, 966216200, 590067427, 1283434795, 1910903650, 1125967790); + uint2x4 b2 = uint2x4(1126739824, 666641241, 38017598, 418797691, 618700513, 1941062990, 158556432, 1081063558); + uint2x4 r2 = uint2x4(627690497, 653235398, 34442032, 128620818, 590067427, 1283434795, 8226466, 44904232); + TestUtils.AreEqual(r2, a2 % b2); + + uint2x4 a3 = uint2x4(1180537254, 308567230, 543945394, 483834400, 308703874, 383723801, 1181975437, 1161083599); + uint2x4 b3 = uint2x4(427329468, 148111230, 1251162672, 1856322297, 1214781084, 401954255, 1323259633, 1167744452); + uint2x4 r3 = uint2x4(325878318, 12344770, 543945394, 483834400, 308703874, 383723801, 1181975437, 1161083599); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void uint2x4_operator_mod_wide_scalar() + { + uint2x4 a0 = uint2x4(560988938, 629524514, 767711194, 434281967, 1399805893, 792916846, 1663690927, 598661916); + uint b0 = (1156862367); + uint2x4 r0 = uint2x4(560988938, 629524514, 767711194, 434281967, 242943526, 792916846, 506828560, 598661916); + TestUtils.AreEqual(r0, a0 % b0); + + uint2x4 a1 = uint2x4(1776636144, 1743722161, 475209785, 327476870, 1617696916, 379853074, 477430114, 858399046); + uint b1 = (1287035793); + uint2x4 r1 = uint2x4(489600351, 456686368, 475209785, 327476870, 330661123, 379853074, 477430114, 858399046); + TestUtils.AreEqual(r1, a1 % b1); + + uint2x4 a2 = uint2x4(712734431, 199829950, 362269020, 1986626876, 1351725413, 1549678101, 431765276, 1315833792); + uint b2 = (1506629323); + uint2x4 r2 = uint2x4(712734431, 199829950, 362269020, 479997553, 1351725413, 43048778, 431765276, 1315833792); + TestUtils.AreEqual(r2, a2 % b2); + + uint2x4 a3 = uint2x4(1664893153, 780055604, 104179235, 629966219, 1810536428, 1747026206, 1799535061, 875754431); + uint b3 = (615834034); + uint2x4 r3 = uint2x4(433225085, 164221570, 104179235, 14132185, 578868360, 515358138, 567866993, 259920397); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void uint2x4_operator_mod_scalar_wide() + { + uint a0 = (933347930); + uint2x4 b0 = uint2x4(549923387, 243114953, 1884274390, 1428033594, 655531454, 1622674954, 1107563514, 1614111094); + uint2x4 r0 = uint2x4(383424543, 204003071, 933347930, 933347930, 277816476, 933347930, 933347930, 933347930); + TestUtils.AreEqual(r0, a0 % b0); + + uint a1 = (914801920); + uint2x4 b1 = uint2x4(1432263179, 564431096, 1967013901, 1709750152, 1080102613, 13120773, 2042535998, 1505698002); + uint2x4 r1 = uint2x4(914801920, 350370824, 914801920, 914801920, 914801920, 9468583, 914801920, 914801920); + TestUtils.AreEqual(r1, a1 % b1); + + uint a2 = (1640058084); + uint2x4 b2 = uint2x4(974167554, 758635306, 1387264978, 611743343, 1139002766, 1913935748, 1086810076, 991846486); + uint2x4 r2 = uint2x4(665890530, 122787472, 252793106, 416571398, 501055318, 1640058084, 553248008, 648211598); + TestUtils.AreEqual(r2, a2 % b2); + + uint a3 = (922870408); + uint2x4 b3 = uint2x4(35007468, 891877602, 157349181, 83267982, 801093706, 546272767, 1665089132, 1889242068); + uint2x4 r3 = uint2x4(12676240, 30992806, 136124503, 6922606, 121776702, 376597641, 922870408, 922870408); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void uint2x4_operator_plus() + { + uint2x4 a0 = uint2x4(195392567, 222719748, 1002351013, 1570765263, 109389333, 1515950277, 1689763402, 291471785); + uint2x4 r0 = uint2x4(195392567, 222719748, 1002351013, 1570765263, 109389333, 1515950277, 1689763402, 291471785); + TestUtils.AreEqual(r0, +a0); + + uint2x4 a1 = uint2x4(264115671, 195779102, 2131702223, 715660442, 1995564647, 69731564, 1317851903, 1957501908); + uint2x4 r1 = uint2x4(264115671, 195779102, 2131702223, 715660442, 1995564647, 69731564, 1317851903, 1957501908); + TestUtils.AreEqual(r1, +a1); + + uint2x4 a2 = uint2x4(531426536, 1334133318, 1539671418, 935436165, 1575048895, 2119066258, 781435471, 1659000230); + uint2x4 r2 = uint2x4(531426536, 1334133318, 1539671418, 935436165, 1575048895, 2119066258, 781435471, 1659000230); + TestUtils.AreEqual(r2, +a2); + + uint2x4 a3 = uint2x4(1301861249, 1360657696, 578750954, 150348334, 1791553179, 1288641627, 735146513, 328684789); + uint2x4 r3 = uint2x4(1301861249, 1360657696, 578750954, 150348334, 1791553179, 1288641627, 735146513, 328684789); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void uint2x4_operator_neg() + { + uint2x4 a0 = uint2x4(1385088677, 94114564, 1350664872, 1458616659, 2067164853, 218122493, 958484951, 270553961); + uint2x4 r0 = uint2x4(2909878619, 4200852732, 2944302424, 2836350637, 2227802443, 4076844803, 3336482345, 4024413335); + TestUtils.AreEqual(r0, -a0); + + uint2x4 a1 = uint2x4(446497525, 1928771252, 1427605822, 2051940607, 1434247484, 485368391, 908365416, 1742096480); + uint2x4 r1 = uint2x4(3848469771, 2366196044, 2867361474, 2243026689, 2860719812, 3809598905, 3386601880, 2552870816); + TestUtils.AreEqual(r1, -a1); + + uint2x4 a2 = uint2x4(990033169, 1350976157, 12802586, 1934372287, 576597401, 785136322, 559205611, 1959833280); + uint2x4 r2 = uint2x4(3304934127, 2943991139, 4282164710, 2360595009, 3718369895, 3509830974, 3735761685, 2335134016); + TestUtils.AreEqual(r2, -a2); + + uint2x4 a3 = uint2x4(162379661, 95281343, 1969004480, 1381288239, 252975075, 1961335692, 1607042487, 832886233); + uint2x4 r3 = uint2x4(4132587635, 4199685953, 2325962816, 2913679057, 4041992221, 2333631604, 2687924809, 3462081063); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void uint2x4_operator_prefix_inc() + { + uint2x4 a0 = uint2x4(780471723, 954741756, 272723451, 2142862245, 606294309, 1514814550, 250124151, 444189162); + uint2x4 r0 = uint2x4(780471724, 954741757, 272723452, 2142862246, 606294310, 1514814551, 250124152, 444189163); + TestUtils.AreEqual(r0, ++a0); + + uint2x4 a1 = uint2x4(1833356994, 1348278302, 129540735, 1584496757, 1170613526, 986715680, 1701179230, 1397451003); + uint2x4 r1 = uint2x4(1833356995, 1348278303, 129540736, 1584496758, 1170613527, 986715681, 1701179231, 1397451004); + TestUtils.AreEqual(r1, ++a1); + + uint2x4 a2 = uint2x4(483952900, 1268688387, 2014528731, 453850931, 1112537171, 621362788, 2063486914, 1612870531); + uint2x4 r2 = uint2x4(483952901, 1268688388, 2014528732, 453850932, 1112537172, 621362789, 2063486915, 1612870532); + TestUtils.AreEqual(r2, ++a2); + + uint2x4 a3 = uint2x4(1161037742, 1583359796, 82587894, 810087437, 72436569, 1094485773, 912422931, 1011314676); + uint2x4 r3 = uint2x4(1161037743, 1583359797, 82587895, 810087438, 72436570, 1094485774, 912422932, 1011314677); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void uint2x4_operator_postfix_inc() + { + uint2x4 a0 = uint2x4(241865086, 2145821641, 1596166022, 803592338, 529551271, 1656767229, 903047443, 1213663244); + uint2x4 r0 = uint2x4(241865086, 2145821641, 1596166022, 803592338, 529551271, 1656767229, 903047443, 1213663244); + TestUtils.AreEqual(r0, a0++); + + uint2x4 a1 = uint2x4(1425753247, 389844650, 1159795446, 1343289659, 1227160199, 947635082, 137930180, 451018043); + uint2x4 r1 = uint2x4(1425753247, 389844650, 1159795446, 1343289659, 1227160199, 947635082, 137930180, 451018043); + TestUtils.AreEqual(r1, a1++); + + uint2x4 a2 = uint2x4(1634297552, 1176922170, 388721494, 2381860, 2062858295, 715101397, 1725384327, 446867079); + uint2x4 r2 = uint2x4(1634297552, 1176922170, 388721494, 2381860, 2062858295, 715101397, 1725384327, 446867079); + TestUtils.AreEqual(r2, a2++); + + uint2x4 a3 = uint2x4(2101314783, 1683365096, 1319511974, 1418603655, 1938539756, 592683318, 1576213022, 1150548583); + uint2x4 r3 = uint2x4(2101314783, 1683365096, 1319511974, 1418603655, 1938539756, 592683318, 1576213022, 1150548583); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void uint2x4_operator_prefix_dec() + { + uint2x4 a0 = uint2x4(1331961415, 1612382200, 1401591249, 2042075388, 1757136546, 1895858159, 1467742422, 578341664); + uint2x4 r0 = uint2x4(1331961414, 1612382199, 1401591248, 2042075387, 1757136545, 1895858158, 1467742421, 578341663); + TestUtils.AreEqual(r0, --a0); + + uint2x4 a1 = uint2x4(1336115745, 1169239112, 1862369220, 312317355, 1027543764, 1595492535, 1426262619, 1426620468); + uint2x4 r1 = uint2x4(1336115744, 1169239111, 1862369219, 312317354, 1027543763, 1595492534, 1426262618, 1426620467); + TestUtils.AreEqual(r1, --a1); + + uint2x4 a2 = uint2x4(674685792, 1459529624, 2092317419, 107501474, 1261583506, 512900840, 1496855314, 777588547); + uint2x4 r2 = uint2x4(674685791, 1459529623, 2092317418, 107501473, 1261583505, 512900839, 1496855313, 777588546); + TestUtils.AreEqual(r2, --a2); + + uint2x4 a3 = uint2x4(617644613, 625907330, 1452782388, 804650978, 2076275981, 120447533, 262357170, 1887136873); + uint2x4 r3 = uint2x4(617644612, 625907329, 1452782387, 804650977, 2076275980, 120447532, 262357169, 1887136872); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void uint2x4_operator_postfix_dec() + { + uint2x4 a0 = uint2x4(1870005937, 1708534798, 704493460, 462940703, 2060593573, 228744869, 940247280, 1818778351); + uint2x4 r0 = uint2x4(1870005937, 1708534798, 704493460, 462940703, 2060593573, 228744869, 940247280, 1818778351); + TestUtils.AreEqual(r0, a0--); + + uint2x4 a1 = uint2x4(1015253889, 1401191870, 2080259851, 653673271, 140452688, 1928164223, 1760916301, 1174531383); + uint2x4 r1 = uint2x4(1015253889, 1401191870, 2080259851, 653673271, 140452688, 1928164223, 1760916301, 1174531383); + TestUtils.AreEqual(r1, a1--); + + uint2x4 a2 = uint2x4(634036198, 1669210509, 874927437, 1393579866, 471308632, 620865961, 220103745, 1407678826); + uint2x4 r2 = uint2x4(634036198, 1669210509, 874927437, 1393579866, 471308632, 620865961, 220103745, 1407678826); + TestUtils.AreEqual(r2, a2--); + + uint2x4 a3 = uint2x4(319906934, 488775250, 1681733117, 1916879863, 2060905976, 636358505, 1379709480, 451326084); + uint2x4 r3 = uint2x4(319906934, 488775250, 1681733117, 1916879863, 2060905976, 636358505, 1379709480, 451326084); + TestUtils.AreEqual(r3, a3--); + } + + [TestCompiler] + public static void uint2x4_operator_bitwise_and_wide_wide() + { + uint2x4 a0 = uint2x4(1055241304, 859321394, 1088358961, 2090949513, 300561740, 651904515, 1331035868, 2012752753); + uint2x4 b0 = uint2x4(749698416, 748105424, 1842764797, 9990577, 1989102105, 1666634755, 58116798, 868036607); + uint2x4 r0 = uint2x4(749024336, 537928720, 1087769137, 8409473, 277479432, 575816707, 55888540, 867707761); + TestUtils.AreEqual(r0, a0 & b0); + + uint2x4 a1 = uint2x4(1298126656, 53199569, 1752363533, 1303061302, 1929998247, 1504941434, 470682792, 713577376); + uint2x4 b1 = uint2x4(1420638875, 1308767169, 564040763, 478617502, 806150474, 674015378, 1505309955, 36064977); + uint2x4 r1 = uint2x4(1141707264, 33686209, 538087433, 209912598, 805855490, 136347666, 403178496, 33571456); + TestUtils.AreEqual(r1, a1 & b1); + + uint2x4 a2 = uint2x4(1493231658, 1340884669, 1577921467, 44846626, 1105094388, 1143008413, 333009589, 2116296009); + uint2x4 b2 = uint2x4(1779639327, 808650076, 1634437037, 1997568501, 1930853951, 1901503461, 1508772523, 2010961769); + uint2x4 r2 = uint2x4(1207967754, 2098204, 1074332585, 33572896, 1091986996, 1073782917, 298320545, 1979979081); + TestUtils.AreEqual(r2, a2 & b2); + + uint2x4 a3 = uint2x4(2067254825, 121795325, 2122365250, 1088796653, 1594120761, 965590824, 337823363, 1686791432); + uint2x4 b3 = uint2x4(1495957269, 1914669725, 1263994006, 491200541, 380703892, 282208487, 1416934135, 942735432); + uint2x4 r3 = uint2x4(1495420417, 33686173, 1241513986, 4530189, 369102864, 276834336, 337674883, 536870920); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void uint2x4_operator_bitwise_and_wide_scalar() + { + uint2x4 a0 = uint2x4(1513158868, 284695609, 734595037, 1566510707, 1601252476, 84213838, 314333543, 430856908); + uint b0 = (1173647397); + uint2x4 r0 = uint2x4(1076916228, 15732769, 29360133, 1163132961, 1164976164, 84148228, 11816997, 27545604); + TestUtils.AreEqual(r0, a0 & b0); + + uint2x4 a1 = uint2x4(753481263, 1619794917, 2143619546, 1873208293, 126982769, 651482651, 1383096952, 1689107088); + uint b1 = (327392481); + uint2x4 r1 = uint2x4(8459297, 8394977, 327223488, 58884321, 58824801, 41980929, 301989984, 8493184); + TestUtils.AreEqual(r1, a1 & b1); + + uint2x4 a2 = uint2x4(1368301071, 1729929586, 989550739, 1914435619, 1592791064, 2047510829, 678485991, 586400261); + uint b2 = (366962092); + uint2x4 r2 = uint2x4(294519820, 85729568, 282804352, 270229536, 349175816, 269091116, 5260708, 13844484); + TestUtils.AreEqual(r2, a2 & b2); + + uint2x4 a3 = uint2x4(771972179, 131945492, 1707451796, 394184188, 1943201012, 558008097, 1070093422, 34324916); + uint b3 = (309059606); + uint2x4 r3 = uint2x4(33767442, 38354964, 4300820, 308985876, 306372628, 4358144, 306724870, 34324500); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void uint2x4_operator_bitwise_and_scalar_wide() + { + uint a0 = (477163326); + uint2x4 b0 = uint2x4(110453385, 703240362, 2075630560, 1884904031, 1734899436, 947945203, 1664399051, 458879298); + uint2x4 r0 = uint2x4(68182536, 140544042, 405834528, 273697310, 73426476, 402681394, 3188234, 407953666); + TestUtils.AreEqual(r0, a0 & b0); + + uint a1 = (158491426); + uint2x4 b1 = uint2x4(79772356, 2054527944, 202228212, 359225061, 639811396, 1821945318, 1821303024, 2030124055); + uint2x4 r1 = uint2x4(4203008, 141558528, 134234400, 23085600, 2237184, 135274786, 134373408, 151003138); + TestUtils.AreEqual(r1, a1 & b1); + + uint a2 = (1985961756); + uint2x4 b2 = uint2x4(579780373, 2061831301, 1139618293, 1145191868, 1121606282, 1414714065, 688688277, 1508875606); + uint2x4 r2 = uint2x4(571350804, 1917127684, 1112346900, 1145183516, 1113217544, 1414681104, 537660436, 1347362068); + TestUtils.AreEqual(r2, a2 & b2); + + uint a3 = (664318814); + uint2x4 b3 = uint2x4(2092766410, 1010043618, 599967779, 47076367, 1325716015, 1119912335, 2083412385, 1805692137); + uint2x4 r3 = uint2x4(613945418, 605028930, 595623938, 42471438, 117477902, 41976078, 604508416, 595632200); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void uint2x4_operator_bitwise_or_wide_wide() + { + uint2x4 a0 = uint2x4(1920951869, 1750772852, 1420019191, 732977093, 1169579447, 229437930, 1966721348, 2039812323); + uint2x4 b0 = uint2x4(214585254, 275414367, 858759675, 190211455, 1218691723, 2129565457, 1862809466, 495728846); + uint2x4 r0 = uint2x4(2130669503, 2021326207, 2008016383, 737572863, 1303895999, 2146367483, 2134507390, 2107455727); + TestUtils.AreEqual(r0, a0 | b0); + + uint2x4 a1 = uint2x4(113550869, 1912038362, 1569990624, 1490718227, 1686257697, 2137727522, 1569900650, 856504729); + uint2x4 b1 = uint2x4(868064152, 1756913766, 933656055, 247722084, 1884195075, 1804207631, 1913174711, 1815920856); + uint2x4 r1 = uint2x4(939376541, 2046780414, 2142664695, 1591475831, 1959708963, 2146117167, 2140863231, 2134768089); + TestUtils.AreEqual(r1, a1 | b1); + + uint2x4 a2 = uint2x4(2033376384, 2086259889, 671790684, 1189001916, 1756048437, 417084592, 2024165808, 966008272); + uint2x4 b2 = uint2x4(1226577606, 1696467642, 186912044, 1778908130, 1461256625, 1142152181, 272117331, 1162254035); + uint2x4 r2 = uint2x4(2034163398, 2103430843, 724483964, 1860172798, 2142973365, 1558183925, 2025750515, 2111217619); + TestUtils.AreEqual(r2, a2 | b2); + + uint2x4 a3 = uint2x4(2031026290, 1461019191, 1071959084, 1645847295, 871350674, 736640317, 868515800, 767794452); + uint2x4 b3 = uint2x4(870448102, 1845053992, 257334526, 987295814, 1503050768, 1683307763, 1076253109, 1403888383); + uint2x4 r3 = uint2x4(2079325174, 2147314239, 1073143038, 2061103871, 2080374162, 1878867455, 1944485885, 2146418687); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void uint2x4_operator_bitwise_or_wide_scalar() + { + uint2x4 a0 = uint2x4(1295304853, 1307252624, 350194630, 1128063578, 1774824542, 2085245467, 1988423804, 999162350); + uint b0 = (1305527136); + uint2x4 r0 = uint2x4(1307888629, 1308350448, 1574947814, 1341973370, 1842999166, 2111492987, 2144662396, 2145305582); + TestUtils.AreEqual(r0, a0 | b0); + + uint2x4 a1 = uint2x4(2110327307, 341855232, 1317039676, 228656898, 41280811, 1536908787, 606786773, 1739461580); + uint b1 = (1050875188); + uint2x4 r1 = uint2x4(2146115391, 1055087924, 2124644156, 1067652918, 1056437567, 2142985719, 1051448821, 2142181372); + TestUtils.AreEqual(r1, a1 | b1); + + uint2x4 a2 = uint2x4(2040936581, 1377874553, 1522262112, 1496806239, 1732466858, 1535976093, 375675620, 1614193383); + uint b2 = (1350320187); + uint2x4 r2 = uint2x4(2046720191, 1383920251, 1526718587, 1501524863, 2004834491, 1543332543, 1450990335, 1887363839); + TestUtils.AreEqual(r2, a2 | b2); + + uint2x4 a3 = uint2x4(226059393, 112556963, 1614163749, 1583289054, 1370656810, 1286074530, 1155438844, 1835671387); + uint b3 = (697385997); + uint2x4 r3 = uint2x4(771318925, 800423855, 1773629229, 2145343199, 2041828399, 1840772271, 1843387645, 1845190495); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void uint2x4_operator_bitwise_or_scalar_wide() + { + uint a0 = (1768627592); + uint2x4 b0 = uint2x4(1849658052, 1759912154, 729979455, 975926310, 1987690876, 1809506714, 1160695341, 408963395); + uint2x4 r0 = uint2x4(1870634956, 1777286618, 1810603967, 2070642094, 2138824188, 1811676570, 1836048301, 2037079499); + TestUtils.AreEqual(r0, a0 | b0); + + uint a1 = (314072711); + uint2x4 b1 = uint2x4(1560007537, 1709003416, 977086639, 1448375596, 1689568808, 595543345, 559778387, 621080913); + uint2x4 r1 = uint2x4(1593565175, 2013093535, 985497263, 1459388335, 1992089263, 872374199, 872275671, 935133143); + TestUtils.AreEqual(r1, a1 | b1); + + uint a2 = (438994183); + uint2x4 b2 = uint2x4(1742637145, 1219409263, 1602932494, 1204461702, 2111538444, 836730895, 1207638621, 802100209); + uint2x4 r2 = uint2x4(2147388767, 1521399151, 1605029647, 1609213319, 2147190031, 1006601487, 1610325855, 1072666615); + TestUtils.AreEqual(r2, a2 | b2); + + uint a3 = (1089077339); + uint2x4 b3 = uint2x4(1315030334, 249047666, 1604790897, 1848168086, 347254235, 1777613639, 1876731927, 842785732); + uint2x4 r3 = uint2x4(1324074367, 1325017723, 1609509499, 1860882143, 1425714651, 1778269023, 1878960223, 1929110495); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void uint2x4_operator_bitwise_xor_wide_wide() + { + uint2x4 a0 = uint2x4(1843655608, 362425681, 640805534, 1342040268, 945678755, 980321850, 390165019, 1682422658); + uint2x4 b0 = uint2x4(1422803441, 1234691140, 119589253, 1101464929, 121896337, 1880109018, 1000210266, 1718938232); + uint2x4 r0 = uint2x4(959296073, 1544407317, 554771227, 240840109, 1058935858, 1249815008, 752651585, 36917754); + TestUtils.AreEqual(r0, a0 ^ b0); + + uint2x4 a1 = uint2x4(303897251, 230477768, 1103646442, 1503102919, 26631152, 1016475570, 1862440929, 379588576); + uint2x4 b1 = uint2x4(464406940, 884337881, 34199854, 1430659227, 126415540, 1069919967, 1810763253, 2082802224); + uint2x4 r1 = uint2x4(162747199, 956900113, 1136760772, 215066460, 102672708, 55804269, 82614804, 1787102672); + TestUtils.AreEqual(r1, a1 ^ b1); + + uint2x4 a2 = uint2x4(1943580404, 691527166, 723280696, 497086939, 1640104913, 893178410, 1596765788, 664096470); + uint2x4 b2 = uint2x4(941097951, 27782297, 156353074, 607061607, 470737131, 1151564598, 8268481, 434405645); + uint2x4 r2 = uint2x4(1270918443, 680538471, 575512842, 965736380, 2110579514, 1906288924, 1599249565, 1047646171); + TestUtils.AreEqual(r2, a2 ^ b2); + + uint2x4 a3 = uint2x4(2043360590, 799560121, 287637604, 696169196, 2067184169, 1208059988, 1250597330, 1386507647); + uint2x4 b3 = uint2x4(519003095, 1880915120, 608970922, 1809455754, 1079250101, 514389994, 272120301, 1282399149); + uint2x4 r3 = uint2x4(1730440857, 1605643529, 896084174, 1118087270, 996325020, 1453948862, 1521655871, 516667090); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void uint2x4_operator_bitwise_xor_wide_scalar() + { + uint2x4 a0 = uint2x4(169345668, 176087064, 2084362901, 1663924004, 193851255, 517476661, 905336222, 863800783); + uint b0 = (354464228); + uint2x4 r0 = uint2x4(523809632, 526275068, 1763470193, 1980614336, 514678419, 200843473, 550954106, 643578923); + TestUtils.AreEqual(r0, a0 ^ b0); + + uint2x4 a1 = uint2x4(365003873, 954341348, 1464576786, 625604047, 1700827127, 2003392824, 1481813598, 1077374714); + uint b1 = (835837496); + uint2x4 r1 = uint2x4(605051481, 154388956, 1721398570, 345517047, 1420906959, 1186498304, 1770221670, 1910943938); + TestUtils.AreEqual(r1, a1 ^ b1); + + uint2x4 a2 = uint2x4(1043379893, 781860967, 60088394, 1196907956, 858716109, 858484213, 178843494, 1223183458); + uint b2 = (1991576049); + uint2x4 r2 = uint2x4(1216724804, 1479494038, 1965156795, 836916293, 1167851068, 1168008196, 2082334359, 1046300051); + TestUtils.AreEqual(r2, a2 ^ b2); + + uint2x4 a3 = uint2x4(866652388, 1206307664, 2037729583, 1324393116, 497725784, 1367278685, 962962860, 906632547); + uint b3 = (1771693181); + uint2x4 r3 = uint2x4(1513223321, 780087085, 283946322, 661210849, 1949521189, 954654752, 1358709201, 1603533086); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void uint2x4_operator_bitwise_xor_scalar_wide() + { + uint a0 = (1361775641); + uint2x4 b0 = uint2x4(1452773578, 459050892, 1986218254, 1689037698, 999278344, 1229114508, 1087843538, 733699740); + uint2x4 r0 = uint2x4(129801427, 1249346453, 659047703, 898082715, 1789184785, 409583765, 301736139, 2056278661); + TestUtils.AreEqual(r0, a0 ^ b0); + + uint a1 = (106187872); + uint2x4 b1 = uint2x4(1533632738, 1107817672, 492506236, 597602329, 1439603382, 1001169118, 1231718216, 1693179077); + uint2x4 r1 = uint2x4(1564290178, 1146337448, 453984284, 634059897, 1402656470, 1039723710, 1329515304, 1656721573); + TestUtils.AreEqual(r1, a1 ^ b1); + + uint a2 = (1050897427); + uint2x4 b2 = uint2x4(1796435561, 1100532547, 2106589181, 79691722, 851486414, 381749210, 1743618507, 2038827673); + uint2x4 r2 = uint2x4(1437598330, 2134615888, 1126994926, 974951385, 207866589, 677538761, 1498344920, 1193633418); + TestUtils.AreEqual(r2, a2 ^ b2); + + uint a3 = (1680906962); + uint2x4 b3 = uint2x4(161437943, 171927307, 277703584, 1344718195, 1634011177, 28540247, 1205447252, 150341716); + uint2x4 r3 = uint2x4(1840235045, 1846541785, 1958605170, 873881505, 89494267, 1703143301, 602484870, 1824952966); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void uint2x4_operator_left_shift() + { + uint2x4 a0 = uint2x4(1129100049, 829482269, 1571297368, 443753193, 1872142968, 249554593, 892627436, 980302862); + int b0 = (218351941); + uint2x4 r0 = uint2x4(1771463200, 773628832, 3036875520, 1315200288, 4074000128, 3690779680, 2794274176, 1304920512); + TestUtils.AreEqual(r0, a0 << b0); + + uint2x4 a1 = uint2x4(62369727, 1271350845, 108441902, 1959056531, 1779118882, 1451674188, 2082026915, 1149883636); + int b1 = (849916599); + uint2x4 r1 = uint2x4(3749707776, 511705088, 2533359616, 1233125376, 2432696320, 637534208, 3514826752, 2046820352); + TestUtils.AreEqual(r1, a1 << b1); + + uint2x4 a2 = uint2x4(1380536034, 1487486874, 1498738574, 752067504, 1647167336, 772453640, 456967739, 947384545); + int b2 = (186532735); + uint2x4 r2 = uint2x4(0, 0, 0, 0, 0, 0, 2147483648, 2147483648); + TestUtils.AreEqual(r2, a2 << b2); + + uint2x4 a3 = uint2x4(1463252873, 640579158, 56630178, 1650899378, 2142944517, 565484033, 965161323, 1634169280); + int b3 = (1315516161); + uint2x4 r3 = uint2x4(2926505746, 1281158316, 113260356, 3301798756, 4285889034, 1130968066, 1930322646, 3268338560); + TestUtils.AreEqual(r3, a3 << b3); + } + + [TestCompiler] + public static void uint2x4_operator_right_shift() + { + uint2x4 a0 = uint2x4(809126085, 908563670, 763568837, 1986717290, 1174507510, 646821842, 1242726074, 390811632); + int b0 = (994800051); + uint2x4 r0 = uint2x4(1543, 1732, 1456, 3789, 2240, 1233, 2370, 745); + TestUtils.AreEqual(r0, a0 >> b0); + + uint2x4 a1 = uint2x4(1521420393, 102096936, 400863878, 667378673, 1611921244, 307750782, 479442287, 2014389412); + int b1 = (1923166649); + uint2x4 r1 = uint2x4(45, 3, 11, 19, 48, 9, 14, 60); + TestUtils.AreEqual(r1, a1 >> b1); + + uint2x4 a2 = uint2x4(1673938174, 1248577253, 848199210, 813936577, 848976170, 500930883, 662405800, 126875849); + int b2 = (1075916177); + uint2x4 r2 = uint2x4(12771, 9525, 6471, 6209, 6477, 3821, 5053, 967); + TestUtils.AreEqual(r2, a2 >> b2); + + uint2x4 a3 = uint2x4(1103917083, 955487090, 1013356510, 391605984, 185228398, 87452680, 2021602226, 1401766495); + int b3 = (1199000503); + uint2x4 r3 = uint2x4(131, 113, 120, 46, 22, 10, 240, 167); + TestUtils.AreEqual(r3, a3 >> b3); + } + + [TestCompiler] + public static void uint2x4_operator_bitwise_not() + { + uint2x4 a0 = uint2x4(111796841, 603562399, 745091931, 853183268, 1110916612, 381888399, 1891338755, 1506860135); + uint2x4 r0 = uint2x4(4183170454, 3691404896, 3549875364, 3441784027, 3184050683, 3913078896, 2403628540, 2788107160); + TestUtils.AreEqual(r0, ~a0); + + uint2x4 a1 = uint2x4(771210628, 875964607, 96456785, 916013379, 203444882, 1172294211, 1020232736, 683852713); + uint2x4 r1 = uint2x4(3523756667, 3419002688, 4198510510, 3378953916, 4091522413, 3122673084, 3274734559, 3611114582); + TestUtils.AreEqual(r1, ~a1); + + uint2x4 a2 = uint2x4(375158799, 1218471344, 1174233245, 592898220, 443427914, 1385118179, 215320517, 860122767); + uint2x4 r2 = uint2x4(3919808496, 3076495951, 3120734050, 3702069075, 3851539381, 2909849116, 4079646778, 3434844528); + TestUtils.AreEqual(r2, ~a2); + + uint2x4 a3 = uint2x4(1411266016, 686325107, 829984855, 191189901, 319233142, 156019905, 1467719681, 1193642973); + uint2x4 r3 = uint2x4(2883701279, 3608642188, 3464982440, 4103777394, 3975734153, 4138947390, 2827247614, 3101324322); + TestUtils.AreEqual(r3, ~a3); + } + + [TestCase /* For player builds */] + public static void uint2x4_EqualsObjectOverride() + { + TestUtils.IsFalse(new uint2x4().Equals((object)new int())); + TestUtils.IsTrue(new uint2x4().Equals((object)new uint2x4())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestUint2x4.gen.cs.meta b/src/Tests/Tests/Shared/TestUint2x4.gen.cs.meta new file mode 100644 index 00000000..7ef0b944 --- /dev/null +++ b/src/Tests/Tests/Shared/TestUint2x4.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 27ff3548fed6aa741b4d1d7cb7a291e2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestUint3.gen.cs b/src/Tests/Tests/Shared/TestUint3.gen.cs new file mode 100644 index 00000000..6443db9b --- /dev/null +++ b/src/Tests/Tests/Shared/TestUint3.gen.cs @@ -0,0 +1,1353 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestUint3 + { + [TestCompiler] + public static void uint3_zero() + { + TestUtils.AreEqual(0u, uint3.zero.x); + TestUtils.AreEqual(0u, uint3.zero.y); + TestUtils.AreEqual(0u, uint3.zero.z); + } + + [TestCompiler] + public static void uint3_constructor() + { + uint3 a = new uint3(1, 2, 3); + TestUtils.AreEqual(1, a.x); + TestUtils.AreEqual(2, a.y); + TestUtils.AreEqual(3, a.z); + } + + [TestCompiler] + public static void uint3_scalar_constructor() + { + uint3 a = new uint3(17u); + TestUtils.AreEqual(17u, a.x); + TestUtils.AreEqual(17u, a.y); + TestUtils.AreEqual(17u, a.z); + } + + [TestCompiler] + public static void uint3_static_constructor() + { + uint3 a = uint3(1, 2, 3); + TestUtils.AreEqual(1, a.x); + TestUtils.AreEqual(2, a.y); + TestUtils.AreEqual(3, a.z); + } + + [TestCompiler] + public static void uint3_static_scalar_constructor() + { + uint3 a = uint3(17u); + TestUtils.AreEqual(17u, a.x); + TestUtils.AreEqual(17u, a.y); + TestUtils.AreEqual(17u, a.z); + } + + [TestCompiler] + public static void uint3_operator_equal_wide_wide() + { + uint3 a0 = uint3(2105871082, 35218899, 1550755093); + uint3 b0 = uint3(1477587886, 579629692, 540974792); + bool3 r0 = bool3(false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + uint3 a1 = uint3(764676020, 606743782, 1208156098); + uint3 b1 = uint3(208405066, 2063397938, 1060167409); + bool3 r1 = bool3(false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + uint3 a2 = uint3(1023640014, 1038468316, 1416064367); + uint3 b2 = uint3(362592601, 2097545362, 277670088); + bool3 r2 = bool3(false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + uint3 a3 = uint3(727143393, 2061243891, 184669837); + uint3 b3 = uint3(426944490, 901076223, 857900673); + bool3 r3 = bool3(false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void uint3_operator_equal_wide_scalar() + { + uint3 a0 = uint3(437822262, 2020661134, 541786900); + uint b0 = (1332833578); + bool3 r0 = bool3(false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + uint3 a1 = uint3(853113810, 179951405, 1409026299); + uint b1 = (23716499); + bool3 r1 = bool3(false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + uint3 a2 = uint3(948838849, 691955848, 1926262965); + uint b2 = (953202998); + bool3 r2 = bool3(false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + uint3 a3 = uint3(1851546137, 2028784869, 1049962241); + uint b3 = (712957637); + bool3 r3 = bool3(false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void uint3_operator_equal_scalar_wide() + { + uint a0 = (542329200); + uint3 b0 = uint3(1115584594, 684107773, 1928988941); + bool3 r0 = bool3(false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + uint a1 = (890709324); + uint3 b1 = uint3(641152437, 1410341302, 497505660); + bool3 r1 = bool3(false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + uint a2 = (1068223109); + uint3 b2 = uint3(2014009435, 213835595, 1592428361); + bool3 r2 = bool3(false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + uint a3 = (1819361470); + uint3 b3 = uint3(448650623, 1942175642, 64377057); + bool3 r3 = bool3(false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void uint3_operator_not_equal_wide_wide() + { + uint3 a0 = uint3(1977284100, 1293292704, 1547283851); + uint3 b0 = uint3(1514195556, 957972049, 507667364); + bool3 r0 = bool3(true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + uint3 a1 = uint3(422428953, 195833190, 1711544892); + uint3 b1 = uint3(581861672, 1128094576, 940096636); + bool3 r1 = bool3(true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + uint3 a2 = uint3(5606053, 737069074, 647386678); + uint3 b2 = uint3(57559040, 181752616, 962017320); + bool3 r2 = bool3(true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + uint3 a3 = uint3(13079405, 1413841590, 1076166545); + uint3 b3 = uint3(1762015406, 1107218953, 2042026522); + bool3 r3 = bool3(true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void uint3_operator_not_equal_wide_scalar() + { + uint3 a0 = uint3(1038269360, 1427812625, 103361237); + uint b0 = (768873026); + bool3 r0 = bool3(true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + uint3 a1 = uint3(1347017023, 150442802, 660334527); + uint b1 = (1523584313); + bool3 r1 = bool3(true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + uint3 a2 = uint3(719113717, 484398043, 506946952); + uint b2 = (262959423); + bool3 r2 = bool3(true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + uint3 a3 = uint3(226568494, 1702162286, 923269270); + uint b3 = (507918242); + bool3 r3 = bool3(true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void uint3_operator_not_equal_scalar_wide() + { + uint a0 = (1652127596); + uint3 b0 = uint3(953791238, 271722683, 1278885987); + bool3 r0 = bool3(true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + uint a1 = (735128017); + uint3 b1 = uint3(112416504, 25967222, 1761444475); + bool3 r1 = bool3(true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + uint a2 = (1844594536); + uint3 b2 = uint3(1199122922, 634219279, 942501101); + bool3 r2 = bool3(true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + uint a3 = (67161343); + uint3 b3 = uint3(969944293, 833229499, 1304301133); + bool3 r3 = bool3(true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void uint3_operator_less_wide_wide() + { + uint3 a0 = uint3(1486550609, 1779244308, 1602148045); + uint3 b0 = uint3(97842578, 536551311, 413528975); + bool3 r0 = bool3(false, false, false); + TestUtils.AreEqual(r0, a0 < b0); + + uint3 a1 = uint3(1614085440, 1975613414, 942838342); + uint3 b1 = uint3(1838293684, 1283898480, 1456599961); + bool3 r1 = bool3(true, false, true); + TestUtils.AreEqual(r1, a1 < b1); + + uint3 a2 = uint3(1092279031, 373677431, 1419098312); + uint3 b2 = uint3(1080278602, 529676676, 156584048); + bool3 r2 = bool3(false, true, false); + TestUtils.AreEqual(r2, a2 < b2); + + uint3 a3 = uint3(337757077, 1081797900, 1336745069); + uint3 b3 = uint3(117348799, 246927124, 1916615924); + bool3 r3 = bool3(false, false, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void uint3_operator_less_wide_scalar() + { + uint3 a0 = uint3(796797557, 670113454, 933579492); + uint b0 = (746564682); + bool3 r0 = bool3(false, true, false); + TestUtils.AreEqual(r0, a0 < b0); + + uint3 a1 = uint3(278884514, 1117630673, 741886928); + uint b1 = (318174822); + bool3 r1 = bool3(true, false, false); + TestUtils.AreEqual(r1, a1 < b1); + + uint3 a2 = uint3(1990922600, 1546212312, 1718582899); + uint b2 = (1030849597); + bool3 r2 = bool3(false, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + uint3 a3 = uint3(1648393417, 1909506562, 1294006045); + uint b3 = (1857132231); + bool3 r3 = bool3(true, false, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void uint3_operator_less_scalar_wide() + { + uint a0 = (186400299); + uint3 b0 = uint3(1881344229, 813834467, 1254886626); + bool3 r0 = bool3(true, true, true); + TestUtils.AreEqual(r0, a0 < b0); + + uint a1 = (1353590345); + uint3 b1 = uint3(1412343685, 1555571443, 1540508298); + bool3 r1 = bool3(true, true, true); + TestUtils.AreEqual(r1, a1 < b1); + + uint a2 = (1735458634); + uint3 b2 = uint3(135888070, 1643818742, 248291654); + bool3 r2 = bool3(false, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + uint a3 = (1739560105); + uint3 b3 = uint3(728539891, 480507742, 1696553040); + bool3 r3 = bool3(false, false, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void uint3_operator_greater_wide_wide() + { + uint3 a0 = uint3(2087717754, 1725569452, 1298066182); + uint3 b0 = uint3(85148514, 293632137, 1151128249); + bool3 r0 = bool3(true, true, true); + TestUtils.AreEqual(r0, a0 > b0); + + uint3 a1 = uint3(1693943616, 1319019629, 70674491); + uint3 b1 = uint3(409440398, 1115020183, 1508500597); + bool3 r1 = bool3(true, true, false); + TestUtils.AreEqual(r1, a1 > b1); + + uint3 a2 = uint3(1042499725, 1002821508, 1021857133); + uint3 b2 = uint3(1834583302, 1755218534, 1788761753); + bool3 r2 = bool3(false, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + uint3 a3 = uint3(1744374599, 821751047, 467646903); + uint3 b3 = uint3(1128238489, 834223713, 1578743290); + bool3 r3 = bool3(true, false, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void uint3_operator_greater_wide_scalar() + { + uint3 a0 = uint3(1208626274, 239697208, 1979453345); + uint b0 = (1715176566); + bool3 r0 = bool3(false, false, true); + TestUtils.AreEqual(r0, a0 > b0); + + uint3 a1 = uint3(1253474001, 1487911635, 1673945595); + uint b1 = (1590192876); + bool3 r1 = bool3(false, false, true); + TestUtils.AreEqual(r1, a1 > b1); + + uint3 a2 = uint3(1662650098, 1433540517, 566635217); + uint b2 = (222749855); + bool3 r2 = bool3(true, true, true); + TestUtils.AreEqual(r2, a2 > b2); + + uint3 a3 = uint3(1773305960, 206147145, 325913453); + uint b3 = (1850273578); + bool3 r3 = bool3(false, false, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void uint3_operator_greater_scalar_wide() + { + uint a0 = (480938827); + uint3 b0 = uint3(1824731899, 921496110, 586859044); + bool3 r0 = bool3(false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + uint a1 = (946430596); + uint3 b1 = uint3(1231356727, 1390167458, 1785807092); + bool3 r1 = bool3(false, false, false); + TestUtils.AreEqual(r1, a1 > b1); + + uint a2 = (28949024); + uint3 b2 = uint3(2037899283, 595656760, 1778095771); + bool3 r2 = bool3(false, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + uint a3 = (1233500439); + uint3 b3 = uint3(1696302238, 1445965340, 484020151); + bool3 r3 = bool3(false, false, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void uint3_operator_less_equal_wide_wide() + { + uint3 a0 = uint3(154092149, 1515170149, 1083970332); + uint3 b0 = uint3(77984380, 1712054191, 1566203809); + bool3 r0 = bool3(false, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + uint3 a1 = uint3(785807178, 1401094881, 310537627); + uint3 b1 = uint3(254834519, 450519938, 389457083); + bool3 r1 = bool3(false, false, true); + TestUtils.AreEqual(r1, a1 <= b1); + + uint3 a2 = uint3(868328962, 1990816725, 2035349541); + uint3 b2 = uint3(1298669505, 207343167, 1214449047); + bool3 r2 = bool3(true, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + uint3 a3 = uint3(457043352, 1123282035, 1001842946); + uint3 b3 = uint3(2059561026, 896534357, 1897470050); + bool3 r3 = bool3(true, false, true); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void uint3_operator_less_equal_wide_scalar() + { + uint3 a0 = uint3(1479531977, 1427983411, 415250630); + uint b0 = (2004563877); + bool3 r0 = bool3(true, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + uint3 a1 = uint3(1245345407, 1072990632, 1579912858); + uint b1 = (1112546666); + bool3 r1 = bool3(false, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + uint3 a2 = uint3(101048307, 509818792, 1910488590); + uint b2 = (1070894375); + bool3 r2 = bool3(true, true, false); + TestUtils.AreEqual(r2, a2 <= b2); + + uint3 a3 = uint3(85452501, 1246249980, 1097326500); + uint b3 = (518127023); + bool3 r3 = bool3(true, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void uint3_operator_less_equal_scalar_wide() + { + uint a0 = (1899193992); + uint3 b0 = uint3(915011820, 980913757, 1337699683); + bool3 r0 = bool3(false, false, false); + TestUtils.AreEqual(r0, a0 <= b0); + + uint a1 = (1476321359); + uint3 b1 = uint3(1102143668, 660493983, 184664508); + bool3 r1 = bool3(false, false, false); + TestUtils.AreEqual(r1, a1 <= b1); + + uint a2 = (381579707); + uint3 b2 = uint3(1954892821, 1295090571, 1440368586); + bool3 r2 = bool3(true, true, true); + TestUtils.AreEqual(r2, a2 <= b2); + + uint a3 = (1696003686); + uint3 b3 = uint3(88708652, 1332251857, 1310713644); + bool3 r3 = bool3(false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void uint3_operator_greater_equal_wide_wide() + { + uint3 a0 = uint3(8538378, 2131749726, 265427108); + uint3 b0 = uint3(903145828, 1697992986, 1432491982); + bool3 r0 = bool3(false, true, false); + TestUtils.AreEqual(r0, a0 >= b0); + + uint3 a1 = uint3(523609761, 994991818, 839709564); + uint3 b1 = uint3(169789504, 1059357300, 1744255222); + bool3 r1 = bool3(true, false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + uint3 a2 = uint3(101288202, 1886280970, 2032074826); + uint3 b2 = uint3(1606584463, 1905414425, 1448794969); + bool3 r2 = bool3(false, false, true); + TestUtils.AreEqual(r2, a2 >= b2); + + uint3 a3 = uint3(631221455, 1456286159, 961342752); + uint3 b3 = uint3(136181998, 1678754836, 2069656857); + bool3 r3 = bool3(true, false, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void uint3_operator_greater_equal_wide_scalar() + { + uint3 a0 = uint3(2049236663, 182691143, 634973382); + uint b0 = (1061998015); + bool3 r0 = bool3(true, false, false); + TestUtils.AreEqual(r0, a0 >= b0); + + uint3 a1 = uint3(1197012109, 1367606469, 1108037359); + uint b1 = (439837565); + bool3 r1 = bool3(true, true, true); + TestUtils.AreEqual(r1, a1 >= b1); + + uint3 a2 = uint3(351147187, 411667685, 1998610091); + uint b2 = (1898505669); + bool3 r2 = bool3(false, false, true); + TestUtils.AreEqual(r2, a2 >= b2); + + uint3 a3 = uint3(4652390, 2111455181, 727766399); + uint b3 = (996159180); + bool3 r3 = bool3(false, true, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void uint3_operator_greater_equal_scalar_wide() + { + uint a0 = (1859811087); + uint3 b0 = uint3(1070365918, 1783869452, 830091760); + bool3 r0 = bool3(true, true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + uint a1 = (377157428); + uint3 b1 = uint3(327199016, 90384229, 1154649706); + bool3 r1 = bool3(true, true, false); + TestUtils.AreEqual(r1, a1 >= b1); + + uint a2 = (376758501); + uint3 b2 = uint3(1079802834, 2054742898, 1328349472); + bool3 r2 = bool3(false, false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + uint a3 = (434061447); + uint3 b3 = uint3(951207723, 598695892, 975131651); + bool3 r3 = bool3(false, false, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void uint3_operator_add_wide_wide() + { + uint3 a0 = uint3(2135171378, 21433296, 1954723494); + uint3 b0 = uint3(1013431952, 366718162, 359290756); + uint3 r0 = uint3(3148603330, 388151458, 2314014250); + TestUtils.AreEqual(r0, a0 + b0); + + uint3 a1 = uint3(683604307, 1054212315, 1762680995); + uint3 b1 = uint3(1393163294, 1962236872, 1263270041); + uint3 r1 = uint3(2076767601, 3016449187, 3025951036); + TestUtils.AreEqual(r1, a1 + b1); + + uint3 a2 = uint3(1963655852, 1257853062, 2043493600); + uint3 b2 = uint3(1862666629, 1077447887, 821693806); + uint3 r2 = uint3(3826322481, 2335300949, 2865187406); + TestUtils.AreEqual(r2, a2 + b2); + + uint3 a3 = uint3(976898058, 1915056423, 121374462); + uint3 b3 = uint3(487316539, 350922520, 1583012528); + uint3 r3 = uint3(1464214597, 2265978943, 1704386990); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void uint3_operator_add_wide_scalar() + { + uint3 a0 = uint3(665815972, 1783729250, 1591678394); + uint b0 = (1334043849); + uint3 r0 = uint3(1999859821, 3117773099, 2925722243); + TestUtils.AreEqual(r0, a0 + b0); + + uint3 a1 = uint3(1284528538, 71069732, 1138577680); + uint b1 = (977850224); + uint3 r1 = uint3(2262378762, 1048919956, 2116427904); + TestUtils.AreEqual(r1, a1 + b1); + + uint3 a2 = uint3(1200356017, 1246759684, 1088001167); + uint b2 = (565982008); + uint3 r2 = uint3(1766338025, 1812741692, 1653983175); + TestUtils.AreEqual(r2, a2 + b2); + + uint3 a3 = uint3(57252642, 625943813, 512157429); + uint b3 = (678921480); + uint3 r3 = uint3(736174122, 1304865293, 1191078909); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void uint3_operator_add_scalar_wide() + { + uint a0 = (359966320); + uint3 b0 = uint3(2146146202, 767103309, 851002415); + uint3 r0 = uint3(2506112522, 1127069629, 1210968735); + TestUtils.AreEqual(r0, a0 + b0); + + uint a1 = (311531406); + uint3 b1 = uint3(1491262941, 1016891373, 1954228994); + uint3 r1 = uint3(1802794347, 1328422779, 2265760400); + TestUtils.AreEqual(r1, a1 + b1); + + uint a2 = (1671335850); + uint3 b2 = uint3(727870747, 551151834, 1390261152); + uint3 r2 = uint3(2399206597, 2222487684, 3061597002); + TestUtils.AreEqual(r2, a2 + b2); + + uint a3 = (1699060326); + uint3 b3 = uint3(115021619, 1964440175, 440700758); + uint3 r3 = uint3(1814081945, 3663500501, 2139761084); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void uint3_operator_sub_wide_wide() + { + uint3 a0 = uint3(1410318491, 1097280168, 1827039044); + uint3 b0 = uint3(1315897366, 799052018, 1580289673); + uint3 r0 = uint3(94421125, 298228150, 246749371); + TestUtils.AreEqual(r0, a0 - b0); + + uint3 a1 = uint3(28881338, 328720965, 875487868); + uint3 b1 = uint3(1094686261, 1954325726, 1197734816); + uint3 r1 = uint3(3229162373, 2669362535, 3972720348); + TestUtils.AreEqual(r1, a1 - b1); + + uint3 a2 = uint3(212936325, 231977215, 1740021315); + uint3 b2 = uint3(229886366, 915679176, 1746884850); + uint3 r2 = uint3(4278017255, 3611265335, 4288103761); + TestUtils.AreEqual(r2, a2 - b2); + + uint3 a3 = uint3(2011295463, 48079003, 591379285); + uint3 b3 = uint3(918743925, 1007797419, 257421324); + uint3 r3 = uint3(1092551538, 3335248880, 333957961); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void uint3_operator_sub_wide_scalar() + { + uint3 a0 = uint3(1508669340, 1594795463, 266707545); + uint b0 = (998008471); + uint3 r0 = uint3(510660869, 596786992, 3563666370); + TestUtils.AreEqual(r0, a0 - b0); + + uint3 a1 = uint3(643102647, 1475644328, 1113286221); + uint b1 = (287705008); + uint3 r1 = uint3(355397639, 1187939320, 825581213); + TestUtils.AreEqual(r1, a1 - b1); + + uint3 a2 = uint3(979450511, 1108005498, 304369206); + uint b2 = (2082174113); + uint3 r2 = uint3(3192243694, 3320798681, 2517162389); + TestUtils.AreEqual(r2, a2 - b2); + + uint3 a3 = uint3(999244508, 1994553647, 2101812429); + uint b3 = (1806482044); + uint3 r3 = uint3(3487729760, 188071603, 295330385); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void uint3_operator_sub_scalar_wide() + { + uint a0 = (893369501); + uint3 b0 = uint3(2051906184, 1699714311, 442603706); + uint3 r0 = uint3(3136430613, 3488622486, 450765795); + TestUtils.AreEqual(r0, a0 - b0); + + uint a1 = (1735141684); + uint3 b1 = uint3(274533585, 811580259, 1196354320); + uint3 r1 = uint3(1460608099, 923561425, 538787364); + TestUtils.AreEqual(r1, a1 - b1); + + uint a2 = (1524097023); + uint3 b2 = uint3(533621527, 2080845793, 143958837); + uint3 r2 = uint3(990475496, 3738218526, 1380138186); + TestUtils.AreEqual(r2, a2 - b2); + + uint a3 = (1620668660); + uint3 b3 = uint3(1135989346, 1367044745, 554088609); + uint3 r3 = uint3(484679314, 253623915, 1066580051); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void uint3_operator_mul_wide_wide() + { + uint3 a0 = uint3(61417577, 219585476, 1362520891); + uint3 b0 = uint3(578042444, 1620527213, 200516468); + uint3 r0 = uint3(2868103468, 1326150260, 3304073148); + TestUtils.AreEqual(r0, a0 * b0); + + uint3 a1 = uint3(1511084277, 1481211272, 58211871); + uint3 b1 = uint3(309339115, 542853019, 299467282); + uint3 r1 = uint3(2972110823, 1973926232, 88546350); + TestUtils.AreEqual(r1, a1 * b1); + + uint3 a2 = uint3(1459591173, 567624644, 1169935583); + uint3 b2 = uint3(1479641221, 1428338601, 1497302909); + uint3 r2 = uint3(3431047833, 3712145508, 556671459); + TestUtils.AreEqual(r2, a2 * b2); + + uint3 a3 = uint3(1835691886, 385626539, 85934842); + uint3 b3 = uint3(1596889147, 427413842, 265122693); + uint3 r3 = uint3(1098186330, 1848083398, 4236646882); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void uint3_operator_mul_wide_scalar() + { + uint3 a0 = uint3(871746615, 492532311, 570557670); + uint b0 = (442064533); + uint3 r0 = uint3(338365955, 1081376419, 2565819870); + TestUtils.AreEqual(r0, a0 * b0); + + uint3 a1 = uint3(2142306629, 1526163563, 118471734); + uint b1 = (1610315153); + uint3 r1 = uint3(310198549, 2932083611, 3286255766); + TestUtils.AreEqual(r1, a1 * b1); + + uint3 a2 = uint3(257439514, 1186560810, 1584938026); + uint b2 = (364291059); + uint3 r2 = uint3(172874670, 1029154526, 1917573598); + TestUtils.AreEqual(r2, a2 * b2); + + uint3 a3 = uint3(1357601203, 268562104, 1007838321); + uint b3 = (638897141); + uint3 r3 = uint3(2774124879, 3498401304, 2987637541); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void uint3_operator_mul_scalar_wide() + { + uint a0 = (1152242766); + uint3 b0 = uint3(1276636134, 2105929407, 499007702); + uint3 r0 = uint3(2165463060, 999811634, 1179056436); + TestUtils.AreEqual(r0, a0 * b0); + + uint a1 = (124002565); + uint3 b1 = uint3(1956335172, 1288034953, 832676555); + uint3 r1 = uint3(3132050260, 495775149, 4067449079); + TestUtils.AreEqual(r1, a1 * b1); + + uint a2 = (337389733); + uint3 b2 = uint3(99268757, 2005055247, 2011389505); + uint3 r2 = uint3(1366048777, 2776519851, 794945509); + TestUtils.AreEqual(r2, a2 * b2); + + uint a3 = (1348110859); + uint3 b3 = uint3(399689191, 2007606374, 2076691289); + uint3 r3 = uint3(1743980269, 1120210018, 1383970515); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void uint3_operator_div_wide_wide() + { + uint3 a0 = uint3(333171510, 858154903, 1181365836); + uint3 b0 = uint3(698897823, 440199998, 655557473); + uint3 r0 = uint3(0, 1, 1); + TestUtils.AreEqual(r0, a0 / b0); + + uint3 a1 = uint3(671357749, 1090606752, 803759420); + uint3 b1 = uint3(1658534285, 2127220100, 315653188); + uint3 r1 = uint3(0, 0, 2); + TestUtils.AreEqual(r1, a1 / b1); + + uint3 a2 = uint3(788404166, 296807814, 575260195); + uint3 b2 = uint3(1814290360, 992173243, 914851653); + uint3 r2 = uint3(0, 0, 0); + TestUtils.AreEqual(r2, a2 / b2); + + uint3 a3 = uint3(166625280, 1493729000, 1831739736); + uint3 b3 = uint3(664340325, 224323977, 246981573); + uint3 r3 = uint3(0, 6, 7); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void uint3_operator_div_wide_scalar() + { + uint3 a0 = uint3(1433072926, 1073958635, 1195142312); + uint b0 = (1434025872); + uint3 r0 = uint3(0, 0, 0); + TestUtils.AreEqual(r0, a0 / b0); + + uint3 a1 = uint3(536596719, 464756346, 806462546); + uint b1 = (1274375693); + uint3 r1 = uint3(0, 0, 0); + TestUtils.AreEqual(r1, a1 / b1); + + uint3 a2 = uint3(906504670, 25493909, 1196815948); + uint b2 = (1380905136); + uint3 r2 = uint3(0, 0, 0); + TestUtils.AreEqual(r2, a2 / b2); + + uint3 a3 = uint3(123300377, 2084019932, 2047825037); + uint b3 = (643754735); + uint3 r3 = uint3(0, 3, 3); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void uint3_operator_div_scalar_wide() + { + uint a0 = (519165704); + uint3 b0 = uint3(1295178177, 775214121, 467772046); + uint3 r0 = uint3(0, 0, 1); + TestUtils.AreEqual(r0, a0 / b0); + + uint a1 = (1156881598); + uint3 b1 = uint3(310396565, 759759959, 243837702); + uint3 r1 = uint3(3, 1, 4); + TestUtils.AreEqual(r1, a1 / b1); + + uint a2 = (1616314235); + uint3 b2 = uint3(1053470225, 1320630160, 378773841); + uint3 r2 = uint3(1, 1, 4); + TestUtils.AreEqual(r2, a2 / b2); + + uint a3 = (4223608); + uint3 b3 = uint3(1971105754, 2054406020, 219939614); + uint3 r3 = uint3(0, 0, 0); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void uint3_operator_mod_wide_wide() + { + uint3 a0 = uint3(258342924, 1454754891, 723352342); + uint3 b0 = uint3(1990080167, 1197348066, 651970512); + uint3 r0 = uint3(258342924, 257406825, 71381830); + TestUtils.AreEqual(r0, a0 % b0); + + uint3 a1 = uint3(1981431473, 531756042, 716993627); + uint3 b1 = uint3(1659454050, 241005212, 1866255454); + uint3 r1 = uint3(321977423, 49745618, 716993627); + TestUtils.AreEqual(r1, a1 % b1); + + uint3 a2 = uint3(1667903349, 1331097004, 1776856101); + uint3 b2 = uint3(1440101415, 595220963, 408818410); + uint3 r2 = uint3(227801934, 140655078, 141582461); + TestUtils.AreEqual(r2, a2 % b2); + + uint3 a3 = uint3(17598216, 1474345080, 1681376293); + uint3 b3 = uint3(198222574, 549504274, 239973807); + uint3 r3 = uint3(17598216, 375336532, 1559644); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void uint3_operator_mod_wide_scalar() + { + uint3 a0 = uint3(560988938, 629524514, 767711194); + uint b0 = (1156862367); + uint3 r0 = uint3(560988938, 629524514, 767711194); + TestUtils.AreEqual(r0, a0 % b0); + + uint3 a1 = uint3(434281967, 792916846, 1663690927); + uint b1 = (1399805893); + uint3 r1 = uint3(434281967, 792916846, 263885034); + TestUtils.AreEqual(r1, a1 % b1); + + uint3 a2 = uint3(598661916, 1287035793, 1743722161); + uint b2 = (1776636144); + uint3 r2 = uint3(598661916, 1287035793, 1743722161); + TestUtils.AreEqual(r2, a2 % b2); + + uint3 a3 = uint3(475209785, 1617696916, 379853074); + uint b3 = (327476870); + uint3 r3 = uint3(147732915, 307789436, 52376204); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void uint3_operator_mod_scalar_wide() + { + uint a0 = (933347930); + uint3 b0 = uint3(549923387, 243114953, 1884274390); + uint3 r0 = uint3(383424543, 204003071, 933347930); + TestUtils.AreEqual(r0, a0 % b0); + + uint a1 = (1428033594); + uint3 b1 = uint3(655531454, 1622674954, 1107563514); + uint3 r1 = uint3(116970686, 1428033594, 320470080); + TestUtils.AreEqual(r1, a1 % b1); + + uint a2 = (1614111094); + uint3 b2 = uint3(914801920, 1432263179, 564431096); + uint3 r2 = uint3(699309174, 181847915, 485248902); + TestUtils.AreEqual(r2, a2 % b2); + + uint a3 = (1967013901); + uint3 b3 = uint3(1709750152, 1080102613, 13120773); + uint3 r3 = uint3(257263749, 886911288, 12018724); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void uint3_operator_plus() + { + uint3 a0 = uint3(195392567, 222719748, 1002351013); + uint3 r0 = uint3(195392567, 222719748, 1002351013); + TestUtils.AreEqual(r0, +a0); + + uint3 a1 = uint3(1570765263, 1515950277, 1689763402); + uint3 r1 = uint3(1570765263, 1515950277, 1689763402); + TestUtils.AreEqual(r1, +a1); + + uint3 a2 = uint3(291471785, 1084131995, 195779102); + uint3 r2 = uint3(291471785, 1084131995, 195779102); + TestUtils.AreEqual(r2, +a2); + + uint3 a3 = uint3(2131702223, 1995564647, 69731564); + uint3 r3 = uint3(2131702223, 1995564647, 69731564); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void uint3_operator_neg() + { + uint3 a0 = uint3(1385088677, 94114564, 1350664872); + uint3 r0 = uint3(2909878619, 4200852732, 2944302424); + TestUtils.AreEqual(r0, -a0); + + uint3 a1 = uint3(1458616659, 218122493, 958484951); + uint3 r1 = uint3(2836350637, 4076844803, 3336482345); + TestUtils.AreEqual(r1, -a1); + + uint3 a2 = uint3(270553961, 270503114, 1928771252); + uint3 r2 = uint3(4024413335, 4024464182, 2366196044); + TestUtils.AreEqual(r2, -a2); + + uint3 a3 = uint3(1427605822, 1434247484, 485368391); + uint3 r3 = uint3(2867361474, 2860719812, 3809598905); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void uint3_operator_prefix_inc() + { + uint3 a0 = uint3(780471723, 954741756, 272723451); + uint3 r0 = uint3(780471724, 954741757, 272723452); + TestUtils.AreEqual(r0, ++a0); + + uint3 a1 = uint3(2142862245, 1514814550, 250124151); + uint3 r1 = uint3(2142862246, 1514814551, 250124152); + TestUtils.AreEqual(r1, ++a1); + + uint3 a2 = uint3(444189162, 1915989169, 1348278302); + uint3 r2 = uint3(444189163, 1915989170, 1348278303); + TestUtils.AreEqual(r2, ++a2); + + uint3 a3 = uint3(129540735, 1170613526, 986715680); + uint3 r3 = uint3(129540736, 1170613527, 986715681); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void uint3_operator_postfix_inc() + { + uint3 a0 = uint3(241865086, 2145821641, 1596166022); + uint3 r0 = uint3(241865086, 2145821641, 1596166022); + TestUtils.AreEqual(r0, a0++); + + uint3 a1 = uint3(803592338, 1656767229, 903047443); + uint3 r1 = uint3(803592338, 1656767229, 903047443); + TestUtils.AreEqual(r1, a1++); + + uint3 a2 = uint3(1213663244, 1384002775, 389844650); + uint3 r2 = uint3(1213663244, 1384002775, 389844650); + TestUtils.AreEqual(r2, a2++); + + uint3 a3 = uint3(1159795446, 1227160199, 947635082); + uint3 r3 = uint3(1159795446, 1227160199, 947635082); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void uint3_operator_prefix_dec() + { + uint3 a0 = uint3(1331961415, 1612382200, 1401591249); + uint3 r0 = uint3(1331961414, 1612382199, 1401591248); + TestUtils.AreEqual(r0, --a0); + + uint3 a1 = uint3(2042075388, 1895858159, 1467742422); + uint3 r1 = uint3(2042075387, 1895858158, 1467742421); + TestUtils.AreEqual(r1, --a1); + + uint3 a2 = uint3(578341664, 2059077641, 1169239112); + uint3 r2 = uint3(578341663, 2059077640, 1169239111); + TestUtils.AreEqual(r2, --a2); + + uint3 a3 = uint3(1862369220, 1027543764, 1595492535); + uint3 r3 = uint3(1862369219, 1027543763, 1595492534); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void uint3_operator_postfix_dec() + { + uint3 a0 = uint3(1870005937, 1708534798, 704493460); + uint3 r0 = uint3(1870005937, 1708534798, 704493460); + TestUtils.AreEqual(r0, a0--); + + uint3 a1 = uint3(462940703, 228744869, 940247280); + uint3 r1 = uint3(462940703, 228744869, 940247280); + TestUtils.AreEqual(r1, a1--); + + uint3 a2 = uint3(1818778351, 862428933, 1401191870); + uint3 r2 = uint3(1818778351, 862428933, 1401191870); + TestUtils.AreEqual(r2, a2--); + + uint3 a3 = uint3(2080259851, 140452688, 1928164223); + uint3 r3 = uint3(2080259851, 140452688, 1928164223); + TestUtils.AreEqual(r3, a3--); + } + + [TestCompiler] + public static void uint3_operator_bitwise_and_wide_wide() + { + uint3 a0 = uint3(1055241304, 859321394, 1088358961); + uint3 b0 = uint3(749698416, 748105424, 1842764797); + uint3 r0 = uint3(749024336, 537928720, 1087769137); + TestUtils.AreEqual(r0, a0 & b0); + + uint3 a1 = uint3(2090949513, 300561740, 651904515); + uint3 b1 = uint3(9990577, 1989102105, 1666634755); + uint3 r1 = uint3(8409473, 277479432, 575816707); + TestUtils.AreEqual(r1, a1 & b1); + + uint3 a2 = uint3(1331035868, 2012752753, 1298126656); + uint3 b2 = uint3(58116798, 868036607, 1420638875); + uint3 r2 = uint3(55888540, 867707761, 1141707264); + TestUtils.AreEqual(r2, a2 & b2); + + uint3 a3 = uint3(53199569, 1752363533, 1303061302); + uint3 b3 = uint3(1308767169, 564040763, 478617502); + uint3 r3 = uint3(33686209, 538087433, 209912598); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void uint3_operator_bitwise_and_wide_scalar() + { + uint3 a0 = uint3(1513158868, 284695609, 734595037); + uint b0 = (1173647397); + uint3 r0 = uint3(1076916228, 15732769, 29360133); + TestUtils.AreEqual(r0, a0 & b0); + + uint3 a1 = uint3(1566510707, 84213838, 314333543); + uint b1 = (1601252476); + uint3 r1 = uint3(1565592688, 83951692, 305137764); + TestUtils.AreEqual(r1, a1 & b1); + + uint3 a2 = uint3(430856908, 327392481, 1619794917); + uint b2 = (753481263); + uint3 r2 = uint3(145232396, 8459297, 545788453); + TestUtils.AreEqual(r2, a2 & b2); + + uint3 a3 = uint3(2143619546, 126982769, 651482651); + uint b3 = (1873208293); + uint3 r3 = uint3(1870922176, 125862497, 646234625); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void uint3_operator_bitwise_and_scalar_wide() + { + uint a0 = (477163326); + uint3 b0 = uint3(110453385, 703240362, 2075630560); + uint3 r0 = uint3(68182536, 140544042, 405834528); + TestUtils.AreEqual(r0, a0 & b0); + + uint a1 = (1884904031); + uint3 b1 = uint3(1734899436, 947945203, 1664399051); + uint3 r1 = uint3(1615352396, 805329491, 1611665995); + TestUtils.AreEqual(r1, a1 & b1); + + uint a2 = (458879298); + uint3 b2 = uint3(158491426, 79772356, 2054527944); + uint3 r2 = uint3(156262658, 4272192, 441553216); + TestUtils.AreEqual(r2, a2 & b2); + + uint a3 = (202228212); + uint3 b3 = uint3(359225061, 639811396, 1821945318); + uint3 r3 = uint3(67715300, 67141956, 201884132); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void uint3_operator_bitwise_or_wide_wide() + { + uint3 a0 = uint3(1920951869, 1750772852, 1420019191); + uint3 b0 = uint3(214585254, 275414367, 858759675); + uint3 r0 = uint3(2130669503, 2021326207, 2008016383); + TestUtils.AreEqual(r0, a0 | b0); + + uint3 a1 = uint3(732977093, 1169579447, 229437930); + uint3 b1 = uint3(190211455, 1218691723, 2129565457); + uint3 r1 = uint3(737572863, 1303895999, 2146367483); + TestUtils.AreEqual(r1, a1 | b1); + + uint3 a2 = uint3(1966721348, 2039812323, 113550869); + uint3 b2 = uint3(1862809466, 495728846, 868064152); + uint3 r2 = uint3(2134507390, 2107455727, 939376541); + TestUtils.AreEqual(r2, a2 | b2); + + uint3 a3 = uint3(1912038362, 1569990624, 1490718227); + uint3 b3 = uint3(1756913766, 933656055, 247722084); + uint3 r3 = uint3(2046780414, 2142664695, 1591475831); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void uint3_operator_bitwise_or_wide_scalar() + { + uint3 a0 = uint3(1295304853, 1307252624, 350194630); + uint b0 = (1305527136); + uint3 r0 = uint3(1307888629, 1308350448, 1574947814); + TestUtils.AreEqual(r0, a0 | b0); + + uint3 a1 = uint3(1128063578, 2085245467, 1988423804); + uint b1 = (1774824542); + uint3 r1 = uint3(1811803742, 2110520927, 2144205950); + TestUtils.AreEqual(r1, a1 | b1); + + uint3 a2 = uint3(999162350, 1050875188, 341855232); + uint b2 = (2110327307); + uint3 r2 = uint3(2144275439, 2146115391, 2112441867); + TestUtils.AreEqual(r2, a2 | b2); + + uint3 a3 = uint3(1317039676, 41280811, 1536908787); + uint b3 = (228656898); + uint3 r3 = uint3(1335979838, 267773739, 1606115315); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void uint3_operator_bitwise_or_scalar_wide() + { + uint a0 = (1768627592); + uint3 b0 = uint3(1849658052, 1759912154, 729979455); + uint3 r0 = uint3(1870634956, 1777286618, 1810603967); + TestUtils.AreEqual(r0, a0 | b0); + + uint a1 = (975926310); + uint3 b1 = uint3(1987690876, 1809506714, 1160695341); + uint3 r1 = uint3(2122052990, 2080110014, 2133851695); + TestUtils.AreEqual(r1, a1 | b1); + + uint a2 = (408963395); + uint3 b2 = uint3(314072711, 1560007537, 1709003416); + uint3 r2 = uint3(452485063, 1560009587, 2113756123); + TestUtils.AreEqual(r2, a2 | b2); + + uint a3 = (977086639); + uint3 b3 = uint3(1448375596, 1689568808, 595543345); + uint3 r3 = uint3(2122153391, 2126376623, 998206911); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void uint3_operator_bitwise_xor_wide_wide() + { + uint3 a0 = uint3(1843655608, 362425681, 640805534); + uint3 b0 = uint3(1422803441, 1234691140, 119589253); + uint3 r0 = uint3(959296073, 1544407317, 554771227); + TestUtils.AreEqual(r0, a0 ^ b0); + + uint3 a1 = uint3(1342040268, 945678755, 980321850); + uint3 b1 = uint3(1101464929, 121896337, 1880109018); + uint3 r1 = uint3(240840109, 1058935858, 1249815008); + TestUtils.AreEqual(r1, a1 ^ b1); + + uint3 a2 = uint3(390165019, 1682422658, 303897251); + uint3 b2 = uint3(1000210266, 1718938232, 464406940); + uint3 r2 = uint3(752651585, 36917754, 162747199); + TestUtils.AreEqual(r2, a2 ^ b2); + + uint3 a3 = uint3(230477768, 1103646442, 1503102919); + uint3 b3 = uint3(884337881, 34199854, 1430659227); + uint3 r3 = uint3(956900113, 1136760772, 215066460); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void uint3_operator_bitwise_xor_wide_scalar() + { + uint3 a0 = uint3(169345668, 176087064, 2084362901); + uint b0 = (354464228); + uint3 r0 = uint3(523809632, 526275068, 1763470193); + TestUtils.AreEqual(r0, a0 ^ b0); + + uint3 a1 = uint3(1663924004, 517476661, 905336222); + uint b1 = (193851255); + uint3 r1 = uint3(1755355219, 357957186, 1048296169); + TestUtils.AreEqual(r1, a1 ^ b1); + + uint3 a2 = uint3(863800783, 835837496, 954341348); + uint b2 = (365003873); + uint3 r2 = uint3(649922990, 605051481, 757306245); + TestUtils.AreEqual(r2, a2 ^ b2); + + uint3 a3 = uint3(1464576786, 1700827127, 2003392824); + uint b3 = (625604047); + uint3 r3 = uint3(1912757981, 1076460088, 1377873143); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void uint3_operator_bitwise_xor_scalar_wide() + { + uint a0 = (1361775641); + uint3 b0 = uint3(1452773578, 459050892, 1986218254); + uint3 r0 = uint3(129801427, 1249346453, 659047703); + TestUtils.AreEqual(r0, a0 ^ b0); + + uint a1 = (1689037698); + uint3 b1 = uint3(999278344, 1229114508, 1087843538); + uint3 r1 = uint3(1596157066, 770598670, 612075344); + TestUtils.AreEqual(r1, a1 ^ b1); + + uint a2 = (733699740); + uint3 b2 = uint3(106187872, 1533632738, 1107817672); + uint3 r2 = uint3(770642684, 1892826750, 1773972052); + TestUtils.AreEqual(r2, a2 ^ b2); + + uint a3 = (492506236); + uint3 b3 = uint3(597602329, 1439603382, 1001169118); + uint3 r3 = uint3(1053146213, 1217763018, 653765794); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void uint3_operator_left_shift() + { + uint3 a0 = uint3(1129100049, 829482269, 1571297368); + int b0 = (218351941); + uint3 r0 = uint3(1771463200, 773628832, 3036875520); + TestUtils.AreEqual(r0, a0 << b0); + + uint3 a1 = uint3(443753193, 249554593, 892627436); + int b1 = (1872142968); + uint3 r1 = uint3(3909091328, 2701131776, 3959422976); + TestUtils.AreEqual(r1, a1 << b1); + + uint3 a2 = uint3(980302862, 849916599, 1271350845); + int b2 = (62369727); + uint3 r2 = uint3(0, 2147483648, 2147483648); + TestUtils.AreEqual(r2, a2 << b2); + + uint3 a3 = uint3(108441902, 1779118882, 1451674188); + int b3 = (1959056531); + uint3 r3 = uint3(2305818624, 2567962624, 1382023168); + TestUtils.AreEqual(r3, a3 << b3); + } + + [TestCompiler] + public static void uint3_operator_right_shift() + { + uint3 a0 = uint3(809126085, 908563670, 763568837); + int b0 = (994800051); + uint3 r0 = uint3(1543, 1732, 1456); + TestUtils.AreEqual(r0, a0 >> b0); + + uint3 a1 = uint3(1986717290, 646821842, 1242726074); + int b1 = (1174507510); + uint3 r1 = uint3(473, 154, 296); + TestUtils.AreEqual(r1, a1 >> b1); + + uint3 a2 = uint3(390811632, 1923166649, 102096936); + int b2 = (1521420393); + uint3 r2 = uint3(763303, 3756184, 199408); + TestUtils.AreEqual(r2, a2 >> b2); + + uint3 a3 = uint3(400863878, 1611921244, 307750782); + int b3 = (667378673); + uint3 r3 = uint3(3058, 12297, 2347); + TestUtils.AreEqual(r3, a3 >> b3); + } + + [TestCompiler] + public static void uint3_operator_bitwise_not() + { + uint3 a0 = uint3(111796841, 603562399, 745091931); + uint3 r0 = uint3(4183170454, 3691404896, 3549875364); + TestUtils.AreEqual(r0, ~a0); + + uint3 a1 = uint3(853183268, 381888399, 1891338755); + uint3 r1 = uint3(3441784027, 3913078896, 2403628540); + TestUtils.AreEqual(r1, ~a1); + + uint3 a2 = uint3(1506860135, 787710759, 875964607); + uint3 r2 = uint3(2788107160, 3507256536, 3419002688); + TestUtils.AreEqual(r2, ~a2); + + uint3 a3 = uint3(96456785, 203444882, 1172294211); + uint3 r3 = uint3(4198510510, 4091522413, 3122673084); + TestUtils.AreEqual(r3, ~a3); + } + + [TestCompiler] + public static void uint3_shuffle_result_1() + { + uint3 a = uint3(0, 1, 2); + uint3 b = uint3(3, 4, 5); + + TestUtils.AreEqual((0), shuffle(a, b, ShuffleComponent.LeftX)); + TestUtils.AreEqual((1), shuffle(a, b, ShuffleComponent.LeftY)); + TestUtils.AreEqual((2), shuffle(a, b, ShuffleComponent.LeftZ)); + TestUtils.AreEqual((3), shuffle(a, b, ShuffleComponent.RightX)); + TestUtils.AreEqual((4), shuffle(a, b, ShuffleComponent.RightY)); + TestUtils.AreEqual((5), shuffle(a, b, ShuffleComponent.RightZ)); + } + + [TestCompiler] + public static void uint3_shuffle_result_2() + { + uint3 a = uint3(0, 1, 2); + uint3 b = uint3(3, 4, 5); + + TestUtils.AreEqual(uint2(4, 4), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightY)); + TestUtils.AreEqual(uint2(4, 3), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightX)); + TestUtils.AreEqual(uint2(1, 3), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.RightX)); + TestUtils.AreEqual(uint2(5, 2), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(uint2(5, 1), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.LeftY)); + TestUtils.AreEqual(uint2(1, 2), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(uint2(3, 2), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(uint2(5, 0), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.LeftX)); + TestUtils.AreEqual(uint2(5, 5), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.RightZ)); + TestUtils.AreEqual(uint2(4, 1), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftY)); + TestUtils.AreEqual(uint2(4, 5), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightZ)); + TestUtils.AreEqual(uint2(5, 0), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.LeftX)); + TestUtils.AreEqual(uint2(4, 3), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightX)); + TestUtils.AreEqual(uint2(5, 4), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.RightY)); + TestUtils.AreEqual(uint2(3, 0), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftX)); + TestUtils.AreEqual(uint2(1, 2), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.LeftZ)); + } + + [TestCompiler] + public static void uint3_shuffle_result_3() + { + uint3 a = uint3(0, 1, 2); + uint3 b = uint3(3, 4, 5); + + TestUtils.AreEqual(uint3(1, 5, 3), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.RightZ, ShuffleComponent.RightX)); + TestUtils.AreEqual(uint3(4, 0, 2), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftX, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(uint3(2, 5, 3), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.RightZ, ShuffleComponent.RightX)); + TestUtils.AreEqual(uint3(4, 0, 1), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftX, ShuffleComponent.LeftY)); + TestUtils.AreEqual(uint3(5, 4, 2), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.RightY, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(uint3(2, 0, 1), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.LeftX, ShuffleComponent.LeftY)); + TestUtils.AreEqual(uint3(2, 4, 3), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.RightY, ShuffleComponent.RightX)); + TestUtils.AreEqual(uint3(2, 1, 5), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.LeftY, ShuffleComponent.RightZ)); + TestUtils.AreEqual(uint3(4, 4, 5), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightY, ShuffleComponent.RightZ)); + TestUtils.AreEqual(uint3(4, 3, 1), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightX, ShuffleComponent.LeftY)); + TestUtils.AreEqual(uint3(5, 5, 0), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.RightZ, ShuffleComponent.LeftX)); + TestUtils.AreEqual(uint3(5, 1, 3), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.LeftY, ShuffleComponent.RightX)); + TestUtils.AreEqual(uint3(4, 1, 5), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftY, ShuffleComponent.RightZ)); + TestUtils.AreEqual(uint3(2, 3, 4), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.RightX, ShuffleComponent.RightY)); + TestUtils.AreEqual(uint3(4, 0, 4), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftX, ShuffleComponent.RightY)); + TestUtils.AreEqual(uint3(4, 0, 5), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftX, ShuffleComponent.RightZ)); + } + + [TestCompiler] + public static void uint3_shuffle_result_4() + { + uint3 a = uint3(0, 1, 2); + uint3 b = uint3(3, 4, 5); + + TestUtils.AreEqual(uint4(1, 2, 3, 1), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.LeftZ, ShuffleComponent.RightX, ShuffleComponent.LeftY)); + TestUtils.AreEqual(uint4(4, 2, 5, 4), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftZ, ShuffleComponent.RightZ, ShuffleComponent.RightY)); + TestUtils.AreEqual(uint4(4, 4, 5, 1), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightY, ShuffleComponent.RightZ, ShuffleComponent.LeftY)); + TestUtils.AreEqual(uint4(3, 3, 1, 1), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightX, ShuffleComponent.LeftY, ShuffleComponent.LeftY)); + TestUtils.AreEqual(uint4(4, 1, 1, 0), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftY, ShuffleComponent.LeftY, ShuffleComponent.LeftX)); + TestUtils.AreEqual(uint4(3, 4, 3, 5), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightY, ShuffleComponent.RightX, ShuffleComponent.RightZ)); + TestUtils.AreEqual(uint4(1, 5, 0, 5), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.RightZ, ShuffleComponent.LeftX, ShuffleComponent.RightZ)); + TestUtils.AreEqual(uint4(4, 0, 0, 0), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftX, ShuffleComponent.LeftX, ShuffleComponent.LeftX)); + TestUtils.AreEqual(uint4(3, 5, 2, 0), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightZ, ShuffleComponent.LeftZ, ShuffleComponent.LeftX)); + TestUtils.AreEqual(uint4(4, 3, 1, 3), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightX, ShuffleComponent.LeftY, ShuffleComponent.RightX)); + TestUtils.AreEqual(uint4(0, 2, 5, 0), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.LeftZ, ShuffleComponent.RightZ, ShuffleComponent.LeftX)); + TestUtils.AreEqual(uint4(1, 4, 5, 5), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.RightY, ShuffleComponent.RightZ, ShuffleComponent.RightZ)); + TestUtils.AreEqual(uint4(2, 3, 1, 3), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.RightX, ShuffleComponent.LeftY, ShuffleComponent.RightX)); + TestUtils.AreEqual(uint4(3, 0, 1, 2), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftX, ShuffleComponent.LeftY, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(uint4(5, 3, 0, 4), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.RightX, ShuffleComponent.LeftX, ShuffleComponent.RightY)); + TestUtils.AreEqual(uint4(2, 5, 0, 4), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.RightZ, ShuffleComponent.LeftX, ShuffleComponent.RightY)); + } + + [TestCase /* For player builds */] + public static void uint3_EqualsObjectOverride() + { + TestUtils.IsFalse(new uint3().Equals((object)new int())); + TestUtils.IsTrue(new uint3().Equals((object)new uint3())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestUint3.gen.cs.meta b/src/Tests/Tests/Shared/TestUint3.gen.cs.meta new file mode 100644 index 00000000..1fb2cc26 --- /dev/null +++ b/src/Tests/Tests/Shared/TestUint3.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1e540f901d21a5c4c94afaaa341f0eba +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestUint3x2.gen.cs b/src/Tests/Tests/Shared/TestUint3x2.gen.cs new file mode 100644 index 00000000..0072a061 --- /dev/null +++ b/src/Tests/Tests/Shared/TestUint3x2.gen.cs @@ -0,0 +1,1234 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestUint3x2 + { + [TestCompiler] + public static void uint3x2_zero() + { + TestUtils.AreEqual(0u, uint3x2.zero.c0.x); + TestUtils.AreEqual(0u, uint3x2.zero.c0.y); + TestUtils.AreEqual(0u, uint3x2.zero.c0.z); + TestUtils.AreEqual(0u, uint3x2.zero.c1.x); + TestUtils.AreEqual(0u, uint3x2.zero.c1.y); + TestUtils.AreEqual(0u, uint3x2.zero.c1.z); + } + + [TestCompiler] + public static void uint3x2_operator_equal_wide_wide() + { + uint3x2 a0 = uint3x2(2105871082, 35218899, 1550755093, 764676020, 606743782, 1208156098); + uint3x2 b0 = uint3x2(1477587886, 579629692, 540974792, 208405066, 2063397938, 1060167409); + bool3x2 r0 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + uint3x2 a1 = uint3x2(1023640014, 1038468316, 1416064367, 727143393, 2061243891, 184669837); + uint3x2 b1 = uint3x2(362592601, 2097545362, 277670088, 426944490, 901076223, 857900673); + bool3x2 r1 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + uint3x2 a2 = uint3x2(1303661760, 2044073738, 370395888, 1822916805, 1076983135, 345215866); + uint3x2 b2 = uint3x2(1548779757, 325265488, 312658571, 176373760, 2052378097, 858156597); + bool3x2 r2 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + uint3x2 a3 = uint3x2(833676277, 1987782708, 1481088614, 1364754268, 93639636, 1850596922); + uint3x2 b3 = uint3x2(982817797, 1252095508, 882634538, 1959142806, 72495800, 1077678183); + bool3x2 r3 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void uint3x2_operator_equal_wide_scalar() + { + uint3x2 a0 = uint3x2(437822262, 2020661134, 541786900, 853113810, 23716499, 179951405); + uint b0 = (1332833578); + bool3x2 r0 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + uint3x2 a1 = uint3x2(1409026299, 953202998, 691955848, 1926262965, 1851546137, 712957637); + uint b1 = (948838849); + bool3x2 r1 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + uint3x2 a2 = uint3x2(2028784869, 1836975611, 1016802970, 390120467, 464814777, 1451642042); + uint b2 = (1049962241); + bool3x2 r2 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + uint3x2 a3 = uint3x2(289137869, 808355440, 660053867, 597354173, 67320270, 151461188); + uint b3 = (152339338); + bool3x2 r3 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void uint3x2_operator_equal_scalar_wide() + { + uint a0 = (542329200); + uint3x2 b0 = uint3x2(1115584594, 684107773, 1928988941, 890709324, 641152437, 1410341302); + bool3x2 r0 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + uint a1 = (497505660); + uint3x2 b1 = uint3x2(1068223109, 2014009435, 213835595, 1592428361, 1819361470, 448650623); + bool3x2 r1 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + uint a2 = (1942175642); + uint3x2 b2 = uint3x2(64377057, 1485938610, 1146305380, 1312317120, 263290348, 812663708); + bool3x2 r2 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + uint a3 = (1585209188); + uint3x2 b3 = uint3x2(40646617, 1378718922, 1957797737, 873652576, 1780082094, 1513270921); + bool3x2 r3 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void uint3x2_operator_not_equal_wide_wide() + { + uint3x2 a0 = uint3x2(1977284100, 1293292704, 1547283851, 422428953, 195833190, 1711544892); + uint3x2 b0 = uint3x2(1514195556, 957972049, 507667364, 581861672, 1128094576, 940096636); + bool3x2 r0 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + uint3x2 a1 = uint3x2(5606053, 737069074, 647386678, 13079405, 1413841590, 1076166545); + uint3x2 b1 = uint3x2(57559040, 181752616, 962017320, 1762015406, 1107218953, 2042026522); + bool3x2 r1 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + uint3x2 a2 = uint3x2(1211445174, 1289303469, 1436402489, 1129570126, 1566836685, 1343313905); + uint3x2 b2 = uint3x2(836002288, 570272309, 2112081980, 1500634658, 1787808345, 566425667); + bool3x2 r2 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + uint3x2 a3 = uint3x2(329259205, 1774944480, 33906739, 2055853627, 2035015372, 1702756001); + uint3x2 b3 = uint3x2(2037529609, 1520589840, 266793699, 538816359, 2075474643, 553571317); + bool3x2 r3 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void uint3x2_operator_not_equal_wide_scalar() + { + uint3x2 a0 = uint3x2(1038269360, 1427812625, 103361237, 1347017023, 1523584313, 150442802); + uint b0 = (768873026); + bool3x2 r0 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + uint3x2 a1 = uint3x2(660334527, 262959423, 484398043, 506946952, 226568494, 507918242); + uint b1 = (719113717); + bool3x2 r1 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + uint3x2 a2 = uint3x2(1702162286, 166187260, 114581840, 1045389187, 1648095254, 1461803977); + uint b2 = (923269270); + bool3x2 r2 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + uint3x2 a3 = uint3x2(61801615, 2146927809, 1557151164, 1284033253, 1345705546, 1747302566); + uint b3 = (1317840133); + bool3x2 r3 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void uint3x2_operator_not_equal_scalar_wide() + { + uint a0 = (1652127596); + uint3x2 b0 = uint3x2(953791238, 271722683, 1278885987, 735128017, 112416504, 25967222); + bool3x2 r0 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + uint a1 = (1761444475); + uint3x2 b1 = uint3x2(1844594536, 1199122922, 634219279, 942501101, 67161343, 969944293); + bool3x2 r1 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + uint a2 = (833229499); + uint3x2 b2 = uint3x2(1304301133, 704045745, 345012334, 1253134152, 325772538, 855127202); + bool3x2 r2 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + uint a3 = (793668881); + uint3x2 b3 = uint3x2(1584481616, 1101301152, 276853534, 987168816, 1258105989, 362645228); + bool3x2 r3 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void uint3x2_operator_less_wide_wide() + { + uint3x2 a0 = uint3x2(1486550609, 1779244308, 1602148045, 1614085440, 1975613414, 942838342); + uint3x2 b0 = uint3x2(97842578, 536551311, 413528975, 1838293684, 1283898480, 1456599961); + bool3x2 r0 = bool3x2(false, false, false, true, false, true); + TestUtils.AreEqual(r0, a0 < b0); + + uint3x2 a1 = uint3x2(1092279031, 373677431, 1419098312, 337757077, 1081797900, 1336745069); + uint3x2 b1 = uint3x2(1080278602, 529676676, 156584048, 117348799, 246927124, 1916615924); + bool3x2 r1 = bool3x2(false, true, false, false, false, true); + TestUtils.AreEqual(r1, a1 < b1); + + uint3x2 a2 = uint3x2(840685445, 1220554047, 2013681746, 192965012, 532043965, 1000693402); + uint3x2 b2 = uint3x2(1731071394, 1328098431, 1014995792, 480319327, 1765937053, 1333997067); + bool3x2 r2 = bool3x2(true, true, false, true, true, true); + TestUtils.AreEqual(r2, a2 < b2); + + uint3x2 a3 = uint3x2(927236048, 1215860000, 780607596, 1882056852, 1354146545, 2135295778); + uint3x2 b3 = uint3x2(688515308, 1856106947, 1303906227, 646821776, 1169473993, 316770064); + bool3x2 r3 = bool3x2(false, true, true, false, false, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void uint3x2_operator_less_wide_scalar() + { + uint3x2 a0 = uint3x2(796797557, 670113454, 933579492, 278884514, 318174822, 1117630673); + uint b0 = (746564682); + bool3x2 r0 = bool3x2(false, true, false, true, true, false); + TestUtils.AreEqual(r0, a0 < b0); + + uint3x2 a1 = uint3x2(741886928, 1030849597, 1546212312, 1718582899, 1648393417, 1857132231); + uint b1 = (1990922600); + bool3x2 r1 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 < b1); + + uint3x2 a2 = uint3x2(1909506562, 952084157, 1303736668, 845460171, 979430272, 1368236640); + uint b2 = (1294006045); + bool3x2 r2 = bool3x2(false, true, false, true, true, false); + TestUtils.AreEqual(r2, a2 < b2); + + uint3x2 a3 = uint3x2(24980695, 659552739, 1058492383, 165694933, 1204097259, 922212691); + uint b3 = (1434668705); + bool3x2 r3 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void uint3x2_operator_less_scalar_wide() + { + uint a0 = (186400299); + uint3x2 b0 = uint3x2(1881344229, 813834467, 1254886626, 1353590345, 1412343685, 1555571443); + bool3x2 r0 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 < b0); + + uint a1 = (1540508298); + uint3x2 b1 = uint3x2(1735458634, 135888070, 1643818742, 248291654, 1739560105, 728539891); + bool3x2 r1 = bool3x2(true, false, true, false, true, false); + TestUtils.AreEqual(r1, a1 < b1); + + uint a2 = (480507742); + uint3x2 b2 = uint3x2(1696553040, 540223931, 1840493353, 146833656, 798115946, 2002002066); + bool3x2 r2 = bool3x2(true, true, true, false, true, true); + TestUtils.AreEqual(r2, a2 < b2); + + uint a3 = (1011261705); + uint3x2 b3 = uint3x2(783550942, 1093071215, 598253401, 1432416562, 1863582169, 103622950); + bool3x2 r3 = bool3x2(false, true, false, true, true, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void uint3x2_operator_greater_wide_wide() + { + uint3x2 a0 = uint3x2(2087717754, 1725569452, 1298066182, 1693943616, 1319019629, 70674491); + uint3x2 b0 = uint3x2(85148514, 293632137, 1151128249, 409440398, 1115020183, 1508500597); + bool3x2 r0 = bool3x2(true, true, true, true, true, false); + TestUtils.AreEqual(r0, a0 > b0); + + uint3x2 a1 = uint3x2(1042499725, 1002821508, 1021857133, 1744374599, 821751047, 467646903); + uint3x2 b1 = uint3x2(1834583302, 1755218534, 1788761753, 1128238489, 834223713, 1578743290); + bool3x2 r1 = bool3x2(false, false, false, true, false, false); + TestUtils.AreEqual(r1, a1 > b1); + + uint3x2 a2 = uint3x2(2029731638, 1377214212, 1207816926, 474621063, 20781266, 366593779); + uint3x2 b2 = uint3x2(1647150256, 1756397855, 1131080201, 1208965204, 1495161099, 1283714281); + bool3x2 r2 = bool3x2(true, false, true, false, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + uint3x2 a3 = uint3x2(2068457387, 10181449, 793634464, 144474612, 99947390, 930377263); + uint3x2 b3 = uint3x2(908051907, 412849651, 815822687, 730271942, 40756039, 883326140); + bool3x2 r3 = bool3x2(true, false, false, false, true, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void uint3x2_operator_greater_wide_scalar() + { + uint3x2 a0 = uint3x2(1208626274, 239697208, 1979453345, 1253474001, 1590192876, 1487911635); + uint b0 = (1715176566); + bool3x2 r0 = bool3x2(false, false, true, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + uint3x2 a1 = uint3x2(1673945595, 222749855, 1433540517, 566635217, 1773305960, 1850273578); + uint b1 = (1662650098); + bool3x2 r1 = bool3x2(true, false, false, false, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + uint3x2 a2 = uint3x2(206147145, 333381537, 1905567362, 2053577491, 570397194, 2128431130); + uint b2 = (325913453); + bool3x2 r2 = bool3x2(false, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 > b2); + + uint3x2 a3 = uint3x2(1735325311, 1663525234, 1972984241, 1587865063, 488268523, 121921923); + uint b3 = (529971908); + bool3x2 r3 = bool3x2(true, true, true, true, false, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void uint3x2_operator_greater_scalar_wide() + { + uint a0 = (480938827); + uint3x2 b0 = uint3x2(1824731899, 921496110, 586859044, 946430596, 1231356727, 1390167458); + bool3x2 r0 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + uint a1 = (1785807092); + uint3x2 b1 = uint3x2(28949024, 2037899283, 595656760, 1778095771, 1233500439, 1696302238); + bool3x2 r1 = bool3x2(true, false, true, true, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + uint a2 = (1445965340); + uint3x2 b2 = uint3x2(484020151, 1586962841, 1361740714, 265628948, 2003122957, 332267433); + bool3x2 r2 = bool3x2(true, false, true, true, false, true); + TestUtils.AreEqual(r2, a2 > b2); + + uint a3 = (1128353075); + uint3x2 b3 = uint3x2(377919478, 982113135, 1117675960, 630865591, 1550679736, 895945757); + bool3x2 r3 = bool3x2(true, true, true, true, false, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void uint3x2_operator_less_equal_wide_wide() + { + uint3x2 a0 = uint3x2(154092149, 1515170149, 1083970332, 785807178, 1401094881, 310537627); + uint3x2 b0 = uint3x2(77984380, 1712054191, 1566203809, 254834519, 450519938, 389457083); + bool3x2 r0 = bool3x2(false, true, true, false, false, true); + TestUtils.AreEqual(r0, a0 <= b0); + + uint3x2 a1 = uint3x2(868328962, 1990816725, 2035349541, 457043352, 1123282035, 1001842946); + uint3x2 b1 = uint3x2(1298669505, 207343167, 1214449047, 2059561026, 896534357, 1897470050); + bool3x2 r1 = bool3x2(true, false, false, true, false, true); + TestUtils.AreEqual(r1, a1 <= b1); + + uint3x2 a2 = uint3x2(1387761992, 195272789, 659549000, 888761458, 283706617, 1790185840); + uint3x2 b2 = uint3x2(521075677, 1848221945, 374708019, 1573731118, 2093466449, 1660210829); + bool3x2 r2 = bool3x2(false, true, false, true, true, false); + TestUtils.AreEqual(r2, a2 <= b2); + + uint3x2 a3 = uint3x2(899029812, 848317418, 1743712447, 1504407474, 1798441490, 1902791952); + uint3x2 b3 = uint3x2(1568778785, 1352157589, 1212771905, 1457525058, 1493446008, 1784768208); + bool3x2 r3 = bool3x2(true, true, false, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void uint3x2_operator_less_equal_wide_scalar() + { + uint3x2 a0 = uint3x2(1479531977, 1427983411, 415250630, 1245345407, 1112546666, 1072990632); + uint b0 = (2004563877); + bool3x2 r0 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + uint3x2 a1 = uint3x2(1579912858, 1070894375, 509818792, 1910488590, 85452501, 518127023); + uint b1 = (101048307); + bool3x2 r1 = bool3x2(false, false, false, false, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + uint3x2 a2 = uint3x2(1246249980, 1964410699, 1968139888, 1191853379, 662096238, 1140643434); + uint b2 = (1097326500); + bool3x2 r2 = bool3x2(false, false, false, false, true, false); + TestUtils.AreEqual(r2, a2 <= b2); + + uint3x2 a3 = uint3x2(754434551, 995927387, 974873240, 1773400038, 497436329, 1825940497); + uint b3 = (155343473); + bool3x2 r3 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void uint3x2_operator_less_equal_scalar_wide() + { + uint a0 = (1899193992); + uint3x2 b0 = uint3x2(915011820, 980913757, 1337699683, 1476321359, 1102143668, 660493983); + bool3x2 r0 = bool3x2(false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 <= b0); + + uint a1 = (184664508); + uint3x2 b1 = uint3x2(381579707, 1954892821, 1295090571, 1440368586, 1696003686, 88708652); + bool3x2 r1 = bool3x2(true, true, true, true, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + uint a2 = (1332251857); + uint3x2 b2 = uint3x2(1310713644, 2112132784, 48951945, 1888568027, 39340955, 1108242207); + bool3x2 r2 = bool3x2(false, true, false, true, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + uint a3 = (260777425); + uint3x2 b3 = uint3x2(593122164, 291471959, 253457314, 1264570386, 699618012, 927735863); + bool3x2 r3 = bool3x2(true, true, false, true, true, true); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void uint3x2_operator_greater_equal_wide_wide() + { + uint3x2 a0 = uint3x2(8538378, 2131749726, 265427108, 523609761, 994991818, 839709564); + uint3x2 b0 = uint3x2(903145828, 1697992986, 1432491982, 169789504, 1059357300, 1744255222); + bool3x2 r0 = bool3x2(false, true, false, true, false, false); + TestUtils.AreEqual(r0, a0 >= b0); + + uint3x2 a1 = uint3x2(101288202, 1886280970, 2032074826, 631221455, 1456286159, 961342752); + uint3x2 b1 = uint3x2(1606584463, 1905414425, 1448794969, 136181998, 1678754836, 2069656857); + bool3x2 r1 = bool3x2(false, false, true, true, false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + uint3x2 a2 = uint3x2(424526026, 788481984, 1662488497, 870326690, 708712581, 1260182701); + uint3x2 b2 = uint3x2(398982689, 243317404, 740939613, 1894753119, 301760792, 1260647988); + bool3x2 r2 = bool3x2(true, true, true, false, true, false); + TestUtils.AreEqual(r2, a2 >= b2); + + uint3x2 a3 = uint3x2(1165630721, 138247561, 1108650168, 1933222913, 672493999, 1541402159); + uint3x2 b3 = uint3x2(3608523, 52576030, 903420465, 1648820371, 627296845, 1679808907); + bool3x2 r3 = bool3x2(true, true, true, true, true, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void uint3x2_operator_greater_equal_wide_scalar() + { + uint3x2 a0 = uint3x2(2049236663, 182691143, 634973382, 1197012109, 439837565, 1367606469); + uint b0 = (1061998015); + bool3x2 r0 = bool3x2(true, false, false, true, false, true); + TestUtils.AreEqual(r0, a0 >= b0); + + uint3x2 a1 = uint3x2(1108037359, 1898505669, 411667685, 1998610091, 4652390, 996159180); + uint b1 = (351147187); + bool3x2 r1 = bool3x2(true, true, true, true, false, true); + TestUtils.AreEqual(r1, a1 >= b1); + + uint3x2 a2 = uint3x2(2111455181, 96217144, 814085575, 1525995206, 1293933760, 1732973229); + uint b2 = (727766399); + bool3x2 r2 = bool3x2(true, false, true, true, true, true); + TestUtils.AreEqual(r2, a2 >= b2); + + uint3x2 a3 = uint3x2(1473283041, 1023753195, 1373738074, 518164359, 717850464, 1765188600); + uint b3 = (899444524); + bool3x2 r3 = bool3x2(true, true, true, false, false, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void uint3x2_operator_greater_equal_scalar_wide() + { + uint a0 = (1859811087); + uint3x2 b0 = uint3x2(1070365918, 1783869452, 830091760, 377157428, 327199016, 90384229); + bool3x2 r0 = bool3x2(true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + uint a1 = (1154649706); + uint3x2 b1 = uint3x2(376758501, 1079802834, 2054742898, 1328349472, 434061447, 951207723); + bool3x2 r1 = bool3x2(true, true, false, false, true, true); + TestUtils.AreEqual(r1, a1 >= b1); + + uint a2 = (598695892); + uint3x2 b2 = uint3x2(975131651, 1714007943, 177416473, 1267232721, 31082860, 216791741); + bool3x2 r2 = bool3x2(false, false, true, false, true, true); + TestUtils.AreEqual(r2, a2 >= b2); + + uint a3 = (119054289); + uint3x2 b3 = uint3x2(1905107583, 89559116, 55041824, 691334141, 462326883, 1658303669); + bool3x2 r3 = bool3x2(false, true, true, false, false, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void uint3x2_operator_add_wide_wide() + { + uint3x2 a0 = uint3x2(2135171378, 21433296, 1954723494, 683604307, 1054212315, 1762680995); + uint3x2 b0 = uint3x2(1013431952, 366718162, 359290756, 1393163294, 1962236872, 1263270041); + uint3x2 r0 = uint3x2(3148603330, 388151458, 2314014250, 2076767601, 3016449187, 3025951036); + TestUtils.AreEqual(r0, a0 + b0); + + uint3x2 a1 = uint3x2(1963655852, 1257853062, 2043493600, 976898058, 1915056423, 121374462); + uint3x2 b1 = uint3x2(1862666629, 1077447887, 821693806, 487316539, 350922520, 1583012528); + uint3x2 r1 = uint3x2(3826322481, 2335300949, 2865187406, 1464214597, 2265978943, 1704386990); + TestUtils.AreEqual(r1, a1 + b1); + + uint3x2 a2 = uint3x2(1218855698, 700538222, 1702057277, 1788251699, 1534939160, 398651016); + uint3x2 b2 = uint3x2(1951595076, 1024851344, 874302782, 1383969588, 1767968088, 900721406); + uint3x2 r2 = uint3x2(3170450774, 1725389566, 2576360059, 3172221287, 3302907248, 1299372422); + TestUtils.AreEqual(r2, a2 + b2); + + uint3x2 a3 = uint3x2(1674272498, 374510467, 824322986, 1217622199, 1122376670, 642613771); + uint3x2 b3 = uint3x2(1659790033, 1792273749, 443844328, 633981449, 2010244807, 335566991); + uint3x2 r3 = uint3x2(3334062531, 2166784216, 1268167314, 1851603648, 3132621477, 978180762); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void uint3x2_operator_add_wide_scalar() + { + uint3x2 a0 = uint3x2(665815972, 1783729250, 1591678394, 1284528538, 977850224, 71069732); + uint b0 = (1334043849); + uint3x2 r0 = uint3x2(1999859821, 3117773099, 2925722243, 2618572387, 2311894073, 1405113581); + TestUtils.AreEqual(r0, a0 + b0); + + uint3x2 a1 = uint3x2(1138577680, 565982008, 1246759684, 1088001167, 57252642, 678921480); + uint b1 = (1200356017); + uint3x2 r1 = uint3x2(2338933697, 1766338025, 2447115701, 2288357184, 1257608659, 1879277497); + TestUtils.AreEqual(r1, a1 + b1); + + uint3x2 a2 = uint3x2(625943813, 1470648741, 1490096953, 1467033531, 182608093, 1707296407); + uint b2 = (512157429); + uint3x2 r2 = uint3x2(1138101242, 1982806170, 2002254382, 1979190960, 694765522, 2219453836); + TestUtils.AreEqual(r2, a2 + b2); + + uint3x2 a3 = uint3x2(1703724354, 653973063, 1139546735, 1834005844, 184572739, 1980578280); + uint b3 = (1333833947); + uint3x2 r3 = uint3x2(3037558301, 1987807010, 2473380682, 3167839791, 1518406686, 3314412227); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void uint3x2_operator_add_scalar_wide() + { + uint a0 = (359966320); + uint3x2 b0 = uint3x2(2146146202, 767103309, 851002415, 311531406, 1491262941, 1016891373); + uint3x2 r0 = uint3x2(2506112522, 1127069629, 1210968735, 671497726, 1851229261, 1376857693); + TestUtils.AreEqual(r0, a0 + b0); + + uint a1 = (1954228994); + uint3x2 b1 = uint3x2(1671335850, 727870747, 551151834, 1390261152, 1699060326, 115021619); + uint3x2 r1 = uint3x2(3625564844, 2682099741, 2505380828, 3344490146, 3653289320, 2069250613); + TestUtils.AreEqual(r1, a1 + b1); + + uint a2 = (1964440175); + uint3x2 b2 = uint3x2(440700758, 1556692550, 185414255, 933106731, 1217866784, 729761881); + uint3x2 r2 = uint3x2(2405140933, 3521132725, 2149854430, 2897546906, 3182306959, 2694202056); + TestUtils.AreEqual(r2, a2 + b2); + + uint a3 = (1742597318); + uint3x2 b3 = uint3x2(1090109152, 1467373815, 1066072609, 138237856, 634834665, 993603553); + uint3x2 r3 = uint3x2(2832706470, 3209971133, 2808669927, 1880835174, 2377431983, 2736200871); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void uint3x2_operator_sub_wide_wide() + { + uint3x2 a0 = uint3x2(1410318491, 1097280168, 1827039044, 28881338, 328720965, 875487868); + uint3x2 b0 = uint3x2(1315897366, 799052018, 1580289673, 1094686261, 1954325726, 1197734816); + uint3x2 r0 = uint3x2(94421125, 298228150, 246749371, 3229162373, 2669362535, 3972720348); + TestUtils.AreEqual(r0, a0 - b0); + + uint3x2 a1 = uint3x2(212936325, 231977215, 1740021315, 2011295463, 48079003, 591379285); + uint3x2 b1 = uint3x2(229886366, 915679176, 1746884850, 918743925, 1007797419, 257421324); + uint3x2 r1 = uint3x2(4278017255, 3611265335, 4288103761, 1092551538, 3335248880, 333957961); + TestUtils.AreEqual(r1, a1 - b1); + + uint3x2 a2 = uint3x2(1125909359, 1842588095, 848561896, 614448464, 2067598029, 1618238416); + uint3x2 b2 = uint3x2(287249342, 1617287463, 1653916102, 123586847, 502107404, 672875302); + uint3x2 r2 = uint3x2(838660017, 225300632, 3489613090, 490861617, 1565490625, 945363114); + TestUtils.AreEqual(r2, a2 - b2); + + uint3x2 a3 = uint3x2(318516219, 1090119767, 1991095823, 949592162, 1951912339, 1457818751); + uint3x2 b3 = uint3x2(1256481116, 1975569142, 1794443030, 1327558915, 330955394, 1596041731); + uint3x2 r3 = uint3x2(3357002399, 3409517921, 196652793, 3917000543, 1620956945, 4156744316); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void uint3x2_operator_sub_wide_scalar() + { + uint3x2 a0 = uint3x2(1508669340, 1594795463, 266707545, 643102647, 287705008, 1475644328); + uint b0 = (998008471); + uint3x2 r0 = uint3x2(510660869, 596786992, 3563666370, 3940061472, 3584663833, 477635857); + TestUtils.AreEqual(r0, a0 - b0); + + uint3x2 a1 = uint3x2(1113286221, 2082174113, 1108005498, 304369206, 999244508, 1806482044); + uint b1 = (979450511); + uint3x2 r1 = uint3x2(133835710, 1102723602, 128554987, 3619885991, 19793997, 827031533); + TestUtils.AreEqual(r1, a1 - b1); + + uint3x2 a2 = uint3x2(1994553647, 1482736902, 266654115, 1470212363, 1190349300, 958542155); + uint b2 = (2101812429); + uint3x2 r2 = uint3x2(4187708514, 3675891769, 2459808982, 3663367230, 3383504167, 3151697022); + TestUtils.AreEqual(r2, a2 - b2); + + uint3x2 a3 = uint3x2(1185075537, 499527536, 1612473406, 1696960099, 1287292743, 1360229454); + uint b3 = (1738124835); + uint3x2 r3 = uint3x2(3741917998, 3056369997, 4169315867, 4253802560, 3844135204, 3917071915); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void uint3x2_operator_sub_scalar_wide() + { + uint a0 = (893369501); + uint3x2 b0 = uint3x2(2051906184, 1699714311, 442603706, 1735141684, 274533585, 811580259); + uint3x2 r0 = uint3x2(3136430613, 3488622486, 450765795, 3453195113, 618835916, 81789242); + TestUtils.AreEqual(r0, a0 - b0); + + uint a1 = (1196354320); + uint3x2 b1 = uint3x2(1524097023, 533621527, 2080845793, 143958837, 1620668660, 1135989346); + uint3x2 r1 = uint3x2(3967224593, 662732793, 3410475823, 1052395483, 3870652956, 60364974); + TestUtils.AreEqual(r1, a1 - b1); + + uint a2 = (1367044745); + uint3x2 b2 = uint3x2(554088609, 552670373, 1265516124, 1254902543, 1857695581, 1619865274); + uint3x2 r2 = uint3x2(812956136, 814374372, 101528621, 112142202, 3804316460, 4042146767); + TestUtils.AreEqual(r2, a2 - b2); + + uint a3 = (1313559400); + uint3x2 b3 = uint3x2(99812999, 843597298, 420111239, 1299949060, 531009038, 1103306550); + uint3x2 r3 = uint3x2(1213746401, 469962102, 893448161, 13610340, 782550362, 210252850); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void uint3x2_operator_mul_wide_wide() + { + uint3x2 a0 = uint3x2(61417577, 219585476, 1362520891, 1511084277, 1481211272, 58211871); + uint3x2 b0 = uint3x2(578042444, 1620527213, 200516468, 309339115, 542853019, 299467282); + uint3x2 r0 = uint3x2(2868103468, 1326150260, 3304073148, 2972110823, 1973926232, 88546350); + TestUtils.AreEqual(r0, a0 * b0); + + uint3x2 a1 = uint3x2(1459591173, 567624644, 1169935583, 1835691886, 385626539, 85934842); + uint3x2 b1 = uint3x2(1479641221, 1428338601, 1497302909, 1596889147, 427413842, 265122693); + uint3x2 r1 = uint3x2(3431047833, 3712145508, 556671459, 1098186330, 1848083398, 4236646882); + TestUtils.AreEqual(r1, a1 * b1); + + uint3x2 a2 = uint3x2(522856538, 278370196, 289217012, 2083410174, 1293162798, 1939730122); + uint3x2 b2 = uint3x2(689376654, 1120457204, 516903000, 873091659, 1353196495, 1384773500); + uint3x2 r2 = uint3x2(2005201900, 651971856, 2573806560, 4184807018, 4175537714, 3758002136); + TestUtils.AreEqual(r2, a2 * b2); + + uint3x2 a3 = uint3x2(2075923048, 1116477212, 1686101741, 783310758, 248585944, 1093377716); + uint3x2 b3 = uint3x2(1596528529, 2122329305, 1033200564, 996795088, 1137754930, 232014195); + uint3x2 r3 = uint3x2(2245379304, 3535300284, 1443849636, 550781664, 3335949872, 3941859036); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void uint3x2_operator_mul_wide_scalar() + { + uint3x2 a0 = uint3x2(871746615, 492532311, 570557670, 2142306629, 1610315153, 1526163563); + uint b0 = (442064533); + uint3x2 r0 = uint3x2(338365955, 1081376419, 2565819870, 3279557417, 3421481829, 4119466055); + TestUtils.AreEqual(r0, a0 * b0); + + uint3x2 a1 = uint3x2(118471734, 364291059, 1186560810, 1584938026, 1357601203, 638897141); + uint b1 = (257439514); + uint3x2 r1 = uint3x2(4120426364, 172874670, 3569125444, 2442338884, 448041262, 3441842658); + TestUtils.AreEqual(r1, a1 * b1); + + uint3x2 a2 = uint3x2(268562104, 1163240135, 1619806399, 1444659979, 1127580168, 464517916); + uint b2 = (1007838321); + uint3x2 r2 = uint3x2(3138010936, 610309591, 1271183439, 624387035, 2516157832, 784123740); + TestUtils.AreEqual(r2, a2 * b2); + + uint3x2 a3 = uint3x2(1508043166, 636691139, 1851670006, 357357967, 1095280227, 702779195); + uint b3 = (745488654); + uint3x2 r3 = uint3x2(4215006372, 1705798058, 478992756, 2524067026, 757415018, 1348784186); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void uint3x2_operator_mul_scalar_wide() + { + uint a0 = (1152242766); + uint3x2 b0 = uint3x2(1276636134, 2105929407, 499007702, 124002565, 1956335172, 1288034953); + uint3x2 r0 = uint3x2(2165463060, 999811634, 1179056436, 3493540742, 404105400, 1339492798); + TestUtils.AreEqual(r0, a0 * b0); + + uint a1 = (832676555); + uint3x2 b1 = uint3x2(337389733, 99268757, 2005055247, 2011389505, 1348110859, 399689191); + uint3x2 r1 = uint3x2(3906053335, 3567495207, 2079172325, 2865880971, 4010896569, 4070972461); + TestUtils.AreEqual(r1, a1 * b1); + + uint a2 = (2007606374); + uint3x2 b2 = uint3x2(2076691289, 1825721194, 769885235, 153314735, 1066325369, 84289667); + uint3x2 r2 = uint3x2(3969976694, 588510268, 67262546, 3401949114, 4287337014, 2514686002); + TestUtils.AreEqual(r2, a2 * b2); + + uint a3 = (984486192); + uint3x2 b3 = uint3x2(1325213504, 1643957457, 1576395620, 2095980601, 907671947, 836919582); + uint3x2 r3 = uint3x2(3432160256, 3104720944, 673990336, 227005360, 4176151824, 826880928); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void uint3x2_operator_div_wide_wide() + { + uint3x2 a0 = uint3x2(333171510, 858154903, 1181365836, 671357749, 1090606752, 803759420); + uint3x2 b0 = uint3x2(698897823, 440199998, 655557473, 1658534285, 2127220100, 315653188); + uint3x2 r0 = uint3x2(0, 1, 1, 0, 0, 2); + TestUtils.AreEqual(r0, a0 / b0); + + uint3x2 a1 = uint3x2(788404166, 296807814, 575260195, 166625280, 1493729000, 1831739736); + uint3x2 b1 = uint3x2(1814290360, 992173243, 914851653, 664340325, 224323977, 246981573); + uint3x2 r1 = uint3x2(0, 0, 0, 0, 6, 7); + TestUtils.AreEqual(r1, a1 / b1); + + uint3x2 a2 = uint3x2(200852358, 129983172, 500176108, 472051781, 414699094, 1446535974); + uint3x2 b2 = uint3x2(285573983, 819471609, 2012476015, 1783179572, 223253978, 169515029); + uint3x2 r2 = uint3x2(0, 0, 0, 0, 1, 8); + TestUtils.AreEqual(r2, a2 / b2); + + uint3x2 a3 = uint3x2(1278480457, 930910505, 263295881, 1626759436, 450830871, 21439121); + uint3x2 b3 = uint3x2(1694929006, 1992168131, 1155972447, 1768506696, 422325410, 1508417406); + uint3x2 r3 = uint3x2(0, 0, 0, 0, 1, 0); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void uint3x2_operator_div_wide_scalar() + { + uint3x2 a0 = uint3x2(1433072926, 1073958635, 1195142312, 536596719, 1274375693, 464756346); + uint b0 = (1434025872); + uint3x2 r0 = uint3x2(0, 0, 0, 0, 0, 0); + TestUtils.AreEqual(r0, a0 / b0); + + uint3x2 a1 = uint3x2(806462546, 1380905136, 25493909, 1196815948, 123300377, 643754735); + uint b1 = (906504670); + uint3x2 r1 = uint3x2(0, 1, 0, 1, 0, 0); + TestUtils.AreEqual(r1, a1 / b1); + + uint3x2 a2 = uint3x2(2084019932, 458304263, 741331531, 466443901, 2110004616, 1500687214); + uint b2 = (2047825037); + uint3x2 r2 = uint3x2(1, 0, 0, 0, 1, 0); + TestUtils.AreEqual(r2, a2 / b2); + + uint3x2 a3 = uint3x2(1453264263, 2040203220, 2103351724, 485536709, 402141749, 1477264254); + uint b3 = (1617154145); + uint3x2 r3 = uint3x2(0, 1, 1, 0, 0, 0); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void uint3x2_operator_div_scalar_wide() + { + uint a0 = (519165704); + uint3x2 b0 = uint3x2(1295178177, 775214121, 467772046, 1156881598, 310396565, 759759959); + uint3x2 r0 = uint3x2(0, 0, 1, 0, 1, 0); + TestUtils.AreEqual(r0, a0 / b0); + + uint a1 = (243837702); + uint3x2 b1 = uint3x2(1616314235, 1053470225, 1320630160, 378773841, 4223608, 1971105754); + uint3x2 r1 = uint3x2(0, 0, 0, 0, 57, 0); + TestUtils.AreEqual(r1, a1 / b1); + + uint a2 = (2054406020); + uint3x2 b2 = uint3x2(219939614, 1603672651, 2006134295, 888535397, 1493077923, 615835131); + uint3x2 r2 = uint3x2(9, 1, 1, 2, 1, 3); + TestUtils.AreEqual(r2, a2 / b2); + + uint a3 = (1045603945); + uint3x2 b3 = uint3x2(452709946, 1074919059, 467037221, 1485241506, 1775728786, 481521341); + uint3x2 r3 = uint3x2(2, 0, 2, 0, 0, 2); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void uint3x2_operator_mod_wide_wide() + { + uint3x2 a0 = uint3x2(258342924, 1454754891, 723352342, 1981431473, 531756042, 716993627); + uint3x2 b0 = uint3x2(1990080167, 1197348066, 651970512, 1659454050, 241005212, 1866255454); + uint3x2 r0 = uint3x2(258342924, 257406825, 71381830, 321977423, 49745618, 716993627); + TestUtils.AreEqual(r0, a0 % b0); + + uint3x2 a1 = uint3x2(1667903349, 1331097004, 1776856101, 17598216, 1474345080, 1681376293); + uint3x2 b1 = uint3x2(1440101415, 595220963, 408818410, 198222574, 549504274, 239973807); + uint3x2 r1 = uint3x2(227801934, 140655078, 141582461, 17598216, 375336532, 1559644); + TestUtils.AreEqual(r1, a1 % b1); + + uint3x2 a2 = uint3x2(813624265, 1617478722, 498370451, 780075943, 1754430321, 653235398); + uint3x2 b2 = uint3x2(321398087, 658171840, 1511495237, 1048325585, 1126739824, 666641241); + uint3x2 r2 = uint3x2(170828091, 301135042, 498370451, 780075943, 627690497, 653235398); + TestUtils.AreEqual(r2, a2 % b2); + + uint3x2 a3 = uint3x2(1517128354, 966216200, 590067427, 1283434795, 1910903650, 1125967790); + uint3x2 b3 = uint3x2(38017598, 418797691, 618700513, 1941062990, 158556432, 1081063558); + uint3x2 r3 = uint3x2(34442032, 128620818, 590067427, 1283434795, 8226466, 44904232); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void uint3x2_operator_mod_wide_scalar() + { + uint3x2 a0 = uint3x2(560988938, 629524514, 767711194, 434281967, 1399805893, 792916846); + uint b0 = (1156862367); + uint3x2 r0 = uint3x2(560988938, 629524514, 767711194, 434281967, 242943526, 792916846); + TestUtils.AreEqual(r0, a0 % b0); + + uint3x2 a1 = uint3x2(1663690927, 1776636144, 1287035793, 1743722161, 475209785, 327476870); + uint b1 = (598661916); + uint3x2 r1 = uint3x2(466367095, 579312312, 89711961, 546398329, 475209785, 327476870); + TestUtils.AreEqual(r1, a1 % b1); + + uint3x2 a2 = uint3x2(1617696916, 477430114, 858399046, 712734431, 1506629323, 199829950); + uint b2 = (379853074); + uint3x2 r2 = uint3x2(98284620, 97577040, 98692898, 332881357, 367070101, 199829950); + TestUtils.AreEqual(r2, a2 % b2); + + uint3x2 a3 = uint3x2(362269020, 1351725413, 1549678101, 431765276, 1315833792, 1664893153); + uint b3 = (1986626876); + uint3x2 r3 = uint3x2(362269020, 1351725413, 1549678101, 431765276, 1315833792, 1664893153); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void uint3x2_operator_mod_scalar_wide() + { + uint a0 = (933347930); + uint3x2 b0 = uint3x2(549923387, 243114953, 1884274390, 1428033594, 655531454, 1622674954); + uint3x2 r0 = uint3x2(383424543, 204003071, 933347930, 933347930, 277816476, 933347930); + TestUtils.AreEqual(r0, a0 % b0); + + uint a1 = (1107563514); + uint3x2 b1 = uint3x2(1614111094, 914801920, 1432263179, 564431096, 1967013901, 1709750152); + uint3x2 r1 = uint3x2(1107563514, 192761594, 1107563514, 543132418, 1107563514, 1107563514); + TestUtils.AreEqual(r1, a1 % b1); + + uint a2 = (1080102613); + uint3x2 b2 = uint3x2(13120773, 2042535998, 1505698002, 1640058084, 974167554, 758635306); + uint3x2 r2 = uint3x2(4199227, 1080102613, 1080102613, 1080102613, 105935059, 321467307); + TestUtils.AreEqual(r2, a2 % b2); + + uint a3 = (1387264978); + uint3x2 b3 = uint3x2(611743343, 1139002766, 1913935748, 1086810076, 991846486, 922870408); + uint3x2 r3 = uint3x2(163778292, 248262212, 1387264978, 300454902, 395418492, 464394570); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void uint3x2_operator_plus() + { + uint3x2 a0 = uint3x2(195392567, 222719748, 1002351013, 1570765263, 109389333, 1515950277); + uint3x2 r0 = uint3x2(195392567, 222719748, 1002351013, 1570765263, 109389333, 1515950277); + TestUtils.AreEqual(r0, +a0); + + uint3x2 a1 = uint3x2(1689763402, 264115671, 1084131995, 195779102, 2131702223, 715660442); + uint3x2 r1 = uint3x2(1689763402, 264115671, 1084131995, 195779102, 2131702223, 715660442); + TestUtils.AreEqual(r1, +a1); + + uint3x2 a2 = uint3x2(1995564647, 1317851903, 1957501908, 531426536, 2012985092, 1334133318); + uint3x2 r2 = uint3x2(1995564647, 1317851903, 1957501908, 531426536, 2012985092, 1334133318); + TestUtils.AreEqual(r2, +a2); + + uint3x2 a3 = uint3x2(1539671418, 1575048895, 2119066258, 781435471, 1659000230, 1301861249); + uint3x2 r3 = uint3x2(1539671418, 1575048895, 2119066258, 781435471, 1659000230, 1301861249); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void uint3x2_operator_neg() + { + uint3x2 a0 = uint3x2(1385088677, 94114564, 1350664872, 1458616659, 2067164853, 218122493); + uint3x2 r0 = uint3x2(2909878619, 4200852732, 2944302424, 2836350637, 2227802443, 4076844803); + TestUtils.AreEqual(r0, -a0); + + uint3x2 a1 = uint3x2(958484951, 446497525, 270503114, 1928771252, 1427605822, 2051940607); + uint3x2 r1 = uint3x2(3336482345, 3848469771, 4024464182, 2366196044, 2867361474, 2243026689); + TestUtils.AreEqual(r1, -a1); + + uint3x2 a2 = uint3x2(1434247484, 908365416, 1742096480, 990033169, 1368056141, 1350976157); + uint3x2 r2 = uint3x2(2860719812, 3386601880, 2552870816, 3304934127, 2926911155, 2943991139); + TestUtils.AreEqual(r2, -a2); + + uint3x2 a3 = uint3x2(12802586, 576597401, 785136322, 559205611, 1959833280, 162379661); + uint3x2 r3 = uint3x2(4282164710, 3718369895, 3509830974, 3735761685, 2335134016, 4132587635); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void uint3x2_operator_prefix_inc() + { + uint3x2 a0 = uint3x2(780471723, 954741756, 272723451, 2142862245, 606294309, 1514814550); + uint3x2 r0 = uint3x2(780471724, 954741757, 272723452, 2142862246, 606294310, 1514814551); + TestUtils.AreEqual(r0, ++a0); + + uint3x2 a1 = uint3x2(250124151, 1833356994, 1915989169, 1348278302, 129540735, 1584496757); + uint3x2 r1 = uint3x2(250124152, 1833356995, 1915989170, 1348278303, 129540736, 1584496758); + TestUtils.AreEqual(r1, ++a1); + + uint3x2 a2 = uint3x2(1170613526, 1701179230, 1397451003, 483952900, 1494652811, 1268688387); + uint3x2 r2 = uint3x2(1170613527, 1701179231, 1397451004, 483952901, 1494652812, 1268688388); + TestUtils.AreEqual(r2, ++a2); + + uint3x2 a3 = uint3x2(2014528731, 1112537171, 621362788, 2063486914, 1612870531, 1161037742); + uint3x2 r3 = uint3x2(2014528732, 1112537172, 621362789, 2063486915, 1612870532, 1161037743); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void uint3x2_operator_postfix_inc() + { + uint3x2 a0 = uint3x2(241865086, 2145821641, 1596166022, 803592338, 529551271, 1656767229); + uint3x2 r0 = uint3x2(241865086, 2145821641, 1596166022, 803592338, 529551271, 1656767229); + TestUtils.AreEqual(r0, a0++); + + uint3x2 a1 = uint3x2(903047443, 1425753247, 1384002775, 389844650, 1159795446, 1343289659); + uint3x2 r1 = uint3x2(903047443, 1425753247, 1384002775, 389844650, 1159795446, 1343289659); + TestUtils.AreEqual(r1, a1++); + + uint3x2 a2 = uint3x2(1227160199, 137930180, 451018043, 1634297552, 2009552507, 1176922170); + uint3x2 r2 = uint3x2(1227160199, 137930180, 451018043, 1634297552, 2009552507, 1176922170); + TestUtils.AreEqual(r2, a2++); + + uint3x2 a3 = uint3x2(388721494, 2062858295, 715101397, 1725384327, 446867079, 2101314783); + uint3x2 r3 = uint3x2(388721494, 2062858295, 715101397, 1725384327, 446867079, 2101314783); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void uint3x2_operator_prefix_dec() + { + uint3x2 a0 = uint3x2(1331961415, 1612382200, 1401591249, 2042075388, 1757136546, 1895858159); + uint3x2 r0 = uint3x2(1331961414, 1612382199, 1401591248, 2042075387, 1757136545, 1895858158); + TestUtils.AreEqual(r0, --a0); + + uint3x2 a1 = uint3x2(1467742422, 1336115745, 2059077641, 1169239112, 1862369220, 312317355); + uint3x2 r1 = uint3x2(1467742421, 1336115744, 2059077640, 1169239111, 1862369219, 312317354); + TestUtils.AreEqual(r1, --a1); + + uint3x2 a2 = uint3x2(1027543764, 1426262619, 1426620468, 674685792, 1423852012, 1459529624); + uint3x2 r2 = uint3x2(1027543763, 1426262618, 1426620467, 674685791, 1423852011, 1459529623); + TestUtils.AreEqual(r2, --a2); + + uint3x2 a3 = uint3x2(2092317419, 1261583506, 512900840, 1496855314, 777588547, 617644613); + uint3x2 r3 = uint3x2(2092317418, 1261583505, 512900839, 1496855313, 777588546, 617644612); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void uint3x2_operator_postfix_dec() + { + uint3x2 a0 = uint3x2(1870005937, 1708534798, 704493460, 462940703, 2060593573, 228744869); + uint3x2 r0 = uint3x2(1870005937, 1708534798, 704493460, 462940703, 2060593573, 228744869); + TestUtils.AreEqual(r0, a0--); + + uint3x2 a1 = uint3x2(940247280, 1015253889, 862428933, 1401191870, 2080259851, 653673271); + uint3x2 r1 = uint3x2(940247280, 1015253889, 862428933, 1401191870, 2080259851, 653673271); + TestUtils.AreEqual(r1, a1--); + + uint3x2 a2 = uint3x2(140452688, 1760916301, 1174531383, 634036198, 993137684, 1669210509); + uint3x2 r2 = uint3x2(140452688, 1760916301, 1174531383, 634036198, 993137684, 1669210509); + TestUtils.AreEqual(r2, a2--); + + uint3x2 a3 = uint3x2(874927437, 471308632, 620865961, 220103745, 1407678826, 319906934); + uint3x2 r3 = uint3x2(874927437, 471308632, 620865961, 220103745, 1407678826, 319906934); + TestUtils.AreEqual(r3, a3--); + } + + [TestCompiler] + public static void uint3x2_operator_bitwise_and_wide_wide() + { + uint3x2 a0 = uint3x2(1055241304, 859321394, 1088358961, 2090949513, 300561740, 651904515); + uint3x2 b0 = uint3x2(749698416, 748105424, 1842764797, 9990577, 1989102105, 1666634755); + uint3x2 r0 = uint3x2(749024336, 537928720, 1087769137, 8409473, 277479432, 575816707); + TestUtils.AreEqual(r0, a0 & b0); + + uint3x2 a1 = uint3x2(1331035868, 2012752753, 1298126656, 53199569, 1752363533, 1303061302); + uint3x2 b1 = uint3x2(58116798, 868036607, 1420638875, 1308767169, 564040763, 478617502); + uint3x2 r1 = uint3x2(55888540, 867707761, 1141707264, 33686209, 538087433, 209912598); + TestUtils.AreEqual(r1, a1 & b1); + + uint3x2 a2 = uint3x2(1929998247, 1504941434, 470682792, 713577376, 1493231658, 1340884669); + uint3x2 b2 = uint3x2(806150474, 674015378, 1505309955, 36064977, 1779639327, 808650076); + uint3x2 r2 = uint3x2(805855490, 136347666, 403178496, 33571456, 1207967754, 2098204); + TestUtils.AreEqual(r2, a2 & b2); + + uint3x2 a3 = uint3x2(1577921467, 44846626, 1105094388, 1143008413, 333009589, 2116296009); + uint3x2 b3 = uint3x2(1634437037, 1997568501, 1930853951, 1901503461, 1508772523, 2010961769); + uint3x2 r3 = uint3x2(1074332585, 33572896, 1091986996, 1073782917, 298320545, 1979979081); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void uint3x2_operator_bitwise_and_wide_scalar() + { + uint3x2 a0 = uint3x2(1513158868, 284695609, 734595037, 1566510707, 1601252476, 84213838); + uint b0 = (1173647397); + uint3x2 r0 = uint3x2(1076916228, 15732769, 29360133, 1163132961, 1164976164, 84148228); + TestUtils.AreEqual(r0, a0 & b0); + + uint3x2 a1 = uint3x2(314333543, 753481263, 327392481, 1619794917, 2143619546, 1873208293); + uint b1 = (430856908); + uint3x2 r1 = uint3x2(279730244, 145232396, 293738688, 9181892, 428083400, 161891012); + TestUtils.AreEqual(r1, a1 & b1); + + uint3x2 a2 = uint3x2(126982769, 1383096952, 1689107088, 1368301071, 366962092, 1729929586); + uint b2 = (651482651); + uint3x2 r2 = uint3x2(110137873, 38814232, 612667920, 8689163, 81019912, 638877714); + TestUtils.AreEqual(r2, a2 & b2); + + uint3x2 a3 = uint3x2(989550739, 1592791064, 2047510829, 678485991, 586400261, 771972179); + uint b3 = (1914435619); + uint3x2 r3 = uint3x2(840652803, 1376784384, 1913292833, 537974819, 571719681, 570644483); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void uint3x2_operator_bitwise_and_scalar_wide() + { + uint a0 = (477163326); + uint3x2 b0 = uint3x2(110453385, 703240362, 2075630560, 1884904031, 1734899436, 947945203); + uint3x2 r0 = uint3x2(68182536, 140544042, 405834528, 273697310, 73426476, 402681394); + TestUtils.AreEqual(r0, a0 & b0); + + uint a1 = (1664399051); + uint3x2 b1 = uint3x2(458879298, 158491426, 79772356, 2054527944, 202228212, 359225061); + uint3x2 r1 = uint3x2(51425346, 19931650, 12992, 1647612616, 295104, 18880193); + TestUtils.AreEqual(r1, a1 & b1); + + uint a2 = (639811396); + uint3x2 b2 = uint3x2(1821945318, 1821303024, 2030124055, 1985961756, 579780373, 2061831301); + uint3x2 r2 = uint3x2(604024132, 604151872, 536886276, 637673220, 570605316, 572525572); + TestUtils.AreEqual(r2, a2 & b2); + + uint a3 = (1139618293); + uint3x2 b3 = uint3x2(1145191868, 1121606282, 1414714065, 688688277, 1508875606, 664318814); + uint3x2 r3 = uint3x2(1077948852, 1120407680, 1077940433, 17563797, 1106055508, 59257172); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void uint3x2_operator_bitwise_or_wide_wide() + { + uint3x2 a0 = uint3x2(1920951869, 1750772852, 1420019191, 732977093, 1169579447, 229437930); + uint3x2 b0 = uint3x2(214585254, 275414367, 858759675, 190211455, 1218691723, 2129565457); + uint3x2 r0 = uint3x2(2130669503, 2021326207, 2008016383, 737572863, 1303895999, 2146367483); + TestUtils.AreEqual(r0, a0 | b0); + + uint3x2 a1 = uint3x2(1966721348, 2039812323, 113550869, 1912038362, 1569990624, 1490718227); + uint3x2 b1 = uint3x2(1862809466, 495728846, 868064152, 1756913766, 933656055, 247722084); + uint3x2 r1 = uint3x2(2134507390, 2107455727, 939376541, 2046780414, 2142664695, 1591475831); + TestUtils.AreEqual(r1, a1 | b1); + + uint3x2 a2 = uint3x2(1686257697, 2137727522, 1569900650, 856504729, 2033376384, 2086259889); + uint3x2 b2 = uint3x2(1884195075, 1804207631, 1913174711, 1815920856, 1226577606, 1696467642); + uint3x2 r2 = uint3x2(1959708963, 2146117167, 2140863231, 2134768089, 2034163398, 2103430843); + TestUtils.AreEqual(r2, a2 | b2); + + uint3x2 a3 = uint3x2(671790684, 1189001916, 1756048437, 417084592, 2024165808, 966008272); + uint3x2 b3 = uint3x2(186912044, 1778908130, 1461256625, 1142152181, 272117331, 1162254035); + uint3x2 r3 = uint3x2(724483964, 1860172798, 2142973365, 1558183925, 2025750515, 2111217619); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void uint3x2_operator_bitwise_or_wide_scalar() + { + uint3x2 a0 = uint3x2(1295304853, 1307252624, 350194630, 1128063578, 1774824542, 2085245467); + uint b0 = (1305527136); + uint3x2 r0 = uint3x2(1307888629, 1308350448, 1574947814, 1341973370, 1842999166, 2111492987); + TestUtils.AreEqual(r0, a0 | b0); + + uint3x2 a1 = uint3x2(1988423804, 2110327307, 1050875188, 341855232, 1317039676, 228656898); + uint b1 = (999162350); + uint3x2 r1 = uint3x2(2140074494, 2144275439, 1068439038, 1072582126, 2140041214, 1068435438); + TestUtils.AreEqual(r1, a1 | b1); + + uint3x2 a2 = uint3x2(41280811, 606786773, 1739461580, 2040936581, 1350320187, 1377874553); + uint b2 = (1536908787); + uint3x2 r2 = uint3x2(1543503355, 2143018487, 2143248383, 2076147191, 1543462395, 1539047419); + TestUtils.AreEqual(r2, a2 | b2); + + uint3x2 a3 = uint3x2(1522262112, 1732466858, 1535976093, 375675620, 1614193383, 226059393); + uint b3 = (1496806239); + uint3x2 r3 = uint3x2(1539306367, 2138536959, 1539273695, 1601666047, 2033710079, 1568634847); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void uint3x2_operator_bitwise_or_scalar_wide() + { + uint a0 = (1768627592); + uint3x2 b0 = uint3x2(1849658052, 1759912154, 729979455, 975926310, 1987690876, 1809506714); + uint3x2 r0 = uint3x2(1870634956, 1777286618, 1810603967, 2070642094, 2138824188, 1811676570); + TestUtils.AreEqual(r0, a0 | b0); + + uint a1 = (1160695341); + uint3x2 b1 = uint3x2(408963395, 314072711, 1560007537, 1709003416, 977086639, 1448375596); + uint3x2 r1 = uint3x2(1567543151, 1472126639, 1577049981, 1711267517, 2134896303, 1467940653); + TestUtils.AreEqual(r1, a1 | b1); + + uint a2 = (1689568808); + uint3x2 b2 = uint3x2(595543345, 559778387, 621080913, 438994183, 1742637145, 1219409263); + uint3x2 r2 = uint3x2(1744815929, 1711132283, 1706358649, 2126432047, 1744752249, 1824454511); + TestUtils.AreEqual(r2, a2 | b2); + + uint a3 = (1602932494); + uint3x2 b3 = uint3x2(1204461702, 2111538444, 836730895, 1207638621, 802100209, 1089077339); + uint3x2 r3 = uint3x2(1607135118, 2145111822, 2145373967, 1610342239, 2144329727, 1609224031); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void uint3x2_operator_bitwise_xor_wide_wide() + { + uint3x2 a0 = uint3x2(1843655608, 362425681, 640805534, 1342040268, 945678755, 980321850); + uint3x2 b0 = uint3x2(1422803441, 1234691140, 119589253, 1101464929, 121896337, 1880109018); + uint3x2 r0 = uint3x2(959296073, 1544407317, 554771227, 240840109, 1058935858, 1249815008); + TestUtils.AreEqual(r0, a0 ^ b0); + + uint3x2 a1 = uint3x2(390165019, 1682422658, 303897251, 230477768, 1103646442, 1503102919); + uint3x2 b1 = uint3x2(1000210266, 1718938232, 464406940, 884337881, 34199854, 1430659227); + uint3x2 r1 = uint3x2(752651585, 36917754, 162747199, 956900113, 1136760772, 215066460); + TestUtils.AreEqual(r1, a1 ^ b1); + + uint3x2 a2 = uint3x2(26631152, 1016475570, 1862440929, 379588576, 1943580404, 691527166); + uint3x2 b2 = uint3x2(126415540, 1069919967, 1810763253, 2082802224, 941097951, 27782297); + uint3x2 r2 = uint3x2(102672708, 55804269, 82614804, 1787102672, 1270918443, 680538471); + TestUtils.AreEqual(r2, a2 ^ b2); + + uint3x2 a3 = uint3x2(723280696, 497086939, 1640104913, 893178410, 1596765788, 664096470); + uint3x2 b3 = uint3x2(156353074, 607061607, 470737131, 1151564598, 8268481, 434405645); + uint3x2 r3 = uint3x2(575512842, 965736380, 2110579514, 1906288924, 1599249565, 1047646171); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void uint3x2_operator_bitwise_xor_wide_scalar() + { + uint3x2 a0 = uint3x2(169345668, 176087064, 2084362901, 1663924004, 193851255, 517476661); + uint b0 = (354464228); + uint3x2 r0 = uint3x2(523809632, 526275068, 1763470193, 1980614336, 514678419, 200843473); + TestUtils.AreEqual(r0, a0 ^ b0); + + uint3x2 a1 = uint3x2(905336222, 365003873, 835837496, 954341348, 1464576786, 625604047); + uint b1 = (863800783); + uint3x2 r1 = uint3x2(109762641, 649922990, 44913655, 194943531, 1681336029, 372602880); + TestUtils.AreEqual(r1, a1 ^ b1); + + uint3x2 a2 = uint3x2(1700827127, 1481813598, 1077374714, 1043379893, 1991576049, 781860967); + uint b2 = (2003392824); + uint3x2 r2 = uint3x2(302634703, 792459110, 928921538, 1230630797, 31215817, 1509103967); + TestUtils.AreEqual(r2, a2 ^ b2); + + uint3x2 a3 = uint3x2(60088394, 858716109, 858484213, 178843494, 1223183458, 866652388); + uint b3 = (1196907956); + uint3x2 r3 = uint3x2(1153678846, 1954130553, 1954295873, 1308603090, 264180182, 1962888528); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void uint3x2_operator_bitwise_xor_scalar_wide() + { + uint a0 = (1361775641); + uint3x2 b0 = uint3x2(1452773578, 459050892, 1986218254, 1689037698, 999278344, 1229114508); + uint3x2 r0 = uint3x2(129801427, 1249346453, 659047703, 898082715, 1789184785, 409583765); + TestUtils.AreEqual(r0, a0 ^ b0); + + uint a1 = (1087843538); + uint3x2 b1 = uint3x2(733699740, 106187872, 1533632738, 1107817672, 492506236, 597602329); + uint3x2 r1 = uint3x2(1802269262, 1183015090, 465456176, 47241242, 1569464494, 1665768651); + TestUtils.AreEqual(r1, a1 ^ b1); + + uint a2 = (1439603382); + uint3x2 b2 = uint3x2(1001169118, 1231718216, 1693179077, 1050897427, 1796435561, 1100532547); + uint3x2 r2 = uint3x2(1851931240, 480517630, 824526451, 1802368677, 1054733535, 341201397); + TestUtils.AreEqual(r2, a2 ^ b2); + + uint a3 = (2106589181); + uint3x2 b3 = uint3x2(79691722, 851486414, 381749210, 1743618507, 2038827673, 1680906962); + uint3x2 r3 = uint3x2(2033188919, 1330600243, 1800337447, 442662454, 67761508, 431973679); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void uint3x2_operator_left_shift() + { + uint3x2 a0 = uint3x2(1129100049, 829482269, 1571297368, 443753193, 1872142968, 249554593); + int b0 = (218351941); + uint3x2 r0 = uint3x2(1771463200, 773628832, 3036875520, 1315200288, 4074000128, 3690779680); + TestUtils.AreEqual(r0, a0 << b0); + + uint3x2 a1 = uint3x2(892627436, 62369727, 849916599, 1271350845, 108441902, 1959056531); + int b1 = (980302862); + uint3x2 r1 = uint3x2(444268544, 3958358016, 749584384, 3515826176, 2890629120, 891600896); + TestUtils.AreEqual(r1, a1 << b1); + + uint3x2 a2 = uint3x2(1779118882, 2082026915, 1149883636, 1380536034, 186532735, 1487486874); + int b2 = (1451674188); + uint3x2 r2 = uint3x2(3006406656, 2472161280, 2639216640, 2498633728, 3828871168, 2482610176); + TestUtils.AreEqual(r2, a2 << b2); + + uint3x2 a3 = uint3x2(1498738574, 1647167336, 772453640, 456967739, 947384545, 1463252873); + int b3 = (752067504); + uint3x2 r3 = uint3x2(4019060736, 3345481728, 3037200384, 3325755392, 4041277440, 2005467136); + TestUtils.AreEqual(r3, a3 << b3); + } + + [TestCompiler] + public static void uint3x2_operator_right_shift() + { + uint3x2 a0 = uint3x2(809126085, 908563670, 763568837, 1986717290, 1174507510, 646821842); + int b0 = (994800051); + uint3x2 r0 = uint3x2(1543, 1732, 1456, 3789, 2240, 1233); + TestUtils.AreEqual(r0, a0 >> b0); + + uint3x2 a1 = uint3x2(1242726074, 1521420393, 1923166649, 102096936, 400863878, 667378673); + int b1 = (390811632); + uint3x2 r1 = uint3x2(18962, 23215, 29345, 1557, 6116, 10183); + TestUtils.AreEqual(r1, a1 >> b1); + + uint3x2 a2 = uint3x2(1611921244, 479442287, 2014389412, 1673938174, 1075916177, 1248577253); + int b2 = (307750782); + uint3x2 r2 = uint3x2(1, 0, 1, 1, 1, 1); + TestUtils.AreEqual(r2, a2 >> b2); + + uint3x2 a3 = uint3x2(848199210, 848976170, 500930883, 662405800, 126875849, 1103917083); + int b3 = (813936577); + uint3x2 r3 = uint3x2(424099605, 424488085, 250465441, 331202900, 63437924, 551958541); + TestUtils.AreEqual(r3, a3 >> b3); + } + + [TestCompiler] + public static void uint3x2_operator_bitwise_not() + { + uint3x2 a0 = uint3x2(111796841, 603562399, 745091931, 853183268, 1110916612, 381888399); + uint3x2 r0 = uint3x2(4183170454, 3691404896, 3549875364, 3441784027, 3184050683, 3913078896); + TestUtils.AreEqual(r0, ~a0); + + uint3x2 a1 = uint3x2(1891338755, 771210628, 787710759, 875964607, 96456785, 916013379); + uint3x2 r1 = uint3x2(2403628540, 3523756667, 3507256536, 3419002688, 4198510510, 3378953916); + TestUtils.AreEqual(r1, ~a1); + + uint3x2 a2 = uint3x2(203444882, 1020232736, 683852713, 375158799, 881353367, 1218471344); + uint3x2 r2 = uint3x2(4091522413, 3274734559, 3611114582, 3919808496, 3413613928, 3076495951); + TestUtils.AreEqual(r2, ~a2); + + uint3x2 a3 = uint3x2(1174233245, 443427914, 1385118179, 215320517, 860122767, 1411266016); + uint3x2 r3 = uint3x2(3120734050, 3851539381, 2909849116, 4079646778, 3434844528, 2883701279); + TestUtils.AreEqual(r3, ~a3); + } + + [TestCase /* For player builds */] + public static void uint3x2_EqualsObjectOverride() + { + TestUtils.IsFalse(new uint3x2().Equals((object)new int())); + TestUtils.IsTrue(new uint3x2().Equals((object)new uint3x2())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestUint3x2.gen.cs.meta b/src/Tests/Tests/Shared/TestUint3x2.gen.cs.meta new file mode 100644 index 00000000..43cda1bd --- /dev/null +++ b/src/Tests/Tests/Shared/TestUint3x2.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bede9ed05d973fa43bff7c97121eab82 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestUint3x3.gen.cs b/src/Tests/Tests/Shared/TestUint3x3.gen.cs new file mode 100644 index 00000000..9e91fc32 --- /dev/null +++ b/src/Tests/Tests/Shared/TestUint3x3.gen.cs @@ -0,0 +1,1251 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestUint3x3 + { + [TestCompiler] + public static void uint3x3_zero() + { + TestUtils.AreEqual(0u, uint3x3.zero.c0.x); + TestUtils.AreEqual(0u, uint3x3.zero.c0.y); + TestUtils.AreEqual(0u, uint3x3.zero.c0.z); + TestUtils.AreEqual(0u, uint3x3.zero.c1.x); + TestUtils.AreEqual(0u, uint3x3.zero.c1.y); + TestUtils.AreEqual(0u, uint3x3.zero.c1.z); + TestUtils.AreEqual(0u, uint3x3.zero.c2.x); + TestUtils.AreEqual(0u, uint3x3.zero.c2.y); + TestUtils.AreEqual(0u, uint3x3.zero.c2.z); + } + + [TestCompiler] + public static void uint3x3_identity() + { + TestUtils.AreEqual(1u, uint3x3.identity.c0.x); + TestUtils.AreEqual(0u, uint3x3.identity.c0.y); + TestUtils.AreEqual(0u, uint3x3.identity.c0.z); + TestUtils.AreEqual(0u, uint3x3.identity.c1.x); + TestUtils.AreEqual(1u, uint3x3.identity.c1.y); + TestUtils.AreEqual(0u, uint3x3.identity.c1.z); + TestUtils.AreEqual(0u, uint3x3.identity.c2.x); + TestUtils.AreEqual(0u, uint3x3.identity.c2.y); + TestUtils.AreEqual(1u, uint3x3.identity.c2.z); + } + + [TestCompiler] + public static void uint3x3_operator_equal_wide_wide() + { + uint3x3 a0 = uint3x3(2105871082, 35218899, 1550755093, 764676020, 606743782, 1208156098, 1023640014, 1038468316, 1416064367); + uint3x3 b0 = uint3x3(1477587886, 579629692, 540974792, 208405066, 2063397938, 1060167409, 362592601, 2097545362, 277670088); + bool3x3 r0 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + uint3x3 a1 = uint3x3(727143393, 2061243891, 184669837, 1303661760, 2044073738, 370395888, 1822916805, 1076983135, 345215866); + uint3x3 b1 = uint3x3(426944490, 901076223, 857900673, 1548779757, 325265488, 312658571, 176373760, 2052378097, 858156597); + bool3x3 r1 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + uint3x3 a2 = uint3x3(833676277, 1987782708, 1481088614, 1364754268, 93639636, 1850596922, 2073471507, 1745989448, 28118669); + uint3x3 b2 = uint3x3(982817797, 1252095508, 882634538, 1959142806, 72495800, 1077678183, 1729269763, 1607675346, 1813461519); + bool3x3 r2 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + uint3x3 a3 = uint3x3(1267554232, 1292918049, 1423451579, 644384701, 1985492825, 240481133, 2130667921, 17376735, 1263869085); + uint3x3 b3 = uint3x3(1204794859, 1324801873, 1975336, 439410532, 294085211, 1031782338, 1118745564, 180311719, 433246570); + bool3x3 r3 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void uint3x3_operator_equal_wide_scalar() + { + uint3x3 a0 = uint3x3(437822262, 2020661134, 541786900, 853113810, 23716499, 179951405, 1409026299, 948838849, 953202998); + uint b0 = (1332833578); + bool3x3 r0 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + uint3x3 a1 = uint3x3(691955848, 1851546137, 712957637, 2028784869, 1049962241, 1836975611, 1016802970, 390120467, 464814777); + uint b1 = (1926262965); + bool3x3 r1 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + uint3x3 a2 = uint3x3(1451642042, 152339338, 808355440, 660053867, 597354173, 67320270, 151461188, 35153827, 602895443); + uint b2 = (289137869); + bool3x3 r2 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + uint3x3 a3 = uint3x3(186996278, 1031574999, 1697392883, 1463742000, 857785521, 611116281, 594150729, 375387566, 1984352551); + uint b3 = (129611815); + bool3x3 r3 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void uint3x3_operator_equal_scalar_wide() + { + uint a0 = (542329200); + uint3x3 b0 = uint3x3(1115584594, 684107773, 1928988941, 890709324, 641152437, 1410341302, 497505660, 1068223109, 2014009435); + bool3x3 r0 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + uint a1 = (213835595); + uint3x3 b1 = uint3x3(1592428361, 1819361470, 448650623, 1942175642, 64377057, 1485938610, 1146305380, 1312317120, 263290348); + bool3x3 r1 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + uint a2 = (812663708); + uint3x3 b2 = uint3x3(1585209188, 40646617, 1378718922, 1957797737, 873652576, 1780082094, 1513270921, 2095980581, 1413074719); + bool3x3 r2 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + uint a3 = (1387984261); + uint3x3 b3 = uint3x3(1547119354, 924385171, 1253636050, 1477542688, 969120167, 591812191, 856880926, 1114040166, 2107388425); + bool3x3 r3 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void uint3x3_operator_not_equal_wide_wide() + { + uint3x3 a0 = uint3x3(1977284100, 1293292704, 1547283851, 422428953, 195833190, 1711544892, 5606053, 737069074, 647386678); + uint3x3 b0 = uint3x3(1514195556, 957972049, 507667364, 581861672, 1128094576, 940096636, 57559040, 181752616, 962017320); + bool3x3 r0 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + uint3x3 a1 = uint3x3(13079405, 1413841590, 1076166545, 1211445174, 1289303469, 1436402489, 1129570126, 1566836685, 1343313905); + uint3x3 b1 = uint3x3(1762015406, 1107218953, 2042026522, 836002288, 570272309, 2112081980, 1500634658, 1787808345, 566425667); + bool3x3 r1 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + uint3x3 a2 = uint3x3(329259205, 1774944480, 33906739, 2055853627, 2035015372, 1702756001, 1164186087, 329853698, 769052491); + uint3x3 b2 = uint3x3(2037529609, 1520589840, 266793699, 538816359, 2075474643, 553571317, 218264354, 654754196, 1392180230); + bool3x3 r2 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + uint3x3 a3 = uint3x3(1893312730, 438029011, 1894010522, 1365847542, 1292942830, 2146008097, 1520743598, 861728782, 1999977058); + uint3x3 b3 = uint3x3(870065147, 1398749829, 711281563, 1999640291, 231234857, 210910234, 365281355, 170643407, 757340716); + bool3x3 r3 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void uint3x3_operator_not_equal_wide_scalar() + { + uint3x3 a0 = uint3x3(1038269360, 1427812625, 103361237, 1347017023, 1523584313, 150442802, 660334527, 719113717, 262959423); + uint b0 = (768873026); + bool3x3 r0 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + uint3x3 a1 = uint3x3(484398043, 226568494, 507918242, 1702162286, 923269270, 166187260, 114581840, 1045389187, 1648095254); + uint b1 = (506946952); + bool3x3 r1 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + uint3x3 a2 = uint3x3(1461803977, 1317840133, 2146927809, 1557151164, 1284033253, 1345705546, 1747302566, 611028295, 1368046109); + uint b2 = (61801615); + bool3x3 r2 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + uint3x3 a3 = uint3x3(1848036266, 373992983, 289537519, 1388743060, 146455100, 1854553487, 872755032, 2113020512, 1062447442); + uint b3 = (2025452920); + bool3x3 r3 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void uint3x3_operator_not_equal_scalar_wide() + { + uint a0 = (1652127596); + uint3x3 b0 = uint3x3(953791238, 271722683, 1278885987, 735128017, 112416504, 25967222, 1761444475, 1844594536, 1199122922); + bool3x3 r0 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + uint a1 = (634219279); + uint3x3 b1 = uint3x3(942501101, 67161343, 969944293, 833229499, 1304301133, 704045745, 345012334, 1253134152, 325772538); + bool3x3 r1 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + uint a2 = (855127202); + uint3x3 b2 = uint3x3(793668881, 1584481616, 1101301152, 276853534, 987168816, 1258105989, 362645228, 293978043, 1772395973); + bool3x3 r2 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + uint a3 = (1692007315); + uint3x3 b3 = uint3x3(681268929, 1535518457, 595209334, 25745185, 1278016813, 2125682481, 2037751005, 1405297618, 1825546885); + bool3x3 r3 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void uint3x3_operator_less_wide_wide() + { + uint3x3 a0 = uint3x3(1486550609, 1779244308, 1602148045, 1614085440, 1975613414, 942838342, 1092279031, 373677431, 1419098312); + uint3x3 b0 = uint3x3(97842578, 536551311, 413528975, 1838293684, 1283898480, 1456599961, 1080278602, 529676676, 156584048); + bool3x3 r0 = bool3x3(false, false, false, true, false, true, false, true, false); + TestUtils.AreEqual(r0, a0 < b0); + + uint3x3 a1 = uint3x3(337757077, 1081797900, 1336745069, 840685445, 1220554047, 2013681746, 192965012, 532043965, 1000693402); + uint3x3 b1 = uint3x3(117348799, 246927124, 1916615924, 1731071394, 1328098431, 1014995792, 480319327, 1765937053, 1333997067); + bool3x3 r1 = bool3x3(false, false, true, true, true, false, true, true, true); + TestUtils.AreEqual(r1, a1 < b1); + + uint3x3 a2 = uint3x3(927236048, 1215860000, 780607596, 1882056852, 1354146545, 2135295778, 1145973790, 1938006975, 895882838); + uint3x3 b2 = uint3x3(688515308, 1856106947, 1303906227, 646821776, 1169473993, 316770064, 1518155802, 416732703, 529193056); + bool3x3 r2 = bool3x3(false, true, true, false, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + uint3x3 a3 = uint3x3(2006524299, 908581156, 1843349513, 1340458575, 1972095585, 1090933468, 924555996, 79585200, 1749924275); + uint3x3 b3 = uint3x3(1239623485, 2010112031, 2018560298, 285987009, 960617622, 462519015, 1473825625, 1187164011, 730583004); + bool3x3 r3 = bool3x3(false, true, true, false, false, false, true, true, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void uint3x3_operator_less_wide_scalar() + { + uint3x3 a0 = uint3x3(796797557, 670113454, 933579492, 278884514, 318174822, 1117630673, 741886928, 1990922600, 1030849597); + uint b0 = (746564682); + bool3x3 r0 = bool3x3(false, true, false, true, true, false, true, false, false); + TestUtils.AreEqual(r0, a0 < b0); + + uint3x3 a1 = uint3x3(1546212312, 1648393417, 1857132231, 1909506562, 1294006045, 952084157, 1303736668, 845460171, 979430272); + uint b1 = (1718582899); + bool3x3 r1 = bool3x3(true, true, false, false, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 < b1); + + uint3x3 a2 = uint3x3(1368236640, 1434668705, 659552739, 1058492383, 165694933, 1204097259, 922212691, 281328069, 24629507); + uint b2 = (24980695); + bool3x3 r2 = bool3x3(false, false, false, false, false, false, false, false, true); + TestUtils.AreEqual(r2, a2 < b2); + + uint3x3 a3 = uint3x3(1386458568, 1498707004, 1650355158, 1213017950, 1650457461, 759932777, 1542997846, 1227393490, 1520634374); + uint b3 = (1325149699); + bool3x3 r3 = bool3x3(false, false, false, true, false, true, false, true, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void uint3x3_operator_less_scalar_wide() + { + uint a0 = (186400299); + uint3x3 b0 = uint3x3(1881344229, 813834467, 1254886626, 1353590345, 1412343685, 1555571443, 1540508298, 1735458634, 135888070); + bool3x3 r0 = bool3x3(true, true, true, true, true, true, true, true, false); + TestUtils.AreEqual(r0, a0 < b0); + + uint a1 = (1643818742); + uint3x3 b1 = uint3x3(248291654, 1739560105, 728539891, 480507742, 1696553040, 540223931, 1840493353, 146833656, 798115946); + bool3x3 r1 = bool3x3(false, true, false, false, true, false, true, false, false); + TestUtils.AreEqual(r1, a1 < b1); + + uint a2 = (2002002066); + uint3x3 b2 = uint3x3(1011261705, 783550942, 1093071215, 598253401, 1432416562, 1863582169, 103622950, 775175960, 116908309); + bool3x3 r2 = bool3x3(false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + uint a3 = (1213433625); + uint3x3 b3 = uint3x3(1428954824, 1760442490, 1208143947, 751820805, 1491872302, 560004484, 2065157473, 310839658, 697329242); + bool3x3 r3 = bool3x3(true, true, false, false, true, false, true, false, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void uint3x3_operator_greater_wide_wide() + { + uint3x3 a0 = uint3x3(2087717754, 1725569452, 1298066182, 1693943616, 1319019629, 70674491, 1042499725, 1002821508, 1021857133); + uint3x3 b0 = uint3x3(85148514, 293632137, 1151128249, 409440398, 1115020183, 1508500597, 1834583302, 1755218534, 1788761753); + bool3x3 r0 = bool3x3(true, true, true, true, true, false, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + uint3x3 a1 = uint3x3(1744374599, 821751047, 467646903, 2029731638, 1377214212, 1207816926, 474621063, 20781266, 366593779); + uint3x3 b1 = uint3x3(1128238489, 834223713, 1578743290, 1647150256, 1756397855, 1131080201, 1208965204, 1495161099, 1283714281); + bool3x3 r1 = bool3x3(true, false, false, true, false, true, false, false, false); + TestUtils.AreEqual(r1, a1 > b1); + + uint3x3 a2 = uint3x3(2068457387, 10181449, 793634464, 144474612, 99947390, 930377263, 683686232, 742803073, 918292048); + uint3x3 b2 = uint3x3(908051907, 412849651, 815822687, 730271942, 40756039, 883326140, 476260632, 1024136446, 1440596667); + bool3x3 r2 = bool3x3(true, false, false, false, true, true, true, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + uint3x3 a3 = uint3x3(875621429, 1764985258, 411384146, 1921397684, 1349107119, 640399120, 1487719331, 1467989523, 1834244794); + uint3x3 b3 = uint3x3(1253494041, 146826162, 1798399573, 2085029408, 187939428, 1009192934, 1694822273, 1866590874, 113805226); + bool3x3 r3 = bool3x3(false, true, false, false, true, false, false, false, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void uint3x3_operator_greater_wide_scalar() + { + uint3x3 a0 = uint3x3(1208626274, 239697208, 1979453345, 1253474001, 1590192876, 1487911635, 1673945595, 1662650098, 222749855); + uint b0 = (1715176566); + bool3x3 r0 = bool3x3(false, false, true, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + uint3x3 a1 = uint3x3(1433540517, 1773305960, 1850273578, 206147145, 325913453, 333381537, 1905567362, 2053577491, 570397194); + uint b1 = (566635217); + bool3x3 r1 = bool3x3(true, true, true, false, false, false, true, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + uint3x3 a2 = uint3x3(2128431130, 529971908, 1663525234, 1972984241, 1587865063, 488268523, 121921923, 812076921, 181082921); + uint b2 = (1735325311); + bool3x3 r2 = bool3x3(true, false, false, true, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + uint3x3 a3 = uint3x3(1281638484, 116518997, 1397728785, 1924199337, 742950077, 1463993051, 1598027926, 842851852, 160842093); + uint b3 = (1818357732); + bool3x3 r3 = bool3x3(false, false, false, true, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void uint3x3_operator_greater_scalar_wide() + { + uint a0 = (480938827); + uint3x3 b0 = uint3x3(1824731899, 921496110, 586859044, 946430596, 1231356727, 1390167458, 1785807092, 28949024, 2037899283); + bool3x3 r0 = bool3x3(false, false, false, false, false, false, false, true, false); + TestUtils.AreEqual(r0, a0 > b0); + + uint a1 = (595656760); + uint3x3 b1 = uint3x3(1778095771, 1233500439, 1696302238, 1445965340, 484020151, 1586962841, 1361740714, 265628948, 2003122957); + bool3x3 r1 = bool3x3(false, false, false, false, true, false, false, true, false); + TestUtils.AreEqual(r1, a1 > b1); + + uint a2 = (332267433); + uint3x3 b2 = uint3x3(1128353075, 377919478, 982113135, 1117675960, 630865591, 1550679736, 895945757, 287025687, 643452096); + bool3x3 r2 = bool3x3(false, false, false, false, false, false, false, true, false); + TestUtils.AreEqual(r2, a2 > b2); + + uint a3 = (660504007); + uint3x3 b3 = uint3x3(613135893, 633307118, 514276792, 1377364317, 84491736, 746768197, 1282879723, 589415384, 363082240); + bool3x3 r3 = bool3x3(true, true, true, false, true, false, false, true, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void uint3x3_operator_less_equal_wide_wide() + { + uint3x3 a0 = uint3x3(154092149, 1515170149, 1083970332, 785807178, 1401094881, 310537627, 868328962, 1990816725, 2035349541); + uint3x3 b0 = uint3x3(77984380, 1712054191, 1566203809, 254834519, 450519938, 389457083, 1298669505, 207343167, 1214449047); + bool3x3 r0 = bool3x3(false, true, true, false, false, true, true, false, false); + TestUtils.AreEqual(r0, a0 <= b0); + + uint3x3 a1 = uint3x3(457043352, 1123282035, 1001842946, 1387761992, 195272789, 659549000, 888761458, 283706617, 1790185840); + uint3x3 b1 = uint3x3(2059561026, 896534357, 1897470050, 521075677, 1848221945, 374708019, 1573731118, 2093466449, 1660210829); + bool3x3 r1 = bool3x3(true, false, true, false, true, false, true, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + uint3x3 a2 = uint3x3(899029812, 848317418, 1743712447, 1504407474, 1798441490, 1902791952, 606340844, 1994437705, 301831413); + uint3x3 b2 = uint3x3(1568778785, 1352157589, 1212771905, 1457525058, 1493446008, 1784768208, 1993422493, 1378671664, 1447376929); + bool3x3 r2 = bool3x3(true, true, false, false, false, false, true, false, true); + TestUtils.AreEqual(r2, a2 <= b2); + + uint3x3 a3 = uint3x3(654230470, 1223625081, 324292199, 1370931020, 1742769166, 1709242127, 105750466, 1655967312, 1455797002); + uint3x3 b3 = uint3x3(1405041439, 1765183746, 562894655, 1085068880, 1026386862, 884290156, 922346160, 330605896, 466570756); + bool3x3 r3 = bool3x3(true, true, true, false, false, false, true, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void uint3x3_operator_less_equal_wide_scalar() + { + uint3x3 a0 = uint3x3(1479531977, 1427983411, 415250630, 1245345407, 1112546666, 1072990632, 1579912858, 101048307, 1070894375); + uint b0 = (2004563877); + bool3x3 r0 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + uint3x3 a1 = uint3x3(509818792, 85452501, 518127023, 1246249980, 1097326500, 1964410699, 1968139888, 1191853379, 662096238); + uint b1 = (1910488590); + bool3x3 r1 = bool3x3(true, true, true, true, true, false, false, true, true); + TestUtils.AreEqual(r1, a1 <= b1); + + uint3x3 a2 = uint3x3(1140643434, 155343473, 995927387, 974873240, 1773400038, 497436329, 1825940497, 527516420, 1477043363); + uint b2 = (754434551); + bool3x3 r2 = bool3x3(false, true, false, false, false, true, false, true, false); + TestUtils.AreEqual(r2, a2 <= b2); + + uint3x3 a3 = uint3x3(1378470734, 37188105, 839762283, 781102710, 766321672, 1145011483, 139031840, 127837780, 817806943); + uint b3 = (96190147); + bool3x3 r3 = bool3x3(false, true, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void uint3x3_operator_less_equal_scalar_wide() + { + uint a0 = (1899193992); + uint3x3 b0 = uint3x3(915011820, 980913757, 1337699683, 1476321359, 1102143668, 660493983, 184664508, 381579707, 1954892821); + bool3x3 r0 = bool3x3(false, false, false, false, false, false, false, false, true); + TestUtils.AreEqual(r0, a0 <= b0); + + uint a1 = (1295090571); + uint3x3 b1 = uint3x3(1440368586, 1696003686, 88708652, 1332251857, 1310713644, 2112132784, 48951945, 1888568027, 39340955); + bool3x3 r1 = bool3x3(true, true, false, true, true, true, false, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + uint a2 = (1108242207); + uint3x3 b2 = uint3x3(260777425, 593122164, 291471959, 253457314, 1264570386, 699618012, 927735863, 2063158939, 932253787); + bool3x3 r2 = bool3x3(false, false, false, false, true, false, false, true, false); + TestUtils.AreEqual(r2, a2 <= b2); + + uint a3 = (1168754049); + uint3x3 b3 = uint3x3(749328788, 1882694892, 168499987, 378173027, 339963627, 832906712, 559482768, 53067420, 1895722478); + bool3x3 r3 = bool3x3(false, true, false, false, false, false, false, false, true); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void uint3x3_operator_greater_equal_wide_wide() + { + uint3x3 a0 = uint3x3(8538378, 2131749726, 265427108, 523609761, 994991818, 839709564, 101288202, 1886280970, 2032074826); + uint3x3 b0 = uint3x3(903145828, 1697992986, 1432491982, 169789504, 1059357300, 1744255222, 1606584463, 1905414425, 1448794969); + bool3x3 r0 = bool3x3(false, true, false, true, false, false, false, false, true); + TestUtils.AreEqual(r0, a0 >= b0); + + uint3x3 a1 = uint3x3(631221455, 1456286159, 961342752, 424526026, 788481984, 1662488497, 870326690, 708712581, 1260182701); + uint3x3 b1 = uint3x3(136181998, 1678754836, 2069656857, 398982689, 243317404, 740939613, 1894753119, 301760792, 1260647988); + bool3x3 r1 = bool3x3(true, false, false, true, true, true, false, true, false); + TestUtils.AreEqual(r1, a1 >= b1); + + uint3x3 a2 = uint3x3(1165630721, 138247561, 1108650168, 1933222913, 672493999, 1541402159, 1921596027, 1557351956, 147242547); + uint3x3 b2 = uint3x3(3608523, 52576030, 903420465, 1648820371, 627296845, 1679808907, 1719102039, 1718081638, 655586949); + bool3x3 r2 = bool3x3(true, true, true, true, true, false, true, false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + uint3x3 a3 = uint3x3(892772168, 2089286723, 1273466960, 644009998, 654784654, 189030610, 1035542641, 346401762, 739783704); + uint3x3 b3 = uint3x3(477267189, 62092869, 2013928066, 280292357, 254052205, 1092440092, 1947011057, 625632982, 2028466303); + bool3x3 r3 = bool3x3(true, true, false, true, true, false, false, false, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void uint3x3_operator_greater_equal_wide_scalar() + { + uint3x3 a0 = uint3x3(2049236663, 182691143, 634973382, 1197012109, 439837565, 1367606469, 1108037359, 351147187, 1898505669); + uint b0 = (1061998015); + bool3x3 r0 = bool3x3(true, false, false, true, false, true, true, false, true); + TestUtils.AreEqual(r0, a0 >= b0); + + uint3x3 a1 = uint3x3(411667685, 4652390, 996159180, 2111455181, 727766399, 96217144, 814085575, 1525995206, 1293933760); + uint b1 = (1998610091); + bool3x3 r1 = bool3x3(false, false, false, true, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + uint3x3 a2 = uint3x3(1732973229, 899444524, 1023753195, 1373738074, 518164359, 717850464, 1765188600, 1826820341, 527594558); + uint b2 = (1473283041); + bool3x3 r2 = bool3x3(true, false, false, false, false, false, true, true, false); + TestUtils.AreEqual(r2, a2 >= b2); + + uint3x3 a3 = uint3x3(1816542874, 1143596061, 1819554651, 160724539, 993212636, 878086499, 363122662, 1989978759, 2145562949); + uint b3 = (839185150); + bool3x3 r3 = bool3x3(true, true, true, false, true, true, false, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void uint3x3_operator_greater_equal_scalar_wide() + { + uint a0 = (1859811087); + uint3x3 b0 = uint3x3(1070365918, 1783869452, 830091760, 377157428, 327199016, 90384229, 1154649706, 376758501, 1079802834); + bool3x3 r0 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + uint a1 = (2054742898); + uint3x3 b1 = uint3x3(1328349472, 434061447, 951207723, 598695892, 975131651, 1714007943, 177416473, 1267232721, 31082860); + bool3x3 r1 = bool3x3(true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 >= b1); + + uint a2 = (216791741); + uint3x3 b2 = uint3x3(119054289, 1905107583, 89559116, 55041824, 691334141, 462326883, 1658303669, 914628512, 1134364322); + bool3x3 r2 = bool3x3(true, false, true, true, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + uint a3 = (1677134711); + uint3x3 b3 = uint3x3(1955614770, 2067009301, 1454405405, 299467282, 1584922149, 561776357, 564147844, 398216936, 1478439642); + bool3x3 r3 = bool3x3(false, false, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void uint3x3_operator_add_wide_wide() + { + uint3x3 a0 = uint3x3(2135171378, 21433296, 1954723494, 683604307, 1054212315, 1762680995, 1963655852, 1257853062, 2043493600); + uint3x3 b0 = uint3x3(1013431952, 366718162, 359290756, 1393163294, 1962236872, 1263270041, 1862666629, 1077447887, 821693806); + uint3x3 r0 = uint3x3(3148603330, 388151458, 2314014250, 2076767601, 3016449187, 3025951036, 3826322481, 2335300949, 2865187406); + TestUtils.AreEqual(r0, a0 + b0); + + uint3x3 a1 = uint3x3(976898058, 1915056423, 121374462, 1218855698, 700538222, 1702057277, 1788251699, 1534939160, 398651016); + uint3x3 b1 = uint3x3(487316539, 350922520, 1583012528, 1951595076, 1024851344, 874302782, 1383969588, 1767968088, 900721406); + uint3x3 r1 = uint3x3(1464214597, 2265978943, 1704386990, 3170450774, 1725389566, 2576360059, 3172221287, 3302907248, 1299372422); + TestUtils.AreEqual(r1, a1 + b1); + + uint3x3 a2 = uint3x3(1674272498, 374510467, 824322986, 1217622199, 1122376670, 642613771, 1097903998, 359042741, 929182687); + uint3x3 b2 = uint3x3(1659790033, 1792273749, 443844328, 633981449, 2010244807, 335566991, 521931102, 544297835, 1681549647); + uint3x3 r2 = uint3x3(3334062531, 2166784216, 1268167314, 1851603648, 3132621477, 978180762, 1619835100, 903340576, 2610732334); + TestUtils.AreEqual(r2, a2 + b2); + + uint3x3 a3 = uint3x3(1713065399, 892057490, 1295346111, 1806236181, 1838589664, 173985173, 1875814528, 1464015613, 1550659036); + uint3x3 b3 = uint3x3(1784248858, 585904415, 3128418, 1806236610, 179909533, 378711407, 195687764, 357131656, 383703567); + uint3x3 r3 = uint3x3(3497314257, 1477961905, 1298474529, 3612472791, 2018499197, 552696580, 2071502292, 1821147269, 1934362603); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void uint3x3_operator_add_wide_scalar() + { + uint3x3 a0 = uint3x3(665815972, 1783729250, 1591678394, 1284528538, 977850224, 71069732, 1138577680, 1200356017, 565982008); + uint b0 = (1334043849); + uint3x3 r0 = uint3x3(1999859821, 3117773099, 2925722243, 2618572387, 2311894073, 1405113581, 2472621529, 2534399866, 1900025857); + TestUtils.AreEqual(r0, a0 + b0); + + uint3x3 a1 = uint3x3(1246759684, 57252642, 678921480, 625943813, 512157429, 1470648741, 1490096953, 1467033531, 182608093); + uint b1 = (1088001167); + uint3x3 r1 = uint3x3(2334760851, 1145253809, 1766922647, 1713944980, 1600158596, 2558649908, 2578098120, 2555034698, 1270609260); + TestUtils.AreEqual(r1, a1 + b1); + + uint3x3 a2 = uint3x3(1707296407, 1333833947, 653973063, 1139546735, 1834005844, 184572739, 1980578280, 1858520040, 97099208); + uint b2 = (1703724354); + uint3x3 r2 = uint3x3(3411020761, 3037558301, 2357697417, 2843271089, 3537730198, 1888297093, 3684302634, 3562244394, 1800823562); + TestUtils.AreEqual(r2, a2 + b2); + + uint3x3 a3 = uint3x3(421437295, 166844260, 1568146789, 82548613, 533562157, 1464065228, 716600557, 831997894, 861575416); + uint b3 = (1251829854); + uint3x3 r3 = uint3x3(1673267149, 1418674114, 2819976643, 1334378467, 1785392011, 2715895082, 1968430411, 2083827748, 2113405270); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void uint3x3_operator_add_scalar_wide() + { + uint a0 = (359966320); + uint3x3 b0 = uint3x3(2146146202, 767103309, 851002415, 311531406, 1491262941, 1016891373, 1954228994, 1671335850, 727870747); + uint3x3 r0 = uint3x3(2506112522, 1127069629, 1210968735, 671497726, 1851229261, 1376857693, 2314195314, 2031302170, 1087837067); + TestUtils.AreEqual(r0, a0 + b0); + + uint a1 = (551151834); + uint3x3 b1 = uint3x3(1390261152, 1699060326, 115021619, 1964440175, 440700758, 1556692550, 185414255, 933106731, 1217866784); + uint3x3 r1 = uint3x3(1941412986, 2250212160, 666173453, 2515592009, 991852592, 2107844384, 736566089, 1484258565, 1769018618); + TestUtils.AreEqual(r1, a1 + b1); + + uint a2 = (729761881); + uint3x3 b2 = uint3x3(1742597318, 1090109152, 1467373815, 1066072609, 138237856, 634834665, 993603553, 347587889, 2050191349); + uint3x3 r2 = uint3x3(2472359199, 1819871033, 2197135696, 1795834490, 867999737, 1364596546, 1723365434, 1077349770, 2779953230); + TestUtils.AreEqual(r2, a2 + b2); + + uint a3 = (670698672); + uint3x3 b3 = uint3x3(1658205080, 1874808705, 2082982954, 869839589, 118460267, 2126166073, 1826004041, 1976984739, 1612682951); + uint3x3 r3 = uint3x3(2328903752, 2545507377, 2753681626, 1540538261, 789158939, 2796864745, 2496702713, 2647683411, 2283381623); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void uint3x3_operator_sub_wide_wide() + { + uint3x3 a0 = uint3x3(1410318491, 1097280168, 1827039044, 28881338, 328720965, 875487868, 212936325, 231977215, 1740021315); + uint3x3 b0 = uint3x3(1315897366, 799052018, 1580289673, 1094686261, 1954325726, 1197734816, 229886366, 915679176, 1746884850); + uint3x3 r0 = uint3x3(94421125, 298228150, 246749371, 3229162373, 2669362535, 3972720348, 4278017255, 3611265335, 4288103761); + TestUtils.AreEqual(r0, a0 - b0); + + uint3x3 a1 = uint3x3(2011295463, 48079003, 591379285, 1125909359, 1842588095, 848561896, 614448464, 2067598029, 1618238416); + uint3x3 b1 = uint3x3(918743925, 1007797419, 257421324, 287249342, 1617287463, 1653916102, 123586847, 502107404, 672875302); + uint3x3 r1 = uint3x3(1092551538, 3335248880, 333957961, 838660017, 225300632, 3489613090, 490861617, 1565490625, 945363114); + TestUtils.AreEqual(r1, a1 - b1); + + uint3x3 a2 = uint3x3(318516219, 1090119767, 1991095823, 949592162, 1951912339, 1457818751, 1642553126, 2114366549, 1420516260); + uint3x3 b2 = uint3x3(1256481116, 1975569142, 1794443030, 1327558915, 330955394, 1596041731, 1069074732, 1120817099, 2076417364); + uint3x3 r2 = uint3x3(3357002399, 3409517921, 196652793, 3917000543, 1620956945, 4156744316, 573478394, 993549450, 3639066192); + TestUtils.AreEqual(r2, a2 - b2); + + uint3x3 a3 = uint3x3(596841760, 724518081, 1820626306, 1885185225, 246124365, 1339877262, 1277620434, 759131597, 597162957); + uint3x3 b3 = uint3x3(402521072, 839858844, 1539789702, 559077522, 822288510, 751901021, 1858312568, 1706585560, 483540199); + uint3x3 r3 = uint3x3(194320688, 4179626533, 280836604, 1326107703, 3718803151, 587976241, 3714275162, 3347513333, 113622758); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void uint3x3_operator_sub_wide_scalar() + { + uint3x3 a0 = uint3x3(1508669340, 1594795463, 266707545, 643102647, 287705008, 1475644328, 1113286221, 979450511, 2082174113); + uint b0 = (998008471); + uint3x3 r0 = uint3x3(510660869, 596786992, 3563666370, 3940061472, 3584663833, 477635857, 115277750, 4276409336, 1084165642); + TestUtils.AreEqual(r0, a0 - b0); + + uint3x3 a1 = uint3x3(1108005498, 999244508, 1806482044, 1994553647, 2101812429, 1482736902, 266654115, 1470212363, 1190349300); + uint b1 = (304369206); + uint3x3 r1 = uint3x3(803636292, 694875302, 1502112838, 1690184441, 1797443223, 1178367696, 4257252205, 1165843157, 885980094); + TestUtils.AreEqual(r1, a1 - b1); + + uint3x3 a2 = uint3x3(958542155, 1738124835, 499527536, 1612473406, 1696960099, 1287292743, 1360229454, 1032360376, 1779621585); + uint b2 = (1185075537); + uint3x3 r2 = uint3x3(4068433914, 553049298, 3609419295, 427397869, 511884562, 102217206, 175153917, 4142252135, 594546048); + TestUtils.AreEqual(r2, a2 - b2); + + uint3x3 a3 = uint3x3(964948785, 94254551, 968533883, 2075770560, 946189008, 1074604044, 1171596880, 1033389665, 1905912138); + uint b3 = (1739264125); + uint3x3 r3 = uint3x3(3520651956, 2649957722, 3524237054, 336506435, 3501892179, 3630307215, 3727300051, 3589092836, 166648013); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void uint3x3_operator_sub_scalar_wide() + { + uint a0 = (893369501); + uint3x3 b0 = uint3x3(2051906184, 1699714311, 442603706, 1735141684, 274533585, 811580259, 1196354320, 1524097023, 533621527); + uint3x3 r0 = uint3x3(3136430613, 3488622486, 450765795, 3453195113, 618835916, 81789242, 3991982477, 3664239774, 359747974); + TestUtils.AreEqual(r0, a0 - b0); + + uint a1 = (2080845793); + uint3x3 b1 = uint3x3(143958837, 1620668660, 1135989346, 1367044745, 554088609, 552670373, 1265516124, 1254902543, 1857695581); + uint3x3 r1 = uint3x3(1936886956, 460177133, 944856447, 713801048, 1526757184, 1528175420, 815329669, 825943250, 223150212); + TestUtils.AreEqual(r1, a1 - b1); + + uint a2 = (1619865274); + uint3x3 b2 = uint3x3(1313559400, 99812999, 843597298, 420111239, 1299949060, 531009038, 1103306550, 104920105, 1137308312); + uint3x3 r2 = uint3x3(306305874, 1520052275, 776267976, 1199754035, 319916214, 1088856236, 516558724, 1514945169, 482556962); + TestUtils.AreEqual(r2, a2 - b2); + + uint a3 = (1207332725); + uint3x3 b3 = uint3x3(103438360, 1157123503, 1174401240, 701247193, 1498366995, 467017290, 109208355, 1594646461, 1252691221); + uint3x3 r3 = uint3x3(1103894365, 50209222, 32931485, 506085532, 4003933026, 740315435, 1098124370, 3907653560, 4249608800); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void uint3x3_operator_mul_wide_wide() + { + uint3x3 a0 = uint3x3(61417577, 219585476, 1362520891, 1511084277, 1481211272, 58211871, 1459591173, 567624644, 1169935583); + uint3x3 b0 = uint3x3(578042444, 1620527213, 200516468, 309339115, 542853019, 299467282, 1479641221, 1428338601, 1497302909); + uint3x3 r0 = uint3x3(2868103468, 1326150260, 3304073148, 2972110823, 1973926232, 88546350, 3431047833, 3712145508, 556671459); + TestUtils.AreEqual(r0, a0 * b0); + + uint3x3 a1 = uint3x3(1835691886, 385626539, 85934842, 522856538, 278370196, 289217012, 2083410174, 1293162798, 1939730122); + uint3x3 b1 = uint3x3(1596889147, 427413842, 265122693, 689376654, 1120457204, 516903000, 873091659, 1353196495, 1384773500); + uint3x3 r1 = uint3x3(1098186330, 1848083398, 4236646882, 2005201900, 651971856, 2573806560, 4184807018, 4175537714, 3758002136); + TestUtils.AreEqual(r1, a1 * b1); + + uint3x3 a2 = uint3x3(2075923048, 1116477212, 1686101741, 783310758, 248585944, 1093377716, 797038788, 1838048120, 1892922904); + uint3x3 b2 = uint3x3(1596528529, 2122329305, 1033200564, 996795088, 1137754930, 232014195, 1080950243, 1613216909, 463529448); + uint3x3 r2 = uint3x3(2245379304, 3535300284, 1443849636, 550781664, 3335949872, 3941859036, 3201362380, 264300824, 4173364672); + TestUtils.AreEqual(r2, a2 * b2); + + uint3x3 a3 = uint3x3(1952024781, 492107602, 1097670675, 2069629919, 20122103, 606926492, 1153788131, 1687394746, 1499899200); + uint3x3 b3 = uint3x3(1781487382, 2101946430, 673144237, 390627073, 964308272, 1332603859, 106394678, 1330334791, 1720890701); + uint3x3 r3 = uint3x3(1825729694, 4053448156, 3048379351, 2230824159, 4043852112, 1004304020, 3964664802, 638638742, 892728384); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void uint3x3_operator_mul_wide_scalar() + { + uint3x3 a0 = uint3x3(871746615, 492532311, 570557670, 2142306629, 1610315153, 1526163563, 118471734, 257439514, 364291059); + uint b0 = (442064533); + uint3x3 r0 = uint3x3(338365955, 1081376419, 2565819870, 3279557417, 3421481829, 4119466055, 3456786286, 513646114, 1627104879); + TestUtils.AreEqual(r0, a0 * b0); + + uint3x3 a1 = uint3x3(1186560810, 1357601203, 638897141, 268562104, 1007838321, 1163240135, 1619806399, 1444659979, 1127580168); + uint b1 = (1584938026); + uint3x3 r1 = uint3x3(989596900, 898280286, 2953765426, 2323925552, 3179738762, 3514521766, 4086870870, 426546126, 1963013456); + TestUtils.AreEqual(r1, a1 * b1); + + uint3x3 a2 = uint3x3(464517916, 745488654, 636691139, 1851670006, 357357967, 1095280227, 702779195, 945802744, 1464398841); + uint b2 = (1508043166); + uint3x3 r2 = uint3x3(2900457288, 4215006372, 836300634, 498803668, 3736038722, 3098332186, 3974437226, 176674576, 937833646); + TestUtils.AreEqual(r2, a2 * b2); + + uint3x3 a3 = uint3x3(51061000, 407442471, 638315697, 1889264235, 584402164, 1343048690, 2144106255, 1634890111, 425282134); + uint b3 = (802418971); + uint3x3 r3 = uint3x3(2111636440, 550688541, 3522664363, 3821575241, 327416252, 4233876614, 3640831381, 3768026981, 3393703186); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void uint3x3_operator_mul_scalar_wide() + { + uint a0 = (1152242766); + uint3x3 b0 = uint3x3(1276636134, 2105929407, 499007702, 124002565, 1956335172, 1288034953, 832676555, 337389733, 99268757); + uint3x3 r0 = uint3x3(2165463060, 999811634, 1179056436, 3493540742, 404105400, 1339492798, 3913201114, 3183347270, 2131796326); + TestUtils.AreEqual(r0, a0 * b0); + + uint a1 = (2005055247); + uint3x3 b1 = uint3x3(2011389505, 1348110859, 399689191, 2007606374, 2076691289, 1825721194, 769885235, 153314735, 1066325369); + uint3x3 r1 = uint3x3(2729770191, 2761028517, 4045388169, 759270394, 3041102135, 1175400758, 716911613, 3533770305, 2053767447); + TestUtils.AreEqual(r1, a1 * b1); + + uint a2 = (84289667); + uint3x3 b2 = uint3x3(984486192, 1325213504, 1643957457, 1576395620, 2095980601, 907671947, 836919582, 1412159342, 2037926630); + uint3x3 r2 = uint3x3(2430749584, 623711680, 2252568307, 3367173164, 20538667, 1317693985, 3266863706, 514616650, 866534322); + TestUtils.AreEqual(r2, a2 * b2); + + uint a3 = (366590562); + uint3x3 b3 = uint3x3(493177763, 2058824164, 497936968, 2136548816, 1211907591, 2113626509, 345443734, 353147704, 688487056); + uint3x3 r3 = uint3x3(1441161830, 1154593096, 936640400, 2733218208, 2467288238, 547408378, 1943547756, 1645353840, 1287490336); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void uint3x3_operator_div_wide_wide() + { + uint3x3 a0 = uint3x3(333171510, 858154903, 1181365836, 671357749, 1090606752, 803759420, 788404166, 296807814, 575260195); + uint3x3 b0 = uint3x3(698897823, 440199998, 655557473, 1658534285, 2127220100, 315653188, 1814290360, 992173243, 914851653); + uint3x3 r0 = uint3x3(0, 1, 1, 0, 0, 2, 0, 0, 0); + TestUtils.AreEqual(r0, a0 / b0); + + uint3x3 a1 = uint3x3(166625280, 1493729000, 1831739736, 200852358, 129983172, 500176108, 472051781, 414699094, 1446535974); + uint3x3 b1 = uint3x3(664340325, 224323977, 246981573, 285573983, 819471609, 2012476015, 1783179572, 223253978, 169515029); + uint3x3 r1 = uint3x3(0, 6, 7, 0, 0, 0, 0, 1, 8); + TestUtils.AreEqual(r1, a1 / b1); + + uint3x3 a2 = uint3x3(1278480457, 930910505, 263295881, 1626759436, 450830871, 21439121, 521337599, 127756712, 200601965); + uint3x3 b2 = uint3x3(1694929006, 1992168131, 1155972447, 1768506696, 422325410, 1508417406, 605462475, 66917170, 2014683461); + uint3x3 r2 = uint3x3(0, 0, 0, 0, 1, 0, 0, 1, 0); + TestUtils.AreEqual(r2, a2 / b2); + + uint3x3 a3 = uint3x3(412554396, 1014641734, 239347640, 525574301, 1158358177, 1655168319, 2048437741, 367754386, 1861176433); + uint3x3 b3 = uint3x3(108847533, 611173330, 895791853, 1999369787, 1225614384, 1168063495, 565150188, 127292785, 1027814836); + uint3x3 r3 = uint3x3(3, 1, 0, 0, 0, 1, 3, 2, 1); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void uint3x3_operator_div_wide_scalar() + { + uint3x3 a0 = uint3x3(1433072926, 1073958635, 1195142312, 536596719, 1274375693, 464756346, 806462546, 906504670, 1380905136); + uint b0 = (1434025872); + uint3x3 r0 = uint3x3(0, 0, 0, 0, 0, 0, 0, 0, 0); + TestUtils.AreEqual(r0, a0 / b0); + + uint3x3 a1 = uint3x3(25493909, 123300377, 643754735, 2084019932, 2047825037, 458304263, 741331531, 466443901, 2110004616); + uint b1 = (1196815948); + uint3x3 r1 = uint3x3(0, 0, 0, 1, 1, 0, 0, 0, 1); + TestUtils.AreEqual(r1, a1 / b1); + + uint3x3 a2 = uint3x3(1500687214, 1617154145, 2040203220, 2103351724, 485536709, 402141749, 1477264254, 1629069474, 1549487015); + uint b2 = (1453264263); + uint3x3 r2 = uint3x3(1, 1, 1, 1, 0, 0, 1, 1, 1); + TestUtils.AreEqual(r2, a2 / b2); + + uint3x3 a3 = uint3x3(670594363, 155415284, 207130003, 1596922206, 1730223836, 1528374182, 1878500631, 1245757182, 1471308702); + uint b3 = (2040479674); + uint3x3 r3 = uint3x3(0, 0, 0, 0, 0, 0, 0, 0, 0); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void uint3x3_operator_div_scalar_wide() + { + uint a0 = (519165704); + uint3x3 b0 = uint3x3(1295178177, 775214121, 467772046, 1156881598, 310396565, 759759959, 243837702, 1616314235, 1053470225); + uint3x3 r0 = uint3x3(0, 0, 1, 0, 1, 0, 2, 0, 0); + TestUtils.AreEqual(r0, a0 / b0); + + uint a1 = (1320630160); + uint3x3 b1 = uint3x3(378773841, 4223608, 1971105754, 2054406020, 219939614, 1603672651, 2006134295, 888535397, 1493077923); + uint3x3 r1 = uint3x3(3, 312, 0, 0, 6, 0, 0, 1, 0); + TestUtils.AreEqual(r1, a1 / b1); + + uint a2 = (615835131); + uint3x3 b2 = uint3x3(1045603945, 452709946, 1074919059, 467037221, 1485241506, 1775728786, 481521341, 68149923, 80867357); + uint3x3 r2 = uint3x3(0, 1, 0, 1, 0, 0, 1, 9, 7); + TestUtils.AreEqual(r2, a2 / b2); + + uint a3 = (1294049272); + uint3x3 b3 = uint3x3(470535313, 1235850199, 631464286, 687722755, 412827650, 1258012095, 1286792622, 1799223034, 766890491); + uint3x3 r3 = uint3x3(2, 1, 2, 1, 3, 1, 1, 0, 1); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void uint3x3_operator_mod_wide_wide() + { + uint3x3 a0 = uint3x3(258342924, 1454754891, 723352342, 1981431473, 531756042, 716993627, 1667903349, 1331097004, 1776856101); + uint3x3 b0 = uint3x3(1990080167, 1197348066, 651970512, 1659454050, 241005212, 1866255454, 1440101415, 595220963, 408818410); + uint3x3 r0 = uint3x3(258342924, 257406825, 71381830, 321977423, 49745618, 716993627, 227801934, 140655078, 141582461); + TestUtils.AreEqual(r0, a0 % b0); + + uint3x3 a1 = uint3x3(17598216, 1474345080, 1681376293, 813624265, 1617478722, 498370451, 780075943, 1754430321, 653235398); + uint3x3 b1 = uint3x3(198222574, 549504274, 239973807, 321398087, 658171840, 1511495237, 1048325585, 1126739824, 666641241); + uint3x3 r1 = uint3x3(17598216, 375336532, 1559644, 170828091, 301135042, 498370451, 780075943, 627690497, 653235398); + TestUtils.AreEqual(r1, a1 % b1); + + uint3x3 a2 = uint3x3(1517128354, 966216200, 590067427, 1283434795, 1910903650, 1125967790, 1180537254, 308567230, 543945394); + uint3x3 b2 = uint3x3(38017598, 418797691, 618700513, 1941062990, 158556432, 1081063558, 427329468, 148111230, 1251162672); + uint3x3 r2 = uint3x3(34442032, 128620818, 590067427, 1283434795, 8226466, 44904232, 325878318, 12344770, 543945394); + TestUtils.AreEqual(r2, a2 % b2); + + uint3x3 a3 = uint3x3(483834400, 308703874, 383723801, 1181975437, 1161083599, 1608412916, 111825133, 786866017, 1225576256); + uint3x3 b3 = uint3x3(1856322297, 1214781084, 401954255, 1323259633, 1167744452, 1816151689, 541163525, 664455763, 1738838503); + uint3x3 r3 = uint3x3(483834400, 308703874, 383723801, 1181975437, 1161083599, 1608412916, 111825133, 122410254, 1225576256); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void uint3x3_operator_mod_wide_scalar() + { + uint3x3 a0 = uint3x3(560988938, 629524514, 767711194, 434281967, 1399805893, 792916846, 1663690927, 598661916, 1776636144); + uint b0 = (1156862367); + uint3x3 r0 = uint3x3(560988938, 629524514, 767711194, 434281967, 242943526, 792916846, 506828560, 598661916, 619773777); + TestUtils.AreEqual(r0, a0 % b0); + + uint3x3 a1 = uint3x3(1287035793, 475209785, 327476870, 1617696916, 379853074, 477430114, 858399046, 712734431, 1506629323); + uint b1 = (1743722161); + uint3x3 r1 = uint3x3(1287035793, 475209785, 327476870, 1617696916, 379853074, 477430114, 858399046, 712734431, 1506629323); + TestUtils.AreEqual(r1, a1 % b1); + + uint3x3 a2 = uint3x3(199829950, 1986626876, 1351725413, 1549678101, 431765276, 1315833792, 1664893153, 615834034, 780055604); + uint b2 = (362269020); + uint3x3 r2 = uint3x3(199829950, 175281776, 264918353, 100602021, 69496256, 229026732, 215817073, 253565014, 55517564); + TestUtils.AreEqual(r2, a2 % b2); + + uint3x3 a3 = uint3x3(104179235, 1810536428, 1747026206, 1799535061, 875754431, 2049775667, 303673867, 93301056, 1944511005); + uint b3 = (629966219); + uint3x3 r3 = uint3x3(104179235, 550603990, 487093768, 539602623, 245788212, 159877010, 303673867, 93301056, 54612348); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void uint3x3_operator_mod_scalar_wide() + { + uint a0 = (933347930); + uint3x3 b0 = uint3x3(549923387, 243114953, 1884274390, 1428033594, 655531454, 1622674954, 1107563514, 1614111094, 914801920); + uint3x3 r0 = uint3x3(383424543, 204003071, 933347930, 933347930, 277816476, 933347930, 933347930, 933347930, 18546010); + TestUtils.AreEqual(r0, a0 % b0); + + uint a1 = (1432263179); + uint3x3 b1 = uint3x3(564431096, 1967013901, 1709750152, 1080102613, 13120773, 2042535998, 1505698002, 1640058084, 974167554); + uint3x3 r1 = uint3x3(303400987, 1432263179, 1432263179, 352160566, 2098922, 1432263179, 1432263179, 1432263179, 458095625); + TestUtils.AreEqual(r1, a1 % b1); + + uint a2 = (758635306); + uint3x3 b2 = uint3x3(1387264978, 611743343, 1139002766, 1913935748, 1086810076, 991846486, 922870408, 35007468, 891877602); + uint3x3 r2 = uint3x3(758635306, 146891963, 758635306, 758635306, 758635306, 758635306, 758635306, 23478478, 758635306); + TestUtils.AreEqual(r2, a2 % b2); + + uint a3 = (157349181); + uint3x3 b3 = uint3x3(83267982, 801093706, 546272767, 1665089132, 1889242068, 1179889796, 1690033703, 1333252321, 1960636489); + uint3x3 r3 = uint3x3(74081199, 157349181, 157349181, 157349181, 157349181, 157349181, 157349181, 157349181, 157349181); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void uint3x3_operator_plus() + { + uint3x3 a0 = uint3x3(195392567, 222719748, 1002351013, 1570765263, 109389333, 1515950277, 1689763402, 291471785, 264115671); + uint3x3 r0 = uint3x3(195392567, 222719748, 1002351013, 1570765263, 109389333, 1515950277, 1689763402, 291471785, 264115671); + TestUtils.AreEqual(r0, +a0); + + uint3x3 a1 = uint3x3(1084131995, 2131702223, 715660442, 1995564647, 69731564, 1317851903, 1957501908, 531426536, 2012985092); + uint3x3 r1 = uint3x3(1084131995, 2131702223, 715660442, 1995564647, 69731564, 1317851903, 1957501908, 531426536, 2012985092); + TestUtils.AreEqual(r1, +a1); + + uint3x3 a2 = uint3x3(1334133318, 935436165, 1575048895, 2119066258, 781435471, 1659000230, 1301861249, 1153431944, 1360657696); + uint3x3 r2 = uint3x3(1334133318, 935436165, 1575048895, 2119066258, 781435471, 1659000230, 1301861249, 1153431944, 1360657696); + TestUtils.AreEqual(r2, +a2); + + uint3x3 a3 = uint3x3(578750954, 1791553179, 1288641627, 735146513, 328684789, 1370099515, 1575634098, 36481877, 1832055170); + uint3x3 r3 = uint3x3(578750954, 1791553179, 1288641627, 735146513, 328684789, 1370099515, 1575634098, 36481877, 1832055170); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void uint3x3_operator_neg() + { + uint3x3 a0 = uint3x3(1385088677, 94114564, 1350664872, 1458616659, 2067164853, 218122493, 958484951, 270553961, 446497525); + uint3x3 r0 = uint3x3(2909878619, 4200852732, 2944302424, 2836350637, 2227802443, 4076844803, 3336482345, 4024413335, 3848469771); + TestUtils.AreEqual(r0, -a0); + + uint3x3 a1 = uint3x3(270503114, 1427605822, 2051940607, 1434247484, 485368391, 908365416, 1742096480, 990033169, 1368056141); + uint3x3 r1 = uint3x3(4024464182, 2867361474, 2243026689, 2860719812, 3809598905, 3386601880, 2552870816, 3304934127, 2926911155); + TestUtils.AreEqual(r1, -a1); + + uint3x3 a2 = uint3x3(1350976157, 1934372287, 576597401, 785136322, 559205611, 1959833280, 162379661, 1200036971, 95281343); + uint3x3 r2 = uint3x3(2943991139, 2360595009, 3718369895, 3509830974, 3735761685, 2335134016, 4132587635, 3094930325, 4199685953); + TestUtils.AreEqual(r2, -a2); + + uint3x3 a3 = uint3x3(1969004480, 252975075, 1961335692, 1607042487, 832886233, 1300359361, 8438338, 431498011, 1534415387); + uint3x3 r3 = uint3x3(2325962816, 4041992221, 2333631604, 2687924809, 3462081063, 2994607935, 4286528958, 3863469285, 2760551909); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void uint3x3_operator_prefix_inc() + { + uint3x3 a0 = uint3x3(780471723, 954741756, 272723451, 2142862245, 606294309, 1514814550, 250124151, 444189162, 1833356994); + uint3x3 r0 = uint3x3(780471724, 954741757, 272723452, 2142862246, 606294310, 1514814551, 250124152, 444189163, 1833356995); + TestUtils.AreEqual(r0, ++a0); + + uint3x3 a1 = uint3x3(1915989169, 129540735, 1584496757, 1170613526, 986715680, 1701179230, 1397451003, 483952900, 1494652811); + uint3x3 r1 = uint3x3(1915989170, 129540736, 1584496758, 1170613527, 986715681, 1701179231, 1397451004, 483952901, 1494652812); + TestUtils.AreEqual(r1, ++a1); + + uint3x3 a2 = uint3x3(1268688387, 453850931, 1112537171, 621362788, 2063486914, 1612870531, 1161037742, 1083861484, 1583359796); + uint3x3 r2 = uint3x3(1268688388, 453850932, 1112537172, 621362789, 2063486915, 1612870532, 1161037743, 1083861485, 1583359797); + TestUtils.AreEqual(r2, ++a2); + + uint3x3 a3 = uint3x3(82587894, 72436569, 1094485773, 912422931, 1011314676, 261771874, 2042016403, 1102472175, 976635804); + uint3x3 r3 = uint3x3(82587895, 72436570, 1094485774, 912422932, 1011314677, 261771875, 2042016404, 1102472176, 976635805); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void uint3x3_operator_postfix_inc() + { + uint3x3 a0 = uint3x3(241865086, 2145821641, 1596166022, 803592338, 529551271, 1656767229, 903047443, 1213663244, 1425753247); + uint3x3 r0 = uint3x3(241865086, 2145821641, 1596166022, 803592338, 529551271, 1656767229, 903047443, 1213663244, 1425753247); + TestUtils.AreEqual(r0, a0++); + + uint3x3 a1 = uint3x3(1384002775, 1159795446, 1343289659, 1227160199, 947635082, 137930180, 451018043, 1634297552, 2009552507); + uint3x3 r1 = uint3x3(1384002775, 1159795446, 1343289659, 1227160199, 947635082, 137930180, 451018043, 1634297552, 2009552507); + TestUtils.AreEqual(r1, a1++); + + uint3x3 a2 = uint3x3(1176922170, 2381860, 2062858295, 715101397, 1725384327, 446867079, 2101314783, 1460883320, 1683365096); + uint3x3 r2 = uint3x3(1176922170, 2381860, 2062858295, 715101397, 1725384327, 446867079, 2101314783, 1460883320, 1683365096); + TestUtils.AreEqual(r2, a2++); + + uint3x3 a3 = uint3x3(1319511974, 1938539756, 592683318, 1576213022, 1150548583, 904484472, 253685095, 70826818, 1423673637); + uint3x3 r3 = uint3x3(1319511974, 1938539756, 592683318, 1576213022, 1150548583, 904484472, 253685095, 70826818, 1423673637); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void uint3x3_operator_prefix_dec() + { + uint3x3 a0 = uint3x3(1331961415, 1612382200, 1401591249, 2042075388, 1757136546, 1895858159, 1467742422, 578341664, 1336115745); + uint3x3 r0 = uint3x3(1331961414, 1612382199, 1401591248, 2042075387, 1757136545, 1895858158, 1467742421, 578341663, 1336115744); + TestUtils.AreEqual(r0, --a0); + + uint3x3 a1 = uint3x3(2059077641, 1862369220, 312317355, 1027543764, 1595492535, 1426262619, 1426620468, 674685792, 1423852012); + uint3x3 r1 = uint3x3(2059077640, 1862369219, 312317354, 1027543763, 1595492534, 1426262618, 1426620467, 674685791, 1423852011); + TestUtils.AreEqual(r1, --a1); + + uint3x3 a2 = uint3x3(1459529624, 107501474, 1261583506, 512900840, 1496855314, 777588547, 617644613, 1487639376, 625907330); + uint3x3 r2 = uint3x3(1459529623, 107501473, 1261583505, 512900839, 1496855313, 777588546, 617644612, 1487639375, 625907329); + TestUtils.AreEqual(r2, --a2); + + uint3x3 a3 = uint3x3(1452782388, 2076275981, 120447533, 262357170, 1887136873, 412907314, 846648478, 473291493, 286048219); + uint3x3 r3 = uint3x3(1452782387, 2076275980, 120447532, 262357169, 1887136872, 412907313, 846648477, 473291492, 286048218); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void uint3x3_operator_postfix_dec() + { + uint3x3 a0 = uint3x3(1870005937, 1708534798, 704493460, 462940703, 2060593573, 228744869, 940247280, 1818778351, 1015253889); + uint3x3 r0 = uint3x3(1870005937, 1708534798, 704493460, 462940703, 2060593573, 228744869, 940247280, 1818778351, 1015253889); + TestUtils.AreEqual(r0, a0--); + + uint3x3 a1 = uint3x3(862428933, 2080259851, 653673271, 140452688, 1928164223, 1760916301, 1174531383, 634036198, 993137684); + uint3x3 r1 = uint3x3(862428933, 2080259851, 653673271, 140452688, 1928164223, 1760916301, 1174531383, 634036198, 993137684); + TestUtils.AreEqual(r1, a1--); + + uint3x3 a2 = uint3x3(1669210509, 1393579866, 471308632, 620865961, 220103745, 1407678826, 319906934, 1426931482, 488775250); + uint3x3 r2 = uint3x3(1669210509, 1393579866, 471308632, 620865961, 220103745, 1407678826, 319906934, 1426931482, 488775250); + TestUtils.AreEqual(r2, a2--); + + uint3x3 a3 = uint3x3(1681733117, 2060905976, 636358505, 1379709480, 451326084, 497925052, 549367303, 925145385, 55306458); + uint3x3 r3 = uint3x3(1681733117, 2060905976, 636358505, 1379709480, 451326084, 497925052, 549367303, 925145385, 55306458); + TestUtils.AreEqual(r3, a3--); + } + + [TestCompiler] + public static void uint3x3_operator_bitwise_and_wide_wide() + { + uint3x3 a0 = uint3x3(1055241304, 859321394, 1088358961, 2090949513, 300561740, 651904515, 1331035868, 2012752753, 1298126656); + uint3x3 b0 = uint3x3(749698416, 748105424, 1842764797, 9990577, 1989102105, 1666634755, 58116798, 868036607, 1420638875); + uint3x3 r0 = uint3x3(749024336, 537928720, 1087769137, 8409473, 277479432, 575816707, 55888540, 867707761, 1141707264); + TestUtils.AreEqual(r0, a0 & b0); + + uint3x3 a1 = uint3x3(53199569, 1752363533, 1303061302, 1929998247, 1504941434, 470682792, 713577376, 1493231658, 1340884669); + uint3x3 b1 = uint3x3(1308767169, 564040763, 478617502, 806150474, 674015378, 1505309955, 36064977, 1779639327, 808650076); + uint3x3 r1 = uint3x3(33686209, 538087433, 209912598, 805855490, 136347666, 403178496, 33571456, 1207967754, 2098204); + TestUtils.AreEqual(r1, a1 & b1); + + uint3x3 a2 = uint3x3(1577921467, 44846626, 1105094388, 1143008413, 333009589, 2116296009, 2067254825, 121795325, 2122365250); + uint3x3 b2 = uint3x3(1634437037, 1997568501, 1930853951, 1901503461, 1508772523, 2010961769, 1495957269, 1914669725, 1263994006); + uint3x3 r2 = uint3x3(1074332585, 33572896, 1091986996, 1073782917, 298320545, 1979979081, 1495420417, 33686173, 1241513986); + TestUtils.AreEqual(r2, a2 & b2); + + uint3x3 a3 = uint3x3(1088796653, 1594120761, 965590824, 337823363, 1686791432, 1275524729, 173403097, 864715776, 1437598787); + uint3x3 b3 = uint3x3(491200541, 380703892, 282208487, 1416934135, 942735432, 615839538, 1698880188, 1204102677, 1811173266); + uint3x3 r3 = uint3x3(4530189, 369102864, 276834336, 337674883, 536870920, 67434032, 4246168, 58721280, 1102054402); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void uint3x3_operator_bitwise_and_wide_scalar() + { + uint3x3 a0 = uint3x3(1513158868, 284695609, 734595037, 1566510707, 1601252476, 84213838, 314333543, 430856908, 753481263); + uint b0 = (1173647397); + uint3x3 r0 = uint3x3(1076916228, 15732769, 29360133, 1163132961, 1164976164, 84148228, 11816997, 27545604, 81801253); + TestUtils.AreEqual(r0, a0 & b0); + + uint3x3 a1 = uint3x3(327392481, 2143619546, 1873208293, 126982769, 651482651, 1383096952, 1689107088, 1368301071, 366962092); + uint b1 = (1619794917); + uint3x3 r1 = uint3x3(8394977, 1619265984, 1619264485, 8395361, 545526273, 1073742432, 1619794560, 1082923525, 9175460); + TestUtils.AreEqual(r1, a1 & b1); + + uint3x3 a2 = uint3x3(1729929586, 1914435619, 1592791064, 2047510829, 678485991, 586400261, 771972179, 309059606, 131945492); + uint b2 = (989550739); + uint3x3 r2 = uint3x3(571998226, 840652803, 451940368, 973735937, 678451331, 586366977, 704862227, 309018642, 47796240); + TestUtils.AreEqual(r2, a2 & b2); + + uint3x3 a3 = uint3x3(1707451796, 1943201012, 558008097, 1070093422, 34324916, 258102213, 1800249857, 922911179, 1719705954); + uint b3 = (394184188); + uint3x3 r3 = uint3x3(88376724, 324191476, 21136672, 390612076, 34259380, 123879876, 55345152, 386040264, 100696416); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void uint3x3_operator_bitwise_and_scalar_wide() + { + uint a0 = (477163326); + uint3x3 b0 = uint3x3(110453385, 703240362, 2075630560, 1884904031, 1734899436, 947945203, 1664399051, 458879298, 158491426); + uint3x3 r0 = uint3x3(68182536, 140544042, 405834528, 273697310, 73426476, 402681394, 3188234, 407953666, 141583138); + TestUtils.AreEqual(r0, a0 & b0); + + uint a1 = (79772356); + uint3x3 b1 = uint3x3(2054527944, 202228212, 359225061, 639811396, 1821945318, 1821303024, 2030124055, 1985961756, 579780373); + uint3x3 r1 = uint3x3(4266688, 67174596, 71373508, 67123780, 75507908, 75505856, 79876, 71375364, 8403460); + TestUtils.AreEqual(r1, a1 & b1); + + uint a2 = (2061831301); + uint3x3 b2 = uint3x3(1139618293, 1145191868, 1121606282, 1414714065, 688688277, 1508875606, 664318814, 2092766410, 1010043618); + uint3x3 r2 = uint3x3(1122304133, 1077939332, 1119881344, 1346371713, 671353989, 1491405828, 578813956, 2024080512, 941885568); + TestUtils.AreEqual(r2, a2 & b2); + + uint a3 = (599967779); + uint3x3 b3 = uint3x3(47076367, 1325716015, 1119912335, 2083412385, 1805692137, 1689798540, 265665838, 1616867488, 244288538); + uint3x3 r3 = uint3x3(46284803, 50380835, 46170115, 537020449, 595626017, 545275904, 62949410, 541212704, 42108930); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void uint3x3_operator_bitwise_or_wide_wide() + { + uint3x3 a0 = uint3x3(1920951869, 1750772852, 1420019191, 732977093, 1169579447, 229437930, 1966721348, 2039812323, 113550869); + uint3x3 b0 = uint3x3(214585254, 275414367, 858759675, 190211455, 1218691723, 2129565457, 1862809466, 495728846, 868064152); + uint3x3 r0 = uint3x3(2130669503, 2021326207, 2008016383, 737572863, 1303895999, 2146367483, 2134507390, 2107455727, 939376541); + TestUtils.AreEqual(r0, a0 | b0); + + uint3x3 a1 = uint3x3(1912038362, 1569990624, 1490718227, 1686257697, 2137727522, 1569900650, 856504729, 2033376384, 2086259889); + uint3x3 b1 = uint3x3(1756913766, 933656055, 247722084, 1884195075, 1804207631, 1913174711, 1815920856, 1226577606, 1696467642); + uint3x3 r1 = uint3x3(2046780414, 2142664695, 1591475831, 1959708963, 2146117167, 2140863231, 2134768089, 2034163398, 2103430843); + TestUtils.AreEqual(r1, a1 | b1); + + uint3x3 a2 = uint3x3(671790684, 1189001916, 1756048437, 417084592, 2024165808, 966008272, 2031026290, 1461019191, 1071959084); + uint3x3 b2 = uint3x3(186912044, 1778908130, 1461256625, 1142152181, 272117331, 1162254035, 870448102, 1845053992, 257334526); + uint3x3 r2 = uint3x3(724483964, 1860172798, 2142973365, 1558183925, 2025750515, 2111217619, 2079325174, 2147314239, 1073143038); + TestUtils.AreEqual(r2, a2 | b2); + + uint3x3 a3 = uint3x3(1645847295, 871350674, 736640317, 868515800, 767794452, 362186994, 96189073, 1924033224, 1971421809); + uint3x3 b3 = uint3x3(987295814, 1503050768, 1683307763, 1076253109, 1403888383, 561000721, 740143742, 343344681, 2074122472); + uint3x3 r3 = uint3x3(2061103871, 2080374162, 1878867455, 1944485885, 2146418687, 905361907, 767539967, 1996451561, 2141297401); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void uint3x3_operator_bitwise_or_wide_scalar() + { + uint3x3 a0 = uint3x3(1295304853, 1307252624, 350194630, 1128063578, 1774824542, 2085245467, 1988423804, 999162350, 2110327307); + uint b0 = (1305527136); + uint3x3 r0 = uint3x3(1307888629, 1308350448, 1574947814, 1341973370, 1842999166, 2111492987, 2144662396, 2145305582, 2111425387); + TestUtils.AreEqual(r0, a0 | b0); + + uint3x3 a1 = uint3x3(1050875188, 1317039676, 228656898, 41280811, 1536908787, 606786773, 1739461580, 2040936581, 1350320187); + uint b1 = (341855232); + uint3x3 r1 = uint3x3(1055087924, 1591766588, 501305090, 376827179, 1610309107, 879418581, 2012110796, 2112257157, 1417432123); + TestUtils.AreEqual(r1, a1 | b1); + + uint3x3 a2 = uint3x3(1377874553, 1496806239, 1732466858, 1535976093, 375675620, 1614193383, 226059393, 697385997, 112556963); + uint b2 = (1522262112); + uint3x3 r2 = uint3x3(1522266745, 1539306367, 2147219690, 1539302141, 1593834212, 2059395815, 1610343649, 2075911277, 1589640163); + TestUtils.AreEqual(r2, a2 | b2); + + uint3x3 a3 = uint3x3(1614163749, 1370656810, 1286074530, 1155438844, 1835671387, 440002979, 1569359727, 5393691, 774282482); + uint b3 = (1583289054); + uint3x3 r3 = uint3x3(2122268671, 1610584830, 1593832190, 1591712510, 2139037663, 1585445887, 1608488959, 1583308767, 2122292990); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void uint3x3_operator_bitwise_or_scalar_wide() + { + uint a0 = (1768627592); + uint3x3 b0 = uint3x3(1849658052, 1759912154, 729979455, 975926310, 1987690876, 1809506714, 1160695341, 408963395, 314072711); + uint3x3 r0 = uint3x3(1870634956, 1777286618, 1810603967, 2070642094, 2138824188, 1811676570, 1836048301, 2037079499, 2080071567); + TestUtils.AreEqual(r0, a0 | b0); + + uint a1 = (1560007537); + uint3x3 b1 = uint3x3(1709003416, 977086639, 1448375596, 1689568808, 595543345, 559778387, 621080913, 438994183, 1742637145); + uint3x3 r1 = uint3x3(2113917945, 2130705407, 1593833341, 2097141625, 2147473265, 2113919859, 2113926001, 1593562999, 2147474297); + TestUtils.AreEqual(r1, a1 | b1); + + uint a2 = (1219409263); + uint3x3 b2 = uint3x3(1602932494, 1204461702, 2111538444, 836730895, 1207638621, 802100209, 1089077339, 1315030334, 249047666); + uint3x3 r2 = uint3x3(1605304175, 1341044207, 2113910127, 2046801263, 1342160767, 1877981183, 1223603583, 1324348799, 1325318015); + TestUtils.AreEqual(r2, a2 | b2); + + uint a3 = (1604790897); + uint3x3 b3 = uint3x3(1848168086, 347254235, 1777613639, 1876731927, 842785732, 1023558747, 1567635900, 1888818835, 1681286114); + uint3x3 r3 = uint3x3(2142236407, 1605873659, 2146909047, 2147461751, 2143284213, 2141679227, 1610038269, 2142715635, 2142727155); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void uint3x3_operator_bitwise_xor_wide_wide() + { + uint3x3 a0 = uint3x3(1843655608, 362425681, 640805534, 1342040268, 945678755, 980321850, 390165019, 1682422658, 303897251); + uint3x3 b0 = uint3x3(1422803441, 1234691140, 119589253, 1101464929, 121896337, 1880109018, 1000210266, 1718938232, 464406940); + uint3x3 r0 = uint3x3(959296073, 1544407317, 554771227, 240840109, 1058935858, 1249815008, 752651585, 36917754, 162747199); + TestUtils.AreEqual(r0, a0 ^ b0); + + uint3x3 a1 = uint3x3(230477768, 1103646442, 1503102919, 26631152, 1016475570, 1862440929, 379588576, 1943580404, 691527166); + uint3x3 b1 = uint3x3(884337881, 34199854, 1430659227, 126415540, 1069919967, 1810763253, 2082802224, 941097951, 27782297); + uint3x3 r1 = uint3x3(956900113, 1136760772, 215066460, 102672708, 55804269, 82614804, 1787102672, 1270918443, 680538471); + TestUtils.AreEqual(r1, a1 ^ b1); + + uint3x3 a2 = uint3x3(723280696, 497086939, 1640104913, 893178410, 1596765788, 664096470, 2043360590, 799560121, 287637604); + uint3x3 b2 = uint3x3(156353074, 607061607, 470737131, 1151564598, 8268481, 434405645, 519003095, 1880915120, 608970922); + uint3x3 r2 = uint3x3(575512842, 965736380, 2110579514, 1906288924, 1599249565, 1047646171, 1730440857, 1605643529, 896084174); + TestUtils.AreEqual(r2, a2 ^ b2); + + uint3x3 a3 = uint3x3(696169196, 2067184169, 1208059988, 1250597330, 1386507647, 1889791408, 2084012261, 308683100, 995657536); + uint3x3 b3 = uint3x3(1809455754, 1079250101, 514389994, 272120301, 1282399149, 1045003273, 1596550715, 1654640361, 147544177); + uint3x3 r3 = uint3x3(1118087270, 996325020, 1453948862, 1521655871, 516667090, 1323995577, 589229790, 1895428021, 865328945); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void uint3x3_operator_bitwise_xor_wide_scalar() + { + uint3x3 a0 = uint3x3(169345668, 176087064, 2084362901, 1663924004, 193851255, 517476661, 905336222, 863800783, 365003873); + uint b0 = (354464228); + uint3x3 r0 = uint3x3(523809632, 526275068, 1763470193, 1980614336, 514678419, 200843473, 550954106, 643578923, 14759301); + TestUtils.AreEqual(r0, a0 ^ b0); + + uint3x3 a1 = uint3x3(835837496, 1464576786, 625604047, 1700827127, 2003392824, 1481813598, 1077374714, 1043379893, 1991576049); + uint b1 = (954341348); + uint3x3 r1 = uint3x3(154388956, 1873394934, 497803819, 1568839699, 1334529756, 1622194618, 2027256094, 114467153, 1314332181); + TestUtils.AreEqual(r1, a1 ^ b1); + + uint3x3 a2 = uint3x3(781860967, 1196907956, 858716109, 858484213, 178843494, 1223183458, 866652388, 1771693181, 1206307664); + uint b2 = (60088394); + uint3x3 r2 = uint3x3(755933229, 1153678846, 817502087, 817860031, 154930988, 1266461736, 809300142, 1779237943, 1148332826); + TestUtils.AreEqual(r2, a2 ^ b2); + + uint3x3 a3 = uint3x3(2037729583, 497725784, 1367278685, 962962860, 906632547, 1570278596, 1744797352, 574677361, 1363709514); + uint b3 = (1324393116); + uint3x3 r3 = uint3x3(931523507, 1398412228, 529508033, 2006255408, 2029699071, 325594712, 688905268, 1823491053, 532163798); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void uint3x3_operator_bitwise_xor_scalar_wide() + { + uint a0 = (1361775641); + uint3x3 b0 = uint3x3(1452773578, 459050892, 1986218254, 1689037698, 999278344, 1229114508, 1087843538, 733699740, 106187872); + uint3x3 r0 = uint3x3(129801427, 1249346453, 659047703, 898082715, 1789184785, 409583765, 301736139, 2056278661, 1467957369); + TestUtils.AreEqual(r0, a0 ^ b0); + + uint a1 = (1533632738); + uint3x3 b1 = uint3x3(1107817672, 492506236, 597602329, 1439603382, 1001169118, 1231718216, 1693179077, 1050897427, 1796435561); + uint3x3 r1 = uint3x3(426677290, 1177709726, 2029506811, 245889620, 1623572540, 302245802, 1065532455, 1707740401, 813305483); + TestUtils.AreEqual(r1, a1 ^ b1); + + uint a2 = (1100532547); + uint3x3 b2 = uint3x3(2106589181, 79691722, 851486414, 381749210, 1743618507, 2038827673, 1680906962, 161437943, 171927307); + uint3x3 r2 = uint3x3(1008153790, 1160197257, 1935175053, 1465502873, 645221000, 941539802, 631787921, 1208456116, 1269279816); + TestUtils.AreEqual(r2, a2 ^ b2); + + uint a3 = (277703584); + uint3x3 b3 = uint3x3(1344718195, 1634011177, 28540247, 1205447252, 150341716, 899457210, 1927941858, 1213321665, 1943899052); + uint3x3 r3 = uint3x3(1084993235, 1911055241, 289281783, 1465172468, 410739700, 621923098, 1650943298, 1490860641, 1666244620); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void uint3x3_operator_left_shift() + { + uint3x3 a0 = uint3x3(1129100049, 829482269, 1571297368, 443753193, 1872142968, 249554593, 892627436, 980302862, 62369727); + int b0 = (218351941); + uint3x3 r0 = uint3x3(1771463200, 773628832, 3036875520, 1315200288, 4074000128, 3690779680, 2794274176, 1304920512, 1995831264); + TestUtils.AreEqual(r0, a0 << b0); + + uint3x3 a1 = uint3x3(849916599, 108441902, 1959056531, 1779118882, 1451674188, 2082026915, 1149883636, 1380536034, 186532735); + int b1 = (1271350845); + uint3x3 r1 = uint3x3(3758096384, 3221225472, 1610612736, 1073741824, 2147483648, 1610612736, 2147483648, 1073741824, 3758096384); + TestUtils.AreEqual(r1, a1 << b1); + + uint3x3 a2 = uint3x3(1487486874, 752067504, 1647167336, 772453640, 456967739, 947384545, 1463252873, 1315516161, 640579158); + int b2 = (1498738574); + uint3x3 r2 = uint3x3(1340506112, 3907780608, 1910112256, 2906783744, 831438848, 4231544832, 3722592256, 1270890496, 2643820544); + TestUtils.AreEqual(r2, a2 << b2); + + uint3x3 a3 = uint3x3(56630178, 2142944517, 565484033, 965161323, 1634169280, 1821547426, 1959741996, 1189216014, 2088913234); + int b3 = (1650899378); + uint3x3 r3 = uint3x3(1854406656, 4094951424, 1745092608, 3316383744, 3338665984, 1854406656, 682622976, 4231528448, 625475584); + TestUtils.AreEqual(r3, a3 << b3); + } + + [TestCompiler] + public static void uint3x3_operator_right_shift() + { + uint3x3 a0 = uint3x3(809126085, 908563670, 763568837, 1986717290, 1174507510, 646821842, 1242726074, 390811632, 1521420393); + int b0 = (994800051); + uint3x3 r0 = uint3x3(1543, 1732, 1456, 3789, 2240, 1233, 2370, 745, 2901); + TestUtils.AreEqual(r0, a0 >> b0); + + uint3x3 a1 = uint3x3(1923166649, 400863878, 667378673, 1611921244, 307750782, 479442287, 2014389412, 1673938174, 1075916177); + int b1 = (102096936); + uint3x3 r1 = uint3x3(7512369, 1565874, 2606947, 6296567, 1202151, 1872821, 7868708, 6538820, 4202797); + TestUtils.AreEqual(r1, a1 >> b1); + + uint3x3 a2 = uint3x3(1248577253, 813936577, 848976170, 500930883, 662405800, 126875849, 1103917083, 1199000503, 955487090); + int b2 = (848199210); + uint3x3 r2 = uint3x3(1219313, 794859, 829078, 489190, 646880, 123902, 1078044, 1170898, 933092); + TestUtils.AreEqual(r2, a2 >> b2); + + uint3x3 a3 = uint3x3(1013356510, 185228398, 87452680, 2021602226, 1401766495, 275199908, 664576720, 363706280, 1600231415); + int b3 = (391605984); + uint3x3 r3 = uint3x3(1013356510, 185228398, 87452680, 2021602226, 1401766495, 275199908, 664576720, 363706280, 1600231415); + TestUtils.AreEqual(r3, a3 >> b3); + } + + [TestCompiler] + public static void uint3x3_operator_bitwise_not() + { + uint3x3 a0 = uint3x3(111796841, 603562399, 745091931, 853183268, 1110916612, 381888399, 1891338755, 1506860135, 771210628); + uint3x3 r0 = uint3x3(4183170454, 3691404896, 3549875364, 3441784027, 3184050683, 3913078896, 2403628540, 2788107160, 3523756667); + TestUtils.AreEqual(r0, ~a0); + + uint3x3 a1 = uint3x3(787710759, 96456785, 916013379, 203444882, 1172294211, 1020232736, 683852713, 375158799, 881353367); + uint3x3 r1 = uint3x3(3507256536, 4198510510, 3378953916, 4091522413, 3122673084, 3274734559, 3611114582, 3919808496, 3413613928); + TestUtils.AreEqual(r1, ~a1); + + uint3x3 a2 = uint3x3(1218471344, 592898220, 443427914, 1385118179, 215320517, 860122767, 1411266016, 1349739899, 686325107); + uint3x3 r2 = uint3x3(3076495951, 3702069075, 3851539381, 2909849116, 4079646778, 3434844528, 2883701279, 2945227396, 3608642188); + TestUtils.AreEqual(r2, ~a2); + + uint3x3 a3 = uint3x3(829984855, 319233142, 156019905, 1467719681, 1193642973, 957020051, 610113447, 1906177458, 1022824453); + uint3x3 r3 = uint3x3(3464982440, 3975734153, 4138947390, 2827247614, 3101324322, 3337947244, 3684853848, 2388789837, 3272142842); + TestUtils.AreEqual(r3, ~a3); + } + + [TestCase /* For player builds */] + public static void uint3x3_EqualsObjectOverride() + { + TestUtils.IsFalse(new uint3x3().Equals((object)new int())); + TestUtils.IsTrue(new uint3x3().Equals((object)new uint3x3())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestUint3x3.gen.cs.meta b/src/Tests/Tests/Shared/TestUint3x3.gen.cs.meta new file mode 100644 index 00000000..2d909545 --- /dev/null +++ b/src/Tests/Tests/Shared/TestUint3x3.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f3db3407f5e21b84d8c21645d5517e9b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestUint3x4.gen.cs b/src/Tests/Tests/Shared/TestUint3x4.gen.cs new file mode 100644 index 00000000..4768c755 --- /dev/null +++ b/src/Tests/Tests/Shared/TestUint3x4.gen.cs @@ -0,0 +1,1240 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestUint3x4 + { + [TestCompiler] + public static void uint3x4_zero() + { + TestUtils.AreEqual(0u, uint3x4.zero.c0.x); + TestUtils.AreEqual(0u, uint3x4.zero.c0.y); + TestUtils.AreEqual(0u, uint3x4.zero.c0.z); + TestUtils.AreEqual(0u, uint3x4.zero.c1.x); + TestUtils.AreEqual(0u, uint3x4.zero.c1.y); + TestUtils.AreEqual(0u, uint3x4.zero.c1.z); + TestUtils.AreEqual(0u, uint3x4.zero.c2.x); + TestUtils.AreEqual(0u, uint3x4.zero.c2.y); + TestUtils.AreEqual(0u, uint3x4.zero.c2.z); + TestUtils.AreEqual(0u, uint3x4.zero.c3.x); + TestUtils.AreEqual(0u, uint3x4.zero.c3.y); + TestUtils.AreEqual(0u, uint3x4.zero.c3.z); + } + + [TestCompiler] + public static void uint3x4_operator_equal_wide_wide() + { + uint3x4 a0 = uint3x4(2105871082, 35218899, 1550755093, 764676020, 606743782, 1208156098, 1023640014, 1038468316, 1416064367, 727143393, 2061243891, 184669837); + uint3x4 b0 = uint3x4(1477587886, 579629692, 540974792, 208405066, 2063397938, 1060167409, 362592601, 2097545362, 277670088, 426944490, 901076223, 857900673); + bool3x4 r0 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + uint3x4 a1 = uint3x4(1303661760, 2044073738, 370395888, 1822916805, 1076983135, 345215866, 833676277, 1987782708, 1481088614, 1364754268, 93639636, 1850596922); + uint3x4 b1 = uint3x4(1548779757, 325265488, 312658571, 176373760, 2052378097, 858156597, 982817797, 1252095508, 882634538, 1959142806, 72495800, 1077678183); + bool3x4 r1 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + uint3x4 a2 = uint3x4(2073471507, 1745989448, 28118669, 1267554232, 1292918049, 1423451579, 644384701, 1985492825, 240481133, 2130667921, 17376735, 1263869085); + uint3x4 b2 = uint3x4(1729269763, 1607675346, 1813461519, 1204794859, 1324801873, 1975336, 439410532, 294085211, 1031782338, 1118745564, 180311719, 433246570); + bool3x4 r2 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + uint3x4 a3 = uint3x4(437371027, 1093339523, 1683805602, 764261037, 1845666482, 399277628, 714152770, 148255091, 784823865, 1712722195, 1706849865, 607710807); + uint3x4 b3 = uint3x4(1622531532, 1178609353, 373010678, 1231165960, 966395555, 788609772, 215241459, 1411005263, 1287904654, 1656358051, 1985807372, 1041678082); + bool3x4 r3 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void uint3x4_operator_equal_wide_scalar() + { + uint3x4 a0 = uint3x4(437822262, 2020661134, 541786900, 853113810, 23716499, 179951405, 1409026299, 948838849, 953202998, 691955848, 1926262965, 1851546137); + uint b0 = (1332833578); + bool3x4 r0 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + uint3x4 a1 = uint3x4(712957637, 1049962241, 1836975611, 1016802970, 390120467, 464814777, 1451642042, 289137869, 152339338, 808355440, 660053867, 597354173); + uint b1 = (2028784869); + bool3x4 r1 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + uint3x4 a2 = uint3x4(67320270, 35153827, 602895443, 186996278, 129611815, 1031574999, 1697392883, 1463742000, 857785521, 611116281, 594150729, 375387566); + uint b2 = (151461188); + bool3x4 r2 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + uint3x4 a3 = uint3x4(1984352551, 570698441, 1872629381, 1263218472, 315982238, 122473806, 1404530826, 43943273, 1695786992, 2085125114, 432271298, 465353570); + uint b3 = (1925707182); + bool3x4 r3 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void uint3x4_operator_equal_scalar_wide() + { + uint a0 = (542329200); + uint3x4 b0 = uint3x4(1115584594, 684107773, 1928988941, 890709324, 641152437, 1410341302, 497505660, 1068223109, 2014009435, 213835595, 1592428361, 1819361470); + bool3x4 r0 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + uint a1 = (448650623); + uint3x4 b1 = uint3x4(1942175642, 64377057, 1485938610, 1146305380, 1312317120, 263290348, 812663708, 1585209188, 40646617, 1378718922, 1957797737, 873652576); + bool3x4 r1 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + uint a2 = (1780082094); + uint3x4 b2 = uint3x4(1513270921, 2095980581, 1413074719, 1387984261, 1547119354, 924385171, 1253636050, 1477542688, 969120167, 591812191, 856880926, 1114040166); + bool3x4 r2 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + uint a3 = (2107388425); + uint3x4 b3 = uint3x4(1368188588, 512677295, 1337925727, 2076181515, 1317314747, 299981273, 601822512, 1079453890, 125277108, 1257151509, 1915342590, 1034639325); + bool3x4 r3 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void uint3x4_operator_not_equal_wide_wide() + { + uint3x4 a0 = uint3x4(1977284100, 1293292704, 1547283851, 422428953, 195833190, 1711544892, 5606053, 737069074, 647386678, 13079405, 1413841590, 1076166545); + uint3x4 b0 = uint3x4(1514195556, 957972049, 507667364, 581861672, 1128094576, 940096636, 57559040, 181752616, 962017320, 1762015406, 1107218953, 2042026522); + bool3x4 r0 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + uint3x4 a1 = uint3x4(1211445174, 1289303469, 1436402489, 1129570126, 1566836685, 1343313905, 329259205, 1774944480, 33906739, 2055853627, 2035015372, 1702756001); + uint3x4 b1 = uint3x4(836002288, 570272309, 2112081980, 1500634658, 1787808345, 566425667, 2037529609, 1520589840, 266793699, 538816359, 2075474643, 553571317); + bool3x4 r1 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + uint3x4 a2 = uint3x4(1164186087, 329853698, 769052491, 1893312730, 438029011, 1894010522, 1365847542, 1292942830, 2146008097, 1520743598, 861728782, 1999977058); + uint3x4 b2 = uint3x4(218264354, 654754196, 1392180230, 870065147, 1398749829, 711281563, 1999640291, 231234857, 210910234, 365281355, 170643407, 757340716); + bool3x4 r2 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + uint3x4 a3 = uint3x4(1334556487, 1728108667, 1198848973, 7011150, 1280729934, 1553569869, 1782228282, 731582167, 2041979262, 128396656, 143519087, 154742298); + uint3x4 b3 = uint3x4(639973212, 1147047891, 537350186, 1283454178, 735732152, 1218138135, 474815930, 174656455, 473248758, 1077993023, 1063662917, 181750095); + bool3x4 r3 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void uint3x4_operator_not_equal_wide_scalar() + { + uint3x4 a0 = uint3x4(1038269360, 1427812625, 103361237, 1347017023, 1523584313, 150442802, 660334527, 719113717, 262959423, 484398043, 506946952, 226568494); + uint b0 = (768873026); + bool3x4 r0 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + uint3x4 a1 = uint3x4(507918242, 923269270, 166187260, 114581840, 1045389187, 1648095254, 1461803977, 61801615, 1317840133, 2146927809, 1557151164, 1284033253); + uint b1 = (1702162286); + bool3x4 r1 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + uint3x4 a2 = uint3x4(1345705546, 611028295, 1368046109, 1848036266, 2025452920, 373992983, 289537519, 1388743060, 146455100, 1854553487, 872755032, 2113020512); + uint b2 = (1747302566); + bool3x4 r2 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + uint3x4 a3 = uint3x4(1062447442, 109864030, 1583997921, 1732461790, 1276630817, 721080697, 922945173, 1528002730, 282331576, 1372281893, 167200566, 1271483982); + uint b3 = (632285066); + bool3x4 r3 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void uint3x4_operator_not_equal_scalar_wide() + { + uint a0 = (1652127596); + uint3x4 b0 = uint3x4(953791238, 271722683, 1278885987, 735128017, 112416504, 25967222, 1761444475, 1844594536, 1199122922, 634219279, 942501101, 67161343); + bool3x4 r0 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + uint a1 = (969944293); + uint3x4 b1 = uint3x4(833229499, 1304301133, 704045745, 345012334, 1253134152, 325772538, 855127202, 793668881, 1584481616, 1101301152, 276853534, 987168816); + bool3x4 r1 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + uint a2 = (1258105989); + uint3x4 b2 = uint3x4(362645228, 293978043, 1772395973, 1692007315, 681268929, 1535518457, 595209334, 25745185, 1278016813, 2125682481, 2037751005, 1405297618); + bool3x4 r2 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + uint a3 = (1825546885); + uint3x4 b3 = uint3x4(1584424742, 1779859088, 1262387250, 936213998, 739749071, 1934808433, 1333711144, 571211509, 445791940, 43428024, 1509344718, 1643255886); + bool3x4 r3 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void uint3x4_operator_less_wide_wide() + { + uint3x4 a0 = uint3x4(1486550609, 1779244308, 1602148045, 1614085440, 1975613414, 942838342, 1092279031, 373677431, 1419098312, 337757077, 1081797900, 1336745069); + uint3x4 b0 = uint3x4(97842578, 536551311, 413528975, 1838293684, 1283898480, 1456599961, 1080278602, 529676676, 156584048, 117348799, 246927124, 1916615924); + bool3x4 r0 = bool3x4(false, false, false, true, false, true, false, true, false, false, false, true); + TestUtils.AreEqual(r0, a0 < b0); + + uint3x4 a1 = uint3x4(840685445, 1220554047, 2013681746, 192965012, 532043965, 1000693402, 927236048, 1215860000, 780607596, 1882056852, 1354146545, 2135295778); + uint3x4 b1 = uint3x4(1731071394, 1328098431, 1014995792, 480319327, 1765937053, 1333997067, 688515308, 1856106947, 1303906227, 646821776, 1169473993, 316770064); + bool3x4 r1 = bool3x4(true, true, false, true, true, true, false, true, true, false, false, false); + TestUtils.AreEqual(r1, a1 < b1); + + uint3x4 a2 = uint3x4(1145973790, 1938006975, 895882838, 2006524299, 908581156, 1843349513, 1340458575, 1972095585, 1090933468, 924555996, 79585200, 1749924275); + uint3x4 b2 = uint3x4(1518155802, 416732703, 529193056, 1239623485, 2010112031, 2018560298, 285987009, 960617622, 462519015, 1473825625, 1187164011, 730583004); + bool3x4 r2 = bool3x4(true, false, false, false, true, true, false, false, false, true, true, false); + TestUtils.AreEqual(r2, a2 < b2); + + uint3x4 a3 = uint3x4(1088207695, 1484224850, 512353919, 562469379, 1743259263, 182124641, 1224472464, 1731920136, 1906896401, 425415911, 992649442, 515648372); + uint3x4 b3 = uint3x4(629133777, 1925375320, 689923293, 1818695099, 903783983, 495525944, 1923715956, 2850909, 1908553564, 1064607664, 1344783349, 494620587); + bool3x4 r3 = bool3x4(false, true, true, true, false, true, true, false, true, true, true, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void uint3x4_operator_less_wide_scalar() + { + uint3x4 a0 = uint3x4(796797557, 670113454, 933579492, 278884514, 318174822, 1117630673, 741886928, 1990922600, 1030849597, 1546212312, 1718582899, 1648393417); + uint b0 = (746564682); + bool3x4 r0 = bool3x4(false, true, false, true, true, false, true, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 < b0); + + uint3x4 a1 = uint3x4(1857132231, 1294006045, 952084157, 1303736668, 845460171, 979430272, 1368236640, 24980695, 1434668705, 659552739, 1058492383, 165694933); + uint b1 = (1909506562); + bool3x4 r1 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 < b1); + + uint3x4 a2 = uint3x4(1204097259, 281328069, 24629507, 1386458568, 1325149699, 1498707004, 1650355158, 1213017950, 1650457461, 759932777, 1542997846, 1227393490); + uint b2 = (922212691); + bool3x4 r2 = bool3x4(false, true, true, false, false, false, false, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + uint3x4 a3 = uint3x4(1520634374, 1951142425, 1956860037, 681224518, 1889763470, 1915403219, 850845857, 1871934613, 1882514458, 1326783898, 1044736383, 24899250); + uint b3 = (1750827258); + bool3x4 r3 = bool3x4(true, false, false, true, false, false, true, false, false, true, true, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void uint3x4_operator_less_scalar_wide() + { + uint a0 = (186400299); + uint3x4 b0 = uint3x4(1881344229, 813834467, 1254886626, 1353590345, 1412343685, 1555571443, 1540508298, 1735458634, 135888070, 1643818742, 248291654, 1739560105); + bool3x4 r0 = bool3x4(true, true, true, true, true, true, true, true, false, true, true, true); + TestUtils.AreEqual(r0, a0 < b0); + + uint a1 = (728539891); + uint3x4 b1 = uint3x4(480507742, 1696553040, 540223931, 1840493353, 146833656, 798115946, 2002002066, 1011261705, 783550942, 1093071215, 598253401, 1432416562); + bool3x4 r1 = bool3x4(false, true, false, true, false, true, true, true, true, true, false, true); + TestUtils.AreEqual(r1, a1 < b1); + + uint a2 = (1863582169); + uint3x4 b2 = uint3x4(103622950, 775175960, 116908309, 1213433625, 1428954824, 1760442490, 1208143947, 751820805, 1491872302, 560004484, 2065157473, 310839658); + bool3x4 r2 = bool3x4(false, false, false, false, false, false, false, false, false, false, true, false); + TestUtils.AreEqual(r2, a2 < b2); + + uint a3 = (697329242); + uint3x4 b3 = uint3x4(898786601, 1448893980, 1204091943, 1933043135, 828031833, 1737703663, 1672512847, 1112905025, 1666248737, 1352503217, 406395888, 1734008932); + bool3x4 r3 = bool3x4(true, true, true, true, true, true, true, true, true, true, false, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void uint3x4_operator_greater_wide_wide() + { + uint3x4 a0 = uint3x4(2087717754, 1725569452, 1298066182, 1693943616, 1319019629, 70674491, 1042499725, 1002821508, 1021857133, 1744374599, 821751047, 467646903); + uint3x4 b0 = uint3x4(85148514, 293632137, 1151128249, 409440398, 1115020183, 1508500597, 1834583302, 1755218534, 1788761753, 1128238489, 834223713, 1578743290); + bool3x4 r0 = bool3x4(true, true, true, true, true, false, false, false, false, true, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + uint3x4 a1 = uint3x4(2029731638, 1377214212, 1207816926, 474621063, 20781266, 366593779, 2068457387, 10181449, 793634464, 144474612, 99947390, 930377263); + uint3x4 b1 = uint3x4(1647150256, 1756397855, 1131080201, 1208965204, 1495161099, 1283714281, 908051907, 412849651, 815822687, 730271942, 40756039, 883326140); + bool3x4 r1 = bool3x4(true, false, true, false, false, false, true, false, false, false, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + uint3x4 a2 = uint3x4(683686232, 742803073, 918292048, 875621429, 1764985258, 411384146, 1921397684, 1349107119, 640399120, 1487719331, 1467989523, 1834244794); + uint3x4 b2 = uint3x4(476260632, 1024136446, 1440596667, 1253494041, 146826162, 1798399573, 2085029408, 187939428, 1009192934, 1694822273, 1866590874, 113805226); + bool3x4 r2 = bool3x4(true, false, false, false, true, false, false, true, false, false, false, true); + TestUtils.AreEqual(r2, a2 > b2); + + uint3x4 a3 = uint3x4(1778580304, 334604025, 689749101, 1478795900, 716772993, 1072711623, 388277128, 290673156, 619539670, 1666212670, 496667761, 638935614); + uint3x4 b3 = uint3x4(1331524948, 5928360, 1884858608, 1988975599, 493888072, 731556294, 1597968264, 727668246, 1260583385, 1921631225, 359265523, 856088703); + bool3x4 r3 = bool3x4(true, true, false, false, true, true, false, false, false, false, true, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void uint3x4_operator_greater_wide_scalar() + { + uint3x4 a0 = uint3x4(1208626274, 239697208, 1979453345, 1253474001, 1590192876, 1487911635, 1673945595, 1662650098, 222749855, 1433540517, 566635217, 1773305960); + uint b0 = (1715176566); + bool3x4 r0 = bool3x4(false, false, true, false, false, false, false, false, false, false, false, true); + TestUtils.AreEqual(r0, a0 > b0); + + uint3x4 a1 = uint3x4(1850273578, 325913453, 333381537, 1905567362, 2053577491, 570397194, 2128431130, 1735325311, 529971908, 1663525234, 1972984241, 1587865063); + uint b1 = (206147145); + bool3x4 r1 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + uint3x4 a2 = uint3x4(488268523, 812076921, 181082921, 1281638484, 1818357732, 116518997, 1397728785, 1924199337, 742950077, 1463993051, 1598027926, 842851852); + uint b2 = (121921923); + bool3x4 r2 = bool3x4(true, true, true, true, true, false, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 > b2); + + uint3x4 a3 = uint3x4(160842093, 540338405, 174088887, 1609299242, 425486336, 1462766889, 651513452, 1122649822, 771802057, 839323192, 325778683, 406189885); + uint b3 = (1226313895); + bool3x4 r3 = bool3x4(false, false, false, true, false, true, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void uint3x4_operator_greater_scalar_wide() + { + uint a0 = (480938827); + uint3x4 b0 = uint3x4(1824731899, 921496110, 586859044, 946430596, 1231356727, 1390167458, 1785807092, 28949024, 2037899283, 595656760, 1778095771, 1233500439); + bool3x4 r0 = bool3x4(false, false, false, false, false, false, false, true, false, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + uint a1 = (1696302238); + uint3x4 b1 = uint3x4(1445965340, 484020151, 1586962841, 1361740714, 265628948, 2003122957, 332267433, 1128353075, 377919478, 982113135, 1117675960, 630865591); + bool3x4 r1 = bool3x4(true, true, true, true, true, false, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + uint a2 = (1550679736); + uint3x4 b2 = uint3x4(895945757, 287025687, 643452096, 660504007, 613135893, 633307118, 514276792, 1377364317, 84491736, 746768197, 1282879723, 589415384); + bool3x4 r2 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 > b2); + + uint a3 = (363082240); + uint3x4 b3 = uint3x4(1774333756, 741005890, 413100725, 702141547, 1434366582, 1489794027, 1710601432, 1914069735, 1811684885, 1007116016, 1883396218, 318035497); + bool3x4 r3 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void uint3x4_operator_less_equal_wide_wide() + { + uint3x4 a0 = uint3x4(154092149, 1515170149, 1083970332, 785807178, 1401094881, 310537627, 868328962, 1990816725, 2035349541, 457043352, 1123282035, 1001842946); + uint3x4 b0 = uint3x4(77984380, 1712054191, 1566203809, 254834519, 450519938, 389457083, 1298669505, 207343167, 1214449047, 2059561026, 896534357, 1897470050); + bool3x4 r0 = bool3x4(false, true, true, false, false, true, true, false, false, true, false, true); + TestUtils.AreEqual(r0, a0 <= b0); + + uint3x4 a1 = uint3x4(1387761992, 195272789, 659549000, 888761458, 283706617, 1790185840, 899029812, 848317418, 1743712447, 1504407474, 1798441490, 1902791952); + uint3x4 b1 = uint3x4(521075677, 1848221945, 374708019, 1573731118, 2093466449, 1660210829, 1568778785, 1352157589, 1212771905, 1457525058, 1493446008, 1784768208); + bool3x4 r1 = bool3x4(false, true, false, true, true, false, true, true, false, false, false, false); + TestUtils.AreEqual(r1, a1 <= b1); + + uint3x4 a2 = uint3x4(606340844, 1994437705, 301831413, 654230470, 1223625081, 324292199, 1370931020, 1742769166, 1709242127, 105750466, 1655967312, 1455797002); + uint3x4 b2 = uint3x4(1993422493, 1378671664, 1447376929, 1405041439, 1765183746, 562894655, 1085068880, 1026386862, 884290156, 922346160, 330605896, 466570756); + bool3x4 r2 = bool3x4(true, false, true, true, true, true, false, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + uint3x4 a3 = uint3x4(366131629, 315848579, 1539610530, 99028560, 765767372, 1241881101, 527753961, 1271899705, 1439235979, 436585748, 1244486586, 2128710216); + uint3x4 b3 = uint3x4(1252369410, 2057993777, 1691801535, 2041799631, 557988228, 813610154, 1657573441, 983813335, 385144401, 1281329713, 285422763, 658643567); + bool3x4 r3 = bool3x4(true, true, true, true, false, false, true, false, false, true, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void uint3x4_operator_less_equal_wide_scalar() + { + uint3x4 a0 = uint3x4(1479531977, 1427983411, 415250630, 1245345407, 1112546666, 1072990632, 1579912858, 101048307, 1070894375, 509818792, 1910488590, 85452501); + uint b0 = (2004563877); + bool3x4 r0 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + uint3x4 a1 = uint3x4(518127023, 1097326500, 1964410699, 1968139888, 1191853379, 662096238, 1140643434, 754434551, 155343473, 995927387, 974873240, 1773400038); + uint b1 = (1246249980); + bool3x4 r1 = bool3x4(true, true, false, false, true, true, true, true, true, true, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + uint3x4 a2 = uint3x4(497436329, 527516420, 1477043363, 1378470734, 96190147, 37188105, 839762283, 781102710, 766321672, 1145011483, 139031840, 127837780); + uint b2 = (1825940497); + bool3x4 r2 = bool3x4(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 <= b2); + + uint3x4 a3 = uint3x4(817806943, 649140851, 913173654, 1530989756, 856611228, 479496140, 287809619, 626008542, 2075114788, 269756518, 1123999963, 1061241170); + uint b3 = (1248492707); + bool3x4 r3 = bool3x4(true, true, true, false, true, true, true, true, false, true, true, true); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void uint3x4_operator_less_equal_scalar_wide() + { + uint a0 = (1899193992); + uint3x4 b0 = uint3x4(915011820, 980913757, 1337699683, 1476321359, 1102143668, 660493983, 184664508, 381579707, 1954892821, 1295090571, 1440368586, 1696003686); + bool3x4 r0 = bool3x4(false, false, false, false, false, false, false, false, true, false, false, false); + TestUtils.AreEqual(r0, a0 <= b0); + + uint a1 = (88708652); + uint3x4 b1 = uint3x4(1332251857, 1310713644, 2112132784, 48951945, 1888568027, 39340955, 1108242207, 260777425, 593122164, 291471959, 253457314, 1264570386); + bool3x4 r1 = bool3x4(true, true, true, false, true, false, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 <= b1); + + uint a2 = (699618012); + uint3x4 b2 = uint3x4(927735863, 2063158939, 932253787, 1168754049, 749328788, 1882694892, 168499987, 378173027, 339963627, 832906712, 559482768, 53067420); + bool3x4 r2 = bool3x4(true, true, true, true, true, true, false, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + uint a3 = (1895722478); + uint3x4 b3 = uint3x4(809981860, 591790551, 1680760399, 653274934, 1664284538, 1283249545, 767500110, 1334099884, 1271622829, 1270706578, 56782179, 505839576); + bool3x4 r3 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void uint3x4_operator_greater_equal_wide_wide() + { + uint3x4 a0 = uint3x4(8538378, 2131749726, 265427108, 523609761, 994991818, 839709564, 101288202, 1886280970, 2032074826, 631221455, 1456286159, 961342752); + uint3x4 b0 = uint3x4(903145828, 1697992986, 1432491982, 169789504, 1059357300, 1744255222, 1606584463, 1905414425, 1448794969, 136181998, 1678754836, 2069656857); + bool3x4 r0 = bool3x4(false, true, false, true, false, false, false, false, true, true, false, false); + TestUtils.AreEqual(r0, a0 >= b0); + + uint3x4 a1 = uint3x4(424526026, 788481984, 1662488497, 870326690, 708712581, 1260182701, 1165630721, 138247561, 1108650168, 1933222913, 672493999, 1541402159); + uint3x4 b1 = uint3x4(398982689, 243317404, 740939613, 1894753119, 301760792, 1260647988, 3608523, 52576030, 903420465, 1648820371, 627296845, 1679808907); + bool3x4 r1 = bool3x4(true, true, true, false, true, false, true, true, true, true, true, false); + TestUtils.AreEqual(r1, a1 >= b1); + + uint3x4 a2 = uint3x4(1921596027, 1557351956, 147242547, 892772168, 2089286723, 1273466960, 644009998, 654784654, 189030610, 1035542641, 346401762, 739783704); + uint3x4 b2 = uint3x4(1719102039, 1718081638, 655586949, 477267189, 62092869, 2013928066, 280292357, 254052205, 1092440092, 1947011057, 625632982, 2028466303); + bool3x4 r2 = bool3x4(true, false, false, true, true, false, true, true, false, false, false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + uint3x4 a3 = uint3x4(1310547408, 1175015477, 1893015570, 1397162858, 1005064177, 469205024, 1331071304, 1747510572, 1556472271, 1318844912, 877625210, 1556049679); + uint3x4 b3 = uint3x4(578645425, 552865694, 1460006028, 1944712828, 1256156724, 2090870105, 1299728699, 53125632, 782915512, 1103537852, 271803142, 828357811); + bool3x4 r3 = bool3x4(true, true, true, false, false, false, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void uint3x4_operator_greater_equal_wide_scalar() + { + uint3x4 a0 = uint3x4(2049236663, 182691143, 634973382, 1197012109, 439837565, 1367606469, 1108037359, 351147187, 1898505669, 411667685, 1998610091, 4652390); + uint b0 = (1061998015); + bool3x4 r0 = bool3x4(true, false, false, true, false, true, true, false, true, false, true, false); + TestUtils.AreEqual(r0, a0 >= b0); + + uint3x4 a1 = uint3x4(996159180, 727766399, 96217144, 814085575, 1525995206, 1293933760, 1732973229, 1473283041, 899444524, 1023753195, 1373738074, 518164359); + uint b1 = (2111455181); + bool3x4 r1 = bool3x4(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + uint3x4 a2 = uint3x4(717850464, 1826820341, 527594558, 1816542874, 839185150, 1143596061, 1819554651, 160724539, 993212636, 878086499, 363122662, 1989978759); + uint b2 = (1765188600); + bool3x4 r2 = bool3x4(false, true, false, true, false, false, true, false, false, false, false, true); + TestUtils.AreEqual(r2, a2 >= b2); + + uint3x4 a3 = uint3x4(2145562949, 122055824, 1432184946, 690328424, 638547285, 403700518, 569358695, 1988815901, 933324785, 1709851817, 1451640349, 1782506169); + uint b3 = (491416140); + bool3x4 r3 = bool3x4(true, false, true, true, true, false, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void uint3x4_operator_greater_equal_scalar_wide() + { + uint a0 = (1859811087); + uint3x4 b0 = uint3x4(1070365918, 1783869452, 830091760, 377157428, 327199016, 90384229, 1154649706, 376758501, 1079802834, 2054742898, 1328349472, 434061447); + bool3x4 r0 = bool3x4(true, true, true, true, true, true, true, true, true, false, true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + uint a1 = (951207723); + uint3x4 b1 = uint3x4(598695892, 975131651, 1714007943, 177416473, 1267232721, 31082860, 216791741, 119054289, 1905107583, 89559116, 55041824, 691334141); + bool3x4 r1 = bool3x4(true, false, false, true, false, true, true, true, false, true, true, true); + TestUtils.AreEqual(r1, a1 >= b1); + + uint a2 = (462326883); + uint3x4 b2 = uint3x4(1658303669, 914628512, 1134364322, 1677134711, 1955614770, 2067009301, 1454405405, 299467282, 1584922149, 561776357, 564147844, 398216936); + bool3x4 r2 = bool3x4(false, false, false, false, false, false, false, true, false, false, false, true); + TestUtils.AreEqual(r2, a2 >= b2); + + uint a3 = (1478439642); + uint3x4 b3 = uint3x4(958973988, 725612832, 1586062302, 1992817431, 732550238, 1151725147, 11183347, 643483664, 1846311608, 999376922, 1029876878, 1092702918); + bool3x4 r3 = bool3x4(true, true, false, false, true, true, true, true, false, true, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void uint3x4_operator_add_wide_wide() + { + uint3x4 a0 = uint3x4(2135171378, 21433296, 1954723494, 683604307, 1054212315, 1762680995, 1963655852, 1257853062, 2043493600, 976898058, 1915056423, 121374462); + uint3x4 b0 = uint3x4(1013431952, 366718162, 359290756, 1393163294, 1962236872, 1263270041, 1862666629, 1077447887, 821693806, 487316539, 350922520, 1583012528); + uint3x4 r0 = uint3x4(3148603330, 388151458, 2314014250, 2076767601, 3016449187, 3025951036, 3826322481, 2335300949, 2865187406, 1464214597, 2265978943, 1704386990); + TestUtils.AreEqual(r0, a0 + b0); + + uint3x4 a1 = uint3x4(1218855698, 700538222, 1702057277, 1788251699, 1534939160, 398651016, 1674272498, 374510467, 824322986, 1217622199, 1122376670, 642613771); + uint3x4 b1 = uint3x4(1951595076, 1024851344, 874302782, 1383969588, 1767968088, 900721406, 1659790033, 1792273749, 443844328, 633981449, 2010244807, 335566991); + uint3x4 r1 = uint3x4(3170450774, 1725389566, 2576360059, 3172221287, 3302907248, 1299372422, 3334062531, 2166784216, 1268167314, 1851603648, 3132621477, 978180762); + TestUtils.AreEqual(r1, a1 + b1); + + uint3x4 a2 = uint3x4(1097903998, 359042741, 929182687, 1713065399, 892057490, 1295346111, 1806236181, 1838589664, 173985173, 1875814528, 1464015613, 1550659036); + uint3x4 b2 = uint3x4(521931102, 544297835, 1681549647, 1784248858, 585904415, 3128418, 1806236610, 179909533, 378711407, 195687764, 357131656, 383703567); + uint3x4 r2 = uint3x4(1619835100, 903340576, 2610732334, 3497314257, 1477961905, 1298474529, 3612472791, 2018499197, 552696580, 2071502292, 1821147269, 1934362603); + TestUtils.AreEqual(r2, a2 + b2); + + uint3x4 a3 = uint3x4(447183339, 1810477200, 1280783968, 460635858, 1308981305, 2074430993, 515260041, 454786901, 54902689, 8663916, 364443922, 2133521215); + uint3x4 b3 = uint3x4(1332107956, 1471212095, 1634876660, 1356094538, 364971231, 1180126175, 1243953864, 2000873160, 761885805, 1088368083, 371382049, 1165570023); + uint3x4 r3 = uint3x4(1779291295, 3281689295, 2915660628, 1816730396, 1673952536, 3254557168, 1759213905, 2455660061, 816788494, 1097031999, 735825971, 3299091238); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void uint3x4_operator_add_wide_scalar() + { + uint3x4 a0 = uint3x4(665815972, 1783729250, 1591678394, 1284528538, 977850224, 71069732, 1138577680, 1200356017, 565982008, 1246759684, 1088001167, 57252642); + uint b0 = (1334043849); + uint3x4 r0 = uint3x4(1999859821, 3117773099, 2925722243, 2618572387, 2311894073, 1405113581, 2472621529, 2534399866, 1900025857, 2580803533, 2422045016, 1391296491); + TestUtils.AreEqual(r0, a0 + b0); + + uint3x4 a1 = uint3x4(678921480, 512157429, 1470648741, 1490096953, 1467033531, 182608093, 1707296407, 1703724354, 1333833947, 653973063, 1139546735, 1834005844); + uint b1 = (625943813); + uint3x4 r1 = uint3x4(1304865293, 1138101242, 2096592554, 2116040766, 2092977344, 808551906, 2333240220, 2329668167, 1959777760, 1279916876, 1765490548, 2459949657); + TestUtils.AreEqual(r1, a1 + b1); + + uint3x4 a2 = uint3x4(184572739, 1858520040, 97099208, 421437295, 1251829854, 166844260, 1568146789, 82548613, 533562157, 1464065228, 716600557, 831997894); + uint b2 = (1980578280); + uint3x4 r2 = uint3x4(2165151019, 3839098320, 2077677488, 2402015575, 3232408134, 2147422540, 3548725069, 2063126893, 2514140437, 3444643508, 2697178837, 2812576174); + TestUtils.AreEqual(r2, a2 + b2); + + uint3x4 a3 = uint3x4(861575416, 1590793088, 240051362, 656307111, 1116911778, 1508531454, 1488841996, 651080626, 850104335, 697550029, 1501177275, 308656842); + uint b3 = (1614335536); + uint3x4 r3 = uint3x4(2475910952, 3205128624, 1854386898, 2270642647, 2731247314, 3122866990, 3103177532, 2265416162, 2464439871, 2311885565, 3115512811, 1922992378); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void uint3x4_operator_add_scalar_wide() + { + uint a0 = (359966320); + uint3x4 b0 = uint3x4(2146146202, 767103309, 851002415, 311531406, 1491262941, 1016891373, 1954228994, 1671335850, 727870747, 551151834, 1390261152, 1699060326); + uint3x4 r0 = uint3x4(2506112522, 1127069629, 1210968735, 671497726, 1851229261, 1376857693, 2314195314, 2031302170, 1087837067, 911118154, 1750227472, 2059026646); + TestUtils.AreEqual(r0, a0 + b0); + + uint a1 = (115021619); + uint3x4 b1 = uint3x4(1964440175, 440700758, 1556692550, 185414255, 933106731, 1217866784, 729761881, 1742597318, 1090109152, 1467373815, 1066072609, 138237856); + uint3x4 r1 = uint3x4(2079461794, 555722377, 1671714169, 300435874, 1048128350, 1332888403, 844783500, 1857618937, 1205130771, 1582395434, 1181094228, 253259475); + TestUtils.AreEqual(r1, a1 + b1); + + uint a2 = (634834665); + uint3x4 b2 = uint3x4(993603553, 347587889, 2050191349, 670698672, 1658205080, 1874808705, 2082982954, 869839589, 118460267, 2126166073, 1826004041, 1976984739); + uint3x4 r2 = uint3x4(1628438218, 982422554, 2685026014, 1305533337, 2293039745, 2509643370, 2717817619, 1504674254, 753294932, 2761000738, 2460838706, 2611819404); + TestUtils.AreEqual(r2, a2 + b2); + + uint a3 = (1612682951); + uint3x4 b3 = uint3x4(1509218893, 283188530, 175981795, 290469072, 90401332, 92990995, 1697612984, 10695923, 584353656, 1985077669, 261483046, 1433592717); + uint3x4 r3 = uint3x4(3121901844, 1895871481, 1788664746, 1903152023, 1703084283, 1705673946, 3310295935, 1623378874, 2197036607, 3597760620, 1874165997, 3046275668); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void uint3x4_operator_sub_wide_wide() + { + uint3x4 a0 = uint3x4(1410318491, 1097280168, 1827039044, 28881338, 328720965, 875487868, 212936325, 231977215, 1740021315, 2011295463, 48079003, 591379285); + uint3x4 b0 = uint3x4(1315897366, 799052018, 1580289673, 1094686261, 1954325726, 1197734816, 229886366, 915679176, 1746884850, 918743925, 1007797419, 257421324); + uint3x4 r0 = uint3x4(94421125, 298228150, 246749371, 3229162373, 2669362535, 3972720348, 4278017255, 3611265335, 4288103761, 1092551538, 3335248880, 333957961); + TestUtils.AreEqual(r0, a0 - b0); + + uint3x4 a1 = uint3x4(1125909359, 1842588095, 848561896, 614448464, 2067598029, 1618238416, 318516219, 1090119767, 1991095823, 949592162, 1951912339, 1457818751); + uint3x4 b1 = uint3x4(287249342, 1617287463, 1653916102, 123586847, 502107404, 672875302, 1256481116, 1975569142, 1794443030, 1327558915, 330955394, 1596041731); + uint3x4 r1 = uint3x4(838660017, 225300632, 3489613090, 490861617, 1565490625, 945363114, 3357002399, 3409517921, 196652793, 3917000543, 1620956945, 4156744316); + TestUtils.AreEqual(r1, a1 - b1); + + uint3x4 a2 = uint3x4(1642553126, 2114366549, 1420516260, 596841760, 724518081, 1820626306, 1885185225, 246124365, 1339877262, 1277620434, 759131597, 597162957); + uint3x4 b2 = uint3x4(1069074732, 1120817099, 2076417364, 402521072, 839858844, 1539789702, 559077522, 822288510, 751901021, 1858312568, 1706585560, 483540199); + uint3x4 r2 = uint3x4(573478394, 993549450, 3639066192, 194320688, 4179626533, 280836604, 1326107703, 3718803151, 587976241, 3714275162, 3347513333, 113622758); + TestUtils.AreEqual(r2, a2 - b2); + + uint3x4 a3 = uint3x4(656765083, 1075131749, 58205257, 452992632, 976914238, 2122217984, 1687033200, 850554234, 2052749291, 2095840868, 1583338457, 90383917); + uint3x4 b3 = uint3x4(35726321, 401119620, 1411304017, 794953965, 246546364, 1926970811, 1641115012, 2138664312, 1215717344, 1626141022, 1697813712, 1432018301); + uint3x4 r3 = uint3x4(621038762, 674012129, 2941868536, 3953005963, 730367874, 195247173, 45918188, 3006857218, 837031947, 469699846, 4180492041, 2953332912); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void uint3x4_operator_sub_wide_scalar() + { + uint3x4 a0 = uint3x4(1508669340, 1594795463, 266707545, 643102647, 287705008, 1475644328, 1113286221, 979450511, 2082174113, 1108005498, 304369206, 999244508); + uint b0 = (998008471); + uint3x4 r0 = uint3x4(510660869, 596786992, 3563666370, 3940061472, 3584663833, 477635857, 115277750, 4276409336, 1084165642, 109997027, 3601328031, 1236037); + TestUtils.AreEqual(r0, a0 - b0); + + uint3x4 a1 = uint3x4(1806482044, 2101812429, 1482736902, 266654115, 1470212363, 1190349300, 958542155, 1185075537, 1738124835, 499527536, 1612473406, 1696960099); + uint b1 = (1994553647); + uint3x4 r1 = uint3x4(4106895693, 107258782, 3783150551, 2567067764, 3770626012, 3490762949, 3258955804, 3485489186, 4038538484, 2799941185, 3912887055, 3997373748); + TestUtils.AreEqual(r1, a1 - b1); + + uint3x4 a2 = uint3x4(1287292743, 1032360376, 1779621585, 964948785, 1739264125, 94254551, 968533883, 2075770560, 946189008, 1074604044, 1171596880, 1033389665); + uint b2 = (1360229454); + uint3x4 r2 = uint3x4(4222030585, 3967098218, 419392131, 3899686627, 379034671, 3028992393, 3903271725, 715541106, 3880926850, 4009341886, 4106334722, 3968127507); + TestUtils.AreEqual(r2, a2 - b2); + + uint3x4 a3 = uint3x4(1905912138, 372717946, 658343960, 572101777, 361378660, 1043302867, 1535109165, 695707807, 153321516, 1464557635, 308141270, 69622833); + uint b3 = (1219683758); + uint3x4 r3 = uint3x4(686228380, 3448001484, 3733627498, 3647385315, 3436662198, 4118586405, 315425407, 3770991345, 3228605054, 244873877, 3383424808, 3144906371); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void uint3x4_operator_sub_scalar_wide() + { + uint a0 = (893369501); + uint3x4 b0 = uint3x4(2051906184, 1699714311, 442603706, 1735141684, 274533585, 811580259, 1196354320, 1524097023, 533621527, 2080845793, 143958837, 1620668660); + uint3x4 r0 = uint3x4(3136430613, 3488622486, 450765795, 3453195113, 618835916, 81789242, 3991982477, 3664239774, 359747974, 3107491004, 749410664, 3567668137); + TestUtils.AreEqual(r0, a0 - b0); + + uint a1 = (1135989346); + uint3x4 b1 = uint3x4(1367044745, 554088609, 552670373, 1265516124, 1254902543, 1857695581, 1619865274, 1313559400, 99812999, 843597298, 420111239, 1299949060); + uint3x4 r1 = uint3x4(4063911897, 581900737, 583318973, 4165440518, 4176054099, 3573261061, 3811091368, 4117397242, 1036176347, 292392048, 715878107, 4131007582); + TestUtils.AreEqual(r1, a1 - b1); + + uint a2 = (531009038); + uint3x4 b2 = uint3x4(1103306550, 104920105, 1137308312, 1207332725, 103438360, 1157123503, 1174401240, 701247193, 1498366995, 467017290, 109208355, 1594646461); + uint3x4 r2 = uint3x4(3722669784, 426088933, 3688668022, 3618643609, 427570678, 3668852831, 3651575094, 4124729141, 3327609339, 63991748, 421800683, 3231329873); + TestUtils.AreEqual(r2, a2 - b2); + + uint a3 = (1252691221); + uint3x4 b3 = uint3x4(919863765, 2826939, 1969148647, 1576198850, 2075870798, 1610641273, 1783880129, 59074246, 1766624573, 521313783, 1333637752, 509364704); + uint3x4 r3 = uint3x4(332827456, 1249864282, 3578509870, 3971459667, 3471787719, 3937017244, 3763778388, 1193616975, 3781033944, 731377438, 4214020765, 743326517); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void uint3x4_operator_mul_wide_wide() + { + uint3x4 a0 = uint3x4(61417577, 219585476, 1362520891, 1511084277, 1481211272, 58211871, 1459591173, 567624644, 1169935583, 1835691886, 385626539, 85934842); + uint3x4 b0 = uint3x4(578042444, 1620527213, 200516468, 309339115, 542853019, 299467282, 1479641221, 1428338601, 1497302909, 1596889147, 427413842, 265122693); + uint3x4 r0 = uint3x4(2868103468, 1326150260, 3304073148, 2972110823, 1973926232, 88546350, 3431047833, 3712145508, 556671459, 1098186330, 1848083398, 4236646882); + TestUtils.AreEqual(r0, a0 * b0); + + uint3x4 a1 = uint3x4(522856538, 278370196, 289217012, 2083410174, 1293162798, 1939730122, 2075923048, 1116477212, 1686101741, 783310758, 248585944, 1093377716); + uint3x4 b1 = uint3x4(689376654, 1120457204, 516903000, 873091659, 1353196495, 1384773500, 1596528529, 2122329305, 1033200564, 996795088, 1137754930, 232014195); + uint3x4 r1 = uint3x4(2005201900, 651971856, 2573806560, 4184807018, 4175537714, 3758002136, 2245379304, 3535300284, 1443849636, 550781664, 3335949872, 3941859036); + TestUtils.AreEqual(r1, a1 * b1); + + uint3x4 a2 = uint3x4(797038788, 1838048120, 1892922904, 1952024781, 492107602, 1097670675, 2069629919, 20122103, 606926492, 1153788131, 1687394746, 1499899200); + uint3x4 b2 = uint3x4(1080950243, 1613216909, 463529448, 1781487382, 2101946430, 673144237, 390627073, 964308272, 1332603859, 106394678, 1330334791, 1720890701); + uint3x4 r2 = uint3x4(3201362380, 264300824, 4173364672, 1825729694, 4053448156, 3048379351, 2230824159, 4043852112, 1004304020, 3964664802, 638638742, 892728384); + TestUtils.AreEqual(r2, a2 * b2); + + uint3x4 a3 = uint3x4(380825697, 2058271053, 1791586731, 16536749, 1743482585, 323418416, 826338527, 1127652402, 1548655361, 892665898, 498857854, 52699386); + uint3x4 b3 = uint3x4(1860846228, 1499909622, 1236623401, 1532585255, 46356001, 1355750416, 470193265, 829633350, 158242740, 2121460265, 443332975, 1295474668); + uint3x4 r3 = uint3x4(2820012564, 1744222462, 3318371427, 2734565211, 2648780793, 1971376896, 936606319, 4269976492, 3894449076, 3059182266, 4018298274, 2504076408); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void uint3x4_operator_mul_wide_scalar() + { + uint3x4 a0 = uint3x4(871746615, 492532311, 570557670, 2142306629, 1610315153, 1526163563, 118471734, 257439514, 364291059, 1186560810, 1584938026, 1357601203); + uint b0 = (442064533); + uint3x4 r0 = uint3x4(338365955, 1081376419, 2565819870, 3279557417, 3421481829, 4119466055, 3456786286, 513646114, 1627104879, 1523063666, 1353478258, 3777359663); + TestUtils.AreEqual(r0, a0 * b0); + + uint3x4 a1 = uint3x4(638897141, 1007838321, 1163240135, 1619806399, 1444659979, 1127580168, 464517916, 1508043166, 745488654, 636691139, 1851670006, 357357967); + uint b1 = (268562104); + uint3x4 r1 = uint3x4(3498401304, 3138010936, 2242445576, 154458952, 643000808, 258008512, 1024230432, 1508298128, 2139080208, 2748663336, 2404203728, 2332971208); + TestUtils.AreEqual(r1, a1 * b1); + + uint3x4 a2 = uint3x4(1095280227, 945802744, 1464398841, 51061000, 802418971, 407442471, 638315697, 1889264235, 584402164, 1343048690, 2144106255, 1634890111); + uint b2 = (702779195); + uint3x4 r2 = uint3x4(91792849, 3708420136, 350441827, 2098992344, 2272765497, 2293132797, 2817092555, 4014470057, 1627861052, 4195528390, 2750271861, 1566775621); + TestUtils.AreEqual(r2, a2 * b2); + + uint3x4 a3 = uint3x4(425282134, 676185747, 1562817045, 379402138, 866868743, 624571724, 889442510, 39498317, 219559094, 211033504, 2076045580, 1838674974); + uint b3 = (997231492); + uint3x4 r3 = uint3x4(3842442840, 3292280012, 3402971604, 3617671528, 1887062172, 2721300272, 1014465592, 910409396, 3484549080, 3195348608, 689032752, 3137743224); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void uint3x4_operator_mul_scalar_wide() + { + uint a0 = (1152242766); + uint3x4 b0 = uint3x4(1276636134, 2105929407, 499007702, 124002565, 1956335172, 1288034953, 832676555, 337389733, 99268757, 2005055247, 2011389505, 1348110859); + uint3x4 r0 = uint3x4(2165463060, 999811634, 1179056436, 3493540742, 404105400, 1339492798, 3913201114, 3183347270, 2131796326, 1519334034, 3342961614, 2874551130); + TestUtils.AreEqual(r0, a0 * b0); + + uint a1 = (399689191); + uint3x4 b1 = uint3x4(2007606374, 2076691289, 1825721194, 769885235, 153314735, 1066325369, 84289667, 984486192, 1325213504, 1643957457, 1576395620, 2095980601); + uint3x4 r1 = uint3x4(2336347658, 1053162063, 1757322918, 2212333829, 2663279593, 1080737071, 1177640245, 1336635984, 136489664, 3207308695, 2229543740, 2272063599); + TestUtils.AreEqual(r1, a1 * b1); + + uint a2 = (907671947); + uint3x4 b2 = uint3x4(836919582, 1412159342, 2037926630, 366590562, 493177763, 2058824164, 497936968, 2136548816, 1211907591, 2113626509, 345443734, 353147704); + uint3x4 r2 = uint3x4(374270282, 2518021818, 3382730978, 2199094582, 1098685569, 4168516300, 1465269528, 1820252144, 1505328333, 774184079, 299976306, 2840182632); + TestUtils.AreEqual(r2, a2 * b2); + + uint a3 = (688487056); + uint3x4 b3 = uint3x4(2038986981, 1991273614, 393095943, 838257274, 1646548338, 480051387, 1077685034, 421911953, 1757438926, 1584698689, 1237695787, 426426495); + uint3x4 r3 = uint3x4(1399726800, 1710668768, 1354271216, 1603930272, 3358221344, 3829172016, 216288160, 872201104, 470175712, 1493036688, 1155786288, 1195363696); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void uint3x4_operator_div_wide_wide() + { + uint3x4 a0 = uint3x4(333171510, 858154903, 1181365836, 671357749, 1090606752, 803759420, 788404166, 296807814, 575260195, 166625280, 1493729000, 1831739736); + uint3x4 b0 = uint3x4(698897823, 440199998, 655557473, 1658534285, 2127220100, 315653188, 1814290360, 992173243, 914851653, 664340325, 224323977, 246981573); + uint3x4 r0 = uint3x4(0, 1, 1, 0, 0, 2, 0, 0, 0, 0, 6, 7); + TestUtils.AreEqual(r0, a0 / b0); + + uint3x4 a1 = uint3x4(200852358, 129983172, 500176108, 472051781, 414699094, 1446535974, 1278480457, 930910505, 263295881, 1626759436, 450830871, 21439121); + uint3x4 b1 = uint3x4(285573983, 819471609, 2012476015, 1783179572, 223253978, 169515029, 1694929006, 1992168131, 1155972447, 1768506696, 422325410, 1508417406); + uint3x4 r1 = uint3x4(0, 0, 0, 0, 1, 8, 0, 0, 0, 0, 1, 0); + TestUtils.AreEqual(r1, a1 / b1); + + uint3x4 a2 = uint3x4(521337599, 127756712, 200601965, 412554396, 1014641734, 239347640, 525574301, 1158358177, 1655168319, 2048437741, 367754386, 1861176433); + uint3x4 b2 = uint3x4(605462475, 66917170, 2014683461, 108847533, 611173330, 895791853, 1999369787, 1225614384, 1168063495, 565150188, 127292785, 1027814836); + uint3x4 r2 = uint3x4(0, 1, 0, 3, 1, 0, 0, 0, 1, 3, 2, 1); + TestUtils.AreEqual(r2, a2 / b2); + + uint3x4 a3 = uint3x4(2131424795, 401044444, 745048188, 1943634349, 264134862, 298134010, 1884719303, 1582577607, 1958183229, 1302356942, 1455581366, 1466593830); + uint3x4 b3 = uint3x4(321940796, 337756553, 63233040, 1926010595, 769049413, 2042197280, 405134611, 547499280, 1337688441, 667307127, 35118652, 411409741); + uint3x4 r3 = uint3x4(6, 1, 11, 1, 0, 0, 4, 2, 1, 1, 41, 3); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void uint3x4_operator_div_wide_scalar() + { + uint3x4 a0 = uint3x4(1433072926, 1073958635, 1195142312, 536596719, 1274375693, 464756346, 806462546, 906504670, 1380905136, 25493909, 1196815948, 123300377); + uint b0 = (1434025872); + uint3x4 r0 = uint3x4(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + TestUtils.AreEqual(r0, a0 / b0); + + uint3x4 a1 = uint3x4(643754735, 2047825037, 458304263, 741331531, 466443901, 2110004616, 1500687214, 1453264263, 1617154145, 2040203220, 2103351724, 485536709); + uint b1 = (2084019932); + uint3x4 r1 = uint3x4(0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0); + TestUtils.AreEqual(r1, a1 / b1); + + uint3x4 a2 = uint3x4(402141749, 1629069474, 1549487015, 670594363, 2040479674, 155415284, 207130003, 1596922206, 1730223836, 1528374182, 1878500631, 1245757182); + uint b2 = (1477264254); + uint3x4 r2 = uint3x4(0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0); + TestUtils.AreEqual(r2, a2 / b2); + + uint3x4 a3 = uint3x4(1471308702, 251821475, 1328085649, 1950145317, 794269329, 174603836, 678361822, 1820872200, 1455358409, 778273070, 2067965131, 127176068); + uint b3 = (1733304186); + uint3x4 r3 = uint3x4(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void uint3x4_operator_div_scalar_wide() + { + uint a0 = (519165704); + uint3x4 b0 = uint3x4(1295178177, 775214121, 467772046, 1156881598, 310396565, 759759959, 243837702, 1616314235, 1053470225, 1320630160, 378773841, 4223608); + uint3x4 r0 = uint3x4(0, 0, 1, 0, 1, 0, 2, 0, 0, 0, 1, 122); + TestUtils.AreEqual(r0, a0 / b0); + + uint a1 = (1971105754); + uint3x4 b1 = uint3x4(2054406020, 219939614, 1603672651, 2006134295, 888535397, 1493077923, 615835131, 1045603945, 452709946, 1074919059, 467037221, 1485241506); + uint3x4 r1 = uint3x4(0, 8, 1, 0, 2, 1, 3, 1, 4, 1, 4, 1); + TestUtils.AreEqual(r1, a1 / b1); + + uint a2 = (1775728786); + uint3x4 b2 = uint3x4(481521341, 68149923, 80867357, 1294049272, 470535313, 1235850199, 631464286, 687722755, 412827650, 1258012095, 1286792622, 1799223034); + uint3x4 r2 = uint3x4(3, 26, 21, 1, 3, 1, 2, 2, 4, 1, 1, 0); + TestUtils.AreEqual(r2, a2 / b2); + + uint a3 = (766890491); + uint3x4 b3 = uint3x4(2080374598, 711612151, 700420132, 1832408481, 1806438353, 237636410, 562498090, 1695805237, 2075783388, 2094216740, 1612536340, 885282904); + uint3x4 r3 = uint3x4(0, 1, 1, 0, 0, 3, 1, 0, 0, 0, 0, 0); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void uint3x4_operator_mod_wide_wide() + { + uint3x4 a0 = uint3x4(258342924, 1454754891, 723352342, 1981431473, 531756042, 716993627, 1667903349, 1331097004, 1776856101, 17598216, 1474345080, 1681376293); + uint3x4 b0 = uint3x4(1990080167, 1197348066, 651970512, 1659454050, 241005212, 1866255454, 1440101415, 595220963, 408818410, 198222574, 549504274, 239973807); + uint3x4 r0 = uint3x4(258342924, 257406825, 71381830, 321977423, 49745618, 716993627, 227801934, 140655078, 141582461, 17598216, 375336532, 1559644); + TestUtils.AreEqual(r0, a0 % b0); + + uint3x4 a1 = uint3x4(813624265, 1617478722, 498370451, 780075943, 1754430321, 653235398, 1517128354, 966216200, 590067427, 1283434795, 1910903650, 1125967790); + uint3x4 b1 = uint3x4(321398087, 658171840, 1511495237, 1048325585, 1126739824, 666641241, 38017598, 418797691, 618700513, 1941062990, 158556432, 1081063558); + uint3x4 r1 = uint3x4(170828091, 301135042, 498370451, 780075943, 627690497, 653235398, 34442032, 128620818, 590067427, 1283434795, 8226466, 44904232); + TestUtils.AreEqual(r1, a1 % b1); + + uint3x4 a2 = uint3x4(1180537254, 308567230, 543945394, 483834400, 308703874, 383723801, 1181975437, 1161083599, 1608412916, 111825133, 786866017, 1225576256); + uint3x4 b2 = uint3x4(427329468, 148111230, 1251162672, 1856322297, 1214781084, 401954255, 1323259633, 1167744452, 1816151689, 541163525, 664455763, 1738838503); + uint3x4 r2 = uint3x4(325878318, 12344770, 543945394, 483834400, 308703874, 383723801, 1181975437, 1161083599, 1608412916, 111825133, 122410254, 1225576256); + TestUtils.AreEqual(r2, a2 % b2); + + uint3x4 a3 = uint3x4(1590085857, 1755638794, 1413553126, 476553804, 1342913944, 1625118233, 1202928007, 504380191, 642905424, 357937367, 1801777444, 1384305901); + uint3x4 b3 = uint3x4(1746284172, 855644567, 1887796950, 655067833, 536415164, 71040983, 631964713, 503267649, 944396748, 302347270, 564261945, 1414291441); + uint3x4 r3 = uint3x4(1590085857, 44349660, 1413553126, 476553804, 270083616, 62216607, 570963294, 1112542, 642905424, 55590097, 108991609, 1384305901); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void uint3x4_operator_mod_wide_scalar() + { + uint3x4 a0 = uint3x4(560988938, 629524514, 767711194, 434281967, 1399805893, 792916846, 1663690927, 598661916, 1776636144, 1287035793, 1743722161, 475209785); + uint b0 = (1156862367); + uint3x4 r0 = uint3x4(560988938, 629524514, 767711194, 434281967, 242943526, 792916846, 506828560, 598661916, 619773777, 130173426, 586859794, 475209785); + TestUtils.AreEqual(r0, a0 % b0); + + uint3x4 a1 = uint3x4(327476870, 379853074, 477430114, 858399046, 712734431, 1506629323, 199829950, 362269020, 1986626876, 1351725413, 1549678101, 431765276); + uint b1 = (1617696916); + uint3x4 r1 = uint3x4(327476870, 379853074, 477430114, 858399046, 712734431, 1506629323, 199829950, 362269020, 368929960, 1351725413, 1549678101, 431765276); + TestUtils.AreEqual(r1, a1 % b1); + + uint3x4 a2 = uint3x4(1315833792, 615834034, 780055604, 104179235, 629966219, 1810536428, 1747026206, 1799535061, 875754431, 2049775667, 303673867, 93301056); + uint b2 = (1664893153); + uint3x4 r2 = uint3x4(1315833792, 615834034, 780055604, 104179235, 629966219, 145643275, 82133053, 134641908, 875754431, 384882514, 303673867, 93301056); + TestUtils.AreEqual(r2, a2 % b2); + + uint3x4 a3 = uint3x4(1944511005, 1065919801, 1342701312, 1356734788, 1593032231, 475449806, 1983416442, 776300612, 591854273, 2061957684, 1865797266, 1982663429); + uint b3 = (2135291183); + uint3x4 r3 = uint3x4(1944511005, 1065919801, 1342701312, 1356734788, 1593032231, 475449806, 1983416442, 776300612, 591854273, 2061957684, 1865797266, 1982663429); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void uint3x4_operator_mod_scalar_wide() + { + uint a0 = (933347930); + uint3x4 b0 = uint3x4(549923387, 243114953, 1884274390, 1428033594, 655531454, 1622674954, 1107563514, 1614111094, 914801920, 1432263179, 564431096, 1967013901); + uint3x4 r0 = uint3x4(383424543, 204003071, 933347930, 933347930, 277816476, 933347930, 933347930, 933347930, 18546010, 933347930, 368916834, 933347930); + TestUtils.AreEqual(r0, a0 % b0); + + uint a1 = (1709750152); + uint3x4 b1 = uint3x4(1080102613, 13120773, 2042535998, 1505698002, 1640058084, 974167554, 758635306, 1387264978, 611743343, 1139002766, 1913935748, 1086810076); + uint3x4 r1 = uint3x4(629647539, 4049662, 1709750152, 204052150, 69692068, 735582598, 192479540, 322485174, 486263466, 570747386, 1709750152, 622940076); + TestUtils.AreEqual(r1, a1 % b1); + + uint a2 = (991846486); + uint3x4 b2 = uint3x4(922870408, 35007468, 891877602, 157349181, 83267982, 801093706, 546272767, 1665089132, 1889242068, 1179889796, 1690033703, 1333252321); + uint3x4 r2 = uint3x4(68976078, 11637382, 99968884, 47751400, 75898684, 190752780, 445573719, 991846486, 991846486, 991846486, 991846486, 991846486); + TestUtils.AreEqual(r2, a2 % b2); + + uint a3 = (1960636489); + uint3x4 b3 = uint3x4(960755248, 698650125, 313994074, 1830992514, 2049496523, 507742240, 739436968, 1012724736, 2089810815, 329356442, 384427687, 713578570); + uint3x4 r3 = uint3x4(39125993, 563336239, 76672045, 129643975, 1960636489, 437409769, 481762553, 947911753, 1960636489, 313854279, 38498054, 533479349); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void uint3x4_operator_plus() + { + uint3x4 a0 = uint3x4(195392567, 222719748, 1002351013, 1570765263, 109389333, 1515950277, 1689763402, 291471785, 264115671, 1084131995, 195779102, 2131702223); + uint3x4 r0 = uint3x4(195392567, 222719748, 1002351013, 1570765263, 109389333, 1515950277, 1689763402, 291471785, 264115671, 1084131995, 195779102, 2131702223); + TestUtils.AreEqual(r0, +a0); + + uint3x4 a1 = uint3x4(715660442, 69731564, 1317851903, 1957501908, 531426536, 2012985092, 1334133318, 1539671418, 935436165, 1575048895, 2119066258, 781435471); + uint3x4 r1 = uint3x4(715660442, 69731564, 1317851903, 1957501908, 531426536, 2012985092, 1334133318, 1539671418, 935436165, 1575048895, 2119066258, 781435471); + TestUtils.AreEqual(r1, +a1); + + uint3x4 a2 = uint3x4(1659000230, 1153431944, 1360657696, 578750954, 150348334, 1791553179, 1288641627, 735146513, 328684789, 1370099515, 1575634098, 36481877); + uint3x4 r2 = uint3x4(1659000230, 1153431944, 1360657696, 578750954, 150348334, 1791553179, 1288641627, 735146513, 328684789, 1370099515, 1575634098, 36481877); + TestUtils.AreEqual(r2, +a2); + + uint3x4 a3 = uint3x4(1832055170, 1370934466, 1126708142, 511229253, 1297664549, 1444401655, 1292097101, 1377029046, 1680766483, 249526091, 656501406, 195015813); + uint3x4 r3 = uint3x4(1832055170, 1370934466, 1126708142, 511229253, 1297664549, 1444401655, 1292097101, 1377029046, 1680766483, 249526091, 656501406, 195015813); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void uint3x4_operator_neg() + { + uint3x4 a0 = uint3x4(1385088677, 94114564, 1350664872, 1458616659, 2067164853, 218122493, 958484951, 270553961, 446497525, 270503114, 1928771252, 1427605822); + uint3x4 r0 = uint3x4(2909878619, 4200852732, 2944302424, 2836350637, 2227802443, 4076844803, 3336482345, 4024413335, 3848469771, 4024464182, 2366196044, 2867361474); + TestUtils.AreEqual(r0, -a0); + + uint3x4 a1 = uint3x4(2051940607, 485368391, 908365416, 1742096480, 990033169, 1368056141, 1350976157, 12802586, 1934372287, 576597401, 785136322, 559205611); + uint3x4 r1 = uint3x4(2243026689, 3809598905, 3386601880, 2552870816, 3304934127, 2926911155, 2943991139, 4282164710, 2360595009, 3718369895, 3509830974, 3735761685); + TestUtils.AreEqual(r1, -a1); + + uint3x4 a2 = uint3x4(1959833280, 1200036971, 95281343, 1969004480, 1381288239, 252975075, 1961335692, 1607042487, 832886233, 1300359361, 8438338, 431498011); + uint3x4 r2 = uint3x4(2335134016, 3094930325, 4199685953, 2325962816, 2913679057, 4041992221, 2333631604, 2687924809, 3462081063, 2994607935, 4286528958, 3863469285); + TestUtils.AreEqual(r2, -a2); + + uint3x4 a3 = uint3x4(1534415387, 866625695, 2105773520, 1249998702, 1704935592, 59004141, 257619538, 392825753, 1868257049, 1472660509, 928823577, 2138036799); + uint3x4 r3 = uint3x4(2760551909, 3428341601, 2189193776, 3044968594, 2590031704, 4235963155, 4037347758, 3902141543, 2426710247, 2822306787, 3366143719, 2156930497); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void uint3x4_operator_prefix_inc() + { + uint3x4 a0 = uint3x4(780471723, 954741756, 272723451, 2142862245, 606294309, 1514814550, 250124151, 444189162, 1833356994, 1915989169, 1348278302, 129540735); + uint3x4 r0 = uint3x4(780471724, 954741757, 272723452, 2142862246, 606294310, 1514814551, 250124152, 444189163, 1833356995, 1915989170, 1348278303, 129540736); + TestUtils.AreEqual(r0, ++a0); + + uint3x4 a1 = uint3x4(1584496757, 986715680, 1701179230, 1397451003, 483952900, 1494652811, 1268688387, 2014528731, 453850931, 1112537171, 621362788, 2063486914); + uint3x4 r1 = uint3x4(1584496758, 986715681, 1701179231, 1397451004, 483952901, 1494652812, 1268688388, 2014528732, 453850932, 1112537172, 621362789, 2063486915); + TestUtils.AreEqual(r1, ++a1); + + uint3x4 a2 = uint3x4(1612870531, 1083861484, 1583359796, 82587894, 810087437, 72436569, 1094485773, 912422931, 1011314676, 261771874, 2042016403, 1102472175); + uint3x4 r2 = uint3x4(1612870532, 1083861485, 1583359797, 82587895, 810087438, 72436570, 1094485774, 912422932, 1011314677, 261771875, 2042016404, 1102472176); + TestUtils.AreEqual(r2, ++a2); + + uint3x4 a3 = uint3x4(976635804, 607693651, 1788488571, 1912059986, 420746703, 1703260621, 501684292, 1809882373, 1989306461, 786299198, 1729269500, 411043860); + uint3x4 r3 = uint3x4(976635805, 607693652, 1788488572, 1912059987, 420746704, 1703260622, 501684293, 1809882374, 1989306462, 786299199, 1729269501, 411043861); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void uint3x4_operator_postfix_inc() + { + uint3x4 a0 = uint3x4(241865086, 2145821641, 1596166022, 803592338, 529551271, 1656767229, 903047443, 1213663244, 1425753247, 1384002775, 389844650, 1159795446); + uint3x4 r0 = uint3x4(241865086, 2145821641, 1596166022, 803592338, 529551271, 1656767229, 903047443, 1213663244, 1425753247, 1384002775, 389844650, 1159795446); + TestUtils.AreEqual(r0, a0++); + + uint3x4 a1 = uint3x4(1343289659, 947635082, 137930180, 451018043, 1634297552, 2009552507, 1176922170, 388721494, 2381860, 2062858295, 715101397, 1725384327); + uint3x4 r1 = uint3x4(1343289659, 947635082, 137930180, 451018043, 1634297552, 2009552507, 1176922170, 388721494, 2381860, 2062858295, 715101397, 1725384327); + TestUtils.AreEqual(r1, a1++); + + uint3x4 a2 = uint3x4(446867079, 1460883320, 1683365096, 1319511974, 1418603655, 1938539756, 592683318, 1576213022, 1150548583, 904484472, 253685095, 70826818); + uint3x4 r2 = uint3x4(446867079, 1460883320, 1683365096, 1319511974, 1418603655, 1938539756, 592683318, 1576213022, 1150548583, 904484472, 253685095, 70826818); + TestUtils.AreEqual(r2, a2++); + + uint3x4 a3 = uint3x4(1423673637, 257117856, 964412816, 1148726183, 1820437224, 1087435092, 475319856, 1950385959, 1172607661, 1139700625, 1386106060, 612787013); + uint3x4 r3 = uint3x4(1423673637, 257117856, 964412816, 1148726183, 1820437224, 1087435092, 475319856, 1950385959, 1172607661, 1139700625, 1386106060, 612787013); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void uint3x4_operator_prefix_dec() + { + uint3x4 a0 = uint3x4(1331961415, 1612382200, 1401591249, 2042075388, 1757136546, 1895858159, 1467742422, 578341664, 1336115745, 2059077641, 1169239112, 1862369220); + uint3x4 r0 = uint3x4(1331961414, 1612382199, 1401591248, 2042075387, 1757136545, 1895858158, 1467742421, 578341663, 1336115744, 2059077640, 1169239111, 1862369219); + TestUtils.AreEqual(r0, --a0); + + uint3x4 a1 = uint3x4(312317355, 1595492535, 1426262619, 1426620468, 674685792, 1423852012, 1459529624, 2092317419, 107501474, 1261583506, 512900840, 1496855314); + uint3x4 r1 = uint3x4(312317354, 1595492534, 1426262618, 1426620467, 674685791, 1423852011, 1459529623, 2092317418, 107501473, 1261583505, 512900839, 1496855313); + TestUtils.AreEqual(r1, --a1); + + uint3x4 a2 = uint3x4(777588547, 1487639376, 625907330, 1452782388, 804650978, 2076275981, 120447533, 262357170, 1887136873, 412907314, 846648478, 473291493); + uint3x4 r2 = uint3x4(777588546, 1487639375, 625907329, 1452782387, 804650977, 2076275980, 120447532, 262357169, 1887136872, 412907313, 846648477, 473291492); + TestUtils.AreEqual(r2, --a2); + + uint3x4 a3 = uint3x4(286048219, 1237897291, 1412498905, 346348942, 953070054, 2028727932, 2006551142, 1345994403, 1356250542, 1202345509, 497982699, 982734742); + uint3x4 r3 = uint3x4(286048218, 1237897290, 1412498904, 346348941, 953070053, 2028727931, 2006551141, 1345994402, 1356250541, 1202345508, 497982698, 982734741); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void uint3x4_operator_postfix_dec() + { + uint3x4 a0 = uint3x4(1870005937, 1708534798, 704493460, 462940703, 2060593573, 228744869, 940247280, 1818778351, 1015253889, 862428933, 1401191870, 2080259851); + uint3x4 r0 = uint3x4(1870005937, 1708534798, 704493460, 462940703, 2060593573, 228744869, 940247280, 1818778351, 1015253889, 862428933, 1401191870, 2080259851); + TestUtils.AreEqual(r0, a0--); + + uint3x4 a1 = uint3x4(653673271, 1928164223, 1760916301, 1174531383, 634036198, 993137684, 1669210509, 874927437, 1393579866, 471308632, 620865961, 220103745); + uint3x4 r1 = uint3x4(653673271, 1928164223, 1760916301, 1174531383, 634036198, 993137684, 1669210509, 874927437, 1393579866, 471308632, 620865961, 220103745); + TestUtils.AreEqual(r1, a1--); + + uint3x4 a2 = uint3x4(1407678826, 1426931482, 488775250, 1681733117, 1916879863, 2060905976, 636358505, 1379709480, 451326084, 497925052, 549367303, 925145385); + uint3x4 r2 = uint3x4(1407678826, 1426931482, 488775250, 1681733117, 1916879863, 2060905976, 636358505, 1379709480, 451326084, 497925052, 549367303, 925145385); + TestUtils.AreEqual(r2, a2--); + + uint3x4 a3 = uint3x4(55306458, 18471540, 1907671409, 2010375112, 459674494, 1339288497, 548526029, 2061115550, 1130246689, 681734791, 1169678318, 640772261); + uint3x4 r3 = uint3x4(55306458, 18471540, 1907671409, 2010375112, 459674494, 1339288497, 548526029, 2061115550, 1130246689, 681734791, 1169678318, 640772261); + TestUtils.AreEqual(r3, a3--); + } + + [TestCompiler] + public static void uint3x4_operator_bitwise_and_wide_wide() + { + uint3x4 a0 = uint3x4(1055241304, 859321394, 1088358961, 2090949513, 300561740, 651904515, 1331035868, 2012752753, 1298126656, 53199569, 1752363533, 1303061302); + uint3x4 b0 = uint3x4(749698416, 748105424, 1842764797, 9990577, 1989102105, 1666634755, 58116798, 868036607, 1420638875, 1308767169, 564040763, 478617502); + uint3x4 r0 = uint3x4(749024336, 537928720, 1087769137, 8409473, 277479432, 575816707, 55888540, 867707761, 1141707264, 33686209, 538087433, 209912598); + TestUtils.AreEqual(r0, a0 & b0); + + uint3x4 a1 = uint3x4(1929998247, 1504941434, 470682792, 713577376, 1493231658, 1340884669, 1577921467, 44846626, 1105094388, 1143008413, 333009589, 2116296009); + uint3x4 b1 = uint3x4(806150474, 674015378, 1505309955, 36064977, 1779639327, 808650076, 1634437037, 1997568501, 1930853951, 1901503461, 1508772523, 2010961769); + uint3x4 r1 = uint3x4(805855490, 136347666, 403178496, 33571456, 1207967754, 2098204, 1074332585, 33572896, 1091986996, 1073782917, 298320545, 1979979081); + TestUtils.AreEqual(r1, a1 & b1); + + uint3x4 a2 = uint3x4(2067254825, 121795325, 2122365250, 1088796653, 1594120761, 965590824, 337823363, 1686791432, 1275524729, 173403097, 864715776, 1437598787); + uint3x4 b2 = uint3x4(1495957269, 1914669725, 1263994006, 491200541, 380703892, 282208487, 1416934135, 942735432, 615839538, 1698880188, 1204102677, 1811173266); + uint3x4 r2 = uint3x4(1495420417, 33686173, 1241513986, 4530189, 369102864, 276834336, 337674883, 536870920, 67434032, 4246168, 58721280, 1102054402); + TestUtils.AreEqual(r2, a2 & b2); + + uint3x4 a3 = uint3x4(1375792249, 203672781, 1568515997, 145607913, 837338112, 754244200, 1383514630, 61183374, 690842674, 1362012962, 668846213, 1659745138); + uint3x4 b3 = uint3x4(203114715, 1968993229, 1549041488, 421225724, 1641463312, 1122209170, 946391298, 229237652, 849684128, 1197217575, 1910121786, 1835643900); + uint3x4 r3 = uint3x4(18521, 67125453, 1549018896, 134825192, 566264832, 14714880, 274776066, 27361668, 539304992, 1091306274, 567803904, 1617539952); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void uint3x4_operator_bitwise_and_wide_scalar() + { + uint3x4 a0 = uint3x4(1513158868, 284695609, 734595037, 1566510707, 1601252476, 84213838, 314333543, 430856908, 753481263, 327392481, 1619794917, 2143619546); + uint b0 = (1173647397); + uint3x4 r0 = uint3x4(1076916228, 15732769, 29360133, 1163132961, 1164976164, 84148228, 11816997, 27545604, 81801253, 25169953, 1082396709, 1170472960); + TestUtils.AreEqual(r0, a0 & b0); + + uint3x4 a1 = uint3x4(1873208293, 651482651, 1383096952, 1689107088, 1368301071, 366962092, 1729929586, 989550739, 1914435619, 1592791064, 2047510829, 678485991); + uint b1 = (126982769); + uint3x4 r1 = uint3x4(125862497, 110137873, 34603632, 75602448, 25205249, 93388832, 118521968, 43063313, 34707489, 110104592, 33589281, 1088097); + TestUtils.AreEqual(r1, a1 & b1); + + uint3x4 a2 = uint3x4(586400261, 309059606, 131945492, 1707451796, 394184188, 1943201012, 558008097, 1070093422, 34324916, 258102213, 1800249857, 922911179); + uint b2 = (771972179); + uint3x4 r2 = uint3x4(570638337, 33767442, 100750352, 604046352, 100811856, 570573904, 537003009, 771773506, 33767440, 235032641, 704708609, 637665347); + TestUtils.AreEqual(r2, a2 & b2); + + uint3x4 a3 = uint3x4(1719705954, 1162961184, 851638827, 889902874, 1622363409, 785352441, 1741477119, 452211039, 1144654389, 641588835, 1574197624, 568430284); + uint b3 = (609219265); + uint3x4 r3 = uint3x4(604020800, 71393280, 541258241, 604688896, 537083905, 609190593, 609013953, 4468801, 67764737, 604885569, 71585856, 541164224); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void uint3x4_operator_bitwise_and_scalar_wide() + { + uint a0 = (477163326); + uint3x4 b0 = uint3x4(110453385, 703240362, 2075630560, 1884904031, 1734899436, 947945203, 1664399051, 458879298, 158491426, 79772356, 2054527944, 202228212); + uint3x4 r0 = uint3x4(68182536, 140544042, 405834528, 273697310, 73426476, 402681394, 3188234, 407953666, 141583138, 71313924, 410028808, 201376052); + TestUtils.AreEqual(r0, a0 & b0); + + uint a1 = (359225061); + uint3x4 b1 = uint3x4(639811396, 1821945318, 1821303024, 2030124055, 1985961756, 579780373, 2061831301, 1139618293, 1145191868, 1121606282, 1414714065, 688688277); + uint3x4 r1 = uint3x4(69211716, 67634404, 67649760, 285283333, 340350468, 529925, 274793605, 23662821, 71308452, 4739712, 339759809, 17302661); + TestUtils.AreEqual(r1, a1 & b1); + + uint a2 = (1508875606); + uint3x4 b2 = uint3x4(664318814, 2092766410, 1010043618, 599967779, 47076367, 1325716015, 1119912335, 2083412385, 1805692137, 1689798540, 265665838, 1616867488); + uint3x4 r2 = uint3x4(25727318, 1487737922, 405014594, 29526018, 13505542, 1225035782, 1086357766, 1479416064, 1235258432, 1084753156, 163945734, 1078923264); + TestUtils.AreEqual(r2, a2 & b2); + + uint a3 = (244288538); + uint3x4 b3 = uint3x4(688929004, 1157047188, 1381359113, 1562107079, 944933664, 1994959125, 1413414673, 1280114143, 1373827711, 1107998701, 890185579, 195053206); + uint3x4 r3 = uint3x4(134219784, 75956240, 33917960, 202083330, 134383616, 109611024, 68062224, 202148890, 8552474, 34243592, 68092938, 176161810); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void uint3x4_operator_bitwise_or_wide_wide() + { + uint3x4 a0 = uint3x4(1920951869, 1750772852, 1420019191, 732977093, 1169579447, 229437930, 1966721348, 2039812323, 113550869, 1912038362, 1569990624, 1490718227); + uint3x4 b0 = uint3x4(214585254, 275414367, 858759675, 190211455, 1218691723, 2129565457, 1862809466, 495728846, 868064152, 1756913766, 933656055, 247722084); + uint3x4 r0 = uint3x4(2130669503, 2021326207, 2008016383, 737572863, 1303895999, 2146367483, 2134507390, 2107455727, 939376541, 2046780414, 2142664695, 1591475831); + TestUtils.AreEqual(r0, a0 | b0); + + uint3x4 a1 = uint3x4(1686257697, 2137727522, 1569900650, 856504729, 2033376384, 2086259889, 671790684, 1189001916, 1756048437, 417084592, 2024165808, 966008272); + uint3x4 b1 = uint3x4(1884195075, 1804207631, 1913174711, 1815920856, 1226577606, 1696467642, 186912044, 1778908130, 1461256625, 1142152181, 272117331, 1162254035); + uint3x4 r1 = uint3x4(1959708963, 2146117167, 2140863231, 2134768089, 2034163398, 2103430843, 724483964, 1860172798, 2142973365, 1558183925, 2025750515, 2111217619); + TestUtils.AreEqual(r1, a1 | b1); + + uint3x4 a2 = uint3x4(2031026290, 1461019191, 1071959084, 1645847295, 871350674, 736640317, 868515800, 767794452, 362186994, 96189073, 1924033224, 1971421809); + uint3x4 b2 = uint3x4(870448102, 1845053992, 257334526, 987295814, 1503050768, 1683307763, 1076253109, 1403888383, 561000721, 740143742, 343344681, 2074122472); + uint3x4 r2 = uint3x4(2079325174, 2147314239, 1073143038, 2061103871, 2080374162, 1878867455, 1944485885, 2146418687, 905361907, 767539967, 1996451561, 2141297401); + TestUtils.AreEqual(r2, a2 | b2); + + uint3x4 a3 = uint3x4(1826545883, 865329, 516571463, 371039923, 918186803, 1920664988, 452155520, 743961772, 1728213958, 825116968, 1597755374, 910392330); + uint3x4 b3 = uint3x4(133130232, 108733999, 348566046, 1414140366, 975473487, 699452548, 1158934384, 1776041858, 1098964075, 1316223563, 1653177800, 679795328); + uint3x4 r3 = uint3x4(1879042043, 109000255, 516879199, 1449107455, 1052699519, 2080099740, 1609826288, 1843396526, 1736638447, 2139093867, 2143027182, 1053294218); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void uint3x4_operator_bitwise_or_wide_scalar() + { + uint3x4 a0 = uint3x4(1295304853, 1307252624, 350194630, 1128063578, 1774824542, 2085245467, 1988423804, 999162350, 2110327307, 1050875188, 341855232, 1317039676); + uint b0 = (1305527136); + uint3x4 r0 = uint3x4(1307888629, 1308350448, 1574947814, 1341973370, 1842999166, 2111492987, 2144662396, 2145305582, 2111425387, 2146686836, 1576062816, 1339092860); + TestUtils.AreEqual(r0, a0 | b0); + + uint3x4 a1 = uint3x4(228656898, 1536908787, 606786773, 1739461580, 2040936581, 1350320187, 1377874553, 1522262112, 1496806239, 1732466858, 1535976093, 375675620); + uint b1 = (41280811); + uint3x4 r1 = uint3x4(267773739, 1543503355, 645920255, 1744828399, 2079849903, 1383982395, 1383462779, 1526719851, 1534588799, 1735916971, 1543366591, 376831983); + TestUtils.AreEqual(r1, a1 | b1); + + uint3x4 a2 = uint3x4(1614193383, 697385997, 112556963, 1614163749, 1583289054, 1370656810, 1286074530, 1155438844, 1835671387, 440002979, 1569359727, 5393691); + uint b2 = (226059393); + uint3x4 r2 = uint3x4(1837098727, 771318925, 268271523, 1837068197, 1602189023, 1576793259, 1308619939, 1308622077, 1836810203, 528084387, 1576789999, 226192795); + TestUtils.AreEqual(r2, a2 | b2); + + uint3x4 a3 = uint3x4(774282482, 212144562, 1525899482, 463019249, 1531812233, 1944160603, 953179348, 1692078056, 1331652826, 183129856, 1305664018, 626899632); + uint b3 = (1217128427); + uint3x4 r3 = uint3x4(1857028091, 1286600699, 1526458363, 1536950267, 1540358123, 2079059963, 2027683839, 1826353131, 1340076027, 1256978411, 1306263547, 1843396603); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void uint3x4_operator_bitwise_or_scalar_wide() + { + uint a0 = (1768627592); + uint3x4 b0 = uint3x4(1849658052, 1759912154, 729979455, 975926310, 1987690876, 1809506714, 1160695341, 408963395, 314072711, 1560007537, 1709003416, 977086639); + uint3x4 r0 = uint3x4(1870634956, 1777286618, 1810603967, 2070642094, 2138824188, 1811676570, 1836048301, 2037079499, 2080071567, 2113658873, 1845452696, 2071936431); + TestUtils.AreEqual(r0, a0 | b0); + + uint a1 = (1448375596); + uint3x4 b1 = uint3x4(1689568808, 595543345, 559778387, 621080913, 438994183, 1742637145, 1219409263, 1602932494, 1204461702, 2111538444, 836730895, 1207638621); + uint3x4 r1 = uint3x4(1995765548, 2004841789, 2002648959, 2002056573, 1585378607, 2011102589, 1593767279, 1608449838, 1474229678, 2145383724, 2011165999, 1476362109); + TestUtils.AreEqual(r1, a1 | b1); + + uint a2 = (802100209); + uint3x4 b2 = uint3x4(1089077339, 1315030334, 249047666, 1604790897, 1848168086, 347254235, 1777613639, 1876731927, 842785732, 1023558747, 1567635900, 1888818835); + uint3x4 r2 = uint3x4(1877939195, 1877989375, 803159027, 2146384881, 1877991415, 1073725435, 1878998007, 1876933623, 1073738741, 1070553083, 2147433469, 2145327091); + TestUtils.AreEqual(r2, a2 | b2); + + uint a3 = (1681286114); + uint3x4 b3 = uint3x4(816160472, 669874393, 856364582, 957707703, 533888601, 707380794, 1472392035, 1658477097, 490006292, 1104319323, 1803275943, 1843251082); + uint3x4 r3 = uint3x4(1958215674, 1744796667, 2000648166, 2100787191, 2146861051, 1849681914, 2012670947, 1727953899, 2100750326, 1710683131, 1870655463, 1845487594); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void uint3x4_operator_bitwise_xor_wide_wide() + { + uint3x4 a0 = uint3x4(1843655608, 362425681, 640805534, 1342040268, 945678755, 980321850, 390165019, 1682422658, 303897251, 230477768, 1103646442, 1503102919); + uint3x4 b0 = uint3x4(1422803441, 1234691140, 119589253, 1101464929, 121896337, 1880109018, 1000210266, 1718938232, 464406940, 884337881, 34199854, 1430659227); + uint3x4 r0 = uint3x4(959296073, 1544407317, 554771227, 240840109, 1058935858, 1249815008, 752651585, 36917754, 162747199, 956900113, 1136760772, 215066460); + TestUtils.AreEqual(r0, a0 ^ b0); + + uint3x4 a1 = uint3x4(26631152, 1016475570, 1862440929, 379588576, 1943580404, 691527166, 723280696, 497086939, 1640104913, 893178410, 1596765788, 664096470); + uint3x4 b1 = uint3x4(126415540, 1069919967, 1810763253, 2082802224, 941097951, 27782297, 156353074, 607061607, 470737131, 1151564598, 8268481, 434405645); + uint3x4 r1 = uint3x4(102672708, 55804269, 82614804, 1787102672, 1270918443, 680538471, 575512842, 965736380, 2110579514, 1906288924, 1599249565, 1047646171); + TestUtils.AreEqual(r1, a1 ^ b1); + + uint3x4 a2 = uint3x4(2043360590, 799560121, 287637604, 696169196, 2067184169, 1208059988, 1250597330, 1386507647, 1889791408, 2084012261, 308683100, 995657536); + uint3x4 b2 = uint3x4(519003095, 1880915120, 608970922, 1809455754, 1079250101, 514389994, 272120301, 1282399149, 1045003273, 1596550715, 1654640361, 147544177); + uint3x4 r2 = uint3x4(1730440857, 1605643529, 896084174, 1118087270, 996325020, 1453948862, 1521655871, 516667090, 1323995577, 589229790, 1895428021, 865328945); + TestUtils.AreEqual(r2, a2 ^ b2); + + uint3x4 a3 = uint3x4(2114803648, 1391716615, 1288505091, 1981377086, 1609802717, 1174043024, 1011203132, 1795164620, 244928755, 108081775, 1095776733, 1503947924); + uint3x4 b3 = uint3x4(1770899808, 632909311, 351538321, 18362671, 582069925, 1343437834, 646157103, 1334609482, 1029555059, 1791514242, 2130180592, 1367984612); + uint3x4 r3 = uint3x4(394305184, 2001372408, 1480133522, 1996577553, 2101480824, 367609242, 449195795, 613191558, 868520832, 1824089325, 1067958317, 137209200); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void uint3x4_operator_bitwise_xor_wide_scalar() + { + uint3x4 a0 = uint3x4(169345668, 176087064, 2084362901, 1663924004, 193851255, 517476661, 905336222, 863800783, 365003873, 835837496, 954341348, 1464576786); + uint b0 = (354464228); + uint3x4 r0 = uint3x4(523809632, 526275068, 1763470193, 1980614336, 514678419, 200843473, 550954106, 643578923, 14759301, 619802588, 767731200, 1114315510); + TestUtils.AreEqual(r0, a0 ^ b0); + + uint3x4 a1 = uint3x4(625604047, 2003392824, 1481813598, 1077374714, 1043379893, 1991576049, 781860967, 60088394, 1196907956, 858716109, 858484213, 178843494); + uint b1 = (1700827127); + uint3x4 r1 = uint3x4(1076460088, 302634703, 1026695593, 626516237, 1531984194, 332760582, 1274728336, 1727295421, 574083651, 1447983162, 1447813634, 1875402897); + TestUtils.AreEqual(r1, a1 ^ b1); + + uint3x4 a2 = uint3x4(1223183458, 1771693181, 1206307664, 2037729583, 1324393116, 497725784, 1367278685, 962962860, 906632547, 1570278596, 1744797352, 574677361); + uint b2 = (866652388); + uint3x4 r2 = uint3x4(2067815558, 1513223321, 1951325108, 1256020427, 2102964856, 771924412, 1658262713, 181253448, 94506375, 1848679456, 1415016012, 300478869); + TestUtils.AreEqual(r2, a2 ^ b2); + + uint3x4 a3 = uint3x4(1363709514, 801937870, 1010182360, 1851940033, 346084804, 1153678862, 443991213, 53881334, 2016754499, 1219039118, 98879165, 1431003548); + uint b3 = (1256194849); + uint3x4 r3 = uint3x4(464031083, 1697422063, 1993747449, 612524000, 1581307621, 237223215, 1352058764, 1238772439, 852834402, 38341807, 1325712796, 531325629); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void uint3x4_operator_bitwise_xor_scalar_wide() + { + uint a0 = (1361775641); + uint3x4 b0 = uint3x4(1452773578, 459050892, 1986218254, 1689037698, 999278344, 1229114508, 1087843538, 733699740, 106187872, 1533632738, 1107817672, 492506236); + uint3x4 r0 = uint3x4(129801427, 1249346453, 659047703, 898082715, 1789184785, 409583765, 301736139, 2056278661, 1467957369, 172125435, 321714385, 1282408549); + TestUtils.AreEqual(r0, a0 ^ b0); + + uint a1 = (597602329); + uint3x4 b1 = uint3x4(1439603382, 1001169118, 1231718216, 1693179077, 1050897427, 1796435561, 1100532547, 2106589181, 79691722, 851486414, 381749210, 1743618507); + uint3x4 r1 = uint3x4(1984965295, 405934279, 1794389841, 1198877916, 490593290, 1217257072, 1644591962, 1578192868, 656494547, 291378903, 895465411, 1148400082); + TestUtils.AreEqual(r1, a1 ^ b1); + + uint a2 = (2038827673); + uint3x4 b2 = uint3x4(1680906962, 161437943, 171927307, 277703584, 1344718195, 1634011177, 28540247, 1205447252, 150341716, 899457210, 1927941858, 1213321665); + uint3x4 r2 = uint3x4(498503755, 1880707694, 1941532050, 1762353465, 698404842, 417530544, 2016769998, 1046454477, 1903166157, 1276815907, 191628411, 836229976); + TestUtils.AreEqual(r2, a2 ^ b2); + + uint a3 = (1943899052); + uint3x4 b3 = uint3x4(1166699955, 244059986, 698605361, 770240668, 1451322609, 409403288, 227252138, 455879262, 1859170556, 2135312326, 436746325, 843204844); + uint3x4 r3 = uint3x4(911730207, 2102494462, 1518228637, 1580563248, 626845533, 1807447092, 2119572486, 1760666098, 487406416, 211537002, 1775612921, 1100989248); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void uint3x4_operator_left_shift() + { + uint3x4 a0 = uint3x4(1129100049, 829482269, 1571297368, 443753193, 1872142968, 249554593, 892627436, 980302862, 62369727, 849916599, 1271350845, 108441902); + int b0 = (218351941); + uint3x4 r0 = uint3x4(1771463200, 773628832, 3036875520, 1315200288, 4074000128, 3690779680, 2794274176, 1304920512, 1995831264, 1427527392, 2028521376, 3470140864); + TestUtils.AreEqual(r0, a0 << b0); + + uint3x4 a1 = uint3x4(1959056531, 1451674188, 2082026915, 1149883636, 1380536034, 186532735, 1487486874, 1498738574, 752067504, 1647167336, 772453640, 456967739); + int b1 = (1779118882); + uint3x4 r1 = uint3x4(3541258828, 1511729456, 4033140364, 304567248, 1227176840, 746130940, 1654980200, 1699987000, 3008270016, 2293702048, 3089814560, 1827870956); + TestUtils.AreEqual(r1, a1 << b1); + + uint3x4 a2 = uint3x4(947384545, 1315516161, 640579158, 56630178, 1650899378, 2142944517, 565484033, 965161323, 1634169280, 1821547426, 1959741996, 1189216014); + int b2 = (1463252873); + uint3x4 r2 = uint3x4(4024549888, 3529376256, 1559014400, 3224847360, 3446891520, 1970932224, 1765016064, 241358336, 3471015936, 624378880, 2660521984, 3288210432); + TestUtils.AreEqual(r2, a2 << b2); + + uint3x4 a3 = uint3x4(2088913234, 1765476869, 1716088059, 2042799042, 1560870407, 1332136179, 1595140080, 1067324801, 948699739, 1516035622, 1153563832, 1430593538); + int b3 = (331636352); + uint3x4 r3 = uint3x4(2088913234, 1765476869, 1716088059, 2042799042, 1560870407, 1332136179, 1595140080, 1067324801, 948699739, 1516035622, 1153563832, 1430593538); + TestUtils.AreEqual(r3, a3 << b3); + } + + [TestCompiler] + public static void uint3x4_operator_right_shift() + { + uint3x4 a0 = uint3x4(809126085, 908563670, 763568837, 1986717290, 1174507510, 646821842, 1242726074, 390811632, 1521420393, 1923166649, 102096936, 400863878); + int b0 = (994800051); + uint3x4 r0 = uint3x4(1543, 1732, 1456, 3789, 2240, 1233, 2370, 745, 2901, 3668, 194, 764); + TestUtils.AreEqual(r0, a0 >> b0); + + uint3x4 a1 = uint3x4(667378673, 307750782, 479442287, 2014389412, 1673938174, 1075916177, 1248577253, 848199210, 813936577, 848976170, 500930883, 662405800); + int b1 = (1611921244); + uint3x4 r1 = uint3x4(2, 1, 1, 7, 6, 4, 4, 3, 3, 3, 1, 2); + TestUtils.AreEqual(r1, a1 >> b1); + + uint3x4 a2 = uint3x4(126875849, 1199000503, 955487090, 1013356510, 391605984, 185228398, 87452680, 2021602226, 1401766495, 275199908, 664576720, 363706280); + int b2 = (1103917083); + uint3x4 r2 = uint3x4(0, 8, 7, 7, 2, 1, 0, 15, 10, 2, 4, 2); + TestUtils.AreEqual(r2, a2 >> b2); + + uint3x4 a3 = uint3x4(1600231415, 1403250657, 1132760506, 388419548, 1563117590, 1786307084, 1386128491, 1614558171, 370772389, 47213745, 1348912303, 1452132416); + int b3 = (19835299); + uint3x4 r3 = uint3x4(200028926, 175406332, 141595063, 48552443, 195389698, 223288385, 173266061, 201819771, 46346548, 5901718, 168614037, 181516552); + TestUtils.AreEqual(r3, a3 >> b3); + } + + [TestCompiler] + public static void uint3x4_operator_bitwise_not() + { + uint3x4 a0 = uint3x4(111796841, 603562399, 745091931, 853183268, 1110916612, 381888399, 1891338755, 1506860135, 771210628, 787710759, 875964607, 96456785); + uint3x4 r0 = uint3x4(4183170454, 3691404896, 3549875364, 3441784027, 3184050683, 3913078896, 2403628540, 2788107160, 3523756667, 3507256536, 3419002688, 4198510510); + TestUtils.AreEqual(r0, ~a0); + + uint3x4 a1 = uint3x4(916013379, 1172294211, 1020232736, 683852713, 375158799, 881353367, 1218471344, 1174233245, 592898220, 443427914, 1385118179, 215320517); + uint3x4 r1 = uint3x4(3378953916, 3122673084, 3274734559, 3611114582, 3919808496, 3413613928, 3076495951, 3120734050, 3702069075, 3851539381, 2909849116, 4079646778); + TestUtils.AreEqual(r1, ~a1); + + uint3x4 a2 = uint3x4(860122767, 1349739899, 686325107, 829984855, 191189901, 319233142, 156019905, 1467719681, 1193642973, 957020051, 610113447, 1906177458); + uint3x4 r2 = uint3x4(3434844528, 2945227396, 3608642188, 3464982440, 4103777394, 3975734153, 4138947390, 2827247614, 3101324322, 3337947244, 3684853848, 2388789837); + TestUtils.AreEqual(r2, ~a2); + + uint3x4 a3 = uint3x4(1022824453, 1876376887, 479785538, 1454477141, 1062967600, 864049393, 916152339, 1644897753, 1624633488, 210894078, 759733457, 40062168); + uint3x4 r3 = uint3x4(3272142842, 2418590408, 3815181757, 2840490154, 3231999695, 3430917902, 3378814956, 2650069542, 2670333807, 4084073217, 3535233838, 4254905127); + TestUtils.AreEqual(r3, ~a3); + } + + [TestCase /* For player builds */] + public static void uint3x4_EqualsObjectOverride() + { + TestUtils.IsFalse(new uint3x4().Equals((object)new int())); + TestUtils.IsTrue(new uint3x4().Equals((object)new uint3x4())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestUint3x4.gen.cs.meta b/src/Tests/Tests/Shared/TestUint3x4.gen.cs.meta new file mode 100644 index 00000000..be725d5e --- /dev/null +++ b/src/Tests/Tests/Shared/TestUint3x4.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f4c3a82cd7a932a4a97b7432498a1d53 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestUint4.gen.cs b/src/Tests/Tests/Shared/TestUint4.gen.cs new file mode 100644 index 00000000..8d0b8a6b --- /dev/null +++ b/src/Tests/Tests/Shared/TestUint4.gen.cs @@ -0,0 +1,1360 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestUint4 + { + [TestCompiler] + public static void uint4_zero() + { + TestUtils.AreEqual(0u, uint4.zero.x); + TestUtils.AreEqual(0u, uint4.zero.y); + TestUtils.AreEqual(0u, uint4.zero.z); + TestUtils.AreEqual(0u, uint4.zero.w); + } + + [TestCompiler] + public static void uint4_constructor() + { + uint4 a = new uint4(1, 2, 3, 4); + TestUtils.AreEqual(1, a.x); + TestUtils.AreEqual(2, a.y); + TestUtils.AreEqual(3, a.z); + TestUtils.AreEqual(4, a.w); + } + + [TestCompiler] + public static void uint4_scalar_constructor() + { + uint4 a = new uint4(17u); + TestUtils.AreEqual(17u, a.x); + TestUtils.AreEqual(17u, a.y); + TestUtils.AreEqual(17u, a.z); + TestUtils.AreEqual(17u, a.w); + } + + [TestCompiler] + public static void uint4_static_constructor() + { + uint4 a = uint4(1, 2, 3, 4); + TestUtils.AreEqual(1, a.x); + TestUtils.AreEqual(2, a.y); + TestUtils.AreEqual(3, a.z); + TestUtils.AreEqual(4, a.w); + } + + [TestCompiler] + public static void uint4_static_scalar_constructor() + { + uint4 a = uint4(17u); + TestUtils.AreEqual(17u, a.x); + TestUtils.AreEqual(17u, a.y); + TestUtils.AreEqual(17u, a.z); + TestUtils.AreEqual(17u, a.w); + } + + [TestCompiler] + public static void uint4_operator_equal_wide_wide() + { + uint4 a0 = uint4(2105871082, 35218899, 1550755093, 764676020); + uint4 b0 = uint4(1477587886, 579629692, 540974792, 208405066); + bool4 r0 = bool4(false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + uint4 a1 = uint4(606743782, 1208156098, 1023640014, 1038468316); + uint4 b1 = uint4(2063397938, 1060167409, 362592601, 2097545362); + bool4 r1 = bool4(false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + uint4 a2 = uint4(1416064367, 727143393, 2061243891, 184669837); + uint4 b2 = uint4(277670088, 426944490, 901076223, 857900673); + bool4 r2 = bool4(false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + uint4 a3 = uint4(1303661760, 2044073738, 370395888, 1822916805); + uint4 b3 = uint4(1548779757, 325265488, 312658571, 176373760); + bool4 r3 = bool4(false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void uint4_operator_equal_wide_scalar() + { + uint4 a0 = uint4(437822262, 2020661134, 541786900, 853113810); + uint b0 = (1332833578); + bool4 r0 = bool4(false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + uint4 a1 = uint4(23716499, 1409026299, 948838849, 953202998); + uint b1 = (179951405); + bool4 r1 = bool4(false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + uint4 a2 = uint4(691955848, 1851546137, 712957637, 2028784869); + uint b2 = (1926262965); + bool4 r2 = bool4(false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + uint4 a3 = uint4(1049962241, 1016802970, 390120467, 464814777); + uint b3 = (1836975611); + bool4 r3 = bool4(false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void uint4_operator_equal_scalar_wide() + { + uint a0 = (542329200); + uint4 b0 = uint4(1115584594, 684107773, 1928988941, 890709324); + bool4 r0 = bool4(false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + uint a1 = (641152437); + uint4 b1 = uint4(1410341302, 497505660, 1068223109, 2014009435); + bool4 r1 = bool4(false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + uint a2 = (213835595); + uint4 b2 = uint4(1592428361, 1819361470, 448650623, 1942175642); + bool4 r2 = bool4(false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + uint a3 = (64377057); + uint4 b3 = uint4(1485938610, 1146305380, 1312317120, 263290348); + bool4 r3 = bool4(false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void uint4_operator_not_equal_wide_wide() + { + uint4 a0 = uint4(1977284100, 1293292704, 1547283851, 422428953); + uint4 b0 = uint4(1514195556, 957972049, 507667364, 581861672); + bool4 r0 = bool4(true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + uint4 a1 = uint4(195833190, 1711544892, 5606053, 737069074); + uint4 b1 = uint4(1128094576, 940096636, 57559040, 181752616); + bool4 r1 = bool4(true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + uint4 a2 = uint4(647386678, 13079405, 1413841590, 1076166545); + uint4 b2 = uint4(962017320, 1762015406, 1107218953, 2042026522); + bool4 r2 = bool4(true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + uint4 a3 = uint4(1211445174, 1289303469, 1436402489, 1129570126); + uint4 b3 = uint4(836002288, 570272309, 2112081980, 1500634658); + bool4 r3 = bool4(true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void uint4_operator_not_equal_wide_scalar() + { + uint4 a0 = uint4(1038269360, 1427812625, 103361237, 1347017023); + uint b0 = (768873026); + bool4 r0 = bool4(true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + uint4 a1 = uint4(1523584313, 660334527, 719113717, 262959423); + uint b1 = (150442802); + bool4 r1 = bool4(true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + uint4 a2 = uint4(484398043, 226568494, 507918242, 1702162286); + uint b2 = (506946952); + bool4 r2 = bool4(true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + uint4 a3 = uint4(923269270, 114581840, 1045389187, 1648095254); + uint b3 = (166187260); + bool4 r3 = bool4(true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void uint4_operator_not_equal_scalar_wide() + { + uint a0 = (1652127596); + uint4 b0 = uint4(953791238, 271722683, 1278885987, 735128017); + bool4 r0 = bool4(true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + uint a1 = (112416504); + uint4 b1 = uint4(25967222, 1761444475, 1844594536, 1199122922); + bool4 r1 = bool4(true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + uint a2 = (634219279); + uint4 b2 = uint4(942501101, 67161343, 969944293, 833229499); + bool4 r2 = bool4(true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + uint a3 = (1304301133); + uint4 b3 = uint4(704045745, 345012334, 1253134152, 325772538); + bool4 r3 = bool4(true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void uint4_operator_less_wide_wide() + { + uint4 a0 = uint4(1486550609, 1779244308, 1602148045, 1614085440); + uint4 b0 = uint4(97842578, 536551311, 413528975, 1838293684); + bool4 r0 = bool4(false, false, false, true); + TestUtils.AreEqual(r0, a0 < b0); + + uint4 a1 = uint4(1975613414, 942838342, 1092279031, 373677431); + uint4 b1 = uint4(1283898480, 1456599961, 1080278602, 529676676); + bool4 r1 = bool4(false, true, false, true); + TestUtils.AreEqual(r1, a1 < b1); + + uint4 a2 = uint4(1419098312, 337757077, 1081797900, 1336745069); + uint4 b2 = uint4(156584048, 117348799, 246927124, 1916615924); + bool4 r2 = bool4(false, false, false, true); + TestUtils.AreEqual(r2, a2 < b2); + + uint4 a3 = uint4(840685445, 1220554047, 2013681746, 192965012); + uint4 b3 = uint4(1731071394, 1328098431, 1014995792, 480319327); + bool4 r3 = bool4(true, true, false, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void uint4_operator_less_wide_scalar() + { + uint4 a0 = uint4(796797557, 670113454, 933579492, 278884514); + uint b0 = (746564682); + bool4 r0 = bool4(false, true, false, true); + TestUtils.AreEqual(r0, a0 < b0); + + uint4 a1 = uint4(318174822, 741886928, 1990922600, 1030849597); + uint b1 = (1117630673); + bool4 r1 = bool4(true, true, false, true); + TestUtils.AreEqual(r1, a1 < b1); + + uint4 a2 = uint4(1546212312, 1648393417, 1857132231, 1909506562); + uint b2 = (1718582899); + bool4 r2 = bool4(true, true, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + uint4 a3 = uint4(1294006045, 1303736668, 845460171, 979430272); + uint b3 = (952084157); + bool4 r3 = bool4(false, false, true, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void uint4_operator_less_scalar_wide() + { + uint a0 = (186400299); + uint4 b0 = uint4(1881344229, 813834467, 1254886626, 1353590345); + bool4 r0 = bool4(true, true, true, true); + TestUtils.AreEqual(r0, a0 < b0); + + uint a1 = (1412343685); + uint4 b1 = uint4(1555571443, 1540508298, 1735458634, 135888070); + bool4 r1 = bool4(true, true, true, false); + TestUtils.AreEqual(r1, a1 < b1); + + uint a2 = (1643818742); + uint4 b2 = uint4(248291654, 1739560105, 728539891, 480507742); + bool4 r2 = bool4(false, true, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + uint a3 = (1696553040); + uint4 b3 = uint4(540223931, 1840493353, 146833656, 798115946); + bool4 r3 = bool4(false, true, false, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void uint4_operator_greater_wide_wide() + { + uint4 a0 = uint4(2087717754, 1725569452, 1298066182, 1693943616); + uint4 b0 = uint4(85148514, 293632137, 1151128249, 409440398); + bool4 r0 = bool4(true, true, true, true); + TestUtils.AreEqual(r0, a0 > b0); + + uint4 a1 = uint4(1319019629, 70674491, 1042499725, 1002821508); + uint4 b1 = uint4(1115020183, 1508500597, 1834583302, 1755218534); + bool4 r1 = bool4(true, false, false, false); + TestUtils.AreEqual(r1, a1 > b1); + + uint4 a2 = uint4(1021857133, 1744374599, 821751047, 467646903); + uint4 b2 = uint4(1788761753, 1128238489, 834223713, 1578743290); + bool4 r2 = bool4(false, true, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + uint4 a3 = uint4(2029731638, 1377214212, 1207816926, 474621063); + uint4 b3 = uint4(1647150256, 1756397855, 1131080201, 1208965204); + bool4 r3 = bool4(true, false, true, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void uint4_operator_greater_wide_scalar() + { + uint4 a0 = uint4(1208626274, 239697208, 1979453345, 1253474001); + uint b0 = (1715176566); + bool4 r0 = bool4(false, false, true, false); + TestUtils.AreEqual(r0, a0 > b0); + + uint4 a1 = uint4(1590192876, 1673945595, 1662650098, 222749855); + uint b1 = (1487911635); + bool4 r1 = bool4(true, true, true, false); + TestUtils.AreEqual(r1, a1 > b1); + + uint4 a2 = uint4(1433540517, 1773305960, 1850273578, 206147145); + uint b2 = (566635217); + bool4 r2 = bool4(true, true, true, false); + TestUtils.AreEqual(r2, a2 > b2); + + uint4 a3 = uint4(325913453, 1905567362, 2053577491, 570397194); + uint b3 = (333381537); + bool4 r3 = bool4(false, true, true, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void uint4_operator_greater_scalar_wide() + { + uint a0 = (480938827); + uint4 b0 = uint4(1824731899, 921496110, 586859044, 946430596); + bool4 r0 = bool4(false, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + uint a1 = (1231356727); + uint4 b1 = uint4(1390167458, 1785807092, 28949024, 2037899283); + bool4 r1 = bool4(false, false, true, false); + TestUtils.AreEqual(r1, a1 > b1); + + uint a2 = (595656760); + uint4 b2 = uint4(1778095771, 1233500439, 1696302238, 1445965340); + bool4 r2 = bool4(false, false, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + uint a3 = (484020151); + uint4 b3 = uint4(1586962841, 1361740714, 265628948, 2003122957); + bool4 r3 = bool4(false, false, true, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void uint4_operator_less_equal_wide_wide() + { + uint4 a0 = uint4(154092149, 1515170149, 1083970332, 785807178); + uint4 b0 = uint4(77984380, 1712054191, 1566203809, 254834519); + bool4 r0 = bool4(false, true, true, false); + TestUtils.AreEqual(r0, a0 <= b0); + + uint4 a1 = uint4(1401094881, 310537627, 868328962, 1990816725); + uint4 b1 = uint4(450519938, 389457083, 1298669505, 207343167); + bool4 r1 = bool4(false, true, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + uint4 a2 = uint4(2035349541, 457043352, 1123282035, 1001842946); + uint4 b2 = uint4(1214449047, 2059561026, 896534357, 1897470050); + bool4 r2 = bool4(false, true, false, true); + TestUtils.AreEqual(r2, a2 <= b2); + + uint4 a3 = uint4(1387761992, 195272789, 659549000, 888761458); + uint4 b3 = uint4(521075677, 1848221945, 374708019, 1573731118); + bool4 r3 = bool4(false, true, false, true); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void uint4_operator_less_equal_wide_scalar() + { + uint4 a0 = uint4(1479531977, 1427983411, 415250630, 1245345407); + uint b0 = (2004563877); + bool4 r0 = bool4(true, true, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + uint4 a1 = uint4(1112546666, 1579912858, 101048307, 1070894375); + uint b1 = (1072990632); + bool4 r1 = bool4(false, false, true, true); + TestUtils.AreEqual(r1, a1 <= b1); + + uint4 a2 = uint4(509818792, 85452501, 518127023, 1246249980); + uint b2 = (1910488590); + bool4 r2 = bool4(true, true, true, true); + TestUtils.AreEqual(r2, a2 <= b2); + + uint4 a3 = uint4(1097326500, 1968139888, 1191853379, 662096238); + uint b3 = (1964410699); + bool4 r3 = bool4(true, false, true, true); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void uint4_operator_less_equal_scalar_wide() + { + uint a0 = (1899193992); + uint4 b0 = uint4(915011820, 980913757, 1337699683, 1476321359); + bool4 r0 = bool4(false, false, false, false); + TestUtils.AreEqual(r0, a0 <= b0); + + uint a1 = (1102143668); + uint4 b1 = uint4(660493983, 184664508, 381579707, 1954892821); + bool4 r1 = bool4(false, false, false, true); + TestUtils.AreEqual(r1, a1 <= b1); + + uint a2 = (1295090571); + uint4 b2 = uint4(1440368586, 1696003686, 88708652, 1332251857); + bool4 r2 = bool4(true, true, false, true); + TestUtils.AreEqual(r2, a2 <= b2); + + uint a3 = (1310713644); + uint4 b3 = uint4(2112132784, 48951945, 1888568027, 39340955); + bool4 r3 = bool4(true, false, true, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void uint4_operator_greater_equal_wide_wide() + { + uint4 a0 = uint4(8538378, 2131749726, 265427108, 523609761); + uint4 b0 = uint4(903145828, 1697992986, 1432491982, 169789504); + bool4 r0 = bool4(false, true, false, true); + TestUtils.AreEqual(r0, a0 >= b0); + + uint4 a1 = uint4(994991818, 839709564, 101288202, 1886280970); + uint4 b1 = uint4(1059357300, 1744255222, 1606584463, 1905414425); + bool4 r1 = bool4(false, false, false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + uint4 a2 = uint4(2032074826, 631221455, 1456286159, 961342752); + uint4 b2 = uint4(1448794969, 136181998, 1678754836, 2069656857); + bool4 r2 = bool4(true, true, false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + uint4 a3 = uint4(424526026, 788481984, 1662488497, 870326690); + uint4 b3 = uint4(398982689, 243317404, 740939613, 1894753119); + bool4 r3 = bool4(true, true, true, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void uint4_operator_greater_equal_wide_scalar() + { + uint4 a0 = uint4(2049236663, 182691143, 634973382, 1197012109); + uint b0 = (1061998015); + bool4 r0 = bool4(true, false, false, true); + TestUtils.AreEqual(r0, a0 >= b0); + + uint4 a1 = uint4(439837565, 1108037359, 351147187, 1898505669); + uint b1 = (1367606469); + bool4 r1 = bool4(false, false, false, true); + TestUtils.AreEqual(r1, a1 >= b1); + + uint4 a2 = uint4(411667685, 4652390, 996159180, 2111455181); + uint b2 = (1998610091); + bool4 r2 = bool4(false, false, false, true); + TestUtils.AreEqual(r2, a2 >= b2); + + uint4 a3 = uint4(727766399, 814085575, 1525995206, 1293933760); + uint b3 = (96217144); + bool4 r3 = bool4(true, true, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void uint4_operator_greater_equal_scalar_wide() + { + uint a0 = (1859811087); + uint4 b0 = uint4(1070365918, 1783869452, 830091760, 377157428); + bool4 r0 = bool4(true, true, true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + uint a1 = (327199016); + uint4 b1 = uint4(90384229, 1154649706, 376758501, 1079802834); + bool4 r1 = bool4(true, false, false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + uint a2 = (2054742898); + uint4 b2 = uint4(1328349472, 434061447, 951207723, 598695892); + bool4 r2 = bool4(true, true, true, true); + TestUtils.AreEqual(r2, a2 >= b2); + + uint a3 = (975131651); + uint4 b3 = uint4(1714007943, 177416473, 1267232721, 31082860); + bool4 r3 = bool4(false, true, false, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void uint4_operator_add_wide_wide() + { + uint4 a0 = uint4(2135171378, 21433296, 1954723494, 683604307); + uint4 b0 = uint4(1013431952, 366718162, 359290756, 1393163294); + uint4 r0 = uint4(3148603330, 388151458, 2314014250, 2076767601); + TestUtils.AreEqual(r0, a0 + b0); + + uint4 a1 = uint4(1054212315, 1762680995, 1963655852, 1257853062); + uint4 b1 = uint4(1962236872, 1263270041, 1862666629, 1077447887); + uint4 r1 = uint4(3016449187, 3025951036, 3826322481, 2335300949); + TestUtils.AreEqual(r1, a1 + b1); + + uint4 a2 = uint4(2043493600, 976898058, 1915056423, 121374462); + uint4 b2 = uint4(821693806, 487316539, 350922520, 1583012528); + uint4 r2 = uint4(2865187406, 1464214597, 2265978943, 1704386990); + TestUtils.AreEqual(r2, a2 + b2); + + uint4 a3 = uint4(1218855698, 700538222, 1702057277, 1788251699); + uint4 b3 = uint4(1951595076, 1024851344, 874302782, 1383969588); + uint4 r3 = uint4(3170450774, 1725389566, 2576360059, 3172221287); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void uint4_operator_add_wide_scalar() + { + uint4 a0 = uint4(665815972, 1783729250, 1591678394, 1284528538); + uint b0 = (1334043849); + uint4 r0 = uint4(1999859821, 3117773099, 2925722243, 2618572387); + TestUtils.AreEqual(r0, a0 + b0); + + uint4 a1 = uint4(977850224, 1138577680, 1200356017, 565982008); + uint b1 = (71069732); + uint4 r1 = uint4(1048919956, 1209647412, 1271425749, 637051740); + TestUtils.AreEqual(r1, a1 + b1); + + uint4 a2 = uint4(1246759684, 57252642, 678921480, 625943813); + uint b2 = (1088001167); + uint4 r2 = uint4(2334760851, 1145253809, 1766922647, 1713944980); + TestUtils.AreEqual(r2, a2 + b2); + + uint4 a3 = uint4(512157429, 1490096953, 1467033531, 182608093); + uint b3 = (1470648741); + uint4 r3 = uint4(1982806170, 2960745694, 2937682272, 1653256834); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void uint4_operator_add_scalar_wide() + { + uint a0 = (359966320); + uint4 b0 = uint4(2146146202, 767103309, 851002415, 311531406); + uint4 r0 = uint4(2506112522, 1127069629, 1210968735, 671497726); + TestUtils.AreEqual(r0, a0 + b0); + + uint a1 = (1491262941); + uint4 b1 = uint4(1016891373, 1954228994, 1671335850, 727870747); + uint4 r1 = uint4(2508154314, 3445491935, 3162598791, 2219133688); + TestUtils.AreEqual(r1, a1 + b1); + + uint a2 = (551151834); + uint4 b2 = uint4(1390261152, 1699060326, 115021619, 1964440175); + uint4 r2 = uint4(1941412986, 2250212160, 666173453, 2515592009); + TestUtils.AreEqual(r2, a2 + b2); + + uint a3 = (440700758); + uint4 b3 = uint4(1556692550, 185414255, 933106731, 1217866784); + uint4 r3 = uint4(1997393308, 626115013, 1373807489, 1658567542); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void uint4_operator_sub_wide_wide() + { + uint4 a0 = uint4(1410318491, 1097280168, 1827039044, 28881338); + uint4 b0 = uint4(1315897366, 799052018, 1580289673, 1094686261); + uint4 r0 = uint4(94421125, 298228150, 246749371, 3229162373); + TestUtils.AreEqual(r0, a0 - b0); + + uint4 a1 = uint4(328720965, 875487868, 212936325, 231977215); + uint4 b1 = uint4(1954325726, 1197734816, 229886366, 915679176); + uint4 r1 = uint4(2669362535, 3972720348, 4278017255, 3611265335); + TestUtils.AreEqual(r1, a1 - b1); + + uint4 a2 = uint4(1740021315, 2011295463, 48079003, 591379285); + uint4 b2 = uint4(1746884850, 918743925, 1007797419, 257421324); + uint4 r2 = uint4(4288103761, 1092551538, 3335248880, 333957961); + TestUtils.AreEqual(r2, a2 - b2); + + uint4 a3 = uint4(1125909359, 1842588095, 848561896, 614448464); + uint4 b3 = uint4(287249342, 1617287463, 1653916102, 123586847); + uint4 r3 = uint4(838660017, 225300632, 3489613090, 490861617); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void uint4_operator_sub_wide_scalar() + { + uint4 a0 = uint4(1508669340, 1594795463, 266707545, 643102647); + uint b0 = (998008471); + uint4 r0 = uint4(510660869, 596786992, 3563666370, 3940061472); + TestUtils.AreEqual(r0, a0 - b0); + + uint4 a1 = uint4(287705008, 1113286221, 979450511, 2082174113); + uint b1 = (1475644328); + uint4 r1 = uint4(3107027976, 3932609189, 3798773479, 606529785); + TestUtils.AreEqual(r1, a1 - b1); + + uint4 a2 = uint4(1108005498, 999244508, 1806482044, 1994553647); + uint b2 = (304369206); + uint4 r2 = uint4(803636292, 694875302, 1502112838, 1690184441); + TestUtils.AreEqual(r2, a2 - b2); + + uint4 a3 = uint4(2101812429, 266654115, 1470212363, 1190349300); + uint b3 = (1482736902); + uint4 r3 = uint4(619075527, 3078884509, 4282442757, 4002579694); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void uint4_operator_sub_scalar_wide() + { + uint a0 = (893369501); + uint4 b0 = uint4(2051906184, 1699714311, 442603706, 1735141684); + uint4 r0 = uint4(3136430613, 3488622486, 450765795, 3453195113); + TestUtils.AreEqual(r0, a0 - b0); + + uint a1 = (274533585); + uint4 b1 = uint4(811580259, 1196354320, 1524097023, 533621527); + uint4 r1 = uint4(3757920622, 3373146561, 3045403858, 4035879354); + TestUtils.AreEqual(r1, a1 - b1); + + uint a2 = (2080845793); + uint4 b2 = uint4(143958837, 1620668660, 1135989346, 1367044745); + uint4 r2 = uint4(1936886956, 460177133, 944856447, 713801048); + TestUtils.AreEqual(r2, a2 - b2); + + uint a3 = (554088609); + uint4 b3 = uint4(552670373, 1265516124, 1254902543, 1857695581); + uint4 r3 = uint4(1418236, 3583539781, 3594153362, 2991360324); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void uint4_operator_mul_wide_wide() + { + uint4 a0 = uint4(61417577, 219585476, 1362520891, 1511084277); + uint4 b0 = uint4(578042444, 1620527213, 200516468, 309339115); + uint4 r0 = uint4(2868103468, 1326150260, 3304073148, 2972110823); + TestUtils.AreEqual(r0, a0 * b0); + + uint4 a1 = uint4(1481211272, 58211871, 1459591173, 567624644); + uint4 b1 = uint4(542853019, 299467282, 1479641221, 1428338601); + uint4 r1 = uint4(1973926232, 88546350, 3431047833, 3712145508); + TestUtils.AreEqual(r1, a1 * b1); + + uint4 a2 = uint4(1169935583, 1835691886, 385626539, 85934842); + uint4 b2 = uint4(1497302909, 1596889147, 427413842, 265122693); + uint4 r2 = uint4(556671459, 1098186330, 1848083398, 4236646882); + TestUtils.AreEqual(r2, a2 * b2); + + uint4 a3 = uint4(522856538, 278370196, 289217012, 2083410174); + uint4 b3 = uint4(689376654, 1120457204, 516903000, 873091659); + uint4 r3 = uint4(2005201900, 651971856, 2573806560, 4184807018); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void uint4_operator_mul_wide_scalar() + { + uint4 a0 = uint4(871746615, 492532311, 570557670, 2142306629); + uint b0 = (442064533); + uint4 r0 = uint4(338365955, 1081376419, 2565819870, 3279557417); + TestUtils.AreEqual(r0, a0 * b0); + + uint4 a1 = uint4(1610315153, 118471734, 257439514, 364291059); + uint b1 = (1526163563); + uint4 r1 = uint4(2932083611, 3961756306, 2388105182, 3815128721); + TestUtils.AreEqual(r1, a1 * b1); + + uint4 a2 = uint4(1186560810, 1357601203, 638897141, 268562104); + uint b2 = (1584938026); + uint4 r2 = uint4(989596900, 898280286, 2953765426, 2323925552); + TestUtils.AreEqual(r2, a2 * b2); + + uint4 a3 = uint4(1007838321, 1619806399, 1444659979, 1127580168); + uint b3 = (1163240135); + uint4 r3 = uint4(610309591, 1971350137, 984126349, 1871258680); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void uint4_operator_mul_scalar_wide() + { + uint a0 = (1152242766); + uint4 b0 = uint4(1276636134, 2105929407, 499007702, 124002565); + uint4 r0 = uint4(2165463060, 999811634, 1179056436, 3493540742); + TestUtils.AreEqual(r0, a0 * b0); + + uint a1 = (1956335172); + uint4 b1 = uint4(1288034953, 832676555, 337389733, 99268757); + uint4 r1 = uint4(303483492, 4218558444, 1271140820, 1556966804); + TestUtils.AreEqual(r1, a1 * b1); + + uint a2 = (2005055247); + uint4 b2 = uint4(2011389505, 1348110859, 399689191, 2007606374); + uint4 r2 = uint4(2729770191, 2761028517, 4045388169, 759270394); + TestUtils.AreEqual(r2, a2 * b2); + + uint a3 = (2076691289); + uint4 b3 = uint4(1825721194, 769885235, 153314735, 1066325369); + uint4 r3 = uint4(609175002, 2727503547, 1593384663, 1878927889); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void uint4_operator_div_wide_wide() + { + uint4 a0 = uint4(333171510, 858154903, 1181365836, 671357749); + uint4 b0 = uint4(698897823, 440199998, 655557473, 1658534285); + uint4 r0 = uint4(0, 1, 1, 0); + TestUtils.AreEqual(r0, a0 / b0); + + uint4 a1 = uint4(1090606752, 803759420, 788404166, 296807814); + uint4 b1 = uint4(2127220100, 315653188, 1814290360, 992173243); + uint4 r1 = uint4(0, 2, 0, 0); + TestUtils.AreEqual(r1, a1 / b1); + + uint4 a2 = uint4(575260195, 166625280, 1493729000, 1831739736); + uint4 b2 = uint4(914851653, 664340325, 224323977, 246981573); + uint4 r2 = uint4(0, 0, 6, 7); + TestUtils.AreEqual(r2, a2 / b2); + + uint4 a3 = uint4(200852358, 129983172, 500176108, 472051781); + uint4 b3 = uint4(285573983, 819471609, 2012476015, 1783179572); + uint4 r3 = uint4(0, 0, 0, 0); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void uint4_operator_div_wide_scalar() + { + uint4 a0 = uint4(1433072926, 1073958635, 1195142312, 536596719); + uint b0 = (1434025872); + uint4 r0 = uint4(0, 0, 0, 0); + TestUtils.AreEqual(r0, a0 / b0); + + uint4 a1 = uint4(1274375693, 806462546, 906504670, 1380905136); + uint b1 = (464756346); + uint4 r1 = uint4(2, 1, 1, 2); + TestUtils.AreEqual(r1, a1 / b1); + + uint4 a2 = uint4(25493909, 123300377, 643754735, 2084019932); + uint b2 = (1196815948); + uint4 r2 = uint4(0, 0, 0, 1); + TestUtils.AreEqual(r2, a2 / b2); + + uint4 a3 = uint4(2047825037, 741331531, 466443901, 2110004616); + uint b3 = (458304263); + uint4 r3 = uint4(4, 1, 1, 4); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void uint4_operator_div_scalar_wide() + { + uint a0 = (519165704); + uint4 b0 = uint4(1295178177, 775214121, 467772046, 1156881598); + uint4 r0 = uint4(0, 0, 1, 0); + TestUtils.AreEqual(r0, a0 / b0); + + uint a1 = (310396565); + uint4 b1 = uint4(759759959, 243837702, 1616314235, 1053470225); + uint4 r1 = uint4(0, 1, 0, 0); + TestUtils.AreEqual(r1, a1 / b1); + + uint a2 = (1320630160); + uint4 b2 = uint4(378773841, 4223608, 1971105754, 2054406020); + uint4 r2 = uint4(3, 312, 0, 0); + TestUtils.AreEqual(r2, a2 / b2); + + uint a3 = (219939614); + uint4 b3 = uint4(1603672651, 2006134295, 888535397, 1493077923); + uint4 r3 = uint4(0, 0, 0, 0); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void uint4_operator_mod_wide_wide() + { + uint4 a0 = uint4(258342924, 1454754891, 723352342, 1981431473); + uint4 b0 = uint4(1990080167, 1197348066, 651970512, 1659454050); + uint4 r0 = uint4(258342924, 257406825, 71381830, 321977423); + TestUtils.AreEqual(r0, a0 % b0); + + uint4 a1 = uint4(531756042, 716993627, 1667903349, 1331097004); + uint4 b1 = uint4(241005212, 1866255454, 1440101415, 595220963); + uint4 r1 = uint4(49745618, 716993627, 227801934, 140655078); + TestUtils.AreEqual(r1, a1 % b1); + + uint4 a2 = uint4(1776856101, 17598216, 1474345080, 1681376293); + uint4 b2 = uint4(408818410, 198222574, 549504274, 239973807); + uint4 r2 = uint4(141582461, 17598216, 375336532, 1559644); + TestUtils.AreEqual(r2, a2 % b2); + + uint4 a3 = uint4(813624265, 1617478722, 498370451, 780075943); + uint4 b3 = uint4(321398087, 658171840, 1511495237, 1048325585); + uint4 r3 = uint4(170828091, 301135042, 498370451, 780075943); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void uint4_operator_mod_wide_scalar() + { + uint4 a0 = uint4(560988938, 629524514, 767711194, 434281967); + uint b0 = (1156862367); + uint4 r0 = uint4(560988938, 629524514, 767711194, 434281967); + TestUtils.AreEqual(r0, a0 % b0); + + uint4 a1 = uint4(1399805893, 1663690927, 598661916, 1776636144); + uint b1 = (792916846); + uint4 r1 = uint4(606889047, 77857235, 598661916, 190802452); + TestUtils.AreEqual(r1, a1 % b1); + + uint4 a2 = uint4(1287035793, 475209785, 327476870, 1617696916); + uint b2 = (1743722161); + uint4 r2 = uint4(1287035793, 475209785, 327476870, 1617696916); + TestUtils.AreEqual(r2, a2 % b2); + + uint4 a3 = uint4(379853074, 858399046, 712734431, 1506629323); + uint b3 = (477430114); + uint4 r3 = uint4(379853074, 380968932, 235304317, 74338981); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void uint4_operator_mod_scalar_wide() + { + uint a0 = (933347930); + uint4 b0 = uint4(549923387, 243114953, 1884274390, 1428033594); + uint4 r0 = uint4(383424543, 204003071, 933347930, 933347930); + TestUtils.AreEqual(r0, a0 % b0); + + uint a1 = (655531454); + uint4 b1 = uint4(1622674954, 1107563514, 1614111094, 914801920); + uint4 r1 = uint4(655531454, 655531454, 655531454, 655531454); + TestUtils.AreEqual(r1, a1 % b1); + + uint a2 = (1432263179); + uint4 b2 = uint4(564431096, 1967013901, 1709750152, 1080102613); + uint4 r2 = uint4(303400987, 1432263179, 1432263179, 352160566); + TestUtils.AreEqual(r2, a2 % b2); + + uint a3 = (13120773); + uint4 b3 = uint4(2042535998, 1505698002, 1640058084, 974167554); + uint4 r3 = uint4(13120773, 13120773, 13120773, 13120773); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void uint4_operator_plus() + { + uint4 a0 = uint4(195392567, 222719748, 1002351013, 1570765263); + uint4 r0 = uint4(195392567, 222719748, 1002351013, 1570765263); + TestUtils.AreEqual(r0, +a0); + + uint4 a1 = uint4(109389333, 1689763402, 291471785, 264115671); + uint4 r1 = uint4(109389333, 1689763402, 291471785, 264115671); + TestUtils.AreEqual(r1, +a1); + + uint4 a2 = uint4(1084131995, 2131702223, 715660442, 1995564647); + uint4 r2 = uint4(1084131995, 2131702223, 715660442, 1995564647); + TestUtils.AreEqual(r2, +a2); + + uint4 a3 = uint4(69731564, 1957501908, 531426536, 2012985092); + uint4 r3 = uint4(69731564, 1957501908, 531426536, 2012985092); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void uint4_operator_neg() + { + uint4 a0 = uint4(1385088677, 94114564, 1350664872, 1458616659); + uint4 r0 = uint4(2909878619, 4200852732, 2944302424, 2836350637); + TestUtils.AreEqual(r0, -a0); + + uint4 a1 = uint4(2067164853, 958484951, 270553961, 446497525); + uint4 r1 = uint4(2227802443, 3336482345, 4024413335, 3848469771); + TestUtils.AreEqual(r1, -a1); + + uint4 a2 = uint4(270503114, 1427605822, 2051940607, 1434247484); + uint4 r2 = uint4(4024464182, 2867361474, 2243026689, 2860719812); + TestUtils.AreEqual(r2, -a2); + + uint4 a3 = uint4(485368391, 1742096480, 990033169, 1368056141); + uint4 r3 = uint4(3809598905, 2552870816, 3304934127, 2926911155); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void uint4_operator_prefix_inc() + { + uint4 a0 = uint4(780471723, 954741756, 272723451, 2142862245); + uint4 r0 = uint4(780471724, 954741757, 272723452, 2142862246); + TestUtils.AreEqual(r0, ++a0); + + uint4 a1 = uint4(606294309, 250124151, 444189162, 1833356994); + uint4 r1 = uint4(606294310, 250124152, 444189163, 1833356995); + TestUtils.AreEqual(r1, ++a1); + + uint4 a2 = uint4(1915989169, 129540735, 1584496757, 1170613526); + uint4 r2 = uint4(1915989170, 129540736, 1584496758, 1170613527); + TestUtils.AreEqual(r2, ++a2); + + uint4 a3 = uint4(986715680, 1397451003, 483952900, 1494652811); + uint4 r3 = uint4(986715681, 1397451004, 483952901, 1494652812); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void uint4_operator_postfix_inc() + { + uint4 a0 = uint4(241865086, 2145821641, 1596166022, 803592338); + uint4 r0 = uint4(241865086, 2145821641, 1596166022, 803592338); + TestUtils.AreEqual(r0, a0++); + + uint4 a1 = uint4(529551271, 903047443, 1213663244, 1425753247); + uint4 r1 = uint4(529551271, 903047443, 1213663244, 1425753247); + TestUtils.AreEqual(r1, a1++); + + uint4 a2 = uint4(1384002775, 1159795446, 1343289659, 1227160199); + uint4 r2 = uint4(1384002775, 1159795446, 1343289659, 1227160199); + TestUtils.AreEqual(r2, a2++); + + uint4 a3 = uint4(947635082, 451018043, 1634297552, 2009552507); + uint4 r3 = uint4(947635082, 451018043, 1634297552, 2009552507); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void uint4_operator_prefix_dec() + { + uint4 a0 = uint4(1331961415, 1612382200, 1401591249, 2042075388); + uint4 r0 = uint4(1331961414, 1612382199, 1401591248, 2042075387); + TestUtils.AreEqual(r0, --a0); + + uint4 a1 = uint4(1757136546, 1467742422, 578341664, 1336115745); + uint4 r1 = uint4(1757136545, 1467742421, 578341663, 1336115744); + TestUtils.AreEqual(r1, --a1); + + uint4 a2 = uint4(2059077641, 1862369220, 312317355, 1027543764); + uint4 r2 = uint4(2059077640, 1862369219, 312317354, 1027543763); + TestUtils.AreEqual(r2, --a2); + + uint4 a3 = uint4(1595492535, 1426620468, 674685792, 1423852012); + uint4 r3 = uint4(1595492534, 1426620467, 674685791, 1423852011); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void uint4_operator_postfix_dec() + { + uint4 a0 = uint4(1870005937, 1708534798, 704493460, 462940703); + uint4 r0 = uint4(1870005937, 1708534798, 704493460, 462940703); + TestUtils.AreEqual(r0, a0--); + + uint4 a1 = uint4(2060593573, 940247280, 1818778351, 1015253889); + uint4 r1 = uint4(2060593573, 940247280, 1818778351, 1015253889); + TestUtils.AreEqual(r1, a1--); + + uint4 a2 = uint4(862428933, 2080259851, 653673271, 140452688); + uint4 r2 = uint4(862428933, 2080259851, 653673271, 140452688); + TestUtils.AreEqual(r2, a2--); + + uint4 a3 = uint4(1928164223, 1174531383, 634036198, 993137684); + uint4 r3 = uint4(1928164223, 1174531383, 634036198, 993137684); + TestUtils.AreEqual(r3, a3--); + } + + [TestCompiler] + public static void uint4_operator_bitwise_and_wide_wide() + { + uint4 a0 = uint4(1055241304, 859321394, 1088358961, 2090949513); + uint4 b0 = uint4(749698416, 748105424, 1842764797, 9990577); + uint4 r0 = uint4(749024336, 537928720, 1087769137, 8409473); + TestUtils.AreEqual(r0, a0 & b0); + + uint4 a1 = uint4(300561740, 651904515, 1331035868, 2012752753); + uint4 b1 = uint4(1989102105, 1666634755, 58116798, 868036607); + uint4 r1 = uint4(277479432, 575816707, 55888540, 867707761); + TestUtils.AreEqual(r1, a1 & b1); + + uint4 a2 = uint4(1298126656, 53199569, 1752363533, 1303061302); + uint4 b2 = uint4(1420638875, 1308767169, 564040763, 478617502); + uint4 r2 = uint4(1141707264, 33686209, 538087433, 209912598); + TestUtils.AreEqual(r2, a2 & b2); + + uint4 a3 = uint4(1929998247, 1504941434, 470682792, 713577376); + uint4 b3 = uint4(806150474, 674015378, 1505309955, 36064977); + uint4 r3 = uint4(805855490, 136347666, 403178496, 33571456); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void uint4_operator_bitwise_and_wide_scalar() + { + uint4 a0 = uint4(1513158868, 284695609, 734595037, 1566510707); + uint b0 = (1173647397); + uint4 r0 = uint4(1076916228, 15732769, 29360133, 1163132961); + TestUtils.AreEqual(r0, a0 & b0); + + uint4 a1 = uint4(1601252476, 314333543, 430856908, 753481263); + uint b1 = (84213838); + uint4 r1 = uint4(83951692, 262214, 17039436, 67174414); + TestUtils.AreEqual(r1, a1 & b1); + + uint4 a2 = uint4(327392481, 2143619546, 1873208293, 126982769); + uint b2 = (1619794917); + uint4 r2 = uint4(8394977, 1619265984, 1619264485, 8395361); + TestUtils.AreEqual(r2, a2 & b2); + + uint4 a3 = uint4(651482651, 1689107088, 1368301071, 366962092); + uint b3 = (1383096952); + uint4 r3 = uint4(38814232, 1075847696, 1342177800, 273702952); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void uint4_operator_bitwise_and_scalar_wide() + { + uint a0 = (477163326); + uint4 b0 = uint4(110453385, 703240362, 2075630560, 1884904031); + uint4 r0 = uint4(68182536, 140544042, 405834528, 273697310); + TestUtils.AreEqual(r0, a0 & b0); + + uint a1 = (1734899436); + uint4 b1 = uint4(947945203, 1664399051, 458879298, 158491426); + uint4 r1 = uint4(536901344, 1663055560, 55078976, 23093792); + TestUtils.AreEqual(r1, a1 & b1); + + uint a2 = (79772356); + uint4 b2 = uint4(2054527944, 202228212, 359225061, 639811396); + uint4 r2 = uint4(4266688, 67174596, 71373508, 67123780); + TestUtils.AreEqual(r2, a2 & b2); + + uint a3 = (1821945318); + uint4 b3 = uint4(1821303024, 2030124055, 1985961756, 579780373); + uint4 r3 = uint4(1820893408, 1744841734, 1679297796, 545828100); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void uint4_operator_bitwise_or_wide_wide() + { + uint4 a0 = uint4(1920951869, 1750772852, 1420019191, 732977093); + uint4 b0 = uint4(214585254, 275414367, 858759675, 190211455); + uint4 r0 = uint4(2130669503, 2021326207, 2008016383, 737572863); + TestUtils.AreEqual(r0, a0 | b0); + + uint4 a1 = uint4(1169579447, 229437930, 1966721348, 2039812323); + uint4 b1 = uint4(1218691723, 2129565457, 1862809466, 495728846); + uint4 r1 = uint4(1303895999, 2146367483, 2134507390, 2107455727); + TestUtils.AreEqual(r1, a1 | b1); + + uint4 a2 = uint4(113550869, 1912038362, 1569990624, 1490718227); + uint4 b2 = uint4(868064152, 1756913766, 933656055, 247722084); + uint4 r2 = uint4(939376541, 2046780414, 2142664695, 1591475831); + TestUtils.AreEqual(r2, a2 | b2); + + uint4 a3 = uint4(1686257697, 2137727522, 1569900650, 856504729); + uint4 b3 = uint4(1884195075, 1804207631, 1913174711, 1815920856); + uint4 r3 = uint4(1959708963, 2146117167, 2140863231, 2134768089); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void uint4_operator_bitwise_or_wide_scalar() + { + uint4 a0 = uint4(1295304853, 1307252624, 350194630, 1128063578); + uint b0 = (1305527136); + uint4 r0 = uint4(1307888629, 1308350448, 1574947814, 1341973370); + TestUtils.AreEqual(r0, a0 | b0); + + uint4 a1 = uint4(1774824542, 1988423804, 999162350, 2110327307); + uint b1 = (2085245467); + uint4 r1 = uint4(2110520927, 2127491711, 2144228351, 2110478875); + TestUtils.AreEqual(r1, a1 | b1); + + uint4 a2 = uint4(1050875188, 1317039676, 228656898, 41280811); + uint b2 = (341855232); + uint4 r2 = uint4(1055087924, 1591766588, 501305090, 376827179); + TestUtils.AreEqual(r2, a2 | b2); + + uint4 a3 = uint4(1536908787, 1739461580, 2040936581, 1350320187); + uint b3 = (606786773); + uint4 r3 = uint4(2143018487, 1739511773, 2108619989, 1954469119); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void uint4_operator_bitwise_or_scalar_wide() + { + uint a0 = (1768627592); + uint4 b0 = uint4(1849658052, 1759912154, 729979455, 975926310); + uint4 r0 = uint4(1870634956, 1777286618, 1810603967, 2070642094); + TestUtils.AreEqual(r0, a0 | b0); + + uint a1 = (1987690876); + uint4 b1 = uint4(1809506714, 1160695341, 408963395, 314072711); + uint4 r1 = uint4(2147213822, 2004864893, 2121910655, 1996087295); + TestUtils.AreEqual(r1, a1 | b1); + + uint a2 = (1560007537); + uint4 b2 = uint4(1709003416, 977086639, 1448375596, 1689568808); + uint4 r2 = uint4(2113917945, 2130705407, 1593833341, 2097141625); + TestUtils.AreEqual(r2, a2 | b2); + + uint a3 = (595543345); + uint4 b3 = uint4(559778387, 621080913, 438994183, 1742637145); + uint4 r3 = uint4(595578739, 662697329, 998229303, 1744817529); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void uint4_operator_bitwise_xor_wide_wide() + { + uint4 a0 = uint4(1843655608, 362425681, 640805534, 1342040268); + uint4 b0 = uint4(1422803441, 1234691140, 119589253, 1101464929); + uint4 r0 = uint4(959296073, 1544407317, 554771227, 240840109); + TestUtils.AreEqual(r0, a0 ^ b0); + + uint4 a1 = uint4(945678755, 980321850, 390165019, 1682422658); + uint4 b1 = uint4(121896337, 1880109018, 1000210266, 1718938232); + uint4 r1 = uint4(1058935858, 1249815008, 752651585, 36917754); + TestUtils.AreEqual(r1, a1 ^ b1); + + uint4 a2 = uint4(303897251, 230477768, 1103646442, 1503102919); + uint4 b2 = uint4(464406940, 884337881, 34199854, 1430659227); + uint4 r2 = uint4(162747199, 956900113, 1136760772, 215066460); + TestUtils.AreEqual(r2, a2 ^ b2); + + uint4 a3 = uint4(26631152, 1016475570, 1862440929, 379588576); + uint4 b3 = uint4(126415540, 1069919967, 1810763253, 2082802224); + uint4 r3 = uint4(102672708, 55804269, 82614804, 1787102672); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void uint4_operator_bitwise_xor_wide_scalar() + { + uint4 a0 = uint4(169345668, 176087064, 2084362901, 1663924004); + uint b0 = (354464228); + uint4 r0 = uint4(523809632, 526275068, 1763470193, 1980614336); + TestUtils.AreEqual(r0, a0 ^ b0); + + uint4 a1 = uint4(193851255, 905336222, 863800783, 365003873); + uint b1 = (517476661); + uint4 r1 = uint4(357957186, 724452523, 765762810, 186226004); + TestUtils.AreEqual(r1, a1 ^ b1); + + uint4 a2 = uint4(835837496, 1464576786, 625604047, 1700827127); + uint b2 = (954341348); + uint4 r2 = uint4(154388956, 1873394934, 497803819, 1568839699); + TestUtils.AreEqual(r2, a2 ^ b2); + + uint4 a3 = uint4(2003392824, 1077374714, 1043379893, 1991576049); + uint b3 = (1481813598); + uint4 r3 = uint4(792459110, 409321636, 1717704939, 786933679); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void uint4_operator_bitwise_xor_scalar_wide() + { + uint a0 = (1361775641); + uint4 b0 = uint4(1452773578, 459050892, 1986218254, 1689037698); + uint4 r0 = uint4(129801427, 1249346453, 659047703, 898082715); + TestUtils.AreEqual(r0, a0 ^ b0); + + uint a1 = (999278344); + uint4 b1 = uint4(1229114508, 1087843538, 733699740, 106187872); + uint4 r1 = uint4(1926040452, 2069425114, 271882644, 1037798248); + TestUtils.AreEqual(r1, a1 ^ b1); + + uint a2 = (1533632738); + uint4 b2 = uint4(1107817672, 492506236, 597602329, 1439603382); + uint4 r2 = uint4(426677290, 1177709726, 2029506811, 245889620); + TestUtils.AreEqual(r2, a2 ^ b2); + + uint a3 = (1001169118); + uint4 b3 = uint4(1231718216, 1693179077, 1050897427, 1796435561); + uint4 r3 = uint4(1925588886, 1598520347, 84921549, 1354747575); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void uint4_operator_left_shift() + { + uint4 a0 = uint4(1129100049, 829482269, 1571297368, 443753193); + int b0 = (218351941); + uint4 r0 = uint4(1771463200, 773628832, 3036875520, 1315200288); + TestUtils.AreEqual(r0, a0 << b0); + + uint4 a1 = uint4(1872142968, 892627436, 980302862, 62369727); + int b1 = (249554593); + uint4 r1 = uint4(3744285936, 1785254872, 1960605724, 124739454); + TestUtils.AreEqual(r1, a1 << b1); + + uint4 a2 = uint4(849916599, 108441902, 1959056531, 1779118882); + int b2 = (1271350845); + uint4 r2 = uint4(3758096384, 3221225472, 1610612736, 1073741824); + TestUtils.AreEqual(r2, a2 << b2); + + uint4 a3 = uint4(1451674188, 1149883636, 1380536034, 186532735); + int b3 = (2082026915); + uint4 r3 = uint4(3023458912, 609134496, 2454353680, 1492261880); + TestUtils.AreEqual(r3, a3 << b3); + } + + [TestCompiler] + public static void uint4_operator_right_shift() + { + uint4 a0 = uint4(809126085, 908563670, 763568837, 1986717290); + int b0 = (994800051); + uint4 r0 = uint4(1543, 1732, 1456, 3789); + TestUtils.AreEqual(r0, a0 >> b0); + + uint4 a1 = uint4(1174507510, 1242726074, 390811632, 1521420393); + int b1 = (646821842); + uint4 r1 = uint4(4480, 4740, 1490, 5803); + TestUtils.AreEqual(r1, a1 >> b1); + + uint4 a2 = uint4(1923166649, 400863878, 667378673, 1611921244); + int b2 = (102096936); + uint4 r2 = uint4(7512369, 1565874, 2606947, 6296567); + TestUtils.AreEqual(r2, a2 >> b2); + + uint4 a3 = uint4(307750782, 2014389412, 1673938174, 1075916177); + int b3 = (479442287); + uint4 r3 = uint4(9391, 61474, 51084, 32834); + TestUtils.AreEqual(r3, a3 >> b3); + } + + [TestCompiler] + public static void uint4_operator_bitwise_not() + { + uint4 a0 = uint4(111796841, 603562399, 745091931, 853183268); + uint4 r0 = uint4(4183170454, 3691404896, 3549875364, 3441784027); + TestUtils.AreEqual(r0, ~a0); + + uint4 a1 = uint4(1110916612, 1891338755, 1506860135, 771210628); + uint4 r1 = uint4(3184050683, 2403628540, 2788107160, 3523756667); + TestUtils.AreEqual(r1, ~a1); + + uint4 a2 = uint4(787710759, 96456785, 916013379, 203444882); + uint4 r2 = uint4(3507256536, 4198510510, 3378953916, 4091522413); + TestUtils.AreEqual(r2, ~a2); + + uint4 a3 = uint4(1172294211, 683852713, 375158799, 881353367); + uint4 r3 = uint4(3122673084, 3611114582, 3919808496, 3413613928); + TestUtils.AreEqual(r3, ~a3); + } + + [TestCompiler] + public static void uint4_shuffle_result_1() + { + uint4 a = uint4(0, 1, 2, 3); + uint4 b = uint4(4, 5, 6, 7); + + TestUtils.AreEqual((0), shuffle(a, b, ShuffleComponent.LeftX)); + TestUtils.AreEqual((1), shuffle(a, b, ShuffleComponent.LeftY)); + TestUtils.AreEqual((2), shuffle(a, b, ShuffleComponent.LeftZ)); + TestUtils.AreEqual((3), shuffle(a, b, ShuffleComponent.LeftW)); + TestUtils.AreEqual((4), shuffle(a, b, ShuffleComponent.RightX)); + TestUtils.AreEqual((5), shuffle(a, b, ShuffleComponent.RightY)); + TestUtils.AreEqual((6), shuffle(a, b, ShuffleComponent.RightZ)); + TestUtils.AreEqual((7), shuffle(a, b, ShuffleComponent.RightW)); + } + + [TestCompiler] + public static void uint4_shuffle_result_2() + { + uint4 a = uint4(0, 1, 2, 3); + uint4 b = uint4(4, 5, 6, 7); + + TestUtils.AreEqual(uint2(5, 6), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightZ)); + TestUtils.AreEqual(uint2(6, 4), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.RightX)); + TestUtils.AreEqual(uint2(1, 4), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.RightX)); + TestUtils.AreEqual(uint2(7, 3), shuffle(a, b, ShuffleComponent.RightW, ShuffleComponent.LeftW)); + TestUtils.AreEqual(uint2(7, 2), shuffle(a, b, ShuffleComponent.RightW, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(uint2(2, 3), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.LeftW)); + TestUtils.AreEqual(uint2(5, 3), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftW)); + TestUtils.AreEqual(uint2(7, 0), shuffle(a, b, ShuffleComponent.RightW, ShuffleComponent.LeftX)); + TestUtils.AreEqual(uint2(6, 7), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.RightW)); + TestUtils.AreEqual(uint2(5, 2), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(uint2(6, 6), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.RightZ)); + TestUtils.AreEqual(uint2(7, 0), shuffle(a, b, ShuffleComponent.RightW, ShuffleComponent.LeftX)); + TestUtils.AreEqual(uint2(5, 4), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightX)); + TestUtils.AreEqual(uint2(7, 5), shuffle(a, b, ShuffleComponent.RightW, ShuffleComponent.RightY)); + TestUtils.AreEqual(uint2(4, 0), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftX)); + TestUtils.AreEqual(uint2(1, 3), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.LeftW)); + } + + [TestCompiler] + public static void uint4_shuffle_result_3() + { + uint4 a = uint4(0, 1, 2, 3); + uint4 b = uint4(4, 5, 6, 7); + + TestUtils.AreEqual(uint3(2, 7, 5), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.RightW, ShuffleComponent.RightY)); + TestUtils.AreEqual(uint3(6, 0, 3), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.LeftX, ShuffleComponent.LeftW)); + TestUtils.AreEqual(uint3(2, 7, 4), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.RightW, ShuffleComponent.RightX)); + TestUtils.AreEqual(uint3(5, 0, 2), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftX, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(uint3(7, 6, 2), shuffle(a, b, ShuffleComponent.RightW, ShuffleComponent.RightZ, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(uint3(3, 1, 1), shuffle(a, b, ShuffleComponent.LeftW, ShuffleComponent.LeftY, ShuffleComponent.LeftY)); + TestUtils.AreEqual(uint3(3, 5, 4), shuffle(a, b, ShuffleComponent.LeftW, ShuffleComponent.RightY, ShuffleComponent.RightX)); + TestUtils.AreEqual(uint3(3, 1, 7), shuffle(a, b, ShuffleComponent.LeftW, ShuffleComponent.LeftY, ShuffleComponent.RightW)); + TestUtils.AreEqual(uint3(6, 5, 6), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.RightY, ShuffleComponent.RightZ)); + TestUtils.AreEqual(uint3(5, 4, 1), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightX, ShuffleComponent.LeftY)); + TestUtils.AreEqual(uint3(7, 7, 0), shuffle(a, b, ShuffleComponent.RightW, ShuffleComponent.RightW, ShuffleComponent.LeftX)); + TestUtils.AreEqual(uint3(6, 1, 5), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.LeftY, ShuffleComponent.RightY)); + TestUtils.AreEqual(uint3(6, 1, 7), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.LeftY, ShuffleComponent.RightW)); + TestUtils.AreEqual(uint3(3, 5, 5), shuffle(a, b, ShuffleComponent.LeftW, ShuffleComponent.RightY, ShuffleComponent.RightY)); + TestUtils.AreEqual(uint3(6, 0, 5), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.LeftX, ShuffleComponent.RightY)); + TestUtils.AreEqual(uint3(5, 1, 7), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftY, ShuffleComponent.RightW)); + } + + [TestCompiler] + public static void uint4_shuffle_result_4() + { + uint4 a = uint4(0, 1, 2, 3); + uint4 b = uint4(4, 5, 6, 7); + + TestUtils.AreEqual(uint4(1, 3, 4, 2), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.LeftW, ShuffleComponent.RightX, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(uint4(5, 3, 6, 6), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftW, ShuffleComponent.RightZ, ShuffleComponent.RightZ)); + TestUtils.AreEqual(uint4(6, 6, 7, 2), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.RightZ, ShuffleComponent.RightW, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(uint4(4, 5, 2, 2), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightY, ShuffleComponent.LeftZ, ShuffleComponent.LeftZ)); + TestUtils.AreEqual(uint4(6, 1, 1, 0), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.LeftY, ShuffleComponent.LeftY, ShuffleComponent.LeftX)); + TestUtils.AreEqual(uint4(4, 5, 5, 7), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightY, ShuffleComponent.RightY, ShuffleComponent.RightW)); + TestUtils.AreEqual(uint4(1, 7, 0, 7), shuffle(a, b, ShuffleComponent.LeftY, ShuffleComponent.RightW, ShuffleComponent.LeftX, ShuffleComponent.RightW)); + TestUtils.AreEqual(uint4(5, 0, 1, 0), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.LeftX, ShuffleComponent.LeftY, ShuffleComponent.LeftX)); + TestUtils.AreEqual(uint4(4, 7, 3, 1), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.RightW, ShuffleComponent.LeftW, ShuffleComponent.LeftY)); + TestUtils.AreEqual(uint4(5, 4, 1, 4), shuffle(a, b, ShuffleComponent.RightY, ShuffleComponent.RightX, ShuffleComponent.LeftY, ShuffleComponent.RightX)); + TestUtils.AreEqual(uint4(0, 2, 6, 0), shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.LeftZ, ShuffleComponent.RightZ, ShuffleComponent.LeftX)); + TestUtils.AreEqual(uint4(2, 5, 7, 7), shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.RightY, ShuffleComponent.RightW, ShuffleComponent.RightW)); + TestUtils.AreEqual(uint4(3, 4, 2, 4), shuffle(a, b, ShuffleComponent.LeftW, ShuffleComponent.RightX, ShuffleComponent.LeftZ, ShuffleComponent.RightX)); + TestUtils.AreEqual(uint4(4, 0, 2, 3), shuffle(a, b, ShuffleComponent.RightX, ShuffleComponent.LeftX, ShuffleComponent.LeftZ, ShuffleComponent.LeftW)); + TestUtils.AreEqual(uint4(6, 4, 0, 5), shuffle(a, b, ShuffleComponent.RightZ, ShuffleComponent.RightX, ShuffleComponent.LeftX, ShuffleComponent.RightY)); + TestUtils.AreEqual(uint4(3, 7, 1, 5), shuffle(a, b, ShuffleComponent.LeftW, ShuffleComponent.RightW, ShuffleComponent.LeftY, ShuffleComponent.RightY)); + } + + [TestCase /* For player builds */] + public static void uint4_EqualsObjectOverride() + { + TestUtils.IsFalse(new uint4().Equals((object)new int())); + TestUtils.IsTrue(new uint4().Equals((object)new uint4())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestUint4.gen.cs.meta b/src/Tests/Tests/Shared/TestUint4.gen.cs.meta new file mode 100644 index 00000000..b1ef89f3 --- /dev/null +++ b/src/Tests/Tests/Shared/TestUint4.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f91c46b1912b5d04d8e4e1ddb7377874 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestUint4x2.gen.cs b/src/Tests/Tests/Shared/TestUint4x2.gen.cs new file mode 100644 index 00000000..7f42bc6a --- /dev/null +++ b/src/Tests/Tests/Shared/TestUint4x2.gen.cs @@ -0,0 +1,1236 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestUint4x2 + { + [TestCompiler] + public static void uint4x2_zero() + { + TestUtils.AreEqual(0u, uint4x2.zero.c0.x); + TestUtils.AreEqual(0u, uint4x2.zero.c0.y); + TestUtils.AreEqual(0u, uint4x2.zero.c0.z); + TestUtils.AreEqual(0u, uint4x2.zero.c0.w); + TestUtils.AreEqual(0u, uint4x2.zero.c1.x); + TestUtils.AreEqual(0u, uint4x2.zero.c1.y); + TestUtils.AreEqual(0u, uint4x2.zero.c1.z); + TestUtils.AreEqual(0u, uint4x2.zero.c1.w); + } + + [TestCompiler] + public static void uint4x2_operator_equal_wide_wide() + { + uint4x2 a0 = uint4x2(2105871082, 35218899, 1550755093, 764676020, 606743782, 1208156098, 1023640014, 1038468316); + uint4x2 b0 = uint4x2(1477587886, 579629692, 540974792, 208405066, 2063397938, 1060167409, 362592601, 2097545362); + bool4x2 r0 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + uint4x2 a1 = uint4x2(1416064367, 727143393, 2061243891, 184669837, 1303661760, 2044073738, 370395888, 1822916805); + uint4x2 b1 = uint4x2(277670088, 426944490, 901076223, 857900673, 1548779757, 325265488, 312658571, 176373760); + bool4x2 r1 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + uint4x2 a2 = uint4x2(1076983135, 345215866, 833676277, 1987782708, 1481088614, 1364754268, 93639636, 1850596922); + uint4x2 b2 = uint4x2(2052378097, 858156597, 982817797, 1252095508, 882634538, 1959142806, 72495800, 1077678183); + bool4x2 r2 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + uint4x2 a3 = uint4x2(2073471507, 1745989448, 28118669, 1267554232, 1292918049, 1423451579, 644384701, 1985492825); + uint4x2 b3 = uint4x2(1729269763, 1607675346, 1813461519, 1204794859, 1324801873, 1975336, 439410532, 294085211); + bool4x2 r3 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void uint4x2_operator_equal_wide_scalar() + { + uint4x2 a0 = uint4x2(437822262, 2020661134, 541786900, 853113810, 23716499, 179951405, 1409026299, 948838849); + uint b0 = (1332833578); + bool4x2 r0 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + uint4x2 a1 = uint4x2(953202998, 1926262965, 1851546137, 712957637, 2028784869, 1049962241, 1836975611, 1016802970); + uint b1 = (691955848); + bool4x2 r1 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + uint4x2 a2 = uint4x2(390120467, 1451642042, 289137869, 152339338, 808355440, 660053867, 597354173, 67320270); + uint b2 = (464814777); + bool4x2 r2 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + uint4x2 a3 = uint4x2(151461188, 602895443, 186996278, 129611815, 1031574999, 1697392883, 1463742000, 857785521); + uint b3 = (35153827); + bool4x2 r3 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void uint4x2_operator_equal_scalar_wide() + { + uint a0 = (542329200); + uint4x2 b0 = uint4x2(1115584594, 684107773, 1928988941, 890709324, 641152437, 1410341302, 497505660, 1068223109); + bool4x2 r0 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + uint a1 = (2014009435); + uint4x2 b1 = uint4x2(213835595, 1592428361, 1819361470, 448650623, 1942175642, 64377057, 1485938610, 1146305380); + bool4x2 r1 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + uint a2 = (1312317120); + uint4x2 b2 = uint4x2(263290348, 812663708, 1585209188, 40646617, 1378718922, 1957797737, 873652576, 1780082094); + bool4x2 r2 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + uint a3 = (1513270921); + uint4x2 b3 = uint4x2(2095980581, 1413074719, 1387984261, 1547119354, 924385171, 1253636050, 1477542688, 969120167); + bool4x2 r3 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void uint4x2_operator_not_equal_wide_wide() + { + uint4x2 a0 = uint4x2(1977284100, 1293292704, 1547283851, 422428953, 195833190, 1711544892, 5606053, 737069074); + uint4x2 b0 = uint4x2(1514195556, 957972049, 507667364, 581861672, 1128094576, 940096636, 57559040, 181752616); + bool4x2 r0 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + uint4x2 a1 = uint4x2(647386678, 13079405, 1413841590, 1076166545, 1211445174, 1289303469, 1436402489, 1129570126); + uint4x2 b1 = uint4x2(962017320, 1762015406, 1107218953, 2042026522, 836002288, 570272309, 2112081980, 1500634658); + bool4x2 r1 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + uint4x2 a2 = uint4x2(1566836685, 1343313905, 329259205, 1774944480, 33906739, 2055853627, 2035015372, 1702756001); + uint4x2 b2 = uint4x2(1787808345, 566425667, 2037529609, 1520589840, 266793699, 538816359, 2075474643, 553571317); + bool4x2 r2 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + uint4x2 a3 = uint4x2(1164186087, 329853698, 769052491, 1893312730, 438029011, 1894010522, 1365847542, 1292942830); + uint4x2 b3 = uint4x2(218264354, 654754196, 1392180230, 870065147, 1398749829, 711281563, 1999640291, 231234857); + bool4x2 r3 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void uint4x2_operator_not_equal_wide_scalar() + { + uint4x2 a0 = uint4x2(1038269360, 1427812625, 103361237, 1347017023, 1523584313, 150442802, 660334527, 719113717); + uint b0 = (768873026); + bool4x2 r0 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + uint4x2 a1 = uint4x2(262959423, 506946952, 226568494, 507918242, 1702162286, 923269270, 166187260, 114581840); + uint b1 = (484398043); + bool4x2 r1 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + uint4x2 a2 = uint4x2(1045389187, 1461803977, 61801615, 1317840133, 2146927809, 1557151164, 1284033253, 1345705546); + uint b2 = (1648095254); + bool4x2 r2 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + uint4x2 a3 = uint4x2(1747302566, 1368046109, 1848036266, 2025452920, 373992983, 289537519, 1388743060, 146455100); + uint b3 = (611028295); + bool4x2 r3 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void uint4x2_operator_not_equal_scalar_wide() + { + uint a0 = (1652127596); + uint4x2 b0 = uint4x2(953791238, 271722683, 1278885987, 735128017, 112416504, 25967222, 1761444475, 1844594536); + bool4x2 r0 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + uint a1 = (1199122922); + uint4x2 b1 = uint4x2(634219279, 942501101, 67161343, 969944293, 833229499, 1304301133, 704045745, 345012334); + bool4x2 r1 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + uint a2 = (1253134152); + uint4x2 b2 = uint4x2(325772538, 855127202, 793668881, 1584481616, 1101301152, 276853534, 987168816, 1258105989); + bool4x2 r2 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + uint a3 = (362645228); + uint4x2 b3 = uint4x2(293978043, 1772395973, 1692007315, 681268929, 1535518457, 595209334, 25745185, 1278016813); + bool4x2 r3 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void uint4x2_operator_less_wide_wide() + { + uint4x2 a0 = uint4x2(1486550609, 1779244308, 1602148045, 1614085440, 1975613414, 942838342, 1092279031, 373677431); + uint4x2 b0 = uint4x2(97842578, 536551311, 413528975, 1838293684, 1283898480, 1456599961, 1080278602, 529676676); + bool4x2 r0 = bool4x2(false, false, false, true, false, true, false, true); + TestUtils.AreEqual(r0, a0 < b0); + + uint4x2 a1 = uint4x2(1419098312, 337757077, 1081797900, 1336745069, 840685445, 1220554047, 2013681746, 192965012); + uint4x2 b1 = uint4x2(156584048, 117348799, 246927124, 1916615924, 1731071394, 1328098431, 1014995792, 480319327); + bool4x2 r1 = bool4x2(false, false, false, true, true, true, false, true); + TestUtils.AreEqual(r1, a1 < b1); + + uint4x2 a2 = uint4x2(532043965, 1000693402, 927236048, 1215860000, 780607596, 1882056852, 1354146545, 2135295778); + uint4x2 b2 = uint4x2(1765937053, 1333997067, 688515308, 1856106947, 1303906227, 646821776, 1169473993, 316770064); + bool4x2 r2 = bool4x2(true, true, false, true, true, false, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + uint4x2 a3 = uint4x2(1145973790, 1938006975, 895882838, 2006524299, 908581156, 1843349513, 1340458575, 1972095585); + uint4x2 b3 = uint4x2(1518155802, 416732703, 529193056, 1239623485, 2010112031, 2018560298, 285987009, 960617622); + bool4x2 r3 = bool4x2(true, false, false, false, true, true, false, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void uint4x2_operator_less_wide_scalar() + { + uint4x2 a0 = uint4x2(796797557, 670113454, 933579492, 278884514, 318174822, 1117630673, 741886928, 1990922600); + uint b0 = (746564682); + bool4x2 r0 = bool4x2(false, true, false, true, true, false, true, false); + TestUtils.AreEqual(r0, a0 < b0); + + uint4x2 a1 = uint4x2(1030849597, 1718582899, 1648393417, 1857132231, 1909506562, 1294006045, 952084157, 1303736668); + uint b1 = (1546212312); + bool4x2 r1 = bool4x2(true, false, false, false, false, true, true, true); + TestUtils.AreEqual(r1, a1 < b1); + + uint4x2 a2 = uint4x2(845460171, 1368236640, 24980695, 1434668705, 659552739, 1058492383, 165694933, 1204097259); + uint b2 = (979430272); + bool4x2 r2 = bool4x2(true, false, true, false, true, false, true, false); + TestUtils.AreEqual(r2, a2 < b2); + + uint4x2 a3 = uint4x2(922212691, 24629507, 1386458568, 1325149699, 1498707004, 1650355158, 1213017950, 1650457461); + uint b3 = (281328069); + bool4x2 r3 = bool4x2(false, true, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void uint4x2_operator_less_scalar_wide() + { + uint a0 = (186400299); + uint4x2 b0 = uint4x2(1881344229, 813834467, 1254886626, 1353590345, 1412343685, 1555571443, 1540508298, 1735458634); + bool4x2 r0 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 < b0); + + uint a1 = (135888070); + uint4x2 b1 = uint4x2(1643818742, 248291654, 1739560105, 728539891, 480507742, 1696553040, 540223931, 1840493353); + bool4x2 r1 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 < b1); + + uint a2 = (146833656); + uint4x2 b2 = uint4x2(798115946, 2002002066, 1011261705, 783550942, 1093071215, 598253401, 1432416562, 1863582169); + bool4x2 r2 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 < b2); + + uint a3 = (103622950); + uint4x2 b3 = uint4x2(775175960, 116908309, 1213433625, 1428954824, 1760442490, 1208143947, 751820805, 1491872302); + bool4x2 r3 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void uint4x2_operator_greater_wide_wide() + { + uint4x2 a0 = uint4x2(2087717754, 1725569452, 1298066182, 1693943616, 1319019629, 70674491, 1042499725, 1002821508); + uint4x2 b0 = uint4x2(85148514, 293632137, 1151128249, 409440398, 1115020183, 1508500597, 1834583302, 1755218534); + bool4x2 r0 = bool4x2(true, true, true, true, true, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + uint4x2 a1 = uint4x2(1021857133, 1744374599, 821751047, 467646903, 2029731638, 1377214212, 1207816926, 474621063); + uint4x2 b1 = uint4x2(1788761753, 1128238489, 834223713, 1578743290, 1647150256, 1756397855, 1131080201, 1208965204); + bool4x2 r1 = bool4x2(false, true, false, false, true, false, true, false); + TestUtils.AreEqual(r1, a1 > b1); + + uint4x2 a2 = uint4x2(20781266, 366593779, 2068457387, 10181449, 793634464, 144474612, 99947390, 930377263); + uint4x2 b2 = uint4x2(1495161099, 1283714281, 908051907, 412849651, 815822687, 730271942, 40756039, 883326140); + bool4x2 r2 = bool4x2(false, false, true, false, false, false, true, true); + TestUtils.AreEqual(r2, a2 > b2); + + uint4x2 a3 = uint4x2(683686232, 742803073, 918292048, 875621429, 1764985258, 411384146, 1921397684, 1349107119); + uint4x2 b3 = uint4x2(476260632, 1024136446, 1440596667, 1253494041, 146826162, 1798399573, 2085029408, 187939428); + bool4x2 r3 = bool4x2(true, false, false, false, true, false, false, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void uint4x2_operator_greater_wide_scalar() + { + uint4x2 a0 = uint4x2(1208626274, 239697208, 1979453345, 1253474001, 1590192876, 1487911635, 1673945595, 1662650098); + uint b0 = (1715176566); + bool4x2 r0 = bool4x2(false, false, true, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + uint4x2 a1 = uint4x2(222749855, 566635217, 1773305960, 1850273578, 206147145, 325913453, 333381537, 1905567362); + uint b1 = (1433540517); + bool4x2 r1 = bool4x2(false, false, true, true, false, false, false, true); + TestUtils.AreEqual(r1, a1 > b1); + + uint4x2 a2 = uint4x2(2053577491, 2128431130, 1735325311, 529971908, 1663525234, 1972984241, 1587865063, 488268523); + uint b2 = (570397194); + bool4x2 r2 = bool4x2(true, true, true, false, true, true, true, false); + TestUtils.AreEqual(r2, a2 > b2); + + uint4x2 a3 = uint4x2(121921923, 181082921, 1281638484, 1818357732, 116518997, 1397728785, 1924199337, 742950077); + uint b3 = (812076921); + bool4x2 r3 = bool4x2(false, false, true, true, false, true, true, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void uint4x2_operator_greater_scalar_wide() + { + uint a0 = (480938827); + uint4x2 b0 = uint4x2(1824731899, 921496110, 586859044, 946430596, 1231356727, 1390167458, 1785807092, 28949024); + bool4x2 r0 = bool4x2(false, false, false, false, false, false, false, true); + TestUtils.AreEqual(r0, a0 > b0); + + uint a1 = (2037899283); + uint4x2 b1 = uint4x2(595656760, 1778095771, 1233500439, 1696302238, 1445965340, 484020151, 1586962841, 1361740714); + bool4x2 r1 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + uint a2 = (265628948); + uint4x2 b2 = uint4x2(2003122957, 332267433, 1128353075, 377919478, 982113135, 1117675960, 630865591, 1550679736); + bool4x2 r2 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 > b2); + + uint a3 = (895945757); + uint4x2 b3 = uint4x2(287025687, 643452096, 660504007, 613135893, 633307118, 514276792, 1377364317, 84491736); + bool4x2 r3 = bool4x2(true, true, true, true, true, true, false, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void uint4x2_operator_less_equal_wide_wide() + { + uint4x2 a0 = uint4x2(154092149, 1515170149, 1083970332, 785807178, 1401094881, 310537627, 868328962, 1990816725); + uint4x2 b0 = uint4x2(77984380, 1712054191, 1566203809, 254834519, 450519938, 389457083, 1298669505, 207343167); + bool4x2 r0 = bool4x2(false, true, true, false, false, true, true, false); + TestUtils.AreEqual(r0, a0 <= b0); + + uint4x2 a1 = uint4x2(2035349541, 457043352, 1123282035, 1001842946, 1387761992, 195272789, 659549000, 888761458); + uint4x2 b1 = uint4x2(1214449047, 2059561026, 896534357, 1897470050, 521075677, 1848221945, 374708019, 1573731118); + bool4x2 r1 = bool4x2(false, true, false, true, false, true, false, true); + TestUtils.AreEqual(r1, a1 <= b1); + + uint4x2 a2 = uint4x2(283706617, 1790185840, 899029812, 848317418, 1743712447, 1504407474, 1798441490, 1902791952); + uint4x2 b2 = uint4x2(2093466449, 1660210829, 1568778785, 1352157589, 1212771905, 1457525058, 1493446008, 1784768208); + bool4x2 r2 = bool4x2(true, false, true, true, false, false, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + uint4x2 a3 = uint4x2(606340844, 1994437705, 301831413, 654230470, 1223625081, 324292199, 1370931020, 1742769166); + uint4x2 b3 = uint4x2(1993422493, 1378671664, 1447376929, 1405041439, 1765183746, 562894655, 1085068880, 1026386862); + bool4x2 r3 = bool4x2(true, false, true, true, true, true, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void uint4x2_operator_less_equal_wide_scalar() + { + uint4x2 a0 = uint4x2(1479531977, 1427983411, 415250630, 1245345407, 1112546666, 1072990632, 1579912858, 101048307); + uint b0 = (2004563877); + bool4x2 r0 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + uint4x2 a1 = uint4x2(1070894375, 1910488590, 85452501, 518127023, 1246249980, 1097326500, 1964410699, 1968139888); + uint b1 = (509818792); + bool4x2 r1 = bool4x2(false, false, true, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 <= b1); + + uint4x2 a2 = uint4x2(1191853379, 1140643434, 754434551, 155343473, 995927387, 974873240, 1773400038, 497436329); + uint b2 = (662096238); + bool4x2 r2 = bool4x2(false, false, false, true, false, false, false, true); + TestUtils.AreEqual(r2, a2 <= b2); + + uint4x2 a3 = uint4x2(1825940497, 1477043363, 1378470734, 96190147, 37188105, 839762283, 781102710, 766321672); + uint b3 = (527516420); + bool4x2 r3 = bool4x2(false, false, false, true, true, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void uint4x2_operator_less_equal_scalar_wide() + { + uint a0 = (1899193992); + uint4x2 b0 = uint4x2(915011820, 980913757, 1337699683, 1476321359, 1102143668, 660493983, 184664508, 381579707); + bool4x2 r0 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 <= b0); + + uint a1 = (1954892821); + uint4x2 b1 = uint4x2(1295090571, 1440368586, 1696003686, 88708652, 1332251857, 1310713644, 2112132784, 48951945); + bool4x2 r1 = bool4x2(false, false, false, false, false, false, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + uint a2 = (1888568027); + uint4x2 b2 = uint4x2(39340955, 1108242207, 260777425, 593122164, 291471959, 253457314, 1264570386, 699618012); + bool4x2 r2 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + uint a3 = (927735863); + uint4x2 b3 = uint4x2(2063158939, 932253787, 1168754049, 749328788, 1882694892, 168499987, 378173027, 339963627); + bool4x2 r3 = bool4x2(true, true, true, false, true, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void uint4x2_operator_greater_equal_wide_wide() + { + uint4x2 a0 = uint4x2(8538378, 2131749726, 265427108, 523609761, 994991818, 839709564, 101288202, 1886280970); + uint4x2 b0 = uint4x2(903145828, 1697992986, 1432491982, 169789504, 1059357300, 1744255222, 1606584463, 1905414425); + bool4x2 r0 = bool4x2(false, true, false, true, false, false, false, false); + TestUtils.AreEqual(r0, a0 >= b0); + + uint4x2 a1 = uint4x2(2032074826, 631221455, 1456286159, 961342752, 424526026, 788481984, 1662488497, 870326690); + uint4x2 b1 = uint4x2(1448794969, 136181998, 1678754836, 2069656857, 398982689, 243317404, 740939613, 1894753119); + bool4x2 r1 = bool4x2(true, true, false, false, true, true, true, false); + TestUtils.AreEqual(r1, a1 >= b1); + + uint4x2 a2 = uint4x2(708712581, 1260182701, 1165630721, 138247561, 1108650168, 1933222913, 672493999, 1541402159); + uint4x2 b2 = uint4x2(301760792, 1260647988, 3608523, 52576030, 903420465, 1648820371, 627296845, 1679808907); + bool4x2 r2 = bool4x2(true, false, true, true, true, true, true, false); + TestUtils.AreEqual(r2, a2 >= b2); + + uint4x2 a3 = uint4x2(1921596027, 1557351956, 147242547, 892772168, 2089286723, 1273466960, 644009998, 654784654); + uint4x2 b3 = uint4x2(1719102039, 1718081638, 655586949, 477267189, 62092869, 2013928066, 280292357, 254052205); + bool4x2 r3 = bool4x2(true, false, false, true, true, false, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void uint4x2_operator_greater_equal_wide_scalar() + { + uint4x2 a0 = uint4x2(2049236663, 182691143, 634973382, 1197012109, 439837565, 1367606469, 1108037359, 351147187); + uint b0 = (1061998015); + bool4x2 r0 = bool4x2(true, false, false, true, false, true, true, false); + TestUtils.AreEqual(r0, a0 >= b0); + + uint4x2 a1 = uint4x2(1898505669, 1998610091, 4652390, 996159180, 2111455181, 727766399, 96217144, 814085575); + uint b1 = (411667685); + bool4x2 r1 = bool4x2(true, true, false, true, true, true, false, true); + TestUtils.AreEqual(r1, a1 >= b1); + + uint4x2 a2 = uint4x2(1525995206, 1732973229, 1473283041, 899444524, 1023753195, 1373738074, 518164359, 717850464); + uint b2 = (1293933760); + bool4x2 r2 = bool4x2(true, true, true, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + uint4x2 a3 = uint4x2(1765188600, 527594558, 1816542874, 839185150, 1143596061, 1819554651, 160724539, 993212636); + uint b3 = (1826820341); + bool4x2 r3 = bool4x2(false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void uint4x2_operator_greater_equal_scalar_wide() + { + uint a0 = (1859811087); + uint4x2 b0 = uint4x2(1070365918, 1783869452, 830091760, 377157428, 327199016, 90384229, 1154649706, 376758501); + bool4x2 r0 = bool4x2(true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + uint a1 = (1079802834); + uint4x2 b1 = uint4x2(2054742898, 1328349472, 434061447, 951207723, 598695892, 975131651, 1714007943, 177416473); + bool4x2 r1 = bool4x2(false, false, true, true, true, true, false, true); + TestUtils.AreEqual(r1, a1 >= b1); + + uint a2 = (1267232721); + uint4x2 b2 = uint4x2(31082860, 216791741, 119054289, 1905107583, 89559116, 55041824, 691334141, 462326883); + bool4x2 r2 = bool4x2(true, true, true, false, true, true, true, true); + TestUtils.AreEqual(r2, a2 >= b2); + + uint a3 = (1658303669); + uint4x2 b3 = uint4x2(914628512, 1134364322, 1677134711, 1955614770, 2067009301, 1454405405, 299467282, 1584922149); + bool4x2 r3 = bool4x2(true, true, false, false, false, true, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void uint4x2_operator_add_wide_wide() + { + uint4x2 a0 = uint4x2(2135171378, 21433296, 1954723494, 683604307, 1054212315, 1762680995, 1963655852, 1257853062); + uint4x2 b0 = uint4x2(1013431952, 366718162, 359290756, 1393163294, 1962236872, 1263270041, 1862666629, 1077447887); + uint4x2 r0 = uint4x2(3148603330, 388151458, 2314014250, 2076767601, 3016449187, 3025951036, 3826322481, 2335300949); + TestUtils.AreEqual(r0, a0 + b0); + + uint4x2 a1 = uint4x2(2043493600, 976898058, 1915056423, 121374462, 1218855698, 700538222, 1702057277, 1788251699); + uint4x2 b1 = uint4x2(821693806, 487316539, 350922520, 1583012528, 1951595076, 1024851344, 874302782, 1383969588); + uint4x2 r1 = uint4x2(2865187406, 1464214597, 2265978943, 1704386990, 3170450774, 1725389566, 2576360059, 3172221287); + TestUtils.AreEqual(r1, a1 + b1); + + uint4x2 a2 = uint4x2(1534939160, 398651016, 1674272498, 374510467, 824322986, 1217622199, 1122376670, 642613771); + uint4x2 b2 = uint4x2(1767968088, 900721406, 1659790033, 1792273749, 443844328, 633981449, 2010244807, 335566991); + uint4x2 r2 = uint4x2(3302907248, 1299372422, 3334062531, 2166784216, 1268167314, 1851603648, 3132621477, 978180762); + TestUtils.AreEqual(r2, a2 + b2); + + uint4x2 a3 = uint4x2(1097903998, 359042741, 929182687, 1713065399, 892057490, 1295346111, 1806236181, 1838589664); + uint4x2 b3 = uint4x2(521931102, 544297835, 1681549647, 1784248858, 585904415, 3128418, 1806236610, 179909533); + uint4x2 r3 = uint4x2(1619835100, 903340576, 2610732334, 3497314257, 1477961905, 1298474529, 3612472791, 2018499197); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void uint4x2_operator_add_wide_scalar() + { + uint4x2 a0 = uint4x2(665815972, 1783729250, 1591678394, 1284528538, 977850224, 71069732, 1138577680, 1200356017); + uint b0 = (1334043849); + uint4x2 r0 = uint4x2(1999859821, 3117773099, 2925722243, 2618572387, 2311894073, 1405113581, 2472621529, 2534399866); + TestUtils.AreEqual(r0, a0 + b0); + + uint4x2 a1 = uint4x2(565982008, 1088001167, 57252642, 678921480, 625943813, 512157429, 1470648741, 1490096953); + uint b1 = (1246759684); + uint4x2 r1 = uint4x2(1812741692, 2334760851, 1304012326, 1925681164, 1872703497, 1758917113, 2717408425, 2736856637); + TestUtils.AreEqual(r1, a1 + b1); + + uint4x2 a2 = uint4x2(1467033531, 1707296407, 1703724354, 1333833947, 653973063, 1139546735, 1834005844, 184572739); + uint b2 = (182608093); + uint4x2 r2 = uint4x2(1649641624, 1889904500, 1886332447, 1516442040, 836581156, 1322154828, 2016613937, 367180832); + TestUtils.AreEqual(r2, a2 + b2); + + uint4x2 a3 = uint4x2(1980578280, 97099208, 421437295, 1251829854, 166844260, 1568146789, 82548613, 533562157); + uint b3 = (1858520040); + uint4x2 r3 = uint4x2(3839098320, 1955619248, 2279957335, 3110349894, 2025364300, 3426666829, 1941068653, 2392082197); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void uint4x2_operator_add_scalar_wide() + { + uint a0 = (359966320); + uint4x2 b0 = uint4x2(2146146202, 767103309, 851002415, 311531406, 1491262941, 1016891373, 1954228994, 1671335850); + uint4x2 r0 = uint4x2(2506112522, 1127069629, 1210968735, 671497726, 1851229261, 1376857693, 2314195314, 2031302170); + TestUtils.AreEqual(r0, a0 + b0); + + uint a1 = (727870747); + uint4x2 b1 = uint4x2(551151834, 1390261152, 1699060326, 115021619, 1964440175, 440700758, 1556692550, 185414255); + uint4x2 r1 = uint4x2(1279022581, 2118131899, 2426931073, 842892366, 2692310922, 1168571505, 2284563297, 913285002); + TestUtils.AreEqual(r1, a1 + b1); + + uint a2 = (933106731); + uint4x2 b2 = uint4x2(1217866784, 729761881, 1742597318, 1090109152, 1467373815, 1066072609, 138237856, 634834665); + uint4x2 r2 = uint4x2(2150973515, 1662868612, 2675704049, 2023215883, 2400480546, 1999179340, 1071344587, 1567941396); + TestUtils.AreEqual(r2, a2 + b2); + + uint a3 = (993603553); + uint4x2 b3 = uint4x2(347587889, 2050191349, 670698672, 1658205080, 1874808705, 2082982954, 869839589, 118460267); + uint4x2 r3 = uint4x2(1341191442, 3043794902, 1664302225, 2651808633, 2868412258, 3076586507, 1863443142, 1112063820); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void uint4x2_operator_sub_wide_wide() + { + uint4x2 a0 = uint4x2(1410318491, 1097280168, 1827039044, 28881338, 328720965, 875487868, 212936325, 231977215); + uint4x2 b0 = uint4x2(1315897366, 799052018, 1580289673, 1094686261, 1954325726, 1197734816, 229886366, 915679176); + uint4x2 r0 = uint4x2(94421125, 298228150, 246749371, 3229162373, 2669362535, 3972720348, 4278017255, 3611265335); + TestUtils.AreEqual(r0, a0 - b0); + + uint4x2 a1 = uint4x2(1740021315, 2011295463, 48079003, 591379285, 1125909359, 1842588095, 848561896, 614448464); + uint4x2 b1 = uint4x2(1746884850, 918743925, 1007797419, 257421324, 287249342, 1617287463, 1653916102, 123586847); + uint4x2 r1 = uint4x2(4288103761, 1092551538, 3335248880, 333957961, 838660017, 225300632, 3489613090, 490861617); + TestUtils.AreEqual(r1, a1 - b1); + + uint4x2 a2 = uint4x2(2067598029, 1618238416, 318516219, 1090119767, 1991095823, 949592162, 1951912339, 1457818751); + uint4x2 b2 = uint4x2(502107404, 672875302, 1256481116, 1975569142, 1794443030, 1327558915, 330955394, 1596041731); + uint4x2 r2 = uint4x2(1565490625, 945363114, 3357002399, 3409517921, 196652793, 3917000543, 1620956945, 4156744316); + TestUtils.AreEqual(r2, a2 - b2); + + uint4x2 a3 = uint4x2(1642553126, 2114366549, 1420516260, 596841760, 724518081, 1820626306, 1885185225, 246124365); + uint4x2 b3 = uint4x2(1069074732, 1120817099, 2076417364, 402521072, 839858844, 1539789702, 559077522, 822288510); + uint4x2 r3 = uint4x2(573478394, 993549450, 3639066192, 194320688, 4179626533, 280836604, 1326107703, 3718803151); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void uint4x2_operator_sub_wide_scalar() + { + uint4x2 a0 = uint4x2(1508669340, 1594795463, 266707545, 643102647, 287705008, 1475644328, 1113286221, 979450511); + uint b0 = (998008471); + uint4x2 r0 = uint4x2(510660869, 596786992, 3563666370, 3940061472, 3584663833, 477635857, 115277750, 4276409336); + TestUtils.AreEqual(r0, a0 - b0); + + uint4x2 a1 = uint4x2(2082174113, 304369206, 999244508, 1806482044, 1994553647, 2101812429, 1482736902, 266654115); + uint b1 = (1108005498); + uint4x2 r1 = uint4x2(974168615, 3491331004, 4186206306, 698476546, 886548149, 993806931, 374731404, 3453615913); + TestUtils.AreEqual(r1, a1 - b1); + + uint4x2 a2 = uint4x2(1470212363, 958542155, 1185075537, 1738124835, 499527536, 1612473406, 1696960099, 1287292743); + uint b2 = (1190349300); + uint4x2 r2 = uint4x2(279863063, 4063160151, 4289693533, 547775535, 3604145532, 422124106, 506610799, 96943443); + TestUtils.AreEqual(r2, a2 - b2); + + uint4x2 a3 = uint4x2(1360229454, 1779621585, 964948785, 1739264125, 94254551, 968533883, 2075770560, 946189008); + uint b3 = (1032360376); + uint4x2 r3 = uint4x2(327869078, 747261209, 4227555705, 706903749, 3356861471, 4231140803, 1043410184, 4208795928); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void uint4x2_operator_sub_scalar_wide() + { + uint a0 = (893369501); + uint4x2 b0 = uint4x2(2051906184, 1699714311, 442603706, 1735141684, 274533585, 811580259, 1196354320, 1524097023); + uint4x2 r0 = uint4x2(3136430613, 3488622486, 450765795, 3453195113, 618835916, 81789242, 3991982477, 3664239774); + TestUtils.AreEqual(r0, a0 - b0); + + uint a1 = (533621527); + uint4x2 b1 = uint4x2(2080845793, 143958837, 1620668660, 1135989346, 1367044745, 554088609, 552670373, 1265516124); + uint4x2 r1 = uint4x2(2747743030, 389662690, 3207920163, 3692599477, 3461544078, 4274500214, 4275918450, 3563072699); + TestUtils.AreEqual(r1, a1 - b1); + + uint a2 = (1254902543); + uint4x2 b2 = uint4x2(1857695581, 1619865274, 1313559400, 99812999, 843597298, 420111239, 1299949060, 531009038); + uint4x2 r2 = uint4x2(3692174258, 3930004565, 4236310439, 1155089544, 411305245, 834791304, 4249920779, 723893505); + TestUtils.AreEqual(r2, a2 - b2); + + uint a3 = (1103306550); + uint4x2 b3 = uint4x2(104920105, 1137308312, 1207332725, 103438360, 1157123503, 1174401240, 701247193, 1498366995); + uint4x2 r3 = uint4x2(998386445, 4260965534, 4190941121, 999868190, 4241150343, 4223872606, 402059357, 3899906851); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void uint4x2_operator_mul_wide_wide() + { + uint4x2 a0 = uint4x2(61417577, 219585476, 1362520891, 1511084277, 1481211272, 58211871, 1459591173, 567624644); + uint4x2 b0 = uint4x2(578042444, 1620527213, 200516468, 309339115, 542853019, 299467282, 1479641221, 1428338601); + uint4x2 r0 = uint4x2(2868103468, 1326150260, 3304073148, 2972110823, 1973926232, 88546350, 3431047833, 3712145508); + TestUtils.AreEqual(r0, a0 * b0); + + uint4x2 a1 = uint4x2(1169935583, 1835691886, 385626539, 85934842, 522856538, 278370196, 289217012, 2083410174); + uint4x2 b1 = uint4x2(1497302909, 1596889147, 427413842, 265122693, 689376654, 1120457204, 516903000, 873091659); + uint4x2 r1 = uint4x2(556671459, 1098186330, 1848083398, 4236646882, 2005201900, 651971856, 2573806560, 4184807018); + TestUtils.AreEqual(r1, a1 * b1); + + uint4x2 a2 = uint4x2(1293162798, 1939730122, 2075923048, 1116477212, 1686101741, 783310758, 248585944, 1093377716); + uint4x2 b2 = uint4x2(1353196495, 1384773500, 1596528529, 2122329305, 1033200564, 996795088, 1137754930, 232014195); + uint4x2 r2 = uint4x2(4175537714, 3758002136, 2245379304, 3535300284, 1443849636, 550781664, 3335949872, 3941859036); + TestUtils.AreEqual(r2, a2 * b2); + + uint4x2 a3 = uint4x2(797038788, 1838048120, 1892922904, 1952024781, 492107602, 1097670675, 2069629919, 20122103); + uint4x2 b3 = uint4x2(1080950243, 1613216909, 463529448, 1781487382, 2101946430, 673144237, 390627073, 964308272); + uint4x2 r3 = uint4x2(3201362380, 264300824, 4173364672, 1825729694, 4053448156, 3048379351, 2230824159, 4043852112); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void uint4x2_operator_mul_wide_scalar() + { + uint4x2 a0 = uint4x2(871746615, 492532311, 570557670, 2142306629, 1610315153, 1526163563, 118471734, 257439514); + uint b0 = (442064533); + uint4x2 r0 = uint4x2(338365955, 1081376419, 2565819870, 3279557417, 3421481829, 4119466055, 3456786286, 513646114); + TestUtils.AreEqual(r0, a0 * b0); + + uint4x2 a1 = uint4x2(364291059, 1584938026, 1357601203, 638897141, 268562104, 1007838321, 1163240135, 1619806399); + uint b1 = (1186560810); + uint4x2 r1 = uint4x2(1029154526, 989596900, 521189470, 2675256626, 1627099696, 753911178, 2433831334, 167687254); + TestUtils.AreEqual(r1, a1 * b1); + + uint4x2 a2 = uint4x2(1444659979, 464517916, 1508043166, 745488654, 636691139, 1851670006, 357357967, 1095280227); + uint b2 = (1127580168); + uint4x2 r2 = uint4x2(204516952, 2345668832, 3245312240, 73999472, 3802078232, 2220284848, 679242360, 1245870360); + TestUtils.AreEqual(r2, a2 * b2); + + uint4x2 a3 = uint4x2(702779195, 1464398841, 51061000, 802418971, 407442471, 638315697, 1889264235, 584402164); + uint b3 = (945802744); + uint4x2 r3 = uint4x2(3708420136, 4218535480, 3727910848, 1852387624, 241680584, 4123396216, 1493698216, 2103324768); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void uint4x2_operator_mul_scalar_wide() + { + uint a0 = (1152242766); + uint4x2 b0 = uint4x2(1276636134, 2105929407, 499007702, 124002565, 1956335172, 1288034953, 832676555, 337389733); + uint4x2 r0 = uint4x2(2165463060, 999811634, 1179056436, 3493540742, 404105400, 1339492798, 3913201114, 3183347270); + TestUtils.AreEqual(r0, a0 * b0); + + uint a1 = (99268757); + uint4x2 b1 = uint4x2(2005055247, 2011389505, 1348110859, 399689191, 2007606374, 2076691289, 1825721194, 769885235); + uint4x2 r1 = uint4x2(559764411, 2675872725, 1022902375, 3289462643, 3609329502, 1103844045, 2105414834, 302946735); + TestUtils.AreEqual(r1, a1 * b1); + + uint a2 = (153314735); + uint4x2 b2 = uint4x2(1066325369, 84289667, 984486192, 1325213504, 1643957457, 1576395620, 2095980601, 907671947); + uint4x2 r2 = uint4x2(1030204087, 35283085, 3545608144, 2102006976, 305231839, 3631801692, 3259597815, 1010199813); + TestUtils.AreEqual(r2, a2 * b2); + + uint a3 = (836919582); + uint4x2 b3 = uint4x2(1412159342, 2037926630, 366590562, 493177763, 2058824164, 497936968, 2136548816, 1211907591); + uint4x2 r3 = uint4x2(3068128484, 4119194868, 1537669500, 3429736474, 1738427576, 4223057008, 3848683104, 1673391058); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void uint4x2_operator_div_wide_wide() + { + uint4x2 a0 = uint4x2(333171510, 858154903, 1181365836, 671357749, 1090606752, 803759420, 788404166, 296807814); + uint4x2 b0 = uint4x2(698897823, 440199998, 655557473, 1658534285, 2127220100, 315653188, 1814290360, 992173243); + uint4x2 r0 = uint4x2(0, 1, 1, 0, 0, 2, 0, 0); + TestUtils.AreEqual(r0, a0 / b0); + + uint4x2 a1 = uint4x2(575260195, 166625280, 1493729000, 1831739736, 200852358, 129983172, 500176108, 472051781); + uint4x2 b1 = uint4x2(914851653, 664340325, 224323977, 246981573, 285573983, 819471609, 2012476015, 1783179572); + uint4x2 r1 = uint4x2(0, 0, 6, 7, 0, 0, 0, 0); + TestUtils.AreEqual(r1, a1 / b1); + + uint4x2 a2 = uint4x2(414699094, 1446535974, 1278480457, 930910505, 263295881, 1626759436, 450830871, 21439121); + uint4x2 b2 = uint4x2(223253978, 169515029, 1694929006, 1992168131, 1155972447, 1768506696, 422325410, 1508417406); + uint4x2 r2 = uint4x2(1, 8, 0, 0, 0, 0, 1, 0); + TestUtils.AreEqual(r2, a2 / b2); + + uint4x2 a3 = uint4x2(521337599, 127756712, 200601965, 412554396, 1014641734, 239347640, 525574301, 1158358177); + uint4x2 b3 = uint4x2(605462475, 66917170, 2014683461, 108847533, 611173330, 895791853, 1999369787, 1225614384); + uint4x2 r3 = uint4x2(0, 1, 0, 3, 1, 0, 0, 0); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void uint4x2_operator_div_wide_scalar() + { + uint4x2 a0 = uint4x2(1433072926, 1073958635, 1195142312, 536596719, 1274375693, 464756346, 806462546, 906504670); + uint b0 = (1434025872); + uint4x2 r0 = uint4x2(0, 0, 0, 0, 0, 0, 0, 0); + TestUtils.AreEqual(r0, a0 / b0); + + uint4x2 a1 = uint4x2(1380905136, 1196815948, 123300377, 643754735, 2084019932, 2047825037, 458304263, 741331531); + uint b1 = (25493909); + uint4x2 r1 = uint4x2(54, 46, 4, 25, 81, 80, 17, 29); + TestUtils.AreEqual(r1, a1 / b1); + + uint4x2 a2 = uint4x2(466443901, 1500687214, 1453264263, 1617154145, 2040203220, 2103351724, 485536709, 402141749); + uint b2 = (2110004616); + uint4x2 r2 = uint4x2(0, 0, 0, 0, 0, 0, 0, 0); + TestUtils.AreEqual(r2, a2 / b2); + + uint4x2 a3 = uint4x2(1477264254, 1549487015, 670594363, 2040479674, 155415284, 207130003, 1596922206, 1730223836); + uint b3 = (1629069474); + uint4x2 r3 = uint4x2(0, 0, 0, 1, 0, 0, 0, 1); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void uint4x2_operator_div_scalar_wide() + { + uint a0 = (519165704); + uint4x2 b0 = uint4x2(1295178177, 775214121, 467772046, 1156881598, 310396565, 759759959, 243837702, 1616314235); + uint4x2 r0 = uint4x2(0, 0, 1, 0, 1, 0, 2, 0); + TestUtils.AreEqual(r0, a0 / b0); + + uint a1 = (1053470225); + uint4x2 b1 = uint4x2(1320630160, 378773841, 4223608, 1971105754, 2054406020, 219939614, 1603672651, 2006134295); + uint4x2 r1 = uint4x2(0, 2, 249, 0, 0, 4, 0, 0); + TestUtils.AreEqual(r1, a1 / b1); + + uint a2 = (888535397); + uint4x2 b2 = uint4x2(1493077923, 615835131, 1045603945, 452709946, 1074919059, 467037221, 1485241506, 1775728786); + uint4x2 r2 = uint4x2(0, 1, 0, 1, 0, 1, 0, 0); + TestUtils.AreEqual(r2, a2 / b2); + + uint a3 = (481521341); + uint4x2 b3 = uint4x2(68149923, 80867357, 1294049272, 470535313, 1235850199, 631464286, 687722755, 412827650); + uint4x2 r3 = uint4x2(7, 5, 0, 1, 0, 0, 0, 1); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void uint4x2_operator_mod_wide_wide() + { + uint4x2 a0 = uint4x2(258342924, 1454754891, 723352342, 1981431473, 531756042, 716993627, 1667903349, 1331097004); + uint4x2 b0 = uint4x2(1990080167, 1197348066, 651970512, 1659454050, 241005212, 1866255454, 1440101415, 595220963); + uint4x2 r0 = uint4x2(258342924, 257406825, 71381830, 321977423, 49745618, 716993627, 227801934, 140655078); + TestUtils.AreEqual(r0, a0 % b0); + + uint4x2 a1 = uint4x2(1776856101, 17598216, 1474345080, 1681376293, 813624265, 1617478722, 498370451, 780075943); + uint4x2 b1 = uint4x2(408818410, 198222574, 549504274, 239973807, 321398087, 658171840, 1511495237, 1048325585); + uint4x2 r1 = uint4x2(141582461, 17598216, 375336532, 1559644, 170828091, 301135042, 498370451, 780075943); + TestUtils.AreEqual(r1, a1 % b1); + + uint4x2 a2 = uint4x2(1754430321, 653235398, 1517128354, 966216200, 590067427, 1283434795, 1910903650, 1125967790); + uint4x2 b2 = uint4x2(1126739824, 666641241, 38017598, 418797691, 618700513, 1941062990, 158556432, 1081063558); + uint4x2 r2 = uint4x2(627690497, 653235398, 34442032, 128620818, 590067427, 1283434795, 8226466, 44904232); + TestUtils.AreEqual(r2, a2 % b2); + + uint4x2 a3 = uint4x2(1180537254, 308567230, 543945394, 483834400, 308703874, 383723801, 1181975437, 1161083599); + uint4x2 b3 = uint4x2(427329468, 148111230, 1251162672, 1856322297, 1214781084, 401954255, 1323259633, 1167744452); + uint4x2 r3 = uint4x2(325878318, 12344770, 543945394, 483834400, 308703874, 383723801, 1181975437, 1161083599); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void uint4x2_operator_mod_wide_scalar() + { + uint4x2 a0 = uint4x2(560988938, 629524514, 767711194, 434281967, 1399805893, 792916846, 1663690927, 598661916); + uint b0 = (1156862367); + uint4x2 r0 = uint4x2(560988938, 629524514, 767711194, 434281967, 242943526, 792916846, 506828560, 598661916); + TestUtils.AreEqual(r0, a0 % b0); + + uint4x2 a1 = uint4x2(1776636144, 1743722161, 475209785, 327476870, 1617696916, 379853074, 477430114, 858399046); + uint b1 = (1287035793); + uint4x2 r1 = uint4x2(489600351, 456686368, 475209785, 327476870, 330661123, 379853074, 477430114, 858399046); + TestUtils.AreEqual(r1, a1 % b1); + + uint4x2 a2 = uint4x2(712734431, 199829950, 362269020, 1986626876, 1351725413, 1549678101, 431765276, 1315833792); + uint b2 = (1506629323); + uint4x2 r2 = uint4x2(712734431, 199829950, 362269020, 479997553, 1351725413, 43048778, 431765276, 1315833792); + TestUtils.AreEqual(r2, a2 % b2); + + uint4x2 a3 = uint4x2(1664893153, 780055604, 104179235, 629966219, 1810536428, 1747026206, 1799535061, 875754431); + uint b3 = (615834034); + uint4x2 r3 = uint4x2(433225085, 164221570, 104179235, 14132185, 578868360, 515358138, 567866993, 259920397); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void uint4x2_operator_mod_scalar_wide() + { + uint a0 = (933347930); + uint4x2 b0 = uint4x2(549923387, 243114953, 1884274390, 1428033594, 655531454, 1622674954, 1107563514, 1614111094); + uint4x2 r0 = uint4x2(383424543, 204003071, 933347930, 933347930, 277816476, 933347930, 933347930, 933347930); + TestUtils.AreEqual(r0, a0 % b0); + + uint a1 = (914801920); + uint4x2 b1 = uint4x2(1432263179, 564431096, 1967013901, 1709750152, 1080102613, 13120773, 2042535998, 1505698002); + uint4x2 r1 = uint4x2(914801920, 350370824, 914801920, 914801920, 914801920, 9468583, 914801920, 914801920); + TestUtils.AreEqual(r1, a1 % b1); + + uint a2 = (1640058084); + uint4x2 b2 = uint4x2(974167554, 758635306, 1387264978, 611743343, 1139002766, 1913935748, 1086810076, 991846486); + uint4x2 r2 = uint4x2(665890530, 122787472, 252793106, 416571398, 501055318, 1640058084, 553248008, 648211598); + TestUtils.AreEqual(r2, a2 % b2); + + uint a3 = (922870408); + uint4x2 b3 = uint4x2(35007468, 891877602, 157349181, 83267982, 801093706, 546272767, 1665089132, 1889242068); + uint4x2 r3 = uint4x2(12676240, 30992806, 136124503, 6922606, 121776702, 376597641, 922870408, 922870408); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void uint4x2_operator_plus() + { + uint4x2 a0 = uint4x2(195392567, 222719748, 1002351013, 1570765263, 109389333, 1515950277, 1689763402, 291471785); + uint4x2 r0 = uint4x2(195392567, 222719748, 1002351013, 1570765263, 109389333, 1515950277, 1689763402, 291471785); + TestUtils.AreEqual(r0, +a0); + + uint4x2 a1 = uint4x2(264115671, 195779102, 2131702223, 715660442, 1995564647, 69731564, 1317851903, 1957501908); + uint4x2 r1 = uint4x2(264115671, 195779102, 2131702223, 715660442, 1995564647, 69731564, 1317851903, 1957501908); + TestUtils.AreEqual(r1, +a1); + + uint4x2 a2 = uint4x2(531426536, 1334133318, 1539671418, 935436165, 1575048895, 2119066258, 781435471, 1659000230); + uint4x2 r2 = uint4x2(531426536, 1334133318, 1539671418, 935436165, 1575048895, 2119066258, 781435471, 1659000230); + TestUtils.AreEqual(r2, +a2); + + uint4x2 a3 = uint4x2(1301861249, 1360657696, 578750954, 150348334, 1791553179, 1288641627, 735146513, 328684789); + uint4x2 r3 = uint4x2(1301861249, 1360657696, 578750954, 150348334, 1791553179, 1288641627, 735146513, 328684789); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void uint4x2_operator_neg() + { + uint4x2 a0 = uint4x2(1385088677, 94114564, 1350664872, 1458616659, 2067164853, 218122493, 958484951, 270553961); + uint4x2 r0 = uint4x2(2909878619, 4200852732, 2944302424, 2836350637, 2227802443, 4076844803, 3336482345, 4024413335); + TestUtils.AreEqual(r0, -a0); + + uint4x2 a1 = uint4x2(446497525, 1928771252, 1427605822, 2051940607, 1434247484, 485368391, 908365416, 1742096480); + uint4x2 r1 = uint4x2(3848469771, 2366196044, 2867361474, 2243026689, 2860719812, 3809598905, 3386601880, 2552870816); + TestUtils.AreEqual(r1, -a1); + + uint4x2 a2 = uint4x2(990033169, 1350976157, 12802586, 1934372287, 576597401, 785136322, 559205611, 1959833280); + uint4x2 r2 = uint4x2(3304934127, 2943991139, 4282164710, 2360595009, 3718369895, 3509830974, 3735761685, 2335134016); + TestUtils.AreEqual(r2, -a2); + + uint4x2 a3 = uint4x2(162379661, 95281343, 1969004480, 1381288239, 252975075, 1961335692, 1607042487, 832886233); + uint4x2 r3 = uint4x2(4132587635, 4199685953, 2325962816, 2913679057, 4041992221, 2333631604, 2687924809, 3462081063); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void uint4x2_operator_prefix_inc() + { + uint4x2 a0 = uint4x2(780471723, 954741756, 272723451, 2142862245, 606294309, 1514814550, 250124151, 444189162); + uint4x2 r0 = uint4x2(780471724, 954741757, 272723452, 2142862246, 606294310, 1514814551, 250124152, 444189163); + TestUtils.AreEqual(r0, ++a0); + + uint4x2 a1 = uint4x2(1833356994, 1348278302, 129540735, 1584496757, 1170613526, 986715680, 1701179230, 1397451003); + uint4x2 r1 = uint4x2(1833356995, 1348278303, 129540736, 1584496758, 1170613527, 986715681, 1701179231, 1397451004); + TestUtils.AreEqual(r1, ++a1); + + uint4x2 a2 = uint4x2(483952900, 1268688387, 2014528731, 453850931, 1112537171, 621362788, 2063486914, 1612870531); + uint4x2 r2 = uint4x2(483952901, 1268688388, 2014528732, 453850932, 1112537172, 621362789, 2063486915, 1612870532); + TestUtils.AreEqual(r2, ++a2); + + uint4x2 a3 = uint4x2(1161037742, 1583359796, 82587894, 810087437, 72436569, 1094485773, 912422931, 1011314676); + uint4x2 r3 = uint4x2(1161037743, 1583359797, 82587895, 810087438, 72436570, 1094485774, 912422932, 1011314677); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void uint4x2_operator_postfix_inc() + { + uint4x2 a0 = uint4x2(241865086, 2145821641, 1596166022, 803592338, 529551271, 1656767229, 903047443, 1213663244); + uint4x2 r0 = uint4x2(241865086, 2145821641, 1596166022, 803592338, 529551271, 1656767229, 903047443, 1213663244); + TestUtils.AreEqual(r0, a0++); + + uint4x2 a1 = uint4x2(1425753247, 389844650, 1159795446, 1343289659, 1227160199, 947635082, 137930180, 451018043); + uint4x2 r1 = uint4x2(1425753247, 389844650, 1159795446, 1343289659, 1227160199, 947635082, 137930180, 451018043); + TestUtils.AreEqual(r1, a1++); + + uint4x2 a2 = uint4x2(1634297552, 1176922170, 388721494, 2381860, 2062858295, 715101397, 1725384327, 446867079); + uint4x2 r2 = uint4x2(1634297552, 1176922170, 388721494, 2381860, 2062858295, 715101397, 1725384327, 446867079); + TestUtils.AreEqual(r2, a2++); + + uint4x2 a3 = uint4x2(2101314783, 1683365096, 1319511974, 1418603655, 1938539756, 592683318, 1576213022, 1150548583); + uint4x2 r3 = uint4x2(2101314783, 1683365096, 1319511974, 1418603655, 1938539756, 592683318, 1576213022, 1150548583); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void uint4x2_operator_prefix_dec() + { + uint4x2 a0 = uint4x2(1331961415, 1612382200, 1401591249, 2042075388, 1757136546, 1895858159, 1467742422, 578341664); + uint4x2 r0 = uint4x2(1331961414, 1612382199, 1401591248, 2042075387, 1757136545, 1895858158, 1467742421, 578341663); + TestUtils.AreEqual(r0, --a0); + + uint4x2 a1 = uint4x2(1336115745, 1169239112, 1862369220, 312317355, 1027543764, 1595492535, 1426262619, 1426620468); + uint4x2 r1 = uint4x2(1336115744, 1169239111, 1862369219, 312317354, 1027543763, 1595492534, 1426262618, 1426620467); + TestUtils.AreEqual(r1, --a1); + + uint4x2 a2 = uint4x2(674685792, 1459529624, 2092317419, 107501474, 1261583506, 512900840, 1496855314, 777588547); + uint4x2 r2 = uint4x2(674685791, 1459529623, 2092317418, 107501473, 1261583505, 512900839, 1496855313, 777588546); + TestUtils.AreEqual(r2, --a2); + + uint4x2 a3 = uint4x2(617644613, 625907330, 1452782388, 804650978, 2076275981, 120447533, 262357170, 1887136873); + uint4x2 r3 = uint4x2(617644612, 625907329, 1452782387, 804650977, 2076275980, 120447532, 262357169, 1887136872); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void uint4x2_operator_postfix_dec() + { + uint4x2 a0 = uint4x2(1870005937, 1708534798, 704493460, 462940703, 2060593573, 228744869, 940247280, 1818778351); + uint4x2 r0 = uint4x2(1870005937, 1708534798, 704493460, 462940703, 2060593573, 228744869, 940247280, 1818778351); + TestUtils.AreEqual(r0, a0--); + + uint4x2 a1 = uint4x2(1015253889, 1401191870, 2080259851, 653673271, 140452688, 1928164223, 1760916301, 1174531383); + uint4x2 r1 = uint4x2(1015253889, 1401191870, 2080259851, 653673271, 140452688, 1928164223, 1760916301, 1174531383); + TestUtils.AreEqual(r1, a1--); + + uint4x2 a2 = uint4x2(634036198, 1669210509, 874927437, 1393579866, 471308632, 620865961, 220103745, 1407678826); + uint4x2 r2 = uint4x2(634036198, 1669210509, 874927437, 1393579866, 471308632, 620865961, 220103745, 1407678826); + TestUtils.AreEqual(r2, a2--); + + uint4x2 a3 = uint4x2(319906934, 488775250, 1681733117, 1916879863, 2060905976, 636358505, 1379709480, 451326084); + uint4x2 r3 = uint4x2(319906934, 488775250, 1681733117, 1916879863, 2060905976, 636358505, 1379709480, 451326084); + TestUtils.AreEqual(r3, a3--); + } + + [TestCompiler] + public static void uint4x2_operator_bitwise_and_wide_wide() + { + uint4x2 a0 = uint4x2(1055241304, 859321394, 1088358961, 2090949513, 300561740, 651904515, 1331035868, 2012752753); + uint4x2 b0 = uint4x2(749698416, 748105424, 1842764797, 9990577, 1989102105, 1666634755, 58116798, 868036607); + uint4x2 r0 = uint4x2(749024336, 537928720, 1087769137, 8409473, 277479432, 575816707, 55888540, 867707761); + TestUtils.AreEqual(r0, a0 & b0); + + uint4x2 a1 = uint4x2(1298126656, 53199569, 1752363533, 1303061302, 1929998247, 1504941434, 470682792, 713577376); + uint4x2 b1 = uint4x2(1420638875, 1308767169, 564040763, 478617502, 806150474, 674015378, 1505309955, 36064977); + uint4x2 r1 = uint4x2(1141707264, 33686209, 538087433, 209912598, 805855490, 136347666, 403178496, 33571456); + TestUtils.AreEqual(r1, a1 & b1); + + uint4x2 a2 = uint4x2(1493231658, 1340884669, 1577921467, 44846626, 1105094388, 1143008413, 333009589, 2116296009); + uint4x2 b2 = uint4x2(1779639327, 808650076, 1634437037, 1997568501, 1930853951, 1901503461, 1508772523, 2010961769); + uint4x2 r2 = uint4x2(1207967754, 2098204, 1074332585, 33572896, 1091986996, 1073782917, 298320545, 1979979081); + TestUtils.AreEqual(r2, a2 & b2); + + uint4x2 a3 = uint4x2(2067254825, 121795325, 2122365250, 1088796653, 1594120761, 965590824, 337823363, 1686791432); + uint4x2 b3 = uint4x2(1495957269, 1914669725, 1263994006, 491200541, 380703892, 282208487, 1416934135, 942735432); + uint4x2 r3 = uint4x2(1495420417, 33686173, 1241513986, 4530189, 369102864, 276834336, 337674883, 536870920); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void uint4x2_operator_bitwise_and_wide_scalar() + { + uint4x2 a0 = uint4x2(1513158868, 284695609, 734595037, 1566510707, 1601252476, 84213838, 314333543, 430856908); + uint b0 = (1173647397); + uint4x2 r0 = uint4x2(1076916228, 15732769, 29360133, 1163132961, 1164976164, 84148228, 11816997, 27545604); + TestUtils.AreEqual(r0, a0 & b0); + + uint4x2 a1 = uint4x2(753481263, 1619794917, 2143619546, 1873208293, 126982769, 651482651, 1383096952, 1689107088); + uint b1 = (327392481); + uint4x2 r1 = uint4x2(8459297, 8394977, 327223488, 58884321, 58824801, 41980929, 301989984, 8493184); + TestUtils.AreEqual(r1, a1 & b1); + + uint4x2 a2 = uint4x2(1368301071, 1729929586, 989550739, 1914435619, 1592791064, 2047510829, 678485991, 586400261); + uint b2 = (366962092); + uint4x2 r2 = uint4x2(294519820, 85729568, 282804352, 270229536, 349175816, 269091116, 5260708, 13844484); + TestUtils.AreEqual(r2, a2 & b2); + + uint4x2 a3 = uint4x2(771972179, 131945492, 1707451796, 394184188, 1943201012, 558008097, 1070093422, 34324916); + uint b3 = (309059606); + uint4x2 r3 = uint4x2(33767442, 38354964, 4300820, 308985876, 306372628, 4358144, 306724870, 34324500); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void uint4x2_operator_bitwise_and_scalar_wide() + { + uint a0 = (477163326); + uint4x2 b0 = uint4x2(110453385, 703240362, 2075630560, 1884904031, 1734899436, 947945203, 1664399051, 458879298); + uint4x2 r0 = uint4x2(68182536, 140544042, 405834528, 273697310, 73426476, 402681394, 3188234, 407953666); + TestUtils.AreEqual(r0, a0 & b0); + + uint a1 = (158491426); + uint4x2 b1 = uint4x2(79772356, 2054527944, 202228212, 359225061, 639811396, 1821945318, 1821303024, 2030124055); + uint4x2 r1 = uint4x2(4203008, 141558528, 134234400, 23085600, 2237184, 135274786, 134373408, 151003138); + TestUtils.AreEqual(r1, a1 & b1); + + uint a2 = (1985961756); + uint4x2 b2 = uint4x2(579780373, 2061831301, 1139618293, 1145191868, 1121606282, 1414714065, 688688277, 1508875606); + uint4x2 r2 = uint4x2(571350804, 1917127684, 1112346900, 1145183516, 1113217544, 1414681104, 537660436, 1347362068); + TestUtils.AreEqual(r2, a2 & b2); + + uint a3 = (664318814); + uint4x2 b3 = uint4x2(2092766410, 1010043618, 599967779, 47076367, 1325716015, 1119912335, 2083412385, 1805692137); + uint4x2 r3 = uint4x2(613945418, 605028930, 595623938, 42471438, 117477902, 41976078, 604508416, 595632200); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void uint4x2_operator_bitwise_or_wide_wide() + { + uint4x2 a0 = uint4x2(1920951869, 1750772852, 1420019191, 732977093, 1169579447, 229437930, 1966721348, 2039812323); + uint4x2 b0 = uint4x2(214585254, 275414367, 858759675, 190211455, 1218691723, 2129565457, 1862809466, 495728846); + uint4x2 r0 = uint4x2(2130669503, 2021326207, 2008016383, 737572863, 1303895999, 2146367483, 2134507390, 2107455727); + TestUtils.AreEqual(r0, a0 | b0); + + uint4x2 a1 = uint4x2(113550869, 1912038362, 1569990624, 1490718227, 1686257697, 2137727522, 1569900650, 856504729); + uint4x2 b1 = uint4x2(868064152, 1756913766, 933656055, 247722084, 1884195075, 1804207631, 1913174711, 1815920856); + uint4x2 r1 = uint4x2(939376541, 2046780414, 2142664695, 1591475831, 1959708963, 2146117167, 2140863231, 2134768089); + TestUtils.AreEqual(r1, a1 | b1); + + uint4x2 a2 = uint4x2(2033376384, 2086259889, 671790684, 1189001916, 1756048437, 417084592, 2024165808, 966008272); + uint4x2 b2 = uint4x2(1226577606, 1696467642, 186912044, 1778908130, 1461256625, 1142152181, 272117331, 1162254035); + uint4x2 r2 = uint4x2(2034163398, 2103430843, 724483964, 1860172798, 2142973365, 1558183925, 2025750515, 2111217619); + TestUtils.AreEqual(r2, a2 | b2); + + uint4x2 a3 = uint4x2(2031026290, 1461019191, 1071959084, 1645847295, 871350674, 736640317, 868515800, 767794452); + uint4x2 b3 = uint4x2(870448102, 1845053992, 257334526, 987295814, 1503050768, 1683307763, 1076253109, 1403888383); + uint4x2 r3 = uint4x2(2079325174, 2147314239, 1073143038, 2061103871, 2080374162, 1878867455, 1944485885, 2146418687); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void uint4x2_operator_bitwise_or_wide_scalar() + { + uint4x2 a0 = uint4x2(1295304853, 1307252624, 350194630, 1128063578, 1774824542, 2085245467, 1988423804, 999162350); + uint b0 = (1305527136); + uint4x2 r0 = uint4x2(1307888629, 1308350448, 1574947814, 1341973370, 1842999166, 2111492987, 2144662396, 2145305582); + TestUtils.AreEqual(r0, a0 | b0); + + uint4x2 a1 = uint4x2(2110327307, 341855232, 1317039676, 228656898, 41280811, 1536908787, 606786773, 1739461580); + uint b1 = (1050875188); + uint4x2 r1 = uint4x2(2146115391, 1055087924, 2124644156, 1067652918, 1056437567, 2142985719, 1051448821, 2142181372); + TestUtils.AreEqual(r1, a1 | b1); + + uint4x2 a2 = uint4x2(2040936581, 1377874553, 1522262112, 1496806239, 1732466858, 1535976093, 375675620, 1614193383); + uint b2 = (1350320187); + uint4x2 r2 = uint4x2(2046720191, 1383920251, 1526718587, 1501524863, 2004834491, 1543332543, 1450990335, 1887363839); + TestUtils.AreEqual(r2, a2 | b2); + + uint4x2 a3 = uint4x2(226059393, 112556963, 1614163749, 1583289054, 1370656810, 1286074530, 1155438844, 1835671387); + uint b3 = (697385997); + uint4x2 r3 = uint4x2(771318925, 800423855, 1773629229, 2145343199, 2041828399, 1840772271, 1843387645, 1845190495); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void uint4x2_operator_bitwise_or_scalar_wide() + { + uint a0 = (1768627592); + uint4x2 b0 = uint4x2(1849658052, 1759912154, 729979455, 975926310, 1987690876, 1809506714, 1160695341, 408963395); + uint4x2 r0 = uint4x2(1870634956, 1777286618, 1810603967, 2070642094, 2138824188, 1811676570, 1836048301, 2037079499); + TestUtils.AreEqual(r0, a0 | b0); + + uint a1 = (314072711); + uint4x2 b1 = uint4x2(1560007537, 1709003416, 977086639, 1448375596, 1689568808, 595543345, 559778387, 621080913); + uint4x2 r1 = uint4x2(1593565175, 2013093535, 985497263, 1459388335, 1992089263, 872374199, 872275671, 935133143); + TestUtils.AreEqual(r1, a1 | b1); + + uint a2 = (438994183); + uint4x2 b2 = uint4x2(1742637145, 1219409263, 1602932494, 1204461702, 2111538444, 836730895, 1207638621, 802100209); + uint4x2 r2 = uint4x2(2147388767, 1521399151, 1605029647, 1609213319, 2147190031, 1006601487, 1610325855, 1072666615); + TestUtils.AreEqual(r2, a2 | b2); + + uint a3 = (1089077339); + uint4x2 b3 = uint4x2(1315030334, 249047666, 1604790897, 1848168086, 347254235, 1777613639, 1876731927, 842785732); + uint4x2 r3 = uint4x2(1324074367, 1325017723, 1609509499, 1860882143, 1425714651, 1778269023, 1878960223, 1929110495); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void uint4x2_operator_bitwise_xor_wide_wide() + { + uint4x2 a0 = uint4x2(1843655608, 362425681, 640805534, 1342040268, 945678755, 980321850, 390165019, 1682422658); + uint4x2 b0 = uint4x2(1422803441, 1234691140, 119589253, 1101464929, 121896337, 1880109018, 1000210266, 1718938232); + uint4x2 r0 = uint4x2(959296073, 1544407317, 554771227, 240840109, 1058935858, 1249815008, 752651585, 36917754); + TestUtils.AreEqual(r0, a0 ^ b0); + + uint4x2 a1 = uint4x2(303897251, 230477768, 1103646442, 1503102919, 26631152, 1016475570, 1862440929, 379588576); + uint4x2 b1 = uint4x2(464406940, 884337881, 34199854, 1430659227, 126415540, 1069919967, 1810763253, 2082802224); + uint4x2 r1 = uint4x2(162747199, 956900113, 1136760772, 215066460, 102672708, 55804269, 82614804, 1787102672); + TestUtils.AreEqual(r1, a1 ^ b1); + + uint4x2 a2 = uint4x2(1943580404, 691527166, 723280696, 497086939, 1640104913, 893178410, 1596765788, 664096470); + uint4x2 b2 = uint4x2(941097951, 27782297, 156353074, 607061607, 470737131, 1151564598, 8268481, 434405645); + uint4x2 r2 = uint4x2(1270918443, 680538471, 575512842, 965736380, 2110579514, 1906288924, 1599249565, 1047646171); + TestUtils.AreEqual(r2, a2 ^ b2); + + uint4x2 a3 = uint4x2(2043360590, 799560121, 287637604, 696169196, 2067184169, 1208059988, 1250597330, 1386507647); + uint4x2 b3 = uint4x2(519003095, 1880915120, 608970922, 1809455754, 1079250101, 514389994, 272120301, 1282399149); + uint4x2 r3 = uint4x2(1730440857, 1605643529, 896084174, 1118087270, 996325020, 1453948862, 1521655871, 516667090); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void uint4x2_operator_bitwise_xor_wide_scalar() + { + uint4x2 a0 = uint4x2(169345668, 176087064, 2084362901, 1663924004, 193851255, 517476661, 905336222, 863800783); + uint b0 = (354464228); + uint4x2 r0 = uint4x2(523809632, 526275068, 1763470193, 1980614336, 514678419, 200843473, 550954106, 643578923); + TestUtils.AreEqual(r0, a0 ^ b0); + + uint4x2 a1 = uint4x2(365003873, 954341348, 1464576786, 625604047, 1700827127, 2003392824, 1481813598, 1077374714); + uint b1 = (835837496); + uint4x2 r1 = uint4x2(605051481, 154388956, 1721398570, 345517047, 1420906959, 1186498304, 1770221670, 1910943938); + TestUtils.AreEqual(r1, a1 ^ b1); + + uint4x2 a2 = uint4x2(1043379893, 781860967, 60088394, 1196907956, 858716109, 858484213, 178843494, 1223183458); + uint b2 = (1991576049); + uint4x2 r2 = uint4x2(1216724804, 1479494038, 1965156795, 836916293, 1167851068, 1168008196, 2082334359, 1046300051); + TestUtils.AreEqual(r2, a2 ^ b2); + + uint4x2 a3 = uint4x2(866652388, 1206307664, 2037729583, 1324393116, 497725784, 1367278685, 962962860, 906632547); + uint b3 = (1771693181); + uint4x2 r3 = uint4x2(1513223321, 780087085, 283946322, 661210849, 1949521189, 954654752, 1358709201, 1603533086); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void uint4x2_operator_bitwise_xor_scalar_wide() + { + uint a0 = (1361775641); + uint4x2 b0 = uint4x2(1452773578, 459050892, 1986218254, 1689037698, 999278344, 1229114508, 1087843538, 733699740); + uint4x2 r0 = uint4x2(129801427, 1249346453, 659047703, 898082715, 1789184785, 409583765, 301736139, 2056278661); + TestUtils.AreEqual(r0, a0 ^ b0); + + uint a1 = (106187872); + uint4x2 b1 = uint4x2(1533632738, 1107817672, 492506236, 597602329, 1439603382, 1001169118, 1231718216, 1693179077); + uint4x2 r1 = uint4x2(1564290178, 1146337448, 453984284, 634059897, 1402656470, 1039723710, 1329515304, 1656721573); + TestUtils.AreEqual(r1, a1 ^ b1); + + uint a2 = (1050897427); + uint4x2 b2 = uint4x2(1796435561, 1100532547, 2106589181, 79691722, 851486414, 381749210, 1743618507, 2038827673); + uint4x2 r2 = uint4x2(1437598330, 2134615888, 1126994926, 974951385, 207866589, 677538761, 1498344920, 1193633418); + TestUtils.AreEqual(r2, a2 ^ b2); + + uint a3 = (1680906962); + uint4x2 b3 = uint4x2(161437943, 171927307, 277703584, 1344718195, 1634011177, 28540247, 1205447252, 150341716); + uint4x2 r3 = uint4x2(1840235045, 1846541785, 1958605170, 873881505, 89494267, 1703143301, 602484870, 1824952966); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void uint4x2_operator_left_shift() + { + uint4x2 a0 = uint4x2(1129100049, 829482269, 1571297368, 443753193, 1872142968, 249554593, 892627436, 980302862); + int b0 = (218351941); + uint4x2 r0 = uint4x2(1771463200, 773628832, 3036875520, 1315200288, 4074000128, 3690779680, 2794274176, 1304920512); + TestUtils.AreEqual(r0, a0 << b0); + + uint4x2 a1 = uint4x2(62369727, 1271350845, 108441902, 1959056531, 1779118882, 1451674188, 2082026915, 1149883636); + int b1 = (849916599); + uint4x2 r1 = uint4x2(3749707776, 511705088, 2533359616, 1233125376, 2432696320, 637534208, 3514826752, 2046820352); + TestUtils.AreEqual(r1, a1 << b1); + + uint4x2 a2 = uint4x2(1380536034, 1487486874, 1498738574, 752067504, 1647167336, 772453640, 456967739, 947384545); + int b2 = (186532735); + uint4x2 r2 = uint4x2(0, 0, 0, 0, 0, 0, 2147483648, 2147483648); + TestUtils.AreEqual(r2, a2 << b2); + + uint4x2 a3 = uint4x2(1463252873, 640579158, 56630178, 1650899378, 2142944517, 565484033, 965161323, 1634169280); + int b3 = (1315516161); + uint4x2 r3 = uint4x2(2926505746, 1281158316, 113260356, 3301798756, 4285889034, 1130968066, 1930322646, 3268338560); + TestUtils.AreEqual(r3, a3 << b3); + } + + [TestCompiler] + public static void uint4x2_operator_right_shift() + { + uint4x2 a0 = uint4x2(809126085, 908563670, 763568837, 1986717290, 1174507510, 646821842, 1242726074, 390811632); + int b0 = (994800051); + uint4x2 r0 = uint4x2(1543, 1732, 1456, 3789, 2240, 1233, 2370, 745); + TestUtils.AreEqual(r0, a0 >> b0); + + uint4x2 a1 = uint4x2(1521420393, 102096936, 400863878, 667378673, 1611921244, 307750782, 479442287, 2014389412); + int b1 = (1923166649); + uint4x2 r1 = uint4x2(45, 3, 11, 19, 48, 9, 14, 60); + TestUtils.AreEqual(r1, a1 >> b1); + + uint4x2 a2 = uint4x2(1673938174, 1248577253, 848199210, 813936577, 848976170, 500930883, 662405800, 126875849); + int b2 = (1075916177); + uint4x2 r2 = uint4x2(12771, 9525, 6471, 6209, 6477, 3821, 5053, 967); + TestUtils.AreEqual(r2, a2 >> b2); + + uint4x2 a3 = uint4x2(1103917083, 955487090, 1013356510, 391605984, 185228398, 87452680, 2021602226, 1401766495); + int b3 = (1199000503); + uint4x2 r3 = uint4x2(131, 113, 120, 46, 22, 10, 240, 167); + TestUtils.AreEqual(r3, a3 >> b3); + } + + [TestCompiler] + public static void uint4x2_operator_bitwise_not() + { + uint4x2 a0 = uint4x2(111796841, 603562399, 745091931, 853183268, 1110916612, 381888399, 1891338755, 1506860135); + uint4x2 r0 = uint4x2(4183170454, 3691404896, 3549875364, 3441784027, 3184050683, 3913078896, 2403628540, 2788107160); + TestUtils.AreEqual(r0, ~a0); + + uint4x2 a1 = uint4x2(771210628, 875964607, 96456785, 916013379, 203444882, 1172294211, 1020232736, 683852713); + uint4x2 r1 = uint4x2(3523756667, 3419002688, 4198510510, 3378953916, 4091522413, 3122673084, 3274734559, 3611114582); + TestUtils.AreEqual(r1, ~a1); + + uint4x2 a2 = uint4x2(375158799, 1218471344, 1174233245, 592898220, 443427914, 1385118179, 215320517, 860122767); + uint4x2 r2 = uint4x2(3919808496, 3076495951, 3120734050, 3702069075, 3851539381, 2909849116, 4079646778, 3434844528); + TestUtils.AreEqual(r2, ~a2); + + uint4x2 a3 = uint4x2(1411266016, 686325107, 829984855, 191189901, 319233142, 156019905, 1467719681, 1193642973); + uint4x2 r3 = uint4x2(2883701279, 3608642188, 3464982440, 4103777394, 3975734153, 4138947390, 2827247614, 3101324322); + TestUtils.AreEqual(r3, ~a3); + } + + [TestCase /* For player builds */] + public static void uint4x2_EqualsObjectOverride() + { + TestUtils.IsFalse(new uint4x2().Equals((object)new int())); + TestUtils.IsTrue(new uint4x2().Equals((object)new uint4x2())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestUint4x2.gen.cs.meta b/src/Tests/Tests/Shared/TestUint4x2.gen.cs.meta new file mode 100644 index 00000000..89848b5b --- /dev/null +++ b/src/Tests/Tests/Shared/TestUint4x2.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 89ef12b5bac48bb47b957005fa49bd89 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestUint4x3.gen.cs b/src/Tests/Tests/Shared/TestUint4x3.gen.cs new file mode 100644 index 00000000..f750426b --- /dev/null +++ b/src/Tests/Tests/Shared/TestUint4x3.gen.cs @@ -0,0 +1,1240 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestUint4x3 + { + [TestCompiler] + public static void uint4x3_zero() + { + TestUtils.AreEqual(0u, uint4x3.zero.c0.x); + TestUtils.AreEqual(0u, uint4x3.zero.c0.y); + TestUtils.AreEqual(0u, uint4x3.zero.c0.z); + TestUtils.AreEqual(0u, uint4x3.zero.c0.w); + TestUtils.AreEqual(0u, uint4x3.zero.c1.x); + TestUtils.AreEqual(0u, uint4x3.zero.c1.y); + TestUtils.AreEqual(0u, uint4x3.zero.c1.z); + TestUtils.AreEqual(0u, uint4x3.zero.c1.w); + TestUtils.AreEqual(0u, uint4x3.zero.c2.x); + TestUtils.AreEqual(0u, uint4x3.zero.c2.y); + TestUtils.AreEqual(0u, uint4x3.zero.c2.z); + TestUtils.AreEqual(0u, uint4x3.zero.c2.w); + } + + [TestCompiler] + public static void uint4x3_operator_equal_wide_wide() + { + uint4x3 a0 = uint4x3(2105871082, 35218899, 1550755093, 764676020, 606743782, 1208156098, 1023640014, 1038468316, 1416064367, 727143393, 2061243891, 184669837); + uint4x3 b0 = uint4x3(1477587886, 579629692, 540974792, 208405066, 2063397938, 1060167409, 362592601, 2097545362, 277670088, 426944490, 901076223, 857900673); + bool4x3 r0 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + uint4x3 a1 = uint4x3(1303661760, 2044073738, 370395888, 1822916805, 1076983135, 345215866, 833676277, 1987782708, 1481088614, 1364754268, 93639636, 1850596922); + uint4x3 b1 = uint4x3(1548779757, 325265488, 312658571, 176373760, 2052378097, 858156597, 982817797, 1252095508, 882634538, 1959142806, 72495800, 1077678183); + bool4x3 r1 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + uint4x3 a2 = uint4x3(2073471507, 1745989448, 28118669, 1267554232, 1292918049, 1423451579, 644384701, 1985492825, 240481133, 2130667921, 17376735, 1263869085); + uint4x3 b2 = uint4x3(1729269763, 1607675346, 1813461519, 1204794859, 1324801873, 1975336, 439410532, 294085211, 1031782338, 1118745564, 180311719, 433246570); + bool4x3 r2 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + uint4x3 a3 = uint4x3(437371027, 1093339523, 1683805602, 764261037, 1845666482, 399277628, 714152770, 148255091, 784823865, 1712722195, 1706849865, 607710807); + uint4x3 b3 = uint4x3(1622531532, 1178609353, 373010678, 1231165960, 966395555, 788609772, 215241459, 1411005263, 1287904654, 1656358051, 1985807372, 1041678082); + bool4x3 r3 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void uint4x3_operator_equal_wide_scalar() + { + uint4x3 a0 = uint4x3(437822262, 2020661134, 541786900, 853113810, 23716499, 179951405, 1409026299, 948838849, 953202998, 691955848, 1926262965, 1851546137); + uint b0 = (1332833578); + bool4x3 r0 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + uint4x3 a1 = uint4x3(712957637, 1049962241, 1836975611, 1016802970, 390120467, 464814777, 1451642042, 289137869, 152339338, 808355440, 660053867, 597354173); + uint b1 = (2028784869); + bool4x3 r1 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + uint4x3 a2 = uint4x3(67320270, 35153827, 602895443, 186996278, 129611815, 1031574999, 1697392883, 1463742000, 857785521, 611116281, 594150729, 375387566); + uint b2 = (151461188); + bool4x3 r2 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + uint4x3 a3 = uint4x3(1984352551, 570698441, 1872629381, 1263218472, 315982238, 122473806, 1404530826, 43943273, 1695786992, 2085125114, 432271298, 465353570); + uint b3 = (1925707182); + bool4x3 r3 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void uint4x3_operator_equal_scalar_wide() + { + uint a0 = (542329200); + uint4x3 b0 = uint4x3(1115584594, 684107773, 1928988941, 890709324, 641152437, 1410341302, 497505660, 1068223109, 2014009435, 213835595, 1592428361, 1819361470); + bool4x3 r0 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + uint a1 = (448650623); + uint4x3 b1 = uint4x3(1942175642, 64377057, 1485938610, 1146305380, 1312317120, 263290348, 812663708, 1585209188, 40646617, 1378718922, 1957797737, 873652576); + bool4x3 r1 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + uint a2 = (1780082094); + uint4x3 b2 = uint4x3(1513270921, 2095980581, 1413074719, 1387984261, 1547119354, 924385171, 1253636050, 1477542688, 969120167, 591812191, 856880926, 1114040166); + bool4x3 r2 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + uint a3 = (2107388425); + uint4x3 b3 = uint4x3(1368188588, 512677295, 1337925727, 2076181515, 1317314747, 299981273, 601822512, 1079453890, 125277108, 1257151509, 1915342590, 1034639325); + bool4x3 r3 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void uint4x3_operator_not_equal_wide_wide() + { + uint4x3 a0 = uint4x3(1977284100, 1293292704, 1547283851, 422428953, 195833190, 1711544892, 5606053, 737069074, 647386678, 13079405, 1413841590, 1076166545); + uint4x3 b0 = uint4x3(1514195556, 957972049, 507667364, 581861672, 1128094576, 940096636, 57559040, 181752616, 962017320, 1762015406, 1107218953, 2042026522); + bool4x3 r0 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + uint4x3 a1 = uint4x3(1211445174, 1289303469, 1436402489, 1129570126, 1566836685, 1343313905, 329259205, 1774944480, 33906739, 2055853627, 2035015372, 1702756001); + uint4x3 b1 = uint4x3(836002288, 570272309, 2112081980, 1500634658, 1787808345, 566425667, 2037529609, 1520589840, 266793699, 538816359, 2075474643, 553571317); + bool4x3 r1 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + uint4x3 a2 = uint4x3(1164186087, 329853698, 769052491, 1893312730, 438029011, 1894010522, 1365847542, 1292942830, 2146008097, 1520743598, 861728782, 1999977058); + uint4x3 b2 = uint4x3(218264354, 654754196, 1392180230, 870065147, 1398749829, 711281563, 1999640291, 231234857, 210910234, 365281355, 170643407, 757340716); + bool4x3 r2 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + uint4x3 a3 = uint4x3(1334556487, 1728108667, 1198848973, 7011150, 1280729934, 1553569869, 1782228282, 731582167, 2041979262, 128396656, 143519087, 154742298); + uint4x3 b3 = uint4x3(639973212, 1147047891, 537350186, 1283454178, 735732152, 1218138135, 474815930, 174656455, 473248758, 1077993023, 1063662917, 181750095); + bool4x3 r3 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void uint4x3_operator_not_equal_wide_scalar() + { + uint4x3 a0 = uint4x3(1038269360, 1427812625, 103361237, 1347017023, 1523584313, 150442802, 660334527, 719113717, 262959423, 484398043, 506946952, 226568494); + uint b0 = (768873026); + bool4x3 r0 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + uint4x3 a1 = uint4x3(507918242, 923269270, 166187260, 114581840, 1045389187, 1648095254, 1461803977, 61801615, 1317840133, 2146927809, 1557151164, 1284033253); + uint b1 = (1702162286); + bool4x3 r1 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + uint4x3 a2 = uint4x3(1345705546, 611028295, 1368046109, 1848036266, 2025452920, 373992983, 289537519, 1388743060, 146455100, 1854553487, 872755032, 2113020512); + uint b2 = (1747302566); + bool4x3 r2 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + uint4x3 a3 = uint4x3(1062447442, 109864030, 1583997921, 1732461790, 1276630817, 721080697, 922945173, 1528002730, 282331576, 1372281893, 167200566, 1271483982); + uint b3 = (632285066); + bool4x3 r3 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void uint4x3_operator_not_equal_scalar_wide() + { + uint a0 = (1652127596); + uint4x3 b0 = uint4x3(953791238, 271722683, 1278885987, 735128017, 112416504, 25967222, 1761444475, 1844594536, 1199122922, 634219279, 942501101, 67161343); + bool4x3 r0 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + uint a1 = (969944293); + uint4x3 b1 = uint4x3(833229499, 1304301133, 704045745, 345012334, 1253134152, 325772538, 855127202, 793668881, 1584481616, 1101301152, 276853534, 987168816); + bool4x3 r1 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + uint a2 = (1258105989); + uint4x3 b2 = uint4x3(362645228, 293978043, 1772395973, 1692007315, 681268929, 1535518457, 595209334, 25745185, 1278016813, 2125682481, 2037751005, 1405297618); + bool4x3 r2 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + uint a3 = (1825546885); + uint4x3 b3 = uint4x3(1584424742, 1779859088, 1262387250, 936213998, 739749071, 1934808433, 1333711144, 571211509, 445791940, 43428024, 1509344718, 1643255886); + bool4x3 r3 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void uint4x3_operator_less_wide_wide() + { + uint4x3 a0 = uint4x3(1486550609, 1779244308, 1602148045, 1614085440, 1975613414, 942838342, 1092279031, 373677431, 1419098312, 337757077, 1081797900, 1336745069); + uint4x3 b0 = uint4x3(97842578, 536551311, 413528975, 1838293684, 1283898480, 1456599961, 1080278602, 529676676, 156584048, 117348799, 246927124, 1916615924); + bool4x3 r0 = bool4x3(false, false, false, true, false, true, false, true, false, false, false, true); + TestUtils.AreEqual(r0, a0 < b0); + + uint4x3 a1 = uint4x3(840685445, 1220554047, 2013681746, 192965012, 532043965, 1000693402, 927236048, 1215860000, 780607596, 1882056852, 1354146545, 2135295778); + uint4x3 b1 = uint4x3(1731071394, 1328098431, 1014995792, 480319327, 1765937053, 1333997067, 688515308, 1856106947, 1303906227, 646821776, 1169473993, 316770064); + bool4x3 r1 = bool4x3(true, true, false, true, true, true, false, true, true, false, false, false); + TestUtils.AreEqual(r1, a1 < b1); + + uint4x3 a2 = uint4x3(1145973790, 1938006975, 895882838, 2006524299, 908581156, 1843349513, 1340458575, 1972095585, 1090933468, 924555996, 79585200, 1749924275); + uint4x3 b2 = uint4x3(1518155802, 416732703, 529193056, 1239623485, 2010112031, 2018560298, 285987009, 960617622, 462519015, 1473825625, 1187164011, 730583004); + bool4x3 r2 = bool4x3(true, false, false, false, true, true, false, false, false, true, true, false); + TestUtils.AreEqual(r2, a2 < b2); + + uint4x3 a3 = uint4x3(1088207695, 1484224850, 512353919, 562469379, 1743259263, 182124641, 1224472464, 1731920136, 1906896401, 425415911, 992649442, 515648372); + uint4x3 b3 = uint4x3(629133777, 1925375320, 689923293, 1818695099, 903783983, 495525944, 1923715956, 2850909, 1908553564, 1064607664, 1344783349, 494620587); + bool4x3 r3 = bool4x3(false, true, true, true, false, true, true, false, true, true, true, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void uint4x3_operator_less_wide_scalar() + { + uint4x3 a0 = uint4x3(796797557, 670113454, 933579492, 278884514, 318174822, 1117630673, 741886928, 1990922600, 1030849597, 1546212312, 1718582899, 1648393417); + uint b0 = (746564682); + bool4x3 r0 = bool4x3(false, true, false, true, true, false, true, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 < b0); + + uint4x3 a1 = uint4x3(1857132231, 1294006045, 952084157, 1303736668, 845460171, 979430272, 1368236640, 24980695, 1434668705, 659552739, 1058492383, 165694933); + uint b1 = (1909506562); + bool4x3 r1 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 < b1); + + uint4x3 a2 = uint4x3(1204097259, 281328069, 24629507, 1386458568, 1325149699, 1498707004, 1650355158, 1213017950, 1650457461, 759932777, 1542997846, 1227393490); + uint b2 = (922212691); + bool4x3 r2 = bool4x3(false, true, true, false, false, false, false, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 < b2); + + uint4x3 a3 = uint4x3(1520634374, 1951142425, 1956860037, 681224518, 1889763470, 1915403219, 850845857, 1871934613, 1882514458, 1326783898, 1044736383, 24899250); + uint b3 = (1750827258); + bool4x3 r3 = bool4x3(true, false, false, true, false, false, true, false, false, true, true, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void uint4x3_operator_less_scalar_wide() + { + uint a0 = (186400299); + uint4x3 b0 = uint4x3(1881344229, 813834467, 1254886626, 1353590345, 1412343685, 1555571443, 1540508298, 1735458634, 135888070, 1643818742, 248291654, 1739560105); + bool4x3 r0 = bool4x3(true, true, true, true, true, true, true, true, false, true, true, true); + TestUtils.AreEqual(r0, a0 < b0); + + uint a1 = (728539891); + uint4x3 b1 = uint4x3(480507742, 1696553040, 540223931, 1840493353, 146833656, 798115946, 2002002066, 1011261705, 783550942, 1093071215, 598253401, 1432416562); + bool4x3 r1 = bool4x3(false, true, false, true, false, true, true, true, true, true, false, true); + TestUtils.AreEqual(r1, a1 < b1); + + uint a2 = (1863582169); + uint4x3 b2 = uint4x3(103622950, 775175960, 116908309, 1213433625, 1428954824, 1760442490, 1208143947, 751820805, 1491872302, 560004484, 2065157473, 310839658); + bool4x3 r2 = bool4x3(false, false, false, false, false, false, false, false, false, false, true, false); + TestUtils.AreEqual(r2, a2 < b2); + + uint a3 = (697329242); + uint4x3 b3 = uint4x3(898786601, 1448893980, 1204091943, 1933043135, 828031833, 1737703663, 1672512847, 1112905025, 1666248737, 1352503217, 406395888, 1734008932); + bool4x3 r3 = bool4x3(true, true, true, true, true, true, true, true, true, true, false, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void uint4x3_operator_greater_wide_wide() + { + uint4x3 a0 = uint4x3(2087717754, 1725569452, 1298066182, 1693943616, 1319019629, 70674491, 1042499725, 1002821508, 1021857133, 1744374599, 821751047, 467646903); + uint4x3 b0 = uint4x3(85148514, 293632137, 1151128249, 409440398, 1115020183, 1508500597, 1834583302, 1755218534, 1788761753, 1128238489, 834223713, 1578743290); + bool4x3 r0 = bool4x3(true, true, true, true, true, false, false, false, false, true, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + uint4x3 a1 = uint4x3(2029731638, 1377214212, 1207816926, 474621063, 20781266, 366593779, 2068457387, 10181449, 793634464, 144474612, 99947390, 930377263); + uint4x3 b1 = uint4x3(1647150256, 1756397855, 1131080201, 1208965204, 1495161099, 1283714281, 908051907, 412849651, 815822687, 730271942, 40756039, 883326140); + bool4x3 r1 = bool4x3(true, false, true, false, false, false, true, false, false, false, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + uint4x3 a2 = uint4x3(683686232, 742803073, 918292048, 875621429, 1764985258, 411384146, 1921397684, 1349107119, 640399120, 1487719331, 1467989523, 1834244794); + uint4x3 b2 = uint4x3(476260632, 1024136446, 1440596667, 1253494041, 146826162, 1798399573, 2085029408, 187939428, 1009192934, 1694822273, 1866590874, 113805226); + bool4x3 r2 = bool4x3(true, false, false, false, true, false, false, true, false, false, false, true); + TestUtils.AreEqual(r2, a2 > b2); + + uint4x3 a3 = uint4x3(1778580304, 334604025, 689749101, 1478795900, 716772993, 1072711623, 388277128, 290673156, 619539670, 1666212670, 496667761, 638935614); + uint4x3 b3 = uint4x3(1331524948, 5928360, 1884858608, 1988975599, 493888072, 731556294, 1597968264, 727668246, 1260583385, 1921631225, 359265523, 856088703); + bool4x3 r3 = bool4x3(true, true, false, false, true, true, false, false, false, false, true, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void uint4x3_operator_greater_wide_scalar() + { + uint4x3 a0 = uint4x3(1208626274, 239697208, 1979453345, 1253474001, 1590192876, 1487911635, 1673945595, 1662650098, 222749855, 1433540517, 566635217, 1773305960); + uint b0 = (1715176566); + bool4x3 r0 = bool4x3(false, false, true, false, false, false, false, false, false, false, false, true); + TestUtils.AreEqual(r0, a0 > b0); + + uint4x3 a1 = uint4x3(1850273578, 325913453, 333381537, 1905567362, 2053577491, 570397194, 2128431130, 1735325311, 529971908, 1663525234, 1972984241, 1587865063); + uint b1 = (206147145); + bool4x3 r1 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + uint4x3 a2 = uint4x3(488268523, 812076921, 181082921, 1281638484, 1818357732, 116518997, 1397728785, 1924199337, 742950077, 1463993051, 1598027926, 842851852); + uint b2 = (121921923); + bool4x3 r2 = bool4x3(true, true, true, true, true, false, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 > b2); + + uint4x3 a3 = uint4x3(160842093, 540338405, 174088887, 1609299242, 425486336, 1462766889, 651513452, 1122649822, 771802057, 839323192, 325778683, 406189885); + uint b3 = (1226313895); + bool4x3 r3 = bool4x3(false, false, false, true, false, true, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void uint4x3_operator_greater_scalar_wide() + { + uint a0 = (480938827); + uint4x3 b0 = uint4x3(1824731899, 921496110, 586859044, 946430596, 1231356727, 1390167458, 1785807092, 28949024, 2037899283, 595656760, 1778095771, 1233500439); + bool4x3 r0 = bool4x3(false, false, false, false, false, false, false, true, false, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + uint a1 = (1696302238); + uint4x3 b1 = uint4x3(1445965340, 484020151, 1586962841, 1361740714, 265628948, 2003122957, 332267433, 1128353075, 377919478, 982113135, 1117675960, 630865591); + bool4x3 r1 = bool4x3(true, true, true, true, true, false, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + uint a2 = (1550679736); + uint4x3 b2 = uint4x3(895945757, 287025687, 643452096, 660504007, 613135893, 633307118, 514276792, 1377364317, 84491736, 746768197, 1282879723, 589415384); + bool4x3 r2 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 > b2); + + uint a3 = (363082240); + uint4x3 b3 = uint4x3(1774333756, 741005890, 413100725, 702141547, 1434366582, 1489794027, 1710601432, 1914069735, 1811684885, 1007116016, 1883396218, 318035497); + bool4x3 r3 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void uint4x3_operator_less_equal_wide_wide() + { + uint4x3 a0 = uint4x3(154092149, 1515170149, 1083970332, 785807178, 1401094881, 310537627, 868328962, 1990816725, 2035349541, 457043352, 1123282035, 1001842946); + uint4x3 b0 = uint4x3(77984380, 1712054191, 1566203809, 254834519, 450519938, 389457083, 1298669505, 207343167, 1214449047, 2059561026, 896534357, 1897470050); + bool4x3 r0 = bool4x3(false, true, true, false, false, true, true, false, false, true, false, true); + TestUtils.AreEqual(r0, a0 <= b0); + + uint4x3 a1 = uint4x3(1387761992, 195272789, 659549000, 888761458, 283706617, 1790185840, 899029812, 848317418, 1743712447, 1504407474, 1798441490, 1902791952); + uint4x3 b1 = uint4x3(521075677, 1848221945, 374708019, 1573731118, 2093466449, 1660210829, 1568778785, 1352157589, 1212771905, 1457525058, 1493446008, 1784768208); + bool4x3 r1 = bool4x3(false, true, false, true, true, false, true, true, false, false, false, false); + TestUtils.AreEqual(r1, a1 <= b1); + + uint4x3 a2 = uint4x3(606340844, 1994437705, 301831413, 654230470, 1223625081, 324292199, 1370931020, 1742769166, 1709242127, 105750466, 1655967312, 1455797002); + uint4x3 b2 = uint4x3(1993422493, 1378671664, 1447376929, 1405041439, 1765183746, 562894655, 1085068880, 1026386862, 884290156, 922346160, 330605896, 466570756); + bool4x3 r2 = bool4x3(true, false, true, true, true, true, false, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + uint4x3 a3 = uint4x3(366131629, 315848579, 1539610530, 99028560, 765767372, 1241881101, 527753961, 1271899705, 1439235979, 436585748, 1244486586, 2128710216); + uint4x3 b3 = uint4x3(1252369410, 2057993777, 1691801535, 2041799631, 557988228, 813610154, 1657573441, 983813335, 385144401, 1281329713, 285422763, 658643567); + bool4x3 r3 = bool4x3(true, true, true, true, false, false, true, false, false, true, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void uint4x3_operator_less_equal_wide_scalar() + { + uint4x3 a0 = uint4x3(1479531977, 1427983411, 415250630, 1245345407, 1112546666, 1072990632, 1579912858, 101048307, 1070894375, 509818792, 1910488590, 85452501); + uint b0 = (2004563877); + bool4x3 r0 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + uint4x3 a1 = uint4x3(518127023, 1097326500, 1964410699, 1968139888, 1191853379, 662096238, 1140643434, 754434551, 155343473, 995927387, 974873240, 1773400038); + uint b1 = (1246249980); + bool4x3 r1 = bool4x3(true, true, false, false, true, true, true, true, true, true, true, false); + TestUtils.AreEqual(r1, a1 <= b1); + + uint4x3 a2 = uint4x3(497436329, 527516420, 1477043363, 1378470734, 96190147, 37188105, 839762283, 781102710, 766321672, 1145011483, 139031840, 127837780); + uint b2 = (1825940497); + bool4x3 r2 = bool4x3(true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 <= b2); + + uint4x3 a3 = uint4x3(817806943, 649140851, 913173654, 1530989756, 856611228, 479496140, 287809619, 626008542, 2075114788, 269756518, 1123999963, 1061241170); + uint b3 = (1248492707); + bool4x3 r3 = bool4x3(true, true, true, false, true, true, true, true, false, true, true, true); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void uint4x3_operator_less_equal_scalar_wide() + { + uint a0 = (1899193992); + uint4x3 b0 = uint4x3(915011820, 980913757, 1337699683, 1476321359, 1102143668, 660493983, 184664508, 381579707, 1954892821, 1295090571, 1440368586, 1696003686); + bool4x3 r0 = bool4x3(false, false, false, false, false, false, false, false, true, false, false, false); + TestUtils.AreEqual(r0, a0 <= b0); + + uint a1 = (88708652); + uint4x3 b1 = uint4x3(1332251857, 1310713644, 2112132784, 48951945, 1888568027, 39340955, 1108242207, 260777425, 593122164, 291471959, 253457314, 1264570386); + bool4x3 r1 = bool4x3(true, true, true, false, true, false, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 <= b1); + + uint a2 = (699618012); + uint4x3 b2 = uint4x3(927735863, 2063158939, 932253787, 1168754049, 749328788, 1882694892, 168499987, 378173027, 339963627, 832906712, 559482768, 53067420); + bool4x3 r2 = bool4x3(true, true, true, true, true, true, false, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + uint a3 = (1895722478); + uint4x3 b3 = uint4x3(809981860, 591790551, 1680760399, 653274934, 1664284538, 1283249545, 767500110, 1334099884, 1271622829, 1270706578, 56782179, 505839576); + bool4x3 r3 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void uint4x3_operator_greater_equal_wide_wide() + { + uint4x3 a0 = uint4x3(8538378, 2131749726, 265427108, 523609761, 994991818, 839709564, 101288202, 1886280970, 2032074826, 631221455, 1456286159, 961342752); + uint4x3 b0 = uint4x3(903145828, 1697992986, 1432491982, 169789504, 1059357300, 1744255222, 1606584463, 1905414425, 1448794969, 136181998, 1678754836, 2069656857); + bool4x3 r0 = bool4x3(false, true, false, true, false, false, false, false, true, true, false, false); + TestUtils.AreEqual(r0, a0 >= b0); + + uint4x3 a1 = uint4x3(424526026, 788481984, 1662488497, 870326690, 708712581, 1260182701, 1165630721, 138247561, 1108650168, 1933222913, 672493999, 1541402159); + uint4x3 b1 = uint4x3(398982689, 243317404, 740939613, 1894753119, 301760792, 1260647988, 3608523, 52576030, 903420465, 1648820371, 627296845, 1679808907); + bool4x3 r1 = bool4x3(true, true, true, false, true, false, true, true, true, true, true, false); + TestUtils.AreEqual(r1, a1 >= b1); + + uint4x3 a2 = uint4x3(1921596027, 1557351956, 147242547, 892772168, 2089286723, 1273466960, 644009998, 654784654, 189030610, 1035542641, 346401762, 739783704); + uint4x3 b2 = uint4x3(1719102039, 1718081638, 655586949, 477267189, 62092869, 2013928066, 280292357, 254052205, 1092440092, 1947011057, 625632982, 2028466303); + bool4x3 r2 = bool4x3(true, false, false, true, true, false, true, true, false, false, false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + uint4x3 a3 = uint4x3(1310547408, 1175015477, 1893015570, 1397162858, 1005064177, 469205024, 1331071304, 1747510572, 1556472271, 1318844912, 877625210, 1556049679); + uint4x3 b3 = uint4x3(578645425, 552865694, 1460006028, 1944712828, 1256156724, 2090870105, 1299728699, 53125632, 782915512, 1103537852, 271803142, 828357811); + bool4x3 r3 = bool4x3(true, true, true, false, false, false, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void uint4x3_operator_greater_equal_wide_scalar() + { + uint4x3 a0 = uint4x3(2049236663, 182691143, 634973382, 1197012109, 439837565, 1367606469, 1108037359, 351147187, 1898505669, 411667685, 1998610091, 4652390); + uint b0 = (1061998015); + bool4x3 r0 = bool4x3(true, false, false, true, false, true, true, false, true, false, true, false); + TestUtils.AreEqual(r0, a0 >= b0); + + uint4x3 a1 = uint4x3(996159180, 727766399, 96217144, 814085575, 1525995206, 1293933760, 1732973229, 1473283041, 899444524, 1023753195, 1373738074, 518164359); + uint b1 = (2111455181); + bool4x3 r1 = bool4x3(false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + uint4x3 a2 = uint4x3(717850464, 1826820341, 527594558, 1816542874, 839185150, 1143596061, 1819554651, 160724539, 993212636, 878086499, 363122662, 1989978759); + uint b2 = (1765188600); + bool4x3 r2 = bool4x3(false, true, false, true, false, false, true, false, false, false, false, true); + TestUtils.AreEqual(r2, a2 >= b2); + + uint4x3 a3 = uint4x3(2145562949, 122055824, 1432184946, 690328424, 638547285, 403700518, 569358695, 1988815901, 933324785, 1709851817, 1451640349, 1782506169); + uint b3 = (491416140); + bool4x3 r3 = bool4x3(true, false, true, true, true, false, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void uint4x3_operator_greater_equal_scalar_wide() + { + uint a0 = (1859811087); + uint4x3 b0 = uint4x3(1070365918, 1783869452, 830091760, 377157428, 327199016, 90384229, 1154649706, 376758501, 1079802834, 2054742898, 1328349472, 434061447); + bool4x3 r0 = bool4x3(true, true, true, true, true, true, true, true, true, false, true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + uint a1 = (951207723); + uint4x3 b1 = uint4x3(598695892, 975131651, 1714007943, 177416473, 1267232721, 31082860, 216791741, 119054289, 1905107583, 89559116, 55041824, 691334141); + bool4x3 r1 = bool4x3(true, false, false, true, false, true, true, true, false, true, true, true); + TestUtils.AreEqual(r1, a1 >= b1); + + uint a2 = (462326883); + uint4x3 b2 = uint4x3(1658303669, 914628512, 1134364322, 1677134711, 1955614770, 2067009301, 1454405405, 299467282, 1584922149, 561776357, 564147844, 398216936); + bool4x3 r2 = bool4x3(false, false, false, false, false, false, false, true, false, false, false, true); + TestUtils.AreEqual(r2, a2 >= b2); + + uint a3 = (1478439642); + uint4x3 b3 = uint4x3(958973988, 725612832, 1586062302, 1992817431, 732550238, 1151725147, 11183347, 643483664, 1846311608, 999376922, 1029876878, 1092702918); + bool4x3 r3 = bool4x3(true, true, false, false, true, true, true, true, false, true, true, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void uint4x3_operator_add_wide_wide() + { + uint4x3 a0 = uint4x3(2135171378, 21433296, 1954723494, 683604307, 1054212315, 1762680995, 1963655852, 1257853062, 2043493600, 976898058, 1915056423, 121374462); + uint4x3 b0 = uint4x3(1013431952, 366718162, 359290756, 1393163294, 1962236872, 1263270041, 1862666629, 1077447887, 821693806, 487316539, 350922520, 1583012528); + uint4x3 r0 = uint4x3(3148603330, 388151458, 2314014250, 2076767601, 3016449187, 3025951036, 3826322481, 2335300949, 2865187406, 1464214597, 2265978943, 1704386990); + TestUtils.AreEqual(r0, a0 + b0); + + uint4x3 a1 = uint4x3(1218855698, 700538222, 1702057277, 1788251699, 1534939160, 398651016, 1674272498, 374510467, 824322986, 1217622199, 1122376670, 642613771); + uint4x3 b1 = uint4x3(1951595076, 1024851344, 874302782, 1383969588, 1767968088, 900721406, 1659790033, 1792273749, 443844328, 633981449, 2010244807, 335566991); + uint4x3 r1 = uint4x3(3170450774, 1725389566, 2576360059, 3172221287, 3302907248, 1299372422, 3334062531, 2166784216, 1268167314, 1851603648, 3132621477, 978180762); + TestUtils.AreEqual(r1, a1 + b1); + + uint4x3 a2 = uint4x3(1097903998, 359042741, 929182687, 1713065399, 892057490, 1295346111, 1806236181, 1838589664, 173985173, 1875814528, 1464015613, 1550659036); + uint4x3 b2 = uint4x3(521931102, 544297835, 1681549647, 1784248858, 585904415, 3128418, 1806236610, 179909533, 378711407, 195687764, 357131656, 383703567); + uint4x3 r2 = uint4x3(1619835100, 903340576, 2610732334, 3497314257, 1477961905, 1298474529, 3612472791, 2018499197, 552696580, 2071502292, 1821147269, 1934362603); + TestUtils.AreEqual(r2, a2 + b2); + + uint4x3 a3 = uint4x3(447183339, 1810477200, 1280783968, 460635858, 1308981305, 2074430993, 515260041, 454786901, 54902689, 8663916, 364443922, 2133521215); + uint4x3 b3 = uint4x3(1332107956, 1471212095, 1634876660, 1356094538, 364971231, 1180126175, 1243953864, 2000873160, 761885805, 1088368083, 371382049, 1165570023); + uint4x3 r3 = uint4x3(1779291295, 3281689295, 2915660628, 1816730396, 1673952536, 3254557168, 1759213905, 2455660061, 816788494, 1097031999, 735825971, 3299091238); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void uint4x3_operator_add_wide_scalar() + { + uint4x3 a0 = uint4x3(665815972, 1783729250, 1591678394, 1284528538, 977850224, 71069732, 1138577680, 1200356017, 565982008, 1246759684, 1088001167, 57252642); + uint b0 = (1334043849); + uint4x3 r0 = uint4x3(1999859821, 3117773099, 2925722243, 2618572387, 2311894073, 1405113581, 2472621529, 2534399866, 1900025857, 2580803533, 2422045016, 1391296491); + TestUtils.AreEqual(r0, a0 + b0); + + uint4x3 a1 = uint4x3(678921480, 512157429, 1470648741, 1490096953, 1467033531, 182608093, 1707296407, 1703724354, 1333833947, 653973063, 1139546735, 1834005844); + uint b1 = (625943813); + uint4x3 r1 = uint4x3(1304865293, 1138101242, 2096592554, 2116040766, 2092977344, 808551906, 2333240220, 2329668167, 1959777760, 1279916876, 1765490548, 2459949657); + TestUtils.AreEqual(r1, a1 + b1); + + uint4x3 a2 = uint4x3(184572739, 1858520040, 97099208, 421437295, 1251829854, 166844260, 1568146789, 82548613, 533562157, 1464065228, 716600557, 831997894); + uint b2 = (1980578280); + uint4x3 r2 = uint4x3(2165151019, 3839098320, 2077677488, 2402015575, 3232408134, 2147422540, 3548725069, 2063126893, 2514140437, 3444643508, 2697178837, 2812576174); + TestUtils.AreEqual(r2, a2 + b2); + + uint4x3 a3 = uint4x3(861575416, 1590793088, 240051362, 656307111, 1116911778, 1508531454, 1488841996, 651080626, 850104335, 697550029, 1501177275, 308656842); + uint b3 = (1614335536); + uint4x3 r3 = uint4x3(2475910952, 3205128624, 1854386898, 2270642647, 2731247314, 3122866990, 3103177532, 2265416162, 2464439871, 2311885565, 3115512811, 1922992378); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void uint4x3_operator_add_scalar_wide() + { + uint a0 = (359966320); + uint4x3 b0 = uint4x3(2146146202, 767103309, 851002415, 311531406, 1491262941, 1016891373, 1954228994, 1671335850, 727870747, 551151834, 1390261152, 1699060326); + uint4x3 r0 = uint4x3(2506112522, 1127069629, 1210968735, 671497726, 1851229261, 1376857693, 2314195314, 2031302170, 1087837067, 911118154, 1750227472, 2059026646); + TestUtils.AreEqual(r0, a0 + b0); + + uint a1 = (115021619); + uint4x3 b1 = uint4x3(1964440175, 440700758, 1556692550, 185414255, 933106731, 1217866784, 729761881, 1742597318, 1090109152, 1467373815, 1066072609, 138237856); + uint4x3 r1 = uint4x3(2079461794, 555722377, 1671714169, 300435874, 1048128350, 1332888403, 844783500, 1857618937, 1205130771, 1582395434, 1181094228, 253259475); + TestUtils.AreEqual(r1, a1 + b1); + + uint a2 = (634834665); + uint4x3 b2 = uint4x3(993603553, 347587889, 2050191349, 670698672, 1658205080, 1874808705, 2082982954, 869839589, 118460267, 2126166073, 1826004041, 1976984739); + uint4x3 r2 = uint4x3(1628438218, 982422554, 2685026014, 1305533337, 2293039745, 2509643370, 2717817619, 1504674254, 753294932, 2761000738, 2460838706, 2611819404); + TestUtils.AreEqual(r2, a2 + b2); + + uint a3 = (1612682951); + uint4x3 b3 = uint4x3(1509218893, 283188530, 175981795, 290469072, 90401332, 92990995, 1697612984, 10695923, 584353656, 1985077669, 261483046, 1433592717); + uint4x3 r3 = uint4x3(3121901844, 1895871481, 1788664746, 1903152023, 1703084283, 1705673946, 3310295935, 1623378874, 2197036607, 3597760620, 1874165997, 3046275668); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void uint4x3_operator_sub_wide_wide() + { + uint4x3 a0 = uint4x3(1410318491, 1097280168, 1827039044, 28881338, 328720965, 875487868, 212936325, 231977215, 1740021315, 2011295463, 48079003, 591379285); + uint4x3 b0 = uint4x3(1315897366, 799052018, 1580289673, 1094686261, 1954325726, 1197734816, 229886366, 915679176, 1746884850, 918743925, 1007797419, 257421324); + uint4x3 r0 = uint4x3(94421125, 298228150, 246749371, 3229162373, 2669362535, 3972720348, 4278017255, 3611265335, 4288103761, 1092551538, 3335248880, 333957961); + TestUtils.AreEqual(r0, a0 - b0); + + uint4x3 a1 = uint4x3(1125909359, 1842588095, 848561896, 614448464, 2067598029, 1618238416, 318516219, 1090119767, 1991095823, 949592162, 1951912339, 1457818751); + uint4x3 b1 = uint4x3(287249342, 1617287463, 1653916102, 123586847, 502107404, 672875302, 1256481116, 1975569142, 1794443030, 1327558915, 330955394, 1596041731); + uint4x3 r1 = uint4x3(838660017, 225300632, 3489613090, 490861617, 1565490625, 945363114, 3357002399, 3409517921, 196652793, 3917000543, 1620956945, 4156744316); + TestUtils.AreEqual(r1, a1 - b1); + + uint4x3 a2 = uint4x3(1642553126, 2114366549, 1420516260, 596841760, 724518081, 1820626306, 1885185225, 246124365, 1339877262, 1277620434, 759131597, 597162957); + uint4x3 b2 = uint4x3(1069074732, 1120817099, 2076417364, 402521072, 839858844, 1539789702, 559077522, 822288510, 751901021, 1858312568, 1706585560, 483540199); + uint4x3 r2 = uint4x3(573478394, 993549450, 3639066192, 194320688, 4179626533, 280836604, 1326107703, 3718803151, 587976241, 3714275162, 3347513333, 113622758); + TestUtils.AreEqual(r2, a2 - b2); + + uint4x3 a3 = uint4x3(656765083, 1075131749, 58205257, 452992632, 976914238, 2122217984, 1687033200, 850554234, 2052749291, 2095840868, 1583338457, 90383917); + uint4x3 b3 = uint4x3(35726321, 401119620, 1411304017, 794953965, 246546364, 1926970811, 1641115012, 2138664312, 1215717344, 1626141022, 1697813712, 1432018301); + uint4x3 r3 = uint4x3(621038762, 674012129, 2941868536, 3953005963, 730367874, 195247173, 45918188, 3006857218, 837031947, 469699846, 4180492041, 2953332912); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void uint4x3_operator_sub_wide_scalar() + { + uint4x3 a0 = uint4x3(1508669340, 1594795463, 266707545, 643102647, 287705008, 1475644328, 1113286221, 979450511, 2082174113, 1108005498, 304369206, 999244508); + uint b0 = (998008471); + uint4x3 r0 = uint4x3(510660869, 596786992, 3563666370, 3940061472, 3584663833, 477635857, 115277750, 4276409336, 1084165642, 109997027, 3601328031, 1236037); + TestUtils.AreEqual(r0, a0 - b0); + + uint4x3 a1 = uint4x3(1806482044, 2101812429, 1482736902, 266654115, 1470212363, 1190349300, 958542155, 1185075537, 1738124835, 499527536, 1612473406, 1696960099); + uint b1 = (1994553647); + uint4x3 r1 = uint4x3(4106895693, 107258782, 3783150551, 2567067764, 3770626012, 3490762949, 3258955804, 3485489186, 4038538484, 2799941185, 3912887055, 3997373748); + TestUtils.AreEqual(r1, a1 - b1); + + uint4x3 a2 = uint4x3(1287292743, 1032360376, 1779621585, 964948785, 1739264125, 94254551, 968533883, 2075770560, 946189008, 1074604044, 1171596880, 1033389665); + uint b2 = (1360229454); + uint4x3 r2 = uint4x3(4222030585, 3967098218, 419392131, 3899686627, 379034671, 3028992393, 3903271725, 715541106, 3880926850, 4009341886, 4106334722, 3968127507); + TestUtils.AreEqual(r2, a2 - b2); + + uint4x3 a3 = uint4x3(1905912138, 372717946, 658343960, 572101777, 361378660, 1043302867, 1535109165, 695707807, 153321516, 1464557635, 308141270, 69622833); + uint b3 = (1219683758); + uint4x3 r3 = uint4x3(686228380, 3448001484, 3733627498, 3647385315, 3436662198, 4118586405, 315425407, 3770991345, 3228605054, 244873877, 3383424808, 3144906371); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void uint4x3_operator_sub_scalar_wide() + { + uint a0 = (893369501); + uint4x3 b0 = uint4x3(2051906184, 1699714311, 442603706, 1735141684, 274533585, 811580259, 1196354320, 1524097023, 533621527, 2080845793, 143958837, 1620668660); + uint4x3 r0 = uint4x3(3136430613, 3488622486, 450765795, 3453195113, 618835916, 81789242, 3991982477, 3664239774, 359747974, 3107491004, 749410664, 3567668137); + TestUtils.AreEqual(r0, a0 - b0); + + uint a1 = (1135989346); + uint4x3 b1 = uint4x3(1367044745, 554088609, 552670373, 1265516124, 1254902543, 1857695581, 1619865274, 1313559400, 99812999, 843597298, 420111239, 1299949060); + uint4x3 r1 = uint4x3(4063911897, 581900737, 583318973, 4165440518, 4176054099, 3573261061, 3811091368, 4117397242, 1036176347, 292392048, 715878107, 4131007582); + TestUtils.AreEqual(r1, a1 - b1); + + uint a2 = (531009038); + uint4x3 b2 = uint4x3(1103306550, 104920105, 1137308312, 1207332725, 103438360, 1157123503, 1174401240, 701247193, 1498366995, 467017290, 109208355, 1594646461); + uint4x3 r2 = uint4x3(3722669784, 426088933, 3688668022, 3618643609, 427570678, 3668852831, 3651575094, 4124729141, 3327609339, 63991748, 421800683, 3231329873); + TestUtils.AreEqual(r2, a2 - b2); + + uint a3 = (1252691221); + uint4x3 b3 = uint4x3(919863765, 2826939, 1969148647, 1576198850, 2075870798, 1610641273, 1783880129, 59074246, 1766624573, 521313783, 1333637752, 509364704); + uint4x3 r3 = uint4x3(332827456, 1249864282, 3578509870, 3971459667, 3471787719, 3937017244, 3763778388, 1193616975, 3781033944, 731377438, 4214020765, 743326517); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void uint4x3_operator_mul_wide_wide() + { + uint4x3 a0 = uint4x3(61417577, 219585476, 1362520891, 1511084277, 1481211272, 58211871, 1459591173, 567624644, 1169935583, 1835691886, 385626539, 85934842); + uint4x3 b0 = uint4x3(578042444, 1620527213, 200516468, 309339115, 542853019, 299467282, 1479641221, 1428338601, 1497302909, 1596889147, 427413842, 265122693); + uint4x3 r0 = uint4x3(2868103468, 1326150260, 3304073148, 2972110823, 1973926232, 88546350, 3431047833, 3712145508, 556671459, 1098186330, 1848083398, 4236646882); + TestUtils.AreEqual(r0, a0 * b0); + + uint4x3 a1 = uint4x3(522856538, 278370196, 289217012, 2083410174, 1293162798, 1939730122, 2075923048, 1116477212, 1686101741, 783310758, 248585944, 1093377716); + uint4x3 b1 = uint4x3(689376654, 1120457204, 516903000, 873091659, 1353196495, 1384773500, 1596528529, 2122329305, 1033200564, 996795088, 1137754930, 232014195); + uint4x3 r1 = uint4x3(2005201900, 651971856, 2573806560, 4184807018, 4175537714, 3758002136, 2245379304, 3535300284, 1443849636, 550781664, 3335949872, 3941859036); + TestUtils.AreEqual(r1, a1 * b1); + + uint4x3 a2 = uint4x3(797038788, 1838048120, 1892922904, 1952024781, 492107602, 1097670675, 2069629919, 20122103, 606926492, 1153788131, 1687394746, 1499899200); + uint4x3 b2 = uint4x3(1080950243, 1613216909, 463529448, 1781487382, 2101946430, 673144237, 390627073, 964308272, 1332603859, 106394678, 1330334791, 1720890701); + uint4x3 r2 = uint4x3(3201362380, 264300824, 4173364672, 1825729694, 4053448156, 3048379351, 2230824159, 4043852112, 1004304020, 3964664802, 638638742, 892728384); + TestUtils.AreEqual(r2, a2 * b2); + + uint4x3 a3 = uint4x3(380825697, 2058271053, 1791586731, 16536749, 1743482585, 323418416, 826338527, 1127652402, 1548655361, 892665898, 498857854, 52699386); + uint4x3 b3 = uint4x3(1860846228, 1499909622, 1236623401, 1532585255, 46356001, 1355750416, 470193265, 829633350, 158242740, 2121460265, 443332975, 1295474668); + uint4x3 r3 = uint4x3(2820012564, 1744222462, 3318371427, 2734565211, 2648780793, 1971376896, 936606319, 4269976492, 3894449076, 3059182266, 4018298274, 2504076408); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void uint4x3_operator_mul_wide_scalar() + { + uint4x3 a0 = uint4x3(871746615, 492532311, 570557670, 2142306629, 1610315153, 1526163563, 118471734, 257439514, 364291059, 1186560810, 1584938026, 1357601203); + uint b0 = (442064533); + uint4x3 r0 = uint4x3(338365955, 1081376419, 2565819870, 3279557417, 3421481829, 4119466055, 3456786286, 513646114, 1627104879, 1523063666, 1353478258, 3777359663); + TestUtils.AreEqual(r0, a0 * b0); + + uint4x3 a1 = uint4x3(638897141, 1007838321, 1163240135, 1619806399, 1444659979, 1127580168, 464517916, 1508043166, 745488654, 636691139, 1851670006, 357357967); + uint b1 = (268562104); + uint4x3 r1 = uint4x3(3498401304, 3138010936, 2242445576, 154458952, 643000808, 258008512, 1024230432, 1508298128, 2139080208, 2748663336, 2404203728, 2332971208); + TestUtils.AreEqual(r1, a1 * b1); + + uint4x3 a2 = uint4x3(1095280227, 945802744, 1464398841, 51061000, 802418971, 407442471, 638315697, 1889264235, 584402164, 1343048690, 2144106255, 1634890111); + uint b2 = (702779195); + uint4x3 r2 = uint4x3(91792849, 3708420136, 350441827, 2098992344, 2272765497, 2293132797, 2817092555, 4014470057, 1627861052, 4195528390, 2750271861, 1566775621); + TestUtils.AreEqual(r2, a2 * b2); + + uint4x3 a3 = uint4x3(425282134, 676185747, 1562817045, 379402138, 866868743, 624571724, 889442510, 39498317, 219559094, 211033504, 2076045580, 1838674974); + uint b3 = (997231492); + uint4x3 r3 = uint4x3(3842442840, 3292280012, 3402971604, 3617671528, 1887062172, 2721300272, 1014465592, 910409396, 3484549080, 3195348608, 689032752, 3137743224); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void uint4x3_operator_mul_scalar_wide() + { + uint a0 = (1152242766); + uint4x3 b0 = uint4x3(1276636134, 2105929407, 499007702, 124002565, 1956335172, 1288034953, 832676555, 337389733, 99268757, 2005055247, 2011389505, 1348110859); + uint4x3 r0 = uint4x3(2165463060, 999811634, 1179056436, 3493540742, 404105400, 1339492798, 3913201114, 3183347270, 2131796326, 1519334034, 3342961614, 2874551130); + TestUtils.AreEqual(r0, a0 * b0); + + uint a1 = (399689191); + uint4x3 b1 = uint4x3(2007606374, 2076691289, 1825721194, 769885235, 153314735, 1066325369, 84289667, 984486192, 1325213504, 1643957457, 1576395620, 2095980601); + uint4x3 r1 = uint4x3(2336347658, 1053162063, 1757322918, 2212333829, 2663279593, 1080737071, 1177640245, 1336635984, 136489664, 3207308695, 2229543740, 2272063599); + TestUtils.AreEqual(r1, a1 * b1); + + uint a2 = (907671947); + uint4x3 b2 = uint4x3(836919582, 1412159342, 2037926630, 366590562, 493177763, 2058824164, 497936968, 2136548816, 1211907591, 2113626509, 345443734, 353147704); + uint4x3 r2 = uint4x3(374270282, 2518021818, 3382730978, 2199094582, 1098685569, 4168516300, 1465269528, 1820252144, 1505328333, 774184079, 299976306, 2840182632); + TestUtils.AreEqual(r2, a2 * b2); + + uint a3 = (688487056); + uint4x3 b3 = uint4x3(2038986981, 1991273614, 393095943, 838257274, 1646548338, 480051387, 1077685034, 421911953, 1757438926, 1584698689, 1237695787, 426426495); + uint4x3 r3 = uint4x3(1399726800, 1710668768, 1354271216, 1603930272, 3358221344, 3829172016, 216288160, 872201104, 470175712, 1493036688, 1155786288, 1195363696); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void uint4x3_operator_div_wide_wide() + { + uint4x3 a0 = uint4x3(333171510, 858154903, 1181365836, 671357749, 1090606752, 803759420, 788404166, 296807814, 575260195, 166625280, 1493729000, 1831739736); + uint4x3 b0 = uint4x3(698897823, 440199998, 655557473, 1658534285, 2127220100, 315653188, 1814290360, 992173243, 914851653, 664340325, 224323977, 246981573); + uint4x3 r0 = uint4x3(0, 1, 1, 0, 0, 2, 0, 0, 0, 0, 6, 7); + TestUtils.AreEqual(r0, a0 / b0); + + uint4x3 a1 = uint4x3(200852358, 129983172, 500176108, 472051781, 414699094, 1446535974, 1278480457, 930910505, 263295881, 1626759436, 450830871, 21439121); + uint4x3 b1 = uint4x3(285573983, 819471609, 2012476015, 1783179572, 223253978, 169515029, 1694929006, 1992168131, 1155972447, 1768506696, 422325410, 1508417406); + uint4x3 r1 = uint4x3(0, 0, 0, 0, 1, 8, 0, 0, 0, 0, 1, 0); + TestUtils.AreEqual(r1, a1 / b1); + + uint4x3 a2 = uint4x3(521337599, 127756712, 200601965, 412554396, 1014641734, 239347640, 525574301, 1158358177, 1655168319, 2048437741, 367754386, 1861176433); + uint4x3 b2 = uint4x3(605462475, 66917170, 2014683461, 108847533, 611173330, 895791853, 1999369787, 1225614384, 1168063495, 565150188, 127292785, 1027814836); + uint4x3 r2 = uint4x3(0, 1, 0, 3, 1, 0, 0, 0, 1, 3, 2, 1); + TestUtils.AreEqual(r2, a2 / b2); + + uint4x3 a3 = uint4x3(2131424795, 401044444, 745048188, 1943634349, 264134862, 298134010, 1884719303, 1582577607, 1958183229, 1302356942, 1455581366, 1466593830); + uint4x3 b3 = uint4x3(321940796, 337756553, 63233040, 1926010595, 769049413, 2042197280, 405134611, 547499280, 1337688441, 667307127, 35118652, 411409741); + uint4x3 r3 = uint4x3(6, 1, 11, 1, 0, 0, 4, 2, 1, 1, 41, 3); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void uint4x3_operator_div_wide_scalar() + { + uint4x3 a0 = uint4x3(1433072926, 1073958635, 1195142312, 536596719, 1274375693, 464756346, 806462546, 906504670, 1380905136, 25493909, 1196815948, 123300377); + uint b0 = (1434025872); + uint4x3 r0 = uint4x3(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + TestUtils.AreEqual(r0, a0 / b0); + + uint4x3 a1 = uint4x3(643754735, 2047825037, 458304263, 741331531, 466443901, 2110004616, 1500687214, 1453264263, 1617154145, 2040203220, 2103351724, 485536709); + uint b1 = (2084019932); + uint4x3 r1 = uint4x3(0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0); + TestUtils.AreEqual(r1, a1 / b1); + + uint4x3 a2 = uint4x3(402141749, 1629069474, 1549487015, 670594363, 2040479674, 155415284, 207130003, 1596922206, 1730223836, 1528374182, 1878500631, 1245757182); + uint b2 = (1477264254); + uint4x3 r2 = uint4x3(0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0); + TestUtils.AreEqual(r2, a2 / b2); + + uint4x3 a3 = uint4x3(1471308702, 251821475, 1328085649, 1950145317, 794269329, 174603836, 678361822, 1820872200, 1455358409, 778273070, 2067965131, 127176068); + uint b3 = (1733304186); + uint4x3 r3 = uint4x3(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void uint4x3_operator_div_scalar_wide() + { + uint a0 = (519165704); + uint4x3 b0 = uint4x3(1295178177, 775214121, 467772046, 1156881598, 310396565, 759759959, 243837702, 1616314235, 1053470225, 1320630160, 378773841, 4223608); + uint4x3 r0 = uint4x3(0, 0, 1, 0, 1, 0, 2, 0, 0, 0, 1, 122); + TestUtils.AreEqual(r0, a0 / b0); + + uint a1 = (1971105754); + uint4x3 b1 = uint4x3(2054406020, 219939614, 1603672651, 2006134295, 888535397, 1493077923, 615835131, 1045603945, 452709946, 1074919059, 467037221, 1485241506); + uint4x3 r1 = uint4x3(0, 8, 1, 0, 2, 1, 3, 1, 4, 1, 4, 1); + TestUtils.AreEqual(r1, a1 / b1); + + uint a2 = (1775728786); + uint4x3 b2 = uint4x3(481521341, 68149923, 80867357, 1294049272, 470535313, 1235850199, 631464286, 687722755, 412827650, 1258012095, 1286792622, 1799223034); + uint4x3 r2 = uint4x3(3, 26, 21, 1, 3, 1, 2, 2, 4, 1, 1, 0); + TestUtils.AreEqual(r2, a2 / b2); + + uint a3 = (766890491); + uint4x3 b3 = uint4x3(2080374598, 711612151, 700420132, 1832408481, 1806438353, 237636410, 562498090, 1695805237, 2075783388, 2094216740, 1612536340, 885282904); + uint4x3 r3 = uint4x3(0, 1, 1, 0, 0, 3, 1, 0, 0, 0, 0, 0); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void uint4x3_operator_mod_wide_wide() + { + uint4x3 a0 = uint4x3(258342924, 1454754891, 723352342, 1981431473, 531756042, 716993627, 1667903349, 1331097004, 1776856101, 17598216, 1474345080, 1681376293); + uint4x3 b0 = uint4x3(1990080167, 1197348066, 651970512, 1659454050, 241005212, 1866255454, 1440101415, 595220963, 408818410, 198222574, 549504274, 239973807); + uint4x3 r0 = uint4x3(258342924, 257406825, 71381830, 321977423, 49745618, 716993627, 227801934, 140655078, 141582461, 17598216, 375336532, 1559644); + TestUtils.AreEqual(r0, a0 % b0); + + uint4x3 a1 = uint4x3(813624265, 1617478722, 498370451, 780075943, 1754430321, 653235398, 1517128354, 966216200, 590067427, 1283434795, 1910903650, 1125967790); + uint4x3 b1 = uint4x3(321398087, 658171840, 1511495237, 1048325585, 1126739824, 666641241, 38017598, 418797691, 618700513, 1941062990, 158556432, 1081063558); + uint4x3 r1 = uint4x3(170828091, 301135042, 498370451, 780075943, 627690497, 653235398, 34442032, 128620818, 590067427, 1283434795, 8226466, 44904232); + TestUtils.AreEqual(r1, a1 % b1); + + uint4x3 a2 = uint4x3(1180537254, 308567230, 543945394, 483834400, 308703874, 383723801, 1181975437, 1161083599, 1608412916, 111825133, 786866017, 1225576256); + uint4x3 b2 = uint4x3(427329468, 148111230, 1251162672, 1856322297, 1214781084, 401954255, 1323259633, 1167744452, 1816151689, 541163525, 664455763, 1738838503); + uint4x3 r2 = uint4x3(325878318, 12344770, 543945394, 483834400, 308703874, 383723801, 1181975437, 1161083599, 1608412916, 111825133, 122410254, 1225576256); + TestUtils.AreEqual(r2, a2 % b2); + + uint4x3 a3 = uint4x3(1590085857, 1755638794, 1413553126, 476553804, 1342913944, 1625118233, 1202928007, 504380191, 642905424, 357937367, 1801777444, 1384305901); + uint4x3 b3 = uint4x3(1746284172, 855644567, 1887796950, 655067833, 536415164, 71040983, 631964713, 503267649, 944396748, 302347270, 564261945, 1414291441); + uint4x3 r3 = uint4x3(1590085857, 44349660, 1413553126, 476553804, 270083616, 62216607, 570963294, 1112542, 642905424, 55590097, 108991609, 1384305901); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void uint4x3_operator_mod_wide_scalar() + { + uint4x3 a0 = uint4x3(560988938, 629524514, 767711194, 434281967, 1399805893, 792916846, 1663690927, 598661916, 1776636144, 1287035793, 1743722161, 475209785); + uint b0 = (1156862367); + uint4x3 r0 = uint4x3(560988938, 629524514, 767711194, 434281967, 242943526, 792916846, 506828560, 598661916, 619773777, 130173426, 586859794, 475209785); + TestUtils.AreEqual(r0, a0 % b0); + + uint4x3 a1 = uint4x3(327476870, 379853074, 477430114, 858399046, 712734431, 1506629323, 199829950, 362269020, 1986626876, 1351725413, 1549678101, 431765276); + uint b1 = (1617696916); + uint4x3 r1 = uint4x3(327476870, 379853074, 477430114, 858399046, 712734431, 1506629323, 199829950, 362269020, 368929960, 1351725413, 1549678101, 431765276); + TestUtils.AreEqual(r1, a1 % b1); + + uint4x3 a2 = uint4x3(1315833792, 615834034, 780055604, 104179235, 629966219, 1810536428, 1747026206, 1799535061, 875754431, 2049775667, 303673867, 93301056); + uint b2 = (1664893153); + uint4x3 r2 = uint4x3(1315833792, 615834034, 780055604, 104179235, 629966219, 145643275, 82133053, 134641908, 875754431, 384882514, 303673867, 93301056); + TestUtils.AreEqual(r2, a2 % b2); + + uint4x3 a3 = uint4x3(1944511005, 1065919801, 1342701312, 1356734788, 1593032231, 475449806, 1983416442, 776300612, 591854273, 2061957684, 1865797266, 1982663429); + uint b3 = (2135291183); + uint4x3 r3 = uint4x3(1944511005, 1065919801, 1342701312, 1356734788, 1593032231, 475449806, 1983416442, 776300612, 591854273, 2061957684, 1865797266, 1982663429); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void uint4x3_operator_mod_scalar_wide() + { + uint a0 = (933347930); + uint4x3 b0 = uint4x3(549923387, 243114953, 1884274390, 1428033594, 655531454, 1622674954, 1107563514, 1614111094, 914801920, 1432263179, 564431096, 1967013901); + uint4x3 r0 = uint4x3(383424543, 204003071, 933347930, 933347930, 277816476, 933347930, 933347930, 933347930, 18546010, 933347930, 368916834, 933347930); + TestUtils.AreEqual(r0, a0 % b0); + + uint a1 = (1709750152); + uint4x3 b1 = uint4x3(1080102613, 13120773, 2042535998, 1505698002, 1640058084, 974167554, 758635306, 1387264978, 611743343, 1139002766, 1913935748, 1086810076); + uint4x3 r1 = uint4x3(629647539, 4049662, 1709750152, 204052150, 69692068, 735582598, 192479540, 322485174, 486263466, 570747386, 1709750152, 622940076); + TestUtils.AreEqual(r1, a1 % b1); + + uint a2 = (991846486); + uint4x3 b2 = uint4x3(922870408, 35007468, 891877602, 157349181, 83267982, 801093706, 546272767, 1665089132, 1889242068, 1179889796, 1690033703, 1333252321); + uint4x3 r2 = uint4x3(68976078, 11637382, 99968884, 47751400, 75898684, 190752780, 445573719, 991846486, 991846486, 991846486, 991846486, 991846486); + TestUtils.AreEqual(r2, a2 % b2); + + uint a3 = (1960636489); + uint4x3 b3 = uint4x3(960755248, 698650125, 313994074, 1830992514, 2049496523, 507742240, 739436968, 1012724736, 2089810815, 329356442, 384427687, 713578570); + uint4x3 r3 = uint4x3(39125993, 563336239, 76672045, 129643975, 1960636489, 437409769, 481762553, 947911753, 1960636489, 313854279, 38498054, 533479349); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void uint4x3_operator_plus() + { + uint4x3 a0 = uint4x3(195392567, 222719748, 1002351013, 1570765263, 109389333, 1515950277, 1689763402, 291471785, 264115671, 1084131995, 195779102, 2131702223); + uint4x3 r0 = uint4x3(195392567, 222719748, 1002351013, 1570765263, 109389333, 1515950277, 1689763402, 291471785, 264115671, 1084131995, 195779102, 2131702223); + TestUtils.AreEqual(r0, +a0); + + uint4x3 a1 = uint4x3(715660442, 69731564, 1317851903, 1957501908, 531426536, 2012985092, 1334133318, 1539671418, 935436165, 1575048895, 2119066258, 781435471); + uint4x3 r1 = uint4x3(715660442, 69731564, 1317851903, 1957501908, 531426536, 2012985092, 1334133318, 1539671418, 935436165, 1575048895, 2119066258, 781435471); + TestUtils.AreEqual(r1, +a1); + + uint4x3 a2 = uint4x3(1659000230, 1153431944, 1360657696, 578750954, 150348334, 1791553179, 1288641627, 735146513, 328684789, 1370099515, 1575634098, 36481877); + uint4x3 r2 = uint4x3(1659000230, 1153431944, 1360657696, 578750954, 150348334, 1791553179, 1288641627, 735146513, 328684789, 1370099515, 1575634098, 36481877); + TestUtils.AreEqual(r2, +a2); + + uint4x3 a3 = uint4x3(1832055170, 1370934466, 1126708142, 511229253, 1297664549, 1444401655, 1292097101, 1377029046, 1680766483, 249526091, 656501406, 195015813); + uint4x3 r3 = uint4x3(1832055170, 1370934466, 1126708142, 511229253, 1297664549, 1444401655, 1292097101, 1377029046, 1680766483, 249526091, 656501406, 195015813); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void uint4x3_operator_neg() + { + uint4x3 a0 = uint4x3(1385088677, 94114564, 1350664872, 1458616659, 2067164853, 218122493, 958484951, 270553961, 446497525, 270503114, 1928771252, 1427605822); + uint4x3 r0 = uint4x3(2909878619, 4200852732, 2944302424, 2836350637, 2227802443, 4076844803, 3336482345, 4024413335, 3848469771, 4024464182, 2366196044, 2867361474); + TestUtils.AreEqual(r0, -a0); + + uint4x3 a1 = uint4x3(2051940607, 485368391, 908365416, 1742096480, 990033169, 1368056141, 1350976157, 12802586, 1934372287, 576597401, 785136322, 559205611); + uint4x3 r1 = uint4x3(2243026689, 3809598905, 3386601880, 2552870816, 3304934127, 2926911155, 2943991139, 4282164710, 2360595009, 3718369895, 3509830974, 3735761685); + TestUtils.AreEqual(r1, -a1); + + uint4x3 a2 = uint4x3(1959833280, 1200036971, 95281343, 1969004480, 1381288239, 252975075, 1961335692, 1607042487, 832886233, 1300359361, 8438338, 431498011); + uint4x3 r2 = uint4x3(2335134016, 3094930325, 4199685953, 2325962816, 2913679057, 4041992221, 2333631604, 2687924809, 3462081063, 2994607935, 4286528958, 3863469285); + TestUtils.AreEqual(r2, -a2); + + uint4x3 a3 = uint4x3(1534415387, 866625695, 2105773520, 1249998702, 1704935592, 59004141, 257619538, 392825753, 1868257049, 1472660509, 928823577, 2138036799); + uint4x3 r3 = uint4x3(2760551909, 3428341601, 2189193776, 3044968594, 2590031704, 4235963155, 4037347758, 3902141543, 2426710247, 2822306787, 3366143719, 2156930497); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void uint4x3_operator_prefix_inc() + { + uint4x3 a0 = uint4x3(780471723, 954741756, 272723451, 2142862245, 606294309, 1514814550, 250124151, 444189162, 1833356994, 1915989169, 1348278302, 129540735); + uint4x3 r0 = uint4x3(780471724, 954741757, 272723452, 2142862246, 606294310, 1514814551, 250124152, 444189163, 1833356995, 1915989170, 1348278303, 129540736); + TestUtils.AreEqual(r0, ++a0); + + uint4x3 a1 = uint4x3(1584496757, 986715680, 1701179230, 1397451003, 483952900, 1494652811, 1268688387, 2014528731, 453850931, 1112537171, 621362788, 2063486914); + uint4x3 r1 = uint4x3(1584496758, 986715681, 1701179231, 1397451004, 483952901, 1494652812, 1268688388, 2014528732, 453850932, 1112537172, 621362789, 2063486915); + TestUtils.AreEqual(r1, ++a1); + + uint4x3 a2 = uint4x3(1612870531, 1083861484, 1583359796, 82587894, 810087437, 72436569, 1094485773, 912422931, 1011314676, 261771874, 2042016403, 1102472175); + uint4x3 r2 = uint4x3(1612870532, 1083861485, 1583359797, 82587895, 810087438, 72436570, 1094485774, 912422932, 1011314677, 261771875, 2042016404, 1102472176); + TestUtils.AreEqual(r2, ++a2); + + uint4x3 a3 = uint4x3(976635804, 607693651, 1788488571, 1912059986, 420746703, 1703260621, 501684292, 1809882373, 1989306461, 786299198, 1729269500, 411043860); + uint4x3 r3 = uint4x3(976635805, 607693652, 1788488572, 1912059987, 420746704, 1703260622, 501684293, 1809882374, 1989306462, 786299199, 1729269501, 411043861); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void uint4x3_operator_postfix_inc() + { + uint4x3 a0 = uint4x3(241865086, 2145821641, 1596166022, 803592338, 529551271, 1656767229, 903047443, 1213663244, 1425753247, 1384002775, 389844650, 1159795446); + uint4x3 r0 = uint4x3(241865086, 2145821641, 1596166022, 803592338, 529551271, 1656767229, 903047443, 1213663244, 1425753247, 1384002775, 389844650, 1159795446); + TestUtils.AreEqual(r0, a0++); + + uint4x3 a1 = uint4x3(1343289659, 947635082, 137930180, 451018043, 1634297552, 2009552507, 1176922170, 388721494, 2381860, 2062858295, 715101397, 1725384327); + uint4x3 r1 = uint4x3(1343289659, 947635082, 137930180, 451018043, 1634297552, 2009552507, 1176922170, 388721494, 2381860, 2062858295, 715101397, 1725384327); + TestUtils.AreEqual(r1, a1++); + + uint4x3 a2 = uint4x3(446867079, 1460883320, 1683365096, 1319511974, 1418603655, 1938539756, 592683318, 1576213022, 1150548583, 904484472, 253685095, 70826818); + uint4x3 r2 = uint4x3(446867079, 1460883320, 1683365096, 1319511974, 1418603655, 1938539756, 592683318, 1576213022, 1150548583, 904484472, 253685095, 70826818); + TestUtils.AreEqual(r2, a2++); + + uint4x3 a3 = uint4x3(1423673637, 257117856, 964412816, 1148726183, 1820437224, 1087435092, 475319856, 1950385959, 1172607661, 1139700625, 1386106060, 612787013); + uint4x3 r3 = uint4x3(1423673637, 257117856, 964412816, 1148726183, 1820437224, 1087435092, 475319856, 1950385959, 1172607661, 1139700625, 1386106060, 612787013); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void uint4x3_operator_prefix_dec() + { + uint4x3 a0 = uint4x3(1331961415, 1612382200, 1401591249, 2042075388, 1757136546, 1895858159, 1467742422, 578341664, 1336115745, 2059077641, 1169239112, 1862369220); + uint4x3 r0 = uint4x3(1331961414, 1612382199, 1401591248, 2042075387, 1757136545, 1895858158, 1467742421, 578341663, 1336115744, 2059077640, 1169239111, 1862369219); + TestUtils.AreEqual(r0, --a0); + + uint4x3 a1 = uint4x3(312317355, 1595492535, 1426262619, 1426620468, 674685792, 1423852012, 1459529624, 2092317419, 107501474, 1261583506, 512900840, 1496855314); + uint4x3 r1 = uint4x3(312317354, 1595492534, 1426262618, 1426620467, 674685791, 1423852011, 1459529623, 2092317418, 107501473, 1261583505, 512900839, 1496855313); + TestUtils.AreEqual(r1, --a1); + + uint4x3 a2 = uint4x3(777588547, 1487639376, 625907330, 1452782388, 804650978, 2076275981, 120447533, 262357170, 1887136873, 412907314, 846648478, 473291493); + uint4x3 r2 = uint4x3(777588546, 1487639375, 625907329, 1452782387, 804650977, 2076275980, 120447532, 262357169, 1887136872, 412907313, 846648477, 473291492); + TestUtils.AreEqual(r2, --a2); + + uint4x3 a3 = uint4x3(286048219, 1237897291, 1412498905, 346348942, 953070054, 2028727932, 2006551142, 1345994403, 1356250542, 1202345509, 497982699, 982734742); + uint4x3 r3 = uint4x3(286048218, 1237897290, 1412498904, 346348941, 953070053, 2028727931, 2006551141, 1345994402, 1356250541, 1202345508, 497982698, 982734741); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void uint4x3_operator_postfix_dec() + { + uint4x3 a0 = uint4x3(1870005937, 1708534798, 704493460, 462940703, 2060593573, 228744869, 940247280, 1818778351, 1015253889, 862428933, 1401191870, 2080259851); + uint4x3 r0 = uint4x3(1870005937, 1708534798, 704493460, 462940703, 2060593573, 228744869, 940247280, 1818778351, 1015253889, 862428933, 1401191870, 2080259851); + TestUtils.AreEqual(r0, a0--); + + uint4x3 a1 = uint4x3(653673271, 1928164223, 1760916301, 1174531383, 634036198, 993137684, 1669210509, 874927437, 1393579866, 471308632, 620865961, 220103745); + uint4x3 r1 = uint4x3(653673271, 1928164223, 1760916301, 1174531383, 634036198, 993137684, 1669210509, 874927437, 1393579866, 471308632, 620865961, 220103745); + TestUtils.AreEqual(r1, a1--); + + uint4x3 a2 = uint4x3(1407678826, 1426931482, 488775250, 1681733117, 1916879863, 2060905976, 636358505, 1379709480, 451326084, 497925052, 549367303, 925145385); + uint4x3 r2 = uint4x3(1407678826, 1426931482, 488775250, 1681733117, 1916879863, 2060905976, 636358505, 1379709480, 451326084, 497925052, 549367303, 925145385); + TestUtils.AreEqual(r2, a2--); + + uint4x3 a3 = uint4x3(55306458, 18471540, 1907671409, 2010375112, 459674494, 1339288497, 548526029, 2061115550, 1130246689, 681734791, 1169678318, 640772261); + uint4x3 r3 = uint4x3(55306458, 18471540, 1907671409, 2010375112, 459674494, 1339288497, 548526029, 2061115550, 1130246689, 681734791, 1169678318, 640772261); + TestUtils.AreEqual(r3, a3--); + } + + [TestCompiler] + public static void uint4x3_operator_bitwise_and_wide_wide() + { + uint4x3 a0 = uint4x3(1055241304, 859321394, 1088358961, 2090949513, 300561740, 651904515, 1331035868, 2012752753, 1298126656, 53199569, 1752363533, 1303061302); + uint4x3 b0 = uint4x3(749698416, 748105424, 1842764797, 9990577, 1989102105, 1666634755, 58116798, 868036607, 1420638875, 1308767169, 564040763, 478617502); + uint4x3 r0 = uint4x3(749024336, 537928720, 1087769137, 8409473, 277479432, 575816707, 55888540, 867707761, 1141707264, 33686209, 538087433, 209912598); + TestUtils.AreEqual(r0, a0 & b0); + + uint4x3 a1 = uint4x3(1929998247, 1504941434, 470682792, 713577376, 1493231658, 1340884669, 1577921467, 44846626, 1105094388, 1143008413, 333009589, 2116296009); + uint4x3 b1 = uint4x3(806150474, 674015378, 1505309955, 36064977, 1779639327, 808650076, 1634437037, 1997568501, 1930853951, 1901503461, 1508772523, 2010961769); + uint4x3 r1 = uint4x3(805855490, 136347666, 403178496, 33571456, 1207967754, 2098204, 1074332585, 33572896, 1091986996, 1073782917, 298320545, 1979979081); + TestUtils.AreEqual(r1, a1 & b1); + + uint4x3 a2 = uint4x3(2067254825, 121795325, 2122365250, 1088796653, 1594120761, 965590824, 337823363, 1686791432, 1275524729, 173403097, 864715776, 1437598787); + uint4x3 b2 = uint4x3(1495957269, 1914669725, 1263994006, 491200541, 380703892, 282208487, 1416934135, 942735432, 615839538, 1698880188, 1204102677, 1811173266); + uint4x3 r2 = uint4x3(1495420417, 33686173, 1241513986, 4530189, 369102864, 276834336, 337674883, 536870920, 67434032, 4246168, 58721280, 1102054402); + TestUtils.AreEqual(r2, a2 & b2); + + uint4x3 a3 = uint4x3(1375792249, 203672781, 1568515997, 145607913, 837338112, 754244200, 1383514630, 61183374, 690842674, 1362012962, 668846213, 1659745138); + uint4x3 b3 = uint4x3(203114715, 1968993229, 1549041488, 421225724, 1641463312, 1122209170, 946391298, 229237652, 849684128, 1197217575, 1910121786, 1835643900); + uint4x3 r3 = uint4x3(18521, 67125453, 1549018896, 134825192, 566264832, 14714880, 274776066, 27361668, 539304992, 1091306274, 567803904, 1617539952); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void uint4x3_operator_bitwise_and_wide_scalar() + { + uint4x3 a0 = uint4x3(1513158868, 284695609, 734595037, 1566510707, 1601252476, 84213838, 314333543, 430856908, 753481263, 327392481, 1619794917, 2143619546); + uint b0 = (1173647397); + uint4x3 r0 = uint4x3(1076916228, 15732769, 29360133, 1163132961, 1164976164, 84148228, 11816997, 27545604, 81801253, 25169953, 1082396709, 1170472960); + TestUtils.AreEqual(r0, a0 & b0); + + uint4x3 a1 = uint4x3(1873208293, 651482651, 1383096952, 1689107088, 1368301071, 366962092, 1729929586, 989550739, 1914435619, 1592791064, 2047510829, 678485991); + uint b1 = (126982769); + uint4x3 r1 = uint4x3(125862497, 110137873, 34603632, 75602448, 25205249, 93388832, 118521968, 43063313, 34707489, 110104592, 33589281, 1088097); + TestUtils.AreEqual(r1, a1 & b1); + + uint4x3 a2 = uint4x3(586400261, 309059606, 131945492, 1707451796, 394184188, 1943201012, 558008097, 1070093422, 34324916, 258102213, 1800249857, 922911179); + uint b2 = (771972179); + uint4x3 r2 = uint4x3(570638337, 33767442, 100750352, 604046352, 100811856, 570573904, 537003009, 771773506, 33767440, 235032641, 704708609, 637665347); + TestUtils.AreEqual(r2, a2 & b2); + + uint4x3 a3 = uint4x3(1719705954, 1162961184, 851638827, 889902874, 1622363409, 785352441, 1741477119, 452211039, 1144654389, 641588835, 1574197624, 568430284); + uint b3 = (609219265); + uint4x3 r3 = uint4x3(604020800, 71393280, 541258241, 604688896, 537083905, 609190593, 609013953, 4468801, 67764737, 604885569, 71585856, 541164224); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void uint4x3_operator_bitwise_and_scalar_wide() + { + uint a0 = (477163326); + uint4x3 b0 = uint4x3(110453385, 703240362, 2075630560, 1884904031, 1734899436, 947945203, 1664399051, 458879298, 158491426, 79772356, 2054527944, 202228212); + uint4x3 r0 = uint4x3(68182536, 140544042, 405834528, 273697310, 73426476, 402681394, 3188234, 407953666, 141583138, 71313924, 410028808, 201376052); + TestUtils.AreEqual(r0, a0 & b0); + + uint a1 = (359225061); + uint4x3 b1 = uint4x3(639811396, 1821945318, 1821303024, 2030124055, 1985961756, 579780373, 2061831301, 1139618293, 1145191868, 1121606282, 1414714065, 688688277); + uint4x3 r1 = uint4x3(69211716, 67634404, 67649760, 285283333, 340350468, 529925, 274793605, 23662821, 71308452, 4739712, 339759809, 17302661); + TestUtils.AreEqual(r1, a1 & b1); + + uint a2 = (1508875606); + uint4x3 b2 = uint4x3(664318814, 2092766410, 1010043618, 599967779, 47076367, 1325716015, 1119912335, 2083412385, 1805692137, 1689798540, 265665838, 1616867488); + uint4x3 r2 = uint4x3(25727318, 1487737922, 405014594, 29526018, 13505542, 1225035782, 1086357766, 1479416064, 1235258432, 1084753156, 163945734, 1078923264); + TestUtils.AreEqual(r2, a2 & b2); + + uint a3 = (244288538); + uint4x3 b3 = uint4x3(688929004, 1157047188, 1381359113, 1562107079, 944933664, 1994959125, 1413414673, 1280114143, 1373827711, 1107998701, 890185579, 195053206); + uint4x3 r3 = uint4x3(134219784, 75956240, 33917960, 202083330, 134383616, 109611024, 68062224, 202148890, 8552474, 34243592, 68092938, 176161810); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void uint4x3_operator_bitwise_or_wide_wide() + { + uint4x3 a0 = uint4x3(1920951869, 1750772852, 1420019191, 732977093, 1169579447, 229437930, 1966721348, 2039812323, 113550869, 1912038362, 1569990624, 1490718227); + uint4x3 b0 = uint4x3(214585254, 275414367, 858759675, 190211455, 1218691723, 2129565457, 1862809466, 495728846, 868064152, 1756913766, 933656055, 247722084); + uint4x3 r0 = uint4x3(2130669503, 2021326207, 2008016383, 737572863, 1303895999, 2146367483, 2134507390, 2107455727, 939376541, 2046780414, 2142664695, 1591475831); + TestUtils.AreEqual(r0, a0 | b0); + + uint4x3 a1 = uint4x3(1686257697, 2137727522, 1569900650, 856504729, 2033376384, 2086259889, 671790684, 1189001916, 1756048437, 417084592, 2024165808, 966008272); + uint4x3 b1 = uint4x3(1884195075, 1804207631, 1913174711, 1815920856, 1226577606, 1696467642, 186912044, 1778908130, 1461256625, 1142152181, 272117331, 1162254035); + uint4x3 r1 = uint4x3(1959708963, 2146117167, 2140863231, 2134768089, 2034163398, 2103430843, 724483964, 1860172798, 2142973365, 1558183925, 2025750515, 2111217619); + TestUtils.AreEqual(r1, a1 | b1); + + uint4x3 a2 = uint4x3(2031026290, 1461019191, 1071959084, 1645847295, 871350674, 736640317, 868515800, 767794452, 362186994, 96189073, 1924033224, 1971421809); + uint4x3 b2 = uint4x3(870448102, 1845053992, 257334526, 987295814, 1503050768, 1683307763, 1076253109, 1403888383, 561000721, 740143742, 343344681, 2074122472); + uint4x3 r2 = uint4x3(2079325174, 2147314239, 1073143038, 2061103871, 2080374162, 1878867455, 1944485885, 2146418687, 905361907, 767539967, 1996451561, 2141297401); + TestUtils.AreEqual(r2, a2 | b2); + + uint4x3 a3 = uint4x3(1826545883, 865329, 516571463, 371039923, 918186803, 1920664988, 452155520, 743961772, 1728213958, 825116968, 1597755374, 910392330); + uint4x3 b3 = uint4x3(133130232, 108733999, 348566046, 1414140366, 975473487, 699452548, 1158934384, 1776041858, 1098964075, 1316223563, 1653177800, 679795328); + uint4x3 r3 = uint4x3(1879042043, 109000255, 516879199, 1449107455, 1052699519, 2080099740, 1609826288, 1843396526, 1736638447, 2139093867, 2143027182, 1053294218); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void uint4x3_operator_bitwise_or_wide_scalar() + { + uint4x3 a0 = uint4x3(1295304853, 1307252624, 350194630, 1128063578, 1774824542, 2085245467, 1988423804, 999162350, 2110327307, 1050875188, 341855232, 1317039676); + uint b0 = (1305527136); + uint4x3 r0 = uint4x3(1307888629, 1308350448, 1574947814, 1341973370, 1842999166, 2111492987, 2144662396, 2145305582, 2111425387, 2146686836, 1576062816, 1339092860); + TestUtils.AreEqual(r0, a0 | b0); + + uint4x3 a1 = uint4x3(228656898, 1536908787, 606786773, 1739461580, 2040936581, 1350320187, 1377874553, 1522262112, 1496806239, 1732466858, 1535976093, 375675620); + uint b1 = (41280811); + uint4x3 r1 = uint4x3(267773739, 1543503355, 645920255, 1744828399, 2079849903, 1383982395, 1383462779, 1526719851, 1534588799, 1735916971, 1543366591, 376831983); + TestUtils.AreEqual(r1, a1 | b1); + + uint4x3 a2 = uint4x3(1614193383, 697385997, 112556963, 1614163749, 1583289054, 1370656810, 1286074530, 1155438844, 1835671387, 440002979, 1569359727, 5393691); + uint b2 = (226059393); + uint4x3 r2 = uint4x3(1837098727, 771318925, 268271523, 1837068197, 1602189023, 1576793259, 1308619939, 1308622077, 1836810203, 528084387, 1576789999, 226192795); + TestUtils.AreEqual(r2, a2 | b2); + + uint4x3 a3 = uint4x3(774282482, 212144562, 1525899482, 463019249, 1531812233, 1944160603, 953179348, 1692078056, 1331652826, 183129856, 1305664018, 626899632); + uint b3 = (1217128427); + uint4x3 r3 = uint4x3(1857028091, 1286600699, 1526458363, 1536950267, 1540358123, 2079059963, 2027683839, 1826353131, 1340076027, 1256978411, 1306263547, 1843396603); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void uint4x3_operator_bitwise_or_scalar_wide() + { + uint a0 = (1768627592); + uint4x3 b0 = uint4x3(1849658052, 1759912154, 729979455, 975926310, 1987690876, 1809506714, 1160695341, 408963395, 314072711, 1560007537, 1709003416, 977086639); + uint4x3 r0 = uint4x3(1870634956, 1777286618, 1810603967, 2070642094, 2138824188, 1811676570, 1836048301, 2037079499, 2080071567, 2113658873, 1845452696, 2071936431); + TestUtils.AreEqual(r0, a0 | b0); + + uint a1 = (1448375596); + uint4x3 b1 = uint4x3(1689568808, 595543345, 559778387, 621080913, 438994183, 1742637145, 1219409263, 1602932494, 1204461702, 2111538444, 836730895, 1207638621); + uint4x3 r1 = uint4x3(1995765548, 2004841789, 2002648959, 2002056573, 1585378607, 2011102589, 1593767279, 1608449838, 1474229678, 2145383724, 2011165999, 1476362109); + TestUtils.AreEqual(r1, a1 | b1); + + uint a2 = (802100209); + uint4x3 b2 = uint4x3(1089077339, 1315030334, 249047666, 1604790897, 1848168086, 347254235, 1777613639, 1876731927, 842785732, 1023558747, 1567635900, 1888818835); + uint4x3 r2 = uint4x3(1877939195, 1877989375, 803159027, 2146384881, 1877991415, 1073725435, 1878998007, 1876933623, 1073738741, 1070553083, 2147433469, 2145327091); + TestUtils.AreEqual(r2, a2 | b2); + + uint a3 = (1681286114); + uint4x3 b3 = uint4x3(816160472, 669874393, 856364582, 957707703, 533888601, 707380794, 1472392035, 1658477097, 490006292, 1104319323, 1803275943, 1843251082); + uint4x3 r3 = uint4x3(1958215674, 1744796667, 2000648166, 2100787191, 2146861051, 1849681914, 2012670947, 1727953899, 2100750326, 1710683131, 1870655463, 1845487594); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void uint4x3_operator_bitwise_xor_wide_wide() + { + uint4x3 a0 = uint4x3(1843655608, 362425681, 640805534, 1342040268, 945678755, 980321850, 390165019, 1682422658, 303897251, 230477768, 1103646442, 1503102919); + uint4x3 b0 = uint4x3(1422803441, 1234691140, 119589253, 1101464929, 121896337, 1880109018, 1000210266, 1718938232, 464406940, 884337881, 34199854, 1430659227); + uint4x3 r0 = uint4x3(959296073, 1544407317, 554771227, 240840109, 1058935858, 1249815008, 752651585, 36917754, 162747199, 956900113, 1136760772, 215066460); + TestUtils.AreEqual(r0, a0 ^ b0); + + uint4x3 a1 = uint4x3(26631152, 1016475570, 1862440929, 379588576, 1943580404, 691527166, 723280696, 497086939, 1640104913, 893178410, 1596765788, 664096470); + uint4x3 b1 = uint4x3(126415540, 1069919967, 1810763253, 2082802224, 941097951, 27782297, 156353074, 607061607, 470737131, 1151564598, 8268481, 434405645); + uint4x3 r1 = uint4x3(102672708, 55804269, 82614804, 1787102672, 1270918443, 680538471, 575512842, 965736380, 2110579514, 1906288924, 1599249565, 1047646171); + TestUtils.AreEqual(r1, a1 ^ b1); + + uint4x3 a2 = uint4x3(2043360590, 799560121, 287637604, 696169196, 2067184169, 1208059988, 1250597330, 1386507647, 1889791408, 2084012261, 308683100, 995657536); + uint4x3 b2 = uint4x3(519003095, 1880915120, 608970922, 1809455754, 1079250101, 514389994, 272120301, 1282399149, 1045003273, 1596550715, 1654640361, 147544177); + uint4x3 r2 = uint4x3(1730440857, 1605643529, 896084174, 1118087270, 996325020, 1453948862, 1521655871, 516667090, 1323995577, 589229790, 1895428021, 865328945); + TestUtils.AreEqual(r2, a2 ^ b2); + + uint4x3 a3 = uint4x3(2114803648, 1391716615, 1288505091, 1981377086, 1609802717, 1174043024, 1011203132, 1795164620, 244928755, 108081775, 1095776733, 1503947924); + uint4x3 b3 = uint4x3(1770899808, 632909311, 351538321, 18362671, 582069925, 1343437834, 646157103, 1334609482, 1029555059, 1791514242, 2130180592, 1367984612); + uint4x3 r3 = uint4x3(394305184, 2001372408, 1480133522, 1996577553, 2101480824, 367609242, 449195795, 613191558, 868520832, 1824089325, 1067958317, 137209200); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void uint4x3_operator_bitwise_xor_wide_scalar() + { + uint4x3 a0 = uint4x3(169345668, 176087064, 2084362901, 1663924004, 193851255, 517476661, 905336222, 863800783, 365003873, 835837496, 954341348, 1464576786); + uint b0 = (354464228); + uint4x3 r0 = uint4x3(523809632, 526275068, 1763470193, 1980614336, 514678419, 200843473, 550954106, 643578923, 14759301, 619802588, 767731200, 1114315510); + TestUtils.AreEqual(r0, a0 ^ b0); + + uint4x3 a1 = uint4x3(625604047, 2003392824, 1481813598, 1077374714, 1043379893, 1991576049, 781860967, 60088394, 1196907956, 858716109, 858484213, 178843494); + uint b1 = (1700827127); + uint4x3 r1 = uint4x3(1076460088, 302634703, 1026695593, 626516237, 1531984194, 332760582, 1274728336, 1727295421, 574083651, 1447983162, 1447813634, 1875402897); + TestUtils.AreEqual(r1, a1 ^ b1); + + uint4x3 a2 = uint4x3(1223183458, 1771693181, 1206307664, 2037729583, 1324393116, 497725784, 1367278685, 962962860, 906632547, 1570278596, 1744797352, 574677361); + uint b2 = (866652388); + uint4x3 r2 = uint4x3(2067815558, 1513223321, 1951325108, 1256020427, 2102964856, 771924412, 1658262713, 181253448, 94506375, 1848679456, 1415016012, 300478869); + TestUtils.AreEqual(r2, a2 ^ b2); + + uint4x3 a3 = uint4x3(1363709514, 801937870, 1010182360, 1851940033, 346084804, 1153678862, 443991213, 53881334, 2016754499, 1219039118, 98879165, 1431003548); + uint b3 = (1256194849); + uint4x3 r3 = uint4x3(464031083, 1697422063, 1993747449, 612524000, 1581307621, 237223215, 1352058764, 1238772439, 852834402, 38341807, 1325712796, 531325629); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void uint4x3_operator_bitwise_xor_scalar_wide() + { + uint a0 = (1361775641); + uint4x3 b0 = uint4x3(1452773578, 459050892, 1986218254, 1689037698, 999278344, 1229114508, 1087843538, 733699740, 106187872, 1533632738, 1107817672, 492506236); + uint4x3 r0 = uint4x3(129801427, 1249346453, 659047703, 898082715, 1789184785, 409583765, 301736139, 2056278661, 1467957369, 172125435, 321714385, 1282408549); + TestUtils.AreEqual(r0, a0 ^ b0); + + uint a1 = (597602329); + uint4x3 b1 = uint4x3(1439603382, 1001169118, 1231718216, 1693179077, 1050897427, 1796435561, 1100532547, 2106589181, 79691722, 851486414, 381749210, 1743618507); + uint4x3 r1 = uint4x3(1984965295, 405934279, 1794389841, 1198877916, 490593290, 1217257072, 1644591962, 1578192868, 656494547, 291378903, 895465411, 1148400082); + TestUtils.AreEqual(r1, a1 ^ b1); + + uint a2 = (2038827673); + uint4x3 b2 = uint4x3(1680906962, 161437943, 171927307, 277703584, 1344718195, 1634011177, 28540247, 1205447252, 150341716, 899457210, 1927941858, 1213321665); + uint4x3 r2 = uint4x3(498503755, 1880707694, 1941532050, 1762353465, 698404842, 417530544, 2016769998, 1046454477, 1903166157, 1276815907, 191628411, 836229976); + TestUtils.AreEqual(r2, a2 ^ b2); + + uint a3 = (1943899052); + uint4x3 b3 = uint4x3(1166699955, 244059986, 698605361, 770240668, 1451322609, 409403288, 227252138, 455879262, 1859170556, 2135312326, 436746325, 843204844); + uint4x3 r3 = uint4x3(911730207, 2102494462, 1518228637, 1580563248, 626845533, 1807447092, 2119572486, 1760666098, 487406416, 211537002, 1775612921, 1100989248); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void uint4x3_operator_left_shift() + { + uint4x3 a0 = uint4x3(1129100049, 829482269, 1571297368, 443753193, 1872142968, 249554593, 892627436, 980302862, 62369727, 849916599, 1271350845, 108441902); + int b0 = (218351941); + uint4x3 r0 = uint4x3(1771463200, 773628832, 3036875520, 1315200288, 4074000128, 3690779680, 2794274176, 1304920512, 1995831264, 1427527392, 2028521376, 3470140864); + TestUtils.AreEqual(r0, a0 << b0); + + uint4x3 a1 = uint4x3(1959056531, 1451674188, 2082026915, 1149883636, 1380536034, 186532735, 1487486874, 1498738574, 752067504, 1647167336, 772453640, 456967739); + int b1 = (1779118882); + uint4x3 r1 = uint4x3(3541258828, 1511729456, 4033140364, 304567248, 1227176840, 746130940, 1654980200, 1699987000, 3008270016, 2293702048, 3089814560, 1827870956); + TestUtils.AreEqual(r1, a1 << b1); + + uint4x3 a2 = uint4x3(947384545, 1315516161, 640579158, 56630178, 1650899378, 2142944517, 565484033, 965161323, 1634169280, 1821547426, 1959741996, 1189216014); + int b2 = (1463252873); + uint4x3 r2 = uint4x3(4024549888, 3529376256, 1559014400, 3224847360, 3446891520, 1970932224, 1765016064, 241358336, 3471015936, 624378880, 2660521984, 3288210432); + TestUtils.AreEqual(r2, a2 << b2); + + uint4x3 a3 = uint4x3(2088913234, 1765476869, 1716088059, 2042799042, 1560870407, 1332136179, 1595140080, 1067324801, 948699739, 1516035622, 1153563832, 1430593538); + int b3 = (331636352); + uint4x3 r3 = uint4x3(2088913234, 1765476869, 1716088059, 2042799042, 1560870407, 1332136179, 1595140080, 1067324801, 948699739, 1516035622, 1153563832, 1430593538); + TestUtils.AreEqual(r3, a3 << b3); + } + + [TestCompiler] + public static void uint4x3_operator_right_shift() + { + uint4x3 a0 = uint4x3(809126085, 908563670, 763568837, 1986717290, 1174507510, 646821842, 1242726074, 390811632, 1521420393, 1923166649, 102096936, 400863878); + int b0 = (994800051); + uint4x3 r0 = uint4x3(1543, 1732, 1456, 3789, 2240, 1233, 2370, 745, 2901, 3668, 194, 764); + TestUtils.AreEqual(r0, a0 >> b0); + + uint4x3 a1 = uint4x3(667378673, 307750782, 479442287, 2014389412, 1673938174, 1075916177, 1248577253, 848199210, 813936577, 848976170, 500930883, 662405800); + int b1 = (1611921244); + uint4x3 r1 = uint4x3(2, 1, 1, 7, 6, 4, 4, 3, 3, 3, 1, 2); + TestUtils.AreEqual(r1, a1 >> b1); + + uint4x3 a2 = uint4x3(126875849, 1199000503, 955487090, 1013356510, 391605984, 185228398, 87452680, 2021602226, 1401766495, 275199908, 664576720, 363706280); + int b2 = (1103917083); + uint4x3 r2 = uint4x3(0, 8, 7, 7, 2, 1, 0, 15, 10, 2, 4, 2); + TestUtils.AreEqual(r2, a2 >> b2); + + uint4x3 a3 = uint4x3(1600231415, 1403250657, 1132760506, 388419548, 1563117590, 1786307084, 1386128491, 1614558171, 370772389, 47213745, 1348912303, 1452132416); + int b3 = (19835299); + uint4x3 r3 = uint4x3(200028926, 175406332, 141595063, 48552443, 195389698, 223288385, 173266061, 201819771, 46346548, 5901718, 168614037, 181516552); + TestUtils.AreEqual(r3, a3 >> b3); + } + + [TestCompiler] + public static void uint4x3_operator_bitwise_not() + { + uint4x3 a0 = uint4x3(111796841, 603562399, 745091931, 853183268, 1110916612, 381888399, 1891338755, 1506860135, 771210628, 787710759, 875964607, 96456785); + uint4x3 r0 = uint4x3(4183170454, 3691404896, 3549875364, 3441784027, 3184050683, 3913078896, 2403628540, 2788107160, 3523756667, 3507256536, 3419002688, 4198510510); + TestUtils.AreEqual(r0, ~a0); + + uint4x3 a1 = uint4x3(916013379, 1172294211, 1020232736, 683852713, 375158799, 881353367, 1218471344, 1174233245, 592898220, 443427914, 1385118179, 215320517); + uint4x3 r1 = uint4x3(3378953916, 3122673084, 3274734559, 3611114582, 3919808496, 3413613928, 3076495951, 3120734050, 3702069075, 3851539381, 2909849116, 4079646778); + TestUtils.AreEqual(r1, ~a1); + + uint4x3 a2 = uint4x3(860122767, 1349739899, 686325107, 829984855, 191189901, 319233142, 156019905, 1467719681, 1193642973, 957020051, 610113447, 1906177458); + uint4x3 r2 = uint4x3(3434844528, 2945227396, 3608642188, 3464982440, 4103777394, 3975734153, 4138947390, 2827247614, 3101324322, 3337947244, 3684853848, 2388789837); + TestUtils.AreEqual(r2, ~a2); + + uint4x3 a3 = uint4x3(1022824453, 1876376887, 479785538, 1454477141, 1062967600, 864049393, 916152339, 1644897753, 1624633488, 210894078, 759733457, 40062168); + uint4x3 r3 = uint4x3(3272142842, 2418590408, 3815181757, 2840490154, 3231999695, 3430917902, 3378814956, 2650069542, 2670333807, 4084073217, 3535233838, 4254905127); + TestUtils.AreEqual(r3, ~a3); + } + + [TestCase /* For player builds */] + public static void uint4x3_EqualsObjectOverride() + { + TestUtils.IsFalse(new uint4x3().Equals((object)new int())); + TestUtils.IsTrue(new uint4x3().Equals((object)new uint4x3())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestUint4x3.gen.cs.meta b/src/Tests/Tests/Shared/TestUint4x3.gen.cs.meta new file mode 100644 index 00000000..4c46c927 --- /dev/null +++ b/src/Tests/Tests/Shared/TestUint4x3.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2459d4a10dea40e469cb5f05b3fa80c2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestUint4x4.gen.cs b/src/Tests/Tests/Shared/TestUint4x4.gen.cs new file mode 100644 index 00000000..b9fc3f5e --- /dev/null +++ b/src/Tests/Tests/Shared/TestUint4x4.gen.cs @@ -0,0 +1,1265 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public class TestUint4x4 + { + [TestCompiler] + public static void uint4x4_zero() + { + TestUtils.AreEqual(0u, uint4x4.zero.c0.x); + TestUtils.AreEqual(0u, uint4x4.zero.c0.y); + TestUtils.AreEqual(0u, uint4x4.zero.c0.z); + TestUtils.AreEqual(0u, uint4x4.zero.c0.w); + TestUtils.AreEqual(0u, uint4x4.zero.c1.x); + TestUtils.AreEqual(0u, uint4x4.zero.c1.y); + TestUtils.AreEqual(0u, uint4x4.zero.c1.z); + TestUtils.AreEqual(0u, uint4x4.zero.c1.w); + TestUtils.AreEqual(0u, uint4x4.zero.c2.x); + TestUtils.AreEqual(0u, uint4x4.zero.c2.y); + TestUtils.AreEqual(0u, uint4x4.zero.c2.z); + TestUtils.AreEqual(0u, uint4x4.zero.c2.w); + TestUtils.AreEqual(0u, uint4x4.zero.c3.x); + TestUtils.AreEqual(0u, uint4x4.zero.c3.y); + TestUtils.AreEqual(0u, uint4x4.zero.c3.z); + TestUtils.AreEqual(0u, uint4x4.zero.c3.w); + } + + [TestCompiler] + public static void uint4x4_identity() + { + TestUtils.AreEqual(1u, uint4x4.identity.c0.x); + TestUtils.AreEqual(0u, uint4x4.identity.c0.y); + TestUtils.AreEqual(0u, uint4x4.identity.c0.z); + TestUtils.AreEqual(0u, uint4x4.identity.c0.w); + TestUtils.AreEqual(0u, uint4x4.identity.c1.x); + TestUtils.AreEqual(1u, uint4x4.identity.c1.y); + TestUtils.AreEqual(0u, uint4x4.identity.c1.z); + TestUtils.AreEqual(0u, uint4x4.identity.c1.w); + TestUtils.AreEqual(0u, uint4x4.identity.c2.x); + TestUtils.AreEqual(0u, uint4x4.identity.c2.y); + TestUtils.AreEqual(1u, uint4x4.identity.c2.z); + TestUtils.AreEqual(0u, uint4x4.identity.c2.w); + TestUtils.AreEqual(0u, uint4x4.identity.c3.x); + TestUtils.AreEqual(0u, uint4x4.identity.c3.y); + TestUtils.AreEqual(0u, uint4x4.identity.c3.z); + TestUtils.AreEqual(1u, uint4x4.identity.c3.w); + } + + [TestCompiler] + public static void uint4x4_operator_equal_wide_wide() + { + uint4x4 a0 = uint4x4(2105871082, 35218899, 1550755093, 764676020, 606743782, 1208156098, 1023640014, 1038468316, 1416064367, 727143393, 2061243891, 184669837, 1303661760, 2044073738, 370395888, 1822916805); + uint4x4 b0 = uint4x4(1477587886, 579629692, 540974792, 208405066, 2063397938, 1060167409, 362592601, 2097545362, 277670088, 426944490, 901076223, 857900673, 1548779757, 325265488, 312658571, 176373760); + bool4x4 r0 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + uint4x4 a1 = uint4x4(1076983135, 345215866, 833676277, 1987782708, 1481088614, 1364754268, 93639636, 1850596922, 2073471507, 1745989448, 28118669, 1267554232, 1292918049, 1423451579, 644384701, 1985492825); + uint4x4 b1 = uint4x4(2052378097, 858156597, 982817797, 1252095508, 882634538, 1959142806, 72495800, 1077678183, 1729269763, 1607675346, 1813461519, 1204794859, 1324801873, 1975336, 439410532, 294085211); + bool4x4 r1 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + uint4x4 a2 = uint4x4(240481133, 2130667921, 17376735, 1263869085, 437371027, 1093339523, 1683805602, 764261037, 1845666482, 399277628, 714152770, 148255091, 784823865, 1712722195, 1706849865, 607710807); + uint4x4 b2 = uint4x4(1031782338, 1118745564, 180311719, 433246570, 1622531532, 1178609353, 373010678, 1231165960, 966395555, 788609772, 215241459, 1411005263, 1287904654, 1656358051, 1985807372, 1041678082); + bool4x4 r2 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + uint4x4 a3 = uint4x4(1044625360, 1718661673, 89311526, 1060301448, 465400678, 1170304319, 720121996, 1668472904, 560540836, 303792501, 40132904, 1727416088, 883527247, 333921699, 615073171, 873880352); + uint4x4 b3 = uint4x4(1070669057, 1209340945, 731851358, 1893159788, 1312742878, 553070784, 88944879, 919907371, 192285619, 1825472793, 1196883053, 25239674, 719662658, 876955728, 1754994681, 599047302); + bool4x4 r3 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void uint4x4_operator_equal_wide_scalar() + { + uint4x4 a0 = uint4x4(437822262, 2020661134, 541786900, 853113810, 23716499, 179951405, 1409026299, 948838849, 953202998, 691955848, 1926262965, 1851546137, 712957637, 2028784869, 1049962241, 1836975611); + uint b0 = (1332833578); + bool4x4 r0 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + uint4x4 a1 = uint4x4(1016802970, 464814777, 1451642042, 289137869, 152339338, 808355440, 660053867, 597354173, 67320270, 151461188, 35153827, 602895443, 186996278, 129611815, 1031574999, 1697392883); + uint b1 = (390120467); + bool4x4 r1 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + uint4x4 a2 = uint4x4(1463742000, 611116281, 594150729, 375387566, 1984352551, 1925707182, 570698441, 1872629381, 1263218472, 315982238, 122473806, 1404530826, 43943273, 1695786992, 2085125114, 432271298); + uint b2 = (857785521); + bool4x4 r2 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + uint4x4 a3 = uint4x4(465353570, 841947061, 2115740248, 148684393, 1180494240, 1212305694, 2029216680, 255759637, 2103879876, 28490217, 1373872472, 345943406, 766206720, 562344033, 894687966, 154153254); + uint b3 = (1315431335); + bool4x4 r3 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void uint4x4_operator_equal_scalar_wide() + { + uint a0 = (542329200); + uint4x4 b0 = uint4x4(1115584594, 684107773, 1928988941, 890709324, 641152437, 1410341302, 497505660, 1068223109, 2014009435, 213835595, 1592428361, 1819361470, 448650623, 1942175642, 64377057, 1485938610); + bool4x4 r0 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 == b0); + + uint a1 = (1146305380); + uint4x4 b1 = uint4x4(1312317120, 263290348, 812663708, 1585209188, 40646617, 1378718922, 1957797737, 873652576, 1780082094, 1513270921, 2095980581, 1413074719, 1387984261, 1547119354, 924385171, 1253636050); + bool4x4 r1 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 == b1); + + uint a2 = (1477542688); + uint4x4 b2 = uint4x4(969120167, 591812191, 856880926, 1114040166, 2107388425, 1368188588, 512677295, 1337925727, 2076181515, 1317314747, 299981273, 601822512, 1079453890, 125277108, 1257151509, 1915342590); + bool4x4 r2 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r2, a2 == b2); + + uint a3 = (1034639325); + uint4x4 b3 = uint4x4(456730344, 1005099225, 1071115483, 1104603659, 1074937977, 1452872498, 2118674851, 17056748, 1008553990, 2044554028, 549008726, 1802632037, 626025174, 814199888, 668043190, 565725420); + bool4x4 r3 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 == b3); + } + + [TestCompiler] + public static void uint4x4_operator_not_equal_wide_wide() + { + uint4x4 a0 = uint4x4(1977284100, 1293292704, 1547283851, 422428953, 195833190, 1711544892, 5606053, 737069074, 647386678, 13079405, 1413841590, 1076166545, 1211445174, 1289303469, 1436402489, 1129570126); + uint4x4 b0 = uint4x4(1514195556, 957972049, 507667364, 581861672, 1128094576, 940096636, 57559040, 181752616, 962017320, 1762015406, 1107218953, 2042026522, 836002288, 570272309, 2112081980, 1500634658); + bool4x4 r0 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + uint4x4 a1 = uint4x4(1566836685, 1343313905, 329259205, 1774944480, 33906739, 2055853627, 2035015372, 1702756001, 1164186087, 329853698, 769052491, 1893312730, 438029011, 1894010522, 1365847542, 1292942830); + uint4x4 b1 = uint4x4(1787808345, 566425667, 2037529609, 1520589840, 266793699, 538816359, 2075474643, 553571317, 218264354, 654754196, 1392180230, 870065147, 1398749829, 711281563, 1999640291, 231234857); + bool4x4 r1 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + uint4x4 a2 = uint4x4(2146008097, 1520743598, 861728782, 1999977058, 1334556487, 1728108667, 1198848973, 7011150, 1280729934, 1553569869, 1782228282, 731582167, 2041979262, 128396656, 143519087, 154742298); + uint4x4 b2 = uint4x4(210910234, 365281355, 170643407, 757340716, 639973212, 1147047891, 537350186, 1283454178, 735732152, 1218138135, 474815930, 174656455, 473248758, 1077993023, 1063662917, 181750095); + bool4x4 r2 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + uint4x4 a3 = uint4x4(1121334516, 540291909, 554731045, 1839326182, 365770943, 1467681356, 1811555210, 1818699821, 1391738679, 1578035276, 446070422, 596490222, 1626811714, 470785740, 42246751, 613821629); + uint4x4 b3 = uint4x4(1824618770, 1824105138, 1337474646, 993542680, 1719996629, 129079279, 746264839, 2048162472, 610556344, 630115390, 74804695, 1671192167, 1346087143, 388480024, 921984035, 270893570); + bool4x4 r3 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void uint4x4_operator_not_equal_wide_scalar() + { + uint4x4 a0 = uint4x4(1038269360, 1427812625, 103361237, 1347017023, 1523584313, 150442802, 660334527, 719113717, 262959423, 484398043, 506946952, 226568494, 507918242, 1702162286, 923269270, 166187260); + uint b0 = (768873026); + bool4x4 r0 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + uint4x4 a1 = uint4x4(114581840, 1648095254, 1461803977, 61801615, 1317840133, 2146927809, 1557151164, 1284033253, 1345705546, 1747302566, 611028295, 1368046109, 1848036266, 2025452920, 373992983, 289537519); + uint b1 = (1045389187); + bool4x4 r1 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + uint4x4 a2 = uint4x4(1388743060, 1854553487, 872755032, 2113020512, 1062447442, 632285066, 109864030, 1583997921, 1732461790, 1276630817, 721080697, 922945173, 1528002730, 282331576, 1372281893, 167200566); + uint b2 = (146455100); + bool4x4 r2 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + uint4x4 a3 = uint4x4(1271483982, 1782181919, 659215598, 976467745, 1598516540, 1428368463, 693693720, 62983770, 177878767, 550623883, 49306232, 1498551255, 562406804, 606428770, 132953969, 2084514622); + uint b3 = (1769269391); + bool4x4 r3 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void uint4x4_operator_not_equal_scalar_wide() + { + uint a0 = (1652127596); + uint4x4 b0 = uint4x4(953791238, 271722683, 1278885987, 735128017, 112416504, 25967222, 1761444475, 1844594536, 1199122922, 634219279, 942501101, 67161343, 969944293, 833229499, 1304301133, 704045745); + bool4x4 r0 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 != b0); + + uint a1 = (345012334); + uint4x4 b1 = uint4x4(1253134152, 325772538, 855127202, 793668881, 1584481616, 1101301152, 276853534, 987168816, 1258105989, 362645228, 293978043, 1772395973, 1692007315, 681268929, 1535518457, 595209334); + bool4x4 r1 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 != b1); + + uint a2 = (25745185); + uint4x4 b2 = uint4x4(1278016813, 2125682481, 2037751005, 1405297618, 1825546885, 1584424742, 1779859088, 1262387250, 936213998, 739749071, 1934808433, 1333711144, 571211509, 445791940, 43428024, 1509344718); + bool4x4 r2 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 != b2); + + uint a3 = (1643255886); + uint4x4 b3 = uint4x4(383699707, 2040544421, 408607994, 858458715, 1516793269, 1317905178, 1002032453, 1895442848, 1001794162, 1810805641, 1467466432, 72198563, 1654599254, 2100433997, 1554466291, 1619435656); + bool4x4 r3 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 != b3); + } + + [TestCompiler] + public static void uint4x4_operator_less_wide_wide() + { + uint4x4 a0 = uint4x4(1486550609, 1779244308, 1602148045, 1614085440, 1975613414, 942838342, 1092279031, 373677431, 1419098312, 337757077, 1081797900, 1336745069, 840685445, 1220554047, 2013681746, 192965012); + uint4x4 b0 = uint4x4(97842578, 536551311, 413528975, 1838293684, 1283898480, 1456599961, 1080278602, 529676676, 156584048, 117348799, 246927124, 1916615924, 1731071394, 1328098431, 1014995792, 480319327); + bool4x4 r0 = bool4x4(false, false, false, true, false, true, false, true, false, false, false, true, true, true, false, true); + TestUtils.AreEqual(r0, a0 < b0); + + uint4x4 a1 = uint4x4(532043965, 1000693402, 927236048, 1215860000, 780607596, 1882056852, 1354146545, 2135295778, 1145973790, 1938006975, 895882838, 2006524299, 908581156, 1843349513, 1340458575, 1972095585); + uint4x4 b1 = uint4x4(1765937053, 1333997067, 688515308, 1856106947, 1303906227, 646821776, 1169473993, 316770064, 1518155802, 416732703, 529193056, 1239623485, 2010112031, 2018560298, 285987009, 960617622); + bool4x4 r1 = bool4x4(true, true, false, true, true, false, false, false, true, false, false, false, true, true, false, false); + TestUtils.AreEqual(r1, a1 < b1); + + uint4x4 a2 = uint4x4(1090933468, 924555996, 79585200, 1749924275, 1088207695, 1484224850, 512353919, 562469379, 1743259263, 182124641, 1224472464, 1731920136, 1906896401, 425415911, 992649442, 515648372); + uint4x4 b2 = uint4x4(462519015, 1473825625, 1187164011, 730583004, 629133777, 1925375320, 689923293, 1818695099, 903783983, 495525944, 1923715956, 2850909, 1908553564, 1064607664, 1344783349, 494620587); + bool4x4 r2 = bool4x4(false, true, true, false, false, true, true, true, false, true, true, false, true, true, true, false); + TestUtils.AreEqual(r2, a2 < b2); + + uint4x4 a3 = uint4x4(1479294289, 1703371955, 244917997, 237184864, 1915715174, 1476008655, 1192451853, 727269566, 1447642652, 275301035, 103862368, 1883628805, 878082526, 1714412871, 761748100, 1885417209); + uint4x4 b3 = uint4x4(921439230, 891627530, 661470153, 2106293426, 1207423971, 266749061, 81148979, 218657863, 24654414, 436674592, 1476569641, 1314701159, 921705087, 318515283, 685316611, 1890907993); + bool4x4 r3 = bool4x4(false, false, true, true, false, false, false, false, false, true, true, false, true, false, false, true); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void uint4x4_operator_less_wide_scalar() + { + uint4x4 a0 = uint4x4(796797557, 670113454, 933579492, 278884514, 318174822, 1117630673, 741886928, 1990922600, 1030849597, 1546212312, 1718582899, 1648393417, 1857132231, 1909506562, 1294006045, 952084157); + uint b0 = (746564682); + bool4x4 r0 = bool4x4(false, true, false, true, true, false, true, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 < b0); + + uint4x4 a1 = uint4x4(1303736668, 979430272, 1368236640, 24980695, 1434668705, 659552739, 1058492383, 165694933, 1204097259, 922212691, 281328069, 24629507, 1386458568, 1325149699, 1498707004, 1650355158); + uint b1 = (845460171); + bool4x4 r1 = bool4x4(false, false, false, true, false, true, false, true, false, false, true, true, false, false, false, false); + TestUtils.AreEqual(r1, a1 < b1); + + uint4x4 a2 = uint4x4(1213017950, 759932777, 1542997846, 1227393490, 1520634374, 1750827258, 1951142425, 1956860037, 681224518, 1889763470, 1915403219, 850845857, 1871934613, 1882514458, 1326783898, 1044736383); + uint b2 = (1650457461); + bool4x4 r2 = bool4x4(true, true, true, true, true, false, false, false, true, false, false, true, false, false, true, true); + TestUtils.AreEqual(r2, a2 < b2); + + uint4x4 a3 = uint4x4(24899250, 1979593332, 1345719300, 771816862, 1459379624, 10560715, 2022570756, 113189581, 1261561210, 195417982, 460558859, 1966293093, 1791874676, 221062613, 219875895, 2145521906); + uint b3 = (2096162636); + bool4x4 r3 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void uint4x4_operator_less_scalar_wide() + { + uint a0 = (186400299); + uint4x4 b0 = uint4x4(1881344229, 813834467, 1254886626, 1353590345, 1412343685, 1555571443, 1540508298, 1735458634, 135888070, 1643818742, 248291654, 1739560105, 728539891, 480507742, 1696553040, 540223931); + bool4x4 r0 = bool4x4(true, true, true, true, true, true, true, true, false, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 < b0); + + uint a1 = (1840493353); + uint4x4 b1 = uint4x4(146833656, 798115946, 2002002066, 1011261705, 783550942, 1093071215, 598253401, 1432416562, 1863582169, 103622950, 775175960, 116908309, 1213433625, 1428954824, 1760442490, 1208143947); + bool4x4 r1 = bool4x4(false, false, true, false, false, false, false, false, true, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 < b1); + + uint a2 = (751820805); + uint4x4 b2 = uint4x4(1491872302, 560004484, 2065157473, 310839658, 697329242, 898786601, 1448893980, 1204091943, 1933043135, 828031833, 1737703663, 1672512847, 1112905025, 1666248737, 1352503217, 406395888); + bool4x4 r2 = bool4x4(true, false, true, false, false, true, true, true, true, true, true, true, true, true, true, false); + TestUtils.AreEqual(r2, a2 < b2); + + uint a3 = (1734008932); + uint4x4 b3 = uint4x4(1237327481, 1318771944, 791935677, 1322622241, 1097793287, 1868246899, 656633225, 2068657430, 1696245163, 1451948493, 765332338, 1618550325, 1069938092, 214863918, 635332811, 531416158); + bool4x4 r3 = bool4x4(false, false, false, false, false, true, false, true, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 < b3); + } + + [TestCompiler] + public static void uint4x4_operator_greater_wide_wide() + { + uint4x4 a0 = uint4x4(2087717754, 1725569452, 1298066182, 1693943616, 1319019629, 70674491, 1042499725, 1002821508, 1021857133, 1744374599, 821751047, 467646903, 2029731638, 1377214212, 1207816926, 474621063); + uint4x4 b0 = uint4x4(85148514, 293632137, 1151128249, 409440398, 1115020183, 1508500597, 1834583302, 1755218534, 1788761753, 1128238489, 834223713, 1578743290, 1647150256, 1756397855, 1131080201, 1208965204); + bool4x4 r0 = bool4x4(true, true, true, true, true, false, false, false, false, true, false, false, true, false, true, false); + TestUtils.AreEqual(r0, a0 > b0); + + uint4x4 a1 = uint4x4(20781266, 366593779, 2068457387, 10181449, 793634464, 144474612, 99947390, 930377263, 683686232, 742803073, 918292048, 875621429, 1764985258, 411384146, 1921397684, 1349107119); + uint4x4 b1 = uint4x4(1495161099, 1283714281, 908051907, 412849651, 815822687, 730271942, 40756039, 883326140, 476260632, 1024136446, 1440596667, 1253494041, 146826162, 1798399573, 2085029408, 187939428); + bool4x4 r1 = bool4x4(false, false, true, false, false, false, true, true, true, false, false, false, true, false, false, true); + TestUtils.AreEqual(r1, a1 > b1); + + uint4x4 a2 = uint4x4(640399120, 1487719331, 1467989523, 1834244794, 1778580304, 334604025, 689749101, 1478795900, 716772993, 1072711623, 388277128, 290673156, 619539670, 1666212670, 496667761, 638935614); + uint4x4 b2 = uint4x4(1009192934, 1694822273, 1866590874, 113805226, 1331524948, 5928360, 1884858608, 1988975599, 493888072, 731556294, 1597968264, 727668246, 1260583385, 1921631225, 359265523, 856088703); + bool4x4 r2 = bool4x4(false, false, false, true, true, true, false, false, true, true, false, false, false, false, true, false); + TestUtils.AreEqual(r2, a2 > b2); + + uint4x4 a3 = uint4x4(1614199215, 89872822, 700520355, 1562820264, 789499485, 1393039789, 1105992642, 563744940, 815513909, 1081626580, 1012317785, 1947145947, 718519778, 1075282603, 200378204, 1764621112); + uint4x4 b3 = uint4x4(2104018831, 1238238103, 1383038637, 964579005, 628997847, 1734250747, 869693069, 2027610297, 569892194, 1427509612, 617550825, 1189914503, 760051085, 207406138, 2060097216, 1419314781); + bool4x4 r3 = bool4x4(false, false, false, true, true, false, true, false, true, false, true, true, false, true, false, true); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void uint4x4_operator_greater_wide_scalar() + { + uint4x4 a0 = uint4x4(1208626274, 239697208, 1979453345, 1253474001, 1590192876, 1487911635, 1673945595, 1662650098, 222749855, 1433540517, 566635217, 1773305960, 1850273578, 206147145, 325913453, 333381537); + uint b0 = (1715176566); + bool4x4 r0 = bool4x4(false, false, true, false, false, false, false, false, false, false, false, true, true, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + uint4x4 a1 = uint4x4(1905567362, 570397194, 2128431130, 1735325311, 529971908, 1663525234, 1972984241, 1587865063, 488268523, 121921923, 812076921, 181082921, 1281638484, 1818357732, 116518997, 1397728785); + uint b1 = (2053577491); + bool4x4 r1 = bool4x4(false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 > b1); + + uint4x4 a2 = uint4x4(1924199337, 1463993051, 1598027926, 842851852, 160842093, 1226313895, 540338405, 174088887, 1609299242, 425486336, 1462766889, 651513452, 1122649822, 771802057, 839323192, 325778683); + uint b2 = (742950077); + bool4x4 r2 = bool4x4(true, true, true, true, false, true, false, false, true, false, true, false, true, true, true, false); + TestUtils.AreEqual(r2, a2 > b2); + + uint4x4 a3 = uint4x4(406189885, 2101738734, 432896271, 1620784610, 1185204658, 723655621, 6469104, 1813092585, 1101924353, 1365989712, 861868674, 1481567177, 1088595018, 1762666432, 450116220, 375577175); + uint b3 = (1676059941); + bool4x4 r3 = bool4x4(false, true, false, false, false, false, false, true, false, false, false, false, false, true, false, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void uint4x4_operator_greater_scalar_wide() + { + uint a0 = (480938827); + uint4x4 b0 = uint4x4(1824731899, 921496110, 586859044, 946430596, 1231356727, 1390167458, 1785807092, 28949024, 2037899283, 595656760, 1778095771, 1233500439, 1696302238, 1445965340, 484020151, 1586962841); + bool4x4 r0 = bool4x4(false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r0, a0 > b0); + + uint a1 = (1361740714); + uint4x4 b1 = uint4x4(265628948, 2003122957, 332267433, 1128353075, 377919478, 982113135, 1117675960, 630865591, 1550679736, 895945757, 287025687, 643452096, 660504007, 613135893, 633307118, 514276792); + bool4x4 r1 = bool4x4(true, false, true, true, true, true, true, true, false, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 > b1); + + uint a2 = (1377364317); + uint4x4 b2 = uint4x4(84491736, 746768197, 1282879723, 589415384, 363082240, 1774333756, 741005890, 413100725, 702141547, 1434366582, 1489794027, 1710601432, 1914069735, 1811684885, 1007116016, 1883396218); + bool4x4 r2 = bool4x4(true, true, true, true, true, false, true, true, true, false, false, false, false, false, true, false); + TestUtils.AreEqual(r2, a2 > b2); + + uint a3 = (318035497); + uint4x4 b3 = uint4x4(25535571, 1971931803, 1966772446, 1500069399, 1446812421, 2086866622, 1616666731, 315565005, 1828160638, 494221701, 1498781405, 1532980575, 1377395276, 2130004514, 1144788653, 719223647); + bool4x4 r3 = bool4x4(true, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 > b3); + } + + [TestCompiler] + public static void uint4x4_operator_less_equal_wide_wide() + { + uint4x4 a0 = uint4x4(154092149, 1515170149, 1083970332, 785807178, 1401094881, 310537627, 868328962, 1990816725, 2035349541, 457043352, 1123282035, 1001842946, 1387761992, 195272789, 659549000, 888761458); + uint4x4 b0 = uint4x4(77984380, 1712054191, 1566203809, 254834519, 450519938, 389457083, 1298669505, 207343167, 1214449047, 2059561026, 896534357, 1897470050, 521075677, 1848221945, 374708019, 1573731118); + bool4x4 r0 = bool4x4(false, true, true, false, false, true, true, false, false, true, false, true, false, true, false, true); + TestUtils.AreEqual(r0, a0 <= b0); + + uint4x4 a1 = uint4x4(283706617, 1790185840, 899029812, 848317418, 1743712447, 1504407474, 1798441490, 1902791952, 606340844, 1994437705, 301831413, 654230470, 1223625081, 324292199, 1370931020, 1742769166); + uint4x4 b1 = uint4x4(2093466449, 1660210829, 1568778785, 1352157589, 1212771905, 1457525058, 1493446008, 1784768208, 1993422493, 1378671664, 1447376929, 1405041439, 1765183746, 562894655, 1085068880, 1026386862); + bool4x4 r1 = bool4x4(true, false, true, true, false, false, false, false, true, false, true, true, true, true, false, false); + TestUtils.AreEqual(r1, a1 <= b1); + + uint4x4 a2 = uint4x4(1709242127, 105750466, 1655967312, 1455797002, 366131629, 315848579, 1539610530, 99028560, 765767372, 1241881101, 527753961, 1271899705, 1439235979, 436585748, 1244486586, 2128710216); + uint4x4 b2 = uint4x4(884290156, 922346160, 330605896, 466570756, 1252369410, 2057993777, 1691801535, 2041799631, 557988228, 813610154, 1657573441, 983813335, 385144401, 1281329713, 285422763, 658643567); + bool4x4 r2 = bool4x4(false, true, false, false, true, true, true, true, false, false, true, false, false, true, false, false); + TestUtils.AreEqual(r2, a2 <= b2); + + uint4x4 a3 = uint4x4(1617486386, 1895766578, 1387695542, 128800896, 537625491, 1012540035, 1131528350, 2012914556, 1666155186, 1944610930, 1990671426, 498632901, 1759874098, 1630593828, 2041503795, 1369567817); + uint4x4 b3 = uint4x4(478020612, 914151334, 980445792, 275734948, 1527866949, 1196945650, 743720340, 1679307193, 429976215, 812942792, 929159012, 51668686, 1269420778, 1270822911, 174467289, 80708866); + bool4x4 r3 = bool4x4(false, false, false, true, true, true, false, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void uint4x4_operator_less_equal_wide_scalar() + { + uint4x4 a0 = uint4x4(1479531977, 1427983411, 415250630, 1245345407, 1112546666, 1072990632, 1579912858, 101048307, 1070894375, 509818792, 1910488590, 85452501, 518127023, 1246249980, 1097326500, 1964410699); + uint b0 = (2004563877); + bool4x4 r0 = bool4x4(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 <= b0); + + uint4x4 a1 = uint4x4(1968139888, 662096238, 1140643434, 754434551, 155343473, 995927387, 974873240, 1773400038, 497436329, 1825940497, 527516420, 1477043363, 1378470734, 96190147, 37188105, 839762283); + uint b1 = (1191853379); + bool4x4 r1 = bool4x4(false, true, true, true, true, true, true, false, true, false, true, false, false, true, true, true); + TestUtils.AreEqual(r1, a1 <= b1); + + uint4x4 a2 = uint4x4(781102710, 1145011483, 139031840, 127837780, 817806943, 1248492707, 649140851, 913173654, 1530989756, 856611228, 479496140, 287809619, 626008542, 2075114788, 269756518, 1123999963); + uint b2 = (766321672); + bool4x4 r2 = bool4x4(false, false, true, true, false, false, true, false, false, false, true, true, true, false, true, false); + TestUtils.AreEqual(r2, a2 <= b2); + + uint4x4 a3 = uint4x4(1061241170, 1419753922, 827050063, 725097426, 1849220404, 432056024, 1587861037, 1619429016, 615110337, 1394533782, 1052396438, 771488591, 1839907288, 413628645, 1873300485, 1393173865); + uint b3 = (478230935); + bool4x4 r3 = bool4x4(false, false, false, false, false, true, false, false, false, false, false, false, false, true, false, false); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void uint4x4_operator_less_equal_scalar_wide() + { + uint a0 = (1899193992); + uint4x4 b0 = uint4x4(915011820, 980913757, 1337699683, 1476321359, 1102143668, 660493983, 184664508, 381579707, 1954892821, 1295090571, 1440368586, 1696003686, 88708652, 1332251857, 1310713644, 2112132784); + bool4x4 r0 = bool4x4(false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, true); + TestUtils.AreEqual(r0, a0 <= b0); + + uint a1 = (48951945); + uint4x4 b1 = uint4x4(1888568027, 39340955, 1108242207, 260777425, 593122164, 291471959, 253457314, 1264570386, 699618012, 927735863, 2063158939, 932253787, 1168754049, 749328788, 1882694892, 168499987); + bool4x4 r1 = bool4x4(true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true); + TestUtils.AreEqual(r1, a1 <= b1); + + uint a2 = (378173027); + uint4x4 b2 = uint4x4(339963627, 832906712, 559482768, 53067420, 1895722478, 809981860, 591790551, 1680760399, 653274934, 1664284538, 1283249545, 767500110, 1334099884, 1271622829, 1270706578, 56782179); + bool4x4 r2 = bool4x4(false, true, true, false, true, true, true, true, true, true, true, true, true, true, true, false); + TestUtils.AreEqual(r2, a2 <= b2); + + uint a3 = (505839576); + uint4x4 b3 = uint4x4(416548761, 1604253810, 438515054, 1638416567, 321889656, 689441798, 1084242369, 211750973, 402525656, 1880241767, 268989216, 1596809567, 786138772, 545761783, 1705157341, 1527503699); + bool4x4 r3 = bool4x4(false, true, false, true, false, true, true, false, false, true, false, true, true, true, true, true); + TestUtils.AreEqual(r3, a3 <= b3); + } + + [TestCompiler] + public static void uint4x4_operator_greater_equal_wide_wide() + { + uint4x4 a0 = uint4x4(8538378, 2131749726, 265427108, 523609761, 994991818, 839709564, 101288202, 1886280970, 2032074826, 631221455, 1456286159, 961342752, 424526026, 788481984, 1662488497, 870326690); + uint4x4 b0 = uint4x4(903145828, 1697992986, 1432491982, 169789504, 1059357300, 1744255222, 1606584463, 1905414425, 1448794969, 136181998, 1678754836, 2069656857, 398982689, 243317404, 740939613, 1894753119); + bool4x4 r0 = bool4x4(false, true, false, true, false, false, false, false, true, true, false, false, true, true, true, false); + TestUtils.AreEqual(r0, a0 >= b0); + + uint4x4 a1 = uint4x4(708712581, 1260182701, 1165630721, 138247561, 1108650168, 1933222913, 672493999, 1541402159, 1921596027, 1557351956, 147242547, 892772168, 2089286723, 1273466960, 644009998, 654784654); + uint4x4 b1 = uint4x4(301760792, 1260647988, 3608523, 52576030, 903420465, 1648820371, 627296845, 1679808907, 1719102039, 1718081638, 655586949, 477267189, 62092869, 2013928066, 280292357, 254052205); + bool4x4 r1 = bool4x4(true, false, true, true, true, true, true, false, true, false, false, true, true, false, true, true); + TestUtils.AreEqual(r1, a1 >= b1); + + uint4x4 a2 = uint4x4(189030610, 1035542641, 346401762, 739783704, 1310547408, 1175015477, 1893015570, 1397162858, 1005064177, 469205024, 1331071304, 1747510572, 1556472271, 1318844912, 877625210, 1556049679); + uint4x4 b2 = uint4x4(1092440092, 1947011057, 625632982, 2028466303, 578645425, 552865694, 1460006028, 1944712828, 1256156724, 2090870105, 1299728699, 53125632, 782915512, 1103537852, 271803142, 828357811); + bool4x4 r2 = bool4x4(false, false, false, false, true, true, true, false, false, false, true, true, true, true, true, true); + TestUtils.AreEqual(r2, a2 >= b2); + + uint4x4 a3 = uint4x4(248635811, 1459789761, 1739237851, 1333407145, 979318335, 407534230, 1628055119, 731735266, 812413658, 1008863889, 1958570980, 1070464548, 1492413167, 390538786, 1454271717, 1150841093); + uint4x4 b3 = uint4x4(1679170708, 1727537554, 1741874749, 1295963045, 1676369300, 1716080769, 339906474, 629280695, 1476237779, 1535336921, 711398196, 1036785558, 982417009, 1710969897, 1783729499, 1038744266); + bool4x4 r3 = bool4x4(false, false, false, true, false, false, true, true, false, false, true, true, true, false, false, true); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void uint4x4_operator_greater_equal_wide_scalar() + { + uint4x4 a0 = uint4x4(2049236663, 182691143, 634973382, 1197012109, 439837565, 1367606469, 1108037359, 351147187, 1898505669, 411667685, 1998610091, 4652390, 996159180, 2111455181, 727766399, 96217144); + uint b0 = (1061998015); + bool4x4 r0 = bool4x4(true, false, false, true, false, true, true, false, true, false, true, false, false, true, false, false); + TestUtils.AreEqual(r0, a0 >= b0); + + uint4x4 a1 = uint4x4(814085575, 1293933760, 1732973229, 1473283041, 899444524, 1023753195, 1373738074, 518164359, 717850464, 1765188600, 1826820341, 527594558, 1816542874, 839185150, 1143596061, 1819554651); + uint b1 = (1525995206); + bool4x4 r1 = bool4x4(false, false, true, false, false, false, false, false, false, true, true, false, true, false, false, true); + TestUtils.AreEqual(r1, a1 >= b1); + + uint4x4 a2 = uint4x4(160724539, 878086499, 363122662, 1989978759, 2145562949, 491416140, 122055824, 1432184946, 690328424, 638547285, 403700518, 569358695, 1988815901, 933324785, 1709851817, 1451640349); + uint b2 = (993212636); + bool4x4 r2 = bool4x4(false, false, false, true, true, false, false, true, false, false, false, false, true, false, true, true); + TestUtils.AreEqual(r2, a2 >= b2); + + uint4x4 a3 = uint4x4(1782506169, 1298885111, 22631046, 575953622, 162553491, 1306421595, 1408718955, 678847750, 1869470748, 1749901516, 1428700665, 1971036276, 81962795, 1719966182, 855014030, 332581386); + uint b3 = (896666795); + bool4x4 r3 = bool4x4(true, true, false, false, false, true, true, false, true, true, true, true, false, true, false, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void uint4x4_operator_greater_equal_scalar_wide() + { + uint a0 = (1859811087); + uint4x4 b0 = uint4x4(1070365918, 1783869452, 830091760, 377157428, 327199016, 90384229, 1154649706, 376758501, 1079802834, 2054742898, 1328349472, 434061447, 951207723, 598695892, 975131651, 1714007943); + bool4x4 r0 = bool4x4(true, true, true, true, true, true, true, true, true, false, true, true, true, true, true, true); + TestUtils.AreEqual(r0, a0 >= b0); + + uint a1 = (177416473); + uint4x4 b1 = uint4x4(1267232721, 31082860, 216791741, 119054289, 1905107583, 89559116, 55041824, 691334141, 462326883, 1658303669, 914628512, 1134364322, 1677134711, 1955614770, 2067009301, 1454405405); + bool4x4 r1 = bool4x4(false, true, false, true, false, true, true, false, false, false, false, false, false, false, false, false); + TestUtils.AreEqual(r1, a1 >= b1); + + uint a2 = (299467282); + uint4x4 b2 = uint4x4(1584922149, 561776357, 564147844, 398216936, 1478439642, 958973988, 725612832, 1586062302, 1992817431, 732550238, 1151725147, 11183347, 643483664, 1846311608, 999376922, 1029876878); + bool4x4 r2 = bool4x4(false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false); + TestUtils.AreEqual(r2, a2 >= b2); + + uint a3 = (1092702918); + uint4x4 b3 = uint4x4(281884284, 1033936590, 1197933362, 1740756798, 1312741982, 1694310336, 775049936, 1833306934, 2012355780, 579564207, 240021194, 1389877826, 1550151770, 99128128, 1408823818, 1127139689); + bool4x4 r3 = bool4x4(true, true, false, false, false, false, true, false, false, true, true, false, false, true, false, false); + TestUtils.AreEqual(r3, a3 >= b3); + } + + [TestCompiler] + public static void uint4x4_operator_add_wide_wide() + { + uint4x4 a0 = uint4x4(2135171378, 21433296, 1954723494, 683604307, 1054212315, 1762680995, 1963655852, 1257853062, 2043493600, 976898058, 1915056423, 121374462, 1218855698, 700538222, 1702057277, 1788251699); + uint4x4 b0 = uint4x4(1013431952, 366718162, 359290756, 1393163294, 1962236872, 1263270041, 1862666629, 1077447887, 821693806, 487316539, 350922520, 1583012528, 1951595076, 1024851344, 874302782, 1383969588); + uint4x4 r0 = uint4x4(3148603330, 388151458, 2314014250, 2076767601, 3016449187, 3025951036, 3826322481, 2335300949, 2865187406, 1464214597, 2265978943, 1704386990, 3170450774, 1725389566, 2576360059, 3172221287); + TestUtils.AreEqual(r0, a0 + b0); + + uint4x4 a1 = uint4x4(1534939160, 398651016, 1674272498, 374510467, 824322986, 1217622199, 1122376670, 642613771, 1097903998, 359042741, 929182687, 1713065399, 892057490, 1295346111, 1806236181, 1838589664); + uint4x4 b1 = uint4x4(1767968088, 900721406, 1659790033, 1792273749, 443844328, 633981449, 2010244807, 335566991, 521931102, 544297835, 1681549647, 1784248858, 585904415, 3128418, 1806236610, 179909533); + uint4x4 r1 = uint4x4(3302907248, 1299372422, 3334062531, 2166784216, 1268167314, 1851603648, 3132621477, 978180762, 1619835100, 903340576, 2610732334, 3497314257, 1477961905, 1298474529, 3612472791, 2018499197); + TestUtils.AreEqual(r1, a1 + b1); + + uint4x4 a2 = uint4x4(173985173, 1875814528, 1464015613, 1550659036, 447183339, 1810477200, 1280783968, 460635858, 1308981305, 2074430993, 515260041, 454786901, 54902689, 8663916, 364443922, 2133521215); + uint4x4 b2 = uint4x4(378711407, 195687764, 357131656, 383703567, 1332107956, 1471212095, 1634876660, 1356094538, 364971231, 1180126175, 1243953864, 2000873160, 761885805, 1088368083, 371382049, 1165570023); + uint4x4 r2 = uint4x4(552696580, 2071502292, 1821147269, 1934362603, 1779291295, 3281689295, 2915660628, 1816730396, 1673952536, 3254557168, 1759213905, 2455660061, 816788494, 1097031999, 735825971, 3299091238); + TestUtils.AreEqual(r2, a2 + b2); + + uint4x4 a3 = uint4x4(752738311, 459996276, 134430279, 1019035025, 1118755713, 97114496, 2018556094, 503464890, 125268557, 841630760, 1879289264, 1812133139, 2071408153, 140785075, 348467740, 19259645); + uint4x4 b3 = uint4x4(1037712666, 743665263, 446926007, 740772342, 2122822821, 1744558378, 241853304, 1404664477, 2086735220, 1441264950, 658463489, 1077514956, 2022425015, 702129808, 462290953, 75801290); + uint4x4 r3 = uint4x4(1790450977, 1203661539, 581356286, 1759807367, 3241578534, 1841672874, 2260409398, 1908129367, 2212003777, 2282895710, 2537752753, 2889648095, 4093833168, 842914883, 810758693, 95060935); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void uint4x4_operator_add_wide_scalar() + { + uint4x4 a0 = uint4x4(665815972, 1783729250, 1591678394, 1284528538, 977850224, 71069732, 1138577680, 1200356017, 565982008, 1246759684, 1088001167, 57252642, 678921480, 625943813, 512157429, 1470648741); + uint b0 = (1334043849); + uint4x4 r0 = uint4x4(1999859821, 3117773099, 2925722243, 2618572387, 2311894073, 1405113581, 2472621529, 2534399866, 1900025857, 2580803533, 2422045016, 1391296491, 2012965329, 1959987662, 1846201278, 2804692590); + TestUtils.AreEqual(r0, a0 + b0); + + uint4x4 a1 = uint4x4(1490096953, 182608093, 1707296407, 1703724354, 1333833947, 653973063, 1139546735, 1834005844, 184572739, 1980578280, 1858520040, 97099208, 421437295, 1251829854, 166844260, 1568146789); + uint b1 = (1467033531); + uint4x4 r1 = uint4x4(2957130484, 1649641624, 3174329938, 3170757885, 2800867478, 2121006594, 2606580266, 3301039375, 1651606270, 3447611811, 3325553571, 1564132739, 1888470826, 2718863385, 1633877791, 3035180320); + TestUtils.AreEqual(r1, a1 + b1); + + uint4x4 a2 = uint4x4(82548613, 1464065228, 716600557, 831997894, 861575416, 1614335536, 1590793088, 240051362, 656307111, 1116911778, 1508531454, 1488841996, 651080626, 850104335, 697550029, 1501177275); + uint b2 = (533562157); + uint4x4 r2 = uint4x4(616110770, 1997627385, 1250162714, 1365560051, 1395137573, 2147897693, 2124355245, 773613519, 1189869268, 1650473935, 2042093611, 2022404153, 1184642783, 1383666492, 1231112186, 2034739432); + TestUtils.AreEqual(r2, a2 + b2); + + uint4x4 a3 = uint4x4(308656842, 1236049353, 1462299846, 1109575265, 209902, 1129756187, 452131659, 1598006341, 793277485, 237975099, 1427541287, 1103256809, 144544713, 2142413477, 921156907, 636589500); + uint b3 = (1397806846); + uint4x4 r3 = uint4x4(1706463688, 2633856199, 2860106692, 2507382111, 1398016748, 2527563033, 1849938505, 2995813187, 2191084331, 1635781945, 2825348133, 2501063655, 1542351559, 3540220323, 2318963753, 2034396346); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void uint4x4_operator_add_scalar_wide() + { + uint a0 = (359966320); + uint4x4 b0 = uint4x4(2146146202, 767103309, 851002415, 311531406, 1491262941, 1016891373, 1954228994, 1671335850, 727870747, 551151834, 1390261152, 1699060326, 115021619, 1964440175, 440700758, 1556692550); + uint4x4 r0 = uint4x4(2506112522, 1127069629, 1210968735, 671497726, 1851229261, 1376857693, 2314195314, 2031302170, 1087837067, 911118154, 1750227472, 2059026646, 474987939, 2324406495, 800667078, 1916658870); + TestUtils.AreEqual(r0, a0 + b0); + + uint a1 = (185414255); + uint4x4 b1 = uint4x4(933106731, 1217866784, 729761881, 1742597318, 1090109152, 1467373815, 1066072609, 138237856, 634834665, 993603553, 347587889, 2050191349, 670698672, 1658205080, 1874808705, 2082982954); + uint4x4 r1 = uint4x4(1118520986, 1403281039, 915176136, 1928011573, 1275523407, 1652788070, 1251486864, 323652111, 820248920, 1179017808, 533002144, 2235605604, 856112927, 1843619335, 2060222960, 2268397209); + TestUtils.AreEqual(r1, a1 + b1); + + uint a2 = (869839589); + uint4x4 b2 = uint4x4(118460267, 2126166073, 1826004041, 1976984739, 1612682951, 1509218893, 283188530, 175981795, 290469072, 90401332, 92990995, 1697612984, 10695923, 584353656, 1985077669, 261483046); + uint4x4 r2 = uint4x4(988299856, 2996005662, 2695843630, 2846824328, 2482522540, 2379058482, 1153028119, 1045821384, 1160308661, 960240921, 962830584, 2567452573, 880535512, 1454193245, 2854917258, 1131322635); + TestUtils.AreEqual(r2, a2 + b2); + + uint a3 = (1433592717); + uint4x4 b3 = uint4x4(1587664734, 1494226579, 1815078437, 764852649, 1056037050, 1447213141, 1932413453, 173293550, 856428276, 23287820, 1606641105, 1768628148, 57172075, 1040430401, 1662936094, 1763561019); + uint4x4 r3 = uint4x4(3021257451, 2927819296, 3248671154, 2198445366, 2489629767, 2880805858, 3366006170, 1606886267, 2290020993, 1456880537, 3040233822, 3202220865, 1490764792, 2474023118, 3096528811, 3197153736); + TestUtils.AreEqual(r3, a3 + b3); + } + + [TestCompiler] + public static void uint4x4_operator_sub_wide_wide() + { + uint4x4 a0 = uint4x4(1410318491, 1097280168, 1827039044, 28881338, 328720965, 875487868, 212936325, 231977215, 1740021315, 2011295463, 48079003, 591379285, 1125909359, 1842588095, 848561896, 614448464); + uint4x4 b0 = uint4x4(1315897366, 799052018, 1580289673, 1094686261, 1954325726, 1197734816, 229886366, 915679176, 1746884850, 918743925, 1007797419, 257421324, 287249342, 1617287463, 1653916102, 123586847); + uint4x4 r0 = uint4x4(94421125, 298228150, 246749371, 3229162373, 2669362535, 3972720348, 4278017255, 3611265335, 4288103761, 1092551538, 3335248880, 333957961, 838660017, 225300632, 3489613090, 490861617); + TestUtils.AreEqual(r0, a0 - b0); + + uint4x4 a1 = uint4x4(2067598029, 1618238416, 318516219, 1090119767, 1991095823, 949592162, 1951912339, 1457818751, 1642553126, 2114366549, 1420516260, 596841760, 724518081, 1820626306, 1885185225, 246124365); + uint4x4 b1 = uint4x4(502107404, 672875302, 1256481116, 1975569142, 1794443030, 1327558915, 330955394, 1596041731, 1069074732, 1120817099, 2076417364, 402521072, 839858844, 1539789702, 559077522, 822288510); + uint4x4 r1 = uint4x4(1565490625, 945363114, 3357002399, 3409517921, 196652793, 3917000543, 1620956945, 4156744316, 573478394, 993549450, 3639066192, 194320688, 4179626533, 280836604, 1326107703, 3718803151); + TestUtils.AreEqual(r1, a1 - b1); + + uint4x4 a2 = uint4x4(1339877262, 1277620434, 759131597, 597162957, 656765083, 1075131749, 58205257, 452992632, 976914238, 2122217984, 1687033200, 850554234, 2052749291, 2095840868, 1583338457, 90383917); + uint4x4 b2 = uint4x4(751901021, 1858312568, 1706585560, 483540199, 35726321, 401119620, 1411304017, 794953965, 246546364, 1926970811, 1641115012, 2138664312, 1215717344, 1626141022, 1697813712, 1432018301); + uint4x4 r2 = uint4x4(587976241, 3714275162, 3347513333, 113622758, 621038762, 674012129, 2941868536, 3953005963, 730367874, 195247173, 45918188, 3006857218, 837031947, 469699846, 4180492041, 2953332912); + TestUtils.AreEqual(r2, a2 - b2); + + uint4x4 a3 = uint4x4(1548318665, 2135165300, 1200818607, 836910134, 471911775, 464052016, 1001285615, 344315815, 386866212, 562875464, 584343185, 1282738957, 2048830434, 1953046924, 1758228339, 1047685389); + uint4x4 b3 = uint4x4(127303652, 1200011318, 1746989830, 2083451213, 1630826350, 1384789939, 195722140, 1460697711, 1025672341, 1638638861, 466637201, 1846245897, 1286439769, 1690897900, 1118505582, 1106435018); + uint4x4 r3 = uint4x4(1421015013, 935153982, 3748796073, 3048426217, 3136052721, 3374229373, 805563475, 3178585400, 3656161167, 3219203899, 117705984, 3731460356, 762390665, 262149024, 639722757, 4236217667); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void uint4x4_operator_sub_wide_scalar() + { + uint4x4 a0 = uint4x4(1508669340, 1594795463, 266707545, 643102647, 287705008, 1475644328, 1113286221, 979450511, 2082174113, 1108005498, 304369206, 999244508, 1806482044, 1994553647, 2101812429, 1482736902); + uint b0 = (998008471); + uint4x4 r0 = uint4x4(510660869, 596786992, 3563666370, 3940061472, 3584663833, 477635857, 115277750, 4276409336, 1084165642, 109997027, 3601328031, 1236037, 808473573, 996545176, 1103803958, 484728431); + TestUtils.AreEqual(r0, a0 - b0); + + uint4x4 a1 = uint4x4(266654115, 1190349300, 958542155, 1185075537, 1738124835, 499527536, 1612473406, 1696960099, 1287292743, 1360229454, 1032360376, 1779621585, 964948785, 1739264125, 94254551, 968533883); + uint b1 = (1470212363); + uint4x4 r1 = uint4x4(3091409048, 4015104233, 3783297088, 4009830470, 267912472, 3324282469, 142261043, 226747736, 4112047676, 4184984387, 3857115309, 309409222, 3789703718, 269051762, 2919009484, 3793288816); + TestUtils.AreEqual(r1, a1 - b1); + + uint4x4 a2 = uint4x4(2075770560, 1074604044, 1171596880, 1033389665, 1905912138, 1219683758, 372717946, 658343960, 572101777, 361378660, 1043302867, 1535109165, 695707807, 153321516, 1464557635, 308141270); + uint b2 = (946189008); + uint4x4 r2 = uint4x4(1129581552, 128415036, 225407872, 87200657, 959723130, 273494750, 3721496234, 4007122248, 3920880065, 3710156948, 97113859, 588920157, 4044486095, 3502099804, 518368627, 3656919558); + TestUtils.AreEqual(r2, a2 - b2); + + uint4x4 a3 = uint4x4(69622833, 1194454863, 1717370179, 323593803, 1407367283, 1095267927, 801717786, 1093626195, 1147895912, 115414874, 80925845, 1347312573, 1117225328, 1516225020, 210114655, 30710625); + uint b3 = (668515891); + uint4x4 r3 = uint4x4(3696074238, 525938972, 1048854288, 3950045208, 738851392, 426752036, 133201895, 425110304, 479380021, 3741866279, 3707377250, 678796682, 448709437, 847709129, 3836566060, 3657162030); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void uint4x4_operator_sub_scalar_wide() + { + uint a0 = (893369501); + uint4x4 b0 = uint4x4(2051906184, 1699714311, 442603706, 1735141684, 274533585, 811580259, 1196354320, 1524097023, 533621527, 2080845793, 143958837, 1620668660, 1135989346, 1367044745, 554088609, 552670373); + uint4x4 r0 = uint4x4(3136430613, 3488622486, 450765795, 3453195113, 618835916, 81789242, 3991982477, 3664239774, 359747974, 3107491004, 749410664, 3567668137, 4052347451, 3821292052, 339280892, 340699128); + TestUtils.AreEqual(r0, a0 - b0); + + uint a1 = (1265516124); + uint4x4 b1 = uint4x4(1254902543, 1857695581, 1619865274, 1313559400, 99812999, 843597298, 420111239, 1299949060, 531009038, 1103306550, 104920105, 1137308312, 1207332725, 103438360, 1157123503, 1174401240); + uint4x4 r1 = uint4x4(10613581, 3702787839, 3940618146, 4246924020, 1165703125, 421918826, 845404885, 4260534360, 734507086, 162209574, 1160596019, 128207812, 58183399, 1162077764, 108392621, 91114884); + TestUtils.AreEqual(r1, a1 - b1); + + uint a2 = (701247193); + uint4x4 b2 = uint4x4(1498366995, 467017290, 109208355, 1594646461, 1252691221, 919863765, 2826939, 1969148647, 1576198850, 2075870798, 1610641273, 1783880129, 59074246, 1766624573, 521313783, 1333637752); + uint4x4 r2 = uint4x4(3497847494, 234229903, 592038838, 3401568028, 3743523268, 4076350724, 698420254, 3027065842, 3420015639, 2920343691, 3385573216, 3212334360, 642172947, 3229589916, 179933410, 3662576737); + TestUtils.AreEqual(r2, a2 - b2); + + uint a3 = (509364704); + uint4x4 b3 = uint4x4(516658115, 2089980466, 436174846, 1727293748, 1952093185, 856117013, 22492467, 435192624, 1891008194, 1855757356, 1091434215, 386788711, 1473772449, 1977407433, 1134318981, 446267420); + uint4x4 r3 = uint4x4(4287673885, 2714351534, 73189858, 3077038252, 2852238815, 3948214987, 486872237, 74172080, 2913323806, 2948574644, 3712897785, 122575993, 3330559551, 2826924567, 3670013019, 63097284); + TestUtils.AreEqual(r3, a3 - b3); + } + + [TestCompiler] + public static void uint4x4_operator_mul_wide_wide() + { + uint4x4 a0 = uint4x4(61417577, 219585476, 1362520891, 1511084277, 1481211272, 58211871, 1459591173, 567624644, 1169935583, 1835691886, 385626539, 85934842, 522856538, 278370196, 289217012, 2083410174); + uint4x4 b0 = uint4x4(578042444, 1620527213, 200516468, 309339115, 542853019, 299467282, 1479641221, 1428338601, 1497302909, 1596889147, 427413842, 265122693, 689376654, 1120457204, 516903000, 873091659); + uint4x4 r0 = uint4x4(2868103468, 1326150260, 3304073148, 2972110823, 1973926232, 88546350, 3431047833, 3712145508, 556671459, 1098186330, 1848083398, 4236646882, 2005201900, 651971856, 2573806560, 4184807018); + TestUtils.AreEqual(r0, a0 * b0); + + uint4x4 a1 = uint4x4(1293162798, 1939730122, 2075923048, 1116477212, 1686101741, 783310758, 248585944, 1093377716, 797038788, 1838048120, 1892922904, 1952024781, 492107602, 1097670675, 2069629919, 20122103); + uint4x4 b1 = uint4x4(1353196495, 1384773500, 1596528529, 2122329305, 1033200564, 996795088, 1137754930, 232014195, 1080950243, 1613216909, 463529448, 1781487382, 2101946430, 673144237, 390627073, 964308272); + uint4x4 r1 = uint4x4(4175537714, 3758002136, 2245379304, 3535300284, 1443849636, 550781664, 3335949872, 3941859036, 3201362380, 264300824, 4173364672, 1825729694, 4053448156, 3048379351, 2230824159, 4043852112); + TestUtils.AreEqual(r1, a1 * b1); + + uint4x4 a2 = uint4x4(606926492, 1153788131, 1687394746, 1499899200, 380825697, 2058271053, 1791586731, 16536749, 1743482585, 323418416, 826338527, 1127652402, 1548655361, 892665898, 498857854, 52699386); + uint4x4 b2 = uint4x4(1332603859, 106394678, 1330334791, 1720890701, 1860846228, 1499909622, 1236623401, 1532585255, 46356001, 1355750416, 470193265, 829633350, 158242740, 2121460265, 443332975, 1295474668); + uint4x4 r2 = uint4x4(1004304020, 3964664802, 638638742, 892728384, 2820012564, 1744222462, 3318371427, 2734565211, 2648780793, 1971376896, 936606319, 4269976492, 3894449076, 3059182266, 4018298274, 2504076408); + TestUtils.AreEqual(r2, a2 * b2); + + uint4x4 a3 = uint4x4(1013078461, 389868596, 2131450446, 692103096, 1728534690, 1232391212, 552742042, 2137384298, 2085409681, 1077145299, 67208657, 137969745, 204951457, 705222964, 437668893, 1222032847); + uint4x4 b3 = uint4x4(1966486133, 1063465732, 986983038, 1614187644, 117157419, 32076676, 452115159, 1402967848, 1712569067, 2023273918, 811855334, 136733227, 324154781, 1529152006, 1525922582, 2084976369); + uint4x4 r3 = uint4x4(492301665, 2753432784, 3640606308, 3084508448, 4283432758, 1476201136, 1834965334, 3709034128, 1711312923, 330198938, 4061378246, 1614991259, 1710893757, 4000022328, 4178229630, 147610079); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void uint4x4_operator_mul_wide_scalar() + { + uint4x4 a0 = uint4x4(871746615, 492532311, 570557670, 2142306629, 1610315153, 1526163563, 118471734, 257439514, 364291059, 1186560810, 1584938026, 1357601203, 638897141, 268562104, 1007838321, 1163240135); + uint b0 = (442064533); + uint4x4 r0 = uint4x4(338365955, 1081376419, 2565819870, 3279557417, 3421481829, 4119466055, 3456786286, 513646114, 1627104879, 1523063666, 1353478258, 3777359663, 2536221593, 3032449304, 484373445, 2580271059); + TestUtils.AreEqual(r0, a0 * b0); + + uint4x4 a1 = uint4x4(1619806399, 1127580168, 464517916, 1508043166, 745488654, 636691139, 1851670006, 357357967, 1095280227, 702779195, 945802744, 1464398841, 51061000, 802418971, 407442471, 638315697); + uint b1 = (1444659979); + uint4x4 r1 = uint4x4(3616906549, 204516952, 550116916, 1818059722, 936342938, 25036641, 3023113106, 1880770085, 4081946433, 270145673, 1865007528, 3007063731, 3346760536, 4271631657, 4019884717, 611909275); + TestUtils.AreEqual(r1, a1 * b1); + + uint4x4 a2 = uint4x4(1889264235, 1343048690, 2144106255, 1634890111, 425282134, 997231492, 676185747, 1562817045, 379402138, 866868743, 624571724, 889442510, 39498317, 219559094, 211033504, 2076045580); + uint b2 = (584402164); + uint4x4 r2 = uint4x4(1438595580, 691186344, 737965644, 2481252620, 644329976, 690489808, 3509538844, 94916612, 130016968, 3995237036, 1642003568, 2726280280, 3923731812, 1721275768, 992656512, 2349657968); + TestUtils.AreEqual(r2, a2 * b2); + + uint4x4 a3 = uint4x4(1838674974, 680562697, 469850888, 1511187096, 1844059526, 2003324819, 866371311, 1784948662, 515034926, 823384368, 1320152637, 940524320, 313230059, 384141839, 1177495555, 719285506); + uint b3 = (1056841954); + uint4x4 r3 = uint4x4(946684540, 4170074098, 646143248, 2211383856, 189976652, 31629254, 1385529086, 3958754988, 660907676, 3964386400, 2610819546, 3214754368, 3136353142, 2227683646, 1201386150, 1792703428); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void uint4x4_operator_mul_scalar_wide() + { + uint a0 = (1152242766); + uint4x4 b0 = uint4x4(1276636134, 2105929407, 499007702, 124002565, 1956335172, 1288034953, 832676555, 337389733, 99268757, 2005055247, 2011389505, 1348110859, 399689191, 2007606374, 2076691289, 1825721194); + uint4x4 r0 = uint4x4(2165463060, 999811634, 1179056436, 3493540742, 404105400, 1339492798, 3913201114, 3183347270, 2131796326, 1519334034, 3342961614, 2874551130, 3879114850, 583175956, 980068638, 1831387724); + TestUtils.AreEqual(r0, a0 * b0); + + uint a1 = (769885235); + uint4x4 b1 = uint4x4(153314735, 1066325369, 84289667, 984486192, 1325213504, 1643957457, 1576395620, 2095980601, 907671947, 836919582, 1412159342, 2037926630, 366590562, 493177763, 2058824164, 497936968); + uint4x4 r1 = uint4x4(4289232349, 3738299163, 541498905, 521809040, 1382797760, 961253795, 3068648684, 1134088027, 3776537265, 231133434, 3160056554, 294093778, 492874118, 3468107129, 490924140, 4232760408); + TestUtils.AreEqual(r1, a1 * b1); + + uint a2 = (2136548816); + uint4x4 b2 = uint4x4(1211907591, 2113626509, 345443734, 353147704, 688487056, 2038986981, 1991273614, 393095943, 838257274, 1646548338, 480051387, 1077685034, 421911953, 1757438926, 1584698689, 1237695787); + uint4x4 r2 = uint4x4(1868064944, 2388501392, 3000481760, 2871342464, 3262801152, 452481808, 510048608, 1680472240, 775038240, 1082189472, 4138639088, 3132761120, 3727882960, 3478904160, 3135547856, 2650008048); + TestUtils.AreEqual(r2, a2 * b2); + + uint a3 = (426426495); + uint4x4 b3 = uint4x4(272190940, 792362979, 710924244, 167756574, 2098906277, 461971950, 1070095729, 175505611, 1048663225, 451115371, 1568000860, 446946750, 1880161842, 1511877484, 2100048988, 850173891); + uint4x4 r3 = uint4x4(3219824676, 1827516829, 4180873772, 2158250978, 2903854555, 3439744274, 2755992335, 3627066549, 659408839, 2872540181, 3859604132, 2084929858, 2043124430, 3420539540, 3930782116, 3442704829); + TestUtils.AreEqual(r3, a3 * b3); + } + + [TestCompiler] + public static void uint4x4_operator_div_wide_wide() + { + uint4x4 a0 = uint4x4(333171510, 858154903, 1181365836, 671357749, 1090606752, 803759420, 788404166, 296807814, 575260195, 166625280, 1493729000, 1831739736, 200852358, 129983172, 500176108, 472051781); + uint4x4 b0 = uint4x4(698897823, 440199998, 655557473, 1658534285, 2127220100, 315653188, 1814290360, 992173243, 914851653, 664340325, 224323977, 246981573, 285573983, 819471609, 2012476015, 1783179572); + uint4x4 r0 = uint4x4(0, 1, 1, 0, 0, 2, 0, 0, 0, 0, 6, 7, 0, 0, 0, 0); + TestUtils.AreEqual(r0, a0 / b0); + + uint4x4 a1 = uint4x4(414699094, 1446535974, 1278480457, 930910505, 263295881, 1626759436, 450830871, 21439121, 521337599, 127756712, 200601965, 412554396, 1014641734, 239347640, 525574301, 1158358177); + uint4x4 b1 = uint4x4(223253978, 169515029, 1694929006, 1992168131, 1155972447, 1768506696, 422325410, 1508417406, 605462475, 66917170, 2014683461, 108847533, 611173330, 895791853, 1999369787, 1225614384); + uint4x4 r1 = uint4x4(1, 8, 0, 0, 0, 0, 1, 0, 0, 1, 0, 3, 1, 0, 0, 0); + TestUtils.AreEqual(r1, a1 / b1); + + uint4x4 a2 = uint4x4(1655168319, 2048437741, 367754386, 1861176433, 2131424795, 401044444, 745048188, 1943634349, 264134862, 298134010, 1884719303, 1582577607, 1958183229, 1302356942, 1455581366, 1466593830); + uint4x4 b2 = uint4x4(1168063495, 565150188, 127292785, 1027814836, 321940796, 337756553, 63233040, 1926010595, 769049413, 2042197280, 405134611, 547499280, 1337688441, 667307127, 35118652, 411409741); + uint4x4 r2 = uint4x4(1, 3, 2, 1, 6, 1, 11, 1, 0, 0, 4, 2, 1, 1, 41, 3); + TestUtils.AreEqual(r2, a2 / b2); + + uint4x4 a3 = uint4x4(2145097917, 113338377, 521371316, 1140663020, 891769689, 82976022, 1613639017, 1511282992, 815022628, 631656991, 1701235777, 1488378728, 1732969535, 754450606, 972419490, 1719717117); + uint4x4 b3 = uint4x4(401145052, 1430251023, 1603772580, 394044814, 1247425523, 2026144816, 74797843, 951408694, 460820692, 1904008535, 1263644544, 1250033708, 1500938461, 1177549592, 1193869306, 2096306143); + uint4x4 r3 = uint4x4(5, 0, 0, 2, 0, 0, 21, 1, 1, 0, 1, 1, 1, 0, 0, 0); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void uint4x4_operator_div_wide_scalar() + { + uint4x4 a0 = uint4x4(1433072926, 1073958635, 1195142312, 536596719, 1274375693, 464756346, 806462546, 906504670, 1380905136, 25493909, 1196815948, 123300377, 643754735, 2084019932, 2047825037, 458304263); + uint b0 = (1434025872); + uint4x4 r0 = uint4x4(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0); + TestUtils.AreEqual(r0, a0 / b0); + + uint4x4 a1 = uint4x4(741331531, 2110004616, 1500687214, 1453264263, 1617154145, 2040203220, 2103351724, 485536709, 402141749, 1477264254, 1629069474, 1549487015, 670594363, 2040479674, 155415284, 207130003); + uint b1 = (466443901); + uint4x4 r1 = uint4x4(1, 4, 3, 3, 3, 4, 4, 1, 0, 3, 3, 3, 1, 4, 0, 0); + TestUtils.AreEqual(r1, a1 / b1); + + uint4x4 a2 = uint4x4(1596922206, 1528374182, 1878500631, 1245757182, 1471308702, 1733304186, 251821475, 1328085649, 1950145317, 794269329, 174603836, 678361822, 1820872200, 1455358409, 778273070, 2067965131); + uint b2 = (1730223836); + uint4x4 r2 = uint4x4(0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1); + TestUtils.AreEqual(r2, a2 / b2); + + uint4x4 a3 = uint4x4(127176068, 610271655, 2044746707, 2127292310, 1964355374, 1181239062, 1239274235, 51060010, 872233944, 1134975739, 1324876719, 1504501302, 710310773, 132497882, 1041400664, 2063654021); + uint b3 = (1891892641); + uint4x4 r3 = uint4x4(0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void uint4x4_operator_div_scalar_wide() + { + uint a0 = (519165704); + uint4x4 b0 = uint4x4(1295178177, 775214121, 467772046, 1156881598, 310396565, 759759959, 243837702, 1616314235, 1053470225, 1320630160, 378773841, 4223608, 1971105754, 2054406020, 219939614, 1603672651); + uint4x4 r0 = uint4x4(0, 0, 1, 0, 1, 0, 2, 0, 0, 0, 1, 122, 0, 0, 2, 0); + TestUtils.AreEqual(r0, a0 / b0); + + uint a1 = (2006134295); + uint4x4 b1 = uint4x4(888535397, 1493077923, 615835131, 1045603945, 452709946, 1074919059, 467037221, 1485241506, 1775728786, 481521341, 68149923, 80867357, 1294049272, 470535313, 1235850199, 631464286); + uint4x4 r1 = uint4x4(2, 1, 3, 1, 4, 1, 4, 1, 1, 4, 29, 24, 1, 4, 1, 3); + TestUtils.AreEqual(r1, a1 / b1); + + uint a2 = (687722755); + uint4x4 b2 = uint4x4(412827650, 1258012095, 1286792622, 1799223034, 766890491, 2080374598, 711612151, 700420132, 1832408481, 1806438353, 237636410, 562498090, 1695805237, 2075783388, 2094216740, 1612536340); + uint4x4 r2 = uint4x4(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0); + TestUtils.AreEqual(r2, a2 / b2); + + uint a3 = (885282904); + uint4x4 b3 = uint4x4(762931601, 1888184154, 1235090956, 1621045406, 842468231, 1847778709, 734825, 1819123739, 682151426, 278238618, 175687779, 1535446878, 1906904600, 850094847, 1290407289, 1520242969); + uint4x4 r3 = uint4x4(1, 0, 0, 0, 1, 0, 1204, 0, 1, 3, 5, 0, 0, 1, 0, 0); + TestUtils.AreEqual(r3, a3 / b3); + } + + [TestCompiler] + public static void uint4x4_operator_mod_wide_wide() + { + uint4x4 a0 = uint4x4(258342924, 1454754891, 723352342, 1981431473, 531756042, 716993627, 1667903349, 1331097004, 1776856101, 17598216, 1474345080, 1681376293, 813624265, 1617478722, 498370451, 780075943); + uint4x4 b0 = uint4x4(1990080167, 1197348066, 651970512, 1659454050, 241005212, 1866255454, 1440101415, 595220963, 408818410, 198222574, 549504274, 239973807, 321398087, 658171840, 1511495237, 1048325585); + uint4x4 r0 = uint4x4(258342924, 257406825, 71381830, 321977423, 49745618, 716993627, 227801934, 140655078, 141582461, 17598216, 375336532, 1559644, 170828091, 301135042, 498370451, 780075943); + TestUtils.AreEqual(r0, a0 % b0); + + uint4x4 a1 = uint4x4(1754430321, 653235398, 1517128354, 966216200, 590067427, 1283434795, 1910903650, 1125967790, 1180537254, 308567230, 543945394, 483834400, 308703874, 383723801, 1181975437, 1161083599); + uint4x4 b1 = uint4x4(1126739824, 666641241, 38017598, 418797691, 618700513, 1941062990, 158556432, 1081063558, 427329468, 148111230, 1251162672, 1856322297, 1214781084, 401954255, 1323259633, 1167744452); + uint4x4 r1 = uint4x4(627690497, 653235398, 34442032, 128620818, 590067427, 1283434795, 8226466, 44904232, 325878318, 12344770, 543945394, 483834400, 308703874, 383723801, 1181975437, 1161083599); + TestUtils.AreEqual(r1, a1 % b1); + + uint4x4 a2 = uint4x4(1608412916, 111825133, 786866017, 1225576256, 1590085857, 1755638794, 1413553126, 476553804, 1342913944, 1625118233, 1202928007, 504380191, 642905424, 357937367, 1801777444, 1384305901); + uint4x4 b2 = uint4x4(1816151689, 541163525, 664455763, 1738838503, 1746284172, 855644567, 1887796950, 655067833, 536415164, 71040983, 631964713, 503267649, 944396748, 302347270, 564261945, 1414291441); + uint4x4 r2 = uint4x4(1608412916, 111825133, 122410254, 1225576256, 1590085857, 44349660, 1413553126, 476553804, 270083616, 62216607, 570963294, 1112542, 642905424, 55590097, 108991609, 1384305901); + TestUtils.AreEqual(r2, a2 % b2); + + uint4x4 a3 = uint4x4(1605100561, 332650074, 46731299, 294197541, 1349236859, 705509020, 1643007525, 442769171, 738227280, 1206523958, 1845625047, 2112300092, 1311771498, 2045741748, 306518396, 2084544706); + uint4x4 b3 = uint4x4(115690343, 94751961, 584804265, 516081491, 717212374, 945144869, 1775673480, 568390571, 1876139615, 645560273, 1090042616, 976448203, 1756041131, 1989952916, 923228986, 1025823912); + uint4x4 r3 = uint4x4(101126102, 48394191, 46731299, 294197541, 632024485, 705509020, 1643007525, 442769171, 738227280, 560963685, 755582431, 159403686, 1311771498, 55788832, 306518396, 32896882); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void uint4x4_operator_mod_wide_scalar() + { + uint4x4 a0 = uint4x4(560988938, 629524514, 767711194, 434281967, 1399805893, 792916846, 1663690927, 598661916, 1776636144, 1287035793, 1743722161, 475209785, 327476870, 1617696916, 379853074, 477430114); + uint b0 = (1156862367); + uint4x4 r0 = uint4x4(560988938, 629524514, 767711194, 434281967, 242943526, 792916846, 506828560, 598661916, 619773777, 130173426, 586859794, 475209785, 327476870, 460834549, 379853074, 477430114); + TestUtils.AreEqual(r0, a0 % b0); + + uint4x4 a1 = uint4x4(858399046, 1506629323, 199829950, 362269020, 1986626876, 1351725413, 1549678101, 431765276, 1315833792, 1664893153, 615834034, 780055604, 104179235, 629966219, 1810536428, 1747026206); + uint b1 = (712734431); + uint4x4 r1 = uint4x4(145664615, 81160461, 199829950, 362269020, 561158014, 638990982, 124209239, 431765276, 603099361, 239424291, 615834034, 67321173, 104179235, 629966219, 385067566, 321557344); + TestUtils.AreEqual(r1, a1 % b1); + + uint4x4 a2 = uint4x4(1799535061, 2049775667, 303673867, 93301056, 1944511005, 2135291183, 1065919801, 1342701312, 1356734788, 1593032231, 475449806, 1983416442, 776300612, 591854273, 2061957684, 1865797266); + uint b2 = (875754431); + uint4x4 r2 = uint4x4(48026199, 298266805, 303673867, 93301056, 193002143, 383782321, 190165370, 466946881, 480980357, 717277800, 475449806, 231907580, 776300612, 591854273, 310448822, 114288404); + TestUtils.AreEqual(r2, a2 % b2); + + uint4x4 a3 = uint4x4(1982663429, 374639153, 1919268329, 198719918, 1317719138, 1425282748, 1365516740, 2516691, 83972101, 1275507340, 1047856893, 1966089959, 1672456909, 657069574, 2080669380, 875667226); + uint b3 = (865181949); + uint4x4 r3 = uint4x4(252299531, 374639153, 188904431, 198719918, 452537189, 560100799, 500334791, 2516691, 83972101, 410325391, 182674944, 235726061, 807274960, 657069574, 350305482, 10485277); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void uint4x4_operator_mod_scalar_wide() + { + uint a0 = (933347930); + uint4x4 b0 = uint4x4(549923387, 243114953, 1884274390, 1428033594, 655531454, 1622674954, 1107563514, 1614111094, 914801920, 1432263179, 564431096, 1967013901, 1709750152, 1080102613, 13120773, 2042535998); + uint4x4 r0 = uint4x4(383424543, 204003071, 933347930, 933347930, 277816476, 933347930, 933347930, 933347930, 18546010, 933347930, 368916834, 933347930, 933347930, 933347930, 1773047, 933347930); + TestUtils.AreEqual(r0, a0 % b0); + + uint a1 = (1505698002); + uint4x4 b1 = uint4x4(1640058084, 974167554, 758635306, 1387264978, 611743343, 1139002766, 1913935748, 1086810076, 991846486, 922870408, 35007468, 891877602, 157349181, 83267982, 801093706, 546272767); + uint4x4 r1 = uint4x4(1505698002, 531530448, 747062696, 118433024, 282211316, 366695236, 1505698002, 418887926, 513851516, 582827594, 376878, 613820400, 89555373, 6874326, 704604296, 413152468); + TestUtils.AreEqual(r1, a1 % b1); + + uint a2 = (1665089132); + uint4x4 b2 = uint4x4(1889242068, 1179889796, 1690033703, 1333252321, 1960636489, 960755248, 698650125, 313994074, 1830992514, 2049496523, 507742240, 739436968, 1012724736, 2089810815, 329356442, 384427687); + uint4x4 r2 = uint4x4(1665089132, 485199336, 1665089132, 331836811, 1665089132, 704333884, 267788882, 95118762, 1665089132, 1665089132, 141862412, 186215196, 652364396, 1665089132, 18306922, 127378384); + TestUtils.AreEqual(r2, a2 % b2); + + uint a3 = (713578570); + uint4x4 b3 = uint4x4(443562339, 938288481, 1912612259, 1693566599, 2085663691, 1251595834, 2117822289, 341223518, 1811168615, 699804546, 1072556046, 722233492, 757452739, 1348995197, 1910821037, 1420741134); + uint4x4 r3 = uint4x4(270016231, 713578570, 713578570, 713578570, 713578570, 713578570, 713578570, 31131534, 713578570, 13774024, 713578570, 713578570, 713578570, 713578570, 713578570, 713578570); + TestUtils.AreEqual(r3, a3 % b3); + } + + [TestCompiler] + public static void uint4x4_operator_plus() + { + uint4x4 a0 = uint4x4(195392567, 222719748, 1002351013, 1570765263, 109389333, 1515950277, 1689763402, 291471785, 264115671, 1084131995, 195779102, 2131702223, 715660442, 1995564647, 69731564, 1317851903); + uint4x4 r0 = uint4x4(195392567, 222719748, 1002351013, 1570765263, 109389333, 1515950277, 1689763402, 291471785, 264115671, 1084131995, 195779102, 2131702223, 715660442, 1995564647, 69731564, 1317851903); + TestUtils.AreEqual(r0, +a0); + + uint4x4 a1 = uint4x4(1957501908, 2012985092, 1334133318, 1539671418, 935436165, 1575048895, 2119066258, 781435471, 1659000230, 1301861249, 1153431944, 1360657696, 578750954, 150348334, 1791553179, 1288641627); + uint4x4 r1 = uint4x4(1957501908, 2012985092, 1334133318, 1539671418, 935436165, 1575048895, 2119066258, 781435471, 1659000230, 1301861249, 1153431944, 1360657696, 578750954, 150348334, 1791553179, 1288641627); + TestUtils.AreEqual(r1, +a1); + + uint4x4 a2 = uint4x4(735146513, 1370099515, 1575634098, 36481877, 1832055170, 1043119761, 1370934466, 1126708142, 511229253, 1297664549, 1444401655, 1292097101, 1377029046, 1680766483, 249526091, 656501406); + uint4x4 r2 = uint4x4(735146513, 1370099515, 1575634098, 36481877, 1832055170, 1043119761, 1370934466, 1126708142, 511229253, 1297664549, 1444401655, 1292097101, 1377029046, 1680766483, 249526091, 656501406); + TestUtils.AreEqual(r2, +a2); + + uint4x4 a3 = uint4x4(195015813, 1562997921, 1927957096, 803204796, 1747288691, 795154500, 1030768402, 789329792, 597872750, 214089028, 536331458, 1078297736, 1832848364, 933783661, 551709570, 843060596); + uint4x4 r3 = uint4x4(195015813, 1562997921, 1927957096, 803204796, 1747288691, 795154500, 1030768402, 789329792, 597872750, 214089028, 536331458, 1078297736, 1832848364, 933783661, 551709570, 843060596); + TestUtils.AreEqual(r3, +a3); + } + + [TestCompiler] + public static void uint4x4_operator_neg() + { + uint4x4 a0 = uint4x4(1385088677, 94114564, 1350664872, 1458616659, 2067164853, 218122493, 958484951, 270553961, 446497525, 270503114, 1928771252, 1427605822, 2051940607, 1434247484, 485368391, 908365416); + uint4x4 r0 = uint4x4(2909878619, 4200852732, 2944302424, 2836350637, 2227802443, 4076844803, 3336482345, 4024413335, 3848469771, 4024464182, 2366196044, 2867361474, 2243026689, 2860719812, 3809598905, 3386601880); + TestUtils.AreEqual(r0, -a0); + + uint4x4 a1 = uint4x4(1742096480, 1368056141, 1350976157, 12802586, 1934372287, 576597401, 785136322, 559205611, 1959833280, 162379661, 1200036971, 95281343, 1969004480, 1381288239, 252975075, 1961335692); + uint4x4 r1 = uint4x4(2552870816, 2926911155, 2943991139, 4282164710, 2360595009, 3718369895, 3509830974, 3735761685, 2335134016, 4132587635, 3094930325, 4199685953, 2325962816, 2913679057, 4041992221, 2333631604); + TestUtils.AreEqual(r1, -a1); + + uint4x4 a2 = uint4x4(1607042487, 1300359361, 8438338, 431498011, 1534415387, 2069192669, 866625695, 2105773520, 1249998702, 1704935592, 59004141, 257619538, 392825753, 1868257049, 1472660509, 928823577); + uint4x4 r2 = uint4x4(2687924809, 2994607935, 4286528958, 3863469285, 2760551909, 2225774627, 3428341601, 2189193776, 3044968594, 2590031704, 4235963155, 4037347758, 3902141543, 2426710247, 2822306787, 3366143719); + TestUtils.AreEqual(r2, -a2); + + uint4x4 a3 = uint4x4(2138036799, 1587572134, 1974711458, 1372286091, 170185840, 1665000810, 565528550, 899411048, 107331573, 55742832, 1905931627, 175272618, 624976692, 1036698522, 1675796177, 1613753777); + uint4x4 r3 = uint4x4(2156930497, 2707395162, 2320255838, 2922681205, 4124781456, 2629966486, 3729438746, 3395556248, 4187635723, 4239224464, 2389035669, 4119694678, 3669990604, 3258268774, 2619171119, 2681213519); + TestUtils.AreEqual(r3, -a3); + } + + [TestCompiler] + public static void uint4x4_operator_prefix_inc() + { + uint4x4 a0 = uint4x4(780471723, 954741756, 272723451, 2142862245, 606294309, 1514814550, 250124151, 444189162, 1833356994, 1915989169, 1348278302, 129540735, 1584496757, 1170613526, 986715680, 1701179230); + uint4x4 r0 = uint4x4(780471724, 954741757, 272723452, 2142862246, 606294310, 1514814551, 250124152, 444189163, 1833356995, 1915989170, 1348278303, 129540736, 1584496758, 1170613527, 986715681, 1701179231); + TestUtils.AreEqual(r0, ++a0); + + uint4x4 a1 = uint4x4(1397451003, 1494652811, 1268688387, 2014528731, 453850931, 1112537171, 621362788, 2063486914, 1612870531, 1161037742, 1083861484, 1583359796, 82587894, 810087437, 72436569, 1094485773); + uint4x4 r1 = uint4x4(1397451004, 1494652812, 1268688388, 2014528732, 453850932, 1112537172, 621362789, 2063486915, 1612870532, 1161037743, 1083861485, 1583359797, 82587895, 810087438, 72436570, 1094485774); + TestUtils.AreEqual(r1, ++a1); + + uint4x4 a2 = uint4x4(912422931, 261771874, 2042016403, 1102472175, 976635804, 1261156013, 607693651, 1788488571, 1912059986, 420746703, 1703260621, 501684292, 1809882373, 1989306461, 786299198, 1729269500); + uint4x4 r2 = uint4x4(912422932, 261771875, 2042016404, 1102472176, 976635805, 1261156014, 607693652, 1788488572, 1912059987, 420746704, 1703260622, 501684293, 1809882374, 1989306462, 786299199, 1729269501); + TestUtils.AreEqual(r2, ++a2); + + uint4x4 a3 = uint4x4(411043860, 145863296, 877006815, 913426639, 1056275934, 1989688232, 1798844310, 79375331, 1140907425, 353776808, 1313746314, 1008313013, 1750769100, 1105901732, 1275841733, 1182538609); + uint4x4 r3 = uint4x4(411043861, 145863297, 877006816, 913426640, 1056275935, 1989688233, 1798844311, 79375332, 1140907426, 353776809, 1313746315, 1008313014, 1750769101, 1105901733, 1275841734, 1182538610); + TestUtils.AreEqual(r3, ++a3); + } + + [TestCompiler] + public static void uint4x4_operator_postfix_inc() + { + uint4x4 a0 = uint4x4(241865086, 2145821641, 1596166022, 803592338, 529551271, 1656767229, 903047443, 1213663244, 1425753247, 1384002775, 389844650, 1159795446, 1343289659, 1227160199, 947635082, 137930180); + uint4x4 r0 = uint4x4(241865086, 2145821641, 1596166022, 803592338, 529551271, 1656767229, 903047443, 1213663244, 1425753247, 1384002775, 389844650, 1159795446, 1343289659, 1227160199, 947635082, 137930180); + TestUtils.AreEqual(r0, a0++); + + uint4x4 a1 = uint4x4(451018043, 2009552507, 1176922170, 388721494, 2381860, 2062858295, 715101397, 1725384327, 446867079, 2101314783, 1460883320, 1683365096, 1319511974, 1418603655, 1938539756, 592683318); + uint4x4 r1 = uint4x4(451018043, 2009552507, 1176922170, 388721494, 2381860, 2062858295, 715101397, 1725384327, 446867079, 2101314783, 1460883320, 1683365096, 1319511974, 1418603655, 1938539756, 592683318); + TestUtils.AreEqual(r1, a1++); + + uint4x4 a2 = uint4x4(1576213022, 904484472, 253685095, 70826818, 1423673637, 463104653, 257117856, 964412816, 1148726183, 1820437224, 1087435092, 475319856, 1950385959, 1172607661, 1139700625, 1386106060); + uint4x4 r2 = uint4x4(1576213022, 904484472, 253685095, 70826818, 1423673637, 463104653, 257117856, 964412816, 1148726183, 1820437224, 1087435092, 475319856, 1950385959, 1172607661, 1139700625, 1386106060); + TestUtils.AreEqual(r2, a2++); + + uint4x4 a3 = uint4x4(612787013, 2015267118, 1005487805, 2000627239, 804783244, 82963346, 881064625, 1225691658, 82684192, 1702936093, 1589647770, 1677781795, 106241273, 2112882767, 598788541, 567112128); + uint4x4 r3 = uint4x4(612787013, 2015267118, 1005487805, 2000627239, 804783244, 82963346, 881064625, 1225691658, 82684192, 1702936093, 1589647770, 1677781795, 106241273, 2112882767, 598788541, 567112128); + TestUtils.AreEqual(r3, a3++); + } + + [TestCompiler] + public static void uint4x4_operator_prefix_dec() + { + uint4x4 a0 = uint4x4(1331961415, 1612382200, 1401591249, 2042075388, 1757136546, 1895858159, 1467742422, 578341664, 1336115745, 2059077641, 1169239112, 1862369220, 312317355, 1027543764, 1595492535, 1426262619); + uint4x4 r0 = uint4x4(1331961414, 1612382199, 1401591248, 2042075387, 1757136545, 1895858158, 1467742421, 578341663, 1336115744, 2059077640, 1169239111, 1862369219, 312317354, 1027543763, 1595492534, 1426262618); + TestUtils.AreEqual(r0, --a0); + + uint4x4 a1 = uint4x4(1426620468, 1423852012, 1459529624, 2092317419, 107501474, 1261583506, 512900840, 1496855314, 777588547, 617644613, 1487639376, 625907330, 1452782388, 804650978, 2076275981, 120447533); + uint4x4 r1 = uint4x4(1426620467, 1423852011, 1459529623, 2092317418, 107501473, 1261583505, 512900839, 1496855313, 777588546, 617644612, 1487639375, 625907329, 1452782387, 804650977, 2076275980, 120447532); + TestUtils.AreEqual(r1, --a1); + + uint4x4 a2 = uint4x4(262357170, 412907314, 846648478, 473291493, 286048219, 890018786, 1237897291, 1412498905, 346348942, 953070054, 2028727932, 2006551142, 1345994403, 1356250542, 1202345509, 497982699); + uint4x4 r2 = uint4x4(262357169, 412907313, 846648477, 473291492, 286048218, 890018785, 1237897290, 1412498904, 346348941, 953070053, 2028727931, 2006551141, 1345994402, 1356250541, 1202345508, 497982698); + TestUtils.AreEqual(r2, --a2); + + uint4x4 a3 = uint4x4(982734742, 1517311883, 735646686, 1387127643, 1263392561, 350798694, 888690409, 545220074, 979547999, 1278213546, 2127586693, 2099917981, 2030817004, 1254426663, 1240446778, 1741921687); + uint4x4 r3 = uint4x4(982734741, 1517311882, 735646685, 1387127642, 1263392560, 350798693, 888690408, 545220073, 979547998, 1278213545, 2127586692, 2099917980, 2030817003, 1254426662, 1240446777, 1741921686); + TestUtils.AreEqual(r3, --a3); + } + + [TestCompiler] + public static void uint4x4_operator_postfix_dec() + { + uint4x4 a0 = uint4x4(1870005937, 1708534798, 704493460, 462940703, 2060593573, 228744869, 940247280, 1818778351, 1015253889, 862428933, 1401191870, 2080259851, 653673271, 140452688, 1928164223, 1760916301); + uint4x4 r0 = uint4x4(1870005937, 1708534798, 704493460, 462940703, 2060593573, 228744869, 940247280, 1818778351, 1015253889, 862428933, 1401191870, 2080259851, 653673271, 140452688, 1928164223, 1760916301); + TestUtils.AreEqual(r0, a0--); + + uint4x4 a1 = uint4x4(1174531383, 993137684, 1669210509, 874927437, 1393579866, 471308632, 620865961, 220103745, 1407678826, 319906934, 1426931482, 488775250, 1681733117, 1916879863, 2060905976, 636358505); + uint4x4 r1 = uint4x4(1174531383, 993137684, 1669210509, 874927437, 1393579866, 471308632, 620865961, 220103745, 1407678826, 319906934, 1426931482, 488775250, 1681733117, 1916879863, 2060905976, 636358505); + TestUtils.AreEqual(r1, a1--); + + uint4x4 a2 = uint4x4(1379709480, 497925052, 549367303, 925145385, 55306458, 358414755, 18471540, 1907671409, 2010375112, 459674494, 1339288497, 548526029, 2061115550, 1130246689, 681734791, 1169678318); + uint4x4 r2 = uint4x4(1379709480, 497925052, 549367303, 925145385, 55306458, 358414755, 18471540, 1907671409, 2010375112, 459674494, 1339288497, 548526029, 2061115550, 1130246689, 681734791, 1169678318); + TestUtils.AreEqual(r2, a2--); + + uint4x4 a3 = uint4x4(640772261, 337750282, 880417560, 995078500, 1313900720, 1237226166, 83627499, 242836958, 652914747, 2056321582, 1660799445, 1330003101, 1481004419, 1093032717, 1487769541, 1443901346); + uint4x4 r3 = uint4x4(640772261, 337750282, 880417560, 995078500, 1313900720, 1237226166, 83627499, 242836958, 652914747, 2056321582, 1660799445, 1330003101, 1481004419, 1093032717, 1487769541, 1443901346); + TestUtils.AreEqual(r3, a3--); + } + + [TestCompiler] + public static void uint4x4_operator_bitwise_and_wide_wide() + { + uint4x4 a0 = uint4x4(1055241304, 859321394, 1088358961, 2090949513, 300561740, 651904515, 1331035868, 2012752753, 1298126656, 53199569, 1752363533, 1303061302, 1929998247, 1504941434, 470682792, 713577376); + uint4x4 b0 = uint4x4(749698416, 748105424, 1842764797, 9990577, 1989102105, 1666634755, 58116798, 868036607, 1420638875, 1308767169, 564040763, 478617502, 806150474, 674015378, 1505309955, 36064977); + uint4x4 r0 = uint4x4(749024336, 537928720, 1087769137, 8409473, 277479432, 575816707, 55888540, 867707761, 1141707264, 33686209, 538087433, 209912598, 805855490, 136347666, 403178496, 33571456); + TestUtils.AreEqual(r0, a0 & b0); + + uint4x4 a1 = uint4x4(1493231658, 1340884669, 1577921467, 44846626, 1105094388, 1143008413, 333009589, 2116296009, 2067254825, 121795325, 2122365250, 1088796653, 1594120761, 965590824, 337823363, 1686791432); + uint4x4 b1 = uint4x4(1779639327, 808650076, 1634437037, 1997568501, 1930853951, 1901503461, 1508772523, 2010961769, 1495957269, 1914669725, 1263994006, 491200541, 380703892, 282208487, 1416934135, 942735432); + uint4x4 r1 = uint4x4(1207967754, 2098204, 1074332585, 33572896, 1091986996, 1073782917, 298320545, 1979979081, 1495420417, 33686173, 1241513986, 4530189, 369102864, 276834336, 337674883, 536870920); + TestUtils.AreEqual(r1, a1 & b1); + + uint4x4 a2 = uint4x4(1275524729, 173403097, 864715776, 1437598787, 1375792249, 203672781, 1568515997, 145607913, 837338112, 754244200, 1383514630, 61183374, 690842674, 1362012962, 668846213, 1659745138); + uint4x4 b2 = uint4x4(615839538, 1698880188, 1204102677, 1811173266, 203114715, 1968993229, 1549041488, 421225724, 1641463312, 1122209170, 946391298, 229237652, 849684128, 1197217575, 1910121786, 1835643900); + uint4x4 r2 = uint4x4(67434032, 4246168, 58721280, 1102054402, 18521, 67125453, 1549018896, 134825192, 566264832, 14714880, 274776066, 27361668, 539304992, 1091306274, 567803904, 1617539952); + TestUtils.AreEqual(r2, a2 & b2); + + uint4x4 a3 = uint4x4(244062519, 625978732, 1335369426, 1146245993, 58358482, 538877476, 1060321225, 1070168191, 235095979, 1592354022, 662689935, 1706704449, 554656164, 1008037514, 1989573362, 1142327053); + uint4x4 b3 = uint4x4(200272981, 1864653698, 417415821, 863152148, 458105706, 1919250535, 1267287071, 45079273, 544365100, 843843698, 564582262, 329133431, 2091649092, 15031648, 240381212, 1613154110); + uint4x4 r3 = uint4x4(176949269, 621021440, 142606976, 5373952, 55190082, 537137188, 184615945, 42555497, 148008, 306708578, 556191750, 26881089, 537657348, 347136, 101869584, 1074169612); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void uint4x4_operator_bitwise_and_wide_scalar() + { + uint4x4 a0 = uint4x4(1513158868, 284695609, 734595037, 1566510707, 1601252476, 84213838, 314333543, 430856908, 753481263, 327392481, 1619794917, 2143619546, 1873208293, 126982769, 651482651, 1383096952); + uint b0 = (1173647397); + uint4x4 r0 = uint4x4(1076916228, 15732769, 29360133, 1163132961, 1164976164, 84148228, 11816997, 27545604, 81801253, 25169953, 1082396709, 1170472960, 1168400421, 93327393, 81022977, 1081106464); + TestUtils.AreEqual(r0, a0 & b0); + + uint4x4 a1 = uint4x4(1689107088, 366962092, 1729929586, 989550739, 1914435619, 1592791064, 2047510829, 678485991, 586400261, 771972179, 309059606, 131945492, 1707451796, 394184188, 1943201012, 558008097); + uint b1 = (1368301071); + uint4x4 r1 = uint4x4(1082956288, 294519820, 1091338242, 277485571, 1342871555, 1350569992, 1342867469, 40455, 8552965, 138243, 269123590, 25957380, 1099203588, 286163980, 1367507972, 16942593); + TestUtils.AreEqual(r1, a1 & b1); + + uint4x4 a2 = uint4x4(1070093422, 258102213, 1800249857, 922911179, 1719705954, 609219265, 1162961184, 851638827, 889902874, 1622363409, 785352441, 1741477119, 452211039, 1144654389, 641588835, 1574197624); + uint b2 = (34324916); + uint4x4 r2 = uint4x4(34095140, 33702276, 34177024, 33718656, 33587488, 770176, 82208, 33734688, 704784, 213264, 34308272, 34128052, 33554708, 655412, 34193440, 16688); + TestUtils.AreEqual(r2, a2 & b2); + + uint4x4 a3 = uint4x4(568430284, 349792636, 1088197642, 523608129, 1406695425, 839388192, 834567855, 888024716, 1014852215, 1459725306, 5273937, 298911416, 1193513114, 2080691940, 1824077552, 1585611449); + uint b3 = (1840697362); + uint4x4 r3 = uint4x4(564166656, 76562448, 1083478018, 221544448, 1099976704, 536870912, 565596162, 614858752, 741621778, 1157660690, 1069072, 26214416, 1159893010, 1812254720, 1823477776, 1283620880); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void uint4x4_operator_bitwise_and_scalar_wide() + { + uint a0 = (477163326); + uint4x4 b0 = uint4x4(110453385, 703240362, 2075630560, 1884904031, 1734899436, 947945203, 1664399051, 458879298, 158491426, 79772356, 2054527944, 202228212, 359225061, 639811396, 1821945318, 1821303024); + uint4x4 r0 = uint4x4(68182536, 140544042, 405834528, 273697310, 73426476, 402681394, 3188234, 407953666, 141583138, 71313924, 410028808, 201376052, 341853732, 69250820, 202419494, 201383984); + TestUtils.AreEqual(r0, a0 & b0); + + uint a1 = (2030124055); + uint4x4 b1 = uint4x4(1985961756, 579780373, 2061831301, 1139618293, 1145191868, 1121606282, 1414714065, 688688277, 1508875606, 664318814, 2092766410, 1010043618, 599967779, 47076367, 1325716015, 1119912335); + uint4x4 r1 = uint4x4(1879120916, 536886293, 2013334533, 1090596885, 1073757204, 1073747970, 1342181393, 687868949, 1493244950, 553660438, 2013336578, 939526146, 553650179, 5127, 1224740871, 1073741831); + TestUtils.AreEqual(r1, a1 & b1); + + uint a2 = (2083412385); + uint4x4 b2 = uint4x4(1805692137, 1689798540, 265665838, 1616867488, 244288538, 688929004, 1157047188, 1381359113, 1562107079, 944933664, 1994959125, 1413414673, 1280114143, 1373827711, 1107998701, 890185579); + uint4x4 r2 = uint4x4(1746929825, 1680359808, 201595168, 1611550880, 202246144, 671094944, 1143341440, 1342461953, 1544181889, 939657504, 1948780801, 1412323585, 1275877761, 1344426017, 1074401697, 873333025); + TestUtils.AreEqual(r2, a2 & b2); + + uint a3 = (195053206); + uint4x4 b3 = uint4x4(1877717925, 2063436477, 878745806, 1485028680, 1112745164, 1729117727, 660916495, 1196215754, 226023830, 283626389, 1719116288, 1596319327, 1706007294, 32695989, 728811929, 1229799524); + uint4x4 r3 = uint4x4(195035780, 178258580, 2097286, 142607360, 33555588, 50333206, 52445190, 50349186, 153108630, 10502804, 35652096, 186664470, 27263638, 27281044, 186663056, 151011332); + TestUtils.AreEqual(r3, a3 & b3); + } + + [TestCompiler] + public static void uint4x4_operator_bitwise_or_wide_wide() + { + uint4x4 a0 = uint4x4(1920951869, 1750772852, 1420019191, 732977093, 1169579447, 229437930, 1966721348, 2039812323, 113550869, 1912038362, 1569990624, 1490718227, 1686257697, 2137727522, 1569900650, 856504729); + uint4x4 b0 = uint4x4(214585254, 275414367, 858759675, 190211455, 1218691723, 2129565457, 1862809466, 495728846, 868064152, 1756913766, 933656055, 247722084, 1884195075, 1804207631, 1913174711, 1815920856); + uint4x4 r0 = uint4x4(2130669503, 2021326207, 2008016383, 737572863, 1303895999, 2146367483, 2134507390, 2107455727, 939376541, 2046780414, 2142664695, 1591475831, 1959708963, 2146117167, 2140863231, 2134768089); + TestUtils.AreEqual(r0, a0 | b0); + + uint4x4 a1 = uint4x4(2033376384, 2086259889, 671790684, 1189001916, 1756048437, 417084592, 2024165808, 966008272, 2031026290, 1461019191, 1071959084, 1645847295, 871350674, 736640317, 868515800, 767794452); + uint4x4 b1 = uint4x4(1226577606, 1696467642, 186912044, 1778908130, 1461256625, 1142152181, 272117331, 1162254035, 870448102, 1845053992, 257334526, 987295814, 1503050768, 1683307763, 1076253109, 1403888383); + uint4x4 r1 = uint4x4(2034163398, 2103430843, 724483964, 1860172798, 2142973365, 1558183925, 2025750515, 2111217619, 2079325174, 2147314239, 1073143038, 2061103871, 2080374162, 1878867455, 1944485885, 2146418687); + TestUtils.AreEqual(r1, a1 | b1); + + uint4x4 a2 = uint4x4(362186994, 96189073, 1924033224, 1971421809, 1826545883, 865329, 516571463, 371039923, 918186803, 1920664988, 452155520, 743961772, 1728213958, 825116968, 1597755374, 910392330); + uint4x4 b2 = uint4x4(561000721, 740143742, 343344681, 2074122472, 133130232, 108733999, 348566046, 1414140366, 975473487, 699452548, 1158934384, 1776041858, 1098964075, 1316223563, 1653177800, 679795328); + uint4x4 r2 = uint4x4(905361907, 767539967, 1996451561, 2141297401, 1879042043, 109000255, 516879199, 1449107455, 1052699519, 2080099740, 1609826288, 1843396526, 1736638447, 2139093867, 2143027182, 1053294218); + TestUtils.AreEqual(r2, a2 | b2); + + uint4x4 a3 = uint4x4(693462173, 779965187, 175928258, 1385704458, 1046509940, 18508109, 256469197, 470724351, 1132010845, 765120960, 1303071768, 951732863, 1964522596, 1159413431, 1665711360, 476367098); + uint4x4 b3 = uint4x4(1160679856, 1463165087, 225864530, 1687681609, 1534380366, 938828852, 1537113296, 522784628, 1469983598, 2040525960, 68341904, 1350736257, 467630862, 825069149, 655198246, 173368083); + uint4x4 r3 = uint4x4(1837102525, 2139059103, 259947474, 1990196811, 2138372478, 939486589, 1608482013, 523218943, 1476345727, 2107635144, 1304157336, 2025511935, 2145353582, 1967111935, 1733147942, 511044603); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void uint4x4_operator_bitwise_or_wide_scalar() + { + uint4x4 a0 = uint4x4(1295304853, 1307252624, 350194630, 1128063578, 1774824542, 2085245467, 1988423804, 999162350, 2110327307, 1050875188, 341855232, 1317039676, 228656898, 41280811, 1536908787, 606786773); + uint b0 = (1305527136); + uint4x4 r0 = uint4x4(1307888629, 1308350448, 1574947814, 1341973370, 1842999166, 2111492987, 2144662396, 2145305582, 2111425387, 2146686836, 1576062816, 1339092860, 1307690850, 1341515627, 1608245235, 1845155829); + TestUtils.AreEqual(r0, a0 | b0); + + uint4x4 a1 = uint4x4(1739461580, 1350320187, 1377874553, 1522262112, 1496806239, 1732466858, 1535976093, 375675620, 1614193383, 226059393, 697385997, 112556963, 1614163749, 1583289054, 1370656810, 1286074530); + uint b1 = (2040936581); + uint4x4 r1 = uint4x4(2142125005, 2046720191, 2074524413, 2076178661, 2042067935, 2145876143, 2075081373, 2145811173, 2042018535, 2113895557, 2042068109, 2142731175, 2041986981, 2147433183, 2042017967, 2108160167); + TestUtils.AreEqual(r1, a1 | b1); + + uint4x4 a2 = uint4x4(1155438844, 440002979, 1569359727, 5393691, 774282482, 1217128427, 212144562, 1525899482, 463019249, 1531812233, 1944160603, 953179348, 1692078056, 1331652826, 183129856, 1305664018); + uint b2 = (1835671387); + uint4x4 r2 = uint4x4(1845403647, 2138832891, 2112528255, 1836736347, 1869520891, 1844183035, 1844387835, 2147188699, 2147164155, 2138021851, 2146148187, 2113560543, 1845174267, 1870626779, 1877630811, 1845157723); + TestUtils.AreEqual(r2, a2 | b2); + + uint4x4 a3 = uint4x4(626899632, 2094300112, 1737365603, 1920526388, 1956204544, 1722269413, 961702184, 752387958, 160631159, 1859186074, 1291037807, 886605387, 496163558, 1615069781, 1118682069, 30965146); + uint b3 = (1403426207); + uint4x4 r3 = uint4x4(2013249471, 2146893791, 2007932415, 1946090943, 2009060767, 2007482367, 2079784383, 2147391487, 1538760191, 2146893215, 1610071551, 2013173727, 1605820415, 1944491999, 1404026847, 1409219999); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void uint4x4_operator_bitwise_or_scalar_wide() + { + uint a0 = (1768627592); + uint4x4 b0 = uint4x4(1849658052, 1759912154, 729979455, 975926310, 1987690876, 1809506714, 1160695341, 408963395, 314072711, 1560007537, 1709003416, 977086639, 1448375596, 1689568808, 595543345, 559778387); + uint4x4 r0 = uint4x4(1870634956, 1777286618, 1810603967, 2070642094, 2138824188, 1811676570, 1836048301, 2037079499, 2080071567, 2113658873, 1845452696, 2071936431, 2139061676, 1845485480, 1803509177, 1769971675); + TestUtils.AreEqual(r0, a0 | b0); + + uint a1 = (621080913); + uint4x4 b1 = uint4x4(438994183, 1742637145, 1219409263, 1602932494, 1204461702, 2111538444, 836730895, 1207638621, 802100209, 1089077339, 1315030334, 249047666, 1604790897, 1848168086, 347254235, 1777613639); + uint4x4 r1 = uint4x4(1060042071, 1742666073, 1840182655, 2140077919, 1741615575, 2111829341, 903868767, 1744829277, 802157553, 1710158171, 1868952959, 803011443, 2141715313, 1865220055, 901184987, 1844771671); + TestUtils.AreEqual(r1, a1 | b1); + + uint a2 = (1876731927); + uint4x4 b2 = uint4x4(842785732, 1023558747, 1567635900, 1888818835, 1681286114, 816160472, 669874393, 856364582, 957707703, 533888601, 707380794, 1472392035, 1658477097, 490006292, 1104319323, 1803275943); + uint4x4 r2 = uint4x4(2147478487, 2145315935, 2147269055, 2145238679, 1878977527, 2147335903, 1878915295, 2145369655, 2145254839, 2145320543, 1878912575, 2145315703, 1876884031, 2147282711, 1876867935, 1879043767); + TestUtils.AreEqual(r2, a2 | b2); + + uint a3 = (1843251082); + uint4x4 b3 = uint4x4(1971735860, 1170365407, 938567231, 165695098, 645196350, 1795857357, 2040732207, 1915771336, 1185590667, 720429375, 1993148654, 159915729, 856765461, 1859323098, 1361749181, 1346956647); + uint4x4 r3 = uint4x4(2111819710, 1843388383, 2147346367, 1845350394, 1878912958, 1876942799, 2113920943, 2147344330, 1879043979, 1878910911, 2145243118, 1843257307, 2145253279, 1876936666, 2113923007, 2111696879); + TestUtils.AreEqual(r3, a3 | b3); + } + + [TestCompiler] + public static void uint4x4_operator_bitwise_xor_wide_wide() + { + uint4x4 a0 = uint4x4(1843655608, 362425681, 640805534, 1342040268, 945678755, 980321850, 390165019, 1682422658, 303897251, 230477768, 1103646442, 1503102919, 26631152, 1016475570, 1862440929, 379588576); + uint4x4 b0 = uint4x4(1422803441, 1234691140, 119589253, 1101464929, 121896337, 1880109018, 1000210266, 1718938232, 464406940, 884337881, 34199854, 1430659227, 126415540, 1069919967, 1810763253, 2082802224); + uint4x4 r0 = uint4x4(959296073, 1544407317, 554771227, 240840109, 1058935858, 1249815008, 752651585, 36917754, 162747199, 956900113, 1136760772, 215066460, 102672708, 55804269, 82614804, 1787102672); + TestUtils.AreEqual(r0, a0 ^ b0); + + uint4x4 a1 = uint4x4(1943580404, 691527166, 723280696, 497086939, 1640104913, 893178410, 1596765788, 664096470, 2043360590, 799560121, 287637604, 696169196, 2067184169, 1208059988, 1250597330, 1386507647); + uint4x4 b1 = uint4x4(941097951, 27782297, 156353074, 607061607, 470737131, 1151564598, 8268481, 434405645, 519003095, 1880915120, 608970922, 1809455754, 1079250101, 514389994, 272120301, 1282399149); + uint4x4 r1 = uint4x4(1270918443, 680538471, 575512842, 965736380, 2110579514, 1906288924, 1599249565, 1047646171, 1730440857, 1605643529, 896084174, 1118087270, 996325020, 1453948862, 1521655871, 516667090); + TestUtils.AreEqual(r1, a1 ^ b1); + + uint4x4 a2 = uint4x4(1889791408, 2084012261, 308683100, 995657536, 2114803648, 1391716615, 1288505091, 1981377086, 1609802717, 1174043024, 1011203132, 1795164620, 244928755, 108081775, 1095776733, 1503947924); + uint4x4 b2 = uint4x4(1045003273, 1596550715, 1654640361, 147544177, 1770899808, 632909311, 351538321, 18362671, 582069925, 1343437834, 646157103, 1334609482, 1029555059, 1791514242, 2130180592, 1367984612); + uint4x4 r2 = uint4x4(1323995577, 589229790, 1895428021, 865328945, 394305184, 2001372408, 1480133522, 1996577553, 2101480824, 367609242, 449195795, 613191558, 868520832, 1824089325, 1067958317, 137209200); + TestUtils.AreEqual(r2, a2 ^ b2); + + uint4x4 a3 = uint4x4(1231713131, 1409256837, 71739867, 125722545, 1670829206, 1913595119, 1364737954, 520950663, 1245356662, 1052070924, 1245560924, 271196017, 1397322300, 1351621960, 1546558586, 1199251091); + uint4x4 b3 = uint4x4(1758262908, 551762515, 1215029402, 388720229, 652015944, 664221443, 63259885, 1715645848, 1189697317, 668527405, 43069813, 1243634305, 749402779, 1426611688, 1351626941, 2132106703); + uint4x4 r3 = uint4x4(564561175, 1931261910, 1278036289, 274020820, 1162489310, 1436029932, 1386052431, 2035269151, 215217491, 426622753, 1219293481, 1510622704, 2145618087, 93864096, 213822663, 946750300); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void uint4x4_operator_bitwise_xor_wide_scalar() + { + uint4x4 a0 = uint4x4(169345668, 176087064, 2084362901, 1663924004, 193851255, 517476661, 905336222, 863800783, 365003873, 835837496, 954341348, 1464576786, 625604047, 1700827127, 2003392824, 1481813598); + uint b0 = (354464228); + uint4x4 r0 = uint4x4(523809632, 526275068, 1763470193, 1980614336, 514678419, 200843473, 550954106, 643578923, 14759301, 619802588, 767731200, 1114315510, 812205099, 1883258387, 1649010908, 1299324858); + TestUtils.AreEqual(r0, a0 ^ b0); + + uint4x4 a1 = uint4x4(1077374714, 1991576049, 781860967, 60088394, 1196907956, 858716109, 858484213, 178843494, 1223183458, 866652388, 1771693181, 1206307664, 2037729583, 1324393116, 497725784, 1367278685); + uint b1 = (1043379893); + uint4x4 r1 = uint4x4(2114443343, 1216724804, 279639762, 1034180351, 2036853505, 220086648, 219929408, 882399699, 1993931479, 228107857, 1470714568, 2044100069, 1195769754, 1891636265, 597297133, 1867494120); + TestUtils.AreEqual(r1, a1 ^ b1); + + uint4x4 a2 = uint4x4(962962860, 1570278596, 1744797352, 574677361, 1363709514, 1256194849, 801937870, 1010182360, 1851940033, 346084804, 1153678862, 443991213, 53881334, 2016754499, 1219039118, 98879165); + uint b2 = (906632547); + uint4x4 r2 = uint4x4(258980047, 1804767655, 1375036363, 340458514, 1732416297, 2095717954, 432440493, 171718075, 1483227554, 581617831, 1925817197, 746379726, 893138069, 1312761376, 2124616429, 871291870); + TestUtils.AreEqual(r2, a2 ^ b2); + + uint4x4 a3 = uint4x4(1431003548, 1357679092, 1348322929, 109257274, 1305039919, 1464854602, 1225878688, 1485080510, 1118151444, 1798307920, 1281126688, 1804976766, 474757937, 1658928027, 456615564, 97298101); + uint b3 = (1566042386); + uint4x4 r3 = uint4x4(136087694, 230383846, 218771299, 1540672296, 278838589, 169345368, 340166066, 97742508, 535972358, 912779586, 285972530, 918694764, 1092342307, 1068946057, 1180733342, 1486573479); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void uint4x4_operator_bitwise_xor_scalar_wide() + { + uint a0 = (1361775641); + uint4x4 b0 = uint4x4(1452773578, 459050892, 1986218254, 1689037698, 999278344, 1229114508, 1087843538, 733699740, 106187872, 1533632738, 1107817672, 492506236, 597602329, 1439603382, 1001169118, 1231718216); + uint4x4 r0 = uint4x4(129801427, 1249346453, 659047703, 898082715, 1789184785, 409583765, 301736139, 2056278661, 1467957369, 172125435, 321714385, 1282408549, 1924512768, 82155183, 1787276487, 406948689); + TestUtils.AreEqual(r0, a0 ^ b0); + + uint a1 = (1693179077); + uint4x4 b1 = uint4x4(1050897427, 1796435561, 1100532547, 2106589181, 79691722, 851486414, 381749210, 1743618507, 2038827673, 1680906962, 161437943, 171927307, 277703584, 1344718195, 1634011177, 28540247); + uint4x4 r1 = uint4x4(1514713302, 267956908, 628299654, 425993016, 1616126735, 1445689867, 1915411231, 50748686, 493737564, 14370327, 1836352562, 1859435470, 1952888677, 885856694, 93246700, 1700307346); + TestUtils.AreEqual(r1, a1 ^ b1); + + uint a2 = (1205447252); + uint4x4 b2 = uint4x4(150341716, 899457210, 1927941858, 1213321665, 1943899052, 1166699955, 244059986, 698605361, 770240668, 1451322609, 409403288, 227252138, 455879262, 1859170556, 2135312326, 436746325); + uint4x4 r2 = uint4x4(1328521728, 1917127406, 892576950, 260602773, 872686072, 39045095, 1230349574, 1853519205, 1781619400, 291030693, 1606374860, 1246903806, 1559592970, 688462504, 950005138, 1574015489); + TestUtils.AreEqual(r2, a2 ^ b2); + + uint a3 = (843204844); + uint4x4 b3 = uint4x4(52615461, 2078810590, 1178449600, 1402670107, 1373081856, 1755048125, 1604469044, 2092902838, 1107934318, 1695691193, 926405595, 561772433, 1975967935, 188914543, 1621290142, 463965989); + uint4x4 r3 = uint4x4(828412361, 1235904818, 1954545196, 1641628919, 1670765036, 1524211793, 1843399128, 1325228378, 1884025986, 1464891733, 91593527, 322551677, 1199876179, 956355459, 1390453874, 702924745); + TestUtils.AreEqual(r3, a3 ^ b3); + } + + [TestCompiler] + public static void uint4x4_operator_left_shift() + { + uint4x4 a0 = uint4x4(1129100049, 829482269, 1571297368, 443753193, 1872142968, 249554593, 892627436, 980302862, 62369727, 849916599, 1271350845, 108441902, 1959056531, 1779118882, 1451674188, 2082026915); + int b0 = (218351941); + uint4x4 r0 = uint4x4(1771463200, 773628832, 3036875520, 1315200288, 4074000128, 3690779680, 2794274176, 1304920512, 1995831264, 1427527392, 2028521376, 3470140864, 2560266848, 1097229376, 3503901056, 2200351840); + TestUtils.AreEqual(r0, a0 << b0); + + uint4x4 a1 = uint4x4(1149883636, 186532735, 1487486874, 1498738574, 752067504, 1647167336, 772453640, 456967739, 947384545, 1463252873, 1315516161, 640579158, 56630178, 1650899378, 2142944517, 565484033); + int b1 = (1380536034); + uint4x4 r1 = uint4x4(304567248, 746130940, 1654980200, 1699987000, 3008270016, 2293702048, 3089814560, 1827870956, 3789538180, 1558044196, 967097348, 2562316632, 226520712, 2308630216, 4276810772, 2261936132); + TestUtils.AreEqual(r1, a1 << b1); + + uint4x4 a2 = uint4x4(965161323, 1821547426, 1959741996, 1189216014, 2088913234, 331636352, 1765476869, 1716088059, 2042799042, 1560870407, 1332136179, 1595140080, 1067324801, 948699739, 1516035622, 1153563832); + int b2 = (1634169280); + uint4x4 r2 = uint4x4(965161323, 1821547426, 1959741996, 1189216014, 2088913234, 331636352, 1765476869, 1716088059, 2042799042, 1560870407, 1332136179, 1595140080, 1067324801, 948699739, 1516035622, 1153563832); + TestUtils.AreEqual(r2, a2 << b2); + + uint4x4 a3 = uint4x4(1430593538, 229486560, 1384761698, 1777845122, 1613768084, 1329798580, 798843728, 2134269101, 924758423, 933785367, 1724594922, 339723704, 5739549, 1346500868, 1275889975, 1690441516); + int b3 = (1594641896); + uint4x4 r3 = uint4x4(1159725568, 2913984512, 2311676416, 4156785152, 807769088, 1126020096, 2640531456, 912043264, 514955008, 2825852672, 3409635840, 1069922304, 1469324544, 1106838528, 210319104, 3256298496); + TestUtils.AreEqual(r3, a3 << b3); + } + + [TestCompiler] + public static void uint4x4_operator_right_shift() + { + uint4x4 a0 = uint4x4(809126085, 908563670, 763568837, 1986717290, 1174507510, 646821842, 1242726074, 390811632, 1521420393, 1923166649, 102096936, 400863878, 667378673, 1611921244, 307750782, 479442287); + int b0 = (994800051); + uint4x4 r0 = uint4x4(1543, 1732, 1456, 3789, 2240, 1233, 2370, 745, 2901, 3668, 194, 764, 1272, 3074, 586, 914); + TestUtils.AreEqual(r0, a0 >> b0); + + uint4x4 a1 = uint4x4(2014389412, 1075916177, 1248577253, 848199210, 813936577, 848976170, 500930883, 662405800, 126875849, 1103917083, 1199000503, 955487090, 1013356510, 391605984, 185228398, 87452680); + int b1 = (1673938174); + uint4x4 r1 = uint4x4(1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0); + TestUtils.AreEqual(r1, a1 >> b1); + + uint4x4 a2 = uint4x4(2021602226, 275199908, 664576720, 363706280, 1600231415, 19835299, 1403250657, 1132760506, 388419548, 1563117590, 1786307084, 1386128491, 1614558171, 370772389, 47213745, 1348912303); + int b2 = (1401766495); + uint4x4 r2 = uint4x4(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + TestUtils.AreEqual(r2, a2 >> b2); + + uint4x4 a3 = uint4x4(1452132416, 1998929045, 455362165, 2108410522, 180863474, 59587500, 262637954, 1324311490, 1047631661, 1690388406, 43725571, 1582808189, 508063883, 1531560665, 2064352185, 313411198); + int b3 = (241508868); + uint4x4 r3 = uint4x4(90758276, 124933065, 28460135, 131775657, 11303967, 3724218, 16414872, 82769468, 65476978, 105649275, 2732848, 98925511, 31753992, 95722541, 129022011, 19588199); + TestUtils.AreEqual(r3, a3 >> b3); + } + + [TestCompiler] + public static void uint4x4_operator_bitwise_not() + { + uint4x4 a0 = uint4x4(111796841, 603562399, 745091931, 853183268, 1110916612, 381888399, 1891338755, 1506860135, 771210628, 787710759, 875964607, 96456785, 916013379, 203444882, 1172294211, 1020232736); + uint4x4 r0 = uint4x4(4183170454, 3691404896, 3549875364, 3441784027, 3184050683, 3913078896, 2403628540, 2788107160, 3523756667, 3507256536, 3419002688, 4198510510, 3378953916, 4091522413, 3122673084, 3274734559); + TestUtils.AreEqual(r0, ~a0); + + uint4x4 a1 = uint4x4(683852713, 881353367, 1218471344, 1174233245, 592898220, 443427914, 1385118179, 215320517, 860122767, 1411266016, 1349739899, 686325107, 829984855, 191189901, 319233142, 156019905); + uint4x4 r1 = uint4x4(3611114582, 3413613928, 3076495951, 3120734050, 3702069075, 3851539381, 2909849116, 4079646778, 3434844528, 2883701279, 2945227396, 3608642188, 3464982440, 4103777394, 3975734153, 4138947390); + TestUtils.AreEqual(r1, ~a1); + + uint4x4 a2 = uint4x4(1467719681, 957020051, 610113447, 1906177458, 1022824453, 1413628073, 1876376887, 479785538, 1454477141, 1062967600, 864049393, 916152339, 1644897753, 1624633488, 210894078, 759733457); + uint4x4 r2 = uint4x4(2827247614, 3337947244, 3684853848, 2388789837, 3272142842, 2881339222, 2418590408, 3815181757, 2840490154, 3231999695, 3430917902, 3378814956, 2650069542, 2670333807, 4084073217, 3535233838); + TestUtils.AreEqual(r2, ~a2); + + uint4x4 a3 = uint4x4(40062168, 316098272, 360895484, 1085047243, 142465498, 160134485, 1507457399, 637862751, 250793845, 1118106030, 541598856, 820535028, 2088709420, 596520858, 556731465, 2087920527); + uint4x4 r3 = uint4x4(4254905127, 3978869023, 3934071811, 3209920052, 4152501797, 4134832810, 2787509896, 3657104544, 4044173450, 3176861265, 3753368439, 3474432267, 2206257875, 3698446437, 3738235830, 2207046768); + TestUtils.AreEqual(r3, ~a3); + } + + [TestCase /* For player builds */] + public static void uint4x4_EqualsObjectOverride() + { + TestUtils.IsFalse(new uint4x4().Equals((object)new int())); + TestUtils.IsTrue(new uint4x4().Equals((object)new uint4x4())); + } + + + } +} diff --git a/src/Tests/Tests/Shared/TestUint4x4.gen.cs.meta b/src/Tests/Tests/Shared/TestUint4x4.gen.cs.meta new file mode 100644 index 00000000..8c8d1fae --- /dev/null +++ b/src/Tests/Tests/Shared/TestUint4x4.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9c652e046dd97fc4aadae764262652ad +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/Shared/TestUtils.cs b/src/Tests/Tests/Shared/TestUtils.cs new file mode 100644 index 00000000..f015648c --- /dev/null +++ b/src/Tests/Tests/Shared/TestUtils.cs @@ -0,0 +1,746 @@ +using NUnit.Framework; +using static Unity.Mathematics.math; + +namespace Unity.Mathematics.Tests +{ + class TestUtils + { + public static void AreEqual(bool expected, bool actual) + { + Assert.AreEqual(expected, actual); + } + + public static void AreEqual(int expected, int actual) + { + Assert.AreEqual(expected, actual); + } + + public static void AreEqual(uint expected, uint actual) + { + Assert.AreEqual(expected, actual); + } + + public static void AreEqual(long expected, long actual) + { + Assert.AreEqual(expected, actual); + } + + public static void AreEqual(ulong expected, ulong actual) + { + Assert.AreEqual(expected, actual); + } + + public static void AreEqual(float expected, float actual, float delta = 0.0f) + { + Assert.AreEqual(expected, actual, delta); + } + + public static void AreEqual(float expected, float actual, int maxUlp, bool signedZeroEqual) + { + if (signedZeroEqual && expected == actual) + return; + + if(isfinite(expected) && isfinite(actual)) + { + int ia = asint(expected); + int ib = asint(actual); + if ((ia ^ ib) < 0) + Assert.AreEqual(true, false); + int ulps = abs(ia - ib); + Assert.AreEqual(true, ulps <= maxUlp); + } + else + { + if (expected != actual && (!isnan(expected) || !isnan(actual))) + Assert.AreEqual(true, false); + } + } + + public static void AreEqual(double expected, double actual, double delta = 0.0) + { + Assert.AreEqual(expected, actual, delta); + } + + public static void AreEqual(double expected, double actual, int maxUlp, bool signedZeroEqual) + { + if (signedZeroEqual && expected == actual) + return; + + if (isfinite(expected) && isfinite(actual)) + { + long la = aslong(expected); + long lb = aslong(actual); + if ((la ^ lb) < 0) + Assert.AreEqual(true, false); + long ulps = abs(la - lb); + Assert.AreEqual(true, ulps <= maxUlp); + } + else + { + if (expected != actual && (!isnan(expected) || !isnan(actual))) + Assert.AreEqual(true, false); + } + } + + + // bool + public static void AreEqual(bool2 expected, bool2 actual) + { + AreEqual(expected.x, actual.x); + AreEqual(expected.y, actual.y); + } + + public static void AreEqual(bool3 expected, bool3 actual) + { + AreEqual(expected.x, actual.x); + AreEqual(expected.y, actual.y); + AreEqual(expected.z, actual.z); + } + + public static void AreEqual(bool4 expected, bool4 actual) + { + AreEqual(expected.x, actual.x); + AreEqual(expected.y, actual.y); + AreEqual(expected.z, actual.z); + AreEqual(expected.w, actual.w); + } + + + public static void AreEqual(bool2x2 expected, bool2x2 actual) + { + AreEqual(expected.c0, actual.c0); + AreEqual(expected.c1, actual.c1); + } + + public static void AreEqual(bool3x2 expected, bool3x2 actual) + { + AreEqual(expected.c0, actual.c0); + AreEqual(expected.c1, actual.c1); + } + + public static void AreEqual(bool4x2 expected, bool4x2 actual) + { + AreEqual(expected.c0, actual.c0); + AreEqual(expected.c1, actual.c1); + } + + + public static void AreEqual(bool2x3 expected, bool2x3 actual) + { + AreEqual(expected.c0, actual.c0); + AreEqual(expected.c1, actual.c1); + AreEqual(expected.c2, actual.c2); + } + + public static void AreEqual(bool3x3 expected, bool3x3 actual) + { + AreEqual(expected.c0, actual.c0); + AreEqual(expected.c1, actual.c1); + AreEqual(expected.c2, actual.c2); + } + + public static void AreEqual(bool4x3 expected, bool4x3 actual) + { + AreEqual(expected.c0, actual.c0); + AreEqual(expected.c1, actual.c1); + AreEqual(expected.c2, actual.c2); + } + + + public static void AreEqual(bool2x4 expected, bool2x4 actual) + { + AreEqual(expected.c0, actual.c0); + AreEqual(expected.c1, actual.c1); + AreEqual(expected.c2, actual.c2); + AreEqual(expected.c3, actual.c3); + } + + public static void AreEqual(bool3x4 expected, bool3x4 actual) + { + AreEqual(expected.c0, actual.c0); + AreEqual(expected.c1, actual.c1); + AreEqual(expected.c2, actual.c2); + AreEqual(expected.c3, actual.c3); + } + + public static void AreEqual(bool4x4 expected, bool4x4 actual) + { + AreEqual(expected.c0, actual.c0); + AreEqual(expected.c1, actual.c1); + AreEqual(expected.c2, actual.c2); + AreEqual(expected.c3, actual.c3); + } + + // int + public static void AreEqual(int2 expected, int2 actual) + { + AreEqual(expected.x, actual.x); + AreEqual(expected.y, actual.y); + } + + public static void AreEqual(int3 expected, int3 actual) + { + AreEqual(expected.x, actual.x); + AreEqual(expected.y, actual.y); + AreEqual(expected.z, actual.z); + } + + public static void AreEqual(int4 expected, int4 actual) + { + AreEqual(expected.x, actual.x); + AreEqual(expected.y, actual.y); + AreEqual(expected.z, actual.z); + AreEqual(expected.w, actual.w); + } + + + public static void AreEqual(int2x2 expected, int2x2 actual) + { + AreEqual(expected.c0, actual.c0); + AreEqual(expected.c1, actual.c1); + } + + public static void AreEqual(int3x2 expected, int3x2 actual) + { + AreEqual(expected.c0, actual.c0); + AreEqual(expected.c1, actual.c1); + } + + public static void AreEqual(int4x2 expected, int4x2 actual) + { + AreEqual(expected.c0, actual.c0); + AreEqual(expected.c1, actual.c1); + } + + + public static void AreEqual(int2x3 expected, int2x3 actual) + { + AreEqual(expected.c0, actual.c0); + AreEqual(expected.c1, actual.c1); + AreEqual(expected.c2, actual.c2); + } + + public static void AreEqual(int3x3 expected, int3x3 actual) + { + AreEqual(expected.c0, actual.c0); + AreEqual(expected.c1, actual.c1); + AreEqual(expected.c2, actual.c2); + } + + public static void AreEqual(int4x3 expected, int4x3 actual) + { + AreEqual(expected.c0, actual.c0); + AreEqual(expected.c1, actual.c1); + AreEqual(expected.c2, actual.c2); + } + + + + public static void AreEqual(int2x4 expected, int2x4 actual) + { + AreEqual(expected.c0, actual.c0); + AreEqual(expected.c1, actual.c1); + AreEqual(expected.c2, actual.c2); + AreEqual(expected.c3, actual.c3); + } + + public static void AreEqual(int3x4 expected, int3x4 actual) + { + AreEqual(expected.c0, actual.c0); + AreEqual(expected.c1, actual.c1); + AreEqual(expected.c2, actual.c2); + AreEqual(expected.c3, actual.c3); + } + + public static void AreEqual(int4x4 expected, int4x4 actual) + { + AreEqual(expected.c0, actual.c0); + AreEqual(expected.c1, actual.c1); + AreEqual(expected.c2, actual.c2); + AreEqual(expected.c3, actual.c3); + } + + + // uint + public static void AreEqual(uint2 expected, uint2 actual) + { + AreEqual(expected.x, actual.x); + AreEqual(expected.y, actual.y); + } + + public static void AreEqual(uint3 expected, uint3 actual) + { + AreEqual(expected.x, actual.x); + AreEqual(expected.y, actual.y); + AreEqual(expected.z, actual.z); + } + + public static void AreEqual(uint4 expected, uint4 actual) + { + AreEqual(expected.x, actual.x); + AreEqual(expected.y, actual.y); + AreEqual(expected.z, actual.z); + AreEqual(expected.w, actual.w); + } + + + public static void AreEqual(uint2x2 expected, uint2x2 actual) + { + AreEqual(expected.c0, actual.c0); + AreEqual(expected.c1, actual.c1); + } + + public static void AreEqual(uint3x2 expected, uint3x2 actual) + { + AreEqual(expected.c0, actual.c0); + AreEqual(expected.c1, actual.c1); + } + + public static void AreEqual(uint4x2 expected, uint4x2 actual) + { + AreEqual(expected.c0, actual.c0); + AreEqual(expected.c1, actual.c1); + } + + + public static void AreEqual(uint2x3 expected, uint2x3 actual) + { + AreEqual(expected.c0, actual.c0); + AreEqual(expected.c1, actual.c1); + AreEqual(expected.c2, actual.c2); + } + + public static void AreEqual(uint3x3 expected, uint3x3 actual) + { + AreEqual(expected.c0, actual.c0); + AreEqual(expected.c1, actual.c1); + AreEqual(expected.c2, actual.c2); + } + + public static void AreEqual(uint4x3 expected, uint4x3 actual) + { + AreEqual(expected.c0, actual.c0); + AreEqual(expected.c1, actual.c1); + AreEqual(expected.c2, actual.c2); + } + + + public static void AreEqual(uint2x4 expected, uint2x4 actual) + { + AreEqual(expected.c0, actual.c0); + AreEqual(expected.c1, actual.c1); + AreEqual(expected.c2, actual.c2); + AreEqual(expected.c3, actual.c3); + } + + public static void AreEqual(uint3x4 expected, uint3x4 actual) + { + AreEqual(expected.c0, actual.c0); + AreEqual(expected.c1, actual.c1); + AreEqual(expected.c2, actual.c2); + AreEqual(expected.c3, actual.c3); + } + + public static void AreEqual(uint4x4 expected, uint4x4 actual) + { + AreEqual(expected.c0, actual.c0); + AreEqual(expected.c1, actual.c1); + AreEqual(expected.c2, actual.c2); + AreEqual(expected.c3, actual.c3); + } + + // float + public static void AreEqual(float2 expected, float2 actual, float delta = 0.0f) + { + AreEqual(expected.x, actual.x, delta); + AreEqual(expected.y, actual.y, delta); + } + + public static void AreEqual(float2 expected, float2 actual, int maxUlp, bool signedZeroEqual) + { + AreEqual(expected.x, actual.x, maxUlp, signedZeroEqual); + AreEqual(expected.y, actual.y, maxUlp, signedZeroEqual); + } + + public static void AreEqual(float3 expected, float3 actual, float delta = 0.0f) + { + AreEqual(expected.x, actual.x, delta); + AreEqual(expected.y, actual.y, delta); + AreEqual(expected.z, actual.z, delta); + } + + public static void AreEqual(float3 expected, float3 actual, int maxUlp, bool signedZeroEqual) + { + AreEqual(expected.x, actual.x, maxUlp, signedZeroEqual); + AreEqual(expected.y, actual.y, maxUlp, signedZeroEqual); + AreEqual(expected.z, actual.z, maxUlp, signedZeroEqual); + } + + public static void AreEqual(float4 expected, float4 actual, float delta = 0.0f) + { + AreEqual(expected.x, actual.x, delta); + AreEqual(expected.y, actual.y, delta); + AreEqual(expected.z, actual.z, delta); + AreEqual(expected.w, actual.w, delta); + } + + public static void AreEqual(float4 expected, float4 actual, int maxUlp, bool signedZeroEqual) + { + AreEqual(expected.x, actual.x, maxUlp, signedZeroEqual); + AreEqual(expected.y, actual.y, maxUlp, signedZeroEqual); + AreEqual(expected.z, actual.z, maxUlp, signedZeroEqual); + AreEqual(expected.w, actual.w, maxUlp, signedZeroEqual); + } + + + public static void AreEqual(float2x2 expected, float2x2 actual, float delta = 0.0f) + { + AreEqual(expected.c0, actual.c0, delta); + AreEqual(expected.c1, actual.c1, delta); + } + + public static void AreEqual(float2x2 expected, float2x2 actual, int maxUlp, bool signedZeroEqual) + { + AreEqual(expected.c0, actual.c0, maxUlp, signedZeroEqual); + AreEqual(expected.c1, actual.c1, maxUlp, signedZeroEqual); + } + + public static void AreEqual(float3x2 expected, float3x2 actual, float delta = 0.0f) + { + AreEqual(expected.c0, actual.c0, delta); + AreEqual(expected.c1, actual.c1, delta); + } + + public static void AreEqual(float3x2 expected, float3x2 actual, int maxUlp, bool signedZeroEqual) + { + AreEqual(expected.c0, actual.c0, maxUlp, signedZeroEqual); + AreEqual(expected.c1, actual.c1, maxUlp, signedZeroEqual); + } + + public static void AreEqual(float4x2 expected, float4x2 actual, float delta = 0.0f) + { + AreEqual(expected.c0, actual.c0, delta); + AreEqual(expected.c1, actual.c1, delta); + } + + public static void AreEqual(float4x2 expected, float4x2 actual, int maxUlp, bool signedZeroEqual) + { + AreEqual(expected.c0, actual.c0, maxUlp, signedZeroEqual); + AreEqual(expected.c1, actual.c1, maxUlp, signedZeroEqual); + } + + + public static void AreEqual(float2x3 expected, float2x3 actual, float delta = 0.0f) + { + AreEqual(expected.c0, actual.c0, delta); + AreEqual(expected.c1, actual.c1, delta); + AreEqual(expected.c2, actual.c2, delta); + } + + public static void AreEqual(float2x3 expected, float2x3 actual, int maxUlp, bool signedZeroEqual) + { + AreEqual(expected.c0, actual.c0, maxUlp, signedZeroEqual); + AreEqual(expected.c1, actual.c1, maxUlp, signedZeroEqual); + AreEqual(expected.c2, actual.c2, maxUlp, signedZeroEqual); + } + + public static void AreEqual(float3x3 expected, float3x3 actual, float delta = 0.0f) + { + AreEqual(expected.c0, actual.c0, delta); + AreEqual(expected.c1, actual.c1, delta); + AreEqual(expected.c2, actual.c2, delta); + } + + public static void AreEqual(float3x3 expected, float3x3 actual, int maxUlp, bool signedZeroEqual) + { + AreEqual(expected.c0, actual.c0, maxUlp, signedZeroEqual); + AreEqual(expected.c1, actual.c1, maxUlp, signedZeroEqual); + AreEqual(expected.c2, actual.c2, maxUlp, signedZeroEqual); + } + + public static void AreEqual(float4x3 expected, float4x3 actual, float delta = 0.0f) + { + AreEqual(expected.c0, actual.c0, delta); + AreEqual(expected.c1, actual.c1, delta); + AreEqual(expected.c2, actual.c2, delta); + } + + public static void AreEqual(float4x3 expected, float4x3 actual, int maxUlp, bool signedZeroEqual) + { + AreEqual(expected.c0, actual.c0, maxUlp, signedZeroEqual); + AreEqual(expected.c1, actual.c1, maxUlp, signedZeroEqual); + AreEqual(expected.c2, actual.c2, maxUlp, signedZeroEqual); + } + + + public static void AreEqual(float2x4 expected, float2x4 actual, float delta = 0.0f) + { + AreEqual(expected.c0, actual.c0, delta); + AreEqual(expected.c1, actual.c1, delta); + AreEqual(expected.c2, actual.c2, delta); + AreEqual(expected.c3, actual.c3, delta); + } + + public static void AreEqual(float2x4 expected, float2x4 actual, int maxUlp, bool signedZeroEqual) + { + AreEqual(expected.c0, actual.c0, maxUlp, signedZeroEqual); + AreEqual(expected.c1, actual.c1, maxUlp, signedZeroEqual); + AreEqual(expected.c2, actual.c2, maxUlp, signedZeroEqual); + AreEqual(expected.c3, actual.c3, maxUlp, signedZeroEqual); + } + + public static void AreEqual(float3x4 expected, float3x4 actual, float delta = 0.0f) + { + AreEqual(expected.c0, actual.c0, delta); + AreEqual(expected.c1, actual.c1, delta); + AreEqual(expected.c2, actual.c2, delta); + AreEqual(expected.c3, actual.c3, delta); + } + + public static void AreEqual(float3x4 expected, float3x4 actual, int maxUlp, bool signedZeroEqual) + { + AreEqual(expected.c0, actual.c0, maxUlp, signedZeroEqual); + AreEqual(expected.c1, actual.c1, maxUlp, signedZeroEqual); + AreEqual(expected.c2, actual.c2, maxUlp, signedZeroEqual); + AreEqual(expected.c3, actual.c3, maxUlp, signedZeroEqual); + } + + public static void AreEqual(float4x4 expected, float4x4 actual, float delta = 0.0f) + { + AreEqual(expected.c0, actual.c0, delta); + AreEqual(expected.c1, actual.c1, delta); + AreEqual(expected.c2, actual.c2, delta); + AreEqual(expected.c3, actual.c3, delta); + } + + public static void AreEqual(float4x4 expected, float4x4 actual, int maxUlp, bool signedZeroEqual) + { + AreEqual(expected.c0, actual.c0, maxUlp, signedZeroEqual); + AreEqual(expected.c1, actual.c1, maxUlp, signedZeroEqual); + AreEqual(expected.c2, actual.c2, maxUlp, signedZeroEqual); + AreEqual(expected.c3, actual.c3, maxUlp, signedZeroEqual); + } + + // double + public static void AreEqual(double2 expected, double2 actual, double delta = 0.0) + { + AreEqual(expected.x, actual.x, delta); + AreEqual(expected.y, actual.y, delta); + } + + public static void AreEqual(double2 expected, double2 actual, int maxUlp, bool signedZeroEqual) + { + AreEqual(expected.x, actual.x, maxUlp, signedZeroEqual); + AreEqual(expected.y, actual.y, maxUlp, signedZeroEqual); + } + + public static void AreEqual(double3 expected, double3 actual, double delta = 0.0) + { + AreEqual(expected.x, actual.x, delta); + AreEqual(expected.y, actual.y, delta); + AreEqual(expected.z, actual.z, delta); + } + + public static void AreEqual(double3 expected, double3 actual, int maxUlp, bool signedZeroEqual) + { + AreEqual(expected.x, actual.x, maxUlp, signedZeroEqual); + AreEqual(expected.y, actual.y, maxUlp, signedZeroEqual); + AreEqual(expected.z, actual.z, maxUlp, signedZeroEqual); + } + + public static void AreEqual(double4 expected, double4 actual, double delta = 0.0) + { + AreEqual(expected.x, actual.x, delta); + AreEqual(expected.y, actual.y, delta); + AreEqual(expected.z, actual.z, delta); + AreEqual(expected.w, actual.w, delta); + } + + public static void AreEqual(double4 expected, double4 actual, int maxUlp, bool signedZeroEqual) + { + AreEqual(expected.x, actual.x, maxUlp, signedZeroEqual); + AreEqual(expected.y, actual.y, maxUlp, signedZeroEqual); + AreEqual(expected.z, actual.z, maxUlp, signedZeroEqual); + AreEqual(expected.w, actual.w, maxUlp, signedZeroEqual); + } + + + public static void AreEqual(double2x2 expected, double2x2 actual, double delta = 0.0) + { + AreEqual(expected.c0, actual.c0, delta); + AreEqual(expected.c1, actual.c1, delta); + } + + public static void AreEqual(double2x2 expected, double2x2 actual, int maxUlp, bool signedZeroEqual) + { + AreEqual(expected.c0, actual.c0, maxUlp, signedZeroEqual); + AreEqual(expected.c1, actual.c1, maxUlp, signedZeroEqual); + } + + public static void AreEqual(double3x2 expected, double3x2 actual, double delta = 0.0) + { + AreEqual(expected.c0, actual.c0, delta); + AreEqual(expected.c1, actual.c1, delta); + } + + public static void AreEqual(double3x2 expected, double3x2 actual, int maxUlp, bool signedZeroEqual) + { + AreEqual(expected.c0, actual.c0, maxUlp, signedZeroEqual); + AreEqual(expected.c1, actual.c1, maxUlp, signedZeroEqual); + } + + public static void AreEqual(double4x2 expected, double4x2 actual, double delta = 0.0) + { + AreEqual(expected.c0, actual.c0, delta); + AreEqual(expected.c1, actual.c1, delta); + } + + public static void AreEqual(double4x2 expected, double4x2 actual, int maxUlp, bool signedZeroEqual) + { + AreEqual(expected.c0, actual.c0, maxUlp, signedZeroEqual); + AreEqual(expected.c1, actual.c1, maxUlp, signedZeroEqual); + } + + public static void AreEqual(double2x3 expected, double2x3 actual, double delta = 0.0) + { + AreEqual(expected.c0, actual.c0, delta); + AreEqual(expected.c1, actual.c1, delta); + AreEqual(expected.c2, actual.c2, delta); + } + + public static void AreEqual(double2x3 expected, double2x3 actual, int maxUlp, bool signedZeroEqual) + { + AreEqual(expected.c0, actual.c0, maxUlp, signedZeroEqual); + AreEqual(expected.c1, actual.c1, maxUlp, signedZeroEqual); + AreEqual(expected.c2, actual.c2, maxUlp, signedZeroEqual); + } + + public static void AreEqual(double3x3 expected, double3x3 actual, double delta = 0.0) + { + AreEqual(expected.c0, actual.c0, delta); + AreEqual(expected.c1, actual.c1, delta); + AreEqual(expected.c2, actual.c2, delta); + } + + public static void AreEqual(double3x3 expected, double3x3 actual, int maxUlp, bool signedZeroEqual) + { + AreEqual(expected.c0, actual.c0, maxUlp, signedZeroEqual); + AreEqual(expected.c1, actual.c1, maxUlp, signedZeroEqual); + AreEqual(expected.c2, actual.c2, maxUlp, signedZeroEqual); + } + + public static void AreEqual(double4x3 expected, double4x3 actual, double delta = 0.0) + { + AreEqual(expected.c0, actual.c0, delta); + AreEqual(expected.c1, actual.c1, delta); + AreEqual(expected.c2, actual.c2, delta); + } + + public static void AreEqual(double4x3 expected, double4x3 actual, int maxUlp, bool signedZeroEqual) + { + AreEqual(expected.c0, actual.c0, maxUlp, signedZeroEqual); + AreEqual(expected.c1, actual.c1, maxUlp, signedZeroEqual); + AreEqual(expected.c2, actual.c2, maxUlp, signedZeroEqual); + } + + + public static void AreEqual(double2x4 expected, double2x4 actual, double delta = 0.0) + { + AreEqual(expected.c0, actual.c0, delta); + AreEqual(expected.c1, actual.c1, delta); + AreEqual(expected.c2, actual.c2, delta); + AreEqual(expected.c3, actual.c3, delta); + } + + public static void AreEqual(double2x4 expected, double2x4 actual, int maxUlp, bool signedZeroEqual) + { + AreEqual(expected.c0, actual.c0, maxUlp, signedZeroEqual); + AreEqual(expected.c1, actual.c1, maxUlp, signedZeroEqual); + AreEqual(expected.c2, actual.c2, maxUlp, signedZeroEqual); + AreEqual(expected.c3, actual.c3, maxUlp, signedZeroEqual); + } + + public static void AreEqual(double3x4 expected, double3x4 actual, double delta = 0.0) + { + AreEqual(expected.c0, actual.c0, delta); + AreEqual(expected.c1, actual.c1, delta); + AreEqual(expected.c2, actual.c2, delta); + AreEqual(expected.c3, actual.c3, delta); + } + + public static void AreEqual(double3x4 expected, double3x4 actual, int maxUlp, bool signedZeroEqual) + { + AreEqual(expected.c0, actual.c0, maxUlp, signedZeroEqual); + AreEqual(expected.c1, actual.c1, maxUlp, signedZeroEqual); + AreEqual(expected.c2, actual.c2, maxUlp, signedZeroEqual); + AreEqual(expected.c3, actual.c3, maxUlp, signedZeroEqual); + } + + public static void AreEqual(double4x4 expected, double4x4 actual, double delta = 0.0) + { + AreEqual(expected.c0, actual.c0, delta); + AreEqual(expected.c1, actual.c1, delta); + AreEqual(expected.c2, actual.c2, delta); + AreEqual(expected.c3, actual.c3, delta); + } + + public static void AreEqual(double4x4 expected, double4x4 actual, int maxUlp, bool signedZeroEqual) + { + AreEqual(expected.c0, actual.c0, maxUlp, signedZeroEqual); + AreEqual(expected.c1, actual.c1, maxUlp, signedZeroEqual); + AreEqual(expected.c2, actual.c2, maxUlp, signedZeroEqual); + AreEqual(expected.c3, actual.c3, maxUlp, signedZeroEqual); + } + + public static void AreEqual(quaternion expected, quaternion actual, float delta = 0.0f) + { + AreEqual(expected.value, actual.value, delta); + } + + public static void AreEqual(RigidTransform expected, RigidTransform actual, float delta = 0.0f) + { + AreEqual(expected.rot, actual.rot, delta); + AreEqual(expected.pos, actual.pos, delta); + } + + public static void IsTrue(bool condition) + { + AreEqual(true, condition); + } + + public static void IsFalse(bool condition) + { + AreEqual(false, condition); + } + + public static float UnsignedFloatQNaN() + { + return asfloat(0x7fc0_0000u); + } + + public static double UnsignedDoubleQNaN() + { + return asdouble(0x7ff8_0000_0000_0000ul); + } + + public static float SignedFloatQNaN() + { + return asfloat(0xffc0_0000u); + } + + public static double SignedDoubleQNaN() + { + return asdouble(0xfff8_0000_0000_0000ul); + } + + public static float SignedFloatZero() + { + return asfloat(0x8000_0000u); + } + + public static double SignedDoubleZero() + { + return asdouble(0x8000_0000_0000_0000ul); + } + } +} diff --git a/src/Tests/Tests/Shared/TestUtils.cs.meta b/src/Tests/Tests/Shared/TestUtils.cs.meta new file mode 100644 index 00000000..5629e131 --- /dev/null +++ b/src/Tests/Tests/Shared/TestUtils.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cff1594319560b44ba925eb76a273c80 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/TestMath2.cs b/src/Tests/Tests/TestMath2.cs new file mode 100644 index 00000000..02b48ddb --- /dev/null +++ b/src/Tests/Tests/TestMath2.cs @@ -0,0 +1,130 @@ +using NUnit.Framework; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; +using System; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + public partial class TestMath + { + [TestCompiler] + public unsafe void hash_blob() + { + byte[] testData = { + 0x0d, 0x26, 0x1c, 0xeb, 0x56, 0x3a, 0x9c, 0x18, 0x93, 0xb6, + 0xc1, 0x99, 0x5e, 0x04, 0x92, 0x4f, 0x6e, 0xb7, 0x42, 0x53, + 0x23, 0xcf, 0xe3, 0xbf, 0x16, 0x64, 0x79, 0x08, 0xc1, 0x01, + 0x43, 0x89, 0x73, 0x8f, 0x76, 0x22, 0x0c, 0xee, 0x9b, 0x80, + 0x31, 0x83, 0xce, 0x33, 0x8b, 0xc7, 0x3f, 0x94, 0x33 + }; + + uint[] resultsWithZeroSeed = + { + 0x02cc5d05, 0x376a5b3f, 0x8ae13198, 0xf5b14d72, 0xcc7ddc84, + 0x763e5905, 0x58759392, 0x6bccbd00, 0x7d0f80c8, 0xef01ae48, + 0xe40aa3ad, 0x805e04ad, 0xf98a471c, 0xdd960ac1, 0x76a71750, + 0xd35e2baa, 0x0219f7da, 0xd5bd1fbd, 0x5f28c87e, 0xfe6f7995, + 0x69a43ac5, 0xec1a1a15, 0x7ae9f103, 0x8d04a688, 0xce3b35be, + 0x6b3f040c, 0xd5ea2e8c, 0x6989e79c, 0x8772f1fb, 0x0d7b7bf6, + 0x0796214b, 0x98ea65c4, 0x3884dd82, 0x59632484, 0x91c92822, + 0x72d28404, 0x167061b0, 0x32adc2ef, 0xbac3e672, 0xd39936b7, + 0x94e2c154, 0x8b4ff46c, 0x68976fd4, 0x04bee59a, 0x2ed62c69, + 0xabee69fd, 0xda11e266, 0xcebd9d38, 0x28eea5fd, 0x0210d6ee + }; + + + uint[] resultsWith_0xeb69cf40_seed = + { + 0x12c3b280, 0x9bc1f68d, 0x2f900b51, 0xdb77e20e, 0xf6e8f561, + 0x3f3f72f6, 0x15f9700f, 0x28beb671, 0xceece5e1, 0x7a9b5c81, + 0x62a84642, 0xf75666af, 0x8939f8ca, 0x6b84792b, 0x527ee836, + 0xa0782090, 0xce6b9926, 0xa608c73b, 0xa08ee6a3, 0xab77a6b2, + 0x4e174e68, 0x596f10d5, 0xa14c4d85, 0x509ab88d, 0xd14698a4, + 0xbaad2308, 0xbd04c3df, 0x5715fed1, 0x5cf23a74, 0xd4e844f9, + 0x166dcfba, 0xe3495e37, 0x1b18b2b3, 0x2e8c2aab, 0x40993321, + 0x4b84998a, 0xd062937d, 0x1b2c9f7b, 0x8a613ed3, 0x70d71291, + 0x1af38ea4, 0x460cb7e9, 0xf806e3a9, 0xec9b6b2e, 0x9972a843, + 0x1ff06d2a, 0xe8c5007b, 0x37d8fc40, 0x0dc4f639, 0x36edff4f + }; + fixed (byte* p = testData) + { + for (int i = 0; i < 50; ++i) + { + TestUtils.AreEqual(hash(p, i, 0), resultsWithZeroSeed[i]); + } + + for (int i = 0; i < 50; ++i) + { + TestUtils.AreEqual(hash(p, i, 0xeb69cf40), resultsWith_0xeb69cf40_seed[i]); + } + } + } + + [TestCompiler] + public unsafe void hash_blob_unaligned() + { + byte[] testData = { + 0x0d, 0x26, 0x1c, 0xeb, 0x56, 0x3a, 0x9c, 0x18, 0x93, 0xb6, + 0xc1, 0x99, 0x5e, 0x04, 0x92, 0x4f, 0x6e, 0xb7, 0x42, 0x53, + 0x23, 0xcf, 0xe3, 0xbf, 0x16, 0x64, 0x79, 0x08, 0xc1, 0x01, + 0x43, 0x89, 0x73, 0x8f, 0x76, 0x22, 0x0c, 0xee, 0x9b, 0x80, + 0x31, 0x83, 0xce, 0x33, 0x8b, 0xc7, 0x3f, 0x94, 0x33 + }; + + uint[] resultsWithZeroSeed = + { + 0x02cc5d05, 0x376a5b3f, 0x8ae13198, 0xf5b14d72, 0xcc7ddc84, + 0x763e5905, 0x58759392, 0x6bccbd00, 0x7d0f80c8, 0xef01ae48, + 0xe40aa3ad, 0x805e04ad, 0xf98a471c, 0xdd960ac1, 0x76a71750, + 0xd35e2baa, 0x0219f7da, 0xd5bd1fbd, 0x5f28c87e, 0xfe6f7995, + 0x69a43ac5, 0xec1a1a15, 0x7ae9f103, 0x8d04a688, 0xce3b35be, + 0x6b3f040c, 0xd5ea2e8c, 0x6989e79c, 0x8772f1fb, 0x0d7b7bf6, + 0x0796214b, 0x98ea65c4, 0x3884dd82, 0x59632484, 0x91c92822, + 0x72d28404, 0x167061b0, 0x32adc2ef, 0xbac3e672, 0xd39936b7, + 0x94e2c154, 0x8b4ff46c, 0x68976fd4, 0x04bee59a, 0x2ed62c69, + 0xabee69fd, 0xda11e266, 0xcebd9d38, 0x28eea5fd, 0x0210d6ee + }; + + + uint[] resultsWith_0xeb69cf40_seed = + { + 0x12c3b280, 0x9bc1f68d, 0x2f900b51, 0xdb77e20e, 0xf6e8f561, + 0x3f3f72f6, 0x15f9700f, 0x28beb671, 0xceece5e1, 0x7a9b5c81, + 0x62a84642, 0xf75666af, 0x8939f8ca, 0x6b84792b, 0x527ee836, + 0xa0782090, 0xce6b9926, 0xa608c73b, 0xa08ee6a3, 0xab77a6b2, + 0x4e174e68, 0x596f10d5, 0xa14c4d85, 0x509ab88d, 0xd14698a4, + 0xbaad2308, 0xbd04c3df, 0x5715fed1, 0x5cf23a74, 0xd4e844f9, + 0x166dcfba, 0xe3495e37, 0x1b18b2b3, 0x2e8c2aab, 0x40993321, + 0x4b84998a, 0xd062937d, 0x1b2c9f7b, 0x8a613ed3, 0x70d71291, + 0x1af38ea4, 0x460cb7e9, 0xf806e3a9, 0xec9b6b2e, 0x9972a843, + 0x1ff06d2a, 0xe8c5007b, 0x37d8fc40, 0x0dc4f639, 0x36edff4f + }; + + byte* buffer = stackalloc byte[testData.Length + 1]; + fixed (byte* p = testData) + { + UIntPtr address = (UIntPtr)p; + bool isUnaligned = ((ulong)address & 1) > 0; + byte* unalignedPtr = buffer; + + if (!isUnaligned) + { + ++unalignedPtr; + } + + Buffer.MemoryCopy(p, unalignedPtr, testData.Length + 1, testData.Length); + + for (int i = 0; i < 50; ++i) + { + TestUtils.AreEqual(hash(unalignedPtr, i, 0), resultsWithZeroSeed[i]); + } + + for (int i = 0; i < 50; ++i) + { + TestUtils.AreEqual(hash(unalignedPtr, i, 0xeb69cf40), resultsWith_0xeb69cf40_seed[i]); + } + } + } + } +} diff --git a/src/Tests/Tests/TestMath2.cs.meta b/src/Tests/Tests/TestMath2.cs.meta new file mode 100644 index 00000000..d2cf65d6 --- /dev/null +++ b/src/Tests/Tests/TestMath2.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b0783b280ba38504faba05db473c408b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Tests/TestRandom.cs b/src/Tests/Tests/TestRandom.cs new file mode 100644 index 00000000..35bc9abd --- /dev/null +++ b/src/Tests/Tests/TestRandom.cs @@ -0,0 +1,1273 @@ +using NUnit.Framework; +using System; +using static Unity.Mathematics.math; +using Burst.Compiler.IL.Tests; + +namespace Unity.Mathematics.Tests +{ + [TestFixture] + class TestRandom + { + // Kolmogorov–Smirnov test on lambda assuming the ideal distribution is uniform [0, 1] + private static void ks_test(Func func, int num_buckets = 256) + { + const int N = 8192; + var histogram = new int[num_buckets]; + + for (int i = 0; i < N; i++) + { + double x = func(); + Assert.GreaterOrEqual(x, 0.0); + Assert.LessOrEqual(x, 1.0); + int bucket = min((int)(x * num_buckets), num_buckets - 1); + + histogram[bucket]++; + } + + double largest_delta = 0.0f; + int accum = 0; + for (int i = 0; i < histogram.Length; i++) + { + accum += histogram[i]; + double current = accum / (double)N; + double target = (double)(i + 1) / histogram.Length; + largest_delta = math.max(largest_delta, math.abs(current - target)); + } + double d = 1.62762 / math.sqrt((double)N); // significance: 0.01 + Assert.Less(largest_delta, d); + } + + private static void ks_test(Func func) + { + ks_test(() => func().x); + ks_test(() => func().y); + } + + // Pearson's product-moment coefficient + private static void r_test(Func func) + { + const int N = 4096; + + double2 sum = 0.0; + var values = new double2[N]; + for(int i = 0; i < N; i++) + { + values[i] = func(); + sum += values[i]; + } + + double2 avg = sum / N; + double var_a = 0.0; + double var_b = 0.0; + double cov = 0.0; + for (int i = 0; i < N; i++) + { + double2 delta = values[i] - avg; + var_a += delta.x * delta.x; + var_b += delta.y * delta.y; + cov += delta.x * delta.y; + } + + double r = cov / sqrt(var_a * var_b); + Assert.Less(abs(r), 0.05); + } + + private static float range_check01(float x) + { + Assert.GreaterOrEqual(x, 0.0f); + Assert.Less(x, 1.0f); + return x; + } + + private static double range_check01(double x) + { + Assert.GreaterOrEqual(x, 0.0); + Assert.Less(x, 1.0); + return x; + } + + private static int range_check(int x, int min, int max) + { + Assert.GreaterOrEqual(x, min); + Assert.Less(x, max); + return x; + } + + private static uint range_check(uint x, uint min, uint max) + { + Assert.GreaterOrEqual(x, min); + Assert.Less(x, max); + return x; + } + + private static float range_check(float x, float min, float max) + { + Assert.GreaterOrEqual(x, min); + Assert.Less(x, max); + return x; + } + + private static double range_check(double x, double min, double max) + { + Assert.GreaterOrEqual(x, min); + Assert.Less(x, max); + return x; + } + + + [TestCompiler] + public static void bool_uniform() + { + var rnd = new Random(0x6E624EB7u); + ks_test((() => rnd.NextBool() ? 0.75 : 0.25), 2); + } + + [TestCompiler] + public static void bool2_uniform() + { + var rnd = new Random(0x6E624EB7u); + ks_test((() => rnd.NextBool2().x ? 0.75 : 0.25), 2); + ks_test((() => rnd.NextBool2().y ? 0.75 : 0.25), 2); + } + + [TestCompiler] + public static void bool2_independent() + { + var rnd = new Random(0x6E624EB7u); + r_test((() => select(double2(0.25), double2(0.75), rnd.NextBool2().xy))); + } + + [TestCompiler] + public static void bool3_uniform() + { + var rnd = new Random(0x6E624EB7u); + ks_test((() => rnd.NextBool3().x ? 0.75 : 0.25), 2); + ks_test((() => rnd.NextBool3().y ? 0.75 : 0.25), 2); + ks_test((() => rnd.NextBool3().z ? 0.75 : 0.25), 2); + } + + [TestCompiler] + public static void bool3_independent() + { + var rnd = new Random(0x6E624EB7u); + r_test((() => select(double2(0.25), double2(0.75), rnd.NextBool3().xy))); + r_test((() => select(double2(0.25), double2(0.75), rnd.NextBool3().xz))); + r_test((() => select(double2(0.25), double2(0.75), rnd.NextBool3().yz))); + } + + [TestCompiler] + public static void bool4_uniform() + { + var rnd = new Random(0x6E624EB7u); + ks_test((() => rnd.NextBool4().x ? 0.75 : 0.25), 2); + ks_test((() => rnd.NextBool4().y ? 0.75 : 0.25), 2); + ks_test((() => rnd.NextBool4().z ? 0.75 : 0.25), 2); + ks_test((() => rnd.NextBool4().w ? 0.75 : 0.25), 2); + } + + [TestCompiler] + public static void bool4_independent() + { + var rnd = new Random(0x6E624EB7u); + r_test((() => select(double2(0.25), double2(0.75), rnd.NextBool4().xy))); + r_test((() => select(double2(0.25), double2(0.75), rnd.NextBool4().xz))); + r_test((() => select(double2(0.25), double2(0.75), rnd.NextBool4().xw))); + r_test((() => select(double2(0.25), double2(0.75), rnd.NextBool4().yz))); + r_test((() => select(double2(0.25), double2(0.75), rnd.NextBool4().yw))); + r_test((() => select(double2(0.25), double2(0.75), rnd.NextBool4().zw))); + } + + [TestCompiler] + public static void int_uniform_low_bits() + { + var rnd = new Random(0x6E624EB7u); + ks_test((() => ((rnd.NextInt() & 255u) + 0.5) / 256.0), 256); + } + + [TestCompiler] + public static void int_uniform_high_bits() + { + var rnd = new Random(0x6E624EB7u); + ks_test((() => (((uint)rnd.NextInt() >> 24) + 0.5) / 256.0), 256); + } + + [TestCompiler] + public static void int_uniform_max() + { + var rnd = new Random(0x6E624EB7u); + int max = 17; + ks_test((() => (range_check(rnd.NextInt(max), 0, max) + 0.5) / max), max); + } + + [TestCompiler] + public static void int_uniform_max_limit() + { + var rnd = new Random(0x6E624EB7u); + int max = 2147483647; + ks_test((() => (range_check(rnd.NextInt(max), 0, max) + 0.5) / max), 256); + } + + [TestCompiler] + public static void int_uniform_min_max() + { + var rnd = new Random(0x6E624EB7u); + int min = -7; + int max = 17; + int range = max - min; + ks_test((() => (range_check(rnd.NextInt(min, max), min, max) + 0.5 - min) / range), range); + } + + [TestCompiler] + public static void int_uniform_min_max_limit() + { + var rnd = new Random(0x6E624EB7u); + int min = -2147483648; + int max = 2147483647; + long range = (long)max - (long)min; + ks_test((() => (range_check(rnd.NextInt(min, max), min, max) + 0.5 - min) / range), 256); + } + + [TestCompiler] + public static void int2_uniform_low_bits() + { + var rnd = new Random(0x6E624EB7u); + ks_test((() => ((rnd.NextInt2().x & 255u) + 0.5) / 256.0), 256); + ks_test((() => ((rnd.NextInt2().y & 255u) + 0.5) / 256.0), 256); + } + + [TestCompiler] + public static void int2_uniform_high_bits() + { + var rnd = new Random(0x6E624EB7u); + ks_test((() => (((uint)rnd.NextInt2().x >> 24) + 0.5) / 256.0), 256); + ks_test((() => (((uint)rnd.NextInt2().y >> 24) + 0.5) / 256.0), 256); + } + + [TestCompiler] + public static void int2_uniform_max() + { + var rnd = new Random(0x6E624EB7u); + int max = 2147483647; + ks_test((() => (range_check(rnd.NextInt2(max).x, 0, max) + 0.5) / max), 256); + ks_test((() => (range_check(rnd.NextInt2(max).y, 0, max) + 0.5) / max), 256); + } + + [TestCompiler] + public static void int2_uniform_min_max() + { + var rnd = new Random(0x6E624EB7u); + int2 min = int2(-7, 3); + int2 max = int2(17, 14); + int2 range = max - min; + ks_test((() => (range_check(rnd.NextInt2(min, max).x, min.x, max.x) + 0.5 - min.x) / range.x), range.x); + ks_test((() => (range_check(rnd.NextInt2(min, max).y, min.y, max.y) + 0.5 - min.y) / range.y), range.y); + } + + [TestCompiler] + public static void int2_uniform_min_max_limit() + { + var rnd = new Random(0x6E624EB7u); + int min = -2147483648; + int max = 2147483647; + long range = (long)max - (long)min; + ks_test((() => (range_check(rnd.NextInt2(min, max).x, min, max) + 0.5 - min) / range), 256); + ks_test((() => (range_check(rnd.NextInt2(min, max).y, min, max) + 0.5 - min) / range), 256); + } + + [TestCompiler] + public static void int2_independent_low_bits() + { + var rnd = new Random(0x6E624EB7u); + r_test(() => (rnd.NextInt2().xy & 255)); + } + + [TestCompiler] + public static void int2_independent_high_bits() + { + var rnd = new Random(0x6E624EB7u); + r_test(() => ((uint2)rnd.NextInt2().xy >> 24)); + } + + [TestCompiler] + public static void int3_uniform_low_bits() + { + var rnd = new Random(0x6E624EB7u); + ks_test((() => ((rnd.NextInt3().x & 255u) + 0.5) / 256.0), 256); + ks_test((() => ((rnd.NextInt3().y & 255u) + 0.5) / 256.0), 256); + ks_test((() => ((rnd.NextInt3().z & 255u) + 0.5) / 256.0), 256); + } + + [TestCompiler] + public static void int3_uniform_high_bits() + { + var rnd = new Random(0x6E624EB7u); + ks_test((() => (((uint)rnd.NextInt3().x >> 24) + 0.5) / 256.0), 256); + ks_test((() => (((uint)rnd.NextInt3().y >> 24) + 0.5) / 256.0), 256); + ks_test((() => (((uint)rnd.NextInt3().z >> 24) + 0.5) / 256.0), 256); + } + + [TestCompiler] + public static void int3_uniform_max() + { + var rnd = new Random(0x6E624EB7u); + int3 max = int3(13, 17, 19); + ks_test((() => ((uint)range_check(rnd.NextInt3(max).x, 0, max.x) + 0.5) / max.x), max.x); + ks_test((() => ((uint)range_check(rnd.NextInt3(max).y, 0, max.y) + 0.5) / max.y), max.y); + ks_test((() => ((uint)range_check(rnd.NextInt3(max).z, 0, max.z) + 0.5) / max.z), max.z); + } + + [TestCompiler] + public static void int3_uniform_max_limit() + { + var rnd = new Random(0x6E624EB7u); + int max = 2147483647; + ks_test((() => ((uint)range_check(rnd.NextInt3(max).x, 0, max) + 0.5) / max), 256); + ks_test((() => ((uint)range_check(rnd.NextInt3(max).y, 0, max) + 0.5) / max), 256); + ks_test((() => ((uint)range_check(rnd.NextInt3(max).z, 0, max) + 0.5) / max), 256); + } + + [TestCompiler] + public static void int3_uniform_min_max() + { + var rnd = new Random(0x6E624EB7u); + int3 min = int3(-7, 3, -10); + int3 max = int3(17, 14, -3); + int3 range = max - min; + ks_test((() => (range_check(rnd.NextInt3(min, max).x, min.x, max.x) + 0.5 - min.x) / range.x), range.x); + ks_test((() => (range_check(rnd.NextInt3(min, max).y, min.y, max.y) + 0.5 - min.y) / range.y), range.y); + ks_test((() => (range_check(rnd.NextInt3(min, max).z, min.z, max.z) + 0.5 - min.z) / range.z), range.z); + } + + [TestCompiler] + public static void int3_uniform_min_max_limit() + { + var rnd = new Random(0x6E624EB7u); + int min = -2147483648; + int max = 2147483647; + long range = (long)max - (long)min; + ks_test((() => (range_check(rnd.NextInt3(min, max).x, min, max) + 0.5 - min) / range), 256); + ks_test((() => (range_check(rnd.NextInt3(min, max).y, min, max) + 0.5 - min) / range), 256); + ks_test((() => (range_check(rnd.NextInt3(min, max).z, min, max) + 0.5 - min) / range), 256); + } + + [TestCompiler] + public static void int3_independent_low_bits() + { + var rnd = new Random(0x6E624EB7u); + r_test(() => (rnd.NextInt3().xy & 255)); + r_test(() => (rnd.NextInt3().xz & 255)); + r_test(() => (rnd.NextInt3().yz & 255)); + } + + [TestCompiler] + public static void int3_independent_high_bits() + { + var rnd = new Random(0x6E624EB7u); + r_test(() => ((uint2)rnd.NextInt3().xy >> 24)); + r_test(() => ((uint2)rnd.NextInt3().xz >> 24)); + r_test(() => ((uint2)rnd.NextInt3().yz >> 24)); + } + + [TestCompiler] + public static void int4_uniform_low_bits() + { + var rnd = new Random(0x6E624EB7u); + ks_test((() => ((rnd.NextInt4().x & 255u) + 0.5) / 256.0), 256); + ks_test((() => ((rnd.NextInt4().y & 255u) + 0.5) / 256.0), 256); + ks_test((() => ((rnd.NextInt4().z & 255u) + 0.5) / 256.0), 256); + ks_test((() => ((rnd.NextInt4().w & 255u) + 0.5) / 256.0), 256); + } + + [TestCompiler] + public static void int4_uniform_high_bits() + { + var rnd = new Random(0x6E624EB7u); + ks_test((() => (((uint)rnd.NextInt4().x >> 24) + 0.5) / 256.0), 256); + ks_test((() => (((uint)rnd.NextInt4().y >> 24) + 0.5) / 256.0), 256); + ks_test((() => (((uint)rnd.NextInt4().z >> 24) + 0.5) / 256.0), 256); + ks_test((() => (((uint)rnd.NextInt4().w >> 24) + 0.5) / 256.0), 256); + } + + [TestCompiler] + public static void int4_uniform_max() + { + var rnd = new Random(0x6E624EB7u); + int4 max = int4(13, 17, 19, 23); + ks_test((() => (range_check(rnd.NextInt4(max).x, 0, max.x) + 0.5) / max.x), max.x); + ks_test((() => (range_check(rnd.NextInt4(max).y, 0, max.y) + 0.5) / max.y), max.y); + ks_test((() => (range_check(rnd.NextInt4(max).z, 0, max.z) + 0.5) / max.z), max.z); + ks_test((() => (range_check(rnd.NextInt4(max).w, 0, max.w) + 0.5) / max.w), max.w); + } + + [TestCompiler] + public static void int4_uniform_max_limit() + { + var rnd = new Random(0x6E624EB7u); + int max = 2147483647; + ks_test((() => (range_check(rnd.NextInt4(max).x, 0, max) + 0.5) / max), 256); + ks_test((() => (range_check(rnd.NextInt4(max).y, 0, max) + 0.5) / max), 256); + ks_test((() => (range_check(rnd.NextInt4(max).z, 0, max) + 0.5) / max), 256); + ks_test((() => (range_check(rnd.NextInt4(max).w, 0, max) + 0.5) / max), 256); + } + + [TestCompiler] + public static void int4_uniform_min_max() + { + var rnd = new Random(0x6E624EB7u); + int4 min = int4(-7, 3, -10, 1); + int4 max = int4(17, 14, -3, 111); + int4 range = max - min; + ks_test((() => (range_check(rnd.NextInt4(min, max).x, min.x, max.x) + 0.5 - min.x) / range.x), range.x); + ks_test((() => (range_check(rnd.NextInt4(min, max).y, min.y, max.y) + 0.5 - min.y) / range.y), range.y); + ks_test((() => (range_check(rnd.NextInt4(min, max).z, min.z, max.z) + 0.5 - min.z) / range.z), range.z); + ks_test((() => (range_check(rnd.NextInt4(min, max).w, min.w, max.w) + 0.5 - min.w) / range.w), range.w); + } + + [TestCompiler] + public static void int4_uniform_min_max_limit() + { + var rnd = new Random(0x6E624EB7u); + int min = -2147483648; + int max = 2147483647; + long range = (long)max - (long)min; + ks_test((() => (range_check(rnd.NextInt4(min, max).x, min, max) + 0.5 - min) / range), 256); + ks_test((() => (range_check(rnd.NextInt4(min, max).y, min, max) + 0.5 - min) / range), 256); + ks_test((() => (range_check(rnd.NextInt4(min, max).z, min, max) + 0.5 - min) / range), 256); + ks_test((() => (range_check(rnd.NextInt4(min, max).w, min, max) + 0.5 - min) / range), 256); + } + + [TestCompiler] + public static void int4_independent_low_bits() + { + var rnd = new Random(0x6E624EB7u); + r_test(() => (rnd.NextUInt4().xy & 255)); + r_test(() => (rnd.NextUInt4().xz & 255)); + r_test(() => (rnd.NextUInt4().xw & 255)); + r_test(() => (rnd.NextUInt4().yz & 255)); + r_test(() => (rnd.NextUInt4().yw & 255)); + r_test(() => (rnd.NextUInt4().zw & 255)); + } + + [TestCompiler] + public static void int4_independent_high_bits() + { + var rnd = new Random(0x6E624EB7u); + r_test(() => ((uint2)rnd.NextUInt4().xy >> 24)); + r_test(() => ((uint2)rnd.NextUInt4().xz >> 24)); + r_test(() => ((uint2)rnd.NextUInt4().xw >> 24)); + r_test(() => ((uint2)rnd.NextUInt4().yz >> 24)); + r_test(() => ((uint2)rnd.NextUInt4().yw >> 24)); + r_test(() => ((uint2)rnd.NextUInt4().zw >> 24)); + } + + + [TestCompiler] + public static void uint_uniform_low_bits() + { + var rnd = new Random(0x6E624EB7u); + ks_test((() => ((rnd.NextUInt() & 255u) + 0.5) / 256.0), 256); + } + + [TestCompiler] + public static void uint_uniform_high_bits() + { + var rnd = new Random(0x6E624EB7u); + ks_test((() => ((rnd.NextUInt() >> 24) + 0.5) / 256.0), 256); + } + + [TestCompiler] + public static void uint_uniform_max() + { + var rnd = new Random(0x6E624EB7u); + uint max = 17; + ks_test((() => (rnd.NextUInt(max) + 0.5) / max), (int)max); + } + + [TestCompiler] + public static void uint_uniform_max_limit() + { + var rnd = new Random(0x6E624EB7u); + uint max = 0xFFFFFFFF; + ks_test((() => (rnd.NextUInt(max) + 0.5) / max), 256); + } + + [TestCompiler] + public static void uint_uniform_min_max() + { + var rnd = new Random(0x6E624EB7u); + uint min = 3; + uint max = 17; + uint range = max - min; + ks_test((() => (range_check(rnd.NextUInt(min, max), min, max) + 0.5 - min) / range), (int)range); + } + + [TestCompiler] + public static void uint_uniform_min_max_limit() + { + var rnd = new Random(0x6E624EB7u); + uint max = 0xFFFFFFFF; + ks_test((() => (range_check(rnd.NextUInt(0, max), 0, max) + 0.5) / max), 256); + } + + [TestCompiler] + public static void uint2_uniform_low_bits() + { + var rnd = new Random(0x6E624EB7u); + ks_test((() => ((rnd.NextUInt2().x & 255u) + 0.5) / 256.0), 256); + ks_test((() => ((rnd.NextUInt2().y & 255u) + 0.5) / 256.0), 256); + } + + [TestCompiler] + public static void uint2_uniform_high_bits() + { + var rnd = new Random(0x6E624EB7u); + ks_test((() => ((rnd.NextUInt2().x >> 24) + 0.5) / 256.0), 256); + ks_test((() => ((rnd.NextUInt2().y >> 24) + 0.5) / 256.0), 256); + } + + [TestCompiler] + public static void uint2_uniform_max() + { + var rnd = new Random(0x6E624EB7u); + uint2 max = uint2(13, 17); + ks_test((() => (rnd.NextUInt2(max).x + 0.5) / max.x), (int)max.x); + ks_test((() => (rnd.NextUInt2(max).y + 0.5) / max.y), (int)max.y); + } + + [TestCompiler] + public static void uint2_uniform_max_limit() + { + var rnd = new Random(0x6E624EB7u); + uint max = 0xFFFFFFFF; + ks_test((() => (rnd.NextUInt2(max).x + 0.5) / max), 256); + ks_test((() => (rnd.NextUInt2(max).y + 0.5) / max), 256); + } + + [TestCompiler] + public static void uint2_uniform_min_max() + { + var rnd = new Random(0x6E624EB7u); + uint2 min = uint2(3, 101); + uint2 max = uint2(17, 117); + uint2 range = max - min; + ks_test((() => (range_check(rnd.NextUInt2(min, max).x, min.x, max.x) + 0.5 - min.x) / range.x), (int)range.x); + ks_test((() => (range_check(rnd.NextUInt2(min, max).y, min.y, max.y) + 0.5 - min.y) / range.y), (int)range.y); + } + + [TestCompiler] + public static void uint2_uniform_min_max_limit() + { + var rnd = new Random(0x6E624EB7u); + uint max = 0xFFFFFFFF; + ks_test((() => (range_check(rnd.NextUInt2(0, max).x, 0, max) + 0.5) / max), 256); + ks_test((() => (range_check(rnd.NextUInt2(0, max).y, 0, max) + 0.5) / max), 256); + } + + [TestCompiler] + public static void uint2_independent_low_bits() + { + var rnd = new Random(0x6E624EB7u); + r_test(() => (rnd.NextUInt2().xy & 255)); + } + + [TestCompiler] + public static void uint2_independent_high_bits() + { + var rnd = new Random(0x6E624EB7u); + r_test(() => (rnd.NextUInt2().xy >> 24)); + } + + [TestCompiler] + public static void uint3_uniform_low_bits() + { + var rnd = new Random(0x6E624EB7u); + ks_test((() => ((rnd.NextUInt3().x & 255u) + 0.5) / 256.0), 256); + ks_test((() => ((rnd.NextUInt3().y & 255u) + 0.5) / 256.0), 256); + ks_test((() => ((rnd.NextUInt3().z & 255u) + 0.5) / 256.0), 256); + } + + [TestCompiler] + public static void uint3_uniform_high_bits() + { + var rnd = new Random(0x6E624EB7u); + ks_test((() => ((rnd.NextUInt3().x >> 24) + 0.5) / 256.0), 256); + ks_test((() => ((rnd.NextUInt3().y >> 24) + 0.5) / 256.0), 256); + ks_test((() => ((rnd.NextUInt3().z >> 24) + 0.5) / 256.0), 256); + } + + [TestCompiler] + public static void uint3_uniform_max() + { + var rnd = new Random(0x6E624EB7u); + uint3 max = uint3(13, 17, 19); + ks_test((() => (rnd.NextUInt3(max).x + 0.5) / max.x), (int)max.x); + ks_test((() => (rnd.NextUInt3(max).y + 0.5) / max.y), (int)max.y); + ks_test((() => (rnd.NextUInt3(max).z + 0.5) / max.z), (int)max.z); + } + + [TestCompiler] + public static void uint3_uniform_max_limit() + { + var rnd = new Random(0x6E624EB7u); + uint max = 0xFFFFFFFF; + ks_test((() => (rnd.NextUInt3(max).x + 0.5) / max), 256); + ks_test((() => (rnd.NextUInt3(max).y + 0.5) / max), 256); + ks_test((() => (rnd.NextUInt3(max).z + 0.5) / max), 256); + } + + [TestCompiler] + public static void uint3_uniform_min_max() + { + var rnd = new Random(0x6E624EB7u); + uint3 min = uint3(3, 101, 0xFFFFFFF0); + uint3 max = uint3(17, 117, 0xFFFFFFFF); + uint3 range = max - min; + ks_test((() => (range_check(rnd.NextUInt3(min, max).x, min.x, max.x) + 0.5 - min.x) / range.x), (int)range.x); + ks_test((() => (range_check(rnd.NextUInt3(min, max).y, min.y, max.y) + 0.5 - min.y) / range.y), (int)range.y); + ks_test((() => (range_check(rnd.NextUInt3(min, max).z, min.z, max.z) + 0.5 - min.z) / range.z), (int)range.z); + } + + [TestCompiler] + public static void uint3_uniform_min_max_limit() + { + var rnd = new Random(0x6E624EB7u); + uint max = 0xFFFFFFFF; + ks_test((() => (range_check(rnd.NextUInt3(0, max).x, 0, max) + 0.5) / max), 256); + ks_test((() => (range_check(rnd.NextUInt3(0, max).y, 0, max) + 0.5) / max), 256); + ks_test((() => (range_check(rnd.NextUInt3(0, max).z, 0, max) + 0.5) / max), 256); + } + + [TestCompiler] + public static void uint3_independent_low_bits() + { + var rnd = new Random(0x6E624EB7u); + r_test(() => (rnd.NextUInt3().xy & 255)); + r_test(() => (rnd.NextUInt3().xz & 255)); + r_test(() => (rnd.NextUInt3().yz & 255)); + } + + [TestCompiler] + public static void uint3_independent_high_bits() + { + var rnd = new Random(0x6E624EB7u); + r_test(() => (rnd.NextUInt3().xy >> 24)); + r_test(() => (rnd.NextUInt3().xz >> 24)); + r_test(() => (rnd.NextUInt3().yz >> 24)); + } + + [TestCompiler] + public static void uint4_uniform_low_bits() + { + var rnd = new Random(0x6E624EB7u); + ks_test((() => ((rnd.NextUInt4().x & 255u) + 0.5) / 256.0), 256); + ks_test((() => ((rnd.NextUInt4().y & 255u) + 0.5) / 256.0), 256); + ks_test((() => ((rnd.NextUInt4().z & 255u) + 0.5) / 256.0), 256); + ks_test((() => ((rnd.NextUInt4().w & 255u) + 0.5) / 256.0), 256); + } + + [TestCompiler] + public static void uint4_uniform_high_bits() + { + var rnd = new Random(0x6E624EB7u); + ks_test((() => ((rnd.NextUInt4().x >> 24) + 0.5) / 256.0), 256); + ks_test((() => ((rnd.NextUInt4().y >> 24) + 0.5) / 256.0), 256); + ks_test((() => ((rnd.NextUInt4().z >> 24) + 0.5) / 256.0), 256); + ks_test((() => ((rnd.NextUInt4().w >> 24) + 0.5) / 256.0), 256); + } + + [TestCompiler] + public static void uint4_uniform_max() + { + var rnd = new Random(0x6E624EB7u); + uint4 max = uint4(13, 17, 19, 23); + ks_test((() => (rnd.NextUInt4(max).x + 0.5) / max.x), (int)max.x); + ks_test((() => (rnd.NextUInt4(max).y + 0.5) / max.y), (int)max.y); + ks_test((() => (rnd.NextUInt4(max).z + 0.5) / max.z), (int)max.z); + ks_test((() => (rnd.NextUInt4(max).w + 0.5) / max.w), (int)max.w); + } + + [TestCompiler] + public static void uint4_uniform_max_limit() + { + var rnd = new Random(0x6E624EB7u); + uint max = 0xFFFFFFFF; + ks_test((() => (rnd.NextUInt4(max).x + 0.5) / max), 256); + ks_test((() => (rnd.NextUInt4(max).y + 0.5) / max), 256); + ks_test((() => (rnd.NextUInt4(max).z + 0.5) / max), 256); + ks_test((() => (rnd.NextUInt4(max).w + 0.5) / max), 256); + } + + [TestCompiler] + public static void uint4_uniform_min_max() + { + var rnd = new Random(0x6E624EB7u); + uint4 min = uint4(3, 101, 0xFFFFFFF0, 100); + uint4 max = uint4(17, 117, 0xFFFFFFFF, 1000); + uint4 range = max - min; + ks_test((() => (range_check(rnd.NextUInt4(min, max).x, min.x, max.x) + 0.5 - min.x) / range.x), (int)range.x); + ks_test((() => (range_check(rnd.NextUInt4(min, max).y, min.y, max.y) + 0.5 - min.y) / range.y), (int)range.y); + ks_test((() => (range_check(rnd.NextUInt4(min, max).z, min.z, max.z) + 0.5 - min.z) / range.z), (int)range.z); + ks_test((() => (range_check(rnd.NextUInt4(min, max).w, min.w, max.w) + 0.5 - min.w) / range.w), (int)range.w); + } + + [TestCompiler] + public static void uint4_uniform_min_max_limit() + { + var rnd = new Random(0x6E624EB7u); + uint max = 0xFFFFFFFF; + ks_test((() => (range_check(rnd.NextUInt4(0, max).x, 0, max) + 0.5) / max), 256); + ks_test((() => (range_check(rnd.NextUInt4(0, max).y, 0, max) + 0.5) / max), 256); + ks_test((() => (range_check(rnd.NextUInt4(0, max).z, 0, max) + 0.5) / max), 256); + ks_test((() => (range_check(rnd.NextUInt4(0, max).w, 0, max) + 0.5) / max), 256); + } + + [TestCompiler] + public static void uint4_independent_low_bits() + { + var rnd = new Random(0x6E624EB7u); + r_test(() => (rnd.NextUInt4().xy & 255)); + r_test(() => (rnd.NextUInt4().xz & 255)); + r_test(() => (rnd.NextUInt4().xw & 255)); + r_test(() => (rnd.NextUInt4().yz & 255)); + r_test(() => (rnd.NextUInt4().yw & 255)); + r_test(() => (rnd.NextUInt4().zw & 255)); + } + + [TestCompiler] + public static void uint4_independent_high_bits() + { + var rnd = new Random(0x6E624EB7u); + r_test(() => (rnd.NextUInt4().xy >> 24)); + r_test(() => (rnd.NextUInt4().xz >> 24)); + r_test(() => (rnd.NextUInt4().xw >> 24)); + r_test(() => (rnd.NextUInt4().yz >> 24)); + r_test(() => (rnd.NextUInt4().yw >> 24)); + r_test(() => (rnd.NextUInt4().zw >> 24)); + } + + [TestCompiler] + public static void float_uniform() + { + var rnd = new Random(0x6E624EB7u); + ks_test((() => range_check01(rnd.NextFloat()))); + } + + [TestCompiler] + public static void float_uniform_low_bits() + { + var rnd = new Random(0x6E624EB7u); + ks_test((() => frac(rnd.NextFloat() * 65536.0f))); + } + + [TestCompiler] + public static void float_uniform_max() + { + var rnd = new Random(0x6E624EB7u); + float max = 16.4f; + ks_test((() => range_check(rnd.NextFloat(max), 0.0f, max) / max)); + } + + [TestCompiler] + public static void float_uniform_min_max() + { + var rnd = new Random(0x6E624EB7u); + float min = -3.1f; + float max = 16.4f; + float range = max - min; + ks_test((() => (range_check(rnd.NextFloat(min, max), min, max) -min) / range)); + } + + [TestCompiler] + public static void float2_uniform() + { + var rnd = new Random(0x6E624EB7u); + ks_test((() => range_check01(rnd.NextFloat2().x))); + ks_test((() => range_check01(rnd.NextFloat2().y))); + } + + [TestCompiler] + public static void float2_uniform_low_bits() + { + var rnd = new Random(0x6E624EB7u); + ks_test((() => frac(rnd.NextFloat2().x * 65536.0f))); + ks_test((() => frac(rnd.NextFloat2().y * 65536.0f))); + } + + [TestCompiler] + public static void float2_uniform_max() + { + var rnd = new Random(0x6E624EB7u); + float2 max = float2(16.4f, 1001.33333333f); + ks_test((() => range_check(rnd.NextFloat2(max).x, 0.0f, max.x) / max.x)); + ks_test((() => range_check(rnd.NextFloat2(max).y, 0.0f, max.y) / max.y)); + } + + [TestCompiler] + public static void float2_uniform_min_max() + { + var rnd = new Random(0x6E624EB7u); + float2 min = float2(-3.1f, 17.1f); + float2 max = float2(16.4f, 1001.33333333f); + float2 range = max - min; + ks_test((() => (range_check(rnd.NextFloat2(min, max).x, min.x, max.x) - min.x) / range.x)); + ks_test((() => (range_check(rnd.NextFloat2(min, max).y, min.y, max.y) - min.y) / range.y)); + } + + [TestCompiler] + public static void float2_independent() + { + var rnd = new Random(0x6E624EB7u); + r_test((() => rnd.NextFloat2())); + } + + [TestCompiler] + public static void float3_uniform() + { + var rnd = new Random(0x6E624EB7u); + ks_test((() => range_check01(rnd.NextFloat3().x))); + ks_test((() => range_check01(rnd.NextFloat3().y))); + ks_test((() => range_check01(rnd.NextFloat3().z))); + } + + [TestCompiler] + public static void float3_uniform_low_bits() + { + var rnd = new Random(0x6E624EB7u); + ks_test((() => frac(rnd.NextFloat3().x * 65536.0f))); + ks_test((() => frac(rnd.NextFloat3().y * 65536.0f))); + ks_test((() => frac(rnd.NextFloat3().z * 65536.0f))); + } + + [TestCompiler] + public static void float3_uniform_max() + { + var rnd = new Random(0x6E624EB7u); + float3 max = float3(16.4f, 1001.33333333f, 3.121f); + ks_test((() => range_check(rnd.NextFloat3(max).x, 0.0f, max.x) / max.x)); + ks_test((() => range_check(rnd.NextFloat3(max).y, 0.0f, max.y) / max.y)); + ks_test((() => range_check(rnd.NextFloat3(max).z, 0.0f, max.z) / max.z)); + } + + [TestCompiler] + public static void float3_uniform_min_max() + { + var rnd = new Random(0x6E624EB7u); + float3 min = float3(-3.1f, 17.1f, -0.3f); + float3 max = float3(16.4f, 1001.33333333f, 3.121f); + float3 range = max - min; + ks_test((() => (range_check(rnd.NextFloat3(min, max).x, min.x, max.x) - min.x) / range.x)); + ks_test((() => (range_check(rnd.NextFloat3(min, max).y, min.y, max.y) - min.y) / range.y)); + ks_test((() => (range_check(rnd.NextFloat3(min, max).z, min.z, max.z) - min.z) / range.z)); + } + + [TestCompiler] + public static void float3_independent() + { + var rnd = new Random(0x6E624EB7u); + r_test((() => rnd.NextFloat3().xy)); + r_test((() => rnd.NextFloat3().xz)); + r_test((() => rnd.NextFloat3().yz)); + } + + [TestCompiler] + public static void float4_uniform() + { + var rnd = new Random(0x6E624EB7u); + ks_test((() => range_check01(rnd.NextFloat4().x))); + ks_test((() => range_check01(rnd.NextFloat4().y))); + ks_test((() => range_check01(rnd.NextFloat4().z))); + ks_test((() => range_check01(rnd.NextFloat4().w))); + } + + [TestCompiler] + public static void float4_uniform_low_bits() + { + var rnd = new Random(0x6E624EB7u); + ks_test((() => frac(rnd.NextFloat4().x * 65536.0f))); + ks_test((() => frac(rnd.NextFloat4().y * 65536.0f))); + ks_test((() => frac(rnd.NextFloat4().z * 65536.0f))); + ks_test((() => frac(rnd.NextFloat4().w * 65536.0f))); + } + + [TestCompiler] + public static void float4_uniform_max() + { + var rnd = new Random(0x6E624EB7u); + float4 max = float4(16.4f, 1001.33333333f, 3.121f, 1.3232e23f); + ks_test((() => range_check(rnd.NextFloat4(max).x, 0.0f, max.x) / max.x)); + ks_test((() => range_check(rnd.NextFloat4(max).y, 0.0f, max.y) / max.y)); + ks_test((() => range_check(rnd.NextFloat4(max).z, 0.0f, max.z) / max.z)); + ks_test((() => range_check(rnd.NextFloat4(max).w, 0.0f, max.w) / max.w)); + } + + [TestCompiler] + public static void float4_uniform_min_max() + { + var rnd = new Random(0x6E624EB7u); + float4 min = float4(-3.1f, 17.1f, -0.3f, -22.6f); + float4 max = float4(16.4f, 1001.33333333f, 3.121f, 1.3232e23f); + float4 range = max - min; + ks_test((() => (range_check(rnd.NextFloat4(min, max).x, min.x, max.x) - min.x) / range.x)); + ks_test((() => (range_check(rnd.NextFloat4(min, max).y, min.y, max.y) - min.y) / range.y)); + ks_test((() => (range_check(rnd.NextFloat4(min, max).z, min.z, max.z) - min.z) / range.z)); + ks_test((() => (range_check(rnd.NextFloat4(min, max).w, min.w, max.w) - min.w) / range.w)); + } + + [TestCompiler] + public static void float4_independent() + { + var rnd = new Random(0x6E624EB7u); + r_test((() => rnd.NextFloat4().xy)); + r_test((() => rnd.NextFloat4().xz)); + r_test((() => rnd.NextFloat4().xw)); + r_test((() => rnd.NextFloat4().yz)); + r_test((() => rnd.NextFloat4().yw)); + r_test((() => rnd.NextFloat4().zw)); + } + + [TestCompiler] + public static void double_uniform() + { + var rnd = new Random(0x6E624EB7u); + ks_test((() => range_check01(rnd.NextDouble()))); + } + + [TestCompiler] + public static void double_uniform_low_bits() + { + var rnd = new Random(0x6E624EB7u); + ks_test((() => frac(rnd.NextDouble() * 35184372088832.0))); + } + + [TestCompiler] + public static void double_uniform_max() + { + var rnd = new Random(0x6E624EB7u); + double max = 16.4; + ks_test((() => range_check(rnd.NextDouble(max), 0.0, max) / max)); + } + + [TestCompiler] + public static void double_uniform_min_max() + { + var rnd = new Random(0x6E624EB7u); + double min = -3.1; + double max = 16.4; + double range = max - min; + ks_test((() => (range_check(rnd.NextDouble(min, max), min, max) - min) / range)); + } + + [TestCompiler] + public static void double2_uniform() + { + var rnd = new Random(0x6E624EB7u); + ks_test((() => range_check01(rnd.NextDouble2().x))); + ks_test((() => range_check01(rnd.NextDouble2().y))); + } + + [TestCompiler] + public static void double2_uniform_low_bits() + { + var rnd = new Random(0x6E624EB7u); + ks_test((() => frac(rnd.NextDouble2().x * 35184372088832.0))); + ks_test((() => frac(rnd.NextDouble2().y * 35184372088832.0))); + } + + [TestCompiler] + public static void double2_uniform_max() + { + var rnd = new Random(0x6E624EB7u); + double2 max = double2(16.4, 1001.33333333); + ks_test((() => range_check(rnd.NextDouble2(max).x, 0.0, max.x) / max.x)); + ks_test((() => range_check(rnd.NextDouble2(max).y, 0.0, max.y) / max.y)); + } + + [TestCompiler] + public static void double2_uniform_min_max() + { + var rnd = new Random(0x6E624EB7u); + double2 min = double2(-3.1, 17.1); + double2 max = double2(16.4, 1001.33333333); + double2 range = max - min; + ks_test((() => (range_check(rnd.NextDouble2(min, max).x, min.x, max.x) - min.x) / range.x)); + ks_test((() => (range_check(rnd.NextDouble2(min, max).y, min.y, max.y) - min.y) / range.y)); + } + + [TestCompiler] + public static void double2_independent() + { + var rnd = new Random(0x6E624EB7u); + r_test((() => rnd.NextDouble2())); + } + + [TestCompiler] + public static void double3_uniform() + { + var rnd = new Random(0x6E624EB7u); + ks_test((() => range_check01(rnd.NextDouble3().x))); + ks_test((() => range_check01(rnd.NextDouble3().y))); + ks_test((() => range_check01(rnd.NextDouble3().z))); + } + + [TestCompiler] + public static void double3_uniform_low_bits() + { + var rnd = new Random(0x6E624EB7u); + ks_test((() => frac(rnd.NextDouble3().x * 35184372088832.0))); + ks_test((() => frac(rnd.NextDouble3().y * 35184372088832.0))); + ks_test((() => frac(rnd.NextDouble3().z * 35184372088832.0))); + } + + [TestCompiler] + public static void double3_uniform_max() + { + var rnd = new Random(0x6E624EB7u); + double3 max = double3(16.4, 1001.33333333, 3.121); + ks_test((() => range_check(rnd.NextDouble3(max).x, 0.0, max.x) / max.x)); + ks_test((() => range_check(rnd.NextDouble3(max).y, 0.0, max.y) / max.y)); + ks_test((() => range_check(rnd.NextDouble3(max).z, 0.0, max.z) / max.z)); + } + + [TestCompiler] + public static void double3_uniform_min_max() + { + var rnd = new Random(0x6E624EB7u); + double3 min = double3(-3.1, 17.1, -0.3); + double3 max = double3(16.4, 1001.33333333, 3.121); + double3 range = max - min; + ks_test((() => (range_check(rnd.NextDouble3(min, max).x, min.x, max.x) - min.x) / range.x)); + ks_test((() => (range_check(rnd.NextDouble3(min, max).y, min.y, max.y) - min.y) / range.y)); + ks_test((() => (range_check(rnd.NextDouble3(min, max).z, min.z, max.z) - min.z) / range.z)); + } + + + [TestCompiler] + public static void double3_independent() + { + var rnd = new Random(0x6E624EB7u); + r_test((() => rnd.NextDouble3().xy)); + r_test((() => rnd.NextDouble3().xz)); + r_test((() => rnd.NextDouble3().yz)); + } + + [TestCompiler] + public static void double4_uniform() + { + var rnd = new Random(0x6E624EB7u); + ks_test((() => range_check01(rnd.NextDouble4().x))); + ks_test((() => range_check01(rnd.NextDouble4().y))); + ks_test((() => range_check01(rnd.NextDouble4().z))); + ks_test((() => range_check01(rnd.NextDouble4().w))); + } + + [TestCompiler] + public static void double4_uniform_low_bits() + { + var rnd = new Random(0x6E624EB7u); + ks_test((() => frac(rnd.NextDouble4().x * 35184372088832.0))); + ks_test((() => frac(rnd.NextDouble4().y * 35184372088832.0))); + ks_test((() => frac(rnd.NextDouble4().z * 35184372088832.0))); + ks_test((() => frac(rnd.NextDouble4().w * 35184372088832.0))); + } + + [TestCompiler] + public static void double4_uniform_max() + { + var rnd = new Random(0x6E624EB7u); + double4 max = double4(16.4f, 1001.33333333f, 3.121f, 1.3232e23f); + ks_test((() => range_check(rnd.NextDouble4(max).x, 0.0, max.x) / max.x)); + ks_test((() => range_check(rnd.NextDouble4(max).y, 0.0, max.y) / max.y)); + ks_test((() => range_check(rnd.NextDouble4(max).z, 0.0, max.z) / max.z)); + ks_test((() => range_check(rnd.NextDouble4(max).w, 0.0, max.w) / max.w)); + } + + [TestCompiler] + public static void double4_uniform_min_max() + { + var rnd = new Random(0x6E624EB7u); + double4 min = double4(-3.1, 17.1, -0.3, -22.6); + double4 max = double4(16.4, 1001.33333333, 3.121, 1.3232e23); + double4 range = max - min; + ks_test((() => (range_check(rnd.NextDouble4(min, max).x, min.x, max.x) - min.x) / range.x)); + ks_test((() => (range_check(rnd.NextDouble4(min, max).y, min.y, max.y) - min.y) / range.y)); + ks_test((() => (range_check(rnd.NextDouble4(min, max).z, min.z, max.z) - min.z) / range.z)); + ks_test((() => (range_check(rnd.NextDouble4(min, max).w, min.w, max.w) - min.w) / range.w)); + } + + [TestCompiler] + public static void double4_independent() + { + var rnd = new Random(0x6E624EB7u); + r_test((() => rnd.NextDouble4().xy)); + r_test((() => rnd.NextDouble4().xz)); + r_test((() => rnd.NextDouble4().xw)); + r_test((() => rnd.NextDouble4().yz)); + r_test((() => rnd.NextDouble4().yw)); + r_test((() => rnd.NextDouble4().zw)); + } + + [TestCompiler] + public static void float2_direction() + { + var rnd = new Random(0x6E624EB7u); + ks_test(() => { + float2 dir = rnd.NextFloat2Direction(); + TestUtils.AreEqual(length(dir), 1.0f, 0.001f); + return atan2(dir.x, dir.y) / (2.0f * PI) + 0.5f; + }); + } + + [TestCompiler] + public static void double2_direction() + { + var rnd = new Random(0x6E624EB7u); + ks_test(() => { + double2 dir = rnd.NextFloat2Direction(); + TestUtils.AreEqual(length(dir), 1.0, 0.000001); + return atan2(dir.y, dir.x) / (2.0 * PI_DBL) + 0.5; + }); + } + + + [TestCompiler] + public static void float3_direction() + { + var rnd = new Random(0x6E624EB7u); + ks_test(() => + { + float3 dir = rnd.NextFloat3Direction(); + float r = length(dir); + TestUtils.AreEqual(r, 1.0f, 0.001f); + + float phi = atan2(dir.y, dir.x) / (2.0f * PI) + 0.5f; + float z = saturate(dir.z / r * 0.5f + 0.5f); + return double2(phi, z); + }); + } + + [TestCompiler] + public static void double3_direction() + { + var rnd = new Random(0x6E624EB7u); + ks_test(() => + { + double3 dir = rnd.NextDouble3Direction(); + double r = length(dir); + TestUtils.AreEqual(r, 1.0, 0.00001); + + double phi = atan2(dir.y, dir.x) / (2.0 * PI_DBL) + 0.5; + double z = saturate(dir.z / r * 0.5 + 0.5); + return double2(phi, z); + }); + } + + [TestCompiler] + public static void quaternion_rotation() + { + var rnd = new Random(0x6E624EB7u); + ks_test(() => + { + quaternion q = rnd.NextQuaternionRotation(); + TestUtils.AreEqual(dot(q, q), 1.0, 0.00001f); + Assert.GreaterOrEqual(q.value.w, 0.0f); + float3 p = float3(1.0f, 2.0f, 3.0f); + + float3 qp = mul(q, p); + + TestUtils.AreEqual(length(qp), length(p), 0.0001f); + float r = length(qp); + + double phi = atan2(qp.y, qp.x) / (2.0 * PI_DBL) + 0.5; + double z = saturate(qp.z / r * 0.5 + 0.5); + return double2(phi, z); + }); + } + + [TestCompiler] + public static void consecutive_seeds_r_test() + { + // Check that drawing 1 number from many consecutive seeds has no correlation. + for (uint i = 0; i < 128; ++i) + { + uint seed1 = i; + uint seed2 = i + 1; + r_test(() => new double2(Random.CreateFromIndex(seed1++).NextUInt(), Random.CreateFromIndex(seed2++).NextUInt())); + } + } + + [TestCompiler] + public static void consecutive_seeds_r_test2() + { + // Check that drawing 1 number from many consecutive seeds has no correlation. + for (uint i = 0; i < 128; ++i) + { + uint seed1 = 0x6E624EB7u + i; + uint seed2 = 0x6E624EB8u + i; + r_test(() => new double2(Random.CreateFromIndex(seed1++).NextUInt(), Random.CreateFromIndex(seed2++).NextUInt())); + } + } + + [TestCompiler] + public static void consecutive_seeds_ks_test() + { + // Check that drawing 1 number from many consecutive seeds matches our expected distribution. + uint seed = 0; + ks_test(() => Random.CreateFromIndex(seed++).NextDouble()); + } + + [TestCompiler] + public static void consecutive_seeds_ks_test2() + { + // Check that drawing 1 number from many consecutive seeds matches our expected distribution. + uint seed = 0x6E624EB7u; + ks_test(() => Random.CreateFromIndex(seed++).NextDouble()); + } + + [TestCompiler] + public static void similar_seeds() + { + // Check to see that two consecutive seeds have no correlation when drawing + // many numbers from them. + for (uint i = 1; i <= 1024; ++i) + { + var rnd1 = new Random(i); + var rnd2 = new Random(i + 1); + r_test(() => new double2(rnd1.NextUInt(), rnd2.NextUInt())); + } + } + + [TestCompiler] + public static void similar_seeds2() + { + // Check to see that two consecutive seeds have no correlation when drawing + // many numbers from them. + for (uint i = 0; i < 1024; ++i) + { + var rnd1 = new Random(0x6E624EB7u + i); + var rnd2 = new Random(0x6E624EB8u + i); + r_test(() => new double2(rnd1.NextUInt(), rnd2.NextUInt())); + } + } + + [TestCompiler] + public static void wang_hash() + { + TestUtils.AreEqual(3232319850u, Random.WangHash(0u)); + TestUtils.AreEqual(663891101u, Random.WangHash(1u)); + TestUtils.AreEqual(3329832309u, Random.WangHash(2u)); + TestUtils.AreEqual(2278584254u, Random.WangHash(3u)); + TestUtils.AreEqual(3427349084u, Random.WangHash(4u)); + TestUtils.AreEqual(3322605197u, Random.WangHash(5u)); + TestUtils.AreEqual(1902946834u, Random.WangHash(6u)); + TestUtils.AreEqual(851741419u, Random.WangHash(7u)); + TestUtils.AreEqual(0u, Random.WangHash(61u)); + + unchecked + { + // Random.CreateFromIndex() takes zero as a valid input and makes uint.MaxValue invalid + // so check that we can make uint.MaxValue hash to zero. + TestUtils.AreEqual(0u, Random.WangHash(uint.MaxValue + 62u)); + } + } + } +} diff --git a/src/Tests/Tests/TestRandom.cs.meta b/src/Tests/Tests/TestRandom.cs.meta new file mode 100644 index 00000000..6578db1a --- /dev/null +++ b/src/Tests/Tests/TestRandom.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ec2e0d8c659a52a45b0bd4f7a3d3981a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/Unity.Mathematics.Tests.asmdef b/src/Tests/Unity.Mathematics.Tests.asmdef new file mode 100644 index 00000000..29a41728 --- /dev/null +++ b/src/Tests/Unity.Mathematics.Tests.asmdef @@ -0,0 +1,21 @@ +{ + "name": "Unity.Mathematics.Tests", + "rootNamespace": "", + "references": [ + "Unity.Mathematics", + "UnityEngine.TestRunner" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": true, + "overrideReferences": true, + "precompiledReferences": [ + "nunit.framework.dll" + ], + "autoReferenced": false, + "defineConstraints": [ + "UNITY_INCLUDE_TESTS" + ], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/src/Unity.Mathematics.Tests/Unity.Mathematics.Tests.asmdef.meta b/src/Tests/Unity.Mathematics.Tests.asmdef.meta similarity index 100% rename from src/Unity.Mathematics.Tests/Unity.Mathematics.Tests.asmdef.meta rename to src/Tests/Unity.Mathematics.Tests.asmdef.meta diff --git a/src/Tests/Unity.Mathematics.Tests.csproj b/src/Tests/Unity.Mathematics.Tests.csproj new file mode 100644 index 00000000..db3c9463 --- /dev/null +++ b/src/Tests/Unity.Mathematics.Tests.csproj @@ -0,0 +1,148 @@ + + + + + Debug + AnyCPU + {2E7C74D3-42F1-482F-8BB7-E199D9E3B412} + Library + Properties + Unity.Mathematics.Tests + Unity.Mathematics.Tests + v4.7.1 + 512 + + latest + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + true + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + + + + ..\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll + True + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {19810344-7387-4155-935f-bdd5cc61f0bf} + Unity.Mathematics + + + + + + + + diff --git a/src/Tests/Unity.Mathematics.Tests.csproj.meta b/src/Tests/Unity.Mathematics.Tests.csproj.meta new file mode 100644 index 00000000..24e5c128 --- /dev/null +++ b/src/Tests/Unity.Mathematics.Tests.csproj.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e393530e16da0c6498af8f6417806c74 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Tests/packages.config b/src/Tests/packages.config new file mode 100644 index 00000000..49bcd55f --- /dev/null +++ b/src/Tests/packages.config @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/Tests/packages.config.meta b/src/Tests/packages.config.meta new file mode 100644 index 00000000..39de042f --- /dev/null +++ b/src/Tests/packages.config.meta @@ -0,0 +1,32 @@ +fileFormatVersion: 2 +guid: 8074767eaca25dd4a83d4d4e0a6d4231 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 1 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics.CodeGen/VectorGenerator.cs b/src/Unity.Mathematics.CodeGen/VectorGenerator.cs deleted file mode 100644 index c282f824..00000000 --- a/src/Unity.Mathematics.CodeGen/VectorGenerator.cs +++ /dev/null @@ -1,456 +0,0 @@ -using System; -using System.Text; - -namespace Unity.Mathematics.Mathematics.CodeGen -{ - class VectorGenerator - { - string[] m_Types; - private GeneratorJob m_Job; - - [Flags] - private enum Features - { - Arithmetic = 1 << 0, - Shifts = 1 << 1, - BitwiseLogic = 1 << 2, - BitwiseComplement = 1 << 3, - UnaryNegation = 1 << 4, - All = Arithmetic | Shifts | BitwiseLogic | BitwiseComplement | UnaryNegation - } - - static readonly string[] floatTypes = { "float", "float2", "float3", "float4" }; - static readonly string[] intTypes = { "int", "int2", "int3", "int4" }; - static readonly string[] uintTypes = { "uint", "uint2", "uint3", "uint4" }; - static readonly string[] boolTypes = { "bool", "bool2", "bool3", "bool4" }; - static readonly string[] components = { "x", "y", "z", "w" }; - static readonly string[] fields = { "x", "y", "z", "w" }; - - private struct GeneratorJob - { - public Features features; - public string[] typeNames; - public string indexOperatorReturnType; - } - - private static readonly GeneratorJob[] s_Jobs = new[] - { - new GeneratorJob { indexOperatorReturnType = "float", typeNames = floatTypes, features = Features.Arithmetic | Features.UnaryNegation }, - new GeneratorJob { indexOperatorReturnType = "int", typeNames = intTypes, features = Features.All }, - new GeneratorJob { indexOperatorReturnType = "uint", typeNames = uintTypes, features = Features.All & ~Features.UnaryNegation }, - new GeneratorJob { indexOperatorReturnType = "bool1", typeNames = boolTypes, features = Features.BitwiseLogic }, - }; - - private VectorGenerator(GeneratorJob job) - { - m_Job = job; - m_Types = m_Job.typeNames; - } - - public static void Write(string dir) - { - foreach (GeneratorJob job in s_Jobs) - { - var typeNames = job.typeNames; - for (int i = 1; i < typeNames.Length; i++) - { - StringBuilder builder = new StringBuilder(); - VectorGenerator gen = new VectorGenerator(job); - - gen.Generate(i + 1, builder); - - var text = builder.ToString(); - // Convert all tabs to spaces - text = text.Replace("\t", " "); - // Convert all EOL to platform EOL - text = text.Replace("\n", Environment.NewLine); - - System.IO.File.WriteAllText(dir + "/" + typeNames[i] + ".gen.cs", text); - - } - } - } - - - - public void Generate(int count, StringBuilder str) - { - str.Append("// GENERATED CODE\n"); - str.Append("using System.Runtime.CompilerServices;\n"); - str.Append("#pragma warning disable 0660, 0661\n"); - str.Append("namespace Unity.Mathematics\n"); - str.Append("{\n"); - str.AppendFormat("\tpublic partial struct {0} : System.IEquatable<{0}>\n", m_Types[count - 1]); - str.Append("\t{\n"); - - GenerateOperators(count, str); - GenerateSwizzles(count, str); - - str.Append("\t}\n"); - str.Append("}\n"); - } - - public void GenerateOperators(int count, StringBuilder str) - { - string resultType = m_Types[count - 1]; - string resultBoolType = boolTypes[count - 1]; - - if (0 != (m_Job.features & Features.Arithmetic)) - { - str.Append("\n\t\t// mul\n"); - GenerateBinaryOperator(count, "*", count, resultType, str); - - str.Append("\n\t\t// add\n"); - GenerateBinaryOperator(count, "+", count, resultType, str); - - str.Append("\n\t\t// sub\n"); - GenerateBinaryOperator(count, "-", count, resultType, str); - - str.Append("\n\t\t// div\n"); - GenerateBinaryOperator(count, "/", count, resultType, str); - - str.Append("\n\t\t// smaller \n"); - GenerateBinaryOperator(count, "<", count, resultBoolType, str); - GenerateBinaryOperator(count, "<=", count, resultBoolType, str); - - str.Append("\n\t\t// greater \n"); - GenerateBinaryOperator(count, ">", count, resultBoolType, str); - GenerateBinaryOperator(count, ">=", count, resultBoolType, str); - } - - if (0 != (m_Job.features & Features.UnaryNegation)) - { - str.Append("\n\t\t// neg \n"); - GenerateUnaryOperator(count, "-", str); - - str.Append("\n\t\t// plus \n"); - GenerateUnaryOperator(count, "+", str); - } - - if (0 != (m_Job.features & Features.Shifts)) - { - str.Append("\n\t\t// left shift\n"); - GenerateShiftOperator(count, "<<", count, resultType, str); - - str.Append("\n\t\t// right shift\n"); - GenerateShiftOperator(count, ">>", count, resultType, str); - } - - str.Append("\n\t\t// equal \n"); - GenerateBinaryOperator(count, "==", count, resultBoolType, str); - - - str.Append("\n\t\t// not equal \n"); - GenerateBinaryOperator(count, "!=", count, resultBoolType, str); - - str.Append("\n\t\t// Equals \n"); - GenerateEquals(count, resultType, str); - - str.Append("\n\t\t// [int index] \n"); - GenerateIndexOperator(count, resultType, m_Job.indexOperatorReturnType, str); - - if (0 != (m_Job.features & Features.BitwiseLogic)) - { - string[] binaryOps = { "&", "|", "^" }; - foreach (string binOp in binaryOps) - { - str.AppendFormat("\n\t\t// operator {0}\n", binOp); - GenerateBinaryOperator(count, binOp, count, resultType, str); - } - - } - - if (0 != (m_Job.features & Features.BitwiseComplement)) - { - str.Append("\n\t\t// operator ~ \n"); - GenerateUnaryOperator(count, "~", str); - } - } - - void GenerateBinaryOperator(int count, string op, int resultCount, string resultType, StringBuilder str) - { - GenerateBinaryOperator(count - 1, count - 1, op, resultCount, resultType, str); - GenerateBinaryOperatorScalarRhs(count, op, resultCount, resultType, str); - GenerateBinaryOperator(0, count - 1, op, resultCount, resultType, str); - } - - void GenerateBinaryOperatorScalarRhs(int count, string op, int resultCount, string resultType, StringBuilder str) - { - GenerateBinaryOperator(count - 1, 0, op, resultCount, resultType, str); - } - - void GenerateBinaryOperator(int lhsTypeIndex, int rhsTypeIndex, string op, int resultCount, string resultType, StringBuilder str) - { - str.Append("\t\t[MethodImpl(0x100)]\n"); - str.AppendFormat("\t\tpublic static {0} operator {1} ({2} lhs, {3} rhs)", resultType, op, m_Types[lhsTypeIndex], m_Types[rhsTypeIndex]); - str.Append(" { "); - str.AppendFormat("return new {0} (", resultType); - - for (int i = 0; i < resultCount; i++) - { - if (lhsTypeIndex == 0) - { - int rhsIndex = i; - str.AppendFormat("lhs {1} rhs.{0}", fields[rhsIndex], op); - if (i != resultCount - 1) - str.Append(", "); - } - else if (rhsTypeIndex == 0) - { - int lhsIndex = i; - str.AppendFormat("lhs.{0} {1} rhs", fields[lhsIndex], op); - if (i != resultCount - 1) - str.Append(", "); - } - else - { - int lhsIndex = i; - int rhsIndex = i; - - str.AppendFormat("lhs.{0} {2} rhs.{1}", fields[lhsIndex], fields[rhsIndex], op); - if (i != resultCount - 1) - str.Append(", "); - } - } - - - str.Append("); }\n"); - } - - void GenerateIndexOperator(int count, string vectorType, string indexOperatorReturnType, StringBuilder str) - { - str.AppendFormat("\t\tunsafe public {0} this[int index]\n", indexOperatorReturnType); - str.AppendLine("\t\t{"); - str.AppendLine("\t\t\tget"); - str.AppendLine("\t\t\t{"); - str.AppendLine("#if ENABLE_UNITY_COLLECTIONS_CHECKS"); - str.AppendFormat("\t\t\t\tif ((uint)index >= {0})\n", count); - str.AppendFormat("\t\t\t\t\tthrow new System.ArgumentException(\"index must be between[0...{0}]\");\n", count - 1); - str.AppendLine("#endif"); - // To workaround an undefined behavior with taking the fixed address of a struct field (that could be allocated on the stack) - // we are fixing this instead of a field - // See issue https://github.com/dotnet/coreclr/issues/16210 - str.Append("\t\t\t\tfixed ("); - str.Append(vectorType); - str.Append("* array = &this) { return ((").Append(indexOperatorReturnType).Append("*)array)[index]; }\n"); - str.AppendLine("\t\t\t}"); - str.AppendLine("\t\t\tset"); - str.AppendLine("\t\t\t{"); - str.AppendLine("#if ENABLE_UNITY_COLLECTIONS_CHECKS"); - str.AppendFormat("\t\t\t\tif ((uint)index >= {0})\n", count); - str.AppendFormat("\t\t\t\t\tthrow new System.ArgumentException(\"index must be between[0...{0}]\");\n", count - 1); - str.AppendLine("#endif"); - str.Append("\t\t\t\tfixed ("); - str.Append(indexOperatorReturnType); - str.Append("* array = &x) { array[index] = value; }\n"); - str.AppendLine("\t\t\t}"); - str.AppendLine("\t\t}"); - - } - - void GenerateEquals(int resultCount, string resultType, StringBuilder str) - { - str.Append("\t\t[MethodImpl(0x100)]\n"); - str.AppendFormat("\t\tpublic bool Equals({0} rhs) ", resultType); - str.Append(" { "); - str.AppendFormat("return ", resultType); - - for (int i = 0; i < resultCount; i++) - { - str.Append(fields[i] + " == rhs." + fields[i]); - if (i != resultCount-1) - str.Append(" && "); - } - - str.Append("; }\n"); - } - - - void GenerateShiftOperator(int lhsTypeIndex, string op, int resultCount, string resultType, StringBuilder str) - { - str.Append("\t\t[MethodImpl(0x100)]\n"); - str.AppendFormat("\t\tpublic static {0} operator {1} ({2} lhs, int rhs)", resultType, op, m_Types[lhsTypeIndex - 1]); - str.Append(" { "); - str.AppendFormat("return new {0} (", resultType); - - for (int i = 0; i < resultCount; i++) - { - if (lhsTypeIndex == 0) - { - str.AppendFormat("lhs {0} rhs", op); - if (i != resultCount - 1) - str.Append(", "); - } - else - { - int lhsIndex = i; - str.AppendFormat("lhs.{0} {1} rhs", fields[lhsIndex], op); - if (i != resultCount - 1) - str.Append(", "); - } - } - - - str.Append("); }\n"); - } - - void GenerateUnaryOperator(int count, string op, StringBuilder str) - { - str.Append("\t\t[MethodImpl(0x100)]\n"); - str.AppendFormat("\t\tpublic static {0} operator {1} ({0} val)", m_Types[count - 1], op); - str.Append(" { "); - str.AppendFormat("return new {0} (", m_Types[count - 1]); - - for (int i = 0; i < count; i++) - { - str.AppendFormat("{0}val.{1}", op, fields[i]); - if (i != count - 1) - str.Append(", "); - } - - str.Append("); }"); - } - - void GenerateSwizzles(int count, StringBuilder str) - { - // float4 swizzles - { - int[] swizzles = new int[4]; - for (int x = 0; x < count; x++) - { - for (int y = 0; y < count; y++) - { - for (int z = 0; z < count; z++) - { - for (int w = 0; w < count; w++) - { - swizzles[0] = x; - swizzles[1] = y; - swizzles[2] = z; - swizzles[3] = w; - - GenerateSwizzles(swizzles, str); - } - } - } - } - } - - // float3 swizzles - { - var swizzles = new int[3]; - for (int x = 0; x < count; x++) - { - for (int y = 0; y < count; y++) - { - for (int z = 0; z < count; z++) - { - swizzles[0] = x; - swizzles[1] = y; - swizzles[2] = z; - - GenerateSwizzles(swizzles, str); - } - } - } - } - - // float2 swizzles - { - var swizzles = new int[2]; - for (int x = 0; x < count; x++) - { - for (int y = 0; y < count; y++) - { - swizzles[0] = x; - swizzles[1] = y; - - GenerateSwizzles(swizzles, str); - } - } - } - } - - void GenerateSwizzles(int[] swizzle, StringBuilder str) - { - int bits = 0; - bool allowSetter = true; - for (int i = 0; i < swizzle.Length; i++) - { - int bit = 1 << swizzle[i]; - if ((bits & bit) != 0) - allowSetter = false; - - bits |= 1 << swizzle[i]; - } - - bool hideAutoComplete = true; - - if (hideAutoComplete) - str.Append("\t\t[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]\n"); - - str.Append("\t\tpublic "); - str.Append(m_Types[swizzle.Length - 1]); - str.Append(' '); - - for (int i = 0; i < swizzle.Length; i++) - str.Append(components[swizzle[i]]); - - // Getter - - str.Append("\n\t\t{"); - if (swizzle.Length != 1) - { - str.AppendFormat("\n\t\t\t[MethodImpl(0x100)]"); - str.Append("\n\t\t\tget { return new "); - str.Append(m_Types[swizzle.Length - 1]); - str.Append('('); - } - else - str.Append("\n\t\t\tget { return "); - - for (int i = 0; i < swizzle.Length; i++) - { - str.Append(fields[swizzle[i]]); - - if (i != swizzle.Length - 1) - str.Append(", "); - } - - if (swizzle.Length != 1) - str.Append("); }"); - else - str.Append("; }"); - - //Setter - if (allowSetter) - { - str.AppendFormat("\n\t\t\t[MethodImpl(0x100)]"); - str.Append("\n\t\t\tset { "); - for (int i = 0; i < swizzle.Length; i++) - { - str.Append(fields[swizzle[i]]); - if (swizzle.Length != 1) - { - str.Append(" = value."); - str.Append(fields[i]); - } - else - { - str.Append(" = value"); - } - - str.Append("; "); - - } - - str.Append("}"); - - } - - str.Append("\n\t\t}\n\n"); - str.Append("\n"); - } - - } -} diff --git a/src/Unity.Mathematics.CodeGen/Program.cs b/src/Unity.Mathematics.CodeGen~/Program.cs similarity index 50% rename from src/Unity.Mathematics.CodeGen/Program.cs rename to src/Unity.Mathematics.CodeGen~/Program.cs index 627bcaae..e57ec59f 100644 --- a/src/Unity.Mathematics.CodeGen/Program.cs +++ b/src/Unity.Mathematics.CodeGen~/Program.cs @@ -1,5 +1,7 @@ -using System; +using System; +using System.Globalization; using System.IO; +using System.Threading; namespace Unity.Mathematics.Mathematics.CodeGen { @@ -7,6 +9,8 @@ class MainClass { public static void Main (string[] args) { + Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US"); + var thisExeDir = Path.GetDirectoryName(typeof(MainClass).Assembly.Location); if (thisExeDir == null) { @@ -24,14 +28,26 @@ public static void Main (string[] args) throw new InvalidOperationException($"Unable to get path of current assembly from `{typeof(MainClass).Assembly.Location}`"); } - directory = new DirectoryInfo(Path.Combine(parent.FullName, "Unity.Mathematics")); - if (!directory.Exists) + var implementationDirectory = new DirectoryInfo(Path.Combine(parent.FullName, "Unity.Mathematics")); + if (!implementationDirectory.Exists) + { + throw new InvalidOperationException($"The directory `{implementationDirectory.FullName}` must exist"); + } + + var testDirectory = new DirectoryInfo(Path.Combine(parent.FullName, "Tests/Tests/Shared")); + if (!testDirectory.Exists) + { + throw new InvalidOperationException($"The directory `{testDirectory.FullName}` must exist"); + } + + var performanceTestDirectory = new DirectoryInfo(Path.Combine(parent.FullName, "Unity.Mathematics.PerformanceTests")); + if (!performanceTestDirectory.Exists) { - throw new InvalidOperationException($"The directory `{directory.FullName}` must exist"); + throw new InvalidOperationException($"The directory `{performanceTestDirectory.FullName}` must exist"); } Console.WriteLine("Generating swizzle and operators: " + directory); - VectorGenerator.Write(directory.FullName); + VectorGenerator.Write(implementationDirectory.FullName, testDirectory.FullName, performanceTestDirectory.FullName); Console.WriteLine("Done"); } } diff --git a/src/Unity.Mathematics.CodeGen~/Program.cs.meta b/src/Unity.Mathematics.CodeGen~/Program.cs.meta new file mode 100644 index 00000000..6977db26 --- /dev/null +++ b/src/Unity.Mathematics.CodeGen~/Program.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0f955c6a4c13d2746831afc3eb6d3735 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics.CodeGen~/Properties.meta b/src/Unity.Mathematics.CodeGen~/Properties.meta new file mode 100644 index 00000000..5f29de7d --- /dev/null +++ b/src/Unity.Mathematics.CodeGen~/Properties.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0db90b841e81edc43b42a24651538cb8 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics.CodeGen/Properties/AssemblyInfo.cs b/src/Unity.Mathematics.CodeGen~/Properties/AssemblyInfo.cs similarity index 100% rename from src/Unity.Mathematics.CodeGen/Properties/AssemblyInfo.cs rename to src/Unity.Mathematics.CodeGen~/Properties/AssemblyInfo.cs diff --git a/src/Unity.Mathematics.CodeGen~/Properties/AssemblyInfo.cs.meta b/src/Unity.Mathematics.CodeGen~/Properties/AssemblyInfo.cs.meta new file mode 100644 index 00000000..1551d6a9 --- /dev/null +++ b/src/Unity.Mathematics.CodeGen~/Properties/AssemblyInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2c67f146c4abc6449845d850d013a838 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics.CodeGen/Unity.Mathematics.CodeGen.csproj b/src/Unity.Mathematics.CodeGen~/Unity.Mathematics.CodeGen.csproj similarity index 72% rename from src/Unity.Mathematics.CodeGen/Unity.Mathematics.CodeGen.csproj rename to src/Unity.Mathematics.CodeGen~/Unity.Mathematics.CodeGen.csproj index ef1fda06..be4fda6e 100644 --- a/src/Unity.Mathematics.CodeGen/Unity.Mathematics.CodeGen.csproj +++ b/src/Unity.Mathematics.CodeGen~/Unity.Mathematics.CodeGen.csproj @@ -10,11 +10,11 @@ Properties UnityEngine.Mathematics.CodeGen UnityEngine.Mathematics.CodeGen - v4.5 + v4.7.1 512 - AnyCPU + x64 true full false @@ -22,34 +22,17 @@ DEBUG;TRACE prompt 4 + true - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU + x64 pdbonly true bin\Release\ TRACE prompt 4 + true diff --git a/src/Unity.Mathematics.CodeGen~/VectorGenerator.cs b/src/Unity.Mathematics.CodeGen~/VectorGenerator.cs new file mode 100644 index 00000000..c53afabc --- /dev/null +++ b/src/Unity.Mathematics.CodeGen~/VectorGenerator.cs @@ -0,0 +1,4071 @@ +using System; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; + +namespace Unity.Mathematics.Mathematics.CodeGen +{ + class VectorGenerator + { + private string m_ImplementationDirectory; + private string m_TestDirectory; + string m_PerformanceTestDirectory; + private string m_BaseType; + private string m_TypeName; + private int m_Rows; + private int m_Columns; + private Features m_Features; + private uint[] m_primes = new uint[] { 0x6E624EB7u, 0x7383ED49u, 0xDD49C23Bu, 0xEBD0D005u, 0x91475DF7u, 0x55E84827u, 0x90A285BBu, 0x5D19E1D5u, + 0xFAAF07DDu, 0x625C45BDu, 0xC9F27FCBu, 0x6D2523B1u, 0x6E2BF6A9u, 0xCC74B3B7u, 0x83B58237u, 0x833E3E29u, + 0xA9D919BFu, 0xC3EC1D97u, 0xB8B208C7u, 0x5D3ED947u, 0x4473BBB1u, 0xCBA11D5Fu, 0x685835CFu, 0xC3D32AE1u, + 0xB966942Fu, 0xFE9856B3u, 0xFA3A3285u, 0xAD55999Du, 0xDCDD5341u, 0x94DDD769u, 0xA1E92D39u, 0x4583C801u, + 0x9536A0F5u, 0xAF816615u, 0x9AF8D62Du, 0xE3600729u, 0x5F17300Du, 0x670D6809u, 0x7AF32C49u, 0xAE131389u, + 0x5D1B165Bu, 0x87096CD7u, 0x4C7F6DD1u, 0x4822A3E9u, 0xAAC3C25Du, 0xD21D0945u, 0x88FCAB2Du, 0x614DA60Du, + 0x5BA2C50Bu, 0x8C455ACBu, 0xCD266C89u, 0xF1852A33u, 0x77E35E77u, 0x863E3729u, 0xE191B035u, 0x68586FAFu, + 0xD4DFF6D3u, 0xCB634F4Du, 0x9B13B92Du, 0x4ABF0813u, 0x86068063u, 0xD75513F9u, 0x5AB3E8CDu, 0x676E8407u, + 0xB36DE767u, 0x6FCA387Du, 0xAF0F3103u, 0xE4A056C7u, 0x841D8225u, 0xC9393C7Du, 0xD42EAFA3u, 0xD9AFD06Du, + 0x97A65421u, 0x7809205Fu, 0x9C9F0823u, 0x5A9CA13Bu, 0xAFCDD5EFu, 0xA88D187Du, 0xCF6EBA1Du, 0x9D88E5A1u, + 0xEADF0775u, 0x747A9D7Bu, 0x4111F799u, 0xB5F05AF1u, 0xFD80290Bu, 0x8B65ADB7u, 0xDFF4F563u, 0x7069770Du, + 0xD1224537u, 0xE99ED6F3u, 0x48125549u, 0xEEE2123Bu, 0xE3AD9FE5u, 0xCE1CF8BFu, 0x7BE39F3Bu, 0xFAB9913Fu, + 0xB4501269u, 0xE04B89FDu, 0xDB3DE101u, 0x7B6D1B4Bu, 0x58399E77u, 0x5EAC29C9u, 0xFC6014F9u, 0x6BF6693Fu, + 0x9D1B1D9Bu, 0xF842F5C1u, 0xA47EC335u, 0xA477DF57u, 0xC4B1493Fu, 0xBA0966D3u, 0xAFBEE253u, 0x5B419C01u, + 0x515D90F5u, 0xEC9F68F3u, 0xF9EA92D5u, 0xC2FAFCB9u, 0x616E9CA1u, 0xC5C5394Bu, 0xCAE78587u, 0x7A1541C9u, + 0xF83BD927u, 0x6A243BCBu, 0x509B84C9u, 0x91D13847u, 0x52F7230Fu, 0xCF286E83u, 0xE121E6ADu, 0xC9CA1249u, + 0x69B60C81u, 0xE0EB6C25u, 0xF648BEABu, 0x6BDB2B07u, 0xEF63C699u, 0x9001903Fu, 0xA895B9CDu, 0x9D23B201u, + 0x4B01D3E1u, 0x7461CA0Du, 0x79725379u, 0xD6258E5Bu, 0xEE390C97u, 0x9C8A2F05u, 0x4DDC6509u, 0x7CF083CBu, + 0x5C4D6CEDu, 0xF9137117u, 0xE857DCE1u, 0xF62213C5u, 0x9CDAA959u, 0xAA269ABFu, 0xD54BA36Fu, 0xFD0847B9u, + 0x8189A683u, 0xB139D651u, 0xE7579997u, 0xEF7D56C7u, 0x66F38F0Bu, 0x624256A3u, 0x5292ADE1u, 0xD2E590E5u, + 0xF25BE857u, 0x9BC17CE7u, 0xC8B86851u, 0x64095221u, 0xADF428FFu, 0xA3977109u, 0x745ED837u, 0x9CDC88F5u, + 0xFA62D721u, 0x7E4DB1CFu, 0x68EEE0F5u, 0xBC3B0A59u, 0x816EFB5Du, 0xA24E82B7u, 0x45A22087u, 0xFC104C3Bu, + 0x5FFF6B19u, 0x5E6CBF3Bu, 0xB546F2A5u, 0xBBCF63E7u, 0xC53F4755u, 0x6985C229u, 0xE133B0B3u, 0xC3E0A3B9u, + 0xFE31134Fu, 0x712A34D7u, 0x9D77A59Bu, 0x4942CA39u, 0xB40EC62Du, 0x565ED63Fu, 0x93C30C2Bu, 0xDCAF0351u, + 0x6E050B01u, 0x750FDBF5u, 0x7F3DD499u, 0x52EAAEBBu, 0x4599C793u, 0x83B5E729u, 0xC267163Fu, 0x67BC9149u, + 0xAD7C5EC1u, 0x822A7D6Du, 0xB492BF15u, 0xD37220E3u, 0x7AA2C2BDu, 0xE16BC89Du, 0x7AA07CD3u, 0xAF642BA9u, + 0xA8F2213Bu, 0x9F3FDC37u, 0xAC60D0C3u, 0x9263662Fu, 0xE69626FFu, 0xBD010EEBu, 0x9CEDE1D1u, 0x43BE0B51u, + 0xAF836EE1u, 0xB130C137u, 0x54834775u, 0x7C022221u, 0xA2D00EDFu, 0xA8977779u, 0x9F1C739Bu, 0x4B1BD187u, + 0x9DF50593u, 0xF18EEB85u, 0x9E19BFC3u, 0x8196B06Fu, 0xD24EFA19u, 0x7D8048BBu, 0x713BD06Fu, 0x753AD6ADu, + 0xD19764C7u, 0xB5D0BF63u, 0xF9102C5Fu, 0x9881FB9Fu, 0x56A1530Du, 0x804B722Du, 0x738E50E5u, 0x4FC93C25u, + 0xCD0445A5u, 0xD2B90D9Bu, 0xD35C9B2Du, 0xA10D9E27u, 0x568DAAA9u, 0x7530254Fu, 0x9F090439u, 0x5E9F85C9u, + 0x8C4CA03Fu, 0xB8D969EDu, 0xAC5DB57Bu, 0xA91A02EDu, 0xB3C49313u, 0xF43A9ABBu, 0x84E7E01Bu, 0x8E055BE5u + }; + + private uint m_NextPrime = 0; + private uint NextPrime() + { + return m_primes[m_NextPrime++ & 255]; //TODO: fix + } + + [Flags] + private enum Features + { + Arithmetic = 1 << 0, + Shifts = 1 << 1, + BitwiseLogic = 1 << 2, + BitwiseComplement = 1 << 3, + UnaryNegation = 1 << 4, + All = Arithmetic | Shifts | BitwiseLogic | BitwiseComplement | UnaryNegation + } + + static readonly string[] components = { "x", "y", "z", "w" }; + static readonly string[] vectorFields = { "x", "y", "z", "w" }; + static readonly string[] matrixFields = { "c0", "c1", "c2", "c3" }; + static readonly string[] shuffleComponents = { "LeftX", "LeftY", "LeftZ", "LeftW", "RightX", "RightY", "RightZ", "RightW" }; + + [StructLayout(LayoutKind.Explicit)] + internal struct UIntFloatUnion + { + [FieldOffset(0)] + public uint uintValue; + [FieldOffset(0)] + public float floatValue; + } + + [StructLayout(LayoutKind.Explicit)] + internal struct ULongDoubleUnion + { + [FieldOffset(0)] + public ulong ulongValue; + [FieldOffset(0)] + public double doubleValue; + } + + public static uint AsUInt(float x) + { + UIntFloatUnion u; + u.uintValue = 0; + u.floatValue = x; + return u.uintValue; + } + + public static ulong AsULong(double x) + { + ULongDoubleUnion u; + u.ulongValue = 0; + u.doubleValue = x; + return u.ulongValue; + } + + public static string ToTypeName(string baseType, int rows, int columns) + { + string name = baseType; + if (rows == 1 && columns > 1) + return name + columns; // row vector + + if (rows > 1) + name += rows; + if (columns > 1) + name += "x" + columns; + return name; + } + + + public enum VectorType { Row, Column, DontCare }; + public static string ToValueDescription(string baseType, int rows, int columns, int n, bool addRowColumnVectorPrefix = false) + { + string name = ToTypeName(baseType, rows, columns); + + string numStr = ""; + switch(n) + { + case 1: + numStr = baseType == "int" ? "an " : "a "; + break; + case 2: + numStr = "two "; + break; + case 3: + numStr = "three "; + break; + case 4: + numStr = "four "; + break; + } + + string vectorPrefix = addRowColumnVectorPrefix ? ((rows == 1) ? " row" : (columns == 1) ? " column" : "") : ""; + + if(n > 1) + return numStr + name + ((rows == 1 && columns == 1) ? " values" : (rows > 1 && columns > 1) ? " matrices" : vectorPrefix + " vectors"); + else + return numStr + name + ((rows == 1 && columns == 1) ? " value" : (rows > 1 && columns > 1) ? " matrix" : vectorPrefix + " vector"); + } + + public static string ToTypedLiteral(string baseType, int value) + { + switch(baseType) + { + case "int": + return "" + value; + case "uint": + return "" + value + "u"; + case "half": + case "float": + return "" + value + ".0f"; + case "double": + return "" + value + ".0"; + default: + return ""; + } + } + + private static string UpperCaseFirstLetter(string s) + { + return char.ToUpper(s[0]) + s.Substring(1); + } + + private static string s_AutoGenHeader = + "//------------------------------------------------------------------------------\n" + + "// \n" + + "// This code was generated by a tool.\n" + + "//\n" + + "// Changes to this file may cause incorrect behavior and will be lost if\n" + + "// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen.\n" + + "// \n" + + "//------------------------------------------------------------------------------\n"; + + private static void WriteFile(string filename, string text) + { + // Convert all tabs to spaces + text = text.Replace("\t", " "); + // Normalize line endings, convert all EOL to platform EOL (and let git handle it) + text = text.Replace("\r\n", "\n"); + text = text.Replace("\n", Environment.NewLine); + + // Generate auto generated comment + text = s_AutoGenHeader + text; + + // Trim trailing spaces that could have come from code gen. + char[] trim = { ' ' }; + var lines = text.Split(new string[] { Environment.NewLine }, StringSplitOptions.None); + + for (int i = 0; i < lines.Length; ++i) + { + lines[i] = lines[i].TrimEnd(trim); + } + + text = string.Join(Environment.NewLine, lines); + + System.IO.File.WriteAllText(filename, text); + } + + private void WriteMatrix() + { + StringBuilder str = new StringBuilder(); + GenerateMatrixImplementation(str); + WriteFile(m_ImplementationDirectory + "/matrix.gen.cs", str.ToString()); + } + + private void WriteType(string baseType, int rows, int columns, Features features) + { + m_BaseType = baseType; + m_TypeName = ToTypeName(baseType, rows, columns); + m_Rows = rows; + m_Columns = columns; + m_Features = features; + + // implementation + StringBuilder str = new StringBuilder(); + GenerateTypeImplementation(str); + WriteFile(m_ImplementationDirectory + "/" + m_TypeName + ".gen.cs", str.ToString()); + + + if(m_BaseType != "half") + { + str = new StringBuilder(); + GenerateTypeTests(str); + WriteFile(m_TestDirectory + "/Test" + UpperCaseFirstLetter(m_TypeName) + ".gen.cs", str.ToString()); + } + } + private void WriteMath() + { + StringBuilder str = new StringBuilder(); + GenerateMathTests(str); + WriteFile(m_TestDirectory + "/TestMath.gen.cs", str.ToString()); + } + + public static void Write(string implementationDirectory, string testDirectory, string performanceTestDirectory) + { + VectorGenerator vectorGenerator = new VectorGenerator(); + vectorGenerator.m_ImplementationDirectory = implementationDirectory; + vectorGenerator.m_TestDirectory = testDirectory; + vectorGenerator.m_PerformanceTestDirectory = performanceTestDirectory; + + for(int rows = 1; rows <= 4; rows++) + { + for(int columns = 1; columns <= 4; columns++) + { + if (rows == 1 && columns == 1) // don't generate type1x1 + continue; + + if (columns == 1) + vectorGenerator.WriteType("half", rows, columns, 0); + + if (rows == 1) // ignore row vectors for now + continue; + + vectorGenerator.WriteType("bool", rows, columns, Features.BitwiseLogic); + vectorGenerator.WriteType("int", rows, columns, Features.All); + vectorGenerator.WriteType("uint", rows, columns, Features.All); + vectorGenerator.WriteType("float", rows, columns, Features.Arithmetic | Features.UnaryNegation); + vectorGenerator.WriteType("double", rows, columns, Features.Arithmetic | Features.UnaryNegation); + } + } + + vectorGenerator.WriteMatrix(); + vectorGenerator.WriteMath(); + vectorGenerator.WritePerformanceTests(); + } + + + private void GenerateMemberVariables(StringBuilder str) + { + if(m_Columns > 1) + { + string columnType = ToTypeName(m_BaseType, m_Rows, 1); + for (int i = 0; i < m_Columns; i++) + { + str.AppendFormat($"\t\t/// Column {i} of the matrix.\n"); + str.AppendFormat("\t\tpublic {0} {1};\n", columnType, matrixFields[i]); + } + } + else + { + for (int i = 0; i < m_Rows; i++) + { + str.AppendFormat($"\t\t/// {vectorFields[i]} component of the vector.\n"); + if (m_Columns == 1 && m_BaseType == "bool") + str.Append("\t\t[MarshalAs(UnmanagedType.U1)]\n"); + str.AppendFormat("\t\tpublic {0} {1};\n", m_BaseType, vectorFields[i]); + } + } + str.Append("\n"); + } + + private void GenerateStaticFields(StringBuilder str) + { + if (m_BaseType == "int" || m_BaseType == "uint" || m_BaseType == "half" || m_BaseType == "float" || m_BaseType == "double") + { + string zeroStr = ToTypedLiteral(m_BaseType, 0); + + // identity + if (m_Rows == m_Columns) + { + string oneStr = ToTypedLiteral(m_BaseType, 1); + str.AppendFormat("\t\t/// {0} identity transform.\n", m_TypeName); + str.AppendFormat("\t\tpublic static readonly {0} identity = new {0}(", m_TypeName); + for (int row = 0; row < m_Rows; row++) + { + for (int column = 0; column < m_Columns; column++) + { + if (row != 0 || column != 0) + str.Append(", "); + if (row != 0 && column == 0) + str.Append(" "); + str.Append(row == column ? oneStr : zeroStr); + } + } + str.Append(");\n\n"); + } + + // zero + str.AppendFormat("\t\t/// {0} zero value.\n", m_TypeName); + str.AppendFormat("\t\tpublic static readonly {0} zero;\n", m_TypeName); + } + + str.Append("\n"); + } + + private void GenerateDebuggerTypeProxy(StringBuilder str) + { + if (m_Columns > 1) + return; + + str.Append("\t\tinternal sealed class DebuggerProxy\n"); + str.Append("\t\t{\n"); + for (int i = 0; i < m_Rows; i++) + { + str.AppendFormat("\t\t\tpublic {0} {1};\n", m_BaseType, vectorFields[i]); + } + + str.AppendFormat("\t\t\tpublic DebuggerProxy({0} v)\n", m_TypeName); + str.Append("\t\t\t{\n"); + for (int i = 0; i < m_Rows; i++) + { + str.AppendFormat("\t\t\t\t{0} = v.{0};\n", vectorFields[i]); + } + str.Append("\t\t\t}\n"); + str.Append("\t\t}\n\n"); + } + + private void GenerateConversion(StringBuilder str, StringBuilder opStr, StringBuilder mathStr, string sourceBaseType, bool isExplicit, bool isScalar) + { + string sourceType = isScalar ? sourceBaseType : ToTypeName(sourceBaseType, m_Rows, m_Columns); + + int fieldCount = (m_Columns > 1) ? m_Columns : m_Rows; + string[] fields = (m_Columns > 1) ? matrixFields : vectorFields; + string dstFieldType = (m_Columns > 1) ? ToTypeName(m_BaseType, m_Rows, 1) : m_BaseType; + string dstTypeCategory = (m_Columns > 1) ? "matrix" : "vector"; + string plicitlyString = isExplicit ? "Explicitly" : "Implicitly"; + + if (isScalar) + { + if(sourceBaseType != m_BaseType) + { + str.AppendFormat("\t\t/// Constructs a {0} {1} from a single {2} value by converting it to {3} and assigning it to every component.\n", m_TypeName, dstTypeCategory, sourceType, m_BaseType); + str.AppendFormat($"\t\t/// {sourceType} to convert to {m_TypeName}\n"); + + mathStr.AppendFormat("\t\t/// Returns a {0} {1} constructed from a single {2} value by converting it to {3} and assigning it to every component.\n", m_TypeName, dstTypeCategory, sourceType, m_BaseType); + mathStr.AppendFormat($"\t\t/// {sourceType} to convert to {m_TypeName}\n"); + + opStr.AppendFormat("\t\t/// {0} converts a single {1} value to a {2} {3} by converting it to {4} and assigning it to every component.\n", plicitlyString, sourceType, m_TypeName, dstTypeCategory, m_BaseType); + opStr.AppendFormat($"\t\t/// {sourceType} to convert to {m_TypeName}\n"); + } + else + { + str.AppendFormat("\t\t/// Constructs a {0} {1} from a single {2} value by assigning it to every component.\n", m_TypeName, dstTypeCategory, sourceType); + str.AppendFormat($"\t\t/// {sourceType} to convert to {m_TypeName}\n"); + + mathStr.AppendFormat("\t\t/// Returns a {0} {1} constructed from a single {2} value by assigning it to every component.\n", m_TypeName, dstTypeCategory, sourceType); + mathStr.AppendFormat($"\t\t/// {sourceType} to convert to {m_TypeName}\n"); + + opStr.AppendFormat("\t\t/// {0} converts a single {1} value to a {2} {3} by assigning it to every component.\n", plicitlyString, sourceType, m_TypeName, dstTypeCategory); + opStr.AppendFormat($"\t\t/// {sourceType} to convert to {m_TypeName}\n"); + } + } + else + { + if (sourceBaseType != m_BaseType) + { + str.AppendFormat("\t\t/// Constructs a {0} {1} from a {2} {1} by componentwise conversion.\n", m_TypeName, dstTypeCategory, sourceType); + str.AppendFormat($"\t\t/// {sourceType} to convert to {m_TypeName}\n"); + + mathStr.AppendFormat("\t\t/// Return a {0} {1} constructed from a {2} {1} by componentwise conversion.\n", m_TypeName, dstTypeCategory, sourceType); + mathStr.AppendFormat($"\t\t/// {sourceType} to convert to {m_TypeName}\n"); + + opStr.AppendFormat("\t\t/// {0} converts a {1} {2} to a {3} {2} by componentwise conversion.\n", plicitlyString, sourceType, dstTypeCategory, m_TypeName); + opStr.AppendFormat($"\t\t/// {sourceType} to convert to {m_TypeName}\n"); + } + } + + str.Append("\t\t[MethodImpl(MethodImplOptions.AggressiveInlining)]\n"); + str.AppendFormat("\t\tpublic {0}({1} v)\n", m_TypeName, sourceType); + str.Append("\t\t{\n"); + for(int i = 0; i < fieldCount; i++) + { + string rhs = "v"; + if (!isScalar) + rhs = rhs + "." + fields[i]; + if (isExplicit) + { + if (sourceBaseType == "bool") + { + if (m_Columns > 1) + rhs = string.Format("math.select(new {0}({1}), new {0}({2}), {3})", dstFieldType, ToTypedLiteral(m_BaseType, 0), ToTypedLiteral(m_BaseType, 1), rhs); + else + rhs = rhs + " ? " + ToTypedLiteral(m_BaseType, 1) + " : " + ToTypedLiteral(m_BaseType, 0); + } + + else + rhs = "(" + dstFieldType + ")" + rhs; + } + + + str.AppendFormat("\t\t\tthis.{0} = {1};\n", fields[i], rhs); + } + str.Append("\t\t}\n\n"); + + mathStr.Append("\t\t/// Converted value.\n"); + mathStr.Append("\t\t[MethodImpl(MethodImplOptions.AggressiveInlining)]\n"); + mathStr.AppendFormat("\t\tpublic static {0} {0}({1} v) {{ return new {0}(v); }}\n\n", m_TypeName, sourceType); + + opStr.Append("\t\t/// Converted value.\n"); + opStr.Append("\t\t[MethodImpl(MethodImplOptions.AggressiveInlining)]\n"); + opStr.AppendFormat("\t\tpublic static {0} operator {1}({2} v) {{ return new {1}(v); }}\n\n", isExplicit ? "explicit" : "implicit", m_TypeName, sourceType); + } + + private void GenerateConversionConstructorsAndOperators(StringBuilder str, StringBuilder mathStr) + { + StringBuilder opStr = new StringBuilder(); + + GenerateConversion(str, opStr, mathStr, m_BaseType, false, true); + + if (m_BaseType == "int") + { + GenerateConversion(str, opStr, mathStr, "bool", true, true); + GenerateConversion(str, opStr, mathStr, "bool", true, false); + GenerateConversion(str, opStr, mathStr, "uint", true, true); + GenerateConversion(str, opStr, mathStr, "uint", true, false); + GenerateConversion(str, opStr, mathStr, "float", true, true); + GenerateConversion(str, opStr, mathStr, "float", true, false); + GenerateConversion(str, opStr, mathStr, "double", true, true); + GenerateConversion(str, opStr, mathStr, "double", true, false); + } + else if (m_BaseType == "uint") + { + GenerateConversion(str, opStr, mathStr, "bool", true, true); + GenerateConversion(str, opStr, mathStr, "bool", true, false); + GenerateConversion(str, opStr, mathStr, "int", true, true); + GenerateConversion(str, opStr, mathStr, "int", true, false); + GenerateConversion(str, opStr, mathStr, "float", true, true); + GenerateConversion(str, opStr, mathStr, "float", true, false); + GenerateConversion(str, opStr, mathStr, "double", true, true); + GenerateConversion(str, opStr, mathStr, "double", true, false); + } + else if (m_BaseType == "half") + { + GenerateConversion(str, opStr, mathStr, "float", true, true); + GenerateConversion(str, opStr, mathStr, "float", true, false); + GenerateConversion(str, opStr, mathStr, "double", true, true); + GenerateConversion(str, opStr, mathStr, "double", true, false); + } + else if (m_BaseType == "float") + { + GenerateConversion(str, opStr, mathStr, "bool", true, true); + GenerateConversion(str, opStr, mathStr, "bool", true, false); + GenerateConversion(str, opStr, mathStr, "int", false, true); + GenerateConversion(str, opStr, mathStr, "int", false, false); + GenerateConversion(str, opStr, mathStr, "uint", false, true); + GenerateConversion(str, opStr, mathStr, "uint", false, false); + if(m_Columns == 1) + { + GenerateConversion(str, opStr, mathStr, "half", false, true); + GenerateConversion(str, opStr, mathStr, "half", false, false); + } + + GenerateConversion(str, opStr, mathStr, "double", true, true); + GenerateConversion(str, opStr, mathStr, "double", true, false); + } + else if (m_BaseType == "double") + { + GenerateConversion(str, opStr, mathStr, "bool", true, true); + GenerateConversion(str, opStr, mathStr, "bool", true, false); + GenerateConversion(str, opStr, mathStr, "int", false, true); + GenerateConversion(str, opStr, mathStr, "int", false, false); + GenerateConversion(str, opStr, mathStr, "uint", false, true); + GenerateConversion(str, opStr, mathStr, "uint", false, false); + if (m_Columns == 1) + { + GenerateConversion(str, opStr, mathStr, "half", false, true); + GenerateConversion(str, opStr, mathStr, "half", false, false); + } + GenerateConversion(str, opStr, mathStr, "float", false, true); + GenerateConversion(str, opStr, mathStr, "float", false, false); + } + + + str.Append("\n"); + str.Append(opStr); + str.Append("\n"); + } + + private void GenerateTypeImplementation(StringBuilder str) + { + StringBuilder mathStr = new StringBuilder(); + + str.Append("using System;\n"); + str.Append("using System.Runtime.CompilerServices;\n"); + if (m_Columns == 1 && m_BaseType == "bool") + str.Append("using System.Runtime.InteropServices;\n"); // for MarshalAs + if (m_Columns == 1) + str.Append("using System.Diagnostics;\n"); // for DebuggerTypeProxy + str.Append("using Unity.IL2CPP.CompilerServices;\n"); + str.Append("\n"); + str.Append("#pragma warning disable 0660, 0661\n\n"); + str.Append("namespace Unity.Mathematics\n"); + str.Append("{\n"); + + if (m_Columns > 1) + { + str.Append($"\t/// A {m_Rows}x{m_Columns} matrix of {m_BaseType}s.\n"); + } + else + { + str.Append($"\t/// A {m_Rows} component vector of {m_BaseType}s.\n"); + } + + if (m_Columns == 1) + str.AppendFormat("\t[DebuggerTypeProxy(typeof({0}.DebuggerProxy))]\n", m_TypeName); + str.Append("\t[System.Serializable]\n"); + str.Append("\t[Il2CppEagerStaticClassConstruction]\n"); + str.AppendFormat("\tpublic partial struct {0} : System.IEquatable<{0}>", m_TypeName); + if (m_BaseType != "bool") + str.Append(", IFormattable"); + str.Append("\n\t{\n"); + + GenerateMemberVariables(str); + + GenerateStaticFields(str); + + GenerateConstructors(str, mathStr); + + GenerateConversionConstructorsAndOperators(str, mathStr); + + GenerateOperators(str); + + var isMatrix = m_Rows > 1 && m_Columns > 1; + + if(m_Rows == 4 && m_Columns == 4 && (m_BaseType == "float" || m_BaseType == "double")) + { + + GenerateMulImplementation("rotate", m_BaseType, mathStr, 4, 4, 3, 1, false, GenerateMulType.Rotate); + GenerateMulImplementation("transform", m_BaseType, mathStr, 4, 4, 3, 1, true, GenerateMulType.Transform); + } + + GenerateTransposeFunction(mathStr); + GenerateInverseFunction(mathStr); + GenerateFastInverseFunction(mathStr); + GenerateDeterminantFunction(mathStr); + GenerateHashFunction(mathStr, false); + GenerateHashFunction(mathStr, true); + + if (m_Columns == 1) + { + str.Append("\n\n"); + GenerateSwizzles(str); + GenerateShuffleImplementation(mathStr); + } + + + str.Append("\n"); + GenerateIndexOperator(str, isMatrix ? IndexerMode.ByRef : IndexerMode.ByValue); + + str.Append("\n"); + GenerateEquals(str); + + str.Append("\n"); + GenerateGetHashCode(str); + + str.Append("\n"); + GenerateToStringFunction(str, false); + if(m_BaseType != "bool") + GenerateToStringFunction(str, true); + + GenerateDebuggerTypeProxy(str); + + + // Internal members last + if (m_Columns == 1 && m_BaseType != "half") + { + GenerateSelectShuffleComponentImplementation(mathStr); + } + + str.Append("\t}\n\n"); + + str.Append("\tpublic static partial class math\n"); + str.Append("\t{\n"); + str.Append(mathStr); + str.Append("\t}\n}\n"); + } + + private void GenerateSelectShuffleComponentImplementation(StringBuilder str) + { + if (m_Columns > 1) + return; + + str.Append("\t\t[MethodImpl(MethodImplOptions.AggressiveInlining)]\n"); + str.AppendFormat("\t\tinternal static {0} select_shuffle_component({1} a, {1} b, ShuffleComponent component)\n", m_BaseType, m_TypeName); + str.Append("\t\t{\n"); + str.Append("\t\t\tswitch(component)\n"); + str.Append("\t\t\t{\n"); + for(int i = 0; i < m_Rows; i++) + { + str.AppendFormat("\t\t\t\tcase ShuffleComponent.{0}:\n", shuffleComponents[i]); + str.AppendFormat("\t\t\t\t\treturn a{0};\n", m_Rows > 1 ? "." + vectorFields[i] : ""); + } + for (int i = 0; i < m_Rows; i++) + { + str.AppendFormat("\t\t\t\tcase ShuffleComponent.{0}:\n", shuffleComponents[i + 4]); + str.AppendFormat("\t\t\t\t\treturn b{0};\n", m_Rows > 1 ? "." + vectorFields[i] : ""); + } + str.Append("\t\t\t\tdefault:\n"); + str.Append("\t\t\t\t\tthrow new System.ArgumentException(\"Invalid shuffle component: \" + component);\n"); + str.Append("\t\t\t}\n"); + str.Append("\t\t}\n\n"); + } + + private void GenerateShuffleImplementation(StringBuilder str) + { + if (m_Columns > 1 || m_BaseType == "half") + return; + + for (int resultComponents = 1; resultComponents <= 4; resultComponents++) + { + string resultType = ToTypeName(m_BaseType, resultComponents, 1); + + str.AppendFormat("\t\t/// Returns the result of specified shuffling of the components from {0} into {1}.\n", + ToValueDescription(m_BaseType, m_Rows, m_Columns, 2), ToValueDescription(m_BaseType, resultComponents, m_Columns, 1)); + str.AppendFormat($"\t\t/// {ToTypeName(m_BaseType, m_Rows, m_Columns)} to use as the left argument of the shuffle operation.\n"); + str.AppendFormat($"\t\t/// {ToTypeName(m_BaseType, m_Rows, m_Columns)} to use as the right argument of the shuffle operation.\n"); + + if (resultComponents == 1) + { + str.AppendFormat($"\t\t/// The ShuffleComponent to use when setting the resulting {resultType}.\n"); + } + else + { + for (int i = 0; i < resultComponents; ++i) + { + str.AppendFormat($"\t\t/// The ShuffleComponent to use when setting the resulting {resultType} {vectorFields[i]} component.\n"); + } + } + + str.AppendFormat($"\t\t/// {resultType} result of the shuffle operation.\n"); + str.Append("\t\t[MethodImpl(MethodImplOptions.AggressiveInlining)]\n"); + str.AppendFormat("\t\tpublic static {0} shuffle({1} left, {2} right", resultType, m_TypeName, m_TypeName); + for(int i = 0; i < resultComponents; i++) + { + str.AppendFormat(", ShuffleComponent {0}", vectorFields[i]); + } + str.Append(")\n"); + str.Append("\t\t{\n"); + + if(resultComponents != 1) + str.AppendFormat("\t\t\treturn {0}(\n", resultType); + else + str.AppendFormat("\t\t\treturn ", resultType); + + for(int i = 0; i < resultComponents; i++) + { + if (resultComponents != 1) + str.Append("\t\t\t\t"); + + str.AppendFormat("select_shuffle_component(left, right, {0})", vectorFields[i]); + if(i != resultComponents - 1) + str.Append(",\n"); + } + + if (resultComponents != 1) + str.Append(");\n"); + else + str.Append(";\n"); + + str.Append("\t\t}\n\n"); + } + } + + enum GenerateMulType + { + Mul, + Rotate, + Transform + } + + private void GenerateMulImplementation(string name, string baseType, StringBuilder str, int lhsRows, int lhsColumns, int rhsRows, int rhsColumns, bool doTranslation, GenerateMulType mulType) + { + // mul(a,b): if a is vector it is treated as a row vector. if b is a vector it is treaded as a column vector. + bool isResultRowVector = (lhsRows == 1 && lhsColumns > 1); + int resultRows = (lhsColumns != rhsRows) ? rhsRows : lhsRows; + string resultType = ToTypeName(baseType, resultRows, rhsColumns); + string lhsType = ToTypeName(baseType, lhsRows, lhsColumns); + string rhsType = ToTypeName(baseType, rhsRows, rhsColumns); + + bool isScalarResult = (resultRows == 1 && rhsColumns == 1); + + switch (mulType) + { + case GenerateMulType.Mul: + str.AppendFormat("\t\t/// Returns the {0} result of a matrix multiplication between {1} and {2}.\n", + ToValueDescription(baseType, resultRows, rhsColumns, 0, true), + ToValueDescription(baseType, lhsRows, lhsColumns, 1, true), + ToValueDescription(baseType, rhsRows, rhsColumns, 1, true)); + str.AppendFormat("\t\t/// Left hand side argument of the matrix multiply.\n"); + str.AppendFormat("\t\t/// Right hand side argument of the matrix multiply.\n"); + str.AppendFormat("\t\t/// The computed matrix multiplication.\n"); + break; + case GenerateMulType.Rotate: + str.AppendFormat("\t\t/// {0}\n", string.Format("Return the result of rotating a {0} vector by a {1} matrix", ToTypeName(m_BaseType, rhsRows, rhsColumns), ToTypeName(m_BaseType, lhsRows, lhsColumns))); + str.AppendFormat("\t\t/// Left hand side matrix argument that specifies the rotation.\n"); + str.AppendFormat("\t\t/// Right hand side vector argument to be rotated.\n"); + str.AppendFormat("\t\t/// The rotated vector.\n"); + break; + case GenerateMulType.Transform: + str.AppendFormat("\t\t/// {0}\n", string.Format("Return the result of transforming a {0} point by a {1} matrix", ToTypeName(m_BaseType, rhsRows, rhsColumns), ToTypeName(m_BaseType, lhsRows, lhsColumns))); + str.AppendFormat("\t\t/// Left hand side matrix argument that specifies the transformation.\n"); + str.AppendFormat("\t\t/// Right hand side point argument to be transformed.\n"); + str.AppendFormat("\t\t/// The transformed point.\n"); + break; + } + + bool needsSwizzle = (resultRows != lhsRows); + + str.Append("\t\t[MethodImpl(MethodImplOptions.AggressiveInlining)]\n"); + str.AppendFormat("\t\tpublic static {1} {0}({2} a, {3} b)\n", name, resultType, lhsType, rhsType); + str.Append("\t\t{\n"); + + str.Append("\t\t\treturn "); + + bool needsParen = rhsColumns > 1 || needsSwizzle; + + if (rhsColumns > 1) + str.Append(resultType); + if (needsParen) + str.Append("("); + + for (int i = 0; i < rhsColumns; i++) + { + if (i > 0 || rhsColumns > 1) + str.Append("\n\t\t\t\t"); + for (int j = 0; j < lhsColumns; j++) + { + if(j < rhsRows || doTranslation) + { + if (j != 0) + str.Append(" + "); + + if (lhsRows == 1 && lhsColumns == 1) + str.Append("a"); + else if (lhsRows == 1 || lhsColumns == 1) + str.Append("a." + vectorFields[j]); + else + str.Append("a." + matrixFields[j]); + + if(j < rhsRows) + { + str.Append(" * "); + + if (rhsRows == 1 && rhsColumns == 1) + str.Append("b"); + else if (rhsRows == 1 || rhsColumns == 1) + str.Append("b." + vectorFields[j]); + else + str.Append("b." + matrixFields[i] + "." + vectorFields[j]); + } + } + + } + + if (i != rhsColumns - 1) + str.Append(","); + } + if (needsParen) + str.Append(")"); + if (needsSwizzle) + str.Append("." + GenerateComponentRangeString(0, resultRows)); + + str.Append(";\n"); + str.Append("\t\t}\n\n"); + } + + private void GenerateMulImplementations(string baseType, StringBuilder str) + { + // typenxk = mul(typenxm, typemxk) + for(int n = 1; n <= 4; n++) + { + for(int m = 1; m <= 4; m++) + { + for(int k = 1; k <= 4; k++) + { + // mul(a,b): if a is vector it is treated as a row vector. if b is a vector it is treaded as a column vector. + + if (n > 1 && m == 1) + continue; // lhs cannot be column vector + if (m == 1 && k > 1) + continue; // rhs cannot be row vector + + GenerateMulImplementation("mul", baseType, str, n, m, m, k, false, GenerateMulType.Mul); + } + } + } + } + + private void GenerateMatrixImplementation(StringBuilder str) + { + str.Append("using System;\n"); + str.Append("using System.Runtime.CompilerServices;\n"); + str.Append("\n"); + str.Append("namespace Unity.Mathematics\n"); + str.Append("{\n"); + str.Append("\tpartial class math\n"); + str.Append("\t{\n"); + + GenerateMulImplementations("float", str); + GenerateMulImplementations("double", str); + GenerateMulImplementations("int", str); + GenerateMulImplementations("uint", str); + + str.Append("\t}\n"); + str.Append("}\n"); + } + + private string GenerateComponentRangeString(int componentIndex, int numComponents) + { + string result = ""; + for(int i = 0; i < numComponents; i++) + { + result += components[componentIndex + i]; + } + return result; + } + + // Generate constructor and static constructor with a given component partitioning of input parameters + private void GenerateVectorConstructor(int numComponents, int numParameters, int[] parameterComponents, StringBuilder constructorStr, StringBuilder mathStr) + { + // Generate signatures + string dstTypeCategory = (m_Columns > 1) ? "matrix" : "vector"; + + StringBuilder descriptionStr = new StringBuilder(); + { + int idx = 0; + bool first = true; + while(true) + { + int paramComponents = parameterComponents[idx]; + string paramType = ToTypeName(m_BaseType, paramComponents, 1); + + int n = 1; + while(idx + 1 < numParameters && parameterComponents[idx + 1] == paramComponents) + { + n++; + idx++; + } + idx++; + + bool last = (idx == numParameters); + if (!first) + descriptionStr.Append(last ? " and " : ", "); + + descriptionStr.Append(ToValueDescription(m_BaseType, paramComponents, 1, n)); + if (last) + break; + first = false; + } + } + + + constructorStr.AppendFormat("\t\t/// Constructs a {0} {1} from {2}.\n", m_TypeName, dstTypeCategory, descriptionStr.ToString()); + + int componentIndex = 0; + for (int i = 0; i < numParameters; ++i) + { + int paramComponents = parameterComponents[i]; + string componentString = GenerateComponentRangeString(componentIndex, paramComponents); + string componentPluralOrSingular = paramComponents > 1 ? "components" : "component"; + constructorStr.Append($"\t\t/// The constructed vector's {componentString} {componentPluralOrSingular} will be set to this value.\n"); + componentIndex += paramComponents; + } + + constructorStr.Append("\t\t[MethodImpl(MethodImplOptions.AggressiveInlining)]\n"); + constructorStr.Append("\t\tpublic "); + constructorStr.Append(m_TypeName); + constructorStr.Append("("); + + mathStr.AppendFormat("\t\t/// Returns a {0} {1} constructed from {2}.\n", m_TypeName, dstTypeCategory, descriptionStr.ToString()); + + componentIndex = 0; + for (int i = 0; i < numParameters; ++i) + { + int paramComponents = parameterComponents[i]; + string componentString = GenerateComponentRangeString(componentIndex, paramComponents); + string componentPluralOrSingular = paramComponents > 1 ? "components" : "component"; + mathStr.Append($"\t\t/// The constructed vector's {componentString} {componentPluralOrSingular} will be set to this value.\n"); + componentIndex += paramComponents; + } + + mathStr.Append($"\t\t/// {m_TypeName} constructed from arguments.\n"); + mathStr.Append("\t\t[MethodImpl(MethodImplOptions.AggressiveInlining)]\n"); + mathStr.Append("\t\tpublic static "); + mathStr.Append(m_TypeName); + mathStr.Append(" "); + mathStr.Append(m_TypeName); + mathStr.Append("("); + + componentIndex = 0; + for (int i = 0; i < numParameters; i++) + { + if (i != 0) + { + constructorStr.Append(", "); + mathStr.Append(", "); + } + + int paramComponents = parameterComponents[i]; + string paramType = ToTypeName(m_BaseType, paramComponents, 1); + string componentString = GenerateComponentRangeString(componentIndex, paramComponents); + + constructorStr.Append(paramType); + constructorStr.Append(" "); + constructorStr.Append(componentString); + mathStr.Append(paramType); + mathStr.Append(" "); + mathStr.Append(componentString); + componentIndex += paramComponents; + } + constructorStr.Append(")\n"); + mathStr.Append(")"); + + // Generate function bodies + constructorStr.Append("\t\t{ "); + mathStr.Append(" { return new "); + mathStr.Append(m_TypeName); + mathStr.Append("("); + + componentIndex = 0; + for (int i = 0; i < numParameters; i++) + { + int paramComponents = parameterComponents[i]; + string componentString = GenerateComponentRangeString(componentIndex, paramComponents); + for (int j = 0; j < paramComponents; j++) + { + constructorStr.Append("\n\t\t\tthis."); + constructorStr.Append(components[componentIndex]); + constructorStr.Append(" = "); + constructorStr.Append(componentString); + if (paramComponents > 1) + { + constructorStr.Append("."); + constructorStr.Append(components[j]); + } + constructorStr.Append(";"); + componentIndex++; + } + + if (i != 0) + { + mathStr.Append(", "); + } + mathStr.Append(componentString); + } + + constructorStr.Append("\n\t\t}\n\n"); + mathStr.Append("); }\n\n"); + } + + // Recursively generate all constructor variants with every possibly partition or the components + private void GenerateVectorConstructors(int numRemainingComponents, int numComponents, int numParameters, int[] parameterComponents, StringBuilder constructorStr, StringBuilder mathStr) + { + if (numRemainingComponents == 0) + { + GenerateVectorConstructor(numComponents, numParameters, parameterComponents, constructorStr, mathStr); + } + + for(int i = 1; i <= numRemainingComponents; i++) + { + parameterComponents[numParameters] = i; + GenerateVectorConstructors(numRemainingComponents - i, numComponents, numParameters + 1, parameterComponents, constructorStr, mathStr); + } + } + + public void GenerateMatrixColumnConstructor(StringBuilder constructorStr, StringBuilder mathStr) + { + // Generate signatures + string columnType = ToTypeName(m_BaseType, m_Rows, 1); + string columnDescription = ToValueDescription(m_BaseType, m_Rows, 1, m_Columns); + constructorStr.AppendFormat("\t\t/// Constructs a {0} matrix from {1}.\n", m_TypeName, columnDescription); + + for (int col = 0; col < m_Columns; ++col) + { + constructorStr.Append($"\t\t/// The matrix column {matrixFields[col]} will be set to this value.\n"); + } + + constructorStr.Append("\t\t[MethodImpl(MethodImplOptions.AggressiveInlining)]\n"); + constructorStr.Append("\t\tpublic "); + constructorStr.Append(m_TypeName); + constructorStr.Append("("); + + mathStr.AppendFormat("\t\t/// Returns a {0} matrix constructed from {1}.\n", m_TypeName, columnDescription); + + for (int col = 0; col < m_Columns; ++col) + { + mathStr.Append($"\t\t/// The matrix column {matrixFields[col]} will be set to this value.\n"); + } + + mathStr.Append($"\t\t/// {m_TypeName} constructed from arguments.\n"); + mathStr.Append("\t\t[MethodImpl(MethodImplOptions.AggressiveInlining)]\n"); + mathStr.Append("\t\tpublic static "); + mathStr.Append(m_TypeName); + mathStr.Append(" "); + mathStr.Append(m_TypeName); + mathStr.Append("("); + + for (int column = 0; column < m_Columns; column++) + { + if (column != 0) + { + constructorStr.Append(", "); + mathStr.Append(", "); + } + + constructorStr.Append(columnType); + constructorStr.Append(" "); + constructorStr.Append(matrixFields[column]); + mathStr.Append(columnType); + mathStr.Append(" "); + mathStr.Append(matrixFields[column]); + } + constructorStr.Append(")\n"); + mathStr.Append(")"); + + // Generate function bodies + constructorStr.Append("\t\t{ "); + mathStr.Append(" { return new "); + mathStr.Append(m_TypeName); + mathStr.Append("("); + + for (int column = 0; column < m_Columns; column++) + { + constructorStr.Append("\n\t\t\tthis."); + constructorStr.Append(matrixFields[column]); + constructorStr.Append(" = "); + constructorStr.Append(matrixFields[column]); + constructorStr.Append(";"); + + if (column != 0) + { + mathStr.Append(", "); + } + mathStr.Append(matrixFields[column]); + } + + constructorStr.Append("\n\t\t}\n\n"); + mathStr.Append("); }\n\n"); + } + + public void GenerateMatrixRowConstructor(StringBuilder constructorStr, StringBuilder mathStr) + { + // Generate signatures + constructorStr.AppendFormat("\t\t/// Constructs a {0} matrix from {1} {2} values given in row-major order.\n", m_TypeName, m_Rows * m_Columns, m_BaseType); + + for (int row = 0; row < m_Rows; ++row) + { + for (int col = 0; col < m_Columns; ++col) + { + constructorStr.Append($"\t\t/// The matrix at row {row}, column {col} will be set to this value.\n"); + } + } + + constructorStr.Append("\t\t[MethodImpl(MethodImplOptions.AggressiveInlining)]\n"); + constructorStr.Append("\t\tpublic "); + constructorStr.Append(m_TypeName); + constructorStr.Append("("); + mathStr.AppendFormat("\t\t/// Returns a {0} matrix constructed from from {1} {2} values given in row-major order.\n", m_TypeName, m_Rows * m_Columns, m_BaseType); + + for (int row = 0; row < m_Rows; ++row) + { + for (int col = 0; col < m_Columns; ++col) + { + mathStr.Append($"\t\t/// The matrix at row {row}, column {col} will be set to this value.\n"); + } + } + + mathStr.Append($"\t\t/// {m_TypeName} constructed from arguments.\n"); + mathStr.Append("\t\t[MethodImpl(MethodImplOptions.AggressiveInlining)]\n"); + mathStr.Append("\t\tpublic static "); + mathStr.Append(m_TypeName); + mathStr.Append(" "); + mathStr.Append(m_TypeName); + mathStr.Append("("); + string indent0 = new string(' ', m_TypeName.Length + 16); + string indent1 = new string(' ', m_TypeName.Length*2 + 24); + string indent2 = new string(' ', m_TypeName.Length + 24); + + for (int row = 0; row < m_Rows; row++) + { + if(row != 0) + { + constructorStr.Append(indent0); + mathStr.Append(indent1); + } + for (int column = 0; column < m_Columns; column++) + { + string paramName = "m" + row + column; + constructorStr.Append(m_BaseType); + constructorStr.Append(" "); + constructorStr.Append(paramName); + mathStr.Append(m_BaseType); + mathStr.Append(" "); + mathStr.Append(paramName); + + //string separator = (row == m_Rows - 1) ? (column == m_Columns - 1) ? "," : ", " : ", "; + string separator = (column == m_Columns - 1) ? (row == m_Rows - 1) ? ")\n" : ",\n" : ", "; + constructorStr.Append(separator); + mathStr.Append(separator); + } + } + + string columnType = ToTypeName(m_BaseType, m_Rows, 1); + + // constructor body + constructorStr.Append("\t\t{ "); + for (int column = 0; column < m_Columns; column++) + { + constructorStr.AppendFormat("\n\t\t\tthis.{0} = new {1}(", matrixFields[column], columnType); + + for (int row = 0; row < m_Rows; row++) + { + constructorStr.Append("m" + row + column); + + if (row != m_Rows - 1) + { + constructorStr.Append(", "); + } + } + + constructorStr.Append(");"); + } + constructorStr.Append("\n\t\t}\n\n"); + + // static constructor body + mathStr.AppendFormat("\t\t{{\n\t\t\treturn new {0}(", m_TypeName); + for (int row = 0; row < m_Rows; row++) + { + if (row != 0) + { + mathStr.Append(indent2); + } + for (int column = 0; column < m_Columns; column++) + { + string paramName = "m" + row + column; + mathStr.Append(paramName); + + //string separator = (row == m_Rows - 1) ? (column == m_Columns - 1) ? "," : ", " : ", "; + string separator = (column == m_Columns - 1) ? (row == m_Rows - 1) ? ");" : ",\n" : ", "; + mathStr.Append(separator); + } + } + mathStr.Append("\n\t\t}\n\n"); + } + + public void GenerateMatrixConstructors(StringBuilder constructorStr, StringBuilder mathStr) + { + GenerateMatrixColumnConstructor(constructorStr, mathStr); + GenerateMatrixRowConstructor(constructorStr, mathStr); + } + + public void GenerateConstructors(StringBuilder constructorStr, StringBuilder mathStr) + { + if(m_Columns == 1) + { + int[] parameterComponenets = new int[4]; + GenerateVectorConstructors(m_Rows, m_Rows, 0, parameterComponenets, constructorStr, mathStr); + } + else + { + GenerateMatrixConstructors(constructorStr, mathStr); + } + } + + public void GenerateOperators(StringBuilder str) + { + string resultType = m_BaseType; + string resultBoolType = "bool"; + + if (0 != (m_Features & Features.Arithmetic)) + { + GenerateBinaryOperator(m_Rows, m_Columns, "*", resultType, str, "multiplication"); + + GenerateBinaryOperator(m_Rows, m_Columns, "+", resultType, str, "addition"); + + GenerateBinaryOperator(m_Rows, m_Columns, "-", resultType, str, "subtraction"); + + GenerateBinaryOperator(m_Rows, m_Columns, "/", resultType, str, "division"); + + GenerateBinaryOperator(m_Rows, m_Columns, "%", resultType, str, "modulus"); + + GenerateUnaryOperator("++", str, "increment"); + + GenerateUnaryOperator("--", str, "decrement"); + + GenerateBinaryOperator(m_Rows, m_Columns, "<", resultBoolType, str, "less than"); + GenerateBinaryOperator(m_Rows, m_Columns, "<=", resultBoolType, str, "less or equal"); + + GenerateBinaryOperator(m_Rows, m_Columns, ">", resultBoolType, str, "greater than"); + GenerateBinaryOperator(m_Rows, m_Columns, ">=", resultBoolType, str, "greater or equal"); + } + + if (0 != (m_Features & Features.UnaryNegation)) + { + GenerateUnaryOperator("-", str, "unary minus"); + GenerateUnaryOperator("+", str, "unary plus"); + } + + if (0 != (m_Features & Features.Shifts)) + { + GenerateShiftOperator(m_Rows, "<<", resultType, str, "left shift"); + GenerateShiftOperator(m_Rows, ">>", resultType, str, "right shift"); + } + + GenerateBinaryOperator(m_Rows, m_Columns, "==", resultBoolType, str, "equality"); + GenerateBinaryOperator(m_Rows, m_Columns, "!=", resultBoolType, str, "not equal"); + + if (0 != (m_Features & Features.BitwiseComplement)) + { + GenerateUnaryOperator("~", str, "bitwise not"); + } + + if(m_BaseType == "bool") + { + GenerateUnaryOperator("!", str, "not"); + } + + if (0 != (m_Features & Features.BitwiseLogic)) + { + GenerateBinaryOperator(m_Rows, m_Columns, "&", resultType, str, "bitwise and"); + GenerateBinaryOperator(m_Rows, m_Columns, "|", resultType, str, "bitwise or"); + GenerateBinaryOperator(m_Rows, m_Columns, "^", resultType, str, "bitwise exclusive or"); + + } + } + + private void GeneratePrimeUIntVector(StringBuilder str, int n) + { + str.AppendFormat("uint{0}(", n); + for (int row = 0; row < n; row++) + { + if (row != 0) + str.Append(", "); + str.AppendFormat("0x{0:X}u", NextPrime()); + } + str.Append(")"); + } + + public void GenerateTransposeFunction(StringBuilder str) + { + if (m_Columns == 1 || m_Rows == 1) + return; + + string resultType = ToTypeName(m_BaseType, m_Columns, m_Rows); + str.AppendFormat("\t\t/// Return the {0} transpose of a {1} matrix.\n", resultType, m_TypeName); + str.Append($"\t\t/// Value to transpose.\n"); + str.Append($"\t\t/// Transposed value.\n"); + str.Append("\t\t[MethodImpl(MethodImplOptions.AggressiveInlining)]\n"); + str.AppendFormat("\t\tpublic static {0} transpose({1} v)\n", resultType, m_TypeName); + str.Append("\t\t{\n"); + + str.AppendFormat("\t\t\treturn {0}(\n", resultType); + for(int i = 0; i < m_Columns; i++) + { + str.Append("\t\t\t\t"); + for(int j = 0; j < m_Rows; j++) + { + if (j != 0) + str.Append(", "); + str.AppendFormat("v.c{0}.{1}", i, vectorFields[j]); + } + if(i != m_Columns - 1) + str.Append(",\n"); + } + + str.Append(");\n"); + str.Append("\t\t}\n\n"); + } + + public void GenerateInverseFunction(StringBuilder str) + { + if (m_Rows != m_Columns || m_Rows == 1) + return; + + if (m_BaseType != "float" && m_BaseType != "double") + return; + + string oneStr = ToTypedLiteral(m_BaseType, 1); + + if(m_Rows == 2) + { + str.AppendFormat(" /// Returns the {0}2x2 full inverse of a {0}2x2 matrix.\n", m_BaseType); + str.AppendFormat(" /// Matrix to invert.\n"); + str.AppendFormat(" /// The inverted matrix.\n"); + str.AppendFormat(@" [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static {0}2x2 inverse({0}2x2 m) + {{ + {0} a = m.c0.x; + {0} b = m.c1.x; + {0} c = m.c0.y; + {0} d = m.c1.y; + + {0} det = a * d - b * c; + + return {0}2x2(d, -b, -c, a) * ({1} / det); + }} + +", + m_BaseType, oneStr); + } + else if(m_Rows == 3) + { + str.AppendFormat(" /// Returns the {0}3x3 full inverse of a {0}3x3 matrix.\n", m_BaseType); + str.AppendFormat(" /// Matrix to invert.\n"); + str.AppendFormat(" /// The inverted matrix.\n"); + str.AppendFormat(@" public static {0}3x3 inverse({0}3x3 m) + {{ + {0}3 c0 = m.c0; + {0}3 c1 = m.c1; + {0}3 c2 = m.c2; + + {0}3 t0 = {0}3(c1.x, c2.x, c0.x); + {0}3 t1 = {0}3(c1.y, c2.y, c0.y); + {0}3 t2 = {0}3(c1.z, c2.z, c0.z); + + {0}3 m0 = t1 * t2.yzx - t1.yzx * t2; + {0}3 m1 = t0.yzx * t2 - t0 * t2.yzx; + {0}3 m2 = t0 * t1.yzx - t0.yzx * t1; + + {0} rcpDet = {1} / csum(t0.zxy * m0); + return {0}3x3(m0, m1, m2) * rcpDet; + }} + +", + m_BaseType, oneStr); + } + else if(m_Rows == 4) + { + str.AppendFormat(" /// Returns the {0}4x4 full inverse of a {0}4x4 matrix.\n", m_BaseType); + str.AppendFormat(" /// Matrix to invert.\n"); + str.AppendFormat(" /// The inverted matrix.\n"); + str.AppendFormat(@" public static {0}4x4 inverse({0}4x4 m) + {{ + {0}4 c0 = m.c0; + {0}4 c1 = m.c1; + {0}4 c2 = m.c2; + {0}4 c3 = m.c3; + + {0}4 r0y_r1y_r0x_r1x = movelh(c1, c0); + {0}4 r0z_r1z_r0w_r1w = movelh(c2, c3); + {0}4 r2y_r3y_r2x_r3x = movehl(c0, c1); + {0}4 r2z_r3z_r2w_r3w = movehl(c3, c2); + + {0}4 r1y_r2y_r1x_r2x = shuffle(c1, c0, ShuffleComponent.LeftY, ShuffleComponent.LeftZ, ShuffleComponent.RightY, ShuffleComponent.RightZ); + {0}4 r1z_r2z_r1w_r2w = shuffle(c2, c3, ShuffleComponent.LeftY, ShuffleComponent.LeftZ, ShuffleComponent.RightY, ShuffleComponent.RightZ); + {0}4 r3y_r0y_r3x_r0x = shuffle(c1, c0, ShuffleComponent.LeftW, ShuffleComponent.LeftX, ShuffleComponent.RightW, ShuffleComponent.RightX); + {0}4 r3z_r0z_r3w_r0w = shuffle(c2, c3, ShuffleComponent.LeftW, ShuffleComponent.LeftX, ShuffleComponent.RightW, ShuffleComponent.RightX); + + {0}4 r0_wzyx = shuffle(r0z_r1z_r0w_r1w, r0y_r1y_r0x_r1x, ShuffleComponent.LeftZ, ShuffleComponent.LeftX, ShuffleComponent.RightX, ShuffleComponent.RightZ); + {0}4 r1_wzyx = shuffle(r0z_r1z_r0w_r1w, r0y_r1y_r0x_r1x, ShuffleComponent.LeftW, ShuffleComponent.LeftY, ShuffleComponent.RightY, ShuffleComponent.RightW); + {0}4 r2_wzyx = shuffle(r2z_r3z_r2w_r3w, r2y_r3y_r2x_r3x, ShuffleComponent.LeftZ, ShuffleComponent.LeftX, ShuffleComponent.RightX, ShuffleComponent.RightZ); + {0}4 r3_wzyx = shuffle(r2z_r3z_r2w_r3w, r2y_r3y_r2x_r3x, ShuffleComponent.LeftW, ShuffleComponent.LeftY, ShuffleComponent.RightY, ShuffleComponent.RightW); + {0}4 r0_xyzw = shuffle(r0y_r1y_r0x_r1x, r0z_r1z_r0w_r1w, ShuffleComponent.LeftZ, ShuffleComponent.LeftX, ShuffleComponent.RightX, ShuffleComponent.RightZ); + + // Calculate remaining inner term pairs. inner terms have zw=-xy, so we only have to calculate xy and can pack two pairs per vector. + {0}4 inner12_23 = r1y_r2y_r1x_r2x * r2z_r3z_r2w_r3w - r1z_r2z_r1w_r2w * r2y_r3y_r2x_r3x; + {0}4 inner02_13 = r0y_r1y_r0x_r1x * r2z_r3z_r2w_r3w - r0z_r1z_r0w_r1w * r2y_r3y_r2x_r3x; + {0}4 inner30_01 = r3z_r0z_r3w_r0w * r0y_r1y_r0x_r1x - r3y_r0y_r3x_r0x * r0z_r1z_r0w_r1w; + + // Expand inner terms back to 4 components. zw signs still need to be flipped + {0}4 inner12 = shuffle(inner12_23, inner12_23, ShuffleComponent.LeftX, ShuffleComponent.LeftZ, ShuffleComponent.RightZ, ShuffleComponent.RightX); + {0}4 inner23 = shuffle(inner12_23, inner12_23, ShuffleComponent.LeftY, ShuffleComponent.LeftW, ShuffleComponent.RightW, ShuffleComponent.RightY); + + {0}4 inner02 = shuffle(inner02_13, inner02_13, ShuffleComponent.LeftX, ShuffleComponent.LeftZ, ShuffleComponent.RightZ, ShuffleComponent.RightX); + {0}4 inner13 = shuffle(inner02_13, inner02_13, ShuffleComponent.LeftY, ShuffleComponent.LeftW, ShuffleComponent.RightW, ShuffleComponent.RightY); + + // Calculate minors + {0}4 minors0 = r3_wzyx * inner12 - r2_wzyx * inner13 + r1_wzyx * inner23; + + {0}4 denom = r0_xyzw * minors0; + + // Horizontal sum of denominator. Free sign flip of z and w compensates for missing flip in inner terms. + denom = denom + shuffle(denom, denom, ShuffleComponent.LeftY, ShuffleComponent.LeftX, ShuffleComponent.RightW, ShuffleComponent.RightZ); // x+y x+y z+w z+w + denom = denom - shuffle(denom, denom, ShuffleComponent.LeftZ, ShuffleComponent.LeftZ, ShuffleComponent.RightX, ShuffleComponent.RightX); // x+y-z-w x+y-z-w z+w-x-y z+w-x-y + + {0}4 rcp_denom_ppnn = {0}4({1}) / denom; + {0}4x4 res; + res.c0 = minors0 * rcp_denom_ppnn; + + {0}4 inner30 = shuffle(inner30_01, inner30_01, ShuffleComponent.LeftX, ShuffleComponent.LeftZ, ShuffleComponent.RightZ, ShuffleComponent.RightX); + {0}4 inner01 = shuffle(inner30_01, inner30_01, ShuffleComponent.LeftY, ShuffleComponent.LeftW, ShuffleComponent.RightW, ShuffleComponent.RightY); + + {0}4 minors1 = r2_wzyx * inner30 - r0_wzyx * inner23 - r3_wzyx * inner02; + res.c1 = minors1 * rcp_denom_ppnn; + + {0}4 minors2 = r0_wzyx * inner13 - r1_wzyx * inner30 - r3_wzyx * inner01; + res.c2 = minors2 * rcp_denom_ppnn; + + {0}4 minors3 = r1_wzyx * inner02 - r0_wzyx * inner12 + r2_wzyx * inner01; + res.c3 = minors3 * rcp_denom_ppnn; + return res; + }} + +", + m_BaseType, oneStr); + } + + } + + public void GenerateFastInverseFunction(StringBuilder str) + { + if (m_BaseType != "float" && m_BaseType != "double") + return; + + string zeroStr = ToTypedLiteral(m_BaseType, 0); + string oneStr = ToTypedLiteral(m_BaseType, 1); + + if(m_Columns == 4 && m_Rows == 3) + { + str.AppendFormat(" /// Fast matrix inverse for rigid transforms (orthonormal basis and translation)\n"); + str.AppendFormat(" /// Matrix to invert.\n"); + str.AppendFormat(" /// The inverted matrix.\n"); + str.AppendFormat(@" public static {0}3x4 fastinverse({0}3x4 m) + {{ + {0}3 c0 = m.c0; + {0}3 c1 = m.c1; + {0}3 c2 = m.c2; + {0}3 pos = m.c3; + + {0}3 r0 = {0}3(c0.x, c1.x, c2.x); + {0}3 r1 = {0}3(c0.y, c1.y, c2.y); + {0}3 r2 = {0}3(c0.z, c1.z, c2.z); + + pos = -(r0 * pos.x + r1 * pos.y + r2 * pos.z); + + return {0}3x4(r0, r1, r2, pos); + }} + +", + m_BaseType); + + } else if(m_Columns == 4 && m_Rows == 4) + { + str.AppendFormat(" /// Fast matrix inverse for rigid transforms (orthonormal basis and translation)\n"); + str.AppendFormat(" /// Matrix to invert.\n"); + str.AppendFormat(" /// The inverted matrix.\n"); + str.AppendFormat(@" public static {0}4x4 fastinverse({0}4x4 m) + {{ + {0}4 c0 = m.c0; + {0}4 c1 = m.c1; + {0}4 c2 = m.c2; + {0}4 pos = m.c3; + + {0}4 zero = {0}4(0); + + {0}4 t0 = unpacklo(c0, c2); + {0}4 t1 = unpacklo(c1, zero); + {0}4 t2 = unpackhi(c0, c2); + {0}4 t3 = unpackhi(c1, zero); + + {0}4 r0 = unpacklo(t0, t1); + {0}4 r1 = unpackhi(t0, t1); + {0}4 r2 = unpacklo(t2, t3); + + pos = -(r0 * pos.x + r1 * pos.y + r2 * pos.z); + pos.w = 1.0f; + + return {0}4x4(r0, r1, r2, pos); + }} + +", + m_BaseType, zeroStr, oneStr); + } + + } + + + public void GenerateDeterminantFunction(StringBuilder str) + { + if (m_Rows != m_Columns || m_Rows == 1) + return; + + if (m_BaseType != "float" && m_BaseType != "double" && m_BaseType != "int") + return; + + str.Append($"\t\t/// Returns the determinant of a {ToTypeName(m_BaseType, m_Rows, m_Columns)} matrix.\n"); + str.Append($"\t\t/// Matrix to use when computing determinant.\n"); + str.Append($"\t\t/// The determinant of the matrix.\n"); + + if (m_Rows == 2) + { + str.AppendFormat(@" [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static {0} determinant({0}2x2 m) + {{ + {0} a = m.c0.x; + {0} b = m.c1.x; + {0} c = m.c0.y; + {0} d = m.c1.y; + + return a * d - b * c; + }} + +", + m_BaseType); + } + else if (m_Rows == 3) + { + str.AppendFormat(@" [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static {0} determinant({0}3x3 m) + {{ + {0}3 c0 = m.c0; + {0}3 c1 = m.c1; + {0}3 c2 = m.c2; + + {0} m00 = c1.y * c2.z - c1.z * c2.y; + {0} m01 = c0.y * c2.z - c0.z * c2.y; + {0} m02 = c0.y * c1.z - c0.z * c1.y; + + return c0.x * m00 - c1.x * m01 + c2.x * m02; + }} + +", + m_BaseType); + } + else if (m_Rows == 4) + { + str.AppendFormat(@" public static {0} determinant({0}4x4 m) + {{ + {0}4 c0 = m.c0; + {0}4 c1 = m.c1; + {0}4 c2 = m.c2; + {0}4 c3 = m.c3; + + {0} m00 = c1.y * (c2.z * c3.w - c2.w * c3.z) - c2.y * (c1.z * c3.w - c1.w * c3.z) + c3.y * (c1.z * c2.w - c1.w * c2.z); + {0} m01 = c0.y * (c2.z * c3.w - c2.w * c3.z) - c2.y * (c0.z * c3.w - c0.w * c3.z) + c3.y * (c0.z * c2.w - c0.w * c2.z); + {0} m02 = c0.y * (c1.z * c3.w - c1.w * c3.z) - c1.y * (c0.z * c3.w - c0.w * c3.z) + c3.y * (c0.z * c1.w - c0.w * c1.z); + {0} m03 = c0.y * (c1.z * c2.w - c1.w * c2.z) - c1.y * (c0.z * c2.w - c0.w * c2.z) + c2.y * (c0.z * c1.w - c0.w * c1.z); + + return c0.x * m00 - c1.x * m01 + c2.x * m02 - c3.x * m03; + }} + +", + m_BaseType); + } + + } + + + public void GenerateHashFunction(StringBuilder str, bool wide) + { + string returnType = wide ? ToTypeName("uint", m_Rows, 1) : "uint"; + string functionName = wide ? "hashwide" : "hash"; + string matrixOrVector = m_Columns > 1 ? "matrix" : "vector"; + string capitalMatrixOrVector = m_Columns > 1 ? "Matrix" : "Vector"; + + if(wide) + { + str.AppendFormat("\t\t/// \n" + + "\t\t/// Returns a {0} vector hash code of a {1} {2}.\n" + + "\t\t/// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash\n" + + "\t\t/// that are only reduced to a narrow uint hash at the very end instead of at every step.\n" + + "\t\t/// \n", returnType, m_TypeName, matrixOrVector); + str.Append($"\t\t/// {capitalMatrixOrVector} value to hash.\n"); + } + else + { + str.AppendFormat("\t\t/// Returns a uint hash code of a {0} {1}.\n", m_TypeName, matrixOrVector); + str.Append($"\t\t/// {capitalMatrixOrVector} value to hash.\n"); + } + + str.Append($"\t\t/// {returnType} hash of the argument.\n"); + str.Append("\t\t[MethodImpl(MethodImplOptions.AggressiveInlining)]\n"); + str.AppendFormat("\t\tpublic static {0} {1}({2} v)\n", returnType, functionName, m_TypeName); + str.Append("\t\t{\n"); + + str.AppendFormat("\t\t\treturn "); + str.Append(wide ? "(" : "csum("); + + if (m_BaseType == "bool") + { + for (int column = 0; column < m_Columns; column++) + { + if (column > 0) + str.Append(wide ? " + \n\t\t\t\t\t" : " + \n\t\t\t\t\t\t"); + + str.Append("select("); + GeneratePrimeUIntVector(str, m_Rows); + str.Append(", "); + GeneratePrimeUIntVector(str, m_Rows); + str.Append(", "); + str.Append(m_Columns > 1 ? "v.c" + column : "v"); + str.Append(")"); + } + str.AppendFormat(");\n"); + } + else + { + for(int column = 0; column < m_Columns; column++) + { + if(column > 0) + str.Append(wide ? " + \n\t\t\t\t\t" : " + \n\t\t\t\t\t\t"); + string columnName = m_Columns > 1 ? "v.c" + column : "v"; + if (m_BaseType != "uint") + { + if(m_BaseType == "double") + columnName = "fold_to_uint(" + columnName + ")"; + else if(m_BaseType == "half") + { + if (m_Rows == 1) + columnName = "v.value"; + else if(m_Rows == 2) + columnName = "uint2(v.x.value, v.y.value)"; + else if (m_Rows == 3) + columnName = "uint3(v.x.value, v.y.value, v.z.value)"; + else if (m_Rows == 4) + columnName = "uint4(v.x.value, v.y.value, v.z.value, v.w.value)"; + } + else + columnName = "asuint(" + columnName + ")"; + } + + str.Append(columnName); + str.Append(" * "); + GeneratePrimeUIntVector(str, m_Rows); + } + str.AppendFormat(") + 0x{0:X}u;\n", NextPrime()); + } + + str.Append("\t\t}\n\n"); + } + + public void GenerateToStringFunction(StringBuilder str, bool useFormat) + { + if (useFormat) + { + str.AppendFormat("\t\t/// Returns a string representation of the {0} using a specified format and culture-specific format information.\n", m_TypeName); + str.AppendFormat("\t\t/// Format string to use during string formatting.\n"); + str.AppendFormat("\t\t/// Format provider to use during string formatting.\n"); + } + else + str.AppendFormat("\t\t/// Returns a string representation of the {0}.\n", m_TypeName); + + str.Append("\t\t/// String representation of the value.\n"); + str.Append("\t\t[MethodImpl(MethodImplOptions.AggressiveInlining)]\n"); + if(useFormat) + str.Append("\t\tpublic string ToString(string format, IFormatProvider formatProvider)\n\t\t{\n"); + else + str.Append("\t\tpublic override string ToString()\n\t\t{\n"); + + str.AppendFormat("\t\t\treturn string.Format(\"{0}(", m_TypeName); + for (int row = 0; row < m_Rows; row++) + { + for (int column = 0; column < m_Columns; column++) + { + int idx = row * m_Columns + column; + if (idx > 0) + { + str.Append(", "); + if (m_Columns > 1 && column == 0) + str.Append(" "); + } + str.AppendFormat("{{{0}}}", idx); + if (m_BaseType == "float") + str.Append("f"); + } + } + str.Append(")\", "); + + for (int row = 0; row < m_Rows; row++) + { + for (int column = 0; column < m_Columns; column++) + { + int idx = row * m_Columns + column; + if (idx > 0) + str.Append(", "); + if(m_Columns > 1) + str.Append(matrixFields[column] + "." + vectorFields[row]); + else + str.Append(vectorFields[row]); + if (useFormat) + str.Append(".ToString(format, formatProvider)"); + } + } + + str.Append(");\n"); + str.Append("\t\t}\n\n"); + } + + void GenerateBinaryOperator(int rows, int columns, string op, string resultType, StringBuilder str, string opDesc) + { + GenerateBinaryOperator(rows, columns, rows, columns, op, resultType, rows, columns, str, opDesc); + GenerateBinaryOperator(rows, columns, 1, 1, op, resultType, rows, columns, str, opDesc); + GenerateBinaryOperator(1, 1, rows, columns, op, resultType, rows, columns, str, opDesc); + str.Append("\n"); + } + + void GenerateBinaryOperator(int lhsRows, int lhsColumns, int rhsRows, int rhsColumns, string op, string resultType, int resultRows, int resultColumns, StringBuilder str, string opDesc) + { + if (lhsRows == rhsRows && lhsColumns == rhsColumns) + str.AppendFormat("\t\t/// Returns the result of a componentwise {0} operation on {1}.\n", opDesc, ToValueDescription(m_BaseType, lhsRows, lhsColumns, 2)); + else + str.AppendFormat("\t\t/// Returns the result of a componentwise {0} operation on {1} and {2}.\n", opDesc, ToValueDescription(m_BaseType, lhsRows, lhsColumns, 1), ToValueDescription(m_BaseType, rhsRows, rhsColumns, 1)); + + str.AppendFormat($"\t\t/// Left hand side {ToTypeName(m_BaseType, lhsRows, lhsColumns)} to use to compute componentwise {opDesc}.\n"); + str.AppendFormat($"\t\t/// Right hand side {ToTypeName(m_BaseType, rhsRows, rhsColumns)} to use to compute componentwise {opDesc}.\n"); + str.AppendFormat($"\t\t/// {ToTypeName(resultType, resultRows, resultColumns)} result of the componentwise {opDesc}.\n"); + str.Append("\t\t[MethodImpl(MethodImplOptions.AggressiveInlining)]\n"); + str.AppendFormat("\t\tpublic static {0} operator {1} ({2} lhs, {3} rhs)", ToTypeName(resultType, resultRows, resultColumns), op, ToTypeName(m_BaseType, lhsRows, lhsColumns), ToTypeName(m_BaseType, rhsRows, rhsColumns)); + str.Append(" { "); + str.AppendFormat("return new {0} (", ToTypeName(resultType, resultRows, resultColumns)); + + string[] fields = (resultColumns > 1) ? matrixFields : vectorFields; + int resultCount = (resultColumns > 1) ? resultColumns : resultRows; + + for (int i = 0; i < resultCount; i++) + { + if (lhsRows == 1) + { + int rhsIndex = i; + str.AppendFormat("lhs {1} rhs.{0}", fields[rhsIndex], op); + if (i != resultCount - 1) + str.Append(", "); + } + else if (rhsRows == 1) + { + int lhsIndex = i; + str.AppendFormat("lhs.{0} {1} rhs", fields[lhsIndex], op); + if (i != resultCount - 1) + str.Append(", "); + } + else + { + int lhsIndex = i; + int rhsIndex = i; + + str.AppendFormat("lhs.{0} {2} rhs.{1}", fields[lhsIndex], fields[rhsIndex], op); + if (i != resultCount - 1) + str.Append(", "); + } + } + + + str.Append("); }\n\n"); + } + + enum IndexerMode + { + ByValue, + ByRef + } + + void GenerateIndexOperator(StringBuilder str, IndexerMode mode) + { + int count = m_Columns > 1 ? m_Columns : m_Rows; + string returnType = ToTypeName(m_BaseType, m_Columns > 1 ? m_Rows : 1, 1); + + var refPrefix = mode == IndexerMode.ByRef ? "ref " : ""; + + str.AppendFormat("\t\t/// Returns the {0} element at a specified index.\n", returnType); + str.AppendFormat("\t\tunsafe public {1}{0} this[int index]\n", returnType, refPrefix); + str.AppendLine("\t\t{"); + str.AppendLine("\t\t\tget"); + str.AppendLine("\t\t\t{"); + str.AppendLine("#if ENABLE_UNITY_COLLECTIONS_CHECKS"); + str.AppendFormat("\t\t\t\tif ((uint)index >= {0})\n", count); + str.AppendFormat("\t\t\t\t\tthrow new System.ArgumentException(\"index must be between[0...{0}]\");\n", count - 1); + str.AppendLine("#endif"); + // To workaround an undefined behavior with taking the fixed address of a struct field (that could be allocated on the stack) + // we are fixing this instead of a field + // See issue https://github.com/dotnet/coreclr/issues/16210 + str.Append("\t\t\t\tfixed ("); + str.Append(m_TypeName); + str.AppendFormat("* array = &this) {{ return {0}((", refPrefix); + str.Append(returnType); + str.Append("*)array)[index]; }\n"); + str.AppendLine("\t\t\t}"); + + if (mode == IndexerMode.ByValue) + { + str.AppendLine("\t\t\tset"); + str.AppendLine("\t\t\t{"); + str.AppendLine("#if ENABLE_UNITY_COLLECTIONS_CHECKS"); + str.AppendFormat("\t\t\t\tif ((uint)index >= {0})\n", count); + str.AppendFormat("\t\t\t\t\tthrow new System.ArgumentException(\"index must be between[0...{0}]\");\n", count - 1); + str.AppendLine("#endif"); + str.Append("\t\t\t\tfixed ("); + str.Append(returnType); + str.Append("* array = &"); + str.Append(m_Columns > 1 ? "c0" : "x"); + str.Append(") { array[index] = value; }\n"); + str.AppendLine("\t\t\t}"); + } + + str.AppendLine("\t\t}"); + + } + + void GenerateEquals(StringBuilder str) + { + string[] fields = (m_Columns > 1) ? matrixFields : vectorFields; + int resultCount = (m_Columns > 1) ? m_Columns : m_Rows; + + str.AppendFormat("\t\t/// Returns true if the {0} is equal to a given {0}, false otherwise.\n", m_TypeName); + str.AppendFormat("\t\t/// Right hand side argument to compare equality with.\n"); + str.AppendFormat("\t\t/// The result of the equality comparison.\n"); + str.Append("\t\t[MethodImpl(MethodImplOptions.AggressiveInlining)]\n"); + str.AppendFormat("\t\tpublic bool Equals({0} rhs) {{ return ", m_TypeName); + + for (int i = 0; i < resultCount; i++) + { + if (m_Columns == 1) + str.AppendFormat("{0} == rhs.{0}", fields[i]); + else + str.AppendFormat("{0}.Equals(rhs.{0})", fields[i]); + if (i != resultCount-1) + str.Append(" && "); + } + + str.Append("; }\n\n"); + + str.AppendFormat("\t\t/// Returns true if the {0} is equal to a given {0}, false otherwise.\n", m_TypeName); + str.AppendFormat("\t\t/// Right hand side argument to compare equality with.\n"); + str.AppendFormat("\t\t/// The result of the equality comparison.\n"); + str.AppendFormat("\t\tpublic override bool Equals(object o) {{ return o is {0} converted && Equals(converted); }}\n\n", m_TypeName); + } + + void GenerateGetHashCode(StringBuilder str) + { + str.AppendFormat("\t\t/// Returns a hash code for the {0}.\n", m_TypeName); + str.AppendFormat("\t\t/// The computed hash code.\n"); + str.Append("\t\t[MethodImpl(MethodImplOptions.AggressiveInlining)]\n"); + str.Append("\t\tpublic override int GetHashCode() { return (int)math.hash(this); }\n\n"); + } + + + void GenerateShiftOperator(int lhsRows, string op, string resultBaseType, StringBuilder str, string opDesc) + { + string[] fields = (m_Columns > 1) ? matrixFields : vectorFields; + int resultCount = (m_Columns > 1) ? m_Columns : m_Rows; + + string matrixOrVector = m_Columns > 1 ? "matrix" : "vector"; + string resultType = ToTypeName(resultBaseType, resultCount, 1); + str.AppendFormat("\t\t/// Returns the result of a componentwise {0} operation on {1} by a number of bits specified by a single int.\n", opDesc, ToValueDescription(m_BaseType, m_Rows, m_Columns, 1)); + str.AppendFormat($"\t\t/// The {matrixOrVector} to {opDesc}.\n"); + str.AppendFormat($"\t\t/// The number of bits to {opDesc}.\n"); + str.AppendFormat($"\t\t/// The result of the componentwise {opDesc}.\n"); + str.Append("\t\t[MethodImpl(MethodImplOptions.AggressiveInlining)]\n"); + str.AppendFormat("\t\tpublic static {0} operator {1} ({0} x, int n)", m_TypeName, op); + str.Append(" { "); + str.AppendFormat("return new {0} (", m_TypeName); + + for (int i = 0; i < resultCount; i++) + { + if (lhsRows == 1) + { + str.AppendFormat("x {0} n", op); + if (i != resultCount - 1) + str.Append(", "); + } + else + { + int lhsIndex = i; + str.AppendFormat("x.{0} {1} n", fields[lhsIndex], op); + if (i != resultCount - 1) + str.Append(", "); + } + } + + str.Append("); }\n\n"); + } + + void GenerateUnaryOperator(string op, StringBuilder str, string opDesc) + { + str.AppendFormat("\t\t/// Returns the result of a componentwise {0} operation on {1}.\n", opDesc, ToValueDescription(m_BaseType, m_Rows, m_Columns, 1)); + str.Append($"\t\t/// Value to use when computing the componentwise {opDesc}.\n"); + str.Append($"\t\t/// {m_TypeName} result of the componentwise {opDesc}.\n"); + str.Append("\t\t[MethodImpl(MethodImplOptions.AggressiveInlining)]\n"); + str.AppendFormat("\t\tpublic static {0} operator {1} ({0} val)", m_TypeName, op); + str.Append(" { "); + str.AppendFormat("return new {0} (", m_TypeName); + + string[] fields = (m_Columns > 1) ? matrixFields : vectorFields; + int resultCount = (m_Columns > 1) ? m_Columns : m_Rows; + + for (int i = 0; i < resultCount; i++) + { + if(op == "-" && m_BaseType == "uint" && m_Columns == 1) + str.AppendFormat("(uint){0}val.{1}", op, fields[i]); + else + str.AppendFormat("{0}val.{1}", op, fields[i]); + if (i != resultCount - 1) + str.Append(", "); + } + + str.Append("); }\n\n\n"); + } + + void GenerateSwizzles(StringBuilder str) + { + int count = m_Rows; + // float4 swizzles + { + int[] swizzles = new int[4]; + for (int x = 0; x < count; x++) + { + for (int y = 0; y < count; y++) + { + for (int z = 0; z < count; z++) + { + for (int w = 0; w < count; w++) + { + swizzles[0] = x; + swizzles[1] = y; + swizzles[2] = z; + swizzles[3] = w; + + GenerateSwizzles(swizzles, str); + } + } + } + } + } + + // float3 swizzles + { + var swizzles = new int[3]; + for (int x = 0; x < count; x++) + { + for (int y = 0; y < count; y++) + { + for (int z = 0; z < count; z++) + { + swizzles[0] = x; + swizzles[1] = y; + swizzles[2] = z; + + GenerateSwizzles(swizzles, str); + } + } + } + } + + // float2 swizzles + { + var swizzles = new int[2]; + for (int x = 0; x < count; x++) + { + for (int y = 0; y < count; y++) + { + swizzles[0] = x; + swizzles[1] = y; + + GenerateSwizzles(swizzles, str); + } + } + } + } + + void GenerateSwizzles(int[] swizzle, StringBuilder str) + { + int bits = 0; + bool allowSetter = true; + for (int i = 0; i < swizzle.Length; i++) + { + int bit = 1 << swizzle[i]; + if ((bits & bit) != 0) + allowSetter = false; + + bits |= 1 << swizzle[i]; + } + + bool hideAutoComplete = true; + + str.Append("\t\t/// Swizzles the vector.\n"); + + if (hideAutoComplete) + str.Append("\t\t[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]\n"); + + str.Append("\t\tpublic "); + str.Append(ToTypeName(m_BaseType, swizzle.Length, 1)); + str.Append(' '); + + for (int i = 0; i < swizzle.Length; i++) + str.Append(components[swizzle[i]]); + + // Getter + + str.Append("\n\t\t{"); + if (swizzle.Length != 1) + { + str.AppendFormat("\n\t\t\t[MethodImpl(MethodImplOptions.AggressiveInlining)]"); + str.Append("\n\t\t\tget { return new "); + str.Append(ToTypeName(m_BaseType, swizzle.Length, 1)); + str.Append('('); + } + else + str.Append("\n\t\t\tget { return "); + + for (int i = 0; i < swizzle.Length; i++) + { + str.Append(components[swizzle[i]]); + + if (i != swizzle.Length - 1) + str.Append(", "); + } + + if (swizzle.Length != 1) + str.Append("); }"); + else + str.Append("; }"); + + //Setter + if (allowSetter) + { + str.AppendFormat("\n\t\t\t[MethodImpl(MethodImplOptions.AggressiveInlining)]"); + str.Append("\n\t\t\tset { "); + for (int i = 0; i < swizzle.Length; i++) + { + str.Append(components[swizzle[i]]); + if (swizzle.Length != 1) + { + str.Append(" = value."); + str.Append(components[i]); + } + else + { + str.Append(" = value"); + } + + str.Append("; "); + + } + + str.Append("}"); + + } + + str.Append("\n\t\t}\n\n"); + str.Append("\n"); + } + + // Test Generation + private void BeginTest(StringBuilder str, string name, bool testCompiler = true) + { + if (testCompiler) + { + str.Append("\t\t[TestCompiler]\n"); + } + else + { + str.Append("\t\t[TestCase /* For player builds */]\n"); + } + + str.AppendFormat("\t\tpublic static void {0}()\n", name); + str.Append("\t\t{\n"); + } + + private void EndTest(StringBuilder str) + { + str.Append("\t\t}\n\n"); + } + + private void AddParenthesized(StringBuilder str, string[] strings) + { + str.Append("("); + str.Append(string.Join(", ", strings)); + str.Append(")"); + } + + private void TestStaticFields(StringBuilder str) + { + if (m_BaseType == "bool") + return; + + if (m_Columns == 1) + { + BeginTest(str, m_TypeName + "_zero"); + for (int row = 0; row < m_Rows; row++) + str.AppendFormat("\t\t\tTestUtils.AreEqual({2}, {0}.zero.{1});\n", m_TypeName, components[row], ToTypedLiteral(m_BaseType, 0)); + EndTest(str); + } + else + { + BeginTest(str, m_TypeName + "_zero"); + for(int column = 0; column < m_Columns; column++) + for (int row = 0; row < m_Rows; row++) + str.AppendFormat("\t\t\tTestUtils.AreEqual({3}, {0}.zero.c{1}.{2});\n", m_TypeName, column, components[row], ToTypedLiteral(m_BaseType, 0)); + EndTest(str); + + if(m_Columns == m_Rows) + { + BeginTest(str, m_TypeName + "_identity"); + for (int column = 0; column < m_Columns; column++) + for (int row = 0; row < m_Rows; row++) + str.AppendFormat("\t\t\tTestUtils.AreEqual({3}, {0}.identity.c{1}.{2});\n", m_TypeName, column, components[row], ToTypedLiteral(m_BaseType, column == row ? 1 : 0)); + EndTest(str); + } + } + } + + private void TestConstructor(StringBuilder str, bool isStatic, bool isScalar) + { + if(m_Columns == 1) + { + string name = "constructor"; + if (isScalar) + name = "scalar_" + name; + if (isStatic) + name = "static_" + name; + + BeginTest(str, m_TypeName + "_" + name); + str.AppendFormat("\t\t\t{0} a = ", m_TypeName); + if (!isStatic) + str.Append("new "); + str.Append(m_TypeName); + + if(isScalar) + { + string value = m_BaseType == "bool" ? "true" : m_BaseType == "uint" ? "17u" : m_BaseType == "int" ? "17" : m_BaseType == "float" ? "17.0f" : m_BaseType == "double" ? "17.0" : ""; + str.Append("(" + value + ");\n"); + + for (int row = 0; row < m_Rows; row++) + { + str.AppendFormat("\t\t\tTestUtils.AreEqual({1}, a.{0});\n", components[row], value); + } + } + else + { + string[] values = (from row in Enumerable.Range(0, m_Rows) select m_BaseType == "bool" ? ((row & 1) != 0 ? "true" : "false") : "" + (row + 1)).ToArray(); + AddParenthesized(str, values); + str.Append(";\n"); + + for (int row = 0; row < m_Rows; row++) + { + str.AppendFormat("\t\t\tTestUtils.AreEqual({1}, a.{0});\n", components[row], values[row]); + } + } + + + EndTest(str); + } + else + { + + } + } + + private void TestConstructors(StringBuilder str) + { + TestConstructor(str, false, false); + TestConstructor(str, false, true); + TestConstructor(str, true, false); + TestConstructor(str, true, true); + } + + static int StableStringHash(string str) + { + unsafe + { + fixed (char* src = str) + { + int hash1 = (5381 << 16) + 5381; + int hash2 = hash1; + + int* pint = (int*)src; + int len = str.Length; + while (len > 2) + { + hash1 = ((hash1 << 5) + hash1 + (hash1 >> 27)) ^ pint[0]; + hash2 = ((hash2 << 5) + hash2 + (hash2 >> 27)) ^ pint[1]; + pint += 2; + len -= 4; + } + + if (len > 0) + hash1 = ((hash1 << 5) + hash1 + (hash1 >> 27)) ^ pint[0]; + + return hash1 + (hash2 * 1566083941); + } + } + } + + private void TestOperator(StringBuilder str, bool lhsWide, bool rhsWide, string lhsType, string rhsType, string returnType, string op, string opName, bool isBinary, bool isPrefix) + { + var rnd = new Random(StableStringHash(opName)); + + BeginTest(str, m_TypeName + "_operator_" + opName); + + int numValues = m_Rows * m_Columns; + int numPasses = 4; + + string[] lhsValues = new string[lhsWide ? numValues : 1]; + string[] rhsValues = new string[rhsWide ? numValues : 1]; + string[] resultValues = new string[numValues]; + + for (int pass = 0; pass < numPasses; pass++) + { + bool bool_a = false; + bool bool_b = false; + int int_a = 0; + int int_b = 0; + uint uint_a = 0; + uint uint_b = 0; + float float_a = 0.0f; + float float_b = 0.0f; + double double_a = 0.0; + double double_b = 0.0; + + for (int i = 0; i < numValues; i++) + { + string lhsValue = ""; + string rhsValue = ""; + string resultValue = ""; + + if (m_BaseType == "bool") + { + if (i == 0 || lhsWide) bool_a = (rnd.Next(2) == 1); + if (i == 0 || rhsWide) bool_b = (rnd.Next(2) == 1); + + lhsValue = bool_a ? "true" : "false"; + rhsValue = bool_b ? "true" : "false"; + switch (op) + { + case "==": resultValue = (bool_a == bool_b) ? "true" : "false"; break; + case "!=": resultValue = (bool_a != bool_b) ? "true" : "false"; break; + + case "&": resultValue = (bool_a & bool_b) ? "true" : "false"; break; + case "|": resultValue = (bool_a | bool_b) ? "true" : "false"; break; + case "^": resultValue = (bool_a ^ bool_b) ? "true" : "false"; break; + case "!": resultValue = (!bool_a) ? "true" : "false"; break; + } + } + else if (m_BaseType == "int") + { + if (i == 0 || lhsWide) int_a = rnd.Next(); + if (i == 0 || rhsWide) int_b = rnd.Next(); + + + lhsValue = "" + int_a; + rhsValue = "" + int_b; + switch (op) + { + case "+": resultValue = "" + (isBinary ? (int_a + int_b) : +int_a); break; + case "-": resultValue = "" + (isBinary ? (int_a - int_b) : -int_a); break; + case "*": resultValue = "" + (int_a * int_b); break; + case "/": resultValue = "" + (int_a / int_b); break; + case "%": resultValue = "" + (int_a % int_b); break; + + case "<": resultValue = (int_a < int_b) ? "true" : "false"; break; + case ">": resultValue = (int_a > int_b) ? "true" : "false"; break; + case "==": resultValue = (int_a == int_b) ? "true" : "false"; break; + case "!=": resultValue = (int_a != int_b) ? "true" : "false"; break; + case "<=": resultValue = (int_a <= int_b) ? "true" : "false"; break; + case ">=": resultValue = (int_a >= int_b) ? "true" : "false"; break; + + case "&": resultValue = "" + (int_a & int_b); break; + case "|": resultValue = "" + (int_a | int_b); break; + case "^": resultValue = "" + (int_a ^ int_b); break; + case "<<": resultValue = "" + (int_a << int_b); break; + case ">>": resultValue = "" + (int_a >> int_b); break; + + case "~": resultValue = "" + (~int_a); break; + case "++": resultValue = "" + (isPrefix ? ++int_a : int_a++); break; + case "--": resultValue = "" + (isPrefix ? --int_a : int_a--); break; + } + } + else if (m_BaseType == "uint") + { + if (i == 0 || lhsWide) uint_a = (uint)rnd.Next(); + if (i == 0 || rhsWide) uint_b = (uint)rnd.Next(); + + lhsValue = "" + uint_a; + rhsValue = "" + uint_b; + switch (op) + { + case "+": resultValue = "" + (isBinary ? (uint_a + uint_b) : +uint_a); break; + case "-": resultValue = "" + (isBinary ? (uint_a - uint_b) : (uint)-uint_a); break; + case "*": resultValue = "" + (uint_a * uint_b); break; + case "/": resultValue = "" + (uint_a / uint_b); break; + case "%": resultValue = "" + (uint_a % uint_b); break; + + case "<": resultValue = (uint_a < uint_b) ? "true" : "false"; break; + case ">": resultValue = (uint_a > uint_b) ? "true" : "false"; break; + case "==": resultValue = (uint_a == uint_b) ? "true" : "false"; break; + case "!=": resultValue = (uint_a != uint_b) ? "true" : "false"; break; + case "<=": resultValue = (uint_a <= uint_b) ? "true" : "false"; break; + case ">=": resultValue = (uint_a >= uint_b) ? "true" : "false"; break; + + case "&": resultValue = "" + (uint_a & uint_b); break; + case "|": resultValue = "" + (uint_a | uint_b); break; + case "^": resultValue = "" + (uint_a ^ uint_b); break; + case "<<": resultValue = "" + (uint_a << (int)uint_b); break; + case ">>": resultValue = "" + (uint_a >> (int)uint_b); break; + + case "~": resultValue = "" + (~uint_a); break; + case "++": resultValue = "" + (isPrefix ? ++uint_a : uint_a++); break; + case "--": resultValue = "" + (isPrefix ? --uint_a : uint_a--); break; + } + } + else if (m_BaseType == "float") + { + if (i == 0 || lhsWide) float_a = (float)rnd.NextDouble() * 1024.0f - 512.0f; + if (i == 0 || rhsWide) float_b = (float)rnd.NextDouble() * 1024.0f - 512.0f; + + lhsValue = "" + float_a.ToString("R") + "f"; + rhsValue = "" + float_b.ToString("R") + "f"; + switch (op) + { + case "+": resultValue = "" + (isBinary ? (float_a + float_b) : +float_a).ToString("R") + "f"; break; + case "-": resultValue = "" + (isBinary ? (float_a - float_b) : -float_a).ToString("R") + "f"; break; + case "*": resultValue = "" + (float_a * float_b).ToString("R") + "f"; break; + case "/": resultValue = "" + (float_a / float_b).ToString("R") + "f"; break; + case "%": resultValue = "" + (float_a % float_b).ToString("R") + "f"; break; + + case "<": resultValue = (float_a < float_b) ? "true" : "false"; break; + case ">": resultValue = (float_a > float_b) ? "true" : "false"; break; + case "==": resultValue = (float_a == float_b) ? "true" : "false"; break; + case "!=": resultValue = (float_a != float_b) ? "true" : "false"; break; + case "<=": resultValue = (float_a <= float_b) ? "true" : "false"; break; + case ">=": resultValue = (float_a >= float_b) ? "true" : "false"; break; + + case "++": resultValue = "" + (isPrefix ? ++float_a : float_a++).ToString("R") + "f"; break; + case "--": resultValue = "" + (isPrefix ? --float_a : float_a--).ToString("R") + "f"; break; + } + } else if (m_BaseType == "double") + { + if (i == 0 || lhsWide) double_a = rnd.NextDouble() * 1024.0 - 512.0; + if (i == 0 || rhsWide) double_b = rnd.NextDouble() * 1024.0 - 512.0; + + lhsValue = "" + double_a.ToString("R"); + rhsValue = "" + double_b.ToString("R"); + switch (op) + { + case "+": resultValue = "" + (isBinary ? (double_a + double_b) : +double_a).ToString("R"); break; + case "-": resultValue = "" + (isBinary ? (double_a - double_b) : -double_a).ToString("R"); break; + case "*": resultValue = "" + (double_a * double_b).ToString("R"); break; + case "/": resultValue = "" + (double_a / double_b).ToString("R"); break; + case "%": resultValue = "" + (double_a % double_b).ToString("R"); break; + + case "<": resultValue = (double_a < double_b) ? "true" : "false"; break; + case ">": resultValue = (double_a > double_b) ? "true" : "false"; break; + case "==": resultValue = (double_a == double_b) ? "true" : "false"; break; + case "!=": resultValue = (double_a != double_b) ? "true" : "false"; break; + case "<=": resultValue = (double_a <= double_b) ? "true" : "false"; break; + case ">=": resultValue = (double_a >= double_b) ? "true" : "false"; break; + + case "++": resultValue = "" + (isPrefix ? ++double_a : double_a++).ToString("R"); break; + case "--": resultValue = "" + (isPrefix ? --double_a : double_a--).ToString("R"); break; + } + } + + if (i == 0 || lhsWide) lhsValues[i] = lhsValue; + if (i == 0 || rhsWide) rhsValues[i] = rhsValue; + resultValues[i] = resultValue; + } + + str.AppendFormat("\t\t\t{0} a{1} = ", lhsType, pass); + if (lhsWide) str.Append(lhsType); + AddParenthesized(str, lhsValues); + str.Append(";\n"); + + if (isBinary) + { + str.AppendFormat("\t\t\t{0} b{1} = ", rhsType, pass); + if (rhsWide) str.Append(rhsType); + AddParenthesized(str, rhsValues); + str.Append(";\n"); + + str.AppendFormat("\t\t\t{0} r{1} = {0}", returnType, pass); + AddParenthesized(str, resultValues); + str.Append(";\n"); + + str.AppendFormat("\t\t\tTestUtils.AreEqual(r{1}, a{1} {0} b{1});\n", op, pass); + } + else + { + str.AppendFormat("\t\t\t{0} r{1} = {0}", returnType, pass); + AddParenthesized(str, resultValues); + str.Append(";\n"); + + if (isPrefix) + str.AppendFormat("\t\t\tTestUtils.AreEqual(r{1}, {0}a{1});\n", op, pass); + else + str.AppendFormat("\t\t\tTestUtils.AreEqual(r{1}, a{1}{0});\n", op, pass); + } + + if (pass != numPasses - 1) + str.Append("\n"); + + } + EndTest(str); + } + + private void TestShuffle(StringBuilder str) + { + if (m_BaseType == "bool") + return; + + var rnd = new Random(0); + + for (int resultComponents = 1; resultComponents <= 4; resultComponents++) + { + BeginTest(str, m_TypeName + "_shuffle_result_" + resultComponents); + + string resultType = ToTypeName(m_BaseType, resultComponents, 1); + str.AppendFormat("\t\t\t{0} a = {0}", m_TypeName); + var a_data = (from row in Enumerable.Range(0, m_Rows) select m_BaseType == "bool" ? ((row & 1) != 0 ? "true" : "false") : "" + (row)).ToArray(); + var b_data = (from row in Enumerable.Range(0, m_Rows) select m_BaseType == "bool" ? ((row & 1) != 1 ? "true" : "false") : "" + (row + m_Rows)).ToArray(); + + AddParenthesized(str, a_data); + str.Append(";\n"); + str.AppendFormat("\t\t\t{0} b = {0}", m_TypeName); + AddParenthesized(str, b_data); + str.Append(";\n\n"); + + + int totalTests = (int)Math.Pow(m_Rows * 2, resultComponents); + int targetTests = 16; + int numTests = Math.Min(totalTests, targetTests); + + int[] shuffleIndices = new int[resultComponents]; + string[] shuffleValues = new string[resultComponents]; + + for (int testIndex = 0; testIndex < numTests; testIndex++) + { + if(numTests == totalTests) + { + // just enumerate all of them + int t = testIndex; + for(int i = 0; i < resultComponents; i++) + { + shuffleIndices[i] = t % (m_Rows * 2); + t /= m_Rows * 2; + } + } + else + { + // sample randomly + for (int i = 0; i < resultComponents; i++) + shuffleIndices[i] = rnd.Next(m_Rows * 2); + } + + str.Append("\t\t\tTestUtils.AreEqual("); + if (resultComponents > 1) + str.Append(resultType); + + for(int i = 0; i < resultComponents; i++) + { + int t = shuffleIndices[i]; + shuffleValues[i] = t >= m_Rows ? b_data[t - m_Rows] : a_data[t]; + } + + AddParenthesized(str, shuffleValues); + str.Append(", shuffle(a, b"); + for(int i = 0; i < resultComponents; i++) + { + int t = shuffleIndices[i]; + str.AppendFormat(", ShuffleComponent.{0}", shuffleComponents[t >= m_Rows ? (t - m_Rows + 4) : t]); + } + str.Append("));\n"); + } + + + EndTest(str); + } + } + + private void TestUnaryOperator(StringBuilder str, string returnType, string op, string opName, bool isPrefix) + { + TestOperator(str, true, false, m_TypeName, m_BaseType, returnType, op, opName, false, isPrefix); + } + + private void TestBinaryOperator(StringBuilder str, string returnType, string op, string opName) + { + TestOperator(str, true, true, m_TypeName, m_TypeName, returnType, op, opName + "_wide_wide", true, false); + TestOperator(str, true, false, m_TypeName, m_BaseType, returnType, op, opName + "_wide_scalar", true, false); + TestOperator(str, false, true, m_BaseType, m_TypeName, returnType, op, opName + "_scalar_wide", true, false); + } + + private void TestOperators(StringBuilder str) + { + string boolResultType = ToTypeName("bool", m_Rows, m_Columns); + + TestBinaryOperator(str, boolResultType, "==", "equal"); + TestBinaryOperator(str, boolResultType, "!=", "not_equal"); + + if (m_BaseType == "int" || m_BaseType == "uint" || m_BaseType == "float" || m_BaseType == "double") + { + TestBinaryOperator(str, boolResultType, "<", "less"); + TestBinaryOperator(str, boolResultType, ">", "greater"); + TestBinaryOperator(str, boolResultType, "<=", "less_equal"); + TestBinaryOperator(str, boolResultType, ">=", "greater_equal"); + + TestBinaryOperator(str, m_TypeName, "+", "add"); + TestBinaryOperator(str, m_TypeName, "-", "sub"); + TestBinaryOperator(str, m_TypeName, "*", "mul"); + TestBinaryOperator(str, m_TypeName, "/", "div"); + TestBinaryOperator(str, m_TypeName, "%", "mod"); + + TestUnaryOperator(str, m_TypeName, "+", "plus", true); + TestUnaryOperator(str, m_TypeName, "-", "neg", true); + + TestUnaryOperator(str, m_TypeName, "++", "prefix_inc", true); + TestUnaryOperator(str, m_TypeName, "++", "postfix_inc", false); + TestUnaryOperator(str, m_TypeName, "--", "prefix_dec", true); + TestUnaryOperator(str, m_TypeName, "--", "postfix_dec", false); + } + + if(m_BaseType == "bool" || m_BaseType == "int" || m_BaseType == "uint") + { + TestBinaryOperator(str, m_TypeName, "&", "bitwise_and"); + TestBinaryOperator(str, m_TypeName, "|", "bitwise_or"); + TestBinaryOperator(str, m_TypeName, "^", "bitwise_xor"); + } + + if(m_BaseType == "bool") + { + TestUnaryOperator(str, m_TypeName, "!", "logical_not", true); + } + + if(m_BaseType == "int" || m_BaseType == "uint") + { + TestOperator(str, true, false, m_TypeName, "int", m_TypeName, "<<", "left_shift", true, false); + TestOperator(str, true, false, m_TypeName, "int", m_TypeName, ">>", "right_shift", true, false); + + TestUnaryOperator(str, m_TypeName, "~", "bitwise_not", true); + } + + if(m_Columns == 1) + { + TestShuffle(str); + } + } + + private T[] GetColumn(T[,] matrix, int columnNumber) + { + return Enumerable.Range(0, matrix.GetLength(0)).Select(x => matrix[x, columnNumber]).ToArray(); + } + private string ToLiteral(T value) + { + if (typeof(T) == typeof(float)) + { + float f = (float)(object)value; + uint uf = AsUInt(f); + if (float.IsPositiveInfinity(f)) + return "float.PositiveInfinity"; + else if (float.IsNegativeInfinity(f)) + return "float.NegativeInfinity"; + else if (f == float.MaxValue) + return "float.MaxValue"; + else if (f == float.MinValue) + return "float.MinValue"; + else if (float.IsNaN(f)) + return uf < 0x80000000u ? "TestUtils.UnsignedFloatQNaN()" : "TestUtils.SignedFloatQNaN()"; + else if (uf == 0x80000000u) + return "TestUtils.SignedFloatZero()"; + else + return ((float)(object)value).ToString("R") + "f"; + } + else if (typeof(T) == typeof(double)) + { + double d = (double)(object)value; + ulong ud = AsULong(d); + if (double.IsPositiveInfinity(d)) + return "double.PositiveInfinity"; + else if (double.IsNegativeInfinity(d)) + return "double.NegativeInfinity"; + else if (d == double.MaxValue) + return "double.MaxValue"; + else if (d == double.MinValue) + return "double.MinValue"; + else if (double.IsNaN(d)) + return ud < 0x8000000000000000ul ? "TestUtils.UnsignedDoubleQNaN()" : "TestUtils.SignedDoubleQNaN()"; + else if (ud == 0x8000000000000000ul) + return "TestUtils.SignedDoubleZero()"; + else + { + string s = ((double)(object)value).ToString("R"); + if (s.IndexOfAny("eE.".ToCharArray()) == -1) + s += ".0"; + return s; + } + + } + else if (typeof(T) == typeof(uint)) + { + return "" + value + "u"; + } + else if(typeof(T) == typeof(long)) + { + return "" + value + "L"; + } + else if(typeof(T) == typeof(ulong)) + { + return "" + value + "UL"; + } + else if (typeof(T) == typeof(bool)) + { + return (bool)(object)value ? "true" : "false"; + } + return "" + value; + } + private void GenerateComponentWiseParam(StringBuilder str, string typeName, int numComponents, I[] input, int test) + { + int numTests = input.GetLength(0); + if (numComponents > 1) + str.Append(typeName + numComponents + "("); + for (int i = 0; i < numComponents; i++) + { + int idx = Math.Min(test + i, numTests - 1); + I v = input[idx]; + if (i > 0) + str.Append(", "); + str.Append(ToLiteral(v)); + } + if (numComponents > 1) + str.Append(")"); + } + private string GetTypeName(Type t) + { + if (t == typeof(float)) + return "float"; + else if (t == typeof(double)) + return "double"; + else if (t == typeof(bool)) + return "bool"; + else if (t == typeof(int)) + return "int"; + else if (t == typeof(uint)) + return "uint"; + else if (t == typeof(long)) + return "long"; + else if (t == typeof(ulong)) + return "ulong"; + return ""; + } + private void GenerateComponentWiseTest(StringBuilder str, string functionName, I[,] input, O[] output, int maxComponents, int maxUps = 0, bool signedZeroEqual = false) + { + int numTests = input.GetLength(0); + int numParams = input.GetLength(1); + string inputTypeName = GetTypeName(typeof(I)); + string outputTypeName = GetTypeName(typeof(O)); + int inputIndex = input.Length; + for (int numComponents = 1; numComponents <= maxComponents; numComponents++) + { + BeginTest(str, functionName + "_" + inputTypeName + (numComponents > 1 ? ("" + numComponents) : "")); + for (int test = 0; test < numTests; test += numComponents) + { + str.Append("\t\t\tTestUtils.AreEqual("); + GenerateComponentWiseParam(str, outputTypeName, numComponents, output, test); + str.Append(", "); + str.AppendFormat("{0}(", functionName); + for (int param = 0; param < numParams; param++) + { + if (param > 0) + str.Append(", "); + GenerateComponentWiseParam(str, inputTypeName, numComponents, GetColumn(input, param), test); + } + + str.Append(")"); + + if((typeof(O) == typeof(float) || typeof(O) == typeof(double)) && maxUps > 0) + { + str.Append(", " + maxUps + ", " + (signedZeroEqual ? "true" : "false")); + } + + str.Append(");\n"); + } + EndTest(str); + } + } + private void GenerateComponentWiseTestFloatAndDouble(StringBuilder str, string functionName, double[,] input, double[] output, int floatMaxEps = 0, int doubleMaxEps = 0, bool signedZeroEqual = false) + { + float[,] inputFloat = new float[input.GetLength(0), input.GetLength(1)]; + + for (int i = 0; i < input.GetLength(0); i++) + for (int j = 0; j < input.GetLength(1); j++) + inputFloat[i, j] = (float)input[i, j]; + float[] outputFloat = new float[output.GetLength(0)]; + for (int i = 0; i < output.GetLength(0); i++) + outputFloat[i] = (float)output[i]; + GenerateComponentWiseTest(str, functionName, inputFloat, outputFloat, 4, floatMaxEps, signedZeroEqual); + GenerateComponentWiseTest(str, functionName, input, output, 4, doubleMaxEps, signedZeroEqual); + } + + static float UnsignedFloatQNaN() + { + UIntFloatUnion u; + u.floatValue = 0.0f; + u.uintValue = 0x7fc0_0000u; + + return u.floatValue; + } + + static double UnsignedDoubleQNaN() + { + ULongDoubleUnion u; + u.doubleValue = 0.0; + u.ulongValue = 0x7ff8_0000_0000_0000ul; + + return u.doubleValue; + } + + static float SignedFloatQNaN() + { + UIntFloatUnion u; + u.floatValue = 0.0f; + u.uintValue = 0xffc0_0000u; + + return u.floatValue; + } + + static double SignedDoubleQNaN() + { + ULongDoubleUnion u; + u.doubleValue = 0.0; + u.ulongValue = 0xfff8_0000_0000_0000ul; + + return u.doubleValue; + } + + private void GenerateMathTests(StringBuilder str) + { + str.Append("using NUnit.Framework;\n"); + str.Append("using static Unity.Mathematics.math;\n"); + str.Append("using Burst.Compiler.IL.Tests;\n\n"); + str.Append("namespace Unity.Mathematics.Tests\n"); + str.Append("{\n"); + str.Append("\t[TestFixture]\n"); + str.Append("\tpublic partial class TestMath\n"); + str.Append("\t{\n"); + + GenerateComponentWiseTest(str, "abs", new int[,] { { 0 }, { -7 }, { 11 }, { -2147483647 }, { -2147483648 } }, new int[] { 0, 7, 11, 2147483647, -2147483648 }, 4); + + GenerateComponentWiseTestFloatAndDouble(str, "abs", new double[,] { { 0.0 }, { -1.1 }, { 2.2 }, { double.NegativeInfinity }, { double.PositiveInfinity } }, new double[] { 0.0, 1.1, 2.2, double.PositiveInfinity, double.PositiveInfinity }, 0, 0, false); + + GenerateComponentWiseTest(str, "isfinite", new float[,] { { SignedFloatQNaN() }, { float.NegativeInfinity }, { float.MinValue }, { -1.0f }, { 0.0f }, { 1.0f }, { float.MaxValue }, { float.PositiveInfinity }, { UnsignedFloatQNaN() } }, + new bool[] { false, false, true, true, true, true, true, false, false }, 4); + GenerateComponentWiseTest(str, "isfinite", new double[,] { { SignedDoubleQNaN() }, { double.NegativeInfinity }, { double.MinValue }, { -1.0 }, { 0.0 }, { 1.0 }, { double.MaxValue }, { double.PositiveInfinity }, { UnsignedDoubleQNaN() } }, + new bool[] { false, false, true, true, true, true, true, false, false }, 4); + GenerateComponentWiseTest(str, "isinf", new float[,] { { SignedFloatQNaN() }, { float.NegativeInfinity }, { float.MinValue }, { -1.0f }, { 0.0f }, { 1.0f }, { float.MaxValue }, { float.PositiveInfinity }, { UnsignedFloatQNaN() } }, + new bool[] { false, true, false, false, false, false, false, true, false }, 4); + GenerateComponentWiseTest(str, "isinf", new double[,] { { SignedDoubleQNaN() }, { double.NegativeInfinity }, { double.MinValue }, { -1.0 }, { 0.0 }, { 1.0 }, { double.MaxValue }, { double.PositiveInfinity }, { UnsignedDoubleQNaN() } }, + new bool[] { false, true, false, false, false, false, false, true, false }, 4); + GenerateComponentWiseTest(str, "isnan", new float[,] { { SignedFloatQNaN() }, { float.NegativeInfinity }, { float.MinValue }, { -1.0f }, { 0.0f }, { 1.0f }, { float.MaxValue }, { float.PositiveInfinity }, { UnsignedFloatQNaN() } }, + new bool[] { true, false, false, false, false, false, false, false, true }, 4); + GenerateComponentWiseTest(str, "isnan", new double[,] { { SignedDoubleQNaN() }, { double.NegativeInfinity }, { double.MinValue }, { -1.0 }, { 0.0 }, { 1.0 }, { double.MaxValue }, { double.PositiveInfinity }, { UnsignedDoubleQNaN() } }, + new bool[] { true, false, false, false, false, false, false, false, true }, 4); + + GenerateComponentWiseTestFloatAndDouble(str, "sin", new double[,] { { -1000000.0 }, { -1.2 }, { 0.0 }, { 1.2 }, { 1000000.0 }, { double.NegativeInfinity }, { double.NaN }, { double.PositiveInfinity } }, + new double[] { 0.34999350217129295, -0.93203908596722635, 0.0, 0.93203908596722635, -0.34999350217129295, double.NaN, double.NaN, double.NaN }, 1, 32); + + GenerateComponentWiseTestFloatAndDouble(str, "cos", new double[,] { { -1000000.0 }, { -1.2 }, { 0.0 }, { 1.2 }, { 1000000.0 }, { double.NegativeInfinity }, { double.NaN }, { double.PositiveInfinity } }, + new double[] { 0.93675212753314479, 0.36235775447667358, 1.0, 0.36235775447667358, 0.93675212753314479, double.NaN, double.NaN, double.NaN }, 8, 32); + + GenerateComponentWiseTestFloatAndDouble(str, "tan", new double[,] { { -1000000.0 }, { -1.2 }, { 0.0 }, { 1.2 }, { 1000000.0 }, { double.NegativeInfinity }, { double.NaN }, { double.PositiveInfinity } }, + new double[] { 0.373624453987599, -2.57215162212632, 0.0, 2.57215162212632, -0.373624453987599, double.NaN, double.NaN, double.NaN }, 1, 32); + + GenerateComponentWiseTestFloatAndDouble(str, "atan",new double[,] { { -1000000.0 }, { -1.2 }, { 0.0 }, { 1.2 }, { 1000000.0 }, { double.NegativeInfinity }, { double.NaN }, { double.PositiveInfinity } }, + new double[] { -1.570795326794897, -0.8760580505981934, 0.0, 0.8760580505981934, 1.570795326794897, -1.570796326794897, double.NaN, 1.570796326794897 }, 1, 32); + + GenerateComponentWiseTestFloatAndDouble(str, "atan2", new double[,] { { 3.1, 2.4 }, { 3.1, -2.4 }, { -3.1, 2.4 }, { -3.1, -2.4 }, { 0.0, 0.0 }, + { 1.0, double.NegativeInfinity }, { 1.0, double.PositiveInfinity }, { double.NegativeInfinity, 1.0 }, { double.PositiveInfinity, 1.0 }, + // { double.NegativeInfinity, double.PositiveInfinity }, // TODO: fails with burst + { 1.0, double.NaN }, { double.NaN, 1.0 }, { double.NaN, double.NaN }, + }, + new double[] { 0.91199029067742038, 2.2296023629123729, -0.91199029067742038, -2.2296023629123729, 0.0f, + Math.PI, 0.0, -Math.PI*0.5, Math.PI*0.5, + // double.NaN, // TODO: fails with burst + double.NaN, double.NaN, double.NaN, + }, 1, 32); + + + GenerateComponentWiseTestFloatAndDouble(str, "sinh",new double[,] { { -2.0 }, { -1.2 }, { 0.0 }, { 1.2 }, { 2.0 }, { double.NegativeInfinity }, { double.NaN }, { double.PositiveInfinity } }, + new double[] { -3.626860407847018, -1.509461355412173, 0.0, 1.509461355412173, 3.626860407847018, double.NegativeInfinity, double.NaN, double.PositiveInfinity }, 1, 32); + + GenerateComponentWiseTestFloatAndDouble(str, "cosh",new double[,] { { -2.0 }, { -1.2 }, { 0.0 }, { 1.2 }, { 2.0 }, { double.NegativeInfinity }, { double.NaN }, { double.PositiveInfinity } }, + new double[] { 3.7621956910836314, 1.81065556732437, 1.0, 1.81065556732437, 3.7621956910836314, double.PositiveInfinity, double.NaN, double.PositiveInfinity }, 1, 32); + + GenerateComponentWiseTestFloatAndDouble(str, "tanh",new double[,] { { -2.0 }, { -1.2 }, { 0.0 }, { 1.2 }, { 2.0 }, { double.NegativeInfinity }, { double.NaN }, { double.PositiveInfinity } }, + new double[] { -0.96402758007581688, -0.83365460701215526, 0.0, 0.83365460701215526, 0.96402758007581688, -1.0, double.NaN, 1.0 }, 1, 32); + + + GenerateComponentWiseTestFloatAndDouble(str, "exp", new double[,] { { -10.0 }, { -1.2 }, { 0.0 }, { 1.2 }, { double.NegativeInfinity }, { double.NaN }, { double.PositiveInfinity } }, + new double[] { 0.00004539992976248485, 0.3011942119122021, 1.0, 3.3201169227365475, 0.0, double.NaN, double.PositiveInfinity }, 1, 32); + + GenerateComponentWiseTestFloatAndDouble(str, "exp2",new double[,] { { -10.0 }, { -1.2 }, { 0.0 }, { 1.2 }, { double.NegativeInfinity }, { double.NaN }, { double.PositiveInfinity } }, + new double[] { 0.0009765625, 0.435275281648062, 1.0, 2.297396709994070, 0.0, double.NaN, double.PositiveInfinity }, 1, 32); + + GenerateComponentWiseTestFloatAndDouble(str, "exp10",new double[,] { { -10.0 }, { -1.2 }, { 0.0 }, { 1.2 }, { double.NegativeInfinity }, { double.NaN }, { double.PositiveInfinity } }, + new double[] { 1e-10, 0.063095734448019325, 1.0, 15.8489319246111348520210, 0.0, double.NaN, double.PositiveInfinity }, 32, 32); + + + GenerateComponentWiseTestFloatAndDouble(str, "log", new double[,] { { 1.2e-9 }, { 1.0 }, { 1.2e10 }, { -1.0 }, { double.NegativeInfinity }, { double.NaN }, { double.PositiveInfinity } }, + new double[] { -20.540944280152457, 0.0, 23.20817248673441, double.NaN, double.NaN, double.NaN, double.PositiveInfinity }, 1, 32); + + GenerateComponentWiseTestFloatAndDouble(str, "log2", new double[,] { { 1.2e-9 }, { 1.0 }, { 1.2e10 }, { -1.0 }, { double.NegativeInfinity }, { double.NaN }, { double.PositiveInfinity } }, + new double[] { -29.634318448152467, 0.0, 33.48231535470742, double.NaN, double.NaN, double.NaN, double.PositiveInfinity }, 1, 32); + + GenerateComponentWiseTestFloatAndDouble(str, "log10", new double[,] { { 1.2e-9 }, { 1.0 }, { 1.2e10 }, { -1.0 }, { double.NegativeInfinity }, { double.NaN }, { double.PositiveInfinity } }, + new double[] { -8.92081875395237517, 0.0, 10.079181246047624, double.NaN, double.NaN, double.NaN, double.PositiveInfinity }, 1, 32); + + GenerateComponentWiseTestFloatAndDouble(str, "radians", new double[,] { { -123.45 }, { 0.0 }, { 123.45 }, { double.NegativeInfinity }, { double.NaN }, { double.PositiveInfinity } }, + new double[] { -2.15460896158699986, 0.0, 2.15460896158699986, double.NegativeInfinity, double.NaN, double.PositiveInfinity }, 1, 1); + + GenerateComponentWiseTestFloatAndDouble(str, "degrees", new double[,] { { -123.45 }, { 0.0 }, { 123.45 }, { double.NegativeInfinity }, { double.NaN }, { double.PositiveInfinity } }, + new double[] { -7073.1639808900125122, 0.0, 7073.1639808900125122, double.NegativeInfinity, double.NaN, double.PositiveInfinity}, 1, 1); + + GenerateComponentWiseTest(str, "sign", new int[,] { { -156 }, { -214748346 }, { 0 }, { 214748346 }, { 1537 }, { 17 }, { -39 }, { 0 }, { -15379 }, { 64583 }, { int.MaxValue }, { int.MinValue } }, + new int[] { -1, -1, 0, 1, 1, 1, -1, 0, -1, 1, 1, -1 }, 4); + + GenerateComponentWiseTestFloatAndDouble(str, "sign",new double[,] { { -123.45 }, { -1e-20 }, { 0.0 }, { 1e-10 }, { 123.45 }, { double.NegativeInfinity }, { double.NaN }, { double.PositiveInfinity } }, + new double[] { -1.0, -1.0, 0.0, 1.0, 1.0, -1.0, 0.0, 1.0 }); + + GenerateComponentWiseTestFloatAndDouble(str, "sqrt", new double[,] { { -1.0}, { 0.0 }, { 1e-10 }, { 123.45 }, { double.NegativeInfinity }, { double.NaN }, { double.PositiveInfinity } }, + new double[] { double.NaN, 0.0, 1e-5, 11.11080555135405, double.NaN, double.NaN, double.PositiveInfinity, }, 1, 1); + + GenerateComponentWiseTestFloatAndDouble(str, "rsqrt", new double[,] { { -1.0 }, { 0.0 }, { 1e10 }, { 123.45 }, { double.NegativeInfinity }, { double.NaN }, { double.PositiveInfinity } }, + new double[] { double.NaN, double.PositiveInfinity, 1e-5, 0.0900024751020984295, double.NaN, double.NaN, 0.0, }, 1, 1); + + GenerateComponentWiseTestFloatAndDouble(str, "rcp", new double[,] { { -123.45 }, { 0.0 }, { 123.45 }, { double.NaN }, { double.PositiveInfinity } }, + new double[] { -0.0081004455245038477, double.PositiveInfinity, 0.0081004455245038477, double.NaN, 0.0, }, 1, 1); + + GenerateComponentWiseTestFloatAndDouble(str, "floor", new double[,] { { double.NegativeInfinity }, { -100.51 }, { -100.5 }, { -100.49 }, { 0.0 }, { 100.49 }, { 100.50 }, { 100.51 }, { double.PositiveInfinity }, { double.NaN } }, + new double[] { double.NegativeInfinity, -101.0, -101.0, -101.0, 0.0, 100.0, 100.0, 100.0, double.PositiveInfinity, double.NaN } ); + + GenerateComponentWiseTestFloatAndDouble(str, "ceil", new double[,] { { double.NegativeInfinity }, { -100.51 }, { -100.5 }, { -100.49 }, { 0.0 }, { 100.49 }, { 100.50 }, { 100.51 }, { double.PositiveInfinity }, { double.NaN } }, + new double[] { double.NegativeInfinity, -100.0, -100.0, -100.0, 0.0, 101.0, 101.0, 101.0, double.PositiveInfinity, double.NaN }); + + GenerateComponentWiseTestFloatAndDouble(str, "round", new double[,] { { double.NegativeInfinity }, { -100.51 }, { -100.5 }, { -100.49 }, { 0.0 }, { 100.49 }, { 100.50 }, { 100.51 }, { 101.50 }, { double.PositiveInfinity }, { double.NaN } }, + new double[] { double.NegativeInfinity, -101.0, -100.0, -100.0, 0.0, 100.0, 100.0, 101.0, 102.0, double.PositiveInfinity, double.NaN }); + + GenerateComponentWiseTestFloatAndDouble(str, "trunc", new double[,] { { double.NegativeInfinity }, { -100.51 }, { -100.5 }, { -100.49 }, { 0.0 }, { 100.49 }, { 100.50 }, { 100.51 }, { 101.50 }, { double.PositiveInfinity }, { double.NaN } }, + new double[] { double.NegativeInfinity, -100.0, -100.0, -100.0, 0.0, 100.0, 100.0, 100.0, 101.0, double.PositiveInfinity, double.NaN }); + + GenerateComponentWiseTestFloatAndDouble(str, "frac", new double[,] { { double.NegativeInfinity }, { -1e20 }, { -100.3 }, { 0.0 }, { 100.8 }, { double.PositiveInfinity }, { double.NaN } }, + new double[] { double.NaN, 0.0, 0.7, 0.0, 0.8, double.NaN, double.NaN }, 64, 64); + + GenerateComponentWiseTestFloatAndDouble(str, "lerp", new double[,] { { -123.45, 439.43, -1.5 }, { -123.45, 439.43, 0.5 }, { -123.45, 439.43, 5.5 }, { -123.45, 439.43, double.NaN } }, + new double[] { -967.77, 157.99, 2972.39, double.NaN }, 1, 1); + + GenerateComponentWiseTestFloatAndDouble(str, "unlerp", new double[,] { { -123.45, 439.43, -254.3}, { -123.45, 439.43, 0.0 }, { -123.45, 439.43, 632.1 }, + { 123.4, 123.4, -430.0 }, { 123.4, 123.4, 430.0 }, + { 439.43, -123.45, -254.3}, { 439.43, -123.45, 0.0 }, { 439.43, -123.45, 632.1 } }, + new double[] { -0.23246517907902217, 0.21931850483229107, 1.3422932063672541, + double.NegativeInfinity, double.PositiveInfinity, + 1.2324651790790221, 0.78068149516770893, -0.34229320636725412}, 4, 4); + + GenerateComponentWiseTestFloatAndDouble(str, "remap", new double[,] { { -123.45, 439.43, 541.3, 631.5, -200.0 }, { -123.45, 439.43, 541.3, 631.5, -100.0 }, { -123.45, 439.43, 541.3, 631.5, 500.0 }, + { 439.43, -123.45, 541.3, 631.5, -200.0 }, { 439.43, -123.45, 541.3, 631.5, -100.0 }, { 439.43, -123.45, 541.3, 631.5, 500.0 }, + { -123.45, 439.43, 631.5, 541.3, -200.0 }, { -123.45, 439.43, 631.5, 541.3,-100.0 }, { -123.45, 439.43, 631.5, 541.3, 500.0 }, + { -123.45,-123.45, 541.3, 631.5, -200.0 }, { -123.45,-123.45, 541.3, 631.5, -100.0 }, }, + new double[] { 529.03306921546333, 545.05779917566799, 641.20617893689596, + 643.76693078453667, 627.74220082433201, 531.59382106310404, + 643.76693078453667, 627.74220082433201, 531.59382106310404, + double.NegativeInfinity, double.PositiveInfinity, + }, 4, 4); + + + GenerateComponentWiseTest(str, "clamp", new int[,] { { int.MinValue, -123, 439}, + { -254, -123, 439}, { 246, -123, 439 }, { 632, -123, 439 }, + { -254, 439,-123}, { 246, 439,-123 }, { 632, 439,-123 }, + { int.MaxValue, -123, 439}, + }, + new int[] { -123, -123, 246, 439, 439, 439, 439, 439 }, 4); + + GenerateComponentWiseTest(str, "clamp", new uint[,] { { 0, 123, 439}, + { 54, 123, 439}, { 246, 123, 439 }, { 632, 123, 439 }, + { 54, 439, 123}, { 246, 439, 123 }, { 632, 439, 123 }, + { uint.MaxValue, 123, 439}, + }, + new uint[] { 123, 123, 246, 439, 439, 439, 439, 439 }, 4); + + GenerateComponentWiseTest(str, "clamp", new long[,] { { long.MinValue, -123, 439}, + { -254, -123, 439}, { 246, -123, 439 }, { 632, -123, 439 }, + { -254, 439,-123}, { 246, 439,-123 }, { 632, 439,-123 }, + { long.MaxValue, -123, 439}, + }, + new long[] { -123, -123, 246, 439, 439, 439, 439, 439 }, 1); + + GenerateComponentWiseTest(str, "clamp", new ulong[,] { { 0, 123, 439}, + { 54, 123, 439}, { 246, 123, 439 }, { 632, 123, 439 }, + { 54, 439, 123}, { 246, 439, 123 }, { 632, 439, 123 }, + { ulong.MaxValue, 123, 439}, + }, + new ulong[] { 123, 123, 246, 439, 439, 439, 439, 439 }, 1); + + GenerateComponentWiseTestFloatAndDouble(str, "clamp", new double[,] { { double.NegativeInfinity, -123.45, 439.43}, + { -254.3, -123.45, 439.43}, { 246.3, -123.45, 439.43 }, { 632.1, -123.45, 439.43 }, + { -254.3, 439.43,-123.45}, { 246.3, 439.43,-123.45 }, { 632.1, 439.43,-123.45 }, + { double.PositiveInfinity, -123.45, 439.43}, + { double.NaN, -123.45, 439.43}, + }, + new double[] { -123.45, -123.45, 246.3, 439.43, 439.43, 439.43, 439.43, 439.43, 439.43 }); + + GenerateComponentWiseTestFloatAndDouble(str, "saturate", new double[,] { { double.NegativeInfinity }, { -123.45 }, { 0.0 }, { 0.5 }, { 1.0 }, { 123.45 }, { double.PositiveInfinity }, { double.NaN } }, + new double[] { 0.0, 0.0, 0.0, 0.5, 1.0, 1.0, 1.0, 1.0 }); + + GenerateComponentWiseTestFloatAndDouble(str, "step", new double[,] { { -123.45, double.NegativeInfinity }, { -123.45, -200.0 }, { -123.45, 200.0 }, { -123.45, double.PositiveInfinity }, { -123.45, double.NaN }, + { 123.45, double.NegativeInfinity }, { 123.45, -200.0 }, { 123.45, 200.0 }, { 123.45, double.PositiveInfinity }, { 123.45, double.NaN }, + { double.NegativeInfinity, double.NegativeInfinity }, { double.NegativeInfinity, -200.0 }, { double.NegativeInfinity, 200.0 }, { double.NegativeInfinity, double.PositiveInfinity }, { double.NegativeInfinity, double.NaN }, + { double.PositiveInfinity, double.NegativeInfinity }, { double.PositiveInfinity, -200.0 }, { double.PositiveInfinity, 200.0 }, { double.PositiveInfinity, double.PositiveInfinity }, { double.PositiveInfinity, double.NaN }, + { double.NaN, double.NegativeInfinity }, { double.NaN, -200.0 }, { double.NaN, 200.0 }, { double.NaN, double.PositiveInfinity }, { double.NaN, double.NaN }}, + new double[] { 0.0, 0.0, 1.0, 1.0, 0.0, + 0.0, 0.0, 1.0, 1.0, 0.0, + 1.0, 1.0, 1.0, 1.0, 0.0, + 0.0, 0.0, 0.0, 1.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0}); + + + GenerateComponentWiseTest(str, "min", new int[,] { { int.MinValue, int.MinValue }, { int.MinValue, -1 }, { -1, int.MinValue }, + { -1234, -3456 }, { -3456, -1234 }, { -1234, 3456 }, { 3456, -1234 }, { 1234, 3456 }, { 3456, 1234 }, + { 1, int.MaxValue}, { int.MaxValue, 1 }, { int.MaxValue, int.MinValue }, { int.MaxValue, int.MaxValue} }, + new int[] { int.MinValue, int.MinValue, int.MinValue, + -3456, -3456, -1234, -1234, 1234, 1234, + 1, 1, int.MinValue, int.MaxValue}, 4); + + GenerateComponentWiseTest(str, "min", new uint[,] { { 1234u, 3456u }, { 3456u, 1234u }, + { 0xFFFFFF00u, 7u}, { 7u, 0xFFFFFF00u}, + { 1u, uint.MaxValue}, { uint.MaxValue, 1u }, { uint.MaxValue, uint.MaxValue} }, + new uint[] { 1234u, 1234u, 7u, 7u, 1u, 1u, uint.MaxValue}, 4); + + GenerateComponentWiseTest(str, "min", new long[,] { { long.MinValue, long.MinValue }, { long.MinValue, -1 }, { -1, long.MinValue }, + { -1234, -3456 }, { -3456, -1234 }, { -1234, 3456 }, { 3456, -1234 }, { 1234, 3456 }, { 3456, 1234 }, + { 1, long.MaxValue}, { long.MaxValue, 1 }, { long.MaxValue, long.MinValue }, { long.MaxValue, long.MaxValue} }, + new long[] { long.MinValue, long.MinValue, long.MinValue, + -3456, -3456, -1234, -1234, 1234, 1234, + 1, 1, long.MinValue, long.MaxValue}, 1); + + GenerateComponentWiseTest(str, "min", new ulong[,] { { 1234u, 3456u }, { 3456u, 1234u }, + { 0xFFFFFFFFFFFFFF00ul, 7u}, { 7u, 0xFFFFFFFFFFFFFF00ul}, + { 1u, ulong.MaxValue}, { ulong.MaxValue, 1u }, { ulong.MaxValue, ulong.MaxValue} }, + new ulong[] { 1234u, 1234u, 7u, 7u, 1u, 1u, ulong.MaxValue }, 1); + + + GenerateComponentWiseTestFloatAndDouble(str, "min", new double[,] { { double.NegativeInfinity, double.NegativeInfinity }, { double.NegativeInfinity, -1.0 }, { -1.0, double.NegativeInfinity }, + { -1234.56, -3456.7 }, { -3456.7, -1234.56 }, { -1234.56, 3456.7 }, { 3456.7, -1234.56 }, { 1234.56, 3456.7 }, { 3456.7, 1234.56 }, + { 1.0, double.PositiveInfinity}, { double.PositiveInfinity, 1.0 }, { double.PositiveInfinity, double.NegativeInfinity }, { double.PositiveInfinity, double.PositiveInfinity }, + { double.NaN, 2.3 }, { 2.3, double.NaN }, { double.NaN, double.NaN } }, + new double[] { double.NegativeInfinity, double.NegativeInfinity, double.NegativeInfinity, + -3456.7, -3456.7, -1234.56, -1234.56, 1234.56, 1234.56, + 1.0, 1.0, double.NegativeInfinity, double.PositiveInfinity, + 2.3, 2.3, double.NaN}); + + + + GenerateComponentWiseTest(str, "max", new int[,] { { int.MinValue, int.MinValue }, { int.MinValue, -1 }, { -1, int.MinValue }, + { -1234, -3456 }, { -3456, -1234 }, { -1234, 3456 }, { 3456, -1234 }, { 1234, 3456 }, { 3456, 1234 }, + { 1, int.MaxValue}, { int.MaxValue, 1 }, { int.MaxValue, int.MinValue }, { int.MaxValue, int.MaxValue} }, + new int[] { int.MinValue, -1, -1, + -1234, -1234, 3456, 3456, 3456, 3456, + int.MaxValue, int.MaxValue, int.MaxValue, int.MaxValue}, 4); + + GenerateComponentWiseTest(str, "max", new uint[,] { { 1234u, 3456u }, { 3456u, 1234u }, + { 0xFFFFFF00u, 7u}, { 7u, 0xFFFFFF00u}, + { 1u, uint.MaxValue}, { uint.MaxValue, 1u }, { uint.MaxValue, uint.MaxValue} }, + new uint[] { 3456u, 3456u, 0xFFFFFF00u, 0xFFFFFF00u, uint.MaxValue, uint.MaxValue, uint.MaxValue }, 4); + + GenerateComponentWiseTest(str, "max", new long[,] { { long.MinValue, long.MinValue }, { long.MinValue, -1 }, { -1, long.MinValue }, + { -1234, -3456 }, { -3456, -1234 }, { -1234, 3456 }, { 3456, -1234 }, { 1234, 3456 }, { 3456, 1234 }, + { 1, long.MaxValue}, { long.MaxValue, 1 }, { long.MaxValue, long.MinValue }, { long.MaxValue, long.MaxValue} }, + new long[] { long.MinValue, -1, -1, + -1234, -1234, 3456, 3456, 3456, 3456, + long.MaxValue, long.MaxValue, long.MaxValue, long.MaxValue}, 1); + + GenerateComponentWiseTest(str, "max", new ulong[,] { { 1234u, 3456u }, { 3456u, 1234u }, + { 0xFFFFFFFFFFFFFF00ul, 7u}, { 7u, 0xFFFFFFFFFFFFFF00ul}, + { 1u, ulong.MaxValue}, { ulong.MaxValue, 1u }, { ulong.MaxValue, ulong.MaxValue} }, + new ulong[] { 3456u, 3456u, 0xFFFFFFFFFFFFFF00ul, 0xFFFFFFFFFFFFFF00ul, ulong.MaxValue, ulong.MaxValue, ulong.MaxValue }, 1); + + GenerateComponentWiseTestFloatAndDouble(str, "max", new double[,] { { double.NegativeInfinity, double.NegativeInfinity }, { double.NegativeInfinity, -1.0 }, { -1.0, double.NegativeInfinity }, + { -1234.56, -3456.7 }, { -3456.7, -1234.56 }, { -1234.56, 3456.7 }, { 3456.7, -1234.56 }, { 1234.56, 3456.7 }, { 3456.7, 1234.56 }, + { 1.0, double.PositiveInfinity}, { double.PositiveInfinity, 1.0 }, { double.PositiveInfinity, double.NegativeInfinity }, { double.PositiveInfinity, double.PositiveInfinity }, + { double.NaN, 2.3 }, { 2.3, double.NaN }, { double.NaN, double.NaN } }, + new double[] { double.NegativeInfinity, -1.0, -1.0, + -1234.56, -1234.56, 3456.7, 3456.7, 3456.7, 3456.7, + double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity, double.PositiveInfinity, + 2.3, 2.3, double.NaN}); + + + GenerateComponentWiseTestFloatAndDouble(str, "smoothstep", new double[,] { { -123.45, 345.6, double.NegativeInfinity}, { -123.45, 345.6, -200.0}, { -123.45, 345.6, -100.0}, { -123.45, 345.6, 400.0}, { -123.45, 345.6, double.PositiveInfinity}, { -123.45, 345.6, double.NaN }, + { 345.6, -123.45, double.NegativeInfinity}, { 345.6, -123.45, -200.0}, { 345.6, -123.45, -100.0}, { 345.6, -123.45, 400.0}, { 345.6, -123.45, double.PositiveInfinity}, { 345.6, -123.45, double.NaN }}, + new double[] { 0.0, 0.0, 0.0072484810488798993, 1.0, 1.0, 1.0, + 1.0, 1.0, 0.9927515189511201007, 0.0, 0.0, 1.0}, 8, 8); + + GenerateComponentWiseTest(str, "mad", new int[,] { { 1234, 5678, 91011 }, { 1234, 5678, -91011 }, { 1234, -5678, 91011 }, { 1234, -5678, -91011 }, + {-1234, 5678, 91011 }, {-1234, 5678, -91011 }, {-1234, -5678, 91011 }, {-1234, -5678, -91011 }, + { 98765, 56789, 91011 }, { 98765, 56789,-91011 }, { 98765,-56789, 91011 }, { 98765,-56789,-91011 }, + {-98765, 56789, 91011 }, {-98765, 56789,-91011 }, {-98765,-56789, 91011 }, {-98765,-56789,-91011 }}, + new int[] { 7097663, 6915641, -6915641, -7097663, + -6915641, -7097663, 7097663, 6915641, + 1313889300, 1313707278, -1313707278, -1313889300, + -1313707278, -1313889300, 1313889300, 1313707278}, 4); + + + GenerateComponentWiseTest(str, "mad", new uint[,] { { 1234u, 5678u, 91011u }, { 98765u, 56789u, 91011u } }, + new uint[] { 7097663u, 1313889300u }, 4); + + + GenerateComponentWiseTest(str, "mad", new long[,] { { 1234, 5678, 91011 }, { 1234, 5678, -91011 }, { 1234, -5678, 91011 }, { 1234, -5678, -91011 }, + {-1234, 5678, 91011 }, {-1234, 5678, -91011 }, {-1234, -5678, 91011 }, {-1234, -5678, -91011 }, + { 9876543210, 5678901234, 9101112134 }, { 9876543210, 5678901234,-9101112134 }, { 9876543210,-5678901234, 9101112134 }, { 9876543210,-5678901234,-9101112134 }, + {-9876543210, 5678901234, 9101112134 }, {-9876543210, 5678901234,-9101112134 }, {-9876543210,-5678901234, 9101112134 }, {-9876543210,-5678901234,-9101112134 }}, + new long[] { 7097663, 6915641, -6915641, -7097663, + -6915641, -7097663, 7097663, 6915641, + 747681210895778426, 747681192693554158, -747681192693554158, -747681210895778426, + -747681192693554158, -747681210895778426, 747681210895778426, 747681192693554158}, 1); + + GenerateComponentWiseTest(str, "mad", new ulong[,] { { 1234, 5678, 91011 }, { 9876543210, 5678901234, 9101112134 }}, + new long[] { 7097663, 747681210895778426 }, 1); + + + GenerateComponentWiseTestFloatAndDouble(str, "mad", new double[,] { { -123.45, 345.6, 4.321 }, { double.NaN, 345.6, 4.321 }, { -123.45, double.NaN, 4.321 }, { -123.45, 345.6, double.NaN } }, + new double[] { -42659.999, double.NaN, double.NaN, double.NaN }, 1, 1); + + + GenerateComponentWiseTestFloatAndDouble(str, "fmod", new double[,] { { double.NegativeInfinity, double.NegativeInfinity }, { -323.4, double.NegativeInfinity }, { -0.0, double.NegativeInfinity}, { 0.0, double.NegativeInfinity}, { 323.4, double.NegativeInfinity}, { double.PositiveInfinity, double.NegativeInfinity}, { double.NaN, double.NegativeInfinity}, + { double.NegativeInfinity, -123.6}, { -323.4, -123.6}, { -0.0, -123.6}, { 0.0, -123.6}, { 323.4, -123.6}, { double.PositiveInfinity, -123.6}, { double.NaN, -123.6}, + { double.NegativeInfinity, -0.0}, { -323.4, -0.0}, { -0.0, -0.0}, { 0.0, -0.0}, { 323.4, -0.0}, { double.PositiveInfinity, -0.0}, { double.NaN, -0.0}, + { double.NegativeInfinity, 0.0}, { -323.4, 0.0}, { -0.0, 0.0}, { 0.0, 0.0}, { 323.4, 0.0}, { double.PositiveInfinity, 0.0}, { double.NaN, 0.0}, + { double.NegativeInfinity, 123.6}, { -323.4, 123.6}, { -0.0, 123.6}, { 0.0, 123.6}, { 323.4, 123.6}, { double.PositiveInfinity, 123.6}, { double.NaN, 123.6}, + { double.NegativeInfinity, double.PositiveInfinity}, { -323.4, double.PositiveInfinity}, { -0.0, double.PositiveInfinity}, { 0.0, double.PositiveInfinity}, { 323.4, double.PositiveInfinity}, { double.PositiveInfinity, double.PositiveInfinity}, { double.NaN, double.PositiveInfinity}, + { double.NegativeInfinity, double.NaN}, { -323.4, double.NaN}, { -0.0, double.NaN}, { 0.0, double.NaN}, { 323.4, double.NaN}, { double.PositiveInfinity, double.NaN}, { double.NaN, double.NaN}, + }, + new double[] { double.NaN, -323.4, -0.0, 0.0, 323.4, double.NaN, double.NaN, + double.NaN, -76.2, -0.0, 0.0, 76.2, double.NaN, double.NaN, + double.NaN, double.NaN,double.NaN,double.NaN,double.NaN,double.NaN,double.NaN, + double.NaN, double.NaN,double.NaN,double.NaN,double.NaN,double.NaN,double.NaN, + double.NaN, -76.2, -0.0, 0.0, 76.2, double.NaN, double.NaN, + double.NaN, -323.4, -0.0, 0.0, 323.4, double.NaN, double.NaN, + double.NaN, double.NaN,double.NaN,double.NaN,double.NaN,double.NaN,double.NaN}, 1, 1); + + GenerateComponentWiseTestFloatAndDouble(str, "pow", new double[,] { { double.NegativeInfinity, double.NegativeInfinity }, { -3.4, double.NegativeInfinity }, { -0.0, double.NegativeInfinity}, { 0.0, double.NegativeInfinity}, { 3.4, double.NegativeInfinity}, { double.PositiveInfinity, double.NegativeInfinity}, { double.NaN, double.NegativeInfinity}, + + /*{ double.NegativeInfinity, -2.6} DOTS-1833 */ { -3.4, -2.6}, { -0.0, -2.6}, { 0.0, -2.6}, { 3.4, -2.6}, { double.PositiveInfinity, -2.6}, { double.NaN, -2.6}, + + { double.NegativeInfinity, -0.0}, { -3.4, -0.0}, { -0.0, -0.0}, { 0.0, -0.0}, { 3.4, -0.0}, { double.PositiveInfinity, -0.0}, // { double.NaN, -0.0}, // TODO: fails with burst + { double.NegativeInfinity, 0.0}, { -3.4, 0.0}, { -0.0, 0.0}, { 0.0, 0.0}, { 3.4, 0.0}, { double.PositiveInfinity, 0.0}, // { double.NaN, 0.0}, // TODO: fails with burst + + /*{ double.NegativeInfinity, 2.6}, DOTS-1833 */ { -3.4, 2.6}, { -0.0, 2.6}, { 0.0, 2.6}, { 3.4, 2.6}, { double.PositiveInfinity, 2.6}, { double.NaN, 2.6}, + { double.NegativeInfinity, double.PositiveInfinity}, { -3.4, double.PositiveInfinity}, { -0.0, double.PositiveInfinity}, { 0.0, double.PositiveInfinity}, { 3.4, double.PositiveInfinity}, { double.PositiveInfinity, double.PositiveInfinity}, { double.NaN, double.PositiveInfinity}, + { double.NegativeInfinity, double.NaN}, { -3.4, double.NaN}, { -0.0, double.NaN}, { 0.0, double.NaN}, { 3.4, double.NaN}, { double.PositiveInfinity, double.NaN}, { double.NaN, double.NaN}, + + }, + new double[] { + 0.0, 0.0, double.PositiveInfinity, double.PositiveInfinity, 0.0, 0.0, double.NaN, + /*0.0, DOTS-1833 */ double.NaN, double.PositiveInfinity, double.PositiveInfinity, 0.041510199028461224, 0.0, double.NaN, + 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, // double.NaN, // TODO: fails with burst + 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, // double.NaN, // TODO: fails with burst + + /*double.PositiveInfinity, DOTS-1833 */ double.NaN, 0.0, 0.0, 24.090465076169736, double.PositiveInfinity, double.NaN, + + double.PositiveInfinity, double.PositiveInfinity, 0.0, 0.0, double.PositiveInfinity, double.PositiveInfinity, double.NaN, + double.NaN, double.NaN, double.NaN, double.NaN, double.NaN, double.NaN, double.NaN, + }, 1, 1); + + + GenerateComponentWiseTest(str, "ceilpow2", new int[,] { { 0 }, { 1 }, { 2 }, { 3 }, { 1019642234 }, { 1823423423 }, { -2147483647 } }, + new int[] { 0, 1, 2, 4, 1073741824, -2147483648, 0 }, 4); + + GenerateComponentWiseTest(str, "ceilpow2", new uint[,] { { 0u }, { 1u }, { 2u }, { 3u }, { 1019642234u }, { 1823423423u }, { 4294967295u } }, + new uint[] { 0u, 1u, 2u, 4u, 1073741824u, 2147483648u, 0u }, 4); + + + GenerateComponentWiseTest(str, "ceilpow2", new long[,] { { 0L }, { 1L }, { 2L }, { 3L }, { 1019642234L }, { 1823423423L }, { 2147483648L }, { 4294967295L }, { 4294967296L }, { 7227372236554874814L }, { -100L } }, + new long[] { 0L, 1L, 2L, 4L, 1073741824L, 2147483648L, 2147483648L, 4294967296L, 4294967296L, -9223372036854775808L, 0L }, 1); + + + GenerateComponentWiseTest(str, "ceilpow2", new ulong[,] { { 0UL }, { 1UL }, { 2UL }, { 3UL }, { 1019642234UL }, { 1823423423UL }, { 2147483648UL }, { 4294967295UL }, { 4294967296UL }, { 7227372236554874814UL }, { 10223372036854775808UL } }, + new ulong[] { 0UL, 1UL, 2UL, 4UL, 1073741824UL, 2147483648UL, 2147483648UL, 4294967296UL, 4294967296UL, 9223372036854775808UL, 0L }, 1); + GenerateComponentWiseTest(str, "floorlog2", new int[,] { { 1 }, { 2 }, { 3 }, { 4 }, { 5 }, { (1 << 15) - 1 }, { 1 << 15 }, { (1 << 15) + 1 }, { Int32.MaxValue } }, new int[] { 0, 1, 1, 2, 2, 14, 15, 15, 30 }, 4); + GenerateComponentWiseTest(str, "floorlog2", new uint[,] { { 1 }, { 2 }, { 3 }, { 4 }, { 5 }, { (1 << 15) - 1 }, { 1 << 15 }, { (1 << 15) + 1 }, { Int32.MaxValue } }, new int[] { 0, 1, 1, 2, 2, 14, 15, 15, 30 }, 4); + + + GenerateComponentWiseTest(str, "ceillog2", new int[,] { { 1 }, { 2 }, { 3 }, { 4 }, { 5 }, { 63 }, { 64 }, { 65 }, { (1 << 24) - 1 }, { 1 << 24 }, { (1 << 24) + 1 }, { 2147483646 }, { 2147483647 } }, new int[] { 0, 1, 2, 2, 3, 6, 6, 7, 24, 24, 25, 31, 31 }, 4); + GenerateComponentWiseTest(str, "ceillog2", new uint[,] { { 1u }, { 2u }, { 3u }, { 4u }, { 5u }, { 63u }, { 64u }, { 65u }, { (1u << 24) - 1u }, { 1u << 24 }, { (1u << 24) + 1u }, { 4294967294u }, { 4294967295u } }, new int[] { 0, 1, 2, 2, 3, 6, 6, 7, 24, 24 ,25, 32, 32 }, 4); + GenerateComponentWiseTest(str, "ispow2", new int[,] { { -3 }, { -2 }, { -1 }, { 0 }, { 1 }, { 2 }, { 3 }, { 4 }, { (1 << 15) - 1}, { 1 << 15 }, { (1 << 15) + 1}, { (1 << 21) - 1}, { 1 << 21 }, { 268431360 } }, new bool[] { false, false, false, false, true, true, false, true, false, true, false, false, true, false, false }, 4); + GenerateComponentWiseTest(str, "ispow2", new uint[,] { { 0u }, { 1u }, { 2u }, { 3u }, { 4u }, { (1u << 15) - 1}, { 1u << 15 }, { (1u << 15) + 1 }, { (1u << 21) - 1}, { 1u << 21 }, { (1u << 21) + 1 }, { 268431360u } }, new bool[] { false, true, true, false, true, false, true, false, false, true, false, false }, 4); + + str.Append("\n\t}"); + str.Append("\n}\n"); + } + + void TestEqualsObjectOverride(StringBuilder str) + { + BeginTest(str, m_TypeName + "_EqualsObjectOverride", false); + str.Append($"\t\t\tTestUtils.IsFalse(new {m_TypeName}().Equals((object)new int()));\n"); + str.Append($"\t\t\tTestUtils.IsTrue(new {m_TypeName}().Equals((object)new {m_TypeName}()));\n"); + EndTest(str); + } + + private void GenerateTypeTests(StringBuilder str) + { + StringBuilder mathStr = new StringBuilder(); + + str.Append("using NUnit.Framework;\n"); + str.Append("using static Unity.Mathematics.math;\n"); + str.Append("using Burst.Compiler.IL.Tests;\n\n"); + str.Append("namespace Unity.Mathematics.Tests\n"); + str.Append("{\n"); + str.Append("\t[TestFixture]\n"); + str.AppendFormat("\tpublic class Test{0}\n", UpperCaseFirstLetter(m_TypeName)); + str.Append("\t{\n"); + + TestStaticFields(str); + TestConstructors(str); + TestOperators(str); + TestEqualsObjectOverride(str); + + str.Append("\n\t}"); + str.Append("\n}\n"); + } + + void BeginPerformanceTestCodeGen(StringBuilder str, string testSuiteName) + { + str.AppendFormat("using System;\n"); + str.AppendFormat("using NUnit.Framework;\n"); + str.AppendFormat("using Unity.Collections;\n"); + str.AppendFormat("using Unity.Collections.LowLevel.Unsafe;\n"); + str.AppendFormat("using Unity.PerformanceTesting;\n"); + str.AppendFormat("using Unity.Mathematics.Geometry;\n"); + str.AppendFormat("using Unity.Burst;\n\n"); + str.AppendFormat("namespace Unity.Mathematics.PerformanceTests\n"); + str.AppendFormat("{{\n"); + str.AppendFormat("\tpartial class {0}\n", testSuiteName); + str.AppendFormat("\t{{\n"); + } + + void EndPerformanceTestCodeGen(StringBuilder str) + { + str.AppendFormat("\t}}\n"); + str.AppendFormat("}}\n"); + } + + void GenerateMulPerformanceTests(StringBuilder str) + { + BeginPerformanceTestCodeGen(str, "TestMul"); + + GeneratePerformanceTest(str, "float4x4_float4x4", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float4x4", m_MemberName = "m1", m_ElementInitializer = "float4x4.identity" }, + new PerformanceTestArrayArgument { m_ElementType = "float4x4", m_MemberName = "m2", m_ElementInitializer = "float4x4.identity" }, + }, "args.m1[i] = math.mul(args.m1[i], args.m2[i]);", 10000); + GeneratePerformanceTest(str, "float4x4_float4", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float4x4", m_MemberName = "m1", m_ElementInitializer = "float4x4.identity" }, + new PerformanceTestArrayArgument { m_ElementType = "float4", m_MemberName = "m2", m_ElementInitializer = "new float4(1.0f, 0.0f, 0.0f, 1.0f)" }, + }, "args.m2[i] = math.mul(args.m1[i], args.m2[i]);", 10000); + GeneratePerformanceTest(str, "quaternion_quaternion", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "quaternion", m_MemberName = "q1", m_ElementInitializer = "quaternion.identity" }, + new PerformanceTestArrayArgument { m_ElementType = "quaternion", m_MemberName = "q2", m_ElementInitializer = "quaternion.identity" }, + }, "args.q2[i] = math.mul(args.q1[i], args.q2[i]);", 10000); + GeneratePerformanceTest(str, "float3x3_float3x3", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float3x3", m_MemberName = "m1", m_ElementInitializer = "float3x3.identity" }, + new PerformanceTestArrayArgument { m_ElementType = "float3x3", m_MemberName = "m2", m_ElementInitializer = "float3x3.identity" }, + }, "args.m2[i] = math.mul(args.m1[i], args.m2[i]);", 10000); + GeneratePerformanceTest(str, "float2x2_float2x2", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float2x2", m_MemberName = "m1", m_ElementInitializer = "float2x2.identity" }, + new PerformanceTestArrayArgument { m_ElementType = "float2x2", m_MemberName = "m2", m_ElementInitializer = "float2x2.identity" }, + }, "args.m2[i] = math.mul(args.m1[i], args.m2[i]);", 10000); + GeneratePerformanceTest(str, "float3x3_float3", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float3x3", m_MemberName = "m1", m_ElementInitializer = "float3x3.identity" }, + new PerformanceTestArrayArgument { m_ElementType = "float3", m_MemberName = "m2", m_ElementInitializer = "new float3(1.0f, 0.0f, 0.0f)" }, + }, "args.m2[i] = math.mul(args.m1[i], args.m2[i]);", 10000); + GeneratePerformanceTest(str, "float2x2_float2", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float2x2", m_MemberName = "m1", m_ElementInitializer = "float2x2.identity" }, + new PerformanceTestArrayArgument { m_ElementType = "float2", m_MemberName = "m2", m_ElementInitializer = "new float2(1.0f, 0.0f)" }, + }, "args.m2[i] = math.mul(args.m1[i], args.m2[i]);", 10000); + + EndPerformanceTestCodeGen(str); + } + + void GenerateInversePerformanceTests(StringBuilder str) + { + BeginPerformanceTestCodeGen(str, "TestInverse"); + + GeneratePerformanceTest(str, "float4x4_inverse", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float4x4", m_MemberName = "m1", m_ElementInitializer = "float4x4.identity" }, + }, "args.m1[i] = math.inverse(args.m1[i]);", 10000); + GeneratePerformanceTest(str, "float3x3_inverse", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float3x3", m_MemberName = "m1", m_ElementInitializer = "float3x3.identity" }, + }, "args.m1[i] = math.inverse(args.m1[i]);", 10000); + GeneratePerformanceTest(str, "float2x2_inverse", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float2x2", m_MemberName = "m1", m_ElementInitializer = "float2x2.identity" }, + }, "args.m1[i] = math.inverse(args.m1[i]);", 10000); + GeneratePerformanceTest(str, "double4x4_inverse", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "double4x4", m_MemberName = "m1", m_ElementInitializer = "double4x4.identity" }, + }, "args.m1[i] = math.inverse(args.m1[i]);", 10000); + GeneratePerformanceTest(str, "double3x3_inverse", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "double3x3", m_MemberName = "m1", m_ElementInitializer = "double3x3.identity" }, + }, "args.m1[i] = math.inverse(args.m1[i]);", 10000); + GeneratePerformanceTest(str, "double2x2_inverse", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "double2x2", m_MemberName = "m1", m_ElementInitializer = "double2x2.identity" }, + }, "args.m1[i] = math.inverse(args.m1[i]);", 10000); + GeneratePerformanceTest(str, "quaternion_inverse", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "quaternion", m_MemberName = "q", m_ElementInitializer = "quaternion.identity" }, + }, "args.q[i] = math.inverse(args.q[i]);", 10000); + GeneratePerformanceTest(str, "pseudoinverse", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float3x3", m_MemberName = "m", m_ElementInitializer = "new float3x3(0.054824f, 0.462398f, 0.050136f, 0.054824f, 0.462398f, 0.050136f, 0.938166f, 0.542226f, 0.106844f)" }, + }, "args.m[i] = math.pseudoinverse(args.m[i]);", 1000); + + EndPerformanceTestCodeGen(str); + } + + void GenerateFastInversePerformanceTests(StringBuilder str) + { + BeginPerformanceTestCodeGen(str, "TestFastInverse"); + + GeneratePerformanceTest(str, "float4x4_fastinverse", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float4x4", m_MemberName = "m1", m_ElementInitializer = "float4x4.identity" }, + }, "args.m1[i] = math.fastinverse(args.m1[i]);", 10000); + GeneratePerformanceTest(str, "double4x4_fastinverse", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "double4x4", m_MemberName = "m1", m_ElementInitializer = "double4x4.identity" }, + }, "args.m1[i] = math.fastinverse(args.m1[i]);", 10000); + + EndPerformanceTestCodeGen(str); + } + + void GenerateConversionPerformanceTests(StringBuilder str) + { + BeginPerformanceTestCodeGen(str, "TestConversions"); + + // Most of these tests will need to write to an output array to ensure + // burst doesn't optimize away to just one loop iteration. + GeneratePerformanceTest(str, "quaternion_to_float3x3", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "quaternion", m_MemberName = "q", m_ElementInitializer = "quaternion.identity" }, + new PerformanceTestArrayArgument { m_ElementType = "float3x3", m_MemberName = "f3x3", m_ElementInitializer = "float3x3.identity" }, + }, "args.f3x3[i] = new float3x3(args.q[i]);", 10000); + GeneratePerformanceTest(str, "float3x3_to_quaternion", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "quaternion", m_MemberName = "q", m_ElementInitializer = "quaternion.identity" }, + new PerformanceTestArrayArgument { m_ElementType = "float3x3", m_MemberName = "f3x3", m_ElementInitializer = "float3x3.identity" }, + }, "args.q[i] = new quaternion(args.f3x3[i]);", 10000); + GeneratePerformanceTest(str, "float4_to_half4", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float4", m_MemberName = "f4", m_ElementInitializer = "new float4(1.0f, 2.0f, 3.0f, 4.0f)" }, + new PerformanceTestArrayArgument { m_ElementType = "half4", m_MemberName = "h4", m_ElementInitializer = "new half4(new float4(-1.0f, -2.0f, -3.0f, -4.0f))" }, + }, "args.h4[i] = new half4(args.f4[i]);", 10000); + GeneratePerformanceTest(str, "half4_to_float4", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float4", m_MemberName = "f4", m_ElementInitializer = "new float4(1.0f, 2.0f, 3.0f, 4.0f)" }, + new PerformanceTestArrayArgument { m_ElementType = "half4", m_MemberName = "h4", m_ElementInitializer = "new half4(new float4(-1.0f, -2.0f, -3.0f, -4.0f))" }, + }, "args.f4[i] = new float4(args.h4[i]);", 10000); + GeneratePerformanceTest(str, "quaternion_to_RigidTransform", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "quaternion", m_MemberName = "q", m_ElementInitializer = "quaternion.identity" }, + new PerformanceTestArrayArgument { m_ElementType = "RigidTransform", m_MemberName = "rt", m_ElementInitializer = "RigidTransform.identity" }, + new PerformanceTestArrayArgument { m_ElementType = "float3", m_MemberName = "pos", m_ElementInitializer = "new float3()" }, + }, "args.rt[i] = new RigidTransform(args.q[i], args.pos[i]);", 10000); + GeneratePerformanceTest(str, "quaternion_to_float4x4", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "quaternion", m_MemberName = "q", m_ElementInitializer = "quaternion.identity" }, + new PerformanceTestArrayArgument { m_ElementType = "float4x4", m_MemberName = "f4x4", m_ElementInitializer = "float4x4.identity" }, + }, "args.q[i] = new quaternion(args.f4x4[i]);", 10000); + GeneratePerformanceTest(str, "float4x4_to_quaternion", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "quaternion", m_MemberName = "q", m_ElementInitializer = "quaternion.identity" }, + new PerformanceTestArrayArgument { m_ElementType = "float4x4", m_MemberName = "f4x4", m_ElementInitializer = "float4x4.identity" }, + new PerformanceTestArrayArgument { m_ElementType = "float3", m_MemberName = "f3", m_ElementInitializer = "new float3()" }, + }, "args.f4x4[i] = new float4x4(args.q[i], args.f3[i]);", 10000); + GeneratePerformanceTest(str, "float4_to_uint4", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float4", m_MemberName = "f4", m_ElementInitializer = "new float4(1.0f, 2.0f, 3.0f, 4.0f)" }, + new PerformanceTestArrayArgument { m_ElementType = "uint4", m_MemberName = "u4", m_ElementInitializer = "new uint4(100, 101, 102, 103)" }, + }, "args.u4[i] = new uint4(args.f4[i]);", 10000); + GeneratePerformanceTest(str, "uint4_to_float4", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float4", m_MemberName = "f4", m_ElementInitializer = "new float4(1.0f, 2.0f, 3.0f, 4.0f)" }, + new PerformanceTestArrayArgument { m_ElementType = "uint4", m_MemberName = "u4", m_ElementInitializer = "new uint4(100, 101, 102, 103)" }, + }, "args.f4[i] = new float4(args.u4[i]);", 10000); + + EndPerformanceTestCodeGen(str); + } + + void GenerateRandomPerformanceTests(StringBuilder str) + { + BeginPerformanceTestCodeGen(str, "TestRandom"); + + GeneratePerformanceTest(str, "Random_NextUint", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "uint", m_MemberName = "u", m_ElementInitializer = "0" }, + }, "args.u[i] = args.rng.NextUInt();", 10000); + GeneratePerformanceTest(str, "Random_NextUint2", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "uint2", m_MemberName = "u", m_ElementInitializer = "0" }, + }, "args.u[i] = args.rng.NextUInt2();", 10000); + GeneratePerformanceTest(str, "Random_NextUint3", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "uint3", m_MemberName = "u", m_ElementInitializer = "0" }, + }, "args.u[i] = args.rng.NextUInt3();", 10000); + GeneratePerformanceTest(str, "Random_NextUint4", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "uint4", m_MemberName = "u", m_ElementInitializer = "0" }, + }, "args.u[i] = args.rng.NextUInt4();", 10000); + + GeneratePerformanceTest(str, "Random_NextFloat", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float", m_MemberName = "f", m_ElementInitializer = "0.0f" }, + }, "args.f[i] = args.rng.NextFloat();", 10000); + GeneratePerformanceTest(str, "Random_NextFloat2", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float2", m_MemberName = "f", m_ElementInitializer = "new float2(0.0f)" }, + }, "args.f[i] = args.rng.NextFloat2();", 10000); + GeneratePerformanceTest(str, "Random_NextFloat3", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float3", m_MemberName = "f", m_ElementInitializer = "new float3(0.0f)" }, + }, "args.f[i] = args.rng.NextFloat3();", 10000); + GeneratePerformanceTest(str, "Random_NextFloat4", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float4", m_MemberName = "f", m_ElementInitializer = "new float4(0.0f)" }, + }, "args.f[i] = args.rng.NextFloat4();", 10000); + + GeneratePerformanceTest(str, "Random_NextDouble", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "double", m_MemberName = "f", m_ElementInitializer = "0.0" }, + }, "args.f[i] = args.rng.NextDouble();", 10000); + GeneratePerformanceTest(str, "Random_NextDouble2", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "double2", m_MemberName = "f", m_ElementInitializer = "new double2(0.0)" }, + }, "args.f[i] = args.rng.NextDouble2();", 10000); + GeneratePerformanceTest(str, "Random_NextDouble3", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "double3", m_MemberName = "f", m_ElementInitializer = "new double3(0.0)" }, + }, "args.f[i] = args.rng.NextDouble3();", 10000); + GeneratePerformanceTest(str, "Random_NextDouble4", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "double4", m_MemberName = "f", m_ElementInitializer = "new double4(0.0)" }, + }, "args.f[i] = args.rng.NextDouble4();", 10000); + + EndPerformanceTestCodeGen(str); + } + + void GenerateTrigPerformanceTests(StringBuilder str) + { + BeginPerformanceTestCodeGen(str, "TestTrig"); + + GeneratePerformanceTest(str, "float_sincos", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float", m_MemberName = "sin", m_ElementInitializer = "0.0f" }, + new PerformanceTestArrayArgument { m_ElementType = "float", m_MemberName = "cos", m_ElementInitializer = "1.0f" }, + }, "math.sincos(args.sin[i], out args.sin[i], out args.cos[i]);", 10000); + GeneratePerformanceTest(str, "float2_sincos", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float2", m_MemberName = "sin", m_ElementInitializer = "new float2(0.0f)" }, + new PerformanceTestArrayArgument { m_ElementType = "float2", m_MemberName = "cos", m_ElementInitializer = "new float2(1.0f)" }, + }, "math.sincos(args.sin[i], out args.sin[i], out args.cos[i]);", 10000); + GeneratePerformanceTest(str, "float3_sincos", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float3", m_MemberName = "sin", m_ElementInitializer = "new float3(0.0f)" }, + new PerformanceTestArrayArgument { m_ElementType = "float3", m_MemberName = "cos", m_ElementInitializer = "new float3(1.0f)" }, + }, "math.sincos(args.sin[i], out args.sin[i], out args.cos[i]);", 10000); + GeneratePerformanceTest(str, "float4_sincos", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float4", m_MemberName = "sin", m_ElementInitializer = "new float4(0.0f)" }, + new PerformanceTestArrayArgument { m_ElementType = "float4", m_MemberName = "cos", m_ElementInitializer = "new float4(1.0f)" }, + }, "math.sincos(args.sin[i], out args.sin[i], out args.cos[i]);", 10000); + + EndPerformanceTestCodeGen(str); + } + + void GenerateNoisePerformanceTests(StringBuilder str) + { + BeginPerformanceTestCodeGen(str, "TestNoise"); + + GeneratePerformanceTest(str, "snoise2D", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float2", m_MemberName = "v", m_ElementInitializer = "new float2()" }, + }, "args.v[i].x = noise.snoise(args.v[i]);", 10000); + GeneratePerformanceTest(str, "snoise3D", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float3", m_MemberName = "v", m_ElementInitializer = "new float3()" }, + }, "args.v[i].x = noise.snoise(args.v[i]);", 10000); + GeneratePerformanceTest(str, "snoise4D", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float4", m_MemberName = "v", m_ElementInitializer = "new float4()" }, + }, "args.v[i].x = noise.snoise(args.v[i]);", 10000); + GeneratePerformanceTest(str, "snoise3Dgrad", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float3", m_MemberName = "v", m_ElementInitializer = "new float3()" }, + new PerformanceTestArrayArgument { m_ElementType = "float3", m_MemberName = "gradient", m_ElementInitializer = "new float3()" }, + }, "args.v[i].x = noise.snoise(args.v[i], out args.gradient[i]);", 10000); + GeneratePerformanceTest(str, "cnoise2D", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float2", m_MemberName = "v", m_ElementInitializer = "new float2()" }, + }, "args.v[i].x = noise.cnoise(args.v[i]);", 10000); + GeneratePerformanceTest(str, "cnoise3D", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float3", m_MemberName = "v", m_ElementInitializer = "new float3()" }, + }, "args.v[i].x = noise.cnoise(args.v[i]);", 10000); + GeneratePerformanceTest(str, "cnoise4D", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float4", m_MemberName = "v", m_ElementInitializer = "new float4()" }, + }, "args.v[i].x = noise.cnoise(args.v[i]);", 10000); + GeneratePerformanceTest(str, "pnoise2D", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float2", m_MemberName = "v", m_ElementInitializer = "new float2()" }, + }, "args.v[i].x = noise.pnoise(args.v[i], args.v[i]);", 10000); + GeneratePerformanceTest(str, "pnoise3D", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float3", m_MemberName = "v", m_ElementInitializer = "new float3()" }, + }, "args.v[i].x = noise.pnoise(args.v[i], args.v[i]);", 10000); + GeneratePerformanceTest(str, "pnoise4D", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float4", m_MemberName = "v", m_ElementInitializer = "new float4()" }, + }, "args.v[i].x = noise.pnoise(args.v[i], args.v[i]);", 10000); + GeneratePerformanceTest(str, "cellular2D", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float2", m_MemberName = "v", m_ElementInitializer = "new float2()" }, + }, "args.v[i] = noise.cellular(args.v[i]);", 10000); + GeneratePerformanceTest(str, "cellular3D", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float3", m_MemberName = "v", m_ElementInitializer = "new float3()" }, + }, "args.v[i].xy = noise.cellular(args.v[i]);", 10000); + GeneratePerformanceTest(str, "cellular2x2", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float2", m_MemberName = "v", m_ElementInitializer = "new float2()" }, + }, "args.v[i] = noise.cellular2x2(args.v[i]);", 10000); + GeneratePerformanceTest(str, "cellular2x2x2", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float3", m_MemberName = "v", m_ElementInitializer = "new float3()" }, + }, "args.v[i].xy = noise.cellular2x2x2(args.v[i]);", 10000); + GeneratePerformanceTest(str, "psrdnoise", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float2", m_MemberName = "v", m_ElementInitializer = "new float2()" }, + }, "args.v[i] = noise.psrdnoise(args.v[i], args.v[i], args.v[i].y).xy;", 10000); + GeneratePerformanceTest(str, "psrnoise", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float2", m_MemberName = "v", m_ElementInitializer = "new float2()" }, + }, "args.v[i].x = noise.psrnoise(args.v[i], args.v[i], args.v[i].y);", 10000); + GeneratePerformanceTest(str, "srdnoise", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float2", m_MemberName = "v", m_ElementInitializer = "new float2()" }, + }, "args.v[i] = noise.srdnoise(args.v[i], args.v[i].y).xy;", 10000); + GeneratePerformanceTest(str, "srnoise", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float2", m_MemberName = "v", m_ElementInitializer = "new float2()" }, + }, "args.v[i].x = noise.srnoise(args.v[i], args.v[i].y);", 10000); + + EndPerformanceTestCodeGen(str); + } + + void GenerateTransposePerformanceTests(StringBuilder str) + { + BeginPerformanceTestCodeGen(str, "TestTranspose"); + + GeneratePerformanceTest(str, "transpose_float4x4", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float4x4", m_MemberName = "m", m_ElementInitializer = "float4x4.identity" }, + }, "args.m[i] = math.transpose(args.m[i]);", 10000); + GeneratePerformanceTest(str, "transpose_float3x3", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float3x3", m_MemberName = "m", m_ElementInitializer = "float3x3.identity" }, + }, "args.m[i] = math.transpose(args.m[i]);", 10000); + GeneratePerformanceTest(str, "transpose_float2x2", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float2x2", m_MemberName = "m", m_ElementInitializer = "float2x2.identity" }, + }, "args.m[i] = math.transpose(args.m[i]);", 10000); + GeneratePerformanceTest(str, "transpose_double4x4", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "double4x4", m_MemberName = "m", m_ElementInitializer = "double4x4.identity" }, + }, "args.m[i] = math.transpose(args.m[i]);", 10000); + GeneratePerformanceTest(str, "transpose_double3x3", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "double3x3", m_MemberName = "m", m_ElementInitializer = "double3x3.identity" }, + }, "args.m[i] = math.transpose(args.m[i]);", 10000); + GeneratePerformanceTest(str, "transpose_double2x2", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "double2x2", m_MemberName = "m", m_ElementInitializer = "double2x2.identity" }, + }, "args.m[i] = math.transpose(args.m[i]);", 10000); + + EndPerformanceTestCodeGen(str); + } + + void GenerateNormalizePerformanceTests(StringBuilder str) + { + BeginPerformanceTestCodeGen(str, "TestNormalize"); + + GeneratePerformanceTest(str, "float4_normalize", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float4", m_MemberName = "v", m_ElementInitializer = "new float4(1.0f)" }, + }, "args.v[i] = math.normalize(args.v[i]);", 10000); + GeneratePerformanceTest(str, "float3_normalize", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float3", m_MemberName = "v", m_ElementInitializer = "new float3(1.0f)" }, + }, "args.v[i] = math.normalize(args.v[i]);", 10000); + GeneratePerformanceTest(str, "float2_normalize", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float2", m_MemberName = "v", m_ElementInitializer = "new float2(1.0f)" }, + }, "args.v[i] = math.normalize(args.v[i]);", 10000); + + GeneratePerformanceTest(str, "double4_normalize", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "double4", m_MemberName = "v", m_ElementInitializer = "new double4(1.0f)" }, + }, "args.v[i] = math.normalize(args.v[i]);", 10000); + GeneratePerformanceTest(str, "double3_normalize", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "double3", m_MemberName = "v", m_ElementInitializer = "new double3(1.0f)" }, + }, "args.v[i] = math.normalize(args.v[i]);", 10000); + GeneratePerformanceTest(str, "double2_normalize", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "double2", m_MemberName = "v", m_ElementInitializer = "new double2(1.0f)" }, + }, "args.v[i] = math.normalize(args.v[i]);", 10000); + + GeneratePerformanceTest(str, "float4_normalizesafe", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float4", m_MemberName = "v", m_ElementInitializer = "new float4(1.0f)" }, + }, "args.v[i] = math.normalizesafe(args.v[i]);", 10000); + GeneratePerformanceTest(str, "float3_normalizesafe", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float3", m_MemberName = "v", m_ElementInitializer = "new float3(1.0f)" }, + }, "args.v[i] = math.normalizesafe(args.v[i]);", 10000); + GeneratePerformanceTest(str, "float2_normalizesafe", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float2", m_MemberName = "v", m_ElementInitializer = "new float2(1.0f)" }, + }, "args.v[i] = math.normalizesafe(args.v[i]);", 10000); + + GeneratePerformanceTest(str, "double4_normalizesafe", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "double4", m_MemberName = "v", m_ElementInitializer = "new double4(1.0f)" }, + }, "args.v[i] = math.normalizesafe(args.v[i]);", 10000); + GeneratePerformanceTest(str, "double3_normalizesafe", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "double3", m_MemberName = "v", m_ElementInitializer = "new double3(1.0f)" }, + }, "args.v[i] = math.normalizesafe(args.v[i]);", 10000); + GeneratePerformanceTest(str, "double2_normalizesafe", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "double2", m_MemberName = "v", m_ElementInitializer = "new double2(1.0f)" }, + }, "args.v[i] = math.normalizesafe(args.v[i]);", 10000); + + EndPerformanceTestCodeGen(str); + } + + void GenerateRotationPerformanceTests(StringBuilder str) + { + BeginPerformanceTestCodeGen(str, "TestRotation"); + + GeneratePerformanceTest(str, "float4x4_EulerXYZ", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float3", m_MemberName = "v", m_ElementInitializer = "new float3(1.0f)" }, + new PerformanceTestArrayArgument { m_ElementType = "float4x4", m_MemberName = "m", m_ElementInitializer = "float4x4.identity" }, + }, "args.m[i] = float4x4.EulerXYZ(args.v[i]);", 10000); + GeneratePerformanceTest(str, "float3x3_EulerXYZ", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float3", m_MemberName = "v", m_ElementInitializer = "new float3(1.0f)" }, + new PerformanceTestArrayArgument { m_ElementType = "float3x3", m_MemberName = "m", m_ElementInitializer = "float3x3.identity" }, + }, "args.m[i] = float3x3.EulerXYZ(args.v[i]);", 10000); + + GeneratePerformanceTest(str, "float4x4_AxisAngle", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float3", m_MemberName = "v", m_ElementInitializer = "math.normalize(new float3(1.0f))" }, + new PerformanceTestArrayArgument { m_ElementType = "float4x4", m_MemberName = "m", m_ElementInitializer = "float4x4.identity" }, + new PerformanceTestArrayArgument { m_ElementType = "float", m_MemberName = "angle", m_ElementInitializer = "1.0f" }, + }, "args.m[i] = float4x4.AxisAngle(args.v[i], args.angle[i]);", 10000); + GeneratePerformanceTest(str, "float3x3_AxisAngle", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float3", m_MemberName = "v", m_ElementInitializer = "math.normalize(new float3(1.0f))" }, + new PerformanceTestArrayArgument { m_ElementType = "float3x3", m_MemberName = "m", m_ElementInitializer = "float3x3.identity" }, + new PerformanceTestArrayArgument { m_ElementType = "float", m_MemberName = "angle", m_ElementInitializer = "1.0f" }, + }, "args.m[i] = float3x3.AxisAngle(args.v[i], args.angle[i]);", 10000); + + GeneratePerformanceTest(str, "float3x3_LookRotation", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float3", m_MemberName = "forward", m_ElementInitializer = "math.normalize(new float3(1.0f))" }, + new PerformanceTestArrayArgument { m_ElementType = "float3", m_MemberName = "up", m_ElementInitializer = "math.normalize(new float3(0.0f, 1.0f, 0.0f))" }, + new PerformanceTestArrayArgument { m_ElementType = "float3x3", m_MemberName = "m", m_ElementInitializer = "float3x3.identity" }, + }, "args.m[i] = float3x3.LookRotation(args.forward[i], args.up[i]);", 10000); + GeneratePerformanceTest(str, "float3x3_LookRotationSafe", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float3", m_MemberName = "forward", m_ElementInitializer = "math.normalize(new float3(1.0f))" }, + new PerformanceTestArrayArgument { m_ElementType = "float3", m_MemberName = "up", m_ElementInitializer = "math.normalize(new float3(0.0f, 1.0f, 0.0f))" }, + new PerformanceTestArrayArgument { m_ElementType = "float3x3", m_MemberName = "m", m_ElementInitializer = "float3x3.identity" }, + }, "args.m[i] = float3x3.LookRotationSafe(args.forward[i], args.up[i]);", 10000); + GeneratePerformanceTest(str, "float4x4_LookAt", new PerformanceTestArrayArgument[] { + new PerformanceTestArrayArgument { m_ElementType = "float3", m_MemberName = "eye", m_ElementInitializer = "math.normalize(new float3(1.0f))" }, + new PerformanceTestArrayArgument { m_ElementType = "float3", m_MemberName = "target", m_ElementInitializer = "math.normalize(new float3(0.0f, 1.0f, 0.0f))" }, + new PerformanceTestArrayArgument { m_ElementType = "float3", m_MemberName = "up", m_ElementInitializer = "math.normalize(new float3(-5.0f, 2.0f, 3.0f))" }, + new PerformanceTestArrayArgument { m_ElementType = "float4x4", m_MemberName = "m", m_ElementInitializer = "float4x4.identity" }, + }, "args.m[i] = float4x4.LookAt(args.eye[i], args.target[i], args.up[i]);", 10000); + + EndPerformanceTestCodeGen(str); + } + + void GenerateShufflePerformanceTests(StringBuilder str) + { + BeginPerformanceTestCodeGen(str, "TestShuffle"); + + GeneratePerformanceTest(str, "float2_shuffle", new PerformanceTestArrayArgument[] + { + new PerformanceTestArrayArgument { m_ElementType = "float2", m_MemberName = "v1", m_ElementInitializer = "new float2(1.0f)" }, + new PerformanceTestArrayArgument { m_ElementType = "float2", m_MemberName = "v2", m_ElementInitializer = "new float2(2.0f)" }, + new PerformanceTestArrayArgument { m_ElementType = "float2", m_MemberName = "result", m_ElementInitializer = "new float2(1.0f)" }, + }, "args.result[i] = math.shuffle(args.v1[i], args.v2[i], math.ShuffleComponent.RightX, math.ShuffleComponent.LeftY);", 100000); + + GeneratePerformanceTest(str, "float3_shuffle", new PerformanceTestArrayArgument[] + { + new PerformanceTestArrayArgument { m_ElementType = "float3", m_MemberName = "v1", m_ElementInitializer = "new float3(1.0f)" }, + new PerformanceTestArrayArgument { m_ElementType = "float3", m_MemberName = "v2", m_ElementInitializer = "new float3(2.0f)" }, + new PerformanceTestArrayArgument { m_ElementType = "float3", m_MemberName = "result", m_ElementInitializer = "new float3(1.0f)" }, + }, "args.result[i] = math.shuffle(args.v1[i], args.v2[i], math.ShuffleComponent.RightX, math.ShuffleComponent.LeftZ, math.ShuffleComponent.LeftX);", 100000); + + GeneratePerformanceTest(str, "float4_shuffle", new PerformanceTestArrayArgument[] + { + new PerformanceTestArrayArgument { m_ElementType = "float4", m_MemberName = "v1", m_ElementInitializer = "new float4(1.0f)" }, + new PerformanceTestArrayArgument { m_ElementType = "float4", m_MemberName = "v2", m_ElementInitializer = "new float4(2.0f)" }, + new PerformanceTestArrayArgument { m_ElementType = "float4", m_MemberName = "result", m_ElementInitializer = "new float4(1.0f)" }, + }, "args.result[i] = math.shuffle(args.v1[i], args.v2[i], math.ShuffleComponent.RightX, math.ShuffleComponent.LeftZ, math.ShuffleComponent.LeftX, math.ShuffleComponent.RightY);", 100000); + + EndPerformanceTestCodeGen(str); + } + + void GenerateHashPerformanceTests(StringBuilder str) + { + BeginPerformanceTestCodeGen(str, "TestHash"); + + GeneratePerformanceTest(str, "float2_hash", new PerformanceTestArrayArgument[] + { + new PerformanceTestArrayArgument { m_ElementType = "float2", m_MemberName = "v", m_ElementInitializer = "new float2(1.0f)" }, + new PerformanceTestArrayArgument { m_ElementType = "uint", m_MemberName = "hash", m_ElementInitializer = "0" }, + }, "args.hash[i] = math.hash(args.v[i]);", 100000); + GeneratePerformanceTest(str, "float3_hash", new PerformanceTestArrayArgument[] + { + new PerformanceTestArrayArgument { m_ElementType = "float3", m_MemberName = "v", m_ElementInitializer = "new float3(1.0f)" }, + new PerformanceTestArrayArgument { m_ElementType = "uint", m_MemberName = "hash", m_ElementInitializer = "0" }, + }, "args.hash[i] = math.hash(args.v[i]);", 100000); + GeneratePerformanceTest(str, "float4_hash", new PerformanceTestArrayArgument[] + { + new PerformanceTestArrayArgument { m_ElementType = "float4", m_MemberName = "v", m_ElementInitializer = "new float4(1.0f)" }, + new PerformanceTestArrayArgument { m_ElementType = "uint", m_MemberName = "hash", m_ElementInitializer = "0" }, + }, "args.hash[i] = math.hash(args.v[i]);", 100000); + + GeneratePerformanceTest(str, "double2_hash", new PerformanceTestArrayArgument[] + { + new PerformanceTestArrayArgument { m_ElementType = "double2", m_MemberName = "v", m_ElementInitializer = "new double2(1.0f)" }, + new PerformanceTestArrayArgument { m_ElementType = "uint", m_MemberName = "hash", m_ElementInitializer = "0" }, + }, "args.hash[i] = math.hash(args.v[i]);", 100000); + GeneratePerformanceTest(str, "double3_hash", new PerformanceTestArrayArgument[] + { + new PerformanceTestArrayArgument { m_ElementType = "double3", m_MemberName = "v", m_ElementInitializer = "new double3(1.0f)" }, + new PerformanceTestArrayArgument { m_ElementType = "uint", m_MemberName = "hash", m_ElementInitializer = "0" }, + }, "args.hash[i] = math.hash(args.v[i]);", 100000); + GeneratePerformanceTest(str, "double4_hash", new PerformanceTestArrayArgument[] + { + new PerformanceTestArrayArgument { m_ElementType = "double4", m_MemberName = "v", m_ElementInitializer = "new double4(1.0f)" }, + new PerformanceTestArrayArgument { m_ElementType = "uint", m_MemberName = "hash", m_ElementInitializer = "0" }, + }, "args.hash[i] = math.hash(args.v[i]);", 100000); + + GeneratePerformanceTest(str, "float2x2_hash", new PerformanceTestArrayArgument[] + { + new PerformanceTestArrayArgument { m_ElementType = "float2x2", m_MemberName = "v", m_ElementInitializer = "new float2x2(1.0f)" }, + new PerformanceTestArrayArgument { m_ElementType = "uint", m_MemberName = "hash", m_ElementInitializer = "0" }, + }, "args.hash[i] = math.hash(args.v[i]);", 100000); + GeneratePerformanceTest(str, "float3x3_hash", new PerformanceTestArrayArgument[] + { + new PerformanceTestArrayArgument { m_ElementType = "float3x3", m_MemberName = "v", m_ElementInitializer = "new float3x3(1.0f)" }, + new PerformanceTestArrayArgument { m_ElementType = "uint", m_MemberName = "hash", m_ElementInitializer = "0" }, + }, "args.hash[i] = math.hash(args.v[i]);", 100000); + GeneratePerformanceTest(str, "float4x4_hash", new PerformanceTestArrayArgument[] + { + new PerformanceTestArrayArgument { m_ElementType = "float4x4", m_MemberName = "v", m_ElementInitializer = "new float4x4(1.0f)" }, + new PerformanceTestArrayArgument { m_ElementType = "uint", m_MemberName = "hash", m_ElementInitializer = "0" }, + }, "args.hash[i] = math.hash(args.v[i]);", 100000); + + GeneratePerformanceTest(str, "float2x2_hashwide", new PerformanceTestArrayArgument[] + { + new PerformanceTestArrayArgument { m_ElementType = "float2x2", m_MemberName = "v", m_ElementInitializer = "new float2x2(1.0f)" }, + new PerformanceTestArrayArgument { m_ElementType = "uint2", m_MemberName = "hash", m_ElementInitializer = "0" }, + }, "args.hash[i] = math.hashwide(args.v[i]);", 100000); + GeneratePerformanceTest(str, "float3x3_hashwide", new PerformanceTestArrayArgument[] + { + new PerformanceTestArrayArgument { m_ElementType = "float3x3", m_MemberName = "v", m_ElementInitializer = "new float3x3(1.0f)" }, + new PerformanceTestArrayArgument { m_ElementType = "uint3", m_MemberName = "hash", m_ElementInitializer = "0" }, + }, "args.hash[i] = math.hashwide(args.v[i]);", 100000); + GeneratePerformanceTest(str, "float4x4_hashwide", new PerformanceTestArrayArgument[] + { + new PerformanceTestArrayArgument { m_ElementType = "float4x4", m_MemberName = "v", m_ElementInitializer = "new float4x4(1.0f)" }, + new PerformanceTestArrayArgument { m_ElementType = "uint4", m_MemberName = "hash", m_ElementInitializer = "0" }, + }, "args.hash[i] = math.hashwide(args.v[i]);", 100000); + + GeneratePerformanceTest(str, "float2_hashwide", new PerformanceTestArrayArgument[] + { + new PerformanceTestArrayArgument { m_ElementType = "float2", m_MemberName = "v", m_ElementInitializer = "new float2(1.0f)" }, + new PerformanceTestArrayArgument { m_ElementType = "uint2", m_MemberName = "hash", m_ElementInitializer = "new uint2()" }, + }, "args.hash[i] = math.hashwide(args.v[i]);", 100000); + + EndPerformanceTestCodeGen(str); + } + + void GeneratePlanePerformanceTests(StringBuilder str) + { + BeginPerformanceTestCodeGen(str, "TestPlane"); + + GeneratePerformanceTest(str, "Normalize_Plane", new PerformanceTestArrayArgument[] + { + new PerformanceTestArrayArgument { m_ElementType = "Plane", m_MemberName = "p", m_ElementInitializer = "new Plane { NormalAndDistance = new float4(1.0f) }" }, + }, "args.p[i] = Plane.Normalize(args.p[i]);", 10000); + + EndPerformanceTestCodeGen(str); + } + + public void GenerateMinMaxAabbPerformanceTests(StringBuilder str) + { + BeginPerformanceTestCodeGen(str, "TestMinMaxAABB"); + + GeneratePerformanceTest(str, "Transform_float4x4", new PerformanceTestArrayArgument[] + { + new PerformanceTestArrayArgument { m_ElementType = "Geometry.MinMaxAABB", m_MemberName = "a", m_ElementInitializer = "new Geometry.MinMaxAABB()" }, + }, "args.a[i] = Geometry.Math.Transform(float4x4.identity, args.a[i]);", 100000); + GeneratePerformanceTest(str, "Transform_float3x3", new PerformanceTestArrayArgument[] + { + new PerformanceTestArrayArgument { m_ElementType = "Geometry.MinMaxAABB", m_MemberName = "a", m_ElementInitializer = "new Geometry.MinMaxAABB()" }, + }, "args.a[i] = Geometry.Math.Transform(float3x3.identity, args.a[i]);", 100000); + + EndPerformanceTestCodeGen(str); + } + + public void GenerateMathPerformanceTests(StringBuilder str) + { + BeginPerformanceTestCodeGen(str, "TestMath"); + + GeneratePerformanceTest(str, "orthonormal_basis_float", new PerformanceTestArrayArgument[] + { + new PerformanceTestArrayArgument { m_ElementType = "float3", m_MemberName = "v1", m_ElementInitializer = "rng.NextFloat3Direction()" }, + new PerformanceTestArrayArgument { m_ElementType = "float3", m_MemberName = "v2", m_ElementInitializer = "new float3()" }, + new PerformanceTestArrayArgument { m_ElementType = "float3", m_MemberName = "v3", m_ElementInitializer = "new float3()" }, + }, "math.orthonormal_basis(args.v1[i], out args.v2[i], out args.v3[i]);", 1000000); + + GeneratePerformanceTest(str, "orthonormal_basis_double", new PerformanceTestArrayArgument[] + { + new PerformanceTestArrayArgument { m_ElementType = "double3", m_MemberName = "v1", m_ElementInitializer = "rng.NextDouble3Direction()" }, + new PerformanceTestArrayArgument { m_ElementType = "double3", m_MemberName = "v2", m_ElementInitializer = "new double()" }, + new PerformanceTestArrayArgument { m_ElementType = "double3", m_MemberName = "v3", m_ElementInitializer = "new double()" }, + }, "math.orthonormal_basis(args.v1[i], out args.v2[i], out args.v3[i]);", 1000000); + + GeneratePerformanceTest(str, "asuint_float", new[] + { + new PerformanceTestArrayArgument { m_ElementType = "uint", m_MemberName = "result", m_ElementInitializer = "new uint()" }, + new PerformanceTestArrayArgument { m_ElementType = "float", m_MemberName = "v", m_ElementInitializer = "rng.NextFloat(-1.0f, 1.0f)" }, + }, "args.result[i] = math.asuint(args.v[i]);", 400000); + + GeneratePerformanceTest(str, "asuint_float2", new[] + { + new PerformanceTestArrayArgument { m_ElementType = "uint2", m_MemberName = "result", m_ElementInitializer = "new uint2()" }, + new PerformanceTestArrayArgument { m_ElementType = "float2", m_MemberName = "v", m_ElementInitializer = "rng.NextFloat2(-1.0f, 1.0f)" }, + }, "args.result[i] = math.asuint(args.v[i]);", 400000); + + GeneratePerformanceTest(str, "asuint_float3", new[] + { + new PerformanceTestArrayArgument { m_ElementType = "uint3", m_MemberName = "result", m_ElementInitializer = "new uint3()" }, + new PerformanceTestArrayArgument { m_ElementType = "float3", m_MemberName = "v", m_ElementInitializer = "rng.NextFloat3(-1.0f, 1.0f)" }, + }, "args.result[i] = math.asuint(args.v[i]);", 400000); + + GeneratePerformanceTest(str, "asuint_float4", new[] + { + new PerformanceTestArrayArgument { m_ElementType = "uint4", m_MemberName = "result", m_ElementInitializer = "new uint4()" }, + new PerformanceTestArrayArgument { m_ElementType = "float4", m_MemberName = "v", m_ElementInitializer = "rng.NextFloat4(-1.0f, 1.0f)" }, + }, "args.result[i] = math.asuint(args.v[i]);", 400000); + + GeneratePerformanceTest(str, "asint_float", new[] + { + new PerformanceTestArrayArgument { m_ElementType = "int", m_MemberName = "result", m_ElementInitializer = "new int()" }, + new PerformanceTestArrayArgument { m_ElementType = "float", m_MemberName = "v", m_ElementInitializer = "rng.NextFloat(-1.0f, 1.0f)" }, + }, "args.result[i] = math.asint(args.v[i]);", 400000); + + GeneratePerformanceTest(str, "asint_float2", new[] + { + new PerformanceTestArrayArgument { m_ElementType = "int2", m_MemberName = "result", m_ElementInitializer = "new int2()" }, + new PerformanceTestArrayArgument { m_ElementType = "float2", m_MemberName = "v", m_ElementInitializer = "rng.NextFloat2(-1.0f, 1.0f)" }, + }, "args.result[i] = math.asint(args.v[i]);", 400000); + + GeneratePerformanceTest(str, "asint_float3", new[] + { + new PerformanceTestArrayArgument { m_ElementType = "int3", m_MemberName = "result", m_ElementInitializer = "new int3()" }, + new PerformanceTestArrayArgument { m_ElementType = "float3", m_MemberName = "v", m_ElementInitializer = "rng.NextFloat3(-1.0f, 1.0f)" }, + }, "args.result[i] = math.asint(args.v[i]);", 400000); + + GeneratePerformanceTest(str, "asint_float4", new[] + { + new PerformanceTestArrayArgument { m_ElementType = "int4", m_MemberName = "result", m_ElementInitializer = "new int4()" }, + new PerformanceTestArrayArgument { m_ElementType = "float4", m_MemberName = "v", m_ElementInitializer = "rng.NextFloat4(-1.0f, 1.0f)" }, + }, "args.result[i] = math.asint(args.v[i]);", 400000); + + GeneratePerformanceTest(str, "asfloat_uint", new[] + { + new PerformanceTestArrayArgument { m_ElementType = "float", m_MemberName = "result", m_ElementInitializer = "new uint()" }, + new PerformanceTestArrayArgument { m_ElementType = "uint", m_MemberName = "v", m_ElementInitializer = "rng.NextUInt()" }, + }, "args.result[i] = math.asfloat(args.v[i]);", 400000); + + GeneratePerformanceTest(str, "asfloat_uint2", new[] + { + new PerformanceTestArrayArgument { m_ElementType = "float2", m_MemberName = "result", m_ElementInitializer = "new uint2()" }, + new PerformanceTestArrayArgument { m_ElementType = "uint2", m_MemberName = "v", m_ElementInitializer = "rng.NextUInt2()" }, + }, "args.result[i] = math.asfloat(args.v[i]);", 400000); + + GeneratePerformanceTest(str, "asfloat_uint3", new[] + { + new PerformanceTestArrayArgument { m_ElementType = "float3", m_MemberName = "result", m_ElementInitializer = "new uint3()" }, + new PerformanceTestArrayArgument { m_ElementType = "uint3", m_MemberName = "v", m_ElementInitializer = "rng.NextUInt3()" }, + }, "args.result[i] = math.asfloat(args.v[i]);", 400000); + + GeneratePerformanceTest(str, "asfloat_uint4", new[] + { + new PerformanceTestArrayArgument { m_ElementType = "float4", m_MemberName = "result", m_ElementInitializer = "new uint4()" }, + new PerformanceTestArrayArgument { m_ElementType = "uint4", m_MemberName = "v", m_ElementInitializer = "rng.NextUInt4()" }, + }, "args.result[i] = math.asfloat(args.v[i]);", 400000); + + GeneratePerformanceTest(str, "asfloat_int", new[] + { + new PerformanceTestArrayArgument { m_ElementType = "float", m_MemberName = "result", m_ElementInitializer = "new int()" }, + new PerformanceTestArrayArgument { m_ElementType = "int", m_MemberName = "v", m_ElementInitializer = "rng.NextInt()" }, + }, "args.result[i] = math.asfloat(args.v[i]);", 400000); + + GeneratePerformanceTest(str, "asfloat_int2", new[] + { + new PerformanceTestArrayArgument { m_ElementType = "float2", m_MemberName = "result", m_ElementInitializer = "new int2()" }, + new PerformanceTestArrayArgument { m_ElementType = "int2", m_MemberName = "v", m_ElementInitializer = "rng.NextInt2()" }, + }, "args.result[i] = math.asfloat(args.v[i]);", 400000); + + GeneratePerformanceTest(str, "asfloat_int3", new[] + { + new PerformanceTestArrayArgument { m_ElementType = "float3", m_MemberName = "result", m_ElementInitializer = "new int3()" }, + new PerformanceTestArrayArgument { m_ElementType = "int3", m_MemberName = "v", m_ElementInitializer = "rng.NextInt3()" }, + }, "args.result[i] = math.asfloat(args.v[i]);", 400000); + + GeneratePerformanceTest(str, "asfloat_int4", new[] + { + new PerformanceTestArrayArgument { m_ElementType = "float4", m_MemberName = "result", m_ElementInitializer = "new int4()" }, + new PerformanceTestArrayArgument { m_ElementType = "int4", m_MemberName = "v", m_ElementInitializer = "rng.NextInt4()" }, + }, "args.result[i] = math.asfloat(args.v[i]);", 400000); + + GeneratePerformanceTest(str, "asdouble_ulong", new[] + { + new PerformanceTestArrayArgument { m_ElementType = "double", m_MemberName = "result", m_ElementInitializer = "new double()" }, + new PerformanceTestArrayArgument { m_ElementType = "ulong", m_MemberName = "v", m_ElementInitializer = "rng.NextUInt()" }, + }, "args.result[i] = math.asdouble(args.v[i]);", 400000); + + GeneratePerformanceTest(str, "asdouble_long", new[] + { + new PerformanceTestArrayArgument { m_ElementType = "double", m_MemberName = "result", m_ElementInitializer = "new double()" }, + new PerformanceTestArrayArgument { m_ElementType = "long", m_MemberName = "v", m_ElementInitializer = "rng.NextInt()" }, + }, "args.result[i] = math.asdouble(args.v[i]);", 400000); + + GeneratePerformanceTest(str, "aslong_double", new[] + { + new PerformanceTestArrayArgument { m_ElementType = "long", m_MemberName = "result", m_ElementInitializer = "new long()" }, + new PerformanceTestArrayArgument { m_ElementType = "double", m_MemberName = "v", m_ElementInitializer = "rng.NextDouble(-1.0, 1.0)" }, + }, "args.result[i] = math.aslong(args.v[i]);", 400000); + + GeneratePerformanceTest(str, "asulong_double", new[] + { + new PerformanceTestArrayArgument { m_ElementType = "ulong", m_MemberName = "result", m_ElementInitializer = "new ulong()" }, + new PerformanceTestArrayArgument { m_ElementType = "double", m_MemberName = "v", m_ElementInitializer = "rng.NextDouble(-1.0, 1.0)" }, + }, "args.result[i] = math.asulong(args.v[i]);", 400000); + + GeneratePerformanceTest(str, "asuint_int", new[] + { + new PerformanceTestArrayArgument { m_ElementType = "uint", m_MemberName = "result", m_ElementInitializer = "new uint()" }, + new PerformanceTestArrayArgument { m_ElementType = "int", m_MemberName = "v", m_ElementInitializer = "rng.NextInt()" }, + }, "args.result[i] = math.asuint(args.v[i]);", 400000); + + GeneratePerformanceTest(str, "asuint_int2", new[] + { + new PerformanceTestArrayArgument { m_ElementType = "uint2", m_MemberName = "result", m_ElementInitializer = "new uint2()" }, + new PerformanceTestArrayArgument { m_ElementType = "int2", m_MemberName = "v", m_ElementInitializer = "rng.NextInt2()" }, + }, "args.result[i] = math.asuint(args.v[i]);", 400000); + + GeneratePerformanceTest(str, "asuint_int3", new[] + { + new PerformanceTestArrayArgument { m_ElementType = "uint3", m_MemberName = "result", m_ElementInitializer = "new uint3()" }, + new PerformanceTestArrayArgument { m_ElementType = "int3", m_MemberName = "v", m_ElementInitializer = "rng.NextInt3()" }, + }, "args.result[i] = math.asuint(args.v[i]);", 400000); + + GeneratePerformanceTest(str, "asuint_int4", new[] + { + new PerformanceTestArrayArgument { m_ElementType = "uint4", m_MemberName = "result", m_ElementInitializer = "new uint4()" }, + new PerformanceTestArrayArgument { m_ElementType = "int4", m_MemberName = "v", m_ElementInitializer = "rng.NextInt4()" }, + }, "args.result[i] = math.asuint(args.v[i]);", 400000); + + GeneratePerformanceTest(str, "asint_uint", new[] + { + new PerformanceTestArrayArgument { m_ElementType = "int", m_MemberName = "result", m_ElementInitializer = "new int()" }, + new PerformanceTestArrayArgument { m_ElementType = "uint", m_MemberName = "v", m_ElementInitializer = "rng.NextUInt()" }, + }, "args.result[i] = math.asint(args.v[i]);", 400000); + + GeneratePerformanceTest(str, "asint_uint2", new[] + { + new PerformanceTestArrayArgument { m_ElementType = "int2", m_MemberName = "result", m_ElementInitializer = "new int2()" }, + new PerformanceTestArrayArgument { m_ElementType = "uint2", m_MemberName = "v", m_ElementInitializer = "rng.NextUInt2()" }, + }, "args.result[i] = math.asint(args.v[i]);", 400000); + + GeneratePerformanceTest(str, "asint_uint3", new[] + { + new PerformanceTestArrayArgument { m_ElementType = "int3", m_MemberName = "result", m_ElementInitializer = "new int3()" }, + new PerformanceTestArrayArgument { m_ElementType = "uint3", m_MemberName = "v", m_ElementInitializer = "rng.NextUInt3()" }, + }, "args.result[i] = math.asint(args.v[i]);", 400000); + + GeneratePerformanceTest(str, "asint_uint4", new[] + { + new PerformanceTestArrayArgument { m_ElementType = "int4", m_MemberName = "result", m_ElementInitializer = "new int4()" }, + new PerformanceTestArrayArgument { m_ElementType = "uint4", m_MemberName = "v", m_ElementInitializer = "rng.NextUInt4()" }, + }, "args.result[i] = math.asint(args.v[i]);", 400000); + + GeneratePerformanceTest(str, "chgsign_float", new PerformanceTestArrayArgument[] + { + new PerformanceTestArrayArgument { m_ElementType = "float", m_MemberName = "f", m_ElementInitializer = "1.0f" }, + new PerformanceTestArrayArgument { m_ElementType = "float", m_MemberName = "sign", m_ElementInitializer = "rng.NextFloat(-1.0f, 1.0f)" }, + new PerformanceTestArrayArgument { m_ElementType = "float", m_MemberName = "result", m_ElementInitializer = "0.0f" }, + }, "args.result[i] = math.chgsign(args.f[i], args.sign[i]);", 100000); + + GeneratePerformanceTest(str, "chgsign_float2", new PerformanceTestArrayArgument[] + { + new PerformanceTestArrayArgument { m_ElementType = "float2", m_MemberName = "f", m_ElementInitializer = "new float2(1.0f)" }, + new PerformanceTestArrayArgument { m_ElementType = "float2", m_MemberName = "sign", m_ElementInitializer = "rng.NextFloat2(-1.0f, 1.0f)" }, + new PerformanceTestArrayArgument { m_ElementType = "float2", m_MemberName = "result", m_ElementInitializer = "new float2()" }, + }, "args.result[i] = math.chgsign(args.f[i], args.sign[i]);", 100000); + + GeneratePerformanceTest(str, "chgsign_float3", new PerformanceTestArrayArgument[] + { + new PerformanceTestArrayArgument { m_ElementType = "float3", m_MemberName = "f", m_ElementInitializer = "new float3(1.0f)" }, + new PerformanceTestArrayArgument { m_ElementType = "float3", m_MemberName = "sign", m_ElementInitializer = "rng.NextFloat3(-1.0f, 1.0f)" }, + new PerformanceTestArrayArgument { m_ElementType = "float3", m_MemberName = "result", m_ElementInitializer = "new float3()" }, + }, "args.result[i] = math.chgsign(args.f[i], args.sign[i]);", 100000); + + GeneratePerformanceTest(str, "chgsign_float4", new PerformanceTestArrayArgument[] + { + new PerformanceTestArrayArgument { m_ElementType = "float4", m_MemberName = "f", m_ElementInitializer = "new float4(1.0f)" }, + new PerformanceTestArrayArgument { m_ElementType = "float4", m_MemberName = "sign", m_ElementInitializer = "rng.NextFloat4(-1.0f, 1.0f)" }, + new PerformanceTestArrayArgument { m_ElementType = "float4", m_MemberName = "result", m_ElementInitializer = "new float4()" }, + }, "args.result[i] = math.chgsign(args.f[i], args.sign[i]);", 100000); + + GeneratePerformanceTest(str, "angle_quaternion_quaternion", new PerformanceTestArrayArgument[] + { + new PerformanceTestArrayArgument { m_ElementType = "quaternion", m_MemberName = "q1", m_ElementInitializer = "rng.NextQuaternionRotation()" }, + new PerformanceTestArrayArgument { m_ElementType = "quaternion", m_MemberName = "q2", m_ElementInitializer = "rng.NextQuaternionRotation()" }, + new PerformanceTestArrayArgument { m_ElementType = "float", m_MemberName = "result", m_ElementInitializer = "new float()" }, + }, "args.result[i] = math.angle(args.q1[i], args.q2[i]);", 10000); + + EndPerformanceTestCodeGen(str); + } + + public struct PerformanceTestArrayArgument + { + public string m_ElementType; + public string m_MemberName; + public string m_ElementInitializer; + } + + void GeneratePerformanceTest(StringBuilder str, string testName, PerformanceTestArrayArgument[] testArguments, string loopBody, int loopIterations, uint rngSeed = 1u) + { + str.AppendFormat("\t\t[BurstCompile(CompileSynchronously = true)]\n"); + str.AppendFormat("\t\tpublic unsafe class {0}\n", testName); + str.AppendFormat("\t\t{{\n"); + str.AppendFormat("\t\t\tpublic const int iterations = {0};\n\n", loopIterations); + str.AppendFormat("\t\t\tpublic struct Arguments : IDisposable\n"); + str.AppendFormat("\t\t\t{{\n"); + str.AppendFormat("\t\t\t\tpublic Random rng;\n"); + + foreach (var argument in testArguments) + { + str.AppendFormat("\t\t\t\tpublic {0}* {1};\n", argument.m_ElementType, argument.m_MemberName); + } + + str.AppendFormat("\n"); + str.AppendFormat("\t\t\t\tpublic void Init()\n"); + str.AppendFormat("\t\t\t\t{{\n"); + str.AppendFormat("\t\t\t\t\trng = new Random({0});\n", rngSeed); + + foreach (var argument in testArguments) + { + str.AppendFormat("\t\t\t\t\t{0} = ({1}*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf<{1}>() * iterations, UnsafeUtility.AlignOf<{1}>(), Allocator.Persistent);\n", argument.m_MemberName, argument.m_ElementType); + str.AppendFormat("\t\t\t\t\tfor (int i = 0; i < iterations; ++i)\n"); + str.AppendFormat("\t\t\t\t\t{{\n"); + str.AppendFormat("\t\t\t\t\t {0}[i] = {1};\n", argument.m_MemberName, argument.m_ElementInitializer); + str.AppendFormat("\t\t\t\t\t}}\n\n"); + } + + str.AppendFormat("\t\t\t\t}}\n\n"); + str.AppendFormat("\t\t\t\tpublic void Dispose()\n"); + str.AppendFormat("\t\t\t\t{{\n"); + + foreach (var argument in testArguments) + { + str.AppendFormat("\t\t\t\t\tUnsafeUtility.Free({0}, Allocator.Persistent);\n", argument.m_MemberName); + } + + str.AppendFormat("\t\t\t\t}}\n"); + str.AppendFormat("\t\t\t}}\n"); + str.AppendFormat("\n"); + + str.AppendFormat("\t\t\tpublic static void CommonTestFunction(ref Arguments args)\n"); + str.AppendFormat("\t\t\t{{\n"); + str.AppendFormat("\t\t\t\tfor (int i = 0; i < iterations; ++i)\n"); + str.AppendFormat("\t\t\t\t{{\n"); + str.AppendFormat("\t\t\t\t\t{0}\n", loopBody); + str.AppendFormat("\t\t\t\t}}\n"); + str.AppendFormat("\t\t\t}}\n\n"); + str.AppendFormat("\t\t\tpublic static void MonoTestFunction(ref Arguments args)\n"); + str.AppendFormat("\t\t\t{{\n"); + str.AppendFormat("\t\t\t\tCommonTestFunction(ref args);\n"); + str.AppendFormat("\t\t\t}}\n\n"); + str.AppendFormat("\t\t\t[BurstCompile(CompileSynchronously = true)]\n"); + str.AppendFormat("\t\t\tpublic static void BurstTestFunction(ref Arguments args)\n"); + str.AppendFormat("\t\t\t{{\n"); + str.AppendFormat("\t\t\t\tCommonTestFunction(ref args);\n"); + str.AppendFormat("\t\t\t}}\n\n"); + str.AppendFormat("\t\t\tpublic delegate void TestFunction(ref Arguments args);\n"); + str.AppendFormat("\t\t}}\n\n"); + str.AppendFormat("\t\t[Test, Performance]\n"); + str.AppendFormat("\t\tpublic void {0}_mono()\n", testName); + str.AppendFormat("\t\t{{\n"); + str.AppendFormat("\t\t\t{0}.TestFunction testFunction = {0}.MonoTestFunction;\n", testName); + str.AppendFormat("\t\t\tvar args = new {0}.Arguments();\n", testName); + str.AppendFormat("\t\t\targs.Init();\n"); + str.AppendFormat("\n"); + str.AppendFormat("\t\t\tvar monoSampleGroup = new SampleGroup(\"Mono\", SampleUnit.Microsecond);"); + str.AppendFormat("\t\t\tMeasure.Method(() =>\n"); + str.AppendFormat("\t\t\t{{\n"); + str.AppendFormat("\t\t\t\ttestFunction.Invoke(ref args);\n"); + str.AppendFormat("\t\t\t}})\n"); + str.AppendFormat("\t\t\t.SampleGroup(monoSampleGroup)\n"); + str.AppendFormat("\t\t\t.WarmupCount(1)\n"); + str.AppendFormat("\t\t\t.MeasurementCount(10)\n"); + str.AppendFormat("\t\t\t.Run();\n"); + str.AppendFormat("\t\t\targs.Dispose();\n"); + str.AppendFormat("\t\t}}\n\n"); + str.AppendFormat("\t\t[Test, Performance]\n"); + str.AppendFormat("\t\tpublic void {0}_burst()\n", testName); + str.AppendFormat("\t\t{{\n"); + str.AppendFormat("\t\t\tFunctionPointer<{0}.TestFunction> testFunction = BurstCompiler.CompileFunctionPointer<{0}.TestFunction>({0}.BurstTestFunction);\n", testName); + str.AppendFormat("\t\t\tvar args = new {0}.Arguments();\n", testName); + str.AppendFormat("\t\t\targs.Init();\n"); + str.AppendFormat("\n"); + str.AppendFormat("\t\t\tvar burstSampleGroup = new SampleGroup(\"Burst\", SampleUnit.Microsecond);"); + str.AppendFormat("\t\t\tMeasure.Method(() =>\n"); + str.AppendFormat("\t\t\t{{\n"); + str.AppendFormat("\t\t\t testFunction.Invoke(ref args);\n"); + str.AppendFormat("\t\t\t}})\n"); + str.AppendFormat("\t\t\t.SampleGroup(burstSampleGroup)\n"); + str.AppendFormat("\t\t\t.WarmupCount(1)\n"); + str.AppendFormat("\t\t\t.MeasurementCount(10)\n"); + str.AppendFormat("\t\t\t.Run();\n"); + str.AppendFormat("\t\t\targs.Dispose();\n"); + str.AppendFormat("\t\t}}\n"); + } + + void WritePerformanceTests() + { + StringBuilder testMulStr = new StringBuilder(); + GenerateMulPerformanceTests(testMulStr); + WriteFile(m_PerformanceTestDirectory + "/TestMul.gen.cs", testMulStr.ToString()); + + StringBuilder inverseStr = new StringBuilder(); + GenerateInversePerformanceTests(inverseStr); + WriteFile(m_PerformanceTestDirectory + "/TestInverse.gen.cs", inverseStr.ToString()); + + StringBuilder fastInverseStr = new StringBuilder(); + GenerateFastInversePerformanceTests(fastInverseStr); + WriteFile(m_PerformanceTestDirectory + "/TestFastInverse.gen.cs", fastInverseStr.ToString()); + + StringBuilder conversionStr = new StringBuilder(); + GenerateConversionPerformanceTests(conversionStr); + WriteFile(m_PerformanceTestDirectory + "/TestConversions.gen.cs", conversionStr.ToString()); + + StringBuilder randomStr = new StringBuilder(); + GenerateRandomPerformanceTests(randomStr); + WriteFile(m_PerformanceTestDirectory + "/TestRandom.gen.cs", randomStr.ToString()); + + StringBuilder trigStr = new StringBuilder(); + GenerateTrigPerformanceTests(trigStr); + WriteFile(m_PerformanceTestDirectory + "/TestTrig.gen.cs", trigStr.ToString()); + + StringBuilder noiseStr = new StringBuilder(); + GenerateNoisePerformanceTests(noiseStr); + WriteFile(m_PerformanceTestDirectory + "/TestNoise.gen.cs", noiseStr.ToString()); + + StringBuilder transposeStr = new StringBuilder(); + GenerateTransposePerformanceTests(transposeStr); + WriteFile(m_PerformanceTestDirectory + "/TestTranspose.gen.cs", transposeStr.ToString()); + + StringBuilder normalizeStr = new StringBuilder(); + GenerateNormalizePerformanceTests(normalizeStr); + WriteFile(m_PerformanceTestDirectory + "/TestNormalize.gen.cs", normalizeStr.ToString()); + + StringBuilder rotationStr = new StringBuilder(); + GenerateRotationPerformanceTests(rotationStr); + WriteFile(m_PerformanceTestDirectory + "/TestRotation.gen.cs", rotationStr.ToString()); + + StringBuilder shuffleStr = new StringBuilder(); + GenerateShufflePerformanceTests(shuffleStr); + WriteFile(m_PerformanceTestDirectory + "/TestShuffle.gen.cs", shuffleStr.ToString()); + + StringBuilder hashStr = new StringBuilder(); + GenerateHashPerformanceTests(hashStr); + WriteFile(m_PerformanceTestDirectory + "/TestHash.gen.cs", hashStr.ToString()); + + StringBuilder planeStr = new StringBuilder(); + GeneratePlanePerformanceTests(planeStr); + WriteFile(m_PerformanceTestDirectory + "/TestPlane.gen.cs", planeStr.ToString()); + + StringBuilder minMaxAabbStr = new StringBuilder(); + GenerateMinMaxAabbPerformanceTests(minMaxAabbStr); + WriteFile(m_PerformanceTestDirectory + "/TestMinMaxAABB.gen.cs", minMaxAabbStr.ToString()); + + StringBuilder mathStr = new StringBuilder(); + GenerateMathPerformanceTests(mathStr); + WriteFile(m_PerformanceTestDirectory + "/TestMath.gen.cs", mathStr.ToString()); + } + } +} diff --git a/src/Unity.Mathematics.CodeGen~/VectorGenerator.cs.meta b/src/Unity.Mathematics.CodeGen~/VectorGenerator.cs.meta new file mode 100644 index 00000000..df5e13c6 --- /dev/null +++ b/src/Unity.Mathematics.CodeGen~/VectorGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ba4a93166b82a0d49a5157c0c9b91aee +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics.Editor.meta b/src/Unity.Mathematics.Editor.meta new file mode 100644 index 00000000..5e615a00 --- /dev/null +++ b/src/Unity.Mathematics.Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ed3cf288b647446a1a4040049eb363d7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics.Editor/MatrixDrawer.cs b/src/Unity.Mathematics.Editor/MatrixDrawer.cs new file mode 100644 index 00000000..f59d2c91 --- /dev/null +++ b/src/Unity.Mathematics.Editor/MatrixDrawer.cs @@ -0,0 +1,141 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using UnityEditor; +using UnityEngine; + +namespace Unity.Mathematics.Editor +{ + [CustomPropertyDrawer(typeof(bool2x2)), CustomPropertyDrawer(typeof(bool2x3)), CustomPropertyDrawer(typeof(bool2x4))] + [CustomPropertyDrawer(typeof(bool3x2)), CustomPropertyDrawer(typeof(bool3x3)), CustomPropertyDrawer(typeof(bool3x4))] + [CustomPropertyDrawer(typeof(bool4x2)), CustomPropertyDrawer(typeof(bool4x3)), CustomPropertyDrawer(typeof(bool4x4))] + [CustomPropertyDrawer(typeof(double2x2)), CustomPropertyDrawer(typeof(double2x3)), CustomPropertyDrawer(typeof(double2x4))] + [CustomPropertyDrawer(typeof(double3x2)), CustomPropertyDrawer(typeof(double3x3)), CustomPropertyDrawer(typeof(double3x4))] + [CustomPropertyDrawer(typeof(double4x2)), CustomPropertyDrawer(typeof(double4x3)), CustomPropertyDrawer(typeof(double4x4))] + [CustomPropertyDrawer(typeof(float2x2)), CustomPropertyDrawer(typeof(float2x3)), CustomPropertyDrawer(typeof(float2x4))] + [CustomPropertyDrawer(typeof(float3x2)), CustomPropertyDrawer(typeof(float3x3)), CustomPropertyDrawer(typeof(float3x4))] + [CustomPropertyDrawer(typeof(float4x2)), CustomPropertyDrawer(typeof(float4x3)), CustomPropertyDrawer(typeof(float4x4))] + [CustomPropertyDrawer(typeof(int2x2)), CustomPropertyDrawer(typeof(int2x3)), CustomPropertyDrawer(typeof(int2x4))] + [CustomPropertyDrawer(typeof(int3x2)), CustomPropertyDrawer(typeof(int3x3)), CustomPropertyDrawer(typeof(int3x4))] + [CustomPropertyDrawer(typeof(int4x2)), CustomPropertyDrawer(typeof(int4x3)), CustomPropertyDrawer(typeof(int4x4))] + [CustomPropertyDrawer(typeof(uint2x2)), CustomPropertyDrawer(typeof(uint2x3)), CustomPropertyDrawer(typeof(uint2x4))] + [CustomPropertyDrawer(typeof(uint3x2)), CustomPropertyDrawer(typeof(uint3x3)), CustomPropertyDrawer(typeof(uint3x4))] + [CustomPropertyDrawer(typeof(uint4x2)), CustomPropertyDrawer(typeof(uint4x3)), CustomPropertyDrawer(typeof(uint4x4))] + class MatrixDrawer : PropertyDrawer + { +#if !UNITY_2023_2_OR_NEWER + public override bool CanCacheInspectorGUI(SerializedProperty property) + { + return false; + } +#endif + + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) + { + if (!property.isExpanded) + return EditorGUIUtility.singleLineHeight; + var rows = 1 + property.type[property.type.Length - 3] - '0'; + return rows * EditorGUIUtility.singleLineHeight + (rows - 1) * EditorGUIUtility.standardVerticalSpacing; + } + + static ReadOnlyCollection k_ColPropertyPaths = + new ReadOnlyCollection(new[] { "c0", "c1", "c2", "c3" }); + static ReadOnlyCollection k_RowPropertyPaths = + new ReadOnlyCollection(new[] { "x", "y", "z", "w" }); + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + position.height = EditorGUIUtility.singleLineHeight; + EditorGUI.PropertyField(position, property, label, false); + + if (Event.current.type == EventType.ContextClick && position.Contains(Event.current.mousePosition)) + { + DoUtilityMenu(property); + Event.current.Use(); + } + + if (!property.isExpanded) + return; + + var rows = property.type[property.type.Length - 3] - '0'; + var cols = property.type[property.type.Length - 1] - '0'; + + ++EditorGUI.indentLevel; + position = EditorGUI.IndentedRect(position); + --EditorGUI.indentLevel; + + var elementType = property.FindPropertyRelative("c0.x").propertyType; + for (var row = 0; row < rows; ++row) + { + position.y += position.height + EditorGUIUtility.standardVerticalSpacing; + var elementRect = new Rect(position) + { + width = elementType == SerializedPropertyType.Boolean + ? EditorGUIUtility.singleLineHeight + : (position.width - (cols - 1) * EditorGUIUtility.standardVerticalSpacing) / cols + }; + for (var col = 0; col < cols; ++col) + { + EditorGUI.PropertyField( + elementRect, + property.FindPropertyRelative($"{k_ColPropertyPaths[col]}.{k_RowPropertyPaths[row]}"), + GUIContent.none + ); + elementRect.x += elementRect.width + EditorGUIUtility.standardVerticalSpacing; + } + } + } + + Dictionary> k_UtilityValueSetters = + new Dictionary> + { + { SerializedPropertyType.Boolean, (property, b) => property.boolValue = b }, + { SerializedPropertyType.Float, (property, b) => property.floatValue = b ? 1f : 0f }, + { SerializedPropertyType.Integer, (property, b) => property.intValue = b ? 1 : 0 } + }; + + void DoUtilityMenu(SerializedProperty property) + { + var rows = property.type[property.type.Length - 3] - '0'; + var cols = property.type[property.type.Length - 1] - '0'; + var elementType = property.FindPropertyRelative("c0.x").propertyType; + var setValue = k_UtilityValueSetters[elementType]; + var menu = new GenericMenu(); + property = property.Copy(); + menu.AddItem( + EditorGUIUtility.TrTextContent("Set to Zero"), + false, + () => + { + property.serializedObject.Update();; + for (var row = 0; row < rows; ++row) + for (var col = 0; col < cols; ++col) + setValue( + property.FindPropertyRelative($"{k_ColPropertyPaths[col]}.{k_RowPropertyPaths[row]}"), + false + ); + property.serializedObject.ApplyModifiedProperties(); + } + ); + if (rows == cols) + { + menu.AddItem( + EditorGUIUtility.TrTextContent("Reset to Identity"), + false, + () => + { + property.serializedObject.Update(); + for (var row = 0; row < rows; ++row) + for (var col = 0; col < cols; ++col) + setValue( + property.FindPropertyRelative($"{k_ColPropertyPaths[col]}.{k_RowPropertyPaths[row]}"), + row == col + ); + property.serializedObject.ApplyModifiedProperties(); + } + ); + } + menu.ShowAsContext(); + } + } +} diff --git a/src/Unity.Mathematics.Editor/MatrixDrawer.cs.meta b/src/Unity.Mathematics.Editor/MatrixDrawer.cs.meta new file mode 100644 index 00000000..7daf3acd --- /dev/null +++ b/src/Unity.Mathematics.Editor/MatrixDrawer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 407410bec194a4cfe929933685bb80a7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics.Editor/PostNormalizedVectorDrawer.cs b/src/Unity.Mathematics.Editor/PostNormalizedVectorDrawer.cs new file mode 100644 index 00000000..eaa2a07d --- /dev/null +++ b/src/Unity.Mathematics.Editor/PostNormalizedVectorDrawer.cs @@ -0,0 +1,208 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using UnityEditor; +using UnityEngine; +using UnityObject = UnityEngine.Object; + +namespace Unity.Mathematics.Editor +{ + [CustomPropertyDrawer(typeof(PostNormalizeAttribute))] + class PostNormalizedVectorDrawer : PrimitiveVectorDrawer + { + static class Content + { + public static readonly GUIContent Tooltip = new ( + string.Empty, + L10n.Tr("Values you enter will be post-normalized. You will see the normalized result if you " + + "change selection and view the values again.")); + } + + class VectorPropertyGUIData + { + const int k_MaxElements = 4; + + public readonly bool Valid; + + // parent property + readonly SerializedProperty m_VectorProperty; + // relative paths of element child properties + readonly IReadOnlyList m_ElementPaths; + // the number of element child properties + readonly int m_NumElements; + // per child property; value is null if there are multiple different values + readonly double?[] m_PreNormalizedValues; + // per target; used to revert actual values for each object after displaying pre-normalized values + readonly Dictionary m_PostNormalizedValues = new Dictionary(); + + public VectorPropertyGUIData(SerializedProperty property) + { + m_VectorProperty = property; + var parentPath = m_VectorProperty.propertyPath; + var i = 0; + var elementPaths = new List(k_MaxElements); + var iterator = m_VectorProperty.Copy(); + while (iterator.Next(true) && iterator.propertyPath.StartsWith(parentPath)) + { + if (i >= k_MaxElements || iterator.propertyType != SerializedPropertyType.Float) + return; + elementPaths.Add(iterator.propertyPath.Substring(parentPath.Length + 1)); + i++; + } + + Valid = true; + m_NumElements = elementPaths.Count; + m_ElementPaths = elementPaths; + m_PreNormalizedValues = elementPaths.Select(p => (double?)null).ToArray(); + + UpdatePreNormalizedValues(); + UpdatePostNormalizedValues(); + } + + void UpdatePostNormalizedValues() + { + m_PostNormalizedValues.Clear(); + foreach (var target in m_VectorProperty.serializedObject.targetObjects) + { + var postNormalizedValue = new double4(); + var parentProperty = new SerializedObject(target).FindProperty(m_VectorProperty.propertyPath); + for (var i = 0; i < m_NumElements; ++i) + postNormalizedValue[i] = parentProperty.FindPropertyRelative(m_ElementPaths[i]).doubleValue; + m_PostNormalizedValues[parentProperty] = postNormalizedValue; + } + } + + public void UpdatePreNormalizedValues() + { + for (var i = 0; i < m_NumElements; ++i) + { + var p = m_VectorProperty.FindPropertyRelative(m_ElementPaths[i]); + m_PreNormalizedValues[i] = p.hasMultipleDifferentValues ? (double?)null : p.doubleValue; + } + } + + public void ApplyPreNormalizedValues() + { + m_VectorProperty.serializedObject.ApplyModifiedProperties(); + for (var i = 0; i < m_NumElements; ++i) + { + if (m_PreNormalizedValues[i] != null) + m_VectorProperty.FindPropertyRelative(m_ElementPaths[i]).doubleValue = m_PreNormalizedValues[i].Value; + } + } + + public void UnapplyPreNormalizedValues() + { + foreach (var target in m_PostNormalizedValues) + { + target.Key.serializedObject.Update(); + for (var i = 0; i < m_NumElements; ++i) + { + target.Key.FindPropertyRelative(m_ElementPaths[i]).doubleValue = target.Value[i]; + target.Key.serializedObject.ApplyModifiedProperties(); + } + } + m_VectorProperty.serializedObject.Update(); + } + + public void PostNormalize(Func normalize) + { + m_VectorProperty.serializedObject.ApplyModifiedProperties(); + foreach (var target in m_PostNormalizedValues) + { + target.Key.serializedObject.Update(); + var postNormalizedValue = new double4(); + for (var i = 0; i < m_NumElements; ++i) + postNormalizedValue[i] = target.Key.FindPropertyRelative(m_ElementPaths[i]).doubleValue; + postNormalizedValue = normalize(normalize(postNormalizedValue)); + for (var i = 0; i < m_NumElements; ++i) + target.Key.FindPropertyRelative(m_ElementPaths[i]).doubleValue = postNormalizedValue[i]; + target.Key.serializedObject.ApplyModifiedProperties(); + } + UpdatePostNormalizedValues(); + m_VectorProperty.serializedObject.Update(); + } + + public void RebuildIfDirty() + { + foreach (var target in m_PostNormalizedValues) + { + target.Key.serializedObject.Update(); + for (var i = 0; i < m_NumElements; ++i) + { + var serialized = target.Key.FindPropertyRelative(m_ElementPaths[i]).doubleValue; + if (target.Value[i] != serialized) + { + UpdatePreNormalizedValues(); + UpdatePostNormalizedValues(); + return; + } + } + } + } + } + + Dictionary m_GUIDataPerPropertyPath = new Dictionary(); + + protected virtual SerializedProperty GetVectorProperty(SerializedProperty property) + { + return property; + } + + protected virtual double4 Normalize(double4 value) + { + return math.normalizesafe(value); + } + + VectorPropertyGUIData GetGUIData(SerializedProperty property) + { + VectorPropertyGUIData guiData; + if (!m_GUIDataPerPropertyPath.TryGetValue(property.propertyPath, out guiData)) + { + guiData = new VectorPropertyGUIData(GetVectorProperty(property)); + m_GUIDataPerPropertyPath[property.propertyPath] = guiData; + } + return guiData; + } + + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) + { + return GetGUIData(property).Valid ? base.GetPropertyHeight(property, label) : EditorGUIUtility.singleLineHeight; + } + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + var guiData = GetGUIData(property); + if (!guiData.Valid) + { + EditorGUI.HelpBox( + EditorGUI.PrefixLabel(position, label), + L10n.Tr($"{typeof(PostNormalizeAttribute).Name} only works with decimal vector types."), + MessageType.None + ); + return; + } + + // Avoid polluting the passed-in GUIContent - it might be static and shared. + if (string.IsNullOrEmpty(label.tooltip)) + { + Content.Tooltip.text = label.text; + label = Content.Tooltip; + } + + guiData.RebuildIfDirty(); + guiData.ApplyPreNormalizedValues(); + EditorGUI.BeginChangeCheck(); + base.OnGUI(position, property, label); + if (EditorGUI.EndChangeCheck()) + { + guiData.UpdatePreNormalizedValues(); + guiData.PostNormalize(Normalize); + } + else + { + guiData.UnapplyPreNormalizedValues(); + } + } + } +} diff --git a/src/Unity.Mathematics.Editor/PostNormalizedVectorDrawer.cs.meta b/src/Unity.Mathematics.Editor/PostNormalizedVectorDrawer.cs.meta new file mode 100644 index 00000000..0e7fc533 --- /dev/null +++ b/src/Unity.Mathematics.Editor/PostNormalizedVectorDrawer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2c060766caf7a405bb18fa4ba02780ee +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics.Editor/PrimitiveVectorDrawer.cs b/src/Unity.Mathematics.Editor/PrimitiveVectorDrawer.cs new file mode 100644 index 00000000..5353bdcb --- /dev/null +++ b/src/Unity.Mathematics.Editor/PrimitiveVectorDrawer.cs @@ -0,0 +1,244 @@ +using System; +using UnityEditor; +using UnityEngine; + +namespace Unity.Mathematics.Editor +{ + [CustomPropertyDrawer(typeof(bool2)), CustomPropertyDrawer(typeof(bool3)), CustomPropertyDrawer(typeof(bool4))] + [CustomPropertyDrawer(typeof(double2)), CustomPropertyDrawer(typeof(double3)), CustomPropertyDrawer(typeof(double4))] + [CustomPropertyDrawer(typeof(float2)), CustomPropertyDrawer(typeof(float3)), CustomPropertyDrawer(typeof(float4))] + [CustomPropertyDrawer(typeof(int2)), CustomPropertyDrawer(typeof(int3)), CustomPropertyDrawer(typeof(int4))] + [CustomPropertyDrawer(typeof(uint2)), CustomPropertyDrawer(typeof(uint3)), CustomPropertyDrawer(typeof(uint4))] + [CustomPropertyDrawer(typeof(DoNotNormalizeAttribute))] + class PrimitiveVectorDrawer : PropertyDrawer + { + private string _PropertyType; + + string GetPropertyType(SerializedProperty property) + { + if (_PropertyType == null) + { + _PropertyType = property.type; + var isManagedRef = property.type.StartsWith("managedReference", StringComparison.Ordinal); + if (isManagedRef) + { + var startIndex = "managedReference<".Length; + var length = _PropertyType.Length - startIndex - 1; + _PropertyType = _PropertyType.Substring("managedReference<".Length, length); + } + } + + return _PropertyType; + } + + static class Content + { + public static readonly string doNotNormalizeCompatibility = L10n.Tr( + $"{typeof(DoNotNormalizeAttribute).Name} only works with {typeof(quaternion)} and primitive vector types." + ); + public static readonly GUIContent doNotNormalizeContent = new GUIContent("", + L10n.Tr("This value is not normalized, which may produce unexpected results.")); + + public static readonly GUIContent[] labels2 = { new GUIContent("X"), new GUIContent("Y") }; + public static readonly GUIContent[] labels3 = { new GUIContent("X"), new GUIContent("Y"), new GUIContent("Z") }; + public static readonly GUIContent[] labels4 = { new GUIContent("X"), new GUIContent("Y"), new GUIContent("Z"), new GUIContent("W") }; + } + +#if !UNITY_2023_2_OR_NEWER + public override bool CanCacheInspectorGUI(SerializedProperty property) + { + return false; + } +#endif + + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) + { + var height = EditorGUIUtility.singleLineHeight; + if (!EditorGUIUtility.wideMode) + height += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; + return height; + } + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + var subLabels = Content.labels4; + var startIter = "x"; + var propertyType = GetPropertyType(property); + switch (propertyType[propertyType.Length - 1]) + { + case '2': + subLabels = Content.labels2; + break; + case '3': + subLabels = Content.labels3; + break; + case '4': + subLabels = Content.labels4; + break; + default: + { + if (property.type == nameof(quaternion)) + startIter = "value.x"; + else if (attribute is DoNotNormalizeAttribute) + { + EditorGUI.HelpBox(EditorGUI.PrefixLabel(position, label), Content.doNotNormalizeCompatibility, MessageType.None); + return; + } + break; + } + } + + if (attribute is DoNotNormalizeAttribute && string.IsNullOrEmpty(label.tooltip)) + { + Content.doNotNormalizeContent.text = label.text; + label = Content.doNotNormalizeContent; + } + label = EditorGUI.BeginProperty(position, label, property); + var valuesIterator = property.FindPropertyRelative(startIter); + MultiPropertyField(position, subLabels, valuesIterator, label); + EditorGUI.EndProperty(); + } + + void MultiPropertyField(Rect position, GUIContent[] subLabels, SerializedProperty valuesIterator, GUIContent label) + { +#if UNITY_2022_1_OR_NEWER + EditorGUI.MultiPropertyField(position, subLabels, valuesIterator, label, EditorGUI.PropertyVisibility.All); +#else + EditorGUICopy.MultiPropertyField(position, subLabels, valuesIterator, label); +#endif + } + } + +#if !UNITY_2022_1_OR_NEWER + internal class EditorGUICopy + { + internal const float kSpacingSubLabel = 4; + private const float kIndentPerLevel = 15; + internal const float kPrefixPaddingRight = 2; + internal static int indentLevel = 0; + private static readonly int s_FoldoutHash = "Foldout".GetHashCode(); + + // internal static readonly SVC kVerticalSpacingMultiField = new SVC("--theme-multifield-vertical-spacing", 0.0f); + // kVerticalSpacingMultiField should actually look like the above line ^^^ but we don't have access to SVC, + // so instead we just set this value to what is observed in the debugger with the Unity dark theme. + internal const float kVerticalSpacingMultiField = 2; + + internal enum PropertyVisibility + { + All, + OnlyVisible + } + + // This code is basically EditorGUI.MultiPropertyField(Rect, GUIContent[], SerializedProperty, GUIContent), + // but with the property visibility assumed to be "All" instead of "OnlyVisible". We really want to have "All" + // because it's possible for someone to hide something in the inspector with [HideInInspector] but then manually + // draw it themselves later. In this case, if you called EditorGUI.MultiPropertyField() directly, you'd + // end up with some fields that point to some unrelated visible property. + public static void MultiPropertyField(Rect position, GUIContent[] subLabels, SerializedProperty valuesIterator, GUIContent label) + { + int id = GUIUtility.GetControlID(s_FoldoutHash, FocusType.Keyboard, position); + position = MultiFieldPrefixLabel(position, id, label, subLabels.Length); + position.height = EditorGUIUtility.singleLineHeight; + MultiPropertyFieldInternal(position, subLabels, valuesIterator, PropertyVisibility.All); + } + + internal static void BeginDisabled(bool disabled) + { + // Unused, but left here to minimize changes in EditorGUICopy.MultiPropertyFieldInternal(). + } + + internal static void EndDisabled() + { + // Unused, but left here to minimize changes in EditorGUICopy.MultiPropertyFieldInternal(). + } + + internal static float CalcPrefixLabelWidth(GUIContent label, GUIStyle style = null) + { + if (style == null) + style = EditorStyles.label; + return style.CalcSize(label).x; + } + + internal static void MultiPropertyFieldInternal(Rect position, GUIContent[] subLabels, SerializedProperty valuesIterator, PropertyVisibility visibility, bool[] disabledMask = null, float prefixLabelWidth = -1) + { + int eCount = subLabels.Length; + float w = (position.width - (eCount - 1) * kSpacingSubLabel) / eCount; + Rect nr = new Rect(position) {width = w}; + float t = EditorGUIUtility.labelWidth; + int l = indentLevel; + indentLevel = 0; + for (int i = 0; i < subLabels.Length; i++) + { + EditorGUIUtility.labelWidth = prefixLabelWidth > 0 ? prefixLabelWidth : CalcPrefixLabelWidth(subLabels[i]); + + if (disabledMask != null) + BeginDisabled(disabledMask[i]); + EditorGUI.PropertyField(nr, valuesIterator, subLabels[i]); + if (disabledMask != null) + EndDisabled(); + nr.x += w + kSpacingSubLabel; + + switch (visibility) + { + case PropertyVisibility.All: + valuesIterator.Next(false); + break; + + case PropertyVisibility.OnlyVisible: + valuesIterator.NextVisible(false); + break; + } + } + EditorGUIUtility.labelWidth = t; + indentLevel = l; + } + + internal static bool LabelHasContent(GUIContent label) + { + if (label == null) + { + return true; + } + // @TODO: find out why checking for GUIContent.none doesn't work + return label.text != string.Empty || label.image != null; + } + + internal static float indent => indentLevel * kIndentPerLevel; + + internal static Rect MultiFieldPrefixLabel(Rect totalPosition, int id, GUIContent label, int columns) + { + if (!LabelHasContent(label)) + { + return EditorGUI.IndentedRect(totalPosition); + } + + if (EditorGUIUtility.wideMode) + { + Rect labelPosition = new Rect(totalPosition.x + indent, totalPosition.y, EditorGUIUtility.labelWidth - indent, EditorGUIUtility.singleLineHeight); + Rect fieldPosition = totalPosition; + fieldPosition.xMin += EditorGUIUtility.labelWidth + kPrefixPaddingRight; + + // If there are 2 columns we use the same column widths as if there had been 3 columns + // in order to make columns line up neatly. + if (columns == 2) + { + float columnWidth = (fieldPosition.width - (3 - 1) * kSpacingSubLabel) / 3f; + fieldPosition.xMax -= (columnWidth + kSpacingSubLabel); + } + + EditorGUI.HandlePrefixLabel(totalPosition, labelPosition, label, id); + return fieldPosition; + } + else + { + Rect labelPosition = new Rect(totalPosition.x + indent, totalPosition.y, totalPosition.width - indent, EditorGUIUtility.singleLineHeight); + Rect fieldPosition = totalPosition; + fieldPosition.xMin += indent + kIndentPerLevel; + fieldPosition.yMin += EditorGUIUtility.singleLineHeight + kVerticalSpacingMultiField; + EditorGUI.HandlePrefixLabel(totalPosition, labelPosition, label, id); + return fieldPosition; + } + } + } +#endif +} diff --git a/src/Unity.Mathematics.Editor/PrimitiveVectorDrawer.cs.meta b/src/Unity.Mathematics.Editor/PrimitiveVectorDrawer.cs.meta new file mode 100644 index 00000000..6bd35817 --- /dev/null +++ b/src/Unity.Mathematics.Editor/PrimitiveVectorDrawer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4ae914da3592740a58dd603fcb28b594 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics.Editor/QuaternionDrawer.cs b/src/Unity.Mathematics.Editor/QuaternionDrawer.cs new file mode 100644 index 00000000..76c92452 --- /dev/null +++ b/src/Unity.Mathematics.Editor/QuaternionDrawer.cs @@ -0,0 +1,18 @@ +using UnityEditor; + +namespace Unity.Mathematics.Editor +{ + [CustomPropertyDrawer(typeof(quaternion))] + class QuaternionDrawer : PostNormalizedVectorDrawer + { + protected override SerializedProperty GetVectorProperty(SerializedProperty property) + { + return property.FindPropertyRelative("value"); + } + + protected override double4 Normalize(double4 value) + { + return math.normalizesafe(new quaternion((float4)value)).value; + } + } +} diff --git a/src/Unity.Mathematics.Editor/QuaternionDrawer.cs.meta b/src/Unity.Mathematics.Editor/QuaternionDrawer.cs.meta new file mode 100644 index 00000000..270314de --- /dev/null +++ b/src/Unity.Mathematics.Editor/QuaternionDrawer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b78c76192c2e742779541501cfe4ca76 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics.Editor/Unity.Mathematics.Editor.asmdef b/src/Unity.Mathematics.Editor/Unity.Mathematics.Editor.asmdef new file mode 100644 index 00000000..35c38c20 --- /dev/null +++ b/src/Unity.Mathematics.Editor/Unity.Mathematics.Editor.asmdef @@ -0,0 +1,12 @@ +{ + "name": "Unity.Mathematics.Editor", + "references": [ + "Unity.Mathematics" + ], + "optionalUnityReferences": [], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": true +} \ No newline at end of file diff --git a/src/Unity.Mathematics.Editor/Unity.Mathematics.Editor.asmdef.meta b/src/Unity.Mathematics.Editor/Unity.Mathematics.Editor.asmdef.meta new file mode 100644 index 00000000..fac2dd44 --- /dev/null +++ b/src/Unity.Mathematics.Editor/Unity.Mathematics.Editor.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 329b4ccd385744985bf3f83cfd77dfe7 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics.PerformanceTests.meta b/src/Unity.Mathematics.PerformanceTests.meta new file mode 100644 index 00000000..739e8afa --- /dev/null +++ b/src/Unity.Mathematics.PerformanceTests.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e3298449ad7b046fa86e59da97ca4c96 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics.PerformanceTests/Properties.meta b/src/Unity.Mathematics.PerformanceTests/Properties.meta new file mode 100644 index 00000000..1aec2b47 --- /dev/null +++ b/src/Unity.Mathematics.PerformanceTests/Properties.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6d0f38e09304a4623b6eb88b271f1928 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics.PerformanceTests/Properties/AssemblyInfo.cs b/src/Unity.Mathematics.PerformanceTests/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..c166d650 --- /dev/null +++ b/src/Unity.Mathematics.PerformanceTests/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Unity.Mathematics.PerformanceTests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Unity.Mathematics.PerformanceTests")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("C3FE0F99-88C7-4E54-96A0-B65A591B7020")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/src/Unity.Mathematics.PerformanceTests/Properties/AssemblyInfo.cs.meta b/src/Unity.Mathematics.PerformanceTests/Properties/AssemblyInfo.cs.meta new file mode 100644 index 00000000..d8edacc7 --- /dev/null +++ b/src/Unity.Mathematics.PerformanceTests/Properties/AssemblyInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6cd4982a963de49c68004ea9caafe21c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics.PerformanceTests/TestConversions.gen.cs b/src/Unity.Mathematics.PerformanceTests/TestConversions.gen.cs new file mode 100644 index 00000000..3050d7f5 --- /dev/null +++ b/src/Unity.Mathematics.PerformanceTests/TestConversions.gen.cs @@ -0,0 +1,866 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using NUnit.Framework; +using Unity.Collections; +using Unity.Collections.LowLevel.Unsafe; +using Unity.PerformanceTesting; +using Unity.Mathematics.Geometry; +using Unity.Burst; + +namespace Unity.Mathematics.PerformanceTests +{ + partial class TestConversions + { + [BurstCompile(CompileSynchronously = true)] + public unsafe class quaternion_to_float3x3 + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public quaternion* q; + public float3x3* f3x3; + + public void Init() + { + rng = new Random(1); + q = (quaternion*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + q[i] = quaternion.identity; + } + + f3x3 = (float3x3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + f3x3[i] = float3x3.identity; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(q, Allocator.Persistent); + UnsafeUtility.Free(f3x3, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.f3x3[i] = new float3x3(args.q[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void quaternion_to_float3x3_mono() + { + quaternion_to_float3x3.TestFunction testFunction = quaternion_to_float3x3.MonoTestFunction; + var args = new quaternion_to_float3x3.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void quaternion_to_float3x3_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(quaternion_to_float3x3.BurstTestFunction); + var args = new quaternion_to_float3x3.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class float3x3_to_quaternion + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public quaternion* q; + public float3x3* f3x3; + + public void Init() + { + rng = new Random(1); + q = (quaternion*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + q[i] = quaternion.identity; + } + + f3x3 = (float3x3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + f3x3[i] = float3x3.identity; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(q, Allocator.Persistent); + UnsafeUtility.Free(f3x3, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.q[i] = new quaternion(args.f3x3[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void float3x3_to_quaternion_mono() + { + float3x3_to_quaternion.TestFunction testFunction = float3x3_to_quaternion.MonoTestFunction; + var args = new float3x3_to_quaternion.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void float3x3_to_quaternion_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(float3x3_to_quaternion.BurstTestFunction); + var args = new float3x3_to_quaternion.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class float4_to_half4 + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float4* f4; + public half4* h4; + + public void Init() + { + rng = new Random(1); + f4 = (float4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + f4[i] = new float4(1.0f, 2.0f, 3.0f, 4.0f); + } + + h4 = (half4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + h4[i] = new half4(new float4(-1.0f, -2.0f, -3.0f, -4.0f)); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(f4, Allocator.Persistent); + UnsafeUtility.Free(h4, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.h4[i] = new half4(args.f4[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void float4_to_half4_mono() + { + float4_to_half4.TestFunction testFunction = float4_to_half4.MonoTestFunction; + var args = new float4_to_half4.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void float4_to_half4_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(float4_to_half4.BurstTestFunction); + var args = new float4_to_half4.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class half4_to_float4 + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float4* f4; + public half4* h4; + + public void Init() + { + rng = new Random(1); + f4 = (float4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + f4[i] = new float4(1.0f, 2.0f, 3.0f, 4.0f); + } + + h4 = (half4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + h4[i] = new half4(new float4(-1.0f, -2.0f, -3.0f, -4.0f)); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(f4, Allocator.Persistent); + UnsafeUtility.Free(h4, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.f4[i] = new float4(args.h4[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void half4_to_float4_mono() + { + half4_to_float4.TestFunction testFunction = half4_to_float4.MonoTestFunction; + var args = new half4_to_float4.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void half4_to_float4_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(half4_to_float4.BurstTestFunction); + var args = new half4_to_float4.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class quaternion_to_RigidTransform + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public quaternion* q; + public RigidTransform* rt; + public float3* pos; + + public void Init() + { + rng = new Random(1); + q = (quaternion*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + q[i] = quaternion.identity; + } + + rt = (RigidTransform*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + rt[i] = RigidTransform.identity; + } + + pos = (float3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + pos[i] = new float3(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(q, Allocator.Persistent); + UnsafeUtility.Free(rt, Allocator.Persistent); + UnsafeUtility.Free(pos, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.rt[i] = new RigidTransform(args.q[i], args.pos[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void quaternion_to_RigidTransform_mono() + { + quaternion_to_RigidTransform.TestFunction testFunction = quaternion_to_RigidTransform.MonoTestFunction; + var args = new quaternion_to_RigidTransform.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void quaternion_to_RigidTransform_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(quaternion_to_RigidTransform.BurstTestFunction); + var args = new quaternion_to_RigidTransform.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class quaternion_to_float4x4 + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public quaternion* q; + public float4x4* f4x4; + + public void Init() + { + rng = new Random(1); + q = (quaternion*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + q[i] = quaternion.identity; + } + + f4x4 = (float4x4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + f4x4[i] = float4x4.identity; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(q, Allocator.Persistent); + UnsafeUtility.Free(f4x4, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.q[i] = new quaternion(args.f4x4[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void quaternion_to_float4x4_mono() + { + quaternion_to_float4x4.TestFunction testFunction = quaternion_to_float4x4.MonoTestFunction; + var args = new quaternion_to_float4x4.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void quaternion_to_float4x4_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(quaternion_to_float4x4.BurstTestFunction); + var args = new quaternion_to_float4x4.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class float4x4_to_quaternion + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public quaternion* q; + public float4x4* f4x4; + public float3* f3; + + public void Init() + { + rng = new Random(1); + q = (quaternion*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + q[i] = quaternion.identity; + } + + f4x4 = (float4x4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + f4x4[i] = float4x4.identity; + } + + f3 = (float3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + f3[i] = new float3(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(q, Allocator.Persistent); + UnsafeUtility.Free(f4x4, Allocator.Persistent); + UnsafeUtility.Free(f3, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.f4x4[i] = new float4x4(args.q[i], args.f3[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void float4x4_to_quaternion_mono() + { + float4x4_to_quaternion.TestFunction testFunction = float4x4_to_quaternion.MonoTestFunction; + var args = new float4x4_to_quaternion.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void float4x4_to_quaternion_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(float4x4_to_quaternion.BurstTestFunction); + var args = new float4x4_to_quaternion.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class float4_to_uint4 + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float4* f4; + public uint4* u4; + + public void Init() + { + rng = new Random(1); + f4 = (float4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + f4[i] = new float4(1.0f, 2.0f, 3.0f, 4.0f); + } + + u4 = (uint4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + u4[i] = new uint4(100, 101, 102, 103); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(f4, Allocator.Persistent); + UnsafeUtility.Free(u4, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.u4[i] = new uint4(args.f4[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void float4_to_uint4_mono() + { + float4_to_uint4.TestFunction testFunction = float4_to_uint4.MonoTestFunction; + var args = new float4_to_uint4.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void float4_to_uint4_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(float4_to_uint4.BurstTestFunction); + var args = new float4_to_uint4.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class uint4_to_float4 + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float4* f4; + public uint4* u4; + + public void Init() + { + rng = new Random(1); + f4 = (float4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + f4[i] = new float4(1.0f, 2.0f, 3.0f, 4.0f); + } + + u4 = (uint4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + u4[i] = new uint4(100, 101, 102, 103); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(f4, Allocator.Persistent); + UnsafeUtility.Free(u4, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.f4[i] = new float4(args.u4[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void uint4_to_float4_mono() + { + uint4_to_float4.TestFunction testFunction = uint4_to_float4.MonoTestFunction; + var args = new uint4_to_float4.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void uint4_to_float4_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(uint4_to_float4.BurstTestFunction); + var args = new uint4_to_float4.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + } +} diff --git a/src/Unity.Mathematics.PerformanceTests/TestConversions.gen.cs.meta b/src/Unity.Mathematics.PerformanceTests/TestConversions.gen.cs.meta new file mode 100644 index 00000000..7add0cf0 --- /dev/null +++ b/src/Unity.Mathematics.PerformanceTests/TestConversions.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e5e36607b900046968ab391757a985f4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics.PerformanceTests/TestFastInverse.gen.cs b/src/Unity.Mathematics.PerformanceTests/TestFastInverse.gen.cs new file mode 100644 index 00000000..570951dd --- /dev/null +++ b/src/Unity.Mathematics.PerformanceTests/TestFastInverse.gen.cs @@ -0,0 +1,190 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using NUnit.Framework; +using Unity.Collections; +using Unity.Collections.LowLevel.Unsafe; +using Unity.PerformanceTesting; +using Unity.Mathematics.Geometry; +using Unity.Burst; + +namespace Unity.Mathematics.PerformanceTests +{ + partial class TestFastInverse + { + [BurstCompile(CompileSynchronously = true)] + public unsafe class float4x4_fastinverse + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float4x4* m1; + + public void Init() + { + rng = new Random(1); + m1 = (float4x4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + m1[i] = float4x4.identity; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(m1, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.m1[i] = math.fastinverse(args.m1[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void float4x4_fastinverse_mono() + { + float4x4_fastinverse.TestFunction testFunction = float4x4_fastinverse.MonoTestFunction; + var args = new float4x4_fastinverse.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void float4x4_fastinverse_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(float4x4_fastinverse.BurstTestFunction); + var args = new float4x4_fastinverse.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class double4x4_fastinverse + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public double4x4* m1; + + public void Init() + { + rng = new Random(1); + m1 = (double4x4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + m1[i] = double4x4.identity; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(m1, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.m1[i] = math.fastinverse(args.m1[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void double4x4_fastinverse_mono() + { + double4x4_fastinverse.TestFunction testFunction = double4x4_fastinverse.MonoTestFunction; + var args = new double4x4_fastinverse.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void double4x4_fastinverse_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(double4x4_fastinverse.BurstTestFunction); + var args = new double4x4_fastinverse.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + } +} diff --git a/src/Unity.Mathematics.PerformanceTests/TestFastInverse.gen.cs.meta b/src/Unity.Mathematics.PerformanceTests/TestFastInverse.gen.cs.meta new file mode 100644 index 00000000..df535cd1 --- /dev/null +++ b/src/Unity.Mathematics.PerformanceTests/TestFastInverse.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2dc2faebec0d74f54b09e28e95ae71bb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics.PerformanceTests/TestHash.cs b/src/Unity.Mathematics.PerformanceTests/TestHash.cs new file mode 100644 index 00000000..106f451f --- /dev/null +++ b/src/Unity.Mathematics.PerformanceTests/TestHash.cs @@ -0,0 +1,58 @@ +using Unity.Burst; +using Unity.PerformanceTesting; +using NUnit.Framework; +using Unity.Collections.LowLevel.Unsafe; +using System; +using UnityEngine; + +namespace Unity.Mathematics.PerformanceTests +{ + [BurstCompile] + partial class TestHash + { + static readonly long kBufferBytes = 1024 * 1024; + static readonly long kBytesToHash = kBufferBytes - 1; + static readonly uint kExpectedHash = 1781740882; + + [Test, Performance] + public static unsafe void HashAligned() + { + Assert.AreEqual(kExpectedHash, Hash(false)); + } + + [Test, Performance] + public static unsafe void HashUnaligned() + { + Assert.AreEqual(kExpectedHash, Hash(true)); + } + + [BurstCompile(CompileSynchronously = true)] + static unsafe uint Hash(bool useUnalignedBuffer) + { + var ptr = (ulong)(UIntPtr)UnsafeUtility.Malloc(kBufferBytes, 16, Collections.Allocator.Persistent); + var ulongptr = (ulong)ptr; + uint seed = 0; + + if (useUnalignedBuffer && ((ulongptr & 1) == 0)) + { + ++ulongptr; + } + + var buffer = (void*)ulongptr; + + for (int i = 0; i < kBytesToHash; ++i) + { + ((byte*)buffer)[i] = 123; + } + + for (int i = 0; i < 100; ++i) + { + seed = math.hash(buffer, (int)kBytesToHash, seed); + } + + UnsafeUtility.Free((void*)ptr, Collections.Allocator.Persistent); + + return seed; + } + } +} \ No newline at end of file diff --git a/src/Unity.Mathematics.PerformanceTests/TestHash.cs.meta b/src/Unity.Mathematics.PerformanceTests/TestHash.cs.meta new file mode 100644 index 00000000..fcfb809b --- /dev/null +++ b/src/Unity.Mathematics.PerformanceTests/TestHash.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c1a8761ebc1ffa240aa484721a63ba9f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics.PerformanceTests/TestHash.gen.cs b/src/Unity.Mathematics.PerformanceTests/TestHash.gen.cs new file mode 100644 index 00000000..e90cf82c --- /dev/null +++ b/src/Unity.Mathematics.PerformanceTests/TestHash.gen.cs @@ -0,0 +1,1218 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using NUnit.Framework; +using Unity.Collections; +using Unity.Collections.LowLevel.Unsafe; +using Unity.PerformanceTesting; +using Unity.Mathematics.Geometry; +using Unity.Burst; + +namespace Unity.Mathematics.PerformanceTests +{ + partial class TestHash + { + [BurstCompile(CompileSynchronously = true)] + public unsafe class float2_hash + { + public const int iterations = 100000; + + public struct Arguments : IDisposable + { + public Random rng; + public float2* v; + public uint* hash; + + public void Init() + { + rng = new Random(1); + v = (float2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new float2(1.0f); + } + + hash = (uint*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + hash[i] = 0; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + UnsafeUtility.Free(hash, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.hash[i] = math.hash(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void float2_hash_mono() + { + float2_hash.TestFunction testFunction = float2_hash.MonoTestFunction; + var args = new float2_hash.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void float2_hash_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(float2_hash.BurstTestFunction); + var args = new float2_hash.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class float3_hash + { + public const int iterations = 100000; + + public struct Arguments : IDisposable + { + public Random rng; + public float3* v; + public uint* hash; + + public void Init() + { + rng = new Random(1); + v = (float3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new float3(1.0f); + } + + hash = (uint*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + hash[i] = 0; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + UnsafeUtility.Free(hash, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.hash[i] = math.hash(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void float3_hash_mono() + { + float3_hash.TestFunction testFunction = float3_hash.MonoTestFunction; + var args = new float3_hash.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void float3_hash_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(float3_hash.BurstTestFunction); + var args = new float3_hash.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class float4_hash + { + public const int iterations = 100000; + + public struct Arguments : IDisposable + { + public Random rng; + public float4* v; + public uint* hash; + + public void Init() + { + rng = new Random(1); + v = (float4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new float4(1.0f); + } + + hash = (uint*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + hash[i] = 0; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + UnsafeUtility.Free(hash, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.hash[i] = math.hash(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void float4_hash_mono() + { + float4_hash.TestFunction testFunction = float4_hash.MonoTestFunction; + var args = new float4_hash.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void float4_hash_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(float4_hash.BurstTestFunction); + var args = new float4_hash.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class double2_hash + { + public const int iterations = 100000; + + public struct Arguments : IDisposable + { + public Random rng; + public double2* v; + public uint* hash; + + public void Init() + { + rng = new Random(1); + v = (double2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new double2(1.0f); + } + + hash = (uint*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + hash[i] = 0; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + UnsafeUtility.Free(hash, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.hash[i] = math.hash(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void double2_hash_mono() + { + double2_hash.TestFunction testFunction = double2_hash.MonoTestFunction; + var args = new double2_hash.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void double2_hash_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(double2_hash.BurstTestFunction); + var args = new double2_hash.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class double3_hash + { + public const int iterations = 100000; + + public struct Arguments : IDisposable + { + public Random rng; + public double3* v; + public uint* hash; + + public void Init() + { + rng = new Random(1); + v = (double3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new double3(1.0f); + } + + hash = (uint*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + hash[i] = 0; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + UnsafeUtility.Free(hash, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.hash[i] = math.hash(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void double3_hash_mono() + { + double3_hash.TestFunction testFunction = double3_hash.MonoTestFunction; + var args = new double3_hash.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void double3_hash_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(double3_hash.BurstTestFunction); + var args = new double3_hash.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class double4_hash + { + public const int iterations = 100000; + + public struct Arguments : IDisposable + { + public Random rng; + public double4* v; + public uint* hash; + + public void Init() + { + rng = new Random(1); + v = (double4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new double4(1.0f); + } + + hash = (uint*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + hash[i] = 0; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + UnsafeUtility.Free(hash, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.hash[i] = math.hash(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void double4_hash_mono() + { + double4_hash.TestFunction testFunction = double4_hash.MonoTestFunction; + var args = new double4_hash.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void double4_hash_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(double4_hash.BurstTestFunction); + var args = new double4_hash.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class float2x2_hash + { + public const int iterations = 100000; + + public struct Arguments : IDisposable + { + public Random rng; + public float2x2* v; + public uint* hash; + + public void Init() + { + rng = new Random(1); + v = (float2x2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new float2x2(1.0f); + } + + hash = (uint*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + hash[i] = 0; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + UnsafeUtility.Free(hash, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.hash[i] = math.hash(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void float2x2_hash_mono() + { + float2x2_hash.TestFunction testFunction = float2x2_hash.MonoTestFunction; + var args = new float2x2_hash.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void float2x2_hash_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(float2x2_hash.BurstTestFunction); + var args = new float2x2_hash.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class float3x3_hash + { + public const int iterations = 100000; + + public struct Arguments : IDisposable + { + public Random rng; + public float3x3* v; + public uint* hash; + + public void Init() + { + rng = new Random(1); + v = (float3x3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new float3x3(1.0f); + } + + hash = (uint*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + hash[i] = 0; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + UnsafeUtility.Free(hash, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.hash[i] = math.hash(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void float3x3_hash_mono() + { + float3x3_hash.TestFunction testFunction = float3x3_hash.MonoTestFunction; + var args = new float3x3_hash.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void float3x3_hash_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(float3x3_hash.BurstTestFunction); + var args = new float3x3_hash.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class float4x4_hash + { + public const int iterations = 100000; + + public struct Arguments : IDisposable + { + public Random rng; + public float4x4* v; + public uint* hash; + + public void Init() + { + rng = new Random(1); + v = (float4x4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new float4x4(1.0f); + } + + hash = (uint*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + hash[i] = 0; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + UnsafeUtility.Free(hash, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.hash[i] = math.hash(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void float4x4_hash_mono() + { + float4x4_hash.TestFunction testFunction = float4x4_hash.MonoTestFunction; + var args = new float4x4_hash.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void float4x4_hash_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(float4x4_hash.BurstTestFunction); + var args = new float4x4_hash.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class float2x2_hashwide + { + public const int iterations = 100000; + + public struct Arguments : IDisposable + { + public Random rng; + public float2x2* v; + public uint2* hash; + + public void Init() + { + rng = new Random(1); + v = (float2x2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new float2x2(1.0f); + } + + hash = (uint2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + hash[i] = 0; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + UnsafeUtility.Free(hash, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.hash[i] = math.hashwide(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void float2x2_hashwide_mono() + { + float2x2_hashwide.TestFunction testFunction = float2x2_hashwide.MonoTestFunction; + var args = new float2x2_hashwide.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void float2x2_hashwide_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(float2x2_hashwide.BurstTestFunction); + var args = new float2x2_hashwide.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class float3x3_hashwide + { + public const int iterations = 100000; + + public struct Arguments : IDisposable + { + public Random rng; + public float3x3* v; + public uint3* hash; + + public void Init() + { + rng = new Random(1); + v = (float3x3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new float3x3(1.0f); + } + + hash = (uint3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + hash[i] = 0; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + UnsafeUtility.Free(hash, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.hash[i] = math.hashwide(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void float3x3_hashwide_mono() + { + float3x3_hashwide.TestFunction testFunction = float3x3_hashwide.MonoTestFunction; + var args = new float3x3_hashwide.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void float3x3_hashwide_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(float3x3_hashwide.BurstTestFunction); + var args = new float3x3_hashwide.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class float4x4_hashwide + { + public const int iterations = 100000; + + public struct Arguments : IDisposable + { + public Random rng; + public float4x4* v; + public uint4* hash; + + public void Init() + { + rng = new Random(1); + v = (float4x4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new float4x4(1.0f); + } + + hash = (uint4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + hash[i] = 0; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + UnsafeUtility.Free(hash, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.hash[i] = math.hashwide(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void float4x4_hashwide_mono() + { + float4x4_hashwide.TestFunction testFunction = float4x4_hashwide.MonoTestFunction; + var args = new float4x4_hashwide.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void float4x4_hashwide_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(float4x4_hashwide.BurstTestFunction); + var args = new float4x4_hashwide.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class float2_hashwide + { + public const int iterations = 100000; + + public struct Arguments : IDisposable + { + public Random rng; + public float2* v; + public uint2* hash; + + public void Init() + { + rng = new Random(1); + v = (float2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new float2(1.0f); + } + + hash = (uint2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + hash[i] = new uint2(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + UnsafeUtility.Free(hash, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.hash[i] = math.hashwide(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void float2_hashwide_mono() + { + float2_hashwide.TestFunction testFunction = float2_hashwide.MonoTestFunction; + var args = new float2_hashwide.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void float2_hashwide_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(float2_hashwide.BurstTestFunction); + var args = new float2_hashwide.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + } +} diff --git a/src/Unity.Mathematics.PerformanceTests/TestHash.gen.cs.meta b/src/Unity.Mathematics.PerformanceTests/TestHash.gen.cs.meta new file mode 100644 index 00000000..13928672 --- /dev/null +++ b/src/Unity.Mathematics.PerformanceTests/TestHash.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fe5b3e9748b2b40bfb63e35e5115724a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics.PerformanceTests/TestInverse.gen.cs b/src/Unity.Mathematics.PerformanceTests/TestInverse.gen.cs new file mode 100644 index 00000000..26bfc7da --- /dev/null +++ b/src/Unity.Mathematics.PerformanceTests/TestInverse.gen.cs @@ -0,0 +1,694 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using NUnit.Framework; +using Unity.Collections; +using Unity.Collections.LowLevel.Unsafe; +using Unity.PerformanceTesting; +using Unity.Mathematics.Geometry; +using Unity.Burst; + +namespace Unity.Mathematics.PerformanceTests +{ + partial class TestInverse + { + [BurstCompile(CompileSynchronously = true)] + public unsafe class float4x4_inverse + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float4x4* m1; + + public void Init() + { + rng = new Random(1); + m1 = (float4x4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + m1[i] = float4x4.identity; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(m1, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.m1[i] = math.inverse(args.m1[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void float4x4_inverse_mono() + { + float4x4_inverse.TestFunction testFunction = float4x4_inverse.MonoTestFunction; + var args = new float4x4_inverse.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void float4x4_inverse_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(float4x4_inverse.BurstTestFunction); + var args = new float4x4_inverse.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class float3x3_inverse + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float3x3* m1; + + public void Init() + { + rng = new Random(1); + m1 = (float3x3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + m1[i] = float3x3.identity; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(m1, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.m1[i] = math.inverse(args.m1[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void float3x3_inverse_mono() + { + float3x3_inverse.TestFunction testFunction = float3x3_inverse.MonoTestFunction; + var args = new float3x3_inverse.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void float3x3_inverse_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(float3x3_inverse.BurstTestFunction); + var args = new float3x3_inverse.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class float2x2_inverse + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float2x2* m1; + + public void Init() + { + rng = new Random(1); + m1 = (float2x2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + m1[i] = float2x2.identity; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(m1, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.m1[i] = math.inverse(args.m1[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void float2x2_inverse_mono() + { + float2x2_inverse.TestFunction testFunction = float2x2_inverse.MonoTestFunction; + var args = new float2x2_inverse.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void float2x2_inverse_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(float2x2_inverse.BurstTestFunction); + var args = new float2x2_inverse.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class double4x4_inverse + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public double4x4* m1; + + public void Init() + { + rng = new Random(1); + m1 = (double4x4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + m1[i] = double4x4.identity; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(m1, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.m1[i] = math.inverse(args.m1[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void double4x4_inverse_mono() + { + double4x4_inverse.TestFunction testFunction = double4x4_inverse.MonoTestFunction; + var args = new double4x4_inverse.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void double4x4_inverse_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(double4x4_inverse.BurstTestFunction); + var args = new double4x4_inverse.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class double3x3_inverse + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public double3x3* m1; + + public void Init() + { + rng = new Random(1); + m1 = (double3x3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + m1[i] = double3x3.identity; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(m1, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.m1[i] = math.inverse(args.m1[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void double3x3_inverse_mono() + { + double3x3_inverse.TestFunction testFunction = double3x3_inverse.MonoTestFunction; + var args = new double3x3_inverse.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void double3x3_inverse_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(double3x3_inverse.BurstTestFunction); + var args = new double3x3_inverse.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class double2x2_inverse + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public double2x2* m1; + + public void Init() + { + rng = new Random(1); + m1 = (double2x2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + m1[i] = double2x2.identity; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(m1, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.m1[i] = math.inverse(args.m1[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void double2x2_inverse_mono() + { + double2x2_inverse.TestFunction testFunction = double2x2_inverse.MonoTestFunction; + var args = new double2x2_inverse.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void double2x2_inverse_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(double2x2_inverse.BurstTestFunction); + var args = new double2x2_inverse.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class quaternion_inverse + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public quaternion* q; + + public void Init() + { + rng = new Random(1); + q = (quaternion*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + q[i] = quaternion.identity; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(q, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.q[i] = math.inverse(args.q[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void quaternion_inverse_mono() + { + quaternion_inverse.TestFunction testFunction = quaternion_inverse.MonoTestFunction; + var args = new quaternion_inverse.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void quaternion_inverse_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(quaternion_inverse.BurstTestFunction); + var args = new quaternion_inverse.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class pseudoinverse + { + public const int iterations = 1000; + + public struct Arguments : IDisposable + { + public Random rng; + public float3x3* m; + + public void Init() + { + rng = new Random(1); + m = (float3x3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + m[i] = new float3x3(0.054824f, 0.462398f, 0.050136f, 0.054824f, 0.462398f, 0.050136f, 0.938166f, 0.542226f, 0.106844f); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(m, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.m[i] = math.pseudoinverse(args.m[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void pseudoinverse_mono() + { + pseudoinverse.TestFunction testFunction = pseudoinverse.MonoTestFunction; + var args = new pseudoinverse.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void pseudoinverse_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(pseudoinverse.BurstTestFunction); + var args = new pseudoinverse.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + } +} diff --git a/src/Unity.Mathematics.PerformanceTests/TestInverse.gen.cs.meta b/src/Unity.Mathematics.PerformanceTests/TestInverse.gen.cs.meta new file mode 100644 index 00000000..1c5e0102 --- /dev/null +++ b/src/Unity.Mathematics.PerformanceTests/TestInverse.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a2e86c2f132904852b5e65648a8f0bf5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics.PerformanceTests/TestMath.gen.cs b/src/Unity.Mathematics.PerformanceTests/TestMath.gen.cs new file mode 100644 index 00000000..dfab18d9 --- /dev/null +++ b/src/Unity.Mathematics.PerformanceTests/TestMath.gen.cs @@ -0,0 +1,3298 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using NUnit.Framework; +using Unity.Collections; +using Unity.Collections.LowLevel.Unsafe; +using Unity.PerformanceTesting; +using Unity.Mathematics.Geometry; +using Unity.Burst; + +namespace Unity.Mathematics.PerformanceTests +{ + partial class TestMath + { + [BurstCompile(CompileSynchronously = true)] + public unsafe class orthonormal_basis_float + { + public const int iterations = 1000000; + + public struct Arguments : IDisposable + { + public Random rng; + public float3* v1; + public float3* v2; + public float3* v3; + + public void Init() + { + rng = new Random(1); + v1 = (float3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v1[i] = rng.NextFloat3Direction(); + } + + v2 = (float3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v2[i] = new float3(); + } + + v3 = (float3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v3[i] = new float3(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v1, Allocator.Persistent); + UnsafeUtility.Free(v2, Allocator.Persistent); + UnsafeUtility.Free(v3, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + math.orthonormal_basis(args.v1[i], out args.v2[i], out args.v3[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void orthonormal_basis_float_mono() + { + orthonormal_basis_float.TestFunction testFunction = orthonormal_basis_float.MonoTestFunction; + var args = new orthonormal_basis_float.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void orthonormal_basis_float_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(orthonormal_basis_float.BurstTestFunction); + var args = new orthonormal_basis_float.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class orthonormal_basis_double + { + public const int iterations = 1000000; + + public struct Arguments : IDisposable + { + public Random rng; + public double3* v1; + public double3* v2; + public double3* v3; + + public void Init() + { + rng = new Random(1); + v1 = (double3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v1[i] = rng.NextDouble3Direction(); + } + + v2 = (double3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v2[i] = new double(); + } + + v3 = (double3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v3[i] = new double(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v1, Allocator.Persistent); + UnsafeUtility.Free(v2, Allocator.Persistent); + UnsafeUtility.Free(v3, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + math.orthonormal_basis(args.v1[i], out args.v2[i], out args.v3[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void orthonormal_basis_double_mono() + { + orthonormal_basis_double.TestFunction testFunction = orthonormal_basis_double.MonoTestFunction; + var args = new orthonormal_basis_double.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void orthonormal_basis_double_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(orthonormal_basis_double.BurstTestFunction); + var args = new orthonormal_basis_double.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class asuint_float + { + public const int iterations = 400000; + + public struct Arguments : IDisposable + { + public Random rng; + public uint* result; + public float* v; + + public void Init() + { + rng = new Random(1); + result = (uint*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + result[i] = new uint(); + } + + v = (float*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = rng.NextFloat(-1.0f, 1.0f); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(result, Allocator.Persistent); + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.result[i] = math.asuint(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void asuint_float_mono() + { + asuint_float.TestFunction testFunction = asuint_float.MonoTestFunction; + var args = new asuint_float.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void asuint_float_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(asuint_float.BurstTestFunction); + var args = new asuint_float.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class asuint_float2 + { + public const int iterations = 400000; + + public struct Arguments : IDisposable + { + public Random rng; + public uint2* result; + public float2* v; + + public void Init() + { + rng = new Random(1); + result = (uint2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + result[i] = new uint2(); + } + + v = (float2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = rng.NextFloat2(-1.0f, 1.0f); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(result, Allocator.Persistent); + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.result[i] = math.asuint(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void asuint_float2_mono() + { + asuint_float2.TestFunction testFunction = asuint_float2.MonoTestFunction; + var args = new asuint_float2.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void asuint_float2_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(asuint_float2.BurstTestFunction); + var args = new asuint_float2.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class asuint_float3 + { + public const int iterations = 400000; + + public struct Arguments : IDisposable + { + public Random rng; + public uint3* result; + public float3* v; + + public void Init() + { + rng = new Random(1); + result = (uint3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + result[i] = new uint3(); + } + + v = (float3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = rng.NextFloat3(-1.0f, 1.0f); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(result, Allocator.Persistent); + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.result[i] = math.asuint(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void asuint_float3_mono() + { + asuint_float3.TestFunction testFunction = asuint_float3.MonoTestFunction; + var args = new asuint_float3.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void asuint_float3_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(asuint_float3.BurstTestFunction); + var args = new asuint_float3.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class asuint_float4 + { + public const int iterations = 400000; + + public struct Arguments : IDisposable + { + public Random rng; + public uint4* result; + public float4* v; + + public void Init() + { + rng = new Random(1); + result = (uint4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + result[i] = new uint4(); + } + + v = (float4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = rng.NextFloat4(-1.0f, 1.0f); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(result, Allocator.Persistent); + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.result[i] = math.asuint(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void asuint_float4_mono() + { + asuint_float4.TestFunction testFunction = asuint_float4.MonoTestFunction; + var args = new asuint_float4.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void asuint_float4_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(asuint_float4.BurstTestFunction); + var args = new asuint_float4.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class asint_float + { + public const int iterations = 400000; + + public struct Arguments : IDisposable + { + public Random rng; + public int* result; + public float* v; + + public void Init() + { + rng = new Random(1); + result = (int*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + result[i] = new int(); + } + + v = (float*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = rng.NextFloat(-1.0f, 1.0f); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(result, Allocator.Persistent); + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.result[i] = math.asint(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void asint_float_mono() + { + asint_float.TestFunction testFunction = asint_float.MonoTestFunction; + var args = new asint_float.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void asint_float_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(asint_float.BurstTestFunction); + var args = new asint_float.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class asint_float2 + { + public const int iterations = 400000; + + public struct Arguments : IDisposable + { + public Random rng; + public int2* result; + public float2* v; + + public void Init() + { + rng = new Random(1); + result = (int2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + result[i] = new int2(); + } + + v = (float2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = rng.NextFloat2(-1.0f, 1.0f); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(result, Allocator.Persistent); + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.result[i] = math.asint(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void asint_float2_mono() + { + asint_float2.TestFunction testFunction = asint_float2.MonoTestFunction; + var args = new asint_float2.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void asint_float2_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(asint_float2.BurstTestFunction); + var args = new asint_float2.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class asint_float3 + { + public const int iterations = 400000; + + public struct Arguments : IDisposable + { + public Random rng; + public int3* result; + public float3* v; + + public void Init() + { + rng = new Random(1); + result = (int3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + result[i] = new int3(); + } + + v = (float3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = rng.NextFloat3(-1.0f, 1.0f); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(result, Allocator.Persistent); + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.result[i] = math.asint(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void asint_float3_mono() + { + asint_float3.TestFunction testFunction = asint_float3.MonoTestFunction; + var args = new asint_float3.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void asint_float3_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(asint_float3.BurstTestFunction); + var args = new asint_float3.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class asint_float4 + { + public const int iterations = 400000; + + public struct Arguments : IDisposable + { + public Random rng; + public int4* result; + public float4* v; + + public void Init() + { + rng = new Random(1); + result = (int4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + result[i] = new int4(); + } + + v = (float4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = rng.NextFloat4(-1.0f, 1.0f); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(result, Allocator.Persistent); + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.result[i] = math.asint(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void asint_float4_mono() + { + asint_float4.TestFunction testFunction = asint_float4.MonoTestFunction; + var args = new asint_float4.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void asint_float4_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(asint_float4.BurstTestFunction); + var args = new asint_float4.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class asfloat_uint + { + public const int iterations = 400000; + + public struct Arguments : IDisposable + { + public Random rng; + public float* result; + public uint* v; + + public void Init() + { + rng = new Random(1); + result = (float*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + result[i] = new uint(); + } + + v = (uint*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = rng.NextUInt(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(result, Allocator.Persistent); + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.result[i] = math.asfloat(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void asfloat_uint_mono() + { + asfloat_uint.TestFunction testFunction = asfloat_uint.MonoTestFunction; + var args = new asfloat_uint.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void asfloat_uint_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(asfloat_uint.BurstTestFunction); + var args = new asfloat_uint.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class asfloat_uint2 + { + public const int iterations = 400000; + + public struct Arguments : IDisposable + { + public Random rng; + public float2* result; + public uint2* v; + + public void Init() + { + rng = new Random(1); + result = (float2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + result[i] = new uint2(); + } + + v = (uint2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = rng.NextUInt2(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(result, Allocator.Persistent); + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.result[i] = math.asfloat(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void asfloat_uint2_mono() + { + asfloat_uint2.TestFunction testFunction = asfloat_uint2.MonoTestFunction; + var args = new asfloat_uint2.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void asfloat_uint2_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(asfloat_uint2.BurstTestFunction); + var args = new asfloat_uint2.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class asfloat_uint3 + { + public const int iterations = 400000; + + public struct Arguments : IDisposable + { + public Random rng; + public float3* result; + public uint3* v; + + public void Init() + { + rng = new Random(1); + result = (float3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + result[i] = new uint3(); + } + + v = (uint3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = rng.NextUInt3(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(result, Allocator.Persistent); + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.result[i] = math.asfloat(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void asfloat_uint3_mono() + { + asfloat_uint3.TestFunction testFunction = asfloat_uint3.MonoTestFunction; + var args = new asfloat_uint3.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void asfloat_uint3_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(asfloat_uint3.BurstTestFunction); + var args = new asfloat_uint3.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class asfloat_uint4 + { + public const int iterations = 400000; + + public struct Arguments : IDisposable + { + public Random rng; + public float4* result; + public uint4* v; + + public void Init() + { + rng = new Random(1); + result = (float4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + result[i] = new uint4(); + } + + v = (uint4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = rng.NextUInt4(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(result, Allocator.Persistent); + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.result[i] = math.asfloat(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void asfloat_uint4_mono() + { + asfloat_uint4.TestFunction testFunction = asfloat_uint4.MonoTestFunction; + var args = new asfloat_uint4.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void asfloat_uint4_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(asfloat_uint4.BurstTestFunction); + var args = new asfloat_uint4.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class asfloat_int + { + public const int iterations = 400000; + + public struct Arguments : IDisposable + { + public Random rng; + public float* result; + public int* v; + + public void Init() + { + rng = new Random(1); + result = (float*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + result[i] = new int(); + } + + v = (int*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = rng.NextInt(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(result, Allocator.Persistent); + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.result[i] = math.asfloat(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void asfloat_int_mono() + { + asfloat_int.TestFunction testFunction = asfloat_int.MonoTestFunction; + var args = new asfloat_int.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void asfloat_int_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(asfloat_int.BurstTestFunction); + var args = new asfloat_int.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class asfloat_int2 + { + public const int iterations = 400000; + + public struct Arguments : IDisposable + { + public Random rng; + public float2* result; + public int2* v; + + public void Init() + { + rng = new Random(1); + result = (float2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + result[i] = new int2(); + } + + v = (int2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = rng.NextInt2(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(result, Allocator.Persistent); + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.result[i] = math.asfloat(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void asfloat_int2_mono() + { + asfloat_int2.TestFunction testFunction = asfloat_int2.MonoTestFunction; + var args = new asfloat_int2.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void asfloat_int2_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(asfloat_int2.BurstTestFunction); + var args = new asfloat_int2.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class asfloat_int3 + { + public const int iterations = 400000; + + public struct Arguments : IDisposable + { + public Random rng; + public float3* result; + public int3* v; + + public void Init() + { + rng = new Random(1); + result = (float3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + result[i] = new int3(); + } + + v = (int3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = rng.NextInt3(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(result, Allocator.Persistent); + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.result[i] = math.asfloat(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void asfloat_int3_mono() + { + asfloat_int3.TestFunction testFunction = asfloat_int3.MonoTestFunction; + var args = new asfloat_int3.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void asfloat_int3_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(asfloat_int3.BurstTestFunction); + var args = new asfloat_int3.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class asfloat_int4 + { + public const int iterations = 400000; + + public struct Arguments : IDisposable + { + public Random rng; + public float4* result; + public int4* v; + + public void Init() + { + rng = new Random(1); + result = (float4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + result[i] = new int4(); + } + + v = (int4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = rng.NextInt4(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(result, Allocator.Persistent); + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.result[i] = math.asfloat(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void asfloat_int4_mono() + { + asfloat_int4.TestFunction testFunction = asfloat_int4.MonoTestFunction; + var args = new asfloat_int4.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void asfloat_int4_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(asfloat_int4.BurstTestFunction); + var args = new asfloat_int4.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class asdouble_ulong + { + public const int iterations = 400000; + + public struct Arguments : IDisposable + { + public Random rng; + public double* result; + public ulong* v; + + public void Init() + { + rng = new Random(1); + result = (double*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + result[i] = new double(); + } + + v = (ulong*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = rng.NextUInt(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(result, Allocator.Persistent); + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.result[i] = math.asdouble(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void asdouble_ulong_mono() + { + asdouble_ulong.TestFunction testFunction = asdouble_ulong.MonoTestFunction; + var args = new asdouble_ulong.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void asdouble_ulong_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(asdouble_ulong.BurstTestFunction); + var args = new asdouble_ulong.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class asdouble_long + { + public const int iterations = 400000; + + public struct Arguments : IDisposable + { + public Random rng; + public double* result; + public long* v; + + public void Init() + { + rng = new Random(1); + result = (double*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + result[i] = new double(); + } + + v = (long*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = rng.NextInt(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(result, Allocator.Persistent); + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.result[i] = math.asdouble(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void asdouble_long_mono() + { + asdouble_long.TestFunction testFunction = asdouble_long.MonoTestFunction; + var args = new asdouble_long.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void asdouble_long_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(asdouble_long.BurstTestFunction); + var args = new asdouble_long.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class aslong_double + { + public const int iterations = 400000; + + public struct Arguments : IDisposable + { + public Random rng; + public long* result; + public double* v; + + public void Init() + { + rng = new Random(1); + result = (long*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + result[i] = new long(); + } + + v = (double*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = rng.NextDouble(-1.0, 1.0); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(result, Allocator.Persistent); + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.result[i] = math.aslong(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void aslong_double_mono() + { + aslong_double.TestFunction testFunction = aslong_double.MonoTestFunction; + var args = new aslong_double.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void aslong_double_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(aslong_double.BurstTestFunction); + var args = new aslong_double.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class asulong_double + { + public const int iterations = 400000; + + public struct Arguments : IDisposable + { + public Random rng; + public ulong* result; + public double* v; + + public void Init() + { + rng = new Random(1); + result = (ulong*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + result[i] = new ulong(); + } + + v = (double*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = rng.NextDouble(-1.0, 1.0); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(result, Allocator.Persistent); + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.result[i] = math.asulong(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void asulong_double_mono() + { + asulong_double.TestFunction testFunction = asulong_double.MonoTestFunction; + var args = new asulong_double.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void asulong_double_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(asulong_double.BurstTestFunction); + var args = new asulong_double.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class asuint_int + { + public const int iterations = 400000; + + public struct Arguments : IDisposable + { + public Random rng; + public uint* result; + public int* v; + + public void Init() + { + rng = new Random(1); + result = (uint*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + result[i] = new uint(); + } + + v = (int*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = rng.NextInt(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(result, Allocator.Persistent); + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.result[i] = math.asuint(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void asuint_int_mono() + { + asuint_int.TestFunction testFunction = asuint_int.MonoTestFunction; + var args = new asuint_int.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void asuint_int_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(asuint_int.BurstTestFunction); + var args = new asuint_int.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class asuint_int2 + { + public const int iterations = 400000; + + public struct Arguments : IDisposable + { + public Random rng; + public uint2* result; + public int2* v; + + public void Init() + { + rng = new Random(1); + result = (uint2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + result[i] = new uint2(); + } + + v = (int2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = rng.NextInt2(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(result, Allocator.Persistent); + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.result[i] = math.asuint(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void asuint_int2_mono() + { + asuint_int2.TestFunction testFunction = asuint_int2.MonoTestFunction; + var args = new asuint_int2.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void asuint_int2_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(asuint_int2.BurstTestFunction); + var args = new asuint_int2.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class asuint_int3 + { + public const int iterations = 400000; + + public struct Arguments : IDisposable + { + public Random rng; + public uint3* result; + public int3* v; + + public void Init() + { + rng = new Random(1); + result = (uint3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + result[i] = new uint3(); + } + + v = (int3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = rng.NextInt3(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(result, Allocator.Persistent); + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.result[i] = math.asuint(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void asuint_int3_mono() + { + asuint_int3.TestFunction testFunction = asuint_int3.MonoTestFunction; + var args = new asuint_int3.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void asuint_int3_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(asuint_int3.BurstTestFunction); + var args = new asuint_int3.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class asuint_int4 + { + public const int iterations = 400000; + + public struct Arguments : IDisposable + { + public Random rng; + public uint4* result; + public int4* v; + + public void Init() + { + rng = new Random(1); + result = (uint4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + result[i] = new uint4(); + } + + v = (int4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = rng.NextInt4(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(result, Allocator.Persistent); + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.result[i] = math.asuint(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void asuint_int4_mono() + { + asuint_int4.TestFunction testFunction = asuint_int4.MonoTestFunction; + var args = new asuint_int4.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void asuint_int4_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(asuint_int4.BurstTestFunction); + var args = new asuint_int4.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class asint_uint + { + public const int iterations = 400000; + + public struct Arguments : IDisposable + { + public Random rng; + public int* result; + public uint* v; + + public void Init() + { + rng = new Random(1); + result = (int*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + result[i] = new int(); + } + + v = (uint*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = rng.NextUInt(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(result, Allocator.Persistent); + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.result[i] = math.asint(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void asint_uint_mono() + { + asint_uint.TestFunction testFunction = asint_uint.MonoTestFunction; + var args = new asint_uint.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void asint_uint_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(asint_uint.BurstTestFunction); + var args = new asint_uint.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class asint_uint2 + { + public const int iterations = 400000; + + public struct Arguments : IDisposable + { + public Random rng; + public int2* result; + public uint2* v; + + public void Init() + { + rng = new Random(1); + result = (int2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + result[i] = new int2(); + } + + v = (uint2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = rng.NextUInt2(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(result, Allocator.Persistent); + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.result[i] = math.asint(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void asint_uint2_mono() + { + asint_uint2.TestFunction testFunction = asint_uint2.MonoTestFunction; + var args = new asint_uint2.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void asint_uint2_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(asint_uint2.BurstTestFunction); + var args = new asint_uint2.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class asint_uint3 + { + public const int iterations = 400000; + + public struct Arguments : IDisposable + { + public Random rng; + public int3* result; + public uint3* v; + + public void Init() + { + rng = new Random(1); + result = (int3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + result[i] = new int3(); + } + + v = (uint3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = rng.NextUInt3(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(result, Allocator.Persistent); + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.result[i] = math.asint(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void asint_uint3_mono() + { + asint_uint3.TestFunction testFunction = asint_uint3.MonoTestFunction; + var args = new asint_uint3.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void asint_uint3_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(asint_uint3.BurstTestFunction); + var args = new asint_uint3.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class asint_uint4 + { + public const int iterations = 400000; + + public struct Arguments : IDisposable + { + public Random rng; + public int4* result; + public uint4* v; + + public void Init() + { + rng = new Random(1); + result = (int4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + result[i] = new int4(); + } + + v = (uint4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = rng.NextUInt4(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(result, Allocator.Persistent); + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.result[i] = math.asint(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void asint_uint4_mono() + { + asint_uint4.TestFunction testFunction = asint_uint4.MonoTestFunction; + var args = new asint_uint4.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void asint_uint4_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(asint_uint4.BurstTestFunction); + var args = new asint_uint4.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class chgsign_float + { + public const int iterations = 100000; + + public struct Arguments : IDisposable + { + public Random rng; + public float* f; + public float* sign; + public float* result; + + public void Init() + { + rng = new Random(1); + f = (float*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + f[i] = 1.0f; + } + + sign = (float*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + sign[i] = rng.NextFloat(-1.0f, 1.0f); + } + + result = (float*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + result[i] = 0.0f; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(f, Allocator.Persistent); + UnsafeUtility.Free(sign, Allocator.Persistent); + UnsafeUtility.Free(result, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.result[i] = math.chgsign(args.f[i], args.sign[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void chgsign_float_mono() + { + chgsign_float.TestFunction testFunction = chgsign_float.MonoTestFunction; + var args = new chgsign_float.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void chgsign_float_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(chgsign_float.BurstTestFunction); + var args = new chgsign_float.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class chgsign_float2 + { + public const int iterations = 100000; + + public struct Arguments : IDisposable + { + public Random rng; + public float2* f; + public float2* sign; + public float2* result; + + public void Init() + { + rng = new Random(1); + f = (float2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + f[i] = new float2(1.0f); + } + + sign = (float2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + sign[i] = rng.NextFloat2(-1.0f, 1.0f); + } + + result = (float2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + result[i] = new float2(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(f, Allocator.Persistent); + UnsafeUtility.Free(sign, Allocator.Persistent); + UnsafeUtility.Free(result, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.result[i] = math.chgsign(args.f[i], args.sign[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void chgsign_float2_mono() + { + chgsign_float2.TestFunction testFunction = chgsign_float2.MonoTestFunction; + var args = new chgsign_float2.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void chgsign_float2_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(chgsign_float2.BurstTestFunction); + var args = new chgsign_float2.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class chgsign_float3 + { + public const int iterations = 100000; + + public struct Arguments : IDisposable + { + public Random rng; + public float3* f; + public float3* sign; + public float3* result; + + public void Init() + { + rng = new Random(1); + f = (float3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + f[i] = new float3(1.0f); + } + + sign = (float3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + sign[i] = rng.NextFloat3(-1.0f, 1.0f); + } + + result = (float3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + result[i] = new float3(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(f, Allocator.Persistent); + UnsafeUtility.Free(sign, Allocator.Persistent); + UnsafeUtility.Free(result, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.result[i] = math.chgsign(args.f[i], args.sign[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void chgsign_float3_mono() + { + chgsign_float3.TestFunction testFunction = chgsign_float3.MonoTestFunction; + var args = new chgsign_float3.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void chgsign_float3_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(chgsign_float3.BurstTestFunction); + var args = new chgsign_float3.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class chgsign_float4 + { + public const int iterations = 100000; + + public struct Arguments : IDisposable + { + public Random rng; + public float4* f; + public float4* sign; + public float4* result; + + public void Init() + { + rng = new Random(1); + f = (float4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + f[i] = new float4(1.0f); + } + + sign = (float4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + sign[i] = rng.NextFloat4(-1.0f, 1.0f); + } + + result = (float4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + result[i] = new float4(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(f, Allocator.Persistent); + UnsafeUtility.Free(sign, Allocator.Persistent); + UnsafeUtility.Free(result, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.result[i] = math.chgsign(args.f[i], args.sign[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void chgsign_float4_mono() + { + chgsign_float4.TestFunction testFunction = chgsign_float4.MonoTestFunction; + var args = new chgsign_float4.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void chgsign_float4_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(chgsign_float4.BurstTestFunction); + var args = new chgsign_float4.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class angle_quaternion_quaternion + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public quaternion* q1; + public quaternion* q2; + public float* result; + + public void Init() + { + rng = new Random(1); + q1 = (quaternion*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + q1[i] = rng.NextQuaternionRotation(); + } + + q2 = (quaternion*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + q2[i] = rng.NextQuaternionRotation(); + } + + result = (float*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + result[i] = new float(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(q1, Allocator.Persistent); + UnsafeUtility.Free(q2, Allocator.Persistent); + UnsafeUtility.Free(result, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.result[i] = math.angle(args.q1[i], args.q2[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void angle_quaternion_quaternion_mono() + { + angle_quaternion_quaternion.TestFunction testFunction = angle_quaternion_quaternion.MonoTestFunction; + var args = new angle_quaternion_quaternion.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void angle_quaternion_quaternion_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(angle_quaternion_quaternion.BurstTestFunction); + var args = new angle_quaternion_quaternion.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + } +} diff --git a/src/Unity.Mathematics.PerformanceTests/TestMath.gen.cs.meta b/src/Unity.Mathematics.PerformanceTests/TestMath.gen.cs.meta new file mode 100644 index 00000000..05b64bda --- /dev/null +++ b/src/Unity.Mathematics.PerformanceTests/TestMath.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f84a39ab49a9b42a7b7d6430da01c134 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics.PerformanceTests/TestMinMaxAABB.gen.cs b/src/Unity.Mathematics.PerformanceTests/TestMinMaxAABB.gen.cs new file mode 100644 index 00000000..ab4406c2 --- /dev/null +++ b/src/Unity.Mathematics.PerformanceTests/TestMinMaxAABB.gen.cs @@ -0,0 +1,190 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using NUnit.Framework; +using Unity.Collections; +using Unity.Collections.LowLevel.Unsafe; +using Unity.PerformanceTesting; +using Unity.Mathematics.Geometry; +using Unity.Burst; + +namespace Unity.Mathematics.PerformanceTests +{ + partial class TestMinMaxAABB + { + [BurstCompile(CompileSynchronously = true)] + public unsafe class Transform_float4x4 + { + public const int iterations = 100000; + + public struct Arguments : IDisposable + { + public Random rng; + public Geometry.MinMaxAABB* a; + + public void Init() + { + rng = new Random(1); + a = (Geometry.MinMaxAABB*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + a[i] = new Geometry.MinMaxAABB(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(a, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.a[i] = Geometry.Math.Transform(float4x4.identity, args.a[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void Transform_float4x4_mono() + { + Transform_float4x4.TestFunction testFunction = Transform_float4x4.MonoTestFunction; + var args = new Transform_float4x4.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void Transform_float4x4_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(Transform_float4x4.BurstTestFunction); + var args = new Transform_float4x4.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class Transform_float3x3 + { + public const int iterations = 100000; + + public struct Arguments : IDisposable + { + public Random rng; + public Geometry.MinMaxAABB* a; + + public void Init() + { + rng = new Random(1); + a = (Geometry.MinMaxAABB*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + a[i] = new Geometry.MinMaxAABB(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(a, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.a[i] = Geometry.Math.Transform(float3x3.identity, args.a[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void Transform_float3x3_mono() + { + Transform_float3x3.TestFunction testFunction = Transform_float3x3.MonoTestFunction; + var args = new Transform_float3x3.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void Transform_float3x3_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(Transform_float3x3.BurstTestFunction); + var args = new Transform_float3x3.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + } +} diff --git a/src/Unity.Mathematics.PerformanceTests/TestMinMaxAABB.gen.cs.meta b/src/Unity.Mathematics.PerformanceTests/TestMinMaxAABB.gen.cs.meta new file mode 100644 index 00000000..e6e42568 --- /dev/null +++ b/src/Unity.Mathematics.PerformanceTests/TestMinMaxAABB.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ca277fe77ffcc4fbebdd68a42b968f0c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics.PerformanceTests/TestMul.gen.cs b/src/Unity.Mathematics.PerformanceTests/TestMul.gen.cs new file mode 100644 index 00000000..2cd2c55a --- /dev/null +++ b/src/Unity.Mathematics.PerformanceTests/TestMul.gen.cs @@ -0,0 +1,666 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using NUnit.Framework; +using Unity.Collections; +using Unity.Collections.LowLevel.Unsafe; +using Unity.PerformanceTesting; +using Unity.Mathematics.Geometry; +using Unity.Burst; + +namespace Unity.Mathematics.PerformanceTests +{ + partial class TestMul + { + [BurstCompile(CompileSynchronously = true)] + public unsafe class float4x4_float4x4 + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float4x4* m1; + public float4x4* m2; + + public void Init() + { + rng = new Random(1); + m1 = (float4x4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + m1[i] = float4x4.identity; + } + + m2 = (float4x4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + m2[i] = float4x4.identity; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(m1, Allocator.Persistent); + UnsafeUtility.Free(m2, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.m1[i] = math.mul(args.m1[i], args.m2[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void float4x4_float4x4_mono() + { + float4x4_float4x4.TestFunction testFunction = float4x4_float4x4.MonoTestFunction; + var args = new float4x4_float4x4.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void float4x4_float4x4_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(float4x4_float4x4.BurstTestFunction); + var args = new float4x4_float4x4.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class float4x4_float4 + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float4x4* m1; + public float4* m2; + + public void Init() + { + rng = new Random(1); + m1 = (float4x4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + m1[i] = float4x4.identity; + } + + m2 = (float4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + m2[i] = new float4(1.0f, 0.0f, 0.0f, 1.0f); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(m1, Allocator.Persistent); + UnsafeUtility.Free(m2, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.m2[i] = math.mul(args.m1[i], args.m2[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void float4x4_float4_mono() + { + float4x4_float4.TestFunction testFunction = float4x4_float4.MonoTestFunction; + var args = new float4x4_float4.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void float4x4_float4_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(float4x4_float4.BurstTestFunction); + var args = new float4x4_float4.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class quaternion_quaternion + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public quaternion* q1; + public quaternion* q2; + + public void Init() + { + rng = new Random(1); + q1 = (quaternion*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + q1[i] = quaternion.identity; + } + + q2 = (quaternion*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + q2[i] = quaternion.identity; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(q1, Allocator.Persistent); + UnsafeUtility.Free(q2, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.q2[i] = math.mul(args.q1[i], args.q2[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void quaternion_quaternion_mono() + { + quaternion_quaternion.TestFunction testFunction = quaternion_quaternion.MonoTestFunction; + var args = new quaternion_quaternion.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void quaternion_quaternion_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(quaternion_quaternion.BurstTestFunction); + var args = new quaternion_quaternion.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class float3x3_float3x3 + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float3x3* m1; + public float3x3* m2; + + public void Init() + { + rng = new Random(1); + m1 = (float3x3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + m1[i] = float3x3.identity; + } + + m2 = (float3x3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + m2[i] = float3x3.identity; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(m1, Allocator.Persistent); + UnsafeUtility.Free(m2, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.m2[i] = math.mul(args.m1[i], args.m2[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void float3x3_float3x3_mono() + { + float3x3_float3x3.TestFunction testFunction = float3x3_float3x3.MonoTestFunction; + var args = new float3x3_float3x3.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void float3x3_float3x3_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(float3x3_float3x3.BurstTestFunction); + var args = new float3x3_float3x3.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class float2x2_float2x2 + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float2x2* m1; + public float2x2* m2; + + public void Init() + { + rng = new Random(1); + m1 = (float2x2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + m1[i] = float2x2.identity; + } + + m2 = (float2x2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + m2[i] = float2x2.identity; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(m1, Allocator.Persistent); + UnsafeUtility.Free(m2, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.m2[i] = math.mul(args.m1[i], args.m2[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void float2x2_float2x2_mono() + { + float2x2_float2x2.TestFunction testFunction = float2x2_float2x2.MonoTestFunction; + var args = new float2x2_float2x2.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void float2x2_float2x2_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(float2x2_float2x2.BurstTestFunction); + var args = new float2x2_float2x2.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class float3x3_float3 + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float3x3* m1; + public float3* m2; + + public void Init() + { + rng = new Random(1); + m1 = (float3x3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + m1[i] = float3x3.identity; + } + + m2 = (float3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + m2[i] = new float3(1.0f, 0.0f, 0.0f); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(m1, Allocator.Persistent); + UnsafeUtility.Free(m2, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.m2[i] = math.mul(args.m1[i], args.m2[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void float3x3_float3_mono() + { + float3x3_float3.TestFunction testFunction = float3x3_float3.MonoTestFunction; + var args = new float3x3_float3.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void float3x3_float3_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(float3x3_float3.BurstTestFunction); + var args = new float3x3_float3.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class float2x2_float2 + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float2x2* m1; + public float2* m2; + + public void Init() + { + rng = new Random(1); + m1 = (float2x2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + m1[i] = float2x2.identity; + } + + m2 = (float2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + m2[i] = new float2(1.0f, 0.0f); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(m1, Allocator.Persistent); + UnsafeUtility.Free(m2, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.m2[i] = math.mul(args.m1[i], args.m2[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void float2x2_float2_mono() + { + float2x2_float2.TestFunction testFunction = float2x2_float2.MonoTestFunction; + var args = new float2x2_float2.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void float2x2_float2_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(float2x2_float2.BurstTestFunction); + var args = new float2x2_float2.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + } +} diff --git a/src/Unity.Mathematics.PerformanceTests/TestMul.gen.cs.meta b/src/Unity.Mathematics.PerformanceTests/TestMul.gen.cs.meta new file mode 100644 index 00000000..d196f34e --- /dev/null +++ b/src/Unity.Mathematics.PerformanceTests/TestMul.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 93771aa1f583e41bdb275ab68a07b103 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics.PerformanceTests/TestNoise.gen.cs b/src/Unity.Mathematics.PerformanceTests/TestNoise.gen.cs new file mode 100644 index 00000000..d87c6612 --- /dev/null +++ b/src/Unity.Mathematics.PerformanceTests/TestNoise.gen.cs @@ -0,0 +1,1542 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using NUnit.Framework; +using Unity.Collections; +using Unity.Collections.LowLevel.Unsafe; +using Unity.PerformanceTesting; +using Unity.Mathematics.Geometry; +using Unity.Burst; + +namespace Unity.Mathematics.PerformanceTests +{ + partial class TestNoise + { + [BurstCompile(CompileSynchronously = true)] + public unsafe class snoise2D + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float2* v; + + public void Init() + { + rng = new Random(1); + v = (float2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new float2(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.v[i].x = noise.snoise(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void snoise2D_mono() + { + snoise2D.TestFunction testFunction = snoise2D.MonoTestFunction; + var args = new snoise2D.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void snoise2D_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(snoise2D.BurstTestFunction); + var args = new snoise2D.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class snoise3D + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float3* v; + + public void Init() + { + rng = new Random(1); + v = (float3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new float3(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.v[i].x = noise.snoise(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void snoise3D_mono() + { + snoise3D.TestFunction testFunction = snoise3D.MonoTestFunction; + var args = new snoise3D.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void snoise3D_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(snoise3D.BurstTestFunction); + var args = new snoise3D.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class snoise4D + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float4* v; + + public void Init() + { + rng = new Random(1); + v = (float4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new float4(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.v[i].x = noise.snoise(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void snoise4D_mono() + { + snoise4D.TestFunction testFunction = snoise4D.MonoTestFunction; + var args = new snoise4D.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void snoise4D_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(snoise4D.BurstTestFunction); + var args = new snoise4D.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class snoise3Dgrad + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float3* v; + public float3* gradient; + + public void Init() + { + rng = new Random(1); + v = (float3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new float3(); + } + + gradient = (float3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + gradient[i] = new float3(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + UnsafeUtility.Free(gradient, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.v[i].x = noise.snoise(args.v[i], out args.gradient[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void snoise3Dgrad_mono() + { + snoise3Dgrad.TestFunction testFunction = snoise3Dgrad.MonoTestFunction; + var args = new snoise3Dgrad.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void snoise3Dgrad_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(snoise3Dgrad.BurstTestFunction); + var args = new snoise3Dgrad.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class cnoise2D + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float2* v; + + public void Init() + { + rng = new Random(1); + v = (float2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new float2(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.v[i].x = noise.cnoise(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void cnoise2D_mono() + { + cnoise2D.TestFunction testFunction = cnoise2D.MonoTestFunction; + var args = new cnoise2D.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void cnoise2D_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(cnoise2D.BurstTestFunction); + var args = new cnoise2D.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class cnoise3D + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float3* v; + + public void Init() + { + rng = new Random(1); + v = (float3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new float3(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.v[i].x = noise.cnoise(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void cnoise3D_mono() + { + cnoise3D.TestFunction testFunction = cnoise3D.MonoTestFunction; + var args = new cnoise3D.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void cnoise3D_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(cnoise3D.BurstTestFunction); + var args = new cnoise3D.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class cnoise4D + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float4* v; + + public void Init() + { + rng = new Random(1); + v = (float4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new float4(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.v[i].x = noise.cnoise(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void cnoise4D_mono() + { + cnoise4D.TestFunction testFunction = cnoise4D.MonoTestFunction; + var args = new cnoise4D.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void cnoise4D_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(cnoise4D.BurstTestFunction); + var args = new cnoise4D.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class pnoise2D + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float2* v; + + public void Init() + { + rng = new Random(1); + v = (float2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new float2(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.v[i].x = noise.pnoise(args.v[i], args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void pnoise2D_mono() + { + pnoise2D.TestFunction testFunction = pnoise2D.MonoTestFunction; + var args = new pnoise2D.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void pnoise2D_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(pnoise2D.BurstTestFunction); + var args = new pnoise2D.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class pnoise3D + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float3* v; + + public void Init() + { + rng = new Random(1); + v = (float3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new float3(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.v[i].x = noise.pnoise(args.v[i], args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void pnoise3D_mono() + { + pnoise3D.TestFunction testFunction = pnoise3D.MonoTestFunction; + var args = new pnoise3D.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void pnoise3D_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(pnoise3D.BurstTestFunction); + var args = new pnoise3D.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class pnoise4D + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float4* v; + + public void Init() + { + rng = new Random(1); + v = (float4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new float4(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.v[i].x = noise.pnoise(args.v[i], args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void pnoise4D_mono() + { + pnoise4D.TestFunction testFunction = pnoise4D.MonoTestFunction; + var args = new pnoise4D.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void pnoise4D_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(pnoise4D.BurstTestFunction); + var args = new pnoise4D.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class cellular2D + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float2* v; + + public void Init() + { + rng = new Random(1); + v = (float2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new float2(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.v[i] = noise.cellular(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void cellular2D_mono() + { + cellular2D.TestFunction testFunction = cellular2D.MonoTestFunction; + var args = new cellular2D.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void cellular2D_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(cellular2D.BurstTestFunction); + var args = new cellular2D.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class cellular3D + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float3* v; + + public void Init() + { + rng = new Random(1); + v = (float3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new float3(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.v[i].xy = noise.cellular(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void cellular3D_mono() + { + cellular3D.TestFunction testFunction = cellular3D.MonoTestFunction; + var args = new cellular3D.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void cellular3D_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(cellular3D.BurstTestFunction); + var args = new cellular3D.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class cellular2x2 + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float2* v; + + public void Init() + { + rng = new Random(1); + v = (float2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new float2(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.v[i] = noise.cellular2x2(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void cellular2x2_mono() + { + cellular2x2.TestFunction testFunction = cellular2x2.MonoTestFunction; + var args = new cellular2x2.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void cellular2x2_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(cellular2x2.BurstTestFunction); + var args = new cellular2x2.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class cellular2x2x2 + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float3* v; + + public void Init() + { + rng = new Random(1); + v = (float3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new float3(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.v[i].xy = noise.cellular2x2x2(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void cellular2x2x2_mono() + { + cellular2x2x2.TestFunction testFunction = cellular2x2x2.MonoTestFunction; + var args = new cellular2x2x2.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void cellular2x2x2_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(cellular2x2x2.BurstTestFunction); + var args = new cellular2x2x2.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class psrdnoise + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float2* v; + + public void Init() + { + rng = new Random(1); + v = (float2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new float2(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.v[i] = noise.psrdnoise(args.v[i], args.v[i], args.v[i].y).xy; + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void psrdnoise_mono() + { + psrdnoise.TestFunction testFunction = psrdnoise.MonoTestFunction; + var args = new psrdnoise.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void psrdnoise_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(psrdnoise.BurstTestFunction); + var args = new psrdnoise.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class psrnoise + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float2* v; + + public void Init() + { + rng = new Random(1); + v = (float2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new float2(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.v[i].x = noise.psrnoise(args.v[i], args.v[i], args.v[i].y); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void psrnoise_mono() + { + psrnoise.TestFunction testFunction = psrnoise.MonoTestFunction; + var args = new psrnoise.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void psrnoise_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(psrnoise.BurstTestFunction); + var args = new psrnoise.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class srdnoise + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float2* v; + + public void Init() + { + rng = new Random(1); + v = (float2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new float2(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.v[i] = noise.srdnoise(args.v[i], args.v[i].y).xy; + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void srdnoise_mono() + { + srdnoise.TestFunction testFunction = srdnoise.MonoTestFunction; + var args = new srdnoise.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void srdnoise_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(srdnoise.BurstTestFunction); + var args = new srdnoise.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class srnoise + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float2* v; + + public void Init() + { + rng = new Random(1); + v = (float2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new float2(); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.v[i].x = noise.srnoise(args.v[i], args.v[i].y); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void srnoise_mono() + { + srnoise.TestFunction testFunction = srnoise.MonoTestFunction; + var args = new srnoise.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void srnoise_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(srnoise.BurstTestFunction); + var args = new srnoise.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + } +} diff --git a/src/Unity.Mathematics.PerformanceTests/TestNoise.gen.cs.meta b/src/Unity.Mathematics.PerformanceTests/TestNoise.gen.cs.meta new file mode 100644 index 00000000..bd4daa96 --- /dev/null +++ b/src/Unity.Mathematics.PerformanceTests/TestNoise.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: af7d6ec8799bc4c6e910ad0a9c52a983 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics.PerformanceTests/TestNormalize.gen.cs b/src/Unity.Mathematics.PerformanceTests/TestNormalize.gen.cs new file mode 100644 index 00000000..5f70e74d --- /dev/null +++ b/src/Unity.Mathematics.PerformanceTests/TestNormalize.gen.cs @@ -0,0 +1,1030 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using NUnit.Framework; +using Unity.Collections; +using Unity.Collections.LowLevel.Unsafe; +using Unity.PerformanceTesting; +using Unity.Mathematics.Geometry; +using Unity.Burst; + +namespace Unity.Mathematics.PerformanceTests +{ + partial class TestNormalize + { + [BurstCompile(CompileSynchronously = true)] + public unsafe class float4_normalize + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float4* v; + + public void Init() + { + rng = new Random(1); + v = (float4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new float4(1.0f); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.v[i] = math.normalize(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void float4_normalize_mono() + { + float4_normalize.TestFunction testFunction = float4_normalize.MonoTestFunction; + var args = new float4_normalize.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void float4_normalize_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(float4_normalize.BurstTestFunction); + var args = new float4_normalize.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class float3_normalize + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float3* v; + + public void Init() + { + rng = new Random(1); + v = (float3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new float3(1.0f); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.v[i] = math.normalize(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void float3_normalize_mono() + { + float3_normalize.TestFunction testFunction = float3_normalize.MonoTestFunction; + var args = new float3_normalize.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void float3_normalize_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(float3_normalize.BurstTestFunction); + var args = new float3_normalize.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class float2_normalize + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float2* v; + + public void Init() + { + rng = new Random(1); + v = (float2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new float2(1.0f); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.v[i] = math.normalize(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void float2_normalize_mono() + { + float2_normalize.TestFunction testFunction = float2_normalize.MonoTestFunction; + var args = new float2_normalize.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void float2_normalize_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(float2_normalize.BurstTestFunction); + var args = new float2_normalize.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class double4_normalize + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public double4* v; + + public void Init() + { + rng = new Random(1); + v = (double4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new double4(1.0f); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.v[i] = math.normalize(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void double4_normalize_mono() + { + double4_normalize.TestFunction testFunction = double4_normalize.MonoTestFunction; + var args = new double4_normalize.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void double4_normalize_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(double4_normalize.BurstTestFunction); + var args = new double4_normalize.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class double3_normalize + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public double3* v; + + public void Init() + { + rng = new Random(1); + v = (double3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new double3(1.0f); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.v[i] = math.normalize(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void double3_normalize_mono() + { + double3_normalize.TestFunction testFunction = double3_normalize.MonoTestFunction; + var args = new double3_normalize.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void double3_normalize_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(double3_normalize.BurstTestFunction); + var args = new double3_normalize.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class double2_normalize + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public double2* v; + + public void Init() + { + rng = new Random(1); + v = (double2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new double2(1.0f); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.v[i] = math.normalize(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void double2_normalize_mono() + { + double2_normalize.TestFunction testFunction = double2_normalize.MonoTestFunction; + var args = new double2_normalize.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void double2_normalize_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(double2_normalize.BurstTestFunction); + var args = new double2_normalize.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class float4_normalizesafe + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float4* v; + + public void Init() + { + rng = new Random(1); + v = (float4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new float4(1.0f); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.v[i] = math.normalizesafe(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void float4_normalizesafe_mono() + { + float4_normalizesafe.TestFunction testFunction = float4_normalizesafe.MonoTestFunction; + var args = new float4_normalizesafe.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void float4_normalizesafe_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(float4_normalizesafe.BurstTestFunction); + var args = new float4_normalizesafe.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class float3_normalizesafe + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float3* v; + + public void Init() + { + rng = new Random(1); + v = (float3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new float3(1.0f); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.v[i] = math.normalizesafe(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void float3_normalizesafe_mono() + { + float3_normalizesafe.TestFunction testFunction = float3_normalizesafe.MonoTestFunction; + var args = new float3_normalizesafe.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void float3_normalizesafe_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(float3_normalizesafe.BurstTestFunction); + var args = new float3_normalizesafe.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class float2_normalizesafe + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float2* v; + + public void Init() + { + rng = new Random(1); + v = (float2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new float2(1.0f); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.v[i] = math.normalizesafe(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void float2_normalizesafe_mono() + { + float2_normalizesafe.TestFunction testFunction = float2_normalizesafe.MonoTestFunction; + var args = new float2_normalizesafe.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void float2_normalizesafe_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(float2_normalizesafe.BurstTestFunction); + var args = new float2_normalizesafe.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class double4_normalizesafe + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public double4* v; + + public void Init() + { + rng = new Random(1); + v = (double4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new double4(1.0f); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.v[i] = math.normalizesafe(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void double4_normalizesafe_mono() + { + double4_normalizesafe.TestFunction testFunction = double4_normalizesafe.MonoTestFunction; + var args = new double4_normalizesafe.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void double4_normalizesafe_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(double4_normalizesafe.BurstTestFunction); + var args = new double4_normalizesafe.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class double3_normalizesafe + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public double3* v; + + public void Init() + { + rng = new Random(1); + v = (double3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new double3(1.0f); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.v[i] = math.normalizesafe(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void double3_normalizesafe_mono() + { + double3_normalizesafe.TestFunction testFunction = double3_normalizesafe.MonoTestFunction; + var args = new double3_normalizesafe.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void double3_normalizesafe_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(double3_normalizesafe.BurstTestFunction); + var args = new double3_normalizesafe.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class double2_normalizesafe + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public double2* v; + + public void Init() + { + rng = new Random(1); + v = (double2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new double2(1.0f); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.v[i] = math.normalizesafe(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void double2_normalizesafe_mono() + { + double2_normalizesafe.TestFunction testFunction = double2_normalizesafe.MonoTestFunction; + var args = new double2_normalizesafe.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void double2_normalizesafe_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(double2_normalizesafe.BurstTestFunction); + var args = new double2_normalizesafe.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + } +} diff --git a/src/Unity.Mathematics.PerformanceTests/TestNormalize.gen.cs.meta b/src/Unity.Mathematics.PerformanceTests/TestNormalize.gen.cs.meta new file mode 100644 index 00000000..1d6a323e --- /dev/null +++ b/src/Unity.Mathematics.PerformanceTests/TestNormalize.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9ae3f5653219a4f49b7a30fd431316a6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics.PerformanceTests/TestPlane.gen.cs b/src/Unity.Mathematics.PerformanceTests/TestPlane.gen.cs new file mode 100644 index 00000000..59b6949c --- /dev/null +++ b/src/Unity.Mathematics.PerformanceTests/TestPlane.gen.cs @@ -0,0 +1,106 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using NUnit.Framework; +using Unity.Collections; +using Unity.Collections.LowLevel.Unsafe; +using Unity.PerformanceTesting; +using Unity.Mathematics.Geometry; +using Unity.Burst; + +namespace Unity.Mathematics.PerformanceTests +{ + partial class TestPlane + { + [BurstCompile(CompileSynchronously = true)] + public unsafe class Normalize_Plane + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public Plane* p; + + public void Init() + { + rng = new Random(1); + p = (Plane*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + p[i] = new Plane { NormalAndDistance = new float4(1.0f) }; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(p, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.p[i] = Plane.Normalize(args.p[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void Normalize_Plane_mono() + { + Normalize_Plane.TestFunction testFunction = Normalize_Plane.MonoTestFunction; + var args = new Normalize_Plane.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void Normalize_Plane_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(Normalize_Plane.BurstTestFunction); + var args = new Normalize_Plane.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + } +} diff --git a/src/Unity.Mathematics.PerformanceTests/TestPlane.gen.cs.meta b/src/Unity.Mathematics.PerformanceTests/TestPlane.gen.cs.meta new file mode 100644 index 00000000..278a542c --- /dev/null +++ b/src/Unity.Mathematics.PerformanceTests/TestPlane.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 69f6889f1582d48189d71c70052f337a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics.PerformanceTests/TestRandom.gen.cs b/src/Unity.Mathematics.PerformanceTests/TestRandom.gen.cs new file mode 100644 index 00000000..c318f90f --- /dev/null +++ b/src/Unity.Mathematics.PerformanceTests/TestRandom.gen.cs @@ -0,0 +1,1030 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using NUnit.Framework; +using Unity.Collections; +using Unity.Collections.LowLevel.Unsafe; +using Unity.PerformanceTesting; +using Unity.Mathematics.Geometry; +using Unity.Burst; + +namespace Unity.Mathematics.PerformanceTests +{ + partial class TestRandom + { + [BurstCompile(CompileSynchronously = true)] + public unsafe class Random_NextUint + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public uint* u; + + public void Init() + { + rng = new Random(1); + u = (uint*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + u[i] = 0; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(u, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.u[i] = args.rng.NextUInt(); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void Random_NextUint_mono() + { + Random_NextUint.TestFunction testFunction = Random_NextUint.MonoTestFunction; + var args = new Random_NextUint.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void Random_NextUint_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(Random_NextUint.BurstTestFunction); + var args = new Random_NextUint.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class Random_NextUint2 + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public uint2* u; + + public void Init() + { + rng = new Random(1); + u = (uint2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + u[i] = 0; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(u, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.u[i] = args.rng.NextUInt2(); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void Random_NextUint2_mono() + { + Random_NextUint2.TestFunction testFunction = Random_NextUint2.MonoTestFunction; + var args = new Random_NextUint2.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void Random_NextUint2_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(Random_NextUint2.BurstTestFunction); + var args = new Random_NextUint2.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class Random_NextUint3 + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public uint3* u; + + public void Init() + { + rng = new Random(1); + u = (uint3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + u[i] = 0; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(u, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.u[i] = args.rng.NextUInt3(); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void Random_NextUint3_mono() + { + Random_NextUint3.TestFunction testFunction = Random_NextUint3.MonoTestFunction; + var args = new Random_NextUint3.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void Random_NextUint3_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(Random_NextUint3.BurstTestFunction); + var args = new Random_NextUint3.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class Random_NextUint4 + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public uint4* u; + + public void Init() + { + rng = new Random(1); + u = (uint4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + u[i] = 0; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(u, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.u[i] = args.rng.NextUInt4(); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void Random_NextUint4_mono() + { + Random_NextUint4.TestFunction testFunction = Random_NextUint4.MonoTestFunction; + var args = new Random_NextUint4.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void Random_NextUint4_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(Random_NextUint4.BurstTestFunction); + var args = new Random_NextUint4.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class Random_NextFloat + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float* f; + + public void Init() + { + rng = new Random(1); + f = (float*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + f[i] = 0.0f; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(f, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.f[i] = args.rng.NextFloat(); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void Random_NextFloat_mono() + { + Random_NextFloat.TestFunction testFunction = Random_NextFloat.MonoTestFunction; + var args = new Random_NextFloat.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void Random_NextFloat_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(Random_NextFloat.BurstTestFunction); + var args = new Random_NextFloat.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class Random_NextFloat2 + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float2* f; + + public void Init() + { + rng = new Random(1); + f = (float2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + f[i] = new float2(0.0f); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(f, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.f[i] = args.rng.NextFloat2(); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void Random_NextFloat2_mono() + { + Random_NextFloat2.TestFunction testFunction = Random_NextFloat2.MonoTestFunction; + var args = new Random_NextFloat2.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void Random_NextFloat2_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(Random_NextFloat2.BurstTestFunction); + var args = new Random_NextFloat2.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class Random_NextFloat3 + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float3* f; + + public void Init() + { + rng = new Random(1); + f = (float3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + f[i] = new float3(0.0f); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(f, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.f[i] = args.rng.NextFloat3(); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void Random_NextFloat3_mono() + { + Random_NextFloat3.TestFunction testFunction = Random_NextFloat3.MonoTestFunction; + var args = new Random_NextFloat3.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void Random_NextFloat3_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(Random_NextFloat3.BurstTestFunction); + var args = new Random_NextFloat3.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class Random_NextFloat4 + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float4* f; + + public void Init() + { + rng = new Random(1); + f = (float4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + f[i] = new float4(0.0f); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(f, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.f[i] = args.rng.NextFloat4(); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void Random_NextFloat4_mono() + { + Random_NextFloat4.TestFunction testFunction = Random_NextFloat4.MonoTestFunction; + var args = new Random_NextFloat4.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void Random_NextFloat4_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(Random_NextFloat4.BurstTestFunction); + var args = new Random_NextFloat4.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class Random_NextDouble + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public double* f; + + public void Init() + { + rng = new Random(1); + f = (double*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + f[i] = 0.0; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(f, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.f[i] = args.rng.NextDouble(); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void Random_NextDouble_mono() + { + Random_NextDouble.TestFunction testFunction = Random_NextDouble.MonoTestFunction; + var args = new Random_NextDouble.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void Random_NextDouble_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(Random_NextDouble.BurstTestFunction); + var args = new Random_NextDouble.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class Random_NextDouble2 + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public double2* f; + + public void Init() + { + rng = new Random(1); + f = (double2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + f[i] = new double2(0.0); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(f, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.f[i] = args.rng.NextDouble2(); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void Random_NextDouble2_mono() + { + Random_NextDouble2.TestFunction testFunction = Random_NextDouble2.MonoTestFunction; + var args = new Random_NextDouble2.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void Random_NextDouble2_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(Random_NextDouble2.BurstTestFunction); + var args = new Random_NextDouble2.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class Random_NextDouble3 + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public double3* f; + + public void Init() + { + rng = new Random(1); + f = (double3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + f[i] = new double3(0.0); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(f, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.f[i] = args.rng.NextDouble3(); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void Random_NextDouble3_mono() + { + Random_NextDouble3.TestFunction testFunction = Random_NextDouble3.MonoTestFunction; + var args = new Random_NextDouble3.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void Random_NextDouble3_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(Random_NextDouble3.BurstTestFunction); + var args = new Random_NextDouble3.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class Random_NextDouble4 + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public double4* f; + + public void Init() + { + rng = new Random(1); + f = (double4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + f[i] = new double4(0.0); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(f, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.f[i] = args.rng.NextDouble4(); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void Random_NextDouble4_mono() + { + Random_NextDouble4.TestFunction testFunction = Random_NextDouble4.MonoTestFunction; + var args = new Random_NextDouble4.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void Random_NextDouble4_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(Random_NextDouble4.BurstTestFunction); + var args = new Random_NextDouble4.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + } +} diff --git a/src/Unity.Mathematics.PerformanceTests/TestRandom.gen.cs.meta b/src/Unity.Mathematics.PerformanceTests/TestRandom.gen.cs.meta new file mode 100644 index 00000000..342e21d5 --- /dev/null +++ b/src/Unity.Mathematics.PerformanceTests/TestRandom.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 958c24f43795843d2b942516825b5c22 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics.PerformanceTests/TestRotation.gen.cs b/src/Unity.Mathematics.PerformanceTests/TestRotation.gen.cs new file mode 100644 index 00000000..81d0a164 --- /dev/null +++ b/src/Unity.Mathematics.PerformanceTests/TestRotation.gen.cs @@ -0,0 +1,714 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using NUnit.Framework; +using Unity.Collections; +using Unity.Collections.LowLevel.Unsafe; +using Unity.PerformanceTesting; +using Unity.Mathematics.Geometry; +using Unity.Burst; + +namespace Unity.Mathematics.PerformanceTests +{ + partial class TestRotation + { + [BurstCompile(CompileSynchronously = true)] + public unsafe class float4x4_EulerXYZ + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float3* v; + public float4x4* m; + + public void Init() + { + rng = new Random(1); + v = (float3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new float3(1.0f); + } + + m = (float4x4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + m[i] = float4x4.identity; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + UnsafeUtility.Free(m, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.m[i] = float4x4.EulerXYZ(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void float4x4_EulerXYZ_mono() + { + float4x4_EulerXYZ.TestFunction testFunction = float4x4_EulerXYZ.MonoTestFunction; + var args = new float4x4_EulerXYZ.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void float4x4_EulerXYZ_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(float4x4_EulerXYZ.BurstTestFunction); + var args = new float4x4_EulerXYZ.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class float3x3_EulerXYZ + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float3* v; + public float3x3* m; + + public void Init() + { + rng = new Random(1); + v = (float3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = new float3(1.0f); + } + + m = (float3x3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + m[i] = float3x3.identity; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + UnsafeUtility.Free(m, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.m[i] = float3x3.EulerXYZ(args.v[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void float3x3_EulerXYZ_mono() + { + float3x3_EulerXYZ.TestFunction testFunction = float3x3_EulerXYZ.MonoTestFunction; + var args = new float3x3_EulerXYZ.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void float3x3_EulerXYZ_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(float3x3_EulerXYZ.BurstTestFunction); + var args = new float3x3_EulerXYZ.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class float4x4_AxisAngle + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float3* v; + public float4x4* m; + public float* angle; + + public void Init() + { + rng = new Random(1); + v = (float3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = math.normalize(new float3(1.0f)); + } + + m = (float4x4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + m[i] = float4x4.identity; + } + + angle = (float*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + angle[i] = 1.0f; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + UnsafeUtility.Free(m, Allocator.Persistent); + UnsafeUtility.Free(angle, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.m[i] = float4x4.AxisAngle(args.v[i], args.angle[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void float4x4_AxisAngle_mono() + { + float4x4_AxisAngle.TestFunction testFunction = float4x4_AxisAngle.MonoTestFunction; + var args = new float4x4_AxisAngle.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void float4x4_AxisAngle_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(float4x4_AxisAngle.BurstTestFunction); + var args = new float4x4_AxisAngle.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class float3x3_AxisAngle + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float3* v; + public float3x3* m; + public float* angle; + + public void Init() + { + rng = new Random(1); + v = (float3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v[i] = math.normalize(new float3(1.0f)); + } + + m = (float3x3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + m[i] = float3x3.identity; + } + + angle = (float*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + angle[i] = 1.0f; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v, Allocator.Persistent); + UnsafeUtility.Free(m, Allocator.Persistent); + UnsafeUtility.Free(angle, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.m[i] = float3x3.AxisAngle(args.v[i], args.angle[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void float3x3_AxisAngle_mono() + { + float3x3_AxisAngle.TestFunction testFunction = float3x3_AxisAngle.MonoTestFunction; + var args = new float3x3_AxisAngle.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void float3x3_AxisAngle_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(float3x3_AxisAngle.BurstTestFunction); + var args = new float3x3_AxisAngle.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class float3x3_LookRotation + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float3* forward; + public float3* up; + public float3x3* m; + + public void Init() + { + rng = new Random(1); + forward = (float3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + forward[i] = math.normalize(new float3(1.0f)); + } + + up = (float3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + up[i] = math.normalize(new float3(0.0f, 1.0f, 0.0f)); + } + + m = (float3x3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + m[i] = float3x3.identity; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(forward, Allocator.Persistent); + UnsafeUtility.Free(up, Allocator.Persistent); + UnsafeUtility.Free(m, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.m[i] = float3x3.LookRotation(args.forward[i], args.up[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void float3x3_LookRotation_mono() + { + float3x3_LookRotation.TestFunction testFunction = float3x3_LookRotation.MonoTestFunction; + var args = new float3x3_LookRotation.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void float3x3_LookRotation_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(float3x3_LookRotation.BurstTestFunction); + var args = new float3x3_LookRotation.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class float3x3_LookRotationSafe + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float3* forward; + public float3* up; + public float3x3* m; + + public void Init() + { + rng = new Random(1); + forward = (float3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + forward[i] = math.normalize(new float3(1.0f)); + } + + up = (float3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + up[i] = math.normalize(new float3(0.0f, 1.0f, 0.0f)); + } + + m = (float3x3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + m[i] = float3x3.identity; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(forward, Allocator.Persistent); + UnsafeUtility.Free(up, Allocator.Persistent); + UnsafeUtility.Free(m, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.m[i] = float3x3.LookRotationSafe(args.forward[i], args.up[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void float3x3_LookRotationSafe_mono() + { + float3x3_LookRotationSafe.TestFunction testFunction = float3x3_LookRotationSafe.MonoTestFunction; + var args = new float3x3_LookRotationSafe.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void float3x3_LookRotationSafe_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(float3x3_LookRotationSafe.BurstTestFunction); + var args = new float3x3_LookRotationSafe.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class float4x4_LookAt + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float3* eye; + public float3* target; + public float3* up; + public float4x4* m; + + public void Init() + { + rng = new Random(1); + eye = (float3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + eye[i] = math.normalize(new float3(1.0f)); + } + + target = (float3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + target[i] = math.normalize(new float3(0.0f, 1.0f, 0.0f)); + } + + up = (float3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + up[i] = math.normalize(new float3(-5.0f, 2.0f, 3.0f)); + } + + m = (float4x4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + m[i] = float4x4.identity; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(eye, Allocator.Persistent); + UnsafeUtility.Free(target, Allocator.Persistent); + UnsafeUtility.Free(up, Allocator.Persistent); + UnsafeUtility.Free(m, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.m[i] = float4x4.LookAt(args.eye[i], args.target[i], args.up[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void float4x4_LookAt_mono() + { + float4x4_LookAt.TestFunction testFunction = float4x4_LookAt.MonoTestFunction; + var args = new float4x4_LookAt.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void float4x4_LookAt_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(float4x4_LookAt.BurstTestFunction); + var args = new float4x4_LookAt.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + } +} diff --git a/src/Unity.Mathematics.PerformanceTests/TestRotation.gen.cs.meta b/src/Unity.Mathematics.PerformanceTests/TestRotation.gen.cs.meta new file mode 100644 index 00000000..fe5377bb --- /dev/null +++ b/src/Unity.Mathematics.PerformanceTests/TestRotation.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d9b7e7c042bdc486c94449470a4c0d44 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics.PerformanceTests/TestShuffle.gen.cs b/src/Unity.Mathematics.PerformanceTests/TestShuffle.gen.cs new file mode 100644 index 00000000..03742fd4 --- /dev/null +++ b/src/Unity.Mathematics.PerformanceTests/TestShuffle.gen.cs @@ -0,0 +1,322 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using NUnit.Framework; +using Unity.Collections; +using Unity.Collections.LowLevel.Unsafe; +using Unity.PerformanceTesting; +using Unity.Mathematics.Geometry; +using Unity.Burst; + +namespace Unity.Mathematics.PerformanceTests +{ + partial class TestShuffle + { + [BurstCompile(CompileSynchronously = true)] + public unsafe class float2_shuffle + { + public const int iterations = 100000; + + public struct Arguments : IDisposable + { + public Random rng; + public float2* v1; + public float2* v2; + public float2* result; + + public void Init() + { + rng = new Random(1); + v1 = (float2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v1[i] = new float2(1.0f); + } + + v2 = (float2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v2[i] = new float2(2.0f); + } + + result = (float2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + result[i] = new float2(1.0f); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v1, Allocator.Persistent); + UnsafeUtility.Free(v2, Allocator.Persistent); + UnsafeUtility.Free(result, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.result[i] = math.shuffle(args.v1[i], args.v2[i], math.ShuffleComponent.RightX, math.ShuffleComponent.LeftY); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void float2_shuffle_mono() + { + float2_shuffle.TestFunction testFunction = float2_shuffle.MonoTestFunction; + var args = new float2_shuffle.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void float2_shuffle_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(float2_shuffle.BurstTestFunction); + var args = new float2_shuffle.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class float3_shuffle + { + public const int iterations = 100000; + + public struct Arguments : IDisposable + { + public Random rng; + public float3* v1; + public float3* v2; + public float3* result; + + public void Init() + { + rng = new Random(1); + v1 = (float3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v1[i] = new float3(1.0f); + } + + v2 = (float3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v2[i] = new float3(2.0f); + } + + result = (float3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + result[i] = new float3(1.0f); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v1, Allocator.Persistent); + UnsafeUtility.Free(v2, Allocator.Persistent); + UnsafeUtility.Free(result, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.result[i] = math.shuffle(args.v1[i], args.v2[i], math.ShuffleComponent.RightX, math.ShuffleComponent.LeftZ, math.ShuffleComponent.LeftX); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void float3_shuffle_mono() + { + float3_shuffle.TestFunction testFunction = float3_shuffle.MonoTestFunction; + var args = new float3_shuffle.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void float3_shuffle_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(float3_shuffle.BurstTestFunction); + var args = new float3_shuffle.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class float4_shuffle + { + public const int iterations = 100000; + + public struct Arguments : IDisposable + { + public Random rng; + public float4* v1; + public float4* v2; + public float4* result; + + public void Init() + { + rng = new Random(1); + v1 = (float4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v1[i] = new float4(1.0f); + } + + v2 = (float4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + v2[i] = new float4(2.0f); + } + + result = (float4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + result[i] = new float4(1.0f); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(v1, Allocator.Persistent); + UnsafeUtility.Free(v2, Allocator.Persistent); + UnsafeUtility.Free(result, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.result[i] = math.shuffle(args.v1[i], args.v2[i], math.ShuffleComponent.RightX, math.ShuffleComponent.LeftZ, math.ShuffleComponent.LeftX, math.ShuffleComponent.RightY); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void float4_shuffle_mono() + { + float4_shuffle.TestFunction testFunction = float4_shuffle.MonoTestFunction; + var args = new float4_shuffle.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void float4_shuffle_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(float4_shuffle.BurstTestFunction); + var args = new float4_shuffle.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + } +} diff --git a/src/Unity.Mathematics.PerformanceTests/TestShuffle.gen.cs.meta b/src/Unity.Mathematics.PerformanceTests/TestShuffle.gen.cs.meta new file mode 100644 index 00000000..9aa3da94 --- /dev/null +++ b/src/Unity.Mathematics.PerformanceTests/TestShuffle.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b94b2cadc86cf49dc970f63ae341b9a7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics.PerformanceTests/TestTranspose.gen.cs b/src/Unity.Mathematics.PerformanceTests/TestTranspose.gen.cs new file mode 100644 index 00000000..53198cd8 --- /dev/null +++ b/src/Unity.Mathematics.PerformanceTests/TestTranspose.gen.cs @@ -0,0 +1,526 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using NUnit.Framework; +using Unity.Collections; +using Unity.Collections.LowLevel.Unsafe; +using Unity.PerformanceTesting; +using Unity.Mathematics.Geometry; +using Unity.Burst; + +namespace Unity.Mathematics.PerformanceTests +{ + partial class TestTranspose + { + [BurstCompile(CompileSynchronously = true)] + public unsafe class transpose_float4x4 + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float4x4* m; + + public void Init() + { + rng = new Random(1); + m = (float4x4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + m[i] = float4x4.identity; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(m, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.m[i] = math.transpose(args.m[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void transpose_float4x4_mono() + { + transpose_float4x4.TestFunction testFunction = transpose_float4x4.MonoTestFunction; + var args = new transpose_float4x4.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void transpose_float4x4_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(transpose_float4x4.BurstTestFunction); + var args = new transpose_float4x4.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class transpose_float3x3 + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float3x3* m; + + public void Init() + { + rng = new Random(1); + m = (float3x3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + m[i] = float3x3.identity; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(m, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.m[i] = math.transpose(args.m[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void transpose_float3x3_mono() + { + transpose_float3x3.TestFunction testFunction = transpose_float3x3.MonoTestFunction; + var args = new transpose_float3x3.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void transpose_float3x3_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(transpose_float3x3.BurstTestFunction); + var args = new transpose_float3x3.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class transpose_float2x2 + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float2x2* m; + + public void Init() + { + rng = new Random(1); + m = (float2x2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + m[i] = float2x2.identity; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(m, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.m[i] = math.transpose(args.m[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void transpose_float2x2_mono() + { + transpose_float2x2.TestFunction testFunction = transpose_float2x2.MonoTestFunction; + var args = new transpose_float2x2.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void transpose_float2x2_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(transpose_float2x2.BurstTestFunction); + var args = new transpose_float2x2.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class transpose_double4x4 + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public double4x4* m; + + public void Init() + { + rng = new Random(1); + m = (double4x4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + m[i] = double4x4.identity; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(m, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.m[i] = math.transpose(args.m[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void transpose_double4x4_mono() + { + transpose_double4x4.TestFunction testFunction = transpose_double4x4.MonoTestFunction; + var args = new transpose_double4x4.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void transpose_double4x4_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(transpose_double4x4.BurstTestFunction); + var args = new transpose_double4x4.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class transpose_double3x3 + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public double3x3* m; + + public void Init() + { + rng = new Random(1); + m = (double3x3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + m[i] = double3x3.identity; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(m, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.m[i] = math.transpose(args.m[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void transpose_double3x3_mono() + { + transpose_double3x3.TestFunction testFunction = transpose_double3x3.MonoTestFunction; + var args = new transpose_double3x3.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void transpose_double3x3_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(transpose_double3x3.BurstTestFunction); + var args = new transpose_double3x3.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class transpose_double2x2 + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public double2x2* m; + + public void Init() + { + rng = new Random(1); + m = (double2x2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + m[i] = double2x2.identity; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(m, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + args.m[i] = math.transpose(args.m[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void transpose_double2x2_mono() + { + transpose_double2x2.TestFunction testFunction = transpose_double2x2.MonoTestFunction; + var args = new transpose_double2x2.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void transpose_double2x2_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(transpose_double2x2.BurstTestFunction); + var args = new transpose_double2x2.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + } +} diff --git a/src/Unity.Mathematics.PerformanceTests/TestTranspose.gen.cs.meta b/src/Unity.Mathematics.PerformanceTests/TestTranspose.gen.cs.meta new file mode 100644 index 00000000..4c21eba9 --- /dev/null +++ b/src/Unity.Mathematics.PerformanceTests/TestTranspose.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2b5fd7988f6e2411aa300b801c75b65d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics.PerformanceTests/TestTrig.gen.cs b/src/Unity.Mathematics.PerformanceTests/TestTrig.gen.cs new file mode 100644 index 00000000..ba2b8ab5 --- /dev/null +++ b/src/Unity.Mathematics.PerformanceTests/TestTrig.gen.cs @@ -0,0 +1,390 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using NUnit.Framework; +using Unity.Collections; +using Unity.Collections.LowLevel.Unsafe; +using Unity.PerformanceTesting; +using Unity.Mathematics.Geometry; +using Unity.Burst; + +namespace Unity.Mathematics.PerformanceTests +{ + partial class TestTrig + { + [BurstCompile(CompileSynchronously = true)] + public unsafe class float_sincos + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float* sin; + public float* cos; + + public void Init() + { + rng = new Random(1); + sin = (float*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + sin[i] = 0.0f; + } + + cos = (float*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + cos[i] = 1.0f; + } + + } + + public void Dispose() + { + UnsafeUtility.Free(sin, Allocator.Persistent); + UnsafeUtility.Free(cos, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + math.sincos(args.sin[i], out args.sin[i], out args.cos[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void float_sincos_mono() + { + float_sincos.TestFunction testFunction = float_sincos.MonoTestFunction; + var args = new float_sincos.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void float_sincos_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(float_sincos.BurstTestFunction); + var args = new float_sincos.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class float2_sincos + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float2* sin; + public float2* cos; + + public void Init() + { + rng = new Random(1); + sin = (float2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + sin[i] = new float2(0.0f); + } + + cos = (float2*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + cos[i] = new float2(1.0f); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(sin, Allocator.Persistent); + UnsafeUtility.Free(cos, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + math.sincos(args.sin[i], out args.sin[i], out args.cos[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void float2_sincos_mono() + { + float2_sincos.TestFunction testFunction = float2_sincos.MonoTestFunction; + var args = new float2_sincos.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void float2_sincos_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(float2_sincos.BurstTestFunction); + var args = new float2_sincos.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class float3_sincos + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float3* sin; + public float3* cos; + + public void Init() + { + rng = new Random(1); + sin = (float3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + sin[i] = new float3(0.0f); + } + + cos = (float3*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + cos[i] = new float3(1.0f); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(sin, Allocator.Persistent); + UnsafeUtility.Free(cos, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + math.sincos(args.sin[i], out args.sin[i], out args.cos[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void float3_sincos_mono() + { + float3_sincos.TestFunction testFunction = float3_sincos.MonoTestFunction; + var args = new float3_sincos.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void float3_sincos_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(float3_sincos.BurstTestFunction); + var args = new float3_sincos.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + [BurstCompile(CompileSynchronously = true)] + public unsafe class float4_sincos + { + public const int iterations = 10000; + + public struct Arguments : IDisposable + { + public Random rng; + public float4* sin; + public float4* cos; + + public void Init() + { + rng = new Random(1); + sin = (float4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + sin[i] = new float4(0.0f); + } + + cos = (float4*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf() * iterations, UnsafeUtility.AlignOf(), Allocator.Persistent); + for (int i = 0; i < iterations; ++i) + { + cos[i] = new float4(1.0f); + } + + } + + public void Dispose() + { + UnsafeUtility.Free(sin, Allocator.Persistent); + UnsafeUtility.Free(cos, Allocator.Persistent); + } + } + + public static void CommonTestFunction(ref Arguments args) + { + for (int i = 0; i < iterations; ++i) + { + math.sincos(args.sin[i], out args.sin[i], out args.cos[i]); + } + } + + public static void MonoTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + [BurstCompile(CompileSynchronously = true)] + public static void BurstTestFunction(ref Arguments args) + { + CommonTestFunction(ref args); + } + + public delegate void TestFunction(ref Arguments args); + } + + [Test, Performance] + public void float4_sincos_mono() + { + float4_sincos.TestFunction testFunction = float4_sincos.MonoTestFunction; + var args = new float4_sincos.Arguments(); + args.Init(); + + var monoSampleGroup = new SampleGroup("Mono", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(monoSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + + [Test, Performance] + public void float4_sincos_burst() + { + FunctionPointer testFunction = BurstCompiler.CompileFunctionPointer(float4_sincos.BurstTestFunction); + var args = new float4_sincos.Arguments(); + args.Init(); + + var burstSampleGroup = new SampleGroup("Burst", SampleUnit.Microsecond); Measure.Method(() => + { + testFunction.Invoke(ref args); + }) + .SampleGroup(burstSampleGroup) + .WarmupCount(1) + .MeasurementCount(10) + .Run(); + args.Dispose(); + } + } +} diff --git a/src/Unity.Mathematics.PerformanceTests/TestTrig.gen.cs.meta b/src/Unity.Mathematics.PerformanceTests/TestTrig.gen.cs.meta new file mode 100644 index 00000000..89c60515 --- /dev/null +++ b/src/Unity.Mathematics.PerformanceTests/TestTrig.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 27be748f9df5f44e6a1fd99b5c41eb61 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics.PerformanceTests/Unity.Mathematics.PerformanceTests.asmdef b/src/Unity.Mathematics.PerformanceTests/Unity.Mathematics.PerformanceTests.asmdef new file mode 100644 index 00000000..3572dc1e --- /dev/null +++ b/src/Unity.Mathematics.PerformanceTests/Unity.Mathematics.PerformanceTests.asmdef @@ -0,0 +1,23 @@ +{ + "name": "Unity.Mathematics.PerformanceTests", + "references": [ + "Unity.Mathematics", + "Unity.PerformanceTesting", + "Unity.Burst" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": true, + "overrideReferences": true, + "precompiledReferences": [ + "nunit.framework.dll" + ], + "autoReferenced": true, + "defineConstraints": [ + "UNITY_INCLUDE_TESTS" + ], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/src/Unity.Mathematics.PerformanceTests/Unity.Mathematics.PerformanceTests.asmdef.meta b/src/Unity.Mathematics.PerformanceTests/Unity.Mathematics.PerformanceTests.asmdef.meta new file mode 100644 index 00000000..1000c874 --- /dev/null +++ b/src/Unity.Mathematics.PerformanceTests/Unity.Mathematics.PerformanceTests.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 00f84beb5fba74ccf8ddf7f5a048b3c0 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics.Tests/Unity.Mathematics.Tests.csproj b/src/Unity.Mathematics.PerformanceTests/Unity.Mathematics.PerformanceTests.csproj similarity index 60% rename from src/Unity.Mathematics.Tests/Unity.Mathematics.Tests.csproj rename to src/Unity.Mathematics.PerformanceTests/Unity.Mathematics.PerformanceTests.csproj index 3eddef8b..01d2faf5 100644 --- a/src/Unity.Mathematics.Tests/Unity.Mathematics.Tests.csproj +++ b/src/Unity.Mathematics.PerformanceTests/Unity.Mathematics.PerformanceTests.csproj @@ -1,18 +1,19 @@  - + Debug AnyCPU - {2E7C74D3-42F1-482F-8BB7-E199D9E3B412} + {C3FE0F99-88C7-4E54-96A0-B65A591B7020} Library Properties - Unity.Mathematics.Tests - Unity.Mathematics.Tests - v4.5.2 + Unity.Mathematics.PerformanceTests + Unity.Mathematics.PerformanceTests + v4.7.2 512 + AnyCPU true full false @@ -22,6 +23,7 @@ 4 + AnyCPU pdbonly true bin\Release\ @@ -30,28 +32,21 @@ 4 - - ..\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll - True - - - - - - + + + + - + - - - - - - + + + + @@ -59,15 +54,12 @@ Unity.Mathematics - - - + Other similar extension points exist, see Microsoft.Common.targets. + + + + + --> \ No newline at end of file diff --git a/src/Unity.Mathematics.PerformanceTests/Unity.Mathematics.PerformanceTests.csproj.meta b/src/Unity.Mathematics.PerformanceTests/Unity.Mathematics.PerformanceTests.csproj.meta new file mode 100644 index 00000000..178e830f --- /dev/null +++ b/src/Unity.Mathematics.PerformanceTests/Unity.Mathematics.PerformanceTests.csproj.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 83a70727fa33a914d9c1049386e82be7 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics.Shaders/hlsl.cs b/src/Unity.Mathematics.Shaders/hlsl.cs deleted file mode 100644 index 864eb7c4..00000000 --- a/src/Unity.Mathematics.Shaders/hlsl.cs +++ /dev/null @@ -1,107 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace Unity.Mathematics.Shaders -{ - public static class hlsl - { - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float ddx(float x) { throw new System.NotImplementedException(); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float2 ddx(float2 x) { throw new System.NotImplementedException(); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float3 ddx(float3 x) { throw new System.NotImplementedException(); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float4 ddx(float4 x) { throw new System.NotImplementedException(); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float2x2 ddx(float2x2 x) { throw new System.NotImplementedException(); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float3x3 ddx(float3x3 x) { throw new System.NotImplementedException(); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float4x4 ddx(float4x4 x) { throw new System.NotImplementedException(); } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float ddx_fine(float x) { throw new System.NotImplementedException(); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float2 ddx_fine(float2 x) { throw new System.NotImplementedException(); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float3 ddx_fine(float3 x) { throw new System.NotImplementedException(); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float4 ddx_fine(float4 x) { throw new System.NotImplementedException(); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float2x2 ddx_fine(float2x2 x) { throw new System.NotImplementedException(); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float3x3 ddx_fine(float3x3 x) { throw new System.NotImplementedException(); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float4x4 ddx_fine(float4x4 x) { throw new System.NotImplementedException(); } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float ddx_coarse(float x) { throw new System.NotImplementedException(); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float2 ddx_coarse(float2 x) { throw new System.NotImplementedException(); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float3 ddx_coarse(float3 x) { throw new System.NotImplementedException(); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float4 ddx_coarse(float4 x) { throw new System.NotImplementedException(); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float2x2 ddx_coarse(float2x2 x) { throw new System.NotImplementedException(); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float3x3 ddx_coarse(float3x3 x) { throw new System.NotImplementedException(); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float4x4 ddx_coarse(float4x4 x) { throw new System.NotImplementedException(); } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float ddy(float x) { throw new System.NotImplementedException(); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float2 ddy(float2 x) { throw new System.NotImplementedException(); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float3 ddy(float3 x) { throw new System.NotImplementedException(); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float4 ddy(float4 x) { throw new System.NotImplementedException(); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float2x2 ddy(float2x2 x) { throw new System.NotImplementedException(); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float3x3 ddy(float3x3 x) { throw new System.NotImplementedException(); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float4x4 ddy(float4x4 x) { throw new System.NotImplementedException(); } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float ddy_fine(float x) { throw new System.NotImplementedException(); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float2 ddy_fine(float2 x) { throw new System.NotImplementedException(); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float3 ddy_fine(float3 x) { throw new System.NotImplementedException(); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float4 ddy_fine(float4 x) { throw new System.NotImplementedException(); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float2x2 ddy_fine(float2x2 x) { throw new System.NotImplementedException(); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float3x3 ddy_fine(float3x3 x) { throw new System.NotImplementedException(); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float4x4 ddy_fine(float4x4 x) { throw new System.NotImplementedException(); } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float ddy_coarse(float x) { throw new System.NotImplementedException(); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float2 ddy_coarse(float2 x) { throw new System.NotImplementedException(); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float3 ddy_coarse(float3 x) { throw new System.NotImplementedException(); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float4 ddy_coarse(float4 x) { throw new System.NotImplementedException(); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float2x2 ddy_coarse(float2x2 x) { throw new System.NotImplementedException(); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float3x3 ddy_coarse(float3x3 x) { throw new System.NotImplementedException(); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float4x4 ddy_coarse(float4x4 x) { throw new System.NotImplementedException(); } - - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static void discard() { } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static void clip(float i) { } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float3 faceforward(float3 n, float3 i, float3 ng) { return math.cross(-n, math.sign(math.dot(i, ng))); } - } -} \ No newline at end of file diff --git a/src/Unity.Mathematics.Tests/TestBool1.cs b/src/Unity.Mathematics.Tests/TestBool1.cs deleted file mode 100644 index 1121d121..00000000 --- a/src/Unity.Mathematics.Tests/TestBool1.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using NUnit.Framework; - -namespace Unity.Mathematics.Tests -{ - [TestFixture] - class TestBool1 - { - [Test] - public void bool1_Constructor_CreateEqualObjects_ReturnSameValue( - [Values(false, true)] bool value) - { - bool1 firstValue = new bool1(value); - bool1 secondValue = new bool1(value); - Assert.AreEqual(firstValue, secondValue); - Assert.AreNotSame(firstValue, secondValue); - } - - [Test] - public void bool1_Constructor_CreateDifferentObjects_ReturnDifferentValue( - [Values(false, true)] bool value) - { - bool1 firstValue = new bool1(value); - bool1 secondValue = new bool1(!value); - Assert.AreNotEqual(firstValue, secondValue); - Assert.AreNotSame(firstValue, secondValue); - } - - [Test] - public void bool1_OperatorBool_CompareWithOriginalValue_ReturnOriginalValue( - [Values(false, true)] bool value) - { - bool1 testValue = new bool1(value); - Assert.AreEqual(value, (bool)testValue); - } - - [Test] - public void bool1_OperatorBool1_CompareCastBoolWithObject_ReturnSameValue( - [Values(false, true)] bool value) - { - bool1 testValue = new bool1(value); - Assert.AreEqual((bool1)value, testValue); - } - - [Test] - public void bool1_ToString_PrintValue_SameStringAsNativeType( - [Values(false, true)] bool value) - { - bool1 testValue = new bool1(value); - Assert.AreEqual(testValue.ToString(), value.ToString()); - } - } -} diff --git a/src/Unity.Mathematics.Tests/TestBool2.cs b/src/Unity.Mathematics.Tests/TestBool2.cs deleted file mode 100644 index af7612a2..00000000 --- a/src/Unity.Mathematics.Tests/TestBool2.cs +++ /dev/null @@ -1,549 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using NUnit.Framework; - -namespace Unity.Mathematics.Tests -{ - [TestFixture] - class TestBool2 - { - [Test] - public void bool2_ConstructorOneArgument_CreateNewObject_CheckAgainstOriginalValues( - [Values(false, true)] bool originalValue) - { - bool2 testValue = new bool2(originalValue); - Assert.AreEqual(testValue.x, (bool1)originalValue); - Assert.AreEqual(testValue.y, (bool1)originalValue); - } - - [Test] - public void bool2_ConstructorTwoArguments_CreateNewObject_CheckAgainstOriginalValues( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument) - { - bool2 testValue = new bool2(firstArgument, secondArgument); - Assert.AreEqual(testValue.x, (bool1)firstArgument); - Assert.AreEqual(testValue.y, (bool1)secondArgument); - } - - [Test] - public void bool2_OperatorBool2_CompareCastBoolWithObject_ReturnSameValue( - [Values(false, true)] bool originalValue) - { - bool2 testValue = new bool2(originalValue); - Assert.AreEqual((bool2)originalValue, testValue); - } - - [Test] - public void bool2_ToString_PrintPair_ReturnExpectedFormat( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument) - { - string expectedString = "bool2(" + firstArgument + ", " + secondArgument + ")"; - bool2 testValue = new bool2(firstArgument, secondArgument); - Assert.AreEqual(testValue.ToString(), expectedString); - } - - [Test] - public void bool2_OperatorEqual_CompareTwoBool2_AreSame( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument) - { - bool2 firstValue = new bool2(firstArgument, secondArgument); - bool2 secondValue = new bool2(firstArgument, secondArgument); - - Assert.AreEqual(new bool2(true), firstValue == secondValue); - } - - [Test] - public void bool2_OperatorEqual_CompareTwoBool2_XIsDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument) - { - bool2 firstValue = new bool2(firstArgument, secondArgument); - bool2 secondValue = new bool2(!firstArgument, secondArgument); - - Assert.AreEqual(new bool2(false, true), firstValue == secondValue); - } - - [Test] - public void bool2_OperatorEqual_CompareTwoBool2_YIsDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument) - { - bool2 firstValue = new bool2(firstArgument, secondArgument); - bool2 secondValue = new bool2(firstArgument, !secondArgument); - - Assert.AreEqual(new bool2(true, false), firstValue == secondValue); - } - - [Test] - public void bool2_OperatorEqual_CompareTwoBool2_XYAreDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument) - { - bool2 firstValue = new bool2(firstArgument, secondArgument); - bool2 secondValue = new bool2(!firstArgument, !secondArgument); - - Assert.AreEqual(new bool2(false), firstValue == secondValue); - } - - [Test] - public void bool2_OperatorEqual_CompareBoolWithBool2_AreSame( - [Values(false, true)] bool firstArgument) - { - bool2 firstValue = new bool2(firstArgument); - - Assert.AreEqual(new bool2(true), firstValue == firstArgument); - Assert.AreEqual(new bool2(true), firstArgument == firstValue); - } - - [Test] - public void bool2_OperatorEqual_CompareBoolWithBool2_AreDifferent( - [Values(false, true)] bool firstArgument) - { - bool2 firstValue = new bool2(!firstArgument); - - Assert.AreEqual(new bool2(false), firstValue == firstArgument); - Assert.AreEqual(new bool2(false), firstArgument == firstValue); - } - - [Test] - public void bool2_OperatorNotEqual_CompareTwoBool2_AreSame( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument) - { - bool2 firstValue = new bool2(firstArgument, secondArgument); - bool2 secondValue = new bool2(firstArgument, secondArgument); - - Assert.AreEqual(new bool2(false), firstValue != secondValue); - } - - [Test] - public void bool2_OperatorNotEqual_CompareTwoBool2_XIsDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument) - { - bool2 firstValue = new bool2(firstArgument, secondArgument); - bool2 secondValue = new bool2(!firstArgument, secondArgument); - - Assert.AreEqual(new bool2(true, false), firstValue != secondValue); - } - - [Test] - public void bool2_OperatorNotEqual_CompareTwoBool2_YIsDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument) - { - bool2 firstValue = new bool2(firstArgument, secondArgument); - bool2 secondValue = new bool2(firstArgument, !secondArgument); - - Assert.AreEqual(new bool2(false, true), firstValue != secondValue); - } - - [Test] - public void bool2_OperatorNotEqual_CompareTwoBool2_XYAreDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument) - { - bool2 firstValue = new bool2(firstArgument, secondArgument); - bool2 secondValue = new bool2(!firstArgument, !secondArgument); - - Assert.AreEqual(new bool2(true), firstValue != secondValue); - } - - [Test] - public void bool2_OperatorNotEqual_CompareBoolWithBool2_AreSame( - [Values(false, true)] bool firstArgument) - { - bool2 firstValue = new bool2(firstArgument); - - Assert.AreEqual(new bool2(false), firstValue != firstArgument); - Assert.AreEqual(new bool2(false), firstArgument != firstValue); - } - - [Test] - public void bool2_OperatorNotEqual_CompareBoolWithBool2_AreDifferent( - [Values(false, true)] bool firstArgument) - { - bool2 firstValue = new bool2(!firstArgument); - - Assert.AreEqual(new bool2(true), firstValue != firstArgument); - Assert.AreEqual(new bool2(true), firstArgument != firstValue); - } - - [Test] - public void bool2_OperatorAND_BothBool2_ReturnFalse( - [Values(false, true)] bool argument) - { - bool2 firstValue = new bool2(argument); - bool2 zeroValue = new bool2(false); - - Assert.AreEqual(new bool2(false), firstValue & zeroValue); - } - - [Test] - public void bool2_OperatorAND_BothBool2_ReturnTrue() - { - bool2 firstValue = new bool2(true); - bool2 secondValue = new bool2(true); - - Assert.AreEqual(new bool2(true), firstValue & secondValue); - } - - [Test] - public void bool2_OperatorAND_BoolANDBool2_ReturnFalse( - [Values(false, true)] bool argument) - { - bool2 firstValue = new bool2(argument); - - Assert.AreEqual(new bool2(false), firstValue & false); - Assert.AreEqual(new bool2(false), false & firstValue); - } - - [Test] - public void bool2_OperatorAND_BoolANDBool2_ReturnTrue() - { - bool2 firstValue = new bool2(true); - - Assert.AreEqual(new bool2(true), firstValue & true); - Assert.AreEqual(new bool2(true), true & firstValue); - } - - [Test] - public void bool2_OperatorOR_BothBool2_ReturnFalse() - { - bool2 firstValue = new bool2(false); - bool2 secondValue = new bool2(false); - - Assert.AreEqual(new bool2(false), firstValue | secondValue); - } - - [Test] - public void bool2_OperatorOR_BothBool2_ReturnTrue( - [Values(false, true)] bool argument) - { - bool2 firstValue = new bool2(argument); - bool2 secondValue = new bool2(true); - - Assert.AreEqual(new bool2(true), firstValue | secondValue); - } - - [Test] - public void bool2_OperatorOR_BoolORBool2_ReturnTrue( - [Values(false, true)] bool argument) - { - bool2 firstValue = new bool2(argument); - - Assert.AreEqual(new bool2(true), firstValue | true); - Assert.AreEqual(new bool2(true), true | firstValue); - } - - [Test] - public void bool2_OperatorOR_BoolORBool2_ReturnFalse() - { - bool2 firstValue = new bool2(false); - - Assert.AreEqual(new bool2(false), firstValue | false); - Assert.AreEqual(new bool2(false), false | firstValue); - } - - [Test] - public void bool2_OperatorXOR_BothBool2_ReturnTrue( - [Values(false, true)] bool argument) - { - bool2 firstValue = new bool2(argument); - bool2 secondValue = new bool2(!argument); - - Assert.AreEqual(new bool2(true), firstValue ^ secondValue); - } - - [Test] - public void bool2_OperatorXOR_BothBool2_ReturnFalse( - [Values(false, true)] bool argument) - { - bool2 firstValue = new bool2(argument); - bool2 secondValue = new bool2(argument); - - Assert.AreEqual(new bool2(false), firstValue ^ secondValue); - } - - [Test] - public void bool2_OperatorXOR_BoolORBool2_ReturnTrue( - [Values(false, true)] bool argument) - { - bool2 firstValue = new bool2(argument); - bool notArgument = !argument; - - Assert.AreEqual(new bool2(true), firstValue ^ notArgument); - Assert.AreEqual(new bool2(true), notArgument ^ firstValue); - } - - [Test] - public void bool2_OperatorXOR_BoolORBool2_ReturnFalse( - [Values(false, true)] bool argument) - { - bool2 firstValue = new bool2(argument); - - Assert.AreEqual(new bool2(false), firstValue ^ argument); - Assert.AreEqual(new bool2(false), argument ^ firstValue); - } - - [Test] - public void bool2_Swizzle_xx_SameValuesButNotSameReference( - [Values(false, true)] bool argument) - { - bool2 value = new bool2(argument); - - Assert.IsFalse(ReferenceEquals(value, value.xx)); - Assert.AreEqual(new bool2(argument), value.xx); - } - - [Test] - public void bool2_Swizzle_yy_SameValuesButNotSameReference( - [Values(false, true)] bool argument) - { - bool2 value = new bool2(argument); - - Assert.IsFalse(ReferenceEquals(value, value.yy)); - Assert.AreEqual(new bool2(argument), value.yy); - } - - [Test] - public void bool2_Swizzle_xy_SameValuesButNotSameReference( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument) - { - bool2 value = new bool2(firstArgument, secondArgument); - Assert.AreEqual(new bool2(firstArgument, secondArgument), value.xy); - } - - [Test] - public void bool2_Swizzle_yx_SameValuesButNotSameReference( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument) - { - bool2 value = new bool2(firstArgument, secondArgument); - Assert.AreEqual(new bool2(secondArgument, firstArgument), value.yx); - } - - [Test] - public void bool2_Swizzle_xxx_SameValues( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument) - { - bool2 value = new bool2(firstArgument, secondArgument); - Assert.AreEqual(new bool3(firstArgument, firstArgument, firstArgument), value.xxx); - } - - [Test] - public void bool2_Swizzle_xxy_SameValues( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument) - { - bool2 value = new bool2(firstArgument, secondArgument); - Assert.AreEqual(new bool3(firstArgument, firstArgument, secondArgument), value.xxy); - } - - [Test] - public void bool2_Swizzle_xyx_SameValues( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument) - { - bool2 value = new bool2(firstArgument, secondArgument); - Assert.AreEqual(new bool3(firstArgument, secondArgument, firstArgument), value.xyx); - } - - [Test] - public void bool2_Swizzle_xyy_SameValues( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument) - { - bool2 value = new bool2(firstArgument, secondArgument); - Assert.AreEqual(new bool3(firstArgument, secondArgument, secondArgument), value.xyy); - } - - [Test] - public void bool2_Swizzle_yxx_SameValues( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument) - { - bool2 value = new bool2(firstArgument, secondArgument); - Assert.AreEqual(new bool3(secondArgument, firstArgument, firstArgument), value.yxx); - } - - [Test] - public void bool2_Swizzle_yxy_SameValues( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument) - { - bool2 value = new bool2(firstArgument, secondArgument); - Assert.AreEqual(new bool3(secondArgument, firstArgument, secondArgument), value.yxy); - } - - [Test] - public void bool2_Swizzle_yyx_SameValues( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument) - { - bool2 value = new bool2(firstArgument, secondArgument); - Assert.AreEqual(new bool3(secondArgument, secondArgument, firstArgument), value.yyx); - } - - [Test] - public void bool2_Swizzle_yyy_SameValues( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument) - { - bool2 value = new bool2(firstArgument, secondArgument); - Assert.AreEqual(new bool3(secondArgument, secondArgument, secondArgument), value.yyy); - } - - [Test] - public void bool2_Swizzle_xxxx_SameValues( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument) - { - bool2 value = new bool2(firstArgument, secondArgument); - Assert.AreEqual(new bool4(firstArgument, firstArgument, firstArgument, firstArgument), value.xxxx); - } - - [Test] - public void bool2_Swizzle_xxxy_SameValues( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument) - { - bool2 value = new bool2(firstArgument, secondArgument); - Assert.AreEqual(new bool4(firstArgument, firstArgument, firstArgument, secondArgument), value.xxxy); - } - - [Test] - public void bool2_Swizzle_xxyx_SameValues( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument) - { - bool2 value = new bool2(firstArgument, secondArgument); - Assert.AreEqual(new bool4(firstArgument, firstArgument, secondArgument, firstArgument), value.xxyx); - } - - [Test] - public void bool2_Swizzle_xxyy_SameValues( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument) - { - bool2 value = new bool2(firstArgument, secondArgument); - Assert.AreEqual(new bool4(firstArgument, firstArgument, secondArgument, secondArgument), value.xxyy); - } - - [Test] - public void bool2_Swizzle_xyxx_SameValues( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument) - { - bool2 value = new bool2(firstArgument, secondArgument); - Assert.AreEqual(new bool4(firstArgument, secondArgument, firstArgument, firstArgument), value.xyxx); - } - - [Test] - public void bool2_Swizzle_xyxy_SameValues( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument) - { - bool2 value = new bool2(firstArgument, secondArgument); - Assert.AreEqual(new bool4(firstArgument, secondArgument, firstArgument, secondArgument), value.xyxy); - } - - [Test] - public void bool2_Swizzle_xyyx_SameValues( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument) - { - bool2 value = new bool2(firstArgument, secondArgument); - Assert.AreEqual(new bool4(firstArgument, secondArgument, secondArgument, firstArgument), value.xyyx); - } - - [Test] - public void bool2_Swizzle_xyyy_SameValues( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument) - { - bool2 value = new bool2(firstArgument, secondArgument); - Assert.AreEqual(new bool4(firstArgument, secondArgument, secondArgument, secondArgument), value.xyyy); - } - - [Test] - public void bool2_Swizzle_yxxx_SameValues( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument) - { - bool2 value = new bool2(firstArgument, secondArgument); - Assert.AreEqual(new bool4(secondArgument, firstArgument, firstArgument, firstArgument), value.yxxx); - } - - [Test] - public void bool2_Swizzle_yxxy_SameValues( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument) - { - bool2 value = new bool2(firstArgument, secondArgument); - Assert.AreEqual(new bool4(secondArgument, firstArgument, firstArgument, secondArgument), value.yxxy); - } - - [Test] - public void bool2_Swizzle_yxyx_SameValues( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument) - { - bool2 value = new bool2(firstArgument, secondArgument); - Assert.AreEqual(new bool4(secondArgument, firstArgument, secondArgument, firstArgument), value.yxyx); - } - - [Test] - public void bool2_Swizzle_yxyy_SameValues( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument) - { - bool2 value = new bool2(firstArgument, secondArgument); - Assert.AreEqual(new bool4(secondArgument, firstArgument, secondArgument, secondArgument), value.yxyy); - } - - [Test] - public void bool2_Swizzle_yyxx_SameValues( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument) - { - bool2 value = new bool2(firstArgument, secondArgument); - Assert.AreEqual(new bool4(secondArgument, secondArgument, firstArgument, firstArgument), value.yyxx); - } - - [Test] - public void bool2_Swizzle_yyxy_SameValues( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument) - { - bool2 value = new bool2(firstArgument, secondArgument); - Assert.AreEqual(new bool4(secondArgument, secondArgument, firstArgument, secondArgument), value.yyxy); - } - - [Test] - public void bool2_Swizzle_yyyx_SameValues( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument) - { - bool2 value = new bool2(firstArgument, secondArgument); - Assert.AreEqual(new bool4(secondArgument, secondArgument, secondArgument, firstArgument), value.yyyx); - } - - [Test] - public void bool2_Swizzle_yyyy_SameValues( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument) - { - bool2 value = new bool2(firstArgument, secondArgument); - Assert.AreEqual(new bool4(secondArgument, secondArgument, secondArgument, secondArgument), value.yyyy); - } - } -} diff --git a/src/Unity.Mathematics.Tests/TestBool3.cs b/src/Unity.Mathematics.Tests/TestBool3.cs deleted file mode 100644 index 9c774431..00000000 --- a/src/Unity.Mathematics.Tests/TestBool3.cs +++ /dev/null @@ -1,1586 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using NUnit.Framework; - -namespace Unity.Mathematics.Tests -{ - [TestFixture] - class TestBool3 - { - [Test] - public void bool3_ConstructorOneArgument_CreateNewObject_CheckAgainstOriginalValues( - [Values(false, true)] bool originalValue) - { - bool3 testValue = new bool3(originalValue); - Assert.AreEqual(testValue.x, (bool1)originalValue); - Assert.AreEqual(testValue.y, (bool1)originalValue); - Assert.AreEqual(testValue.z, (bool1)originalValue); - } - - [Test] - public void bool3_ConstructorTwoArguments_CreateNewObject_CheckAgainstOriginalValues( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument) - { - bool2 xy = new bool2(firstArgument, secondArgument); - bool3 testValue = new bool3(xy, thirdArgument); - Assert.AreEqual(testValue.x, (bool1)firstArgument); - Assert.AreEqual(testValue.y, (bool1)secondArgument); - Assert.AreEqual(testValue.z, (bool1)thirdArgument); - } - - [Test] - public void bool3_ConstructorThreeArguments_CreateNewObject_CheckAgainstOriginalValues( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument) - { - bool3 testValue = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(testValue.x, (bool1)firstArgument); - Assert.AreEqual(testValue.y, (bool1)secondArgument); - Assert.AreEqual(testValue.z, (bool1)thirdArgument); - } - - [Test] - public void bool3_OperatorBool3_CompareCastBoolWithObject_ReturnSameValue( - [Values(false, true)] bool originalValue) - { - bool3 testValue = new bool3(originalValue); - Assert.AreEqual((bool3)originalValue, testValue); - } - - [Test] - public void bool3_ToString_PrintAll_ReturnExpectedFormat( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument) - { - string expectedString = "bool3(" + firstArgument + ", " + secondArgument + ", " + thirdArgument + ")"; - bool3 testValue = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(testValue.ToString(), expectedString); - } - - [Test] - public void bool3_OperatorEqual_CompareTwoBool3_AreSame( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument) - { - bool3 firstValue = new bool3(firstArgument, secondArgument, thirdArgument); - bool3 secondValue = new bool3(firstArgument, secondArgument, thirdArgument); - - Assert.AreEqual(new bool3(true), firstValue == secondValue); - } - - [Test] - public void bool3_OperatorEqual_CompareTwoBool3_XIsDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument) - { - bool3 firstValue = new bool3(firstArgument, secondArgument, thirdArgument); - bool3 secondValue = new bool3(!firstArgument, secondArgument, thirdArgument); - - Assert.AreEqual(new bool3(false, true, true), firstValue == secondValue); - } - - [Test] - public void bool3_OperatorEqual_CompareTwoBool3_YIsDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument) - { - bool3 firstValue = new bool3(firstArgument, secondArgument, thirdArgument); - bool3 secondValue = new bool3(firstArgument, !secondArgument, thirdArgument); - - Assert.AreEqual(new bool3(true, false, true), firstValue == secondValue); - } - - [Test] - public void bool3_OperatorEqual_CompareTwoBool3_ZIsDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument) - { - bool3 firstValue = new bool3(firstArgument, secondArgument, thirdArgument); - bool3 secondValue = new bool3(firstArgument, secondArgument, !thirdArgument); - - Assert.AreEqual(new bool3(true, true, false), firstValue == secondValue); - } - - [Test] - public void bool3_OperatorEqual_CompareTwoBool3_XYAreDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument) - { - bool3 firstValue = new bool3(firstArgument, secondArgument, thirdArgument); - bool3 secondValue = new bool3(!firstArgument, !secondArgument, thirdArgument); - - Assert.AreEqual(new bool3(false, false, true), firstValue == secondValue); - } - - [Test] - public void bool3_OperatorEqual_CompareTwoBool3_XZAreDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument) - { - bool3 firstValue = new bool3(firstArgument, secondArgument, thirdArgument); - bool3 secondValue = new bool3(!firstArgument, secondArgument, !thirdArgument); - - Assert.AreEqual(new bool3(false, true, false), firstValue == secondValue); - } - - [Test] - public void bool3_OperatorEqual_CompareTwoBool3_YZAreDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument) - { - bool3 firstValue = new bool3(firstArgument, secondArgument, thirdArgument); - bool3 secondValue = new bool3(firstArgument, !secondArgument, !thirdArgument); - - Assert.AreEqual(new bool3(true, false, false), firstValue == secondValue); - } - - [Test] - public void bool3_OperatorEqual_CompareTwoBool3_XYZAreDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument) - { - bool3 firstValue = new bool3(firstArgument, secondArgument, thirdArgument); - bool3 secondValue = new bool3(!firstArgument, !secondArgument, !thirdArgument); - - Assert.AreEqual(new bool3(false, false, false), firstValue == secondValue); - } - - [Test] - public void bool3_OperatorEqual_CompareBoolWithBool3_AreSame( - [Values(false, true)] bool firstArgument) - { - bool3 firstValue = new bool3(firstArgument); - - Assert.AreEqual(new bool3(true), firstValue == firstArgument); - Assert.AreEqual(new bool3(true), firstArgument == firstValue); - } - - [Test] - public void bool3_OperatorEqual_CompareBoolWithBool3_AreDifferent( - [Values(false, true)] bool firstArgument) - { - bool3 firstValue = new bool3(!firstArgument); - - Assert.AreEqual(new bool3(false), firstValue == firstArgument); - Assert.AreEqual(new bool3(false), firstArgument == firstValue); - } - - [Test] - public void bool3_OperatorNotEqual_CompareTwoBool3_AreSame( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument) - { - bool3 firstValue = new bool3(firstArgument, secondArgument, thirdArgument); - bool3 secondValue = new bool3(firstArgument, secondArgument, thirdArgument); - - Assert.AreEqual(new bool3(false), firstValue != secondValue); - } - - [Test] - public void bool3_OperatorNotEqual_CompareTwoBool3_XIsDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument) - { - bool3 firstValue = new bool3(firstArgument, secondArgument, thirdArgument); - bool3 secondValue = new bool3(!firstArgument, secondArgument, thirdArgument); - - Assert.AreEqual(new bool3(true, false, false), firstValue != secondValue); - } - - [Test] - public void bool3_OperatorNotEqual_CompareTwoBool3_YIsDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument) - { - bool3 firstValue = new bool3(firstArgument, secondArgument, thirdArgument); - bool3 secondValue = new bool3(firstArgument, !secondArgument, thirdArgument); - - Assert.AreEqual(new bool3(false, true, false), firstValue != secondValue); - } - - [Test] - public void bool3_OperatorNotEqual_CompareTwoBool3_ZIsDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument) - { - bool3 firstValue = new bool3(firstArgument, secondArgument, thirdArgument); - bool3 secondValue = new bool3(firstArgument, secondArgument, !thirdArgument); - - Assert.AreEqual(new bool3(false, false, true), firstValue != secondValue); - } - - [Test] - public void bool3_OperatorNotEqual_CompareTwoBool3_XYAreDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument) - { - bool3 firstValue = new bool3(firstArgument, secondArgument, thirdArgument); - bool3 secondValue = new bool3(!firstArgument, !secondArgument, thirdArgument); - - Assert.AreEqual(new bool3(true, true, false), firstValue != secondValue); - } - - [Test] - public void bool3_OperatorNotEqual_CompareTwoBool3_XZAreDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument) - { - bool3 firstValue = new bool3(firstArgument, secondArgument, thirdArgument); - bool3 secondValue = new bool3(!firstArgument, secondArgument, !thirdArgument); - - Assert.AreEqual(new bool3(true, false, true), firstValue != secondValue); - } - - [Test] - public void bool3_OperatorNotEqual_CompareTwoBool3_YZAreDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument) - { - bool3 firstValue = new bool3(firstArgument, secondArgument, thirdArgument); - bool3 secondValue = new bool3(firstArgument, !secondArgument, !thirdArgument); - - Assert.AreEqual(new bool3(false, true, true), firstValue != secondValue); - } - - [Test] - public void bool3_OperatorNotEqual_CompareTwoBool3_XYZAreDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument) - { - bool3 firstValue = new bool3(firstArgument, secondArgument, thirdArgument); - bool3 secondValue = new bool3(!firstArgument, !secondArgument, !thirdArgument); - - Assert.AreEqual(new bool3(true, true, true), firstValue != secondValue); - } - - [Test] - public void bool3_OperatorNotEqual_CompareBoolWithBool3_AreSame( - [Values(false, true)] bool firstArgument) - { - bool3 firstValue = new bool3(firstArgument); - - Assert.AreEqual(new bool3(false), firstValue != firstArgument); - Assert.AreEqual(new bool3(false), firstArgument != firstValue); - } - - [Test] - public void bool3_OperatorNotEqual_CompareBoolWithBool3_AreDifferent( - [Values(false, true)] bool firstArgument) - { - bool3 firstValue = new bool3(!firstArgument); - - Assert.AreEqual(new bool3(true), firstValue != firstArgument); - Assert.AreEqual(new bool3(true), firstArgument != firstValue); - } - - [Test] - public void bool3_OperatorAND_BothBool3_ReturnFalse( - [Values(false, true)] bool argument) - { - bool3 firstValue = new bool3(argument); - bool3 zeroValue = new bool3(false); - - Assert.AreEqual(new bool3(false), firstValue & zeroValue); - } - - [Test] - public void bool3_OperatorAND_BothBool3_ReturnTrue() - { - bool3 firstValue = new bool3(true); - bool3 secondValue = new bool3(true); - - Assert.AreEqual(new bool3(true), firstValue & secondValue); - } - - [Test] - public void bool3_OperatorAND_BoolANDBool3_ReturnFalse( - [Values(false, true)] bool argument) - { - bool3 firstValue = new bool3(argument); - - Assert.AreEqual(new bool3(false), firstValue & false); - Assert.AreEqual(new bool3(false), false & firstValue); - } - - [Test] - public void bool3_OperatorAND_BoolANDBool3_ReturnTrue() - { - bool3 firstValue = new bool3(true); - - Assert.AreEqual(new bool3(true), firstValue & true); - Assert.AreEqual(new bool3(true), true & firstValue); - } - - [Test] - public void bool3_OperatorOR_BothBool3_ReturnFalse() - { - bool3 firstValue = new bool3(false); - bool3 secondValue = new bool3(false); - - Assert.AreEqual(new bool3(false), firstValue | secondValue); - } - - [Test] - public void bool3_OperatorOR_BothBool3_ReturnTrue( - [Values(false, true)] bool argument) - { - bool3 firstValue = new bool3(argument); - bool3 secondValue = new bool3(true); - - Assert.AreEqual(new bool3(true), firstValue | secondValue); - } - - [Test] - public void bool3_OperatorOR_BoolORBool3_ReturnTrue( - [Values(false, true)] bool argument) - { - bool3 firstValue = new bool3(argument); - - Assert.AreEqual(new bool3(true), firstValue | true); - Assert.AreEqual(new bool3(true), true | firstValue); - } - - [Test] - public void bool3_OperatorOR_BoolORBool3_ReturnFalse() - { - bool3 firstValue = new bool3(false); - - Assert.AreEqual(new bool3(false), firstValue | false); - Assert.AreEqual(new bool3(false), false | firstValue); - } - - [Test] - public void bool3_OperatorXOR_BothBool3_ReturnTrue( - [Values(false, true)] bool argument) - { - bool3 firstValue = new bool3(argument); - bool3 secondValue = new bool3(!argument); - - Assert.AreEqual(new bool3(true), firstValue ^ secondValue); - } - - [Test] - public void bool3_OperatorXOR_BothBool3_ReturnFalse( - [Values(false, true)] bool argument) - { - bool3 firstValue = new bool3(argument); - bool3 secondValue = new bool3(argument); - - Assert.AreEqual(new bool3(false), firstValue ^ secondValue); - } - - [Test] - public void bool3_OperatorXOR_BoolORBool3_ReturnTrue( - [Values(false, true)] bool argument) - { - bool3 firstValue = new bool3(argument); - bool notArgument = !argument; - - Assert.AreEqual(new bool3(true), firstValue ^ notArgument); - Assert.AreEqual(new bool3(true), notArgument ^ firstValue); - } - - [Test] - public void bool3_OperatorXOR_BoolORBool3_ReturnFalse( - [Values(false, true)] bool argument) - { - bool3 firstValue = new bool3(argument); - - Assert.AreEqual(new bool3(false), firstValue ^ argument); - Assert.AreEqual(new bool3(false), argument ^ firstValue); - } - -[Test] -public void bool3_Swizzle_xx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool2(firstArgument,firstArgument), value.xx); -} - -[Test] -public void bool3_Swizzle_xy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool2(firstArgument,secondArgument), value.xy); -} - -[Test] -public void bool3_Swizzle_xz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool2(firstArgument,thirdArgument), value.xz); -} - -[Test] -public void bool3_Swizzle_yx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool2(secondArgument,firstArgument), value.yx); -} - -[Test] -public void bool3_Swizzle_yy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool2(secondArgument,secondArgument), value.yy); -} - -[Test] -public void bool3_Swizzle_yz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool2(secondArgument,thirdArgument), value.yz); -} - -[Test] -public void bool3_Swizzle_zx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool2(thirdArgument,firstArgument), value.zx); -} - -[Test] -public void bool3_Swizzle_zy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool2(thirdArgument,secondArgument), value.zy); -} - -[Test] -public void bool3_Swizzle_zz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool2(thirdArgument,thirdArgument), value.zz); -} - -[Test] -public void bool3_Swizzle_xxx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool3(firstArgument,firstArgument,firstArgument), value.xxx); -} - -[Test] -public void bool3_Swizzle_xxy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool3(firstArgument,firstArgument,secondArgument), value.xxy); -} - -[Test] -public void bool3_Swizzle_xxz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool3(firstArgument,firstArgument,thirdArgument), value.xxz); -} - -[Test] -public void bool3_Swizzle_xyx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool3(firstArgument,secondArgument,firstArgument), value.xyx); -} - -[Test] -public void bool3_Swizzle_xyy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool3(firstArgument,secondArgument,secondArgument), value.xyy); -} - -[Test] -public void bool3_Swizzle_xyz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool3(firstArgument,secondArgument,thirdArgument), value.xyz); -} - -[Test] -public void bool3_Swizzle_xzx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool3(firstArgument,thirdArgument,firstArgument), value.xzx); -} - -[Test] -public void bool3_Swizzle_xzy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool3(firstArgument,thirdArgument,secondArgument), value.xzy); -} - -[Test] -public void bool3_Swizzle_xzz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool3(firstArgument,thirdArgument,thirdArgument), value.xzz); -} - -[Test] -public void bool3_Swizzle_yxx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool3(secondArgument,firstArgument,firstArgument), value.yxx); -} - -[Test] -public void bool3_Swizzle_yxy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool3(secondArgument,firstArgument,secondArgument), value.yxy); -} - -[Test] -public void bool3_Swizzle_yxz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool3(secondArgument,firstArgument,thirdArgument), value.yxz); -} - -[Test] -public void bool3_Swizzle_yyx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool3(secondArgument,secondArgument,firstArgument), value.yyx); -} - -[Test] -public void bool3_Swizzle_yyy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool3(secondArgument,secondArgument,secondArgument), value.yyy); -} - -[Test] -public void bool3_Swizzle_yyz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool3(secondArgument,secondArgument,thirdArgument), value.yyz); -} - -[Test] -public void bool3_Swizzle_yzx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool3(secondArgument,thirdArgument,firstArgument), value.yzx); -} - -[Test] -public void bool3_Swizzle_yzy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool3(secondArgument,thirdArgument,secondArgument), value.yzy); -} - -[Test] -public void bool3_Swizzle_yzz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool3(secondArgument,thirdArgument,thirdArgument), value.yzz); -} - -[Test] -public void bool3_Swizzle_zxx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool3(thirdArgument,firstArgument,firstArgument), value.zxx); -} - -[Test] -public void bool3_Swizzle_zxy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool3(thirdArgument,firstArgument,secondArgument), value.zxy); -} - -[Test] -public void bool3_Swizzle_zxz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool3(thirdArgument,firstArgument,thirdArgument), value.zxz); -} - -[Test] -public void bool3_Swizzle_zyx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool3(thirdArgument,secondArgument,firstArgument), value.zyx); -} - -[Test] -public void bool3_Swizzle_zyy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool3(thirdArgument,secondArgument,secondArgument), value.zyy); -} - -[Test] -public void bool3_Swizzle_zyz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool3(thirdArgument,secondArgument,thirdArgument), value.zyz); -} - -[Test] -public void bool3_Swizzle_zzx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool3(thirdArgument,thirdArgument,firstArgument), value.zzx); -} - -[Test] -public void bool3_Swizzle_zzy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool3(thirdArgument,thirdArgument,secondArgument), value.zzy); -} - -[Test] -public void bool3_Swizzle_zzz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool3(thirdArgument,thirdArgument,thirdArgument), value.zzz); -} - -[Test] -public void bool3_Swizzle_xxxx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(firstArgument,firstArgument,firstArgument,firstArgument), value.xxxx); -} - -[Test] -public void bool3_Swizzle_xxxy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(firstArgument,firstArgument,firstArgument,secondArgument), value.xxxy); -} - -[Test] -public void bool3_Swizzle_xxxz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(firstArgument,firstArgument,firstArgument,thirdArgument), value.xxxz); -} - -[Test] -public void bool3_Swizzle_xxyx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(firstArgument,firstArgument,secondArgument,firstArgument), value.xxyx); -} - -[Test] -public void bool3_Swizzle_xxyy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(firstArgument,firstArgument,secondArgument,secondArgument), value.xxyy); -} - -[Test] -public void bool3_Swizzle_xxyz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(firstArgument,firstArgument,secondArgument,thirdArgument), value.xxyz); -} - -[Test] -public void bool3_Swizzle_xxzx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(firstArgument,firstArgument,thirdArgument,firstArgument), value.xxzx); -} - -[Test] -public void bool3_Swizzle_xxzy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(firstArgument,firstArgument,thirdArgument,secondArgument), value.xxzy); -} - -[Test] -public void bool3_Swizzle_xxzz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(firstArgument,firstArgument,thirdArgument,thirdArgument), value.xxzz); -} - -[Test] -public void bool3_Swizzle_xyxx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(firstArgument,secondArgument,firstArgument,firstArgument), value.xyxx); -} - -[Test] -public void bool3_Swizzle_xyxy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(firstArgument,secondArgument,firstArgument,secondArgument), value.xyxy); -} - -[Test] -public void bool3_Swizzle_xyxz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(firstArgument,secondArgument,firstArgument,thirdArgument), value.xyxz); -} - -[Test] -public void bool3_Swizzle_xyyx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(firstArgument,secondArgument,secondArgument,firstArgument), value.xyyx); -} - -[Test] -public void bool3_Swizzle_xyyy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(firstArgument,secondArgument,secondArgument,secondArgument), value.xyyy); -} - -[Test] -public void bool3_Swizzle_xyyz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(firstArgument,secondArgument,secondArgument,thirdArgument), value.xyyz); -} - -[Test] -public void bool3_Swizzle_xyzx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(firstArgument,secondArgument,thirdArgument,firstArgument), value.xyzx); -} - -[Test] -public void bool3_Swizzle_xyzy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(firstArgument,secondArgument,thirdArgument,secondArgument), value.xyzy); -} - -[Test] -public void bool3_Swizzle_xyzz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(firstArgument,secondArgument,thirdArgument,thirdArgument), value.xyzz); -} - -[Test] -public void bool3_Swizzle_xzxx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(firstArgument,thirdArgument,firstArgument,firstArgument), value.xzxx); -} - -[Test] -public void bool3_Swizzle_xzxy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(firstArgument,thirdArgument,firstArgument,secondArgument), value.xzxy); -} - -[Test] -public void bool3_Swizzle_xzxz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(firstArgument,thirdArgument,firstArgument,thirdArgument), value.xzxz); -} - -[Test] -public void bool3_Swizzle_xzyx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(firstArgument,thirdArgument,secondArgument,firstArgument), value.xzyx); -} - -[Test] -public void bool3_Swizzle_xzyy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(firstArgument,thirdArgument,secondArgument,secondArgument), value.xzyy); -} - -[Test] -public void bool3_Swizzle_xzyz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(firstArgument,thirdArgument,secondArgument,thirdArgument), value.xzyz); -} - -[Test] -public void bool3_Swizzle_xzzx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(firstArgument,thirdArgument,thirdArgument,firstArgument), value.xzzx); -} - -[Test] -public void bool3_Swizzle_xzzy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(firstArgument,thirdArgument,thirdArgument,secondArgument), value.xzzy); -} - -[Test] -public void bool3_Swizzle_xzzz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(firstArgument,thirdArgument,thirdArgument,thirdArgument), value.xzzz); -} - -[Test] -public void bool3_Swizzle_yxxx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(secondArgument,firstArgument,firstArgument,firstArgument), value.yxxx); -} - -[Test] -public void bool3_Swizzle_yxxy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(secondArgument,firstArgument,firstArgument,secondArgument), value.yxxy); -} - -[Test] -public void bool3_Swizzle_yxxz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(secondArgument,firstArgument,firstArgument,thirdArgument), value.yxxz); -} - -[Test] -public void bool3_Swizzle_yxyx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(secondArgument,firstArgument,secondArgument,firstArgument), value.yxyx); -} - -[Test] -public void bool3_Swizzle_yxyy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(secondArgument,firstArgument,secondArgument,secondArgument), value.yxyy); -} - -[Test] -public void bool3_Swizzle_yxyz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(secondArgument,firstArgument,secondArgument,thirdArgument), value.yxyz); -} - -[Test] -public void bool3_Swizzle_yxzx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(secondArgument,firstArgument,thirdArgument,firstArgument), value.yxzx); -} - -[Test] -public void bool3_Swizzle_yxzy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(secondArgument,firstArgument,thirdArgument,secondArgument), value.yxzy); -} - -[Test] -public void bool3_Swizzle_yxzz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(secondArgument,firstArgument,thirdArgument,thirdArgument), value.yxzz); -} - -[Test] -public void bool3_Swizzle_yyxx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(secondArgument,secondArgument,firstArgument,firstArgument), value.yyxx); -} - -[Test] -public void bool3_Swizzle_yyxy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(secondArgument,secondArgument,firstArgument,secondArgument), value.yyxy); -} - -[Test] -public void bool3_Swizzle_yyxz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(secondArgument,secondArgument,firstArgument,thirdArgument), value.yyxz); -} - -[Test] -public void bool3_Swizzle_yyyx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(secondArgument,secondArgument,secondArgument,firstArgument), value.yyyx); -} - -[Test] -public void bool3_Swizzle_yyyy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(secondArgument,secondArgument,secondArgument,secondArgument), value.yyyy); -} - -[Test] -public void bool3_Swizzle_yyyz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(secondArgument,secondArgument,secondArgument,thirdArgument), value.yyyz); -} - -[Test] -public void bool3_Swizzle_yyzx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(secondArgument,secondArgument,thirdArgument,firstArgument), value.yyzx); -} - -[Test] -public void bool3_Swizzle_yyzy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(secondArgument,secondArgument,thirdArgument,secondArgument), value.yyzy); -} - -[Test] -public void bool3_Swizzle_yyzz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(secondArgument,secondArgument,thirdArgument,thirdArgument), value.yyzz); -} - -[Test] -public void bool3_Swizzle_yzxx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(secondArgument,thirdArgument,firstArgument,firstArgument), value.yzxx); -} - -[Test] -public void bool3_Swizzle_yzxy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(secondArgument,thirdArgument,firstArgument,secondArgument), value.yzxy); -} - -[Test] -public void bool3_Swizzle_yzxz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(secondArgument,thirdArgument,firstArgument,thirdArgument), value.yzxz); -} - -[Test] -public void bool3_Swizzle_yzyx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(secondArgument,thirdArgument,secondArgument,firstArgument), value.yzyx); -} - -[Test] -public void bool3_Swizzle_yzyy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(secondArgument,thirdArgument,secondArgument,secondArgument), value.yzyy); -} - -[Test] -public void bool3_Swizzle_yzyz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(secondArgument,thirdArgument,secondArgument,thirdArgument), value.yzyz); -} - -[Test] -public void bool3_Swizzle_yzzx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(secondArgument,thirdArgument,thirdArgument,firstArgument), value.yzzx); -} - -[Test] -public void bool3_Swizzle_yzzy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(secondArgument,thirdArgument,thirdArgument,secondArgument), value.yzzy); -} - -[Test] -public void bool3_Swizzle_yzzz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(secondArgument,thirdArgument,thirdArgument,thirdArgument), value.yzzz); -} - -[Test] -public void bool3_Swizzle_zxxx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(thirdArgument,firstArgument,firstArgument,firstArgument), value.zxxx); -} - -[Test] -public void bool3_Swizzle_zxxy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(thirdArgument,firstArgument,firstArgument,secondArgument), value.zxxy); -} - -[Test] -public void bool3_Swizzle_zxxz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(thirdArgument,firstArgument,firstArgument,thirdArgument), value.zxxz); -} - -[Test] -public void bool3_Swizzle_zxyx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(thirdArgument,firstArgument,secondArgument,firstArgument), value.zxyx); -} - -[Test] -public void bool3_Swizzle_zxyy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(thirdArgument,firstArgument,secondArgument,secondArgument), value.zxyy); -} - -[Test] -public void bool3_Swizzle_zxyz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(thirdArgument,firstArgument,secondArgument,thirdArgument), value.zxyz); -} - -[Test] -public void bool3_Swizzle_zxzx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(thirdArgument,firstArgument,thirdArgument,firstArgument), value.zxzx); -} - -[Test] -public void bool3_Swizzle_zxzy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(thirdArgument,firstArgument,thirdArgument,secondArgument), value.zxzy); -} - -[Test] -public void bool3_Swizzle_zxzz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(thirdArgument,firstArgument,thirdArgument,thirdArgument), value.zxzz); -} - -[Test] -public void bool3_Swizzle_zyxx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(thirdArgument,secondArgument,firstArgument,firstArgument), value.zyxx); -} - -[Test] -public void bool3_Swizzle_zyxy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(thirdArgument,secondArgument,firstArgument,secondArgument), value.zyxy); -} - -[Test] -public void bool3_Swizzle_zyxz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(thirdArgument,secondArgument,firstArgument,thirdArgument), value.zyxz); -} - -[Test] -public void bool3_Swizzle_zyyx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(thirdArgument,secondArgument,secondArgument,firstArgument), value.zyyx); -} - -[Test] -public void bool3_Swizzle_zyyy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(thirdArgument,secondArgument,secondArgument,secondArgument), value.zyyy); -} - -[Test] -public void bool3_Swizzle_zyyz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(thirdArgument,secondArgument,secondArgument,thirdArgument), value.zyyz); -} - -[Test] -public void bool3_Swizzle_zyzx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(thirdArgument,secondArgument,thirdArgument,firstArgument), value.zyzx); -} - -[Test] -public void bool3_Swizzle_zyzy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(thirdArgument,secondArgument,thirdArgument,secondArgument), value.zyzy); -} - -[Test] -public void bool3_Swizzle_zyzz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(thirdArgument,secondArgument,thirdArgument,thirdArgument), value.zyzz); -} - -[Test] -public void bool3_Swizzle_zzxx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(thirdArgument,thirdArgument,firstArgument,firstArgument), value.zzxx); -} - -[Test] -public void bool3_Swizzle_zzxy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(thirdArgument,thirdArgument,firstArgument,secondArgument), value.zzxy); -} - -[Test] -public void bool3_Swizzle_zzxz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(thirdArgument,thirdArgument,firstArgument,thirdArgument), value.zzxz); -} - -[Test] -public void bool3_Swizzle_zzyx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(thirdArgument,thirdArgument,secondArgument,firstArgument), value.zzyx); -} - -[Test] -public void bool3_Swizzle_zzyy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(thirdArgument,thirdArgument,secondArgument,secondArgument), value.zzyy); -} - -[Test] -public void bool3_Swizzle_zzyz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(thirdArgument,thirdArgument,secondArgument,thirdArgument), value.zzyz); -} - -[Test] -public void bool3_Swizzle_zzzx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(thirdArgument,thirdArgument,thirdArgument,firstArgument), value.zzzx); -} - -[Test] -public void bool3_Swizzle_zzzy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(thirdArgument,thirdArgument,thirdArgument,secondArgument), value.zzzy); -} - -[Test] -public void bool3_Swizzle_zzzz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument) -{ - bool3 value = new bool3(firstArgument, secondArgument, thirdArgument); - Assert.AreEqual(new bool4(thirdArgument,thirdArgument,thirdArgument,thirdArgument), value.zzzz); -} - } -} diff --git a/src/Unity.Mathematics.Tests/TestBool4.cs b/src/Unity.Mathematics.Tests/TestBool4.cs deleted file mode 100644 index 9f322a67..00000000 --- a/src/Unity.Mathematics.Tests/TestBool4.cs +++ /dev/null @@ -1,4315 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using NUnit.Framework; - -namespace Unity.Mathematics.Tests -{ - [TestFixture] - class TestBool4 - { - [Test] - public void bool4_ConstructorOneArgument_CreateNewObject_CheckAgainstOriginalValues( - [Values(false, true)] bool originalValue) - { - bool4 testValue = new bool4(originalValue); - Assert.AreEqual(testValue.x, (bool1)originalValue); - Assert.AreEqual(testValue.y, (bool1)originalValue); - Assert.AreEqual(testValue.z, (bool1)originalValue); - Assert.AreEqual(testValue.w, (bool1)originalValue); - } - - [Test] - public void bool4_ConstructorTwoArguments_CreateNewObject_CheckAgainstOriginalValues( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument, - [Values(false, true)] bool fourthArgument) - { - bool3 xyz = new bool3(firstArgument, secondArgument, thirdArgument); - bool4 testValue = new bool4(xyz, fourthArgument); - Assert.AreEqual(testValue.x, (bool1)firstArgument); - Assert.AreEqual(testValue.y, (bool1)secondArgument); - Assert.AreEqual(testValue.z, (bool1)thirdArgument); - Assert.AreEqual(testValue.w, (bool1)fourthArgument); - } - - [Test] - public void bool4_ConstructorFourArguments_CreateNewObject_CheckAgainstOriginalValues( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument, - [Values(false, true)] bool fourthArgument) - { - bool4 testValue = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(testValue.x, (bool1)firstArgument); - Assert.AreEqual(testValue.y, (bool1)secondArgument); - Assert.AreEqual(testValue.z, (bool1)thirdArgument); - Assert.AreEqual(testValue.w, (bool1)fourthArgument); - } - - [Test] - public void bool4_OperatorBool4_CompareCastBoolWithObject_ReturnSameValue( - [Values(false, true)] bool originalValue) - { - bool4 testValue = new bool4(originalValue); - Assert.AreEqual((bool4)originalValue, testValue); - } - - [Test] - public void bool4_ToString_PrintAll_ReturnExpectedFormat( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument, - [Values(false, true)] bool fourthArgument) - { - string expectedString = "bool4(" + firstArgument + ", " + secondArgument + ", " + thirdArgument + ", " + fourthArgument + ")"; - bool4 testValue = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(testValue.ToString(), expectedString); - } - - [Test] - public void bool4_OperatorEqual_CompareTwoBool4_AreSame( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument, - [Values(false, true)] bool fourthArgument) - { - bool4 firstValue = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - bool4 secondValue = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - - Assert.AreEqual(new bool4(true), firstValue == secondValue); - } - - [Test] - public void bool4_OperatorEqual_CompareTwoBool4_XIsDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument, - [Values(false, true)] bool fourthArgument) - { - bool4 firstValue = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - bool4 secondValue = new bool4(!firstArgument, secondArgument, thirdArgument, fourthArgument); - - Assert.AreEqual(new bool4(false, true, true, true), firstValue == secondValue); - } - - [Test] - public void bool4_OperatorEqual_CompareTwoBool4_YIsDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument, - [Values(false, true)] bool fourthArgument) - { - bool4 firstValue = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - bool4 secondValue = new bool4(firstArgument, !secondArgument, thirdArgument, fourthArgument); - - Assert.AreEqual(new bool4(true, false, true, true), firstValue == secondValue); - } - - [Test] - public void bool4_OperatorEqual_CompareTwoBool4_ZIsDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument, - [Values(false, true)] bool fourthArgument) - { - bool4 firstValue = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - bool4 secondValue = new bool4(firstArgument, secondArgument, !thirdArgument, fourthArgument); - - Assert.AreEqual(new bool4(true, true, false, true), firstValue == secondValue); - } - - [Test] - public void bool4_OperatorEqual_CompareTwoBool4_WIsDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument, - [Values(false, true)] bool fourthArgument) - { - bool4 firstValue = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - bool4 secondValue = new bool4(firstArgument, secondArgument, thirdArgument, !fourthArgument); - - Assert.AreEqual(new bool4(true, true, true, false), firstValue == secondValue); - } - - [Test] - public void bool4_OperatorEqual_CompareTwoBool4_XYAreDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument, - [Values(false, true)] bool fourthArgument) - { - bool4 firstValue = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - bool4 secondValue = new bool4(!firstArgument, !secondArgument, thirdArgument, fourthArgument); - - Assert.AreEqual(new bool4(false, false, true, true), firstValue == secondValue); - } - - [Test] - public void bool4_OperatorEqual_CompareTwoBool4_XZAreDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument, - [Values(false, true)] bool fourthArgument) - { - bool4 firstValue = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - bool4 secondValue = new bool4(!firstArgument, secondArgument, !thirdArgument, fourthArgument); - - Assert.AreEqual(new bool4(false, true, false, true), firstValue == secondValue); - } - - [Test] - public void bool4_OperatorEqual_CompareTwoBool4_XWAreDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument, - [Values(false, true)] bool fourthArgument) - { - bool4 firstValue = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - bool4 secondValue = new bool4(!firstArgument, secondArgument, thirdArgument, !fourthArgument); - - Assert.AreEqual(new bool4(false, true, true, false), firstValue == secondValue); - } - - [Test] - public void bool4_OperatorEqual_CompareTwoBool4_YZAreDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument, - [Values(false, true)] bool fourthArgument) - { - bool4 firstValue = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - bool4 secondValue = new bool4(firstArgument, !secondArgument, !thirdArgument, fourthArgument); - - Assert.AreEqual(new bool4(true, false, false, true), firstValue == secondValue); - } - - [Test] - public void bool4_OperatorEqual_CompareTwoBool4_YWAreDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument, - [Values(false, true)] bool fourthArgument) - { - bool4 firstValue = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - bool4 secondValue = new bool4(firstArgument, !secondArgument, thirdArgument, !fourthArgument); - - Assert.AreEqual(new bool4(true, false, true, false), firstValue == secondValue); - } - - [Test] - public void bool4_OperatorEqual_CompareTwoBool4_ZWAreDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument, - [Values(false, true)] bool fourthArgument) - { - bool4 firstValue = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - bool4 secondValue = new bool4(firstArgument, secondArgument, !thirdArgument, !fourthArgument); - - Assert.AreEqual(new bool4(true, true, false, false), firstValue == secondValue); - } - - [Test] - public void bool4_OperatorEqual_CompareTwoBool4_XYZAreDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument, - [Values(false, true)] bool fourthArgument) - { - bool4 firstValue = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - bool4 secondValue = new bool4(!firstArgument, !secondArgument, !thirdArgument, fourthArgument); - - Assert.AreEqual(new bool4(false, false, false, true), firstValue == secondValue); - } - - [Test] - public void bool4_OperatorEqual_CompareTwoBool4_XYWAreDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument, - [Values(false, true)] bool fourthArgument) - { - bool4 firstValue = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - bool4 secondValue = new bool4(!firstArgument, !secondArgument, thirdArgument, !fourthArgument); - - Assert.AreEqual(new bool4(false, false, true, false), firstValue == secondValue); - } - - [Test] - public void bool4_OperatorEqual_CompareTwoBool4_YZWAreDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument, - [Values(false, true)] bool fourthArgument) - { - bool4 firstValue = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - bool4 secondValue = new bool4(firstArgument, !secondArgument, !thirdArgument, !fourthArgument); - - Assert.AreEqual(new bool4(true, false, false, false), firstValue == secondValue); - } - - [Test] - public void bool4_OperatorEqual_CompareTwoBool4_XYZWAreDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument, - [Values(false, true)] bool fourthArgument) - { - bool4 firstValue = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - bool4 secondValue = new bool4(!firstArgument, !secondArgument, !thirdArgument, !fourthArgument); - - Assert.AreEqual(new bool4(false, false, false, false), firstValue == secondValue); - } - - [Test] - public void bool4_OperatorEqual_CompareBoolWithBool4_AreSame( - [Values(false, true)] bool firstArgument) - { - bool4 firstValue = new bool4(firstArgument); - - Assert.AreEqual(new bool4(true), firstValue == firstArgument); - Assert.AreEqual(new bool4(true), firstArgument == firstValue); - } - - [Test] - public void bool4_OperatorEqual_CompareBoolWithBool4_AreDifferent( - [Values(false, true)] bool firstArgument) - { - bool4 firstValue = new bool4(!firstArgument); - - Assert.AreEqual(new bool4(false), firstValue == firstArgument); - Assert.AreEqual(new bool4(false), firstArgument == firstValue); - } - - [Test] - public void bool4_OperatorNotEqual_CompareTwoBool4_AreSame( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument, - [Values(false, true)] bool fourthArgument) - { - bool4 firstValue = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - bool4 secondValue = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - - Assert.AreEqual(new bool4(false), firstValue != secondValue); - } - - [Test] - public void bool4_OperatorNotEqual_CompareTwoBool4_XIsDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument, - [Values(false, true)] bool fourthArgument) - { - bool4 firstValue = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - bool4 secondValue = new bool4(!firstArgument, secondArgument, thirdArgument, fourthArgument); - - Assert.AreEqual(new bool4(true, false, false, false), firstValue != secondValue); - } - - [Test] - public void bool4_OperatorNotEqual_CompareTwoBool4_YIsDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument, - [Values(false, true)] bool fourthArgument) - { - bool4 firstValue = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - bool4 secondValue = new bool4(firstArgument, !secondArgument, thirdArgument, fourthArgument); - - Assert.AreEqual(new bool4(false, true, false, false), firstValue != secondValue); - } - - [Test] - public void bool4_OperatorNotEqual_CompareTwoBool4_ZIsDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument, - [Values(false, true)] bool fourthArgument) - { - bool4 firstValue = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - bool4 secondValue = new bool4(firstArgument, secondArgument, !thirdArgument, fourthArgument); - - Assert.AreEqual(new bool4(false, false, true, false), firstValue != secondValue); - } - - [Test] - public void bool4_OperatorNotEqual_CompareTwoBool4_WIsDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument, - [Values(false, true)] bool fourthArgument) - { - bool4 firstValue = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - bool4 secondValue = new bool4(firstArgument, secondArgument, thirdArgument, !fourthArgument); - - Assert.AreEqual(new bool4(false, false, false, true), firstValue != secondValue); - } - - [Test] - public void bool4_OperatorNotEqual_CompareTwoBool4_XYAreDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument, - [Values(false, true)] bool fourthArgument) - { - bool4 firstValue = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - bool4 secondValue = new bool4(!firstArgument, !secondArgument, thirdArgument, fourthArgument); - - Assert.AreEqual(new bool4(true, true, false, false), firstValue != secondValue); - } - - [Test] - public void bool4_OperatorNotEqual_CompareTwoBool4_XZAreDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument, - [Values(false, true)] bool fourthArgument) - { - bool4 firstValue = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - bool4 secondValue = new bool4(!firstArgument, secondArgument, !thirdArgument, fourthArgument); - - Assert.AreEqual(new bool4(true, false, true, false), firstValue != secondValue); - } - - [Test] - public void bool4_OperatorNotEqual_CompareTwoBool4_XWAreDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument, - [Values(false, true)] bool fourthArgument) - { - bool4 firstValue = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - bool4 secondValue = new bool4(!firstArgument, secondArgument, thirdArgument, !fourthArgument); - - Assert.AreEqual(new bool4(true, false, false, true), firstValue != secondValue); - } - - [Test] - public void bool4_OperatorNotEqual_CompareTwoBool4_YZAreDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument, - [Values(false, true)] bool fourthArgument) - { - bool4 firstValue = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - bool4 secondValue = new bool4(firstArgument, !secondArgument, !thirdArgument, fourthArgument); - - Assert.AreEqual(new bool4(false, true, true, false), firstValue != secondValue); - } - - [Test] - public void bool4_OperatorNotEqual_CompareTwoBool4_YWAreDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument, - [Values(false, true)] bool fourthArgument) - { - bool4 firstValue = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - bool4 secondValue = new bool4(firstArgument, !secondArgument, thirdArgument, !fourthArgument); - - Assert.AreEqual(new bool4(false, true, false, true), firstValue != secondValue); - } - - [Test] - public void bool4_OperatorNotEqual_CompareTwoBool4_ZWAreDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument, - [Values(false, true)] bool fourthArgument) - { - bool4 firstValue = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - bool4 secondValue = new bool4(firstArgument, secondArgument, !thirdArgument, !fourthArgument); - - Assert.AreEqual(new bool4(false, false, true, true), firstValue != secondValue); - } - - [Test] - public void bool4_OperatorNotEqual_CompareTwoBool4_XYZAreDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument, - [Values(false, true)] bool fourthArgument) - { - bool4 firstValue = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - bool4 secondValue = new bool4(!firstArgument, !secondArgument, !thirdArgument, fourthArgument); - - Assert.AreEqual(new bool4(true, true, true, false), firstValue != secondValue); - } - - [Test] - public void bool4_OperatorNotEqual_CompareTwoBool4_XYWAreDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument, - [Values(false, true)] bool fourthArgument) - { - bool4 firstValue = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - bool4 secondValue = new bool4(!firstArgument, !secondArgument, thirdArgument, !fourthArgument); - - Assert.AreEqual(new bool4(true, true, false, true), firstValue != secondValue); - } - - [Test] - public void bool4_OperatorNotEqual_CompareTwoBool4_YZWAreDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument, - [Values(false, true)] bool fourthArgument) - { - bool4 firstValue = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - bool4 secondValue = new bool4(firstArgument, !secondArgument, !thirdArgument, !fourthArgument); - - Assert.AreEqual(new bool4(false, true, true, true), firstValue != secondValue); - } - - [Test] - public void bool4_OperatorNotEqual_CompareTwoBool4_XYZWAreDifferent( - [Values(false, true)] bool firstArgument, - [Values(false, true)] bool secondArgument, - [Values(false, true)] bool thirdArgument, - [Values(false, true)] bool fourthArgument) - { - bool4 firstValue = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - bool4 secondValue = new bool4(!firstArgument, !secondArgument, !thirdArgument, !fourthArgument); - - Assert.AreEqual(new bool4(true, true, true, true), firstValue != secondValue); - } - - [Test] - public void bool4_OperatorNotEqual_CompareBoolWithBool4_AreSame( - [Values(false, true)] bool firstArgument) - { - bool4 firstValue = new bool4(firstArgument); - - Assert.AreEqual(new bool4(false), firstValue != firstArgument); - Assert.AreEqual(new bool4(false), firstArgument != firstValue); - } - - [Test] - public void bool4_OperatorNotEqual_CompareBoolWithBool4_AreDifferent( - [Values(false, true)] bool firstArgument) - { - bool4 firstValue = new bool4(!firstArgument); - - Assert.AreEqual(new bool4(true), firstValue != firstArgument); - Assert.AreEqual(new bool4(true), firstArgument != firstValue); - } - - [Test] - public void bool4_OperatorAND_BothBool4_ReturnFalse( - [Values(false, true)] bool argument) - { - bool4 firstValue = new bool4(argument); - bool4 zeroValue = new bool4(false); - - Assert.AreEqual(new bool4(false), firstValue & zeroValue); - } - - [Test] - public void bool4_OperatorAND_BothBool4_ReturnTrue() - { - bool4 firstValue = new bool4(true); - bool4 secondValue = new bool4(true); - - Assert.AreEqual(new bool4(true), firstValue & secondValue); - } - - [Test] - public void bool4_OperatorAND_BoolANDBool4_ReturnFalse( - [Values(false, true)] bool argument) - { - bool4 firstValue = new bool4(argument); - - Assert.AreEqual(new bool4(false), firstValue & false); - Assert.AreEqual(new bool4(false), false & firstValue); - } - - [Test] - public void bool4_OperatorAND_BoolANDBool4_ReturnTrue() - { - bool4 firstValue = new bool4(true); - - Assert.AreEqual(new bool4(true), firstValue & true); - Assert.AreEqual(new bool4(true), true & firstValue); - } - - [Test] - public void bool4_OperatorOR_BothBool4_ReturnFalse() - { - bool4 firstValue = new bool4(false); - bool4 secondValue = new bool4(false); - - Assert.AreEqual(new bool4(false), firstValue | secondValue); - } - - [Test] - public void bool4_OperatorOR_BothBool4_ReturnTrue( - [Values(false, true)] bool argument) - { - bool4 firstValue = new bool4(argument); - bool4 secondValue = new bool4(true); - - Assert.AreEqual(new bool4(true), firstValue | secondValue); - } - - [Test] - public void bool4_OperatorOR_BoolORBool4_ReturnTrue( - [Values(false, true)] bool argument) - { - bool4 firstValue = new bool4(argument); - - Assert.AreEqual(new bool4(true), firstValue | true); - Assert.AreEqual(new bool4(true), true | firstValue); - } - - [Test] - public void bool4_OperatorOR_BoolORBool4_ReturnFalse() - { - bool4 firstValue = new bool4(false); - - Assert.AreEqual(new bool4(false), firstValue | false); - Assert.AreEqual(new bool4(false), false | firstValue); - } - - [Test] - public void bool4_OperatorXOR_BothBool4_ReturnTrue( - [Values(false, true)] bool argument) - { - bool4 firstValue = new bool4(argument); - bool4 secondValue = new bool4(!argument); - - Assert.AreEqual(new bool4(true), firstValue ^ secondValue); - } - - [Test] - public void bool4_OperatorXOR_BothBool4_ReturnFalse( - [Values(false, true)] bool argument) - { - bool4 firstValue = new bool4(argument); - bool4 secondValue = new bool4(argument); - - Assert.AreEqual(new bool4(false), firstValue ^ secondValue); - } - - [Test] - public void bool4_OperatorXOR_BoolORBool4_ReturnTrue( - [Values(false, true)] bool argument) - { - bool4 firstValue = new bool4(argument); - bool notArgument = !argument; - - Assert.AreEqual(new bool4(true), firstValue ^ notArgument); - Assert.AreEqual(new bool4(true), notArgument ^ firstValue); - } - - [Test] - public void bool4_OperatorXOR_BoolORBool4_ReturnFalse( - [Values(false, true)] bool argument) - { - bool4 firstValue = new bool4(argument); - - Assert.AreEqual(new bool4(false), firstValue ^ argument); - Assert.AreEqual(new bool4(false), argument ^ firstValue); - } - [Test] - public void Swizzle_xx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool2(firstArgument,firstArgument), value.xx); - } - - [Test] - public void Swizzle_xy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool2(firstArgument,secondArgument), value.xy); - } - - [Test] - public void Swizzle_xz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool2(firstArgument,thirdArgument), value.xz); - } - - [Test] - public void Swizzle_xw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool2(firstArgument,fourthArgument), value.xw); - } - - [Test] - public void Swizzle_yx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool2(secondArgument,firstArgument), value.yx); - } - - [Test] - public void Swizzle_yy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool2(secondArgument,secondArgument), value.yy); - } - - [Test] - public void Swizzle_yz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool2(secondArgument,thirdArgument), value.yz); - } - - [Test] - public void Swizzle_yw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool2(secondArgument,fourthArgument), value.yw); - } - - [Test] - public void Swizzle_zx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool2(thirdArgument,firstArgument), value.zx); - } - - [Test] - public void Swizzle_zy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool2(thirdArgument,secondArgument), value.zy); - } - - [Test] - public void Swizzle_zz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool2(thirdArgument,thirdArgument), value.zz); - } - - [Test] - public void Swizzle_zw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool2(thirdArgument,fourthArgument), value.zw); - } - - [Test] - public void Swizzle_wx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool2(fourthArgument,firstArgument), value.wx); - } - - [Test] - public void Swizzle_wy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool2(fourthArgument,secondArgument), value.wy); - } - - [Test] - public void Swizzle_wz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool2(fourthArgument,thirdArgument), value.wz); - } - - [Test] - public void Swizzle_ww_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool2(fourthArgument,fourthArgument), value.ww); - } - - [Test] - public void Swizzle_xxx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(firstArgument,firstArgument,firstArgument), value.xxx); - } - - [Test] - public void Swizzle_xxy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(firstArgument,firstArgument,secondArgument), value.xxy); - } - - [Test] - public void Swizzle_xxz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(firstArgument,firstArgument,thirdArgument), value.xxz); - } - - [Test] - public void Swizzle_xxw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(firstArgument,firstArgument,fourthArgument), value.xxw); - } - - [Test] - public void Swizzle_xyx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(firstArgument,secondArgument,firstArgument), value.xyx); - } - - [Test] - public void Swizzle_xyy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(firstArgument,secondArgument,secondArgument), value.xyy); - } - - [Test] - public void Swizzle_xyz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(firstArgument,secondArgument,thirdArgument), value.xyz); - } - - [Test] - public void Swizzle_xyw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(firstArgument,secondArgument,fourthArgument), value.xyw); - } - - [Test] - public void Swizzle_xzx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(firstArgument,thirdArgument,firstArgument), value.xzx); - } - - [Test] - public void Swizzle_xzy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(firstArgument,thirdArgument,secondArgument), value.xzy); - } - - [Test] - public void Swizzle_xzz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(firstArgument,thirdArgument,thirdArgument), value.xzz); - } - - [Test] - public void Swizzle_xzw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(firstArgument,thirdArgument,fourthArgument), value.xzw); - } - - [Test] - public void Swizzle_xwx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(firstArgument,fourthArgument,firstArgument), value.xwx); - } - - [Test] - public void Swizzle_xwy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(firstArgument,fourthArgument,secondArgument), value.xwy); - } - - [Test] - public void Swizzle_xwz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(firstArgument,fourthArgument,thirdArgument), value.xwz); - } - - [Test] - public void Swizzle_xww_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(firstArgument,fourthArgument,fourthArgument), value.xww); - } - - [Test] - public void Swizzle_yxx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(secondArgument,firstArgument,firstArgument), value.yxx); - } - - [Test] - public void Swizzle_yxy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(secondArgument,firstArgument,secondArgument), value.yxy); - } - - [Test] - public void Swizzle_yxz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(secondArgument,firstArgument,thirdArgument), value.yxz); - } - - [Test] - public void Swizzle_yxw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(secondArgument,firstArgument,fourthArgument), value.yxw); - } - - [Test] - public void Swizzle_yyx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(secondArgument,secondArgument,firstArgument), value.yyx); - } - - [Test] - public void Swizzle_yyy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(secondArgument,secondArgument,secondArgument), value.yyy); - } - - [Test] - public void Swizzle_yyz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(secondArgument,secondArgument,thirdArgument), value.yyz); - } - - [Test] - public void Swizzle_yyw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(secondArgument,secondArgument,fourthArgument), value.yyw); - } - - [Test] - public void Swizzle_yzx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(secondArgument,thirdArgument,firstArgument), value.yzx); - } - - [Test] - public void Swizzle_yzy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(secondArgument,thirdArgument,secondArgument), value.yzy); - } - - [Test] - public void Swizzle_yzz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(secondArgument,thirdArgument,thirdArgument), value.yzz); - } - - [Test] - public void Swizzle_yzw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(secondArgument,thirdArgument,fourthArgument), value.yzw); - } - - [Test] - public void Swizzle_ywx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(secondArgument,fourthArgument,firstArgument), value.ywx); - } - - [Test] - public void Swizzle_ywy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(secondArgument,fourthArgument,secondArgument), value.ywy); - } - - [Test] - public void Swizzle_ywz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(secondArgument,fourthArgument,thirdArgument), value.ywz); - } - - [Test] - public void Swizzle_yww_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(secondArgument,fourthArgument,fourthArgument), value.yww); - } - - [Test] - public void Swizzle_zxx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(thirdArgument,firstArgument,firstArgument), value.zxx); - } - - [Test] - public void Swizzle_zxy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(thirdArgument,firstArgument,secondArgument), value.zxy); - } - - [Test] - public void Swizzle_zxz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(thirdArgument,firstArgument,thirdArgument), value.zxz); - } - - [Test] - public void Swizzle_zxw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(thirdArgument,firstArgument,fourthArgument), value.zxw); - } - - [Test] - public void Swizzle_zyx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(thirdArgument,secondArgument,firstArgument), value.zyx); - } - - [Test] - public void Swizzle_zyy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(thirdArgument,secondArgument,secondArgument), value.zyy); - } - - [Test] - public void Swizzle_zyz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(thirdArgument,secondArgument,thirdArgument), value.zyz); - } - - [Test] - public void Swizzle_zyw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(thirdArgument,secondArgument,fourthArgument), value.zyw); - } - - [Test] - public void Swizzle_zzx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(thirdArgument,thirdArgument,firstArgument), value.zzx); - } - - [Test] - public void Swizzle_zzy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(thirdArgument,thirdArgument,secondArgument), value.zzy); - } - - [Test] - public void Swizzle_zzz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(thirdArgument,thirdArgument,thirdArgument), value.zzz); - } - - [Test] - public void Swizzle_zzw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(thirdArgument,thirdArgument,fourthArgument), value.zzw); - } - - [Test] - public void Swizzle_zwx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(thirdArgument,fourthArgument,firstArgument), value.zwx); - } - - [Test] - public void Swizzle_zwy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(thirdArgument,fourthArgument,secondArgument), value.zwy); - } - - [Test] - public void Swizzle_zwz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(thirdArgument,fourthArgument,thirdArgument), value.zwz); - } - - [Test] - public void Swizzle_zww_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(thirdArgument,fourthArgument,fourthArgument), value.zww); - } - - [Test] - public void Swizzle_wxx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(fourthArgument,firstArgument,firstArgument), value.wxx); - } - - [Test] - public void Swizzle_wxy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(fourthArgument,firstArgument,secondArgument), value.wxy); - } - - [Test] - public void Swizzle_wxz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(fourthArgument,firstArgument,thirdArgument), value.wxz); - } - - [Test] - public void Swizzle_wxw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(fourthArgument,firstArgument,fourthArgument), value.wxw); - } - - [Test] - public void Swizzle_wyx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(fourthArgument,secondArgument,firstArgument), value.wyx); - } - - [Test] - public void Swizzle_wyy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(fourthArgument,secondArgument,secondArgument), value.wyy); - } - - [Test] - public void Swizzle_wyz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(fourthArgument,secondArgument,thirdArgument), value.wyz); - } - - [Test] - public void Swizzle_wyw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(fourthArgument,secondArgument,fourthArgument), value.wyw); - } - - [Test] - public void Swizzle_wzx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(fourthArgument,thirdArgument,firstArgument), value.wzx); - } - - [Test] - public void Swizzle_wzy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(fourthArgument,thirdArgument,secondArgument), value.wzy); - } - - [Test] - public void Swizzle_wzz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(fourthArgument,thirdArgument,thirdArgument), value.wzz); - } - - [Test] - public void Swizzle_wzw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(fourthArgument,thirdArgument,fourthArgument), value.wzw); - } - - [Test] - public void Swizzle_wwx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(fourthArgument,fourthArgument,firstArgument), value.wwx); - } - - [Test] - public void Swizzle_wwy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(fourthArgument,fourthArgument,secondArgument), value.wwy); - } - - [Test] - public void Swizzle_wwz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(fourthArgument,fourthArgument,thirdArgument), value.wwz); - } - - [Test] - public void Swizzle_www_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool3(fourthArgument,fourthArgument,fourthArgument), value.www); - } - - [Test] - public void Swizzle_xxxx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,firstArgument,firstArgument,firstArgument), value.xxxx); - } - - [Test] - public void Swizzle_xxxy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,firstArgument,firstArgument,secondArgument), value.xxxy); - } - - [Test] - public void Swizzle_xxxz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,firstArgument,firstArgument,thirdArgument), value.xxxz); - } - - [Test] - public void Swizzle_xxxw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,firstArgument,firstArgument,fourthArgument), value.xxxw); - } - - [Test] - public void Swizzle_xxyx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,firstArgument,secondArgument,firstArgument), value.xxyx); - } - - [Test] - public void Swizzle_xxyy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,firstArgument,secondArgument,secondArgument), value.xxyy); - } - - [Test] - public void Swizzle_xxyz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,firstArgument,secondArgument,thirdArgument), value.xxyz); - } - - [Test] - public void Swizzle_xxyw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,firstArgument,secondArgument,fourthArgument), value.xxyw); - } - - [Test] - public void Swizzle_xxzx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,firstArgument,thirdArgument,firstArgument), value.xxzx); - } - - [Test] - public void Swizzle_xxzy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,firstArgument,thirdArgument,secondArgument), value.xxzy); - } - - [Test] - public void Swizzle_xxzz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,firstArgument,thirdArgument,thirdArgument), value.xxzz); - } - - [Test] - public void Swizzle_xxzw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,firstArgument,thirdArgument,fourthArgument), value.xxzw); - } - - [Test] - public void Swizzle_xxwx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,firstArgument,fourthArgument,firstArgument), value.xxwx); - } - - [Test] - public void Swizzle_xxwy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,firstArgument,fourthArgument,secondArgument), value.xxwy); - } - - [Test] - public void Swizzle_xxwz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,firstArgument,fourthArgument,thirdArgument), value.xxwz); - } - - [Test] - public void Swizzle_xxww_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,firstArgument,fourthArgument,fourthArgument), value.xxww); - } - - [Test] - public void Swizzle_xyxx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,secondArgument,firstArgument,firstArgument), value.xyxx); - } - - [Test] - public void Swizzle_xyxy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,secondArgument,firstArgument,secondArgument), value.xyxy); - } - - [Test] - public void Swizzle_xyxz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,secondArgument,firstArgument,thirdArgument), value.xyxz); - } - - [Test] - public void Swizzle_xyxw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,secondArgument,firstArgument,fourthArgument), value.xyxw); - } - - [Test] - public void Swizzle_xyyx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,secondArgument,secondArgument,firstArgument), value.xyyx); - } - - [Test] - public void Swizzle_xyyy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,secondArgument,secondArgument,secondArgument), value.xyyy); - } - - [Test] - public void Swizzle_xyyz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,secondArgument,secondArgument,thirdArgument), value.xyyz); - } - - [Test] - public void Swizzle_xyyw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,secondArgument,secondArgument,fourthArgument), value.xyyw); - } - - [Test] - public void Swizzle_xyzx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,secondArgument,thirdArgument,firstArgument), value.xyzx); - } - - [Test] - public void Swizzle_xyzy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,secondArgument,thirdArgument,secondArgument), value.xyzy); - } - - [Test] - public void Swizzle_xyzz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,secondArgument,thirdArgument,thirdArgument), value.xyzz); - } - - [Test] - public void Swizzle_xyzw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,secondArgument,thirdArgument,fourthArgument), value.xyzw); - } - - [Test] - public void Swizzle_xywx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,secondArgument,fourthArgument,firstArgument), value.xywx); - } - - [Test] - public void Swizzle_xywy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,secondArgument,fourthArgument,secondArgument), value.xywy); - } - - [Test] - public void Swizzle_xywz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,secondArgument,fourthArgument,thirdArgument), value.xywz); - } - - [Test] - public void Swizzle_xyww_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,secondArgument,fourthArgument,fourthArgument), value.xyww); - } - - [Test] - public void Swizzle_xzxx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,thirdArgument,firstArgument,firstArgument), value.xzxx); - } - - [Test] - public void Swizzle_xzxy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,thirdArgument,firstArgument,secondArgument), value.xzxy); - } - - [Test] - public void Swizzle_xzxz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,thirdArgument,firstArgument,thirdArgument), value.xzxz); - } - - [Test] - public void Swizzle_xzxw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,thirdArgument,firstArgument,fourthArgument), value.xzxw); - } - - [Test] - public void Swizzle_xzyx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,thirdArgument,secondArgument,firstArgument), value.xzyx); - } - - [Test] - public void Swizzle_xzyy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,thirdArgument,secondArgument,secondArgument), value.xzyy); - } - - [Test] - public void Swizzle_xzyz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,thirdArgument,secondArgument,thirdArgument), value.xzyz); - } - - [Test] - public void Swizzle_xzyw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,thirdArgument,secondArgument,fourthArgument), value.xzyw); - } - - [Test] - public void Swizzle_xzzx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,thirdArgument,thirdArgument,firstArgument), value.xzzx); - } - - [Test] - public void Swizzle_xzzy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,thirdArgument,thirdArgument,secondArgument), value.xzzy); - } - - [Test] - public void Swizzle_xzzz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,thirdArgument,thirdArgument,thirdArgument), value.xzzz); - } - - [Test] - public void Swizzle_xzzw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,thirdArgument,thirdArgument,fourthArgument), value.xzzw); - } - - [Test] - public void Swizzle_xzwx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,thirdArgument,fourthArgument,firstArgument), value.xzwx); - } - - [Test] - public void Swizzle_xzwy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,thirdArgument,fourthArgument,secondArgument), value.xzwy); - } - - [Test] - public void Swizzle_xzwz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,thirdArgument,fourthArgument,thirdArgument), value.xzwz); - } - - [Test] - public void Swizzle_xzww_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,thirdArgument,fourthArgument,fourthArgument), value.xzww); - } - - [Test] - public void Swizzle_xwxx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,fourthArgument,firstArgument,firstArgument), value.xwxx); - } - - [Test] - public void Swizzle_xwxy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,fourthArgument,firstArgument,secondArgument), value.xwxy); - } - - [Test] - public void Swizzle_xwxz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,fourthArgument,firstArgument,thirdArgument), value.xwxz); - } - - [Test] - public void Swizzle_xwxw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,fourthArgument,firstArgument,fourthArgument), value.xwxw); - } - - [Test] - public void Swizzle_xwyx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,fourthArgument,secondArgument,firstArgument), value.xwyx); - } - - [Test] - public void Swizzle_xwyy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,fourthArgument,secondArgument,secondArgument), value.xwyy); - } - - [Test] - public void Swizzle_xwyz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,fourthArgument,secondArgument,thirdArgument), value.xwyz); - } - - [Test] - public void Swizzle_xwyw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,fourthArgument,secondArgument,fourthArgument), value.xwyw); - } - - [Test] - public void Swizzle_xwzx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,fourthArgument,thirdArgument,firstArgument), value.xwzx); - } - - [Test] - public void Swizzle_xwzy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,fourthArgument,thirdArgument,secondArgument), value.xwzy); - } - - [Test] - public void Swizzle_xwzz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,fourthArgument,thirdArgument,thirdArgument), value.xwzz); - } - - [Test] - public void Swizzle_xwzw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,fourthArgument,thirdArgument,fourthArgument), value.xwzw); - } - - [Test] - public void Swizzle_xwwx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,fourthArgument,fourthArgument,firstArgument), value.xwwx); - } - - [Test] - public void Swizzle_xwwy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,fourthArgument,fourthArgument,secondArgument), value.xwwy); - } - - [Test] - public void Swizzle_xwwz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,fourthArgument,fourthArgument,thirdArgument), value.xwwz); - } - - [Test] - public void Swizzle_xwww_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(firstArgument,fourthArgument,fourthArgument,fourthArgument), value.xwww); - } - - [Test] - public void Swizzle_yxxx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,firstArgument,firstArgument,firstArgument), value.yxxx); - } - - [Test] - public void Swizzle_yxxy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,firstArgument,firstArgument,secondArgument), value.yxxy); - } - - [Test] - public void Swizzle_yxxz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,firstArgument,firstArgument,thirdArgument), value.yxxz); - } - - [Test] - public void Swizzle_yxxw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,firstArgument,firstArgument,fourthArgument), value.yxxw); - } - - [Test] - public void Swizzle_yxyx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,firstArgument,secondArgument,firstArgument), value.yxyx); - } - - [Test] - public void Swizzle_yxyy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,firstArgument,secondArgument,secondArgument), value.yxyy); - } - - [Test] - public void Swizzle_yxyz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,firstArgument,secondArgument,thirdArgument), value.yxyz); - } - - [Test] - public void Swizzle_yxyw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,firstArgument,secondArgument,fourthArgument), value.yxyw); - } - - [Test] - public void Swizzle_yxzx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,firstArgument,thirdArgument,firstArgument), value.yxzx); - } - - [Test] - public void Swizzle_yxzy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,firstArgument,thirdArgument,secondArgument), value.yxzy); - } - - [Test] - public void Swizzle_yxzz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,firstArgument,thirdArgument,thirdArgument), value.yxzz); - } - - [Test] - public void Swizzle_yxzw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,firstArgument,thirdArgument,fourthArgument), value.yxzw); - } - - [Test] - public void Swizzle_yxwx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,firstArgument,fourthArgument,firstArgument), value.yxwx); - } - - [Test] - public void Swizzle_yxwy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,firstArgument,fourthArgument,secondArgument), value.yxwy); - } - - [Test] - public void Swizzle_yxwz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,firstArgument,fourthArgument,thirdArgument), value.yxwz); - } - - [Test] - public void Swizzle_yxww_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,firstArgument,fourthArgument,fourthArgument), value.yxww); - } - - [Test] - public void Swizzle_yyxx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,secondArgument,firstArgument,firstArgument), value.yyxx); - } - - [Test] - public void Swizzle_yyxy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,secondArgument,firstArgument,secondArgument), value.yyxy); - } - - [Test] - public void Swizzle_yyxz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,secondArgument,firstArgument,thirdArgument), value.yyxz); - } - - [Test] - public void Swizzle_yyxw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,secondArgument,firstArgument,fourthArgument), value.yyxw); - } - - [Test] - public void Swizzle_yyyx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,secondArgument,secondArgument,firstArgument), value.yyyx); - } - - [Test] - public void Swizzle_yyyy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,secondArgument,secondArgument,secondArgument), value.yyyy); - } - - [Test] - public void Swizzle_yyyz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,secondArgument,secondArgument,thirdArgument), value.yyyz); - } - - [Test] - public void Swizzle_yyyw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,secondArgument,secondArgument,fourthArgument), value.yyyw); - } - - [Test] - public void Swizzle_yyzx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,secondArgument,thirdArgument,firstArgument), value.yyzx); - } - - [Test] - public void Swizzle_yyzy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,secondArgument,thirdArgument,secondArgument), value.yyzy); - } - - [Test] - public void Swizzle_yyzz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,secondArgument,thirdArgument,thirdArgument), value.yyzz); - } - - [Test] - public void Swizzle_yyzw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,secondArgument,thirdArgument,fourthArgument), value.yyzw); - } - - [Test] - public void Swizzle_yywx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,secondArgument,fourthArgument,firstArgument), value.yywx); - } - - [Test] - public void Swizzle_yywy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,secondArgument,fourthArgument,secondArgument), value.yywy); - } - - [Test] - public void Swizzle_yywz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,secondArgument,fourthArgument,thirdArgument), value.yywz); - } - - [Test] - public void Swizzle_yyww_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,secondArgument,fourthArgument,fourthArgument), value.yyww); - } - - [Test] - public void Swizzle_yzxx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,thirdArgument,firstArgument,firstArgument), value.yzxx); - } - - [Test] - public void Swizzle_yzxy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,thirdArgument,firstArgument,secondArgument), value.yzxy); - } - - [Test] - public void Swizzle_yzxz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,thirdArgument,firstArgument,thirdArgument), value.yzxz); - } - - [Test] - public void Swizzle_yzxw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,thirdArgument,firstArgument,fourthArgument), value.yzxw); - } - - [Test] - public void Swizzle_yzyx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,thirdArgument,secondArgument,firstArgument), value.yzyx); - } - - [Test] - public void Swizzle_yzyy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,thirdArgument,secondArgument,secondArgument), value.yzyy); - } - - [Test] - public void Swizzle_yzyz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,thirdArgument,secondArgument,thirdArgument), value.yzyz); - } - - [Test] - public void Swizzle_yzyw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,thirdArgument,secondArgument,fourthArgument), value.yzyw); - } - - [Test] - public void Swizzle_yzzx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,thirdArgument,thirdArgument,firstArgument), value.yzzx); - } - - [Test] - public void Swizzle_yzzy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,thirdArgument,thirdArgument,secondArgument), value.yzzy); - } - - [Test] - public void Swizzle_yzzz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,thirdArgument,thirdArgument,thirdArgument), value.yzzz); - } - - [Test] - public void Swizzle_yzzw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,thirdArgument,thirdArgument,fourthArgument), value.yzzw); - } - - [Test] - public void Swizzle_yzwx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,thirdArgument,fourthArgument,firstArgument), value.yzwx); - } - - [Test] - public void Swizzle_yzwy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,thirdArgument,fourthArgument,secondArgument), value.yzwy); - } - - [Test] - public void Swizzle_yzwz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,thirdArgument,fourthArgument,thirdArgument), value.yzwz); - } - - [Test] - public void Swizzle_yzww_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,thirdArgument,fourthArgument,fourthArgument), value.yzww); - } - - [Test] - public void Swizzle_ywxx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,fourthArgument,firstArgument,firstArgument), value.ywxx); - } - - [Test] - public void Swizzle_ywxy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,fourthArgument,firstArgument,secondArgument), value.ywxy); - } - - [Test] - public void Swizzle_ywxz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,fourthArgument,firstArgument,thirdArgument), value.ywxz); - } - - [Test] - public void Swizzle_ywxw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,fourthArgument,firstArgument,fourthArgument), value.ywxw); - } - - [Test] - public void Swizzle_ywyx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,fourthArgument,secondArgument,firstArgument), value.ywyx); - } - - [Test] - public void Swizzle_ywyy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,fourthArgument,secondArgument,secondArgument), value.ywyy); - } - - [Test] - public void Swizzle_ywyz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,fourthArgument,secondArgument,thirdArgument), value.ywyz); - } - - [Test] - public void Swizzle_ywyw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,fourthArgument,secondArgument,fourthArgument), value.ywyw); - } - - [Test] - public void Swizzle_ywzx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,fourthArgument,thirdArgument,firstArgument), value.ywzx); - } - - [Test] - public void Swizzle_ywzy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,fourthArgument,thirdArgument,secondArgument), value.ywzy); - } - - [Test] - public void Swizzle_ywzz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,fourthArgument,thirdArgument,thirdArgument), value.ywzz); - } - - [Test] - public void Swizzle_ywzw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,fourthArgument,thirdArgument,fourthArgument), value.ywzw); - } - - [Test] - public void Swizzle_ywwx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,fourthArgument,fourthArgument,firstArgument), value.ywwx); - } - - [Test] - public void Swizzle_ywwy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,fourthArgument,fourthArgument,secondArgument), value.ywwy); - } - - [Test] - public void Swizzle_ywwz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,fourthArgument,fourthArgument,thirdArgument), value.ywwz); - } - - [Test] - public void Swizzle_ywww_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(secondArgument,fourthArgument,fourthArgument,fourthArgument), value.ywww); - } - - [Test] - public void Swizzle_zxxx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,firstArgument,firstArgument,firstArgument), value.zxxx); - } - - [Test] - public void Swizzle_zxxy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,firstArgument,firstArgument,secondArgument), value.zxxy); - } - - [Test] - public void Swizzle_zxxz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,firstArgument,firstArgument,thirdArgument), value.zxxz); - } - - [Test] - public void Swizzle_zxxw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,firstArgument,firstArgument,fourthArgument), value.zxxw); - } - - [Test] - public void Swizzle_zxyx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,firstArgument,secondArgument,firstArgument), value.zxyx); - } - - [Test] - public void Swizzle_zxyy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,firstArgument,secondArgument,secondArgument), value.zxyy); - } - - [Test] - public void Swizzle_zxyz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,firstArgument,secondArgument,thirdArgument), value.zxyz); - } - - [Test] - public void Swizzle_zxyw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,firstArgument,secondArgument,fourthArgument), value.zxyw); - } - - [Test] - public void Swizzle_zxzx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,firstArgument,thirdArgument,firstArgument), value.zxzx); - } - - [Test] - public void Swizzle_zxzy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,firstArgument,thirdArgument,secondArgument), value.zxzy); - } - - [Test] - public void Swizzle_zxzz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,firstArgument,thirdArgument,thirdArgument), value.zxzz); - } - - [Test] - public void Swizzle_zxzw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,firstArgument,thirdArgument,fourthArgument), value.zxzw); - } - - [Test] - public void Swizzle_zxwx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,firstArgument,fourthArgument,firstArgument), value.zxwx); - } - - [Test] - public void Swizzle_zxwy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,firstArgument,fourthArgument,secondArgument), value.zxwy); - } - - [Test] - public void Swizzle_zxwz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,firstArgument,fourthArgument,thirdArgument), value.zxwz); - } - - [Test] - public void Swizzle_zxww_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,firstArgument,fourthArgument,fourthArgument), value.zxww); - } - - [Test] - public void Swizzle_zyxx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,secondArgument,firstArgument,firstArgument), value.zyxx); - } - - [Test] - public void Swizzle_zyxy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,secondArgument,firstArgument,secondArgument), value.zyxy); - } - - [Test] - public void Swizzle_zyxz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,secondArgument,firstArgument,thirdArgument), value.zyxz); - } - - [Test] - public void Swizzle_zyxw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,secondArgument,firstArgument,fourthArgument), value.zyxw); - } - - [Test] - public void Swizzle_zyyx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,secondArgument,secondArgument,firstArgument), value.zyyx); - } - - [Test] - public void Swizzle_zyyy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,secondArgument,secondArgument,secondArgument), value.zyyy); - } - - [Test] - public void Swizzle_zyyz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,secondArgument,secondArgument,thirdArgument), value.zyyz); - } - - [Test] - public void Swizzle_zyyw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,secondArgument,secondArgument,fourthArgument), value.zyyw); - } - - [Test] - public void Swizzle_zyzx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,secondArgument,thirdArgument,firstArgument), value.zyzx); - } - - [Test] - public void Swizzle_zyzy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,secondArgument,thirdArgument,secondArgument), value.zyzy); - } - - [Test] - public void Swizzle_zyzz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,secondArgument,thirdArgument,thirdArgument), value.zyzz); - } - - [Test] - public void Swizzle_zyzw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,secondArgument,thirdArgument,fourthArgument), value.zyzw); - } - - [Test] - public void Swizzle_zywx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,secondArgument,fourthArgument,firstArgument), value.zywx); - } - - [Test] - public void Swizzle_zywy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,secondArgument,fourthArgument,secondArgument), value.zywy); - } - - [Test] - public void Swizzle_zywz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,secondArgument,fourthArgument,thirdArgument), value.zywz); - } - - [Test] - public void Swizzle_zyww_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,secondArgument,fourthArgument,fourthArgument), value.zyww); - } - - [Test] - public void Swizzle_zzxx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,thirdArgument,firstArgument,firstArgument), value.zzxx); - } - - [Test] - public void Swizzle_zzxy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,thirdArgument,firstArgument,secondArgument), value.zzxy); - } - - [Test] - public void Swizzle_zzxz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,thirdArgument,firstArgument,thirdArgument), value.zzxz); - } - - [Test] - public void Swizzle_zzxw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,thirdArgument,firstArgument,fourthArgument), value.zzxw); - } - - [Test] - public void Swizzle_zzyx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,thirdArgument,secondArgument,firstArgument), value.zzyx); - } - - [Test] - public void Swizzle_zzyy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,thirdArgument,secondArgument,secondArgument), value.zzyy); - } - - [Test] - public void Swizzle_zzyz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,thirdArgument,secondArgument,thirdArgument), value.zzyz); - } - - [Test] - public void Swizzle_zzyw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,thirdArgument,secondArgument,fourthArgument), value.zzyw); - } - - [Test] - public void Swizzle_zzzx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,thirdArgument,thirdArgument,firstArgument), value.zzzx); - } - - [Test] - public void Swizzle_zzzy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,thirdArgument,thirdArgument,secondArgument), value.zzzy); - } - - [Test] - public void Swizzle_zzzz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,thirdArgument,thirdArgument,thirdArgument), value.zzzz); - } - - [Test] - public void Swizzle_zzzw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,thirdArgument,thirdArgument,fourthArgument), value.zzzw); - } - - [Test] - public void Swizzle_zzwx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,thirdArgument,fourthArgument,firstArgument), value.zzwx); - } - - [Test] - public void Swizzle_zzwy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,thirdArgument,fourthArgument,secondArgument), value.zzwy); - } - - [Test] - public void Swizzle_zzwz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,thirdArgument,fourthArgument,thirdArgument), value.zzwz); - } - - [Test] - public void Swizzle_zzww_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,thirdArgument,fourthArgument,fourthArgument), value.zzww); - } - - [Test] - public void Swizzle_zwxx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,fourthArgument,firstArgument,firstArgument), value.zwxx); - } - - [Test] - public void Swizzle_zwxy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,fourthArgument,firstArgument,secondArgument), value.zwxy); - } - - [Test] - public void Swizzle_zwxz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,fourthArgument,firstArgument,thirdArgument), value.zwxz); - } - - [Test] - public void Swizzle_zwxw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,fourthArgument,firstArgument,fourthArgument), value.zwxw); - } - - [Test] - public void Swizzle_zwyx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,fourthArgument,secondArgument,firstArgument), value.zwyx); - } - - [Test] - public void Swizzle_zwyy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,fourthArgument,secondArgument,secondArgument), value.zwyy); - } - - [Test] - public void Swizzle_zwyz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,fourthArgument,secondArgument,thirdArgument), value.zwyz); - } - - [Test] - public void Swizzle_zwyw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,fourthArgument,secondArgument,fourthArgument), value.zwyw); - } - - [Test] - public void Swizzle_zwzx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,fourthArgument,thirdArgument,firstArgument), value.zwzx); - } - - [Test] - public void Swizzle_zwzy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,fourthArgument,thirdArgument,secondArgument), value.zwzy); - } - - [Test] - public void Swizzle_zwzz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,fourthArgument,thirdArgument,thirdArgument), value.zwzz); - } - - [Test] - public void Swizzle_zwzw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,fourthArgument,thirdArgument,fourthArgument), value.zwzw); - } - - [Test] - public void Swizzle_zwwx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,fourthArgument,fourthArgument,firstArgument), value.zwwx); - } - - [Test] - public void Swizzle_zwwy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,fourthArgument,fourthArgument,secondArgument), value.zwwy); - } - - [Test] - public void Swizzle_zwwz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,fourthArgument,fourthArgument,thirdArgument), value.zwwz); - } - - [Test] - public void Swizzle_zwww_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(thirdArgument,fourthArgument,fourthArgument,fourthArgument), value.zwww); - } - - [Test] - public void Swizzle_wxxx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,firstArgument,firstArgument,firstArgument), value.wxxx); - } - - [Test] - public void Swizzle_wxxy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,firstArgument,firstArgument,secondArgument), value.wxxy); - } - - [Test] - public void Swizzle_wxxz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,firstArgument,firstArgument,thirdArgument), value.wxxz); - } - - [Test] - public void Swizzle_wxxw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,firstArgument,firstArgument,fourthArgument), value.wxxw); - } - - [Test] - public void Swizzle_wxyx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,firstArgument,secondArgument,firstArgument), value.wxyx); - } - - [Test] - public void Swizzle_wxyy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,firstArgument,secondArgument,secondArgument), value.wxyy); - } - - [Test] - public void Swizzle_wxyz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,firstArgument,secondArgument,thirdArgument), value.wxyz); - } - - [Test] - public void Swizzle_wxyw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,firstArgument,secondArgument,fourthArgument), value.wxyw); - } - - [Test] - public void Swizzle_wxzx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,firstArgument,thirdArgument,firstArgument), value.wxzx); - } - - [Test] - public void Swizzle_wxzy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,firstArgument,thirdArgument,secondArgument), value.wxzy); - } - - [Test] - public void Swizzle_wxzz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,firstArgument,thirdArgument,thirdArgument), value.wxzz); - } - - [Test] - public void Swizzle_wxzw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,firstArgument,thirdArgument,fourthArgument), value.wxzw); - } - - [Test] - public void Swizzle_wxwx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,firstArgument,fourthArgument,firstArgument), value.wxwx); - } - - [Test] - public void Swizzle_wxwy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,firstArgument,fourthArgument,secondArgument), value.wxwy); - } - - [Test] - public void Swizzle_wxwz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,firstArgument,fourthArgument,thirdArgument), value.wxwz); - } - - [Test] - public void Swizzle_wxww_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,firstArgument,fourthArgument,fourthArgument), value.wxww); - } - - [Test] - public void Swizzle_wyxx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,secondArgument,firstArgument,firstArgument), value.wyxx); - } - - [Test] - public void Swizzle_wyxy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,secondArgument,firstArgument,secondArgument), value.wyxy); - } - - [Test] - public void Swizzle_wyxz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,secondArgument,firstArgument,thirdArgument), value.wyxz); - } - - [Test] - public void Swizzle_wyxw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,secondArgument,firstArgument,fourthArgument), value.wyxw); - } - - [Test] - public void Swizzle_wyyx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,secondArgument,secondArgument,firstArgument), value.wyyx); - } - - [Test] - public void Swizzle_wyyy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,secondArgument,secondArgument,secondArgument), value.wyyy); - } - - [Test] - public void Swizzle_wyyz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,secondArgument,secondArgument,thirdArgument), value.wyyz); - } - - [Test] - public void Swizzle_wyyw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,secondArgument,secondArgument,fourthArgument), value.wyyw); - } - - [Test] - public void Swizzle_wyzx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,secondArgument,thirdArgument,firstArgument), value.wyzx); - } - - [Test] - public void Swizzle_wyzy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,secondArgument,thirdArgument,secondArgument), value.wyzy); - } - - [Test] - public void Swizzle_wyzz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,secondArgument,thirdArgument,thirdArgument), value.wyzz); - } - - [Test] - public void Swizzle_wyzw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,secondArgument,thirdArgument,fourthArgument), value.wyzw); - } - - [Test] - public void Swizzle_wywx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,secondArgument,fourthArgument,firstArgument), value.wywx); - } - - [Test] - public void Swizzle_wywy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,secondArgument,fourthArgument,secondArgument), value.wywy); - } - - [Test] - public void Swizzle_wywz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,secondArgument,fourthArgument,thirdArgument), value.wywz); - } - - [Test] - public void Swizzle_wyww_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,secondArgument,fourthArgument,fourthArgument), value.wyww); - } - - [Test] - public void Swizzle_wzxx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,thirdArgument,firstArgument,firstArgument), value.wzxx); - } - - [Test] - public void Swizzle_wzxy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,thirdArgument,firstArgument,secondArgument), value.wzxy); - } - - [Test] - public void Swizzle_wzxz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,thirdArgument,firstArgument,thirdArgument), value.wzxz); - } - - [Test] - public void Swizzle_wzxw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,thirdArgument,firstArgument,fourthArgument), value.wzxw); - } - - [Test] - public void Swizzle_wzyx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,thirdArgument,secondArgument,firstArgument), value.wzyx); - } - - [Test] - public void Swizzle_wzyy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,thirdArgument,secondArgument,secondArgument), value.wzyy); - } - - [Test] - public void Swizzle_wzyz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,thirdArgument,secondArgument,thirdArgument), value.wzyz); - } - - [Test] - public void Swizzle_wzyw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,thirdArgument,secondArgument,fourthArgument), value.wzyw); - } - - [Test] - public void Swizzle_wzzx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,thirdArgument,thirdArgument,firstArgument), value.wzzx); - } - - [Test] - public void Swizzle_wzzy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,thirdArgument,thirdArgument,secondArgument), value.wzzy); - } - - [Test] - public void Swizzle_wzzz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,thirdArgument,thirdArgument,thirdArgument), value.wzzz); - } - - [Test] - public void Swizzle_wzzw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,thirdArgument,thirdArgument,fourthArgument), value.wzzw); - } - - [Test] - public void Swizzle_wzwx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,thirdArgument,fourthArgument,firstArgument), value.wzwx); - } - - [Test] - public void Swizzle_wzwy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,thirdArgument,fourthArgument,secondArgument), value.wzwy); - } - - [Test] - public void Swizzle_wzwz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,thirdArgument,fourthArgument,thirdArgument), value.wzwz); - } - - [Test] - public void Swizzle_wzww_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,thirdArgument,fourthArgument,fourthArgument), value.wzww); - } - - [Test] - public void Swizzle_wwxx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,fourthArgument,firstArgument,firstArgument), value.wwxx); - } - - [Test] - public void Swizzle_wwxy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,fourthArgument,firstArgument,secondArgument), value.wwxy); - } - - [Test] - public void Swizzle_wwxz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,fourthArgument,firstArgument,thirdArgument), value.wwxz); - } - - [Test] - public void Swizzle_wwxw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,fourthArgument,firstArgument,fourthArgument), value.wwxw); - } - - [Test] - public void Swizzle_wwyx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,fourthArgument,secondArgument,firstArgument), value.wwyx); - } - - [Test] - public void Swizzle_wwyy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,fourthArgument,secondArgument,secondArgument), value.wwyy); - } - - [Test] - public void Swizzle_wwyz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,fourthArgument,secondArgument,thirdArgument), value.wwyz); - } - - [Test] - public void Swizzle_wwyw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,fourthArgument,secondArgument,fourthArgument), value.wwyw); - } - - [Test] - public void Swizzle_wwzx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,fourthArgument,thirdArgument,firstArgument), value.wwzx); - } - - [Test] - public void Swizzle_wwzy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,fourthArgument,thirdArgument,secondArgument), value.wwzy); - } - - [Test] - public void Swizzle_wwzz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,fourthArgument,thirdArgument,thirdArgument), value.wwzz); - } - - [Test] - public void Swizzle_wwzw_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,fourthArgument,thirdArgument,fourthArgument), value.wwzw); - } - - [Test] - public void Swizzle_wwwx_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,fourthArgument,fourthArgument,firstArgument), value.wwwx); - } - - [Test] - public void Swizzle_wwwy_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,fourthArgument,fourthArgument,secondArgument), value.wwwy); - } - - [Test] - public void Swizzle_wwwz_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,fourthArgument,fourthArgument,thirdArgument), value.wwwz); - } - - [Test] - public void Swizzle_wwww_SameValues( - [Values(false,true)] bool firstArgument, - [Values(false,true)] bool secondArgument, - [Values(false,true)] bool thirdArgument, - [Values(false,true)] bool fourthArgument) - { - bool4 value = new bool4(firstArgument, secondArgument, thirdArgument, fourthArgument); - Assert.AreEqual(new bool4(fourthArgument,fourthArgument,fourthArgument,fourthArgument), value.wwww); - } - } -} diff --git a/src/Unity.Mathematics.Tests/Unity.Mathematics.Tests.asmdef b/src/Unity.Mathematics.Tests/Unity.Mathematics.Tests.asmdef deleted file mode 100644 index 7b8dd5db..00000000 --- a/src/Unity.Mathematics.Tests/Unity.Mathematics.Tests.asmdef +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "Unity.Mathematics.Tests", - "optionalUnityReferences": [ - "TestAssemblies" - ], - "references": [ - "Unity.Mathematics" - ], - "includePlatforms": [ - "Editor" - ] -} diff --git a/src/Unity.Mathematics.Tests/packages.config b/src/Unity.Mathematics.Tests/packages.config deleted file mode 100644 index 01feaf46..00000000 --- a/src/Unity.Mathematics.Tests/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/Unity.Mathematics.sln b/src/Unity.Mathematics.sln index 70360aca..2af7740a 100644 --- a/src/Unity.Mathematics.sln +++ b/src/Unity.Mathematics.sln @@ -1,18 +1,20 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29806.167 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.Mathematics", "Unity.Mathematics\Unity.Mathematics.csproj", "{19810344-7387-4155-935F-BDD5CC61F0BF}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.Mathematics.CodeGen", "Unity.Mathematics.CodeGen\Unity.Mathematics.CodeGen.csproj", "{293EBCD6-CACD-4DA8-A518-FBC629268C0F}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "General", "General", "{B11ECCE1-1A78-40B2-956F-CBE615FF5DF9}" ProjectSection(SolutionItems) = preProject + CHANGELOG.md = CHANGELOG.md + package.json = package.json ..\readme.md = ..\readme.md EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.Mathematics.Tests", "Unity.Mathematics.Tests\Unity.Mathematics.Tests.csproj", "{2E7C74D3-42F1-482F-8BB7-E199D9E3B412}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.Mathematics.Tests", "Tests\Unity.Mathematics.Tests.csproj", "{2E7C74D3-42F1-482F-8BB7-E199D9E3B412}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.Mathematics.CodeGen", "Unity.Mathematics.CodeGen~\Unity.Mathematics.CodeGen.csproj", "{293EBCD6-CACD-4DA8-A518-FBC629268C0F}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -26,28 +28,16 @@ Global GlobalSection(ProjectConfigurationPlatforms) = postSolution {19810344-7387-4155-935F-BDD5CC61F0BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {19810344-7387-4155-935F-BDD5CC61F0BF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {19810344-7387-4155-935F-BDD5CC61F0BF}.Debug|x64.ActiveCfg = Debug|x64 - {19810344-7387-4155-935F-BDD5CC61F0BF}.Debug|x64.Build.0 = Debug|x64 + {19810344-7387-4155-935F-BDD5CC61F0BF}.Debug|x64.ActiveCfg = Debug|Any CPU + {19810344-7387-4155-935F-BDD5CC61F0BF}.Debug|x64.Build.0 = Debug|Any CPU {19810344-7387-4155-935F-BDD5CC61F0BF}.Debug|x86.ActiveCfg = Debug|Any CPU {19810344-7387-4155-935F-BDD5CC61F0BF}.Debug|x86.Build.0 = Debug|Any CPU {19810344-7387-4155-935F-BDD5CC61F0BF}.Release|Any CPU.ActiveCfg = Release|Any CPU {19810344-7387-4155-935F-BDD5CC61F0BF}.Release|Any CPU.Build.0 = Release|Any CPU - {19810344-7387-4155-935F-BDD5CC61F0BF}.Release|x64.ActiveCfg = Release|x64 - {19810344-7387-4155-935F-BDD5CC61F0BF}.Release|x64.Build.0 = Release|x64 + {19810344-7387-4155-935F-BDD5CC61F0BF}.Release|x64.ActiveCfg = Release|Any CPU + {19810344-7387-4155-935F-BDD5CC61F0BF}.Release|x64.Build.0 = Release|Any CPU {19810344-7387-4155-935F-BDD5CC61F0BF}.Release|x86.ActiveCfg = Release|Any CPU {19810344-7387-4155-935F-BDD5CC61F0BF}.Release|x86.Build.0 = Release|Any CPU - {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Debug|x64.ActiveCfg = Debug|x64 - {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Debug|x64.Build.0 = Debug|x64 - {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Debug|x86.ActiveCfg = Debug|Any CPU - {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Debug|x86.Build.0 = Debug|Any CPU - {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Release|Any CPU.Build.0 = Release|Any CPU - {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Release|x64.ActiveCfg = Release|x64 - {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Release|x64.Build.0 = Release|x64 - {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Release|x86.ActiveCfg = Release|Any CPU - {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Release|x86.Build.0 = Release|Any CPU {2E7C74D3-42F1-482F-8BB7-E199D9E3B412}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2E7C74D3-42F1-482F-8BB7-E199D9E3B412}.Debug|Any CPU.Build.0 = Debug|Any CPU {2E7C74D3-42F1-482F-8BB7-E199D9E3B412}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -60,8 +50,23 @@ Global {2E7C74D3-42F1-482F-8BB7-E199D9E3B412}.Release|x64.Build.0 = Release|Any CPU {2E7C74D3-42F1-482F-8BB7-E199D9E3B412}.Release|x86.ActiveCfg = Release|Any CPU {2E7C74D3-42F1-482F-8BB7-E199D9E3B412}.Release|x86.Build.0 = Release|Any CPU + {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Debug|x64.ActiveCfg = Debug|Any CPU + {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Debug|x64.Build.0 = Debug|Any CPU + {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Debug|x86.ActiveCfg = Debug|Any CPU + {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Debug|x86.Build.0 = Debug|Any CPU + {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Release|Any CPU.Build.0 = Release|Any CPU + {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Release|x64.ActiveCfg = Release|Any CPU + {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Release|x64.Build.0 = Release|Any CPU + {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Release|x86.ActiveCfg = Release|Any CPU + {293EBCD6-CACD-4DA8-A518-FBC629268C0F}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {644285FA-DECE-4BCC-8345-3DA015012412} + EndGlobalSection EndGlobal diff --git a/src/Unity.Mathematics.sln.meta b/src/Unity.Mathematics.sln.meta new file mode 100644 index 00000000..3c0c80c7 --- /dev/null +++ b/src/Unity.Mathematics.sln.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: a7424524b11ff534ca46c90122741ac4 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/Geometry.meta b/src/Unity.Mathematics/Geometry.meta new file mode 100644 index 00000000..b0af7ef0 --- /dev/null +++ b/src/Unity.Mathematics/Geometry.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8179f9b7bb3904f5ba86140bea0a128b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/Geometry/MinMaxAABB.cs b/src/Unity.Mathematics/Geometry/MinMaxAABB.cs new file mode 100644 index 00000000..6b5b666d --- /dev/null +++ b/src/Unity.Mathematics/Geometry/MinMaxAABB.cs @@ -0,0 +1,322 @@ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; +using static Unity.Mathematics.math; + +namespace Unity.Mathematics.Geometry +{ + /// + /// Axis aligned bounding box (AABB) stored in min and max form. + /// + /// + /// Axis aligned bounding boxes (AABB) are boxes where each side is parallel with one of the Cartesian coordinate axes + /// X, Y, and Z. AABBs are useful for approximating the region an object (or collection of objects) occupies and quickly + /// testing whether or not that object (or collection of objects) is relevant. Because they are axis aligned, they + /// are very cheap to construct and perform overlap tests with them. + /// + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public struct MinMaxAABB : IEquatable + { + /// + /// The minimum point contained by the AABB. + /// + /// + /// If any component of is greater than then this AABB is invalid. + /// + /// + public float3 Min; + + /// + /// The maximum point contained by the AABB. + /// + /// + /// If any component of is less than then this AABB is invalid. + /// + /// + public float3 Max; + + /// + /// Constructs the AABB with the given minimum and maximum. + /// + /// + /// If you have a center and extents, you can call or + /// to create the AABB. + /// + /// Minimum point inside AABB. + /// Maximum point inside AABB. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public MinMaxAABB(float3 min, float3 max) + { + Min = min; + Max = max; + } + + /// + /// Creates the AABB from a center and extents. + /// + /// + /// This function takes full extents. It is the distance between and . + /// If you have half extents, you can call . + /// + /// Center of AABB. + /// Full extents of AABB. + /// AABB created from inputs. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static MinMaxAABB CreateFromCenterAndExtents(float3 center, float3 extents) + { + return CreateFromCenterAndHalfExtents(center, extents * 0.5f); + } + + /// + /// Creates the AABB from a center and half extents. + /// + /// + /// This function takes half extents. It is half the distance between and . + /// If you have full extents, you can call . + /// + /// Center of AABB. + /// Half extents of AABB. + /// AABB created from inputs. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static MinMaxAABB CreateFromCenterAndHalfExtents(float3 center, float3 halfExtents) + { + return new MinMaxAABB(center - halfExtents, center + halfExtents); + } + + /// + /// Computes the extents of the AABB. + /// + /// + /// Extents is the componentwise distance between min and max. + /// + public float3 Extents => Max - Min; + + /// + /// Computes the half extents of the AABB. + /// + /// + /// HalfExtents is half of the componentwise distance between min and max. Subtracting HalfExtents from Center + /// gives Min and adding HalfExtents to Center gives Max. + /// + public float3 HalfExtents => (Max - Min) * 0.5f; + + /// + /// Computes the center of the AABB. + /// + public float3 Center => (Max + Min) * 0.5f; + + /// + /// Check if the AABB is valid. + /// + /// + /// An AABB is considered valid if is componentwise less than or equal to . + /// + /// True if is componentwise less than or equal to . + public bool IsValid => math.all(Min <= Max); + + /// + /// Computes the surface area for this axis aligned bounding box. + /// + public float SurfaceArea + { + get + { + float3 diff = Max - Min; + return 2 * math.dot(diff, diff.yzx); + } + } + + /// + /// Tests if the input point is contained by the AABB. + /// + /// Point to test. + /// True if AABB contains the input point. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Contains(float3 point) => math.all(point >= Min & point <= Max); + + /// + /// Tests if the input AABB is contained entirely by this AABB. + /// + /// AABB to test. + /// True if input AABB is contained entirely by this AABB. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Contains(MinMaxAABB aabb) => math.all((Min <= aabb.Min) & (Max >= aabb.Max)); + + /// + /// Tests if the input AABB overlaps this AABB. + /// + /// AABB to test. + /// True if input AABB overlaps with this AABB. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Overlaps(MinMaxAABB aabb) + { + return math.all(Max >= aabb.Min & Min <= aabb.Max); + } + + /// + /// Expands the AABB by the given signed distance. + /// + /// + /// Positive distance expands the AABB while negative distance shrinks the AABB. + /// + /// Signed distance to expand the AABB with. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Expand(float signedDistance) + { + Min -= signedDistance; + Max += signedDistance; + } + + /// + /// Encapsulates the given AABB. + /// + /// + /// Modifies this AABB so that it contains the given AABB. If the given AABB is already contained by this AABB, + /// then this AABB doesn't change. + /// + /// + /// AABB to encapsulate. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Encapsulate(MinMaxAABB aabb) + { + Min = math.min(Min, aabb.Min); + Max = math.max(Max, aabb.Max); + } + + /// + /// Encapsulate the given point. + /// + /// + /// Modifies this AABB so that it contains the given point. If the given point is already contained by this AABB, + /// then this AABB doesn't change. + /// + /// + /// Point to encapsulate. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Encapsulate(float3 point) + { + Min = math.min(Min, point); + Max = math.max(Max, point); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(MinMaxAABB other) + { + return Min.Equals(other.Min) && Max.Equals(other.Max); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("MinMaxAABB({0}, {1})", Min, Max); + } + } + + public static partial class Math + { + /// + /// Transforms the AABB with the given transform. + /// + /// + /// The resulting AABB encapsulates the transformed AABB which may not be axis aligned after the transformation. + /// + /// Transform to apply to AABB. + /// AABB to be transformed. + /// Transformed AABB. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static MinMaxAABB Transform(RigidTransform transform, MinMaxAABB aabb) + { + float3 halfExtentsInA = aabb.HalfExtents; + + // Rotate each axis individually and find their new positions in the rotated space. + float3 x = math.rotate(transform.rot, new float3(halfExtentsInA.x, 0, 0)); + float3 y = math.rotate(transform.rot, new float3(0, halfExtentsInA.y, 0)); + float3 z = math.rotate(transform.rot, new float3(0, 0, halfExtentsInA.z)); + + // Find the new max corner by summing the rotated axes. Absolute value of each axis + // since we are trying to find the max corner. + float3 halfExtentsInB = math.abs(x) + math.abs(y) + math.abs(z); + float3 centerInB = math.transform(transform, aabb.Center); + + return new MinMaxAABB(centerInB - halfExtentsInB, centerInB + halfExtentsInB); + } + + /// + /// Transforms the AABB with the given transform. + /// + /// + /// The resulting AABB encapsulates the transformed AABB which may not be axis aligned after the transformation. + /// + /// Transform to apply to AABB. + /// AABB to be transformed. + /// Transformed AABB. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static MinMaxAABB Transform(float4x4 transform, MinMaxAABB aabb) + { + var transformed = Transform(new float3x3(transform), aabb); + transformed.Min += transform.c3.xyz; + transformed.Max += transform.c3.xyz; + return transformed; + } + + /// + /// Transforms the AABB with the given transform. + /// + /// + /// The resulting AABB encapsulates the transformed AABB which may not be axis aligned after the transformation. + /// + /// Transform to apply to AABB. + /// AABB to be transformed. + /// Transformed AABB. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static MinMaxAABB Transform(float3x3 transform, MinMaxAABB aabb) + { + // From Christer Ericson's Real-Time Collision Detection on page 86 and 87. + // We want the transformed minimum and maximums of the AABB. Multiplying a 3x3 matrix on the left of a + // column vector looks like so: + // + // [ c0.x c1.x c2.x ] [ x ] [ c0.x * x + c1.x * y + c2.x * z ] + // [ c0.y c1.y c2.y ] [ y ] = [ c0.y * x + c1.y * y + c2.y * z ] + // [ c0.z c1.z c2.z ] [ z ] [ c0.z * x + c1.z * y + c2.z * z ] + // + // The column vectors we will use are the input AABB's min and max. Simply multiplying those two vectors + // with the transformation matrix won't guarantee we get the new min and max since those are only two + // points out of eight in the AABB and one of the other six may set the new min or max. + // + // To ensure we get the correct min and max, we must transform all eight points. But it's not necessary + // to actually perform eight matrix multiplies to get our final result. Instead, we can build the min and + // max incrementally by computing each term in the above matrix multiply separately then summing the min + // (or max). For instance, to find the new minimum contributed by the original min and max x component, we + // compute this: + // + // newMin.x = min(c0.x * Min.x, c0.x * Max.x); + // newMin.y = min(c0.y * Min.x, c0.y * Max.x); + // newMin.z = min(c0.z * Min.x, c0.z * Max.x); + // + // Then we add minimum contributed by the original min and max y components: + // + // newMin.x += min(c1.x * Min.y, c1.x * Max.y); + // newMin.y += min(c1.y * Min.y, c1.y * Max.y); + // newMin.z += min(c1.z * Min.y, c1.z * Max.y); + // + // And so on. Translation can be handled by simply initializing the new min and max with the translation + // amount since it does not affect the min and max bounds in local space. + var t1 = transform.c0.xyz * aabb.Min.xxx; + var t2 = transform.c0.xyz * aabb.Max.xxx; + var minMask = t1 < t2; + var transformed = new MinMaxAABB(select(t2, t1, minMask), select(t2, t1, !minMask)); + t1 = transform.c1.xyz * aabb.Min.yyy; + t2 = transform.c1.xyz * aabb.Max.yyy; + minMask = t1 < t2; + transformed.Min += select(t2, t1, minMask); + transformed.Max += select(t2, t1, !minMask); + t1 = transform.c2.xyz * aabb.Min.zzz; + t2 = transform.c2.xyz * aabb.Max.zzz; + minMask = t1 < t2; + transformed.Min += select(t2, t1, minMask); + transformed.Max += select(t2, t1, !minMask); + return transformed; + } + } +} diff --git a/src/Unity.Mathematics/Geometry/MinMaxAABB.cs.meta b/src/Unity.Mathematics/Geometry/MinMaxAABB.cs.meta new file mode 100644 index 00000000..9e1680bf --- /dev/null +++ b/src/Unity.Mathematics/Geometry/MinMaxAABB.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e0eb9224bcb474ac091e7d7f2780d61d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/Geometry/Plane.cs b/src/Unity.Mathematics/Geometry/Plane.cs new file mode 100644 index 00000000..5094bb94 --- /dev/null +++ b/src/Unity.Mathematics/Geometry/Plane.cs @@ -0,0 +1,234 @@ +using System; +using System.Diagnostics; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +namespace Unity.Mathematics.Geometry +{ + /// + /// A plane represented by a normal vector and a distance along the normal from the origin. + /// + /// + /// A plane splits the 3D space in half. The normal vector points to the positive half and the other half is + /// considered negative. + /// + [DebuggerDisplay("{Normal}, {Distance}")] + [Serializable] + [Il2CppEagerStaticClassConstruction] + public struct Plane + { + /// + /// A plane in the form Ax + By + Cz + Dw = 0. + /// + /// + /// Stores the plane coefficients A, B, C, D where (A, B, C) is a unit normal vector and D is the distance + /// from the origin. A plane stored with a unit normal vector is called a normalized plane. + /// + public float4 NormalAndDistance; + + /// + /// Constructs a Plane from arbitrary coefficients A, B, C, D of the plane equation Ax + By + Cz + Dw = 0. + /// + /// + /// The constructed plane will be the normalized form of the plane specified by the given coefficients. + /// + /// Coefficient A from plane equation. + /// Coefficient B from plane equation. + /// Coefficient C from plane equation. + /// Coefficient D from plane equation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public Plane(float coefficientA, float coefficientB, float coefficientC, float coefficientD) + { + NormalAndDistance = Normalize(new float4(coefficientA, coefficientB, coefficientC, coefficientD)); + } + + /// + /// Constructs a plane with a normal vector and distance from the origin. + /// + /// + /// The constructed plane will be the normalized form of the plane specified by the inputs. + /// + /// A non-zero vector that is perpendicular to the plane. It may be any length. + /// Distance from the origin along the normal. A negative value moves the plane in the + /// same direction as the normal while a positive value moves it in the opposite direction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public Plane(float3 normal, float distance) + { + NormalAndDistance = Normalize(new float4(normal, distance)); + } + + /// + /// Constructs a plane with a normal vector and a point that lies in the plane. + /// + /// + /// The constructed plane will be the normalized form of the plane specified by the inputs. + /// + /// A non-zero vector that is perpendicular to the plane. It may be any length. + /// A point that lies in the plane. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public Plane(float3 normal, float3 pointInPlane) + : this(normal, -math.dot(normal, pointInPlane)) + { + } + + /// + /// Constructs a plane with two vectors and a point that all lie in the plane. + /// + /// + /// The constructed plane will be the normalized form of the plane specified by the inputs. + /// + /// A non-zero vector that lies in the plane. It may be any length. + /// A non-zero vector that lies in the plane. It may be any length and must not be a scalar multiple of . + /// A point that lies in the plane. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public Plane(float3 vector1InPlane, float3 vector2InPlane, float3 pointInPlane) + : this(math.cross(vector1InPlane, vector2InPlane), pointInPlane) + { + } + + /// + /// Creates a normalized Plane directly without normalization cost. + /// + /// + /// If you have a unit length normal vector, you can create a Plane faster than using one of its constructors + /// by calling this function. + /// + /// A non-zero vector that is perpendicular to the plane. It must be unit length. + /// Distance from the origin along the normal. A negative value moves the plane in the + /// same direction as the normal while a positive value moves it in the opposite direction. + /// Normalized Plane constructed from given inputs. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Plane CreateFromUnitNormalAndDistance(float3 unitNormal, float distance) + { + return new Plane { NormalAndDistance = new float4(unitNormal, distance) }; + } + + /// + /// Creates a normalized Plane without normalization cost. + /// + /// + /// If you have a unit length normal vector, you can create a Plane faster than using one of its constructors + /// by calling this function. + /// + /// A non-zero vector that is perpendicular to the plane. It must be unit length. + /// A point that lies in the plane. + /// Normalized Plane constructed from given inputs. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Plane CreateFromUnitNormalAndPointInPlane(float3 unitNormal, float3 pointInPlane) + { + return new Plane { NormalAndDistance = new float4(unitNormal, -math.dot(unitNormal, pointInPlane)) }; + } + + /// + /// Get/set the normal vector of the plane. + /// + /// + /// It is assumed that the normal is unit length. If you set a new plane such that Ax + By + Cz + Dw = 0 but + /// (A, B, C) is not unit length, then you must normalize the plane by calling . + /// + public float3 Normal + { + get => NormalAndDistance.xyz; + set => NormalAndDistance.xyz = value; + } + + /// + /// Get/set the distance of the plane from the origin. May be a negative value. + /// + /// + /// It is assumed that the normal is unit length. If you set a new plane such that Ax + By + Cz + Dw = 0 but + /// (A, B, C) is not unit length, then you must normalize the plane by calling . + /// + public float Distance + { + get => NormalAndDistance.w; + set => NormalAndDistance.w = value; + } + + /// + /// Normalizes the given Plane. + /// + /// Plane to normalize. + /// Normalized Plane. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Plane Normalize(Plane plane) + { + return new Plane { NormalAndDistance = Normalize(plane.NormalAndDistance) }; + } + + /// + /// Normalizes the plane represented by the given plane coefficients. + /// + /// + /// The plane coefficients are A, B, C, D and stored in that order in the . + /// + /// Plane coefficients A, B, C, D stored in x, y, z, w (respectively). + /// Normalized plane coefficients. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 Normalize(float4 planeCoefficients) + { + float recipLength = math.rsqrt(math.lengthsq(planeCoefficients.xyz)); + return new Plane { NormalAndDistance = planeCoefficients * recipLength }; + } + + /// + /// Get the signed distance from the point to the plane. + /// + /// + /// Plane must be normalized prior to calling this function. Distance is positive if point is on side of the + /// plane the normal points to, negative if on the opposite side and zero if the point lies in the plane. + /// Avoid comparing equality with 0.0f when testing if a point lies exactly in the plane and use an approximate + /// comparison instead. + /// + /// Point to find the signed distance with. + /// Signed distance of the point from the plane. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float SignedDistanceToPoint(float3 point) + { + CheckPlaneIsNormalized(); + return math.dot(NormalAndDistance, new float4(point, 1.0f)); + } + + /// + /// Projects the given point onto the plane. + /// + /// + /// Plane must be normalized prior to calling this function. The result is the position closest to the point + /// that still lies in the plane. + /// + /// Point to project onto the plane. + /// Projected point that's inside the plane. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3 Projection(float3 point) + { + CheckPlaneIsNormalized(); + return point - Normal * SignedDistanceToPoint(point); + } + + /// + /// Flips the plane so the normal points in the opposite direction. + /// + public Plane Flipped => new Plane { NormalAndDistance = -NormalAndDistance }; + + /// + /// Implicitly converts a to . + /// + /// Plane to convert. + /// A representing the plane. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float4(Plane plane) => plane.NormalAndDistance; + + [Conditional("ENABLE_UNITY_COLLECTIONS_CHECKS")] + void CheckPlaneIsNormalized() + { + float ll = math.lengthsq(Normal.xyz); + const float lowerBound = 0.999f * 0.999f; + const float upperBound = 1.001f * 1.001f; + + if (ll < lowerBound || ll > upperBound) + { + throw new System.ArgumentException("Plane must be normalized. Call Plane.Normalize() to normalize plane."); + } + } + } +} diff --git a/src/Unity.Mathematics/Geometry/Plane.cs.meta b/src/Unity.Mathematics/Geometry/Plane.cs.meta new file mode 100644 index 00000000..8528b3e9 --- /dev/null +++ b/src/Unity.Mathematics/Geometry/Plane.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b715caa4800cd41edbf02f1d3a42accf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/Il2CppEagerStaticClassConstructionAttribute.cs b/src/Unity.Mathematics/Il2CppEagerStaticClassConstructionAttribute.cs new file mode 100644 index 00000000..6f64b476 --- /dev/null +++ b/src/Unity.Mathematics/Il2CppEagerStaticClassConstructionAttribute.cs @@ -0,0 +1,13 @@ +using System; + +namespace Unity.IL2CPP.CompilerServices +{ + /// + /// This is used to indicate to IL2CPP that the static constructors should be executed eagerly at startup + /// rather than lazily at runtime. + /// + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)] + internal class Il2CppEagerStaticClassConstructionAttribute : Attribute + { + } +} \ No newline at end of file diff --git a/src/Unity.Mathematics/Il2CppEagerStaticClassConstructionAttribute.cs.meta b/src/Unity.Mathematics/Il2CppEagerStaticClassConstructionAttribute.cs.meta new file mode 100644 index 00000000..643f0d34 --- /dev/null +++ b/src/Unity.Mathematics/Il2CppEagerStaticClassConstructionAttribute.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3c7ef86a2cddb4254810c84d4f6e6618 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/IntFloatUnion.cs b/src/Unity.Mathematics/IntFloatUnion.cs deleted file mode 100644 index 67a38653..00000000 --- a/src/Unity.Mathematics/IntFloatUnion.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System.Runtime.InteropServices; -using System.Runtime.CompilerServices; - -namespace Unity.Mathematics -{ - [StructLayout(LayoutKind.Explicit)] - internal struct IntFloatUnion - { - [FieldOffset(0)] - public int intValue; - [FieldOffset(0)] - public float floatValue; - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public IntFloatUnion(float value) - { - intValue = 0; - floatValue = (float)value; - } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public IntFloatUnion(int value) - { - floatValue = 0; - intValue = (int)value; - } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static int ToInt(float value) - { - return new IntFloatUnion(value).intValue; - } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float ToFloat(int value) - { - return new IntFloatUnion(value).floatValue; - } - } -} - diff --git a/src/Unity.Mathematics/IntFloatUnion.cs.meta b/src/Unity.Mathematics/IntFloatUnion.cs.meta deleted file mode 100644 index d7265aac..00000000 --- a/src/Unity.Mathematics/IntFloatUnion.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: cd85d27d5cb34464fb3d3a7402e47746 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/src/Unity.Mathematics/Noise/cellular2D.cs b/src/Unity.Mathematics/Noise/cellular2D.cs index 2ace6e8f..ab962a65 100644 --- a/src/Unity.Mathematics/Noise/cellular2D.cs +++ b/src/Unity.Mathematics/Noise/cellular2D.cs @@ -4,53 +4,58 @@ // See LICENSE file for details. // https://github.com/stegu/webgl-noise +using static Unity.Mathematics.math; + namespace Unity.Mathematics { public static partial class noise { - // Cellular noise, returning F1 and F2 in a float2. - // Standard 3x3 search window for good F1 and F2 values + /// + /// 2D Cellular noise ("Worley noise") with standard 3x3 search window for good feature point values. + /// + /// A point in 2D space. + /// Feature points. F1 is in the x component, F2 in the y component. public static float2 cellular(float2 P) { const float K = 0.142857142857f; // 1/7 const float Ko = 0.428571428571f; // 3/7 const float jitter = 1.0f; // Less gives more regular pattern - float2 Pi = mod289(math.floor(P)); - float2 Pf = math.fract(P); - float3 oi = new float3(-1.0f, 0.0f, 1.0f); - float3 of = new float3(-0.5f, 0.5f, 1.5f); + float2 Pi = mod289(floor(P)); + float2 Pf = frac(P); + float3 oi = float3(-1.0f, 0.0f, 1.0f); + float3 of = float3(-0.5f, 0.5f, 1.5f); float3 px = permute(Pi.x + oi); float3 p = permute(px.x + Pi.y + oi); // p11, p12, p13 - float3 ox = math.fract(p * K) - Ko; - float3 oy = mod7(math.floor(p * K)) * K - Ko; + float3 ox = frac(p * K) - Ko; + float3 oy = mod7(floor(p * K)) * K - Ko; float3 dx = Pf.x + 0.5f + jitter * ox; float3 dy = Pf.y - of + jitter * oy; float3 d1 = dx * dx + dy * dy; // d11, d12 and d13, squared p = permute(px.y + Pi.y + oi); // p21, p22, p23 - ox = math.fract(p * K) - Ko; - oy = mod7(math.floor(p * K)) * K - Ko; + ox = frac(p * K) - Ko; + oy = mod7(floor(p * K)) * K - Ko; dx = Pf.x - 0.5f + jitter * ox; dy = Pf.y - of + jitter * oy; float3 d2 = dx * dx + dy * dy; // d21, d22 and d23, squared p = permute(px.z + Pi.y + oi); // p31, p32, p33 - ox = math.fract(p * K) - Ko; - oy = mod7(math.floor(p * K)) * K - Ko; + ox = frac(p * K) - Ko; + oy = mod7(floor(p * K)) * K - Ko; dx = Pf.x - 1.5f + jitter * ox; dy = Pf.y - of + jitter * oy; float3 d3 = dx * dx + dy * dy; // d31, d32 and d33, squared // Sort out the two smallest distances (F1, F2) - float3 d1a = math.min(d1, d2); - d2 = math.max(d1, d2); // Swap to keep candidates for F2 - d2 = math.min(d2, d3); // neither F1 nor F2 are now in d3 - d1 = math.min(d1a, d2); // F1 is now in d1 - d2 = math.max(d1a, d2); // Swap to keep candidates for F2 + float3 d1a = min(d1, d2); + d2 = max(d1, d2); // Swap to keep candidates for F2 + d2 = min(d2, d3); // neither F1 nor F2 are now in d3 + d1 = min(d1a, d2); // F1 is now in d1 + d2 = max(d1a, d2); // Swap to keep candidates for F2 d1.xy = (d1.x < d1.y) ? d1.xy : d1.yx; // Swap if smaller d1.xz = (d1.x < d1.z) ? d1.xz : d1.zx; // F1 is in d1.x - d1.yz = math.min(d1.yz, d2.yz); // F2 is now not in d2.yz - d1.y = math.min(d1.y, d1.z); // nor in d1.z - d1.y = math.min(d1.y, d2.x); // F2 is in d1.y, we're done. - return math.sqrt(d1.xy); + d1.yz = min(d1.yz, d2.yz); // F2 is now not in d2.yz + d1.y = min(d1.y, d1.z); // nor in d1.z + d1.y = min(d1.y, d2.x); // F2 is in d1.y, we're done. + return sqrt(d1.xy); } } } diff --git a/src/Unity.Mathematics/Noise/cellular2x2.cs b/src/Unity.Mathematics/Noise/cellular2x2.cs index e560d4cb..5c677bca 100644 --- a/src/Unity.Mathematics/Noise/cellular2x2.cs +++ b/src/Unity.Mathematics/Noise/cellular2x2.cs @@ -4,30 +4,34 @@ // See LICENSE file for details. // https://github.com/stegu/webgl-noise +using static Unity.Mathematics.math; + namespace Unity.Mathematics { public static partial class noise { - // Cellular noise, returning F1 and F2 in a float2. - // Speeded up by umath.sing 2x2 search window instead of 3x3, - // at the expense of some strong pattern artifacts. - // F2 is often wrong and has sharp discontinuities. - // If you need a smooth F2, use the slower 3x3 version. - // F1 is sometimes wrong, too, but OK for most purposes. + /// + /// 2D Cellular noise ("Worley noise") with a 2x2 search window. + /// + /// + /// Faster than using 3x3, at the expense of some strong pattern artifacts. F2 is often wrong and has sharp discontinuities. If you need a smooth F2, use the slower 3x3 version. F1 is sometimes wrong, too, but OK for most purposes. + /// + /// A point in 2D space. + /// Feature points. F1 is in the x component, F2 in the y component. public static float2 cellular2x2(float2 P) { const float K = 0.142857142857f; // 1/7 const float K2 = 0.0714285714285f; // K/2 const float jitter = 0.8f; // jitter 1.0 makes F1 wrong more often - - float2 Pi = mod289(math.floor(P)); - float2 Pf = math.fract(P); - float4 Pfx = Pf.x + new float4(-0.5f, -1.5f, -0.5f, -1.5f); - float4 Pfy = Pf.y + new float4(-0.5f, -0.5f, -1.5f, -1.5f); - float4 p = permute(Pi.x + new float4(0.0f, 1.0f, 0.0f, 1.0f)); - p = permute(p + Pi.y + new float4(0.0f, 0.0f, 1.0f, 1.0f)); + + float2 Pi = mod289(floor(P)); + float2 Pf = frac(P); + float4 Pfx = Pf.x + float4(-0.5f, -1.5f, -0.5f, -1.5f); + float4 Pfy = Pf.y + float4(-0.5f, -0.5f, -1.5f, -1.5f); + float4 p = permute(Pi.x + float4(0.0f, 1.0f, 0.0f, 1.0f)); + p = permute(p + Pi.y + float4(0.0f, 0.0f, 1.0f, 1.0f)); float4 ox = mod7(p) * K + K2; - float4 oy = mod7(math.floor(p * K)) * K + K2; + float4 oy = mod7(floor(p * K)) * K + K2; float4 dx = Pfx + jitter * ox; float4 dy = Pfy + jitter * oy; float4 d = dx * dx + dy * dy; // d11, d12, d21 and d22, squared @@ -36,9 +40,9 @@ public static float2 cellular2x2(float2 P) d.xy = (d.x < d.y) ? d.xy : d.yx; // Swap if smaller d.xz = (d.x < d.z) ? d.xz : d.zx; d.xw = (d.x < d.w) ? d.xw : d.wx; - d.y = math.min(d.y, d.z); - d.y = math.min(d.y, d.w); - return math.sqrt(d.xy); + d.y = min(d.y, d.z); + d.y = min(d.y, d.w); + return sqrt(d.xy); } } } diff --git a/src/Unity.Mathematics/Noise/cellular2x2x2.cs b/src/Unity.Mathematics/Noise/cellular2x2x2.cs index b122a069..b146d2d6 100644 --- a/src/Unity.Mathematics/Noise/cellular2x2x2.cs +++ b/src/Unity.Mathematics/Noise/cellular2x2x2.cs @@ -4,15 +4,20 @@ // See LICENSE file for details. // https://github.com/stegu/webgl-noise +using static Unity.Mathematics.math; + namespace Unity.Mathematics { public static partial class noise { - // Cellular noise, returning F1 and F2 in a float2. - // Speeded up by umath.sing 2x2x2 search window instead of 3x3x3, - // at the expense of some pattern artifacts. - // F2 is often wrong and has sharp discontinuities. - // If you need a good F2, use the slower 3x3x3 version. + /// + /// 3D Cellular noise ("Worley noise") with a 2x2x2 search window. + /// + /// + /// Faster than using 3x3x3, at the expense of some pattern artifacts. F2 is often wrong and has sharp discontinuities. If you need a smooth F2, use the slower 3x3x3 version. + /// + /// A point in 3D space. + /// Feature points. F1 is in the x component, F2 in the y component. public static float2 cellular2x2x2(float3 P) { const float K = 0.142857142857f; // 1/7 @@ -21,21 +26,21 @@ public static float2 cellular2x2x2(float3 P) const float Kz = 0.166666666667f; // 1/6 const float Kzo = 0.416666666667f; // 1/2-1/6*2 const float jitter = 0.8f; // smaller jitter gives less errors in F2 - - float3 Pi = mod289(math.floor(P)); - float3 Pf = math.fract(P); - float4 Pfx = Pf.x + new float4(0.0f, -1.0f, 0.0f, -1.0f); - float4 Pfy = Pf.y + new float4(0.0f, 0.0f, -1.0f, -1.0f); - float4 p = permute(Pi.x + new float4(0.0f, 1.0f, 0.0f, 1.0f)); - p = permute(p + Pi.y + new float4(0.0f, 0.0f, 1.0f, 1.0f)); + + float3 Pi = mod289(floor(P)); + float3 Pf = frac(P); + float4 Pfx = Pf.x + float4(0.0f, -1.0f, 0.0f, -1.0f); + float4 Pfy = Pf.y + float4(0.0f, 0.0f, -1.0f, -1.0f); + float4 p = permute(Pi.x + float4(0.0f, 1.0f, 0.0f, 1.0f)); + p = permute(p + Pi.y + float4(0.0f, 0.0f, 1.0f, 1.0f)); float4 p1 = permute(p + Pi.z); // z+0 - float4 p2 = permute(p + Pi.z + new float4(1.0f,1.0f,1.0f,1.0f)); // z+1 - float4 ox1 = math.fract(p1 * K) - Ko; - float4 oy1 = mod7(math.floor(p1 * K)) * K - Ko; - float4 oz1 = math.floor(p1 * K2) * Kz - Kzo; // p1 < 289 guaranteed - float4 ox2 = math.fract(p2 * K) - Ko; - float4 oy2 = mod7(math.floor(p2 * K)) * K - Ko; - float4 oz2 = math.floor(p2 * K2) * Kz - Kzo; + float4 p2 = permute(p + Pi.z + float4(1.0f,1.0f,1.0f,1.0f)); // z+1 + float4 ox1 = frac(p1 * K) - Ko; + float4 oy1 = mod7(floor(p1 * K)) * K - Ko; + float4 oz1 = floor(p1 * K2) * Kz - Kzo; // p1 < 289 guaranteed + float4 ox2 = frac(p2 * K) - Ko; + float4 oy2 = mod7(floor(p2 * K)) * K - Ko; + float4 oz2 = floor(p2 * K2) * Kz - Kzo; float4 dx1 = Pfx + jitter * ox1; float4 dy1 = Pfy + jitter * oy1; float4 dz1 = Pf.z + jitter * oz1; @@ -46,18 +51,18 @@ public static float2 cellular2x2x2(float3 P) float4 d2 = dx2 * dx2 + dy2 * dy2 + dz2 * dz2; // z+1 // Sort out the two smallest distances (F1, F2) - + // Do it right and sort out both F1 and F2 - float4 d = math.min(d1,d2); // F1 is now in d - d2 = math.max(d1,d2); // Make sure we keep all candidates for F2 + float4 d = min(d1,d2); // F1 is now in d + d2 = max(d1,d2); // Make sure we keep all candidates for F2 d.xy = (d.x < d.y) ? d.xy : d.yx; // Swap smallest to d.x d.xz = (d.x < d.z) ? d.xz : d.zx; d.xw = (d.x < d.w) ? d.xw : d.wx; // F1 is now in d.x - d.yzw = math.min(d.yzw, d2.yzw); // F2 now not in d2.yzw - d.y = math.min(d.y, d.z); // nor in d.z - d.y = math.min(d.y, d.w); // nor in d.w - d.y = math.min(d.y, d2.x); // F2 is now in d.y - return math.sqrt(d.xy); // F1 and F2 + d.yzw = min(d.yzw, d2.yzw); // F2 now not in d2.yzw + d.y = min(d.y, d.z); // nor in d.z + d.y = min(d.y, d.w); // nor in d.w + d.y = min(d.y, d2.x); // F2 is now in d.y + return sqrt(d.xy); // F1 and F2 } } } diff --git a/src/Unity.Mathematics/Noise/cellular3D.cs b/src/Unity.Mathematics/Noise/cellular3D.cs index bc90f512..4de3daee 100644 --- a/src/Unity.Mathematics/Noise/cellular3D.cs +++ b/src/Unity.Mathematics/Noise/cellular3D.cs @@ -4,13 +4,17 @@ // See LICENSE file for details. // https://github.com/stegu/webgl-noise +using static Unity.Mathematics.math; + namespace Unity.Mathematics { public static partial class noise { - // Cellular noise, returning F1 and F2 in a float2. - // 3x3x3 search region for good F2 everywhere, but a lot - // slower than the 2x2x2 version. + /// + /// 3D Cellular noise ("Worley noise") with 3x3x3 search region for good F2 everywhere, but a lot slower than the 2x2x2 version. + /// + /// A point in 2D space. + /// Feature points. F1 is in the x component, F2 in the y component. // The code below is a bit scary even to its author, // but it has at least half decent performance on a // math.modern GPU. In any case, it beats any software @@ -25,14 +29,14 @@ public static float2 cellular(float3 P) const float Kzo = 0.416666666667f; // 1/2-1/6*2 const float jitter = 1.0f; // smaller jitter gives more regular pattern - float3 Pi = mod289(math.floor(P)); - float3 Pf = math.fract(P) - 0.5f; + float3 Pi = mod289(floor(P)); + float3 Pf = frac(P) - 0.5f; - float3 Pfx = Pf.x + new float3(1.0f, 0.0f, -1.0f); - float3 Pfy = Pf.y + new float3(1.0f, 0.0f, -1.0f); - float3 Pfz = Pf.z + new float3(1.0f, 0.0f, -1.0f); + float3 Pfx = Pf.x + float3(1.0f, 0.0f, -1.0f); + float3 Pfy = Pf.y + float3(1.0f, 0.0f, -1.0f); + float3 Pfz = Pf.z + float3(1.0f, 0.0f, -1.0f); - float3 p = permute(Pi.x + new float3(-1.0f, 0.0f, 1.0f)); + float3 p = permute(Pi.x + float3(-1.0f, 0.0f, 1.0f)); float3 p1 = permute(p + Pi.y - 1.0f); float3 p2 = permute(p + Pi.y); float3 p3 = permute(p + Pi.y + 1.0f); @@ -49,41 +53,41 @@ public static float2 cellular(float3 P) float3 p32 = permute(p3 + Pi.z); float3 p33 = permute(p3 + Pi.z + 1.0f); - float3 ox11 = math.fract(p11 * K) - Ko; - float3 oy11 = mod7(math.floor(p11 * K)) * K - Ko; - float3 oz11 = math.floor(p11 * K2) * Kz - Kzo; // p11 < 289 guaranteed + float3 ox11 = frac(p11 * K) - Ko; + float3 oy11 = mod7(floor(p11 * K)) * K - Ko; + float3 oz11 = floor(p11 * K2) * Kz - Kzo; // p11 < 289 guaranteed - float3 ox12 = math.fract(p12 * K) - Ko; - float3 oy12 = mod7(math.floor(p12 * K)) * K - Ko; - float3 oz12 = math.floor(p12 * K2) * Kz - Kzo; + float3 ox12 = frac(p12 * K) - Ko; + float3 oy12 = mod7(floor(p12 * K)) * K - Ko; + float3 oz12 = floor(p12 * K2) * Kz - Kzo; - float3 ox13 = math.fract(p13 * K) - Ko; - float3 oy13 = mod7(math.floor(p13 * K)) * K - Ko; - float3 oz13 = math.floor(p13 * K2) * Kz - Kzo; + float3 ox13 = frac(p13 * K) - Ko; + float3 oy13 = mod7(floor(p13 * K)) * K - Ko; + float3 oz13 = floor(p13 * K2) * Kz - Kzo; - float3 ox21 = math.fract(p21 * K) - Ko; - float3 oy21 = mod7(math.floor(p21 * K)) * K - Ko; - float3 oz21 = math.floor(p21 * K2) * Kz - Kzo; + float3 ox21 = frac(p21 * K) - Ko; + float3 oy21 = mod7(floor(p21 * K)) * K - Ko; + float3 oz21 = floor(p21 * K2) * Kz - Kzo; - float3 ox22 = math.fract(p22 * K) - Ko; - float3 oy22 = mod7(math.floor(p22 * K)) * K - Ko; - float3 oz22 = math.floor(p22 * K2) * Kz - Kzo; + float3 ox22 = frac(p22 * K) - Ko; + float3 oy22 = mod7(floor(p22 * K)) * K - Ko; + float3 oz22 = floor(p22 * K2) * Kz - Kzo; - float3 ox23 = math.fract(p23 * K) - Ko; - float3 oy23 = mod7(math.floor(p23 * K)) * K - Ko; - float3 oz23 = math.floor(p23 * K2) * Kz - Kzo; + float3 ox23 = frac(p23 * K) - Ko; + float3 oy23 = mod7(floor(p23 * K)) * K - Ko; + float3 oz23 = floor(p23 * K2) * Kz - Kzo; - float3 ox31 = math.fract(p31 * K) - Ko; - float3 oy31 = mod7(math.floor(p31 * K)) * K - Ko; - float3 oz31 = math.floor(p31 * K2) * Kz - Kzo; + float3 ox31 = frac(p31 * K) - Ko; + float3 oy31 = mod7(floor(p31 * K)) * K - Ko; + float3 oz31 = floor(p31 * K2) * Kz - Kzo; - float3 ox32 = math.fract(p32 * K) - Ko; - float3 oy32 = mod7(math.floor(p32 * K)) * K - Ko; - float3 oz32 = math.floor(p32 * K2) * Kz - Kzo; + float3 ox32 = frac(p32 * K) - Ko; + float3 oy32 = mod7(floor(p32 * K)) * K - Ko; + float3 oz32 = floor(p32 * K2) * Kz - Kzo; - float3 ox33 = math.fract(p33 * K) - Ko; - float3 oy33 = mod7(math.floor(p33 * K)) * K - Ko; - float3 oz33 = math.floor(p33 * K2) * Kz - Kzo; + float3 ox33 = frac(p33 * K) - Ko; + float3 oy33 = mod7(floor(p33 * K)) * K - Ko; + float3 oz33 = floor(p33 * K2) * Kz - Kzo; float3 dx11 = Pfx + jitter * ox11; float3 dy11 = Pfy.x + jitter * oy11; @@ -133,35 +137,35 @@ public static float2 cellular(float3 P) // Sort out the two smallest distances (F1, F2) // Do it right and sort out both F1 and F2 - float3 d1a = math.min(d11, d12); - d12 = math.max(d11, d12); - d11 = math.min(d1a, d13); // Smallest now not in d12 or d13 - d13 = math.max(d1a, d13); - d12 = math.min(d12, d13); // 2nd smallest now not in d13 - float3 d2a = math.min(d21, d22); - d22 = math.max(d21, d22); - d21 = math.min(d2a, d23); // Smallest now not in d22 or d23 - d23 = math.max(d2a, d23); - d22 = math.min(d22, d23); // 2nd smallest now not in d23 - float3 d3a = math.min(d31, d32); - d32 = math.max(d31, d32); - d31 = math.min(d3a, d33); // Smallest now not in d32 or d33 - d33 = math.max(d3a, d33); - d32 = math.min(d32, d33); // 2nd smallest now not in d33 - float3 da = math.min(d11, d21); - d21 = math.max(d11, d21); - d11 = math.min(da, d31); // Smallest now in d11 - d31 = math.max(da, d31); // 2nd smallest now not in d31 + float3 d1a = min(d11, d12); + d12 = max(d11, d12); + d11 = min(d1a, d13); // Smallest now not in d12 or d13 + d13 = max(d1a, d13); + d12 = min(d12, d13); // 2nd smallest now not in d13 + float3 d2a = min(d21, d22); + d22 = max(d21, d22); + d21 = min(d2a, d23); // Smallest now not in d22 or d23 + d23 = max(d2a, d23); + d22 = min(d22, d23); // 2nd smallest now not in d23 + float3 d3a = min(d31, d32); + d32 = max(d31, d32); + d31 = min(d3a, d33); // Smallest now not in d32 or d33 + d33 = max(d3a, d33); + d32 = min(d32, d33); // 2nd smallest now not in d33 + float3 da = min(d11, d21); + d21 = max(d11, d21); + d11 = min(da, d31); // Smallest now in d11 + d31 = max(da, d31); // 2nd smallest now not in d31 d11.xy = (d11.x < d11.y) ? d11.xy : d11.yx; d11.xz = (d11.x < d11.z) ? d11.xz : d11.zx; // d11.x now smallest - d12 = math.min(d12, d21); // 2nd smallest now not in d21 - d12 = math.min(d12, d22); // nor in d22 - d12 = math.min(d12, d31); // nor in d31 - d12 = math.min(d12, d32); // nor in d32 - d11.yz = math.min(d11.yz, d12.xy); // nor in d12.yz - d11.y = math.min(d11.y, d12.z); // Only two more to go - d11.y = math.min(d11.y, d11.z); // Done! (Phew!) - return math.sqrt(d11.xy); // F1, F2 + d12 = min(d12, d21); // 2nd smallest now not in d21 + d12 = min(d12, d22); // nor in d22 + d12 = min(d12, d31); // nor in d31 + d12 = min(d12, d32); // nor in d32 + d11.yz = min(d11.yz, d12.xy); // nor in d12.yz + d11.y = min(d11.y, d12.z); // Only two more to go + d11.y = min(d11.y, d11.z); // Done! (Phew!) + return sqrt(d11.xy); // F1, F2 } } } diff --git a/src/Unity.Mathematics/Noise/classicnoise2D.cs b/src/Unity.Mathematics/Noise/classicnoise2D.cs index fbb7a0c6..6d8d6f39 100644 --- a/src/Unity.Mathematics/Noise/classicnoise2D.cs +++ b/src/Unity.Mathematics/Noise/classicnoise2D.cs @@ -12,15 +12,21 @@ // https://github.com/stegu/webgl-noise // +using static Unity.Mathematics.math; + namespace Unity.Mathematics { public static partial class noise { - // Classic Perlin noise + /// + /// Classic Perlin noise + /// + /// Point on a 2D grid of gradient vectors. + /// Noise value. public static float cnoise(float2 P) { - float4 Pi = math.floor(P.xyxy) + new float4(0.0f, 0.0f, 1.0f, 1.0f); - float4 Pf = math.fract(P.xyxy) - new float4(0.0f, 0.0f, 1.0f, 1.0f); + float4 Pi = floor(P.xyxy) + float4(0.0f, 0.0f, 1.0f, 1.0f); + float4 Pf = frac(P.xyxy) - float4(0.0f, 0.0f, 1.0f, 1.0f); Pi = mod289(Pi); // To avoid truncation effects in permutation float4 ix = Pi.xzxz; float4 iy = Pi.yyww; @@ -29,39 +35,44 @@ public static float cnoise(float2 P) float4 i = permute(permute(ix) + iy); - float4 gx = math.fract(i * (1.0f / 41.0f)) * 2.0f - 1.0f; - float4 gy = math.abs(gx) - 0.5f; - float4 tx = math.floor(gx + 0.5f); + float4 gx = frac(i * (1.0f / 41.0f)) * 2.0f - 1.0f; + float4 gy = abs(gx) - 0.5f; + float4 tx = floor(gx + 0.5f); gx = gx - tx; - float2 g00 = new float2(gx.x, gy.x); - float2 g10 = new float2(gx.y, gy.y); - float2 g01 = new float2(gx.z, gy.z); - float2 g11 = new float2(gx.w, gy.w); + float2 g00 = float2(gx.x, gy.x); + float2 g10 = float2(gx.y, gy.y); + float2 g01 = float2(gx.z, gy.z); + float2 g11 = float2(gx.w, gy.w); - float4 norm = taylorInvSqrt(new float4(math.dot(g00, g00), math.dot(g01, g01), math.dot(g10, g10), math.dot(g11, g11))); + float4 norm = taylorInvSqrt(float4(dot(g00, g00), dot(g01, g01), dot(g10, g10), dot(g11, g11))); g00 *= norm.x; g01 *= norm.y; g10 *= norm.z; g11 *= norm.w; - float n00 = math.dot(g00, new float2(fx.x, fy.x)); - float n10 = math.dot(g10, new float2(fx.y, fy.y)); - float n01 = math.dot(g01, new float2(fx.z, fy.z)); - float n11 = math.dot(g11, new float2(fx.w, fy.w)); + float n00 = dot(g00, float2(fx.x, fy.x)); + float n10 = dot(g10, float2(fx.y, fy.y)); + float n01 = dot(g01, float2(fx.z, fy.z)); + float n11 = dot(g11, float2(fx.w, fy.w)); float2 fade_xy = fade(Pf.xy); - float2 n_x = math.mix(new float2(n00, n01), new float2(n10, n11), fade_xy.x); - float n_xy = math.mix(n_x.x, n_x.y, fade_xy.y); + float2 n_x = lerp(float2(n00, n01), float2(n10, n11), fade_xy.x); + float n_xy = lerp(n_x.x, n_x.y, fade_xy.y); return 2.3f * n_xy; } - // Classic Perlin noise, periodic variant + /// + /// Classic Perlin noise, periodic variant + /// + /// Point on a 2D grid of gradient vectors. + /// Period of repetition. + /// Noise value. public static float pnoise(float2 P, float2 rep) { - float4 Pi = math.floor(P.xyxy) + new float4(0.0f, 0.0f, 1.0f, 1.0f); - float4 Pf = math.fract(P.xyxy) - new float4(0.0f, 0.0f, 1.0f, 1.0f); - Pi = math.mod(Pi, rep.xyxy); // To create noise with explicit period + float4 Pi = floor(P.xyxy) + float4(0.0f, 0.0f, 1.0f, 1.0f); + float4 Pf = frac(P.xyxy) - float4(0.0f, 0.0f, 1.0f, 1.0f); + Pi = fmod(Pi, rep.xyxy); // To create noise with explicit period Pi = mod289(Pi); // To avoid truncation effects in permutation float4 ix = Pi.xzxz; float4 iy = Pi.yyww; @@ -70,30 +81,30 @@ public static float pnoise(float2 P, float2 rep) float4 i = permute(permute(ix) + iy); - float4 gx = math.fract(i * (1.0f / 41.0f)) * 2.0f - 1.0f; - float4 gy = math.abs(gx) - 0.5f; - float4 tx = math.floor(gx + 0.5f); + float4 gx = frac(i * (1.0f / 41.0f)) * 2.0f - 1.0f; + float4 gy = abs(gx) - 0.5f; + float4 tx = floor(gx + 0.5f); gx = gx - tx; - float2 g00 = new float2(gx.x, gy.x); - float2 g10 = new float2(gx.y, gy.y); - float2 g01 = new float2(gx.z, gy.z); - float2 g11 = new float2(gx.w, gy.w); + float2 g00 = float2(gx.x, gy.x); + float2 g10 = float2(gx.y, gy.y); + float2 g01 = float2(gx.z, gy.z); + float2 g11 = float2(gx.w, gy.w); - float4 norm = taylorInvSqrt(new float4(math.dot(g00, g00), math.dot(g01, g01), math.dot(g10, g10), math.dot(g11, g11))); + float4 norm = taylorInvSqrt(float4(dot(g00, g00), dot(g01, g01), dot(g10, g10), dot(g11, g11))); g00 *= norm.x; g01 *= norm.y; g10 *= norm.z; g11 *= norm.w; - float n00 = math.dot(g00, new float2(fx.x, fy.x)); - float n10 = math.dot(g10, new float2(fx.y, fy.y)); - float n01 = math.dot(g01, new float2(fx.z, fy.z)); - float n11 = math.dot(g11, new float2(fx.w, fy.w)); + float n00 = dot(g00, float2(fx.x, fy.x)); + float n10 = dot(g10, float2(fx.y, fy.y)); + float n01 = dot(g01, float2(fx.z, fy.z)); + float n11 = dot(g11, float2(fx.w, fy.w)); float2 fade_xy = fade(Pf.xy); - float2 n_x = math.mix(new float2(n00, n01), new float2(n10, n11), fade_xy.x); - float n_xy = math.mix(n_x.x, n_x.y, fade_xy.y); + float2 n_x = lerp(float2(n00, n01), float2(n10, n11), fade_xy.x); + float n_xy = lerp(n_x.x, n_x.y, fade_xy.y); return 2.3f * n_xy; } } diff --git a/src/Unity.Mathematics/Noise/classicnoise3D.cs b/src/Unity.Mathematics/Noise/classicnoise3D.cs index 7a72d8f1..be4893c6 100644 --- a/src/Unity.Mathematics/Noise/classicnoise3D.cs +++ b/src/Unity.Mathematics/Noise/classicnoise3D.cs @@ -12,21 +12,27 @@ // https://github.com/stegu/webgl-noise // +using static Unity.Mathematics.math; + namespace Unity.Mathematics { public static partial class noise { - // Classic Perlin noise + /// + /// Classic Perlin noise + /// + /// Point on a 3D grid of gradient vectors. + /// Noise value. public static float cnoise(float3 P) { - float3 Pi0 = math.floor(P); // Integer part for indexing - float3 Pi1 = Pi0 + new float3(1.0f); // Integer part + 1 + float3 Pi0 = floor(P); // Integer part for indexing + float3 Pi1 = Pi0 + float3(1.0f); // Integer part + 1 Pi0 = mod289(Pi0); Pi1 = mod289(Pi1); - float3 Pf0 = math.fract(P); // Fractional part for interpolation - float3 Pf1 = Pf0 - new float3(1.0f); // Fractional part - 1.0 - float4 ix = new float4(Pi0.x, Pi1.x, Pi0.x, Pi1.x); - float4 iy = new float4(Pi0.yy, Pi1.yy); + float3 Pf0 = frac(P); // Fractional part for interpolation + float3 Pf1 = Pf0 - float3(1.0f); // Fractional part - 1.0 + float4 ix = float4(Pi0.x, Pi1.x, Pi0.x, Pi1.x); + float4 iy = float4(Pi0.yy, Pi1.yy); float4 iz0 = Pi0.zzzz; float4 iz1 = Pi1.zzzz; @@ -35,68 +41,73 @@ public static float cnoise(float3 P) float4 ixy1 = permute(ixy + iz1); float4 gx0 = ixy0 * (1.0f / 7.0f); - float4 gy0 = math.fract(math.floor(gx0) * (1.0f / 7.0f)) - 0.5f; - gx0 = math.fract(gx0); - float4 gz0 = new float4(0.5f) - math.abs(gx0) - math.abs(gy0); - float4 sz0 = math.step(gz0, new float4(0.0f)); - gx0 -= sz0 * (math.step(0.0f, gx0) - 0.5f); - gy0 -= sz0 * (math.step(0.0f, gy0) - 0.5f); + float4 gy0 = frac(floor(gx0) * (1.0f / 7.0f)) - 0.5f; + gx0 = frac(gx0); + float4 gz0 = float4(0.5f) - abs(gx0) - abs(gy0); + float4 sz0 = step(gz0, float4(0.0f)); + gx0 -= sz0 * (step(0.0f, gx0) - 0.5f); + gy0 -= sz0 * (step(0.0f, gy0) - 0.5f); float4 gx1 = ixy1 * (1.0f / 7.0f); - float4 gy1 = math.fract(math.floor(gx1) * (1.0f / 7.0f)) - 0.5f; - gx1 = math.fract(gx1); - float4 gz1 = new float4(0.5f) - math.abs(gx1) - math.abs(gy1); - float4 sz1 = math.step(gz1, new float4(0.0f)); - gx1 -= sz1 * (math.step(0.0f, gx1) - 0.5f); - gy1 -= sz1 * (math.step(0.0f, gy1) - 0.5f); - - float3 g000 = new float3(gx0.x, gy0.x, gz0.x); - float3 g100 = new float3(gx0.y, gy0.y, gz0.y); - float3 g010 = new float3(gx0.z, gy0.z, gz0.z); - float3 g110 = new float3(gx0.w, gy0.w, gz0.w); - float3 g001 = new float3(gx1.x, gy1.x, gz1.x); - float3 g101 = new float3(gx1.y, gy1.y, gz1.y); - float3 g011 = new float3(gx1.z, gy1.z, gz1.z); - float3 g111 = new float3(gx1.w, gy1.w, gz1.w); - - float4 norm0 = taylorInvSqrt(new float4(math.dot(g000, g000), math.dot(g010, g010), math.dot(g100, g100), math.dot(g110, g110))); + float4 gy1 = frac(floor(gx1) * (1.0f / 7.0f)) - 0.5f; + gx1 = frac(gx1); + float4 gz1 = float4(0.5f) - abs(gx1) - abs(gy1); + float4 sz1 = step(gz1, float4(0.0f)); + gx1 -= sz1 * (step(0.0f, gx1) - 0.5f); + gy1 -= sz1 * (step(0.0f, gy1) - 0.5f); + + float3 g000 = float3(gx0.x, gy0.x, gz0.x); + float3 g100 = float3(gx0.y, gy0.y, gz0.y); + float3 g010 = float3(gx0.z, gy0.z, gz0.z); + float3 g110 = float3(gx0.w, gy0.w, gz0.w); + float3 g001 = float3(gx1.x, gy1.x, gz1.x); + float3 g101 = float3(gx1.y, gy1.y, gz1.y); + float3 g011 = float3(gx1.z, gy1.z, gz1.z); + float3 g111 = float3(gx1.w, gy1.w, gz1.w); + + float4 norm0 = taylorInvSqrt(float4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); g000 *= norm0.x; g010 *= norm0.y; g100 *= norm0.z; g110 *= norm0.w; - float4 norm1 = taylorInvSqrt(new float4(math.dot(g001, g001), math.dot(g011, g011), math.dot(g101, g101), math.dot(g111, g111))); + float4 norm1 = taylorInvSqrt(float4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); g001 *= norm1.x; g011 *= norm1.y; g101 *= norm1.z; g111 *= norm1.w; - float n000 = math.dot(g000, Pf0); - float n100 = math.dot(g100, new float3(Pf1.x, Pf0.yz)); - float n010 = math.dot(g010, new float3(Pf0.x, Pf1.y, Pf0.z)); - float n110 = math.dot(g110, new float3(Pf1.xy, Pf0.z)); - float n001 = math.dot(g001, new float3(Pf0.xy, Pf1.z)); - float n101 = math.dot(g101, new float3(Pf1.x, Pf0.y, Pf1.z)); - float n011 = math.dot(g011, new float3(Pf0.x, Pf1.yz)); - float n111 = math.dot(g111, Pf1); + float n000 = dot(g000, Pf0); + float n100 = dot(g100, float3(Pf1.x, Pf0.yz)); + float n010 = dot(g010, float3(Pf0.x, Pf1.y, Pf0.z)); + float n110 = dot(g110, float3(Pf1.xy, Pf0.z)); + float n001 = dot(g001, float3(Pf0.xy, Pf1.z)); + float n101 = dot(g101, float3(Pf1.x, Pf0.y, Pf1.z)); + float n011 = dot(g011, float3(Pf0.x, Pf1.yz)); + float n111 = dot(g111, Pf1); float3 fade_xyz = fade(Pf0); - float4 n_z = math.mix(new float4(n000, n100, n010, n110), new float4(n001, n101, n011, n111), fade_xyz.z); - float2 n_yz = math.mix(n_z.xy, n_z.zw, fade_xyz.y); - float n_xyz = math.mix(n_yz.x, n_yz.y, fade_xyz.x); + float4 n_z = lerp(float4(n000, n100, n010, n110), float4(n001, n101, n011, n111), fade_xyz.z); + float2 n_yz = lerp(n_z.xy, n_z.zw, fade_xyz.y); + float n_xyz = lerp(n_yz.x, n_yz.y, fade_xyz.x); return 2.2f * n_xyz; } - // Classic Perlin noise, periodic variant + /// + /// Classic Perlin noise, periodic variant + /// + /// Point on a 3D grid of gradient vectors. + /// Period of repetition. + /// Noise value. public static float pnoise(float3 P, float3 rep) { - float3 Pi0 = math.mod(math.floor(P), rep); // Integer part, math.modulo period - float3 Pi1 = math.mod(Pi0 + new float3(1.0f), rep); // Integer part + 1, math.mod period + float3 Pi0 = fmod(floor(P), rep); // Integer part, math.modulo period + float3 Pi1 = fmod(Pi0 + float3(1.0f), rep); // Integer part + 1, math.mod period Pi0 = mod289(Pi0); Pi1 = mod289(Pi1); - float3 Pf0 = math.fract(P); // Fractional part for interpolation - float3 Pf1 = Pf0 - new float3(1.0f); // Fractional part - 1.0 - float4 ix = new float4(Pi0.x, Pi1.x, Pi0.x, Pi1.x); - float4 iy = new float4(Pi0.yy, Pi1.yy); + float3 Pf0 = frac(P); // Fractional part for interpolation + float3 Pf1 = Pf0 - float3(1.0f); // Fractional part - 1.0 + float4 ix = float4(Pi0.x, Pi1.x, Pi0.x, Pi1.x); + float4 iy = float4(Pi0.yy, Pi1.yy); float4 iz0 = Pi0.zzzz; float4 iz1 = Pi1.zzzz; @@ -105,54 +116,54 @@ public static float pnoise(float3 P, float3 rep) float4 ixy1 = permute(ixy + iz1); float4 gx0 = ixy0 * (1.0f / 7.0f); - float4 gy0 = math.fract(math.floor(gx0) * (1.0f / 7.0f)) - 0.5f; - gx0 = math.fract(gx0); - float4 gz0 = new float4(0.5f) - math.abs(gx0) - math.abs(gy0); - float4 sz0 = math.step(gz0, new float4(0.0f)); - gx0 -= sz0 * (math.step(0.0f, gx0) - 0.5f); - gy0 -= sz0 * (math.step(0.0f, gy0) - 0.5f); + float4 gy0 = frac(floor(gx0) * (1.0f / 7.0f)) - 0.5f; + gx0 = frac(gx0); + float4 gz0 = float4(0.5f) - abs(gx0) - abs(gy0); + float4 sz0 = step(gz0, float4(0.0f)); + gx0 -= sz0 * (step(0.0f, gx0) - 0.5f); + gy0 -= sz0 * (step(0.0f, gy0) - 0.5f); float4 gx1 = ixy1 * (1.0f / 7.0f); - float4 gy1 = math.fract(math.floor(gx1) * (1.0f / 7.0f)) - 0.5f; - gx1 = math.fract(gx1); - float4 gz1 = new float4(0.5f) - math.abs(gx1) - math.abs(gy1); - float4 sz1 = math.step(gz1, new float4(0.0f)); - gx1 -= sz1 * (math.step(0.0f, gx1) - 0.5f); - gy1 -= sz1 * (math.step(0.0f, gy1) - 0.5f); - - float3 g000 = new float3(gx0.x, gy0.x, gz0.x); - float3 g100 = new float3(gx0.y, gy0.y, gz0.y); - float3 g010 = new float3(gx0.z, gy0.z, gz0.z); - float3 g110 = new float3(gx0.w, gy0.w, gz0.w); - float3 g001 = new float3(gx1.x, gy1.x, gz1.x); - float3 g101 = new float3(gx1.y, gy1.y, gz1.y); - float3 g011 = new float3(gx1.z, gy1.z, gz1.z); - float3 g111 = new float3(gx1.w, gy1.w, gz1.w); - - float4 norm0 = taylorInvSqrt(new float4(math.dot(g000, g000), math.dot(g010, g010), math.dot(g100, g100), math.dot(g110, g110))); + float4 gy1 = frac(floor(gx1) * (1.0f / 7.0f)) - 0.5f; + gx1 = frac(gx1); + float4 gz1 = float4(0.5f) - abs(gx1) - abs(gy1); + float4 sz1 = step(gz1, float4(0.0f)); + gx1 -= sz1 * (step(0.0f, gx1) - 0.5f); + gy1 -= sz1 * (step(0.0f, gy1) - 0.5f); + + float3 g000 = float3(gx0.x, gy0.x, gz0.x); + float3 g100 = float3(gx0.y, gy0.y, gz0.y); + float3 g010 = float3(gx0.z, gy0.z, gz0.z); + float3 g110 = float3(gx0.w, gy0.w, gz0.w); + float3 g001 = float3(gx1.x, gy1.x, gz1.x); + float3 g101 = float3(gx1.y, gy1.y, gz1.y); + float3 g011 = float3(gx1.z, gy1.z, gz1.z); + float3 g111 = float3(gx1.w, gy1.w, gz1.w); + + float4 norm0 = taylorInvSqrt(float4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); g000 *= norm0.x; g010 *= norm0.y; g100 *= norm0.z; g110 *= norm0.w; - float4 norm1 = taylorInvSqrt(new float4(math.dot(g001, g001), math.dot(g011, g011), math.dot(g101, g101), math.dot(g111, g111))); + float4 norm1 = taylorInvSqrt(float4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); g001 *= norm1.x; g011 *= norm1.y; g101 *= norm1.z; g111 *= norm1.w; - float n000 = math.dot(g000, Pf0); - float n100 = math.dot(g100, new float3(Pf1.x, Pf0.yz)); - float n010 = math.dot(g010, new float3(Pf0.x, Pf1.y, Pf0.z)); - float n110 = math.dot(g110, new float3(Pf1.xy, Pf0.z)); - float n001 = math.dot(g001, new float3(Pf0.xy, Pf1.z)); - float n101 = math.dot(g101, new float3(Pf1.x, Pf0.y, Pf1.z)); - float n011 = math.dot(g011, new float3(Pf0.x, Pf1.yz)); - float n111 = math.dot(g111, Pf1); + float n000 = dot(g000, Pf0); + float n100 = dot(g100, float3(Pf1.x, Pf0.yz)); + float n010 = dot(g010, float3(Pf0.x, Pf1.y, Pf0.z)); + float n110 = dot(g110, float3(Pf1.xy, Pf0.z)); + float n001 = dot(g001, float3(Pf0.xy, Pf1.z)); + float n101 = dot(g101, float3(Pf1.x, Pf0.y, Pf1.z)); + float n011 = dot(g011, float3(Pf0.x, Pf1.yz)); + float n111 = dot(g111, Pf1); float3 fade_xyz = fade(Pf0); - float4 n_z = math.mix(new float4(n000, n100, n010, n110), new float4(n001, n101, n011, n111), fade_xyz.z); - float2 n_yz = math.mix(n_z.xy, n_z.zw, fade_xyz.y); - float n_xyz = math.mix(n_yz.x, n_yz.y, fade_xyz.x); + float4 n_z = lerp(float4(n000, n100, n010, n110), float4(n001, n101, n011, n111), fade_xyz.z); + float2 n_yz = lerp(n_z.xy, n_z.zw, fade_xyz.y); + float n_xyz = lerp(n_yz.x, n_yz.y, fade_xyz.x); return 2.2f * n_xyz; } } diff --git a/src/Unity.Mathematics/Noise/classicnoise4D.cs b/src/Unity.Mathematics/Noise/classicnoise4D.cs index c342426e..60f5f474 100644 --- a/src/Unity.Mathematics/Noise/classicnoise4D.cs +++ b/src/Unity.Mathematics/Noise/classicnoise4D.cs @@ -12,25 +12,31 @@ // https://github.com/stegu/webgl-noise // +using static Unity.Mathematics.math; + namespace Unity.Mathematics { public static partial class noise { - // Classic Perlin noise + /// + /// Classic Perlin noise + /// + /// Point on a 4D grid of gradient vectors. + /// Noise value. public static float cnoise(float4 P) { - float4 Pi0 = math.floor(P); // Integer part for indexing + float4 Pi0 = floor(P); // Integer part for indexing float4 Pi1 = Pi0 + 1.0f; // Integer part + 1 Pi0 = mod289(Pi0); Pi1 = mod289(Pi1); - float4 Pf0 = math.fract(P); // Fractional part for interpolation + float4 Pf0 = frac(P); // Fractional part for interpolation float4 Pf1 = Pf0 - 1.0f; // Fractional part - 1.0 - float4 ix = new float4(Pi0.x, Pi1.x, Pi0.x, Pi1.x); - float4 iy = new float4(Pi0.yy, Pi1.yy); - float4 iz0 = new float4(Pi0.zzzz); - float4 iz1 = new float4(Pi1.zzzz); - float4 iw0 = new float4(Pi0.wwww); - float4 iw1 = new float4(Pi1.wwww); + float4 ix = float4(Pi0.x, Pi1.x, Pi0.x, Pi1.x); + float4 iy = float4(Pi0.yy, Pi1.yy); + float4 iz0 = float4(Pi0.zzzz); + float4 iz1 = float4(Pi1.zzzz); + float4 iw0 = float4(Pi0.wwww); + float4 iw1 = float4(Pi1.wwww); float4 ixy = permute(permute(ix) + iy); float4 ixy0 = permute(ixy + iz0); @@ -41,131 +47,136 @@ public static float cnoise(float4 P) float4 ixy11 = permute(ixy1 + iw1); float4 gx00 = ixy00 * (1.0f / 7.0f); - float4 gy00 = math.floor(gx00) * (1.0f / 7.0f); - float4 gz00 = math.floor(gy00) * (1.0f / 6.0f); - gx00 = math.fract(gx00) - 0.5f; - gy00 = math.fract(gy00) - 0.5f; - gz00 = math.fract(gz00) - 0.5f; - float4 gw00 = new float4(0.75f) - math.abs(gx00) - math.abs(gy00) - math.abs(gz00); - float4 sw00 = math.step(gw00, new float4(0.0f)); - gx00 -= sw00 * (math.step(0.0f, gx00) - 0.5f); - gy00 -= sw00 * (math.step(0.0f, gy00) - 0.5f); + float4 gy00 = floor(gx00) * (1.0f / 7.0f); + float4 gz00 = floor(gy00) * (1.0f / 6.0f); + gx00 = frac(gx00) - 0.5f; + gy00 = frac(gy00) - 0.5f; + gz00 = frac(gz00) - 0.5f; + float4 gw00 = float4(0.75f) - abs(gx00) - abs(gy00) - abs(gz00); + float4 sw00 = step(gw00, float4(0.0f)); + gx00 -= sw00 * (step(0.0f, gx00) - 0.5f); + gy00 -= sw00 * (step(0.0f, gy00) - 0.5f); float4 gx01 = ixy01 * (1.0f / 7.0f); - float4 gy01 = math.floor(gx01) * (1.0f / 7.0f); - float4 gz01 = math.floor(gy01) * (1.0f / 6.0f); - gx01 = math.fract(gx01) - 0.5f; - gy01 = math.fract(gy01) - 0.5f; - gz01 = math.fract(gz01) - 0.5f; - float4 gw01 = new float4(0.75f) - math.abs(gx01) - math.abs(gy01) - math.abs(gz01); - float4 sw01 = math.step(gw01, new float4(0.0f)); - gx01 -= sw01 * (math.step(0.0f, gx01) - 0.5f); - gy01 -= sw01 * (math.step(0.0f, gy01) - 0.5f); + float4 gy01 = floor(gx01) * (1.0f / 7.0f); + float4 gz01 = floor(gy01) * (1.0f / 6.0f); + gx01 = frac(gx01) - 0.5f; + gy01 = frac(gy01) - 0.5f; + gz01 = frac(gz01) - 0.5f; + float4 gw01 = float4(0.75f) - abs(gx01) - abs(gy01) - abs(gz01); + float4 sw01 = step(gw01, float4(0.0f)); + gx01 -= sw01 * (step(0.0f, gx01) - 0.5f); + gy01 -= sw01 * (step(0.0f, gy01) - 0.5f); float4 gx10 = ixy10 * (1.0f / 7.0f); - float4 gy10 = math.floor(gx10) * (1.0f / 7.0f); - float4 gz10 = math.floor(gy10) * (1.0f / 6.0f); - gx10 = math.fract(gx10) - 0.5f; - gy10 = math.fract(gy10) - 0.5f; - gz10 = math.fract(gz10) - 0.5f; - float4 gw10 = new float4(0.75f) - math.abs(gx10) - math.abs(gy10) - math.abs(gz10); - float4 sw10 = math.step(gw10, new float4(0.0f)); - gx10 -= sw10 * (math.step(0.0f, gx10) - 0.5f); - gy10 -= sw10 * (math.step(0.0f, gy10) - 0.5f); + float4 gy10 = floor(gx10) * (1.0f / 7.0f); + float4 gz10 = floor(gy10) * (1.0f / 6.0f); + gx10 = frac(gx10) - 0.5f; + gy10 = frac(gy10) - 0.5f; + gz10 = frac(gz10) - 0.5f; + float4 gw10 = float4(0.75f) - abs(gx10) - abs(gy10) - abs(gz10); + float4 sw10 = step(gw10, float4(0.0f)); + gx10 -= sw10 * (step(0.0f, gx10) - 0.5f); + gy10 -= sw10 * (step(0.0f, gy10) - 0.5f); float4 gx11 = ixy11 * (1.0f / 7.0f); - float4 gy11 = math.floor(gx11) * (1.0f / 7.0f); - float4 gz11 = math.floor(gy11) * (1.0f / 6.0f); - gx11 = math.fract(gx11) - 0.5f; - gy11 = math.fract(gy11) - 0.5f; - gz11 = math.fract(gz11) - 0.5f; - float4 gw11 = new float4(0.75f) - math.abs(gx11) - math.abs(gy11) - math.abs(gz11); - float4 sw11 = math.step(gw11, new float4(0.0f)); - gx11 -= sw11 * (math.step(0.0f, gx11) - 0.5f); - gy11 -= sw11 * (math.step(0.0f, gy11) - 0.5f); + float4 gy11 = floor(gx11) * (1.0f / 7.0f); + float4 gz11 = floor(gy11) * (1.0f / 6.0f); + gx11 = frac(gx11) - 0.5f; + gy11 = frac(gy11) - 0.5f; + gz11 = frac(gz11) - 0.5f; + float4 gw11 = float4(0.75f) - abs(gx11) - abs(gy11) - abs(gz11); + float4 sw11 = step(gw11, float4(0.0f)); + gx11 -= sw11 * (step(0.0f, gx11) - 0.5f); + gy11 -= sw11 * (step(0.0f, gy11) - 0.5f); - float4 g0000 = new float4(gx00.x, gy00.x, gz00.x, gw00.x); - float4 g1000 = new float4(gx00.y, gy00.y, gz00.y, gw00.y); - float4 g0100 = new float4(gx00.z, gy00.z, gz00.z, gw00.z); - float4 g1100 = new float4(gx00.w, gy00.w, gz00.w, gw00.w); - float4 g0010 = new float4(gx10.x, gy10.x, gz10.x, gw10.x); - float4 g1010 = new float4(gx10.y, gy10.y, gz10.y, gw10.y); - float4 g0110 = new float4(gx10.z, gy10.z, gz10.z, gw10.z); - float4 g1110 = new float4(gx10.w, gy10.w, gz10.w, gw10.w); - float4 g0001 = new float4(gx01.x, gy01.x, gz01.x, gw01.x); - float4 g1001 = new float4(gx01.y, gy01.y, gz01.y, gw01.y); - float4 g0101 = new float4(gx01.z, gy01.z, gz01.z, gw01.z); - float4 g1101 = new float4(gx01.w, gy01.w, gz01.w, gw01.w); - float4 g0011 = new float4(gx11.x, gy11.x, gz11.x, gw11.x); - float4 g1011 = new float4(gx11.y, gy11.y, gz11.y, gw11.y); - float4 g0111 = new float4(gx11.z, gy11.z, gz11.z, gw11.z); - float4 g1111 = new float4(gx11.w, gy11.w, gz11.w, gw11.w); + float4 g0000 = float4(gx00.x, gy00.x, gz00.x, gw00.x); + float4 g1000 = float4(gx00.y, gy00.y, gz00.y, gw00.y); + float4 g0100 = float4(gx00.z, gy00.z, gz00.z, gw00.z); + float4 g1100 = float4(gx00.w, gy00.w, gz00.w, gw00.w); + float4 g0010 = float4(gx10.x, gy10.x, gz10.x, gw10.x); + float4 g1010 = float4(gx10.y, gy10.y, gz10.y, gw10.y); + float4 g0110 = float4(gx10.z, gy10.z, gz10.z, gw10.z); + float4 g1110 = float4(gx10.w, gy10.w, gz10.w, gw10.w); + float4 g0001 = float4(gx01.x, gy01.x, gz01.x, gw01.x); + float4 g1001 = float4(gx01.y, gy01.y, gz01.y, gw01.y); + float4 g0101 = float4(gx01.z, gy01.z, gz01.z, gw01.z); + float4 g1101 = float4(gx01.w, gy01.w, gz01.w, gw01.w); + float4 g0011 = float4(gx11.x, gy11.x, gz11.x, gw11.x); + float4 g1011 = float4(gx11.y, gy11.y, gz11.y, gw11.y); + float4 g0111 = float4(gx11.z, gy11.z, gz11.z, gw11.z); + float4 g1111 = float4(gx11.w, gy11.w, gz11.w, gw11.w); - float4 norm00 = taylorInvSqrt(new float4(math.dot(g0000, g0000), math.dot(g0100, g0100), math.dot(g1000, g1000), math.dot(g1100, g1100))); + float4 norm00 = taylorInvSqrt(float4(dot(g0000, g0000), dot(g0100, g0100), dot(g1000, g1000), dot(g1100, g1100))); g0000 *= norm00.x; g0100 *= norm00.y; g1000 *= norm00.z; g1100 *= norm00.w; - float4 norm01 = taylorInvSqrt(new float4(math.dot(g0001, g0001), math.dot(g0101, g0101), math.dot(g1001, g1001), math.dot(g1101, g1101))); + float4 norm01 = taylorInvSqrt(float4(dot(g0001, g0001), dot(g0101, g0101), dot(g1001, g1001), dot(g1101, g1101))); g0001 *= norm01.x; g0101 *= norm01.y; g1001 *= norm01.z; g1101 *= norm01.w; - float4 norm10 = taylorInvSqrt(new float4(math.dot(g0010, g0010), math.dot(g0110, g0110), math.dot(g1010, g1010), math.dot(g1110, g1110))); + float4 norm10 = taylorInvSqrt(float4(dot(g0010, g0010), dot(g0110, g0110), dot(g1010, g1010), dot(g1110, g1110))); g0010 *= norm10.x; g0110 *= norm10.y; g1010 *= norm10.z; g1110 *= norm10.w; - float4 norm11 = taylorInvSqrt(new float4(math.dot(g0011, g0011), math.dot(g0111, g0111), math.dot(g1011, g1011), math.dot(g1111, g1111))); + float4 norm11 = taylorInvSqrt(float4(dot(g0011, g0011), dot(g0111, g0111), dot(g1011, g1011), dot(g1111, g1111))); g0011 *= norm11.x; g0111 *= norm11.y; g1011 *= norm11.z; g1111 *= norm11.w; - float n0000 = math.dot(g0000, Pf0); - float n1000 = math.dot(g1000, new float4(Pf1.x, Pf0.yzw)); - float n0100 = math.dot(g0100, new float4(Pf0.x, Pf1.y, Pf0.zw)); - float n1100 = math.dot(g1100, new float4(Pf1.xy, Pf0.zw)); - float n0010 = math.dot(g0010, new float4(Pf0.xy, Pf1.z, Pf0.w)); - float n1010 = math.dot(g1010, new float4(Pf1.x, Pf0.y, Pf1.z, Pf0.w)); - float n0110 = math.dot(g0110, new float4(Pf0.x, Pf1.yz, Pf0.w)); - float n1110 = math.dot(g1110, new float4(Pf1.xyz, Pf0.w)); - float n0001 = math.dot(g0001, new float4(Pf0.xyz, Pf1.w)); - float n1001 = math.dot(g1001, new float4(Pf1.x, Pf0.yz, Pf1.w)); - float n0101 = math.dot(g0101, new float4(Pf0.x, Pf1.y, Pf0.z, Pf1.w)); - float n1101 = math.dot(g1101, new float4(Pf1.xy, Pf0.z, Pf1.w)); - float n0011 = math.dot(g0011, new float4(Pf0.xy, Pf1.zw)); - float n1011 = math.dot(g1011, new float4(Pf1.x, Pf0.y, Pf1.zw)); - float n0111 = math.dot(g0111, new float4(Pf0.x, Pf1.yzw)); - float n1111 = math.dot(g1111, Pf1); + float n0000 = dot(g0000, Pf0); + float n1000 = dot(g1000, float4(Pf1.x, Pf0.yzw)); + float n0100 = dot(g0100, float4(Pf0.x, Pf1.y, Pf0.zw)); + float n1100 = dot(g1100, float4(Pf1.xy, Pf0.zw)); + float n0010 = dot(g0010, float4(Pf0.xy, Pf1.z, Pf0.w)); + float n1010 = dot(g1010, float4(Pf1.x, Pf0.y, Pf1.z, Pf0.w)); + float n0110 = dot(g0110, float4(Pf0.x, Pf1.yz, Pf0.w)); + float n1110 = dot(g1110, float4(Pf1.xyz, Pf0.w)); + float n0001 = dot(g0001, float4(Pf0.xyz, Pf1.w)); + float n1001 = dot(g1001, float4(Pf1.x, Pf0.yz, Pf1.w)); + float n0101 = dot(g0101, float4(Pf0.x, Pf1.y, Pf0.z, Pf1.w)); + float n1101 = dot(g1101, float4(Pf1.xy, Pf0.z, Pf1.w)); + float n0011 = dot(g0011, float4(Pf0.xy, Pf1.zw)); + float n1011 = dot(g1011, float4(Pf1.x, Pf0.y, Pf1.zw)); + float n0111 = dot(g0111, float4(Pf0.x, Pf1.yzw)); + float n1111 = dot(g1111, Pf1); float4 fade_xyzw = fade(Pf0); - float4 n_0w = math.mix(new float4(n0000, n1000, n0100, n1100), new float4(n0001, n1001, n0101, n1101), fade_xyzw.w); - float4 n_1w = math.mix(new float4(n0010, n1010, n0110, n1110), new float4(n0011, n1011, n0111, n1111), fade_xyzw.w); - float4 n_zw = math.mix(n_0w, n_1w, fade_xyzw.z); - float2 n_yzw = math.mix(n_zw.xy, n_zw.zw, fade_xyzw.y); - float n_xyzw = math.mix(n_yzw.x, n_yzw.y, fade_xyzw.x); + float4 n_0w = lerp(float4(n0000, n1000, n0100, n1100), float4(n0001, n1001, n0101, n1101), fade_xyzw.w); + float4 n_1w = lerp(float4(n0010, n1010, n0110, n1110), float4(n0011, n1011, n0111, n1111), fade_xyzw.w); + float4 n_zw = lerp(n_0w, n_1w, fade_xyzw.z); + float2 n_yzw = lerp(n_zw.xy, n_zw.zw, fade_xyzw.y); + float n_xyzw = lerp(n_yzw.x, n_yzw.y, fade_xyzw.x); return 2.2f * n_xyzw; } - // Classic Perlin noise, periodic version + /// + /// Classic Perlin noise, periodic variant + /// + /// Point on a 4D grid of gradient vectors. + /// Period of repetition. + /// Noise value. public static float pnoise(float4 P, float4 rep) { - float4 Pi0 = math.mod(math.floor(P), rep); // Integer part math.modulo rep - float4 Pi1 = math.mod(Pi0 + 1.0f, rep); // Integer part + 1 math.mod rep + float4 Pi0 = fmod(floor(P), rep); // Integer part math.modulo rep + float4 Pi1 = fmod(Pi0 + 1.0f, rep); // Integer part + 1 math.mod rep Pi0 = mod289(Pi0); Pi1 = mod289(Pi1); - float4 Pf0 = math.fract(P); // Fractional part for interpolation + float4 Pf0 = frac(P); // Fractional part for interpolation float4 Pf1 = Pf0 - 1.0f; // Fractional part - 1.0 - float4 ix = new float4(Pi0.x, Pi1.x, Pi0.x, Pi1.x); - float4 iy = new float4(Pi0.yy, Pi1.yy); - float4 iz0 = new float4(Pi0.zzzz); - float4 iz1 = new float4(Pi1.zzzz); - float4 iw0 = new float4(Pi0.wwww); - float4 iw1 = new float4(Pi1.wwww); + float4 ix = float4(Pi0.x, Pi1.x, Pi0.x, Pi1.x); + float4 iy = float4(Pi0.yy, Pi1.yy); + float4 iz0 = float4(Pi0.zzzz); + float4 iz1 = float4(Pi1.zzzz); + float4 iw0 = float4(Pi0.wwww); + float4 iw1 = float4(Pi1.wwww); float4 ixy = permute(permute(ix) + iy); float4 ixy0 = permute(ixy + iz0); @@ -176,113 +187,113 @@ public static float pnoise(float4 P, float4 rep) float4 ixy11 = permute(ixy1 + iw1); float4 gx00 = ixy00 * (1.0f / 7.0f); - float4 gy00 = math.floor(gx00) * (1.0f / 7.0f); - float4 gz00 = math.floor(gy00) * (1.0f / 6.0f); - gx00 = math.fract(gx00) - 0.5f; - gy00 = math.fract(gy00) - 0.5f; - gz00 = math.fract(gz00) - 0.5f; - float4 gw00 = new float4(0.75f) - math.abs(gx00) - math.abs(gy00) - math.abs(gz00); - float4 sw00 = math.step(gw00, new float4(0.0f)); - gx00 -= sw00 * (math.step(0.0f, gx00) - 0.5f); - gy00 -= sw00 * (math.step(0.0f, gy00) - 0.5f); + float4 gy00 = floor(gx00) * (1.0f / 7.0f); + float4 gz00 = floor(gy00) * (1.0f / 6.0f); + gx00 = frac(gx00) - 0.5f; + gy00 = frac(gy00) - 0.5f; + gz00 = frac(gz00) - 0.5f; + float4 gw00 = float4(0.75f) - abs(gx00) - abs(gy00) - abs(gz00); + float4 sw00 = step(gw00, float4(0.0f)); + gx00 -= sw00 * (step(0.0f, gx00) - 0.5f); + gy00 -= sw00 * (step(0.0f, gy00) - 0.5f); float4 gx01 = ixy01 * (1.0f / 7.0f); - float4 gy01 = math.floor(gx01) * (1.0f / 7.0f); - float4 gz01 = math.floor(gy01) * (1.0f / 6.0f); - gx01 = math.fract(gx01) - 0.5f; - gy01 = math.fract(gy01) - 0.5f; - gz01 = math.fract(gz01) - 0.5f; - float4 gw01 = new float4(0.75f) - math.abs(gx01) - math.abs(gy01) - math.abs(gz01); - float4 sw01 = math.step(gw01, new float4(0.0f)); - gx01 -= sw01 * (math.step(0.0f, gx01) - 0.5f); - gy01 -= sw01 * (math.step(0.0f, gy01) - 0.5f); + float4 gy01 = floor(gx01) * (1.0f / 7.0f); + float4 gz01 = floor(gy01) * (1.0f / 6.0f); + gx01 = frac(gx01) - 0.5f; + gy01 = frac(gy01) - 0.5f; + gz01 = frac(gz01) - 0.5f; + float4 gw01 = float4(0.75f) - abs(gx01) - abs(gy01) - abs(gz01); + float4 sw01 = step(gw01, float4(0.0f)); + gx01 -= sw01 * (step(0.0f, gx01) - 0.5f); + gy01 -= sw01 * (step(0.0f, gy01) - 0.5f); float4 gx10 = ixy10 * (1.0f / 7.0f); - float4 gy10 = math.floor(gx10) * (1.0f / 7.0f); - float4 gz10 = math.floor(gy10) * (1.0f / 6.0f); - gx10 = math.fract(gx10) - 0.5f; - gy10 = math.fract(gy10) - 0.5f; - gz10 = math.fract(gz10) - 0.5f; - float4 gw10 = new float4(0.75f) - math.abs(gx10) - math.abs(gy10) - math.abs(gz10); - float4 sw10 = math.step(gw10, new float4(0.0f)); - gx10 -= sw10 * (math.step(0.0f, gx10) - 0.5f); - gy10 -= sw10 * (math.step(0.0f, gy10) - 0.5f); + float4 gy10 = floor(gx10) * (1.0f / 7.0f); + float4 gz10 = floor(gy10) * (1.0f / 6.0f); + gx10 = frac(gx10) - 0.5f; + gy10 = frac(gy10) - 0.5f; + gz10 = frac(gz10) - 0.5f; + float4 gw10 = float4(0.75f) - abs(gx10) - abs(gy10) - abs(gz10); + float4 sw10 = step(gw10, float4(0.0f)); + gx10 -= sw10 * (step(0.0f, gx10) - 0.5f); + gy10 -= sw10 * (step(0.0f, gy10) - 0.5f); float4 gx11 = ixy11 * (1.0f / 7.0f); - float4 gy11 = math.floor(gx11) * (1.0f / 7.0f); - float4 gz11 = math.floor(gy11) * (1.0f / 6.0f); - gx11 = math.fract(gx11) - 0.5f; - gy11 = math.fract(gy11) - 0.5f; - gz11 = math.fract(gz11) - 0.5f; - float4 gw11 = new float4(0.75f) - math.abs(gx11) - math.abs(gy11) - math.abs(gz11); - float4 sw11 = math.step(gw11, new float4(0.0f)); - gx11 -= sw11 * (math.step(0.0f, gx11) - 0.5f); - gy11 -= sw11 * (math.step(0.0f, gy11) - 0.5f); + float4 gy11 = floor(gx11) * (1.0f / 7.0f); + float4 gz11 = floor(gy11) * (1.0f / 6.0f); + gx11 = frac(gx11) - 0.5f; + gy11 = frac(gy11) - 0.5f; + gz11 = frac(gz11) - 0.5f; + float4 gw11 = float4(0.75f) - abs(gx11) - abs(gy11) - abs(gz11); + float4 sw11 = step(gw11, float4(0.0f)); + gx11 -= sw11 * (step(0.0f, gx11) - 0.5f); + gy11 -= sw11 * (step(0.0f, gy11) - 0.5f); - float4 g0000 = new float4(gx00.x, gy00.x, gz00.x, gw00.x); - float4 g1000 = new float4(gx00.y, gy00.y, gz00.y, gw00.y); - float4 g0100 = new float4(gx00.z, gy00.z, gz00.z, gw00.z); - float4 g1100 = new float4(gx00.w, gy00.w, gz00.w, gw00.w); - float4 g0010 = new float4(gx10.x, gy10.x, gz10.x, gw10.x); - float4 g1010 = new float4(gx10.y, gy10.y, gz10.y, gw10.y); - float4 g0110 = new float4(gx10.z, gy10.z, gz10.z, gw10.z); - float4 g1110 = new float4(gx10.w, gy10.w, gz10.w, gw10.w); - float4 g0001 = new float4(gx01.x, gy01.x, gz01.x, gw01.x); - float4 g1001 = new float4(gx01.y, gy01.y, gz01.y, gw01.y); - float4 g0101 = new float4(gx01.z, gy01.z, gz01.z, gw01.z); - float4 g1101 = new float4(gx01.w, gy01.w, gz01.w, gw01.w); - float4 g0011 = new float4(gx11.x, gy11.x, gz11.x, gw11.x); - float4 g1011 = new float4(gx11.y, gy11.y, gz11.y, gw11.y); - float4 g0111 = new float4(gx11.z, gy11.z, gz11.z, gw11.z); - float4 g1111 = new float4(gx11.w, gy11.w, gz11.w, gw11.w); + float4 g0000 = float4(gx00.x, gy00.x, gz00.x, gw00.x); + float4 g1000 = float4(gx00.y, gy00.y, gz00.y, gw00.y); + float4 g0100 = float4(gx00.z, gy00.z, gz00.z, gw00.z); + float4 g1100 = float4(gx00.w, gy00.w, gz00.w, gw00.w); + float4 g0010 = float4(gx10.x, gy10.x, gz10.x, gw10.x); + float4 g1010 = float4(gx10.y, gy10.y, gz10.y, gw10.y); + float4 g0110 = float4(gx10.z, gy10.z, gz10.z, gw10.z); + float4 g1110 = float4(gx10.w, gy10.w, gz10.w, gw10.w); + float4 g0001 = float4(gx01.x, gy01.x, gz01.x, gw01.x); + float4 g1001 = float4(gx01.y, gy01.y, gz01.y, gw01.y); + float4 g0101 = float4(gx01.z, gy01.z, gz01.z, gw01.z); + float4 g1101 = float4(gx01.w, gy01.w, gz01.w, gw01.w); + float4 g0011 = float4(gx11.x, gy11.x, gz11.x, gw11.x); + float4 g1011 = float4(gx11.y, gy11.y, gz11.y, gw11.y); + float4 g0111 = float4(gx11.z, gy11.z, gz11.z, gw11.z); + float4 g1111 = float4(gx11.w, gy11.w, gz11.w, gw11.w); - float4 norm00 = taylorInvSqrt(new float4(math.dot(g0000, g0000), math.dot(g0100, g0100), math.dot(g1000, g1000), math.dot(g1100, g1100))); + float4 norm00 = taylorInvSqrt(float4(dot(g0000, g0000), dot(g0100, g0100), dot(g1000, g1000), dot(g1100, g1100))); g0000 *= norm00.x; g0100 *= norm00.y; g1000 *= norm00.z; g1100 *= norm00.w; - float4 norm01 = taylorInvSqrt(new float4(math.dot(g0001, g0001), math.dot(g0101, g0101), math.dot(g1001, g1001), math.dot(g1101, g1101))); + float4 norm01 = taylorInvSqrt(float4(dot(g0001, g0001), dot(g0101, g0101), dot(g1001, g1001), dot(g1101, g1101))); g0001 *= norm01.x; g0101 *= norm01.y; g1001 *= norm01.z; g1101 *= norm01.w; - float4 norm10 = taylorInvSqrt(new float4(math.dot(g0010, g0010), math.dot(g0110, g0110), math.dot(g1010, g1010), math.dot(g1110, g1110))); + float4 norm10 = taylorInvSqrt(float4(dot(g0010, g0010), dot(g0110, g0110), dot(g1010, g1010), dot(g1110, g1110))); g0010 *= norm10.x; g0110 *= norm10.y; g1010 *= norm10.z; g1110 *= norm10.w; - float4 norm11 = taylorInvSqrt(new float4(math.dot(g0011, g0011), math.dot(g0111, g0111), math.dot(g1011, g1011), math.dot(g1111, g1111))); + float4 norm11 = taylorInvSqrt(float4(dot(g0011, g0011), dot(g0111, g0111), dot(g1011, g1011), dot(g1111, g1111))); g0011 *= norm11.x; g0111 *= norm11.y; g1011 *= norm11.z; g1111 *= norm11.w; - float n0000 = math.dot(g0000, Pf0); - float n1000 = math.dot(g1000, new float4(Pf1.x, Pf0.yzw)); - float n0100 = math.dot(g0100, new float4(Pf0.x, Pf1.y, Pf0.zw)); - float n1100 = math.dot(g1100, new float4(Pf1.xy, Pf0.zw)); - float n0010 = math.dot(g0010, new float4(Pf0.xy, Pf1.z, Pf0.w)); - float n1010 = math.dot(g1010, new float4(Pf1.x, Pf0.y, Pf1.z, Pf0.w)); - float n0110 = math.dot(g0110, new float4(Pf0.x, Pf1.yz, Pf0.w)); - float n1110 = math.dot(g1110, new float4(Pf1.xyz, Pf0.w)); - float n0001 = math.dot(g0001, new float4(Pf0.xyz, Pf1.w)); - float n1001 = math.dot(g1001, new float4(Pf1.x, Pf0.yz, Pf1.w)); - float n0101 = math.dot(g0101, new float4(Pf0.x, Pf1.y, Pf0.z, Pf1.w)); - float n1101 = math.dot(g1101, new float4(Pf1.xy, Pf0.z, Pf1.w)); - float n0011 = math.dot(g0011, new float4(Pf0.xy, Pf1.zw)); - float n1011 = math.dot(g1011, new float4(Pf1.x, Pf0.y, Pf1.zw)); - float n0111 = math.dot(g0111, new float4(Pf0.x, Pf1.yzw)); - float n1111 = math.dot(g1111, Pf1); + float n0000 = dot(g0000, Pf0); + float n1000 = dot(g1000, float4(Pf1.x, Pf0.yzw)); + float n0100 = dot(g0100, float4(Pf0.x, Pf1.y, Pf0.zw)); + float n1100 = dot(g1100, float4(Pf1.xy, Pf0.zw)); + float n0010 = dot(g0010, float4(Pf0.xy, Pf1.z, Pf0.w)); + float n1010 = dot(g1010, float4(Pf1.x, Pf0.y, Pf1.z, Pf0.w)); + float n0110 = dot(g0110, float4(Pf0.x, Pf1.yz, Pf0.w)); + float n1110 = dot(g1110, float4(Pf1.xyz, Pf0.w)); + float n0001 = dot(g0001, float4(Pf0.xyz, Pf1.w)); + float n1001 = dot(g1001, float4(Pf1.x, Pf0.yz, Pf1.w)); + float n0101 = dot(g0101, float4(Pf0.x, Pf1.y, Pf0.z, Pf1.w)); + float n1101 = dot(g1101, float4(Pf1.xy, Pf0.z, Pf1.w)); + float n0011 = dot(g0011, float4(Pf0.xy, Pf1.zw)); + float n1011 = dot(g1011, float4(Pf1.x, Pf0.y, Pf1.zw)); + float n0111 = dot(g0111, float4(Pf0.x, Pf1.yzw)); + float n1111 = dot(g1111, Pf1); float4 fade_xyzw = fade(Pf0); - float4 n_0w = math.mix(new float4(n0000, n1000, n0100, n1100), new float4(n0001, n1001, n0101, n1101), fade_xyzw.w); - float4 n_1w = math.mix(new float4(n0010, n1010, n0110, n1110), new float4(n0011, n1011, n0111, n1111), fade_xyzw.w); - float4 n_zw = math.mix(n_0w, n_1w, fade_xyzw.z); - float2 n_yzw = math.mix(n_zw.xy, n_zw.zw, fade_xyzw.y); - float n_xyzw = math.mix(n_yzw.x, n_yzw.y, fade_xyzw.x); + float4 n_0w = lerp(float4(n0000, n1000, n0100, n1100), float4(n0001, n1001, n0101, n1101), fade_xyzw.w); + float4 n_1w = lerp(float4(n0010, n1010, n0110, n1110), float4(n0011, n1011, n0111, n1111), fade_xyzw.w); + float4 n_zw = lerp(n_0w, n_1w, fade_xyzw.z); + float2 n_yzw = lerp(n_zw.xy, n_zw.zw, fade_xyzw.y); + float n_xyzw = lerp(n_yzw.x, n_yzw.y, fade_xyzw.x); return 2.2f * n_xyzw; } } diff --git a/src/Unity.Mathematics/Noise/common.cs b/src/Unity.Mathematics/Noise/common.cs index dbd5dcd9..1a8d1146 100644 --- a/src/Unity.Mathematics/Noise/common.cs +++ b/src/Unity.Mathematics/Noise/common.cs @@ -1,48 +1,55 @@ -namespace Unity.Mathematics +using Unity.IL2CPP.CompilerServices; +using static Unity.Mathematics.math; + +namespace Unity.Mathematics { + /// + /// A static class containing noise functions. + /// + [Il2CppEagerStaticClassConstruction] public static partial class noise { // Modulo 289 without a division (only multiplications) - static float mod289(float x) { return x - math.floor(x * (1.0f / 289.0f)) * 289.0f; } - static float2 mod289(float2 x) { return x - math.floor(x * (1.0f / 289.0f)) * 289.0f; } - static float3 mod289(float3 x) { return x - math.floor(x * (1.0f / 289.0f)) * 289.0f; } - static float4 mod289(float4 x) { return x - math.floor(x * (1.0f / 289.0f)) * 289.0f; } + static float mod289(float x) { return x - floor(x * (1.0f / 289.0f)) * 289.0f; } + static float2 mod289(float2 x) { return x - floor(x * (1.0f / 289.0f)) * 289.0f; } + static float3 mod289(float3 x) { return x - floor(x * (1.0f / 289.0f)) * 289.0f; } + static float4 mod289(float4 x) { return x - floor(x * (1.0f / 289.0f)) * 289.0f; } // Modulo 7 without a division - static float3 mod7(float3 x) { return x - math.floor(x * (1.0f / 7.0f)) * 7.0f; } - static float4 mod7(float4 x) { return x - math.floor(x * (1.0f / 7.0f)) * 7.0f; } + static float3 mod7(float3 x) { return x - floor(x * (1.0f / 7.0f)) * 7.0f; } + static float4 mod7(float4 x) { return x - floor(x * (1.0f / 7.0f)) * 7.0f; } // Permutation polynomial: (34x^2 + x) math.mod 289 static float permute(float x) { return mod289((34.0f * x + 1.0f) * x); } static float3 permute(float3 x) { return mod289((34.0f * x + 1.0f) * x); } static float4 permute(float4 x) { return mod289((34.0f * x + 1.0f) * x); } - + static float taylorInvSqrt(float r) { return 1.79284291400159f - 0.85373472095314f * r; } static float4 taylorInvSqrt(float4 r) { return 1.79284291400159f - 0.85373472095314f * r; } - + static float2 fade(float2 t) { return t*t*t*(t*(t*6.0f-15.0f)+10.0f); } static float3 fade(float3 t) { return t*t*t*(t*(t*6.0f-15.0f)+10.0f); } static float4 fade(float4 t) { return t*t*t*(t*(t*6.0f-15.0f)+10.0f); } - + static float4 grad4(float j, float4 ip) { - float4 ones = new float4(1.0f, 1.0f, 1.0f, -1.0f); - float3 pxyz = math.floor(math.fract(new float3(j) * ip.xyz) * 7.0f) * ip.z - 1.0f; - float pw = 1.5f - math.dot(math.abs(pxyz), ones.xyz); - float4 p = new float4(pxyz, pw); - float4 s = new float4(math.lessThan(p, new float4(0.0f))); - p.xyz = p.xyz + (s.xyz*2.0f - 1.0f) * s.www; + float4 ones = float4(1.0f, 1.0f, 1.0f, -1.0f); + float3 pxyz = floor(frac(float3(j) * ip.xyz) * 7.0f) * ip.z - 1.0f; + float pw = 1.5f - dot(abs(pxyz), ones.xyz); + float4 p = float4(pxyz, pw); + float4 s = float4(p < 0.0f); + p.xyz = p.xyz + (s.xyz*2.0f - 1.0f) * s.www; return p; } - + // Hashed 2-D gradients with an extra rotation. // (The constant 0.0243902439 is 1/41) static float2 rgrad2(float2 p, float rot) { // For more isotropic gradients, math.sin/math.cos can be used instead. float u = permute(permute(p.x) + p.y) * 0.0243902439f + rot; // Rotate by shift - u = math.fract(u) * 6.28318530718f; // 2*pi - return new float2(math.cos(u), math.sin(u)); + u = frac(u) * 6.28318530718f; // 2*pi + return float2(cos(u), sin(u)); } } } diff --git a/src/Unity.Mathematics/Noise/noise2D.cs b/src/Unity.Mathematics/Noise/noise2D.cs index c627787e..f723e0b9 100644 --- a/src/Unity.Mathematics/Noise/noise2D.cs +++ b/src/Unity.Mathematics/Noise/noise2D.cs @@ -7,27 +7,34 @@ // Distributed under the MIT License. See LICENSE file. // https://github.com/ashima/webgl-noise // https://github.com/stegu/webgl-noise -// +// + +using static Unity.Mathematics.math; namespace Unity.Mathematics { public static partial class noise { + /// + /// Simplex noise. + /// + /// Input coordinate. + /// Noise value. public static float snoise(float2 v) { - float4 C = new float4(0.211324865405187f, // (3.0-math.sqrt(3.0))/6.0 + float4 C = float4(0.211324865405187f, // (3.0-math.sqrt(3.0))/6.0 0.366025403784439f, // 0.5*(math.sqrt(3.0)-1.0) -0.577350269189626f, // -1.0 + 2.0 * C.x 0.024390243902439f); // 1.0 / 41.0 // First corner - float2 i = math.floor(v + math.dot(v, C.yy)); - float2 x0 = v - i + math.dot(i, C.xx); + float2 i = floor(v + dot(v, C.yy)); + float2 x0 = v - i + dot(i, C.xx); // Other corners float2 i1; //i1.x = math.step( x0.y, x0.x ); // x0.x > x0.y ? 1.0 : 0.0 //i1.y = 1.0 - i1.x; - i1 = (x0.x > x0.y) ? new float2(1.0f, 0.0f) : new float2(0.0f, 1.0f); + i1 = (x0.x > x0.y) ? float2(1.0f, 0.0f) : float2(0.0f, 1.0f); // x0 = x0 - 0.0 + 0.0 * C.xx ; // x1 = x0 - i1 + 1.0 * C.xx ; // x2 = x0 - 1.0 + 2.0 * C.xx ; @@ -36,18 +43,18 @@ public static float snoise(float2 v) // Permutations i = mod289(i); // Avoid truncation effects in permutation - float3 p = permute(permute(i.y + new float3(0.0f, i1.y, 1.0f)) + i.x + new float3(0.0f, i1.x, 1.0f)); + float3 p = permute(permute(i.y + float3(0.0f, i1.y, 1.0f)) + i.x + float3(0.0f, i1.x, 1.0f)); - float3 m = math.max(0.5f - new float3(math.dot(x0, x0), math.dot(x12.xy, x12.xy), math.dot(x12.zw, x12.zw)), 0.0f); + float3 m = max(0.5f - float3(dot(x0, x0), dot(x12.xy, x12.xy), dot(x12.zw, x12.zw)), 0.0f); m = m * m; m = m * m; // Gradients: 41 points uniformly over a line, mapped onto a diamond. // The ring size 17*17 = 289 is close to a multiple of 41 (41*7 = 287) - float3 x = 2.0f * math.fract(p * C.www) - 1.0f; - float3 h = math.abs(x) - 0.5f; - float3 ox = math.floor(x + 0.5f); + float3 x = 2.0f * frac(p * C.www) - 1.0f; + float3 h = abs(x) - 0.5f; + float3 ox = floor(x + 0.5f); float3 a0 = x - ox; // Normalise gradients implicitly by scaling m @@ -55,12 +62,12 @@ public static float snoise(float2 v) m *= 1.79284291400159f - 0.85373472095314f * (a0 * a0 + h * h); // Compute final noise value at P - + float gx = a0.x * x0.x + h.x * x0.y; float2 gyz = a0.yz * x12.xz + h.yz * x12.yw; - float3 g = new float3(gx,gyz); - - return 130.0f * math.dot(m, g); + float3 g = float3(gx,gyz); + + return 130.0f * dot(m, g); } } } diff --git a/src/Unity.Mathematics/Noise/noise3D.cs b/src/Unity.Mathematics/Noise/noise3D.cs index c24cedde..9e55c46c 100644 --- a/src/Unity.Mathematics/Noise/noise3D.cs +++ b/src/Unity.Mathematics/Noise/noise3D.cs @@ -1,5 +1,5 @@ // -// Description : Array and textureless GLSL 2D/3D/4D simplex +// Description : Array and textureless GLSL 2D/3D/4D simplex // noise functions. // Author : Ian McEwan, Ashima Arts. // Maintainer : stegu @@ -8,26 +8,33 @@ // Distributed under the MIT License. See LICENSE file. // https://github.com/ashima/webgl-noise // https://github.com/stegu/webgl-noise -// +// + +using static Unity.Mathematics.math; namespace Unity.Mathematics { public static partial class noise { + /// + /// Simplex noise. + /// + /// Input coordinate. + /// Noise value. public static float snoise(float3 v) { - float2 C = new float2(1.0f / 6.0f, 1.0f / 3.0f); - float4 D = new float4(0.0f, 0.5f, 1.0f, 2.0f); + float2 C = float2(1.0f / 6.0f, 1.0f / 3.0f); + float4 D = float4(0.0f, 0.5f, 1.0f, 2.0f); // First corner - float3 i = math.floor(v + math.dot(v, C.yyy)); - float3 x0 = v - i + math.dot(i, C.xxx); + float3 i = floor(v + dot(v, C.yyy)); + float3 x0 = v - i + dot(i, C.xxx); // Other corners - float3 g = math.step(x0.yzx, x0.xyz); + float3 g = step(x0.yzx, x0.xyz); float3 l = 1.0f - g; - float3 i1 = math.min(g.xyz, l.zxy); - float3 i2 = math.max(g.xyz, l.zxy); + float3 i1 = min(g.xyz, l.zxy); + float3 i2 = max(g.xyz, l.zxy); // x0 = x0 - 0.0 + 0.0 * C.xxx; // x1 = x0 - i1 + 1.0 * C.xxx; @@ -40,52 +47,52 @@ public static float snoise(float3 v) // Permutations i = mod289(i); float4 p = permute(permute(permute( - i.z + new float4(0.0f, i1.z, i2.z, 1.0f)) - + i.y + new float4(0.0f, i1.y, i2.y, 1.0f)) - + i.x + new float4(0.0f, i1.x, i2.x, 1.0f)); + i.z + float4(0.0f, i1.z, i2.z, 1.0f)) + + i.y + float4(0.0f, i1.y, i2.y, 1.0f)) + + i.x + float4(0.0f, i1.x, i2.x, 1.0f)); // Gradients: 7x7 points over a square, mapped onto an octahedron. // The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294) float n_ = 0.142857142857f; // 1.0/7.0 float3 ns = n_ * D.wyz - D.xzx; - float4 j = p - 49.0f * math.floor(p * ns.z * ns.z); // math.mod(p,7*7) + float4 j = p - 49.0f * floor(p * ns.z * ns.z); // math.mod(p,7*7) - float4 x_ = math.floor(j * ns.z); - float4 y_ = math.floor(j - 7.0f * x_); // math.mod(j,N) + float4 x_ = floor(j * ns.z); + float4 y_ = floor(j - 7.0f * x_); // math.mod(j,N) float4 x = x_ * ns.x + ns.yyyy; float4 y = y_ * ns.x + ns.yyyy; - float4 h = 1.0f - math.abs(x) - math.abs(y); + float4 h = 1.0f - abs(x) - abs(y); - float4 b0 = new float4(x.xy, y.xy); - float4 b1 = new float4(x.zw, y.zw); + float4 b0 = float4(x.xy, y.xy); + float4 b1 = float4(x.zw, y.zw); //float4 s0 = float4(math.lessThan(b0,0.0))*2.0 - 1.0; //float4 s1 = float4(math.lessThan(b1,0.0))*2.0 - 1.0; - float4 s0 = math.floor(b0) * 2.0f + 1.0f; - float4 s1 = math.floor(b1) * 2.0f + 1.0f; - float4 sh = -math.step(h, new float4(0.0f)); + float4 s0 = floor(b0) * 2.0f + 1.0f; + float4 s1 = floor(b1) * 2.0f + 1.0f; + float4 sh = -step(h, float4(0.0f)); float4 a0 = b0.xzyw + s0.xzyw * sh.xxyy; float4 a1 = b1.xzyw + s1.xzyw * sh.zzww; - float3 p0 = new float3(a0.xy, h.x); - float3 p1 = new float3(a0.zw, h.y); - float3 p2 = new float3(a1.xy, h.z); - float3 p3 = new float3(a1.zw, h.w); + float3 p0 = float3(a0.xy, h.x); + float3 p1 = float3(a0.zw, h.y); + float3 p2 = float3(a1.xy, h.z); + float3 p3 = float3(a1.zw, h.w); //Normalise gradients - float4 norm = taylorInvSqrt(new float4(math.dot(p0, p0), math.dot(p1, p1), math.dot(p2, p2), math.dot(p3, p3))); + float4 norm = taylorInvSqrt(float4(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3))); p0 *= norm.x; p1 *= norm.y; p2 *= norm.z; p3 *= norm.w; // Mix final noise value - float4 m = math.max(0.6f - new float4(math.dot(x0, x0), math.dot(x1, x1), math.dot(x2, x2), math.dot(x3, x3)), 0.0f); + float4 m = max(0.6f - float4(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3)), 0.0f); m = m * m; - return 42.0f * math.dot(m * m, new float4(math.dot(p0, x0), math.dot(p1, x1), math.dot(p2, x2), math.dot(p3, x3))); + return 42.0f * dot(m * m, float4(dot(p0, x0), dot(p1, x1), dot(p2, x2), dot(p3, x3))); } } } diff --git a/src/Unity.Mathematics/Noise/noise3Dgrad.cs b/src/Unity.Mathematics/Noise/noise3Dgrad.cs index cdab2757..7f33bfec 100644 --- a/src/Unity.Mathematics/Noise/noise3Dgrad.cs +++ b/src/Unity.Mathematics/Noise/noise3Dgrad.cs @@ -1,5 +1,5 @@ // -// Description : Array and textureless GLSL 2D/3D/4D simplex +// Description : Array and textureless GLSL 2D/3D/4D simplex // noise functions. // Author : Ian McEwan, Ashima Arts. // Maintainer : stegu @@ -8,26 +8,34 @@ // Distributed under the MIT License. See LICENSE file. // https://github.com/ashima/webgl-noise // https://github.com/stegu/webgl-noise -// +// + +using static Unity.Mathematics.math; namespace Unity.Mathematics { public static partial class noise { + /// + /// Simplex noise. + /// + /// Input coordinate. + /// Output 3D noise gradient. + /// Noise value. public static float snoise(float3 v, out float3 gradient) { - float2 C = new float2(1.0f / 6.0f, 1.0f / 3.0f); - float4 D = new float4(0.0f, 0.5f, 1.0f, 2.0f); + float2 C = float2(1.0f / 6.0f, 1.0f / 3.0f); + float4 D = float4(0.0f, 0.5f, 1.0f, 2.0f); // First corner - float3 i = math.floor(v + math.dot(v, C.yyy)); - float3 x0 = v - i + math.dot(i, C.xxx); + float3 i = floor(v + dot(v, C.yyy)); + float3 x0 = v - i + dot(i, C.xxx); // Other corners - float3 g = math.step(x0.yzx, x0.xyz); + float3 g = step(x0.yzx, x0.xyz); float3 l = 1.0f - g; - float3 i1 = math.min(g.xyz, l.zxy); - float3 i2 = math.max(g.xyz, l.zxy); + float3 i1 = min(g.xyz, l.zxy); + float3 i2 = max(g.xyz, l.zxy); // x0 = x0 - 0.0 + 0.0 * C.xxx; // x1 = x0 - i1 + 1.0 * C.xxx; @@ -40,53 +48,53 @@ public static float snoise(float3 v, out float3 gradient) // Permutations i = mod289(i); float4 p = permute(permute(permute( - i.z + new float4(0.0f, i1.z, i2.z, 1.0f)) - + i.y + new float4(0.0f, i1.y, i2.y, 1.0f)) - + i.x + new float4(0.0f, i1.x, i2.x, 1.0f)); + i.z + float4(0.0f, i1.z, i2.z, 1.0f)) + + i.y + float4(0.0f, i1.y, i2.y, 1.0f)) + + i.x + float4(0.0f, i1.x, i2.x, 1.0f)); // Gradients: 7x7 points over a square, mapped onto an octahedron. // The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294) float n_ = 0.142857142857f; // 1.0/7.0 float3 ns = n_ * D.wyz - D.xzx; - float4 j = p - 49.0f * math.floor(p * ns.z * ns.z); // math.mod(p,7*7) + float4 j = p - 49.0f * floor(p * ns.z * ns.z); // math.mod(p,7*7) - float4 x_ = math.floor(j * ns.z); - float4 y_ = math.floor(j - 7.0f * x_); // math.mod(j,N) + float4 x_ = floor(j * ns.z); + float4 y_ = floor(j - 7.0f * x_); // math.mod(j,N) float4 x = x_ * ns.x + ns.yyyy; float4 y = y_ * ns.x + ns.yyyy; - float4 h = 1.0f - math.abs(x) - math.abs(y); + float4 h = 1.0f - abs(x) - abs(y); - float4 b0 = new float4(x.xy, y.xy); - float4 b1 = new float4(x.zw, y.zw); + float4 b0 = float4(x.xy, y.xy); + float4 b1 = float4(x.zw, y.zw); //float4 s0 = float4(math.lessThan(b0,0.0))*2.0 - 1.0; //float4 s1 = float4(math.lessThan(b1,0.0))*2.0 - 1.0; - float4 s0 = math.floor(b0) * 2.0f + 1.0f; - float4 s1 = math.floor(b1) * 2.0f + 1.0f; - float4 sh = -math.step(h, new float4(0.0f)); + float4 s0 = floor(b0) * 2.0f + 1.0f; + float4 s1 = floor(b1) * 2.0f + 1.0f; + float4 sh = -step(h, float4(0.0f)); float4 a0 = b0.xzyw + s0.xzyw * sh.xxyy; float4 a1 = b1.xzyw + s1.xzyw * sh.zzww; - float3 p0 = new float3(a0.xy, h.x); - float3 p1 = new float3(a0.zw, h.y); - float3 p2 = new float3(a1.xy, h.z); - float3 p3 = new float3(a1.zw, h.w); + float3 p0 = float3(a0.xy, h.x); + float3 p1 = float3(a0.zw, h.y); + float3 p2 = float3(a1.xy, h.z); + float3 p3 = float3(a1.zw, h.w); //Normalise gradients - float4 norm = taylorInvSqrt(new float4(math.dot(p0, p0), math.dot(p1, p1), math.dot(p2, p2), math.dot(p3, p3))); + float4 norm = taylorInvSqrt(float4(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3))); p0 *= norm.x; p1 *= norm.y; p2 *= norm.z; p3 *= norm.w; // Mix final noise value - float4 m = math.max(0.6f - new float4(math.dot(x0, x0), math.dot(x1, x1), math.dot(x2, x2), math.dot(x3, x3)), 0.0f); + float4 m = max(0.6f - float4(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3)), 0.0f); float4 m2 = m * m; float4 m4 = m2 * m2; - float4 pdotx = new float4(math.dot(p0, x0), math.dot(p1, x1), math.dot(p2, x2), math.dot(p3, x3)); + float4 pdotx = float4(dot(p0, x0), dot(p1, x1), dot(p2, x2), dot(p3, x3)); // Determath.mine noise gradient float4 temp = m2 * m * pdotx; @@ -94,7 +102,7 @@ public static float snoise(float3 v, out float3 gradient) gradient += m4.x * p0 + m4.y * p1 + m4.z * p2 + m4.w * p3; gradient *= 42.0f; - return 42.0f * math.dot(m4, pdotx); + return 42.0f * dot(m4, pdotx); } } } diff --git a/src/Unity.Mathematics/Noise/noise4D.cs b/src/Unity.Mathematics/Noise/noise4D.cs index 832686d2..78ff63c5 100644 --- a/src/Unity.Mathematics/Noise/noise4D.cs +++ b/src/Unity.Mathematics/Noise/noise4D.cs @@ -1,5 +1,5 @@ // -// Description : Array and textureless GLSL 2D/3D/4D simplex +// Description : Array and textureless GLSL 2D/3D/4D simplex // noise functions. // Author : Ian McEwan, Ashima Arts. // Maintainer : stegu @@ -8,31 +8,38 @@ // Distributed under the MIT License. See LICENSE file. // https://github.com/ashima/webgl-noise // https://github.com/stegu/webgl-noise -// +// + +using static Unity.Mathematics.math; namespace Unity.Mathematics { public static partial class noise { + /// + /// Simplex noise. + /// + /// Input coordinate. + /// Noise value. public static float snoise(float4 v) { // (math.sqrt(5) - 1)/4 = F4, used once below const float F4 = 0.309016994374947451f; - float4 C = new float4( 0.138196601125011f, // (5 - math.sqrt(5))/20 G4 + float4 C = float4( 0.138196601125011f, // (5 - math.sqrt(5))/20 G4 0.276393202250021f, // 2 * G4 0.414589803375032f, // 3 * G4 -0.447213595499958f); // -1 + 4 * G4 // First corner - float4 i = math.floor(v + math.dot(v, new float4(F4)) ); - float4 x0 = v - i + math.dot(i, C.xxxx); + float4 i = floor(v + dot(v, float4(F4)) ); + float4 x0 = v - i + dot(i, C.xxxx); // Other corners // Rank sorting originally contributed by Bill Licea-Kane, AMD (formerly ATI) - float4 i0 = new float4(0.0f); - float3 isX = math.step( x0.yzw, x0.xxx ); - float3 isYZ = math.step( x0.zww, x0.yyz ); + float4 i0 = float4(0.0f); + float3 isX = step( x0.yzw, x0.xxx ); + float3 isYZ = step( x0.zww, x0.yyz ); // i0.x = math.dot( isX, float3( 1.0 ) ); i0.x = isX.x + isX.y + isX.z; i0.yzw = 1.0f - isX; @@ -43,9 +50,9 @@ public static float snoise(float4 v) i0.w += 1.0f - isYZ.z; // i0 now contains the unique values 0,1,2,3 in each channel - float4 i3 = math.clamp( i0, 0.0f, 1.0f ); - float4 i2 = math.clamp( i0-1.0f, 0.0f, 1.0f ); - float4 i1 = math.clamp( i0-2.0f, 0.0f, 1.0f ); + float4 i3 = clamp( i0, 0.0f, 1.0f ); + float4 i2 = clamp( i0-1.0f, 0.0f, 1.0f ); + float4 i1 = clamp( i0-2.0f, 0.0f, 1.0f ); // x0 = x0 - 0.0 + 0.0 * C.xxxx // x1 = x0 - i1 + 1.0 * C.xxxx @@ -58,17 +65,17 @@ public static float snoise(float4 v) float4 x4 = x0 + C.wwww; // Permutations - i = mod289(i); + i = mod289(i); float j0 = permute( permute( permute( permute(i.w) + i.z) + i.y) + i.x); float4 j1 = permute( permute( permute( permute ( - i.w + new float4(i1.w, i2.w, i3.w, 1.0f )) - + i.z + new float4(i1.z, i2.z, i3.z, 1.0f )) - + i.y + new float4(i1.y, i2.y, i3.y, 1.0f )) - + i.x + new float4(i1.x, i2.x, i3.x, 1.0f )); + i.w + float4(i1.w, i2.w, i3.w, 1.0f )) + + i.z + float4(i1.z, i2.z, i3.z, 1.0f )) + + i.y + float4(i1.y, i2.y, i3.y, 1.0f )) + + i.x + float4(i1.x, i2.x, i3.x, 1.0f )); // Gradients: 7x7x6 points over a cube, mapped onto a 4-cross polytope // 7*7*6 = 294, which is close to the ring size 17*17 = 289. - float4 ip = new float4(1.0f/294.0f, 1.0f/49.0f, 1.0f/7.0f, 0.0f) ; + float4 ip = float4(1.0f/294.0f, 1.0f/49.0f, 1.0f/7.0f, 0.0f) ; float4 p0 = grad4(j0, ip); float4 p1 = grad4(j1.x, ip); @@ -77,20 +84,20 @@ public static float snoise(float4 v) float4 p4 = grad4(j1.w, ip); // Normalise gradients - float4 norm = taylorInvSqrt(new float4(math.dot(p0,p0), math.dot(p1,p1), math.dot(p2, p2), math.dot(p3,p3))); + float4 norm = taylorInvSqrt(float4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3))); p0 *= norm.x; p1 *= norm.y; p2 *= norm.z; p3 *= norm.w; - p4 *= taylorInvSqrt(math.dot(p4,p4)); + p4 *= taylorInvSqrt(dot(p4,p4)); // Mix contributions from the five corners - float3 m0 = math.max(0.6f - new float3(math.dot(x0,x0), math.dot(x1,x1), math.dot(x2,x2)), 0.0f); - float2 m1 = math.max(0.6f - new float2(math.dot(x3,x3), math.dot(x4,x4) ), 0.0f); + float3 m0 = max(0.6f - float3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.0f); + float2 m1 = max(0.6f - float2(dot(x3,x3), dot(x4,x4) ), 0.0f); m0 = m0 * m0; m1 = m1 * m1; - return 49.0f * ( math.dot(m0*m0, new float3( math.dot( p0, x0 ), math.dot( p1, x1 ), math.dot( p2, x2 ))) - + math.dot(m1*m1, new float2( math.dot( p3, x3 ), math.dot( p4, x4 ) ) ) ) ; + return 49.0f * ( dot(m0*m0, float3( dot( p0, x0 ), dot( p1, x1 ), dot( p2, x2 ))) + + dot(m1*m1, float2( dot( p3, x3 ), dot( p4, x4 ) ) ) ) ; } } diff --git a/src/Unity.Mathematics/Noise/psrdnoise2D.cs b/src/Unity.Mathematics/Noise/psrdnoise2D.cs index c844def8..0bde5f2f 100644 --- a/src/Unity.Mathematics/Noise/psrdnoise2D.cs +++ b/src/Unity.Mathematics/Noise/psrdnoise2D.cs @@ -67,35 +67,35 @@ // (If you run into problems with this, please let me know.) // +using static Unity.Mathematics.math; + namespace Unity.Mathematics { public static partial class noise { - // - // 2-D tiling simplex noise with rotating gradients and analytical derivative. - // The first component of the 3-element return vector is the noise value, - // and the second and third components are the x and y partial derivatives. - // + /// + /// 2-D tiling simplex noise with rotating gradients and analytical derivative. + /// + /// Input (x,y) coordinate. + /// The x and y period, where per.x is a positive integer and per.y is a positive even integer. + /// Angle to rotate the gradients. + /// The first component of the 3-element return vector is the noise value, and the second and third components are the x and y partial derivatives. public static float3 psrdnoise(float2 pos, float2 per, float rot) { // Hack: offset y slightly to hide some rare artifacts pos.y += 0.01f; // Skew to hexagonal grid - float2 uv = new float2(pos.x + pos.y * 0.5f, pos.y); + float2 uv = float2(pos.x + pos.y * 0.5f, pos.y); - float2 i0 = math.floor(uv); - float2 f0 = math.fract(uv); + float2 i0 = floor(uv); + float2 f0 = frac(uv); // Traversal order - float2 i1 = (f0.x > f0.y) ? new float2(1.0f, 0.0f) : new float2(0.0f, 1.0f); + float2 i1 = (f0.x > f0.y) ? float2(1.0f, 0.0f) : float2(0.0f, 1.0f); // Unskewed grid points in (x,y) space - float2 p0 = new float2(i0.x - i0.y * 0.5f, i0.y); - float2 p1 = new float2(p0.x + i1.x - i1.y * 0.5f, p0.y + i1.y); - float2 p2 = new float2(p0.x + 0.5f, p0.y + 1.0f); - - // Integer grid point indices in (u,v) space - i1 = i0 + i1; - float2 i2 = i0 + new float2(1.0f, 1.0f); + float2 p0 = float2(i0.x - i0.y * 0.5f, i0.y); + float2 p1 = float2(p0.x + i1.x - i1.y * 0.5f, p0.y + i1.y); + float2 p2 = float2(p0.x + 0.5f, p0.y + 1.0f); // Vectors in unskewed (x,y) coordinates from // each of the simplex corners to the evaluation point @@ -103,30 +103,30 @@ public static float3 psrdnoise(float2 pos, float2 per, float rot) float2 d1 = pos - p1; float2 d2 = pos - p2; - // Wrap i0, i1 and i2 to the desired period before gradient hashing: + // Wrap p0, p1 and p2 to the desired period before gradient hashing: // wrap points in (x,y), map to (u,v) - float3 xw = math.mod(new float3(p0.x, p1.x, p2.x), per.x); - float3 yw = math.mod(new float3(p0.y, p1.y, p2.y), per.y); + float3 xw = fmod(float3(p0.x, p1.x, p2.x), per.x); + float3 yw = fmod(float3(p0.y, p1.y, p2.y), per.y); float3 iuw = xw + 0.5f * yw; float3 ivw = yw; // Create gradients from indices - float2 g0 = rgrad2(new float2(iuw.x, ivw.x), rot); - float2 g1 = rgrad2(new float2(iuw.y, ivw.y), rot); - float2 g2 = rgrad2(new float2(iuw.z, ivw.z), rot); + float2 g0 = rgrad2(float2(iuw.x, ivw.x), rot); + float2 g1 = rgrad2(float2(iuw.y, ivw.y), rot); + float2 g2 = rgrad2(float2(iuw.z, ivw.z), rot); // Gradients math.dot vectors to corresponding corners // (The derivatives of this are simply the gradients) - float3 w = new float3(math.dot(g0, d0), math.dot(g1, d1), math.dot(g2, d2)); + float3 w = float3(dot(g0, d0), dot(g1, d1), dot(g2, d2)); // Radial weights from corners // 0.8 is the square of 2/math.sqrt(5), the distance from // a grid point to the nearest simplex boundary - float3 t = 0.8f - new float3(math.dot(d0, d0), math.dot(d1, d1), math.dot(d2, d2)); + float3 t = 0.8f - float3(dot(d0, d0), dot(d1, d1), dot(d2, d2)); // Partial derivatives for analytical gradient computation - float3 dtdx = -2.0f * new float3(d0.x, d1.x, d2.x); - float3 dtdy = -2.0f * new float3(d0.y, d1.y, d2.y); + float3 dtdx = -2.0f * float3(d0.x, d1.x, d2.x); + float3 dtdy = -2.0f * float3(d0.y, d1.y, d2.y); // Set influence of each surflet to zero outside radius math.sqrt(0.8) if (t.x < 0.0f) @@ -155,54 +155,53 @@ public static float3 psrdnoise(float2 pos, float2 per, float rot) // Final noise value is: // sum of ((radial weights) times (gradient math.dot vector from corner)) - float n = math.dot(t4, w); + float n = dot(t4, w); // Final analytical derivative (gradient of a sum of scalar products) - float2 dt0 = new float2(dtdx.x, dtdy.x) * 4.0f * t3.x; + float2 dt0 = float2(dtdx.x, dtdy.x) * 4.0f * t3.x; float2 dn0 = t4.x * g0 + dt0 * w.x; - float2 dt1 = new float2(dtdx.y, dtdy.y) * 4.0f * t3.y; + float2 dt1 = float2(dtdx.y, dtdy.y) * 4.0f * t3.y; float2 dn1 = t4.y * g1 + dt1 * w.y; - float2 dt2 = new float2(dtdx.z, dtdy.z) * 4.0f * t3.z; + float2 dt2 = float2(dtdx.z, dtdy.z) * 4.0f * t3.z; float2 dn2 = t4.z * g2 + dt2 * w.z; - return 11.0f * new float3(n, dn0 + dn1 + dn2); + return 11.0f * float3(n, dn0 + dn1 + dn2); } - // - // 2-D tiling simplex noise with fixed gradients - // and analytical derivative. - // This function is implemented as a wrapper to "psrdnoise", - // at the math.minimal math.cost of three extra additions. - // + /// + /// 2-D tiling simplex noise with fixed gradients and analytical derivative. + /// + /// Input (x,y) coordinate. + /// The x and y period, where per.x is a positive integer and per.y is a positive even integer. + /// The first component of the 3-element return vector is the noise value, and the second and third components are the x and y partial derivatives. public static float3 psrdnoise(float2 pos, float2 per) { return psrdnoise(pos, per, 0.0f); } - // - // 2-D tiling simplex noise with rotating gradients, - // but without the analytical derivative. - // + /// + /// 2-D tiling simplex noise with rotating gradients, but without the analytical derivative. + /// + /// Input (x,y) coordinate. + /// The x and y period, where per.x is a positive integer and per.y is a positive even integer. + /// Angle to rotate the gradients. + /// Noise value. public static float psrnoise(float2 pos, float2 per, float rot) { // Offset y slightly to hide some rare artifacts pos.y += 0.001f; // Skew to hexagonal grid - float2 uv = new float2(pos.x + pos.y * 0.5f, pos.y); + float2 uv = float2(pos.x + pos.y * 0.5f, pos.y); - float2 i0 = math.floor(uv); - float2 f0 = math.fract(uv); + float2 i0 = floor(uv); + float2 f0 = frac(uv); // Traversal order - float2 i1 = (f0.x > f0.y) ? new float2(1.0f, 0.0f) : new float2(0.0f, 1.0f); + float2 i1 = (f0.x > f0.y) ? float2(1.0f, 0.0f) : float2(0.0f, 1.0f); // Unskewed grid points in (x,y) space - float2 p0 = new float2(i0.x - i0.y * 0.5f, i0.y); - float2 p1 = new float2(p0.x + i1.x - i1.y * 0.5f, p0.y + i1.y); - float2 p2 = new float2(p0.x + 0.5f, p0.y + 1.0f); - - // Integer grid point indices in (u,v) space - i1 = i0 + i1; - float2 i2 = i0 + new float2(1.0f, 1.0f); + float2 p0 = float2(i0.x - i0.y * 0.5f, i0.y); + float2 p1 = float2(p0.x + i1.x - i1.y * 0.5f, p0.y + i1.y); + float2 p2 = float2(p0.x + 0.5f, p0.y + 1.0f); // Vectors in unskewed (x,y) coordinates from // each of the simplex corners to the evaluation point @@ -210,29 +209,29 @@ public static float psrnoise(float2 pos, float2 per, float rot) float2 d1 = pos - p1; float2 d2 = pos - p2; - // Wrap i0, i1 and i2 to the desired period before gradient hashing: + // Wrap p0, p1 and p2 to the desired period before gradient hashing: // wrap points in (x,y), map to (u,v) - float3 xw = math.mod(new float3(p0.x, p1.x, p2.x), per.x); - float3 yw = math.mod(new float3(p0.y, p1.y, p2.y), per.y); + float3 xw = fmod(float3(p0.x, p1.x, p2.x), per.x); + float3 yw = fmod(float3(p0.y, p1.y, p2.y), per.y); float3 iuw = xw + 0.5f * yw; float3 ivw = yw; // Create gradients from indices - float2 g0 = rgrad2(new float2(iuw.x, ivw.x), rot); - float2 g1 = rgrad2(new float2(iuw.y, ivw.y), rot); - float2 g2 = rgrad2(new float2(iuw.z, ivw.z), rot); + float2 g0 = rgrad2(float2(iuw.x, ivw.x), rot); + float2 g1 = rgrad2(float2(iuw.y, ivw.y), rot); + float2 g2 = rgrad2(float2(iuw.z, ivw.z), rot); // Gradients math.dot vectors to corresponding corners // (The derivatives of this are simply the gradients) - float3 w = new float3(math.dot(g0, d0), math.dot(g1, d1), math.dot(g2, d2)); + float3 w = float3(dot(g0, d0), dot(g1, d1), dot(g2, d2)); // Radial weights from corners // 0.8 is the square of 2/math.sqrt(5), the distance from // a grid point to the nearest simplex boundary - float3 t = 0.8f - new float3(math.dot(d0, d0), math.dot(d1, d1), math.dot(d2, d2)); + float3 t = 0.8f - float3(dot(d0, d0), dot(d1, d1), dot(d2, d2)); // Set influence of each surflet to zero outside radius math.sqrt(0.8) - t = math.max(t, 0.0f); + t = max(t, 0.0f); // Fourth power of t float3 t2 = t * t; @@ -240,48 +239,45 @@ public static float psrnoise(float2 pos, float2 per, float rot) // Final noise value is: // sum of ((radial weights) times (gradient math.dot vector from corner)) - float n = math.dot(t4, w); + float n = dot(t4, w); // Rescale to cover the range [-1,1] reasonably well return 11.0f * n; } - // - // 2-D tiling simplex noise with fixed gradients, - // without the analytical derivative. - // This function is implemented as a wrapper to "psrnoise", - // at the math.minimal math.cost of three extra additions. - // + /// + /// 2-D tiling simplex noise with fixed gradients, without the analytical derivative. + /// + /// Input (x,y) coordinate. + /// The x and y period, where per.x is a positive integer and per.y is a positive even integer. + /// Noise value. public static float psrnoise(float2 pos, float2 per) { return psrnoise(pos, per, 0.0f); } - // - // 2-D non-tiling simplex noise with rotating gradients and analytical derivative. - // The first component of the 3-element return vector is the noise value, - // and the second and third components are the x and y partial derivatives. - // + /// + /// 2-D non-tiling simplex noise with rotating gradients and analytical derivative. + /// + /// Input (x,y) coordinate. + /// Angle to rotate the gradients. + /// The first component of the 3-element return vector is the noise value, and the second and third components are the x and y partial derivatives. public static float3 srdnoise(float2 pos, float rot) { // Offset y slightly to hide some rare artifacts pos.y += 0.001f; // Skew to hexagonal grid - float2 uv = new float2(pos.x + pos.y * 0.5f, pos.y); + float2 uv = float2(pos.x + pos.y * 0.5f, pos.y); - float2 i0 = math.floor(uv); - float2 f0 = math.fract(uv); + float2 i0 = floor(uv); + float2 f0 = frac(uv); // Traversal order - float2 i1 = (f0.x > f0.y) ? new float2(1.0f, 0.0f) : new float2(0.0f, 1.0f); + float2 i1 = (f0.x > f0.y) ? float2(1.0f, 0.0f) : float2(0.0f, 1.0f); // Unskewed grid points in (x,y) space - float2 p0 = new float2(i0.x - i0.y * 0.5f, i0.y); - float2 p1 = new float2(p0.x + i1.x - i1.y * 0.5f, p0.y + i1.y); - float2 p2 = new float2(p0.x + 0.5f, p0.y + 1.0f); - - // Integer grid point indices in (u,v) space - i1 = i0 + i1; - float2 i2 = i0 + new float2(1.0f, 1.0f); + float2 p0 = float2(i0.x - i0.y * 0.5f, i0.y); + float2 p1 = float2(p0.x + i1.x - i1.y * 0.5f, p0.y + i1.y); + float2 p2 = float2(p0.x + 0.5f, p0.y + 1.0f); // Vectors in unskewed (x,y) coordinates from // each of the simplex corners to the evaluation point @@ -289,8 +285,8 @@ public static float3 srdnoise(float2 pos, float rot) float2 d1 = pos - p1; float2 d2 = pos - p2; - float3 x = new float3(p0.x, p1.x, p2.x); - float3 y = new float3(p0.y, p1.y, p2.y); + float3 x = float3(p0.x, p1.x, p2.x); + float3 y = float3(p0.y, p1.y, p2.y); float3 iuw = x + 0.5f * y; float3 ivw = y; @@ -299,22 +295,22 @@ public static float3 srdnoise(float2 pos, float rot) ivw = mod289(ivw); // Create gradients from indices - float2 g0 = rgrad2(new float2(iuw.x, ivw.x), rot); - float2 g1 = rgrad2(new float2(iuw.y, ivw.y), rot); - float2 g2 = rgrad2(new float2(iuw.z, ivw.z), rot); + float2 g0 = rgrad2(float2(iuw.x, ivw.x), rot); + float2 g1 = rgrad2(float2(iuw.y, ivw.y), rot); + float2 g2 = rgrad2(float2(iuw.z, ivw.z), rot); // Gradients math.dot vectors to corresponding corners // (The derivatives of this are simply the gradients) - float3 w = new float3(math.dot(g0, d0), math.dot(g1, d1), math.dot(g2, d2)); + float3 w = float3(dot(g0, d0), dot(g1, d1), dot(g2, d2)); // Radial weights from corners // 0.8 is the square of 2/math.sqrt(5), the distance from // a grid point to the nearest simplex boundary - float3 t = 0.8f - new float3(math.dot(d0, d0), math.dot(d1, d1), math.dot(d2, d2)); + float3 t = 0.8f - float3(dot(d0, d0), dot(d1, d1), dot(d2, d2)); // Partial derivatives for analytical gradient computation - float3 dtdx = -2.0f * new float3(d0.x, d1.x, d2.x); - float3 dtdy = -2.0f * new float3(d0.y, d1.y, d2.y); + float3 dtdx = -2.0f * float3(d0.x, d1.x, d2.x); + float3 dtdy = -2.0f * float3(d0.y, d1.y, d2.y); // Set influence of each surflet to zero outside radius math.sqrt(0.8) if (t.x < 0.0f) @@ -343,53 +339,51 @@ public static float3 srdnoise(float2 pos, float rot) // Final noise value is: // sum of ((radial weights) times (gradient math.dot vector from corner)) - float n = math.dot(t4, w); + float n = dot(t4, w); // Final analytical derivative (gradient of a sum of scalar products) - float2 dt0 = new float2(dtdx.x, dtdy.x) * 4.0f * t3.x; + float2 dt0 = float2(dtdx.x, dtdy.x) * 4.0f * t3.x; float2 dn0 = t4.x * g0 + dt0 * w.x; - float2 dt1 = new float2(dtdx.y, dtdy.y) * 4.0f * t3.y; + float2 dt1 = float2(dtdx.y, dtdy.y) * 4.0f * t3.y; float2 dn1 = t4.y * g1 + dt1 * w.y; - float2 dt2 = new float2(dtdx.z, dtdy.z) * 4.0f * t3.z; + float2 dt2 = float2(dtdx.z, dtdy.z) * 4.0f * t3.z; float2 dn2 = t4.z * g2 + dt2 * w.z; - return 11.0f * new float3(n, dn0 + dn1 + dn2); + return 11.0f * float3(n, dn0 + dn1 + dn2); } - // - // 2-D non-tiling simplex noise with fixed gradients and analytical derivative. - // This function is implemented as a wrapper to "srdnoise", - // at the math.minimal math.cost of three extra additions. - // + /// + /// 2-D non-tiling simplex noise with fixed gradients and analytical derivative. + /// + /// Input (x,y) coordinate. + /// The first component of the 3-element return vector is the noise value, and the second and third components are the x and y partial derivatives. public static float3 srdnoise(float2 pos) { return srdnoise(pos, 0.0f); } - // - // 2-D non-tiling simplex noise with rotating gradients, - // without the analytical derivative. - // + /// + /// 2-D non-tiling simplex noise with rotating gradients, without the analytical derivative. + /// + /// Input (x,y) coordinate. + /// Angle to rotate the gradients. + /// Noise value. public static float srnoise(float2 pos, float rot) { // Offset y slightly to hide some rare artifacts pos.y += 0.001f; // Skew to hexagonal grid - float2 uv = new float2(pos.x + pos.y * 0.5f, pos.y); + float2 uv = float2(pos.x + pos.y * 0.5f, pos.y); - float2 i0 = math.floor(uv); - float2 f0 = math.fract(uv); + float2 i0 = floor(uv); + float2 f0 = frac(uv); // Traversal order - float2 i1 = (f0.x > f0.y) ? new float2(1.0f, 0.0f) : new float2(0.0f, 1.0f); + float2 i1 = (f0.x > f0.y) ? float2(1.0f, 0.0f) : float2(0.0f, 1.0f); // Unskewed grid points in (x,y) space - float2 p0 = new float2(i0.x - i0.y * 0.5f, i0.y); - float2 p1 = new float2(p0.x + i1.x - i1.y * 0.5f, p0.y + i1.y); - float2 p2 = new float2(p0.x + 0.5f, p0.y + 1.0f); - - // Integer grid point indices in (u,v) space - i1 = i0 + i1; - float2 i2 = i0 + new float2(1.0f, 1.0f); + float2 p0 = float2(i0.x - i0.y * 0.5f, i0.y); + float2 p1 = float2(p0.x + i1.x - i1.y * 0.5f, p0.y + i1.y); + float2 p2 = float2(p0.x + 0.5f, p0.y + 1.0f); // Vectors in unskewed (x,y) coordinates from // each of the simplex corners to the evaluation point @@ -397,10 +391,8 @@ public static float srnoise(float2 pos, float rot) float2 d1 = pos - p1; float2 d2 = pos - p2; - // Wrap i0, i1 and i2 to the desired period before gradient hashing: - // wrap points in (x,y), map to (u,v) - float3 x = new float3(p0.x, p1.x, p2.x); - float3 y = new float3(p0.y, p1.y, p2.y); + float3 x = float3(p0.x, p1.x, p2.x); + float3 y = float3(p0.y, p1.y, p2.y); float3 iuw = x + 0.5f * y; float3 ivw = y; @@ -409,21 +401,21 @@ public static float srnoise(float2 pos, float rot) ivw = mod289(ivw); // Create gradients from indices - float2 g0 = rgrad2(new float2(iuw.x, ivw.x), rot); - float2 g1 = rgrad2(new float2(iuw.y, ivw.y), rot); - float2 g2 = rgrad2(new float2(iuw.z, ivw.z), rot); + float2 g0 = rgrad2(float2(iuw.x, ivw.x), rot); + float2 g1 = rgrad2(float2(iuw.y, ivw.y), rot); + float2 g2 = rgrad2(float2(iuw.z, ivw.z), rot); // Gradients math.dot vectors to corresponding corners // (The derivatives of this are simply the gradients) - float3 w = new float3(math.dot(g0, d0), math.dot(g1, d1), math.dot(g2, d2)); + float3 w = float3(dot(g0, d0), dot(g1, d1), dot(g2, d2)); // Radial weights from corners // 0.8 is the square of 2/math.sqrt(5), the distance from // a grid point to the nearest simplex boundary - float3 t = 0.8f - new float3(math.dot(d0, d0), math.dot(d1, d1), math.dot(d2, d2)); + float3 t = 0.8f - float3(dot(d0, d0), dot(d1, d1), dot(d2, d2)); // Set influence of each surflet to zero outside radius math.sqrt(0.8) - t = math.max(t, 0.0f); + t = max(t, 0.0f); // Fourth power of t float3 t2 = t * t; @@ -431,22 +423,17 @@ public static float srnoise(float2 pos, float rot) // Final noise value is: // sum of ((radial weights) times (gradient math.dot vector from corner)) - float n = math.dot(t4, w); + float n = dot(t4, w); // Rescale to cover the range [-1,1] reasonably well return 11.0f * n; } - // - // 2-D non-tiling simplex noise with fixed gradients, - // without the analytical derivative. - // This function is implemented as a wrapper to "srnoise", - // at the math.minimal math.cost of three extra additions. - // Note: if this kind of noise is all you want, there are faster - // GLSL implementations of non-tiling simplex noise out there. - // This one is included mainly for completeness and compatibility - // with the other functions in the file. - // + /// + /// 2-D non-tiling simplex noise with fixed gradients, without the analytical derivative. + /// + /// Input (x,y) coordinate. + /// Noise value. public static float srnoise(float2 pos) { return srnoise(pos, 0.0f); diff --git a/src/Unity.Mathematics/Properties.meta b/src/Unity.Mathematics/Properties.meta new file mode 100644 index 00000000..376ebec9 --- /dev/null +++ b/src/Unity.Mathematics/Properties.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d3e017d9ad3f00a4c9e234b0236911b7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/Properties/AssemblyInfo.cs b/src/Unity.Mathematics/Properties/AssemblyInfo.cs index 90743b1c..582cdee0 100644 --- a/src/Unity.Mathematics/Properties/AssemblyInfo.cs +++ b/src/Unity.Mathematics/Properties/AssemblyInfo.cs @@ -1,40 +1,5 @@ -using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. - -[assembly: AssemblyTitle("Unity.Mathematics")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Unity.Mathematics")] -[assembly: AssemblyCopyright("Copyright © 2017")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. - -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM - -[assembly: Guid("19810344-7387-4155-935F-BDD5CC61F0BF")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] - -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: InternalsVisibleTo("Unity.Mathematics.Tests")] +[assembly: InternalsVisibleTo("Unity.Mathematics.PerformanceTests")] diff --git a/src/Unity.Mathematics/Properties/AssemblyInfo.cs.meta b/src/Unity.Mathematics/Properties/AssemblyInfo.cs.meta new file mode 100644 index 00000000..048f3093 --- /dev/null +++ b/src/Unity.Mathematics/Properties/AssemblyInfo.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: fb0d7ffc71c40bd49a849e6427f80cb5 \ No newline at end of file diff --git a/src/Unity.Mathematics/PropertyAttributes.cs b/src/Unity.Mathematics/PropertyAttributes.cs new file mode 100644 index 00000000..d069f15b --- /dev/null +++ b/src/Unity.Mathematics/PropertyAttributes.cs @@ -0,0 +1,12 @@ +namespace Unity.Mathematics +{ + /// + /// Used by property drawers when vectors should be post normalized. + /// + public class PostNormalizeAttribute : UnityEngine.PropertyAttribute {} + + /// + /// Used by property drawers when vectors should not be normalized. + /// + public class DoNotNormalizeAttribute : UnityEngine.PropertyAttribute {} +} diff --git a/src/Unity.Mathematics/PropertyAttributes.cs.meta b/src/Unity.Mathematics/PropertyAttributes.cs.meta new file mode 100644 index 00000000..934c0570 --- /dev/null +++ b/src/Unity.Mathematics/PropertyAttributes.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 61cbbdd02bb00406b94029228cb3b73b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/Unity.Mathematics.csproj b/src/Unity.Mathematics/Unity.Mathematics.csproj index f423e7c3..6a97724f 100644 --- a/src/Unity.Mathematics/Unity.Mathematics.csproj +++ b/src/Unity.Mathematics/Unity.Mathematics.csproj @@ -1,104 +1,21 @@ - - - + - Debug - AnyCPU - {19810344-7387-4155-935F-BDD5CC61F0BF} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Library - Properties - Unity - Unity.Mathematics - v4.5 - 512 - - - AnyCPU - true - full - false - ..\..\build\bin\Debug\ - DEBUG;TRACE - prompt - 4 - true - - - AnyCPU - pdbonly - true - ..\..\build\bin\Release\ - TRACE - prompt - 4 - true - - - AnyCPU - true - full - false - ..\..\build\bin\Debug\ - DEBUG;TRACE - prompt - 4 - true - - + net471 AnyCPU - pdbonly - true - ..\..\build\bin\Release\ - TRACE - prompt - 4 true + false + ..\..\build\bin\$(Configuration)\ + + 1.0.0.0 - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - + \ No newline at end of file diff --git a/src/Unity.Mathematics/Unity.Mathematics.csproj.meta b/src/Unity.Mathematics/Unity.Mathematics.csproj.meta new file mode 100644 index 00000000..ebf3a017 --- /dev/null +++ b/src/Unity.Mathematics/Unity.Mathematics.csproj.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: adc57cbbc95b9e449ba89e2bd869e8d9 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/affine_transform.cs b/src/Unity.Mathematics/affine_transform.cs new file mode 100644 index 00000000..6ba30887 --- /dev/null +++ b/src/Unity.Mathematics/affine_transform.cs @@ -0,0 +1,322 @@ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; +using static Unity.Mathematics.math; + +namespace Unity.Mathematics +{ + /// + /// An affine transformation type. + /// + [Il2CppEagerStaticClassConstruction] + [Serializable] + public struct AffineTransform : IEquatable, IFormattable + { + /// + /// The rotation and scale part of the affine transformation. + /// + public float3x3 rs; + + /// + /// The translation part of the affine transformation. + /// + public float3 t; + + /// An AffineTransform representing the identity transform. + public static readonly AffineTransform identity = new AffineTransform(float3.zero, float3x3.identity); + + /// + /// An AffineTransform zero value. + /// + public static readonly AffineTransform zero; + + /// Constructs an AffineTransform from a translation represented by a float3 vector and rotation represented by a unit quaternion. + /// The translation vector. + /// The rotation quaternion. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public AffineTransform(float3 translation, quaternion rotation) + { + rs = float3x3(rotation); + t = translation; + } + + /// Constructs an AffineTransform from a translation represented by a float3 vector, rotation represented by a unit quaternion and scale represented by a float3 vector. + /// The translation vector. + /// The rotation quaternion. + /// The scale vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public AffineTransform(float3 translation, quaternion rotation, float3 scale) + { + rs = mulScale(math.float3x3(rotation), scale); + t = translation; + } + + /// Constructs an AffineTransform from a translation represented by float3 vector and a float3x3 matrix representing both rotation and scale. + /// The translation vector. + /// The rotation and scale matrix. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public AffineTransform(float3 translation, float3x3 rotationScale) + { + rs = rotationScale; + t = translation; + } + + /// Constructs an AffineTransform from float3x3 matrix representating both rotation and scale. + /// The rotation and scale matrix. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public AffineTransform(float3x3 rotationScale) + { + rs = rotationScale; + t = float3.zero; + } + + /// Constructs an AffineTransform from a RigidTransform. + /// The RigidTransform. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public AffineTransform(RigidTransform rigid) + { + rs = math.float3x3(rigid.rot); + t = rigid.pos; + } + + /// Constructs an AffineTransform from a float3x4 matrix. + /// The float3x4 matrix. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public AffineTransform(float3x4 m) + { + rs = math.float3x3(m.c0, m.c1, m.c2); + t = m.c3; + } + + /// Constructs an AffineTransform from a float4x4 matrix. + /// The float4x4 matrix. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public AffineTransform(float4x4 m) + { + rs = math.float3x3(m.c0.xyz, m.c1.xyz, m.c2.xyz); + t = m.c3.xyz; + } + + /// Implicit float3x4 cast operator. + /// The AffineTransform. + /// The converted AffineTransform. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float3x4(AffineTransform m) { return float3x4(m.rs.c0, m.rs.c1, m.rs.c2, m.t); } + + /// Implicit float4x4 cast operator. + /// The AffineTransform. + /// The converted AffineTransform. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float4x4(AffineTransform m) { return float4x4(float4(m.rs.c0, 0f), float4(m.rs.c1, 0f), float4(m.rs.c2, 0f), float4(m.t, 1f)); } + + /// Returns true if the AffineTransform is equal to a given AffineTransform, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(AffineTransform rhs) { return rs.Equals(rhs.rs) && t.Equals(rhs.t); } + + /// Returns true if the AffineTransform is equal to a given AffineTransform, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is AffineTransform converted && Equals(converted); } + + /// Returns a hash code for the AffineTransform. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)hash(this); } + + /// Returns a string representation of the AffineTransform. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("AffineTransform(({0}f, {1}f, {2}f, {3}f, {4}f, {5}f, {6}f, {7}f, {8}f), ({9}f, {10}f, {11}f))", + rs.c0.x, rs.c1.x, rs.c2.x, rs.c0.y, rs.c1.y, rs.c2.y, rs.c0.z, rs.c1.z, rs.c2.z, t.x, t.y, t.z + ); + } + + /// Returns a string representation of the AffineTransform using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("AffineTransform(({0}f, {1}f, {2}f, {3}f, {4}f, {5}f, {6}f, {7}f, {8}f), ({9}f, {10}f, {11}f))", + rs.c0.x.ToString(format, formatProvider), rs.c1.x.ToString(format, formatProvider), rs.c2.x.ToString(format, formatProvider), + rs.c0.y.ToString(format, formatProvider), rs.c1.y.ToString(format, formatProvider), rs.c2.y.ToString(format, formatProvider), + rs.c0.z.ToString(format, formatProvider), rs.c1.z.ToString(format, formatProvider), rs.c2.z.ToString(format, formatProvider), + t.x.ToString(format, formatProvider), t.y.ToString(format, formatProvider), t.z.ToString(format, formatProvider) + ); + } + } + + public static partial class math + { + /// Returns an AffineTransform constructed from a translation represented by a float3 vector and rotation represented by a unit quaternion. + /// The AffineTransform translation. + /// The AffineTransform rotation. + /// The AffineTransform given the translation vector and rotation quaternion. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static AffineTransform AffineTransform(float3 translation, quaternion rotation) { return new AffineTransform(translation, rotation); } + + /// Returns an AffineTransform constructed from a translation represented by a float3 vector, rotation represented by a unit quaternion and scale represented by a float3 vector. + /// The translation vector. + /// The rotation quaternion. + /// The scale vector. + /// The AffineTransform given the translation vector, rotation quaternion and scale vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static AffineTransform AffineTransform(float3 translation, quaternion rotation, float3 scale) { return new AffineTransform(translation, rotation, scale); } + + /// Returns an AffineTransform constructed from a translation represented by float3 vector and a float3x3 matrix representing both rotation and scale. + /// The translation vector. + /// The rotation and scale matrix. + /// The AffineTransform given the translation vector and float3x3 matrix. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static AffineTransform AffineTransform(float3 translation, float3x3 rotationScale) { return new AffineTransform(translation, rotationScale); } + + /// Returns an AffineTransform constructed from a float3x3 matrix representing both rotation and scale. + /// The rotation and scale matrix. + /// The AffineTransform given a float3x3 matrix. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static AffineTransform AffineTransform(float3x3 rotationScale) { return new AffineTransform(rotationScale); } + + /// Returns an AffineTransform constructed from a float4x4 matrix. + /// The float4x4 matrix. + /// The AffineTransform given a float4x4 matrix. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static AffineTransform AffineTransform(float4x4 m) { return new AffineTransform(m); } + + /// Returns an AffineTransform constructed from a float3x4 matrix. + /// The float3x4 matrix. + /// The AffineTransform given a float3x4 matrix. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static AffineTransform AffineTransform(float3x4 m) { return new AffineTransform(m); } + + /// Returns an AffineTransform constructed from a RigidTransform. + /// The RigidTransform. + /// The AffineTransform given a RigidTransform. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static AffineTransform AffineTransform(RigidTransform rigid) { return new AffineTransform (rigid); } + + /// Returns a float4x4 matrix constructed from an AffineTransform. + /// The AffineTransform. + /// The float4x4 matrix given an AffineTransform. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 float4x4(AffineTransform transform) { return float4x4(float4(transform.rs.c0, 0f), float4(transform.rs.c1, 0f), float4(transform.rs.c2, 0f), float4(transform.t, 1f)); } + + /// Returns a float3x4 matrix constructed from an AffineTransform. + /// The AffineTransform. + /// The float3x4 matrix given an AffineTransform. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x4 float3x4(AffineTransform transform) { return float3x4(transform.rs.c0, transform.rs.c1, transform.rs.c2, transform.t); } + + /// Returns the result of transforming the AffineTransform b by the AffineTransform a. + /// The AffineTransform on the left. + /// The AffineTransform on the right. + /// The AffineTransform of a transforming b. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static AffineTransform mul(AffineTransform a, AffineTransform b) + { + return new AffineTransform(transform(a, b.t), mul(a.rs, b.rs)); + } + + /// Returns the result of transforming the AffineTransform b by a float3x3 matrix a. + /// The float3x3 matrix on the left. + /// The AffineTransform on the right. + /// The AffineTransform of a transforming b. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static AffineTransform mul(float3x3 a, AffineTransform b) + { + return new AffineTransform(mul(a, b.t), mul(a, b.rs)); + } + + /// Returns the result of transforming the float3x3 b by an AffineTransform a. + /// The AffineTransform on the left. + /// The float3x3 matrix on the right. + /// The AffineTransform of a transforming b. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static AffineTransform mul(AffineTransform a, float3x3 b) + { + return new AffineTransform(a.t, mul(b, a.rs)); + } + + /// Returns the result of transforming a float4 homogeneous coordinate by an AffineTransform. + /// The AffineTransform. + /// The position to be transformed. + /// The transformed position. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 mul(AffineTransform a, float4 pos) + { + return float4(mul(a.rs, pos.xyz) + a.t * pos.w, pos.w); + } + + /// Returns the result of rotating a float3 vector by an AffineTransform. + /// The AffineTransform. + /// The direction vector to rotate. + /// The rotated direction vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 rotate(AffineTransform a, float3 dir) + { + return mul(a.rs, dir); + } + + /// Returns the result of transforming a float3 point by an AffineTransform. + /// The AffineTransform. + /// The position to transform. + /// The transformed position. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 transform(AffineTransform a, float3 pos) + { + return a.t + mul(a.rs, pos); + } + + /// Returns the inverse of an AffineTransform. + /// The AffineTransform to invert. + /// The inverse AffineTransform. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static AffineTransform inverse(AffineTransform a) + { + AffineTransform inv; + inv.rs = pseudoinverse(a.rs); + inv.t = mul(inv.rs, -a.t); + return inv; + } + + /// Decomposes the AffineTransform in translation, rotation and scale. + /// The AffineTransform + /// The decomposed translation vector of the AffineTransform. + /// The decomposed rotation quaternion of the AffineTransform. + /// The decomposed scale of the AffineTransform. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void decompose(AffineTransform a, out float3 translation, out quaternion rotation, out float3 scale) + { + translation = a.t; + rotation = math.rotation(a.rs); + var sm = mul(float3x3(conjugate(rotation)), a.rs); + scale = float3(sm.c0.x, sm.c1.y, sm.c2.z); + } + + /// Returns a uint hash code of an AffineTransform. + /// The AffineTransform to hash. + /// The hash code of the input AffineTransform. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(AffineTransform a) + { + return hash(a.rs) + 0xC5C5394Bu * hash(a.t); + } + + /// + /// Returns a uint4 vector hash code of an AffineTransform. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// The AffineTransform to hash. + /// The uint4 wide hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 hashwide(AffineTransform a) + { + return hashwide(a.rs).xyzz + 0xC5C5394Bu * hashwide(a.t).xyzz; + } + } +} diff --git a/src/Unity.Mathematics/affine_transform.cs.meta b/src/Unity.Mathematics/affine_transform.cs.meta new file mode 100644 index 00000000..19d69b1d --- /dev/null +++ b/src/Unity.Mathematics/affine_transform.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 25c2cff1b9e35e648980b04c895d7332 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/bool1.cs b/src/Unity.Mathematics/bool1.cs deleted file mode 100644 index 601b0802..00000000 --- a/src/Unity.Mathematics/bool1.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System; - -namespace Unity.Mathematics -{ - /// - /// A bool compatible for marshalling with native code. - /// - public struct bool1 : IEquatable - { - private readonly int _value; - - public bool1(bool value) - { - this._value = value ? 1 : 0; - } - - public static implicit operator bool(bool1 value) - { - return value._value != 0; - } - - public static implicit operator bool1(bool value) - { - return new bool1(value); - } - - public bool Equals(bool1 other) - { - return _value == other._value; - } - - public override bool Equals(object obj) - { - if (ReferenceEquals(null, obj)) return false; - return obj is bool1 && Equals((bool1)obj); - } - - public override int GetHashCode() - { - return _value; - } - - public static bool operator ==(bool1 left, bool1 right) - { - return left.Equals(right); - } - - public static bool operator !=(bool1 left, bool1 right) - { - return !left.Equals(right); - } - - public override string ToString() - { - return ((bool)this).ToString(); - } - } -} diff --git a/src/Unity.Mathematics/bool1.cs.meta b/src/Unity.Mathematics/bool1.cs.meta deleted file mode 100644 index 187ee017..00000000 --- a/src/Unity.Mathematics/bool1.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: f22724f32112b004f9503adef124973a -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/src/Unity.Mathematics/bool2.cs b/src/Unity.Mathematics/bool2.cs deleted file mode 100644 index d3cafe83..00000000 --- a/src/Unity.Mathematics/bool2.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System.Runtime.CompilerServices; -using System.Diagnostics; - -#pragma warning disable 0660, 0661 - -namespace Unity.Mathematics -{ - [DebuggerTypeProxy(typeof(bool2.DebuggerProxy))] - public partial struct bool2 - { - internal sealed class DebuggerProxy - { - public bool x; - public bool y; - - public DebuggerProxy(bool2 vec) - { - x = vec.x; - y = vec.y; - } - } - - public bool1 x; - public bool1 y; - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public bool2(bool val) - { - x = y = val; - } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public bool2(bool x, bool y) - { - this.x = x; - this.y = y; - } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static implicit operator bool2(bool d) - { - return new bool2(d); - } - - public override string ToString() - { - return string.Format("bool2({0}, {1})", x, y); - } - } -} - diff --git a/src/Unity.Mathematics/bool2.cs.meta b/src/Unity.Mathematics/bool2.cs.meta deleted file mode 100644 index 4c941060..00000000 --- a/src/Unity.Mathematics/bool2.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 2c7f277f80e7d3f45a5541d4acae2050 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/src/Unity.Mathematics/bool2.gen.cs b/src/Unity.Mathematics/bool2.gen.cs index ffbe0357..15951804 100644 --- a/src/Unity.Mathematics/bool2.gen.cs +++ b/src/Unity.Mathematics/bool2.gen.cs @@ -1,302 +1,626 @@ -// GENERATED CODE +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Diagnostics; +using Unity.IL2CPP.CompilerServices; + #pragma warning disable 0660, 0661 + namespace Unity.Mathematics { + /// A 2 component vector of bools. + [DebuggerTypeProxy(typeof(bool2.DebuggerProxy))] + [System.Serializable] + [Il2CppEagerStaticClassConstruction] public partial struct bool2 : System.IEquatable { + /// x component of the vector. + [MarshalAs(UnmanagedType.U1)] + public bool x; + /// y component of the vector. + [MarshalAs(UnmanagedType.U1)] + public bool y; + + + /// Constructs a bool2 vector from two bool values. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool2(bool x, bool y) + { + this.x = x; + this.y = y; + } + + /// Constructs a bool2 vector from a bool2 vector. + /// The constructed vector's xy components will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool2(bool2 xy) + { + this.x = xy.x; + this.y = xy.y; + } + + /// Constructs a bool2 vector from a single bool value by assigning it to every component. + /// bool to convert to bool2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool2(bool v) + { + this.x = v; + this.y = v; + } + + + /// Implicitly converts a single bool value to a bool2 vector by assigning it to every component. + /// bool to convert to bool2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator bool2(bool v) { return new bool2(v); } + - // equal - [MethodImpl(0x100)] + /// Returns the result of a componentwise equality operation on two bool2 vectors. + /// Left hand side bool2 to use to compute componentwise equality. + /// Right hand side bool2 to use to compute componentwise equality. + /// bool2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator == (bool2 lhs, bool2 rhs) { return new bool2 (lhs.x == rhs.x, lhs.y == rhs.y); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise equality operation on a bool2 vector and a bool value. + /// Left hand side bool2 to use to compute componentwise equality. + /// Right hand side bool to use to compute componentwise equality. + /// bool2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator == (bool2 lhs, bool rhs) { return new bool2 (lhs.x == rhs, lhs.y == rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise equality operation on a bool value and a bool2 vector. + /// Left hand side bool to use to compute componentwise equality. + /// Right hand side bool2 to use to compute componentwise equality. + /// bool2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator == (bool lhs, bool2 rhs) { return new bool2 (lhs == rhs.x, lhs == rhs.y); } - // not equal - [MethodImpl(0x100)] + + /// Returns the result of a componentwise not equal operation on two bool2 vectors. + /// Left hand side bool2 to use to compute componentwise not equal. + /// Right hand side bool2 to use to compute componentwise not equal. + /// bool2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator != (bool2 lhs, bool2 rhs) { return new bool2 (lhs.x != rhs.x, lhs.y != rhs.y); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise not equal operation on a bool2 vector and a bool value. + /// Left hand side bool2 to use to compute componentwise not equal. + /// Right hand side bool to use to compute componentwise not equal. + /// bool2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator != (bool2 lhs, bool rhs) { return new bool2 (lhs.x != rhs, lhs.y != rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise not equal operation on a bool value and a bool2 vector. + /// Left hand side bool to use to compute componentwise not equal. + /// Right hand side bool2 to use to compute componentwise not equal. + /// bool2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator != (bool lhs, bool2 rhs) { return new bool2 (lhs != rhs.x, lhs != rhs.y); } - // Equals - [MethodImpl(0x100)] - public bool Equals(bool2 rhs) { return x == rhs.x && y == rhs.y; } - // [int index] - unsafe public bool1 this[int index] - { - get - { -#if ENABLE_UNITY_COLLECTIONS_CHECKS - if ((uint)index >= 2) - throw new System.ArgumentException("index must be between[0...1]"); -#endif - fixed (bool1* array = &x) { return array[index]; } - } - set - { -#if ENABLE_UNITY_COLLECTIONS_CHECKS - if ((uint)index >= 2) - throw new System.ArgumentException("index must be between[0...1]"); -#endif - fixed (bool1* array = &x) { array[index] = value; } - } - } + /// Returns the result of a componentwise not operation on a bool2 vector. + /// Value to use when computing the componentwise not. + /// bool2 result of the componentwise not. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2 operator ! (bool2 val) { return new bool2 (!val.x, !val.y); } + - // operator & - [MethodImpl(0x100)] + /// Returns the result of a componentwise bitwise and operation on two bool2 vectors. + /// Left hand side bool2 to use to compute componentwise bitwise and. + /// Right hand side bool2 to use to compute componentwise bitwise and. + /// bool2 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator & (bool2 lhs, bool2 rhs) { return new bool2 (lhs.x & rhs.x, lhs.y & rhs.y); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise and operation on a bool2 vector and a bool value. + /// Left hand side bool2 to use to compute componentwise bitwise and. + /// Right hand side bool to use to compute componentwise bitwise and. + /// bool2 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator & (bool2 lhs, bool rhs) { return new bool2 (lhs.x & rhs, lhs.y & rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise and operation on a bool value and a bool2 vector. + /// Left hand side bool to use to compute componentwise bitwise and. + /// Right hand side bool2 to use to compute componentwise bitwise and. + /// bool2 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator & (bool lhs, bool2 rhs) { return new bool2 (lhs & rhs.x, lhs & rhs.y); } - // operator | - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise or operation on two bool2 vectors. + /// Left hand side bool2 to use to compute componentwise bitwise or. + /// Right hand side bool2 to use to compute componentwise bitwise or. + /// bool2 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator | (bool2 lhs, bool2 rhs) { return new bool2 (lhs.x | rhs.x, lhs.y | rhs.y); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise or operation on a bool2 vector and a bool value. + /// Left hand side bool2 to use to compute componentwise bitwise or. + /// Right hand side bool to use to compute componentwise bitwise or. + /// bool2 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator | (bool2 lhs, bool rhs) { return new bool2 (lhs.x | rhs, lhs.y | rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise or operation on a bool value and a bool2 vector. + /// Left hand side bool to use to compute componentwise bitwise or. + /// Right hand side bool2 to use to compute componentwise bitwise or. + /// bool2 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator | (bool lhs, bool2 rhs) { return new bool2 (lhs | rhs.x, lhs | rhs.y); } - // operator ^ - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise exclusive or operation on two bool2 vectors. + /// Left hand side bool2 to use to compute componentwise bitwise exclusive or. + /// Right hand side bool2 to use to compute componentwise bitwise exclusive or. + /// bool2 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator ^ (bool2 lhs, bool2 rhs) { return new bool2 (lhs.x ^ rhs.x, lhs.y ^ rhs.y); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise exclusive or operation on a bool2 vector and a bool value. + /// Left hand side bool2 to use to compute componentwise bitwise exclusive or. + /// Right hand side bool to use to compute componentwise bitwise exclusive or. + /// bool2 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator ^ (bool2 lhs, bool rhs) { return new bool2 (lhs.x ^ rhs, lhs.y ^ rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise exclusive or operation on a bool value and a bool2 vector. + /// Left hand side bool to use to compute componentwise bitwise exclusive or. + /// Right hand side bool2 to use to compute componentwise bitwise exclusive or. + /// bool2 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator ^ (bool lhs, bool2 rhs) { return new bool2 (lhs ^ rhs.x, lhs ^ rhs.y); } + + + + + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xxxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xxxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xxyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xxyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xyxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xyxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xyyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xyyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yxxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yxxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yxyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yxyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yyxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yyxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yyyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yyyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 xxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 xxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 xyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 xyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 yxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 yxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 yyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 yyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool2 xx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool2(x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool2 xy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool2(x, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; y = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool2 yx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool2(y, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; x = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool2 yy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool2(y, y); } } + + /// Returns the bool element at a specified index. + unsafe public bool this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 2) + throw new System.ArgumentException("index must be between[0...1]"); +#endif + fixed (bool2* array = &this) { return ((bool*)array)[index]; } + } + set + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 2) + throw new System.ArgumentException("index must be between[0...1]"); +#endif + fixed (bool* array = &x) { array[index] = value; } + } + } + + /// Returns true if the bool2 is equal to a given bool2, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(bool2 rhs) { return x == rhs.x && y == rhs.y; } + + /// Returns true if the bool2 is equal to a given bool2, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is bool2 converted && Equals(converted); } + + + /// Returns a hash code for the bool2. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the bool2. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("bool2({0}, {1})", x, y); + } + + internal sealed class DebuggerProxy + { + public bool x; + public bool y; + public DebuggerProxy(bool2 v) + { + x = v.x; + y = v.y; + } + } + + } + + public static partial class math + { + /// Returns a bool2 vector constructed from two bool values. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + /// bool2 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2 bool2(bool x, bool y) { return new bool2(x, y); } + + /// Returns a bool2 vector constructed from a bool2 vector. + /// The constructed vector's xy components will be set to this value. + /// bool2 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2 bool2(bool2 xy) { return new bool2(xy); } + + /// Returns a bool2 vector constructed from a single bool value by assigning it to every component. + /// bool to convert to bool2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2 bool2(bool v) { return new bool2(v); } + + /// Returns a uint hash code of a bool2 vector. + /// Vector value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(bool2 v) + { + return csum(select(uint2(0x90A285BBu, 0x5D19E1D5u), uint2(0xFAAF07DDu, 0x625C45BDu), v)); + } + + /// + /// Returns a uint2 vector hash code of a bool2 vector. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Vector value to hash. + /// uint2 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 hashwide(bool2 v) + { + return (select(uint2(0xC9F27FCBu, 0x6D2523B1u), uint2(0x6E2BF6A9u, 0xCC74B3B7u), v)); + } + + /// Returns the result of specified shuffling of the components from two bool2 vectors into a bool value. + /// bool2 to use as the left argument of the shuffle operation. + /// bool2 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting bool. + /// bool result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool shuffle(bool2 left, bool2 right, ShuffleComponent x) + { + return select_shuffle_component(left, right, x); + } + + /// Returns the result of specified shuffling of the components from two bool2 vectors into a bool2 vector. + /// bool2 to use as the left argument of the shuffle operation. + /// bool2 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting bool2 x component. + /// The ShuffleComponent to use when setting the resulting bool2 y component. + /// bool2 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2 shuffle(bool2 left, bool2 right, ShuffleComponent x, ShuffleComponent y) + { + return bool2( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y)); + } + + /// Returns the result of specified shuffling of the components from two bool2 vectors into a bool3 vector. + /// bool2 to use as the left argument of the shuffle operation. + /// bool2 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting bool3 x component. + /// The ShuffleComponent to use when setting the resulting bool3 y component. + /// The ShuffleComponent to use when setting the resulting bool3 z component. + /// bool3 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3 shuffle(bool2 left, bool2 right, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z) + { + return bool3( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y), + select_shuffle_component(left, right, z)); + } + + /// Returns the result of specified shuffling of the components from two bool2 vectors into a bool4 vector. + /// bool2 to use as the left argument of the shuffle operation. + /// bool2 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting bool4 x component. + /// The ShuffleComponent to use when setting the resulting bool4 y component. + /// The ShuffleComponent to use when setting the resulting bool4 z component. + /// The ShuffleComponent to use when setting the resulting bool4 w component. + /// bool4 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 shuffle(bool2 left, bool2 right, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z, ShuffleComponent w) + { + return bool4( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y), + select_shuffle_component(left, right, z), + select_shuffle_component(left, right, w)); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static bool select_shuffle_component(bool2 a, bool2 b, ShuffleComponent component) + { + switch(component) + { + case ShuffleComponent.LeftX: + return a.x; + case ShuffleComponent.LeftY: + return a.y; + case ShuffleComponent.RightX: + return b.x; + case ShuffleComponent.RightY: + return b.y; + default: + throw new System.ArgumentException("Invalid shuffle component: " + component); + } + } + } } diff --git a/src/Unity.Mathematics/bool2x2.gen.cs b/src/Unity.Mathematics/bool2x2.gen.cs new file mode 100644 index 00000000..02460be4 --- /dev/null +++ b/src/Unity.Mathematics/bool2x2.gen.cs @@ -0,0 +1,292 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 2x2 matrix of bools. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct bool2x2 : System.IEquatable + { + /// Column 0 of the matrix. + public bool2 c0; + /// Column 1 of the matrix. + public bool2 c1; + + + /// Constructs a bool2x2 matrix from two bool2 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool2x2(bool2 c0, bool2 c1) + { + this.c0 = c0; + this.c1 = c1; + } + + /// Constructs a bool2x2 matrix from 4 bool values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool2x2(bool m00, bool m01, + bool m10, bool m11) + { + this.c0 = new bool2(m00, m10); + this.c1 = new bool2(m01, m11); + } + + /// Constructs a bool2x2 matrix from a single bool value by assigning it to every component. + /// bool to convert to bool2x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool2x2(bool v) + { + this.c0 = v; + this.c1 = v; + } + + + /// Implicitly converts a single bool value to a bool2x2 matrix by assigning it to every component. + /// bool to convert to bool2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator bool2x2(bool v) { return new bool2x2(v); } + + + /// Returns the result of a componentwise equality operation on two bool2x2 matrices. + /// Left hand side bool2x2 to use to compute componentwise equality. + /// Right hand side bool2x2 to use to compute componentwise equality. + /// bool2x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator == (bool2x2 lhs, bool2x2 rhs) { return new bool2x2 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1); } + + /// Returns the result of a componentwise equality operation on a bool2x2 matrix and a bool value. + /// Left hand side bool2x2 to use to compute componentwise equality. + /// Right hand side bool to use to compute componentwise equality. + /// bool2x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator == (bool2x2 lhs, bool rhs) { return new bool2x2 (lhs.c0 == rhs, lhs.c1 == rhs); } + + /// Returns the result of a componentwise equality operation on a bool value and a bool2x2 matrix. + /// Left hand side bool to use to compute componentwise equality. + /// Right hand side bool2x2 to use to compute componentwise equality. + /// bool2x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator == (bool lhs, bool2x2 rhs) { return new bool2x2 (lhs == rhs.c0, lhs == rhs.c1); } + + + /// Returns the result of a componentwise not equal operation on two bool2x2 matrices. + /// Left hand side bool2x2 to use to compute componentwise not equal. + /// Right hand side bool2x2 to use to compute componentwise not equal. + /// bool2x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator != (bool2x2 lhs, bool2x2 rhs) { return new bool2x2 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1); } + + /// Returns the result of a componentwise not equal operation on a bool2x2 matrix and a bool value. + /// Left hand side bool2x2 to use to compute componentwise not equal. + /// Right hand side bool to use to compute componentwise not equal. + /// bool2x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator != (bool2x2 lhs, bool rhs) { return new bool2x2 (lhs.c0 != rhs, lhs.c1 != rhs); } + + /// Returns the result of a componentwise not equal operation on a bool value and a bool2x2 matrix. + /// Left hand side bool to use to compute componentwise not equal. + /// Right hand side bool2x2 to use to compute componentwise not equal. + /// bool2x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator != (bool lhs, bool2x2 rhs) { return new bool2x2 (lhs != rhs.c0, lhs != rhs.c1); } + + + /// Returns the result of a componentwise not operation on a bool2x2 matrix. + /// Value to use when computing the componentwise not. + /// bool2x2 result of the componentwise not. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator ! (bool2x2 val) { return new bool2x2 (!val.c0, !val.c1); } + + + /// Returns the result of a componentwise bitwise and operation on two bool2x2 matrices. + /// Left hand side bool2x2 to use to compute componentwise bitwise and. + /// Right hand side bool2x2 to use to compute componentwise bitwise and. + /// bool2x2 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator & (bool2x2 lhs, bool2x2 rhs) { return new bool2x2 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1); } + + /// Returns the result of a componentwise bitwise and operation on a bool2x2 matrix and a bool value. + /// Left hand side bool2x2 to use to compute componentwise bitwise and. + /// Right hand side bool to use to compute componentwise bitwise and. + /// bool2x2 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator & (bool2x2 lhs, bool rhs) { return new bool2x2 (lhs.c0 & rhs, lhs.c1 & rhs); } + + /// Returns the result of a componentwise bitwise and operation on a bool value and a bool2x2 matrix. + /// Left hand side bool to use to compute componentwise bitwise and. + /// Right hand side bool2x2 to use to compute componentwise bitwise and. + /// bool2x2 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator & (bool lhs, bool2x2 rhs) { return new bool2x2 (lhs & rhs.c0, lhs & rhs.c1); } + + + /// Returns the result of a componentwise bitwise or operation on two bool2x2 matrices. + /// Left hand side bool2x2 to use to compute componentwise bitwise or. + /// Right hand side bool2x2 to use to compute componentwise bitwise or. + /// bool2x2 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator | (bool2x2 lhs, bool2x2 rhs) { return new bool2x2 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1); } + + /// Returns the result of a componentwise bitwise or operation on a bool2x2 matrix and a bool value. + /// Left hand side bool2x2 to use to compute componentwise bitwise or. + /// Right hand side bool to use to compute componentwise bitwise or. + /// bool2x2 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator | (bool2x2 lhs, bool rhs) { return new bool2x2 (lhs.c0 | rhs, lhs.c1 | rhs); } + + /// Returns the result of a componentwise bitwise or operation on a bool value and a bool2x2 matrix. + /// Left hand side bool to use to compute componentwise bitwise or. + /// Right hand side bool2x2 to use to compute componentwise bitwise or. + /// bool2x2 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator | (bool lhs, bool2x2 rhs) { return new bool2x2 (lhs | rhs.c0, lhs | rhs.c1); } + + + /// Returns the result of a componentwise bitwise exclusive or operation on two bool2x2 matrices. + /// Left hand side bool2x2 to use to compute componentwise bitwise exclusive or. + /// Right hand side bool2x2 to use to compute componentwise bitwise exclusive or. + /// bool2x2 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator ^ (bool2x2 lhs, bool2x2 rhs) { return new bool2x2 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1); } + + /// Returns the result of a componentwise bitwise exclusive or operation on a bool2x2 matrix and a bool value. + /// Left hand side bool2x2 to use to compute componentwise bitwise exclusive or. + /// Right hand side bool to use to compute componentwise bitwise exclusive or. + /// bool2x2 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator ^ (bool2x2 lhs, bool rhs) { return new bool2x2 (lhs.c0 ^ rhs, lhs.c1 ^ rhs); } + + /// Returns the result of a componentwise bitwise exclusive or operation on a bool value and a bool2x2 matrix. + /// Left hand side bool to use to compute componentwise bitwise exclusive or. + /// Right hand side bool2x2 to use to compute componentwise bitwise exclusive or. + /// bool2x2 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator ^ (bool lhs, bool2x2 rhs) { return new bool2x2 (lhs ^ rhs.c0, lhs ^ rhs.c1); } + + + + /// Returns the bool2 element at a specified index. + unsafe public ref bool2 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 2) + throw new System.ArgumentException("index must be between[0...1]"); +#endif + fixed (bool2x2* array = &this) { return ref ((bool2*)array)[index]; } + } + } + + /// Returns true if the bool2x2 is equal to a given bool2x2, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(bool2x2 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1); } + + /// Returns true if the bool2x2 is equal to a given bool2x2, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is bool2x2 converted && Equals(converted); } + + + /// Returns a hash code for the bool2x2. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the bool2x2. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("bool2x2({0}, {1}, {2}, {3})", c0.x, c1.x, c0.y, c1.y); + } + + } + + public static partial class math + { + /// Returns a bool2x2 matrix constructed from two bool2 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// bool2x2 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 bool2x2(bool2 c0, bool2 c1) { return new bool2x2(c0, c1); } + + /// Returns a bool2x2 matrix constructed from from 4 bool values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// bool2x2 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 bool2x2(bool m00, bool m01, + bool m10, bool m11) + { + return new bool2x2(m00, m01, + m10, m11); + } + + /// Returns a bool2x2 matrix constructed from a single bool value by assigning it to every component. + /// bool to convert to bool2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 bool2x2(bool v) { return new bool2x2(v); } + + /// Return the bool2x2 transpose of a bool2x2 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 transpose(bool2x2 v) + { + return bool2x2( + v.c0.x, v.c0.y, + v.c1.x, v.c1.y); + } + + /// Returns a uint hash code of a bool2x2 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(bool2x2 v) + { + return csum(select(uint2(0x7AF32C49u, 0xAE131389u), uint2(0x5D1B165Bu, 0x87096CD7u), v.c0) + + select(uint2(0x4C7F6DD1u, 0x4822A3E9u), uint2(0xAAC3C25Du, 0xD21D0945u), v.c1)); + } + + /// + /// Returns a uint2 vector hash code of a bool2x2 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint2 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 hashwide(bool2x2 v) + { + return (select(uint2(0x88FCAB2Du, 0x614DA60Du), uint2(0x5BA2C50Bu, 0x8C455ACBu), v.c0) + + select(uint2(0xCD266C89u, 0xF1852A33u), uint2(0x77E35E77u, 0x863E3729u), v.c1)); + } + + } +} diff --git a/src/Unity.Mathematics/bool2x2.gen.cs.meta b/src/Unity.Mathematics/bool2x2.gen.cs.meta new file mode 100644 index 00000000..27058f1c --- /dev/null +++ b/src/Unity.Mathematics/bool2x2.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 466955346f18d45f1811f3683f9cf707 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/bool2x3.gen.cs b/src/Unity.Mathematics/bool2x3.gen.cs new file mode 100644 index 00000000..4e497b66 --- /dev/null +++ b/src/Unity.Mathematics/bool2x3.gen.cs @@ -0,0 +1,306 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 2x3 matrix of bools. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct bool2x3 : System.IEquatable + { + /// Column 0 of the matrix. + public bool2 c0; + /// Column 1 of the matrix. + public bool2 c1; + /// Column 2 of the matrix. + public bool2 c2; + + + /// Constructs a bool2x3 matrix from three bool2 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool2x3(bool2 c0, bool2 c1, bool2 c2) + { + this.c0 = c0; + this.c1 = c1; + this.c2 = c2; + } + + /// Constructs a bool2x3 matrix from 6 bool values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool2x3(bool m00, bool m01, bool m02, + bool m10, bool m11, bool m12) + { + this.c0 = new bool2(m00, m10); + this.c1 = new bool2(m01, m11); + this.c2 = new bool2(m02, m12); + } + + /// Constructs a bool2x3 matrix from a single bool value by assigning it to every component. + /// bool to convert to bool2x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool2x3(bool v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + } + + + /// Implicitly converts a single bool value to a bool2x3 matrix by assigning it to every component. + /// bool to convert to bool2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator bool2x3(bool v) { return new bool2x3(v); } + + + /// Returns the result of a componentwise equality operation on two bool2x3 matrices. + /// Left hand side bool2x3 to use to compute componentwise equality. + /// Right hand side bool2x3 to use to compute componentwise equality. + /// bool2x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator == (bool2x3 lhs, bool2x3 rhs) { return new bool2x3 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2); } + + /// Returns the result of a componentwise equality operation on a bool2x3 matrix and a bool value. + /// Left hand side bool2x3 to use to compute componentwise equality. + /// Right hand side bool to use to compute componentwise equality. + /// bool2x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator == (bool2x3 lhs, bool rhs) { return new bool2x3 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs); } + + /// Returns the result of a componentwise equality operation on a bool value and a bool2x3 matrix. + /// Left hand side bool to use to compute componentwise equality. + /// Right hand side bool2x3 to use to compute componentwise equality. + /// bool2x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator == (bool lhs, bool2x3 rhs) { return new bool2x3 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2); } + + + /// Returns the result of a componentwise not equal operation on two bool2x3 matrices. + /// Left hand side bool2x3 to use to compute componentwise not equal. + /// Right hand side bool2x3 to use to compute componentwise not equal. + /// bool2x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator != (bool2x3 lhs, bool2x3 rhs) { return new bool2x3 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2); } + + /// Returns the result of a componentwise not equal operation on a bool2x3 matrix and a bool value. + /// Left hand side bool2x3 to use to compute componentwise not equal. + /// Right hand side bool to use to compute componentwise not equal. + /// bool2x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator != (bool2x3 lhs, bool rhs) { return new bool2x3 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs); } + + /// Returns the result of a componentwise not equal operation on a bool value and a bool2x3 matrix. + /// Left hand side bool to use to compute componentwise not equal. + /// Right hand side bool2x3 to use to compute componentwise not equal. + /// bool2x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator != (bool lhs, bool2x3 rhs) { return new bool2x3 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2); } + + + /// Returns the result of a componentwise not operation on a bool2x3 matrix. + /// Value to use when computing the componentwise not. + /// bool2x3 result of the componentwise not. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator ! (bool2x3 val) { return new bool2x3 (!val.c0, !val.c1, !val.c2); } + + + /// Returns the result of a componentwise bitwise and operation on two bool2x3 matrices. + /// Left hand side bool2x3 to use to compute componentwise bitwise and. + /// Right hand side bool2x3 to use to compute componentwise bitwise and. + /// bool2x3 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator & (bool2x3 lhs, bool2x3 rhs) { return new bool2x3 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1, lhs.c2 & rhs.c2); } + + /// Returns the result of a componentwise bitwise and operation on a bool2x3 matrix and a bool value. + /// Left hand side bool2x3 to use to compute componentwise bitwise and. + /// Right hand side bool to use to compute componentwise bitwise and. + /// bool2x3 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator & (bool2x3 lhs, bool rhs) { return new bool2x3 (lhs.c0 & rhs, lhs.c1 & rhs, lhs.c2 & rhs); } + + /// Returns the result of a componentwise bitwise and operation on a bool value and a bool2x3 matrix. + /// Left hand side bool to use to compute componentwise bitwise and. + /// Right hand side bool2x3 to use to compute componentwise bitwise and. + /// bool2x3 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator & (bool lhs, bool2x3 rhs) { return new bool2x3 (lhs & rhs.c0, lhs & rhs.c1, lhs & rhs.c2); } + + + /// Returns the result of a componentwise bitwise or operation on two bool2x3 matrices. + /// Left hand side bool2x3 to use to compute componentwise bitwise or. + /// Right hand side bool2x3 to use to compute componentwise bitwise or. + /// bool2x3 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator | (bool2x3 lhs, bool2x3 rhs) { return new bool2x3 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1, lhs.c2 | rhs.c2); } + + /// Returns the result of a componentwise bitwise or operation on a bool2x3 matrix and a bool value. + /// Left hand side bool2x3 to use to compute componentwise bitwise or. + /// Right hand side bool to use to compute componentwise bitwise or. + /// bool2x3 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator | (bool2x3 lhs, bool rhs) { return new bool2x3 (lhs.c0 | rhs, lhs.c1 | rhs, lhs.c2 | rhs); } + + /// Returns the result of a componentwise bitwise or operation on a bool value and a bool2x3 matrix. + /// Left hand side bool to use to compute componentwise bitwise or. + /// Right hand side bool2x3 to use to compute componentwise bitwise or. + /// bool2x3 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator | (bool lhs, bool2x3 rhs) { return new bool2x3 (lhs | rhs.c0, lhs | rhs.c1, lhs | rhs.c2); } + + + /// Returns the result of a componentwise bitwise exclusive or operation on two bool2x3 matrices. + /// Left hand side bool2x3 to use to compute componentwise bitwise exclusive or. + /// Right hand side bool2x3 to use to compute componentwise bitwise exclusive or. + /// bool2x3 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator ^ (bool2x3 lhs, bool2x3 rhs) { return new bool2x3 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1, lhs.c2 ^ rhs.c2); } + + /// Returns the result of a componentwise bitwise exclusive or operation on a bool2x3 matrix and a bool value. + /// Left hand side bool2x3 to use to compute componentwise bitwise exclusive or. + /// Right hand side bool to use to compute componentwise bitwise exclusive or. + /// bool2x3 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator ^ (bool2x3 lhs, bool rhs) { return new bool2x3 (lhs.c0 ^ rhs, lhs.c1 ^ rhs, lhs.c2 ^ rhs); } + + /// Returns the result of a componentwise bitwise exclusive or operation on a bool value and a bool2x3 matrix. + /// Left hand side bool to use to compute componentwise bitwise exclusive or. + /// Right hand side bool2x3 to use to compute componentwise bitwise exclusive or. + /// bool2x3 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator ^ (bool lhs, bool2x3 rhs) { return new bool2x3 (lhs ^ rhs.c0, lhs ^ rhs.c1, lhs ^ rhs.c2); } + + + + /// Returns the bool2 element at a specified index. + unsafe public ref bool2 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 3) + throw new System.ArgumentException("index must be between[0...2]"); +#endif + fixed (bool2x3* array = &this) { return ref ((bool2*)array)[index]; } + } + } + + /// Returns true if the bool2x3 is equal to a given bool2x3, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(bool2x3 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2); } + + /// Returns true if the bool2x3 is equal to a given bool2x3, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is bool2x3 converted && Equals(converted); } + + + /// Returns a hash code for the bool2x3. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the bool2x3. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("bool2x3({0}, {1}, {2}, {3}, {4}, {5})", c0.x, c1.x, c2.x, c0.y, c1.y, c2.y); + } + + } + + public static partial class math + { + /// Returns a bool2x3 matrix constructed from three bool2 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// bool2x3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 bool2x3(bool2 c0, bool2 c1, bool2 c2) { return new bool2x3(c0, c1, c2); } + + /// Returns a bool2x3 matrix constructed from from 6 bool values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// bool2x3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 bool2x3(bool m00, bool m01, bool m02, + bool m10, bool m11, bool m12) + { + return new bool2x3(m00, m01, m02, + m10, m11, m12); + } + + /// Returns a bool2x3 matrix constructed from a single bool value by assigning it to every component. + /// bool to convert to bool2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 bool2x3(bool v) { return new bool2x3(v); } + + /// Return the bool3x2 transpose of a bool2x3 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 transpose(bool2x3 v) + { + return bool3x2( + v.c0.x, v.c0.y, + v.c1.x, v.c1.y, + v.c2.x, v.c2.y); + } + + /// Returns a uint hash code of a bool2x3 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(bool2x3 v) + { + return csum(select(uint2(0x7BE39F3Bu, 0xFAB9913Fu), uint2(0xB4501269u, 0xE04B89FDu), v.c0) + + select(uint2(0xDB3DE101u, 0x7B6D1B4Bu), uint2(0x58399E77u, 0x5EAC29C9u), v.c1) + + select(uint2(0xFC6014F9u, 0x6BF6693Fu), uint2(0x9D1B1D9Bu, 0xF842F5C1u), v.c2)); + } + + /// + /// Returns a uint2 vector hash code of a bool2x3 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint2 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 hashwide(bool2x3 v) + { + return (select(uint2(0xA47EC335u, 0xA477DF57u), uint2(0xC4B1493Fu, 0xBA0966D3u), v.c0) + + select(uint2(0xAFBEE253u, 0x5B419C01u), uint2(0x515D90F5u, 0xEC9F68F3u), v.c1) + + select(uint2(0xF9EA92D5u, 0xC2FAFCB9u), uint2(0x616E9CA1u, 0xC5C5394Bu), v.c2)); + } + + } +} diff --git a/src/Unity.Mathematics/bool2x3.gen.cs.meta b/src/Unity.Mathematics/bool2x3.gen.cs.meta new file mode 100644 index 00000000..4180af5d --- /dev/null +++ b/src/Unity.Mathematics/bool2x3.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2da7f6798be134406a5cc96b770b5e70 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/bool2x4.gen.cs b/src/Unity.Mathematics/bool2x4.gen.cs new file mode 100644 index 00000000..c4f76156 --- /dev/null +++ b/src/Unity.Mathematics/bool2x4.gen.cs @@ -0,0 +1,320 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 2x4 matrix of bools. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct bool2x4 : System.IEquatable + { + /// Column 0 of the matrix. + public bool2 c0; + /// Column 1 of the matrix. + public bool2 c1; + /// Column 2 of the matrix. + public bool2 c2; + /// Column 3 of the matrix. + public bool2 c3; + + + /// Constructs a bool2x4 matrix from four bool2 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// The matrix column c3 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool2x4(bool2 c0, bool2 c1, bool2 c2, bool2 c3) + { + this.c0 = c0; + this.c1 = c1; + this.c2 = c2; + this.c3 = c3; + } + + /// Constructs a bool2x4 matrix from 8 bool values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 0, column 3 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 1, column 3 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool2x4(bool m00, bool m01, bool m02, bool m03, + bool m10, bool m11, bool m12, bool m13) + { + this.c0 = new bool2(m00, m10); + this.c1 = new bool2(m01, m11); + this.c2 = new bool2(m02, m12); + this.c3 = new bool2(m03, m13); + } + + /// Constructs a bool2x4 matrix from a single bool value by assigning it to every component. + /// bool to convert to bool2x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool2x4(bool v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + this.c3 = v; + } + + + /// Implicitly converts a single bool value to a bool2x4 matrix by assigning it to every component. + /// bool to convert to bool2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator bool2x4(bool v) { return new bool2x4(v); } + + + /// Returns the result of a componentwise equality operation on two bool2x4 matrices. + /// Left hand side bool2x4 to use to compute componentwise equality. + /// Right hand side bool2x4 to use to compute componentwise equality. + /// bool2x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator == (bool2x4 lhs, bool2x4 rhs) { return new bool2x4 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2, lhs.c3 == rhs.c3); } + + /// Returns the result of a componentwise equality operation on a bool2x4 matrix and a bool value. + /// Left hand side bool2x4 to use to compute componentwise equality. + /// Right hand side bool to use to compute componentwise equality. + /// bool2x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator == (bool2x4 lhs, bool rhs) { return new bool2x4 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs, lhs.c3 == rhs); } + + /// Returns the result of a componentwise equality operation on a bool value and a bool2x4 matrix. + /// Left hand side bool to use to compute componentwise equality. + /// Right hand side bool2x4 to use to compute componentwise equality. + /// bool2x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator == (bool lhs, bool2x4 rhs) { return new bool2x4 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2, lhs == rhs.c3); } + + + /// Returns the result of a componentwise not equal operation on two bool2x4 matrices. + /// Left hand side bool2x4 to use to compute componentwise not equal. + /// Right hand side bool2x4 to use to compute componentwise not equal. + /// bool2x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator != (bool2x4 lhs, bool2x4 rhs) { return new bool2x4 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2, lhs.c3 != rhs.c3); } + + /// Returns the result of a componentwise not equal operation on a bool2x4 matrix and a bool value. + /// Left hand side bool2x4 to use to compute componentwise not equal. + /// Right hand side bool to use to compute componentwise not equal. + /// bool2x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator != (bool2x4 lhs, bool rhs) { return new bool2x4 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs, lhs.c3 != rhs); } + + /// Returns the result of a componentwise not equal operation on a bool value and a bool2x4 matrix. + /// Left hand side bool to use to compute componentwise not equal. + /// Right hand side bool2x4 to use to compute componentwise not equal. + /// bool2x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator != (bool lhs, bool2x4 rhs) { return new bool2x4 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2, lhs != rhs.c3); } + + + /// Returns the result of a componentwise not operation on a bool2x4 matrix. + /// Value to use when computing the componentwise not. + /// bool2x4 result of the componentwise not. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator ! (bool2x4 val) { return new bool2x4 (!val.c0, !val.c1, !val.c2, !val.c3); } + + + /// Returns the result of a componentwise bitwise and operation on two bool2x4 matrices. + /// Left hand side bool2x4 to use to compute componentwise bitwise and. + /// Right hand side bool2x4 to use to compute componentwise bitwise and. + /// bool2x4 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator & (bool2x4 lhs, bool2x4 rhs) { return new bool2x4 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1, lhs.c2 & rhs.c2, lhs.c3 & rhs.c3); } + + /// Returns the result of a componentwise bitwise and operation on a bool2x4 matrix and a bool value. + /// Left hand side bool2x4 to use to compute componentwise bitwise and. + /// Right hand side bool to use to compute componentwise bitwise and. + /// bool2x4 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator & (bool2x4 lhs, bool rhs) { return new bool2x4 (lhs.c0 & rhs, lhs.c1 & rhs, lhs.c2 & rhs, lhs.c3 & rhs); } + + /// Returns the result of a componentwise bitwise and operation on a bool value and a bool2x4 matrix. + /// Left hand side bool to use to compute componentwise bitwise and. + /// Right hand side bool2x4 to use to compute componentwise bitwise and. + /// bool2x4 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator & (bool lhs, bool2x4 rhs) { return new bool2x4 (lhs & rhs.c0, lhs & rhs.c1, lhs & rhs.c2, lhs & rhs.c3); } + + + /// Returns the result of a componentwise bitwise or operation on two bool2x4 matrices. + /// Left hand side bool2x4 to use to compute componentwise bitwise or. + /// Right hand side bool2x4 to use to compute componentwise bitwise or. + /// bool2x4 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator | (bool2x4 lhs, bool2x4 rhs) { return new bool2x4 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1, lhs.c2 | rhs.c2, lhs.c3 | rhs.c3); } + + /// Returns the result of a componentwise bitwise or operation on a bool2x4 matrix and a bool value. + /// Left hand side bool2x4 to use to compute componentwise bitwise or. + /// Right hand side bool to use to compute componentwise bitwise or. + /// bool2x4 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator | (bool2x4 lhs, bool rhs) { return new bool2x4 (lhs.c0 | rhs, lhs.c1 | rhs, lhs.c2 | rhs, lhs.c3 | rhs); } + + /// Returns the result of a componentwise bitwise or operation on a bool value and a bool2x4 matrix. + /// Left hand side bool to use to compute componentwise bitwise or. + /// Right hand side bool2x4 to use to compute componentwise bitwise or. + /// bool2x4 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator | (bool lhs, bool2x4 rhs) { return new bool2x4 (lhs | rhs.c0, lhs | rhs.c1, lhs | rhs.c2, lhs | rhs.c3); } + + + /// Returns the result of a componentwise bitwise exclusive or operation on two bool2x4 matrices. + /// Left hand side bool2x4 to use to compute componentwise bitwise exclusive or. + /// Right hand side bool2x4 to use to compute componentwise bitwise exclusive or. + /// bool2x4 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator ^ (bool2x4 lhs, bool2x4 rhs) { return new bool2x4 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1, lhs.c2 ^ rhs.c2, lhs.c3 ^ rhs.c3); } + + /// Returns the result of a componentwise bitwise exclusive or operation on a bool2x4 matrix and a bool value. + /// Left hand side bool2x4 to use to compute componentwise bitwise exclusive or. + /// Right hand side bool to use to compute componentwise bitwise exclusive or. + /// bool2x4 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator ^ (bool2x4 lhs, bool rhs) { return new bool2x4 (lhs.c0 ^ rhs, lhs.c1 ^ rhs, lhs.c2 ^ rhs, lhs.c3 ^ rhs); } + + /// Returns the result of a componentwise bitwise exclusive or operation on a bool value and a bool2x4 matrix. + /// Left hand side bool to use to compute componentwise bitwise exclusive or. + /// Right hand side bool2x4 to use to compute componentwise bitwise exclusive or. + /// bool2x4 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator ^ (bool lhs, bool2x4 rhs) { return new bool2x4 (lhs ^ rhs.c0, lhs ^ rhs.c1, lhs ^ rhs.c2, lhs ^ rhs.c3); } + + + + /// Returns the bool2 element at a specified index. + unsafe public ref bool2 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 4) + throw new System.ArgumentException("index must be between[0...3]"); +#endif + fixed (bool2x4* array = &this) { return ref ((bool2*)array)[index]; } + } + } + + /// Returns true if the bool2x4 is equal to a given bool2x4, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(bool2x4 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2) && c3.Equals(rhs.c3); } + + /// Returns true if the bool2x4 is equal to a given bool2x4, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is bool2x4 converted && Equals(converted); } + + + /// Returns a hash code for the bool2x4. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the bool2x4. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("bool2x4({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7})", c0.x, c1.x, c2.x, c3.x, c0.y, c1.y, c2.y, c3.y); + } + + } + + public static partial class math + { + /// Returns a bool2x4 matrix constructed from four bool2 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// The matrix column c3 will be set to this value. + /// bool2x4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 bool2x4(bool2 c0, bool2 c1, bool2 c2, bool2 c3) { return new bool2x4(c0, c1, c2, c3); } + + /// Returns a bool2x4 matrix constructed from from 8 bool values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 0, column 3 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 1, column 3 will be set to this value. + /// bool2x4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 bool2x4(bool m00, bool m01, bool m02, bool m03, + bool m10, bool m11, bool m12, bool m13) + { + return new bool2x4(m00, m01, m02, m03, + m10, m11, m12, m13); + } + + /// Returns a bool2x4 matrix constructed from a single bool value by assigning it to every component. + /// bool to convert to bool2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 bool2x4(bool v) { return new bool2x4(v); } + + /// Return the bool4x2 transpose of a bool2x4 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 transpose(bool2x4 v) + { + return bool4x2( + v.c0.x, v.c0.y, + v.c1.x, v.c1.y, + v.c2.x, v.c2.y, + v.c3.x, v.c3.y); + } + + /// Returns a uint hash code of a bool2x4 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(bool2x4 v) + { + return csum(select(uint2(0x45A22087u, 0xFC104C3Bu), uint2(0x5FFF6B19u, 0x5E6CBF3Bu), v.c0) + + select(uint2(0xB546F2A5u, 0xBBCF63E7u), uint2(0xC53F4755u, 0x6985C229u), v.c1) + + select(uint2(0xE133B0B3u, 0xC3E0A3B9u), uint2(0xFE31134Fu, 0x712A34D7u), v.c2) + + select(uint2(0x9D77A59Bu, 0x4942CA39u), uint2(0xB40EC62Du, 0x565ED63Fu), v.c3)); + } + + /// + /// Returns a uint2 vector hash code of a bool2x4 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint2 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 hashwide(bool2x4 v) + { + return (select(uint2(0x93C30C2Bu, 0xDCAF0351u), uint2(0x6E050B01u, 0x750FDBF5u), v.c0) + + select(uint2(0x7F3DD499u, 0x52EAAEBBu), uint2(0x4599C793u, 0x83B5E729u), v.c1) + + select(uint2(0xC267163Fu, 0x67BC9149u), uint2(0xAD7C5EC1u, 0x822A7D6Du), v.c2) + + select(uint2(0xB492BF15u, 0xD37220E3u), uint2(0x7AA2C2BDu, 0xE16BC89Du), v.c3)); + } + + } +} diff --git a/src/Unity.Mathematics/bool2x4.gen.cs.meta b/src/Unity.Mathematics/bool2x4.gen.cs.meta new file mode 100644 index 00000000..011e8d3d --- /dev/null +++ b/src/Unity.Mathematics/bool2x4.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f3638df1ef4a049fb957126fc52d1a20 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/bool3.cs b/src/Unity.Mathematics/bool3.cs deleted file mode 100644 index 19677926..00000000 --- a/src/Unity.Mathematics/bool3.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System.Runtime.CompilerServices; -using System.Diagnostics; - -#pragma warning disable 0660, 0661 - -namespace Unity.Mathematics -{ - [DebuggerTypeProxy(typeof(bool3.DebuggerProxy))] - public partial struct bool3 - { - internal sealed class DebuggerProxy - { - public bool x; - public bool y; - public bool z; - - public DebuggerProxy(bool3 vec) - { - x = vec.x; - y = vec.y; - z = vec.z; - } - } - - public bool1 x; - public bool1 y; - public bool1 z; - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public bool3(bool val) { x = y = z = val; } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public bool3(bool x, bool y, bool z) - { - this.x = x; - this.y = y; - this.z = z; - } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public bool3(bool2 xy, bool z) - { - this.x = xy.x; - this.y = xy.y; - this.z = z; - } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static implicit operator bool3(bool d) - { - return new bool3(d); - } - - public override string ToString() - { - return string.Format("bool3({0}, {1}, {2})", x, y, z); - } - - } -} - diff --git a/src/Unity.Mathematics/bool3.cs.meta b/src/Unity.Mathematics/bool3.cs.meta deleted file mode 100644 index a36a3bb6..00000000 --- a/src/Unity.Mathematics/bool3.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: bfa473d96790d61438b24f34f5b2b03a -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/src/Unity.Mathematics/bool3.gen.cs b/src/Unity.Mathematics/bool3.gen.cs index daaf1beb..602a7ccf 100644 --- a/src/Unity.Mathematics/bool3.gen.cs +++ b/src/Unity.Mathematics/bool3.gen.cs @@ -1,1034 +1,1497 @@ -// GENERATED CODE +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Diagnostics; +using Unity.IL2CPP.CompilerServices; + #pragma warning disable 0660, 0661 + namespace Unity.Mathematics { + /// A 3 component vector of bools. + [DebuggerTypeProxy(typeof(bool3.DebuggerProxy))] + [System.Serializable] + [Il2CppEagerStaticClassConstruction] public partial struct bool3 : System.IEquatable { + /// x component of the vector. + [MarshalAs(UnmanagedType.U1)] + public bool x; + /// y component of the vector. + [MarshalAs(UnmanagedType.U1)] + public bool y; + /// z component of the vector. + [MarshalAs(UnmanagedType.U1)] + public bool z; + + + /// Constructs a bool3 vector from three bool values. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + /// The constructed vector's z component will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool3(bool x, bool y, bool z) + { + this.x = x; + this.y = y; + this.z = z; + } + + /// Constructs a bool3 vector from a bool value and a bool2 vector. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's yz components will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool3(bool x, bool2 yz) + { + this.x = x; + this.y = yz.x; + this.z = yz.y; + } + + /// Constructs a bool3 vector from a bool2 vector and a bool value. + /// The constructed vector's xy components will be set to this value. + /// The constructed vector's z component will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool3(bool2 xy, bool z) + { + this.x = xy.x; + this.y = xy.y; + this.z = z; + } - // equal - [MethodImpl(0x100)] + /// Constructs a bool3 vector from a bool3 vector. + /// The constructed vector's xyz components will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool3(bool3 xyz) + { + this.x = xyz.x; + this.y = xyz.y; + this.z = xyz.z; + } + + /// Constructs a bool3 vector from a single bool value by assigning it to every component. + /// bool to convert to bool3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool3(bool v) + { + this.x = v; + this.y = v; + this.z = v; + } + + + /// Implicitly converts a single bool value to a bool3 vector by assigning it to every component. + /// bool to convert to bool3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator bool3(bool v) { return new bool3(v); } + + + /// Returns the result of a componentwise equality operation on two bool3 vectors. + /// Left hand side bool3 to use to compute componentwise equality. + /// Right hand side bool3 to use to compute componentwise equality. + /// bool3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator == (bool3 lhs, bool3 rhs) { return new bool3 (lhs.x == rhs.x, lhs.y == rhs.y, lhs.z == rhs.z); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise equality operation on a bool3 vector and a bool value. + /// Left hand side bool3 to use to compute componentwise equality. + /// Right hand side bool to use to compute componentwise equality. + /// bool3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator == (bool3 lhs, bool rhs) { return new bool3 (lhs.x == rhs, lhs.y == rhs, lhs.z == rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise equality operation on a bool value and a bool3 vector. + /// Left hand side bool to use to compute componentwise equality. + /// Right hand side bool3 to use to compute componentwise equality. + /// bool3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator == (bool lhs, bool3 rhs) { return new bool3 (lhs == rhs.x, lhs == rhs.y, lhs == rhs.z); } - // not equal - [MethodImpl(0x100)] + + /// Returns the result of a componentwise not equal operation on two bool3 vectors. + /// Left hand side bool3 to use to compute componentwise not equal. + /// Right hand side bool3 to use to compute componentwise not equal. + /// bool3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator != (bool3 lhs, bool3 rhs) { return new bool3 (lhs.x != rhs.x, lhs.y != rhs.y, lhs.z != rhs.z); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise not equal operation on a bool3 vector and a bool value. + /// Left hand side bool3 to use to compute componentwise not equal. + /// Right hand side bool to use to compute componentwise not equal. + /// bool3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator != (bool3 lhs, bool rhs) { return new bool3 (lhs.x != rhs, lhs.y != rhs, lhs.z != rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise not equal operation on a bool value and a bool3 vector. + /// Left hand side bool to use to compute componentwise not equal. + /// Right hand side bool3 to use to compute componentwise not equal. + /// bool3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator != (bool lhs, bool3 rhs) { return new bool3 (lhs != rhs.x, lhs != rhs.y, lhs != rhs.z); } - // Equals - [MethodImpl(0x100)] - public bool Equals(bool3 rhs) { return x == rhs.x && y == rhs.y && z == rhs.z; } - // [int index] - unsafe public bool1 this[int index] - { - get - { -#if ENABLE_UNITY_COLLECTIONS_CHECKS - if ((uint)index >= 3) - throw new System.ArgumentException("index must be between[0...2]"); -#endif - fixed (bool1* array = &x) { return array[index]; } - } - set - { -#if ENABLE_UNITY_COLLECTIONS_CHECKS - if ((uint)index >= 3) - throw new System.ArgumentException("index must be between[0...2]"); -#endif - fixed (bool1* array = &x) { array[index] = value; } - } - } + /// Returns the result of a componentwise not operation on a bool3 vector. + /// Value to use when computing the componentwise not. + /// bool3 result of the componentwise not. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3 operator ! (bool3 val) { return new bool3 (!val.x, !val.y, !val.z); } - // operator & - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise and operation on two bool3 vectors. + /// Left hand side bool3 to use to compute componentwise bitwise and. + /// Right hand side bool3 to use to compute componentwise bitwise and. + /// bool3 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator & (bool3 lhs, bool3 rhs) { return new bool3 (lhs.x & rhs.x, lhs.y & rhs.y, lhs.z & rhs.z); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise and operation on a bool3 vector and a bool value. + /// Left hand side bool3 to use to compute componentwise bitwise and. + /// Right hand side bool to use to compute componentwise bitwise and. + /// bool3 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator & (bool3 lhs, bool rhs) { return new bool3 (lhs.x & rhs, lhs.y & rhs, lhs.z & rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise and operation on a bool value and a bool3 vector. + /// Left hand side bool to use to compute componentwise bitwise and. + /// Right hand side bool3 to use to compute componentwise bitwise and. + /// bool3 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator & (bool lhs, bool3 rhs) { return new bool3 (lhs & rhs.x, lhs & rhs.y, lhs & rhs.z); } - // operator | - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise or operation on two bool3 vectors. + /// Left hand side bool3 to use to compute componentwise bitwise or. + /// Right hand side bool3 to use to compute componentwise bitwise or. + /// bool3 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator | (bool3 lhs, bool3 rhs) { return new bool3 (lhs.x | rhs.x, lhs.y | rhs.y, lhs.z | rhs.z); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise or operation on a bool3 vector and a bool value. + /// Left hand side bool3 to use to compute componentwise bitwise or. + /// Right hand side bool to use to compute componentwise bitwise or. + /// bool3 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator | (bool3 lhs, bool rhs) { return new bool3 (lhs.x | rhs, lhs.y | rhs, lhs.z | rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise or operation on a bool value and a bool3 vector. + /// Left hand side bool to use to compute componentwise bitwise or. + /// Right hand side bool3 to use to compute componentwise bitwise or. + /// bool3 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator | (bool lhs, bool3 rhs) { return new bool3 (lhs | rhs.x, lhs | rhs.y, lhs | rhs.z); } - // operator ^ - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise exclusive or operation on two bool3 vectors. + /// Left hand side bool3 to use to compute componentwise bitwise exclusive or. + /// Right hand side bool3 to use to compute componentwise bitwise exclusive or. + /// bool3 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator ^ (bool3 lhs, bool3 rhs) { return new bool3 (lhs.x ^ rhs.x, lhs.y ^ rhs.y, lhs.z ^ rhs.z); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise exclusive or operation on a bool3 vector and a bool value. + /// Left hand side bool3 to use to compute componentwise bitwise exclusive or. + /// Right hand side bool to use to compute componentwise bitwise exclusive or. + /// bool3 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator ^ (bool3 lhs, bool rhs) { return new bool3 (lhs.x ^ rhs, lhs.y ^ rhs, lhs.z ^ rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise exclusive or operation on a bool value and a bool3 vector. + /// Left hand side bool to use to compute componentwise bitwise exclusive or. + /// Right hand side bool3 to use to compute componentwise bitwise exclusive or. + /// bool3 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator ^ (bool lhs, bool3 rhs) { return new bool3 (lhs ^ rhs.x, lhs ^ rhs.y, lhs ^ rhs.z); } + + + + + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xxxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xxxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xxxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, x, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xxyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xxyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xxyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, x, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xxzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, x, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xxzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, x, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xxzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, x, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xyxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xyxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xyxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, y, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xyyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xyyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xyyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, y, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xyzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, y, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xyzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, y, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xyzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, y, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xzxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, z, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xzxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, z, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xzxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, z, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xzyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, z, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xzyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, z, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xzyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, z, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xzzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, z, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xzzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, z, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xzzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, z, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yxxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yxxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yxxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, x, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yxyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yxyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yxyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, x, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yxzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, x, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yxzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, x, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yxzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, x, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yyxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yyxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yyxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, y, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yyyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yyyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yyyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, y, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yyzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, y, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yyzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, y, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yyzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, y, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yzxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, z, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yzxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, z, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yzxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, z, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yzyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, z, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yzyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, z, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yzyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, z, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yzzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, z, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yzzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, z, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yzzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, z, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zxxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zxxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zxxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, x, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zxyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zxyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zxyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, x, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zxzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, x, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zxzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, x, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zxzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, x, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zyxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zyxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zyxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, y, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zyyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zyyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zyyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, y, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zyzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, y, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zyzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, y, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zyzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, y, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zzxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, z, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zzxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, z, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zzxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, z, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zzyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, z, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zzyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, z, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zzyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, z, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zzzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, z, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zzzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, z, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zzzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, z, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 xxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 xxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 xxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(x, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 xyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 xyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 xyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(x, y, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; y = value.y; z = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 xzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(x, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 xzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(x, z, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; z = value.y; y = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 xzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(x, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 yxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 yxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 yxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(y, x, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; x = value.y; z = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 yyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 yyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 yyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(y, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 yzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(y, z, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; z = value.y; x = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 yzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(y, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 yzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(y, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 zxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(z, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 zxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(z, x, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; x = value.y; y = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 zxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(z, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 zyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(z, y, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; y = value.y; x = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 zyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(z, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 zyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(z, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 zzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(z, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 zzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(z, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 zzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(z, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool2 xx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool2(x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool2 xy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool2(x, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; y = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool2 xz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool2(x, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; z = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool2 yx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool2(y, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; x = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool2 yy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool2(y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool2 yz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool2(y, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; z = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool2 zx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool2(z, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; x = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool2 zy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool2(z, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; y = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool2 zz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool2(z, z); } } + + /// Returns the bool element at a specified index. + unsafe public bool this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 3) + throw new System.ArgumentException("index must be between[0...2]"); +#endif + fixed (bool3* array = &this) { return ((bool*)array)[index]; } + } + set + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 3) + throw new System.ArgumentException("index must be between[0...2]"); +#endif + fixed (bool* array = &x) { array[index] = value; } + } + } + + /// Returns true if the bool3 is equal to a given bool3, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(bool3 rhs) { return x == rhs.x && y == rhs.y && z == rhs.z; } + + /// Returns true if the bool3 is equal to a given bool3, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is bool3 converted && Equals(converted); } + + + /// Returns a hash code for the bool3. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the bool3. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("bool3({0}, {1}, {2})", x, y, z); + } + + internal sealed class DebuggerProxy + { + public bool x; + public bool y; + public bool z; + public DebuggerProxy(bool3 v) + { + x = v.x; + y = v.y; + z = v.z; + } + } + + } + + public static partial class math + { + /// Returns a bool3 vector constructed from three bool values. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + /// The constructed vector's z component will be set to this value. + /// bool3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3 bool3(bool x, bool y, bool z) { return new bool3(x, y, z); } + + /// Returns a bool3 vector constructed from a bool value and a bool2 vector. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's yz components will be set to this value. + /// bool3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3 bool3(bool x, bool2 yz) { return new bool3(x, yz); } + + /// Returns a bool3 vector constructed from a bool2 vector and a bool value. + /// The constructed vector's xy components will be set to this value. + /// The constructed vector's z component will be set to this value. + /// bool3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3 bool3(bool2 xy, bool z) { return new bool3(xy, z); } + + /// Returns a bool3 vector constructed from a bool3 vector. + /// The constructed vector's xyz components will be set to this value. + /// bool3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3 bool3(bool3 xyz) { return new bool3(xyz); } + + /// Returns a bool3 vector constructed from a single bool value by assigning it to every component. + /// bool to convert to bool3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3 bool3(bool v) { return new bool3(v); } + + /// Returns a uint hash code of a bool3 vector. + /// Vector value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(bool3 v) + { + return csum(select(uint3(0xA1E92D39u, 0x4583C801u, 0x9536A0F5u), uint3(0xAF816615u, 0x9AF8D62Du, 0xE3600729u), v)); + } + + /// + /// Returns a uint3 vector hash code of a bool3 vector. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Vector value to hash. + /// uint3 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 hashwide(bool3 v) + { + return (select(uint3(0x5F17300Du, 0x670D6809u, 0x7AF32C49u), uint3(0xAE131389u, 0x5D1B165Bu, 0x87096CD7u), v)); + } + + /// Returns the result of specified shuffling of the components from two bool3 vectors into a bool value. + /// bool3 to use as the left argument of the shuffle operation. + /// bool3 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting bool. + /// bool result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool shuffle(bool3 left, bool3 right, ShuffleComponent x) + { + return select_shuffle_component(left, right, x); + } + + /// Returns the result of specified shuffling of the components from two bool3 vectors into a bool2 vector. + /// bool3 to use as the left argument of the shuffle operation. + /// bool3 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting bool2 x component. + /// The ShuffleComponent to use when setting the resulting bool2 y component. + /// bool2 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2 shuffle(bool3 left, bool3 right, ShuffleComponent x, ShuffleComponent y) + { + return bool2( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y)); + } + + /// Returns the result of specified shuffling of the components from two bool3 vectors into a bool3 vector. + /// bool3 to use as the left argument of the shuffle operation. + /// bool3 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting bool3 x component. + /// The ShuffleComponent to use when setting the resulting bool3 y component. + /// The ShuffleComponent to use when setting the resulting bool3 z component. + /// bool3 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3 shuffle(bool3 left, bool3 right, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z) + { + return bool3( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y), + select_shuffle_component(left, right, z)); + } + + /// Returns the result of specified shuffling of the components from two bool3 vectors into a bool4 vector. + /// bool3 to use as the left argument of the shuffle operation. + /// bool3 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting bool4 x component. + /// The ShuffleComponent to use when setting the resulting bool4 y component. + /// The ShuffleComponent to use when setting the resulting bool4 z component. + /// The ShuffleComponent to use when setting the resulting bool4 w component. + /// bool4 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 shuffle(bool3 left, bool3 right, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z, ShuffleComponent w) + { + return bool4( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y), + select_shuffle_component(left, right, z), + select_shuffle_component(left, right, w)); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static bool select_shuffle_component(bool3 a, bool3 b, ShuffleComponent component) + { + switch(component) + { + case ShuffleComponent.LeftX: + return a.x; + case ShuffleComponent.LeftY: + return a.y; + case ShuffleComponent.LeftZ: + return a.z; + case ShuffleComponent.RightX: + return b.x; + case ShuffleComponent.RightY: + return b.y; + case ShuffleComponent.RightZ: + return b.z; + default: + throw new System.ArgumentException("Invalid shuffle component: " + component); + } + } + } } diff --git a/src/Unity.Mathematics/bool3x2.gen.cs b/src/Unity.Mathematics/bool3x2.gen.cs new file mode 100644 index 00000000..8790944d --- /dev/null +++ b/src/Unity.Mathematics/bool3x2.gen.cs @@ -0,0 +1,299 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 3x2 matrix of bools. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct bool3x2 : System.IEquatable + { + /// Column 0 of the matrix. + public bool3 c0; + /// Column 1 of the matrix. + public bool3 c1; + + + /// Constructs a bool3x2 matrix from two bool3 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool3x2(bool3 c0, bool3 c1) + { + this.c0 = c0; + this.c1 = c1; + } + + /// Constructs a bool3x2 matrix from 6 bool values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool3x2(bool m00, bool m01, + bool m10, bool m11, + bool m20, bool m21) + { + this.c0 = new bool3(m00, m10, m20); + this.c1 = new bool3(m01, m11, m21); + } + + /// Constructs a bool3x2 matrix from a single bool value by assigning it to every component. + /// bool to convert to bool3x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool3x2(bool v) + { + this.c0 = v; + this.c1 = v; + } + + + /// Implicitly converts a single bool value to a bool3x2 matrix by assigning it to every component. + /// bool to convert to bool3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator bool3x2(bool v) { return new bool3x2(v); } + + + /// Returns the result of a componentwise equality operation on two bool3x2 matrices. + /// Left hand side bool3x2 to use to compute componentwise equality. + /// Right hand side bool3x2 to use to compute componentwise equality. + /// bool3x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator == (bool3x2 lhs, bool3x2 rhs) { return new bool3x2 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1); } + + /// Returns the result of a componentwise equality operation on a bool3x2 matrix and a bool value. + /// Left hand side bool3x2 to use to compute componentwise equality. + /// Right hand side bool to use to compute componentwise equality. + /// bool3x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator == (bool3x2 lhs, bool rhs) { return new bool3x2 (lhs.c0 == rhs, lhs.c1 == rhs); } + + /// Returns the result of a componentwise equality operation on a bool value and a bool3x2 matrix. + /// Left hand side bool to use to compute componentwise equality. + /// Right hand side bool3x2 to use to compute componentwise equality. + /// bool3x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator == (bool lhs, bool3x2 rhs) { return new bool3x2 (lhs == rhs.c0, lhs == rhs.c1); } + + + /// Returns the result of a componentwise not equal operation on two bool3x2 matrices. + /// Left hand side bool3x2 to use to compute componentwise not equal. + /// Right hand side bool3x2 to use to compute componentwise not equal. + /// bool3x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator != (bool3x2 lhs, bool3x2 rhs) { return new bool3x2 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1); } + + /// Returns the result of a componentwise not equal operation on a bool3x2 matrix and a bool value. + /// Left hand side bool3x2 to use to compute componentwise not equal. + /// Right hand side bool to use to compute componentwise not equal. + /// bool3x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator != (bool3x2 lhs, bool rhs) { return new bool3x2 (lhs.c0 != rhs, lhs.c1 != rhs); } + + /// Returns the result of a componentwise not equal operation on a bool value and a bool3x2 matrix. + /// Left hand side bool to use to compute componentwise not equal. + /// Right hand side bool3x2 to use to compute componentwise not equal. + /// bool3x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator != (bool lhs, bool3x2 rhs) { return new bool3x2 (lhs != rhs.c0, lhs != rhs.c1); } + + + /// Returns the result of a componentwise not operation on a bool3x2 matrix. + /// Value to use when computing the componentwise not. + /// bool3x2 result of the componentwise not. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator ! (bool3x2 val) { return new bool3x2 (!val.c0, !val.c1); } + + + /// Returns the result of a componentwise bitwise and operation on two bool3x2 matrices. + /// Left hand side bool3x2 to use to compute componentwise bitwise and. + /// Right hand side bool3x2 to use to compute componentwise bitwise and. + /// bool3x2 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator & (bool3x2 lhs, bool3x2 rhs) { return new bool3x2 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1); } + + /// Returns the result of a componentwise bitwise and operation on a bool3x2 matrix and a bool value. + /// Left hand side bool3x2 to use to compute componentwise bitwise and. + /// Right hand side bool to use to compute componentwise bitwise and. + /// bool3x2 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator & (bool3x2 lhs, bool rhs) { return new bool3x2 (lhs.c0 & rhs, lhs.c1 & rhs); } + + /// Returns the result of a componentwise bitwise and operation on a bool value and a bool3x2 matrix. + /// Left hand side bool to use to compute componentwise bitwise and. + /// Right hand side bool3x2 to use to compute componentwise bitwise and. + /// bool3x2 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator & (bool lhs, bool3x2 rhs) { return new bool3x2 (lhs & rhs.c0, lhs & rhs.c1); } + + + /// Returns the result of a componentwise bitwise or operation on two bool3x2 matrices. + /// Left hand side bool3x2 to use to compute componentwise bitwise or. + /// Right hand side bool3x2 to use to compute componentwise bitwise or. + /// bool3x2 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator | (bool3x2 lhs, bool3x2 rhs) { return new bool3x2 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1); } + + /// Returns the result of a componentwise bitwise or operation on a bool3x2 matrix and a bool value. + /// Left hand side bool3x2 to use to compute componentwise bitwise or. + /// Right hand side bool to use to compute componentwise bitwise or. + /// bool3x2 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator | (bool3x2 lhs, bool rhs) { return new bool3x2 (lhs.c0 | rhs, lhs.c1 | rhs); } + + /// Returns the result of a componentwise bitwise or operation on a bool value and a bool3x2 matrix. + /// Left hand side bool to use to compute componentwise bitwise or. + /// Right hand side bool3x2 to use to compute componentwise bitwise or. + /// bool3x2 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator | (bool lhs, bool3x2 rhs) { return new bool3x2 (lhs | rhs.c0, lhs | rhs.c1); } + + + /// Returns the result of a componentwise bitwise exclusive or operation on two bool3x2 matrices. + /// Left hand side bool3x2 to use to compute componentwise bitwise exclusive or. + /// Right hand side bool3x2 to use to compute componentwise bitwise exclusive or. + /// bool3x2 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator ^ (bool3x2 lhs, bool3x2 rhs) { return new bool3x2 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1); } + + /// Returns the result of a componentwise bitwise exclusive or operation on a bool3x2 matrix and a bool value. + /// Left hand side bool3x2 to use to compute componentwise bitwise exclusive or. + /// Right hand side bool to use to compute componentwise bitwise exclusive or. + /// bool3x2 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator ^ (bool3x2 lhs, bool rhs) { return new bool3x2 (lhs.c0 ^ rhs, lhs.c1 ^ rhs); } + + /// Returns the result of a componentwise bitwise exclusive or operation on a bool value and a bool3x2 matrix. + /// Left hand side bool to use to compute componentwise bitwise exclusive or. + /// Right hand side bool3x2 to use to compute componentwise bitwise exclusive or. + /// bool3x2 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator ^ (bool lhs, bool3x2 rhs) { return new bool3x2 (lhs ^ rhs.c0, lhs ^ rhs.c1); } + + + + /// Returns the bool3 element at a specified index. + unsafe public ref bool3 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 2) + throw new System.ArgumentException("index must be between[0...1]"); +#endif + fixed (bool3x2* array = &this) { return ref ((bool3*)array)[index]; } + } + } + + /// Returns true if the bool3x2 is equal to a given bool3x2, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(bool3x2 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1); } + + /// Returns true if the bool3x2 is equal to a given bool3x2, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is bool3x2 converted && Equals(converted); } + + + /// Returns a hash code for the bool3x2. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the bool3x2. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("bool3x2({0}, {1}, {2}, {3}, {4}, {5})", c0.x, c1.x, c0.y, c1.y, c0.z, c1.z); + } + + } + + public static partial class math + { + /// Returns a bool3x2 matrix constructed from two bool3 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// bool3x2 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 bool3x2(bool3 c0, bool3 c1) { return new bool3x2(c0, c1); } + + /// Returns a bool3x2 matrix constructed from from 6 bool values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// bool3x2 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 bool3x2(bool m00, bool m01, + bool m10, bool m11, + bool m20, bool m21) + { + return new bool3x2(m00, m01, + m10, m11, + m20, m21); + } + + /// Returns a bool3x2 matrix constructed from a single bool value by assigning it to every component. + /// bool to convert to bool3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 bool3x2(bool v) { return new bool3x2(v); } + + /// Return the bool2x3 transpose of a bool3x2 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 transpose(bool3x2 v) + { + return bool2x3( + v.c0.x, v.c0.y, v.c0.z, + v.c1.x, v.c1.y, v.c1.z); + } + + /// Returns a uint hash code of a bool3x2 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(bool3x2 v) + { + return csum(select(uint3(0x9C9F0823u, 0x5A9CA13Bu, 0xAFCDD5EFu), uint3(0xA88D187Du, 0xCF6EBA1Du, 0x9D88E5A1u), v.c0) + + select(uint3(0xEADF0775u, 0x747A9D7Bu, 0x4111F799u), uint3(0xB5F05AF1u, 0xFD80290Bu, 0x8B65ADB7u), v.c1)); + } + + /// + /// Returns a uint3 vector hash code of a bool3x2 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint3 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 hashwide(bool3x2 v) + { + return (select(uint3(0xDFF4F563u, 0x7069770Du, 0xD1224537u), uint3(0xE99ED6F3u, 0x48125549u, 0xEEE2123Bu), v.c0) + + select(uint3(0xE3AD9FE5u, 0xCE1CF8BFu, 0x7BE39F3Bu), uint3(0xFAB9913Fu, 0xB4501269u, 0xE04B89FDu), v.c1)); + } + + } +} diff --git a/src/Unity.Mathematics/bool3x2.gen.cs.meta b/src/Unity.Mathematics/bool3x2.gen.cs.meta new file mode 100644 index 00000000..f6530626 --- /dev/null +++ b/src/Unity.Mathematics/bool3x2.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 21b83123b388e4dcb80da9576a60ebd2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/bool3x3.gen.cs b/src/Unity.Mathematics/bool3x3.gen.cs new file mode 100644 index 00000000..1ce216d7 --- /dev/null +++ b/src/Unity.Mathematics/bool3x3.gen.cs @@ -0,0 +1,315 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 3x3 matrix of bools. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct bool3x3 : System.IEquatable + { + /// Column 0 of the matrix. + public bool3 c0; + /// Column 1 of the matrix. + public bool3 c1; + /// Column 2 of the matrix. + public bool3 c2; + + + /// Constructs a bool3x3 matrix from three bool3 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool3x3(bool3 c0, bool3 c1, bool3 c2) + { + this.c0 = c0; + this.c1 = c1; + this.c2 = c2; + } + + /// Constructs a bool3x3 matrix from 9 bool values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 2, column 2 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool3x3(bool m00, bool m01, bool m02, + bool m10, bool m11, bool m12, + bool m20, bool m21, bool m22) + { + this.c0 = new bool3(m00, m10, m20); + this.c1 = new bool3(m01, m11, m21); + this.c2 = new bool3(m02, m12, m22); + } + + /// Constructs a bool3x3 matrix from a single bool value by assigning it to every component. + /// bool to convert to bool3x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool3x3(bool v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + } + + + /// Implicitly converts a single bool value to a bool3x3 matrix by assigning it to every component. + /// bool to convert to bool3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator bool3x3(bool v) { return new bool3x3(v); } + + + /// Returns the result of a componentwise equality operation on two bool3x3 matrices. + /// Left hand side bool3x3 to use to compute componentwise equality. + /// Right hand side bool3x3 to use to compute componentwise equality. + /// bool3x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator == (bool3x3 lhs, bool3x3 rhs) { return new bool3x3 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2); } + + /// Returns the result of a componentwise equality operation on a bool3x3 matrix and a bool value. + /// Left hand side bool3x3 to use to compute componentwise equality. + /// Right hand side bool to use to compute componentwise equality. + /// bool3x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator == (bool3x3 lhs, bool rhs) { return new bool3x3 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs); } + + /// Returns the result of a componentwise equality operation on a bool value and a bool3x3 matrix. + /// Left hand side bool to use to compute componentwise equality. + /// Right hand side bool3x3 to use to compute componentwise equality. + /// bool3x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator == (bool lhs, bool3x3 rhs) { return new bool3x3 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2); } + + + /// Returns the result of a componentwise not equal operation on two bool3x3 matrices. + /// Left hand side bool3x3 to use to compute componentwise not equal. + /// Right hand side bool3x3 to use to compute componentwise not equal. + /// bool3x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator != (bool3x3 lhs, bool3x3 rhs) { return new bool3x3 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2); } + + /// Returns the result of a componentwise not equal operation on a bool3x3 matrix and a bool value. + /// Left hand side bool3x3 to use to compute componentwise not equal. + /// Right hand side bool to use to compute componentwise not equal. + /// bool3x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator != (bool3x3 lhs, bool rhs) { return new bool3x3 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs); } + + /// Returns the result of a componentwise not equal operation on a bool value and a bool3x3 matrix. + /// Left hand side bool to use to compute componentwise not equal. + /// Right hand side bool3x3 to use to compute componentwise not equal. + /// bool3x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator != (bool lhs, bool3x3 rhs) { return new bool3x3 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2); } + + + /// Returns the result of a componentwise not operation on a bool3x3 matrix. + /// Value to use when computing the componentwise not. + /// bool3x3 result of the componentwise not. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator ! (bool3x3 val) { return new bool3x3 (!val.c0, !val.c1, !val.c2); } + + + /// Returns the result of a componentwise bitwise and operation on two bool3x3 matrices. + /// Left hand side bool3x3 to use to compute componentwise bitwise and. + /// Right hand side bool3x3 to use to compute componentwise bitwise and. + /// bool3x3 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator & (bool3x3 lhs, bool3x3 rhs) { return new bool3x3 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1, lhs.c2 & rhs.c2); } + + /// Returns the result of a componentwise bitwise and operation on a bool3x3 matrix and a bool value. + /// Left hand side bool3x3 to use to compute componentwise bitwise and. + /// Right hand side bool to use to compute componentwise bitwise and. + /// bool3x3 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator & (bool3x3 lhs, bool rhs) { return new bool3x3 (lhs.c0 & rhs, lhs.c1 & rhs, lhs.c2 & rhs); } + + /// Returns the result of a componentwise bitwise and operation on a bool value and a bool3x3 matrix. + /// Left hand side bool to use to compute componentwise bitwise and. + /// Right hand side bool3x3 to use to compute componentwise bitwise and. + /// bool3x3 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator & (bool lhs, bool3x3 rhs) { return new bool3x3 (lhs & rhs.c0, lhs & rhs.c1, lhs & rhs.c2); } + + + /// Returns the result of a componentwise bitwise or operation on two bool3x3 matrices. + /// Left hand side bool3x3 to use to compute componentwise bitwise or. + /// Right hand side bool3x3 to use to compute componentwise bitwise or. + /// bool3x3 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator | (bool3x3 lhs, bool3x3 rhs) { return new bool3x3 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1, lhs.c2 | rhs.c2); } + + /// Returns the result of a componentwise bitwise or operation on a bool3x3 matrix and a bool value. + /// Left hand side bool3x3 to use to compute componentwise bitwise or. + /// Right hand side bool to use to compute componentwise bitwise or. + /// bool3x3 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator | (bool3x3 lhs, bool rhs) { return new bool3x3 (lhs.c0 | rhs, lhs.c1 | rhs, lhs.c2 | rhs); } + + /// Returns the result of a componentwise bitwise or operation on a bool value and a bool3x3 matrix. + /// Left hand side bool to use to compute componentwise bitwise or. + /// Right hand side bool3x3 to use to compute componentwise bitwise or. + /// bool3x3 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator | (bool lhs, bool3x3 rhs) { return new bool3x3 (lhs | rhs.c0, lhs | rhs.c1, lhs | rhs.c2); } + + + /// Returns the result of a componentwise bitwise exclusive or operation on two bool3x3 matrices. + /// Left hand side bool3x3 to use to compute componentwise bitwise exclusive or. + /// Right hand side bool3x3 to use to compute componentwise bitwise exclusive or. + /// bool3x3 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator ^ (bool3x3 lhs, bool3x3 rhs) { return new bool3x3 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1, lhs.c2 ^ rhs.c2); } + + /// Returns the result of a componentwise bitwise exclusive or operation on a bool3x3 matrix and a bool value. + /// Left hand side bool3x3 to use to compute componentwise bitwise exclusive or. + /// Right hand side bool to use to compute componentwise bitwise exclusive or. + /// bool3x3 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator ^ (bool3x3 lhs, bool rhs) { return new bool3x3 (lhs.c0 ^ rhs, lhs.c1 ^ rhs, lhs.c2 ^ rhs); } + + /// Returns the result of a componentwise bitwise exclusive or operation on a bool value and a bool3x3 matrix. + /// Left hand side bool to use to compute componentwise bitwise exclusive or. + /// Right hand side bool3x3 to use to compute componentwise bitwise exclusive or. + /// bool3x3 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator ^ (bool lhs, bool3x3 rhs) { return new bool3x3 (lhs ^ rhs.c0, lhs ^ rhs.c1, lhs ^ rhs.c2); } + + + + /// Returns the bool3 element at a specified index. + unsafe public ref bool3 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 3) + throw new System.ArgumentException("index must be between[0...2]"); +#endif + fixed (bool3x3* array = &this) { return ref ((bool3*)array)[index]; } + } + } + + /// Returns true if the bool3x3 is equal to a given bool3x3, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(bool3x3 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2); } + + /// Returns true if the bool3x3 is equal to a given bool3x3, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is bool3x3 converted && Equals(converted); } + + + /// Returns a hash code for the bool3x3. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the bool3x3. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("bool3x3({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8})", c0.x, c1.x, c2.x, c0.y, c1.y, c2.y, c0.z, c1.z, c2.z); + } + + } + + public static partial class math + { + /// Returns a bool3x3 matrix constructed from three bool3 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// bool3x3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 bool3x3(bool3 c0, bool3 c1, bool3 c2) { return new bool3x3(c0, c1, c2); } + + /// Returns a bool3x3 matrix constructed from from 9 bool values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 2, column 2 will be set to this value. + /// bool3x3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 bool3x3(bool m00, bool m01, bool m02, + bool m10, bool m11, bool m12, + bool m20, bool m21, bool m22) + { + return new bool3x3(m00, m01, m02, + m10, m11, m12, + m20, m21, m22); + } + + /// Returns a bool3x3 matrix constructed from a single bool value by assigning it to every component. + /// bool to convert to bool3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 bool3x3(bool v) { return new bool3x3(v); } + + /// Return the bool3x3 transpose of a bool3x3 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 transpose(bool3x3 v) + { + return bool3x3( + v.c0.x, v.c0.y, v.c0.z, + v.c1.x, v.c1.y, v.c1.z, + v.c2.x, v.c2.y, v.c2.z); + } + + /// Returns a uint hash code of a bool3x3 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(bool3x3 v) + { + return csum(select(uint3(0xE7579997u, 0xEF7D56C7u, 0x66F38F0Bu), uint3(0x624256A3u, 0x5292ADE1u, 0xD2E590E5u), v.c0) + + select(uint3(0xF25BE857u, 0x9BC17CE7u, 0xC8B86851u), uint3(0x64095221u, 0xADF428FFu, 0xA3977109u), v.c1) + + select(uint3(0x745ED837u, 0x9CDC88F5u, 0xFA62D721u), uint3(0x7E4DB1CFu, 0x68EEE0F5u, 0xBC3B0A59u), v.c2)); + } + + /// + /// Returns a uint3 vector hash code of a bool3x3 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint3 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 hashwide(bool3x3 v) + { + return (select(uint3(0x816EFB5Du, 0xA24E82B7u, 0x45A22087u), uint3(0xFC104C3Bu, 0x5FFF6B19u, 0x5E6CBF3Bu), v.c0) + + select(uint3(0xB546F2A5u, 0xBBCF63E7u, 0xC53F4755u), uint3(0x6985C229u, 0xE133B0B3u, 0xC3E0A3B9u), v.c1) + + select(uint3(0xFE31134Fu, 0x712A34D7u, 0x9D77A59Bu), uint3(0x4942CA39u, 0xB40EC62Du, 0x565ED63Fu), v.c2)); + } + + } +} diff --git a/src/Unity.Mathematics/bool3x3.gen.cs.meta b/src/Unity.Mathematics/bool3x3.gen.cs.meta new file mode 100644 index 00000000..b9ae856f --- /dev/null +++ b/src/Unity.Mathematics/bool3x3.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a3b4b734e76c94d5099484b5b6c5b029 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/bool3x4.gen.cs b/src/Unity.Mathematics/bool3x4.gen.cs new file mode 100644 index 00000000..f93f07f4 --- /dev/null +++ b/src/Unity.Mathematics/bool3x4.gen.cs @@ -0,0 +1,331 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 3x4 matrix of bools. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct bool3x4 : System.IEquatable + { + /// Column 0 of the matrix. + public bool3 c0; + /// Column 1 of the matrix. + public bool3 c1; + /// Column 2 of the matrix. + public bool3 c2; + /// Column 3 of the matrix. + public bool3 c3; + + + /// Constructs a bool3x4 matrix from four bool3 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// The matrix column c3 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool3x4(bool3 c0, bool3 c1, bool3 c2, bool3 c3) + { + this.c0 = c0; + this.c1 = c1; + this.c2 = c2; + this.c3 = c3; + } + + /// Constructs a bool3x4 matrix from 12 bool values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 0, column 3 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 1, column 3 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 2, column 2 will be set to this value. + /// The matrix at row 2, column 3 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool3x4(bool m00, bool m01, bool m02, bool m03, + bool m10, bool m11, bool m12, bool m13, + bool m20, bool m21, bool m22, bool m23) + { + this.c0 = new bool3(m00, m10, m20); + this.c1 = new bool3(m01, m11, m21); + this.c2 = new bool3(m02, m12, m22); + this.c3 = new bool3(m03, m13, m23); + } + + /// Constructs a bool3x4 matrix from a single bool value by assigning it to every component. + /// bool to convert to bool3x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool3x4(bool v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + this.c3 = v; + } + + + /// Implicitly converts a single bool value to a bool3x4 matrix by assigning it to every component. + /// bool to convert to bool3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator bool3x4(bool v) { return new bool3x4(v); } + + + /// Returns the result of a componentwise equality operation on two bool3x4 matrices. + /// Left hand side bool3x4 to use to compute componentwise equality. + /// Right hand side bool3x4 to use to compute componentwise equality. + /// bool3x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator == (bool3x4 lhs, bool3x4 rhs) { return new bool3x4 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2, lhs.c3 == rhs.c3); } + + /// Returns the result of a componentwise equality operation on a bool3x4 matrix and a bool value. + /// Left hand side bool3x4 to use to compute componentwise equality. + /// Right hand side bool to use to compute componentwise equality. + /// bool3x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator == (bool3x4 lhs, bool rhs) { return new bool3x4 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs, lhs.c3 == rhs); } + + /// Returns the result of a componentwise equality operation on a bool value and a bool3x4 matrix. + /// Left hand side bool to use to compute componentwise equality. + /// Right hand side bool3x4 to use to compute componentwise equality. + /// bool3x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator == (bool lhs, bool3x4 rhs) { return new bool3x4 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2, lhs == rhs.c3); } + + + /// Returns the result of a componentwise not equal operation on two bool3x4 matrices. + /// Left hand side bool3x4 to use to compute componentwise not equal. + /// Right hand side bool3x4 to use to compute componentwise not equal. + /// bool3x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator != (bool3x4 lhs, bool3x4 rhs) { return new bool3x4 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2, lhs.c3 != rhs.c3); } + + /// Returns the result of a componentwise not equal operation on a bool3x4 matrix and a bool value. + /// Left hand side bool3x4 to use to compute componentwise not equal. + /// Right hand side bool to use to compute componentwise not equal. + /// bool3x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator != (bool3x4 lhs, bool rhs) { return new bool3x4 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs, lhs.c3 != rhs); } + + /// Returns the result of a componentwise not equal operation on a bool value and a bool3x4 matrix. + /// Left hand side bool to use to compute componentwise not equal. + /// Right hand side bool3x4 to use to compute componentwise not equal. + /// bool3x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator != (bool lhs, bool3x4 rhs) { return new bool3x4 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2, lhs != rhs.c3); } + + + /// Returns the result of a componentwise not operation on a bool3x4 matrix. + /// Value to use when computing the componentwise not. + /// bool3x4 result of the componentwise not. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator ! (bool3x4 val) { return new bool3x4 (!val.c0, !val.c1, !val.c2, !val.c3); } + + + /// Returns the result of a componentwise bitwise and operation on two bool3x4 matrices. + /// Left hand side bool3x4 to use to compute componentwise bitwise and. + /// Right hand side bool3x4 to use to compute componentwise bitwise and. + /// bool3x4 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator & (bool3x4 lhs, bool3x4 rhs) { return new bool3x4 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1, lhs.c2 & rhs.c2, lhs.c3 & rhs.c3); } + + /// Returns the result of a componentwise bitwise and operation on a bool3x4 matrix and a bool value. + /// Left hand side bool3x4 to use to compute componentwise bitwise and. + /// Right hand side bool to use to compute componentwise bitwise and. + /// bool3x4 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator & (bool3x4 lhs, bool rhs) { return new bool3x4 (lhs.c0 & rhs, lhs.c1 & rhs, lhs.c2 & rhs, lhs.c3 & rhs); } + + /// Returns the result of a componentwise bitwise and operation on a bool value and a bool3x4 matrix. + /// Left hand side bool to use to compute componentwise bitwise and. + /// Right hand side bool3x4 to use to compute componentwise bitwise and. + /// bool3x4 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator & (bool lhs, bool3x4 rhs) { return new bool3x4 (lhs & rhs.c0, lhs & rhs.c1, lhs & rhs.c2, lhs & rhs.c3); } + + + /// Returns the result of a componentwise bitwise or operation on two bool3x4 matrices. + /// Left hand side bool3x4 to use to compute componentwise bitwise or. + /// Right hand side bool3x4 to use to compute componentwise bitwise or. + /// bool3x4 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator | (bool3x4 lhs, bool3x4 rhs) { return new bool3x4 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1, lhs.c2 | rhs.c2, lhs.c3 | rhs.c3); } + + /// Returns the result of a componentwise bitwise or operation on a bool3x4 matrix and a bool value. + /// Left hand side bool3x4 to use to compute componentwise bitwise or. + /// Right hand side bool to use to compute componentwise bitwise or. + /// bool3x4 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator | (bool3x4 lhs, bool rhs) { return new bool3x4 (lhs.c0 | rhs, lhs.c1 | rhs, lhs.c2 | rhs, lhs.c3 | rhs); } + + /// Returns the result of a componentwise bitwise or operation on a bool value and a bool3x4 matrix. + /// Left hand side bool to use to compute componentwise bitwise or. + /// Right hand side bool3x4 to use to compute componentwise bitwise or. + /// bool3x4 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator | (bool lhs, bool3x4 rhs) { return new bool3x4 (lhs | rhs.c0, lhs | rhs.c1, lhs | rhs.c2, lhs | rhs.c3); } + + + /// Returns the result of a componentwise bitwise exclusive or operation on two bool3x4 matrices. + /// Left hand side bool3x4 to use to compute componentwise bitwise exclusive or. + /// Right hand side bool3x4 to use to compute componentwise bitwise exclusive or. + /// bool3x4 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator ^ (bool3x4 lhs, bool3x4 rhs) { return new bool3x4 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1, lhs.c2 ^ rhs.c2, lhs.c3 ^ rhs.c3); } + + /// Returns the result of a componentwise bitwise exclusive or operation on a bool3x4 matrix and a bool value. + /// Left hand side bool3x4 to use to compute componentwise bitwise exclusive or. + /// Right hand side bool to use to compute componentwise bitwise exclusive or. + /// bool3x4 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator ^ (bool3x4 lhs, bool rhs) { return new bool3x4 (lhs.c0 ^ rhs, lhs.c1 ^ rhs, lhs.c2 ^ rhs, lhs.c3 ^ rhs); } + + /// Returns the result of a componentwise bitwise exclusive or operation on a bool value and a bool3x4 matrix. + /// Left hand side bool to use to compute componentwise bitwise exclusive or. + /// Right hand side bool3x4 to use to compute componentwise bitwise exclusive or. + /// bool3x4 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator ^ (bool lhs, bool3x4 rhs) { return new bool3x4 (lhs ^ rhs.c0, lhs ^ rhs.c1, lhs ^ rhs.c2, lhs ^ rhs.c3); } + + + + /// Returns the bool3 element at a specified index. + unsafe public ref bool3 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 4) + throw new System.ArgumentException("index must be between[0...3]"); +#endif + fixed (bool3x4* array = &this) { return ref ((bool3*)array)[index]; } + } + } + + /// Returns true if the bool3x4 is equal to a given bool3x4, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(bool3x4 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2) && c3.Equals(rhs.c3); } + + /// Returns true if the bool3x4 is equal to a given bool3x4, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is bool3x4 converted && Equals(converted); } + + + /// Returns a hash code for the bool3x4. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the bool3x4. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("bool3x4({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11})", c0.x, c1.x, c2.x, c3.x, c0.y, c1.y, c2.y, c3.y, c0.z, c1.z, c2.z, c3.z); + } + + } + + public static partial class math + { + /// Returns a bool3x4 matrix constructed from four bool3 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// The matrix column c3 will be set to this value. + /// bool3x4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 bool3x4(bool3 c0, bool3 c1, bool3 c2, bool3 c3) { return new bool3x4(c0, c1, c2, c3); } + + /// Returns a bool3x4 matrix constructed from from 12 bool values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 0, column 3 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 1, column 3 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 2, column 2 will be set to this value. + /// The matrix at row 2, column 3 will be set to this value. + /// bool3x4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 bool3x4(bool m00, bool m01, bool m02, bool m03, + bool m10, bool m11, bool m12, bool m13, + bool m20, bool m21, bool m22, bool m23) + { + return new bool3x4(m00, m01, m02, m03, + m10, m11, m12, m13, + m20, m21, m22, m23); + } + + /// Returns a bool3x4 matrix constructed from a single bool value by assigning it to every component. + /// bool to convert to bool3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 bool3x4(bool v) { return new bool3x4(v); } + + /// Return the bool4x3 transpose of a bool3x4 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 transpose(bool3x4 v) + { + return bool4x3( + v.c0.x, v.c0.y, v.c0.z, + v.c1.x, v.c1.y, v.c1.z, + v.c2.x, v.c2.y, v.c2.z, + v.c3.x, v.c3.y, v.c3.z); + } + + /// Returns a uint hash code of a bool3x4 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(bool3x4 v) + { + return csum(select(uint3(0x83B58237u, 0x833E3E29u, 0xA9D919BFu), uint3(0xC3EC1D97u, 0xB8B208C7u, 0x5D3ED947u), v.c0) + + select(uint3(0x4473BBB1u, 0xCBA11D5Fu, 0x685835CFu), uint3(0xC3D32AE1u, 0xB966942Fu, 0xFE9856B3u), v.c1) + + select(uint3(0xFA3A3285u, 0xAD55999Du, 0xDCDD5341u), uint3(0x94DDD769u, 0xA1E92D39u, 0x4583C801u), v.c2) + + select(uint3(0x9536A0F5u, 0xAF816615u, 0x9AF8D62Du), uint3(0xE3600729u, 0x5F17300Du, 0x670D6809u), v.c3)); + } + + /// + /// Returns a uint3 vector hash code of a bool3x4 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint3 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 hashwide(bool3x4 v) + { + return (select(uint3(0x7AF32C49u, 0xAE131389u, 0x5D1B165Bu), uint3(0x87096CD7u, 0x4C7F6DD1u, 0x4822A3E9u), v.c0) + + select(uint3(0xAAC3C25Du, 0xD21D0945u, 0x88FCAB2Du), uint3(0x614DA60Du, 0x5BA2C50Bu, 0x8C455ACBu), v.c1) + + select(uint3(0xCD266C89u, 0xF1852A33u, 0x77E35E77u), uint3(0x863E3729u, 0xE191B035u, 0x68586FAFu), v.c2) + + select(uint3(0xD4DFF6D3u, 0xCB634F4Du, 0x9B13B92Du), uint3(0x4ABF0813u, 0x86068063u, 0xD75513F9u), v.c3)); + } + + } +} diff --git a/src/Unity.Mathematics/bool3x4.gen.cs.meta b/src/Unity.Mathematics/bool3x4.gen.cs.meta new file mode 100644 index 00000000..e70cf5b9 --- /dev/null +++ b/src/Unity.Mathematics/bool3x4.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 82510cd108c8a4a7ebe40f0cec12d18c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/bool4.cs b/src/Unity.Mathematics/bool4.cs deleted file mode 100644 index 6fcfc21b..00000000 --- a/src/Unity.Mathematics/bool4.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System.Runtime.CompilerServices; -using System.Diagnostics; - -#pragma warning disable 0660, 0661 - -namespace Unity.Mathematics -{ - [DebuggerTypeProxy(typeof(bool4.DebuggerProxy))] - public partial struct bool4 - { - internal sealed class DebuggerProxy - { - public bool x; - public bool y; - public bool z; - public bool w; - - public DebuggerProxy(bool4 vec) - { - x = vec.x; - y = vec.y; - z = vec.z; - w = vec.z; - } - } - - public bool1 x; - public bool1 y; - public bool1 z; - public bool1 w; - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public bool4(bool x, bool y, bool z, bool w) - { - this.x = x; - this.y = y; - this.z = z; - this.w = w; - } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public bool4(bool val) - { - x = y = z = w = val; - } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public bool4(bool3 xyz, bool w) - { - x = xyz.x; y = xyz.y; z = xyz.z; this.w = w; - } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static implicit operator bool4(bool d) - { - return new bool4(d); - } - - public override string ToString() - { - return string.Format("bool4({0}, {1}, {2}, {3})", x, y, z, w); - } - } -} - diff --git a/src/Unity.Mathematics/bool4.cs.meta b/src/Unity.Mathematics/bool4.cs.meta deleted file mode 100644 index 9019cf56..00000000 --- a/src/Unity.Mathematics/bool4.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: acee578729bca9347885aab5b4c8a63d -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/src/Unity.Mathematics/bool4.gen.cs b/src/Unity.Mathematics/bool4.gen.cs index 79b9fac7..b19f367c 100644 --- a/src/Unity.Mathematics/bool4.gen.cs +++ b/src/Unity.Mathematics/bool4.gen.cs @@ -1,2882 +1,3662 @@ -// GENERATED CODE +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Diagnostics; +using Unity.IL2CPP.CompilerServices; + #pragma warning disable 0660, 0661 + namespace Unity.Mathematics { + /// A 4 component vector of bools. + [DebuggerTypeProxy(typeof(bool4.DebuggerProxy))] + [System.Serializable] + [Il2CppEagerStaticClassConstruction] public partial struct bool4 : System.IEquatable { + /// x component of the vector. + [MarshalAs(UnmanagedType.U1)] + public bool x; + /// y component of the vector. + [MarshalAs(UnmanagedType.U1)] + public bool y; + /// z component of the vector. + [MarshalAs(UnmanagedType.U1)] + public bool z; + /// w component of the vector. + [MarshalAs(UnmanagedType.U1)] + public bool w; + + + /// Constructs a bool4 vector from four bool values. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + /// The constructed vector's z component will be set to this value. + /// The constructed vector's w component will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool4(bool x, bool y, bool z, bool w) + { + this.x = x; + this.y = y; + this.z = z; + this.w = w; + } + + /// Constructs a bool4 vector from two bool values and a bool2 vector. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + /// The constructed vector's zw components will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool4(bool x, bool y, bool2 zw) + { + this.x = x; + this.y = y; + this.z = zw.x; + this.w = zw.y; + } + + /// Constructs a bool4 vector from a bool value, a bool2 vector and a bool value. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's yz components will be set to this value. + /// The constructed vector's w component will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool4(bool x, bool2 yz, bool w) + { + this.x = x; + this.y = yz.x; + this.z = yz.y; + this.w = w; + } + + /// Constructs a bool4 vector from a bool value and a bool3 vector. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's yzw components will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool4(bool x, bool3 yzw) + { + this.x = x; + this.y = yzw.x; + this.z = yzw.y; + this.w = yzw.z; + } + + /// Constructs a bool4 vector from a bool2 vector and two bool values. + /// The constructed vector's xy components will be set to this value. + /// The constructed vector's z component will be set to this value. + /// The constructed vector's w component will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool4(bool2 xy, bool z, bool w) + { + this.x = xy.x; + this.y = xy.y; + this.z = z; + this.w = w; + } + + /// Constructs a bool4 vector from two bool2 vectors. + /// The constructed vector's xy components will be set to this value. + /// The constructed vector's zw components will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool4(bool2 xy, bool2 zw) + { + this.x = xy.x; + this.y = xy.y; + this.z = zw.x; + this.w = zw.y; + } + + /// Constructs a bool4 vector from a bool3 vector and a bool value. + /// The constructed vector's xyz components will be set to this value. + /// The constructed vector's w component will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool4(bool3 xyz, bool w) + { + this.x = xyz.x; + this.y = xyz.y; + this.z = xyz.z; + this.w = w; + } + + /// Constructs a bool4 vector from a bool4 vector. + /// The constructed vector's xyzw components will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool4(bool4 xyzw) + { + this.x = xyzw.x; + this.y = xyzw.y; + this.z = xyzw.z; + this.w = xyzw.w; + } - // equal - [MethodImpl(0x100)] + /// Constructs a bool4 vector from a single bool value by assigning it to every component. + /// bool to convert to bool4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool4(bool v) + { + this.x = v; + this.y = v; + this.z = v; + this.w = v; + } + + + /// Implicitly converts a single bool value to a bool4 vector by assigning it to every component. + /// bool to convert to bool4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator bool4(bool v) { return new bool4(v); } + + + /// Returns the result of a componentwise equality operation on two bool4 vectors. + /// Left hand side bool4 to use to compute componentwise equality. + /// Right hand side bool4 to use to compute componentwise equality. + /// bool4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator == (bool4 lhs, bool4 rhs) { return new bool4 (lhs.x == rhs.x, lhs.y == rhs.y, lhs.z == rhs.z, lhs.w == rhs.w); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise equality operation on a bool4 vector and a bool value. + /// Left hand side bool4 to use to compute componentwise equality. + /// Right hand side bool to use to compute componentwise equality. + /// bool4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator == (bool4 lhs, bool rhs) { return new bool4 (lhs.x == rhs, lhs.y == rhs, lhs.z == rhs, lhs.w == rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise equality operation on a bool value and a bool4 vector. + /// Left hand side bool to use to compute componentwise equality. + /// Right hand side bool4 to use to compute componentwise equality. + /// bool4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator == (bool lhs, bool4 rhs) { return new bool4 (lhs == rhs.x, lhs == rhs.y, lhs == rhs.z, lhs == rhs.w); } - // not equal - [MethodImpl(0x100)] + + /// Returns the result of a componentwise not equal operation on two bool4 vectors. + /// Left hand side bool4 to use to compute componentwise not equal. + /// Right hand side bool4 to use to compute componentwise not equal. + /// bool4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator != (bool4 lhs, bool4 rhs) { return new bool4 (lhs.x != rhs.x, lhs.y != rhs.y, lhs.z != rhs.z, lhs.w != rhs.w); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise not equal operation on a bool4 vector and a bool value. + /// Left hand side bool4 to use to compute componentwise not equal. + /// Right hand side bool to use to compute componentwise not equal. + /// bool4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator != (bool4 lhs, bool rhs) { return new bool4 (lhs.x != rhs, lhs.y != rhs, lhs.z != rhs, lhs.w != rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise not equal operation on a bool value and a bool4 vector. + /// Left hand side bool to use to compute componentwise not equal. + /// Right hand side bool4 to use to compute componentwise not equal. + /// bool4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator != (bool lhs, bool4 rhs) { return new bool4 (lhs != rhs.x, lhs != rhs.y, lhs != rhs.z, lhs != rhs.w); } - // Equals - [MethodImpl(0x100)] - public bool Equals(bool4 rhs) { return x == rhs.x && y == rhs.y && z == rhs.z && w == rhs.w; } - // [int index] - unsafe public bool1 this[int index] - { - get - { -#if ENABLE_UNITY_COLLECTIONS_CHECKS - if ((uint)index >= 4) - throw new System.ArgumentException("index must be between[0...3]"); -#endif - fixed (bool1* array = &x) { return array[index]; } - } - set - { -#if ENABLE_UNITY_COLLECTIONS_CHECKS - if ((uint)index >= 4) - throw new System.ArgumentException("index must be between[0...3]"); -#endif - fixed (bool1* array = &x) { array[index] = value; } - } - } + /// Returns the result of a componentwise not operation on a bool4 vector. + /// Value to use when computing the componentwise not. + /// bool4 result of the componentwise not. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 operator ! (bool4 val) { return new bool4 (!val.x, !val.y, !val.z, !val.w); } - // operator & - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise and operation on two bool4 vectors. + /// Left hand side bool4 to use to compute componentwise bitwise and. + /// Right hand side bool4 to use to compute componentwise bitwise and. + /// bool4 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator & (bool4 lhs, bool4 rhs) { return new bool4 (lhs.x & rhs.x, lhs.y & rhs.y, lhs.z & rhs.z, lhs.w & rhs.w); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise and operation on a bool4 vector and a bool value. + /// Left hand side bool4 to use to compute componentwise bitwise and. + /// Right hand side bool to use to compute componentwise bitwise and. + /// bool4 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator & (bool4 lhs, bool rhs) { return new bool4 (lhs.x & rhs, lhs.y & rhs, lhs.z & rhs, lhs.w & rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise and operation on a bool value and a bool4 vector. + /// Left hand side bool to use to compute componentwise bitwise and. + /// Right hand side bool4 to use to compute componentwise bitwise and. + /// bool4 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator & (bool lhs, bool4 rhs) { return new bool4 (lhs & rhs.x, lhs & rhs.y, lhs & rhs.z, lhs & rhs.w); } - // operator | - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise or operation on two bool4 vectors. + /// Left hand side bool4 to use to compute componentwise bitwise or. + /// Right hand side bool4 to use to compute componentwise bitwise or. + /// bool4 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator | (bool4 lhs, bool4 rhs) { return new bool4 (lhs.x | rhs.x, lhs.y | rhs.y, lhs.z | rhs.z, lhs.w | rhs.w); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise or operation on a bool4 vector and a bool value. + /// Left hand side bool4 to use to compute componentwise bitwise or. + /// Right hand side bool to use to compute componentwise bitwise or. + /// bool4 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator | (bool4 lhs, bool rhs) { return new bool4 (lhs.x | rhs, lhs.y | rhs, lhs.z | rhs, lhs.w | rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise or operation on a bool value and a bool4 vector. + /// Left hand side bool to use to compute componentwise bitwise or. + /// Right hand side bool4 to use to compute componentwise bitwise or. + /// bool4 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator | (bool lhs, bool4 rhs) { return new bool4 (lhs | rhs.x, lhs | rhs.y, lhs | rhs.z, lhs | rhs.w); } - // operator ^ - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise exclusive or operation on two bool4 vectors. + /// Left hand side bool4 to use to compute componentwise bitwise exclusive or. + /// Right hand side bool4 to use to compute componentwise bitwise exclusive or. + /// bool4 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator ^ (bool4 lhs, bool4 rhs) { return new bool4 (lhs.x ^ rhs.x, lhs.y ^ rhs.y, lhs.z ^ rhs.z, lhs.w ^ rhs.w); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise exclusive or operation on a bool4 vector and a bool value. + /// Left hand side bool4 to use to compute componentwise bitwise exclusive or. + /// Right hand side bool to use to compute componentwise bitwise exclusive or. + /// bool4 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator ^ (bool4 lhs, bool rhs) { return new bool4 (lhs.x ^ rhs, lhs.y ^ rhs, lhs.z ^ rhs, lhs.w ^ rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise exclusive or operation on a bool value and a bool4 vector. + /// Left hand side bool to use to compute componentwise bitwise exclusive or. + /// Right hand side bool4 to use to compute componentwise bitwise exclusive or. + /// bool4 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator ^ (bool lhs, bool4 rhs) { return new bool4 (lhs ^ rhs.x, lhs ^ rhs.y, lhs ^ rhs.z, lhs ^ rhs.w); } + + + + + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xxxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xxxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xxxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, x, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xxxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, x, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xxyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xxyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xxyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, x, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xxyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, x, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xxzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, x, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xxzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, x, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xxzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, x, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xxzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, x, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xxwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, x, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xxwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, x, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xxwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, x, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xxww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, x, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xyxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xyxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xyxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, y, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xyxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, y, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xyyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xyyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xyyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, y, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xyyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, y, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xyzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, y, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xyzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, y, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xyzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, y, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xyzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, y, z, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; y = value.y; z = value.z; w = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xywx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, y, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xywy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, y, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xywz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, y, w, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; y = value.y; w = value.z; z = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xyww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, y, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xzxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, z, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xzxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, z, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xzxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, z, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xzxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, z, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xzyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, z, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xzyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, z, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xzyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, z, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xzyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, z, y, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; z = value.y; y = value.z; w = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xzzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, z, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xzzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, z, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xzzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, z, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xzzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, z, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xzwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, z, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xzwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, z, w, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; z = value.y; w = value.z; y = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xzwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, z, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xzww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, z, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xwxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, w, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xwxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, w, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xwxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, w, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xwxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, w, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xwyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, w, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xwyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, w, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xwyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, w, y, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; w = value.y; y = value.z; z = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xwyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, w, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xwzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, w, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xwzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, w, z, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; w = value.y; z = value.z; y = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xwzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, w, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xwzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, w, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xwwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, w, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xwwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, w, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xwwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, w, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 xwww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(x, w, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yxxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yxxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yxxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, x, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yxxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, x, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yxyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yxyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yxyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, x, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yxyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, x, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yxzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, x, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yxzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, x, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yxzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, x, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yxzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, x, z, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; x = value.y; z = value.z; w = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yxwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, x, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yxwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, x, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yxwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, x, w, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; x = value.y; w = value.z; z = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yxww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, x, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yyxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yyxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yyxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, y, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yyxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, y, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yyyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yyyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yyyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, y, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yyyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, y, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yyzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, y, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yyzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, y, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yyzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, y, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yyzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, y, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yywx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, y, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yywy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, y, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yywz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, y, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yyww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, y, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yzxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, z, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yzxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, z, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yzxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, z, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yzxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, z, x, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; z = value.y; x = value.z; w = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yzyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, z, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yzyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, z, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yzyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, z, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yzyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, z, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yzzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, z, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yzzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, z, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yzzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, z, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yzzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, z, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yzwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, z, w, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; z = value.y; w = value.z; x = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yzwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, z, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yzwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, z, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 yzww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, z, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 ywxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, w, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 ywxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, w, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 ywxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, w, x, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; w = value.y; x = value.z; z = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 ywxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, w, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 ywyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, w, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 ywyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, w, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 ywyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, w, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 ywyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, w, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 ywzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, w, z, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; w = value.y; z = value.z; x = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 ywzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, w, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 ywzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, w, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 ywzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, w, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 ywwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, w, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 ywwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, w, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 ywwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, w, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 ywww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(y, w, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zxxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zxxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zxxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, x, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zxxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, x, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zxyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zxyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zxyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, x, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zxyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, x, y, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; x = value.y; y = value.z; w = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zxzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, x, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zxzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, x, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zxzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, x, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zxzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, x, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zxwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, x, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zxwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, x, w, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; x = value.y; w = value.z; y = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zxwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, x, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zxww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, x, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zyxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zyxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zyxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, y, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zyxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, y, x, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; y = value.y; x = value.z; w = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zyyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zyyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zyyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, y, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zyyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, y, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zyzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, y, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zyzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, y, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zyzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, y, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zyzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, y, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zywx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, y, w, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; y = value.y; w = value.z; x = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zywy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, y, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zywz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, y, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zyww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, y, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zzxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, z, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zzxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, z, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zzxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, z, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zzxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, z, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zzyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, z, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zzyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, z, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zzyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, z, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zzyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, z, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zzzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, z, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zzzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, z, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zzzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, z, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zzzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, z, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zzwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, z, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zzwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, z, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zzwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, z, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zzww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, z, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zwxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, w, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zwxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, w, x, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; w = value.y; x = value.z; y = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zwxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, w, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zwxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, w, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zwyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, w, y, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; w = value.y; y = value.z; x = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zwyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, w, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zwyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, w, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zwyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, w, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zwzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, w, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zwzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, w, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zwzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, w, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zwzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, w, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zwwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, w, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zwwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, w, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zwwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, w, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 zwww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(z, w, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wxxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wxxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wxxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, x, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wxxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, x, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wxyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wxyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wxyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, x, y, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; x = value.y; y = value.z; z = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wxyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, x, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wxzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, x, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wxzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, x, z, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; x = value.y; z = value.z; y = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wxzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, x, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wxzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, x, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wxwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, x, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wxwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, x, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wxwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, x, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wxww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, x, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wyxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wyxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wyxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, y, x, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; y = value.y; x = value.z; z = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wyxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, y, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wyyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wyyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wyyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, y, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wyyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, y, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wyzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, y, z, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; y = value.y; z = value.z; x = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wyzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, y, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wyzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, y, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wyzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, y, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wywx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, y, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wywy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, y, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wywz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, y, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wyww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, y, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wzxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, z, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wzxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, z, x, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; z = value.y; x = value.z; y = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wzxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, z, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wzxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, z, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wzyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, z, y, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; z = value.y; y = value.z; x = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wzyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, z, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wzyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, z, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wzyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, z, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wzzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, z, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wzzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, z, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wzzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, z, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wzzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, z, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wzwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, z, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wzwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, z, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wzwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, z, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wzww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, z, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wwxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, w, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wwxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, w, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wwxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, w, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wwxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, w, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wwyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, w, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wwyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, w, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wwyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, w, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wwyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, w, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wwzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, w, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wwzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, w, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wwzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, w, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wwzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, w, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wwwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, w, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wwwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, w, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wwwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, w, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool4 wwww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool4(w, w, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 xxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 xxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 xxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(x, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 xxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(x, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 xyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 xyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 xyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(x, y, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; y = value.y; z = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 xyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(x, y, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; y = value.y; w = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 xzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(x, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 xzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(x, z, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; z = value.y; y = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 xzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(x, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 xzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(x, z, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; z = value.y; w = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 xwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(x, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 xwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(x, w, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; w = value.y; y = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 xwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(x, w, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; w = value.y; z = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 xww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(x, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 yxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 yxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 yxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(y, x, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; x = value.y; z = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 yxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(y, x, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; x = value.y; w = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 yyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 yyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 yyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(y, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 yyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(y, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 yzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(y, z, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; z = value.y; x = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 yzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(y, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 yzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(y, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 yzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(y, z, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; z = value.y; w = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 ywx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(y, w, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; w = value.y; x = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 ywy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(y, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 ywz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(y, w, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; w = value.y; z = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 yww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(y, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 zxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(z, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 zxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(z, x, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; x = value.y; y = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 zxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(z, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 zxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(z, x, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; x = value.y; w = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 zyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(z, y, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; y = value.y; x = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 zyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(z, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 zyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(z, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 zyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(z, y, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; y = value.y; w = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 zzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(z, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 zzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(z, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 zzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(z, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 zzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(z, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 zwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(z, w, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; w = value.y; x = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 zwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(z, w, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; w = value.y; y = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 zwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(z, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 zww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(z, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 wxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(w, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 wxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(w, x, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; x = value.y; y = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 wxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(w, x, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; x = value.y; z = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 wxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(w, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 wyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(w, y, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; y = value.y; x = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 wyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(w, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 wyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(w, y, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; y = value.y; z = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 wyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(w, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 wzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(w, z, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; z = value.y; x = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 wzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(w, z, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; z = value.y; y = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 wzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(w, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 wzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(w, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 wwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(w, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 wwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(w, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 wwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(w, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool3 www { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool3(w, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool2 xx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool2(x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool2 xy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool2(x, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; y = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool2 xz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool2(x, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; z = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool2 xw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool2(x, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; w = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool2 yx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool2(y, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; x = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool2 yy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool2(y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool2 yz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool2(y, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; z = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool2 yw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool2(y, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; w = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool2 zx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool2(z, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; x = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool2 zy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool2(z, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; y = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool2 zz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool2(z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool2 zw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool2(z, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; w = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool2 wx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool2(w, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; x = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool2 wy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool2(w, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; y = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool2 wz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool2(w, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; z = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public bool2 ww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new bool2(w, w); } } + + /// Returns the bool element at a specified index. + unsafe public bool this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 4) + throw new System.ArgumentException("index must be between[0...3]"); +#endif + fixed (bool4* array = &this) { return ((bool*)array)[index]; } + } + set + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 4) + throw new System.ArgumentException("index must be between[0...3]"); +#endif + fixed (bool* array = &x) { array[index] = value; } + } + } + + /// Returns true if the bool4 is equal to a given bool4, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(bool4 rhs) { return x == rhs.x && y == rhs.y && z == rhs.z && w == rhs.w; } + + /// Returns true if the bool4 is equal to a given bool4, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is bool4 converted && Equals(converted); } + + + /// Returns a hash code for the bool4. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the bool4. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("bool4({0}, {1}, {2}, {3})", x, y, z, w); + } + + internal sealed class DebuggerProxy + { + public bool x; + public bool y; + public bool z; + public bool w; + public DebuggerProxy(bool4 v) + { + x = v.x; + y = v.y; + z = v.z; + w = v.w; + } + } + + } + + public static partial class math + { + /// Returns a bool4 vector constructed from four bool values. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + /// The constructed vector's z component will be set to this value. + /// The constructed vector's w component will be set to this value. + /// bool4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 bool4(bool x, bool y, bool z, bool w) { return new bool4(x, y, z, w); } + + /// Returns a bool4 vector constructed from two bool values and a bool2 vector. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + /// The constructed vector's zw components will be set to this value. + /// bool4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 bool4(bool x, bool y, bool2 zw) { return new bool4(x, y, zw); } + + /// Returns a bool4 vector constructed from a bool value, a bool2 vector and a bool value. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's yz components will be set to this value. + /// The constructed vector's w component will be set to this value. + /// bool4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 bool4(bool x, bool2 yz, bool w) { return new bool4(x, yz, w); } + + /// Returns a bool4 vector constructed from a bool value and a bool3 vector. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's yzw components will be set to this value. + /// bool4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 bool4(bool x, bool3 yzw) { return new bool4(x, yzw); } + + /// Returns a bool4 vector constructed from a bool2 vector and two bool values. + /// The constructed vector's xy components will be set to this value. + /// The constructed vector's z component will be set to this value. + /// The constructed vector's w component will be set to this value. + /// bool4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 bool4(bool2 xy, bool z, bool w) { return new bool4(xy, z, w); } + + /// Returns a bool4 vector constructed from two bool2 vectors. + /// The constructed vector's xy components will be set to this value. + /// The constructed vector's zw components will be set to this value. + /// bool4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 bool4(bool2 xy, bool2 zw) { return new bool4(xy, zw); } + + /// Returns a bool4 vector constructed from a bool3 vector and a bool value. + /// The constructed vector's xyz components will be set to this value. + /// The constructed vector's w component will be set to this value. + /// bool4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 bool4(bool3 xyz, bool w) { return new bool4(xyz, w); } + + /// Returns a bool4 vector constructed from a bool4 vector. + /// The constructed vector's xyzw components will be set to this value. + /// bool4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 bool4(bool4 xyzw) { return new bool4(xyzw); } + + /// Returns a bool4 vector constructed from a single bool value by assigning it to every component. + /// bool to convert to bool4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 bool4(bool v) { return new bool4(v); } + + /// Returns a uint hash code of a bool4 vector. + /// Vector value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(bool4 v) + { + return csum(select(uint4(0x5FFF6B19u, 0x5E6CBF3Bu, 0xB546F2A5u, 0xBBCF63E7u), uint4(0xC53F4755u, 0x6985C229u, 0xE133B0B3u, 0xC3E0A3B9u), v)); + } + + /// + /// Returns a uint4 vector hash code of a bool4 vector. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Vector value to hash. + /// uint4 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 hashwide(bool4 v) + { + return (select(uint4(0xFE31134Fu, 0x712A34D7u, 0x9D77A59Bu, 0x4942CA39u), uint4(0xB40EC62Du, 0x565ED63Fu, 0x93C30C2Bu, 0xDCAF0351u), v)); + } + + /// Returns the result of specified shuffling of the components from two bool4 vectors into a bool value. + /// bool4 to use as the left argument of the shuffle operation. + /// bool4 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting bool. + /// bool result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool shuffle(bool4 left, bool4 right, ShuffleComponent x) + { + return select_shuffle_component(left, right, x); + } + + /// Returns the result of specified shuffling of the components from two bool4 vectors into a bool2 vector. + /// bool4 to use as the left argument of the shuffle operation. + /// bool4 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting bool2 x component. + /// The ShuffleComponent to use when setting the resulting bool2 y component. + /// bool2 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2 shuffle(bool4 left, bool4 right, ShuffleComponent x, ShuffleComponent y) + { + return bool2( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y)); + } + + /// Returns the result of specified shuffling of the components from two bool4 vectors into a bool3 vector. + /// bool4 to use as the left argument of the shuffle operation. + /// bool4 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting bool3 x component. + /// The ShuffleComponent to use when setting the resulting bool3 y component. + /// The ShuffleComponent to use when setting the resulting bool3 z component. + /// bool3 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3 shuffle(bool4 left, bool4 right, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z) + { + return bool3( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y), + select_shuffle_component(left, right, z)); + } + + /// Returns the result of specified shuffling of the components from two bool4 vectors into a bool4 vector. + /// bool4 to use as the left argument of the shuffle operation. + /// bool4 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting bool4 x component. + /// The ShuffleComponent to use when setting the resulting bool4 y component. + /// The ShuffleComponent to use when setting the resulting bool4 z component. + /// The ShuffleComponent to use when setting the resulting bool4 w component. + /// bool4 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 shuffle(bool4 left, bool4 right, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z, ShuffleComponent w) + { + return bool4( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y), + select_shuffle_component(left, right, z), + select_shuffle_component(left, right, w)); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static bool select_shuffle_component(bool4 a, bool4 b, ShuffleComponent component) + { + switch(component) + { + case ShuffleComponent.LeftX: + return a.x; + case ShuffleComponent.LeftY: + return a.y; + case ShuffleComponent.LeftZ: + return a.z; + case ShuffleComponent.LeftW: + return a.w; + case ShuffleComponent.RightX: + return b.x; + case ShuffleComponent.RightY: + return b.y; + case ShuffleComponent.RightZ: + return b.z; + case ShuffleComponent.RightW: + return b.w; + default: + throw new System.ArgumentException("Invalid shuffle component: " + component); + } + } + } } diff --git a/src/Unity.Mathematics/bool4x2.gen.cs b/src/Unity.Mathematics/bool4x2.gen.cs new file mode 100644 index 00000000..875357d6 --- /dev/null +++ b/src/Unity.Mathematics/bool4x2.gen.cs @@ -0,0 +1,306 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 4x2 matrix of bools. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct bool4x2 : System.IEquatable + { + /// Column 0 of the matrix. + public bool4 c0; + /// Column 1 of the matrix. + public bool4 c1; + + + /// Constructs a bool4x2 matrix from two bool4 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool4x2(bool4 c0, bool4 c1) + { + this.c0 = c0; + this.c1 = c1; + } + + /// Constructs a bool4x2 matrix from 8 bool values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 3, column 0 will be set to this value. + /// The matrix at row 3, column 1 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool4x2(bool m00, bool m01, + bool m10, bool m11, + bool m20, bool m21, + bool m30, bool m31) + { + this.c0 = new bool4(m00, m10, m20, m30); + this.c1 = new bool4(m01, m11, m21, m31); + } + + /// Constructs a bool4x2 matrix from a single bool value by assigning it to every component. + /// bool to convert to bool4x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool4x2(bool v) + { + this.c0 = v; + this.c1 = v; + } + + + /// Implicitly converts a single bool value to a bool4x2 matrix by assigning it to every component. + /// bool to convert to bool4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator bool4x2(bool v) { return new bool4x2(v); } + + + /// Returns the result of a componentwise equality operation on two bool4x2 matrices. + /// Left hand side bool4x2 to use to compute componentwise equality. + /// Right hand side bool4x2 to use to compute componentwise equality. + /// bool4x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator == (bool4x2 lhs, bool4x2 rhs) { return new bool4x2 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1); } + + /// Returns the result of a componentwise equality operation on a bool4x2 matrix and a bool value. + /// Left hand side bool4x2 to use to compute componentwise equality. + /// Right hand side bool to use to compute componentwise equality. + /// bool4x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator == (bool4x2 lhs, bool rhs) { return new bool4x2 (lhs.c0 == rhs, lhs.c1 == rhs); } + + /// Returns the result of a componentwise equality operation on a bool value and a bool4x2 matrix. + /// Left hand side bool to use to compute componentwise equality. + /// Right hand side bool4x2 to use to compute componentwise equality. + /// bool4x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator == (bool lhs, bool4x2 rhs) { return new bool4x2 (lhs == rhs.c0, lhs == rhs.c1); } + + + /// Returns the result of a componentwise not equal operation on two bool4x2 matrices. + /// Left hand side bool4x2 to use to compute componentwise not equal. + /// Right hand side bool4x2 to use to compute componentwise not equal. + /// bool4x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator != (bool4x2 lhs, bool4x2 rhs) { return new bool4x2 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1); } + + /// Returns the result of a componentwise not equal operation on a bool4x2 matrix and a bool value. + /// Left hand side bool4x2 to use to compute componentwise not equal. + /// Right hand side bool to use to compute componentwise not equal. + /// bool4x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator != (bool4x2 lhs, bool rhs) { return new bool4x2 (lhs.c0 != rhs, lhs.c1 != rhs); } + + /// Returns the result of a componentwise not equal operation on a bool value and a bool4x2 matrix. + /// Left hand side bool to use to compute componentwise not equal. + /// Right hand side bool4x2 to use to compute componentwise not equal. + /// bool4x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator != (bool lhs, bool4x2 rhs) { return new bool4x2 (lhs != rhs.c0, lhs != rhs.c1); } + + + /// Returns the result of a componentwise not operation on a bool4x2 matrix. + /// Value to use when computing the componentwise not. + /// bool4x2 result of the componentwise not. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator ! (bool4x2 val) { return new bool4x2 (!val.c0, !val.c1); } + + + /// Returns the result of a componentwise bitwise and operation on two bool4x2 matrices. + /// Left hand side bool4x2 to use to compute componentwise bitwise and. + /// Right hand side bool4x2 to use to compute componentwise bitwise and. + /// bool4x2 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator & (bool4x2 lhs, bool4x2 rhs) { return new bool4x2 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1); } + + /// Returns the result of a componentwise bitwise and operation on a bool4x2 matrix and a bool value. + /// Left hand side bool4x2 to use to compute componentwise bitwise and. + /// Right hand side bool to use to compute componentwise bitwise and. + /// bool4x2 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator & (bool4x2 lhs, bool rhs) { return new bool4x2 (lhs.c0 & rhs, lhs.c1 & rhs); } + + /// Returns the result of a componentwise bitwise and operation on a bool value and a bool4x2 matrix. + /// Left hand side bool to use to compute componentwise bitwise and. + /// Right hand side bool4x2 to use to compute componentwise bitwise and. + /// bool4x2 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator & (bool lhs, bool4x2 rhs) { return new bool4x2 (lhs & rhs.c0, lhs & rhs.c1); } + + + /// Returns the result of a componentwise bitwise or operation on two bool4x2 matrices. + /// Left hand side bool4x2 to use to compute componentwise bitwise or. + /// Right hand side bool4x2 to use to compute componentwise bitwise or. + /// bool4x2 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator | (bool4x2 lhs, bool4x2 rhs) { return new bool4x2 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1); } + + /// Returns the result of a componentwise bitwise or operation on a bool4x2 matrix and a bool value. + /// Left hand side bool4x2 to use to compute componentwise bitwise or. + /// Right hand side bool to use to compute componentwise bitwise or. + /// bool4x2 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator | (bool4x2 lhs, bool rhs) { return new bool4x2 (lhs.c0 | rhs, lhs.c1 | rhs); } + + /// Returns the result of a componentwise bitwise or operation on a bool value and a bool4x2 matrix. + /// Left hand side bool to use to compute componentwise bitwise or. + /// Right hand side bool4x2 to use to compute componentwise bitwise or. + /// bool4x2 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator | (bool lhs, bool4x2 rhs) { return new bool4x2 (lhs | rhs.c0, lhs | rhs.c1); } + + + /// Returns the result of a componentwise bitwise exclusive or operation on two bool4x2 matrices. + /// Left hand side bool4x2 to use to compute componentwise bitwise exclusive or. + /// Right hand side bool4x2 to use to compute componentwise bitwise exclusive or. + /// bool4x2 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator ^ (bool4x2 lhs, bool4x2 rhs) { return new bool4x2 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1); } + + /// Returns the result of a componentwise bitwise exclusive or operation on a bool4x2 matrix and a bool value. + /// Left hand side bool4x2 to use to compute componentwise bitwise exclusive or. + /// Right hand side bool to use to compute componentwise bitwise exclusive or. + /// bool4x2 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator ^ (bool4x2 lhs, bool rhs) { return new bool4x2 (lhs.c0 ^ rhs, lhs.c1 ^ rhs); } + + /// Returns the result of a componentwise bitwise exclusive or operation on a bool value and a bool4x2 matrix. + /// Left hand side bool to use to compute componentwise bitwise exclusive or. + /// Right hand side bool4x2 to use to compute componentwise bitwise exclusive or. + /// bool4x2 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator ^ (bool lhs, bool4x2 rhs) { return new bool4x2 (lhs ^ rhs.c0, lhs ^ rhs.c1); } + + + + /// Returns the bool4 element at a specified index. + unsafe public ref bool4 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 2) + throw new System.ArgumentException("index must be between[0...1]"); +#endif + fixed (bool4x2* array = &this) { return ref ((bool4*)array)[index]; } + } + } + + /// Returns true if the bool4x2 is equal to a given bool4x2, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(bool4x2 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1); } + + /// Returns true if the bool4x2 is equal to a given bool4x2, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is bool4x2 converted && Equals(converted); } + + + /// Returns a hash code for the bool4x2. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the bool4x2. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("bool4x2({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7})", c0.x, c1.x, c0.y, c1.y, c0.z, c1.z, c0.w, c1.w); + } + + } + + public static partial class math + { + /// Returns a bool4x2 matrix constructed from two bool4 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// bool4x2 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 bool4x2(bool4 c0, bool4 c1) { return new bool4x2(c0, c1); } + + /// Returns a bool4x2 matrix constructed from from 8 bool values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 3, column 0 will be set to this value. + /// The matrix at row 3, column 1 will be set to this value. + /// bool4x2 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 bool4x2(bool m00, bool m01, + bool m10, bool m11, + bool m20, bool m21, + bool m30, bool m31) + { + return new bool4x2(m00, m01, + m10, m11, + m20, m21, + m30, m31); + } + + /// Returns a bool4x2 matrix constructed from a single bool value by assigning it to every component. + /// bool to convert to bool4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 bool4x2(bool v) { return new bool4x2(v); } + + /// Return the bool2x4 transpose of a bool4x2 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 transpose(bool4x2 v) + { + return bool2x4( + v.c0.x, v.c0.y, v.c0.z, v.c0.w, + v.c1.x, v.c1.y, v.c1.z, v.c1.w); + } + + /// Returns a uint hash code of a bool4x2 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(bool4x2 v) + { + return csum(select(uint4(0xD19764C7u, 0xB5D0BF63u, 0xF9102C5Fu, 0x9881FB9Fu), uint4(0x56A1530Du, 0x804B722Du, 0x738E50E5u, 0x4FC93C25u), v.c0) + + select(uint4(0xCD0445A5u, 0xD2B90D9Bu, 0xD35C9B2Du, 0xA10D9E27u), uint4(0x568DAAA9u, 0x7530254Fu, 0x9F090439u, 0x5E9F85C9u), v.c1)); + } + + /// + /// Returns a uint4 vector hash code of a bool4x2 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint4 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 hashwide(bool4x2 v) + { + return (select(uint4(0x8C4CA03Fu, 0xB8D969EDu, 0xAC5DB57Bu, 0xA91A02EDu), uint4(0xB3C49313u, 0xF43A9ABBu, 0x84E7E01Bu, 0x8E055BE5u), v.c0) + + select(uint4(0x6E624EB7u, 0x7383ED49u, 0xDD49C23Bu, 0xEBD0D005u), uint4(0x91475DF7u, 0x55E84827u, 0x90A285BBu, 0x5D19E1D5u), v.c1)); + } + + } +} diff --git a/src/Unity.Mathematics/bool4x2.gen.cs.meta b/src/Unity.Mathematics/bool4x2.gen.cs.meta new file mode 100644 index 00000000..52034705 --- /dev/null +++ b/src/Unity.Mathematics/bool4x2.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d34b6dd47888145b8870e017d6c84d4e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/bool4x3.gen.cs b/src/Unity.Mathematics/bool4x3.gen.cs new file mode 100644 index 00000000..655bfab1 --- /dev/null +++ b/src/Unity.Mathematics/bool4x3.gen.cs @@ -0,0 +1,324 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 4x3 matrix of bools. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct bool4x3 : System.IEquatable + { + /// Column 0 of the matrix. + public bool4 c0; + /// Column 1 of the matrix. + public bool4 c1; + /// Column 2 of the matrix. + public bool4 c2; + + + /// Constructs a bool4x3 matrix from three bool4 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool4x3(bool4 c0, bool4 c1, bool4 c2) + { + this.c0 = c0; + this.c1 = c1; + this.c2 = c2; + } + + /// Constructs a bool4x3 matrix from 12 bool values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 2, column 2 will be set to this value. + /// The matrix at row 3, column 0 will be set to this value. + /// The matrix at row 3, column 1 will be set to this value. + /// The matrix at row 3, column 2 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool4x3(bool m00, bool m01, bool m02, + bool m10, bool m11, bool m12, + bool m20, bool m21, bool m22, + bool m30, bool m31, bool m32) + { + this.c0 = new bool4(m00, m10, m20, m30); + this.c1 = new bool4(m01, m11, m21, m31); + this.c2 = new bool4(m02, m12, m22, m32); + } + + /// Constructs a bool4x3 matrix from a single bool value by assigning it to every component. + /// bool to convert to bool4x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool4x3(bool v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + } + + + /// Implicitly converts a single bool value to a bool4x3 matrix by assigning it to every component. + /// bool to convert to bool4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator bool4x3(bool v) { return new bool4x3(v); } + + + /// Returns the result of a componentwise equality operation on two bool4x3 matrices. + /// Left hand side bool4x3 to use to compute componentwise equality. + /// Right hand side bool4x3 to use to compute componentwise equality. + /// bool4x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator == (bool4x3 lhs, bool4x3 rhs) { return new bool4x3 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2); } + + /// Returns the result of a componentwise equality operation on a bool4x3 matrix and a bool value. + /// Left hand side bool4x3 to use to compute componentwise equality. + /// Right hand side bool to use to compute componentwise equality. + /// bool4x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator == (bool4x3 lhs, bool rhs) { return new bool4x3 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs); } + + /// Returns the result of a componentwise equality operation on a bool value and a bool4x3 matrix. + /// Left hand side bool to use to compute componentwise equality. + /// Right hand side bool4x3 to use to compute componentwise equality. + /// bool4x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator == (bool lhs, bool4x3 rhs) { return new bool4x3 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2); } + + + /// Returns the result of a componentwise not equal operation on two bool4x3 matrices. + /// Left hand side bool4x3 to use to compute componentwise not equal. + /// Right hand side bool4x3 to use to compute componentwise not equal. + /// bool4x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator != (bool4x3 lhs, bool4x3 rhs) { return new bool4x3 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2); } + + /// Returns the result of a componentwise not equal operation on a bool4x3 matrix and a bool value. + /// Left hand side bool4x3 to use to compute componentwise not equal. + /// Right hand side bool to use to compute componentwise not equal. + /// bool4x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator != (bool4x3 lhs, bool rhs) { return new bool4x3 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs); } + + /// Returns the result of a componentwise not equal operation on a bool value and a bool4x3 matrix. + /// Left hand side bool to use to compute componentwise not equal. + /// Right hand side bool4x3 to use to compute componentwise not equal. + /// bool4x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator != (bool lhs, bool4x3 rhs) { return new bool4x3 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2); } + + + /// Returns the result of a componentwise not operation on a bool4x3 matrix. + /// Value to use when computing the componentwise not. + /// bool4x3 result of the componentwise not. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator ! (bool4x3 val) { return new bool4x3 (!val.c0, !val.c1, !val.c2); } + + + /// Returns the result of a componentwise bitwise and operation on two bool4x3 matrices. + /// Left hand side bool4x3 to use to compute componentwise bitwise and. + /// Right hand side bool4x3 to use to compute componentwise bitwise and. + /// bool4x3 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator & (bool4x3 lhs, bool4x3 rhs) { return new bool4x3 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1, lhs.c2 & rhs.c2); } + + /// Returns the result of a componentwise bitwise and operation on a bool4x3 matrix and a bool value. + /// Left hand side bool4x3 to use to compute componentwise bitwise and. + /// Right hand side bool to use to compute componentwise bitwise and. + /// bool4x3 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator & (bool4x3 lhs, bool rhs) { return new bool4x3 (lhs.c0 & rhs, lhs.c1 & rhs, lhs.c2 & rhs); } + + /// Returns the result of a componentwise bitwise and operation on a bool value and a bool4x3 matrix. + /// Left hand side bool to use to compute componentwise bitwise and. + /// Right hand side bool4x3 to use to compute componentwise bitwise and. + /// bool4x3 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator & (bool lhs, bool4x3 rhs) { return new bool4x3 (lhs & rhs.c0, lhs & rhs.c1, lhs & rhs.c2); } + + + /// Returns the result of a componentwise bitwise or operation on two bool4x3 matrices. + /// Left hand side bool4x3 to use to compute componentwise bitwise or. + /// Right hand side bool4x3 to use to compute componentwise bitwise or. + /// bool4x3 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator | (bool4x3 lhs, bool4x3 rhs) { return new bool4x3 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1, lhs.c2 | rhs.c2); } + + /// Returns the result of a componentwise bitwise or operation on a bool4x3 matrix and a bool value. + /// Left hand side bool4x3 to use to compute componentwise bitwise or. + /// Right hand side bool to use to compute componentwise bitwise or. + /// bool4x3 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator | (bool4x3 lhs, bool rhs) { return new bool4x3 (lhs.c0 | rhs, lhs.c1 | rhs, lhs.c2 | rhs); } + + /// Returns the result of a componentwise bitwise or operation on a bool value and a bool4x3 matrix. + /// Left hand side bool to use to compute componentwise bitwise or. + /// Right hand side bool4x3 to use to compute componentwise bitwise or. + /// bool4x3 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator | (bool lhs, bool4x3 rhs) { return new bool4x3 (lhs | rhs.c0, lhs | rhs.c1, lhs | rhs.c2); } + + + /// Returns the result of a componentwise bitwise exclusive or operation on two bool4x3 matrices. + /// Left hand side bool4x3 to use to compute componentwise bitwise exclusive or. + /// Right hand side bool4x3 to use to compute componentwise bitwise exclusive or. + /// bool4x3 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator ^ (bool4x3 lhs, bool4x3 rhs) { return new bool4x3 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1, lhs.c2 ^ rhs.c2); } + + /// Returns the result of a componentwise bitwise exclusive or operation on a bool4x3 matrix and a bool value. + /// Left hand side bool4x3 to use to compute componentwise bitwise exclusive or. + /// Right hand side bool to use to compute componentwise bitwise exclusive or. + /// bool4x3 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator ^ (bool4x3 lhs, bool rhs) { return new bool4x3 (lhs.c0 ^ rhs, lhs.c1 ^ rhs, lhs.c2 ^ rhs); } + + /// Returns the result of a componentwise bitwise exclusive or operation on a bool value and a bool4x3 matrix. + /// Left hand side bool to use to compute componentwise bitwise exclusive or. + /// Right hand side bool4x3 to use to compute componentwise bitwise exclusive or. + /// bool4x3 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator ^ (bool lhs, bool4x3 rhs) { return new bool4x3 (lhs ^ rhs.c0, lhs ^ rhs.c1, lhs ^ rhs.c2); } + + + + /// Returns the bool4 element at a specified index. + unsafe public ref bool4 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 3) + throw new System.ArgumentException("index must be between[0...2]"); +#endif + fixed (bool4x3* array = &this) { return ref ((bool4*)array)[index]; } + } + } + + /// Returns true if the bool4x3 is equal to a given bool4x3, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(bool4x3 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2); } + + /// Returns true if the bool4x3 is equal to a given bool4x3, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is bool4x3 converted && Equals(converted); } + + + /// Returns a hash code for the bool4x3. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the bool4x3. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("bool4x3({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11})", c0.x, c1.x, c2.x, c0.y, c1.y, c2.y, c0.z, c1.z, c2.z, c0.w, c1.w, c2.w); + } + + } + + public static partial class math + { + /// Returns a bool4x3 matrix constructed from three bool4 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// bool4x3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 bool4x3(bool4 c0, bool4 c1, bool4 c2) { return new bool4x3(c0, c1, c2); } + + /// Returns a bool4x3 matrix constructed from from 12 bool values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 2, column 2 will be set to this value. + /// The matrix at row 3, column 0 will be set to this value. + /// The matrix at row 3, column 1 will be set to this value. + /// The matrix at row 3, column 2 will be set to this value. + /// bool4x3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 bool4x3(bool m00, bool m01, bool m02, + bool m10, bool m11, bool m12, + bool m20, bool m21, bool m22, + bool m30, bool m31, bool m32) + { + return new bool4x3(m00, m01, m02, + m10, m11, m12, + m20, m21, m22, + m30, m31, m32); + } + + /// Returns a bool4x3 matrix constructed from a single bool value by assigning it to every component. + /// bool to convert to bool4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 bool4x3(bool v) { return new bool4x3(v); } + + /// Return the bool3x4 transpose of a bool4x3 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 transpose(bool4x3 v) + { + return bool3x4( + v.c0.x, v.c0.y, v.c0.z, v.c0.w, + v.c1.x, v.c1.y, v.c1.z, v.c1.w, + v.c2.x, v.c2.y, v.c2.z, v.c2.w); + } + + /// Returns a uint hash code of a bool4x3 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(bool4x3 v) + { + return csum(select(uint4(0xEADF0775u, 0x747A9D7Bu, 0x4111F799u, 0xB5F05AF1u), uint4(0xFD80290Bu, 0x8B65ADB7u, 0xDFF4F563u, 0x7069770Du), v.c0) + + select(uint4(0xD1224537u, 0xE99ED6F3u, 0x48125549u, 0xEEE2123Bu), uint4(0xE3AD9FE5u, 0xCE1CF8BFu, 0x7BE39F3Bu, 0xFAB9913Fu), v.c1) + + select(uint4(0xB4501269u, 0xE04B89FDu, 0xDB3DE101u, 0x7B6D1B4Bu), uint4(0x58399E77u, 0x5EAC29C9u, 0xFC6014F9u, 0x6BF6693Fu), v.c2)); + } + + /// + /// Returns a uint4 vector hash code of a bool4x3 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint4 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 hashwide(bool4x3 v) + { + return (select(uint4(0x9D1B1D9Bu, 0xF842F5C1u, 0xA47EC335u, 0xA477DF57u), uint4(0xC4B1493Fu, 0xBA0966D3u, 0xAFBEE253u, 0x5B419C01u), v.c0) + + select(uint4(0x515D90F5u, 0xEC9F68F3u, 0xF9EA92D5u, 0xC2FAFCB9u), uint4(0x616E9CA1u, 0xC5C5394Bu, 0xCAE78587u, 0x7A1541C9u), v.c1) + + select(uint4(0xF83BD927u, 0x6A243BCBu, 0x509B84C9u, 0x91D13847u), uint4(0x52F7230Fu, 0xCF286E83u, 0xE121E6ADu, 0xC9CA1249u), v.c2)); + } + + } +} diff --git a/src/Unity.Mathematics/bool4x3.gen.cs.meta b/src/Unity.Mathematics/bool4x3.gen.cs.meta new file mode 100644 index 00000000..4351f47b --- /dev/null +++ b/src/Unity.Mathematics/bool4x3.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e3e9b9173355b4d25aad23fb08782200 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/bool4x4.gen.cs b/src/Unity.Mathematics/bool4x4.gen.cs new file mode 100644 index 00000000..9112018b --- /dev/null +++ b/src/Unity.Mathematics/bool4x4.gen.cs @@ -0,0 +1,342 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 4x4 matrix of bools. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct bool4x4 : System.IEquatable + { + /// Column 0 of the matrix. + public bool4 c0; + /// Column 1 of the matrix. + public bool4 c1; + /// Column 2 of the matrix. + public bool4 c2; + /// Column 3 of the matrix. + public bool4 c3; + + + /// Constructs a bool4x4 matrix from four bool4 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// The matrix column c3 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool4x4(bool4 c0, bool4 c1, bool4 c2, bool4 c3) + { + this.c0 = c0; + this.c1 = c1; + this.c2 = c2; + this.c3 = c3; + } + + /// Constructs a bool4x4 matrix from 16 bool values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 0, column 3 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 1, column 3 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 2, column 2 will be set to this value. + /// The matrix at row 2, column 3 will be set to this value. + /// The matrix at row 3, column 0 will be set to this value. + /// The matrix at row 3, column 1 will be set to this value. + /// The matrix at row 3, column 2 will be set to this value. + /// The matrix at row 3, column 3 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool4x4(bool m00, bool m01, bool m02, bool m03, + bool m10, bool m11, bool m12, bool m13, + bool m20, bool m21, bool m22, bool m23, + bool m30, bool m31, bool m32, bool m33) + { + this.c0 = new bool4(m00, m10, m20, m30); + this.c1 = new bool4(m01, m11, m21, m31); + this.c2 = new bool4(m02, m12, m22, m32); + this.c3 = new bool4(m03, m13, m23, m33); + } + + /// Constructs a bool4x4 matrix from a single bool value by assigning it to every component. + /// bool to convert to bool4x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool4x4(bool v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + this.c3 = v; + } + + + /// Implicitly converts a single bool value to a bool4x4 matrix by assigning it to every component. + /// bool to convert to bool4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator bool4x4(bool v) { return new bool4x4(v); } + + + /// Returns the result of a componentwise equality operation on two bool4x4 matrices. + /// Left hand side bool4x4 to use to compute componentwise equality. + /// Right hand side bool4x4 to use to compute componentwise equality. + /// bool4x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator == (bool4x4 lhs, bool4x4 rhs) { return new bool4x4 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2, lhs.c3 == rhs.c3); } + + /// Returns the result of a componentwise equality operation on a bool4x4 matrix and a bool value. + /// Left hand side bool4x4 to use to compute componentwise equality. + /// Right hand side bool to use to compute componentwise equality. + /// bool4x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator == (bool4x4 lhs, bool rhs) { return new bool4x4 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs, lhs.c3 == rhs); } + + /// Returns the result of a componentwise equality operation on a bool value and a bool4x4 matrix. + /// Left hand side bool to use to compute componentwise equality. + /// Right hand side bool4x4 to use to compute componentwise equality. + /// bool4x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator == (bool lhs, bool4x4 rhs) { return new bool4x4 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2, lhs == rhs.c3); } + + + /// Returns the result of a componentwise not equal operation on two bool4x4 matrices. + /// Left hand side bool4x4 to use to compute componentwise not equal. + /// Right hand side bool4x4 to use to compute componentwise not equal. + /// bool4x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator != (bool4x4 lhs, bool4x4 rhs) { return new bool4x4 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2, lhs.c3 != rhs.c3); } + + /// Returns the result of a componentwise not equal operation on a bool4x4 matrix and a bool value. + /// Left hand side bool4x4 to use to compute componentwise not equal. + /// Right hand side bool to use to compute componentwise not equal. + /// bool4x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator != (bool4x4 lhs, bool rhs) { return new bool4x4 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs, lhs.c3 != rhs); } + + /// Returns the result of a componentwise not equal operation on a bool value and a bool4x4 matrix. + /// Left hand side bool to use to compute componentwise not equal. + /// Right hand side bool4x4 to use to compute componentwise not equal. + /// bool4x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator != (bool lhs, bool4x4 rhs) { return new bool4x4 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2, lhs != rhs.c3); } + + + /// Returns the result of a componentwise not operation on a bool4x4 matrix. + /// Value to use when computing the componentwise not. + /// bool4x4 result of the componentwise not. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator ! (bool4x4 val) { return new bool4x4 (!val.c0, !val.c1, !val.c2, !val.c3); } + + + /// Returns the result of a componentwise bitwise and operation on two bool4x4 matrices. + /// Left hand side bool4x4 to use to compute componentwise bitwise and. + /// Right hand side bool4x4 to use to compute componentwise bitwise and. + /// bool4x4 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator & (bool4x4 lhs, bool4x4 rhs) { return new bool4x4 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1, lhs.c2 & rhs.c2, lhs.c3 & rhs.c3); } + + /// Returns the result of a componentwise bitwise and operation on a bool4x4 matrix and a bool value. + /// Left hand side bool4x4 to use to compute componentwise bitwise and. + /// Right hand side bool to use to compute componentwise bitwise and. + /// bool4x4 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator & (bool4x4 lhs, bool rhs) { return new bool4x4 (lhs.c0 & rhs, lhs.c1 & rhs, lhs.c2 & rhs, lhs.c3 & rhs); } + + /// Returns the result of a componentwise bitwise and operation on a bool value and a bool4x4 matrix. + /// Left hand side bool to use to compute componentwise bitwise and. + /// Right hand side bool4x4 to use to compute componentwise bitwise and. + /// bool4x4 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator & (bool lhs, bool4x4 rhs) { return new bool4x4 (lhs & rhs.c0, lhs & rhs.c1, lhs & rhs.c2, lhs & rhs.c3); } + + + /// Returns the result of a componentwise bitwise or operation on two bool4x4 matrices. + /// Left hand side bool4x4 to use to compute componentwise bitwise or. + /// Right hand side bool4x4 to use to compute componentwise bitwise or. + /// bool4x4 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator | (bool4x4 lhs, bool4x4 rhs) { return new bool4x4 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1, lhs.c2 | rhs.c2, lhs.c3 | rhs.c3); } + + /// Returns the result of a componentwise bitwise or operation on a bool4x4 matrix and a bool value. + /// Left hand side bool4x4 to use to compute componentwise bitwise or. + /// Right hand side bool to use to compute componentwise bitwise or. + /// bool4x4 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator | (bool4x4 lhs, bool rhs) { return new bool4x4 (lhs.c0 | rhs, lhs.c1 | rhs, lhs.c2 | rhs, lhs.c3 | rhs); } + + /// Returns the result of a componentwise bitwise or operation on a bool value and a bool4x4 matrix. + /// Left hand side bool to use to compute componentwise bitwise or. + /// Right hand side bool4x4 to use to compute componentwise bitwise or. + /// bool4x4 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator | (bool lhs, bool4x4 rhs) { return new bool4x4 (lhs | rhs.c0, lhs | rhs.c1, lhs | rhs.c2, lhs | rhs.c3); } + + + /// Returns the result of a componentwise bitwise exclusive or operation on two bool4x4 matrices. + /// Left hand side bool4x4 to use to compute componentwise bitwise exclusive or. + /// Right hand side bool4x4 to use to compute componentwise bitwise exclusive or. + /// bool4x4 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator ^ (bool4x4 lhs, bool4x4 rhs) { return new bool4x4 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1, lhs.c2 ^ rhs.c2, lhs.c3 ^ rhs.c3); } + + /// Returns the result of a componentwise bitwise exclusive or operation on a bool4x4 matrix and a bool value. + /// Left hand side bool4x4 to use to compute componentwise bitwise exclusive or. + /// Right hand side bool to use to compute componentwise bitwise exclusive or. + /// bool4x4 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator ^ (bool4x4 lhs, bool rhs) { return new bool4x4 (lhs.c0 ^ rhs, lhs.c1 ^ rhs, lhs.c2 ^ rhs, lhs.c3 ^ rhs); } + + /// Returns the result of a componentwise bitwise exclusive or operation on a bool value and a bool4x4 matrix. + /// Left hand side bool to use to compute componentwise bitwise exclusive or. + /// Right hand side bool4x4 to use to compute componentwise bitwise exclusive or. + /// bool4x4 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator ^ (bool lhs, bool4x4 rhs) { return new bool4x4 (lhs ^ rhs.c0, lhs ^ rhs.c1, lhs ^ rhs.c2, lhs ^ rhs.c3); } + + + + /// Returns the bool4 element at a specified index. + unsafe public ref bool4 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 4) + throw new System.ArgumentException("index must be between[0...3]"); +#endif + fixed (bool4x4* array = &this) { return ref ((bool4*)array)[index]; } + } + } + + /// Returns true if the bool4x4 is equal to a given bool4x4, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(bool4x4 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2) && c3.Equals(rhs.c3); } + + /// Returns true if the bool4x4 is equal to a given bool4x4, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is bool4x4 converted && Equals(converted); } + + + /// Returns a hash code for the bool4x4. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the bool4x4. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("bool4x4({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11}, {12}, {13}, {14}, {15})", c0.x, c1.x, c2.x, c3.x, c0.y, c1.y, c2.y, c3.y, c0.z, c1.z, c2.z, c3.z, c0.w, c1.w, c2.w, c3.w); + } + + } + + public static partial class math + { + /// Returns a bool4x4 matrix constructed from four bool4 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// The matrix column c3 will be set to this value. + /// bool4x4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 bool4x4(bool4 c0, bool4 c1, bool4 c2, bool4 c3) { return new bool4x4(c0, c1, c2, c3); } + + /// Returns a bool4x4 matrix constructed from from 16 bool values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 0, column 3 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 1, column 3 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 2, column 2 will be set to this value. + /// The matrix at row 2, column 3 will be set to this value. + /// The matrix at row 3, column 0 will be set to this value. + /// The matrix at row 3, column 1 will be set to this value. + /// The matrix at row 3, column 2 will be set to this value. + /// The matrix at row 3, column 3 will be set to this value. + /// bool4x4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 bool4x4(bool m00, bool m01, bool m02, bool m03, + bool m10, bool m11, bool m12, bool m13, + bool m20, bool m21, bool m22, bool m23, + bool m30, bool m31, bool m32, bool m33) + { + return new bool4x4(m00, m01, m02, m03, + m10, m11, m12, m13, + m20, m21, m22, m23, + m30, m31, m32, m33); + } + + /// Returns a bool4x4 matrix constructed from a single bool value by assigning it to every component. + /// bool to convert to bool4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 bool4x4(bool v) { return new bool4x4(v); } + + /// Return the bool4x4 transpose of a bool4x4 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 transpose(bool4x4 v) + { + return bool4x4( + v.c0.x, v.c0.y, v.c0.z, v.c0.w, + v.c1.x, v.c1.y, v.c1.z, v.c1.w, + v.c2.x, v.c2.y, v.c2.z, v.c2.w, + v.c3.x, v.c3.y, v.c3.z, v.c3.w); + } + + /// Returns a uint hash code of a bool4x4 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(bool4x4 v) + { + return csum(select(uint4(0xD19764C7u, 0xB5D0BF63u, 0xF9102C5Fu, 0x9881FB9Fu), uint4(0x56A1530Du, 0x804B722Du, 0x738E50E5u, 0x4FC93C25u), v.c0) + + select(uint4(0xCD0445A5u, 0xD2B90D9Bu, 0xD35C9B2Du, 0xA10D9E27u), uint4(0x568DAAA9u, 0x7530254Fu, 0x9F090439u, 0x5E9F85C9u), v.c1) + + select(uint4(0x8C4CA03Fu, 0xB8D969EDu, 0xAC5DB57Bu, 0xA91A02EDu), uint4(0xB3C49313u, 0xF43A9ABBu, 0x84E7E01Bu, 0x8E055BE5u), v.c2) + + select(uint4(0x6E624EB7u, 0x7383ED49u, 0xDD49C23Bu, 0xEBD0D005u), uint4(0x91475DF7u, 0x55E84827u, 0x90A285BBu, 0x5D19E1D5u), v.c3)); + } + + /// + /// Returns a uint4 vector hash code of a bool4x4 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint4 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 hashwide(bool4x4 v) + { + return (select(uint4(0xFAAF07DDu, 0x625C45BDu, 0xC9F27FCBu, 0x6D2523B1u), uint4(0x6E2BF6A9u, 0xCC74B3B7u, 0x83B58237u, 0x833E3E29u), v.c0) + + select(uint4(0xA9D919BFu, 0xC3EC1D97u, 0xB8B208C7u, 0x5D3ED947u), uint4(0x4473BBB1u, 0xCBA11D5Fu, 0x685835CFu, 0xC3D32AE1u), v.c1) + + select(uint4(0xB966942Fu, 0xFE9856B3u, 0xFA3A3285u, 0xAD55999Du), uint4(0xDCDD5341u, 0x94DDD769u, 0xA1E92D39u, 0x4583C801u), v.c2) + + select(uint4(0x9536A0F5u, 0xAF816615u, 0x9AF8D62Du, 0xE3600729u), uint4(0x5F17300Du, 0x670D6809u, 0x7AF32C49u, 0xAE131389u), v.c3)); + } + + } +} diff --git a/src/Unity.Mathematics/bool4x4.gen.cs.meta b/src/Unity.Mathematics/bool4x4.gen.cs.meta new file mode 100644 index 00000000..bee4ddf1 --- /dev/null +++ b/src/Unity.Mathematics/bool4x4.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ec21b45eb93de4c05962f95aee69aee6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/double2.gen.cs b/src/Unity.Mathematics/double2.gen.cs new file mode 100644 index 00000000..d4d213f6 --- /dev/null +++ b/src/Unity.Mathematics/double2.gen.cs @@ -0,0 +1,998 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using System.Diagnostics; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 2 component vector of doubles. + [DebuggerTypeProxy(typeof(double2.DebuggerProxy))] + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct double2 : System.IEquatable, IFormattable + { + /// x component of the vector. + public double x; + /// y component of the vector. + public double y; + + /// double2 zero value. + public static readonly double2 zero; + + /// Constructs a double2 vector from two double values. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2(double x, double y) + { + this.x = x; + this.y = y; + } + + /// Constructs a double2 vector from a double2 vector. + /// The constructed vector's xy components will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2(double2 xy) + { + this.x = xy.x; + this.y = xy.y; + } + + /// Constructs a double2 vector from a single double value by assigning it to every component. + /// double to convert to double2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2(double v) + { + this.x = v; + this.y = v; + } + + /// Constructs a double2 vector from a single bool value by converting it to double and assigning it to every component. + /// bool to convert to double2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2(bool v) + { + this.x = v ? 1.0 : 0.0; + this.y = v ? 1.0 : 0.0; + } + + /// Constructs a double2 vector from a bool2 vector by componentwise conversion. + /// bool2 to convert to double2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2(bool2 v) + { + this.x = v.x ? 1.0 : 0.0; + this.y = v.y ? 1.0 : 0.0; + } + + /// Constructs a double2 vector from a single int value by converting it to double and assigning it to every component. + /// int to convert to double2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2(int v) + { + this.x = v; + this.y = v; + } + + /// Constructs a double2 vector from a int2 vector by componentwise conversion. + /// int2 to convert to double2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2(int2 v) + { + this.x = v.x; + this.y = v.y; + } + + /// Constructs a double2 vector from a single uint value by converting it to double and assigning it to every component. + /// uint to convert to double2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2(uint v) + { + this.x = v; + this.y = v; + } + + /// Constructs a double2 vector from a uint2 vector by componentwise conversion. + /// uint2 to convert to double2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2(uint2 v) + { + this.x = v.x; + this.y = v.y; + } + + /// Constructs a double2 vector from a single half value by converting it to double and assigning it to every component. + /// half to convert to double2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2(half v) + { + this.x = v; + this.y = v; + } + + /// Constructs a double2 vector from a half2 vector by componentwise conversion. + /// half2 to convert to double2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2(half2 v) + { + this.x = v.x; + this.y = v.y; + } + + /// Constructs a double2 vector from a single float value by converting it to double and assigning it to every component. + /// float to convert to double2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2(float v) + { + this.x = v; + this.y = v; + } + + /// Constructs a double2 vector from a float2 vector by componentwise conversion. + /// float2 to convert to double2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2(float2 v) + { + this.x = v.x; + this.y = v.y; + } + + + /// Implicitly converts a single double value to a double2 vector by assigning it to every component. + /// double to convert to double2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double2(double v) { return new double2(v); } + + /// Explicitly converts a single bool value to a double2 vector by converting it to double and assigning it to every component. + /// bool to convert to double2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator double2(bool v) { return new double2(v); } + + /// Explicitly converts a bool2 vector to a double2 vector by componentwise conversion. + /// bool2 to convert to double2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator double2(bool2 v) { return new double2(v); } + + /// Implicitly converts a single int value to a double2 vector by converting it to double and assigning it to every component. + /// int to convert to double2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double2(int v) { return new double2(v); } + + /// Implicitly converts a int2 vector to a double2 vector by componentwise conversion. + /// int2 to convert to double2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double2(int2 v) { return new double2(v); } + + /// Implicitly converts a single uint value to a double2 vector by converting it to double and assigning it to every component. + /// uint to convert to double2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double2(uint v) { return new double2(v); } + + /// Implicitly converts a uint2 vector to a double2 vector by componentwise conversion. + /// uint2 to convert to double2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double2(uint2 v) { return new double2(v); } + + /// Implicitly converts a single half value to a double2 vector by converting it to double and assigning it to every component. + /// half to convert to double2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double2(half v) { return new double2(v); } + + /// Implicitly converts a half2 vector to a double2 vector by componentwise conversion. + /// half2 to convert to double2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double2(half2 v) { return new double2(v); } + + /// Implicitly converts a single float value to a double2 vector by converting it to double and assigning it to every component. + /// float to convert to double2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double2(float v) { return new double2(v); } + + /// Implicitly converts a float2 vector to a double2 vector by componentwise conversion. + /// float2 to convert to double2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double2(float2 v) { return new double2(v); } + + + /// Returns the result of a componentwise multiplication operation on two double2 vectors. + /// Left hand side double2 to use to compute componentwise multiplication. + /// Right hand side double2 to use to compute componentwise multiplication. + /// double2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 operator * (double2 lhs, double2 rhs) { return new double2 (lhs.x * rhs.x, lhs.y * rhs.y); } + + /// Returns the result of a componentwise multiplication operation on a double2 vector and a double value. + /// Left hand side double2 to use to compute componentwise multiplication. + /// Right hand side double to use to compute componentwise multiplication. + /// double2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 operator * (double2 lhs, double rhs) { return new double2 (lhs.x * rhs, lhs.y * rhs); } + + /// Returns the result of a componentwise multiplication operation on a double value and a double2 vector. + /// Left hand side double to use to compute componentwise multiplication. + /// Right hand side double2 to use to compute componentwise multiplication. + /// double2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 operator * (double lhs, double2 rhs) { return new double2 (lhs * rhs.x, lhs * rhs.y); } + + + /// Returns the result of a componentwise addition operation on two double2 vectors. + /// Left hand side double2 to use to compute componentwise addition. + /// Right hand side double2 to use to compute componentwise addition. + /// double2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 operator + (double2 lhs, double2 rhs) { return new double2 (lhs.x + rhs.x, lhs.y + rhs.y); } + + /// Returns the result of a componentwise addition operation on a double2 vector and a double value. + /// Left hand side double2 to use to compute componentwise addition. + /// Right hand side double to use to compute componentwise addition. + /// double2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 operator + (double2 lhs, double rhs) { return new double2 (lhs.x + rhs, lhs.y + rhs); } + + /// Returns the result of a componentwise addition operation on a double value and a double2 vector. + /// Left hand side double to use to compute componentwise addition. + /// Right hand side double2 to use to compute componentwise addition. + /// double2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 operator + (double lhs, double2 rhs) { return new double2 (lhs + rhs.x, lhs + rhs.y); } + + + /// Returns the result of a componentwise subtraction operation on two double2 vectors. + /// Left hand side double2 to use to compute componentwise subtraction. + /// Right hand side double2 to use to compute componentwise subtraction. + /// double2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 operator - (double2 lhs, double2 rhs) { return new double2 (lhs.x - rhs.x, lhs.y - rhs.y); } + + /// Returns the result of a componentwise subtraction operation on a double2 vector and a double value. + /// Left hand side double2 to use to compute componentwise subtraction. + /// Right hand side double to use to compute componentwise subtraction. + /// double2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 operator - (double2 lhs, double rhs) { return new double2 (lhs.x - rhs, lhs.y - rhs); } + + /// Returns the result of a componentwise subtraction operation on a double value and a double2 vector. + /// Left hand side double to use to compute componentwise subtraction. + /// Right hand side double2 to use to compute componentwise subtraction. + /// double2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 operator - (double lhs, double2 rhs) { return new double2 (lhs - rhs.x, lhs - rhs.y); } + + + /// Returns the result of a componentwise division operation on two double2 vectors. + /// Left hand side double2 to use to compute componentwise division. + /// Right hand side double2 to use to compute componentwise division. + /// double2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 operator / (double2 lhs, double2 rhs) { return new double2 (lhs.x / rhs.x, lhs.y / rhs.y); } + + /// Returns the result of a componentwise division operation on a double2 vector and a double value. + /// Left hand side double2 to use to compute componentwise division. + /// Right hand side double to use to compute componentwise division. + /// double2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 operator / (double2 lhs, double rhs) { return new double2 (lhs.x / rhs, lhs.y / rhs); } + + /// Returns the result of a componentwise division operation on a double value and a double2 vector. + /// Left hand side double to use to compute componentwise division. + /// Right hand side double2 to use to compute componentwise division. + /// double2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 operator / (double lhs, double2 rhs) { return new double2 (lhs / rhs.x, lhs / rhs.y); } + + + /// Returns the result of a componentwise modulus operation on two double2 vectors. + /// Left hand side double2 to use to compute componentwise modulus. + /// Right hand side double2 to use to compute componentwise modulus. + /// double2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 operator % (double2 lhs, double2 rhs) { return new double2 (lhs.x % rhs.x, lhs.y % rhs.y); } + + /// Returns the result of a componentwise modulus operation on a double2 vector and a double value. + /// Left hand side double2 to use to compute componentwise modulus. + /// Right hand side double to use to compute componentwise modulus. + /// double2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 operator % (double2 lhs, double rhs) { return new double2 (lhs.x % rhs, lhs.y % rhs); } + + /// Returns the result of a componentwise modulus operation on a double value and a double2 vector. + /// Left hand side double to use to compute componentwise modulus. + /// Right hand side double2 to use to compute componentwise modulus. + /// double2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 operator % (double lhs, double2 rhs) { return new double2 (lhs % rhs.x, lhs % rhs.y); } + + + /// Returns the result of a componentwise increment operation on a double2 vector. + /// Value to use when computing the componentwise increment. + /// double2 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 operator ++ (double2 val) { return new double2 (++val.x, ++val.y); } + + + /// Returns the result of a componentwise decrement operation on a double2 vector. + /// Value to use when computing the componentwise decrement. + /// double2 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 operator -- (double2 val) { return new double2 (--val.x, --val.y); } + + + /// Returns the result of a componentwise less than operation on two double2 vectors. + /// Left hand side double2 to use to compute componentwise less than. + /// Right hand side double2 to use to compute componentwise less than. + /// bool2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2 operator < (double2 lhs, double2 rhs) { return new bool2 (lhs.x < rhs.x, lhs.y < rhs.y); } + + /// Returns the result of a componentwise less than operation on a double2 vector and a double value. + /// Left hand side double2 to use to compute componentwise less than. + /// Right hand side double to use to compute componentwise less than. + /// bool2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2 operator < (double2 lhs, double rhs) { return new bool2 (lhs.x < rhs, lhs.y < rhs); } + + /// Returns the result of a componentwise less than operation on a double value and a double2 vector. + /// Left hand side double to use to compute componentwise less than. + /// Right hand side double2 to use to compute componentwise less than. + /// bool2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2 operator < (double lhs, double2 rhs) { return new bool2 (lhs < rhs.x, lhs < rhs.y); } + + + /// Returns the result of a componentwise less or equal operation on two double2 vectors. + /// Left hand side double2 to use to compute componentwise less or equal. + /// Right hand side double2 to use to compute componentwise less or equal. + /// bool2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2 operator <= (double2 lhs, double2 rhs) { return new bool2 (lhs.x <= rhs.x, lhs.y <= rhs.y); } + + /// Returns the result of a componentwise less or equal operation on a double2 vector and a double value. + /// Left hand side double2 to use to compute componentwise less or equal. + /// Right hand side double to use to compute componentwise less or equal. + /// bool2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2 operator <= (double2 lhs, double rhs) { return new bool2 (lhs.x <= rhs, lhs.y <= rhs); } + + /// Returns the result of a componentwise less or equal operation on a double value and a double2 vector. + /// Left hand side double to use to compute componentwise less or equal. + /// Right hand side double2 to use to compute componentwise less or equal. + /// bool2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2 operator <= (double lhs, double2 rhs) { return new bool2 (lhs <= rhs.x, lhs <= rhs.y); } + + + /// Returns the result of a componentwise greater than operation on two double2 vectors. + /// Left hand side double2 to use to compute componentwise greater than. + /// Right hand side double2 to use to compute componentwise greater than. + /// bool2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2 operator > (double2 lhs, double2 rhs) { return new bool2 (lhs.x > rhs.x, lhs.y > rhs.y); } + + /// Returns the result of a componentwise greater than operation on a double2 vector and a double value. + /// Left hand side double2 to use to compute componentwise greater than. + /// Right hand side double to use to compute componentwise greater than. + /// bool2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2 operator > (double2 lhs, double rhs) { return new bool2 (lhs.x > rhs, lhs.y > rhs); } + + /// Returns the result of a componentwise greater than operation on a double value and a double2 vector. + /// Left hand side double to use to compute componentwise greater than. + /// Right hand side double2 to use to compute componentwise greater than. + /// bool2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2 operator > (double lhs, double2 rhs) { return new bool2 (lhs > rhs.x, lhs > rhs.y); } + + + /// Returns the result of a componentwise greater or equal operation on two double2 vectors. + /// Left hand side double2 to use to compute componentwise greater or equal. + /// Right hand side double2 to use to compute componentwise greater or equal. + /// bool2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2 operator >= (double2 lhs, double2 rhs) { return new bool2 (lhs.x >= rhs.x, lhs.y >= rhs.y); } + + /// Returns the result of a componentwise greater or equal operation on a double2 vector and a double value. + /// Left hand side double2 to use to compute componentwise greater or equal. + /// Right hand side double to use to compute componentwise greater or equal. + /// bool2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2 operator >= (double2 lhs, double rhs) { return new bool2 (lhs.x >= rhs, lhs.y >= rhs); } + + /// Returns the result of a componentwise greater or equal operation on a double value and a double2 vector. + /// Left hand side double to use to compute componentwise greater or equal. + /// Right hand side double2 to use to compute componentwise greater or equal. + /// bool2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2 operator >= (double lhs, double2 rhs) { return new bool2 (lhs >= rhs.x, lhs >= rhs.y); } + + + /// Returns the result of a componentwise unary minus operation on a double2 vector. + /// Value to use when computing the componentwise unary minus. + /// double2 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 operator - (double2 val) { return new double2 (-val.x, -val.y); } + + + /// Returns the result of a componentwise unary plus operation on a double2 vector. + /// Value to use when computing the componentwise unary plus. + /// double2 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 operator + (double2 val) { return new double2 (+val.x, +val.y); } + + + /// Returns the result of a componentwise equality operation on two double2 vectors. + /// Left hand side double2 to use to compute componentwise equality. + /// Right hand side double2 to use to compute componentwise equality. + /// bool2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2 operator == (double2 lhs, double2 rhs) { return new bool2 (lhs.x == rhs.x, lhs.y == rhs.y); } + + /// Returns the result of a componentwise equality operation on a double2 vector and a double value. + /// Left hand side double2 to use to compute componentwise equality. + /// Right hand side double to use to compute componentwise equality. + /// bool2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2 operator == (double2 lhs, double rhs) { return new bool2 (lhs.x == rhs, lhs.y == rhs); } + + /// Returns the result of a componentwise equality operation on a double value and a double2 vector. + /// Left hand side double to use to compute componentwise equality. + /// Right hand side double2 to use to compute componentwise equality. + /// bool2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2 operator == (double lhs, double2 rhs) { return new bool2 (lhs == rhs.x, lhs == rhs.y); } + + + /// Returns the result of a componentwise not equal operation on two double2 vectors. + /// Left hand side double2 to use to compute componentwise not equal. + /// Right hand side double2 to use to compute componentwise not equal. + /// bool2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2 operator != (double2 lhs, double2 rhs) { return new bool2 (lhs.x != rhs.x, lhs.y != rhs.y); } + + /// Returns the result of a componentwise not equal operation on a double2 vector and a double value. + /// Left hand side double2 to use to compute componentwise not equal. + /// Right hand side double to use to compute componentwise not equal. + /// bool2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2 operator != (double2 lhs, double rhs) { return new bool2 (lhs.x != rhs, lhs.y != rhs); } + + /// Returns the result of a componentwise not equal operation on a double value and a double2 vector. + /// Left hand side double to use to compute componentwise not equal. + /// Right hand side double2 to use to compute componentwise not equal. + /// bool2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2 operator != (double lhs, double2 rhs) { return new bool2 (lhs != rhs.x, lhs != rhs.y); } + + + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xxxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, x, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xxxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, x, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xxyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, x, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xxyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, x, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xyxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, y, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xyxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, y, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xyyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, y, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xyyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, y, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yxxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, x, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yxxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, x, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yxyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, x, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yxyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, x, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yyxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, y, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yyxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, y, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yyyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, y, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yyyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, y, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 xxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(x, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 xxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(x, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 xyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(x, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 xyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(x, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 yxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(y, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 yxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(y, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 yyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(y, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 yyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(y, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double2 xx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double2(x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double2 xy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double2(x, y); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { x = value.x; y = value.y; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double2 yx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double2(y, x); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { y = value.x; x = value.y; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double2 yy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double2(y, y); } + } + + + + /// Returns the double element at a specified index. + unsafe public double this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 2) + throw new System.ArgumentException("index must be between[0...1]"); +#endif + fixed (double2* array = &this) { return ((double*)array)[index]; } + } + set + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 2) + throw new System.ArgumentException("index must be between[0...1]"); +#endif + fixed (double* array = &x) { array[index] = value; } + } + } + + /// Returns true if the double2 is equal to a given double2, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(double2 rhs) { return x == rhs.x && y == rhs.y; } + + /// Returns true if the double2 is equal to a given double2, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is double2 converted && Equals(converted); } + + + /// Returns a hash code for the double2. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the double2. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("double2({0}, {1})", x, y); + } + + /// Returns a string representation of the double2 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("double2({0}, {1})", x.ToString(format, formatProvider), y.ToString(format, formatProvider)); + } + + internal sealed class DebuggerProxy + { + public double x; + public double y; + public DebuggerProxy(double2 v) + { + x = v.x; + y = v.y; + } + } + + } + + public static partial class math + { + /// Returns a double2 vector constructed from two double values. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + /// double2 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 double2(double x, double y) { return new double2(x, y); } + + /// Returns a double2 vector constructed from a double2 vector. + /// The constructed vector's xy components will be set to this value. + /// double2 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 double2(double2 xy) { return new double2(xy); } + + /// Returns a double2 vector constructed from a single double value by assigning it to every component. + /// double to convert to double2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 double2(double v) { return new double2(v); } + + /// Returns a double2 vector constructed from a single bool value by converting it to double and assigning it to every component. + /// bool to convert to double2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 double2(bool v) { return new double2(v); } + + /// Return a double2 vector constructed from a bool2 vector by componentwise conversion. + /// bool2 to convert to double2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 double2(bool2 v) { return new double2(v); } + + /// Returns a double2 vector constructed from a single int value by converting it to double and assigning it to every component. + /// int to convert to double2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 double2(int v) { return new double2(v); } + + /// Return a double2 vector constructed from a int2 vector by componentwise conversion. + /// int2 to convert to double2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 double2(int2 v) { return new double2(v); } + + /// Returns a double2 vector constructed from a single uint value by converting it to double and assigning it to every component. + /// uint to convert to double2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 double2(uint v) { return new double2(v); } + + /// Return a double2 vector constructed from a uint2 vector by componentwise conversion. + /// uint2 to convert to double2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 double2(uint2 v) { return new double2(v); } + + /// Returns a double2 vector constructed from a single half value by converting it to double and assigning it to every component. + /// half to convert to double2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 double2(half v) { return new double2(v); } + + /// Return a double2 vector constructed from a half2 vector by componentwise conversion. + /// half2 to convert to double2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 double2(half2 v) { return new double2(v); } + + /// Returns a double2 vector constructed from a single float value by converting it to double and assigning it to every component. + /// float to convert to double2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 double2(float v) { return new double2(v); } + + /// Return a double2 vector constructed from a float2 vector by componentwise conversion. + /// float2 to convert to double2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 double2(float2 v) { return new double2(v); } + + /// Returns a uint hash code of a double2 vector. + /// Vector value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(double2 v) + { + return csum(fold_to_uint(v) * uint2(0x9536A0F5u, 0xAF816615u)) + 0x9AF8D62Du; + } + + /// + /// Returns a uint2 vector hash code of a double2 vector. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Vector value to hash. + /// uint2 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 hashwide(double2 v) + { + return (fold_to_uint(v) * uint2(0xE3600729u, 0x5F17300Du)) + 0x670D6809u; + } + + /// Returns the result of specified shuffling of the components from two double2 vectors into a double value. + /// double2 to use as the left argument of the shuffle operation. + /// double2 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting double. + /// double result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double shuffle(double2 left, double2 right, ShuffleComponent x) + { + return select_shuffle_component(left, right, x); + } + + /// Returns the result of specified shuffling of the components from two double2 vectors into a double2 vector. + /// double2 to use as the left argument of the shuffle operation. + /// double2 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting double2 x component. + /// The ShuffleComponent to use when setting the resulting double2 y component. + /// double2 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 shuffle(double2 left, double2 right, ShuffleComponent x, ShuffleComponent y) + { + return double2( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y)); + } + + /// Returns the result of specified shuffling of the components from two double2 vectors into a double3 vector. + /// double2 to use as the left argument of the shuffle operation. + /// double2 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting double3 x component. + /// The ShuffleComponent to use when setting the resulting double3 y component. + /// The ShuffleComponent to use when setting the resulting double3 z component. + /// double3 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 shuffle(double2 left, double2 right, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z) + { + return double3( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y), + select_shuffle_component(left, right, z)); + } + + /// Returns the result of specified shuffling of the components from two double2 vectors into a double4 vector. + /// double2 to use as the left argument of the shuffle operation. + /// double2 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting double4 x component. + /// The ShuffleComponent to use when setting the resulting double4 y component. + /// The ShuffleComponent to use when setting the resulting double4 z component. + /// The ShuffleComponent to use when setting the resulting double4 w component. + /// double4 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 shuffle(double2 left, double2 right, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z, ShuffleComponent w) + { + return double4( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y), + select_shuffle_component(left, right, z), + select_shuffle_component(left, right, w)); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static double select_shuffle_component(double2 a, double2 b, ShuffleComponent component) + { + switch(component) + { + case ShuffleComponent.LeftX: + return a.x; + case ShuffleComponent.LeftY: + return a.y; + case ShuffleComponent.RightX: + return b.x; + case ShuffleComponent.RightY: + return b.y; + default: + throw new System.ArgumentException("Invalid shuffle component: " + component); + } + } + + } +} diff --git a/src/Unity.Mathematics/double2.gen.cs.meta b/src/Unity.Mathematics/double2.gen.cs.meta new file mode 100644 index 00000000..df2c3ce3 --- /dev/null +++ b/src/Unity.Mathematics/double2.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8df28422e0a0640c1896e8de330e2640 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/double2x2.gen.cs b/src/Unity.Mathematics/double2x2.gen.cs new file mode 100644 index 00000000..57328b34 --- /dev/null +++ b/src/Unity.Mathematics/double2x2.gen.cs @@ -0,0 +1,658 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 2x2 matrix of doubles. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct double2x2 : System.IEquatable, IFormattable + { + /// Column 0 of the matrix. + public double2 c0; + /// Column 1 of the matrix. + public double2 c1; + + /// double2x2 identity transform. + public static readonly double2x2 identity = new double2x2(1.0, 0.0, 0.0, 1.0); + + /// double2x2 zero value. + public static readonly double2x2 zero; + + /// Constructs a double2x2 matrix from two double2 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2x2(double2 c0, double2 c1) + { + this.c0 = c0; + this.c1 = c1; + } + + /// Constructs a double2x2 matrix from 4 double values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2x2(double m00, double m01, + double m10, double m11) + { + this.c0 = new double2(m00, m10); + this.c1 = new double2(m01, m11); + } + + /// Constructs a double2x2 matrix from a single double value by assigning it to every component. + /// double to convert to double2x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2x2(double v) + { + this.c0 = v; + this.c1 = v; + } + + /// Constructs a double2x2 matrix from a single bool value by converting it to double and assigning it to every component. + /// bool to convert to double2x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2x2(bool v) + { + this.c0 = math.select(new double2(0.0), new double2(1.0), v); + this.c1 = math.select(new double2(0.0), new double2(1.0), v); + } + + /// Constructs a double2x2 matrix from a bool2x2 matrix by componentwise conversion. + /// bool2x2 to convert to double2x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2x2(bool2x2 v) + { + this.c0 = math.select(new double2(0.0), new double2(1.0), v.c0); + this.c1 = math.select(new double2(0.0), new double2(1.0), v.c1); + } + + /// Constructs a double2x2 matrix from a single int value by converting it to double and assigning it to every component. + /// int to convert to double2x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2x2(int v) + { + this.c0 = v; + this.c1 = v; + } + + /// Constructs a double2x2 matrix from a int2x2 matrix by componentwise conversion. + /// int2x2 to convert to double2x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2x2(int2x2 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + } + + /// Constructs a double2x2 matrix from a single uint value by converting it to double and assigning it to every component. + /// uint to convert to double2x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2x2(uint v) + { + this.c0 = v; + this.c1 = v; + } + + /// Constructs a double2x2 matrix from a uint2x2 matrix by componentwise conversion. + /// uint2x2 to convert to double2x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2x2(uint2x2 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + } + + /// Constructs a double2x2 matrix from a single float value by converting it to double and assigning it to every component. + /// float to convert to double2x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2x2(float v) + { + this.c0 = v; + this.c1 = v; + } + + /// Constructs a double2x2 matrix from a float2x2 matrix by componentwise conversion. + /// float2x2 to convert to double2x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2x2(float2x2 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + } + + + /// Implicitly converts a single double value to a double2x2 matrix by assigning it to every component. + /// double to convert to double2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double2x2(double v) { return new double2x2(v); } + + /// Explicitly converts a single bool value to a double2x2 matrix by converting it to double and assigning it to every component. + /// bool to convert to double2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator double2x2(bool v) { return new double2x2(v); } + + /// Explicitly converts a bool2x2 matrix to a double2x2 matrix by componentwise conversion. + /// bool2x2 to convert to double2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator double2x2(bool2x2 v) { return new double2x2(v); } + + /// Implicitly converts a single int value to a double2x2 matrix by converting it to double and assigning it to every component. + /// int to convert to double2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double2x2(int v) { return new double2x2(v); } + + /// Implicitly converts a int2x2 matrix to a double2x2 matrix by componentwise conversion. + /// int2x2 to convert to double2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double2x2(int2x2 v) { return new double2x2(v); } + + /// Implicitly converts a single uint value to a double2x2 matrix by converting it to double and assigning it to every component. + /// uint to convert to double2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double2x2(uint v) { return new double2x2(v); } + + /// Implicitly converts a uint2x2 matrix to a double2x2 matrix by componentwise conversion. + /// uint2x2 to convert to double2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double2x2(uint2x2 v) { return new double2x2(v); } + + /// Implicitly converts a single float value to a double2x2 matrix by converting it to double and assigning it to every component. + /// float to convert to double2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double2x2(float v) { return new double2x2(v); } + + /// Implicitly converts a float2x2 matrix to a double2x2 matrix by componentwise conversion. + /// float2x2 to convert to double2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double2x2(float2x2 v) { return new double2x2(v); } + + + /// Returns the result of a componentwise multiplication operation on two double2x2 matrices. + /// Left hand side double2x2 to use to compute componentwise multiplication. + /// Right hand side double2x2 to use to compute componentwise multiplication. + /// double2x2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x2 operator * (double2x2 lhs, double2x2 rhs) { return new double2x2 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1); } + + /// Returns the result of a componentwise multiplication operation on a double2x2 matrix and a double value. + /// Left hand side double2x2 to use to compute componentwise multiplication. + /// Right hand side double to use to compute componentwise multiplication. + /// double2x2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x2 operator * (double2x2 lhs, double rhs) { return new double2x2 (lhs.c0 * rhs, lhs.c1 * rhs); } + + /// Returns the result of a componentwise multiplication operation on a double value and a double2x2 matrix. + /// Left hand side double to use to compute componentwise multiplication. + /// Right hand side double2x2 to use to compute componentwise multiplication. + /// double2x2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x2 operator * (double lhs, double2x2 rhs) { return new double2x2 (lhs * rhs.c0, lhs * rhs.c1); } + + + /// Returns the result of a componentwise addition operation on two double2x2 matrices. + /// Left hand side double2x2 to use to compute componentwise addition. + /// Right hand side double2x2 to use to compute componentwise addition. + /// double2x2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x2 operator + (double2x2 lhs, double2x2 rhs) { return new double2x2 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1); } + + /// Returns the result of a componentwise addition operation on a double2x2 matrix and a double value. + /// Left hand side double2x2 to use to compute componentwise addition. + /// Right hand side double to use to compute componentwise addition. + /// double2x2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x2 operator + (double2x2 lhs, double rhs) { return new double2x2 (lhs.c0 + rhs, lhs.c1 + rhs); } + + /// Returns the result of a componentwise addition operation on a double value and a double2x2 matrix. + /// Left hand side double to use to compute componentwise addition. + /// Right hand side double2x2 to use to compute componentwise addition. + /// double2x2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x2 operator + (double lhs, double2x2 rhs) { return new double2x2 (lhs + rhs.c0, lhs + rhs.c1); } + + + /// Returns the result of a componentwise subtraction operation on two double2x2 matrices. + /// Left hand side double2x2 to use to compute componentwise subtraction. + /// Right hand side double2x2 to use to compute componentwise subtraction. + /// double2x2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x2 operator - (double2x2 lhs, double2x2 rhs) { return new double2x2 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1); } + + /// Returns the result of a componentwise subtraction operation on a double2x2 matrix and a double value. + /// Left hand side double2x2 to use to compute componentwise subtraction. + /// Right hand side double to use to compute componentwise subtraction. + /// double2x2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x2 operator - (double2x2 lhs, double rhs) { return new double2x2 (lhs.c0 - rhs, lhs.c1 - rhs); } + + /// Returns the result of a componentwise subtraction operation on a double value and a double2x2 matrix. + /// Left hand side double to use to compute componentwise subtraction. + /// Right hand side double2x2 to use to compute componentwise subtraction. + /// double2x2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x2 operator - (double lhs, double2x2 rhs) { return new double2x2 (lhs - rhs.c0, lhs - rhs.c1); } + + + /// Returns the result of a componentwise division operation on two double2x2 matrices. + /// Left hand side double2x2 to use to compute componentwise division. + /// Right hand side double2x2 to use to compute componentwise division. + /// double2x2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x2 operator / (double2x2 lhs, double2x2 rhs) { return new double2x2 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1); } + + /// Returns the result of a componentwise division operation on a double2x2 matrix and a double value. + /// Left hand side double2x2 to use to compute componentwise division. + /// Right hand side double to use to compute componentwise division. + /// double2x2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x2 operator / (double2x2 lhs, double rhs) { return new double2x2 (lhs.c0 / rhs, lhs.c1 / rhs); } + + /// Returns the result of a componentwise division operation on a double value and a double2x2 matrix. + /// Left hand side double to use to compute componentwise division. + /// Right hand side double2x2 to use to compute componentwise division. + /// double2x2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x2 operator / (double lhs, double2x2 rhs) { return new double2x2 (lhs / rhs.c0, lhs / rhs.c1); } + + + /// Returns the result of a componentwise modulus operation on two double2x2 matrices. + /// Left hand side double2x2 to use to compute componentwise modulus. + /// Right hand side double2x2 to use to compute componentwise modulus. + /// double2x2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x2 operator % (double2x2 lhs, double2x2 rhs) { return new double2x2 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1); } + + /// Returns the result of a componentwise modulus operation on a double2x2 matrix and a double value. + /// Left hand side double2x2 to use to compute componentwise modulus. + /// Right hand side double to use to compute componentwise modulus. + /// double2x2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x2 operator % (double2x2 lhs, double rhs) { return new double2x2 (lhs.c0 % rhs, lhs.c1 % rhs); } + + /// Returns the result of a componentwise modulus operation on a double value and a double2x2 matrix. + /// Left hand side double to use to compute componentwise modulus. + /// Right hand side double2x2 to use to compute componentwise modulus. + /// double2x2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x2 operator % (double lhs, double2x2 rhs) { return new double2x2 (lhs % rhs.c0, lhs % rhs.c1); } + + + /// Returns the result of a componentwise increment operation on a double2x2 matrix. + /// Value to use when computing the componentwise increment. + /// double2x2 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x2 operator ++ (double2x2 val) { return new double2x2 (++val.c0, ++val.c1); } + + + /// Returns the result of a componentwise decrement operation on a double2x2 matrix. + /// Value to use when computing the componentwise decrement. + /// double2x2 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x2 operator -- (double2x2 val) { return new double2x2 (--val.c0, --val.c1); } + + + /// Returns the result of a componentwise less than operation on two double2x2 matrices. + /// Left hand side double2x2 to use to compute componentwise less than. + /// Right hand side double2x2 to use to compute componentwise less than. + /// bool2x2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator < (double2x2 lhs, double2x2 rhs) { return new bool2x2 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1); } + + /// Returns the result of a componentwise less than operation on a double2x2 matrix and a double value. + /// Left hand side double2x2 to use to compute componentwise less than. + /// Right hand side double to use to compute componentwise less than. + /// bool2x2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator < (double2x2 lhs, double rhs) { return new bool2x2 (lhs.c0 < rhs, lhs.c1 < rhs); } + + /// Returns the result of a componentwise less than operation on a double value and a double2x2 matrix. + /// Left hand side double to use to compute componentwise less than. + /// Right hand side double2x2 to use to compute componentwise less than. + /// bool2x2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator < (double lhs, double2x2 rhs) { return new bool2x2 (lhs < rhs.c0, lhs < rhs.c1); } + + + /// Returns the result of a componentwise less or equal operation on two double2x2 matrices. + /// Left hand side double2x2 to use to compute componentwise less or equal. + /// Right hand side double2x2 to use to compute componentwise less or equal. + /// bool2x2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator <= (double2x2 lhs, double2x2 rhs) { return new bool2x2 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1); } + + /// Returns the result of a componentwise less or equal operation on a double2x2 matrix and a double value. + /// Left hand side double2x2 to use to compute componentwise less or equal. + /// Right hand side double to use to compute componentwise less or equal. + /// bool2x2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator <= (double2x2 lhs, double rhs) { return new bool2x2 (lhs.c0 <= rhs, lhs.c1 <= rhs); } + + /// Returns the result of a componentwise less or equal operation on a double value and a double2x2 matrix. + /// Left hand side double to use to compute componentwise less or equal. + /// Right hand side double2x2 to use to compute componentwise less or equal. + /// bool2x2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator <= (double lhs, double2x2 rhs) { return new bool2x2 (lhs <= rhs.c0, lhs <= rhs.c1); } + + + /// Returns the result of a componentwise greater than operation on two double2x2 matrices. + /// Left hand side double2x2 to use to compute componentwise greater than. + /// Right hand side double2x2 to use to compute componentwise greater than. + /// bool2x2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator > (double2x2 lhs, double2x2 rhs) { return new bool2x2 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1); } + + /// Returns the result of a componentwise greater than operation on a double2x2 matrix and a double value. + /// Left hand side double2x2 to use to compute componentwise greater than. + /// Right hand side double to use to compute componentwise greater than. + /// bool2x2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator > (double2x2 lhs, double rhs) { return new bool2x2 (lhs.c0 > rhs, lhs.c1 > rhs); } + + /// Returns the result of a componentwise greater than operation on a double value and a double2x2 matrix. + /// Left hand side double to use to compute componentwise greater than. + /// Right hand side double2x2 to use to compute componentwise greater than. + /// bool2x2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator > (double lhs, double2x2 rhs) { return new bool2x2 (lhs > rhs.c0, lhs > rhs.c1); } + + + /// Returns the result of a componentwise greater or equal operation on two double2x2 matrices. + /// Left hand side double2x2 to use to compute componentwise greater or equal. + /// Right hand side double2x2 to use to compute componentwise greater or equal. + /// bool2x2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator >= (double2x2 lhs, double2x2 rhs) { return new bool2x2 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1); } + + /// Returns the result of a componentwise greater or equal operation on a double2x2 matrix and a double value. + /// Left hand side double2x2 to use to compute componentwise greater or equal. + /// Right hand side double to use to compute componentwise greater or equal. + /// bool2x2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator >= (double2x2 lhs, double rhs) { return new bool2x2 (lhs.c0 >= rhs, lhs.c1 >= rhs); } + + /// Returns the result of a componentwise greater or equal operation on a double value and a double2x2 matrix. + /// Left hand side double to use to compute componentwise greater or equal. + /// Right hand side double2x2 to use to compute componentwise greater or equal. + /// bool2x2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator >= (double lhs, double2x2 rhs) { return new bool2x2 (lhs >= rhs.c0, lhs >= rhs.c1); } + + + /// Returns the result of a componentwise unary minus operation on a double2x2 matrix. + /// Value to use when computing the componentwise unary minus. + /// double2x2 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x2 operator - (double2x2 val) { return new double2x2 (-val.c0, -val.c1); } + + + /// Returns the result of a componentwise unary plus operation on a double2x2 matrix. + /// Value to use when computing the componentwise unary plus. + /// double2x2 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x2 operator + (double2x2 val) { return new double2x2 (+val.c0, +val.c1); } + + + /// Returns the result of a componentwise equality operation on two double2x2 matrices. + /// Left hand side double2x2 to use to compute componentwise equality. + /// Right hand side double2x2 to use to compute componentwise equality. + /// bool2x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator == (double2x2 lhs, double2x2 rhs) { return new bool2x2 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1); } + + /// Returns the result of a componentwise equality operation on a double2x2 matrix and a double value. + /// Left hand side double2x2 to use to compute componentwise equality. + /// Right hand side double to use to compute componentwise equality. + /// bool2x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator == (double2x2 lhs, double rhs) { return new bool2x2 (lhs.c0 == rhs, lhs.c1 == rhs); } + + /// Returns the result of a componentwise equality operation on a double value and a double2x2 matrix. + /// Left hand side double to use to compute componentwise equality. + /// Right hand side double2x2 to use to compute componentwise equality. + /// bool2x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator == (double lhs, double2x2 rhs) { return new bool2x2 (lhs == rhs.c0, lhs == rhs.c1); } + + + /// Returns the result of a componentwise not equal operation on two double2x2 matrices. + /// Left hand side double2x2 to use to compute componentwise not equal. + /// Right hand side double2x2 to use to compute componentwise not equal. + /// bool2x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator != (double2x2 lhs, double2x2 rhs) { return new bool2x2 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1); } + + /// Returns the result of a componentwise not equal operation on a double2x2 matrix and a double value. + /// Left hand side double2x2 to use to compute componentwise not equal. + /// Right hand side double to use to compute componentwise not equal. + /// bool2x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator != (double2x2 lhs, double rhs) { return new bool2x2 (lhs.c0 != rhs, lhs.c1 != rhs); } + + /// Returns the result of a componentwise not equal operation on a double value and a double2x2 matrix. + /// Left hand side double to use to compute componentwise not equal. + /// Right hand side double2x2 to use to compute componentwise not equal. + /// bool2x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator != (double lhs, double2x2 rhs) { return new bool2x2 (lhs != rhs.c0, lhs != rhs.c1); } + + + + /// Returns the double2 element at a specified index. + unsafe public ref double2 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 2) + throw new System.ArgumentException("index must be between[0...1]"); +#endif + fixed (double2x2* array = &this) { return ref ((double2*)array)[index]; } + } + } + + /// Returns true if the double2x2 is equal to a given double2x2, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(double2x2 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1); } + + /// Returns true if the double2x2 is equal to a given double2x2, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is double2x2 converted && Equals(converted); } + + + /// Returns a hash code for the double2x2. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the double2x2. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("double2x2({0}, {1}, {2}, {3})", c0.x, c1.x, c0.y, c1.y); + } + + /// Returns a string representation of the double2x2 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("double2x2({0}, {1}, {2}, {3})", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider)); + } + + } + + public static partial class math + { + /// Returns a double2x2 matrix constructed from two double2 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// double2x2 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x2 double2x2(double2 c0, double2 c1) { return new double2x2(c0, c1); } + + /// Returns a double2x2 matrix constructed from from 4 double values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// double2x2 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x2 double2x2(double m00, double m01, + double m10, double m11) + { + return new double2x2(m00, m01, + m10, m11); + } + + /// Returns a double2x2 matrix constructed from a single double value by assigning it to every component. + /// double to convert to double2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x2 double2x2(double v) { return new double2x2(v); } + + /// Returns a double2x2 matrix constructed from a single bool value by converting it to double and assigning it to every component. + /// bool to convert to double2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x2 double2x2(bool v) { return new double2x2(v); } + + /// Return a double2x2 matrix constructed from a bool2x2 matrix by componentwise conversion. + /// bool2x2 to convert to double2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x2 double2x2(bool2x2 v) { return new double2x2(v); } + + /// Returns a double2x2 matrix constructed from a single int value by converting it to double and assigning it to every component. + /// int to convert to double2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x2 double2x2(int v) { return new double2x2(v); } + + /// Return a double2x2 matrix constructed from a int2x2 matrix by componentwise conversion. + /// int2x2 to convert to double2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x2 double2x2(int2x2 v) { return new double2x2(v); } + + /// Returns a double2x2 matrix constructed from a single uint value by converting it to double and assigning it to every component. + /// uint to convert to double2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x2 double2x2(uint v) { return new double2x2(v); } + + /// Return a double2x2 matrix constructed from a uint2x2 matrix by componentwise conversion. + /// uint2x2 to convert to double2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x2 double2x2(uint2x2 v) { return new double2x2(v); } + + /// Returns a double2x2 matrix constructed from a single float value by converting it to double and assigning it to every component. + /// float to convert to double2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x2 double2x2(float v) { return new double2x2(v); } + + /// Return a double2x2 matrix constructed from a float2x2 matrix by componentwise conversion. + /// float2x2 to convert to double2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x2 double2x2(float2x2 v) { return new double2x2(v); } + + /// Return the double2x2 transpose of a double2x2 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x2 transpose(double2x2 v) + { + return double2x2( + v.c0.x, v.c0.y, + v.c1.x, v.c1.y); + } + + /// Returns the double2x2 full inverse of a double2x2 matrix. + /// Matrix to invert. + /// The inverted matrix. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x2 inverse(double2x2 m) + { + double a = m.c0.x; + double b = m.c1.x; + double c = m.c0.y; + double d = m.c1.y; + + double det = a * d - b * c; + + return double2x2(d, -b, -c, a) * (1.0 / det); + } + + /// Returns the determinant of a double2x2 matrix. + /// Matrix to use when computing determinant. + /// The determinant of the matrix. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double determinant(double2x2 m) + { + double a = m.c0.x; + double b = m.c1.x; + double c = m.c0.y; + double d = m.c1.y; + + return a * d - b * c; + } + + /// Returns a uint hash code of a double2x2 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(double2x2 v) + { + return csum(fold_to_uint(v.c0) * uint2(0xFD80290Bu, 0x8B65ADB7u) + + fold_to_uint(v.c1) * uint2(0xDFF4F563u, 0x7069770Du)) + 0xD1224537u; + } + + /// + /// Returns a uint2 vector hash code of a double2x2 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint2 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 hashwide(double2x2 v) + { + return (fold_to_uint(v.c0) * uint2(0xE99ED6F3u, 0x48125549u) + + fold_to_uint(v.c1) * uint2(0xEEE2123Bu, 0xE3AD9FE5u)) + 0xCE1CF8BFu; + } + + } +} diff --git a/src/Unity.Mathematics/double2x2.gen.cs.meta b/src/Unity.Mathematics/double2x2.gen.cs.meta new file mode 100644 index 00000000..c8bf01b1 --- /dev/null +++ b/src/Unity.Mathematics/double2x2.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3faab235f9f6845bbbd1d94d1376d896 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/double2x3.gen.cs b/src/Unity.Mathematics/double2x3.gen.cs new file mode 100644 index 00000000..f6a34908 --- /dev/null +++ b/src/Unity.Mathematics/double2x3.gen.cs @@ -0,0 +1,647 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 2x3 matrix of doubles. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct double2x3 : System.IEquatable, IFormattable + { + /// Column 0 of the matrix. + public double2 c0; + /// Column 1 of the matrix. + public double2 c1; + /// Column 2 of the matrix. + public double2 c2; + + /// double2x3 zero value. + public static readonly double2x3 zero; + + /// Constructs a double2x3 matrix from three double2 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2x3(double2 c0, double2 c1, double2 c2) + { + this.c0 = c0; + this.c1 = c1; + this.c2 = c2; + } + + /// Constructs a double2x3 matrix from 6 double values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2x3(double m00, double m01, double m02, + double m10, double m11, double m12) + { + this.c0 = new double2(m00, m10); + this.c1 = new double2(m01, m11); + this.c2 = new double2(m02, m12); + } + + /// Constructs a double2x3 matrix from a single double value by assigning it to every component. + /// double to convert to double2x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2x3(double v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + } + + /// Constructs a double2x3 matrix from a single bool value by converting it to double and assigning it to every component. + /// bool to convert to double2x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2x3(bool v) + { + this.c0 = math.select(new double2(0.0), new double2(1.0), v); + this.c1 = math.select(new double2(0.0), new double2(1.0), v); + this.c2 = math.select(new double2(0.0), new double2(1.0), v); + } + + /// Constructs a double2x3 matrix from a bool2x3 matrix by componentwise conversion. + /// bool2x3 to convert to double2x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2x3(bool2x3 v) + { + this.c0 = math.select(new double2(0.0), new double2(1.0), v.c0); + this.c1 = math.select(new double2(0.0), new double2(1.0), v.c1); + this.c2 = math.select(new double2(0.0), new double2(1.0), v.c2); + } + + /// Constructs a double2x3 matrix from a single int value by converting it to double and assigning it to every component. + /// int to convert to double2x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2x3(int v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + } + + /// Constructs a double2x3 matrix from a int2x3 matrix by componentwise conversion. + /// int2x3 to convert to double2x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2x3(int2x3 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + this.c2 = v.c2; + } + + /// Constructs a double2x3 matrix from a single uint value by converting it to double and assigning it to every component. + /// uint to convert to double2x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2x3(uint v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + } + + /// Constructs a double2x3 matrix from a uint2x3 matrix by componentwise conversion. + /// uint2x3 to convert to double2x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2x3(uint2x3 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + this.c2 = v.c2; + } + + /// Constructs a double2x3 matrix from a single float value by converting it to double and assigning it to every component. + /// float to convert to double2x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2x3(float v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + } + + /// Constructs a double2x3 matrix from a float2x3 matrix by componentwise conversion. + /// float2x3 to convert to double2x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2x3(float2x3 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + this.c2 = v.c2; + } + + + /// Implicitly converts a single double value to a double2x3 matrix by assigning it to every component. + /// double to convert to double2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double2x3(double v) { return new double2x3(v); } + + /// Explicitly converts a single bool value to a double2x3 matrix by converting it to double and assigning it to every component. + /// bool to convert to double2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator double2x3(bool v) { return new double2x3(v); } + + /// Explicitly converts a bool2x3 matrix to a double2x3 matrix by componentwise conversion. + /// bool2x3 to convert to double2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator double2x3(bool2x3 v) { return new double2x3(v); } + + /// Implicitly converts a single int value to a double2x3 matrix by converting it to double and assigning it to every component. + /// int to convert to double2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double2x3(int v) { return new double2x3(v); } + + /// Implicitly converts a int2x3 matrix to a double2x3 matrix by componentwise conversion. + /// int2x3 to convert to double2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double2x3(int2x3 v) { return new double2x3(v); } + + /// Implicitly converts a single uint value to a double2x3 matrix by converting it to double and assigning it to every component. + /// uint to convert to double2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double2x3(uint v) { return new double2x3(v); } + + /// Implicitly converts a uint2x3 matrix to a double2x3 matrix by componentwise conversion. + /// uint2x3 to convert to double2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double2x3(uint2x3 v) { return new double2x3(v); } + + /// Implicitly converts a single float value to a double2x3 matrix by converting it to double and assigning it to every component. + /// float to convert to double2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double2x3(float v) { return new double2x3(v); } + + /// Implicitly converts a float2x3 matrix to a double2x3 matrix by componentwise conversion. + /// float2x3 to convert to double2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double2x3(float2x3 v) { return new double2x3(v); } + + + /// Returns the result of a componentwise multiplication operation on two double2x3 matrices. + /// Left hand side double2x3 to use to compute componentwise multiplication. + /// Right hand side double2x3 to use to compute componentwise multiplication. + /// double2x3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x3 operator * (double2x3 lhs, double2x3 rhs) { return new double2x3 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1, lhs.c2 * rhs.c2); } + + /// Returns the result of a componentwise multiplication operation on a double2x3 matrix and a double value. + /// Left hand side double2x3 to use to compute componentwise multiplication. + /// Right hand side double to use to compute componentwise multiplication. + /// double2x3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x3 operator * (double2x3 lhs, double rhs) { return new double2x3 (lhs.c0 * rhs, lhs.c1 * rhs, lhs.c2 * rhs); } + + /// Returns the result of a componentwise multiplication operation on a double value and a double2x3 matrix. + /// Left hand side double to use to compute componentwise multiplication. + /// Right hand side double2x3 to use to compute componentwise multiplication. + /// double2x3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x3 operator * (double lhs, double2x3 rhs) { return new double2x3 (lhs * rhs.c0, lhs * rhs.c1, lhs * rhs.c2); } + + + /// Returns the result of a componentwise addition operation on two double2x3 matrices. + /// Left hand side double2x3 to use to compute componentwise addition. + /// Right hand side double2x3 to use to compute componentwise addition. + /// double2x3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x3 operator + (double2x3 lhs, double2x3 rhs) { return new double2x3 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1, lhs.c2 + rhs.c2); } + + /// Returns the result of a componentwise addition operation on a double2x3 matrix and a double value. + /// Left hand side double2x3 to use to compute componentwise addition. + /// Right hand side double to use to compute componentwise addition. + /// double2x3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x3 operator + (double2x3 lhs, double rhs) { return new double2x3 (lhs.c0 + rhs, lhs.c1 + rhs, lhs.c2 + rhs); } + + /// Returns the result of a componentwise addition operation on a double value and a double2x3 matrix. + /// Left hand side double to use to compute componentwise addition. + /// Right hand side double2x3 to use to compute componentwise addition. + /// double2x3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x3 operator + (double lhs, double2x3 rhs) { return new double2x3 (lhs + rhs.c0, lhs + rhs.c1, lhs + rhs.c2); } + + + /// Returns the result of a componentwise subtraction operation on two double2x3 matrices. + /// Left hand side double2x3 to use to compute componentwise subtraction. + /// Right hand side double2x3 to use to compute componentwise subtraction. + /// double2x3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x3 operator - (double2x3 lhs, double2x3 rhs) { return new double2x3 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1, lhs.c2 - rhs.c2); } + + /// Returns the result of a componentwise subtraction operation on a double2x3 matrix and a double value. + /// Left hand side double2x3 to use to compute componentwise subtraction. + /// Right hand side double to use to compute componentwise subtraction. + /// double2x3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x3 operator - (double2x3 lhs, double rhs) { return new double2x3 (lhs.c0 - rhs, lhs.c1 - rhs, lhs.c2 - rhs); } + + /// Returns the result of a componentwise subtraction operation on a double value and a double2x3 matrix. + /// Left hand side double to use to compute componentwise subtraction. + /// Right hand side double2x3 to use to compute componentwise subtraction. + /// double2x3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x3 operator - (double lhs, double2x3 rhs) { return new double2x3 (lhs - rhs.c0, lhs - rhs.c1, lhs - rhs.c2); } + + + /// Returns the result of a componentwise division operation on two double2x3 matrices. + /// Left hand side double2x3 to use to compute componentwise division. + /// Right hand side double2x3 to use to compute componentwise division. + /// double2x3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x3 operator / (double2x3 lhs, double2x3 rhs) { return new double2x3 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1, lhs.c2 / rhs.c2); } + + /// Returns the result of a componentwise division operation on a double2x3 matrix and a double value. + /// Left hand side double2x3 to use to compute componentwise division. + /// Right hand side double to use to compute componentwise division. + /// double2x3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x3 operator / (double2x3 lhs, double rhs) { return new double2x3 (lhs.c0 / rhs, lhs.c1 / rhs, lhs.c2 / rhs); } + + /// Returns the result of a componentwise division operation on a double value and a double2x3 matrix. + /// Left hand side double to use to compute componentwise division. + /// Right hand side double2x3 to use to compute componentwise division. + /// double2x3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x3 operator / (double lhs, double2x3 rhs) { return new double2x3 (lhs / rhs.c0, lhs / rhs.c1, lhs / rhs.c2); } + + + /// Returns the result of a componentwise modulus operation on two double2x3 matrices. + /// Left hand side double2x3 to use to compute componentwise modulus. + /// Right hand side double2x3 to use to compute componentwise modulus. + /// double2x3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x3 operator % (double2x3 lhs, double2x3 rhs) { return new double2x3 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1, lhs.c2 % rhs.c2); } + + /// Returns the result of a componentwise modulus operation on a double2x3 matrix and a double value. + /// Left hand side double2x3 to use to compute componentwise modulus. + /// Right hand side double to use to compute componentwise modulus. + /// double2x3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x3 operator % (double2x3 lhs, double rhs) { return new double2x3 (lhs.c0 % rhs, lhs.c1 % rhs, lhs.c2 % rhs); } + + /// Returns the result of a componentwise modulus operation on a double value and a double2x3 matrix. + /// Left hand side double to use to compute componentwise modulus. + /// Right hand side double2x3 to use to compute componentwise modulus. + /// double2x3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x3 operator % (double lhs, double2x3 rhs) { return new double2x3 (lhs % rhs.c0, lhs % rhs.c1, lhs % rhs.c2); } + + + /// Returns the result of a componentwise increment operation on a double2x3 matrix. + /// Value to use when computing the componentwise increment. + /// double2x3 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x3 operator ++ (double2x3 val) { return new double2x3 (++val.c0, ++val.c1, ++val.c2); } + + + /// Returns the result of a componentwise decrement operation on a double2x3 matrix. + /// Value to use when computing the componentwise decrement. + /// double2x3 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x3 operator -- (double2x3 val) { return new double2x3 (--val.c0, --val.c1, --val.c2); } + + + /// Returns the result of a componentwise less than operation on two double2x3 matrices. + /// Left hand side double2x3 to use to compute componentwise less than. + /// Right hand side double2x3 to use to compute componentwise less than. + /// bool2x3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator < (double2x3 lhs, double2x3 rhs) { return new bool2x3 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1, lhs.c2 < rhs.c2); } + + /// Returns the result of a componentwise less than operation on a double2x3 matrix and a double value. + /// Left hand side double2x3 to use to compute componentwise less than. + /// Right hand side double to use to compute componentwise less than. + /// bool2x3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator < (double2x3 lhs, double rhs) { return new bool2x3 (lhs.c0 < rhs, lhs.c1 < rhs, lhs.c2 < rhs); } + + /// Returns the result of a componentwise less than operation on a double value and a double2x3 matrix. + /// Left hand side double to use to compute componentwise less than. + /// Right hand side double2x3 to use to compute componentwise less than. + /// bool2x3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator < (double lhs, double2x3 rhs) { return new bool2x3 (lhs < rhs.c0, lhs < rhs.c1, lhs < rhs.c2); } + + + /// Returns the result of a componentwise less or equal operation on two double2x3 matrices. + /// Left hand side double2x3 to use to compute componentwise less or equal. + /// Right hand side double2x3 to use to compute componentwise less or equal. + /// bool2x3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator <= (double2x3 lhs, double2x3 rhs) { return new bool2x3 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1, lhs.c2 <= rhs.c2); } + + /// Returns the result of a componentwise less or equal operation on a double2x3 matrix and a double value. + /// Left hand side double2x3 to use to compute componentwise less or equal. + /// Right hand side double to use to compute componentwise less or equal. + /// bool2x3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator <= (double2x3 lhs, double rhs) { return new bool2x3 (lhs.c0 <= rhs, lhs.c1 <= rhs, lhs.c2 <= rhs); } + + /// Returns the result of a componentwise less or equal operation on a double value and a double2x3 matrix. + /// Left hand side double to use to compute componentwise less or equal. + /// Right hand side double2x3 to use to compute componentwise less or equal. + /// bool2x3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator <= (double lhs, double2x3 rhs) { return new bool2x3 (lhs <= rhs.c0, lhs <= rhs.c1, lhs <= rhs.c2); } + + + /// Returns the result of a componentwise greater than operation on two double2x3 matrices. + /// Left hand side double2x3 to use to compute componentwise greater than. + /// Right hand side double2x3 to use to compute componentwise greater than. + /// bool2x3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator > (double2x3 lhs, double2x3 rhs) { return new bool2x3 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1, lhs.c2 > rhs.c2); } + + /// Returns the result of a componentwise greater than operation on a double2x3 matrix and a double value. + /// Left hand side double2x3 to use to compute componentwise greater than. + /// Right hand side double to use to compute componentwise greater than. + /// bool2x3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator > (double2x3 lhs, double rhs) { return new bool2x3 (lhs.c0 > rhs, lhs.c1 > rhs, lhs.c2 > rhs); } + + /// Returns the result of a componentwise greater than operation on a double value and a double2x3 matrix. + /// Left hand side double to use to compute componentwise greater than. + /// Right hand side double2x3 to use to compute componentwise greater than. + /// bool2x3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator > (double lhs, double2x3 rhs) { return new bool2x3 (lhs > rhs.c0, lhs > rhs.c1, lhs > rhs.c2); } + + + /// Returns the result of a componentwise greater or equal operation on two double2x3 matrices. + /// Left hand side double2x3 to use to compute componentwise greater or equal. + /// Right hand side double2x3 to use to compute componentwise greater or equal. + /// bool2x3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator >= (double2x3 lhs, double2x3 rhs) { return new bool2x3 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1, lhs.c2 >= rhs.c2); } + + /// Returns the result of a componentwise greater or equal operation on a double2x3 matrix and a double value. + /// Left hand side double2x3 to use to compute componentwise greater or equal. + /// Right hand side double to use to compute componentwise greater or equal. + /// bool2x3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator >= (double2x3 lhs, double rhs) { return new bool2x3 (lhs.c0 >= rhs, lhs.c1 >= rhs, lhs.c2 >= rhs); } + + /// Returns the result of a componentwise greater or equal operation on a double value and a double2x3 matrix. + /// Left hand side double to use to compute componentwise greater or equal. + /// Right hand side double2x3 to use to compute componentwise greater or equal. + /// bool2x3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator >= (double lhs, double2x3 rhs) { return new bool2x3 (lhs >= rhs.c0, lhs >= rhs.c1, lhs >= rhs.c2); } + + + /// Returns the result of a componentwise unary minus operation on a double2x3 matrix. + /// Value to use when computing the componentwise unary minus. + /// double2x3 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x3 operator - (double2x3 val) { return new double2x3 (-val.c0, -val.c1, -val.c2); } + + + /// Returns the result of a componentwise unary plus operation on a double2x3 matrix. + /// Value to use when computing the componentwise unary plus. + /// double2x3 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x3 operator + (double2x3 val) { return new double2x3 (+val.c0, +val.c1, +val.c2); } + + + /// Returns the result of a componentwise equality operation on two double2x3 matrices. + /// Left hand side double2x3 to use to compute componentwise equality. + /// Right hand side double2x3 to use to compute componentwise equality. + /// bool2x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator == (double2x3 lhs, double2x3 rhs) { return new bool2x3 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2); } + + /// Returns the result of a componentwise equality operation on a double2x3 matrix and a double value. + /// Left hand side double2x3 to use to compute componentwise equality. + /// Right hand side double to use to compute componentwise equality. + /// bool2x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator == (double2x3 lhs, double rhs) { return new bool2x3 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs); } + + /// Returns the result of a componentwise equality operation on a double value and a double2x3 matrix. + /// Left hand side double to use to compute componentwise equality. + /// Right hand side double2x3 to use to compute componentwise equality. + /// bool2x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator == (double lhs, double2x3 rhs) { return new bool2x3 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2); } + + + /// Returns the result of a componentwise not equal operation on two double2x3 matrices. + /// Left hand side double2x3 to use to compute componentwise not equal. + /// Right hand side double2x3 to use to compute componentwise not equal. + /// bool2x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator != (double2x3 lhs, double2x3 rhs) { return new bool2x3 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2); } + + /// Returns the result of a componentwise not equal operation on a double2x3 matrix and a double value. + /// Left hand side double2x3 to use to compute componentwise not equal. + /// Right hand side double to use to compute componentwise not equal. + /// bool2x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator != (double2x3 lhs, double rhs) { return new bool2x3 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs); } + + /// Returns the result of a componentwise not equal operation on a double value and a double2x3 matrix. + /// Left hand side double to use to compute componentwise not equal. + /// Right hand side double2x3 to use to compute componentwise not equal. + /// bool2x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator != (double lhs, double2x3 rhs) { return new bool2x3 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2); } + + + + /// Returns the double2 element at a specified index. + unsafe public ref double2 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 3) + throw new System.ArgumentException("index must be between[0...2]"); +#endif + fixed (double2x3* array = &this) { return ref ((double2*)array)[index]; } + } + } + + /// Returns true if the double2x3 is equal to a given double2x3, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(double2x3 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2); } + + /// Returns true if the double2x3 is equal to a given double2x3, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is double2x3 converted && Equals(converted); } + + + /// Returns a hash code for the double2x3. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the double2x3. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("double2x3({0}, {1}, {2}, {3}, {4}, {5})", c0.x, c1.x, c2.x, c0.y, c1.y, c2.y); + } + + /// Returns a string representation of the double2x3 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("double2x3({0}, {1}, {2}, {3}, {4}, {5})", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c2.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c2.y.ToString(format, formatProvider)); + } + + } + + public static partial class math + { + /// Returns a double2x3 matrix constructed from three double2 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// double2x3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x3 double2x3(double2 c0, double2 c1, double2 c2) { return new double2x3(c0, c1, c2); } + + /// Returns a double2x3 matrix constructed from from 6 double values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// double2x3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x3 double2x3(double m00, double m01, double m02, + double m10, double m11, double m12) + { + return new double2x3(m00, m01, m02, + m10, m11, m12); + } + + /// Returns a double2x3 matrix constructed from a single double value by assigning it to every component. + /// double to convert to double2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x3 double2x3(double v) { return new double2x3(v); } + + /// Returns a double2x3 matrix constructed from a single bool value by converting it to double and assigning it to every component. + /// bool to convert to double2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x3 double2x3(bool v) { return new double2x3(v); } + + /// Return a double2x3 matrix constructed from a bool2x3 matrix by componentwise conversion. + /// bool2x3 to convert to double2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x3 double2x3(bool2x3 v) { return new double2x3(v); } + + /// Returns a double2x3 matrix constructed from a single int value by converting it to double and assigning it to every component. + /// int to convert to double2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x3 double2x3(int v) { return new double2x3(v); } + + /// Return a double2x3 matrix constructed from a int2x3 matrix by componentwise conversion. + /// int2x3 to convert to double2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x3 double2x3(int2x3 v) { return new double2x3(v); } + + /// Returns a double2x3 matrix constructed from a single uint value by converting it to double and assigning it to every component. + /// uint to convert to double2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x3 double2x3(uint v) { return new double2x3(v); } + + /// Return a double2x3 matrix constructed from a uint2x3 matrix by componentwise conversion. + /// uint2x3 to convert to double2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x3 double2x3(uint2x3 v) { return new double2x3(v); } + + /// Returns a double2x3 matrix constructed from a single float value by converting it to double and assigning it to every component. + /// float to convert to double2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x3 double2x3(float v) { return new double2x3(v); } + + /// Return a double2x3 matrix constructed from a float2x3 matrix by componentwise conversion. + /// float2x3 to convert to double2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x3 double2x3(float2x3 v) { return new double2x3(v); } + + /// Return the double3x2 transpose of a double2x3 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x2 transpose(double2x3 v) + { + return double3x2( + v.c0.x, v.c0.y, + v.c1.x, v.c1.y, + v.c2.x, v.c2.y); + } + + /// Returns a uint hash code of a double2x3 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(double2x3 v) + { + return csum(fold_to_uint(v.c0) * uint2(0xF25BE857u, 0x9BC17CE7u) + + fold_to_uint(v.c1) * uint2(0xC8B86851u, 0x64095221u) + + fold_to_uint(v.c2) * uint2(0xADF428FFu, 0xA3977109u)) + 0x745ED837u; + } + + /// + /// Returns a uint2 vector hash code of a double2x3 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint2 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 hashwide(double2x3 v) + { + return (fold_to_uint(v.c0) * uint2(0x9CDC88F5u, 0xFA62D721u) + + fold_to_uint(v.c1) * uint2(0x7E4DB1CFu, 0x68EEE0F5u) + + fold_to_uint(v.c2) * uint2(0xBC3B0A59u, 0x816EFB5Du)) + 0xA24E82B7u; + } + + } +} diff --git a/src/Unity.Mathematics/double2x3.gen.cs.meta b/src/Unity.Mathematics/double2x3.gen.cs.meta new file mode 100644 index 00000000..e6617d10 --- /dev/null +++ b/src/Unity.Mathematics/double2x3.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5c05b76c6656d48b1a5a25086c9277c7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/double2x4.gen.cs b/src/Unity.Mathematics/double2x4.gen.cs new file mode 100644 index 00000000..00e91ec9 --- /dev/null +++ b/src/Unity.Mathematics/double2x4.gen.cs @@ -0,0 +1,669 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 2x4 matrix of doubles. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct double2x4 : System.IEquatable, IFormattable + { + /// Column 0 of the matrix. + public double2 c0; + /// Column 1 of the matrix. + public double2 c1; + /// Column 2 of the matrix. + public double2 c2; + /// Column 3 of the matrix. + public double2 c3; + + /// double2x4 zero value. + public static readonly double2x4 zero; + + /// Constructs a double2x4 matrix from four double2 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// The matrix column c3 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2x4(double2 c0, double2 c1, double2 c2, double2 c3) + { + this.c0 = c0; + this.c1 = c1; + this.c2 = c2; + this.c3 = c3; + } + + /// Constructs a double2x4 matrix from 8 double values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 0, column 3 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 1, column 3 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2x4(double m00, double m01, double m02, double m03, + double m10, double m11, double m12, double m13) + { + this.c0 = new double2(m00, m10); + this.c1 = new double2(m01, m11); + this.c2 = new double2(m02, m12); + this.c3 = new double2(m03, m13); + } + + /// Constructs a double2x4 matrix from a single double value by assigning it to every component. + /// double to convert to double2x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2x4(double v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + this.c3 = v; + } + + /// Constructs a double2x4 matrix from a single bool value by converting it to double and assigning it to every component. + /// bool to convert to double2x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2x4(bool v) + { + this.c0 = math.select(new double2(0.0), new double2(1.0), v); + this.c1 = math.select(new double2(0.0), new double2(1.0), v); + this.c2 = math.select(new double2(0.0), new double2(1.0), v); + this.c3 = math.select(new double2(0.0), new double2(1.0), v); + } + + /// Constructs a double2x4 matrix from a bool2x4 matrix by componentwise conversion. + /// bool2x4 to convert to double2x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2x4(bool2x4 v) + { + this.c0 = math.select(new double2(0.0), new double2(1.0), v.c0); + this.c1 = math.select(new double2(0.0), new double2(1.0), v.c1); + this.c2 = math.select(new double2(0.0), new double2(1.0), v.c2); + this.c3 = math.select(new double2(0.0), new double2(1.0), v.c3); + } + + /// Constructs a double2x4 matrix from a single int value by converting it to double and assigning it to every component. + /// int to convert to double2x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2x4(int v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + this.c3 = v; + } + + /// Constructs a double2x4 matrix from a int2x4 matrix by componentwise conversion. + /// int2x4 to convert to double2x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2x4(int2x4 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + this.c2 = v.c2; + this.c3 = v.c3; + } + + /// Constructs a double2x4 matrix from a single uint value by converting it to double and assigning it to every component. + /// uint to convert to double2x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2x4(uint v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + this.c3 = v; + } + + /// Constructs a double2x4 matrix from a uint2x4 matrix by componentwise conversion. + /// uint2x4 to convert to double2x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2x4(uint2x4 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + this.c2 = v.c2; + this.c3 = v.c3; + } + + /// Constructs a double2x4 matrix from a single float value by converting it to double and assigning it to every component. + /// float to convert to double2x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2x4(float v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + this.c3 = v; + } + + /// Constructs a double2x4 matrix from a float2x4 matrix by componentwise conversion. + /// float2x4 to convert to double2x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2x4(float2x4 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + this.c2 = v.c2; + this.c3 = v.c3; + } + + + /// Implicitly converts a single double value to a double2x4 matrix by assigning it to every component. + /// double to convert to double2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double2x4(double v) { return new double2x4(v); } + + /// Explicitly converts a single bool value to a double2x4 matrix by converting it to double and assigning it to every component. + /// bool to convert to double2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator double2x4(bool v) { return new double2x4(v); } + + /// Explicitly converts a bool2x4 matrix to a double2x4 matrix by componentwise conversion. + /// bool2x4 to convert to double2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator double2x4(bool2x4 v) { return new double2x4(v); } + + /// Implicitly converts a single int value to a double2x4 matrix by converting it to double and assigning it to every component. + /// int to convert to double2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double2x4(int v) { return new double2x4(v); } + + /// Implicitly converts a int2x4 matrix to a double2x4 matrix by componentwise conversion. + /// int2x4 to convert to double2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double2x4(int2x4 v) { return new double2x4(v); } + + /// Implicitly converts a single uint value to a double2x4 matrix by converting it to double and assigning it to every component. + /// uint to convert to double2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double2x4(uint v) { return new double2x4(v); } + + /// Implicitly converts a uint2x4 matrix to a double2x4 matrix by componentwise conversion. + /// uint2x4 to convert to double2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double2x4(uint2x4 v) { return new double2x4(v); } + + /// Implicitly converts a single float value to a double2x4 matrix by converting it to double and assigning it to every component. + /// float to convert to double2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double2x4(float v) { return new double2x4(v); } + + /// Implicitly converts a float2x4 matrix to a double2x4 matrix by componentwise conversion. + /// float2x4 to convert to double2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double2x4(float2x4 v) { return new double2x4(v); } + + + /// Returns the result of a componentwise multiplication operation on two double2x4 matrices. + /// Left hand side double2x4 to use to compute componentwise multiplication. + /// Right hand side double2x4 to use to compute componentwise multiplication. + /// double2x4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x4 operator * (double2x4 lhs, double2x4 rhs) { return new double2x4 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1, lhs.c2 * rhs.c2, lhs.c3 * rhs.c3); } + + /// Returns the result of a componentwise multiplication operation on a double2x4 matrix and a double value. + /// Left hand side double2x4 to use to compute componentwise multiplication. + /// Right hand side double to use to compute componentwise multiplication. + /// double2x4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x4 operator * (double2x4 lhs, double rhs) { return new double2x4 (lhs.c0 * rhs, lhs.c1 * rhs, lhs.c2 * rhs, lhs.c3 * rhs); } + + /// Returns the result of a componentwise multiplication operation on a double value and a double2x4 matrix. + /// Left hand side double to use to compute componentwise multiplication. + /// Right hand side double2x4 to use to compute componentwise multiplication. + /// double2x4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x4 operator * (double lhs, double2x4 rhs) { return new double2x4 (lhs * rhs.c0, lhs * rhs.c1, lhs * rhs.c2, lhs * rhs.c3); } + + + /// Returns the result of a componentwise addition operation on two double2x4 matrices. + /// Left hand side double2x4 to use to compute componentwise addition. + /// Right hand side double2x4 to use to compute componentwise addition. + /// double2x4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x4 operator + (double2x4 lhs, double2x4 rhs) { return new double2x4 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1, lhs.c2 + rhs.c2, lhs.c3 + rhs.c3); } + + /// Returns the result of a componentwise addition operation on a double2x4 matrix and a double value. + /// Left hand side double2x4 to use to compute componentwise addition. + /// Right hand side double to use to compute componentwise addition. + /// double2x4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x4 operator + (double2x4 lhs, double rhs) { return new double2x4 (lhs.c0 + rhs, lhs.c1 + rhs, lhs.c2 + rhs, lhs.c3 + rhs); } + + /// Returns the result of a componentwise addition operation on a double value and a double2x4 matrix. + /// Left hand side double to use to compute componentwise addition. + /// Right hand side double2x4 to use to compute componentwise addition. + /// double2x4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x4 operator + (double lhs, double2x4 rhs) { return new double2x4 (lhs + rhs.c0, lhs + rhs.c1, lhs + rhs.c2, lhs + rhs.c3); } + + + /// Returns the result of a componentwise subtraction operation on two double2x4 matrices. + /// Left hand side double2x4 to use to compute componentwise subtraction. + /// Right hand side double2x4 to use to compute componentwise subtraction. + /// double2x4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x4 operator - (double2x4 lhs, double2x4 rhs) { return new double2x4 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1, lhs.c2 - rhs.c2, lhs.c3 - rhs.c3); } + + /// Returns the result of a componentwise subtraction operation on a double2x4 matrix and a double value. + /// Left hand side double2x4 to use to compute componentwise subtraction. + /// Right hand side double to use to compute componentwise subtraction. + /// double2x4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x4 operator - (double2x4 lhs, double rhs) { return new double2x4 (lhs.c0 - rhs, lhs.c1 - rhs, lhs.c2 - rhs, lhs.c3 - rhs); } + + /// Returns the result of a componentwise subtraction operation on a double value and a double2x4 matrix. + /// Left hand side double to use to compute componentwise subtraction. + /// Right hand side double2x4 to use to compute componentwise subtraction. + /// double2x4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x4 operator - (double lhs, double2x4 rhs) { return new double2x4 (lhs - rhs.c0, lhs - rhs.c1, lhs - rhs.c2, lhs - rhs.c3); } + + + /// Returns the result of a componentwise division operation on two double2x4 matrices. + /// Left hand side double2x4 to use to compute componentwise division. + /// Right hand side double2x4 to use to compute componentwise division. + /// double2x4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x4 operator / (double2x4 lhs, double2x4 rhs) { return new double2x4 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1, lhs.c2 / rhs.c2, lhs.c3 / rhs.c3); } + + /// Returns the result of a componentwise division operation on a double2x4 matrix and a double value. + /// Left hand side double2x4 to use to compute componentwise division. + /// Right hand side double to use to compute componentwise division. + /// double2x4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x4 operator / (double2x4 lhs, double rhs) { return new double2x4 (lhs.c0 / rhs, lhs.c1 / rhs, lhs.c2 / rhs, lhs.c3 / rhs); } + + /// Returns the result of a componentwise division operation on a double value and a double2x4 matrix. + /// Left hand side double to use to compute componentwise division. + /// Right hand side double2x4 to use to compute componentwise division. + /// double2x4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x4 operator / (double lhs, double2x4 rhs) { return new double2x4 (lhs / rhs.c0, lhs / rhs.c1, lhs / rhs.c2, lhs / rhs.c3); } + + + /// Returns the result of a componentwise modulus operation on two double2x4 matrices. + /// Left hand side double2x4 to use to compute componentwise modulus. + /// Right hand side double2x4 to use to compute componentwise modulus. + /// double2x4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x4 operator % (double2x4 lhs, double2x4 rhs) { return new double2x4 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1, lhs.c2 % rhs.c2, lhs.c3 % rhs.c3); } + + /// Returns the result of a componentwise modulus operation on a double2x4 matrix and a double value. + /// Left hand side double2x4 to use to compute componentwise modulus. + /// Right hand side double to use to compute componentwise modulus. + /// double2x4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x4 operator % (double2x4 lhs, double rhs) { return new double2x4 (lhs.c0 % rhs, lhs.c1 % rhs, lhs.c2 % rhs, lhs.c3 % rhs); } + + /// Returns the result of a componentwise modulus operation on a double value and a double2x4 matrix. + /// Left hand side double to use to compute componentwise modulus. + /// Right hand side double2x4 to use to compute componentwise modulus. + /// double2x4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x4 operator % (double lhs, double2x4 rhs) { return new double2x4 (lhs % rhs.c0, lhs % rhs.c1, lhs % rhs.c2, lhs % rhs.c3); } + + + /// Returns the result of a componentwise increment operation on a double2x4 matrix. + /// Value to use when computing the componentwise increment. + /// double2x4 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x4 operator ++ (double2x4 val) { return new double2x4 (++val.c0, ++val.c1, ++val.c2, ++val.c3); } + + + /// Returns the result of a componentwise decrement operation on a double2x4 matrix. + /// Value to use when computing the componentwise decrement. + /// double2x4 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x4 operator -- (double2x4 val) { return new double2x4 (--val.c0, --val.c1, --val.c2, --val.c3); } + + + /// Returns the result of a componentwise less than operation on two double2x4 matrices. + /// Left hand side double2x4 to use to compute componentwise less than. + /// Right hand side double2x4 to use to compute componentwise less than. + /// bool2x4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator < (double2x4 lhs, double2x4 rhs) { return new bool2x4 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1, lhs.c2 < rhs.c2, lhs.c3 < rhs.c3); } + + /// Returns the result of a componentwise less than operation on a double2x4 matrix and a double value. + /// Left hand side double2x4 to use to compute componentwise less than. + /// Right hand side double to use to compute componentwise less than. + /// bool2x4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator < (double2x4 lhs, double rhs) { return new bool2x4 (lhs.c0 < rhs, lhs.c1 < rhs, lhs.c2 < rhs, lhs.c3 < rhs); } + + /// Returns the result of a componentwise less than operation on a double value and a double2x4 matrix. + /// Left hand side double to use to compute componentwise less than. + /// Right hand side double2x4 to use to compute componentwise less than. + /// bool2x4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator < (double lhs, double2x4 rhs) { return new bool2x4 (lhs < rhs.c0, lhs < rhs.c1, lhs < rhs.c2, lhs < rhs.c3); } + + + /// Returns the result of a componentwise less or equal operation on two double2x4 matrices. + /// Left hand side double2x4 to use to compute componentwise less or equal. + /// Right hand side double2x4 to use to compute componentwise less or equal. + /// bool2x4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator <= (double2x4 lhs, double2x4 rhs) { return new bool2x4 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1, lhs.c2 <= rhs.c2, lhs.c3 <= rhs.c3); } + + /// Returns the result of a componentwise less or equal operation on a double2x4 matrix and a double value. + /// Left hand side double2x4 to use to compute componentwise less or equal. + /// Right hand side double to use to compute componentwise less or equal. + /// bool2x4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator <= (double2x4 lhs, double rhs) { return new bool2x4 (lhs.c0 <= rhs, lhs.c1 <= rhs, lhs.c2 <= rhs, lhs.c3 <= rhs); } + + /// Returns the result of a componentwise less or equal operation on a double value and a double2x4 matrix. + /// Left hand side double to use to compute componentwise less or equal. + /// Right hand side double2x4 to use to compute componentwise less or equal. + /// bool2x4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator <= (double lhs, double2x4 rhs) { return new bool2x4 (lhs <= rhs.c0, lhs <= rhs.c1, lhs <= rhs.c2, lhs <= rhs.c3); } + + + /// Returns the result of a componentwise greater than operation on two double2x4 matrices. + /// Left hand side double2x4 to use to compute componentwise greater than. + /// Right hand side double2x4 to use to compute componentwise greater than. + /// bool2x4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator > (double2x4 lhs, double2x4 rhs) { return new bool2x4 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1, lhs.c2 > rhs.c2, lhs.c3 > rhs.c3); } + + /// Returns the result of a componentwise greater than operation on a double2x4 matrix and a double value. + /// Left hand side double2x4 to use to compute componentwise greater than. + /// Right hand side double to use to compute componentwise greater than. + /// bool2x4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator > (double2x4 lhs, double rhs) { return new bool2x4 (lhs.c0 > rhs, lhs.c1 > rhs, lhs.c2 > rhs, lhs.c3 > rhs); } + + /// Returns the result of a componentwise greater than operation on a double value and a double2x4 matrix. + /// Left hand side double to use to compute componentwise greater than. + /// Right hand side double2x4 to use to compute componentwise greater than. + /// bool2x4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator > (double lhs, double2x4 rhs) { return new bool2x4 (lhs > rhs.c0, lhs > rhs.c1, lhs > rhs.c2, lhs > rhs.c3); } + + + /// Returns the result of a componentwise greater or equal operation on two double2x4 matrices. + /// Left hand side double2x4 to use to compute componentwise greater or equal. + /// Right hand side double2x4 to use to compute componentwise greater or equal. + /// bool2x4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator >= (double2x4 lhs, double2x4 rhs) { return new bool2x4 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1, lhs.c2 >= rhs.c2, lhs.c3 >= rhs.c3); } + + /// Returns the result of a componentwise greater or equal operation on a double2x4 matrix and a double value. + /// Left hand side double2x4 to use to compute componentwise greater or equal. + /// Right hand side double to use to compute componentwise greater or equal. + /// bool2x4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator >= (double2x4 lhs, double rhs) { return new bool2x4 (lhs.c0 >= rhs, lhs.c1 >= rhs, lhs.c2 >= rhs, lhs.c3 >= rhs); } + + /// Returns the result of a componentwise greater or equal operation on a double value and a double2x4 matrix. + /// Left hand side double to use to compute componentwise greater or equal. + /// Right hand side double2x4 to use to compute componentwise greater or equal. + /// bool2x4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator >= (double lhs, double2x4 rhs) { return new bool2x4 (lhs >= rhs.c0, lhs >= rhs.c1, lhs >= rhs.c2, lhs >= rhs.c3); } + + + /// Returns the result of a componentwise unary minus operation on a double2x4 matrix. + /// Value to use when computing the componentwise unary minus. + /// double2x4 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x4 operator - (double2x4 val) { return new double2x4 (-val.c0, -val.c1, -val.c2, -val.c3); } + + + /// Returns the result of a componentwise unary plus operation on a double2x4 matrix. + /// Value to use when computing the componentwise unary plus. + /// double2x4 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x4 operator + (double2x4 val) { return new double2x4 (+val.c0, +val.c1, +val.c2, +val.c3); } + + + /// Returns the result of a componentwise equality operation on two double2x4 matrices. + /// Left hand side double2x4 to use to compute componentwise equality. + /// Right hand side double2x4 to use to compute componentwise equality. + /// bool2x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator == (double2x4 lhs, double2x4 rhs) { return new bool2x4 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2, lhs.c3 == rhs.c3); } + + /// Returns the result of a componentwise equality operation on a double2x4 matrix and a double value. + /// Left hand side double2x4 to use to compute componentwise equality. + /// Right hand side double to use to compute componentwise equality. + /// bool2x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator == (double2x4 lhs, double rhs) { return new bool2x4 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs, lhs.c3 == rhs); } + + /// Returns the result of a componentwise equality operation on a double value and a double2x4 matrix. + /// Left hand side double to use to compute componentwise equality. + /// Right hand side double2x4 to use to compute componentwise equality. + /// bool2x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator == (double lhs, double2x4 rhs) { return new bool2x4 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2, lhs == rhs.c3); } + + + /// Returns the result of a componentwise not equal operation on two double2x4 matrices. + /// Left hand side double2x4 to use to compute componentwise not equal. + /// Right hand side double2x4 to use to compute componentwise not equal. + /// bool2x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator != (double2x4 lhs, double2x4 rhs) { return new bool2x4 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2, lhs.c3 != rhs.c3); } + + /// Returns the result of a componentwise not equal operation on a double2x4 matrix and a double value. + /// Left hand side double2x4 to use to compute componentwise not equal. + /// Right hand side double to use to compute componentwise not equal. + /// bool2x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator != (double2x4 lhs, double rhs) { return new bool2x4 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs, lhs.c3 != rhs); } + + /// Returns the result of a componentwise not equal operation on a double value and a double2x4 matrix. + /// Left hand side double to use to compute componentwise not equal. + /// Right hand side double2x4 to use to compute componentwise not equal. + /// bool2x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator != (double lhs, double2x4 rhs) { return new bool2x4 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2, lhs != rhs.c3); } + + + + /// Returns the double2 element at a specified index. + unsafe public ref double2 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 4) + throw new System.ArgumentException("index must be between[0...3]"); +#endif + fixed (double2x4* array = &this) { return ref ((double2*)array)[index]; } + } + } + + /// Returns true if the double2x4 is equal to a given double2x4, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(double2x4 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2) && c3.Equals(rhs.c3); } + + /// Returns true if the double2x4 is equal to a given double2x4, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is double2x4 converted && Equals(converted); } + + + /// Returns a hash code for the double2x4. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the double2x4. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("double2x4({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7})", c0.x, c1.x, c2.x, c3.x, c0.y, c1.y, c2.y, c3.y); + } + + /// Returns a string representation of the double2x4 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("double2x4({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7})", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c2.x.ToString(format, formatProvider), c3.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c2.y.ToString(format, formatProvider), c3.y.ToString(format, formatProvider)); + } + + } + + public static partial class math + { + /// Returns a double2x4 matrix constructed from four double2 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// The matrix column c3 will be set to this value. + /// double2x4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x4 double2x4(double2 c0, double2 c1, double2 c2, double2 c3) { return new double2x4(c0, c1, c2, c3); } + + /// Returns a double2x4 matrix constructed from from 8 double values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 0, column 3 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 1, column 3 will be set to this value. + /// double2x4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x4 double2x4(double m00, double m01, double m02, double m03, + double m10, double m11, double m12, double m13) + { + return new double2x4(m00, m01, m02, m03, + m10, m11, m12, m13); + } + + /// Returns a double2x4 matrix constructed from a single double value by assigning it to every component. + /// double to convert to double2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x4 double2x4(double v) { return new double2x4(v); } + + /// Returns a double2x4 matrix constructed from a single bool value by converting it to double and assigning it to every component. + /// bool to convert to double2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x4 double2x4(bool v) { return new double2x4(v); } + + /// Return a double2x4 matrix constructed from a bool2x4 matrix by componentwise conversion. + /// bool2x4 to convert to double2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x4 double2x4(bool2x4 v) { return new double2x4(v); } + + /// Returns a double2x4 matrix constructed from a single int value by converting it to double and assigning it to every component. + /// int to convert to double2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x4 double2x4(int v) { return new double2x4(v); } + + /// Return a double2x4 matrix constructed from a int2x4 matrix by componentwise conversion. + /// int2x4 to convert to double2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x4 double2x4(int2x4 v) { return new double2x4(v); } + + /// Returns a double2x4 matrix constructed from a single uint value by converting it to double and assigning it to every component. + /// uint to convert to double2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x4 double2x4(uint v) { return new double2x4(v); } + + /// Return a double2x4 matrix constructed from a uint2x4 matrix by componentwise conversion. + /// uint2x4 to convert to double2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x4 double2x4(uint2x4 v) { return new double2x4(v); } + + /// Returns a double2x4 matrix constructed from a single float value by converting it to double and assigning it to every component. + /// float to convert to double2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x4 double2x4(float v) { return new double2x4(v); } + + /// Return a double2x4 matrix constructed from a float2x4 matrix by componentwise conversion. + /// float2x4 to convert to double2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x4 double2x4(float2x4 v) { return new double2x4(v); } + + /// Return the double4x2 transpose of a double2x4 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x2 transpose(double2x4 v) + { + return double4x2( + v.c0.x, v.c0.y, + v.c1.x, v.c1.y, + v.c2.x, v.c2.y, + v.c3.x, v.c3.y); + } + + /// Returns a uint hash code of a double2x4 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(double2x4 v) + { + return csum(fold_to_uint(v.c0) * uint2(0x91475DF7u, 0x55E84827u) + + fold_to_uint(v.c1) * uint2(0x90A285BBu, 0x5D19E1D5u) + + fold_to_uint(v.c2) * uint2(0xFAAF07DDu, 0x625C45BDu) + + fold_to_uint(v.c3) * uint2(0xC9F27FCBu, 0x6D2523B1u)) + 0x6E2BF6A9u; + } + + /// + /// Returns a uint2 vector hash code of a double2x4 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint2 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 hashwide(double2x4 v) + { + return (fold_to_uint(v.c0) * uint2(0xCC74B3B7u, 0x83B58237u) + + fold_to_uint(v.c1) * uint2(0x833E3E29u, 0xA9D919BFu) + + fold_to_uint(v.c2) * uint2(0xC3EC1D97u, 0xB8B208C7u) + + fold_to_uint(v.c3) * uint2(0x5D3ED947u, 0x4473BBB1u)) + 0xCBA11D5Fu; + } + + } +} diff --git a/src/Unity.Mathematics/double2x4.gen.cs.meta b/src/Unity.Mathematics/double2x4.gen.cs.meta new file mode 100644 index 00000000..835f9438 --- /dev/null +++ b/src/Unity.Mathematics/double2x4.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3e21dd148ae3e4bf98a4042d4756c4db +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/double3.gen.cs b/src/Unity.Mathematics/double3.gen.cs new file mode 100644 index 00000000..3468bbfc --- /dev/null +++ b/src/Unity.Mathematics/double3.gen.cs @@ -0,0 +1,1878 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using System.Diagnostics; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 3 component vector of doubles. + [DebuggerTypeProxy(typeof(double3.DebuggerProxy))] + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct double3 : System.IEquatable, IFormattable + { + /// x component of the vector. + public double x; + /// y component of the vector. + public double y; + /// z component of the vector. + public double z; + + /// double3 zero value. + public static readonly double3 zero; + + /// Constructs a double3 vector from three double values. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + /// The constructed vector's z component will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3(double x, double y, double z) + { + this.x = x; + this.y = y; + this.z = z; + } + + /// Constructs a double3 vector from a double value and a double2 vector. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's yz components will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3(double x, double2 yz) + { + this.x = x; + this.y = yz.x; + this.z = yz.y; + } + + /// Constructs a double3 vector from a double2 vector and a double value. + /// The constructed vector's xy components will be set to this value. + /// The constructed vector's z component will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3(double2 xy, double z) + { + this.x = xy.x; + this.y = xy.y; + this.z = z; + } + + /// Constructs a double3 vector from a double3 vector. + /// The constructed vector's xyz components will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3(double3 xyz) + { + this.x = xyz.x; + this.y = xyz.y; + this.z = xyz.z; + } + + /// Constructs a double3 vector from a single double value by assigning it to every component. + /// double to convert to double3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3(double v) + { + this.x = v; + this.y = v; + this.z = v; + } + + /// Constructs a double3 vector from a single bool value by converting it to double and assigning it to every component. + /// bool to convert to double3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3(bool v) + { + this.x = v ? 1.0 : 0.0; + this.y = v ? 1.0 : 0.0; + this.z = v ? 1.0 : 0.0; + } + + /// Constructs a double3 vector from a bool3 vector by componentwise conversion. + /// bool3 to convert to double3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3(bool3 v) + { + this.x = v.x ? 1.0 : 0.0; + this.y = v.y ? 1.0 : 0.0; + this.z = v.z ? 1.0 : 0.0; + } + + /// Constructs a double3 vector from a single int value by converting it to double and assigning it to every component. + /// int to convert to double3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3(int v) + { + this.x = v; + this.y = v; + this.z = v; + } + + /// Constructs a double3 vector from a int3 vector by componentwise conversion. + /// int3 to convert to double3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3(int3 v) + { + this.x = v.x; + this.y = v.y; + this.z = v.z; + } + + /// Constructs a double3 vector from a single uint value by converting it to double and assigning it to every component. + /// uint to convert to double3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3(uint v) + { + this.x = v; + this.y = v; + this.z = v; + } + + /// Constructs a double3 vector from a uint3 vector by componentwise conversion. + /// uint3 to convert to double3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3(uint3 v) + { + this.x = v.x; + this.y = v.y; + this.z = v.z; + } + + /// Constructs a double3 vector from a single half value by converting it to double and assigning it to every component. + /// half to convert to double3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3(half v) + { + this.x = v; + this.y = v; + this.z = v; + } + + /// Constructs a double3 vector from a half3 vector by componentwise conversion. + /// half3 to convert to double3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3(half3 v) + { + this.x = v.x; + this.y = v.y; + this.z = v.z; + } + + /// Constructs a double3 vector from a single float value by converting it to double and assigning it to every component. + /// float to convert to double3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3(float v) + { + this.x = v; + this.y = v; + this.z = v; + } + + /// Constructs a double3 vector from a float3 vector by componentwise conversion. + /// float3 to convert to double3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3(float3 v) + { + this.x = v.x; + this.y = v.y; + this.z = v.z; + } + + + /// Implicitly converts a single double value to a double3 vector by assigning it to every component. + /// double to convert to double3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double3(double v) { return new double3(v); } + + /// Explicitly converts a single bool value to a double3 vector by converting it to double and assigning it to every component. + /// bool to convert to double3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator double3(bool v) { return new double3(v); } + + /// Explicitly converts a bool3 vector to a double3 vector by componentwise conversion. + /// bool3 to convert to double3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator double3(bool3 v) { return new double3(v); } + + /// Implicitly converts a single int value to a double3 vector by converting it to double and assigning it to every component. + /// int to convert to double3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double3(int v) { return new double3(v); } + + /// Implicitly converts a int3 vector to a double3 vector by componentwise conversion. + /// int3 to convert to double3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double3(int3 v) { return new double3(v); } + + /// Implicitly converts a single uint value to a double3 vector by converting it to double and assigning it to every component. + /// uint to convert to double3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double3(uint v) { return new double3(v); } + + /// Implicitly converts a uint3 vector to a double3 vector by componentwise conversion. + /// uint3 to convert to double3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double3(uint3 v) { return new double3(v); } + + /// Implicitly converts a single half value to a double3 vector by converting it to double and assigning it to every component. + /// half to convert to double3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double3(half v) { return new double3(v); } + + /// Implicitly converts a half3 vector to a double3 vector by componentwise conversion. + /// half3 to convert to double3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double3(half3 v) { return new double3(v); } + + /// Implicitly converts a single float value to a double3 vector by converting it to double and assigning it to every component. + /// float to convert to double3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double3(float v) { return new double3(v); } + + /// Implicitly converts a float3 vector to a double3 vector by componentwise conversion. + /// float3 to convert to double3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double3(float3 v) { return new double3(v); } + + + /// Returns the result of a componentwise multiplication operation on two double3 vectors. + /// Left hand side double3 to use to compute componentwise multiplication. + /// Right hand side double3 to use to compute componentwise multiplication. + /// double3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 operator * (double3 lhs, double3 rhs) { return new double3 (lhs.x * rhs.x, lhs.y * rhs.y, lhs.z * rhs.z); } + + /// Returns the result of a componentwise multiplication operation on a double3 vector and a double value. + /// Left hand side double3 to use to compute componentwise multiplication. + /// Right hand side double to use to compute componentwise multiplication. + /// double3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 operator * (double3 lhs, double rhs) { return new double3 (lhs.x * rhs, lhs.y * rhs, lhs.z * rhs); } + + /// Returns the result of a componentwise multiplication operation on a double value and a double3 vector. + /// Left hand side double to use to compute componentwise multiplication. + /// Right hand side double3 to use to compute componentwise multiplication. + /// double3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 operator * (double lhs, double3 rhs) { return new double3 (lhs * rhs.x, lhs * rhs.y, lhs * rhs.z); } + + + /// Returns the result of a componentwise addition operation on two double3 vectors. + /// Left hand side double3 to use to compute componentwise addition. + /// Right hand side double3 to use to compute componentwise addition. + /// double3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 operator + (double3 lhs, double3 rhs) { return new double3 (lhs.x + rhs.x, lhs.y + rhs.y, lhs.z + rhs.z); } + + /// Returns the result of a componentwise addition operation on a double3 vector and a double value. + /// Left hand side double3 to use to compute componentwise addition. + /// Right hand side double to use to compute componentwise addition. + /// double3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 operator + (double3 lhs, double rhs) { return new double3 (lhs.x + rhs, lhs.y + rhs, lhs.z + rhs); } + + /// Returns the result of a componentwise addition operation on a double value and a double3 vector. + /// Left hand side double to use to compute componentwise addition. + /// Right hand side double3 to use to compute componentwise addition. + /// double3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 operator + (double lhs, double3 rhs) { return new double3 (lhs + rhs.x, lhs + rhs.y, lhs + rhs.z); } + + + /// Returns the result of a componentwise subtraction operation on two double3 vectors. + /// Left hand side double3 to use to compute componentwise subtraction. + /// Right hand side double3 to use to compute componentwise subtraction. + /// double3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 operator - (double3 lhs, double3 rhs) { return new double3 (lhs.x - rhs.x, lhs.y - rhs.y, lhs.z - rhs.z); } + + /// Returns the result of a componentwise subtraction operation on a double3 vector and a double value. + /// Left hand side double3 to use to compute componentwise subtraction. + /// Right hand side double to use to compute componentwise subtraction. + /// double3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 operator - (double3 lhs, double rhs) { return new double3 (lhs.x - rhs, lhs.y - rhs, lhs.z - rhs); } + + /// Returns the result of a componentwise subtraction operation on a double value and a double3 vector. + /// Left hand side double to use to compute componentwise subtraction. + /// Right hand side double3 to use to compute componentwise subtraction. + /// double3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 operator - (double lhs, double3 rhs) { return new double3 (lhs - rhs.x, lhs - rhs.y, lhs - rhs.z); } + + + /// Returns the result of a componentwise division operation on two double3 vectors. + /// Left hand side double3 to use to compute componentwise division. + /// Right hand side double3 to use to compute componentwise division. + /// double3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 operator / (double3 lhs, double3 rhs) { return new double3 (lhs.x / rhs.x, lhs.y / rhs.y, lhs.z / rhs.z); } + + /// Returns the result of a componentwise division operation on a double3 vector and a double value. + /// Left hand side double3 to use to compute componentwise division. + /// Right hand side double to use to compute componentwise division. + /// double3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 operator / (double3 lhs, double rhs) { return new double3 (lhs.x / rhs, lhs.y / rhs, lhs.z / rhs); } + + /// Returns the result of a componentwise division operation on a double value and a double3 vector. + /// Left hand side double to use to compute componentwise division. + /// Right hand side double3 to use to compute componentwise division. + /// double3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 operator / (double lhs, double3 rhs) { return new double3 (lhs / rhs.x, lhs / rhs.y, lhs / rhs.z); } + + + /// Returns the result of a componentwise modulus operation on two double3 vectors. + /// Left hand side double3 to use to compute componentwise modulus. + /// Right hand side double3 to use to compute componentwise modulus. + /// double3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 operator % (double3 lhs, double3 rhs) { return new double3 (lhs.x % rhs.x, lhs.y % rhs.y, lhs.z % rhs.z); } + + /// Returns the result of a componentwise modulus operation on a double3 vector and a double value. + /// Left hand side double3 to use to compute componentwise modulus. + /// Right hand side double to use to compute componentwise modulus. + /// double3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 operator % (double3 lhs, double rhs) { return new double3 (lhs.x % rhs, lhs.y % rhs, lhs.z % rhs); } + + /// Returns the result of a componentwise modulus operation on a double value and a double3 vector. + /// Left hand side double to use to compute componentwise modulus. + /// Right hand side double3 to use to compute componentwise modulus. + /// double3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 operator % (double lhs, double3 rhs) { return new double3 (lhs % rhs.x, lhs % rhs.y, lhs % rhs.z); } + + + /// Returns the result of a componentwise increment operation on a double3 vector. + /// Value to use when computing the componentwise increment. + /// double3 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 operator ++ (double3 val) { return new double3 (++val.x, ++val.y, ++val.z); } + + + /// Returns the result of a componentwise decrement operation on a double3 vector. + /// Value to use when computing the componentwise decrement. + /// double3 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 operator -- (double3 val) { return new double3 (--val.x, --val.y, --val.z); } + + + /// Returns the result of a componentwise less than operation on two double3 vectors. + /// Left hand side double3 to use to compute componentwise less than. + /// Right hand side double3 to use to compute componentwise less than. + /// bool3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3 operator < (double3 lhs, double3 rhs) { return new bool3 (lhs.x < rhs.x, lhs.y < rhs.y, lhs.z < rhs.z); } + + /// Returns the result of a componentwise less than operation on a double3 vector and a double value. + /// Left hand side double3 to use to compute componentwise less than. + /// Right hand side double to use to compute componentwise less than. + /// bool3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3 operator < (double3 lhs, double rhs) { return new bool3 (lhs.x < rhs, lhs.y < rhs, lhs.z < rhs); } + + /// Returns the result of a componentwise less than operation on a double value and a double3 vector. + /// Left hand side double to use to compute componentwise less than. + /// Right hand side double3 to use to compute componentwise less than. + /// bool3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3 operator < (double lhs, double3 rhs) { return new bool3 (lhs < rhs.x, lhs < rhs.y, lhs < rhs.z); } + + + /// Returns the result of a componentwise less or equal operation on two double3 vectors. + /// Left hand side double3 to use to compute componentwise less or equal. + /// Right hand side double3 to use to compute componentwise less or equal. + /// bool3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3 operator <= (double3 lhs, double3 rhs) { return new bool3 (lhs.x <= rhs.x, lhs.y <= rhs.y, lhs.z <= rhs.z); } + + /// Returns the result of a componentwise less or equal operation on a double3 vector and a double value. + /// Left hand side double3 to use to compute componentwise less or equal. + /// Right hand side double to use to compute componentwise less or equal. + /// bool3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3 operator <= (double3 lhs, double rhs) { return new bool3 (lhs.x <= rhs, lhs.y <= rhs, lhs.z <= rhs); } + + /// Returns the result of a componentwise less or equal operation on a double value and a double3 vector. + /// Left hand side double to use to compute componentwise less or equal. + /// Right hand side double3 to use to compute componentwise less or equal. + /// bool3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3 operator <= (double lhs, double3 rhs) { return new bool3 (lhs <= rhs.x, lhs <= rhs.y, lhs <= rhs.z); } + + + /// Returns the result of a componentwise greater than operation on two double3 vectors. + /// Left hand side double3 to use to compute componentwise greater than. + /// Right hand side double3 to use to compute componentwise greater than. + /// bool3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3 operator > (double3 lhs, double3 rhs) { return new bool3 (lhs.x > rhs.x, lhs.y > rhs.y, lhs.z > rhs.z); } + + /// Returns the result of a componentwise greater than operation on a double3 vector and a double value. + /// Left hand side double3 to use to compute componentwise greater than. + /// Right hand side double to use to compute componentwise greater than. + /// bool3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3 operator > (double3 lhs, double rhs) { return new bool3 (lhs.x > rhs, lhs.y > rhs, lhs.z > rhs); } + + /// Returns the result of a componentwise greater than operation on a double value and a double3 vector. + /// Left hand side double to use to compute componentwise greater than. + /// Right hand side double3 to use to compute componentwise greater than. + /// bool3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3 operator > (double lhs, double3 rhs) { return new bool3 (lhs > rhs.x, lhs > rhs.y, lhs > rhs.z); } + + + /// Returns the result of a componentwise greater or equal operation on two double3 vectors. + /// Left hand side double3 to use to compute componentwise greater or equal. + /// Right hand side double3 to use to compute componentwise greater or equal. + /// bool3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3 operator >= (double3 lhs, double3 rhs) { return new bool3 (lhs.x >= rhs.x, lhs.y >= rhs.y, lhs.z >= rhs.z); } + + /// Returns the result of a componentwise greater or equal operation on a double3 vector and a double value. + /// Left hand side double3 to use to compute componentwise greater or equal. + /// Right hand side double to use to compute componentwise greater or equal. + /// bool3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3 operator >= (double3 lhs, double rhs) { return new bool3 (lhs.x >= rhs, lhs.y >= rhs, lhs.z >= rhs); } + + /// Returns the result of a componentwise greater or equal operation on a double value and a double3 vector. + /// Left hand side double to use to compute componentwise greater or equal. + /// Right hand side double3 to use to compute componentwise greater or equal. + /// bool3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3 operator >= (double lhs, double3 rhs) { return new bool3 (lhs >= rhs.x, lhs >= rhs.y, lhs >= rhs.z); } + + + /// Returns the result of a componentwise unary minus operation on a double3 vector. + /// Value to use when computing the componentwise unary minus. + /// double3 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 operator - (double3 val) { return new double3 (-val.x, -val.y, -val.z); } + + + /// Returns the result of a componentwise unary plus operation on a double3 vector. + /// Value to use when computing the componentwise unary plus. + /// double3 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 operator + (double3 val) { return new double3 (+val.x, +val.y, +val.z); } + + + /// Returns the result of a componentwise equality operation on two double3 vectors. + /// Left hand side double3 to use to compute componentwise equality. + /// Right hand side double3 to use to compute componentwise equality. + /// bool3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3 operator == (double3 lhs, double3 rhs) { return new bool3 (lhs.x == rhs.x, lhs.y == rhs.y, lhs.z == rhs.z); } + + /// Returns the result of a componentwise equality operation on a double3 vector and a double value. + /// Left hand side double3 to use to compute componentwise equality. + /// Right hand side double to use to compute componentwise equality. + /// bool3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3 operator == (double3 lhs, double rhs) { return new bool3 (lhs.x == rhs, lhs.y == rhs, lhs.z == rhs); } + + /// Returns the result of a componentwise equality operation on a double value and a double3 vector. + /// Left hand side double to use to compute componentwise equality. + /// Right hand side double3 to use to compute componentwise equality. + /// bool3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3 operator == (double lhs, double3 rhs) { return new bool3 (lhs == rhs.x, lhs == rhs.y, lhs == rhs.z); } + + + /// Returns the result of a componentwise not equal operation on two double3 vectors. + /// Left hand side double3 to use to compute componentwise not equal. + /// Right hand side double3 to use to compute componentwise not equal. + /// bool3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3 operator != (double3 lhs, double3 rhs) { return new bool3 (lhs.x != rhs.x, lhs.y != rhs.y, lhs.z != rhs.z); } + + /// Returns the result of a componentwise not equal operation on a double3 vector and a double value. + /// Left hand side double3 to use to compute componentwise not equal. + /// Right hand side double to use to compute componentwise not equal. + /// bool3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3 operator != (double3 lhs, double rhs) { return new bool3 (lhs.x != rhs, lhs.y != rhs, lhs.z != rhs); } + + /// Returns the result of a componentwise not equal operation on a double value and a double3 vector. + /// Left hand side double to use to compute componentwise not equal. + /// Right hand side double3 to use to compute componentwise not equal. + /// bool3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3 operator != (double lhs, double3 rhs) { return new bool3 (lhs != rhs.x, lhs != rhs.y, lhs != rhs.z); } + + + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xxxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, x, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xxxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, x, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xxxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, x, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xxyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, x, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xxyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, x, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xxyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, x, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xxzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, x, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xxzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, x, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xxzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, x, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xyxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, y, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xyxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, y, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xyxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, y, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xyyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, y, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xyyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, y, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xyyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, y, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xyzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, y, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xyzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, y, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xyzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, y, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xzxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, z, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xzxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, z, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xzxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, z, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xzyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, z, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xzyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, z, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xzyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, z, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xzzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, z, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xzzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, z, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xzzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, z, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yxxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, x, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yxxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, x, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yxxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, x, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yxyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, x, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yxyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, x, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yxyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, x, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yxzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, x, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yxzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, x, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yxzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, x, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yyxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, y, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yyxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, y, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yyxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, y, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yyyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, y, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yyyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, y, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yyyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, y, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yyzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, y, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yyzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, y, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yyzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, y, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yzxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, z, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yzxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, z, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yzxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, z, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yzyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, z, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yzyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, z, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yzyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, z, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yzzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, z, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yzzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, z, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yzzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, z, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zxxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, x, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zxxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, x, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zxxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, x, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zxyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, x, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zxyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, x, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zxyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, x, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zxzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, x, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zxzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, x, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zxzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, x, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zyxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, y, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zyxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, y, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zyxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, y, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zyyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, y, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zyyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, y, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zyyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, y, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zyzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, y, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zyzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, y, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zyzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, y, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zzxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, z, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zzxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, z, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zzxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, z, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zzyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, z, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zzyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, z, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zzyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, z, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zzzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, z, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zzzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, z, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zzzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, z, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 xxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(x, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 xxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(x, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 xxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(x, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 xyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(x, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 xyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(x, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 xyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(x, y, z); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { x = value.x; y = value.y; z = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 xzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(x, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 xzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(x, z, y); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { x = value.x; z = value.y; y = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 xzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(x, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 yxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(y, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 yxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(y, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 yxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(y, x, z); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { y = value.x; x = value.y; z = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 yyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(y, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 yyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(y, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 yyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(y, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 yzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(y, z, x); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { y = value.x; z = value.y; x = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 yzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(y, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 yzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(y, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 zxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(z, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 zxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(z, x, y); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { z = value.x; x = value.y; y = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 zxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(z, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 zyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(z, y, x); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { z = value.x; y = value.y; x = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 zyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(z, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 zyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(z, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 zzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(z, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 zzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(z, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 zzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(z, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double2 xx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double2(x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double2 xy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double2(x, y); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { x = value.x; y = value.y; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double2 xz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double2(x, z); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { x = value.x; z = value.y; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double2 yx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double2(y, x); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { y = value.x; x = value.y; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double2 yy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double2(y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double2 yz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double2(y, z); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { y = value.x; z = value.y; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double2 zx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double2(z, x); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { z = value.x; x = value.y; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double2 zy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double2(z, y); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { z = value.x; y = value.y; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double2 zz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double2(z, z); } + } + + + + /// Returns the double element at a specified index. + unsafe public double this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 3) + throw new System.ArgumentException("index must be between[0...2]"); +#endif + fixed (double3* array = &this) { return ((double*)array)[index]; } + } + set + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 3) + throw new System.ArgumentException("index must be between[0...2]"); +#endif + fixed (double* array = &x) { array[index] = value; } + } + } + + /// Returns true if the double3 is equal to a given double3, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(double3 rhs) { return x == rhs.x && y == rhs.y && z == rhs.z; } + + /// Returns true if the double3 is equal to a given double3, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is double3 converted && Equals(converted); } + + + /// Returns a hash code for the double3. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the double3. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("double3({0}, {1}, {2})", x, y, z); + } + + /// Returns a string representation of the double3 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("double3({0}, {1}, {2})", x.ToString(format, formatProvider), y.ToString(format, formatProvider), z.ToString(format, formatProvider)); + } + + internal sealed class DebuggerProxy + { + public double x; + public double y; + public double z; + public DebuggerProxy(double3 v) + { + x = v.x; + y = v.y; + z = v.z; + } + } + + } + + public static partial class math + { + /// Returns a double3 vector constructed from three double values. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + /// The constructed vector's z component will be set to this value. + /// double3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 double3(double x, double y, double z) { return new double3(x, y, z); } + + /// Returns a double3 vector constructed from a double value and a double2 vector. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's yz components will be set to this value. + /// double3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 double3(double x, double2 yz) { return new double3(x, yz); } + + /// Returns a double3 vector constructed from a double2 vector and a double value. + /// The constructed vector's xy components will be set to this value. + /// The constructed vector's z component will be set to this value. + /// double3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 double3(double2 xy, double z) { return new double3(xy, z); } + + /// Returns a double3 vector constructed from a double3 vector. + /// The constructed vector's xyz components will be set to this value. + /// double3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 double3(double3 xyz) { return new double3(xyz); } + + /// Returns a double3 vector constructed from a single double value by assigning it to every component. + /// double to convert to double3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 double3(double v) { return new double3(v); } + + /// Returns a double3 vector constructed from a single bool value by converting it to double and assigning it to every component. + /// bool to convert to double3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 double3(bool v) { return new double3(v); } + + /// Return a double3 vector constructed from a bool3 vector by componentwise conversion. + /// bool3 to convert to double3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 double3(bool3 v) { return new double3(v); } + + /// Returns a double3 vector constructed from a single int value by converting it to double and assigning it to every component. + /// int to convert to double3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 double3(int v) { return new double3(v); } + + /// Return a double3 vector constructed from a int3 vector by componentwise conversion. + /// int3 to convert to double3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 double3(int3 v) { return new double3(v); } + + /// Returns a double3 vector constructed from a single uint value by converting it to double and assigning it to every component. + /// uint to convert to double3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 double3(uint v) { return new double3(v); } + + /// Return a double3 vector constructed from a uint3 vector by componentwise conversion. + /// uint3 to convert to double3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 double3(uint3 v) { return new double3(v); } + + /// Returns a double3 vector constructed from a single half value by converting it to double and assigning it to every component. + /// half to convert to double3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 double3(half v) { return new double3(v); } + + /// Return a double3 vector constructed from a half3 vector by componentwise conversion. + /// half3 to convert to double3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 double3(half3 v) { return new double3(v); } + + /// Returns a double3 vector constructed from a single float value by converting it to double and assigning it to every component. + /// float to convert to double3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 double3(float v) { return new double3(v); } + + /// Return a double3 vector constructed from a float3 vector by componentwise conversion. + /// float3 to convert to double3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 double3(float3 v) { return new double3(v); } + + /// Returns a uint hash code of a double3 vector. + /// Vector value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(double3 v) + { + return csum(fold_to_uint(v) * uint3(0xAF0F3103u, 0xE4A056C7u, 0x841D8225u)) + 0xC9393C7Du; + } + + /// + /// Returns a uint3 vector hash code of a double3 vector. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Vector value to hash. + /// uint3 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 hashwide(double3 v) + { + return (fold_to_uint(v) * uint3(0xD42EAFA3u, 0xD9AFD06Du, 0x97A65421u)) + 0x7809205Fu; + } + + /// Returns the result of specified shuffling of the components from two double3 vectors into a double value. + /// double3 to use as the left argument of the shuffle operation. + /// double3 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting double. + /// double result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double shuffle(double3 left, double3 right, ShuffleComponent x) + { + return select_shuffle_component(left, right, x); + } + + /// Returns the result of specified shuffling of the components from two double3 vectors into a double2 vector. + /// double3 to use as the left argument of the shuffle operation. + /// double3 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting double2 x component. + /// The ShuffleComponent to use when setting the resulting double2 y component. + /// double2 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 shuffle(double3 left, double3 right, ShuffleComponent x, ShuffleComponent y) + { + return double2( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y)); + } + + /// Returns the result of specified shuffling of the components from two double3 vectors into a double3 vector. + /// double3 to use as the left argument of the shuffle operation. + /// double3 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting double3 x component. + /// The ShuffleComponent to use when setting the resulting double3 y component. + /// The ShuffleComponent to use when setting the resulting double3 z component. + /// double3 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 shuffle(double3 left, double3 right, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z) + { + return double3( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y), + select_shuffle_component(left, right, z)); + } + + /// Returns the result of specified shuffling of the components from two double3 vectors into a double4 vector. + /// double3 to use as the left argument of the shuffle operation. + /// double3 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting double4 x component. + /// The ShuffleComponent to use when setting the resulting double4 y component. + /// The ShuffleComponent to use when setting the resulting double4 z component. + /// The ShuffleComponent to use when setting the resulting double4 w component. + /// double4 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 shuffle(double3 left, double3 right, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z, ShuffleComponent w) + { + return double4( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y), + select_shuffle_component(left, right, z), + select_shuffle_component(left, right, w)); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static double select_shuffle_component(double3 a, double3 b, ShuffleComponent component) + { + switch(component) + { + case ShuffleComponent.LeftX: + return a.x; + case ShuffleComponent.LeftY: + return a.y; + case ShuffleComponent.LeftZ: + return a.z; + case ShuffleComponent.RightX: + return b.x; + case ShuffleComponent.RightY: + return b.y; + case ShuffleComponent.RightZ: + return b.z; + default: + throw new System.ArgumentException("Invalid shuffle component: " + component); + } + } + + } +} diff --git a/src/Unity.Mathematics/double3.gen.cs.meta b/src/Unity.Mathematics/double3.gen.cs.meta new file mode 100644 index 00000000..f4476c97 --- /dev/null +++ b/src/Unity.Mathematics/double3.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8532598f495324d779593b36c90c7f7c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/double3x2.gen.cs b/src/Unity.Mathematics/double3x2.gen.cs new file mode 100644 index 00000000..50e477ed --- /dev/null +++ b/src/Unity.Mathematics/double3x2.gen.cs @@ -0,0 +1,632 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 3x2 matrix of doubles. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct double3x2 : System.IEquatable, IFormattable + { + /// Column 0 of the matrix. + public double3 c0; + /// Column 1 of the matrix. + public double3 c1; + + /// double3x2 zero value. + public static readonly double3x2 zero; + + /// Constructs a double3x2 matrix from two double3 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3x2(double3 c0, double3 c1) + { + this.c0 = c0; + this.c1 = c1; + } + + /// Constructs a double3x2 matrix from 6 double values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3x2(double m00, double m01, + double m10, double m11, + double m20, double m21) + { + this.c0 = new double3(m00, m10, m20); + this.c1 = new double3(m01, m11, m21); + } + + /// Constructs a double3x2 matrix from a single double value by assigning it to every component. + /// double to convert to double3x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3x2(double v) + { + this.c0 = v; + this.c1 = v; + } + + /// Constructs a double3x2 matrix from a single bool value by converting it to double and assigning it to every component. + /// bool to convert to double3x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3x2(bool v) + { + this.c0 = math.select(new double3(0.0), new double3(1.0), v); + this.c1 = math.select(new double3(0.0), new double3(1.0), v); + } + + /// Constructs a double3x2 matrix from a bool3x2 matrix by componentwise conversion. + /// bool3x2 to convert to double3x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3x2(bool3x2 v) + { + this.c0 = math.select(new double3(0.0), new double3(1.0), v.c0); + this.c1 = math.select(new double3(0.0), new double3(1.0), v.c1); + } + + /// Constructs a double3x2 matrix from a single int value by converting it to double and assigning it to every component. + /// int to convert to double3x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3x2(int v) + { + this.c0 = v; + this.c1 = v; + } + + /// Constructs a double3x2 matrix from a int3x2 matrix by componentwise conversion. + /// int3x2 to convert to double3x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3x2(int3x2 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + } + + /// Constructs a double3x2 matrix from a single uint value by converting it to double and assigning it to every component. + /// uint to convert to double3x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3x2(uint v) + { + this.c0 = v; + this.c1 = v; + } + + /// Constructs a double3x2 matrix from a uint3x2 matrix by componentwise conversion. + /// uint3x2 to convert to double3x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3x2(uint3x2 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + } + + /// Constructs a double3x2 matrix from a single float value by converting it to double and assigning it to every component. + /// float to convert to double3x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3x2(float v) + { + this.c0 = v; + this.c1 = v; + } + + /// Constructs a double3x2 matrix from a float3x2 matrix by componentwise conversion. + /// float3x2 to convert to double3x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3x2(float3x2 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + } + + + /// Implicitly converts a single double value to a double3x2 matrix by assigning it to every component. + /// double to convert to double3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double3x2(double v) { return new double3x2(v); } + + /// Explicitly converts a single bool value to a double3x2 matrix by converting it to double and assigning it to every component. + /// bool to convert to double3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator double3x2(bool v) { return new double3x2(v); } + + /// Explicitly converts a bool3x2 matrix to a double3x2 matrix by componentwise conversion. + /// bool3x2 to convert to double3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator double3x2(bool3x2 v) { return new double3x2(v); } + + /// Implicitly converts a single int value to a double3x2 matrix by converting it to double and assigning it to every component. + /// int to convert to double3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double3x2(int v) { return new double3x2(v); } + + /// Implicitly converts a int3x2 matrix to a double3x2 matrix by componentwise conversion. + /// int3x2 to convert to double3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double3x2(int3x2 v) { return new double3x2(v); } + + /// Implicitly converts a single uint value to a double3x2 matrix by converting it to double and assigning it to every component. + /// uint to convert to double3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double3x2(uint v) { return new double3x2(v); } + + /// Implicitly converts a uint3x2 matrix to a double3x2 matrix by componentwise conversion. + /// uint3x2 to convert to double3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double3x2(uint3x2 v) { return new double3x2(v); } + + /// Implicitly converts a single float value to a double3x2 matrix by converting it to double and assigning it to every component. + /// float to convert to double3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double3x2(float v) { return new double3x2(v); } + + /// Implicitly converts a float3x2 matrix to a double3x2 matrix by componentwise conversion. + /// float3x2 to convert to double3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double3x2(float3x2 v) { return new double3x2(v); } + + + /// Returns the result of a componentwise multiplication operation on two double3x2 matrices. + /// Left hand side double3x2 to use to compute componentwise multiplication. + /// Right hand side double3x2 to use to compute componentwise multiplication. + /// double3x2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x2 operator * (double3x2 lhs, double3x2 rhs) { return new double3x2 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1); } + + /// Returns the result of a componentwise multiplication operation on a double3x2 matrix and a double value. + /// Left hand side double3x2 to use to compute componentwise multiplication. + /// Right hand side double to use to compute componentwise multiplication. + /// double3x2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x2 operator * (double3x2 lhs, double rhs) { return new double3x2 (lhs.c0 * rhs, lhs.c1 * rhs); } + + /// Returns the result of a componentwise multiplication operation on a double value and a double3x2 matrix. + /// Left hand side double to use to compute componentwise multiplication. + /// Right hand side double3x2 to use to compute componentwise multiplication. + /// double3x2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x2 operator * (double lhs, double3x2 rhs) { return new double3x2 (lhs * rhs.c0, lhs * rhs.c1); } + + + /// Returns the result of a componentwise addition operation on two double3x2 matrices. + /// Left hand side double3x2 to use to compute componentwise addition. + /// Right hand side double3x2 to use to compute componentwise addition. + /// double3x2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x2 operator + (double3x2 lhs, double3x2 rhs) { return new double3x2 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1); } + + /// Returns the result of a componentwise addition operation on a double3x2 matrix and a double value. + /// Left hand side double3x2 to use to compute componentwise addition. + /// Right hand side double to use to compute componentwise addition. + /// double3x2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x2 operator + (double3x2 lhs, double rhs) { return new double3x2 (lhs.c0 + rhs, lhs.c1 + rhs); } + + /// Returns the result of a componentwise addition operation on a double value and a double3x2 matrix. + /// Left hand side double to use to compute componentwise addition. + /// Right hand side double3x2 to use to compute componentwise addition. + /// double3x2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x2 operator + (double lhs, double3x2 rhs) { return new double3x2 (lhs + rhs.c0, lhs + rhs.c1); } + + + /// Returns the result of a componentwise subtraction operation on two double3x2 matrices. + /// Left hand side double3x2 to use to compute componentwise subtraction. + /// Right hand side double3x2 to use to compute componentwise subtraction. + /// double3x2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x2 operator - (double3x2 lhs, double3x2 rhs) { return new double3x2 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1); } + + /// Returns the result of a componentwise subtraction operation on a double3x2 matrix and a double value. + /// Left hand side double3x2 to use to compute componentwise subtraction. + /// Right hand side double to use to compute componentwise subtraction. + /// double3x2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x2 operator - (double3x2 lhs, double rhs) { return new double3x2 (lhs.c0 - rhs, lhs.c1 - rhs); } + + /// Returns the result of a componentwise subtraction operation on a double value and a double3x2 matrix. + /// Left hand side double to use to compute componentwise subtraction. + /// Right hand side double3x2 to use to compute componentwise subtraction. + /// double3x2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x2 operator - (double lhs, double3x2 rhs) { return new double3x2 (lhs - rhs.c0, lhs - rhs.c1); } + + + /// Returns the result of a componentwise division operation on two double3x2 matrices. + /// Left hand side double3x2 to use to compute componentwise division. + /// Right hand side double3x2 to use to compute componentwise division. + /// double3x2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x2 operator / (double3x2 lhs, double3x2 rhs) { return new double3x2 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1); } + + /// Returns the result of a componentwise division operation on a double3x2 matrix and a double value. + /// Left hand side double3x2 to use to compute componentwise division. + /// Right hand side double to use to compute componentwise division. + /// double3x2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x2 operator / (double3x2 lhs, double rhs) { return new double3x2 (lhs.c0 / rhs, lhs.c1 / rhs); } + + /// Returns the result of a componentwise division operation on a double value and a double3x2 matrix. + /// Left hand side double to use to compute componentwise division. + /// Right hand side double3x2 to use to compute componentwise division. + /// double3x2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x2 operator / (double lhs, double3x2 rhs) { return new double3x2 (lhs / rhs.c0, lhs / rhs.c1); } + + + /// Returns the result of a componentwise modulus operation on two double3x2 matrices. + /// Left hand side double3x2 to use to compute componentwise modulus. + /// Right hand side double3x2 to use to compute componentwise modulus. + /// double3x2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x2 operator % (double3x2 lhs, double3x2 rhs) { return new double3x2 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1); } + + /// Returns the result of a componentwise modulus operation on a double3x2 matrix and a double value. + /// Left hand side double3x2 to use to compute componentwise modulus. + /// Right hand side double to use to compute componentwise modulus. + /// double3x2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x2 operator % (double3x2 lhs, double rhs) { return new double3x2 (lhs.c0 % rhs, lhs.c1 % rhs); } + + /// Returns the result of a componentwise modulus operation on a double value and a double3x2 matrix. + /// Left hand side double to use to compute componentwise modulus. + /// Right hand side double3x2 to use to compute componentwise modulus. + /// double3x2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x2 operator % (double lhs, double3x2 rhs) { return new double3x2 (lhs % rhs.c0, lhs % rhs.c1); } + + + /// Returns the result of a componentwise increment operation on a double3x2 matrix. + /// Value to use when computing the componentwise increment. + /// double3x2 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x2 operator ++ (double3x2 val) { return new double3x2 (++val.c0, ++val.c1); } + + + /// Returns the result of a componentwise decrement operation on a double3x2 matrix. + /// Value to use when computing the componentwise decrement. + /// double3x2 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x2 operator -- (double3x2 val) { return new double3x2 (--val.c0, --val.c1); } + + + /// Returns the result of a componentwise less than operation on two double3x2 matrices. + /// Left hand side double3x2 to use to compute componentwise less than. + /// Right hand side double3x2 to use to compute componentwise less than. + /// bool3x2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator < (double3x2 lhs, double3x2 rhs) { return new bool3x2 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1); } + + /// Returns the result of a componentwise less than operation on a double3x2 matrix and a double value. + /// Left hand side double3x2 to use to compute componentwise less than. + /// Right hand side double to use to compute componentwise less than. + /// bool3x2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator < (double3x2 lhs, double rhs) { return new bool3x2 (lhs.c0 < rhs, lhs.c1 < rhs); } + + /// Returns the result of a componentwise less than operation on a double value and a double3x2 matrix. + /// Left hand side double to use to compute componentwise less than. + /// Right hand side double3x2 to use to compute componentwise less than. + /// bool3x2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator < (double lhs, double3x2 rhs) { return new bool3x2 (lhs < rhs.c0, lhs < rhs.c1); } + + + /// Returns the result of a componentwise less or equal operation on two double3x2 matrices. + /// Left hand side double3x2 to use to compute componentwise less or equal. + /// Right hand side double3x2 to use to compute componentwise less or equal. + /// bool3x2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator <= (double3x2 lhs, double3x2 rhs) { return new bool3x2 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1); } + + /// Returns the result of a componentwise less or equal operation on a double3x2 matrix and a double value. + /// Left hand side double3x2 to use to compute componentwise less or equal. + /// Right hand side double to use to compute componentwise less or equal. + /// bool3x2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator <= (double3x2 lhs, double rhs) { return new bool3x2 (lhs.c0 <= rhs, lhs.c1 <= rhs); } + + /// Returns the result of a componentwise less or equal operation on a double value and a double3x2 matrix. + /// Left hand side double to use to compute componentwise less or equal. + /// Right hand side double3x2 to use to compute componentwise less or equal. + /// bool3x2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator <= (double lhs, double3x2 rhs) { return new bool3x2 (lhs <= rhs.c0, lhs <= rhs.c1); } + + + /// Returns the result of a componentwise greater than operation on two double3x2 matrices. + /// Left hand side double3x2 to use to compute componentwise greater than. + /// Right hand side double3x2 to use to compute componentwise greater than. + /// bool3x2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator > (double3x2 lhs, double3x2 rhs) { return new bool3x2 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1); } + + /// Returns the result of a componentwise greater than operation on a double3x2 matrix and a double value. + /// Left hand side double3x2 to use to compute componentwise greater than. + /// Right hand side double to use to compute componentwise greater than. + /// bool3x2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator > (double3x2 lhs, double rhs) { return new bool3x2 (lhs.c0 > rhs, lhs.c1 > rhs); } + + /// Returns the result of a componentwise greater than operation on a double value and a double3x2 matrix. + /// Left hand side double to use to compute componentwise greater than. + /// Right hand side double3x2 to use to compute componentwise greater than. + /// bool3x2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator > (double lhs, double3x2 rhs) { return new bool3x2 (lhs > rhs.c0, lhs > rhs.c1); } + + + /// Returns the result of a componentwise greater or equal operation on two double3x2 matrices. + /// Left hand side double3x2 to use to compute componentwise greater or equal. + /// Right hand side double3x2 to use to compute componentwise greater or equal. + /// bool3x2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator >= (double3x2 lhs, double3x2 rhs) { return new bool3x2 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1); } + + /// Returns the result of a componentwise greater or equal operation on a double3x2 matrix and a double value. + /// Left hand side double3x2 to use to compute componentwise greater or equal. + /// Right hand side double to use to compute componentwise greater or equal. + /// bool3x2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator >= (double3x2 lhs, double rhs) { return new bool3x2 (lhs.c0 >= rhs, lhs.c1 >= rhs); } + + /// Returns the result of a componentwise greater or equal operation on a double value and a double3x2 matrix. + /// Left hand side double to use to compute componentwise greater or equal. + /// Right hand side double3x2 to use to compute componentwise greater or equal. + /// bool3x2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator >= (double lhs, double3x2 rhs) { return new bool3x2 (lhs >= rhs.c0, lhs >= rhs.c1); } + + + /// Returns the result of a componentwise unary minus operation on a double3x2 matrix. + /// Value to use when computing the componentwise unary minus. + /// double3x2 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x2 operator - (double3x2 val) { return new double3x2 (-val.c0, -val.c1); } + + + /// Returns the result of a componentwise unary plus operation on a double3x2 matrix. + /// Value to use when computing the componentwise unary plus. + /// double3x2 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x2 operator + (double3x2 val) { return new double3x2 (+val.c0, +val.c1); } + + + /// Returns the result of a componentwise equality operation on two double3x2 matrices. + /// Left hand side double3x2 to use to compute componentwise equality. + /// Right hand side double3x2 to use to compute componentwise equality. + /// bool3x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator == (double3x2 lhs, double3x2 rhs) { return new bool3x2 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1); } + + /// Returns the result of a componentwise equality operation on a double3x2 matrix and a double value. + /// Left hand side double3x2 to use to compute componentwise equality. + /// Right hand side double to use to compute componentwise equality. + /// bool3x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator == (double3x2 lhs, double rhs) { return new bool3x2 (lhs.c0 == rhs, lhs.c1 == rhs); } + + /// Returns the result of a componentwise equality operation on a double value and a double3x2 matrix. + /// Left hand side double to use to compute componentwise equality. + /// Right hand side double3x2 to use to compute componentwise equality. + /// bool3x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator == (double lhs, double3x2 rhs) { return new bool3x2 (lhs == rhs.c0, lhs == rhs.c1); } + + + /// Returns the result of a componentwise not equal operation on two double3x2 matrices. + /// Left hand side double3x2 to use to compute componentwise not equal. + /// Right hand side double3x2 to use to compute componentwise not equal. + /// bool3x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator != (double3x2 lhs, double3x2 rhs) { return new bool3x2 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1); } + + /// Returns the result of a componentwise not equal operation on a double3x2 matrix and a double value. + /// Left hand side double3x2 to use to compute componentwise not equal. + /// Right hand side double to use to compute componentwise not equal. + /// bool3x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator != (double3x2 lhs, double rhs) { return new bool3x2 (lhs.c0 != rhs, lhs.c1 != rhs); } + + /// Returns the result of a componentwise not equal operation on a double value and a double3x2 matrix. + /// Left hand side double to use to compute componentwise not equal. + /// Right hand side double3x2 to use to compute componentwise not equal. + /// bool3x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator != (double lhs, double3x2 rhs) { return new bool3x2 (lhs != rhs.c0, lhs != rhs.c1); } + + + + /// Returns the double3 element at a specified index. + unsafe public ref double3 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 2) + throw new System.ArgumentException("index must be between[0...1]"); +#endif + fixed (double3x2* array = &this) { return ref ((double3*)array)[index]; } + } + } + + /// Returns true if the double3x2 is equal to a given double3x2, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(double3x2 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1); } + + /// Returns true if the double3x2 is equal to a given double3x2, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is double3x2 converted && Equals(converted); } + + + /// Returns a hash code for the double3x2. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the double3x2. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("double3x2({0}, {1}, {2}, {3}, {4}, {5})", c0.x, c1.x, c0.y, c1.y, c0.z, c1.z); + } + + /// Returns a string representation of the double3x2 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("double3x2({0}, {1}, {2}, {3}, {4}, {5})", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c0.z.ToString(format, formatProvider), c1.z.ToString(format, formatProvider)); + } + + } + + public static partial class math + { + /// Returns a double3x2 matrix constructed from two double3 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// double3x2 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x2 double3x2(double3 c0, double3 c1) { return new double3x2(c0, c1); } + + /// Returns a double3x2 matrix constructed from from 6 double values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// double3x2 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x2 double3x2(double m00, double m01, + double m10, double m11, + double m20, double m21) + { + return new double3x2(m00, m01, + m10, m11, + m20, m21); + } + + /// Returns a double3x2 matrix constructed from a single double value by assigning it to every component. + /// double to convert to double3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x2 double3x2(double v) { return new double3x2(v); } + + /// Returns a double3x2 matrix constructed from a single bool value by converting it to double and assigning it to every component. + /// bool to convert to double3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x2 double3x2(bool v) { return new double3x2(v); } + + /// Return a double3x2 matrix constructed from a bool3x2 matrix by componentwise conversion. + /// bool3x2 to convert to double3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x2 double3x2(bool3x2 v) { return new double3x2(v); } + + /// Returns a double3x2 matrix constructed from a single int value by converting it to double and assigning it to every component. + /// int to convert to double3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x2 double3x2(int v) { return new double3x2(v); } + + /// Return a double3x2 matrix constructed from a int3x2 matrix by componentwise conversion. + /// int3x2 to convert to double3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x2 double3x2(int3x2 v) { return new double3x2(v); } + + /// Returns a double3x2 matrix constructed from a single uint value by converting it to double and assigning it to every component. + /// uint to convert to double3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x2 double3x2(uint v) { return new double3x2(v); } + + /// Return a double3x2 matrix constructed from a uint3x2 matrix by componentwise conversion. + /// uint3x2 to convert to double3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x2 double3x2(uint3x2 v) { return new double3x2(v); } + + /// Returns a double3x2 matrix constructed from a single float value by converting it to double and assigning it to every component. + /// float to convert to double3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x2 double3x2(float v) { return new double3x2(v); } + + /// Return a double3x2 matrix constructed from a float3x2 matrix by componentwise conversion. + /// float3x2 to convert to double3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x2 double3x2(float3x2 v) { return new double3x2(v); } + + /// Return the double2x3 transpose of a double3x2 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x3 transpose(double3x2 v) + { + return double2x3( + v.c0.x, v.c0.y, v.c0.z, + v.c1.x, v.c1.y, v.c1.z); + } + + /// Returns a uint hash code of a double3x2 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(double3x2 v) + { + return csum(fold_to_uint(v.c0) * uint3(0xEE390C97u, 0x9C8A2F05u, 0x4DDC6509u) + + fold_to_uint(v.c1) * uint3(0x7CF083CBu, 0x5C4D6CEDu, 0xF9137117u)) + 0xE857DCE1u; + } + + /// + /// Returns a uint3 vector hash code of a double3x2 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint3 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 hashwide(double3x2 v) + { + return (fold_to_uint(v.c0) * uint3(0xF62213C5u, 0x9CDAA959u, 0xAA269ABFu) + + fold_to_uint(v.c1) * uint3(0xD54BA36Fu, 0xFD0847B9u, 0x8189A683u)) + 0xB139D651u; + } + + } +} diff --git a/src/Unity.Mathematics/double3x2.gen.cs.meta b/src/Unity.Mathematics/double3x2.gen.cs.meta new file mode 100644 index 00000000..628f16d3 --- /dev/null +++ b/src/Unity.Mathematics/double3x2.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dbb081701c605492aa7bca8b0dcd80d7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/double3x3.gen.cs b/src/Unity.Mathematics/double3x3.gen.cs new file mode 100644 index 00000000..1bdeb13f --- /dev/null +++ b/src/Unity.Mathematics/double3x3.gen.cs @@ -0,0 +1,697 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 3x3 matrix of doubles. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct double3x3 : System.IEquatable, IFormattable + { + /// Column 0 of the matrix. + public double3 c0; + /// Column 1 of the matrix. + public double3 c1; + /// Column 2 of the matrix. + public double3 c2; + + /// double3x3 identity transform. + public static readonly double3x3 identity = new double3x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0); + + /// double3x3 zero value. + public static readonly double3x3 zero; + + /// Constructs a double3x3 matrix from three double3 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3x3(double3 c0, double3 c1, double3 c2) + { + this.c0 = c0; + this.c1 = c1; + this.c2 = c2; + } + + /// Constructs a double3x3 matrix from 9 double values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 2, column 2 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3x3(double m00, double m01, double m02, + double m10, double m11, double m12, + double m20, double m21, double m22) + { + this.c0 = new double3(m00, m10, m20); + this.c1 = new double3(m01, m11, m21); + this.c2 = new double3(m02, m12, m22); + } + + /// Constructs a double3x3 matrix from a single double value by assigning it to every component. + /// double to convert to double3x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3x3(double v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + } + + /// Constructs a double3x3 matrix from a single bool value by converting it to double and assigning it to every component. + /// bool to convert to double3x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3x3(bool v) + { + this.c0 = math.select(new double3(0.0), new double3(1.0), v); + this.c1 = math.select(new double3(0.0), new double3(1.0), v); + this.c2 = math.select(new double3(0.0), new double3(1.0), v); + } + + /// Constructs a double3x3 matrix from a bool3x3 matrix by componentwise conversion. + /// bool3x3 to convert to double3x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3x3(bool3x3 v) + { + this.c0 = math.select(new double3(0.0), new double3(1.0), v.c0); + this.c1 = math.select(new double3(0.0), new double3(1.0), v.c1); + this.c2 = math.select(new double3(0.0), new double3(1.0), v.c2); + } + + /// Constructs a double3x3 matrix from a single int value by converting it to double and assigning it to every component. + /// int to convert to double3x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3x3(int v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + } + + /// Constructs a double3x3 matrix from a int3x3 matrix by componentwise conversion. + /// int3x3 to convert to double3x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3x3(int3x3 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + this.c2 = v.c2; + } + + /// Constructs a double3x3 matrix from a single uint value by converting it to double and assigning it to every component. + /// uint to convert to double3x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3x3(uint v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + } + + /// Constructs a double3x3 matrix from a uint3x3 matrix by componentwise conversion. + /// uint3x3 to convert to double3x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3x3(uint3x3 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + this.c2 = v.c2; + } + + /// Constructs a double3x3 matrix from a single float value by converting it to double and assigning it to every component. + /// float to convert to double3x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3x3(float v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + } + + /// Constructs a double3x3 matrix from a float3x3 matrix by componentwise conversion. + /// float3x3 to convert to double3x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3x3(float3x3 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + this.c2 = v.c2; + } + + + /// Implicitly converts a single double value to a double3x3 matrix by assigning it to every component. + /// double to convert to double3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double3x3(double v) { return new double3x3(v); } + + /// Explicitly converts a single bool value to a double3x3 matrix by converting it to double and assigning it to every component. + /// bool to convert to double3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator double3x3(bool v) { return new double3x3(v); } + + /// Explicitly converts a bool3x3 matrix to a double3x3 matrix by componentwise conversion. + /// bool3x3 to convert to double3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator double3x3(bool3x3 v) { return new double3x3(v); } + + /// Implicitly converts a single int value to a double3x3 matrix by converting it to double and assigning it to every component. + /// int to convert to double3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double3x3(int v) { return new double3x3(v); } + + /// Implicitly converts a int3x3 matrix to a double3x3 matrix by componentwise conversion. + /// int3x3 to convert to double3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double3x3(int3x3 v) { return new double3x3(v); } + + /// Implicitly converts a single uint value to a double3x3 matrix by converting it to double and assigning it to every component. + /// uint to convert to double3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double3x3(uint v) { return new double3x3(v); } + + /// Implicitly converts a uint3x3 matrix to a double3x3 matrix by componentwise conversion. + /// uint3x3 to convert to double3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double3x3(uint3x3 v) { return new double3x3(v); } + + /// Implicitly converts a single float value to a double3x3 matrix by converting it to double and assigning it to every component. + /// float to convert to double3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double3x3(float v) { return new double3x3(v); } + + /// Implicitly converts a float3x3 matrix to a double3x3 matrix by componentwise conversion. + /// float3x3 to convert to double3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double3x3(float3x3 v) { return new double3x3(v); } + + + /// Returns the result of a componentwise multiplication operation on two double3x3 matrices. + /// Left hand side double3x3 to use to compute componentwise multiplication. + /// Right hand side double3x3 to use to compute componentwise multiplication. + /// double3x3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x3 operator * (double3x3 lhs, double3x3 rhs) { return new double3x3 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1, lhs.c2 * rhs.c2); } + + /// Returns the result of a componentwise multiplication operation on a double3x3 matrix and a double value. + /// Left hand side double3x3 to use to compute componentwise multiplication. + /// Right hand side double to use to compute componentwise multiplication. + /// double3x3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x3 operator * (double3x3 lhs, double rhs) { return new double3x3 (lhs.c0 * rhs, lhs.c1 * rhs, lhs.c2 * rhs); } + + /// Returns the result of a componentwise multiplication operation on a double value and a double3x3 matrix. + /// Left hand side double to use to compute componentwise multiplication. + /// Right hand side double3x3 to use to compute componentwise multiplication. + /// double3x3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x3 operator * (double lhs, double3x3 rhs) { return new double3x3 (lhs * rhs.c0, lhs * rhs.c1, lhs * rhs.c2); } + + + /// Returns the result of a componentwise addition operation on two double3x3 matrices. + /// Left hand side double3x3 to use to compute componentwise addition. + /// Right hand side double3x3 to use to compute componentwise addition. + /// double3x3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x3 operator + (double3x3 lhs, double3x3 rhs) { return new double3x3 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1, lhs.c2 + rhs.c2); } + + /// Returns the result of a componentwise addition operation on a double3x3 matrix and a double value. + /// Left hand side double3x3 to use to compute componentwise addition. + /// Right hand side double to use to compute componentwise addition. + /// double3x3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x3 operator + (double3x3 lhs, double rhs) { return new double3x3 (lhs.c0 + rhs, lhs.c1 + rhs, lhs.c2 + rhs); } + + /// Returns the result of a componentwise addition operation on a double value and a double3x3 matrix. + /// Left hand side double to use to compute componentwise addition. + /// Right hand side double3x3 to use to compute componentwise addition. + /// double3x3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x3 operator + (double lhs, double3x3 rhs) { return new double3x3 (lhs + rhs.c0, lhs + rhs.c1, lhs + rhs.c2); } + + + /// Returns the result of a componentwise subtraction operation on two double3x3 matrices. + /// Left hand side double3x3 to use to compute componentwise subtraction. + /// Right hand side double3x3 to use to compute componentwise subtraction. + /// double3x3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x3 operator - (double3x3 lhs, double3x3 rhs) { return new double3x3 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1, lhs.c2 - rhs.c2); } + + /// Returns the result of a componentwise subtraction operation on a double3x3 matrix and a double value. + /// Left hand side double3x3 to use to compute componentwise subtraction. + /// Right hand side double to use to compute componentwise subtraction. + /// double3x3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x3 operator - (double3x3 lhs, double rhs) { return new double3x3 (lhs.c0 - rhs, lhs.c1 - rhs, lhs.c2 - rhs); } + + /// Returns the result of a componentwise subtraction operation on a double value and a double3x3 matrix. + /// Left hand side double to use to compute componentwise subtraction. + /// Right hand side double3x3 to use to compute componentwise subtraction. + /// double3x3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x3 operator - (double lhs, double3x3 rhs) { return new double3x3 (lhs - rhs.c0, lhs - rhs.c1, lhs - rhs.c2); } + + + /// Returns the result of a componentwise division operation on two double3x3 matrices. + /// Left hand side double3x3 to use to compute componentwise division. + /// Right hand side double3x3 to use to compute componentwise division. + /// double3x3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x3 operator / (double3x3 lhs, double3x3 rhs) { return new double3x3 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1, lhs.c2 / rhs.c2); } + + /// Returns the result of a componentwise division operation on a double3x3 matrix and a double value. + /// Left hand side double3x3 to use to compute componentwise division. + /// Right hand side double to use to compute componentwise division. + /// double3x3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x3 operator / (double3x3 lhs, double rhs) { return new double3x3 (lhs.c0 / rhs, lhs.c1 / rhs, lhs.c2 / rhs); } + + /// Returns the result of a componentwise division operation on a double value and a double3x3 matrix. + /// Left hand side double to use to compute componentwise division. + /// Right hand side double3x3 to use to compute componentwise division. + /// double3x3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x3 operator / (double lhs, double3x3 rhs) { return new double3x3 (lhs / rhs.c0, lhs / rhs.c1, lhs / rhs.c2); } + + + /// Returns the result of a componentwise modulus operation on two double3x3 matrices. + /// Left hand side double3x3 to use to compute componentwise modulus. + /// Right hand side double3x3 to use to compute componentwise modulus. + /// double3x3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x3 operator % (double3x3 lhs, double3x3 rhs) { return new double3x3 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1, lhs.c2 % rhs.c2); } + + /// Returns the result of a componentwise modulus operation on a double3x3 matrix and a double value. + /// Left hand side double3x3 to use to compute componentwise modulus. + /// Right hand side double to use to compute componentwise modulus. + /// double3x3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x3 operator % (double3x3 lhs, double rhs) { return new double3x3 (lhs.c0 % rhs, lhs.c1 % rhs, lhs.c2 % rhs); } + + /// Returns the result of a componentwise modulus operation on a double value and a double3x3 matrix. + /// Left hand side double to use to compute componentwise modulus. + /// Right hand side double3x3 to use to compute componentwise modulus. + /// double3x3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x3 operator % (double lhs, double3x3 rhs) { return new double3x3 (lhs % rhs.c0, lhs % rhs.c1, lhs % rhs.c2); } + + + /// Returns the result of a componentwise increment operation on a double3x3 matrix. + /// Value to use when computing the componentwise increment. + /// double3x3 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x3 operator ++ (double3x3 val) { return new double3x3 (++val.c0, ++val.c1, ++val.c2); } + + + /// Returns the result of a componentwise decrement operation on a double3x3 matrix. + /// Value to use when computing the componentwise decrement. + /// double3x3 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x3 operator -- (double3x3 val) { return new double3x3 (--val.c0, --val.c1, --val.c2); } + + + /// Returns the result of a componentwise less than operation on two double3x3 matrices. + /// Left hand side double3x3 to use to compute componentwise less than. + /// Right hand side double3x3 to use to compute componentwise less than. + /// bool3x3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator < (double3x3 lhs, double3x3 rhs) { return new bool3x3 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1, lhs.c2 < rhs.c2); } + + /// Returns the result of a componentwise less than operation on a double3x3 matrix and a double value. + /// Left hand side double3x3 to use to compute componentwise less than. + /// Right hand side double to use to compute componentwise less than. + /// bool3x3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator < (double3x3 lhs, double rhs) { return new bool3x3 (lhs.c0 < rhs, lhs.c1 < rhs, lhs.c2 < rhs); } + + /// Returns the result of a componentwise less than operation on a double value and a double3x3 matrix. + /// Left hand side double to use to compute componentwise less than. + /// Right hand side double3x3 to use to compute componentwise less than. + /// bool3x3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator < (double lhs, double3x3 rhs) { return new bool3x3 (lhs < rhs.c0, lhs < rhs.c1, lhs < rhs.c2); } + + + /// Returns the result of a componentwise less or equal operation on two double3x3 matrices. + /// Left hand side double3x3 to use to compute componentwise less or equal. + /// Right hand side double3x3 to use to compute componentwise less or equal. + /// bool3x3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator <= (double3x3 lhs, double3x3 rhs) { return new bool3x3 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1, lhs.c2 <= rhs.c2); } + + /// Returns the result of a componentwise less or equal operation on a double3x3 matrix and a double value. + /// Left hand side double3x3 to use to compute componentwise less or equal. + /// Right hand side double to use to compute componentwise less or equal. + /// bool3x3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator <= (double3x3 lhs, double rhs) { return new bool3x3 (lhs.c0 <= rhs, lhs.c1 <= rhs, lhs.c2 <= rhs); } + + /// Returns the result of a componentwise less or equal operation on a double value and a double3x3 matrix. + /// Left hand side double to use to compute componentwise less or equal. + /// Right hand side double3x3 to use to compute componentwise less or equal. + /// bool3x3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator <= (double lhs, double3x3 rhs) { return new bool3x3 (lhs <= rhs.c0, lhs <= rhs.c1, lhs <= rhs.c2); } + + + /// Returns the result of a componentwise greater than operation on two double3x3 matrices. + /// Left hand side double3x3 to use to compute componentwise greater than. + /// Right hand side double3x3 to use to compute componentwise greater than. + /// bool3x3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator > (double3x3 lhs, double3x3 rhs) { return new bool3x3 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1, lhs.c2 > rhs.c2); } + + /// Returns the result of a componentwise greater than operation on a double3x3 matrix and a double value. + /// Left hand side double3x3 to use to compute componentwise greater than. + /// Right hand side double to use to compute componentwise greater than. + /// bool3x3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator > (double3x3 lhs, double rhs) { return new bool3x3 (lhs.c0 > rhs, lhs.c1 > rhs, lhs.c2 > rhs); } + + /// Returns the result of a componentwise greater than operation on a double value and a double3x3 matrix. + /// Left hand side double to use to compute componentwise greater than. + /// Right hand side double3x3 to use to compute componentwise greater than. + /// bool3x3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator > (double lhs, double3x3 rhs) { return new bool3x3 (lhs > rhs.c0, lhs > rhs.c1, lhs > rhs.c2); } + + + /// Returns the result of a componentwise greater or equal operation on two double3x3 matrices. + /// Left hand side double3x3 to use to compute componentwise greater or equal. + /// Right hand side double3x3 to use to compute componentwise greater or equal. + /// bool3x3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator >= (double3x3 lhs, double3x3 rhs) { return new bool3x3 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1, lhs.c2 >= rhs.c2); } + + /// Returns the result of a componentwise greater or equal operation on a double3x3 matrix and a double value. + /// Left hand side double3x3 to use to compute componentwise greater or equal. + /// Right hand side double to use to compute componentwise greater or equal. + /// bool3x3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator >= (double3x3 lhs, double rhs) { return new bool3x3 (lhs.c0 >= rhs, lhs.c1 >= rhs, lhs.c2 >= rhs); } + + /// Returns the result of a componentwise greater or equal operation on a double value and a double3x3 matrix. + /// Left hand side double to use to compute componentwise greater or equal. + /// Right hand side double3x3 to use to compute componentwise greater or equal. + /// bool3x3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator >= (double lhs, double3x3 rhs) { return new bool3x3 (lhs >= rhs.c0, lhs >= rhs.c1, lhs >= rhs.c2); } + + + /// Returns the result of a componentwise unary minus operation on a double3x3 matrix. + /// Value to use when computing the componentwise unary minus. + /// double3x3 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x3 operator - (double3x3 val) { return new double3x3 (-val.c0, -val.c1, -val.c2); } + + + /// Returns the result of a componentwise unary plus operation on a double3x3 matrix. + /// Value to use when computing the componentwise unary plus. + /// double3x3 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x3 operator + (double3x3 val) { return new double3x3 (+val.c0, +val.c1, +val.c2); } + + + /// Returns the result of a componentwise equality operation on two double3x3 matrices. + /// Left hand side double3x3 to use to compute componentwise equality. + /// Right hand side double3x3 to use to compute componentwise equality. + /// bool3x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator == (double3x3 lhs, double3x3 rhs) { return new bool3x3 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2); } + + /// Returns the result of a componentwise equality operation on a double3x3 matrix and a double value. + /// Left hand side double3x3 to use to compute componentwise equality. + /// Right hand side double to use to compute componentwise equality. + /// bool3x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator == (double3x3 lhs, double rhs) { return new bool3x3 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs); } + + /// Returns the result of a componentwise equality operation on a double value and a double3x3 matrix. + /// Left hand side double to use to compute componentwise equality. + /// Right hand side double3x3 to use to compute componentwise equality. + /// bool3x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator == (double lhs, double3x3 rhs) { return new bool3x3 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2); } + + + /// Returns the result of a componentwise not equal operation on two double3x3 matrices. + /// Left hand side double3x3 to use to compute componentwise not equal. + /// Right hand side double3x3 to use to compute componentwise not equal. + /// bool3x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator != (double3x3 lhs, double3x3 rhs) { return new bool3x3 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2); } + + /// Returns the result of a componentwise not equal operation on a double3x3 matrix and a double value. + /// Left hand side double3x3 to use to compute componentwise not equal. + /// Right hand side double to use to compute componentwise not equal. + /// bool3x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator != (double3x3 lhs, double rhs) { return new bool3x3 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs); } + + /// Returns the result of a componentwise not equal operation on a double value and a double3x3 matrix. + /// Left hand side double to use to compute componentwise not equal. + /// Right hand side double3x3 to use to compute componentwise not equal. + /// bool3x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator != (double lhs, double3x3 rhs) { return new bool3x3 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2); } + + + + /// Returns the double3 element at a specified index. + unsafe public ref double3 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 3) + throw new System.ArgumentException("index must be between[0...2]"); +#endif + fixed (double3x3* array = &this) { return ref ((double3*)array)[index]; } + } + } + + /// Returns true if the double3x3 is equal to a given double3x3, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(double3x3 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2); } + + /// Returns true if the double3x3 is equal to a given double3x3, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is double3x3 converted && Equals(converted); } + + + /// Returns a hash code for the double3x3. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the double3x3. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("double3x3({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8})", c0.x, c1.x, c2.x, c0.y, c1.y, c2.y, c0.z, c1.z, c2.z); + } + + /// Returns a string representation of the double3x3 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("double3x3({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8})", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c2.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c2.y.ToString(format, formatProvider), c0.z.ToString(format, formatProvider), c1.z.ToString(format, formatProvider), c2.z.ToString(format, formatProvider)); + } + + } + + public static partial class math + { + /// Returns a double3x3 matrix constructed from three double3 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// double3x3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x3 double3x3(double3 c0, double3 c1, double3 c2) { return new double3x3(c0, c1, c2); } + + /// Returns a double3x3 matrix constructed from from 9 double values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 2, column 2 will be set to this value. + /// double3x3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x3 double3x3(double m00, double m01, double m02, + double m10, double m11, double m12, + double m20, double m21, double m22) + { + return new double3x3(m00, m01, m02, + m10, m11, m12, + m20, m21, m22); + } + + /// Returns a double3x3 matrix constructed from a single double value by assigning it to every component. + /// double to convert to double3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x3 double3x3(double v) { return new double3x3(v); } + + /// Returns a double3x3 matrix constructed from a single bool value by converting it to double and assigning it to every component. + /// bool to convert to double3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x3 double3x3(bool v) { return new double3x3(v); } + + /// Return a double3x3 matrix constructed from a bool3x3 matrix by componentwise conversion. + /// bool3x3 to convert to double3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x3 double3x3(bool3x3 v) { return new double3x3(v); } + + /// Returns a double3x3 matrix constructed from a single int value by converting it to double and assigning it to every component. + /// int to convert to double3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x3 double3x3(int v) { return new double3x3(v); } + + /// Return a double3x3 matrix constructed from a int3x3 matrix by componentwise conversion. + /// int3x3 to convert to double3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x3 double3x3(int3x3 v) { return new double3x3(v); } + + /// Returns a double3x3 matrix constructed from a single uint value by converting it to double and assigning it to every component. + /// uint to convert to double3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x3 double3x3(uint v) { return new double3x3(v); } + + /// Return a double3x3 matrix constructed from a uint3x3 matrix by componentwise conversion. + /// uint3x3 to convert to double3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x3 double3x3(uint3x3 v) { return new double3x3(v); } + + /// Returns a double3x3 matrix constructed from a single float value by converting it to double and assigning it to every component. + /// float to convert to double3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x3 double3x3(float v) { return new double3x3(v); } + + /// Return a double3x3 matrix constructed from a float3x3 matrix by componentwise conversion. + /// float3x3 to convert to double3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x3 double3x3(float3x3 v) { return new double3x3(v); } + + /// Return the double3x3 transpose of a double3x3 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x3 transpose(double3x3 v) + { + return double3x3( + v.c0.x, v.c0.y, v.c0.z, + v.c1.x, v.c1.y, v.c1.z, + v.c2.x, v.c2.y, v.c2.z); + } + + /// Returns the double3x3 full inverse of a double3x3 matrix. + /// Matrix to invert. + /// The inverted matrix. + public static double3x3 inverse(double3x3 m) + { + double3 c0 = m.c0; + double3 c1 = m.c1; + double3 c2 = m.c2; + + double3 t0 = double3(c1.x, c2.x, c0.x); + double3 t1 = double3(c1.y, c2.y, c0.y); + double3 t2 = double3(c1.z, c2.z, c0.z); + + double3 m0 = t1 * t2.yzx - t1.yzx * t2; + double3 m1 = t0.yzx * t2 - t0 * t2.yzx; + double3 m2 = t0 * t1.yzx - t0.yzx * t1; + + double rcpDet = 1.0 / csum(t0.zxy * m0); + return double3x3(m0, m1, m2) * rcpDet; + } + + /// Returns the determinant of a double3x3 matrix. + /// Matrix to use when computing determinant. + /// The determinant of the matrix. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double determinant(double3x3 m) + { + double3 c0 = m.c0; + double3 c1 = m.c1; + double3 c2 = m.c2; + + double m00 = c1.y * c2.z - c1.z * c2.y; + double m01 = c0.y * c2.z - c0.z * c2.y; + double m02 = c0.y * c1.z - c0.z * c1.y; + + return c0.x * m00 - c1.x * m01 + c2.x * m02; + } + + /// Returns a uint hash code of a double3x3 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(double3x3 v) + { + return csum(fold_to_uint(v.c0) * uint3(0xAC5DB57Bu, 0xA91A02EDu, 0xB3C49313u) + + fold_to_uint(v.c1) * uint3(0xF43A9ABBu, 0x84E7E01Bu, 0x8E055BE5u) + + fold_to_uint(v.c2) * uint3(0x6E624EB7u, 0x7383ED49u, 0xDD49C23Bu)) + 0xEBD0D005u; + } + + /// + /// Returns a uint3 vector hash code of a double3x3 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint3 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 hashwide(double3x3 v) + { + return (fold_to_uint(v.c0) * uint3(0x91475DF7u, 0x55E84827u, 0x90A285BBu) + + fold_to_uint(v.c1) * uint3(0x5D19E1D5u, 0xFAAF07DDu, 0x625C45BDu) + + fold_to_uint(v.c2) * uint3(0xC9F27FCBu, 0x6D2523B1u, 0x6E2BF6A9u)) + 0xCC74B3B7u; + } + + } +} diff --git a/src/Unity.Mathematics/double3x3.gen.cs.meta b/src/Unity.Mathematics/double3x3.gen.cs.meta new file mode 100644 index 00000000..68223744 --- /dev/null +++ b/src/Unity.Mathematics/double3x3.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f1e8e688d7f354f92a78d4d78697150d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/double3x4.gen.cs b/src/Unity.Mathematics/double3x4.gen.cs new file mode 100644 index 00000000..5e687dce --- /dev/null +++ b/src/Unity.Mathematics/double3x4.gen.cs @@ -0,0 +1,699 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 3x4 matrix of doubles. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct double3x4 : System.IEquatable, IFormattable + { + /// Column 0 of the matrix. + public double3 c0; + /// Column 1 of the matrix. + public double3 c1; + /// Column 2 of the matrix. + public double3 c2; + /// Column 3 of the matrix. + public double3 c3; + + /// double3x4 zero value. + public static readonly double3x4 zero; + + /// Constructs a double3x4 matrix from four double3 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// The matrix column c3 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3x4(double3 c0, double3 c1, double3 c2, double3 c3) + { + this.c0 = c0; + this.c1 = c1; + this.c2 = c2; + this.c3 = c3; + } + + /// Constructs a double3x4 matrix from 12 double values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 0, column 3 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 1, column 3 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 2, column 2 will be set to this value. + /// The matrix at row 2, column 3 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3x4(double m00, double m01, double m02, double m03, + double m10, double m11, double m12, double m13, + double m20, double m21, double m22, double m23) + { + this.c0 = new double3(m00, m10, m20); + this.c1 = new double3(m01, m11, m21); + this.c2 = new double3(m02, m12, m22); + this.c3 = new double3(m03, m13, m23); + } + + /// Constructs a double3x4 matrix from a single double value by assigning it to every component. + /// double to convert to double3x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3x4(double v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + this.c3 = v; + } + + /// Constructs a double3x4 matrix from a single bool value by converting it to double and assigning it to every component. + /// bool to convert to double3x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3x4(bool v) + { + this.c0 = math.select(new double3(0.0), new double3(1.0), v); + this.c1 = math.select(new double3(0.0), new double3(1.0), v); + this.c2 = math.select(new double3(0.0), new double3(1.0), v); + this.c3 = math.select(new double3(0.0), new double3(1.0), v); + } + + /// Constructs a double3x4 matrix from a bool3x4 matrix by componentwise conversion. + /// bool3x4 to convert to double3x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3x4(bool3x4 v) + { + this.c0 = math.select(new double3(0.0), new double3(1.0), v.c0); + this.c1 = math.select(new double3(0.0), new double3(1.0), v.c1); + this.c2 = math.select(new double3(0.0), new double3(1.0), v.c2); + this.c3 = math.select(new double3(0.0), new double3(1.0), v.c3); + } + + /// Constructs a double3x4 matrix from a single int value by converting it to double and assigning it to every component. + /// int to convert to double3x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3x4(int v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + this.c3 = v; + } + + /// Constructs a double3x4 matrix from a int3x4 matrix by componentwise conversion. + /// int3x4 to convert to double3x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3x4(int3x4 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + this.c2 = v.c2; + this.c3 = v.c3; + } + + /// Constructs a double3x4 matrix from a single uint value by converting it to double and assigning it to every component. + /// uint to convert to double3x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3x4(uint v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + this.c3 = v; + } + + /// Constructs a double3x4 matrix from a uint3x4 matrix by componentwise conversion. + /// uint3x4 to convert to double3x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3x4(uint3x4 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + this.c2 = v.c2; + this.c3 = v.c3; + } + + /// Constructs a double3x4 matrix from a single float value by converting it to double and assigning it to every component. + /// float to convert to double3x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3x4(float v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + this.c3 = v; + } + + /// Constructs a double3x4 matrix from a float3x4 matrix by componentwise conversion. + /// float3x4 to convert to double3x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3x4(float3x4 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + this.c2 = v.c2; + this.c3 = v.c3; + } + + + /// Implicitly converts a single double value to a double3x4 matrix by assigning it to every component. + /// double to convert to double3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double3x4(double v) { return new double3x4(v); } + + /// Explicitly converts a single bool value to a double3x4 matrix by converting it to double and assigning it to every component. + /// bool to convert to double3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator double3x4(bool v) { return new double3x4(v); } + + /// Explicitly converts a bool3x4 matrix to a double3x4 matrix by componentwise conversion. + /// bool3x4 to convert to double3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator double3x4(bool3x4 v) { return new double3x4(v); } + + /// Implicitly converts a single int value to a double3x4 matrix by converting it to double and assigning it to every component. + /// int to convert to double3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double3x4(int v) { return new double3x4(v); } + + /// Implicitly converts a int3x4 matrix to a double3x4 matrix by componentwise conversion. + /// int3x4 to convert to double3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double3x4(int3x4 v) { return new double3x4(v); } + + /// Implicitly converts a single uint value to a double3x4 matrix by converting it to double and assigning it to every component. + /// uint to convert to double3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double3x4(uint v) { return new double3x4(v); } + + /// Implicitly converts a uint3x4 matrix to a double3x4 matrix by componentwise conversion. + /// uint3x4 to convert to double3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double3x4(uint3x4 v) { return new double3x4(v); } + + /// Implicitly converts a single float value to a double3x4 matrix by converting it to double and assigning it to every component. + /// float to convert to double3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double3x4(float v) { return new double3x4(v); } + + /// Implicitly converts a float3x4 matrix to a double3x4 matrix by componentwise conversion. + /// float3x4 to convert to double3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double3x4(float3x4 v) { return new double3x4(v); } + + + /// Returns the result of a componentwise multiplication operation on two double3x4 matrices. + /// Left hand side double3x4 to use to compute componentwise multiplication. + /// Right hand side double3x4 to use to compute componentwise multiplication. + /// double3x4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x4 operator * (double3x4 lhs, double3x4 rhs) { return new double3x4 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1, lhs.c2 * rhs.c2, lhs.c3 * rhs.c3); } + + /// Returns the result of a componentwise multiplication operation on a double3x4 matrix and a double value. + /// Left hand side double3x4 to use to compute componentwise multiplication. + /// Right hand side double to use to compute componentwise multiplication. + /// double3x4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x4 operator * (double3x4 lhs, double rhs) { return new double3x4 (lhs.c0 * rhs, lhs.c1 * rhs, lhs.c2 * rhs, lhs.c3 * rhs); } + + /// Returns the result of a componentwise multiplication operation on a double value and a double3x4 matrix. + /// Left hand side double to use to compute componentwise multiplication. + /// Right hand side double3x4 to use to compute componentwise multiplication. + /// double3x4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x4 operator * (double lhs, double3x4 rhs) { return new double3x4 (lhs * rhs.c0, lhs * rhs.c1, lhs * rhs.c2, lhs * rhs.c3); } + + + /// Returns the result of a componentwise addition operation on two double3x4 matrices. + /// Left hand side double3x4 to use to compute componentwise addition. + /// Right hand side double3x4 to use to compute componentwise addition. + /// double3x4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x4 operator + (double3x4 lhs, double3x4 rhs) { return new double3x4 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1, lhs.c2 + rhs.c2, lhs.c3 + rhs.c3); } + + /// Returns the result of a componentwise addition operation on a double3x4 matrix and a double value. + /// Left hand side double3x4 to use to compute componentwise addition. + /// Right hand side double to use to compute componentwise addition. + /// double3x4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x4 operator + (double3x4 lhs, double rhs) { return new double3x4 (lhs.c0 + rhs, lhs.c1 + rhs, lhs.c2 + rhs, lhs.c3 + rhs); } + + /// Returns the result of a componentwise addition operation on a double value and a double3x4 matrix. + /// Left hand side double to use to compute componentwise addition. + /// Right hand side double3x4 to use to compute componentwise addition. + /// double3x4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x4 operator + (double lhs, double3x4 rhs) { return new double3x4 (lhs + rhs.c0, lhs + rhs.c1, lhs + rhs.c2, lhs + rhs.c3); } + + + /// Returns the result of a componentwise subtraction operation on two double3x4 matrices. + /// Left hand side double3x4 to use to compute componentwise subtraction. + /// Right hand side double3x4 to use to compute componentwise subtraction. + /// double3x4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x4 operator - (double3x4 lhs, double3x4 rhs) { return new double3x4 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1, lhs.c2 - rhs.c2, lhs.c3 - rhs.c3); } + + /// Returns the result of a componentwise subtraction operation on a double3x4 matrix and a double value. + /// Left hand side double3x4 to use to compute componentwise subtraction. + /// Right hand side double to use to compute componentwise subtraction. + /// double3x4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x4 operator - (double3x4 lhs, double rhs) { return new double3x4 (lhs.c0 - rhs, lhs.c1 - rhs, lhs.c2 - rhs, lhs.c3 - rhs); } + + /// Returns the result of a componentwise subtraction operation on a double value and a double3x4 matrix. + /// Left hand side double to use to compute componentwise subtraction. + /// Right hand side double3x4 to use to compute componentwise subtraction. + /// double3x4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x4 operator - (double lhs, double3x4 rhs) { return new double3x4 (lhs - rhs.c0, lhs - rhs.c1, lhs - rhs.c2, lhs - rhs.c3); } + + + /// Returns the result of a componentwise division operation on two double3x4 matrices. + /// Left hand side double3x4 to use to compute componentwise division. + /// Right hand side double3x4 to use to compute componentwise division. + /// double3x4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x4 operator / (double3x4 lhs, double3x4 rhs) { return new double3x4 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1, lhs.c2 / rhs.c2, lhs.c3 / rhs.c3); } + + /// Returns the result of a componentwise division operation on a double3x4 matrix and a double value. + /// Left hand side double3x4 to use to compute componentwise division. + /// Right hand side double to use to compute componentwise division. + /// double3x4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x4 operator / (double3x4 lhs, double rhs) { return new double3x4 (lhs.c0 / rhs, lhs.c1 / rhs, lhs.c2 / rhs, lhs.c3 / rhs); } + + /// Returns the result of a componentwise division operation on a double value and a double3x4 matrix. + /// Left hand side double to use to compute componentwise division. + /// Right hand side double3x4 to use to compute componentwise division. + /// double3x4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x4 operator / (double lhs, double3x4 rhs) { return new double3x4 (lhs / rhs.c0, lhs / rhs.c1, lhs / rhs.c2, lhs / rhs.c3); } + + + /// Returns the result of a componentwise modulus operation on two double3x4 matrices. + /// Left hand side double3x4 to use to compute componentwise modulus. + /// Right hand side double3x4 to use to compute componentwise modulus. + /// double3x4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x4 operator % (double3x4 lhs, double3x4 rhs) { return new double3x4 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1, lhs.c2 % rhs.c2, lhs.c3 % rhs.c3); } + + /// Returns the result of a componentwise modulus operation on a double3x4 matrix and a double value. + /// Left hand side double3x4 to use to compute componentwise modulus. + /// Right hand side double to use to compute componentwise modulus. + /// double3x4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x4 operator % (double3x4 lhs, double rhs) { return new double3x4 (lhs.c0 % rhs, lhs.c1 % rhs, lhs.c2 % rhs, lhs.c3 % rhs); } + + /// Returns the result of a componentwise modulus operation on a double value and a double3x4 matrix. + /// Left hand side double to use to compute componentwise modulus. + /// Right hand side double3x4 to use to compute componentwise modulus. + /// double3x4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x4 operator % (double lhs, double3x4 rhs) { return new double3x4 (lhs % rhs.c0, lhs % rhs.c1, lhs % rhs.c2, lhs % rhs.c3); } + + + /// Returns the result of a componentwise increment operation on a double3x4 matrix. + /// Value to use when computing the componentwise increment. + /// double3x4 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x4 operator ++ (double3x4 val) { return new double3x4 (++val.c0, ++val.c1, ++val.c2, ++val.c3); } + + + /// Returns the result of a componentwise decrement operation on a double3x4 matrix. + /// Value to use when computing the componentwise decrement. + /// double3x4 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x4 operator -- (double3x4 val) { return new double3x4 (--val.c0, --val.c1, --val.c2, --val.c3); } + + + /// Returns the result of a componentwise less than operation on two double3x4 matrices. + /// Left hand side double3x4 to use to compute componentwise less than. + /// Right hand side double3x4 to use to compute componentwise less than. + /// bool3x4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator < (double3x4 lhs, double3x4 rhs) { return new bool3x4 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1, lhs.c2 < rhs.c2, lhs.c3 < rhs.c3); } + + /// Returns the result of a componentwise less than operation on a double3x4 matrix and a double value. + /// Left hand side double3x4 to use to compute componentwise less than. + /// Right hand side double to use to compute componentwise less than. + /// bool3x4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator < (double3x4 lhs, double rhs) { return new bool3x4 (lhs.c0 < rhs, lhs.c1 < rhs, lhs.c2 < rhs, lhs.c3 < rhs); } + + /// Returns the result of a componentwise less than operation on a double value and a double3x4 matrix. + /// Left hand side double to use to compute componentwise less than. + /// Right hand side double3x4 to use to compute componentwise less than. + /// bool3x4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator < (double lhs, double3x4 rhs) { return new bool3x4 (lhs < rhs.c0, lhs < rhs.c1, lhs < rhs.c2, lhs < rhs.c3); } + + + /// Returns the result of a componentwise less or equal operation on two double3x4 matrices. + /// Left hand side double3x4 to use to compute componentwise less or equal. + /// Right hand side double3x4 to use to compute componentwise less or equal. + /// bool3x4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator <= (double3x4 lhs, double3x4 rhs) { return new bool3x4 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1, lhs.c2 <= rhs.c2, lhs.c3 <= rhs.c3); } + + /// Returns the result of a componentwise less or equal operation on a double3x4 matrix and a double value. + /// Left hand side double3x4 to use to compute componentwise less or equal. + /// Right hand side double to use to compute componentwise less or equal. + /// bool3x4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator <= (double3x4 lhs, double rhs) { return new bool3x4 (lhs.c0 <= rhs, lhs.c1 <= rhs, lhs.c2 <= rhs, lhs.c3 <= rhs); } + + /// Returns the result of a componentwise less or equal operation on a double value and a double3x4 matrix. + /// Left hand side double to use to compute componentwise less or equal. + /// Right hand side double3x4 to use to compute componentwise less or equal. + /// bool3x4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator <= (double lhs, double3x4 rhs) { return new bool3x4 (lhs <= rhs.c0, lhs <= rhs.c1, lhs <= rhs.c2, lhs <= rhs.c3); } + + + /// Returns the result of a componentwise greater than operation on two double3x4 matrices. + /// Left hand side double3x4 to use to compute componentwise greater than. + /// Right hand side double3x4 to use to compute componentwise greater than. + /// bool3x4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator > (double3x4 lhs, double3x4 rhs) { return new bool3x4 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1, lhs.c2 > rhs.c2, lhs.c3 > rhs.c3); } + + /// Returns the result of a componentwise greater than operation on a double3x4 matrix and a double value. + /// Left hand side double3x4 to use to compute componentwise greater than. + /// Right hand side double to use to compute componentwise greater than. + /// bool3x4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator > (double3x4 lhs, double rhs) { return new bool3x4 (lhs.c0 > rhs, lhs.c1 > rhs, lhs.c2 > rhs, lhs.c3 > rhs); } + + /// Returns the result of a componentwise greater than operation on a double value and a double3x4 matrix. + /// Left hand side double to use to compute componentwise greater than. + /// Right hand side double3x4 to use to compute componentwise greater than. + /// bool3x4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator > (double lhs, double3x4 rhs) { return new bool3x4 (lhs > rhs.c0, lhs > rhs.c1, lhs > rhs.c2, lhs > rhs.c3); } + + + /// Returns the result of a componentwise greater or equal operation on two double3x4 matrices. + /// Left hand side double3x4 to use to compute componentwise greater or equal. + /// Right hand side double3x4 to use to compute componentwise greater or equal. + /// bool3x4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator >= (double3x4 lhs, double3x4 rhs) { return new bool3x4 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1, lhs.c2 >= rhs.c2, lhs.c3 >= rhs.c3); } + + /// Returns the result of a componentwise greater or equal operation on a double3x4 matrix and a double value. + /// Left hand side double3x4 to use to compute componentwise greater or equal. + /// Right hand side double to use to compute componentwise greater or equal. + /// bool3x4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator >= (double3x4 lhs, double rhs) { return new bool3x4 (lhs.c0 >= rhs, lhs.c1 >= rhs, lhs.c2 >= rhs, lhs.c3 >= rhs); } + + /// Returns the result of a componentwise greater or equal operation on a double value and a double3x4 matrix. + /// Left hand side double to use to compute componentwise greater or equal. + /// Right hand side double3x4 to use to compute componentwise greater or equal. + /// bool3x4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator >= (double lhs, double3x4 rhs) { return new bool3x4 (lhs >= rhs.c0, lhs >= rhs.c1, lhs >= rhs.c2, lhs >= rhs.c3); } + + + /// Returns the result of a componentwise unary minus operation on a double3x4 matrix. + /// Value to use when computing the componentwise unary minus. + /// double3x4 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x4 operator - (double3x4 val) { return new double3x4 (-val.c0, -val.c1, -val.c2, -val.c3); } + + + /// Returns the result of a componentwise unary plus operation on a double3x4 matrix. + /// Value to use when computing the componentwise unary plus. + /// double3x4 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x4 operator + (double3x4 val) { return new double3x4 (+val.c0, +val.c1, +val.c2, +val.c3); } + + + /// Returns the result of a componentwise equality operation on two double3x4 matrices. + /// Left hand side double3x4 to use to compute componentwise equality. + /// Right hand side double3x4 to use to compute componentwise equality. + /// bool3x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator == (double3x4 lhs, double3x4 rhs) { return new bool3x4 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2, lhs.c3 == rhs.c3); } + + /// Returns the result of a componentwise equality operation on a double3x4 matrix and a double value. + /// Left hand side double3x4 to use to compute componentwise equality. + /// Right hand side double to use to compute componentwise equality. + /// bool3x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator == (double3x4 lhs, double rhs) { return new bool3x4 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs, lhs.c3 == rhs); } + + /// Returns the result of a componentwise equality operation on a double value and a double3x4 matrix. + /// Left hand side double to use to compute componentwise equality. + /// Right hand side double3x4 to use to compute componentwise equality. + /// bool3x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator == (double lhs, double3x4 rhs) { return new bool3x4 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2, lhs == rhs.c3); } + + + /// Returns the result of a componentwise not equal operation on two double3x4 matrices. + /// Left hand side double3x4 to use to compute componentwise not equal. + /// Right hand side double3x4 to use to compute componentwise not equal. + /// bool3x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator != (double3x4 lhs, double3x4 rhs) { return new bool3x4 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2, lhs.c3 != rhs.c3); } + + /// Returns the result of a componentwise not equal operation on a double3x4 matrix and a double value. + /// Left hand side double3x4 to use to compute componentwise not equal. + /// Right hand side double to use to compute componentwise not equal. + /// bool3x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator != (double3x4 lhs, double rhs) { return new bool3x4 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs, lhs.c3 != rhs); } + + /// Returns the result of a componentwise not equal operation on a double value and a double3x4 matrix. + /// Left hand side double to use to compute componentwise not equal. + /// Right hand side double3x4 to use to compute componentwise not equal. + /// bool3x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator != (double lhs, double3x4 rhs) { return new bool3x4 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2, lhs != rhs.c3); } + + + + /// Returns the double3 element at a specified index. + unsafe public ref double3 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 4) + throw new System.ArgumentException("index must be between[0...3]"); +#endif + fixed (double3x4* array = &this) { return ref ((double3*)array)[index]; } + } + } + + /// Returns true if the double3x4 is equal to a given double3x4, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(double3x4 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2) && c3.Equals(rhs.c3); } + + /// Returns true if the double3x4 is equal to a given double3x4, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is double3x4 converted && Equals(converted); } + + + /// Returns a hash code for the double3x4. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the double3x4. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("double3x4({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11})", c0.x, c1.x, c2.x, c3.x, c0.y, c1.y, c2.y, c3.y, c0.z, c1.z, c2.z, c3.z); + } + + /// Returns a string representation of the double3x4 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("double3x4({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11})", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c2.x.ToString(format, formatProvider), c3.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c2.y.ToString(format, formatProvider), c3.y.ToString(format, formatProvider), c0.z.ToString(format, formatProvider), c1.z.ToString(format, formatProvider), c2.z.ToString(format, formatProvider), c3.z.ToString(format, formatProvider)); + } + + } + + public static partial class math + { + /// Returns a double3x4 matrix constructed from four double3 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// The matrix column c3 will be set to this value. + /// double3x4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x4 double3x4(double3 c0, double3 c1, double3 c2, double3 c3) { return new double3x4(c0, c1, c2, c3); } + + /// Returns a double3x4 matrix constructed from from 12 double values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 0, column 3 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 1, column 3 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 2, column 2 will be set to this value. + /// The matrix at row 2, column 3 will be set to this value. + /// double3x4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x4 double3x4(double m00, double m01, double m02, double m03, + double m10, double m11, double m12, double m13, + double m20, double m21, double m22, double m23) + { + return new double3x4(m00, m01, m02, m03, + m10, m11, m12, m13, + m20, m21, m22, m23); + } + + /// Returns a double3x4 matrix constructed from a single double value by assigning it to every component. + /// double to convert to double3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x4 double3x4(double v) { return new double3x4(v); } + + /// Returns a double3x4 matrix constructed from a single bool value by converting it to double and assigning it to every component. + /// bool to convert to double3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x4 double3x4(bool v) { return new double3x4(v); } + + /// Return a double3x4 matrix constructed from a bool3x4 matrix by componentwise conversion. + /// bool3x4 to convert to double3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x4 double3x4(bool3x4 v) { return new double3x4(v); } + + /// Returns a double3x4 matrix constructed from a single int value by converting it to double and assigning it to every component. + /// int to convert to double3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x4 double3x4(int v) { return new double3x4(v); } + + /// Return a double3x4 matrix constructed from a int3x4 matrix by componentwise conversion. + /// int3x4 to convert to double3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x4 double3x4(int3x4 v) { return new double3x4(v); } + + /// Returns a double3x4 matrix constructed from a single uint value by converting it to double and assigning it to every component. + /// uint to convert to double3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x4 double3x4(uint v) { return new double3x4(v); } + + /// Return a double3x4 matrix constructed from a uint3x4 matrix by componentwise conversion. + /// uint3x4 to convert to double3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x4 double3x4(uint3x4 v) { return new double3x4(v); } + + /// Returns a double3x4 matrix constructed from a single float value by converting it to double and assigning it to every component. + /// float to convert to double3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x4 double3x4(float v) { return new double3x4(v); } + + /// Return a double3x4 matrix constructed from a float3x4 matrix by componentwise conversion. + /// float3x4 to convert to double3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x4 double3x4(float3x4 v) { return new double3x4(v); } + + /// Return the double4x3 transpose of a double3x4 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x3 transpose(double3x4 v) + { + return double4x3( + v.c0.x, v.c0.y, v.c0.z, + v.c1.x, v.c1.y, v.c1.z, + v.c2.x, v.c2.y, v.c2.z, + v.c3.x, v.c3.y, v.c3.z); + } + + /// Fast matrix inverse for rigid transforms (orthonormal basis and translation) + /// Matrix to invert. + /// The inverted matrix. + public static double3x4 fastinverse(double3x4 m) + { + double3 c0 = m.c0; + double3 c1 = m.c1; + double3 c2 = m.c2; + double3 pos = m.c3; + + double3 r0 = double3(c0.x, c1.x, c2.x); + double3 r1 = double3(c0.y, c1.y, c2.y); + double3 r2 = double3(c0.z, c1.z, c2.z); + + pos = -(r0 * pos.x + r1 * pos.y + r2 * pos.z); + + return double3x4(r0, r1, r2, pos); + } + + /// Returns a uint hash code of a double3x4 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(double3x4 v) + { + return csum(fold_to_uint(v.c0) * uint3(0xEE390C97u, 0x9C8A2F05u, 0x4DDC6509u) + + fold_to_uint(v.c1) * uint3(0x7CF083CBu, 0x5C4D6CEDu, 0xF9137117u) + + fold_to_uint(v.c2) * uint3(0xE857DCE1u, 0xF62213C5u, 0x9CDAA959u) + + fold_to_uint(v.c3) * uint3(0xAA269ABFu, 0xD54BA36Fu, 0xFD0847B9u)) + 0x8189A683u; + } + + /// + /// Returns a uint3 vector hash code of a double3x4 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint3 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 hashwide(double3x4 v) + { + return (fold_to_uint(v.c0) * uint3(0xB139D651u, 0xE7579997u, 0xEF7D56C7u) + + fold_to_uint(v.c1) * uint3(0x66F38F0Bu, 0x624256A3u, 0x5292ADE1u) + + fold_to_uint(v.c2) * uint3(0xD2E590E5u, 0xF25BE857u, 0x9BC17CE7u) + + fold_to_uint(v.c3) * uint3(0xC8B86851u, 0x64095221u, 0xADF428FFu)) + 0xA3977109u; + } + + } +} diff --git a/src/Unity.Mathematics/double3x4.gen.cs.meta b/src/Unity.Mathematics/double3x4.gen.cs.meta new file mode 100644 index 00000000..32240315 --- /dev/null +++ b/src/Unity.Mathematics/double3x4.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 419ac95b4026548c39e12d2aa34922d6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/double4.gen.cs b/src/Unity.Mathematics/double4.gen.cs new file mode 100644 index 00000000..b5a13817 --- /dev/null +++ b/src/Unity.Mathematics/double4.gen.cs @@ -0,0 +1,4052 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using System.Diagnostics; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 4 component vector of doubles. + [DebuggerTypeProxy(typeof(double4.DebuggerProxy))] + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct double4 : System.IEquatable, IFormattable + { + /// x component of the vector. + public double x; + /// y component of the vector. + public double y; + /// z component of the vector. + public double z; + /// w component of the vector. + public double w; + + /// double4 zero value. + public static readonly double4 zero; + + /// Constructs a double4 vector from four double values. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + /// The constructed vector's z component will be set to this value. + /// The constructed vector's w component will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4(double x, double y, double z, double w) + { + this.x = x; + this.y = y; + this.z = z; + this.w = w; + } + + /// Constructs a double4 vector from two double values and a double2 vector. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + /// The constructed vector's zw components will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4(double x, double y, double2 zw) + { + this.x = x; + this.y = y; + this.z = zw.x; + this.w = zw.y; + } + + /// Constructs a double4 vector from a double value, a double2 vector and a double value. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's yz components will be set to this value. + /// The constructed vector's w component will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4(double x, double2 yz, double w) + { + this.x = x; + this.y = yz.x; + this.z = yz.y; + this.w = w; + } + + /// Constructs a double4 vector from a double value and a double3 vector. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's yzw components will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4(double x, double3 yzw) + { + this.x = x; + this.y = yzw.x; + this.z = yzw.y; + this.w = yzw.z; + } + + /// Constructs a double4 vector from a double2 vector and two double values. + /// The constructed vector's xy components will be set to this value. + /// The constructed vector's z component will be set to this value. + /// The constructed vector's w component will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4(double2 xy, double z, double w) + { + this.x = xy.x; + this.y = xy.y; + this.z = z; + this.w = w; + } + + /// Constructs a double4 vector from two double2 vectors. + /// The constructed vector's xy components will be set to this value. + /// The constructed vector's zw components will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4(double2 xy, double2 zw) + { + this.x = xy.x; + this.y = xy.y; + this.z = zw.x; + this.w = zw.y; + } + + /// Constructs a double4 vector from a double3 vector and a double value. + /// The constructed vector's xyz components will be set to this value. + /// The constructed vector's w component will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4(double3 xyz, double w) + { + this.x = xyz.x; + this.y = xyz.y; + this.z = xyz.z; + this.w = w; + } + + /// Constructs a double4 vector from a double4 vector. + /// The constructed vector's xyzw components will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4(double4 xyzw) + { + this.x = xyzw.x; + this.y = xyzw.y; + this.z = xyzw.z; + this.w = xyzw.w; + } + + /// Constructs a double4 vector from a single double value by assigning it to every component. + /// double to convert to double4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4(double v) + { + this.x = v; + this.y = v; + this.z = v; + this.w = v; + } + + /// Constructs a double4 vector from a single bool value by converting it to double and assigning it to every component. + /// bool to convert to double4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4(bool v) + { + this.x = v ? 1.0 : 0.0; + this.y = v ? 1.0 : 0.0; + this.z = v ? 1.0 : 0.0; + this.w = v ? 1.0 : 0.0; + } + + /// Constructs a double4 vector from a bool4 vector by componentwise conversion. + /// bool4 to convert to double4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4(bool4 v) + { + this.x = v.x ? 1.0 : 0.0; + this.y = v.y ? 1.0 : 0.0; + this.z = v.z ? 1.0 : 0.0; + this.w = v.w ? 1.0 : 0.0; + } + + /// Constructs a double4 vector from a single int value by converting it to double and assigning it to every component. + /// int to convert to double4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4(int v) + { + this.x = v; + this.y = v; + this.z = v; + this.w = v; + } + + /// Constructs a double4 vector from a int4 vector by componentwise conversion. + /// int4 to convert to double4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4(int4 v) + { + this.x = v.x; + this.y = v.y; + this.z = v.z; + this.w = v.w; + } + + /// Constructs a double4 vector from a single uint value by converting it to double and assigning it to every component. + /// uint to convert to double4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4(uint v) + { + this.x = v; + this.y = v; + this.z = v; + this.w = v; + } + + /// Constructs a double4 vector from a uint4 vector by componentwise conversion. + /// uint4 to convert to double4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4(uint4 v) + { + this.x = v.x; + this.y = v.y; + this.z = v.z; + this.w = v.w; + } + + /// Constructs a double4 vector from a single half value by converting it to double and assigning it to every component. + /// half to convert to double4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4(half v) + { + this.x = v; + this.y = v; + this.z = v; + this.w = v; + } + + /// Constructs a double4 vector from a half4 vector by componentwise conversion. + /// half4 to convert to double4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4(half4 v) + { + this.x = v.x; + this.y = v.y; + this.z = v.z; + this.w = v.w; + } + + /// Constructs a double4 vector from a single float value by converting it to double and assigning it to every component. + /// float to convert to double4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4(float v) + { + this.x = v; + this.y = v; + this.z = v; + this.w = v; + } + + /// Constructs a double4 vector from a float4 vector by componentwise conversion. + /// float4 to convert to double4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4(float4 v) + { + this.x = v.x; + this.y = v.y; + this.z = v.z; + this.w = v.w; + } + + + /// Implicitly converts a single double value to a double4 vector by assigning it to every component. + /// double to convert to double4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double4(double v) { return new double4(v); } + + /// Explicitly converts a single bool value to a double4 vector by converting it to double and assigning it to every component. + /// bool to convert to double4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator double4(bool v) { return new double4(v); } + + /// Explicitly converts a bool4 vector to a double4 vector by componentwise conversion. + /// bool4 to convert to double4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator double4(bool4 v) { return new double4(v); } + + /// Implicitly converts a single int value to a double4 vector by converting it to double and assigning it to every component. + /// int to convert to double4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double4(int v) { return new double4(v); } + + /// Implicitly converts a int4 vector to a double4 vector by componentwise conversion. + /// int4 to convert to double4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double4(int4 v) { return new double4(v); } + + /// Implicitly converts a single uint value to a double4 vector by converting it to double and assigning it to every component. + /// uint to convert to double4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double4(uint v) { return new double4(v); } + + /// Implicitly converts a uint4 vector to a double4 vector by componentwise conversion. + /// uint4 to convert to double4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double4(uint4 v) { return new double4(v); } + + /// Implicitly converts a single half value to a double4 vector by converting it to double and assigning it to every component. + /// half to convert to double4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double4(half v) { return new double4(v); } + + /// Implicitly converts a half4 vector to a double4 vector by componentwise conversion. + /// half4 to convert to double4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double4(half4 v) { return new double4(v); } + + /// Implicitly converts a single float value to a double4 vector by converting it to double and assigning it to every component. + /// float to convert to double4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double4(float v) { return new double4(v); } + + /// Implicitly converts a float4 vector to a double4 vector by componentwise conversion. + /// float4 to convert to double4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double4(float4 v) { return new double4(v); } + + + /// Returns the result of a componentwise multiplication operation on two double4 vectors. + /// Left hand side double4 to use to compute componentwise multiplication. + /// Right hand side double4 to use to compute componentwise multiplication. + /// double4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 operator * (double4 lhs, double4 rhs) { return new double4 (lhs.x * rhs.x, lhs.y * rhs.y, lhs.z * rhs.z, lhs.w * rhs.w); } + + /// Returns the result of a componentwise multiplication operation on a double4 vector and a double value. + /// Left hand side double4 to use to compute componentwise multiplication. + /// Right hand side double to use to compute componentwise multiplication. + /// double4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 operator * (double4 lhs, double rhs) { return new double4 (lhs.x * rhs, lhs.y * rhs, lhs.z * rhs, lhs.w * rhs); } + + /// Returns the result of a componentwise multiplication operation on a double value and a double4 vector. + /// Left hand side double to use to compute componentwise multiplication. + /// Right hand side double4 to use to compute componentwise multiplication. + /// double4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 operator * (double lhs, double4 rhs) { return new double4 (lhs * rhs.x, lhs * rhs.y, lhs * rhs.z, lhs * rhs.w); } + + + /// Returns the result of a componentwise addition operation on two double4 vectors. + /// Left hand side double4 to use to compute componentwise addition. + /// Right hand side double4 to use to compute componentwise addition. + /// double4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 operator + (double4 lhs, double4 rhs) { return new double4 (lhs.x + rhs.x, lhs.y + rhs.y, lhs.z + rhs.z, lhs.w + rhs.w); } + + /// Returns the result of a componentwise addition operation on a double4 vector and a double value. + /// Left hand side double4 to use to compute componentwise addition. + /// Right hand side double to use to compute componentwise addition. + /// double4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 operator + (double4 lhs, double rhs) { return new double4 (lhs.x + rhs, lhs.y + rhs, lhs.z + rhs, lhs.w + rhs); } + + /// Returns the result of a componentwise addition operation on a double value and a double4 vector. + /// Left hand side double to use to compute componentwise addition. + /// Right hand side double4 to use to compute componentwise addition. + /// double4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 operator + (double lhs, double4 rhs) { return new double4 (lhs + rhs.x, lhs + rhs.y, lhs + rhs.z, lhs + rhs.w); } + + + /// Returns the result of a componentwise subtraction operation on two double4 vectors. + /// Left hand side double4 to use to compute componentwise subtraction. + /// Right hand side double4 to use to compute componentwise subtraction. + /// double4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 operator - (double4 lhs, double4 rhs) { return new double4 (lhs.x - rhs.x, lhs.y - rhs.y, lhs.z - rhs.z, lhs.w - rhs.w); } + + /// Returns the result of a componentwise subtraction operation on a double4 vector and a double value. + /// Left hand side double4 to use to compute componentwise subtraction. + /// Right hand side double to use to compute componentwise subtraction. + /// double4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 operator - (double4 lhs, double rhs) { return new double4 (lhs.x - rhs, lhs.y - rhs, lhs.z - rhs, lhs.w - rhs); } + + /// Returns the result of a componentwise subtraction operation on a double value and a double4 vector. + /// Left hand side double to use to compute componentwise subtraction. + /// Right hand side double4 to use to compute componentwise subtraction. + /// double4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 operator - (double lhs, double4 rhs) { return new double4 (lhs - rhs.x, lhs - rhs.y, lhs - rhs.z, lhs - rhs.w); } + + + /// Returns the result of a componentwise division operation on two double4 vectors. + /// Left hand side double4 to use to compute componentwise division. + /// Right hand side double4 to use to compute componentwise division. + /// double4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 operator / (double4 lhs, double4 rhs) { return new double4 (lhs.x / rhs.x, lhs.y / rhs.y, lhs.z / rhs.z, lhs.w / rhs.w); } + + /// Returns the result of a componentwise division operation on a double4 vector and a double value. + /// Left hand side double4 to use to compute componentwise division. + /// Right hand side double to use to compute componentwise division. + /// double4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 operator / (double4 lhs, double rhs) { return new double4 (lhs.x / rhs, lhs.y / rhs, lhs.z / rhs, lhs.w / rhs); } + + /// Returns the result of a componentwise division operation on a double value and a double4 vector. + /// Left hand side double to use to compute componentwise division. + /// Right hand side double4 to use to compute componentwise division. + /// double4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 operator / (double lhs, double4 rhs) { return new double4 (lhs / rhs.x, lhs / rhs.y, lhs / rhs.z, lhs / rhs.w); } + + + /// Returns the result of a componentwise modulus operation on two double4 vectors. + /// Left hand side double4 to use to compute componentwise modulus. + /// Right hand side double4 to use to compute componentwise modulus. + /// double4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 operator % (double4 lhs, double4 rhs) { return new double4 (lhs.x % rhs.x, lhs.y % rhs.y, lhs.z % rhs.z, lhs.w % rhs.w); } + + /// Returns the result of a componentwise modulus operation on a double4 vector and a double value. + /// Left hand side double4 to use to compute componentwise modulus. + /// Right hand side double to use to compute componentwise modulus. + /// double4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 operator % (double4 lhs, double rhs) { return new double4 (lhs.x % rhs, lhs.y % rhs, lhs.z % rhs, lhs.w % rhs); } + + /// Returns the result of a componentwise modulus operation on a double value and a double4 vector. + /// Left hand side double to use to compute componentwise modulus. + /// Right hand side double4 to use to compute componentwise modulus. + /// double4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 operator % (double lhs, double4 rhs) { return new double4 (lhs % rhs.x, lhs % rhs.y, lhs % rhs.z, lhs % rhs.w); } + + + /// Returns the result of a componentwise increment operation on a double4 vector. + /// Value to use when computing the componentwise increment. + /// double4 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 operator ++ (double4 val) { return new double4 (++val.x, ++val.y, ++val.z, ++val.w); } + + + /// Returns the result of a componentwise decrement operation on a double4 vector. + /// Value to use when computing the componentwise decrement. + /// double4 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 operator -- (double4 val) { return new double4 (--val.x, --val.y, --val.z, --val.w); } + + + /// Returns the result of a componentwise less than operation on two double4 vectors. + /// Left hand side double4 to use to compute componentwise less than. + /// Right hand side double4 to use to compute componentwise less than. + /// bool4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 operator < (double4 lhs, double4 rhs) { return new bool4 (lhs.x < rhs.x, lhs.y < rhs.y, lhs.z < rhs.z, lhs.w < rhs.w); } + + /// Returns the result of a componentwise less than operation on a double4 vector and a double value. + /// Left hand side double4 to use to compute componentwise less than. + /// Right hand side double to use to compute componentwise less than. + /// bool4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 operator < (double4 lhs, double rhs) { return new bool4 (lhs.x < rhs, lhs.y < rhs, lhs.z < rhs, lhs.w < rhs); } + + /// Returns the result of a componentwise less than operation on a double value and a double4 vector. + /// Left hand side double to use to compute componentwise less than. + /// Right hand side double4 to use to compute componentwise less than. + /// bool4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 operator < (double lhs, double4 rhs) { return new bool4 (lhs < rhs.x, lhs < rhs.y, lhs < rhs.z, lhs < rhs.w); } + + + /// Returns the result of a componentwise less or equal operation on two double4 vectors. + /// Left hand side double4 to use to compute componentwise less or equal. + /// Right hand side double4 to use to compute componentwise less or equal. + /// bool4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 operator <= (double4 lhs, double4 rhs) { return new bool4 (lhs.x <= rhs.x, lhs.y <= rhs.y, lhs.z <= rhs.z, lhs.w <= rhs.w); } + + /// Returns the result of a componentwise less or equal operation on a double4 vector and a double value. + /// Left hand side double4 to use to compute componentwise less or equal. + /// Right hand side double to use to compute componentwise less or equal. + /// bool4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 operator <= (double4 lhs, double rhs) { return new bool4 (lhs.x <= rhs, lhs.y <= rhs, lhs.z <= rhs, lhs.w <= rhs); } + + /// Returns the result of a componentwise less or equal operation on a double value and a double4 vector. + /// Left hand side double to use to compute componentwise less or equal. + /// Right hand side double4 to use to compute componentwise less or equal. + /// bool4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 operator <= (double lhs, double4 rhs) { return new bool4 (lhs <= rhs.x, lhs <= rhs.y, lhs <= rhs.z, lhs <= rhs.w); } + + + /// Returns the result of a componentwise greater than operation on two double4 vectors. + /// Left hand side double4 to use to compute componentwise greater than. + /// Right hand side double4 to use to compute componentwise greater than. + /// bool4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 operator > (double4 lhs, double4 rhs) { return new bool4 (lhs.x > rhs.x, lhs.y > rhs.y, lhs.z > rhs.z, lhs.w > rhs.w); } + + /// Returns the result of a componentwise greater than operation on a double4 vector and a double value. + /// Left hand side double4 to use to compute componentwise greater than. + /// Right hand side double to use to compute componentwise greater than. + /// bool4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 operator > (double4 lhs, double rhs) { return new bool4 (lhs.x > rhs, lhs.y > rhs, lhs.z > rhs, lhs.w > rhs); } + + /// Returns the result of a componentwise greater than operation on a double value and a double4 vector. + /// Left hand side double to use to compute componentwise greater than. + /// Right hand side double4 to use to compute componentwise greater than. + /// bool4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 operator > (double lhs, double4 rhs) { return new bool4 (lhs > rhs.x, lhs > rhs.y, lhs > rhs.z, lhs > rhs.w); } + + + /// Returns the result of a componentwise greater or equal operation on two double4 vectors. + /// Left hand side double4 to use to compute componentwise greater or equal. + /// Right hand side double4 to use to compute componentwise greater or equal. + /// bool4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 operator >= (double4 lhs, double4 rhs) { return new bool4 (lhs.x >= rhs.x, lhs.y >= rhs.y, lhs.z >= rhs.z, lhs.w >= rhs.w); } + + /// Returns the result of a componentwise greater or equal operation on a double4 vector and a double value. + /// Left hand side double4 to use to compute componentwise greater or equal. + /// Right hand side double to use to compute componentwise greater or equal. + /// bool4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 operator >= (double4 lhs, double rhs) { return new bool4 (lhs.x >= rhs, lhs.y >= rhs, lhs.z >= rhs, lhs.w >= rhs); } + + /// Returns the result of a componentwise greater or equal operation on a double value and a double4 vector. + /// Left hand side double to use to compute componentwise greater or equal. + /// Right hand side double4 to use to compute componentwise greater or equal. + /// bool4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 operator >= (double lhs, double4 rhs) { return new bool4 (lhs >= rhs.x, lhs >= rhs.y, lhs >= rhs.z, lhs >= rhs.w); } + + + /// Returns the result of a componentwise unary minus operation on a double4 vector. + /// Value to use when computing the componentwise unary minus. + /// double4 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 operator - (double4 val) { return new double4 (-val.x, -val.y, -val.z, -val.w); } + + + /// Returns the result of a componentwise unary plus operation on a double4 vector. + /// Value to use when computing the componentwise unary plus. + /// double4 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 operator + (double4 val) { return new double4 (+val.x, +val.y, +val.z, +val.w); } + + + /// Returns the result of a componentwise equality operation on two double4 vectors. + /// Left hand side double4 to use to compute componentwise equality. + /// Right hand side double4 to use to compute componentwise equality. + /// bool4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 operator == (double4 lhs, double4 rhs) { return new bool4 (lhs.x == rhs.x, lhs.y == rhs.y, lhs.z == rhs.z, lhs.w == rhs.w); } + + /// Returns the result of a componentwise equality operation on a double4 vector and a double value. + /// Left hand side double4 to use to compute componentwise equality. + /// Right hand side double to use to compute componentwise equality. + /// bool4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 operator == (double4 lhs, double rhs) { return new bool4 (lhs.x == rhs, lhs.y == rhs, lhs.z == rhs, lhs.w == rhs); } + + /// Returns the result of a componentwise equality operation on a double value and a double4 vector. + /// Left hand side double to use to compute componentwise equality. + /// Right hand side double4 to use to compute componentwise equality. + /// bool4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 operator == (double lhs, double4 rhs) { return new bool4 (lhs == rhs.x, lhs == rhs.y, lhs == rhs.z, lhs == rhs.w); } + + + /// Returns the result of a componentwise not equal operation on two double4 vectors. + /// Left hand side double4 to use to compute componentwise not equal. + /// Right hand side double4 to use to compute componentwise not equal. + /// bool4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 operator != (double4 lhs, double4 rhs) { return new bool4 (lhs.x != rhs.x, lhs.y != rhs.y, lhs.z != rhs.z, lhs.w != rhs.w); } + + /// Returns the result of a componentwise not equal operation on a double4 vector and a double value. + /// Left hand side double4 to use to compute componentwise not equal. + /// Right hand side double to use to compute componentwise not equal. + /// bool4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 operator != (double4 lhs, double rhs) { return new bool4 (lhs.x != rhs, lhs.y != rhs, lhs.z != rhs, lhs.w != rhs); } + + /// Returns the result of a componentwise not equal operation on a double value and a double4 vector. + /// Left hand side double to use to compute componentwise not equal. + /// Right hand side double4 to use to compute componentwise not equal. + /// bool4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 operator != (double lhs, double4 rhs) { return new bool4 (lhs != rhs.x, lhs != rhs.y, lhs != rhs.z, lhs != rhs.w); } + + + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xxxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, x, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xxxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, x, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xxxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, x, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xxxw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, x, x, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xxyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, x, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xxyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, x, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xxyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, x, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xxyw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, x, y, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xxzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, x, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xxzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, x, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xxzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, x, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xxzw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, x, z, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xxwx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, x, w, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xxwy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, x, w, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xxwz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, x, w, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xxww + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, x, w, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xyxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, y, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xyxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, y, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xyxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, y, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xyxw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, y, x, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xyyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, y, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xyyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, y, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xyyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, y, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xyyw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, y, y, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xyzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, y, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xyzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, y, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xyzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, y, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xyzw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, y, z, w); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { x = value.x; y = value.y; z = value.z; w = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xywx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, y, w, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xywy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, y, w, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xywz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, y, w, z); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { x = value.x; y = value.y; w = value.z; z = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xyww + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, y, w, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xzxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, z, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xzxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, z, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xzxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, z, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xzxw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, z, x, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xzyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, z, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xzyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, z, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xzyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, z, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xzyw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, z, y, w); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { x = value.x; z = value.y; y = value.z; w = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xzzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, z, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xzzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, z, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xzzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, z, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xzzw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, z, z, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xzwx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, z, w, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xzwy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, z, w, y); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { x = value.x; z = value.y; w = value.z; y = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xzwz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, z, w, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xzww + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, z, w, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xwxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, w, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xwxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, w, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xwxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, w, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xwxw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, w, x, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xwyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, w, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xwyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, w, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xwyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, w, y, z); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { x = value.x; w = value.y; y = value.z; z = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xwyw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, w, y, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xwzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, w, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xwzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, w, z, y); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { x = value.x; w = value.y; z = value.z; y = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xwzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, w, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xwzw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, w, z, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xwwx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, w, w, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xwwy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, w, w, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xwwz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, w, w, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 xwww + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(x, w, w, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yxxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, x, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yxxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, x, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yxxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, x, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yxxw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, x, x, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yxyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, x, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yxyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, x, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yxyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, x, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yxyw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, x, y, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yxzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, x, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yxzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, x, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yxzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, x, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yxzw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, x, z, w); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { y = value.x; x = value.y; z = value.z; w = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yxwx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, x, w, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yxwy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, x, w, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yxwz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, x, w, z); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { y = value.x; x = value.y; w = value.z; z = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yxww + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, x, w, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yyxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, y, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yyxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, y, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yyxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, y, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yyxw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, y, x, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yyyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, y, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yyyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, y, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yyyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, y, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yyyw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, y, y, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yyzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, y, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yyzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, y, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yyzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, y, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yyzw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, y, z, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yywx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, y, w, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yywy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, y, w, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yywz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, y, w, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yyww + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, y, w, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yzxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, z, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yzxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, z, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yzxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, z, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yzxw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, z, x, w); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { y = value.x; z = value.y; x = value.z; w = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yzyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, z, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yzyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, z, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yzyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, z, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yzyw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, z, y, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yzzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, z, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yzzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, z, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yzzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, z, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yzzw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, z, z, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yzwx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, z, w, x); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { y = value.x; z = value.y; w = value.z; x = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yzwy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, z, w, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yzwz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, z, w, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 yzww + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, z, w, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 ywxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, w, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 ywxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, w, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 ywxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, w, x, z); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { y = value.x; w = value.y; x = value.z; z = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 ywxw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, w, x, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 ywyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, w, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 ywyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, w, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 ywyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, w, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 ywyw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, w, y, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 ywzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, w, z, x); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { y = value.x; w = value.y; z = value.z; x = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 ywzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, w, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 ywzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, w, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 ywzw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, w, z, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 ywwx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, w, w, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 ywwy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, w, w, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 ywwz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, w, w, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 ywww + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(y, w, w, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zxxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, x, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zxxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, x, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zxxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, x, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zxxw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, x, x, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zxyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, x, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zxyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, x, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zxyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, x, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zxyw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, x, y, w); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { z = value.x; x = value.y; y = value.z; w = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zxzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, x, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zxzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, x, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zxzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, x, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zxzw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, x, z, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zxwx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, x, w, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zxwy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, x, w, y); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { z = value.x; x = value.y; w = value.z; y = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zxwz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, x, w, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zxww + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, x, w, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zyxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, y, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zyxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, y, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zyxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, y, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zyxw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, y, x, w); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { z = value.x; y = value.y; x = value.z; w = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zyyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, y, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zyyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, y, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zyyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, y, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zyyw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, y, y, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zyzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, y, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zyzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, y, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zyzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, y, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zyzw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, y, z, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zywx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, y, w, x); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { z = value.x; y = value.y; w = value.z; x = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zywy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, y, w, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zywz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, y, w, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zyww + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, y, w, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zzxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, z, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zzxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, z, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zzxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, z, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zzxw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, z, x, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zzyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, z, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zzyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, z, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zzyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, z, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zzyw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, z, y, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zzzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, z, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zzzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, z, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zzzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, z, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zzzw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, z, z, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zzwx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, z, w, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zzwy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, z, w, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zzwz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, z, w, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zzww + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, z, w, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zwxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, w, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zwxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, w, x, y); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { z = value.x; w = value.y; x = value.z; y = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zwxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, w, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zwxw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, w, x, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zwyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, w, y, x); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { z = value.x; w = value.y; y = value.z; x = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zwyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, w, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zwyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, w, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zwyw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, w, y, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zwzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, w, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zwzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, w, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zwzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, w, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zwzw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, w, z, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zwwx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, w, w, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zwwy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, w, w, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zwwz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, w, w, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 zwww + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(z, w, w, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wxxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, x, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wxxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, x, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wxxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, x, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wxxw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, x, x, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wxyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, x, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wxyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, x, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wxyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, x, y, z); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { w = value.x; x = value.y; y = value.z; z = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wxyw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, x, y, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wxzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, x, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wxzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, x, z, y); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { w = value.x; x = value.y; z = value.z; y = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wxzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, x, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wxzw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, x, z, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wxwx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, x, w, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wxwy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, x, w, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wxwz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, x, w, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wxww + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, x, w, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wyxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, y, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wyxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, y, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wyxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, y, x, z); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { w = value.x; y = value.y; x = value.z; z = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wyxw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, y, x, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wyyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, y, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wyyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, y, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wyyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, y, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wyyw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, y, y, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wyzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, y, z, x); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { w = value.x; y = value.y; z = value.z; x = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wyzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, y, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wyzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, y, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wyzw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, y, z, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wywx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, y, w, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wywy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, y, w, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wywz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, y, w, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wyww + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, y, w, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wzxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, z, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wzxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, z, x, y); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { w = value.x; z = value.y; x = value.z; y = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wzxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, z, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wzxw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, z, x, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wzyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, z, y, x); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { w = value.x; z = value.y; y = value.z; x = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wzyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, z, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wzyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, z, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wzyw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, z, y, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wzzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, z, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wzzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, z, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wzzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, z, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wzzw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, z, z, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wzwx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, z, w, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wzwy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, z, w, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wzwz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, z, w, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wzww + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, z, w, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wwxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, w, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wwxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, w, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wwxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, w, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wwxw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, w, x, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wwyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, w, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wwyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, w, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wwyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, w, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wwyw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, w, y, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wwzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, w, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wwzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, w, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wwzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, w, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wwzw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, w, z, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wwwx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, w, w, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wwwy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, w, w, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wwwz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, w, w, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double4 wwww + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double4(w, w, w, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 xxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(x, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 xxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(x, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 xxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(x, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 xxw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(x, x, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 xyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(x, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 xyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(x, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 xyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(x, y, z); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { x = value.x; y = value.y; z = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 xyw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(x, y, w); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { x = value.x; y = value.y; w = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 xzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(x, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 xzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(x, z, y); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { x = value.x; z = value.y; y = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 xzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(x, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 xzw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(x, z, w); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { x = value.x; z = value.y; w = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 xwx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(x, w, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 xwy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(x, w, y); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { x = value.x; w = value.y; y = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 xwz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(x, w, z); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { x = value.x; w = value.y; z = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 xww + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(x, w, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 yxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(y, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 yxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(y, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 yxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(y, x, z); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { y = value.x; x = value.y; z = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 yxw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(y, x, w); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { y = value.x; x = value.y; w = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 yyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(y, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 yyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(y, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 yyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(y, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 yyw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(y, y, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 yzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(y, z, x); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { y = value.x; z = value.y; x = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 yzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(y, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 yzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(y, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 yzw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(y, z, w); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { y = value.x; z = value.y; w = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 ywx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(y, w, x); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { y = value.x; w = value.y; x = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 ywy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(y, w, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 ywz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(y, w, z); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { y = value.x; w = value.y; z = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 yww + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(y, w, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 zxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(z, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 zxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(z, x, y); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { z = value.x; x = value.y; y = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 zxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(z, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 zxw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(z, x, w); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { z = value.x; x = value.y; w = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 zyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(z, y, x); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { z = value.x; y = value.y; x = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 zyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(z, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 zyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(z, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 zyw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(z, y, w); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { z = value.x; y = value.y; w = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 zzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(z, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 zzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(z, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 zzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(z, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 zzw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(z, z, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 zwx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(z, w, x); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { z = value.x; w = value.y; x = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 zwy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(z, w, y); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { z = value.x; w = value.y; y = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 zwz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(z, w, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 zww + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(z, w, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 wxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(w, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 wxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(w, x, y); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { w = value.x; x = value.y; y = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 wxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(w, x, z); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { w = value.x; x = value.y; z = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 wxw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(w, x, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 wyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(w, y, x); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { w = value.x; y = value.y; x = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 wyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(w, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 wyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(w, y, z); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { w = value.x; y = value.y; z = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 wyw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(w, y, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 wzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(w, z, x); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { w = value.x; z = value.y; x = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 wzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(w, z, y); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { w = value.x; z = value.y; y = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 wzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(w, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 wzw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(w, z, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 wwx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(w, w, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 wwy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(w, w, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 wwz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(w, w, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double3 www + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double3(w, w, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double2 xx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double2(x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double2 xy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double2(x, y); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { x = value.x; y = value.y; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double2 xz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double2(x, z); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { x = value.x; z = value.y; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double2 xw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double2(x, w); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { x = value.x; w = value.y; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double2 yx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double2(y, x); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { y = value.x; x = value.y; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double2 yy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double2(y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double2 yz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double2(y, z); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { y = value.x; z = value.y; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double2 yw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double2(y, w); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { y = value.x; w = value.y; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double2 zx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double2(z, x); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { z = value.x; x = value.y; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double2 zy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double2(z, y); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { z = value.x; y = value.y; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double2 zz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double2(z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double2 zw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double2(z, w); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { z = value.x; w = value.y; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double2 wx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double2(w, x); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { w = value.x; x = value.y; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double2 wy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double2(w, y); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { w = value.x; y = value.y; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double2 wz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double2(w, z); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { w = value.x; z = value.y; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public double2 ww + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new double2(w, w); } + } + + + + /// Returns the double element at a specified index. + unsafe public double this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 4) + throw new System.ArgumentException("index must be between[0...3]"); +#endif + fixed (double4* array = &this) { return ((double*)array)[index]; } + } + set + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 4) + throw new System.ArgumentException("index must be between[0...3]"); +#endif + fixed (double* array = &x) { array[index] = value; } + } + } + + /// Returns true if the double4 is equal to a given double4, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(double4 rhs) { return x == rhs.x && y == rhs.y && z == rhs.z && w == rhs.w; } + + /// Returns true if the double4 is equal to a given double4, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is double4 converted && Equals(converted); } + + + /// Returns a hash code for the double4. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the double4. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("double4({0}, {1}, {2}, {3})", x, y, z, w); + } + + /// Returns a string representation of the double4 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("double4({0}, {1}, {2}, {3})", x.ToString(format, formatProvider), y.ToString(format, formatProvider), z.ToString(format, formatProvider), w.ToString(format, formatProvider)); + } + + internal sealed class DebuggerProxy + { + public double x; + public double y; + public double z; + public double w; + public DebuggerProxy(double4 v) + { + x = v.x; + y = v.y; + z = v.z; + w = v.w; + } + } + + } + + public static partial class math + { + /// Returns a double4 vector constructed from four double values. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + /// The constructed vector's z component will be set to this value. + /// The constructed vector's w component will be set to this value. + /// double4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 double4(double x, double y, double z, double w) { return new double4(x, y, z, w); } + + /// Returns a double4 vector constructed from two double values and a double2 vector. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + /// The constructed vector's zw components will be set to this value. + /// double4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 double4(double x, double y, double2 zw) { return new double4(x, y, zw); } + + /// Returns a double4 vector constructed from a double value, a double2 vector and a double value. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's yz components will be set to this value. + /// The constructed vector's w component will be set to this value. + /// double4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 double4(double x, double2 yz, double w) { return new double4(x, yz, w); } + + /// Returns a double4 vector constructed from a double value and a double3 vector. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's yzw components will be set to this value. + /// double4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 double4(double x, double3 yzw) { return new double4(x, yzw); } + + /// Returns a double4 vector constructed from a double2 vector and two double values. + /// The constructed vector's xy components will be set to this value. + /// The constructed vector's z component will be set to this value. + /// The constructed vector's w component will be set to this value. + /// double4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 double4(double2 xy, double z, double w) { return new double4(xy, z, w); } + + /// Returns a double4 vector constructed from two double2 vectors. + /// The constructed vector's xy components will be set to this value. + /// The constructed vector's zw components will be set to this value. + /// double4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 double4(double2 xy, double2 zw) { return new double4(xy, zw); } + + /// Returns a double4 vector constructed from a double3 vector and a double value. + /// The constructed vector's xyz components will be set to this value. + /// The constructed vector's w component will be set to this value. + /// double4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 double4(double3 xyz, double w) { return new double4(xyz, w); } + + /// Returns a double4 vector constructed from a double4 vector. + /// The constructed vector's xyzw components will be set to this value. + /// double4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 double4(double4 xyzw) { return new double4(xyzw); } + + /// Returns a double4 vector constructed from a single double value by assigning it to every component. + /// double to convert to double4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 double4(double v) { return new double4(v); } + + /// Returns a double4 vector constructed from a single bool value by converting it to double and assigning it to every component. + /// bool to convert to double4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 double4(bool v) { return new double4(v); } + + /// Return a double4 vector constructed from a bool4 vector by componentwise conversion. + /// bool4 to convert to double4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 double4(bool4 v) { return new double4(v); } + + /// Returns a double4 vector constructed from a single int value by converting it to double and assigning it to every component. + /// int to convert to double4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 double4(int v) { return new double4(v); } + + /// Return a double4 vector constructed from a int4 vector by componentwise conversion. + /// int4 to convert to double4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 double4(int4 v) { return new double4(v); } + + /// Returns a double4 vector constructed from a single uint value by converting it to double and assigning it to every component. + /// uint to convert to double4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 double4(uint v) { return new double4(v); } + + /// Return a double4 vector constructed from a uint4 vector by componentwise conversion. + /// uint4 to convert to double4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 double4(uint4 v) { return new double4(v); } + + /// Returns a double4 vector constructed from a single half value by converting it to double and assigning it to every component. + /// half to convert to double4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 double4(half v) { return new double4(v); } + + /// Return a double4 vector constructed from a half4 vector by componentwise conversion. + /// half4 to convert to double4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 double4(half4 v) { return new double4(v); } + + /// Returns a double4 vector constructed from a single float value by converting it to double and assigning it to every component. + /// float to convert to double4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 double4(float v) { return new double4(v); } + + /// Return a double4 vector constructed from a float4 vector by componentwise conversion. + /// float4 to convert to double4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 double4(float4 v) { return new double4(v); } + + /// Returns a uint hash code of a double4 vector. + /// Vector value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(double4 v) + { + return csum(fold_to_uint(v) * uint4(0x9F1C739Bu, 0x4B1BD187u, 0x9DF50593u, 0xF18EEB85u)) + 0x9E19BFC3u; + } + + /// + /// Returns a uint4 vector hash code of a double4 vector. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Vector value to hash. + /// uint4 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 hashwide(double4 v) + { + return (fold_to_uint(v) * uint4(0x8196B06Fu, 0xD24EFA19u, 0x7D8048BBu, 0x713BD06Fu)) + 0x753AD6ADu; + } + + /// Returns the result of specified shuffling of the components from two double4 vectors into a double value. + /// double4 to use as the left argument of the shuffle operation. + /// double4 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting double. + /// double result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double shuffle(double4 left, double4 right, ShuffleComponent x) + { + return select_shuffle_component(left, right, x); + } + + /// Returns the result of specified shuffling of the components from two double4 vectors into a double2 vector. + /// double4 to use as the left argument of the shuffle operation. + /// double4 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting double2 x component. + /// The ShuffleComponent to use when setting the resulting double2 y component. + /// double2 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 shuffle(double4 left, double4 right, ShuffleComponent x, ShuffleComponent y) + { + return double2( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y)); + } + + /// Returns the result of specified shuffling of the components from two double4 vectors into a double3 vector. + /// double4 to use as the left argument of the shuffle operation. + /// double4 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting double3 x component. + /// The ShuffleComponent to use when setting the resulting double3 y component. + /// The ShuffleComponent to use when setting the resulting double3 z component. + /// double3 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 shuffle(double4 left, double4 right, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z) + { + return double3( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y), + select_shuffle_component(left, right, z)); + } + + /// Returns the result of specified shuffling of the components from two double4 vectors into a double4 vector. + /// double4 to use as the left argument of the shuffle operation. + /// double4 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting double4 x component. + /// The ShuffleComponent to use when setting the resulting double4 y component. + /// The ShuffleComponent to use when setting the resulting double4 z component. + /// The ShuffleComponent to use when setting the resulting double4 w component. + /// double4 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 shuffle(double4 left, double4 right, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z, ShuffleComponent w) + { + return double4( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y), + select_shuffle_component(left, right, z), + select_shuffle_component(left, right, w)); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static double select_shuffle_component(double4 a, double4 b, ShuffleComponent component) + { + switch(component) + { + case ShuffleComponent.LeftX: + return a.x; + case ShuffleComponent.LeftY: + return a.y; + case ShuffleComponent.LeftZ: + return a.z; + case ShuffleComponent.LeftW: + return a.w; + case ShuffleComponent.RightX: + return b.x; + case ShuffleComponent.RightY: + return b.y; + case ShuffleComponent.RightZ: + return b.z; + case ShuffleComponent.RightW: + return b.w; + default: + throw new System.ArgumentException("Invalid shuffle component: " + component); + } + } + + } +} diff --git a/src/Unity.Mathematics/double4.gen.cs.meta b/src/Unity.Mathematics/double4.gen.cs.meta new file mode 100644 index 00000000..457f7975 --- /dev/null +++ b/src/Unity.Mathematics/double4.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8d041bf430fc14f4787b6f89d3326147 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/double4x2.gen.cs b/src/Unity.Mathematics/double4x2.gen.cs new file mode 100644 index 00000000..77005ce7 --- /dev/null +++ b/src/Unity.Mathematics/double4x2.gen.cs @@ -0,0 +1,639 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 4x2 matrix of doubles. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct double4x2 : System.IEquatable, IFormattable + { + /// Column 0 of the matrix. + public double4 c0; + /// Column 1 of the matrix. + public double4 c1; + + /// double4x2 zero value. + public static readonly double4x2 zero; + + /// Constructs a double4x2 matrix from two double4 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4x2(double4 c0, double4 c1) + { + this.c0 = c0; + this.c1 = c1; + } + + /// Constructs a double4x2 matrix from 8 double values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 3, column 0 will be set to this value. + /// The matrix at row 3, column 1 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4x2(double m00, double m01, + double m10, double m11, + double m20, double m21, + double m30, double m31) + { + this.c0 = new double4(m00, m10, m20, m30); + this.c1 = new double4(m01, m11, m21, m31); + } + + /// Constructs a double4x2 matrix from a single double value by assigning it to every component. + /// double to convert to double4x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4x2(double v) + { + this.c0 = v; + this.c1 = v; + } + + /// Constructs a double4x2 matrix from a single bool value by converting it to double and assigning it to every component. + /// bool to convert to double4x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4x2(bool v) + { + this.c0 = math.select(new double4(0.0), new double4(1.0), v); + this.c1 = math.select(new double4(0.0), new double4(1.0), v); + } + + /// Constructs a double4x2 matrix from a bool4x2 matrix by componentwise conversion. + /// bool4x2 to convert to double4x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4x2(bool4x2 v) + { + this.c0 = math.select(new double4(0.0), new double4(1.0), v.c0); + this.c1 = math.select(new double4(0.0), new double4(1.0), v.c1); + } + + /// Constructs a double4x2 matrix from a single int value by converting it to double and assigning it to every component. + /// int to convert to double4x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4x2(int v) + { + this.c0 = v; + this.c1 = v; + } + + /// Constructs a double4x2 matrix from a int4x2 matrix by componentwise conversion. + /// int4x2 to convert to double4x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4x2(int4x2 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + } + + /// Constructs a double4x2 matrix from a single uint value by converting it to double and assigning it to every component. + /// uint to convert to double4x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4x2(uint v) + { + this.c0 = v; + this.c1 = v; + } + + /// Constructs a double4x2 matrix from a uint4x2 matrix by componentwise conversion. + /// uint4x2 to convert to double4x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4x2(uint4x2 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + } + + /// Constructs a double4x2 matrix from a single float value by converting it to double and assigning it to every component. + /// float to convert to double4x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4x2(float v) + { + this.c0 = v; + this.c1 = v; + } + + /// Constructs a double4x2 matrix from a float4x2 matrix by componentwise conversion. + /// float4x2 to convert to double4x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4x2(float4x2 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + } + + + /// Implicitly converts a single double value to a double4x2 matrix by assigning it to every component. + /// double to convert to double4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double4x2(double v) { return new double4x2(v); } + + /// Explicitly converts a single bool value to a double4x2 matrix by converting it to double and assigning it to every component. + /// bool to convert to double4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator double4x2(bool v) { return new double4x2(v); } + + /// Explicitly converts a bool4x2 matrix to a double4x2 matrix by componentwise conversion. + /// bool4x2 to convert to double4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator double4x2(bool4x2 v) { return new double4x2(v); } + + /// Implicitly converts a single int value to a double4x2 matrix by converting it to double and assigning it to every component. + /// int to convert to double4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double4x2(int v) { return new double4x2(v); } + + /// Implicitly converts a int4x2 matrix to a double4x2 matrix by componentwise conversion. + /// int4x2 to convert to double4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double4x2(int4x2 v) { return new double4x2(v); } + + /// Implicitly converts a single uint value to a double4x2 matrix by converting it to double and assigning it to every component. + /// uint to convert to double4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double4x2(uint v) { return new double4x2(v); } + + /// Implicitly converts a uint4x2 matrix to a double4x2 matrix by componentwise conversion. + /// uint4x2 to convert to double4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double4x2(uint4x2 v) { return new double4x2(v); } + + /// Implicitly converts a single float value to a double4x2 matrix by converting it to double and assigning it to every component. + /// float to convert to double4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double4x2(float v) { return new double4x2(v); } + + /// Implicitly converts a float4x2 matrix to a double4x2 matrix by componentwise conversion. + /// float4x2 to convert to double4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double4x2(float4x2 v) { return new double4x2(v); } + + + /// Returns the result of a componentwise multiplication operation on two double4x2 matrices. + /// Left hand side double4x2 to use to compute componentwise multiplication. + /// Right hand side double4x2 to use to compute componentwise multiplication. + /// double4x2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x2 operator * (double4x2 lhs, double4x2 rhs) { return new double4x2 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1); } + + /// Returns the result of a componentwise multiplication operation on a double4x2 matrix and a double value. + /// Left hand side double4x2 to use to compute componentwise multiplication. + /// Right hand side double to use to compute componentwise multiplication. + /// double4x2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x2 operator * (double4x2 lhs, double rhs) { return new double4x2 (lhs.c0 * rhs, lhs.c1 * rhs); } + + /// Returns the result of a componentwise multiplication operation on a double value and a double4x2 matrix. + /// Left hand side double to use to compute componentwise multiplication. + /// Right hand side double4x2 to use to compute componentwise multiplication. + /// double4x2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x2 operator * (double lhs, double4x2 rhs) { return new double4x2 (lhs * rhs.c0, lhs * rhs.c1); } + + + /// Returns the result of a componentwise addition operation on two double4x2 matrices. + /// Left hand side double4x2 to use to compute componentwise addition. + /// Right hand side double4x2 to use to compute componentwise addition. + /// double4x2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x2 operator + (double4x2 lhs, double4x2 rhs) { return new double4x2 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1); } + + /// Returns the result of a componentwise addition operation on a double4x2 matrix and a double value. + /// Left hand side double4x2 to use to compute componentwise addition. + /// Right hand side double to use to compute componentwise addition. + /// double4x2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x2 operator + (double4x2 lhs, double rhs) { return new double4x2 (lhs.c0 + rhs, lhs.c1 + rhs); } + + /// Returns the result of a componentwise addition operation on a double value and a double4x2 matrix. + /// Left hand side double to use to compute componentwise addition. + /// Right hand side double4x2 to use to compute componentwise addition. + /// double4x2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x2 operator + (double lhs, double4x2 rhs) { return new double4x2 (lhs + rhs.c0, lhs + rhs.c1); } + + + /// Returns the result of a componentwise subtraction operation on two double4x2 matrices. + /// Left hand side double4x2 to use to compute componentwise subtraction. + /// Right hand side double4x2 to use to compute componentwise subtraction. + /// double4x2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x2 operator - (double4x2 lhs, double4x2 rhs) { return new double4x2 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1); } + + /// Returns the result of a componentwise subtraction operation on a double4x2 matrix and a double value. + /// Left hand side double4x2 to use to compute componentwise subtraction. + /// Right hand side double to use to compute componentwise subtraction. + /// double4x2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x2 operator - (double4x2 lhs, double rhs) { return new double4x2 (lhs.c0 - rhs, lhs.c1 - rhs); } + + /// Returns the result of a componentwise subtraction operation on a double value and a double4x2 matrix. + /// Left hand side double to use to compute componentwise subtraction. + /// Right hand side double4x2 to use to compute componentwise subtraction. + /// double4x2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x2 operator - (double lhs, double4x2 rhs) { return new double4x2 (lhs - rhs.c0, lhs - rhs.c1); } + + + /// Returns the result of a componentwise division operation on two double4x2 matrices. + /// Left hand side double4x2 to use to compute componentwise division. + /// Right hand side double4x2 to use to compute componentwise division. + /// double4x2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x2 operator / (double4x2 lhs, double4x2 rhs) { return new double4x2 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1); } + + /// Returns the result of a componentwise division operation on a double4x2 matrix and a double value. + /// Left hand side double4x2 to use to compute componentwise division. + /// Right hand side double to use to compute componentwise division. + /// double4x2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x2 operator / (double4x2 lhs, double rhs) { return new double4x2 (lhs.c0 / rhs, lhs.c1 / rhs); } + + /// Returns the result of a componentwise division operation on a double value and a double4x2 matrix. + /// Left hand side double to use to compute componentwise division. + /// Right hand side double4x2 to use to compute componentwise division. + /// double4x2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x2 operator / (double lhs, double4x2 rhs) { return new double4x2 (lhs / rhs.c0, lhs / rhs.c1); } + + + /// Returns the result of a componentwise modulus operation on two double4x2 matrices. + /// Left hand side double4x2 to use to compute componentwise modulus. + /// Right hand side double4x2 to use to compute componentwise modulus. + /// double4x2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x2 operator % (double4x2 lhs, double4x2 rhs) { return new double4x2 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1); } + + /// Returns the result of a componentwise modulus operation on a double4x2 matrix and a double value. + /// Left hand side double4x2 to use to compute componentwise modulus. + /// Right hand side double to use to compute componentwise modulus. + /// double4x2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x2 operator % (double4x2 lhs, double rhs) { return new double4x2 (lhs.c0 % rhs, lhs.c1 % rhs); } + + /// Returns the result of a componentwise modulus operation on a double value and a double4x2 matrix. + /// Left hand side double to use to compute componentwise modulus. + /// Right hand side double4x2 to use to compute componentwise modulus. + /// double4x2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x2 operator % (double lhs, double4x2 rhs) { return new double4x2 (lhs % rhs.c0, lhs % rhs.c1); } + + + /// Returns the result of a componentwise increment operation on a double4x2 matrix. + /// Value to use when computing the componentwise increment. + /// double4x2 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x2 operator ++ (double4x2 val) { return new double4x2 (++val.c0, ++val.c1); } + + + /// Returns the result of a componentwise decrement operation on a double4x2 matrix. + /// Value to use when computing the componentwise decrement. + /// double4x2 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x2 operator -- (double4x2 val) { return new double4x2 (--val.c0, --val.c1); } + + + /// Returns the result of a componentwise less than operation on two double4x2 matrices. + /// Left hand side double4x2 to use to compute componentwise less than. + /// Right hand side double4x2 to use to compute componentwise less than. + /// bool4x2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator < (double4x2 lhs, double4x2 rhs) { return new bool4x2 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1); } + + /// Returns the result of a componentwise less than operation on a double4x2 matrix and a double value. + /// Left hand side double4x2 to use to compute componentwise less than. + /// Right hand side double to use to compute componentwise less than. + /// bool4x2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator < (double4x2 lhs, double rhs) { return new bool4x2 (lhs.c0 < rhs, lhs.c1 < rhs); } + + /// Returns the result of a componentwise less than operation on a double value and a double4x2 matrix. + /// Left hand side double to use to compute componentwise less than. + /// Right hand side double4x2 to use to compute componentwise less than. + /// bool4x2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator < (double lhs, double4x2 rhs) { return new bool4x2 (lhs < rhs.c0, lhs < rhs.c1); } + + + /// Returns the result of a componentwise less or equal operation on two double4x2 matrices. + /// Left hand side double4x2 to use to compute componentwise less or equal. + /// Right hand side double4x2 to use to compute componentwise less or equal. + /// bool4x2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator <= (double4x2 lhs, double4x2 rhs) { return new bool4x2 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1); } + + /// Returns the result of a componentwise less or equal operation on a double4x2 matrix and a double value. + /// Left hand side double4x2 to use to compute componentwise less or equal. + /// Right hand side double to use to compute componentwise less or equal. + /// bool4x2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator <= (double4x2 lhs, double rhs) { return new bool4x2 (lhs.c0 <= rhs, lhs.c1 <= rhs); } + + /// Returns the result of a componentwise less or equal operation on a double value and a double4x2 matrix. + /// Left hand side double to use to compute componentwise less or equal. + /// Right hand side double4x2 to use to compute componentwise less or equal. + /// bool4x2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator <= (double lhs, double4x2 rhs) { return new bool4x2 (lhs <= rhs.c0, lhs <= rhs.c1); } + + + /// Returns the result of a componentwise greater than operation on two double4x2 matrices. + /// Left hand side double4x2 to use to compute componentwise greater than. + /// Right hand side double4x2 to use to compute componentwise greater than. + /// bool4x2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator > (double4x2 lhs, double4x2 rhs) { return new bool4x2 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1); } + + /// Returns the result of a componentwise greater than operation on a double4x2 matrix and a double value. + /// Left hand side double4x2 to use to compute componentwise greater than. + /// Right hand side double to use to compute componentwise greater than. + /// bool4x2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator > (double4x2 lhs, double rhs) { return new bool4x2 (lhs.c0 > rhs, lhs.c1 > rhs); } + + /// Returns the result of a componentwise greater than operation on a double value and a double4x2 matrix. + /// Left hand side double to use to compute componentwise greater than. + /// Right hand side double4x2 to use to compute componentwise greater than. + /// bool4x2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator > (double lhs, double4x2 rhs) { return new bool4x2 (lhs > rhs.c0, lhs > rhs.c1); } + + + /// Returns the result of a componentwise greater or equal operation on two double4x2 matrices. + /// Left hand side double4x2 to use to compute componentwise greater or equal. + /// Right hand side double4x2 to use to compute componentwise greater or equal. + /// bool4x2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator >= (double4x2 lhs, double4x2 rhs) { return new bool4x2 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1); } + + /// Returns the result of a componentwise greater or equal operation on a double4x2 matrix and a double value. + /// Left hand side double4x2 to use to compute componentwise greater or equal. + /// Right hand side double to use to compute componentwise greater or equal. + /// bool4x2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator >= (double4x2 lhs, double rhs) { return new bool4x2 (lhs.c0 >= rhs, lhs.c1 >= rhs); } + + /// Returns the result of a componentwise greater or equal operation on a double value and a double4x2 matrix. + /// Left hand side double to use to compute componentwise greater or equal. + /// Right hand side double4x2 to use to compute componentwise greater or equal. + /// bool4x2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator >= (double lhs, double4x2 rhs) { return new bool4x2 (lhs >= rhs.c0, lhs >= rhs.c1); } + + + /// Returns the result of a componentwise unary minus operation on a double4x2 matrix. + /// Value to use when computing the componentwise unary minus. + /// double4x2 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x2 operator - (double4x2 val) { return new double4x2 (-val.c0, -val.c1); } + + + /// Returns the result of a componentwise unary plus operation on a double4x2 matrix. + /// Value to use when computing the componentwise unary plus. + /// double4x2 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x2 operator + (double4x2 val) { return new double4x2 (+val.c0, +val.c1); } + + + /// Returns the result of a componentwise equality operation on two double4x2 matrices. + /// Left hand side double4x2 to use to compute componentwise equality. + /// Right hand side double4x2 to use to compute componentwise equality. + /// bool4x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator == (double4x2 lhs, double4x2 rhs) { return new bool4x2 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1); } + + /// Returns the result of a componentwise equality operation on a double4x2 matrix and a double value. + /// Left hand side double4x2 to use to compute componentwise equality. + /// Right hand side double to use to compute componentwise equality. + /// bool4x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator == (double4x2 lhs, double rhs) { return new bool4x2 (lhs.c0 == rhs, lhs.c1 == rhs); } + + /// Returns the result of a componentwise equality operation on a double value and a double4x2 matrix. + /// Left hand side double to use to compute componentwise equality. + /// Right hand side double4x2 to use to compute componentwise equality. + /// bool4x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator == (double lhs, double4x2 rhs) { return new bool4x2 (lhs == rhs.c0, lhs == rhs.c1); } + + + /// Returns the result of a componentwise not equal operation on two double4x2 matrices. + /// Left hand side double4x2 to use to compute componentwise not equal. + /// Right hand side double4x2 to use to compute componentwise not equal. + /// bool4x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator != (double4x2 lhs, double4x2 rhs) { return new bool4x2 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1); } + + /// Returns the result of a componentwise not equal operation on a double4x2 matrix and a double value. + /// Left hand side double4x2 to use to compute componentwise not equal. + /// Right hand side double to use to compute componentwise not equal. + /// bool4x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator != (double4x2 lhs, double rhs) { return new bool4x2 (lhs.c0 != rhs, lhs.c1 != rhs); } + + /// Returns the result of a componentwise not equal operation on a double value and a double4x2 matrix. + /// Left hand side double to use to compute componentwise not equal. + /// Right hand side double4x2 to use to compute componentwise not equal. + /// bool4x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator != (double lhs, double4x2 rhs) { return new bool4x2 (lhs != rhs.c0, lhs != rhs.c1); } + + + + /// Returns the double4 element at a specified index. + unsafe public ref double4 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 2) + throw new System.ArgumentException("index must be between[0...1]"); +#endif + fixed (double4x2* array = &this) { return ref ((double4*)array)[index]; } + } + } + + /// Returns true if the double4x2 is equal to a given double4x2, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(double4x2 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1); } + + /// Returns true if the double4x2 is equal to a given double4x2, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is double4x2 converted && Equals(converted); } + + + /// Returns a hash code for the double4x2. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the double4x2. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("double4x2({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7})", c0.x, c1.x, c0.y, c1.y, c0.z, c1.z, c0.w, c1.w); + } + + /// Returns a string representation of the double4x2 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("double4x2({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7})", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c0.z.ToString(format, formatProvider), c1.z.ToString(format, formatProvider), c0.w.ToString(format, formatProvider), c1.w.ToString(format, formatProvider)); + } + + } + + public static partial class math + { + /// Returns a double4x2 matrix constructed from two double4 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// double4x2 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x2 double4x2(double4 c0, double4 c1) { return new double4x2(c0, c1); } + + /// Returns a double4x2 matrix constructed from from 8 double values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 3, column 0 will be set to this value. + /// The matrix at row 3, column 1 will be set to this value. + /// double4x2 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x2 double4x2(double m00, double m01, + double m10, double m11, + double m20, double m21, + double m30, double m31) + { + return new double4x2(m00, m01, + m10, m11, + m20, m21, + m30, m31); + } + + /// Returns a double4x2 matrix constructed from a single double value by assigning it to every component. + /// double to convert to double4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x2 double4x2(double v) { return new double4x2(v); } + + /// Returns a double4x2 matrix constructed from a single bool value by converting it to double and assigning it to every component. + /// bool to convert to double4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x2 double4x2(bool v) { return new double4x2(v); } + + /// Return a double4x2 matrix constructed from a bool4x2 matrix by componentwise conversion. + /// bool4x2 to convert to double4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x2 double4x2(bool4x2 v) { return new double4x2(v); } + + /// Returns a double4x2 matrix constructed from a single int value by converting it to double and assigning it to every component. + /// int to convert to double4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x2 double4x2(int v) { return new double4x2(v); } + + /// Return a double4x2 matrix constructed from a int4x2 matrix by componentwise conversion. + /// int4x2 to convert to double4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x2 double4x2(int4x2 v) { return new double4x2(v); } + + /// Returns a double4x2 matrix constructed from a single uint value by converting it to double and assigning it to every component. + /// uint to convert to double4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x2 double4x2(uint v) { return new double4x2(v); } + + /// Return a double4x2 matrix constructed from a uint4x2 matrix by componentwise conversion. + /// uint4x2 to convert to double4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x2 double4x2(uint4x2 v) { return new double4x2(v); } + + /// Returns a double4x2 matrix constructed from a single float value by converting it to double and assigning it to every component. + /// float to convert to double4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x2 double4x2(float v) { return new double4x2(v); } + + /// Return a double4x2 matrix constructed from a float4x2 matrix by componentwise conversion. + /// float4x2 to convert to double4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x2 double4x2(float4x2 v) { return new double4x2(v); } + + /// Return the double2x4 transpose of a double4x2 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x4 transpose(double4x2 v) + { + return double2x4( + v.c0.x, v.c0.y, v.c0.z, v.c0.w, + v.c1.x, v.c1.y, v.c1.z, v.c1.w); + } + + /// Returns a uint hash code of a double4x2 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(double4x2 v) + { + return csum(fold_to_uint(v.c0) * uint4(0x5AB3E8CDu, 0x676E8407u, 0xB36DE767u, 0x6FCA387Du) + + fold_to_uint(v.c1) * uint4(0xAF0F3103u, 0xE4A056C7u, 0x841D8225u, 0xC9393C7Du)) + 0xD42EAFA3u; + } + + /// + /// Returns a uint4 vector hash code of a double4x2 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint4 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 hashwide(double4x2 v) + { + return (fold_to_uint(v.c0) * uint4(0xD9AFD06Du, 0x97A65421u, 0x7809205Fu, 0x9C9F0823u) + + fold_to_uint(v.c1) * uint4(0x5A9CA13Bu, 0xAFCDD5EFu, 0xA88D187Du, 0xCF6EBA1Du)) + 0x9D88E5A1u; + } + + } +} diff --git a/src/Unity.Mathematics/double4x2.gen.cs.meta b/src/Unity.Mathematics/double4x2.gen.cs.meta new file mode 100644 index 00000000..debb415a --- /dev/null +++ b/src/Unity.Mathematics/double4x2.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2780651a7c8e8413da73612cb720fbac +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/double4x3.gen.cs b/src/Unity.Mathematics/double4x3.gen.cs new file mode 100644 index 00000000..54e6cfea --- /dev/null +++ b/src/Unity.Mathematics/double4x3.gen.cs @@ -0,0 +1,665 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 4x3 matrix of doubles. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct double4x3 : System.IEquatable, IFormattable + { + /// Column 0 of the matrix. + public double4 c0; + /// Column 1 of the matrix. + public double4 c1; + /// Column 2 of the matrix. + public double4 c2; + + /// double4x3 zero value. + public static readonly double4x3 zero; + + /// Constructs a double4x3 matrix from three double4 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4x3(double4 c0, double4 c1, double4 c2) + { + this.c0 = c0; + this.c1 = c1; + this.c2 = c2; + } + + /// Constructs a double4x3 matrix from 12 double values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 2, column 2 will be set to this value. + /// The matrix at row 3, column 0 will be set to this value. + /// The matrix at row 3, column 1 will be set to this value. + /// The matrix at row 3, column 2 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4x3(double m00, double m01, double m02, + double m10, double m11, double m12, + double m20, double m21, double m22, + double m30, double m31, double m32) + { + this.c0 = new double4(m00, m10, m20, m30); + this.c1 = new double4(m01, m11, m21, m31); + this.c2 = new double4(m02, m12, m22, m32); + } + + /// Constructs a double4x3 matrix from a single double value by assigning it to every component. + /// double to convert to double4x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4x3(double v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + } + + /// Constructs a double4x3 matrix from a single bool value by converting it to double and assigning it to every component. + /// bool to convert to double4x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4x3(bool v) + { + this.c0 = math.select(new double4(0.0), new double4(1.0), v); + this.c1 = math.select(new double4(0.0), new double4(1.0), v); + this.c2 = math.select(new double4(0.0), new double4(1.0), v); + } + + /// Constructs a double4x3 matrix from a bool4x3 matrix by componentwise conversion. + /// bool4x3 to convert to double4x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4x3(bool4x3 v) + { + this.c0 = math.select(new double4(0.0), new double4(1.0), v.c0); + this.c1 = math.select(new double4(0.0), new double4(1.0), v.c1); + this.c2 = math.select(new double4(0.0), new double4(1.0), v.c2); + } + + /// Constructs a double4x3 matrix from a single int value by converting it to double and assigning it to every component. + /// int to convert to double4x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4x3(int v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + } + + /// Constructs a double4x3 matrix from a int4x3 matrix by componentwise conversion. + /// int4x3 to convert to double4x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4x3(int4x3 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + this.c2 = v.c2; + } + + /// Constructs a double4x3 matrix from a single uint value by converting it to double and assigning it to every component. + /// uint to convert to double4x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4x3(uint v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + } + + /// Constructs a double4x3 matrix from a uint4x3 matrix by componentwise conversion. + /// uint4x3 to convert to double4x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4x3(uint4x3 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + this.c2 = v.c2; + } + + /// Constructs a double4x3 matrix from a single float value by converting it to double and assigning it to every component. + /// float to convert to double4x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4x3(float v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + } + + /// Constructs a double4x3 matrix from a float4x3 matrix by componentwise conversion. + /// float4x3 to convert to double4x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4x3(float4x3 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + this.c2 = v.c2; + } + + + /// Implicitly converts a single double value to a double4x3 matrix by assigning it to every component. + /// double to convert to double4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double4x3(double v) { return new double4x3(v); } + + /// Explicitly converts a single bool value to a double4x3 matrix by converting it to double and assigning it to every component. + /// bool to convert to double4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator double4x3(bool v) { return new double4x3(v); } + + /// Explicitly converts a bool4x3 matrix to a double4x3 matrix by componentwise conversion. + /// bool4x3 to convert to double4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator double4x3(bool4x3 v) { return new double4x3(v); } + + /// Implicitly converts a single int value to a double4x3 matrix by converting it to double and assigning it to every component. + /// int to convert to double4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double4x3(int v) { return new double4x3(v); } + + /// Implicitly converts a int4x3 matrix to a double4x3 matrix by componentwise conversion. + /// int4x3 to convert to double4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double4x3(int4x3 v) { return new double4x3(v); } + + /// Implicitly converts a single uint value to a double4x3 matrix by converting it to double and assigning it to every component. + /// uint to convert to double4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double4x3(uint v) { return new double4x3(v); } + + /// Implicitly converts a uint4x3 matrix to a double4x3 matrix by componentwise conversion. + /// uint4x3 to convert to double4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double4x3(uint4x3 v) { return new double4x3(v); } + + /// Implicitly converts a single float value to a double4x3 matrix by converting it to double and assigning it to every component. + /// float to convert to double4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double4x3(float v) { return new double4x3(v); } + + /// Implicitly converts a float4x3 matrix to a double4x3 matrix by componentwise conversion. + /// float4x3 to convert to double4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double4x3(float4x3 v) { return new double4x3(v); } + + + /// Returns the result of a componentwise multiplication operation on two double4x3 matrices. + /// Left hand side double4x3 to use to compute componentwise multiplication. + /// Right hand side double4x3 to use to compute componentwise multiplication. + /// double4x3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x3 operator * (double4x3 lhs, double4x3 rhs) { return new double4x3 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1, lhs.c2 * rhs.c2); } + + /// Returns the result of a componentwise multiplication operation on a double4x3 matrix and a double value. + /// Left hand side double4x3 to use to compute componentwise multiplication. + /// Right hand side double to use to compute componentwise multiplication. + /// double4x3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x3 operator * (double4x3 lhs, double rhs) { return new double4x3 (lhs.c0 * rhs, lhs.c1 * rhs, lhs.c2 * rhs); } + + /// Returns the result of a componentwise multiplication operation on a double value and a double4x3 matrix. + /// Left hand side double to use to compute componentwise multiplication. + /// Right hand side double4x3 to use to compute componentwise multiplication. + /// double4x3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x3 operator * (double lhs, double4x3 rhs) { return new double4x3 (lhs * rhs.c0, lhs * rhs.c1, lhs * rhs.c2); } + + + /// Returns the result of a componentwise addition operation on two double4x3 matrices. + /// Left hand side double4x3 to use to compute componentwise addition. + /// Right hand side double4x3 to use to compute componentwise addition. + /// double4x3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x3 operator + (double4x3 lhs, double4x3 rhs) { return new double4x3 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1, lhs.c2 + rhs.c2); } + + /// Returns the result of a componentwise addition operation on a double4x3 matrix and a double value. + /// Left hand side double4x3 to use to compute componentwise addition. + /// Right hand side double to use to compute componentwise addition. + /// double4x3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x3 operator + (double4x3 lhs, double rhs) { return new double4x3 (lhs.c0 + rhs, lhs.c1 + rhs, lhs.c2 + rhs); } + + /// Returns the result of a componentwise addition operation on a double value and a double4x3 matrix. + /// Left hand side double to use to compute componentwise addition. + /// Right hand side double4x3 to use to compute componentwise addition. + /// double4x3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x3 operator + (double lhs, double4x3 rhs) { return new double4x3 (lhs + rhs.c0, lhs + rhs.c1, lhs + rhs.c2); } + + + /// Returns the result of a componentwise subtraction operation on two double4x3 matrices. + /// Left hand side double4x3 to use to compute componentwise subtraction. + /// Right hand side double4x3 to use to compute componentwise subtraction. + /// double4x3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x3 operator - (double4x3 lhs, double4x3 rhs) { return new double4x3 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1, lhs.c2 - rhs.c2); } + + /// Returns the result of a componentwise subtraction operation on a double4x3 matrix and a double value. + /// Left hand side double4x3 to use to compute componentwise subtraction. + /// Right hand side double to use to compute componentwise subtraction. + /// double4x3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x3 operator - (double4x3 lhs, double rhs) { return new double4x3 (lhs.c0 - rhs, lhs.c1 - rhs, lhs.c2 - rhs); } + + /// Returns the result of a componentwise subtraction operation on a double value and a double4x3 matrix. + /// Left hand side double to use to compute componentwise subtraction. + /// Right hand side double4x3 to use to compute componentwise subtraction. + /// double4x3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x3 operator - (double lhs, double4x3 rhs) { return new double4x3 (lhs - rhs.c0, lhs - rhs.c1, lhs - rhs.c2); } + + + /// Returns the result of a componentwise division operation on two double4x3 matrices. + /// Left hand side double4x3 to use to compute componentwise division. + /// Right hand side double4x3 to use to compute componentwise division. + /// double4x3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x3 operator / (double4x3 lhs, double4x3 rhs) { return new double4x3 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1, lhs.c2 / rhs.c2); } + + /// Returns the result of a componentwise division operation on a double4x3 matrix and a double value. + /// Left hand side double4x3 to use to compute componentwise division. + /// Right hand side double to use to compute componentwise division. + /// double4x3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x3 operator / (double4x3 lhs, double rhs) { return new double4x3 (lhs.c0 / rhs, lhs.c1 / rhs, lhs.c2 / rhs); } + + /// Returns the result of a componentwise division operation on a double value and a double4x3 matrix. + /// Left hand side double to use to compute componentwise division. + /// Right hand side double4x3 to use to compute componentwise division. + /// double4x3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x3 operator / (double lhs, double4x3 rhs) { return new double4x3 (lhs / rhs.c0, lhs / rhs.c1, lhs / rhs.c2); } + + + /// Returns the result of a componentwise modulus operation on two double4x3 matrices. + /// Left hand side double4x3 to use to compute componentwise modulus. + /// Right hand side double4x3 to use to compute componentwise modulus. + /// double4x3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x3 operator % (double4x3 lhs, double4x3 rhs) { return new double4x3 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1, lhs.c2 % rhs.c2); } + + /// Returns the result of a componentwise modulus operation on a double4x3 matrix and a double value. + /// Left hand side double4x3 to use to compute componentwise modulus. + /// Right hand side double to use to compute componentwise modulus. + /// double4x3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x3 operator % (double4x3 lhs, double rhs) { return new double4x3 (lhs.c0 % rhs, lhs.c1 % rhs, lhs.c2 % rhs); } + + /// Returns the result of a componentwise modulus operation on a double value and a double4x3 matrix. + /// Left hand side double to use to compute componentwise modulus. + /// Right hand side double4x3 to use to compute componentwise modulus. + /// double4x3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x3 operator % (double lhs, double4x3 rhs) { return new double4x3 (lhs % rhs.c0, lhs % rhs.c1, lhs % rhs.c2); } + + + /// Returns the result of a componentwise increment operation on a double4x3 matrix. + /// Value to use when computing the componentwise increment. + /// double4x3 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x3 operator ++ (double4x3 val) { return new double4x3 (++val.c0, ++val.c1, ++val.c2); } + + + /// Returns the result of a componentwise decrement operation on a double4x3 matrix. + /// Value to use when computing the componentwise decrement. + /// double4x3 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x3 operator -- (double4x3 val) { return new double4x3 (--val.c0, --val.c1, --val.c2); } + + + /// Returns the result of a componentwise less than operation on two double4x3 matrices. + /// Left hand side double4x3 to use to compute componentwise less than. + /// Right hand side double4x3 to use to compute componentwise less than. + /// bool4x3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator < (double4x3 lhs, double4x3 rhs) { return new bool4x3 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1, lhs.c2 < rhs.c2); } + + /// Returns the result of a componentwise less than operation on a double4x3 matrix and a double value. + /// Left hand side double4x3 to use to compute componentwise less than. + /// Right hand side double to use to compute componentwise less than. + /// bool4x3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator < (double4x3 lhs, double rhs) { return new bool4x3 (lhs.c0 < rhs, lhs.c1 < rhs, lhs.c2 < rhs); } + + /// Returns the result of a componentwise less than operation on a double value and a double4x3 matrix. + /// Left hand side double to use to compute componentwise less than. + /// Right hand side double4x3 to use to compute componentwise less than. + /// bool4x3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator < (double lhs, double4x3 rhs) { return new bool4x3 (lhs < rhs.c0, lhs < rhs.c1, lhs < rhs.c2); } + + + /// Returns the result of a componentwise less or equal operation on two double4x3 matrices. + /// Left hand side double4x3 to use to compute componentwise less or equal. + /// Right hand side double4x3 to use to compute componentwise less or equal. + /// bool4x3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator <= (double4x3 lhs, double4x3 rhs) { return new bool4x3 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1, lhs.c2 <= rhs.c2); } + + /// Returns the result of a componentwise less or equal operation on a double4x3 matrix and a double value. + /// Left hand side double4x3 to use to compute componentwise less or equal. + /// Right hand side double to use to compute componentwise less or equal. + /// bool4x3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator <= (double4x3 lhs, double rhs) { return new bool4x3 (lhs.c0 <= rhs, lhs.c1 <= rhs, lhs.c2 <= rhs); } + + /// Returns the result of a componentwise less or equal operation on a double value and a double4x3 matrix. + /// Left hand side double to use to compute componentwise less or equal. + /// Right hand side double4x3 to use to compute componentwise less or equal. + /// bool4x3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator <= (double lhs, double4x3 rhs) { return new bool4x3 (lhs <= rhs.c0, lhs <= rhs.c1, lhs <= rhs.c2); } + + + /// Returns the result of a componentwise greater than operation on two double4x3 matrices. + /// Left hand side double4x3 to use to compute componentwise greater than. + /// Right hand side double4x3 to use to compute componentwise greater than. + /// bool4x3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator > (double4x3 lhs, double4x3 rhs) { return new bool4x3 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1, lhs.c2 > rhs.c2); } + + /// Returns the result of a componentwise greater than operation on a double4x3 matrix and a double value. + /// Left hand side double4x3 to use to compute componentwise greater than. + /// Right hand side double to use to compute componentwise greater than. + /// bool4x3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator > (double4x3 lhs, double rhs) { return new bool4x3 (lhs.c0 > rhs, lhs.c1 > rhs, lhs.c2 > rhs); } + + /// Returns the result of a componentwise greater than operation on a double value and a double4x3 matrix. + /// Left hand side double to use to compute componentwise greater than. + /// Right hand side double4x3 to use to compute componentwise greater than. + /// bool4x3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator > (double lhs, double4x3 rhs) { return new bool4x3 (lhs > rhs.c0, lhs > rhs.c1, lhs > rhs.c2); } + + + /// Returns the result of a componentwise greater or equal operation on two double4x3 matrices. + /// Left hand side double4x3 to use to compute componentwise greater or equal. + /// Right hand side double4x3 to use to compute componentwise greater or equal. + /// bool4x3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator >= (double4x3 lhs, double4x3 rhs) { return new bool4x3 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1, lhs.c2 >= rhs.c2); } + + /// Returns the result of a componentwise greater or equal operation on a double4x3 matrix and a double value. + /// Left hand side double4x3 to use to compute componentwise greater or equal. + /// Right hand side double to use to compute componentwise greater or equal. + /// bool4x3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator >= (double4x3 lhs, double rhs) { return new bool4x3 (lhs.c0 >= rhs, lhs.c1 >= rhs, lhs.c2 >= rhs); } + + /// Returns the result of a componentwise greater or equal operation on a double value and a double4x3 matrix. + /// Left hand side double to use to compute componentwise greater or equal. + /// Right hand side double4x3 to use to compute componentwise greater or equal. + /// bool4x3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator >= (double lhs, double4x3 rhs) { return new bool4x3 (lhs >= rhs.c0, lhs >= rhs.c1, lhs >= rhs.c2); } + + + /// Returns the result of a componentwise unary minus operation on a double4x3 matrix. + /// Value to use when computing the componentwise unary minus. + /// double4x3 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x3 operator - (double4x3 val) { return new double4x3 (-val.c0, -val.c1, -val.c2); } + + + /// Returns the result of a componentwise unary plus operation on a double4x3 matrix. + /// Value to use when computing the componentwise unary plus. + /// double4x3 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x3 operator + (double4x3 val) { return new double4x3 (+val.c0, +val.c1, +val.c2); } + + + /// Returns the result of a componentwise equality operation on two double4x3 matrices. + /// Left hand side double4x3 to use to compute componentwise equality. + /// Right hand side double4x3 to use to compute componentwise equality. + /// bool4x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator == (double4x3 lhs, double4x3 rhs) { return new bool4x3 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2); } + + /// Returns the result of a componentwise equality operation on a double4x3 matrix and a double value. + /// Left hand side double4x3 to use to compute componentwise equality. + /// Right hand side double to use to compute componentwise equality. + /// bool4x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator == (double4x3 lhs, double rhs) { return new bool4x3 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs); } + + /// Returns the result of a componentwise equality operation on a double value and a double4x3 matrix. + /// Left hand side double to use to compute componentwise equality. + /// Right hand side double4x3 to use to compute componentwise equality. + /// bool4x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator == (double lhs, double4x3 rhs) { return new bool4x3 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2); } + + + /// Returns the result of a componentwise not equal operation on two double4x3 matrices. + /// Left hand side double4x3 to use to compute componentwise not equal. + /// Right hand side double4x3 to use to compute componentwise not equal. + /// bool4x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator != (double4x3 lhs, double4x3 rhs) { return new bool4x3 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2); } + + /// Returns the result of a componentwise not equal operation on a double4x3 matrix and a double value. + /// Left hand side double4x3 to use to compute componentwise not equal. + /// Right hand side double to use to compute componentwise not equal. + /// bool4x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator != (double4x3 lhs, double rhs) { return new bool4x3 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs); } + + /// Returns the result of a componentwise not equal operation on a double value and a double4x3 matrix. + /// Left hand side double to use to compute componentwise not equal. + /// Right hand side double4x3 to use to compute componentwise not equal. + /// bool4x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator != (double lhs, double4x3 rhs) { return new bool4x3 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2); } + + + + /// Returns the double4 element at a specified index. + unsafe public ref double4 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 3) + throw new System.ArgumentException("index must be between[0...2]"); +#endif + fixed (double4x3* array = &this) { return ref ((double4*)array)[index]; } + } + } + + /// Returns true if the double4x3 is equal to a given double4x3, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(double4x3 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2); } + + /// Returns true if the double4x3 is equal to a given double4x3, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is double4x3 converted && Equals(converted); } + + + /// Returns a hash code for the double4x3. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the double4x3. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("double4x3({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11})", c0.x, c1.x, c2.x, c0.y, c1.y, c2.y, c0.z, c1.z, c2.z, c0.w, c1.w, c2.w); + } + + /// Returns a string representation of the double4x3 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("double4x3({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11})", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c2.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c2.y.ToString(format, formatProvider), c0.z.ToString(format, formatProvider), c1.z.ToString(format, formatProvider), c2.z.ToString(format, formatProvider), c0.w.ToString(format, formatProvider), c1.w.ToString(format, formatProvider), c2.w.ToString(format, formatProvider)); + } + + } + + public static partial class math + { + /// Returns a double4x3 matrix constructed from three double4 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// double4x3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x3 double4x3(double4 c0, double4 c1, double4 c2) { return new double4x3(c0, c1, c2); } + + /// Returns a double4x3 matrix constructed from from 12 double values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 2, column 2 will be set to this value. + /// The matrix at row 3, column 0 will be set to this value. + /// The matrix at row 3, column 1 will be set to this value. + /// The matrix at row 3, column 2 will be set to this value. + /// double4x3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x3 double4x3(double m00, double m01, double m02, + double m10, double m11, double m12, + double m20, double m21, double m22, + double m30, double m31, double m32) + { + return new double4x3(m00, m01, m02, + m10, m11, m12, + m20, m21, m22, + m30, m31, m32); + } + + /// Returns a double4x3 matrix constructed from a single double value by assigning it to every component. + /// double to convert to double4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x3 double4x3(double v) { return new double4x3(v); } + + /// Returns a double4x3 matrix constructed from a single bool value by converting it to double and assigning it to every component. + /// bool to convert to double4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x3 double4x3(bool v) { return new double4x3(v); } + + /// Return a double4x3 matrix constructed from a bool4x3 matrix by componentwise conversion. + /// bool4x3 to convert to double4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x3 double4x3(bool4x3 v) { return new double4x3(v); } + + /// Returns a double4x3 matrix constructed from a single int value by converting it to double and assigning it to every component. + /// int to convert to double4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x3 double4x3(int v) { return new double4x3(v); } + + /// Return a double4x3 matrix constructed from a int4x3 matrix by componentwise conversion. + /// int4x3 to convert to double4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x3 double4x3(int4x3 v) { return new double4x3(v); } + + /// Returns a double4x3 matrix constructed from a single uint value by converting it to double and assigning it to every component. + /// uint to convert to double4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x3 double4x3(uint v) { return new double4x3(v); } + + /// Return a double4x3 matrix constructed from a uint4x3 matrix by componentwise conversion. + /// uint4x3 to convert to double4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x3 double4x3(uint4x3 v) { return new double4x3(v); } + + /// Returns a double4x3 matrix constructed from a single float value by converting it to double and assigning it to every component. + /// float to convert to double4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x3 double4x3(float v) { return new double4x3(v); } + + /// Return a double4x3 matrix constructed from a float4x3 matrix by componentwise conversion. + /// float4x3 to convert to double4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x3 double4x3(float4x3 v) { return new double4x3(v); } + + /// Return the double3x4 transpose of a double4x3 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x4 transpose(double4x3 v) + { + return double3x4( + v.c0.x, v.c0.y, v.c0.z, v.c0.w, + v.c1.x, v.c1.y, v.c1.z, v.c1.w, + v.c2.x, v.c2.y, v.c2.z, v.c2.w); + } + + /// Returns a uint hash code of a double4x3 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(double4x3 v) + { + return csum(fold_to_uint(v.c0) * uint4(0x7AA07CD3u, 0xAF642BA9u, 0xA8F2213Bu, 0x9F3FDC37u) + + fold_to_uint(v.c1) * uint4(0xAC60D0C3u, 0x9263662Fu, 0xE69626FFu, 0xBD010EEBu) + + fold_to_uint(v.c2) * uint4(0x9CEDE1D1u, 0x43BE0B51u, 0xAF836EE1u, 0xB130C137u)) + 0x54834775u; + } + + /// + /// Returns a uint4 vector hash code of a double4x3 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint4 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 hashwide(double4x3 v) + { + return (fold_to_uint(v.c0) * uint4(0x7C022221u, 0xA2D00EDFu, 0xA8977779u, 0x9F1C739Bu) + + fold_to_uint(v.c1) * uint4(0x4B1BD187u, 0x9DF50593u, 0xF18EEB85u, 0x9E19BFC3u) + + fold_to_uint(v.c2) * uint4(0x8196B06Fu, 0xD24EFA19u, 0x7D8048BBu, 0x713BD06Fu)) + 0x753AD6ADu; + } + + } +} diff --git a/src/Unity.Mathematics/double4x3.gen.cs.meta b/src/Unity.Mathematics/double4x3.gen.cs.meta new file mode 100644 index 00000000..eab57e57 --- /dev/null +++ b/src/Unity.Mathematics/double4x3.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 673ff09d67f254e00a538d7bbb41618e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/double4x4.gen.cs b/src/Unity.Mathematics/double4x4.gen.cs new file mode 100644 index 00000000..1380a77f --- /dev/null +++ b/src/Unity.Mathematics/double4x4.gen.cs @@ -0,0 +1,824 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 4x4 matrix of doubles. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct double4x4 : System.IEquatable, IFormattable + { + /// Column 0 of the matrix. + public double4 c0; + /// Column 1 of the matrix. + public double4 c1; + /// Column 2 of the matrix. + public double4 c2; + /// Column 3 of the matrix. + public double4 c3; + + /// double4x4 identity transform. + public static readonly double4x4 identity = new double4x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0); + + /// double4x4 zero value. + public static readonly double4x4 zero; + + /// Constructs a double4x4 matrix from four double4 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// The matrix column c3 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4x4(double4 c0, double4 c1, double4 c2, double4 c3) + { + this.c0 = c0; + this.c1 = c1; + this.c2 = c2; + this.c3 = c3; + } + + /// Constructs a double4x4 matrix from 16 double values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 0, column 3 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 1, column 3 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 2, column 2 will be set to this value. + /// The matrix at row 2, column 3 will be set to this value. + /// The matrix at row 3, column 0 will be set to this value. + /// The matrix at row 3, column 1 will be set to this value. + /// The matrix at row 3, column 2 will be set to this value. + /// The matrix at row 3, column 3 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4x4(double m00, double m01, double m02, double m03, + double m10, double m11, double m12, double m13, + double m20, double m21, double m22, double m23, + double m30, double m31, double m32, double m33) + { + this.c0 = new double4(m00, m10, m20, m30); + this.c1 = new double4(m01, m11, m21, m31); + this.c2 = new double4(m02, m12, m22, m32); + this.c3 = new double4(m03, m13, m23, m33); + } + + /// Constructs a double4x4 matrix from a single double value by assigning it to every component. + /// double to convert to double4x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4x4(double v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + this.c3 = v; + } + + /// Constructs a double4x4 matrix from a single bool value by converting it to double and assigning it to every component. + /// bool to convert to double4x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4x4(bool v) + { + this.c0 = math.select(new double4(0.0), new double4(1.0), v); + this.c1 = math.select(new double4(0.0), new double4(1.0), v); + this.c2 = math.select(new double4(0.0), new double4(1.0), v); + this.c3 = math.select(new double4(0.0), new double4(1.0), v); + } + + /// Constructs a double4x4 matrix from a bool4x4 matrix by componentwise conversion. + /// bool4x4 to convert to double4x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4x4(bool4x4 v) + { + this.c0 = math.select(new double4(0.0), new double4(1.0), v.c0); + this.c1 = math.select(new double4(0.0), new double4(1.0), v.c1); + this.c2 = math.select(new double4(0.0), new double4(1.0), v.c2); + this.c3 = math.select(new double4(0.0), new double4(1.0), v.c3); + } + + /// Constructs a double4x4 matrix from a single int value by converting it to double and assigning it to every component. + /// int to convert to double4x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4x4(int v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + this.c3 = v; + } + + /// Constructs a double4x4 matrix from a int4x4 matrix by componentwise conversion. + /// int4x4 to convert to double4x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4x4(int4x4 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + this.c2 = v.c2; + this.c3 = v.c3; + } + + /// Constructs a double4x4 matrix from a single uint value by converting it to double and assigning it to every component. + /// uint to convert to double4x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4x4(uint v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + this.c3 = v; + } + + /// Constructs a double4x4 matrix from a uint4x4 matrix by componentwise conversion. + /// uint4x4 to convert to double4x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4x4(uint4x4 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + this.c2 = v.c2; + this.c3 = v.c3; + } + + /// Constructs a double4x4 matrix from a single float value by converting it to double and assigning it to every component. + /// float to convert to double4x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4x4(float v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + this.c3 = v; + } + + /// Constructs a double4x4 matrix from a float4x4 matrix by componentwise conversion. + /// float4x4 to convert to double4x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4x4(float4x4 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + this.c2 = v.c2; + this.c3 = v.c3; + } + + + /// Implicitly converts a single double value to a double4x4 matrix by assigning it to every component. + /// double to convert to double4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double4x4(double v) { return new double4x4(v); } + + /// Explicitly converts a single bool value to a double4x4 matrix by converting it to double and assigning it to every component. + /// bool to convert to double4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator double4x4(bool v) { return new double4x4(v); } + + /// Explicitly converts a bool4x4 matrix to a double4x4 matrix by componentwise conversion. + /// bool4x4 to convert to double4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator double4x4(bool4x4 v) { return new double4x4(v); } + + /// Implicitly converts a single int value to a double4x4 matrix by converting it to double and assigning it to every component. + /// int to convert to double4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double4x4(int v) { return new double4x4(v); } + + /// Implicitly converts a int4x4 matrix to a double4x4 matrix by componentwise conversion. + /// int4x4 to convert to double4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double4x4(int4x4 v) { return new double4x4(v); } + + /// Implicitly converts a single uint value to a double4x4 matrix by converting it to double and assigning it to every component. + /// uint to convert to double4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double4x4(uint v) { return new double4x4(v); } + + /// Implicitly converts a uint4x4 matrix to a double4x4 matrix by componentwise conversion. + /// uint4x4 to convert to double4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double4x4(uint4x4 v) { return new double4x4(v); } + + /// Implicitly converts a single float value to a double4x4 matrix by converting it to double and assigning it to every component. + /// float to convert to double4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double4x4(float v) { return new double4x4(v); } + + /// Implicitly converts a float4x4 matrix to a double4x4 matrix by componentwise conversion. + /// float4x4 to convert to double4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double4x4(float4x4 v) { return new double4x4(v); } + + + /// Returns the result of a componentwise multiplication operation on two double4x4 matrices. + /// Left hand side double4x4 to use to compute componentwise multiplication. + /// Right hand side double4x4 to use to compute componentwise multiplication. + /// double4x4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x4 operator * (double4x4 lhs, double4x4 rhs) { return new double4x4 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1, lhs.c2 * rhs.c2, lhs.c3 * rhs.c3); } + + /// Returns the result of a componentwise multiplication operation on a double4x4 matrix and a double value. + /// Left hand side double4x4 to use to compute componentwise multiplication. + /// Right hand side double to use to compute componentwise multiplication. + /// double4x4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x4 operator * (double4x4 lhs, double rhs) { return new double4x4 (lhs.c0 * rhs, lhs.c1 * rhs, lhs.c2 * rhs, lhs.c3 * rhs); } + + /// Returns the result of a componentwise multiplication operation on a double value and a double4x4 matrix. + /// Left hand side double to use to compute componentwise multiplication. + /// Right hand side double4x4 to use to compute componentwise multiplication. + /// double4x4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x4 operator * (double lhs, double4x4 rhs) { return new double4x4 (lhs * rhs.c0, lhs * rhs.c1, lhs * rhs.c2, lhs * rhs.c3); } + + + /// Returns the result of a componentwise addition operation on two double4x4 matrices. + /// Left hand side double4x4 to use to compute componentwise addition. + /// Right hand side double4x4 to use to compute componentwise addition. + /// double4x4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x4 operator + (double4x4 lhs, double4x4 rhs) { return new double4x4 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1, lhs.c2 + rhs.c2, lhs.c3 + rhs.c3); } + + /// Returns the result of a componentwise addition operation on a double4x4 matrix and a double value. + /// Left hand side double4x4 to use to compute componentwise addition. + /// Right hand side double to use to compute componentwise addition. + /// double4x4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x4 operator + (double4x4 lhs, double rhs) { return new double4x4 (lhs.c0 + rhs, lhs.c1 + rhs, lhs.c2 + rhs, lhs.c3 + rhs); } + + /// Returns the result of a componentwise addition operation on a double value and a double4x4 matrix. + /// Left hand side double to use to compute componentwise addition. + /// Right hand side double4x4 to use to compute componentwise addition. + /// double4x4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x4 operator + (double lhs, double4x4 rhs) { return new double4x4 (lhs + rhs.c0, lhs + rhs.c1, lhs + rhs.c2, lhs + rhs.c3); } + + + /// Returns the result of a componentwise subtraction operation on two double4x4 matrices. + /// Left hand side double4x4 to use to compute componentwise subtraction. + /// Right hand side double4x4 to use to compute componentwise subtraction. + /// double4x4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x4 operator - (double4x4 lhs, double4x4 rhs) { return new double4x4 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1, lhs.c2 - rhs.c2, lhs.c3 - rhs.c3); } + + /// Returns the result of a componentwise subtraction operation on a double4x4 matrix and a double value. + /// Left hand side double4x4 to use to compute componentwise subtraction. + /// Right hand side double to use to compute componentwise subtraction. + /// double4x4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x4 operator - (double4x4 lhs, double rhs) { return new double4x4 (lhs.c0 - rhs, lhs.c1 - rhs, lhs.c2 - rhs, lhs.c3 - rhs); } + + /// Returns the result of a componentwise subtraction operation on a double value and a double4x4 matrix. + /// Left hand side double to use to compute componentwise subtraction. + /// Right hand side double4x4 to use to compute componentwise subtraction. + /// double4x4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x4 operator - (double lhs, double4x4 rhs) { return new double4x4 (lhs - rhs.c0, lhs - rhs.c1, lhs - rhs.c2, lhs - rhs.c3); } + + + /// Returns the result of a componentwise division operation on two double4x4 matrices. + /// Left hand side double4x4 to use to compute componentwise division. + /// Right hand side double4x4 to use to compute componentwise division. + /// double4x4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x4 operator / (double4x4 lhs, double4x4 rhs) { return new double4x4 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1, lhs.c2 / rhs.c2, lhs.c3 / rhs.c3); } + + /// Returns the result of a componentwise division operation on a double4x4 matrix and a double value. + /// Left hand side double4x4 to use to compute componentwise division. + /// Right hand side double to use to compute componentwise division. + /// double4x4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x4 operator / (double4x4 lhs, double rhs) { return new double4x4 (lhs.c0 / rhs, lhs.c1 / rhs, lhs.c2 / rhs, lhs.c3 / rhs); } + + /// Returns the result of a componentwise division operation on a double value and a double4x4 matrix. + /// Left hand side double to use to compute componentwise division. + /// Right hand side double4x4 to use to compute componentwise division. + /// double4x4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x4 operator / (double lhs, double4x4 rhs) { return new double4x4 (lhs / rhs.c0, lhs / rhs.c1, lhs / rhs.c2, lhs / rhs.c3); } + + + /// Returns the result of a componentwise modulus operation on two double4x4 matrices. + /// Left hand side double4x4 to use to compute componentwise modulus. + /// Right hand side double4x4 to use to compute componentwise modulus. + /// double4x4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x4 operator % (double4x4 lhs, double4x4 rhs) { return new double4x4 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1, lhs.c2 % rhs.c2, lhs.c3 % rhs.c3); } + + /// Returns the result of a componentwise modulus operation on a double4x4 matrix and a double value. + /// Left hand side double4x4 to use to compute componentwise modulus. + /// Right hand side double to use to compute componentwise modulus. + /// double4x4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x4 operator % (double4x4 lhs, double rhs) { return new double4x4 (lhs.c0 % rhs, lhs.c1 % rhs, lhs.c2 % rhs, lhs.c3 % rhs); } + + /// Returns the result of a componentwise modulus operation on a double value and a double4x4 matrix. + /// Left hand side double to use to compute componentwise modulus. + /// Right hand side double4x4 to use to compute componentwise modulus. + /// double4x4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x4 operator % (double lhs, double4x4 rhs) { return new double4x4 (lhs % rhs.c0, lhs % rhs.c1, lhs % rhs.c2, lhs % rhs.c3); } + + + /// Returns the result of a componentwise increment operation on a double4x4 matrix. + /// Value to use when computing the componentwise increment. + /// double4x4 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x4 operator ++ (double4x4 val) { return new double4x4 (++val.c0, ++val.c1, ++val.c2, ++val.c3); } + + + /// Returns the result of a componentwise decrement operation on a double4x4 matrix. + /// Value to use when computing the componentwise decrement. + /// double4x4 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x4 operator -- (double4x4 val) { return new double4x4 (--val.c0, --val.c1, --val.c2, --val.c3); } + + + /// Returns the result of a componentwise less than operation on two double4x4 matrices. + /// Left hand side double4x4 to use to compute componentwise less than. + /// Right hand side double4x4 to use to compute componentwise less than. + /// bool4x4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator < (double4x4 lhs, double4x4 rhs) { return new bool4x4 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1, lhs.c2 < rhs.c2, lhs.c3 < rhs.c3); } + + /// Returns the result of a componentwise less than operation on a double4x4 matrix and a double value. + /// Left hand side double4x4 to use to compute componentwise less than. + /// Right hand side double to use to compute componentwise less than. + /// bool4x4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator < (double4x4 lhs, double rhs) { return new bool4x4 (lhs.c0 < rhs, lhs.c1 < rhs, lhs.c2 < rhs, lhs.c3 < rhs); } + + /// Returns the result of a componentwise less than operation on a double value and a double4x4 matrix. + /// Left hand side double to use to compute componentwise less than. + /// Right hand side double4x4 to use to compute componentwise less than. + /// bool4x4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator < (double lhs, double4x4 rhs) { return new bool4x4 (lhs < rhs.c0, lhs < rhs.c1, lhs < rhs.c2, lhs < rhs.c3); } + + + /// Returns the result of a componentwise less or equal operation on two double4x4 matrices. + /// Left hand side double4x4 to use to compute componentwise less or equal. + /// Right hand side double4x4 to use to compute componentwise less or equal. + /// bool4x4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator <= (double4x4 lhs, double4x4 rhs) { return new bool4x4 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1, lhs.c2 <= rhs.c2, lhs.c3 <= rhs.c3); } + + /// Returns the result of a componentwise less or equal operation on a double4x4 matrix and a double value. + /// Left hand side double4x4 to use to compute componentwise less or equal. + /// Right hand side double to use to compute componentwise less or equal. + /// bool4x4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator <= (double4x4 lhs, double rhs) { return new bool4x4 (lhs.c0 <= rhs, lhs.c1 <= rhs, lhs.c2 <= rhs, lhs.c3 <= rhs); } + + /// Returns the result of a componentwise less or equal operation on a double value and a double4x4 matrix. + /// Left hand side double to use to compute componentwise less or equal. + /// Right hand side double4x4 to use to compute componentwise less or equal. + /// bool4x4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator <= (double lhs, double4x4 rhs) { return new bool4x4 (lhs <= rhs.c0, lhs <= rhs.c1, lhs <= rhs.c2, lhs <= rhs.c3); } + + + /// Returns the result of a componentwise greater than operation on two double4x4 matrices. + /// Left hand side double4x4 to use to compute componentwise greater than. + /// Right hand side double4x4 to use to compute componentwise greater than. + /// bool4x4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator > (double4x4 lhs, double4x4 rhs) { return new bool4x4 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1, lhs.c2 > rhs.c2, lhs.c3 > rhs.c3); } + + /// Returns the result of a componentwise greater than operation on a double4x4 matrix and a double value. + /// Left hand side double4x4 to use to compute componentwise greater than. + /// Right hand side double to use to compute componentwise greater than. + /// bool4x4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator > (double4x4 lhs, double rhs) { return new bool4x4 (lhs.c0 > rhs, lhs.c1 > rhs, lhs.c2 > rhs, lhs.c3 > rhs); } + + /// Returns the result of a componentwise greater than operation on a double value and a double4x4 matrix. + /// Left hand side double to use to compute componentwise greater than. + /// Right hand side double4x4 to use to compute componentwise greater than. + /// bool4x4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator > (double lhs, double4x4 rhs) { return new bool4x4 (lhs > rhs.c0, lhs > rhs.c1, lhs > rhs.c2, lhs > rhs.c3); } + + + /// Returns the result of a componentwise greater or equal operation on two double4x4 matrices. + /// Left hand side double4x4 to use to compute componentwise greater or equal. + /// Right hand side double4x4 to use to compute componentwise greater or equal. + /// bool4x4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator >= (double4x4 lhs, double4x4 rhs) { return new bool4x4 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1, lhs.c2 >= rhs.c2, lhs.c3 >= rhs.c3); } + + /// Returns the result of a componentwise greater or equal operation on a double4x4 matrix and a double value. + /// Left hand side double4x4 to use to compute componentwise greater or equal. + /// Right hand side double to use to compute componentwise greater or equal. + /// bool4x4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator >= (double4x4 lhs, double rhs) { return new bool4x4 (lhs.c0 >= rhs, lhs.c1 >= rhs, lhs.c2 >= rhs, lhs.c3 >= rhs); } + + /// Returns the result of a componentwise greater or equal operation on a double value and a double4x4 matrix. + /// Left hand side double to use to compute componentwise greater or equal. + /// Right hand side double4x4 to use to compute componentwise greater or equal. + /// bool4x4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator >= (double lhs, double4x4 rhs) { return new bool4x4 (lhs >= rhs.c0, lhs >= rhs.c1, lhs >= rhs.c2, lhs >= rhs.c3); } + + + /// Returns the result of a componentwise unary minus operation on a double4x4 matrix. + /// Value to use when computing the componentwise unary minus. + /// double4x4 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x4 operator - (double4x4 val) { return new double4x4 (-val.c0, -val.c1, -val.c2, -val.c3); } + + + /// Returns the result of a componentwise unary plus operation on a double4x4 matrix. + /// Value to use when computing the componentwise unary plus. + /// double4x4 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x4 operator + (double4x4 val) { return new double4x4 (+val.c0, +val.c1, +val.c2, +val.c3); } + + + /// Returns the result of a componentwise equality operation on two double4x4 matrices. + /// Left hand side double4x4 to use to compute componentwise equality. + /// Right hand side double4x4 to use to compute componentwise equality. + /// bool4x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator == (double4x4 lhs, double4x4 rhs) { return new bool4x4 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2, lhs.c3 == rhs.c3); } + + /// Returns the result of a componentwise equality operation on a double4x4 matrix and a double value. + /// Left hand side double4x4 to use to compute componentwise equality. + /// Right hand side double to use to compute componentwise equality. + /// bool4x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator == (double4x4 lhs, double rhs) { return new bool4x4 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs, lhs.c3 == rhs); } + + /// Returns the result of a componentwise equality operation on a double value and a double4x4 matrix. + /// Left hand side double to use to compute componentwise equality. + /// Right hand side double4x4 to use to compute componentwise equality. + /// bool4x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator == (double lhs, double4x4 rhs) { return new bool4x4 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2, lhs == rhs.c3); } + + + /// Returns the result of a componentwise not equal operation on two double4x4 matrices. + /// Left hand side double4x4 to use to compute componentwise not equal. + /// Right hand side double4x4 to use to compute componentwise not equal. + /// bool4x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator != (double4x4 lhs, double4x4 rhs) { return new bool4x4 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2, lhs.c3 != rhs.c3); } + + /// Returns the result of a componentwise not equal operation on a double4x4 matrix and a double value. + /// Left hand side double4x4 to use to compute componentwise not equal. + /// Right hand side double to use to compute componentwise not equal. + /// bool4x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator != (double4x4 lhs, double rhs) { return new bool4x4 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs, lhs.c3 != rhs); } + + /// Returns the result of a componentwise not equal operation on a double value and a double4x4 matrix. + /// Left hand side double to use to compute componentwise not equal. + /// Right hand side double4x4 to use to compute componentwise not equal. + /// bool4x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator != (double lhs, double4x4 rhs) { return new bool4x4 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2, lhs != rhs.c3); } + + + + /// Returns the double4 element at a specified index. + unsafe public ref double4 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 4) + throw new System.ArgumentException("index must be between[0...3]"); +#endif + fixed (double4x4* array = &this) { return ref ((double4*)array)[index]; } + } + } + + /// Returns true if the double4x4 is equal to a given double4x4, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(double4x4 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2) && c3.Equals(rhs.c3); } + + /// Returns true if the double4x4 is equal to a given double4x4, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is double4x4 converted && Equals(converted); } + + + /// Returns a hash code for the double4x4. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the double4x4. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("double4x4({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11}, {12}, {13}, {14}, {15})", c0.x, c1.x, c2.x, c3.x, c0.y, c1.y, c2.y, c3.y, c0.z, c1.z, c2.z, c3.z, c0.w, c1.w, c2.w, c3.w); + } + + /// Returns a string representation of the double4x4 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("double4x4({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11}, {12}, {13}, {14}, {15})", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c2.x.ToString(format, formatProvider), c3.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c2.y.ToString(format, formatProvider), c3.y.ToString(format, formatProvider), c0.z.ToString(format, formatProvider), c1.z.ToString(format, formatProvider), c2.z.ToString(format, formatProvider), c3.z.ToString(format, formatProvider), c0.w.ToString(format, formatProvider), c1.w.ToString(format, formatProvider), c2.w.ToString(format, formatProvider), c3.w.ToString(format, formatProvider)); + } + + } + + public static partial class math + { + /// Returns a double4x4 matrix constructed from four double4 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// The matrix column c3 will be set to this value. + /// double4x4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x4 double4x4(double4 c0, double4 c1, double4 c2, double4 c3) { return new double4x4(c0, c1, c2, c3); } + + /// Returns a double4x4 matrix constructed from from 16 double values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 0, column 3 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 1, column 3 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 2, column 2 will be set to this value. + /// The matrix at row 2, column 3 will be set to this value. + /// The matrix at row 3, column 0 will be set to this value. + /// The matrix at row 3, column 1 will be set to this value. + /// The matrix at row 3, column 2 will be set to this value. + /// The matrix at row 3, column 3 will be set to this value. + /// double4x4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x4 double4x4(double m00, double m01, double m02, double m03, + double m10, double m11, double m12, double m13, + double m20, double m21, double m22, double m23, + double m30, double m31, double m32, double m33) + { + return new double4x4(m00, m01, m02, m03, + m10, m11, m12, m13, + m20, m21, m22, m23, + m30, m31, m32, m33); + } + + /// Returns a double4x4 matrix constructed from a single double value by assigning it to every component. + /// double to convert to double4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x4 double4x4(double v) { return new double4x4(v); } + + /// Returns a double4x4 matrix constructed from a single bool value by converting it to double and assigning it to every component. + /// bool to convert to double4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x4 double4x4(bool v) { return new double4x4(v); } + + /// Return a double4x4 matrix constructed from a bool4x4 matrix by componentwise conversion. + /// bool4x4 to convert to double4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x4 double4x4(bool4x4 v) { return new double4x4(v); } + + /// Returns a double4x4 matrix constructed from a single int value by converting it to double and assigning it to every component. + /// int to convert to double4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x4 double4x4(int v) { return new double4x4(v); } + + /// Return a double4x4 matrix constructed from a int4x4 matrix by componentwise conversion. + /// int4x4 to convert to double4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x4 double4x4(int4x4 v) { return new double4x4(v); } + + /// Returns a double4x4 matrix constructed from a single uint value by converting it to double and assigning it to every component. + /// uint to convert to double4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x4 double4x4(uint v) { return new double4x4(v); } + + /// Return a double4x4 matrix constructed from a uint4x4 matrix by componentwise conversion. + /// uint4x4 to convert to double4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x4 double4x4(uint4x4 v) { return new double4x4(v); } + + /// Returns a double4x4 matrix constructed from a single float value by converting it to double and assigning it to every component. + /// float to convert to double4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x4 double4x4(float v) { return new double4x4(v); } + + /// Return a double4x4 matrix constructed from a float4x4 matrix by componentwise conversion. + /// float4x4 to convert to double4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x4 double4x4(float4x4 v) { return new double4x4(v); } + + /// Return the result of rotating a double3 vector by a double4x4 matrix + /// Left hand side matrix argument that specifies the rotation. + /// Right hand side vector argument to be rotated. + /// The rotated vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 rotate(double4x4 a, double3 b) + { + return (a.c0 * b.x + a.c1 * b.y + a.c2 * b.z).xyz; + } + + /// Return the result of transforming a double3 point by a double4x4 matrix + /// Left hand side matrix argument that specifies the transformation. + /// Right hand side point argument to be transformed. + /// The transformed point. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 transform(double4x4 a, double3 b) + { + return (a.c0 * b.x + a.c1 * b.y + a.c2 * b.z + a.c3).xyz; + } + + /// Return the double4x4 transpose of a double4x4 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x4 transpose(double4x4 v) + { + return double4x4( + v.c0.x, v.c0.y, v.c0.z, v.c0.w, + v.c1.x, v.c1.y, v.c1.z, v.c1.w, + v.c2.x, v.c2.y, v.c2.z, v.c2.w, + v.c3.x, v.c3.y, v.c3.z, v.c3.w); + } + + /// Returns the double4x4 full inverse of a double4x4 matrix. + /// Matrix to invert. + /// The inverted matrix. + public static double4x4 inverse(double4x4 m) + { + double4 c0 = m.c0; + double4 c1 = m.c1; + double4 c2 = m.c2; + double4 c3 = m.c3; + + double4 r0y_r1y_r0x_r1x = movelh(c1, c0); + double4 r0z_r1z_r0w_r1w = movelh(c2, c3); + double4 r2y_r3y_r2x_r3x = movehl(c0, c1); + double4 r2z_r3z_r2w_r3w = movehl(c3, c2); + + double4 r1y_r2y_r1x_r2x = shuffle(c1, c0, ShuffleComponent.LeftY, ShuffleComponent.LeftZ, ShuffleComponent.RightY, ShuffleComponent.RightZ); + double4 r1z_r2z_r1w_r2w = shuffle(c2, c3, ShuffleComponent.LeftY, ShuffleComponent.LeftZ, ShuffleComponent.RightY, ShuffleComponent.RightZ); + double4 r3y_r0y_r3x_r0x = shuffle(c1, c0, ShuffleComponent.LeftW, ShuffleComponent.LeftX, ShuffleComponent.RightW, ShuffleComponent.RightX); + double4 r3z_r0z_r3w_r0w = shuffle(c2, c3, ShuffleComponent.LeftW, ShuffleComponent.LeftX, ShuffleComponent.RightW, ShuffleComponent.RightX); + + double4 r0_wzyx = shuffle(r0z_r1z_r0w_r1w, r0y_r1y_r0x_r1x, ShuffleComponent.LeftZ, ShuffleComponent.LeftX, ShuffleComponent.RightX, ShuffleComponent.RightZ); + double4 r1_wzyx = shuffle(r0z_r1z_r0w_r1w, r0y_r1y_r0x_r1x, ShuffleComponent.LeftW, ShuffleComponent.LeftY, ShuffleComponent.RightY, ShuffleComponent.RightW); + double4 r2_wzyx = shuffle(r2z_r3z_r2w_r3w, r2y_r3y_r2x_r3x, ShuffleComponent.LeftZ, ShuffleComponent.LeftX, ShuffleComponent.RightX, ShuffleComponent.RightZ); + double4 r3_wzyx = shuffle(r2z_r3z_r2w_r3w, r2y_r3y_r2x_r3x, ShuffleComponent.LeftW, ShuffleComponent.LeftY, ShuffleComponent.RightY, ShuffleComponent.RightW); + double4 r0_xyzw = shuffle(r0y_r1y_r0x_r1x, r0z_r1z_r0w_r1w, ShuffleComponent.LeftZ, ShuffleComponent.LeftX, ShuffleComponent.RightX, ShuffleComponent.RightZ); + + // Calculate remaining inner term pairs. inner terms have zw=-xy, so we only have to calculate xy and can pack two pairs per vector. + double4 inner12_23 = r1y_r2y_r1x_r2x * r2z_r3z_r2w_r3w - r1z_r2z_r1w_r2w * r2y_r3y_r2x_r3x; + double4 inner02_13 = r0y_r1y_r0x_r1x * r2z_r3z_r2w_r3w - r0z_r1z_r0w_r1w * r2y_r3y_r2x_r3x; + double4 inner30_01 = r3z_r0z_r3w_r0w * r0y_r1y_r0x_r1x - r3y_r0y_r3x_r0x * r0z_r1z_r0w_r1w; + + // Expand inner terms back to 4 components. zw signs still need to be flipped + double4 inner12 = shuffle(inner12_23, inner12_23, ShuffleComponent.LeftX, ShuffleComponent.LeftZ, ShuffleComponent.RightZ, ShuffleComponent.RightX); + double4 inner23 = shuffle(inner12_23, inner12_23, ShuffleComponent.LeftY, ShuffleComponent.LeftW, ShuffleComponent.RightW, ShuffleComponent.RightY); + + double4 inner02 = shuffle(inner02_13, inner02_13, ShuffleComponent.LeftX, ShuffleComponent.LeftZ, ShuffleComponent.RightZ, ShuffleComponent.RightX); + double4 inner13 = shuffle(inner02_13, inner02_13, ShuffleComponent.LeftY, ShuffleComponent.LeftW, ShuffleComponent.RightW, ShuffleComponent.RightY); + + // Calculate minors + double4 minors0 = r3_wzyx * inner12 - r2_wzyx * inner13 + r1_wzyx * inner23; + + double4 denom = r0_xyzw * minors0; + + // Horizontal sum of denominator. Free sign flip of z and w compensates for missing flip in inner terms. + denom = denom + shuffle(denom, denom, ShuffleComponent.LeftY, ShuffleComponent.LeftX, ShuffleComponent.RightW, ShuffleComponent.RightZ); // x+y x+y z+w z+w + denom = denom - shuffle(denom, denom, ShuffleComponent.LeftZ, ShuffleComponent.LeftZ, ShuffleComponent.RightX, ShuffleComponent.RightX); // x+y-z-w x+y-z-w z+w-x-y z+w-x-y + + double4 rcp_denom_ppnn = double4(1.0) / denom; + double4x4 res; + res.c0 = minors0 * rcp_denom_ppnn; + + double4 inner30 = shuffle(inner30_01, inner30_01, ShuffleComponent.LeftX, ShuffleComponent.LeftZ, ShuffleComponent.RightZ, ShuffleComponent.RightX); + double4 inner01 = shuffle(inner30_01, inner30_01, ShuffleComponent.LeftY, ShuffleComponent.LeftW, ShuffleComponent.RightW, ShuffleComponent.RightY); + + double4 minors1 = r2_wzyx * inner30 - r0_wzyx * inner23 - r3_wzyx * inner02; + res.c1 = minors1 * rcp_denom_ppnn; + + double4 minors2 = r0_wzyx * inner13 - r1_wzyx * inner30 - r3_wzyx * inner01; + res.c2 = minors2 * rcp_denom_ppnn; + + double4 minors3 = r1_wzyx * inner02 - r0_wzyx * inner12 + r2_wzyx * inner01; + res.c3 = minors3 * rcp_denom_ppnn; + return res; + } + + /// Fast matrix inverse for rigid transforms (orthonormal basis and translation) + /// Matrix to invert. + /// The inverted matrix. + public static double4x4 fastinverse(double4x4 m) + { + double4 c0 = m.c0; + double4 c1 = m.c1; + double4 c2 = m.c2; + double4 pos = m.c3; + + double4 zero = double4(0); + + double4 t0 = unpacklo(c0, c2); + double4 t1 = unpacklo(c1, zero); + double4 t2 = unpackhi(c0, c2); + double4 t3 = unpackhi(c1, zero); + + double4 r0 = unpacklo(t0, t1); + double4 r1 = unpackhi(t0, t1); + double4 r2 = unpacklo(t2, t3); + + pos = -(r0 * pos.x + r1 * pos.y + r2 * pos.z); + pos.w = 1.0f; + + return double4x4(r0, r1, r2, pos); + } + + /// Returns the determinant of a double4x4 matrix. + /// Matrix to use when computing determinant. + /// The determinant of the matrix. + public static double determinant(double4x4 m) + { + double4 c0 = m.c0; + double4 c1 = m.c1; + double4 c2 = m.c2; + double4 c3 = m.c3; + + double m00 = c1.y * (c2.z * c3.w - c2.w * c3.z) - c2.y * (c1.z * c3.w - c1.w * c3.z) + c3.y * (c1.z * c2.w - c1.w * c2.z); + double m01 = c0.y * (c2.z * c3.w - c2.w * c3.z) - c2.y * (c0.z * c3.w - c0.w * c3.z) + c3.y * (c0.z * c2.w - c0.w * c2.z); + double m02 = c0.y * (c1.z * c3.w - c1.w * c3.z) - c1.y * (c0.z * c3.w - c0.w * c3.z) + c3.y * (c0.z * c1.w - c0.w * c1.z); + double m03 = c0.y * (c1.z * c2.w - c1.w * c2.z) - c1.y * (c0.z * c2.w - c0.w * c2.z) + c2.y * (c0.z * c1.w - c0.w * c1.z); + + return c0.x * m00 - c1.x * m01 + c2.x * m02 - c3.x * m03; + } + + /// Returns a uint hash code of a double4x4 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(double4x4 v) + { + return csum(fold_to_uint(v.c0) * uint4(0x4DDC6509u, 0x7CF083CBu, 0x5C4D6CEDu, 0xF9137117u) + + fold_to_uint(v.c1) * uint4(0xE857DCE1u, 0xF62213C5u, 0x9CDAA959u, 0xAA269ABFu) + + fold_to_uint(v.c2) * uint4(0xD54BA36Fu, 0xFD0847B9u, 0x8189A683u, 0xB139D651u) + + fold_to_uint(v.c3) * uint4(0xE7579997u, 0xEF7D56C7u, 0x66F38F0Bu, 0x624256A3u)) + 0x5292ADE1u; + } + + /// + /// Returns a uint4 vector hash code of a double4x4 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint4 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 hashwide(double4x4 v) + { + return (fold_to_uint(v.c0) * uint4(0xD2E590E5u, 0xF25BE857u, 0x9BC17CE7u, 0xC8B86851u) + + fold_to_uint(v.c1) * uint4(0x64095221u, 0xADF428FFu, 0xA3977109u, 0x745ED837u) + + fold_to_uint(v.c2) * uint4(0x9CDC88F5u, 0xFA62D721u, 0x7E4DB1CFu, 0x68EEE0F5u) + + fold_to_uint(v.c3) * uint4(0xBC3B0A59u, 0x816EFB5Du, 0xA24E82B7u, 0x45A22087u)) + 0xFC104C3Bu; + } + + } +} diff --git a/src/Unity.Mathematics/double4x4.gen.cs.meta b/src/Unity.Mathematics/double4x4.gen.cs.meta new file mode 100644 index 00000000..025b7a1a --- /dev/null +++ b/src/Unity.Mathematics/double4x4.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e000b5ccaea0345d8b4686220f3307ed +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/float2.cs b/src/Unity.Mathematics/float2.cs deleted file mode 100644 index aef9193e..00000000 --- a/src/Unity.Mathematics/float2.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using System.Diagnostics; - -#pragma warning disable 0660, 0661 - -namespace Unity.Mathematics -{ - [DebuggerTypeProxy(typeof(float2.DebuggerProxy))] - [System.Serializable] - public partial struct float2 : IFormattable - { - internal sealed class DebuggerProxy - { - public float x; - public float y; - - public DebuggerProxy(float2 vec) - { - x = vec.x; - y = vec.y; - } - } - - public float x; - public float y; - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public float2(float x, float y) - { - this.x = x; - this.y = y; - } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public float2(float val) { x = y = val; } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public float2(int val) { x = y = val; } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public float2(int2 val) - { - x = val.x; - y = val.y; - } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static implicit operator float2(float d) { return new float2(d); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static implicit operator float2(int2 d) { return new float2(d.x, d.y); } - - public override string ToString() - { - return string.Format("float2({0:R}f, {1:R}f)", x, y); - } - - public string ToString(string format, IFormatProvider formatProvider) - { - return string.Format("float2({0}f, {1}f)", x.ToString(format, formatProvider), y.ToString(format, formatProvider)); - } - } -} - diff --git a/src/Unity.Mathematics/float2.cs.meta b/src/Unity.Mathematics/float2.cs.meta deleted file mode 100644 index cec94d54..00000000 --- a/src/Unity.Mathematics/float2.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 66fadf7820f02e24f8a1f8f61c205327 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/src/Unity.Mathematics/float2.gen.cs b/src/Unity.Mathematics/float2.gen.cs index 74b94584..f9359491 100644 --- a/src/Unity.Mathematics/float2.gen.cs +++ b/src/Unity.Mathematics/float2.gen.cs @@ -1,344 +1,998 @@ -// GENERATED CODE +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; using System.Runtime.CompilerServices; +using System.Diagnostics; +using Unity.IL2CPP.CompilerServices; + #pragma warning disable 0660, 0661 + namespace Unity.Mathematics { - public partial struct float2 : System.IEquatable + /// A 2 component vector of floats. + [DebuggerTypeProxy(typeof(float2.DebuggerProxy))] + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct float2 : System.IEquatable, IFormattable { + /// x component of the vector. + public float x; + /// y component of the vector. + public float y; + + /// float2 zero value. + public static readonly float2 zero; + + /// Constructs a float2 vector from two float values. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2(float x, float y) + { + this.x = x; + this.y = y; + } + + /// Constructs a float2 vector from a float2 vector. + /// The constructed vector's xy components will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2(float2 xy) + { + this.x = xy.x; + this.y = xy.y; + } + + /// Constructs a float2 vector from a single float value by assigning it to every component. + /// float to convert to float2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2(float v) + { + this.x = v; + this.y = v; + } + + /// Constructs a float2 vector from a single bool value by converting it to float and assigning it to every component. + /// bool to convert to float2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2(bool v) + { + this.x = v ? 1.0f : 0.0f; + this.y = v ? 1.0f : 0.0f; + } + + /// Constructs a float2 vector from a bool2 vector by componentwise conversion. + /// bool2 to convert to float2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2(bool2 v) + { + this.x = v.x ? 1.0f : 0.0f; + this.y = v.y ? 1.0f : 0.0f; + } + + /// Constructs a float2 vector from a single int value by converting it to float and assigning it to every component. + /// int to convert to float2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2(int v) + { + this.x = v; + this.y = v; + } + + /// Constructs a float2 vector from a int2 vector by componentwise conversion. + /// int2 to convert to float2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2(int2 v) + { + this.x = v.x; + this.y = v.y; + } + + /// Constructs a float2 vector from a single uint value by converting it to float and assigning it to every component. + /// uint to convert to float2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2(uint v) + { + this.x = v; + this.y = v; + } - // mul - [MethodImpl(0x100)] + /// Constructs a float2 vector from a uint2 vector by componentwise conversion. + /// uint2 to convert to float2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2(uint2 v) + { + this.x = v.x; + this.y = v.y; + } + + /// Constructs a float2 vector from a single half value by converting it to float and assigning it to every component. + /// half to convert to float2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2(half v) + { + this.x = v; + this.y = v; + } + + /// Constructs a float2 vector from a half2 vector by componentwise conversion. + /// half2 to convert to float2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2(half2 v) + { + this.x = v.x; + this.y = v.y; + } + + /// Constructs a float2 vector from a single double value by converting it to float and assigning it to every component. + /// double to convert to float2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2(double v) + { + this.x = (float)v; + this.y = (float)v; + } + + /// Constructs a float2 vector from a double2 vector by componentwise conversion. + /// double2 to convert to float2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2(double2 v) + { + this.x = (float)v.x; + this.y = (float)v.y; + } + + + /// Implicitly converts a single float value to a float2 vector by assigning it to every component. + /// float to convert to float2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float2(float v) { return new float2(v); } + + /// Explicitly converts a single bool value to a float2 vector by converting it to float and assigning it to every component. + /// bool to convert to float2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float2(bool v) { return new float2(v); } + + /// Explicitly converts a bool2 vector to a float2 vector by componentwise conversion. + /// bool2 to convert to float2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float2(bool2 v) { return new float2(v); } + + /// Implicitly converts a single int value to a float2 vector by converting it to float and assigning it to every component. + /// int to convert to float2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float2(int v) { return new float2(v); } + + /// Implicitly converts a int2 vector to a float2 vector by componentwise conversion. + /// int2 to convert to float2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float2(int2 v) { return new float2(v); } + + /// Implicitly converts a single uint value to a float2 vector by converting it to float and assigning it to every component. + /// uint to convert to float2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float2(uint v) { return new float2(v); } + + /// Implicitly converts a uint2 vector to a float2 vector by componentwise conversion. + /// uint2 to convert to float2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float2(uint2 v) { return new float2(v); } + + /// Implicitly converts a single half value to a float2 vector by converting it to float and assigning it to every component. + /// half to convert to float2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float2(half v) { return new float2(v); } + + /// Implicitly converts a half2 vector to a float2 vector by componentwise conversion. + /// half2 to convert to float2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float2(half2 v) { return new float2(v); } + + /// Explicitly converts a single double value to a float2 vector by converting it to float and assigning it to every component. + /// double to convert to float2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float2(double v) { return new float2(v); } + + /// Explicitly converts a double2 vector to a float2 vector by componentwise conversion. + /// double2 to convert to float2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float2(double2 v) { return new float2(v); } + + + /// Returns the result of a componentwise multiplication operation on two float2 vectors. + /// Left hand side float2 to use to compute componentwise multiplication. + /// Right hand side float2 to use to compute componentwise multiplication. + /// float2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float2 operator * (float2 lhs, float2 rhs) { return new float2 (lhs.x * rhs.x, lhs.y * rhs.y); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise multiplication operation on a float2 vector and a float value. + /// Left hand side float2 to use to compute componentwise multiplication. + /// Right hand side float to use to compute componentwise multiplication. + /// float2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float2 operator * (float2 lhs, float rhs) { return new float2 (lhs.x * rhs, lhs.y * rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise multiplication operation on a float value and a float2 vector. + /// Left hand side float to use to compute componentwise multiplication. + /// Right hand side float2 to use to compute componentwise multiplication. + /// float2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float2 operator * (float lhs, float2 rhs) { return new float2 (lhs * rhs.x, lhs * rhs.y); } - // add - [MethodImpl(0x100)] + + /// Returns the result of a componentwise addition operation on two float2 vectors. + /// Left hand side float2 to use to compute componentwise addition. + /// Right hand side float2 to use to compute componentwise addition. + /// float2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float2 operator + (float2 lhs, float2 rhs) { return new float2 (lhs.x + rhs.x, lhs.y + rhs.y); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise addition operation on a float2 vector and a float value. + /// Left hand side float2 to use to compute componentwise addition. + /// Right hand side float to use to compute componentwise addition. + /// float2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float2 operator + (float2 lhs, float rhs) { return new float2 (lhs.x + rhs, lhs.y + rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise addition operation on a float value and a float2 vector. + /// Left hand side float to use to compute componentwise addition. + /// Right hand side float2 to use to compute componentwise addition. + /// float2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float2 operator + (float lhs, float2 rhs) { return new float2 (lhs + rhs.x, lhs + rhs.y); } - // sub - [MethodImpl(0x100)] + + /// Returns the result of a componentwise subtraction operation on two float2 vectors. + /// Left hand side float2 to use to compute componentwise subtraction. + /// Right hand side float2 to use to compute componentwise subtraction. + /// float2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float2 operator - (float2 lhs, float2 rhs) { return new float2 (lhs.x - rhs.x, lhs.y - rhs.y); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise subtraction operation on a float2 vector and a float value. + /// Left hand side float2 to use to compute componentwise subtraction. + /// Right hand side float to use to compute componentwise subtraction. + /// float2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float2 operator - (float2 lhs, float rhs) { return new float2 (lhs.x - rhs, lhs.y - rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise subtraction operation on a float value and a float2 vector. + /// Left hand side float to use to compute componentwise subtraction. + /// Right hand side float2 to use to compute componentwise subtraction. + /// float2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float2 operator - (float lhs, float2 rhs) { return new float2 (lhs - rhs.x, lhs - rhs.y); } - // div - [MethodImpl(0x100)] + + /// Returns the result of a componentwise division operation on two float2 vectors. + /// Left hand side float2 to use to compute componentwise division. + /// Right hand side float2 to use to compute componentwise division. + /// float2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float2 operator / (float2 lhs, float2 rhs) { return new float2 (lhs.x / rhs.x, lhs.y / rhs.y); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise division operation on a float2 vector and a float value. + /// Left hand side float2 to use to compute componentwise division. + /// Right hand side float to use to compute componentwise division. + /// float2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float2 operator / (float2 lhs, float rhs) { return new float2 (lhs.x / rhs, lhs.y / rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise division operation on a float value and a float2 vector. + /// Left hand side float to use to compute componentwise division. + /// Right hand side float2 to use to compute componentwise division. + /// float2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float2 operator / (float lhs, float2 rhs) { return new float2 (lhs / rhs.x, lhs / rhs.y); } - // smaller - [MethodImpl(0x100)] + + /// Returns the result of a componentwise modulus operation on two float2 vectors. + /// Left hand side float2 to use to compute componentwise modulus. + /// Right hand side float2 to use to compute componentwise modulus. + /// float2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 operator % (float2 lhs, float2 rhs) { return new float2 (lhs.x % rhs.x, lhs.y % rhs.y); } + + /// Returns the result of a componentwise modulus operation on a float2 vector and a float value. + /// Left hand side float2 to use to compute componentwise modulus. + /// Right hand side float to use to compute componentwise modulus. + /// float2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 operator % (float2 lhs, float rhs) { return new float2 (lhs.x % rhs, lhs.y % rhs); } + + /// Returns the result of a componentwise modulus operation on a float value and a float2 vector. + /// Left hand side float to use to compute componentwise modulus. + /// Right hand side float2 to use to compute componentwise modulus. + /// float2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 operator % (float lhs, float2 rhs) { return new float2 (lhs % rhs.x, lhs % rhs.y); } + + + /// Returns the result of a componentwise increment operation on a float2 vector. + /// Value to use when computing the componentwise increment. + /// float2 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 operator ++ (float2 val) { return new float2 (++val.x, ++val.y); } + + + /// Returns the result of a componentwise decrement operation on a float2 vector. + /// Value to use when computing the componentwise decrement. + /// float2 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 operator -- (float2 val) { return new float2 (--val.x, --val.y); } + + + /// Returns the result of a componentwise less than operation on two float2 vectors. + /// Left hand side float2 to use to compute componentwise less than. + /// Right hand side float2 to use to compute componentwise less than. + /// bool2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator < (float2 lhs, float2 rhs) { return new bool2 (lhs.x < rhs.x, lhs.y < rhs.y); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise less than operation on a float2 vector and a float value. + /// Left hand side float2 to use to compute componentwise less than. + /// Right hand side float to use to compute componentwise less than. + /// bool2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator < (float2 lhs, float rhs) { return new bool2 (lhs.x < rhs, lhs.y < rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise less than operation on a float value and a float2 vector. + /// Left hand side float to use to compute componentwise less than. + /// Right hand side float2 to use to compute componentwise less than. + /// bool2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator < (float lhs, float2 rhs) { return new bool2 (lhs < rhs.x, lhs < rhs.y); } - [MethodImpl(0x100)] + + + /// Returns the result of a componentwise less or equal operation on two float2 vectors. + /// Left hand side float2 to use to compute componentwise less or equal. + /// Right hand side float2 to use to compute componentwise less or equal. + /// bool2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator <= (float2 lhs, float2 rhs) { return new bool2 (lhs.x <= rhs.x, lhs.y <= rhs.y); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise less or equal operation on a float2 vector and a float value. + /// Left hand side float2 to use to compute componentwise less or equal. + /// Right hand side float to use to compute componentwise less or equal. + /// bool2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator <= (float2 lhs, float rhs) { return new bool2 (lhs.x <= rhs, lhs.y <= rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise less or equal operation on a float value and a float2 vector. + /// Left hand side float to use to compute componentwise less or equal. + /// Right hand side float2 to use to compute componentwise less or equal. + /// bool2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator <= (float lhs, float2 rhs) { return new bool2 (lhs <= rhs.x, lhs <= rhs.y); } - // greater - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater than operation on two float2 vectors. + /// Left hand side float2 to use to compute componentwise greater than. + /// Right hand side float2 to use to compute componentwise greater than. + /// bool2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator > (float2 lhs, float2 rhs) { return new bool2 (lhs.x > rhs.x, lhs.y > rhs.y); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater than operation on a float2 vector and a float value. + /// Left hand side float2 to use to compute componentwise greater than. + /// Right hand side float to use to compute componentwise greater than. + /// bool2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator > (float2 lhs, float rhs) { return new bool2 (lhs.x > rhs, lhs.y > rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater than operation on a float value and a float2 vector. + /// Left hand side float to use to compute componentwise greater than. + /// Right hand side float2 to use to compute componentwise greater than. + /// bool2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator > (float lhs, float2 rhs) { return new bool2 (lhs > rhs.x, lhs > rhs.y); } - [MethodImpl(0x100)] + + + /// Returns the result of a componentwise greater or equal operation on two float2 vectors. + /// Left hand side float2 to use to compute componentwise greater or equal. + /// Right hand side float2 to use to compute componentwise greater or equal. + /// bool2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator >= (float2 lhs, float2 rhs) { return new bool2 (lhs.x >= rhs.x, lhs.y >= rhs.y); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater or equal operation on a float2 vector and a float value. + /// Left hand side float2 to use to compute componentwise greater or equal. + /// Right hand side float to use to compute componentwise greater or equal. + /// bool2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator >= (float2 lhs, float rhs) { return new bool2 (lhs.x >= rhs, lhs.y >= rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater or equal operation on a float value and a float2 vector. + /// Left hand side float to use to compute componentwise greater or equal. + /// Right hand side float2 to use to compute componentwise greater or equal. + /// bool2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator >= (float lhs, float2 rhs) { return new bool2 (lhs >= rhs.x, lhs >= rhs.y); } - // neg - [MethodImpl(0x100)] + + /// Returns the result of a componentwise unary minus operation on a float2 vector. + /// Value to use when computing the componentwise unary minus. + /// float2 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float2 operator - (float2 val) { return new float2 (-val.x, -val.y); } - // plus - [MethodImpl(0x100)] + + + /// Returns the result of a componentwise unary plus operation on a float2 vector. + /// Value to use when computing the componentwise unary plus. + /// float2 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float2 operator + (float2 val) { return new float2 (+val.x, +val.y); } - // equal - [MethodImpl(0x100)] + + + /// Returns the result of a componentwise equality operation on two float2 vectors. + /// Left hand side float2 to use to compute componentwise equality. + /// Right hand side float2 to use to compute componentwise equality. + /// bool2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator == (float2 lhs, float2 rhs) { return new bool2 (lhs.x == rhs.x, lhs.y == rhs.y); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise equality operation on a float2 vector and a float value. + /// Left hand side float2 to use to compute componentwise equality. + /// Right hand side float to use to compute componentwise equality. + /// bool2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator == (float2 lhs, float rhs) { return new bool2 (lhs.x == rhs, lhs.y == rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise equality operation on a float value and a float2 vector. + /// Left hand side float to use to compute componentwise equality. + /// Right hand side float2 to use to compute componentwise equality. + /// bool2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator == (float lhs, float2 rhs) { return new bool2 (lhs == rhs.x, lhs == rhs.y); } - // not equal - [MethodImpl(0x100)] + + /// Returns the result of a componentwise not equal operation on two float2 vectors. + /// Left hand side float2 to use to compute componentwise not equal. + /// Right hand side float2 to use to compute componentwise not equal. + /// bool2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator != (float2 lhs, float2 rhs) { return new bool2 (lhs.x != rhs.x, lhs.y != rhs.y); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise not equal operation on a float2 vector and a float value. + /// Left hand side float2 to use to compute componentwise not equal. + /// Right hand side float to use to compute componentwise not equal. + /// bool2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator != (float2 lhs, float rhs) { return new bool2 (lhs.x != rhs, lhs.y != rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise not equal operation on a float value and a float2 vector. + /// Left hand side float to use to compute componentwise not equal. + /// Right hand side float2 to use to compute componentwise not equal. + /// bool2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator != (float lhs, float2 rhs) { return new bool2 (lhs != rhs.x, lhs != rhs.y); } - // Equals - [MethodImpl(0x100)] - public bool Equals(float2 rhs) { return x == rhs.x && y == rhs.y; } - // [int index] - unsafe public float this[int index] - { - get - { -#if ENABLE_UNITY_COLLECTIONS_CHECKS - if ((uint)index >= 2) - throw new System.ArgumentException("index must be between[0...1]"); -#endif - fixed (float2* array = &this) { return ((float*)array)[index]; } - } - set - { -#if ENABLE_UNITY_COLLECTIONS_CHECKS - if ((uint)index >= 2) - throw new System.ArgumentException("index must be between[0...1]"); -#endif - fixed (float2* array = &this) { ((float*)array)[index] = value; } - } - } + + + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xxxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xxxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xxyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xxyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xyxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xyxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xyyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xyyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yxxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yxxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yxyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yxyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yyxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yyxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yyyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yyyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 xxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 xxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 xyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 xyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 yxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 yxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 yyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 yyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float2 xx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float2(x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float2 xy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float2(x, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; y = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float2 yx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float2(y, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; x = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float2 yy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float2(y, y); } } + + /// Returns the float element at a specified index. + unsafe public float this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 2) + throw new System.ArgumentException("index must be between[0...1]"); +#endif + fixed (float2* array = &this) { return ((float*)array)[index]; } + } + set + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 2) + throw new System.ArgumentException("index must be between[0...1]"); +#endif + fixed (float* array = &x) { array[index] = value; } + } + } + + /// Returns true if the float2 is equal to a given float2, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(float2 rhs) { return x == rhs.x && y == rhs.y; } + + /// Returns true if the float2 is equal to a given float2, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is float2 converted && Equals(converted); } + + + /// Returns a hash code for the float2. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the float2. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("float2({0}f, {1}f)", x, y); + } + + /// Returns a string representation of the float2 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("float2({0}f, {1}f)", x.ToString(format, formatProvider), y.ToString(format, formatProvider)); + } + + internal sealed class DebuggerProxy + { + public float x; + public float y; + public DebuggerProxy(float2 v) + { + x = v.x; + y = v.y; + } + } + + } + + public static partial class math + { + /// Returns a float2 vector constructed from two float values. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + /// float2 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 float2(float x, float y) { return new float2(x, y); } + + /// Returns a float2 vector constructed from a float2 vector. + /// The constructed vector's xy components will be set to this value. + /// float2 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 float2(float2 xy) { return new float2(xy); } + + /// Returns a float2 vector constructed from a single float value by assigning it to every component. + /// float to convert to float2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 float2(float v) { return new float2(v); } + + /// Returns a float2 vector constructed from a single bool value by converting it to float and assigning it to every component. + /// bool to convert to float2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 float2(bool v) { return new float2(v); } + + /// Return a float2 vector constructed from a bool2 vector by componentwise conversion. + /// bool2 to convert to float2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 float2(bool2 v) { return new float2(v); } + + /// Returns a float2 vector constructed from a single int value by converting it to float and assigning it to every component. + /// int to convert to float2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 float2(int v) { return new float2(v); } + + /// Return a float2 vector constructed from a int2 vector by componentwise conversion. + /// int2 to convert to float2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 float2(int2 v) { return new float2(v); } + + /// Returns a float2 vector constructed from a single uint value by converting it to float and assigning it to every component. + /// uint to convert to float2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 float2(uint v) { return new float2(v); } + + /// Return a float2 vector constructed from a uint2 vector by componentwise conversion. + /// uint2 to convert to float2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 float2(uint2 v) { return new float2(v); } + + /// Returns a float2 vector constructed from a single half value by converting it to float and assigning it to every component. + /// half to convert to float2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 float2(half v) { return new float2(v); } + + /// Return a float2 vector constructed from a half2 vector by componentwise conversion. + /// half2 to convert to float2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 float2(half2 v) { return new float2(v); } + + /// Returns a float2 vector constructed from a single double value by converting it to float and assigning it to every component. + /// double to convert to float2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 float2(double v) { return new float2(v); } + + /// Return a float2 vector constructed from a double2 vector by componentwise conversion. + /// double2 to convert to float2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 float2(double2 v) { return new float2(v); } + + /// Returns a uint hash code of a float2 vector. + /// Vector value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(float2 v) + { + return csum(asuint(v) * uint2(0xFA3A3285u, 0xAD55999Du)) + 0xDCDD5341u; + } + + /// + /// Returns a uint2 vector hash code of a float2 vector. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Vector value to hash. + /// uint2 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 hashwide(float2 v) + { + return (asuint(v) * uint2(0x94DDD769u, 0xA1E92D39u)) + 0x4583C801u; + } + + /// Returns the result of specified shuffling of the components from two float2 vectors into a float value. + /// float2 to use as the left argument of the shuffle operation. + /// float2 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting float. + /// float result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float shuffle(float2 left, float2 right, ShuffleComponent x) + { + return select_shuffle_component(left, right, x); + } + + /// Returns the result of specified shuffling of the components from two float2 vectors into a float2 vector. + /// float2 to use as the left argument of the shuffle operation. + /// float2 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting float2 x component. + /// The ShuffleComponent to use when setting the resulting float2 y component. + /// float2 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 shuffle(float2 left, float2 right, ShuffleComponent x, ShuffleComponent y) + { + return float2( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y)); + } + + /// Returns the result of specified shuffling of the components from two float2 vectors into a float3 vector. + /// float2 to use as the left argument of the shuffle operation. + /// float2 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting float3 x component. + /// The ShuffleComponent to use when setting the resulting float3 y component. + /// The ShuffleComponent to use when setting the resulting float3 z component. + /// float3 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 shuffle(float2 left, float2 right, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z) + { + return float3( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y), + select_shuffle_component(left, right, z)); + } + + /// Returns the result of specified shuffling of the components from two float2 vectors into a float4 vector. + /// float2 to use as the left argument of the shuffle operation. + /// float2 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting float4 x component. + /// The ShuffleComponent to use when setting the resulting float4 y component. + /// The ShuffleComponent to use when setting the resulting float4 z component. + /// The ShuffleComponent to use when setting the resulting float4 w component. + /// float4 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 shuffle(float2 left, float2 right, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z, ShuffleComponent w) + { + return float4( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y), + select_shuffle_component(left, right, z), + select_shuffle_component(left, right, w)); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static float select_shuffle_component(float2 a, float2 b, ShuffleComponent component) + { + switch(component) + { + case ShuffleComponent.LeftX: + return a.x; + case ShuffleComponent.LeftY: + return a.y; + case ShuffleComponent.RightX: + return b.x; + case ShuffleComponent.RightY: + return b.y; + default: + throw new System.ArgumentException("Invalid shuffle component: " + component); + } + } + } } diff --git a/src/Unity.Mathematics/float2x2.gen.cs b/src/Unity.Mathematics/float2x2.gen.cs new file mode 100644 index 00000000..b4d88079 --- /dev/null +++ b/src/Unity.Mathematics/float2x2.gen.cs @@ -0,0 +1,658 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 2x2 matrix of floats. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct float2x2 : System.IEquatable, IFormattable + { + /// Column 0 of the matrix. + public float2 c0; + /// Column 1 of the matrix. + public float2 c1; + + /// float2x2 identity transform. + public static readonly float2x2 identity = new float2x2(1.0f, 0.0f, 0.0f, 1.0f); + + /// float2x2 zero value. + public static readonly float2x2 zero; + + /// Constructs a float2x2 matrix from two float2 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2x2(float2 c0, float2 c1) + { + this.c0 = c0; + this.c1 = c1; + } + + /// Constructs a float2x2 matrix from 4 float values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2x2(float m00, float m01, + float m10, float m11) + { + this.c0 = new float2(m00, m10); + this.c1 = new float2(m01, m11); + } + + /// Constructs a float2x2 matrix from a single float value by assigning it to every component. + /// float to convert to float2x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2x2(float v) + { + this.c0 = v; + this.c1 = v; + } + + /// Constructs a float2x2 matrix from a single bool value by converting it to float and assigning it to every component. + /// bool to convert to float2x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2x2(bool v) + { + this.c0 = math.select(new float2(0.0f), new float2(1.0f), v); + this.c1 = math.select(new float2(0.0f), new float2(1.0f), v); + } + + /// Constructs a float2x2 matrix from a bool2x2 matrix by componentwise conversion. + /// bool2x2 to convert to float2x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2x2(bool2x2 v) + { + this.c0 = math.select(new float2(0.0f), new float2(1.0f), v.c0); + this.c1 = math.select(new float2(0.0f), new float2(1.0f), v.c1); + } + + /// Constructs a float2x2 matrix from a single int value by converting it to float and assigning it to every component. + /// int to convert to float2x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2x2(int v) + { + this.c0 = v; + this.c1 = v; + } + + /// Constructs a float2x2 matrix from a int2x2 matrix by componentwise conversion. + /// int2x2 to convert to float2x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2x2(int2x2 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + } + + /// Constructs a float2x2 matrix from a single uint value by converting it to float and assigning it to every component. + /// uint to convert to float2x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2x2(uint v) + { + this.c0 = v; + this.c1 = v; + } + + /// Constructs a float2x2 matrix from a uint2x2 matrix by componentwise conversion. + /// uint2x2 to convert to float2x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2x2(uint2x2 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + } + + /// Constructs a float2x2 matrix from a single double value by converting it to float and assigning it to every component. + /// double to convert to float2x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2x2(double v) + { + this.c0 = (float2)v; + this.c1 = (float2)v; + } + + /// Constructs a float2x2 matrix from a double2x2 matrix by componentwise conversion. + /// double2x2 to convert to float2x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2x2(double2x2 v) + { + this.c0 = (float2)v.c0; + this.c1 = (float2)v.c1; + } + + + /// Implicitly converts a single float value to a float2x2 matrix by assigning it to every component. + /// float to convert to float2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float2x2(float v) { return new float2x2(v); } + + /// Explicitly converts a single bool value to a float2x2 matrix by converting it to float and assigning it to every component. + /// bool to convert to float2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float2x2(bool v) { return new float2x2(v); } + + /// Explicitly converts a bool2x2 matrix to a float2x2 matrix by componentwise conversion. + /// bool2x2 to convert to float2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float2x2(bool2x2 v) { return new float2x2(v); } + + /// Implicitly converts a single int value to a float2x2 matrix by converting it to float and assigning it to every component. + /// int to convert to float2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float2x2(int v) { return new float2x2(v); } + + /// Implicitly converts a int2x2 matrix to a float2x2 matrix by componentwise conversion. + /// int2x2 to convert to float2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float2x2(int2x2 v) { return new float2x2(v); } + + /// Implicitly converts a single uint value to a float2x2 matrix by converting it to float and assigning it to every component. + /// uint to convert to float2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float2x2(uint v) { return new float2x2(v); } + + /// Implicitly converts a uint2x2 matrix to a float2x2 matrix by componentwise conversion. + /// uint2x2 to convert to float2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float2x2(uint2x2 v) { return new float2x2(v); } + + /// Explicitly converts a single double value to a float2x2 matrix by converting it to float and assigning it to every component. + /// double to convert to float2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float2x2(double v) { return new float2x2(v); } + + /// Explicitly converts a double2x2 matrix to a float2x2 matrix by componentwise conversion. + /// double2x2 to convert to float2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float2x2(double2x2 v) { return new float2x2(v); } + + + /// Returns the result of a componentwise multiplication operation on two float2x2 matrices. + /// Left hand side float2x2 to use to compute componentwise multiplication. + /// Right hand side float2x2 to use to compute componentwise multiplication. + /// float2x2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x2 operator * (float2x2 lhs, float2x2 rhs) { return new float2x2 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1); } + + /// Returns the result of a componentwise multiplication operation on a float2x2 matrix and a float value. + /// Left hand side float2x2 to use to compute componentwise multiplication. + /// Right hand side float to use to compute componentwise multiplication. + /// float2x2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x2 operator * (float2x2 lhs, float rhs) { return new float2x2 (lhs.c0 * rhs, lhs.c1 * rhs); } + + /// Returns the result of a componentwise multiplication operation on a float value and a float2x2 matrix. + /// Left hand side float to use to compute componentwise multiplication. + /// Right hand side float2x2 to use to compute componentwise multiplication. + /// float2x2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x2 operator * (float lhs, float2x2 rhs) { return new float2x2 (lhs * rhs.c0, lhs * rhs.c1); } + + + /// Returns the result of a componentwise addition operation on two float2x2 matrices. + /// Left hand side float2x2 to use to compute componentwise addition. + /// Right hand side float2x2 to use to compute componentwise addition. + /// float2x2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x2 operator + (float2x2 lhs, float2x2 rhs) { return new float2x2 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1); } + + /// Returns the result of a componentwise addition operation on a float2x2 matrix and a float value. + /// Left hand side float2x2 to use to compute componentwise addition. + /// Right hand side float to use to compute componentwise addition. + /// float2x2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x2 operator + (float2x2 lhs, float rhs) { return new float2x2 (lhs.c0 + rhs, lhs.c1 + rhs); } + + /// Returns the result of a componentwise addition operation on a float value and a float2x2 matrix. + /// Left hand side float to use to compute componentwise addition. + /// Right hand side float2x2 to use to compute componentwise addition. + /// float2x2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x2 operator + (float lhs, float2x2 rhs) { return new float2x2 (lhs + rhs.c0, lhs + rhs.c1); } + + + /// Returns the result of a componentwise subtraction operation on two float2x2 matrices. + /// Left hand side float2x2 to use to compute componentwise subtraction. + /// Right hand side float2x2 to use to compute componentwise subtraction. + /// float2x2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x2 operator - (float2x2 lhs, float2x2 rhs) { return new float2x2 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1); } + + /// Returns the result of a componentwise subtraction operation on a float2x2 matrix and a float value. + /// Left hand side float2x2 to use to compute componentwise subtraction. + /// Right hand side float to use to compute componentwise subtraction. + /// float2x2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x2 operator - (float2x2 lhs, float rhs) { return new float2x2 (lhs.c0 - rhs, lhs.c1 - rhs); } + + /// Returns the result of a componentwise subtraction operation on a float value and a float2x2 matrix. + /// Left hand side float to use to compute componentwise subtraction. + /// Right hand side float2x2 to use to compute componentwise subtraction. + /// float2x2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x2 operator - (float lhs, float2x2 rhs) { return new float2x2 (lhs - rhs.c0, lhs - rhs.c1); } + + + /// Returns the result of a componentwise division operation on two float2x2 matrices. + /// Left hand side float2x2 to use to compute componentwise division. + /// Right hand side float2x2 to use to compute componentwise division. + /// float2x2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x2 operator / (float2x2 lhs, float2x2 rhs) { return new float2x2 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1); } + + /// Returns the result of a componentwise division operation on a float2x2 matrix and a float value. + /// Left hand side float2x2 to use to compute componentwise division. + /// Right hand side float to use to compute componentwise division. + /// float2x2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x2 operator / (float2x2 lhs, float rhs) { return new float2x2 (lhs.c0 / rhs, lhs.c1 / rhs); } + + /// Returns the result of a componentwise division operation on a float value and a float2x2 matrix. + /// Left hand side float to use to compute componentwise division. + /// Right hand side float2x2 to use to compute componentwise division. + /// float2x2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x2 operator / (float lhs, float2x2 rhs) { return new float2x2 (lhs / rhs.c0, lhs / rhs.c1); } + + + /// Returns the result of a componentwise modulus operation on two float2x2 matrices. + /// Left hand side float2x2 to use to compute componentwise modulus. + /// Right hand side float2x2 to use to compute componentwise modulus. + /// float2x2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x2 operator % (float2x2 lhs, float2x2 rhs) { return new float2x2 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1); } + + /// Returns the result of a componentwise modulus operation on a float2x2 matrix and a float value. + /// Left hand side float2x2 to use to compute componentwise modulus. + /// Right hand side float to use to compute componentwise modulus. + /// float2x2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x2 operator % (float2x2 lhs, float rhs) { return new float2x2 (lhs.c0 % rhs, lhs.c1 % rhs); } + + /// Returns the result of a componentwise modulus operation on a float value and a float2x2 matrix. + /// Left hand side float to use to compute componentwise modulus. + /// Right hand side float2x2 to use to compute componentwise modulus. + /// float2x2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x2 operator % (float lhs, float2x2 rhs) { return new float2x2 (lhs % rhs.c0, lhs % rhs.c1); } + + + /// Returns the result of a componentwise increment operation on a float2x2 matrix. + /// Value to use when computing the componentwise increment. + /// float2x2 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x2 operator ++ (float2x2 val) { return new float2x2 (++val.c0, ++val.c1); } + + + /// Returns the result of a componentwise decrement operation on a float2x2 matrix. + /// Value to use when computing the componentwise decrement. + /// float2x2 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x2 operator -- (float2x2 val) { return new float2x2 (--val.c0, --val.c1); } + + + /// Returns the result of a componentwise less than operation on two float2x2 matrices. + /// Left hand side float2x2 to use to compute componentwise less than. + /// Right hand side float2x2 to use to compute componentwise less than. + /// bool2x2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator < (float2x2 lhs, float2x2 rhs) { return new bool2x2 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1); } + + /// Returns the result of a componentwise less than operation on a float2x2 matrix and a float value. + /// Left hand side float2x2 to use to compute componentwise less than. + /// Right hand side float to use to compute componentwise less than. + /// bool2x2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator < (float2x2 lhs, float rhs) { return new bool2x2 (lhs.c0 < rhs, lhs.c1 < rhs); } + + /// Returns the result of a componentwise less than operation on a float value and a float2x2 matrix. + /// Left hand side float to use to compute componentwise less than. + /// Right hand side float2x2 to use to compute componentwise less than. + /// bool2x2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator < (float lhs, float2x2 rhs) { return new bool2x2 (lhs < rhs.c0, lhs < rhs.c1); } + + + /// Returns the result of a componentwise less or equal operation on two float2x2 matrices. + /// Left hand side float2x2 to use to compute componentwise less or equal. + /// Right hand side float2x2 to use to compute componentwise less or equal. + /// bool2x2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator <= (float2x2 lhs, float2x2 rhs) { return new bool2x2 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1); } + + /// Returns the result of a componentwise less or equal operation on a float2x2 matrix and a float value. + /// Left hand side float2x2 to use to compute componentwise less or equal. + /// Right hand side float to use to compute componentwise less or equal. + /// bool2x2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator <= (float2x2 lhs, float rhs) { return new bool2x2 (lhs.c0 <= rhs, lhs.c1 <= rhs); } + + /// Returns the result of a componentwise less or equal operation on a float value and a float2x2 matrix. + /// Left hand side float to use to compute componentwise less or equal. + /// Right hand side float2x2 to use to compute componentwise less or equal. + /// bool2x2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator <= (float lhs, float2x2 rhs) { return new bool2x2 (lhs <= rhs.c0, lhs <= rhs.c1); } + + + /// Returns the result of a componentwise greater than operation on two float2x2 matrices. + /// Left hand side float2x2 to use to compute componentwise greater than. + /// Right hand side float2x2 to use to compute componentwise greater than. + /// bool2x2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator > (float2x2 lhs, float2x2 rhs) { return new bool2x2 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1); } + + /// Returns the result of a componentwise greater than operation on a float2x2 matrix and a float value. + /// Left hand side float2x2 to use to compute componentwise greater than. + /// Right hand side float to use to compute componentwise greater than. + /// bool2x2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator > (float2x2 lhs, float rhs) { return new bool2x2 (lhs.c0 > rhs, lhs.c1 > rhs); } + + /// Returns the result of a componentwise greater than operation on a float value and a float2x2 matrix. + /// Left hand side float to use to compute componentwise greater than. + /// Right hand side float2x2 to use to compute componentwise greater than. + /// bool2x2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator > (float lhs, float2x2 rhs) { return new bool2x2 (lhs > rhs.c0, lhs > rhs.c1); } + + + /// Returns the result of a componentwise greater or equal operation on two float2x2 matrices. + /// Left hand side float2x2 to use to compute componentwise greater or equal. + /// Right hand side float2x2 to use to compute componentwise greater or equal. + /// bool2x2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator >= (float2x2 lhs, float2x2 rhs) { return new bool2x2 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1); } + + /// Returns the result of a componentwise greater or equal operation on a float2x2 matrix and a float value. + /// Left hand side float2x2 to use to compute componentwise greater or equal. + /// Right hand side float to use to compute componentwise greater or equal. + /// bool2x2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator >= (float2x2 lhs, float rhs) { return new bool2x2 (lhs.c0 >= rhs, lhs.c1 >= rhs); } + + /// Returns the result of a componentwise greater or equal operation on a float value and a float2x2 matrix. + /// Left hand side float to use to compute componentwise greater or equal. + /// Right hand side float2x2 to use to compute componentwise greater or equal. + /// bool2x2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator >= (float lhs, float2x2 rhs) { return new bool2x2 (lhs >= rhs.c0, lhs >= rhs.c1); } + + + /// Returns the result of a componentwise unary minus operation on a float2x2 matrix. + /// Value to use when computing the componentwise unary minus. + /// float2x2 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x2 operator - (float2x2 val) { return new float2x2 (-val.c0, -val.c1); } + + + /// Returns the result of a componentwise unary plus operation on a float2x2 matrix. + /// Value to use when computing the componentwise unary plus. + /// float2x2 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x2 operator + (float2x2 val) { return new float2x2 (+val.c0, +val.c1); } + + + /// Returns the result of a componentwise equality operation on two float2x2 matrices. + /// Left hand side float2x2 to use to compute componentwise equality. + /// Right hand side float2x2 to use to compute componentwise equality. + /// bool2x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator == (float2x2 lhs, float2x2 rhs) { return new bool2x2 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1); } + + /// Returns the result of a componentwise equality operation on a float2x2 matrix and a float value. + /// Left hand side float2x2 to use to compute componentwise equality. + /// Right hand side float to use to compute componentwise equality. + /// bool2x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator == (float2x2 lhs, float rhs) { return new bool2x2 (lhs.c0 == rhs, lhs.c1 == rhs); } + + /// Returns the result of a componentwise equality operation on a float value and a float2x2 matrix. + /// Left hand side float to use to compute componentwise equality. + /// Right hand side float2x2 to use to compute componentwise equality. + /// bool2x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator == (float lhs, float2x2 rhs) { return new bool2x2 (lhs == rhs.c0, lhs == rhs.c1); } + + + /// Returns the result of a componentwise not equal operation on two float2x2 matrices. + /// Left hand side float2x2 to use to compute componentwise not equal. + /// Right hand side float2x2 to use to compute componentwise not equal. + /// bool2x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator != (float2x2 lhs, float2x2 rhs) { return new bool2x2 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1); } + + /// Returns the result of a componentwise not equal operation on a float2x2 matrix and a float value. + /// Left hand side float2x2 to use to compute componentwise not equal. + /// Right hand side float to use to compute componentwise not equal. + /// bool2x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator != (float2x2 lhs, float rhs) { return new bool2x2 (lhs.c0 != rhs, lhs.c1 != rhs); } + + /// Returns the result of a componentwise not equal operation on a float value and a float2x2 matrix. + /// Left hand side float to use to compute componentwise not equal. + /// Right hand side float2x2 to use to compute componentwise not equal. + /// bool2x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator != (float lhs, float2x2 rhs) { return new bool2x2 (lhs != rhs.c0, lhs != rhs.c1); } + + + + /// Returns the float2 element at a specified index. + unsafe public ref float2 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 2) + throw new System.ArgumentException("index must be between[0...1]"); +#endif + fixed (float2x2* array = &this) { return ref ((float2*)array)[index]; } + } + } + + /// Returns true if the float2x2 is equal to a given float2x2, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(float2x2 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1); } + + /// Returns true if the float2x2 is equal to a given float2x2, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is float2x2 converted && Equals(converted); } + + + /// Returns a hash code for the float2x2. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the float2x2. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("float2x2({0}f, {1}f, {2}f, {3}f)", c0.x, c1.x, c0.y, c1.y); + } + + /// Returns a string representation of the float2x2 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("float2x2({0}f, {1}f, {2}f, {3}f)", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider)); + } + + } + + public static partial class math + { + /// Returns a float2x2 matrix constructed from two float2 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// float2x2 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x2 float2x2(float2 c0, float2 c1) { return new float2x2(c0, c1); } + + /// Returns a float2x2 matrix constructed from from 4 float values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// float2x2 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x2 float2x2(float m00, float m01, + float m10, float m11) + { + return new float2x2(m00, m01, + m10, m11); + } + + /// Returns a float2x2 matrix constructed from a single float value by assigning it to every component. + /// float to convert to float2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x2 float2x2(float v) { return new float2x2(v); } + + /// Returns a float2x2 matrix constructed from a single bool value by converting it to float and assigning it to every component. + /// bool to convert to float2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x2 float2x2(bool v) { return new float2x2(v); } + + /// Return a float2x2 matrix constructed from a bool2x2 matrix by componentwise conversion. + /// bool2x2 to convert to float2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x2 float2x2(bool2x2 v) { return new float2x2(v); } + + /// Returns a float2x2 matrix constructed from a single int value by converting it to float and assigning it to every component. + /// int to convert to float2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x2 float2x2(int v) { return new float2x2(v); } + + /// Return a float2x2 matrix constructed from a int2x2 matrix by componentwise conversion. + /// int2x2 to convert to float2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x2 float2x2(int2x2 v) { return new float2x2(v); } + + /// Returns a float2x2 matrix constructed from a single uint value by converting it to float and assigning it to every component. + /// uint to convert to float2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x2 float2x2(uint v) { return new float2x2(v); } + + /// Return a float2x2 matrix constructed from a uint2x2 matrix by componentwise conversion. + /// uint2x2 to convert to float2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x2 float2x2(uint2x2 v) { return new float2x2(v); } + + /// Returns a float2x2 matrix constructed from a single double value by converting it to float and assigning it to every component. + /// double to convert to float2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x2 float2x2(double v) { return new float2x2(v); } + + /// Return a float2x2 matrix constructed from a double2x2 matrix by componentwise conversion. + /// double2x2 to convert to float2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x2 float2x2(double2x2 v) { return new float2x2(v); } + + /// Return the float2x2 transpose of a float2x2 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x2 transpose(float2x2 v) + { + return float2x2( + v.c0.x, v.c0.y, + v.c1.x, v.c1.y); + } + + /// Returns the float2x2 full inverse of a float2x2 matrix. + /// Matrix to invert. + /// The inverted matrix. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x2 inverse(float2x2 m) + { + float a = m.c0.x; + float b = m.c1.x; + float c = m.c0.y; + float d = m.c1.y; + + float det = a * d - b * c; + + return float2x2(d, -b, -c, a) * (1.0f / det); + } + + /// Returns the determinant of a float2x2 matrix. + /// Matrix to use when computing determinant. + /// The determinant of the matrix. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float determinant(float2x2 m) + { + float a = m.c0.x; + float b = m.c1.x; + float c = m.c0.y; + float d = m.c1.y; + + return a * d - b * c; + } + + /// Returns a uint hash code of a float2x2 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(float2x2 v) + { + return csum(asuint(v.c0) * uint2(0x9C9F0823u, 0x5A9CA13Bu) + + asuint(v.c1) * uint2(0xAFCDD5EFu, 0xA88D187Du)) + 0xCF6EBA1Du; + } + + /// + /// Returns a uint2 vector hash code of a float2x2 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint2 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 hashwide(float2x2 v) + { + return (asuint(v.c0) * uint2(0x9D88E5A1u, 0xEADF0775u) + + asuint(v.c1) * uint2(0x747A9D7Bu, 0x4111F799u)) + 0xB5F05AF1u; + } + + } +} diff --git a/src/Unity.Mathematics/float2x2.gen.cs.meta b/src/Unity.Mathematics/float2x2.gen.cs.meta new file mode 100644 index 00000000..f0671d4a --- /dev/null +++ b/src/Unity.Mathematics/float2x2.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 93080f7a13fd743e3aaaac6fee9f12b6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/float2x3.gen.cs b/src/Unity.Mathematics/float2x3.gen.cs new file mode 100644 index 00000000..38a1e2a0 --- /dev/null +++ b/src/Unity.Mathematics/float2x3.gen.cs @@ -0,0 +1,647 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 2x3 matrix of floats. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct float2x3 : System.IEquatable, IFormattable + { + /// Column 0 of the matrix. + public float2 c0; + /// Column 1 of the matrix. + public float2 c1; + /// Column 2 of the matrix. + public float2 c2; + + /// float2x3 zero value. + public static readonly float2x3 zero; + + /// Constructs a float2x3 matrix from three float2 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2x3(float2 c0, float2 c1, float2 c2) + { + this.c0 = c0; + this.c1 = c1; + this.c2 = c2; + } + + /// Constructs a float2x3 matrix from 6 float values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2x3(float m00, float m01, float m02, + float m10, float m11, float m12) + { + this.c0 = new float2(m00, m10); + this.c1 = new float2(m01, m11); + this.c2 = new float2(m02, m12); + } + + /// Constructs a float2x3 matrix from a single float value by assigning it to every component. + /// float to convert to float2x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2x3(float v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + } + + /// Constructs a float2x3 matrix from a single bool value by converting it to float and assigning it to every component. + /// bool to convert to float2x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2x3(bool v) + { + this.c0 = math.select(new float2(0.0f), new float2(1.0f), v); + this.c1 = math.select(new float2(0.0f), new float2(1.0f), v); + this.c2 = math.select(new float2(0.0f), new float2(1.0f), v); + } + + /// Constructs a float2x3 matrix from a bool2x3 matrix by componentwise conversion. + /// bool2x3 to convert to float2x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2x3(bool2x3 v) + { + this.c0 = math.select(new float2(0.0f), new float2(1.0f), v.c0); + this.c1 = math.select(new float2(0.0f), new float2(1.0f), v.c1); + this.c2 = math.select(new float2(0.0f), new float2(1.0f), v.c2); + } + + /// Constructs a float2x3 matrix from a single int value by converting it to float and assigning it to every component. + /// int to convert to float2x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2x3(int v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + } + + /// Constructs a float2x3 matrix from a int2x3 matrix by componentwise conversion. + /// int2x3 to convert to float2x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2x3(int2x3 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + this.c2 = v.c2; + } + + /// Constructs a float2x3 matrix from a single uint value by converting it to float and assigning it to every component. + /// uint to convert to float2x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2x3(uint v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + } + + /// Constructs a float2x3 matrix from a uint2x3 matrix by componentwise conversion. + /// uint2x3 to convert to float2x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2x3(uint2x3 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + this.c2 = v.c2; + } + + /// Constructs a float2x3 matrix from a single double value by converting it to float and assigning it to every component. + /// double to convert to float2x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2x3(double v) + { + this.c0 = (float2)v; + this.c1 = (float2)v; + this.c2 = (float2)v; + } + + /// Constructs a float2x3 matrix from a double2x3 matrix by componentwise conversion. + /// double2x3 to convert to float2x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2x3(double2x3 v) + { + this.c0 = (float2)v.c0; + this.c1 = (float2)v.c1; + this.c2 = (float2)v.c2; + } + + + /// Implicitly converts a single float value to a float2x3 matrix by assigning it to every component. + /// float to convert to float2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float2x3(float v) { return new float2x3(v); } + + /// Explicitly converts a single bool value to a float2x3 matrix by converting it to float and assigning it to every component. + /// bool to convert to float2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float2x3(bool v) { return new float2x3(v); } + + /// Explicitly converts a bool2x3 matrix to a float2x3 matrix by componentwise conversion. + /// bool2x3 to convert to float2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float2x3(bool2x3 v) { return new float2x3(v); } + + /// Implicitly converts a single int value to a float2x3 matrix by converting it to float and assigning it to every component. + /// int to convert to float2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float2x3(int v) { return new float2x3(v); } + + /// Implicitly converts a int2x3 matrix to a float2x3 matrix by componentwise conversion. + /// int2x3 to convert to float2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float2x3(int2x3 v) { return new float2x3(v); } + + /// Implicitly converts a single uint value to a float2x3 matrix by converting it to float and assigning it to every component. + /// uint to convert to float2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float2x3(uint v) { return new float2x3(v); } + + /// Implicitly converts a uint2x3 matrix to a float2x3 matrix by componentwise conversion. + /// uint2x3 to convert to float2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float2x3(uint2x3 v) { return new float2x3(v); } + + /// Explicitly converts a single double value to a float2x3 matrix by converting it to float and assigning it to every component. + /// double to convert to float2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float2x3(double v) { return new float2x3(v); } + + /// Explicitly converts a double2x3 matrix to a float2x3 matrix by componentwise conversion. + /// double2x3 to convert to float2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float2x3(double2x3 v) { return new float2x3(v); } + + + /// Returns the result of a componentwise multiplication operation on two float2x3 matrices. + /// Left hand side float2x3 to use to compute componentwise multiplication. + /// Right hand side float2x3 to use to compute componentwise multiplication. + /// float2x3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x3 operator * (float2x3 lhs, float2x3 rhs) { return new float2x3 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1, lhs.c2 * rhs.c2); } + + /// Returns the result of a componentwise multiplication operation on a float2x3 matrix and a float value. + /// Left hand side float2x3 to use to compute componentwise multiplication. + /// Right hand side float to use to compute componentwise multiplication. + /// float2x3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x3 operator * (float2x3 lhs, float rhs) { return new float2x3 (lhs.c0 * rhs, lhs.c1 * rhs, lhs.c2 * rhs); } + + /// Returns the result of a componentwise multiplication operation on a float value and a float2x3 matrix. + /// Left hand side float to use to compute componentwise multiplication. + /// Right hand side float2x3 to use to compute componentwise multiplication. + /// float2x3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x3 operator * (float lhs, float2x3 rhs) { return new float2x3 (lhs * rhs.c0, lhs * rhs.c1, lhs * rhs.c2); } + + + /// Returns the result of a componentwise addition operation on two float2x3 matrices. + /// Left hand side float2x3 to use to compute componentwise addition. + /// Right hand side float2x3 to use to compute componentwise addition. + /// float2x3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x3 operator + (float2x3 lhs, float2x3 rhs) { return new float2x3 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1, lhs.c2 + rhs.c2); } + + /// Returns the result of a componentwise addition operation on a float2x3 matrix and a float value. + /// Left hand side float2x3 to use to compute componentwise addition. + /// Right hand side float to use to compute componentwise addition. + /// float2x3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x3 operator + (float2x3 lhs, float rhs) { return new float2x3 (lhs.c0 + rhs, lhs.c1 + rhs, lhs.c2 + rhs); } + + /// Returns the result of a componentwise addition operation on a float value and a float2x3 matrix. + /// Left hand side float to use to compute componentwise addition. + /// Right hand side float2x3 to use to compute componentwise addition. + /// float2x3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x3 operator + (float lhs, float2x3 rhs) { return new float2x3 (lhs + rhs.c0, lhs + rhs.c1, lhs + rhs.c2); } + + + /// Returns the result of a componentwise subtraction operation on two float2x3 matrices. + /// Left hand side float2x3 to use to compute componentwise subtraction. + /// Right hand side float2x3 to use to compute componentwise subtraction. + /// float2x3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x3 operator - (float2x3 lhs, float2x3 rhs) { return new float2x3 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1, lhs.c2 - rhs.c2); } + + /// Returns the result of a componentwise subtraction operation on a float2x3 matrix and a float value. + /// Left hand side float2x3 to use to compute componentwise subtraction. + /// Right hand side float to use to compute componentwise subtraction. + /// float2x3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x3 operator - (float2x3 lhs, float rhs) { return new float2x3 (lhs.c0 - rhs, lhs.c1 - rhs, lhs.c2 - rhs); } + + /// Returns the result of a componentwise subtraction operation on a float value and a float2x3 matrix. + /// Left hand side float to use to compute componentwise subtraction. + /// Right hand side float2x3 to use to compute componentwise subtraction. + /// float2x3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x3 operator - (float lhs, float2x3 rhs) { return new float2x3 (lhs - rhs.c0, lhs - rhs.c1, lhs - rhs.c2); } + + + /// Returns the result of a componentwise division operation on two float2x3 matrices. + /// Left hand side float2x3 to use to compute componentwise division. + /// Right hand side float2x3 to use to compute componentwise division. + /// float2x3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x3 operator / (float2x3 lhs, float2x3 rhs) { return new float2x3 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1, lhs.c2 / rhs.c2); } + + /// Returns the result of a componentwise division operation on a float2x3 matrix and a float value. + /// Left hand side float2x3 to use to compute componentwise division. + /// Right hand side float to use to compute componentwise division. + /// float2x3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x3 operator / (float2x3 lhs, float rhs) { return new float2x3 (lhs.c0 / rhs, lhs.c1 / rhs, lhs.c2 / rhs); } + + /// Returns the result of a componentwise division operation on a float value and a float2x3 matrix. + /// Left hand side float to use to compute componentwise division. + /// Right hand side float2x3 to use to compute componentwise division. + /// float2x3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x3 operator / (float lhs, float2x3 rhs) { return new float2x3 (lhs / rhs.c0, lhs / rhs.c1, lhs / rhs.c2); } + + + /// Returns the result of a componentwise modulus operation on two float2x3 matrices. + /// Left hand side float2x3 to use to compute componentwise modulus. + /// Right hand side float2x3 to use to compute componentwise modulus. + /// float2x3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x3 operator % (float2x3 lhs, float2x3 rhs) { return new float2x3 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1, lhs.c2 % rhs.c2); } + + /// Returns the result of a componentwise modulus operation on a float2x3 matrix and a float value. + /// Left hand side float2x3 to use to compute componentwise modulus. + /// Right hand side float to use to compute componentwise modulus. + /// float2x3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x3 operator % (float2x3 lhs, float rhs) { return new float2x3 (lhs.c0 % rhs, lhs.c1 % rhs, lhs.c2 % rhs); } + + /// Returns the result of a componentwise modulus operation on a float value and a float2x3 matrix. + /// Left hand side float to use to compute componentwise modulus. + /// Right hand side float2x3 to use to compute componentwise modulus. + /// float2x3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x3 operator % (float lhs, float2x3 rhs) { return new float2x3 (lhs % rhs.c0, lhs % rhs.c1, lhs % rhs.c2); } + + + /// Returns the result of a componentwise increment operation on a float2x3 matrix. + /// Value to use when computing the componentwise increment. + /// float2x3 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x3 operator ++ (float2x3 val) { return new float2x3 (++val.c0, ++val.c1, ++val.c2); } + + + /// Returns the result of a componentwise decrement operation on a float2x3 matrix. + /// Value to use when computing the componentwise decrement. + /// float2x3 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x3 operator -- (float2x3 val) { return new float2x3 (--val.c0, --val.c1, --val.c2); } + + + /// Returns the result of a componentwise less than operation on two float2x3 matrices. + /// Left hand side float2x3 to use to compute componentwise less than. + /// Right hand side float2x3 to use to compute componentwise less than. + /// bool2x3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator < (float2x3 lhs, float2x3 rhs) { return new bool2x3 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1, lhs.c2 < rhs.c2); } + + /// Returns the result of a componentwise less than operation on a float2x3 matrix and a float value. + /// Left hand side float2x3 to use to compute componentwise less than. + /// Right hand side float to use to compute componentwise less than. + /// bool2x3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator < (float2x3 lhs, float rhs) { return new bool2x3 (lhs.c0 < rhs, lhs.c1 < rhs, lhs.c2 < rhs); } + + /// Returns the result of a componentwise less than operation on a float value and a float2x3 matrix. + /// Left hand side float to use to compute componentwise less than. + /// Right hand side float2x3 to use to compute componentwise less than. + /// bool2x3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator < (float lhs, float2x3 rhs) { return new bool2x3 (lhs < rhs.c0, lhs < rhs.c1, lhs < rhs.c2); } + + + /// Returns the result of a componentwise less or equal operation on two float2x3 matrices. + /// Left hand side float2x3 to use to compute componentwise less or equal. + /// Right hand side float2x3 to use to compute componentwise less or equal. + /// bool2x3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator <= (float2x3 lhs, float2x3 rhs) { return new bool2x3 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1, lhs.c2 <= rhs.c2); } + + /// Returns the result of a componentwise less or equal operation on a float2x3 matrix and a float value. + /// Left hand side float2x3 to use to compute componentwise less or equal. + /// Right hand side float to use to compute componentwise less or equal. + /// bool2x3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator <= (float2x3 lhs, float rhs) { return new bool2x3 (lhs.c0 <= rhs, lhs.c1 <= rhs, lhs.c2 <= rhs); } + + /// Returns the result of a componentwise less or equal operation on a float value and a float2x3 matrix. + /// Left hand side float to use to compute componentwise less or equal. + /// Right hand side float2x3 to use to compute componentwise less or equal. + /// bool2x3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator <= (float lhs, float2x3 rhs) { return new bool2x3 (lhs <= rhs.c0, lhs <= rhs.c1, lhs <= rhs.c2); } + + + /// Returns the result of a componentwise greater than operation on two float2x3 matrices. + /// Left hand side float2x3 to use to compute componentwise greater than. + /// Right hand side float2x3 to use to compute componentwise greater than. + /// bool2x3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator > (float2x3 lhs, float2x3 rhs) { return new bool2x3 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1, lhs.c2 > rhs.c2); } + + /// Returns the result of a componentwise greater than operation on a float2x3 matrix and a float value. + /// Left hand side float2x3 to use to compute componentwise greater than. + /// Right hand side float to use to compute componentwise greater than. + /// bool2x3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator > (float2x3 lhs, float rhs) { return new bool2x3 (lhs.c0 > rhs, lhs.c1 > rhs, lhs.c2 > rhs); } + + /// Returns the result of a componentwise greater than operation on a float value and a float2x3 matrix. + /// Left hand side float to use to compute componentwise greater than. + /// Right hand side float2x3 to use to compute componentwise greater than. + /// bool2x3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator > (float lhs, float2x3 rhs) { return new bool2x3 (lhs > rhs.c0, lhs > rhs.c1, lhs > rhs.c2); } + + + /// Returns the result of a componentwise greater or equal operation on two float2x3 matrices. + /// Left hand side float2x3 to use to compute componentwise greater or equal. + /// Right hand side float2x3 to use to compute componentwise greater or equal. + /// bool2x3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator >= (float2x3 lhs, float2x3 rhs) { return new bool2x3 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1, lhs.c2 >= rhs.c2); } + + /// Returns the result of a componentwise greater or equal operation on a float2x3 matrix and a float value. + /// Left hand side float2x3 to use to compute componentwise greater or equal. + /// Right hand side float to use to compute componentwise greater or equal. + /// bool2x3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator >= (float2x3 lhs, float rhs) { return new bool2x3 (lhs.c0 >= rhs, lhs.c1 >= rhs, lhs.c2 >= rhs); } + + /// Returns the result of a componentwise greater or equal operation on a float value and a float2x3 matrix. + /// Left hand side float to use to compute componentwise greater or equal. + /// Right hand side float2x3 to use to compute componentwise greater or equal. + /// bool2x3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator >= (float lhs, float2x3 rhs) { return new bool2x3 (lhs >= rhs.c0, lhs >= rhs.c1, lhs >= rhs.c2); } + + + /// Returns the result of a componentwise unary minus operation on a float2x3 matrix. + /// Value to use when computing the componentwise unary minus. + /// float2x3 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x3 operator - (float2x3 val) { return new float2x3 (-val.c0, -val.c1, -val.c2); } + + + /// Returns the result of a componentwise unary plus operation on a float2x3 matrix. + /// Value to use when computing the componentwise unary plus. + /// float2x3 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x3 operator + (float2x3 val) { return new float2x3 (+val.c0, +val.c1, +val.c2); } + + + /// Returns the result of a componentwise equality operation on two float2x3 matrices. + /// Left hand side float2x3 to use to compute componentwise equality. + /// Right hand side float2x3 to use to compute componentwise equality. + /// bool2x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator == (float2x3 lhs, float2x3 rhs) { return new bool2x3 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2); } + + /// Returns the result of a componentwise equality operation on a float2x3 matrix and a float value. + /// Left hand side float2x3 to use to compute componentwise equality. + /// Right hand side float to use to compute componentwise equality. + /// bool2x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator == (float2x3 lhs, float rhs) { return new bool2x3 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs); } + + /// Returns the result of a componentwise equality operation on a float value and a float2x3 matrix. + /// Left hand side float to use to compute componentwise equality. + /// Right hand side float2x3 to use to compute componentwise equality. + /// bool2x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator == (float lhs, float2x3 rhs) { return new bool2x3 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2); } + + + /// Returns the result of a componentwise not equal operation on two float2x3 matrices. + /// Left hand side float2x3 to use to compute componentwise not equal. + /// Right hand side float2x3 to use to compute componentwise not equal. + /// bool2x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator != (float2x3 lhs, float2x3 rhs) { return new bool2x3 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2); } + + /// Returns the result of a componentwise not equal operation on a float2x3 matrix and a float value. + /// Left hand side float2x3 to use to compute componentwise not equal. + /// Right hand side float to use to compute componentwise not equal. + /// bool2x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator != (float2x3 lhs, float rhs) { return new bool2x3 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs); } + + /// Returns the result of a componentwise not equal operation on a float value and a float2x3 matrix. + /// Left hand side float to use to compute componentwise not equal. + /// Right hand side float2x3 to use to compute componentwise not equal. + /// bool2x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator != (float lhs, float2x3 rhs) { return new bool2x3 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2); } + + + + /// Returns the float2 element at a specified index. + unsafe public ref float2 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 3) + throw new System.ArgumentException("index must be between[0...2]"); +#endif + fixed (float2x3* array = &this) { return ref ((float2*)array)[index]; } + } + } + + /// Returns true if the float2x3 is equal to a given float2x3, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(float2x3 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2); } + + /// Returns true if the float2x3 is equal to a given float2x3, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is float2x3 converted && Equals(converted); } + + + /// Returns a hash code for the float2x3. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the float2x3. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("float2x3({0}f, {1}f, {2}f, {3}f, {4}f, {5}f)", c0.x, c1.x, c2.x, c0.y, c1.y, c2.y); + } + + /// Returns a string representation of the float2x3 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("float2x3({0}f, {1}f, {2}f, {3}f, {4}f, {5}f)", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c2.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c2.y.ToString(format, formatProvider)); + } + + } + + public static partial class math + { + /// Returns a float2x3 matrix constructed from three float2 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// float2x3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x3 float2x3(float2 c0, float2 c1, float2 c2) { return new float2x3(c0, c1, c2); } + + /// Returns a float2x3 matrix constructed from from 6 float values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// float2x3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x3 float2x3(float m00, float m01, float m02, + float m10, float m11, float m12) + { + return new float2x3(m00, m01, m02, + m10, m11, m12); + } + + /// Returns a float2x3 matrix constructed from a single float value by assigning it to every component. + /// float to convert to float2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x3 float2x3(float v) { return new float2x3(v); } + + /// Returns a float2x3 matrix constructed from a single bool value by converting it to float and assigning it to every component. + /// bool to convert to float2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x3 float2x3(bool v) { return new float2x3(v); } + + /// Return a float2x3 matrix constructed from a bool2x3 matrix by componentwise conversion. + /// bool2x3 to convert to float2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x3 float2x3(bool2x3 v) { return new float2x3(v); } + + /// Returns a float2x3 matrix constructed from a single int value by converting it to float and assigning it to every component. + /// int to convert to float2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x3 float2x3(int v) { return new float2x3(v); } + + /// Return a float2x3 matrix constructed from a int2x3 matrix by componentwise conversion. + /// int2x3 to convert to float2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x3 float2x3(int2x3 v) { return new float2x3(v); } + + /// Returns a float2x3 matrix constructed from a single uint value by converting it to float and assigning it to every component. + /// uint to convert to float2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x3 float2x3(uint v) { return new float2x3(v); } + + /// Return a float2x3 matrix constructed from a uint2x3 matrix by componentwise conversion. + /// uint2x3 to convert to float2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x3 float2x3(uint2x3 v) { return new float2x3(v); } + + /// Returns a float2x3 matrix constructed from a single double value by converting it to float and assigning it to every component. + /// double to convert to float2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x3 float2x3(double v) { return new float2x3(v); } + + /// Return a float2x3 matrix constructed from a double2x3 matrix by componentwise conversion. + /// double2x3 to convert to float2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x3 float2x3(double2x3 v) { return new float2x3(v); } + + /// Return the float3x2 transpose of a float2x3 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x2 transpose(float2x3 v) + { + return float3x2( + v.c0.x, v.c0.y, + v.c1.x, v.c1.y, + v.c2.x, v.c2.y); + } + + /// Returns a uint hash code of a float2x3 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(float2x3 v) + { + return csum(asuint(v.c0) * uint2(0xE857DCE1u, 0xF62213C5u) + + asuint(v.c1) * uint2(0x9CDAA959u, 0xAA269ABFu) + + asuint(v.c2) * uint2(0xD54BA36Fu, 0xFD0847B9u)) + 0x8189A683u; + } + + /// + /// Returns a uint2 vector hash code of a float2x3 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint2 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 hashwide(float2x3 v) + { + return (asuint(v.c0) * uint2(0xB139D651u, 0xE7579997u) + + asuint(v.c1) * uint2(0xEF7D56C7u, 0x66F38F0Bu) + + asuint(v.c2) * uint2(0x624256A3u, 0x5292ADE1u)) + 0xD2E590E5u; + } + + } +} diff --git a/src/Unity.Mathematics/float2x3.gen.cs.meta b/src/Unity.Mathematics/float2x3.gen.cs.meta new file mode 100644 index 00000000..509bdb81 --- /dev/null +++ b/src/Unity.Mathematics/float2x3.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f6047b8d8f85d4465b798320ea146853 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/float2x4.gen.cs b/src/Unity.Mathematics/float2x4.gen.cs new file mode 100644 index 00000000..2ec76c5a --- /dev/null +++ b/src/Unity.Mathematics/float2x4.gen.cs @@ -0,0 +1,669 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 2x4 matrix of floats. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct float2x4 : System.IEquatable, IFormattable + { + /// Column 0 of the matrix. + public float2 c0; + /// Column 1 of the matrix. + public float2 c1; + /// Column 2 of the matrix. + public float2 c2; + /// Column 3 of the matrix. + public float2 c3; + + /// float2x4 zero value. + public static readonly float2x4 zero; + + /// Constructs a float2x4 matrix from four float2 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// The matrix column c3 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2x4(float2 c0, float2 c1, float2 c2, float2 c3) + { + this.c0 = c0; + this.c1 = c1; + this.c2 = c2; + this.c3 = c3; + } + + /// Constructs a float2x4 matrix from 8 float values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 0, column 3 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 1, column 3 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2x4(float m00, float m01, float m02, float m03, + float m10, float m11, float m12, float m13) + { + this.c0 = new float2(m00, m10); + this.c1 = new float2(m01, m11); + this.c2 = new float2(m02, m12); + this.c3 = new float2(m03, m13); + } + + /// Constructs a float2x4 matrix from a single float value by assigning it to every component. + /// float to convert to float2x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2x4(float v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + this.c3 = v; + } + + /// Constructs a float2x4 matrix from a single bool value by converting it to float and assigning it to every component. + /// bool to convert to float2x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2x4(bool v) + { + this.c0 = math.select(new float2(0.0f), new float2(1.0f), v); + this.c1 = math.select(new float2(0.0f), new float2(1.0f), v); + this.c2 = math.select(new float2(0.0f), new float2(1.0f), v); + this.c3 = math.select(new float2(0.0f), new float2(1.0f), v); + } + + /// Constructs a float2x4 matrix from a bool2x4 matrix by componentwise conversion. + /// bool2x4 to convert to float2x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2x4(bool2x4 v) + { + this.c0 = math.select(new float2(0.0f), new float2(1.0f), v.c0); + this.c1 = math.select(new float2(0.0f), new float2(1.0f), v.c1); + this.c2 = math.select(new float2(0.0f), new float2(1.0f), v.c2); + this.c3 = math.select(new float2(0.0f), new float2(1.0f), v.c3); + } + + /// Constructs a float2x4 matrix from a single int value by converting it to float and assigning it to every component. + /// int to convert to float2x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2x4(int v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + this.c3 = v; + } + + /// Constructs a float2x4 matrix from a int2x4 matrix by componentwise conversion. + /// int2x4 to convert to float2x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2x4(int2x4 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + this.c2 = v.c2; + this.c3 = v.c3; + } + + /// Constructs a float2x4 matrix from a single uint value by converting it to float and assigning it to every component. + /// uint to convert to float2x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2x4(uint v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + this.c3 = v; + } + + /// Constructs a float2x4 matrix from a uint2x4 matrix by componentwise conversion. + /// uint2x4 to convert to float2x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2x4(uint2x4 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + this.c2 = v.c2; + this.c3 = v.c3; + } + + /// Constructs a float2x4 matrix from a single double value by converting it to float and assigning it to every component. + /// double to convert to float2x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2x4(double v) + { + this.c0 = (float2)v; + this.c1 = (float2)v; + this.c2 = (float2)v; + this.c3 = (float2)v; + } + + /// Constructs a float2x4 matrix from a double2x4 matrix by componentwise conversion. + /// double2x4 to convert to float2x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2x4(double2x4 v) + { + this.c0 = (float2)v.c0; + this.c1 = (float2)v.c1; + this.c2 = (float2)v.c2; + this.c3 = (float2)v.c3; + } + + + /// Implicitly converts a single float value to a float2x4 matrix by assigning it to every component. + /// float to convert to float2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float2x4(float v) { return new float2x4(v); } + + /// Explicitly converts a single bool value to a float2x4 matrix by converting it to float and assigning it to every component. + /// bool to convert to float2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float2x4(bool v) { return new float2x4(v); } + + /// Explicitly converts a bool2x4 matrix to a float2x4 matrix by componentwise conversion. + /// bool2x4 to convert to float2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float2x4(bool2x4 v) { return new float2x4(v); } + + /// Implicitly converts a single int value to a float2x4 matrix by converting it to float and assigning it to every component. + /// int to convert to float2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float2x4(int v) { return new float2x4(v); } + + /// Implicitly converts a int2x4 matrix to a float2x4 matrix by componentwise conversion. + /// int2x4 to convert to float2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float2x4(int2x4 v) { return new float2x4(v); } + + /// Implicitly converts a single uint value to a float2x4 matrix by converting it to float and assigning it to every component. + /// uint to convert to float2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float2x4(uint v) { return new float2x4(v); } + + /// Implicitly converts a uint2x4 matrix to a float2x4 matrix by componentwise conversion. + /// uint2x4 to convert to float2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float2x4(uint2x4 v) { return new float2x4(v); } + + /// Explicitly converts a single double value to a float2x4 matrix by converting it to float and assigning it to every component. + /// double to convert to float2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float2x4(double v) { return new float2x4(v); } + + /// Explicitly converts a double2x4 matrix to a float2x4 matrix by componentwise conversion. + /// double2x4 to convert to float2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float2x4(double2x4 v) { return new float2x4(v); } + + + /// Returns the result of a componentwise multiplication operation on two float2x4 matrices. + /// Left hand side float2x4 to use to compute componentwise multiplication. + /// Right hand side float2x4 to use to compute componentwise multiplication. + /// float2x4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x4 operator * (float2x4 lhs, float2x4 rhs) { return new float2x4 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1, lhs.c2 * rhs.c2, lhs.c3 * rhs.c3); } + + /// Returns the result of a componentwise multiplication operation on a float2x4 matrix and a float value. + /// Left hand side float2x4 to use to compute componentwise multiplication. + /// Right hand side float to use to compute componentwise multiplication. + /// float2x4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x4 operator * (float2x4 lhs, float rhs) { return new float2x4 (lhs.c0 * rhs, lhs.c1 * rhs, lhs.c2 * rhs, lhs.c3 * rhs); } + + /// Returns the result of a componentwise multiplication operation on a float value and a float2x4 matrix. + /// Left hand side float to use to compute componentwise multiplication. + /// Right hand side float2x4 to use to compute componentwise multiplication. + /// float2x4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x4 operator * (float lhs, float2x4 rhs) { return new float2x4 (lhs * rhs.c0, lhs * rhs.c1, lhs * rhs.c2, lhs * rhs.c3); } + + + /// Returns the result of a componentwise addition operation on two float2x4 matrices. + /// Left hand side float2x4 to use to compute componentwise addition. + /// Right hand side float2x4 to use to compute componentwise addition. + /// float2x4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x4 operator + (float2x4 lhs, float2x4 rhs) { return new float2x4 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1, lhs.c2 + rhs.c2, lhs.c3 + rhs.c3); } + + /// Returns the result of a componentwise addition operation on a float2x4 matrix and a float value. + /// Left hand side float2x4 to use to compute componentwise addition. + /// Right hand side float to use to compute componentwise addition. + /// float2x4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x4 operator + (float2x4 lhs, float rhs) { return new float2x4 (lhs.c0 + rhs, lhs.c1 + rhs, lhs.c2 + rhs, lhs.c3 + rhs); } + + /// Returns the result of a componentwise addition operation on a float value and a float2x4 matrix. + /// Left hand side float to use to compute componentwise addition. + /// Right hand side float2x4 to use to compute componentwise addition. + /// float2x4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x4 operator + (float lhs, float2x4 rhs) { return new float2x4 (lhs + rhs.c0, lhs + rhs.c1, lhs + rhs.c2, lhs + rhs.c3); } + + + /// Returns the result of a componentwise subtraction operation on two float2x4 matrices. + /// Left hand side float2x4 to use to compute componentwise subtraction. + /// Right hand side float2x4 to use to compute componentwise subtraction. + /// float2x4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x4 operator - (float2x4 lhs, float2x4 rhs) { return new float2x4 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1, lhs.c2 - rhs.c2, lhs.c3 - rhs.c3); } + + /// Returns the result of a componentwise subtraction operation on a float2x4 matrix and a float value. + /// Left hand side float2x4 to use to compute componentwise subtraction. + /// Right hand side float to use to compute componentwise subtraction. + /// float2x4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x4 operator - (float2x4 lhs, float rhs) { return new float2x4 (lhs.c0 - rhs, lhs.c1 - rhs, lhs.c2 - rhs, lhs.c3 - rhs); } + + /// Returns the result of a componentwise subtraction operation on a float value and a float2x4 matrix. + /// Left hand side float to use to compute componentwise subtraction. + /// Right hand side float2x4 to use to compute componentwise subtraction. + /// float2x4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x4 operator - (float lhs, float2x4 rhs) { return new float2x4 (lhs - rhs.c0, lhs - rhs.c1, lhs - rhs.c2, lhs - rhs.c3); } + + + /// Returns the result of a componentwise division operation on two float2x4 matrices. + /// Left hand side float2x4 to use to compute componentwise division. + /// Right hand side float2x4 to use to compute componentwise division. + /// float2x4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x4 operator / (float2x4 lhs, float2x4 rhs) { return new float2x4 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1, lhs.c2 / rhs.c2, lhs.c3 / rhs.c3); } + + /// Returns the result of a componentwise division operation on a float2x4 matrix and a float value. + /// Left hand side float2x4 to use to compute componentwise division. + /// Right hand side float to use to compute componentwise division. + /// float2x4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x4 operator / (float2x4 lhs, float rhs) { return new float2x4 (lhs.c0 / rhs, lhs.c1 / rhs, lhs.c2 / rhs, lhs.c3 / rhs); } + + /// Returns the result of a componentwise division operation on a float value and a float2x4 matrix. + /// Left hand side float to use to compute componentwise division. + /// Right hand side float2x4 to use to compute componentwise division. + /// float2x4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x4 operator / (float lhs, float2x4 rhs) { return new float2x4 (lhs / rhs.c0, lhs / rhs.c1, lhs / rhs.c2, lhs / rhs.c3); } + + + /// Returns the result of a componentwise modulus operation on two float2x4 matrices. + /// Left hand side float2x4 to use to compute componentwise modulus. + /// Right hand side float2x4 to use to compute componentwise modulus. + /// float2x4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x4 operator % (float2x4 lhs, float2x4 rhs) { return new float2x4 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1, lhs.c2 % rhs.c2, lhs.c3 % rhs.c3); } + + /// Returns the result of a componentwise modulus operation on a float2x4 matrix and a float value. + /// Left hand side float2x4 to use to compute componentwise modulus. + /// Right hand side float to use to compute componentwise modulus. + /// float2x4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x4 operator % (float2x4 lhs, float rhs) { return new float2x4 (lhs.c0 % rhs, lhs.c1 % rhs, lhs.c2 % rhs, lhs.c3 % rhs); } + + /// Returns the result of a componentwise modulus operation on a float value and a float2x4 matrix. + /// Left hand side float to use to compute componentwise modulus. + /// Right hand side float2x4 to use to compute componentwise modulus. + /// float2x4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x4 operator % (float lhs, float2x4 rhs) { return new float2x4 (lhs % rhs.c0, lhs % rhs.c1, lhs % rhs.c2, lhs % rhs.c3); } + + + /// Returns the result of a componentwise increment operation on a float2x4 matrix. + /// Value to use when computing the componentwise increment. + /// float2x4 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x4 operator ++ (float2x4 val) { return new float2x4 (++val.c0, ++val.c1, ++val.c2, ++val.c3); } + + + /// Returns the result of a componentwise decrement operation on a float2x4 matrix. + /// Value to use when computing the componentwise decrement. + /// float2x4 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x4 operator -- (float2x4 val) { return new float2x4 (--val.c0, --val.c1, --val.c2, --val.c3); } + + + /// Returns the result of a componentwise less than operation on two float2x4 matrices. + /// Left hand side float2x4 to use to compute componentwise less than. + /// Right hand side float2x4 to use to compute componentwise less than. + /// bool2x4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator < (float2x4 lhs, float2x4 rhs) { return new bool2x4 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1, lhs.c2 < rhs.c2, lhs.c3 < rhs.c3); } + + /// Returns the result of a componentwise less than operation on a float2x4 matrix and a float value. + /// Left hand side float2x4 to use to compute componentwise less than. + /// Right hand side float to use to compute componentwise less than. + /// bool2x4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator < (float2x4 lhs, float rhs) { return new bool2x4 (lhs.c0 < rhs, lhs.c1 < rhs, lhs.c2 < rhs, lhs.c3 < rhs); } + + /// Returns the result of a componentwise less than operation on a float value and a float2x4 matrix. + /// Left hand side float to use to compute componentwise less than. + /// Right hand side float2x4 to use to compute componentwise less than. + /// bool2x4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator < (float lhs, float2x4 rhs) { return new bool2x4 (lhs < rhs.c0, lhs < rhs.c1, lhs < rhs.c2, lhs < rhs.c3); } + + + /// Returns the result of a componentwise less or equal operation on two float2x4 matrices. + /// Left hand side float2x4 to use to compute componentwise less or equal. + /// Right hand side float2x4 to use to compute componentwise less or equal. + /// bool2x4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator <= (float2x4 lhs, float2x4 rhs) { return new bool2x4 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1, lhs.c2 <= rhs.c2, lhs.c3 <= rhs.c3); } + + /// Returns the result of a componentwise less or equal operation on a float2x4 matrix and a float value. + /// Left hand side float2x4 to use to compute componentwise less or equal. + /// Right hand side float to use to compute componentwise less or equal. + /// bool2x4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator <= (float2x4 lhs, float rhs) { return new bool2x4 (lhs.c0 <= rhs, lhs.c1 <= rhs, lhs.c2 <= rhs, lhs.c3 <= rhs); } + + /// Returns the result of a componentwise less or equal operation on a float value and a float2x4 matrix. + /// Left hand side float to use to compute componentwise less or equal. + /// Right hand side float2x4 to use to compute componentwise less or equal. + /// bool2x4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator <= (float lhs, float2x4 rhs) { return new bool2x4 (lhs <= rhs.c0, lhs <= rhs.c1, lhs <= rhs.c2, lhs <= rhs.c3); } + + + /// Returns the result of a componentwise greater than operation on two float2x4 matrices. + /// Left hand side float2x4 to use to compute componentwise greater than. + /// Right hand side float2x4 to use to compute componentwise greater than. + /// bool2x4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator > (float2x4 lhs, float2x4 rhs) { return new bool2x4 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1, lhs.c2 > rhs.c2, lhs.c3 > rhs.c3); } + + /// Returns the result of a componentwise greater than operation on a float2x4 matrix and a float value. + /// Left hand side float2x4 to use to compute componentwise greater than. + /// Right hand side float to use to compute componentwise greater than. + /// bool2x4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator > (float2x4 lhs, float rhs) { return new bool2x4 (lhs.c0 > rhs, lhs.c1 > rhs, lhs.c2 > rhs, lhs.c3 > rhs); } + + /// Returns the result of a componentwise greater than operation on a float value and a float2x4 matrix. + /// Left hand side float to use to compute componentwise greater than. + /// Right hand side float2x4 to use to compute componentwise greater than. + /// bool2x4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator > (float lhs, float2x4 rhs) { return new bool2x4 (lhs > rhs.c0, lhs > rhs.c1, lhs > rhs.c2, lhs > rhs.c3); } + + + /// Returns the result of a componentwise greater or equal operation on two float2x4 matrices. + /// Left hand side float2x4 to use to compute componentwise greater or equal. + /// Right hand side float2x4 to use to compute componentwise greater or equal. + /// bool2x4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator >= (float2x4 lhs, float2x4 rhs) { return new bool2x4 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1, lhs.c2 >= rhs.c2, lhs.c3 >= rhs.c3); } + + /// Returns the result of a componentwise greater or equal operation on a float2x4 matrix and a float value. + /// Left hand side float2x4 to use to compute componentwise greater or equal. + /// Right hand side float to use to compute componentwise greater or equal. + /// bool2x4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator >= (float2x4 lhs, float rhs) { return new bool2x4 (lhs.c0 >= rhs, lhs.c1 >= rhs, lhs.c2 >= rhs, lhs.c3 >= rhs); } + + /// Returns the result of a componentwise greater or equal operation on a float value and a float2x4 matrix. + /// Left hand side float to use to compute componentwise greater or equal. + /// Right hand side float2x4 to use to compute componentwise greater or equal. + /// bool2x4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator >= (float lhs, float2x4 rhs) { return new bool2x4 (lhs >= rhs.c0, lhs >= rhs.c1, lhs >= rhs.c2, lhs >= rhs.c3); } + + + /// Returns the result of a componentwise unary minus operation on a float2x4 matrix. + /// Value to use when computing the componentwise unary minus. + /// float2x4 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x4 operator - (float2x4 val) { return new float2x4 (-val.c0, -val.c1, -val.c2, -val.c3); } + + + /// Returns the result of a componentwise unary plus operation on a float2x4 matrix. + /// Value to use when computing the componentwise unary plus. + /// float2x4 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x4 operator + (float2x4 val) { return new float2x4 (+val.c0, +val.c1, +val.c2, +val.c3); } + + + /// Returns the result of a componentwise equality operation on two float2x4 matrices. + /// Left hand side float2x4 to use to compute componentwise equality. + /// Right hand side float2x4 to use to compute componentwise equality. + /// bool2x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator == (float2x4 lhs, float2x4 rhs) { return new bool2x4 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2, lhs.c3 == rhs.c3); } + + /// Returns the result of a componentwise equality operation on a float2x4 matrix and a float value. + /// Left hand side float2x4 to use to compute componentwise equality. + /// Right hand side float to use to compute componentwise equality. + /// bool2x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator == (float2x4 lhs, float rhs) { return new bool2x4 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs, lhs.c3 == rhs); } + + /// Returns the result of a componentwise equality operation on a float value and a float2x4 matrix. + /// Left hand side float to use to compute componentwise equality. + /// Right hand side float2x4 to use to compute componentwise equality. + /// bool2x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator == (float lhs, float2x4 rhs) { return new bool2x4 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2, lhs == rhs.c3); } + + + /// Returns the result of a componentwise not equal operation on two float2x4 matrices. + /// Left hand side float2x4 to use to compute componentwise not equal. + /// Right hand side float2x4 to use to compute componentwise not equal. + /// bool2x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator != (float2x4 lhs, float2x4 rhs) { return new bool2x4 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2, lhs.c3 != rhs.c3); } + + /// Returns the result of a componentwise not equal operation on a float2x4 matrix and a float value. + /// Left hand side float2x4 to use to compute componentwise not equal. + /// Right hand side float to use to compute componentwise not equal. + /// bool2x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator != (float2x4 lhs, float rhs) { return new bool2x4 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs, lhs.c3 != rhs); } + + /// Returns the result of a componentwise not equal operation on a float value and a float2x4 matrix. + /// Left hand side float to use to compute componentwise not equal. + /// Right hand side float2x4 to use to compute componentwise not equal. + /// bool2x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator != (float lhs, float2x4 rhs) { return new bool2x4 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2, lhs != rhs.c3); } + + + + /// Returns the float2 element at a specified index. + unsafe public ref float2 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 4) + throw new System.ArgumentException("index must be between[0...3]"); +#endif + fixed (float2x4* array = &this) { return ref ((float2*)array)[index]; } + } + } + + /// Returns true if the float2x4 is equal to a given float2x4, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(float2x4 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2) && c3.Equals(rhs.c3); } + + /// Returns true if the float2x4 is equal to a given float2x4, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is float2x4 converted && Equals(converted); } + + + /// Returns a hash code for the float2x4. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the float2x4. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("float2x4({0}f, {1}f, {2}f, {3}f, {4}f, {5}f, {6}f, {7}f)", c0.x, c1.x, c2.x, c3.x, c0.y, c1.y, c2.y, c3.y); + } + + /// Returns a string representation of the float2x4 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("float2x4({0}f, {1}f, {2}f, {3}f, {4}f, {5}f, {6}f, {7}f)", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c2.x.ToString(format, formatProvider), c3.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c2.y.ToString(format, formatProvider), c3.y.ToString(format, formatProvider)); + } + + } + + public static partial class math + { + /// Returns a float2x4 matrix constructed from four float2 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// The matrix column c3 will be set to this value. + /// float2x4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x4 float2x4(float2 c0, float2 c1, float2 c2, float2 c3) { return new float2x4(c0, c1, c2, c3); } + + /// Returns a float2x4 matrix constructed from from 8 float values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 0, column 3 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 1, column 3 will be set to this value. + /// float2x4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x4 float2x4(float m00, float m01, float m02, float m03, + float m10, float m11, float m12, float m13) + { + return new float2x4(m00, m01, m02, m03, + m10, m11, m12, m13); + } + + /// Returns a float2x4 matrix constructed from a single float value by assigning it to every component. + /// float to convert to float2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x4 float2x4(float v) { return new float2x4(v); } + + /// Returns a float2x4 matrix constructed from a single bool value by converting it to float and assigning it to every component. + /// bool to convert to float2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x4 float2x4(bool v) { return new float2x4(v); } + + /// Return a float2x4 matrix constructed from a bool2x4 matrix by componentwise conversion. + /// bool2x4 to convert to float2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x4 float2x4(bool2x4 v) { return new float2x4(v); } + + /// Returns a float2x4 matrix constructed from a single int value by converting it to float and assigning it to every component. + /// int to convert to float2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x4 float2x4(int v) { return new float2x4(v); } + + /// Return a float2x4 matrix constructed from a int2x4 matrix by componentwise conversion. + /// int2x4 to convert to float2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x4 float2x4(int2x4 v) { return new float2x4(v); } + + /// Returns a float2x4 matrix constructed from a single uint value by converting it to float and assigning it to every component. + /// uint to convert to float2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x4 float2x4(uint v) { return new float2x4(v); } + + /// Return a float2x4 matrix constructed from a uint2x4 matrix by componentwise conversion. + /// uint2x4 to convert to float2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x4 float2x4(uint2x4 v) { return new float2x4(v); } + + /// Returns a float2x4 matrix constructed from a single double value by converting it to float and assigning it to every component. + /// double to convert to float2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x4 float2x4(double v) { return new float2x4(v); } + + /// Return a float2x4 matrix constructed from a double2x4 matrix by componentwise conversion. + /// double2x4 to convert to float2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x4 float2x4(double2x4 v) { return new float2x4(v); } + + /// Return the float4x2 transpose of a float2x4 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x2 transpose(float2x4 v) + { + return float4x2( + v.c0.x, v.c0.y, + v.c1.x, v.c1.y, + v.c2.x, v.c2.y, + v.c3.x, v.c3.y); + } + + /// Returns a uint hash code of a float2x4 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(float2x4 v) + { + return csum(asuint(v.c0) * uint2(0xD35C9B2Du, 0xA10D9E27u) + + asuint(v.c1) * uint2(0x568DAAA9u, 0x7530254Fu) + + asuint(v.c2) * uint2(0x9F090439u, 0x5E9F85C9u) + + asuint(v.c3) * uint2(0x8C4CA03Fu, 0xB8D969EDu)) + 0xAC5DB57Bu; + } + + /// + /// Returns a uint2 vector hash code of a float2x4 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint2 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 hashwide(float2x4 v) + { + return (asuint(v.c0) * uint2(0xA91A02EDu, 0xB3C49313u) + + asuint(v.c1) * uint2(0xF43A9ABBu, 0x84E7E01Bu) + + asuint(v.c2) * uint2(0x8E055BE5u, 0x6E624EB7u) + + asuint(v.c3) * uint2(0x7383ED49u, 0xDD49C23Bu)) + 0xEBD0D005u; + } + + } +} diff --git a/src/Unity.Mathematics/float2x4.gen.cs.meta b/src/Unity.Mathematics/float2x4.gen.cs.meta new file mode 100644 index 00000000..4579c691 --- /dev/null +++ b/src/Unity.Mathematics/float2x4.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 70c2d51ac2a824bdb88b239c4fa6122c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/float3.cs b/src/Unity.Mathematics/float3.cs deleted file mode 100644 index 75147e1b..00000000 --- a/src/Unity.Mathematics/float3.cs +++ /dev/null @@ -1,85 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using System.Diagnostics; - -#pragma warning disable 0660, 0661 -namespace Unity.Mathematics -{ - [DebuggerTypeProxy(typeof(float3.DebuggerProxy))] - [System.Serializable] - public partial struct float3 : IFormattable - { - internal sealed class DebuggerProxy - { - public float x; - public float y; - public float z; - - public DebuggerProxy(float3 vec) - { - x = vec.x; - y = vec.y; - z = vec.z; - } - } - - public float x; - public float y; - public float z; - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public float3(float x, float y, float z) - { - this.x = x; - this.y = y; - this.z = z; - } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public float3(float val) { x = y = z = val; } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public float3(float2 xy, float z) - { - this.x = xy.x; - this.y = xy.y; - this.z = z; - } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public float3(float x, float2 yz) - { - this.x = x; - this.y = yz.x; - this.z = yz.y; - } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public float3(int val) { x = y = z = val; } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public float3(int3 val) - { - x = val.x; - y = val.y; - z = val.z; - } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static implicit operator float3(float d) { return new float3(d); } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static implicit operator float3(int3 d) { return new float3(d.x, d.y, d.z); } - - public override string ToString() - { - return string.Format("float3({0}f, {1}f, {2}f)", x, y, z); - } - - public string ToString(string format, IFormatProvider formatProvider) - { - return string.Format("float3({0}f, {1}f, {2}f)", x.ToString(format, formatProvider), y.ToString(format, formatProvider), z.ToString(format, formatProvider)); - } - } -} - diff --git a/src/Unity.Mathematics/float3.cs.meta b/src/Unity.Mathematics/float3.cs.meta deleted file mode 100644 index aba078bb..00000000 --- a/src/Unity.Mathematics/float3.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 886c8392061f7d442b868f342d937640 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/src/Unity.Mathematics/float3.gen.cs b/src/Unity.Mathematics/float3.gen.cs index 3a65999f..178cf4eb 100644 --- a/src/Unity.Mathematics/float3.gen.cs +++ b/src/Unity.Mathematics/float3.gen.cs @@ -1,1076 +1,1878 @@ -// GENERATED CODE +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; using System.Runtime.CompilerServices; +using System.Diagnostics; +using Unity.IL2CPP.CompilerServices; + #pragma warning disable 0660, 0661 + namespace Unity.Mathematics { - public partial struct float3 : System.IEquatable + /// A 3 component vector of floats. + [DebuggerTypeProxy(typeof(float3.DebuggerProxy))] + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct float3 : System.IEquatable, IFormattable { + /// x component of the vector. + public float x; + /// y component of the vector. + public float y; + /// z component of the vector. + public float z; + + /// float3 zero value. + public static readonly float3 zero; + + /// Constructs a float3 vector from three float values. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + /// The constructed vector's z component will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3(float x, float y, float z) + { + this.x = x; + this.y = y; + this.z = z; + } + + /// Constructs a float3 vector from a float value and a float2 vector. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's yz components will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3(float x, float2 yz) + { + this.x = x; + this.y = yz.x; + this.z = yz.y; + } + + /// Constructs a float3 vector from a float2 vector and a float value. + /// The constructed vector's xy components will be set to this value. + /// The constructed vector's z component will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3(float2 xy, float z) + { + this.x = xy.x; + this.y = xy.y; + this.z = z; + } + + /// Constructs a float3 vector from a float3 vector. + /// The constructed vector's xyz components will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3(float3 xyz) + { + this.x = xyz.x; + this.y = xyz.y; + this.z = xyz.z; + } + + /// Constructs a float3 vector from a single float value by assigning it to every component. + /// float to convert to float3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3(float v) + { + this.x = v; + this.y = v; + this.z = v; + } + + /// Constructs a float3 vector from a single bool value by converting it to float and assigning it to every component. + /// bool to convert to float3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3(bool v) + { + this.x = v ? 1.0f : 0.0f; + this.y = v ? 1.0f : 0.0f; + this.z = v ? 1.0f : 0.0f; + } + + /// Constructs a float3 vector from a bool3 vector by componentwise conversion. + /// bool3 to convert to float3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3(bool3 v) + { + this.x = v.x ? 1.0f : 0.0f; + this.y = v.y ? 1.0f : 0.0f; + this.z = v.z ? 1.0f : 0.0f; + } + + /// Constructs a float3 vector from a single int value by converting it to float and assigning it to every component. + /// int to convert to float3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3(int v) + { + this.x = v; + this.y = v; + this.z = v; + } + + /// Constructs a float3 vector from a int3 vector by componentwise conversion. + /// int3 to convert to float3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3(int3 v) + { + this.x = v.x; + this.y = v.y; + this.z = v.z; + } - // mul - [MethodImpl(0x100)] + /// Constructs a float3 vector from a single uint value by converting it to float and assigning it to every component. + /// uint to convert to float3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3(uint v) + { + this.x = v; + this.y = v; + this.z = v; + } + + /// Constructs a float3 vector from a uint3 vector by componentwise conversion. + /// uint3 to convert to float3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3(uint3 v) + { + this.x = v.x; + this.y = v.y; + this.z = v.z; + } + + /// Constructs a float3 vector from a single half value by converting it to float and assigning it to every component. + /// half to convert to float3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3(half v) + { + this.x = v; + this.y = v; + this.z = v; + } + + /// Constructs a float3 vector from a half3 vector by componentwise conversion. + /// half3 to convert to float3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3(half3 v) + { + this.x = v.x; + this.y = v.y; + this.z = v.z; + } + + /// Constructs a float3 vector from a single double value by converting it to float and assigning it to every component. + /// double to convert to float3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3(double v) + { + this.x = (float)v; + this.y = (float)v; + this.z = (float)v; + } + + /// Constructs a float3 vector from a double3 vector by componentwise conversion. + /// double3 to convert to float3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3(double3 v) + { + this.x = (float)v.x; + this.y = (float)v.y; + this.z = (float)v.z; + } + + + /// Implicitly converts a single float value to a float3 vector by assigning it to every component. + /// float to convert to float3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float3(float v) { return new float3(v); } + + /// Explicitly converts a single bool value to a float3 vector by converting it to float and assigning it to every component. + /// bool to convert to float3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float3(bool v) { return new float3(v); } + + /// Explicitly converts a bool3 vector to a float3 vector by componentwise conversion. + /// bool3 to convert to float3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float3(bool3 v) { return new float3(v); } + + /// Implicitly converts a single int value to a float3 vector by converting it to float and assigning it to every component. + /// int to convert to float3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float3(int v) { return new float3(v); } + + /// Implicitly converts a int3 vector to a float3 vector by componentwise conversion. + /// int3 to convert to float3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float3(int3 v) { return new float3(v); } + + /// Implicitly converts a single uint value to a float3 vector by converting it to float and assigning it to every component. + /// uint to convert to float3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float3(uint v) { return new float3(v); } + + /// Implicitly converts a uint3 vector to a float3 vector by componentwise conversion. + /// uint3 to convert to float3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float3(uint3 v) { return new float3(v); } + + /// Implicitly converts a single half value to a float3 vector by converting it to float and assigning it to every component. + /// half to convert to float3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float3(half v) { return new float3(v); } + + /// Implicitly converts a half3 vector to a float3 vector by componentwise conversion. + /// half3 to convert to float3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float3(half3 v) { return new float3(v); } + + /// Explicitly converts a single double value to a float3 vector by converting it to float and assigning it to every component. + /// double to convert to float3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float3(double v) { return new float3(v); } + + /// Explicitly converts a double3 vector to a float3 vector by componentwise conversion. + /// double3 to convert to float3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float3(double3 v) { return new float3(v); } + + + /// Returns the result of a componentwise multiplication operation on two float3 vectors. + /// Left hand side float3 to use to compute componentwise multiplication. + /// Right hand side float3 to use to compute componentwise multiplication. + /// float3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float3 operator * (float3 lhs, float3 rhs) { return new float3 (lhs.x * rhs.x, lhs.y * rhs.y, lhs.z * rhs.z); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise multiplication operation on a float3 vector and a float value. + /// Left hand side float3 to use to compute componentwise multiplication. + /// Right hand side float to use to compute componentwise multiplication. + /// float3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float3 operator * (float3 lhs, float rhs) { return new float3 (lhs.x * rhs, lhs.y * rhs, lhs.z * rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise multiplication operation on a float value and a float3 vector. + /// Left hand side float to use to compute componentwise multiplication. + /// Right hand side float3 to use to compute componentwise multiplication. + /// float3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float3 operator * (float lhs, float3 rhs) { return new float3 (lhs * rhs.x, lhs * rhs.y, lhs * rhs.z); } - // add - [MethodImpl(0x100)] + + /// Returns the result of a componentwise addition operation on two float3 vectors. + /// Left hand side float3 to use to compute componentwise addition. + /// Right hand side float3 to use to compute componentwise addition. + /// float3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float3 operator + (float3 lhs, float3 rhs) { return new float3 (lhs.x + rhs.x, lhs.y + rhs.y, lhs.z + rhs.z); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise addition operation on a float3 vector and a float value. + /// Left hand side float3 to use to compute componentwise addition. + /// Right hand side float to use to compute componentwise addition. + /// float3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float3 operator + (float3 lhs, float rhs) { return new float3 (lhs.x + rhs, lhs.y + rhs, lhs.z + rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise addition operation on a float value and a float3 vector. + /// Left hand side float to use to compute componentwise addition. + /// Right hand side float3 to use to compute componentwise addition. + /// float3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float3 operator + (float lhs, float3 rhs) { return new float3 (lhs + rhs.x, lhs + rhs.y, lhs + rhs.z); } - // sub - [MethodImpl(0x100)] + + /// Returns the result of a componentwise subtraction operation on two float3 vectors. + /// Left hand side float3 to use to compute componentwise subtraction. + /// Right hand side float3 to use to compute componentwise subtraction. + /// float3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float3 operator - (float3 lhs, float3 rhs) { return new float3 (lhs.x - rhs.x, lhs.y - rhs.y, lhs.z - rhs.z); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise subtraction operation on a float3 vector and a float value. + /// Left hand side float3 to use to compute componentwise subtraction. + /// Right hand side float to use to compute componentwise subtraction. + /// float3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float3 operator - (float3 lhs, float rhs) { return new float3 (lhs.x - rhs, lhs.y - rhs, lhs.z - rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise subtraction operation on a float value and a float3 vector. + /// Left hand side float to use to compute componentwise subtraction. + /// Right hand side float3 to use to compute componentwise subtraction. + /// float3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float3 operator - (float lhs, float3 rhs) { return new float3 (lhs - rhs.x, lhs - rhs.y, lhs - rhs.z); } - // div - [MethodImpl(0x100)] + + /// Returns the result of a componentwise division operation on two float3 vectors. + /// Left hand side float3 to use to compute componentwise division. + /// Right hand side float3 to use to compute componentwise division. + /// float3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float3 operator / (float3 lhs, float3 rhs) { return new float3 (lhs.x / rhs.x, lhs.y / rhs.y, lhs.z / rhs.z); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise division operation on a float3 vector and a float value. + /// Left hand side float3 to use to compute componentwise division. + /// Right hand side float to use to compute componentwise division. + /// float3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float3 operator / (float3 lhs, float rhs) { return new float3 (lhs.x / rhs, lhs.y / rhs, lhs.z / rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise division operation on a float value and a float3 vector. + /// Left hand side float to use to compute componentwise division. + /// Right hand side float3 to use to compute componentwise division. + /// float3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float3 operator / (float lhs, float3 rhs) { return new float3 (lhs / rhs.x, lhs / rhs.y, lhs / rhs.z); } - // smaller - [MethodImpl(0x100)] + + /// Returns the result of a componentwise modulus operation on two float3 vectors. + /// Left hand side float3 to use to compute componentwise modulus. + /// Right hand side float3 to use to compute componentwise modulus. + /// float3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 operator % (float3 lhs, float3 rhs) { return new float3 (lhs.x % rhs.x, lhs.y % rhs.y, lhs.z % rhs.z); } + + /// Returns the result of a componentwise modulus operation on a float3 vector and a float value. + /// Left hand side float3 to use to compute componentwise modulus. + /// Right hand side float to use to compute componentwise modulus. + /// float3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 operator % (float3 lhs, float rhs) { return new float3 (lhs.x % rhs, lhs.y % rhs, lhs.z % rhs); } + + /// Returns the result of a componentwise modulus operation on a float value and a float3 vector. + /// Left hand side float to use to compute componentwise modulus. + /// Right hand side float3 to use to compute componentwise modulus. + /// float3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 operator % (float lhs, float3 rhs) { return new float3 (lhs % rhs.x, lhs % rhs.y, lhs % rhs.z); } + + + /// Returns the result of a componentwise increment operation on a float3 vector. + /// Value to use when computing the componentwise increment. + /// float3 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 operator ++ (float3 val) { return new float3 (++val.x, ++val.y, ++val.z); } + + + /// Returns the result of a componentwise decrement operation on a float3 vector. + /// Value to use when computing the componentwise decrement. + /// float3 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 operator -- (float3 val) { return new float3 (--val.x, --val.y, --val.z); } + + + /// Returns the result of a componentwise less than operation on two float3 vectors. + /// Left hand side float3 to use to compute componentwise less than. + /// Right hand side float3 to use to compute componentwise less than. + /// bool3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator < (float3 lhs, float3 rhs) { return new bool3 (lhs.x < rhs.x, lhs.y < rhs.y, lhs.z < rhs.z); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise less than operation on a float3 vector and a float value. + /// Left hand side float3 to use to compute componentwise less than. + /// Right hand side float to use to compute componentwise less than. + /// bool3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator < (float3 lhs, float rhs) { return new bool3 (lhs.x < rhs, lhs.y < rhs, lhs.z < rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise less than operation on a float value and a float3 vector. + /// Left hand side float to use to compute componentwise less than. + /// Right hand side float3 to use to compute componentwise less than. + /// bool3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator < (float lhs, float3 rhs) { return new bool3 (lhs < rhs.x, lhs < rhs.y, lhs < rhs.z); } - [MethodImpl(0x100)] + + + /// Returns the result of a componentwise less or equal operation on two float3 vectors. + /// Left hand side float3 to use to compute componentwise less or equal. + /// Right hand side float3 to use to compute componentwise less or equal. + /// bool3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator <= (float3 lhs, float3 rhs) { return new bool3 (lhs.x <= rhs.x, lhs.y <= rhs.y, lhs.z <= rhs.z); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise less or equal operation on a float3 vector and a float value. + /// Left hand side float3 to use to compute componentwise less or equal. + /// Right hand side float to use to compute componentwise less or equal. + /// bool3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator <= (float3 lhs, float rhs) { return new bool3 (lhs.x <= rhs, lhs.y <= rhs, lhs.z <= rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise less or equal operation on a float value and a float3 vector. + /// Left hand side float to use to compute componentwise less or equal. + /// Right hand side float3 to use to compute componentwise less or equal. + /// bool3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator <= (float lhs, float3 rhs) { return new bool3 (lhs <= rhs.x, lhs <= rhs.y, lhs <= rhs.z); } - // greater - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater than operation on two float3 vectors. + /// Left hand side float3 to use to compute componentwise greater than. + /// Right hand side float3 to use to compute componentwise greater than. + /// bool3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator > (float3 lhs, float3 rhs) { return new bool3 (lhs.x > rhs.x, lhs.y > rhs.y, lhs.z > rhs.z); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater than operation on a float3 vector and a float value. + /// Left hand side float3 to use to compute componentwise greater than. + /// Right hand side float to use to compute componentwise greater than. + /// bool3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator > (float3 lhs, float rhs) { return new bool3 (lhs.x > rhs, lhs.y > rhs, lhs.z > rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater than operation on a float value and a float3 vector. + /// Left hand side float to use to compute componentwise greater than. + /// Right hand side float3 to use to compute componentwise greater than. + /// bool3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator > (float lhs, float3 rhs) { return new bool3 (lhs > rhs.x, lhs > rhs.y, lhs > rhs.z); } - [MethodImpl(0x100)] + + + /// Returns the result of a componentwise greater or equal operation on two float3 vectors. + /// Left hand side float3 to use to compute componentwise greater or equal. + /// Right hand side float3 to use to compute componentwise greater or equal. + /// bool3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator >= (float3 lhs, float3 rhs) { return new bool3 (lhs.x >= rhs.x, lhs.y >= rhs.y, lhs.z >= rhs.z); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater or equal operation on a float3 vector and a float value. + /// Left hand side float3 to use to compute componentwise greater or equal. + /// Right hand side float to use to compute componentwise greater or equal. + /// bool3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator >= (float3 lhs, float rhs) { return new bool3 (lhs.x >= rhs, lhs.y >= rhs, lhs.z >= rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater or equal operation on a float value and a float3 vector. + /// Left hand side float to use to compute componentwise greater or equal. + /// Right hand side float3 to use to compute componentwise greater or equal. + /// bool3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator >= (float lhs, float3 rhs) { return new bool3 (lhs >= rhs.x, lhs >= rhs.y, lhs >= rhs.z); } - // neg - [MethodImpl(0x100)] + + /// Returns the result of a componentwise unary minus operation on a float3 vector. + /// Value to use when computing the componentwise unary minus. + /// float3 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float3 operator - (float3 val) { return new float3 (-val.x, -val.y, -val.z); } - // plus - [MethodImpl(0x100)] + + + /// Returns the result of a componentwise unary plus operation on a float3 vector. + /// Value to use when computing the componentwise unary plus. + /// float3 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float3 operator + (float3 val) { return new float3 (+val.x, +val.y, +val.z); } - // equal - [MethodImpl(0x100)] + + + /// Returns the result of a componentwise equality operation on two float3 vectors. + /// Left hand side float3 to use to compute componentwise equality. + /// Right hand side float3 to use to compute componentwise equality. + /// bool3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator == (float3 lhs, float3 rhs) { return new bool3 (lhs.x == rhs.x, lhs.y == rhs.y, lhs.z == rhs.z); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise equality operation on a float3 vector and a float value. + /// Left hand side float3 to use to compute componentwise equality. + /// Right hand side float to use to compute componentwise equality. + /// bool3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator == (float3 lhs, float rhs) { return new bool3 (lhs.x == rhs, lhs.y == rhs, lhs.z == rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise equality operation on a float value and a float3 vector. + /// Left hand side float to use to compute componentwise equality. + /// Right hand side float3 to use to compute componentwise equality. + /// bool3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator == (float lhs, float3 rhs) { return new bool3 (lhs == rhs.x, lhs == rhs.y, lhs == rhs.z); } - // not equal - [MethodImpl(0x100)] + + /// Returns the result of a componentwise not equal operation on two float3 vectors. + /// Left hand side float3 to use to compute componentwise not equal. + /// Right hand side float3 to use to compute componentwise not equal. + /// bool3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator != (float3 lhs, float3 rhs) { return new bool3 (lhs.x != rhs.x, lhs.y != rhs.y, lhs.z != rhs.z); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise not equal operation on a float3 vector and a float value. + /// Left hand side float3 to use to compute componentwise not equal. + /// Right hand side float to use to compute componentwise not equal. + /// bool3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator != (float3 lhs, float rhs) { return new bool3 (lhs.x != rhs, lhs.y != rhs, lhs.z != rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise not equal operation on a float value and a float3 vector. + /// Left hand side float to use to compute componentwise not equal. + /// Right hand side float3 to use to compute componentwise not equal. + /// bool3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator != (float lhs, float3 rhs) { return new bool3 (lhs != rhs.x, lhs != rhs.y, lhs != rhs.z); } - // Equals - [MethodImpl(0x100)] - public bool Equals(float3 rhs) { return x == rhs.x && y == rhs.y && z == rhs.z; } - // [int index] - unsafe public float this[int index] - { - get - { -#if ENABLE_UNITY_COLLECTIONS_CHECKS - if ((uint)index >= 3) - throw new System.ArgumentException("index must be between[0...2]"); -#endif - fixed (float3* array = &this) { return ((float*)array) [index]; } - } - set - { -#if ENABLE_UNITY_COLLECTIONS_CHECKS - if ((uint)index >= 3) - throw new System.ArgumentException("index must be between[0...2]"); -#endif - fixed (float3* array = &this) { ((float*)array)[index] = value; } - } - } + + + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xxxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xxxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xxxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, x, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xxyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xxyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xxyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, x, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xxzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, x, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xxzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, x, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xxzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, x, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xyxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xyxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xyxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, y, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xyyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xyyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xyyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, y, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xyzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, y, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xyzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, y, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xyzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, y, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xzxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, z, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xzxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, z, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xzxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, z, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xzyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, z, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xzyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, z, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xzyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, z, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xzzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, z, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xzzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, z, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xzzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, z, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yxxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yxxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yxxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, x, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yxyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yxyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yxyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, x, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yxzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, x, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yxzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, x, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yxzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, x, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yyxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yyxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yyxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, y, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yyyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yyyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yyyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, y, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yyzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, y, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yyzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, y, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yyzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, y, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yzxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, z, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yzxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, z, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yzxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, z, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yzyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, z, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yzyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, z, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yzyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, z, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yzzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, z, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yzzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, z, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yzzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, z, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zxxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zxxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zxxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, x, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zxyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zxyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zxyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, x, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zxzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, x, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zxzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, x, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zxzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, x, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zyxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zyxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zyxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, y, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zyyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zyyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zyyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, y, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zyzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, y, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zyzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, y, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zyzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, y, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zzxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, z, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zzxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, z, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zzxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, z, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zzyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, z, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zzyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, z, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zzyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, z, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zzzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, z, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zzzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, z, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zzzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, z, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 xxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 xxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 xxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(x, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 xyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 xyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 xyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(x, y, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; y = value.y; z = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 xzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(x, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 xzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(x, z, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; z = value.y; y = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 xzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(x, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 yxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 yxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 yxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(y, x, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; x = value.y; z = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 yyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 yyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 yyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(y, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 yzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(y, z, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; z = value.y; x = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 yzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(y, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 yzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(y, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 zxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(z, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 zxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(z, x, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; x = value.y; y = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 zxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(z, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 zyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(z, y, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; y = value.y; x = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 zyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(z, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 zyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(z, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 zzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(z, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 zzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(z, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 zzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(z, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float2 xx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float2(x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float2 xy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float2(x, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; y = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float2 xz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float2(x, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; z = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float2 yx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float2(y, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; x = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float2 yy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float2(y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float2 yz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float2(y, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; z = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float2 zx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float2(z, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; x = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float2 zy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float2(z, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; y = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float2 zz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float2(z, z); } } + + /// Returns the float element at a specified index. + unsafe public float this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 3) + throw new System.ArgumentException("index must be between[0...2]"); +#endif + fixed (float3* array = &this) { return ((float*)array)[index]; } + } + set + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 3) + throw new System.ArgumentException("index must be between[0...2]"); +#endif + fixed (float* array = &x) { array[index] = value; } + } + } + + /// Returns true if the float3 is equal to a given float3, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(float3 rhs) { return x == rhs.x && y == rhs.y && z == rhs.z; } + + /// Returns true if the float3 is equal to a given float3, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is float3 converted && Equals(converted); } + + + /// Returns a hash code for the float3. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the float3. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("float3({0}f, {1}f, {2}f)", x, y, z); + } + + /// Returns a string representation of the float3 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("float3({0}f, {1}f, {2}f)", x.ToString(format, formatProvider), y.ToString(format, formatProvider), z.ToString(format, formatProvider)); + } + + internal sealed class DebuggerProxy + { + public float x; + public float y; + public float z; + public DebuggerProxy(float3 v) + { + x = v.x; + y = v.y; + z = v.z; + } + } + + } + + public static partial class math + { + /// Returns a float3 vector constructed from three float values. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + /// The constructed vector's z component will be set to this value. + /// float3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 float3(float x, float y, float z) { return new float3(x, y, z); } + + /// Returns a float3 vector constructed from a float value and a float2 vector. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's yz components will be set to this value. + /// float3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 float3(float x, float2 yz) { return new float3(x, yz); } + + /// Returns a float3 vector constructed from a float2 vector and a float value. + /// The constructed vector's xy components will be set to this value. + /// The constructed vector's z component will be set to this value. + /// float3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 float3(float2 xy, float z) { return new float3(xy, z); } + + /// Returns a float3 vector constructed from a float3 vector. + /// The constructed vector's xyz components will be set to this value. + /// float3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 float3(float3 xyz) { return new float3(xyz); } + + /// Returns a float3 vector constructed from a single float value by assigning it to every component. + /// float to convert to float3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 float3(float v) { return new float3(v); } + + /// Returns a float3 vector constructed from a single bool value by converting it to float and assigning it to every component. + /// bool to convert to float3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 float3(bool v) { return new float3(v); } + + /// Return a float3 vector constructed from a bool3 vector by componentwise conversion. + /// bool3 to convert to float3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 float3(bool3 v) { return new float3(v); } + + /// Returns a float3 vector constructed from a single int value by converting it to float and assigning it to every component. + /// int to convert to float3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 float3(int v) { return new float3(v); } + + /// Return a float3 vector constructed from a int3 vector by componentwise conversion. + /// int3 to convert to float3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 float3(int3 v) { return new float3(v); } + + /// Returns a float3 vector constructed from a single uint value by converting it to float and assigning it to every component. + /// uint to convert to float3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 float3(uint v) { return new float3(v); } + + /// Return a float3 vector constructed from a uint3 vector by componentwise conversion. + /// uint3 to convert to float3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 float3(uint3 v) { return new float3(v); } + + /// Returns a float3 vector constructed from a single half value by converting it to float and assigning it to every component. + /// half to convert to float3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 float3(half v) { return new float3(v); } + + /// Return a float3 vector constructed from a half3 vector by componentwise conversion. + /// half3 to convert to float3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 float3(half3 v) { return new float3(v); } + + /// Returns a float3 vector constructed from a single double value by converting it to float and assigning it to every component. + /// double to convert to float3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 float3(double v) { return new float3(v); } + + /// Return a float3 vector constructed from a double3 vector by componentwise conversion. + /// double3 to convert to float3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 float3(double3 v) { return new float3(v); } + + /// Returns a uint hash code of a float3 vector. + /// Vector value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(float3 v) + { + return csum(asuint(v) * uint3(0x9B13B92Du, 0x4ABF0813u, 0x86068063u)) + 0xD75513F9u; + } + + /// + /// Returns a uint3 vector hash code of a float3 vector. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Vector value to hash. + /// uint3 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 hashwide(float3 v) + { + return (asuint(v) * uint3(0x5AB3E8CDu, 0x676E8407u, 0xB36DE767u)) + 0x6FCA387Du; + } + + /// Returns the result of specified shuffling of the components from two float3 vectors into a float value. + /// float3 to use as the left argument of the shuffle operation. + /// float3 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting float. + /// float result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float shuffle(float3 left, float3 right, ShuffleComponent x) + { + return select_shuffle_component(left, right, x); + } + + /// Returns the result of specified shuffling of the components from two float3 vectors into a float2 vector. + /// float3 to use as the left argument of the shuffle operation. + /// float3 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting float2 x component. + /// The ShuffleComponent to use when setting the resulting float2 y component. + /// float2 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 shuffle(float3 left, float3 right, ShuffleComponent x, ShuffleComponent y) + { + return float2( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y)); + } + + /// Returns the result of specified shuffling of the components from two float3 vectors into a float3 vector. + /// float3 to use as the left argument of the shuffle operation. + /// float3 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting float3 x component. + /// The ShuffleComponent to use when setting the resulting float3 y component. + /// The ShuffleComponent to use when setting the resulting float3 z component. + /// float3 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 shuffle(float3 left, float3 right, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z) + { + return float3( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y), + select_shuffle_component(left, right, z)); + } + + /// Returns the result of specified shuffling of the components from two float3 vectors into a float4 vector. + /// float3 to use as the left argument of the shuffle operation. + /// float3 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting float4 x component. + /// The ShuffleComponent to use when setting the resulting float4 y component. + /// The ShuffleComponent to use when setting the resulting float4 z component. + /// The ShuffleComponent to use when setting the resulting float4 w component. + /// float4 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 shuffle(float3 left, float3 right, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z, ShuffleComponent w) + { + return float4( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y), + select_shuffle_component(left, right, z), + select_shuffle_component(left, right, w)); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static float select_shuffle_component(float3 a, float3 b, ShuffleComponent component) + { + switch(component) + { + case ShuffleComponent.LeftX: + return a.x; + case ShuffleComponent.LeftY: + return a.y; + case ShuffleComponent.LeftZ: + return a.z; + case ShuffleComponent.RightX: + return b.x; + case ShuffleComponent.RightY: + return b.y; + case ShuffleComponent.RightZ: + return b.z; + default: + throw new System.ArgumentException("Invalid shuffle component: " + component); + } + } + } } diff --git a/src/Unity.Mathematics/float3x2.gen.cs b/src/Unity.Mathematics/float3x2.gen.cs new file mode 100644 index 00000000..e4a95dba --- /dev/null +++ b/src/Unity.Mathematics/float3x2.gen.cs @@ -0,0 +1,632 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 3x2 matrix of floats. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct float3x2 : System.IEquatable, IFormattable + { + /// Column 0 of the matrix. + public float3 c0; + /// Column 1 of the matrix. + public float3 c1; + + /// float3x2 zero value. + public static readonly float3x2 zero; + + /// Constructs a float3x2 matrix from two float3 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3x2(float3 c0, float3 c1) + { + this.c0 = c0; + this.c1 = c1; + } + + /// Constructs a float3x2 matrix from 6 float values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3x2(float m00, float m01, + float m10, float m11, + float m20, float m21) + { + this.c0 = new float3(m00, m10, m20); + this.c1 = new float3(m01, m11, m21); + } + + /// Constructs a float3x2 matrix from a single float value by assigning it to every component. + /// float to convert to float3x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3x2(float v) + { + this.c0 = v; + this.c1 = v; + } + + /// Constructs a float3x2 matrix from a single bool value by converting it to float and assigning it to every component. + /// bool to convert to float3x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3x2(bool v) + { + this.c0 = math.select(new float3(0.0f), new float3(1.0f), v); + this.c1 = math.select(new float3(0.0f), new float3(1.0f), v); + } + + /// Constructs a float3x2 matrix from a bool3x2 matrix by componentwise conversion. + /// bool3x2 to convert to float3x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3x2(bool3x2 v) + { + this.c0 = math.select(new float3(0.0f), new float3(1.0f), v.c0); + this.c1 = math.select(new float3(0.0f), new float3(1.0f), v.c1); + } + + /// Constructs a float3x2 matrix from a single int value by converting it to float and assigning it to every component. + /// int to convert to float3x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3x2(int v) + { + this.c0 = v; + this.c1 = v; + } + + /// Constructs a float3x2 matrix from a int3x2 matrix by componentwise conversion. + /// int3x2 to convert to float3x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3x2(int3x2 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + } + + /// Constructs a float3x2 matrix from a single uint value by converting it to float and assigning it to every component. + /// uint to convert to float3x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3x2(uint v) + { + this.c0 = v; + this.c1 = v; + } + + /// Constructs a float3x2 matrix from a uint3x2 matrix by componentwise conversion. + /// uint3x2 to convert to float3x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3x2(uint3x2 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + } + + /// Constructs a float3x2 matrix from a single double value by converting it to float and assigning it to every component. + /// double to convert to float3x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3x2(double v) + { + this.c0 = (float3)v; + this.c1 = (float3)v; + } + + /// Constructs a float3x2 matrix from a double3x2 matrix by componentwise conversion. + /// double3x2 to convert to float3x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3x2(double3x2 v) + { + this.c0 = (float3)v.c0; + this.c1 = (float3)v.c1; + } + + + /// Implicitly converts a single float value to a float3x2 matrix by assigning it to every component. + /// float to convert to float3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float3x2(float v) { return new float3x2(v); } + + /// Explicitly converts a single bool value to a float3x2 matrix by converting it to float and assigning it to every component. + /// bool to convert to float3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float3x2(bool v) { return new float3x2(v); } + + /// Explicitly converts a bool3x2 matrix to a float3x2 matrix by componentwise conversion. + /// bool3x2 to convert to float3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float3x2(bool3x2 v) { return new float3x2(v); } + + /// Implicitly converts a single int value to a float3x2 matrix by converting it to float and assigning it to every component. + /// int to convert to float3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float3x2(int v) { return new float3x2(v); } + + /// Implicitly converts a int3x2 matrix to a float3x2 matrix by componentwise conversion. + /// int3x2 to convert to float3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float3x2(int3x2 v) { return new float3x2(v); } + + /// Implicitly converts a single uint value to a float3x2 matrix by converting it to float and assigning it to every component. + /// uint to convert to float3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float3x2(uint v) { return new float3x2(v); } + + /// Implicitly converts a uint3x2 matrix to a float3x2 matrix by componentwise conversion. + /// uint3x2 to convert to float3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float3x2(uint3x2 v) { return new float3x2(v); } + + /// Explicitly converts a single double value to a float3x2 matrix by converting it to float and assigning it to every component. + /// double to convert to float3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float3x2(double v) { return new float3x2(v); } + + /// Explicitly converts a double3x2 matrix to a float3x2 matrix by componentwise conversion. + /// double3x2 to convert to float3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float3x2(double3x2 v) { return new float3x2(v); } + + + /// Returns the result of a componentwise multiplication operation on two float3x2 matrices. + /// Left hand side float3x2 to use to compute componentwise multiplication. + /// Right hand side float3x2 to use to compute componentwise multiplication. + /// float3x2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x2 operator * (float3x2 lhs, float3x2 rhs) { return new float3x2 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1); } + + /// Returns the result of a componentwise multiplication operation on a float3x2 matrix and a float value. + /// Left hand side float3x2 to use to compute componentwise multiplication. + /// Right hand side float to use to compute componentwise multiplication. + /// float3x2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x2 operator * (float3x2 lhs, float rhs) { return new float3x2 (lhs.c0 * rhs, lhs.c1 * rhs); } + + /// Returns the result of a componentwise multiplication operation on a float value and a float3x2 matrix. + /// Left hand side float to use to compute componentwise multiplication. + /// Right hand side float3x2 to use to compute componentwise multiplication. + /// float3x2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x2 operator * (float lhs, float3x2 rhs) { return new float3x2 (lhs * rhs.c0, lhs * rhs.c1); } + + + /// Returns the result of a componentwise addition operation on two float3x2 matrices. + /// Left hand side float3x2 to use to compute componentwise addition. + /// Right hand side float3x2 to use to compute componentwise addition. + /// float3x2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x2 operator + (float3x2 lhs, float3x2 rhs) { return new float3x2 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1); } + + /// Returns the result of a componentwise addition operation on a float3x2 matrix and a float value. + /// Left hand side float3x2 to use to compute componentwise addition. + /// Right hand side float to use to compute componentwise addition. + /// float3x2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x2 operator + (float3x2 lhs, float rhs) { return new float3x2 (lhs.c0 + rhs, lhs.c1 + rhs); } + + /// Returns the result of a componentwise addition operation on a float value and a float3x2 matrix. + /// Left hand side float to use to compute componentwise addition. + /// Right hand side float3x2 to use to compute componentwise addition. + /// float3x2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x2 operator + (float lhs, float3x2 rhs) { return new float3x2 (lhs + rhs.c0, lhs + rhs.c1); } + + + /// Returns the result of a componentwise subtraction operation on two float3x2 matrices. + /// Left hand side float3x2 to use to compute componentwise subtraction. + /// Right hand side float3x2 to use to compute componentwise subtraction. + /// float3x2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x2 operator - (float3x2 lhs, float3x2 rhs) { return new float3x2 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1); } + + /// Returns the result of a componentwise subtraction operation on a float3x2 matrix and a float value. + /// Left hand side float3x2 to use to compute componentwise subtraction. + /// Right hand side float to use to compute componentwise subtraction. + /// float3x2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x2 operator - (float3x2 lhs, float rhs) { return new float3x2 (lhs.c0 - rhs, lhs.c1 - rhs); } + + /// Returns the result of a componentwise subtraction operation on a float value and a float3x2 matrix. + /// Left hand side float to use to compute componentwise subtraction. + /// Right hand side float3x2 to use to compute componentwise subtraction. + /// float3x2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x2 operator - (float lhs, float3x2 rhs) { return new float3x2 (lhs - rhs.c0, lhs - rhs.c1); } + + + /// Returns the result of a componentwise division operation on two float3x2 matrices. + /// Left hand side float3x2 to use to compute componentwise division. + /// Right hand side float3x2 to use to compute componentwise division. + /// float3x2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x2 operator / (float3x2 lhs, float3x2 rhs) { return new float3x2 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1); } + + /// Returns the result of a componentwise division operation on a float3x2 matrix and a float value. + /// Left hand side float3x2 to use to compute componentwise division. + /// Right hand side float to use to compute componentwise division. + /// float3x2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x2 operator / (float3x2 lhs, float rhs) { return new float3x2 (lhs.c0 / rhs, lhs.c1 / rhs); } + + /// Returns the result of a componentwise division operation on a float value and a float3x2 matrix. + /// Left hand side float to use to compute componentwise division. + /// Right hand side float3x2 to use to compute componentwise division. + /// float3x2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x2 operator / (float lhs, float3x2 rhs) { return new float3x2 (lhs / rhs.c0, lhs / rhs.c1); } + + + /// Returns the result of a componentwise modulus operation on two float3x2 matrices. + /// Left hand side float3x2 to use to compute componentwise modulus. + /// Right hand side float3x2 to use to compute componentwise modulus. + /// float3x2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x2 operator % (float3x2 lhs, float3x2 rhs) { return new float3x2 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1); } + + /// Returns the result of a componentwise modulus operation on a float3x2 matrix and a float value. + /// Left hand side float3x2 to use to compute componentwise modulus. + /// Right hand side float to use to compute componentwise modulus. + /// float3x2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x2 operator % (float3x2 lhs, float rhs) { return new float3x2 (lhs.c0 % rhs, lhs.c1 % rhs); } + + /// Returns the result of a componentwise modulus operation on a float value and a float3x2 matrix. + /// Left hand side float to use to compute componentwise modulus. + /// Right hand side float3x2 to use to compute componentwise modulus. + /// float3x2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x2 operator % (float lhs, float3x2 rhs) { return new float3x2 (lhs % rhs.c0, lhs % rhs.c1); } + + + /// Returns the result of a componentwise increment operation on a float3x2 matrix. + /// Value to use when computing the componentwise increment. + /// float3x2 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x2 operator ++ (float3x2 val) { return new float3x2 (++val.c0, ++val.c1); } + + + /// Returns the result of a componentwise decrement operation on a float3x2 matrix. + /// Value to use when computing the componentwise decrement. + /// float3x2 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x2 operator -- (float3x2 val) { return new float3x2 (--val.c0, --val.c1); } + + + /// Returns the result of a componentwise less than operation on two float3x2 matrices. + /// Left hand side float3x2 to use to compute componentwise less than. + /// Right hand side float3x2 to use to compute componentwise less than. + /// bool3x2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator < (float3x2 lhs, float3x2 rhs) { return new bool3x2 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1); } + + /// Returns the result of a componentwise less than operation on a float3x2 matrix and a float value. + /// Left hand side float3x2 to use to compute componentwise less than. + /// Right hand side float to use to compute componentwise less than. + /// bool3x2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator < (float3x2 lhs, float rhs) { return new bool3x2 (lhs.c0 < rhs, lhs.c1 < rhs); } + + /// Returns the result of a componentwise less than operation on a float value and a float3x2 matrix. + /// Left hand side float to use to compute componentwise less than. + /// Right hand side float3x2 to use to compute componentwise less than. + /// bool3x2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator < (float lhs, float3x2 rhs) { return new bool3x2 (lhs < rhs.c0, lhs < rhs.c1); } + + + /// Returns the result of a componentwise less or equal operation on two float3x2 matrices. + /// Left hand side float3x2 to use to compute componentwise less or equal. + /// Right hand side float3x2 to use to compute componentwise less or equal. + /// bool3x2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator <= (float3x2 lhs, float3x2 rhs) { return new bool3x2 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1); } + + /// Returns the result of a componentwise less or equal operation on a float3x2 matrix and a float value. + /// Left hand side float3x2 to use to compute componentwise less or equal. + /// Right hand side float to use to compute componentwise less or equal. + /// bool3x2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator <= (float3x2 lhs, float rhs) { return new bool3x2 (lhs.c0 <= rhs, lhs.c1 <= rhs); } + + /// Returns the result of a componentwise less or equal operation on a float value and a float3x2 matrix. + /// Left hand side float to use to compute componentwise less or equal. + /// Right hand side float3x2 to use to compute componentwise less or equal. + /// bool3x2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator <= (float lhs, float3x2 rhs) { return new bool3x2 (lhs <= rhs.c0, lhs <= rhs.c1); } + + + /// Returns the result of a componentwise greater than operation on two float3x2 matrices. + /// Left hand side float3x2 to use to compute componentwise greater than. + /// Right hand side float3x2 to use to compute componentwise greater than. + /// bool3x2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator > (float3x2 lhs, float3x2 rhs) { return new bool3x2 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1); } + + /// Returns the result of a componentwise greater than operation on a float3x2 matrix and a float value. + /// Left hand side float3x2 to use to compute componentwise greater than. + /// Right hand side float to use to compute componentwise greater than. + /// bool3x2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator > (float3x2 lhs, float rhs) { return new bool3x2 (lhs.c0 > rhs, lhs.c1 > rhs); } + + /// Returns the result of a componentwise greater than operation on a float value and a float3x2 matrix. + /// Left hand side float to use to compute componentwise greater than. + /// Right hand side float3x2 to use to compute componentwise greater than. + /// bool3x2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator > (float lhs, float3x2 rhs) { return new bool3x2 (lhs > rhs.c0, lhs > rhs.c1); } + + + /// Returns the result of a componentwise greater or equal operation on two float3x2 matrices. + /// Left hand side float3x2 to use to compute componentwise greater or equal. + /// Right hand side float3x2 to use to compute componentwise greater or equal. + /// bool3x2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator >= (float3x2 lhs, float3x2 rhs) { return new bool3x2 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1); } + + /// Returns the result of a componentwise greater or equal operation on a float3x2 matrix and a float value. + /// Left hand side float3x2 to use to compute componentwise greater or equal. + /// Right hand side float to use to compute componentwise greater or equal. + /// bool3x2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator >= (float3x2 lhs, float rhs) { return new bool3x2 (lhs.c0 >= rhs, lhs.c1 >= rhs); } + + /// Returns the result of a componentwise greater or equal operation on a float value and a float3x2 matrix. + /// Left hand side float to use to compute componentwise greater or equal. + /// Right hand side float3x2 to use to compute componentwise greater or equal. + /// bool3x2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator >= (float lhs, float3x2 rhs) { return new bool3x2 (lhs >= rhs.c0, lhs >= rhs.c1); } + + + /// Returns the result of a componentwise unary minus operation on a float3x2 matrix. + /// Value to use when computing the componentwise unary minus. + /// float3x2 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x2 operator - (float3x2 val) { return new float3x2 (-val.c0, -val.c1); } + + + /// Returns the result of a componentwise unary plus operation on a float3x2 matrix. + /// Value to use when computing the componentwise unary plus. + /// float3x2 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x2 operator + (float3x2 val) { return new float3x2 (+val.c0, +val.c1); } + + + /// Returns the result of a componentwise equality operation on two float3x2 matrices. + /// Left hand side float3x2 to use to compute componentwise equality. + /// Right hand side float3x2 to use to compute componentwise equality. + /// bool3x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator == (float3x2 lhs, float3x2 rhs) { return new bool3x2 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1); } + + /// Returns the result of a componentwise equality operation on a float3x2 matrix and a float value. + /// Left hand side float3x2 to use to compute componentwise equality. + /// Right hand side float to use to compute componentwise equality. + /// bool3x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator == (float3x2 lhs, float rhs) { return new bool3x2 (lhs.c0 == rhs, lhs.c1 == rhs); } + + /// Returns the result of a componentwise equality operation on a float value and a float3x2 matrix. + /// Left hand side float to use to compute componentwise equality. + /// Right hand side float3x2 to use to compute componentwise equality. + /// bool3x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator == (float lhs, float3x2 rhs) { return new bool3x2 (lhs == rhs.c0, lhs == rhs.c1); } + + + /// Returns the result of a componentwise not equal operation on two float3x2 matrices. + /// Left hand side float3x2 to use to compute componentwise not equal. + /// Right hand side float3x2 to use to compute componentwise not equal. + /// bool3x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator != (float3x2 lhs, float3x2 rhs) { return new bool3x2 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1); } + + /// Returns the result of a componentwise not equal operation on a float3x2 matrix and a float value. + /// Left hand side float3x2 to use to compute componentwise not equal. + /// Right hand side float to use to compute componentwise not equal. + /// bool3x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator != (float3x2 lhs, float rhs) { return new bool3x2 (lhs.c0 != rhs, lhs.c1 != rhs); } + + /// Returns the result of a componentwise not equal operation on a float value and a float3x2 matrix. + /// Left hand side float to use to compute componentwise not equal. + /// Right hand side float3x2 to use to compute componentwise not equal. + /// bool3x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator != (float lhs, float3x2 rhs) { return new bool3x2 (lhs != rhs.c0, lhs != rhs.c1); } + + + + /// Returns the float3 element at a specified index. + unsafe public ref float3 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 2) + throw new System.ArgumentException("index must be between[0...1]"); +#endif + fixed (float3x2* array = &this) { return ref ((float3*)array)[index]; } + } + } + + /// Returns true if the float3x2 is equal to a given float3x2, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(float3x2 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1); } + + /// Returns true if the float3x2 is equal to a given float3x2, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is float3x2 converted && Equals(converted); } + + + /// Returns a hash code for the float3x2. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the float3x2. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("float3x2({0}f, {1}f, {2}f, {3}f, {4}f, {5}f)", c0.x, c1.x, c0.y, c1.y, c0.z, c1.z); + } + + /// Returns a string representation of the float3x2 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("float3x2({0}f, {1}f, {2}f, {3}f, {4}f, {5}f)", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c0.z.ToString(format, formatProvider), c1.z.ToString(format, formatProvider)); + } + + } + + public static partial class math + { + /// Returns a float3x2 matrix constructed from two float3 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// float3x2 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x2 float3x2(float3 c0, float3 c1) { return new float3x2(c0, c1); } + + /// Returns a float3x2 matrix constructed from from 6 float values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// float3x2 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x2 float3x2(float m00, float m01, + float m10, float m11, + float m20, float m21) + { + return new float3x2(m00, m01, + m10, m11, + m20, m21); + } + + /// Returns a float3x2 matrix constructed from a single float value by assigning it to every component. + /// float to convert to float3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x2 float3x2(float v) { return new float3x2(v); } + + /// Returns a float3x2 matrix constructed from a single bool value by converting it to float and assigning it to every component. + /// bool to convert to float3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x2 float3x2(bool v) { return new float3x2(v); } + + /// Return a float3x2 matrix constructed from a bool3x2 matrix by componentwise conversion. + /// bool3x2 to convert to float3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x2 float3x2(bool3x2 v) { return new float3x2(v); } + + /// Returns a float3x2 matrix constructed from a single int value by converting it to float and assigning it to every component. + /// int to convert to float3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x2 float3x2(int v) { return new float3x2(v); } + + /// Return a float3x2 matrix constructed from a int3x2 matrix by componentwise conversion. + /// int3x2 to convert to float3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x2 float3x2(int3x2 v) { return new float3x2(v); } + + /// Returns a float3x2 matrix constructed from a single uint value by converting it to float and assigning it to every component. + /// uint to convert to float3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x2 float3x2(uint v) { return new float3x2(v); } + + /// Return a float3x2 matrix constructed from a uint3x2 matrix by componentwise conversion. + /// uint3x2 to convert to float3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x2 float3x2(uint3x2 v) { return new float3x2(v); } + + /// Returns a float3x2 matrix constructed from a single double value by converting it to float and assigning it to every component. + /// double to convert to float3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x2 float3x2(double v) { return new float3x2(v); } + + /// Return a float3x2 matrix constructed from a double3x2 matrix by componentwise conversion. + /// double3x2 to convert to float3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x2 float3x2(double3x2 v) { return new float3x2(v); } + + /// Return the float2x3 transpose of a float3x2 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x3 transpose(float3x2 v) + { + return float2x3( + v.c0.x, v.c0.y, v.c0.z, + v.c1.x, v.c1.y, v.c1.z); + } + + /// Returns a uint hash code of a float3x2 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(float3x2 v) + { + return csum(asuint(v.c0) * uint3(0xE121E6ADu, 0xC9CA1249u, 0x69B60C81u) + + asuint(v.c1) * uint3(0xE0EB6C25u, 0xF648BEABu, 0x6BDB2B07u)) + 0xEF63C699u; + } + + /// + /// Returns a uint3 vector hash code of a float3x2 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint3 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 hashwide(float3x2 v) + { + return (asuint(v.c0) * uint3(0x9001903Fu, 0xA895B9CDu, 0x9D23B201u) + + asuint(v.c1) * uint3(0x4B01D3E1u, 0x7461CA0Du, 0x79725379u)) + 0xD6258E5Bu; + } + + } +} diff --git a/src/Unity.Mathematics/float3x2.gen.cs.meta b/src/Unity.Mathematics/float3x2.gen.cs.meta new file mode 100644 index 00000000..84208ff8 --- /dev/null +++ b/src/Unity.Mathematics/float3x2.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d20ff0b41ab5f4071b3d6ec3442fb2f7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/float3x3.gen.cs b/src/Unity.Mathematics/float3x3.gen.cs new file mode 100644 index 00000000..14929538 --- /dev/null +++ b/src/Unity.Mathematics/float3x3.gen.cs @@ -0,0 +1,697 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 3x3 matrix of floats. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct float3x3 : System.IEquatable, IFormattable + { + /// Column 0 of the matrix. + public float3 c0; + /// Column 1 of the matrix. + public float3 c1; + /// Column 2 of the matrix. + public float3 c2; + + /// float3x3 identity transform. + public static readonly float3x3 identity = new float3x3(1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f); + + /// float3x3 zero value. + public static readonly float3x3 zero; + + /// Constructs a float3x3 matrix from three float3 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3x3(float3 c0, float3 c1, float3 c2) + { + this.c0 = c0; + this.c1 = c1; + this.c2 = c2; + } + + /// Constructs a float3x3 matrix from 9 float values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 2, column 2 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3x3(float m00, float m01, float m02, + float m10, float m11, float m12, + float m20, float m21, float m22) + { + this.c0 = new float3(m00, m10, m20); + this.c1 = new float3(m01, m11, m21); + this.c2 = new float3(m02, m12, m22); + } + + /// Constructs a float3x3 matrix from a single float value by assigning it to every component. + /// float to convert to float3x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3x3(float v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + } + + /// Constructs a float3x3 matrix from a single bool value by converting it to float and assigning it to every component. + /// bool to convert to float3x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3x3(bool v) + { + this.c0 = math.select(new float3(0.0f), new float3(1.0f), v); + this.c1 = math.select(new float3(0.0f), new float3(1.0f), v); + this.c2 = math.select(new float3(0.0f), new float3(1.0f), v); + } + + /// Constructs a float3x3 matrix from a bool3x3 matrix by componentwise conversion. + /// bool3x3 to convert to float3x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3x3(bool3x3 v) + { + this.c0 = math.select(new float3(0.0f), new float3(1.0f), v.c0); + this.c1 = math.select(new float3(0.0f), new float3(1.0f), v.c1); + this.c2 = math.select(new float3(0.0f), new float3(1.0f), v.c2); + } + + /// Constructs a float3x3 matrix from a single int value by converting it to float and assigning it to every component. + /// int to convert to float3x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3x3(int v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + } + + /// Constructs a float3x3 matrix from a int3x3 matrix by componentwise conversion. + /// int3x3 to convert to float3x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3x3(int3x3 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + this.c2 = v.c2; + } + + /// Constructs a float3x3 matrix from a single uint value by converting it to float and assigning it to every component. + /// uint to convert to float3x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3x3(uint v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + } + + /// Constructs a float3x3 matrix from a uint3x3 matrix by componentwise conversion. + /// uint3x3 to convert to float3x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3x3(uint3x3 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + this.c2 = v.c2; + } + + /// Constructs a float3x3 matrix from a single double value by converting it to float and assigning it to every component. + /// double to convert to float3x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3x3(double v) + { + this.c0 = (float3)v; + this.c1 = (float3)v; + this.c2 = (float3)v; + } + + /// Constructs a float3x3 matrix from a double3x3 matrix by componentwise conversion. + /// double3x3 to convert to float3x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3x3(double3x3 v) + { + this.c0 = (float3)v.c0; + this.c1 = (float3)v.c1; + this.c2 = (float3)v.c2; + } + + + /// Implicitly converts a single float value to a float3x3 matrix by assigning it to every component. + /// float to convert to float3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float3x3(float v) { return new float3x3(v); } + + /// Explicitly converts a single bool value to a float3x3 matrix by converting it to float and assigning it to every component. + /// bool to convert to float3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float3x3(bool v) { return new float3x3(v); } + + /// Explicitly converts a bool3x3 matrix to a float3x3 matrix by componentwise conversion. + /// bool3x3 to convert to float3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float3x3(bool3x3 v) { return new float3x3(v); } + + /// Implicitly converts a single int value to a float3x3 matrix by converting it to float and assigning it to every component. + /// int to convert to float3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float3x3(int v) { return new float3x3(v); } + + /// Implicitly converts a int3x3 matrix to a float3x3 matrix by componentwise conversion. + /// int3x3 to convert to float3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float3x3(int3x3 v) { return new float3x3(v); } + + /// Implicitly converts a single uint value to a float3x3 matrix by converting it to float and assigning it to every component. + /// uint to convert to float3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float3x3(uint v) { return new float3x3(v); } + + /// Implicitly converts a uint3x3 matrix to a float3x3 matrix by componentwise conversion. + /// uint3x3 to convert to float3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float3x3(uint3x3 v) { return new float3x3(v); } + + /// Explicitly converts a single double value to a float3x3 matrix by converting it to float and assigning it to every component. + /// double to convert to float3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float3x3(double v) { return new float3x3(v); } + + /// Explicitly converts a double3x3 matrix to a float3x3 matrix by componentwise conversion. + /// double3x3 to convert to float3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float3x3(double3x3 v) { return new float3x3(v); } + + + /// Returns the result of a componentwise multiplication operation on two float3x3 matrices. + /// Left hand side float3x3 to use to compute componentwise multiplication. + /// Right hand side float3x3 to use to compute componentwise multiplication. + /// float3x3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 operator * (float3x3 lhs, float3x3 rhs) { return new float3x3 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1, lhs.c2 * rhs.c2); } + + /// Returns the result of a componentwise multiplication operation on a float3x3 matrix and a float value. + /// Left hand side float3x3 to use to compute componentwise multiplication. + /// Right hand side float to use to compute componentwise multiplication. + /// float3x3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 operator * (float3x3 lhs, float rhs) { return new float3x3 (lhs.c0 * rhs, lhs.c1 * rhs, lhs.c2 * rhs); } + + /// Returns the result of a componentwise multiplication operation on a float value and a float3x3 matrix. + /// Left hand side float to use to compute componentwise multiplication. + /// Right hand side float3x3 to use to compute componentwise multiplication. + /// float3x3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 operator * (float lhs, float3x3 rhs) { return new float3x3 (lhs * rhs.c0, lhs * rhs.c1, lhs * rhs.c2); } + + + /// Returns the result of a componentwise addition operation on two float3x3 matrices. + /// Left hand side float3x3 to use to compute componentwise addition. + /// Right hand side float3x3 to use to compute componentwise addition. + /// float3x3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 operator + (float3x3 lhs, float3x3 rhs) { return new float3x3 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1, lhs.c2 + rhs.c2); } + + /// Returns the result of a componentwise addition operation on a float3x3 matrix and a float value. + /// Left hand side float3x3 to use to compute componentwise addition. + /// Right hand side float to use to compute componentwise addition. + /// float3x3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 operator + (float3x3 lhs, float rhs) { return new float3x3 (lhs.c0 + rhs, lhs.c1 + rhs, lhs.c2 + rhs); } + + /// Returns the result of a componentwise addition operation on a float value and a float3x3 matrix. + /// Left hand side float to use to compute componentwise addition. + /// Right hand side float3x3 to use to compute componentwise addition. + /// float3x3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 operator + (float lhs, float3x3 rhs) { return new float3x3 (lhs + rhs.c0, lhs + rhs.c1, lhs + rhs.c2); } + + + /// Returns the result of a componentwise subtraction operation on two float3x3 matrices. + /// Left hand side float3x3 to use to compute componentwise subtraction. + /// Right hand side float3x3 to use to compute componentwise subtraction. + /// float3x3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 operator - (float3x3 lhs, float3x3 rhs) { return new float3x3 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1, lhs.c2 - rhs.c2); } + + /// Returns the result of a componentwise subtraction operation on a float3x3 matrix and a float value. + /// Left hand side float3x3 to use to compute componentwise subtraction. + /// Right hand side float to use to compute componentwise subtraction. + /// float3x3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 operator - (float3x3 lhs, float rhs) { return new float3x3 (lhs.c0 - rhs, lhs.c1 - rhs, lhs.c2 - rhs); } + + /// Returns the result of a componentwise subtraction operation on a float value and a float3x3 matrix. + /// Left hand side float to use to compute componentwise subtraction. + /// Right hand side float3x3 to use to compute componentwise subtraction. + /// float3x3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 operator - (float lhs, float3x3 rhs) { return new float3x3 (lhs - rhs.c0, lhs - rhs.c1, lhs - rhs.c2); } + + + /// Returns the result of a componentwise division operation on two float3x3 matrices. + /// Left hand side float3x3 to use to compute componentwise division. + /// Right hand side float3x3 to use to compute componentwise division. + /// float3x3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 operator / (float3x3 lhs, float3x3 rhs) { return new float3x3 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1, lhs.c2 / rhs.c2); } + + /// Returns the result of a componentwise division operation on a float3x3 matrix and a float value. + /// Left hand side float3x3 to use to compute componentwise division. + /// Right hand side float to use to compute componentwise division. + /// float3x3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 operator / (float3x3 lhs, float rhs) { return new float3x3 (lhs.c0 / rhs, lhs.c1 / rhs, lhs.c2 / rhs); } + + /// Returns the result of a componentwise division operation on a float value and a float3x3 matrix. + /// Left hand side float to use to compute componentwise division. + /// Right hand side float3x3 to use to compute componentwise division. + /// float3x3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 operator / (float lhs, float3x3 rhs) { return new float3x3 (lhs / rhs.c0, lhs / rhs.c1, lhs / rhs.c2); } + + + /// Returns the result of a componentwise modulus operation on two float3x3 matrices. + /// Left hand side float3x3 to use to compute componentwise modulus. + /// Right hand side float3x3 to use to compute componentwise modulus. + /// float3x3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 operator % (float3x3 lhs, float3x3 rhs) { return new float3x3 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1, lhs.c2 % rhs.c2); } + + /// Returns the result of a componentwise modulus operation on a float3x3 matrix and a float value. + /// Left hand side float3x3 to use to compute componentwise modulus. + /// Right hand side float to use to compute componentwise modulus. + /// float3x3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 operator % (float3x3 lhs, float rhs) { return new float3x3 (lhs.c0 % rhs, lhs.c1 % rhs, lhs.c2 % rhs); } + + /// Returns the result of a componentwise modulus operation on a float value and a float3x3 matrix. + /// Left hand side float to use to compute componentwise modulus. + /// Right hand side float3x3 to use to compute componentwise modulus. + /// float3x3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 operator % (float lhs, float3x3 rhs) { return new float3x3 (lhs % rhs.c0, lhs % rhs.c1, lhs % rhs.c2); } + + + /// Returns the result of a componentwise increment operation on a float3x3 matrix. + /// Value to use when computing the componentwise increment. + /// float3x3 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 operator ++ (float3x3 val) { return new float3x3 (++val.c0, ++val.c1, ++val.c2); } + + + /// Returns the result of a componentwise decrement operation on a float3x3 matrix. + /// Value to use when computing the componentwise decrement. + /// float3x3 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 operator -- (float3x3 val) { return new float3x3 (--val.c0, --val.c1, --val.c2); } + + + /// Returns the result of a componentwise less than operation on two float3x3 matrices. + /// Left hand side float3x3 to use to compute componentwise less than. + /// Right hand side float3x3 to use to compute componentwise less than. + /// bool3x3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator < (float3x3 lhs, float3x3 rhs) { return new bool3x3 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1, lhs.c2 < rhs.c2); } + + /// Returns the result of a componentwise less than operation on a float3x3 matrix and a float value. + /// Left hand side float3x3 to use to compute componentwise less than. + /// Right hand side float to use to compute componentwise less than. + /// bool3x3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator < (float3x3 lhs, float rhs) { return new bool3x3 (lhs.c0 < rhs, lhs.c1 < rhs, lhs.c2 < rhs); } + + /// Returns the result of a componentwise less than operation on a float value and a float3x3 matrix. + /// Left hand side float to use to compute componentwise less than. + /// Right hand side float3x3 to use to compute componentwise less than. + /// bool3x3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator < (float lhs, float3x3 rhs) { return new bool3x3 (lhs < rhs.c0, lhs < rhs.c1, lhs < rhs.c2); } + + + /// Returns the result of a componentwise less or equal operation on two float3x3 matrices. + /// Left hand side float3x3 to use to compute componentwise less or equal. + /// Right hand side float3x3 to use to compute componentwise less or equal. + /// bool3x3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator <= (float3x3 lhs, float3x3 rhs) { return new bool3x3 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1, lhs.c2 <= rhs.c2); } + + /// Returns the result of a componentwise less or equal operation on a float3x3 matrix and a float value. + /// Left hand side float3x3 to use to compute componentwise less or equal. + /// Right hand side float to use to compute componentwise less or equal. + /// bool3x3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator <= (float3x3 lhs, float rhs) { return new bool3x3 (lhs.c0 <= rhs, lhs.c1 <= rhs, lhs.c2 <= rhs); } + + /// Returns the result of a componentwise less or equal operation on a float value and a float3x3 matrix. + /// Left hand side float to use to compute componentwise less or equal. + /// Right hand side float3x3 to use to compute componentwise less or equal. + /// bool3x3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator <= (float lhs, float3x3 rhs) { return new bool3x3 (lhs <= rhs.c0, lhs <= rhs.c1, lhs <= rhs.c2); } + + + /// Returns the result of a componentwise greater than operation on two float3x3 matrices. + /// Left hand side float3x3 to use to compute componentwise greater than. + /// Right hand side float3x3 to use to compute componentwise greater than. + /// bool3x3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator > (float3x3 lhs, float3x3 rhs) { return new bool3x3 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1, lhs.c2 > rhs.c2); } + + /// Returns the result of a componentwise greater than operation on a float3x3 matrix and a float value. + /// Left hand side float3x3 to use to compute componentwise greater than. + /// Right hand side float to use to compute componentwise greater than. + /// bool3x3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator > (float3x3 lhs, float rhs) { return new bool3x3 (lhs.c0 > rhs, lhs.c1 > rhs, lhs.c2 > rhs); } + + /// Returns the result of a componentwise greater than operation on a float value and a float3x3 matrix. + /// Left hand side float to use to compute componentwise greater than. + /// Right hand side float3x3 to use to compute componentwise greater than. + /// bool3x3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator > (float lhs, float3x3 rhs) { return new bool3x3 (lhs > rhs.c0, lhs > rhs.c1, lhs > rhs.c2); } + + + /// Returns the result of a componentwise greater or equal operation on two float3x3 matrices. + /// Left hand side float3x3 to use to compute componentwise greater or equal. + /// Right hand side float3x3 to use to compute componentwise greater or equal. + /// bool3x3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator >= (float3x3 lhs, float3x3 rhs) { return new bool3x3 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1, lhs.c2 >= rhs.c2); } + + /// Returns the result of a componentwise greater or equal operation on a float3x3 matrix and a float value. + /// Left hand side float3x3 to use to compute componentwise greater or equal. + /// Right hand side float to use to compute componentwise greater or equal. + /// bool3x3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator >= (float3x3 lhs, float rhs) { return new bool3x3 (lhs.c0 >= rhs, lhs.c1 >= rhs, lhs.c2 >= rhs); } + + /// Returns the result of a componentwise greater or equal operation on a float value and a float3x3 matrix. + /// Left hand side float to use to compute componentwise greater or equal. + /// Right hand side float3x3 to use to compute componentwise greater or equal. + /// bool3x3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator >= (float lhs, float3x3 rhs) { return new bool3x3 (lhs >= rhs.c0, lhs >= rhs.c1, lhs >= rhs.c2); } + + + /// Returns the result of a componentwise unary minus operation on a float3x3 matrix. + /// Value to use when computing the componentwise unary minus. + /// float3x3 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 operator - (float3x3 val) { return new float3x3 (-val.c0, -val.c1, -val.c2); } + + + /// Returns the result of a componentwise unary plus operation on a float3x3 matrix. + /// Value to use when computing the componentwise unary plus. + /// float3x3 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 operator + (float3x3 val) { return new float3x3 (+val.c0, +val.c1, +val.c2); } + + + /// Returns the result of a componentwise equality operation on two float3x3 matrices. + /// Left hand side float3x3 to use to compute componentwise equality. + /// Right hand side float3x3 to use to compute componentwise equality. + /// bool3x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator == (float3x3 lhs, float3x3 rhs) { return new bool3x3 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2); } + + /// Returns the result of a componentwise equality operation on a float3x3 matrix and a float value. + /// Left hand side float3x3 to use to compute componentwise equality. + /// Right hand side float to use to compute componentwise equality. + /// bool3x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator == (float3x3 lhs, float rhs) { return new bool3x3 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs); } + + /// Returns the result of a componentwise equality operation on a float value and a float3x3 matrix. + /// Left hand side float to use to compute componentwise equality. + /// Right hand side float3x3 to use to compute componentwise equality. + /// bool3x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator == (float lhs, float3x3 rhs) { return new bool3x3 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2); } + + + /// Returns the result of a componentwise not equal operation on two float3x3 matrices. + /// Left hand side float3x3 to use to compute componentwise not equal. + /// Right hand side float3x3 to use to compute componentwise not equal. + /// bool3x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator != (float3x3 lhs, float3x3 rhs) { return new bool3x3 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2); } + + /// Returns the result of a componentwise not equal operation on a float3x3 matrix and a float value. + /// Left hand side float3x3 to use to compute componentwise not equal. + /// Right hand side float to use to compute componentwise not equal. + /// bool3x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator != (float3x3 lhs, float rhs) { return new bool3x3 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs); } + + /// Returns the result of a componentwise not equal operation on a float value and a float3x3 matrix. + /// Left hand side float to use to compute componentwise not equal. + /// Right hand side float3x3 to use to compute componentwise not equal. + /// bool3x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator != (float lhs, float3x3 rhs) { return new bool3x3 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2); } + + + + /// Returns the float3 element at a specified index. + unsafe public ref float3 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 3) + throw new System.ArgumentException("index must be between[0...2]"); +#endif + fixed (float3x3* array = &this) { return ref ((float3*)array)[index]; } + } + } + + /// Returns true if the float3x3 is equal to a given float3x3, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(float3x3 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2); } + + /// Returns true if the float3x3 is equal to a given float3x3, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is float3x3 converted && Equals(converted); } + + + /// Returns a hash code for the float3x3. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the float3x3. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("float3x3({0}f, {1}f, {2}f, {3}f, {4}f, {5}f, {6}f, {7}f, {8}f)", c0.x, c1.x, c2.x, c0.y, c1.y, c2.y, c0.z, c1.z, c2.z); + } + + /// Returns a string representation of the float3x3 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("float3x3({0}f, {1}f, {2}f, {3}f, {4}f, {5}f, {6}f, {7}f, {8}f)", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c2.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c2.y.ToString(format, formatProvider), c0.z.ToString(format, formatProvider), c1.z.ToString(format, formatProvider), c2.z.ToString(format, formatProvider)); + } + + } + + public static partial class math + { + /// Returns a float3x3 matrix constructed from three float3 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// float3x3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 float3x3(float3 c0, float3 c1, float3 c2) { return new float3x3(c0, c1, c2); } + + /// Returns a float3x3 matrix constructed from from 9 float values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 2, column 2 will be set to this value. + /// float3x3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 float3x3(float m00, float m01, float m02, + float m10, float m11, float m12, + float m20, float m21, float m22) + { + return new float3x3(m00, m01, m02, + m10, m11, m12, + m20, m21, m22); + } + + /// Returns a float3x3 matrix constructed from a single float value by assigning it to every component. + /// float to convert to float3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 float3x3(float v) { return new float3x3(v); } + + /// Returns a float3x3 matrix constructed from a single bool value by converting it to float and assigning it to every component. + /// bool to convert to float3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 float3x3(bool v) { return new float3x3(v); } + + /// Return a float3x3 matrix constructed from a bool3x3 matrix by componentwise conversion. + /// bool3x3 to convert to float3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 float3x3(bool3x3 v) { return new float3x3(v); } + + /// Returns a float3x3 matrix constructed from a single int value by converting it to float and assigning it to every component. + /// int to convert to float3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 float3x3(int v) { return new float3x3(v); } + + /// Return a float3x3 matrix constructed from a int3x3 matrix by componentwise conversion. + /// int3x3 to convert to float3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 float3x3(int3x3 v) { return new float3x3(v); } + + /// Returns a float3x3 matrix constructed from a single uint value by converting it to float and assigning it to every component. + /// uint to convert to float3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 float3x3(uint v) { return new float3x3(v); } + + /// Return a float3x3 matrix constructed from a uint3x3 matrix by componentwise conversion. + /// uint3x3 to convert to float3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 float3x3(uint3x3 v) { return new float3x3(v); } + + /// Returns a float3x3 matrix constructed from a single double value by converting it to float and assigning it to every component. + /// double to convert to float3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 float3x3(double v) { return new float3x3(v); } + + /// Return a float3x3 matrix constructed from a double3x3 matrix by componentwise conversion. + /// double3x3 to convert to float3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 float3x3(double3x3 v) { return new float3x3(v); } + + /// Return the float3x3 transpose of a float3x3 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 transpose(float3x3 v) + { + return float3x3( + v.c0.x, v.c0.y, v.c0.z, + v.c1.x, v.c1.y, v.c1.z, + v.c2.x, v.c2.y, v.c2.z); + } + + /// Returns the float3x3 full inverse of a float3x3 matrix. + /// Matrix to invert. + /// The inverted matrix. + public static float3x3 inverse(float3x3 m) + { + float3 c0 = m.c0; + float3 c1 = m.c1; + float3 c2 = m.c2; + + float3 t0 = float3(c1.x, c2.x, c0.x); + float3 t1 = float3(c1.y, c2.y, c0.y); + float3 t2 = float3(c1.z, c2.z, c0.z); + + float3 m0 = t1 * t2.yzx - t1.yzx * t2; + float3 m1 = t0.yzx * t2 - t0 * t2.yzx; + float3 m2 = t0 * t1.yzx - t0.yzx * t1; + + float rcpDet = 1.0f / csum(t0.zxy * m0); + return float3x3(m0, m1, m2) * rcpDet; + } + + /// Returns the determinant of a float3x3 matrix. + /// Matrix to use when computing determinant. + /// The determinant of the matrix. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float determinant(float3x3 m) + { + float3 c0 = m.c0; + float3 c1 = m.c1; + float3 c2 = m.c2; + + float m00 = c1.y * c2.z - c1.z * c2.y; + float m01 = c0.y * c2.z - c0.z * c2.y; + float m02 = c0.y * c1.z - c0.z * c1.y; + + return c0.x * m00 - c1.x * m01 + c2.x * m02; + } + + /// Returns a uint hash code of a float3x3 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(float3x3 v) + { + return csum(asuint(v.c0) * uint3(0x713BD06Fu, 0x753AD6ADu, 0xD19764C7u) + + asuint(v.c1) * uint3(0xB5D0BF63u, 0xF9102C5Fu, 0x9881FB9Fu) + + asuint(v.c2) * uint3(0x56A1530Du, 0x804B722Du, 0x738E50E5u)) + 0x4FC93C25u; + } + + /// + /// Returns a uint3 vector hash code of a float3x3 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint3 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 hashwide(float3x3 v) + { + return (asuint(v.c0) * uint3(0xCD0445A5u, 0xD2B90D9Bu, 0xD35C9B2Du) + + asuint(v.c1) * uint3(0xA10D9E27u, 0x568DAAA9u, 0x7530254Fu) + + asuint(v.c2) * uint3(0x9F090439u, 0x5E9F85C9u, 0x8C4CA03Fu)) + 0xB8D969EDu; + } + + } +} diff --git a/src/Unity.Mathematics/float3x3.gen.cs.meta b/src/Unity.Mathematics/float3x3.gen.cs.meta new file mode 100644 index 00000000..2f248324 --- /dev/null +++ b/src/Unity.Mathematics/float3x3.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3ad77e7310a1e44499f09a51a558bb01 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/float3x4.gen.cs b/src/Unity.Mathematics/float3x4.gen.cs new file mode 100644 index 00000000..f6111f6d --- /dev/null +++ b/src/Unity.Mathematics/float3x4.gen.cs @@ -0,0 +1,699 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 3x4 matrix of floats. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct float3x4 : System.IEquatable, IFormattable + { + /// Column 0 of the matrix. + public float3 c0; + /// Column 1 of the matrix. + public float3 c1; + /// Column 2 of the matrix. + public float3 c2; + /// Column 3 of the matrix. + public float3 c3; + + /// float3x4 zero value. + public static readonly float3x4 zero; + + /// Constructs a float3x4 matrix from four float3 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// The matrix column c3 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3x4(float3 c0, float3 c1, float3 c2, float3 c3) + { + this.c0 = c0; + this.c1 = c1; + this.c2 = c2; + this.c3 = c3; + } + + /// Constructs a float3x4 matrix from 12 float values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 0, column 3 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 1, column 3 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 2, column 2 will be set to this value. + /// The matrix at row 2, column 3 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3x4(float m00, float m01, float m02, float m03, + float m10, float m11, float m12, float m13, + float m20, float m21, float m22, float m23) + { + this.c0 = new float3(m00, m10, m20); + this.c1 = new float3(m01, m11, m21); + this.c2 = new float3(m02, m12, m22); + this.c3 = new float3(m03, m13, m23); + } + + /// Constructs a float3x4 matrix from a single float value by assigning it to every component. + /// float to convert to float3x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3x4(float v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + this.c3 = v; + } + + /// Constructs a float3x4 matrix from a single bool value by converting it to float and assigning it to every component. + /// bool to convert to float3x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3x4(bool v) + { + this.c0 = math.select(new float3(0.0f), new float3(1.0f), v); + this.c1 = math.select(new float3(0.0f), new float3(1.0f), v); + this.c2 = math.select(new float3(0.0f), new float3(1.0f), v); + this.c3 = math.select(new float3(0.0f), new float3(1.0f), v); + } + + /// Constructs a float3x4 matrix from a bool3x4 matrix by componentwise conversion. + /// bool3x4 to convert to float3x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3x4(bool3x4 v) + { + this.c0 = math.select(new float3(0.0f), new float3(1.0f), v.c0); + this.c1 = math.select(new float3(0.0f), new float3(1.0f), v.c1); + this.c2 = math.select(new float3(0.0f), new float3(1.0f), v.c2); + this.c3 = math.select(new float3(0.0f), new float3(1.0f), v.c3); + } + + /// Constructs a float3x4 matrix from a single int value by converting it to float and assigning it to every component. + /// int to convert to float3x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3x4(int v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + this.c3 = v; + } + + /// Constructs a float3x4 matrix from a int3x4 matrix by componentwise conversion. + /// int3x4 to convert to float3x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3x4(int3x4 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + this.c2 = v.c2; + this.c3 = v.c3; + } + + /// Constructs a float3x4 matrix from a single uint value by converting it to float and assigning it to every component. + /// uint to convert to float3x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3x4(uint v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + this.c3 = v; + } + + /// Constructs a float3x4 matrix from a uint3x4 matrix by componentwise conversion. + /// uint3x4 to convert to float3x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3x4(uint3x4 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + this.c2 = v.c2; + this.c3 = v.c3; + } + + /// Constructs a float3x4 matrix from a single double value by converting it to float and assigning it to every component. + /// double to convert to float3x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3x4(double v) + { + this.c0 = (float3)v; + this.c1 = (float3)v; + this.c2 = (float3)v; + this.c3 = (float3)v; + } + + /// Constructs a float3x4 matrix from a double3x4 matrix by componentwise conversion. + /// double3x4 to convert to float3x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3x4(double3x4 v) + { + this.c0 = (float3)v.c0; + this.c1 = (float3)v.c1; + this.c2 = (float3)v.c2; + this.c3 = (float3)v.c3; + } + + + /// Implicitly converts a single float value to a float3x4 matrix by assigning it to every component. + /// float to convert to float3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float3x4(float v) { return new float3x4(v); } + + /// Explicitly converts a single bool value to a float3x4 matrix by converting it to float and assigning it to every component. + /// bool to convert to float3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float3x4(bool v) { return new float3x4(v); } + + /// Explicitly converts a bool3x4 matrix to a float3x4 matrix by componentwise conversion. + /// bool3x4 to convert to float3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float3x4(bool3x4 v) { return new float3x4(v); } + + /// Implicitly converts a single int value to a float3x4 matrix by converting it to float and assigning it to every component. + /// int to convert to float3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float3x4(int v) { return new float3x4(v); } + + /// Implicitly converts a int3x4 matrix to a float3x4 matrix by componentwise conversion. + /// int3x4 to convert to float3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float3x4(int3x4 v) { return new float3x4(v); } + + /// Implicitly converts a single uint value to a float3x4 matrix by converting it to float and assigning it to every component. + /// uint to convert to float3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float3x4(uint v) { return new float3x4(v); } + + /// Implicitly converts a uint3x4 matrix to a float3x4 matrix by componentwise conversion. + /// uint3x4 to convert to float3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float3x4(uint3x4 v) { return new float3x4(v); } + + /// Explicitly converts a single double value to a float3x4 matrix by converting it to float and assigning it to every component. + /// double to convert to float3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float3x4(double v) { return new float3x4(v); } + + /// Explicitly converts a double3x4 matrix to a float3x4 matrix by componentwise conversion. + /// double3x4 to convert to float3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float3x4(double3x4 v) { return new float3x4(v); } + + + /// Returns the result of a componentwise multiplication operation on two float3x4 matrices. + /// Left hand side float3x4 to use to compute componentwise multiplication. + /// Right hand side float3x4 to use to compute componentwise multiplication. + /// float3x4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x4 operator * (float3x4 lhs, float3x4 rhs) { return new float3x4 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1, lhs.c2 * rhs.c2, lhs.c3 * rhs.c3); } + + /// Returns the result of a componentwise multiplication operation on a float3x4 matrix and a float value. + /// Left hand side float3x4 to use to compute componentwise multiplication. + /// Right hand side float to use to compute componentwise multiplication. + /// float3x4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x4 operator * (float3x4 lhs, float rhs) { return new float3x4 (lhs.c0 * rhs, lhs.c1 * rhs, lhs.c2 * rhs, lhs.c3 * rhs); } + + /// Returns the result of a componentwise multiplication operation on a float value and a float3x4 matrix. + /// Left hand side float to use to compute componentwise multiplication. + /// Right hand side float3x4 to use to compute componentwise multiplication. + /// float3x4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x4 operator * (float lhs, float3x4 rhs) { return new float3x4 (lhs * rhs.c0, lhs * rhs.c1, lhs * rhs.c2, lhs * rhs.c3); } + + + /// Returns the result of a componentwise addition operation on two float3x4 matrices. + /// Left hand side float3x4 to use to compute componentwise addition. + /// Right hand side float3x4 to use to compute componentwise addition. + /// float3x4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x4 operator + (float3x4 lhs, float3x4 rhs) { return new float3x4 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1, lhs.c2 + rhs.c2, lhs.c3 + rhs.c3); } + + /// Returns the result of a componentwise addition operation on a float3x4 matrix and a float value. + /// Left hand side float3x4 to use to compute componentwise addition. + /// Right hand side float to use to compute componentwise addition. + /// float3x4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x4 operator + (float3x4 lhs, float rhs) { return new float3x4 (lhs.c0 + rhs, lhs.c1 + rhs, lhs.c2 + rhs, lhs.c3 + rhs); } + + /// Returns the result of a componentwise addition operation on a float value and a float3x4 matrix. + /// Left hand side float to use to compute componentwise addition. + /// Right hand side float3x4 to use to compute componentwise addition. + /// float3x4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x4 operator + (float lhs, float3x4 rhs) { return new float3x4 (lhs + rhs.c0, lhs + rhs.c1, lhs + rhs.c2, lhs + rhs.c3); } + + + /// Returns the result of a componentwise subtraction operation on two float3x4 matrices. + /// Left hand side float3x4 to use to compute componentwise subtraction. + /// Right hand side float3x4 to use to compute componentwise subtraction. + /// float3x4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x4 operator - (float3x4 lhs, float3x4 rhs) { return new float3x4 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1, lhs.c2 - rhs.c2, lhs.c3 - rhs.c3); } + + /// Returns the result of a componentwise subtraction operation on a float3x4 matrix and a float value. + /// Left hand side float3x4 to use to compute componentwise subtraction. + /// Right hand side float to use to compute componentwise subtraction. + /// float3x4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x4 operator - (float3x4 lhs, float rhs) { return new float3x4 (lhs.c0 - rhs, lhs.c1 - rhs, lhs.c2 - rhs, lhs.c3 - rhs); } + + /// Returns the result of a componentwise subtraction operation on a float value and a float3x4 matrix. + /// Left hand side float to use to compute componentwise subtraction. + /// Right hand side float3x4 to use to compute componentwise subtraction. + /// float3x4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x4 operator - (float lhs, float3x4 rhs) { return new float3x4 (lhs - rhs.c0, lhs - rhs.c1, lhs - rhs.c2, lhs - rhs.c3); } + + + /// Returns the result of a componentwise division operation on two float3x4 matrices. + /// Left hand side float3x4 to use to compute componentwise division. + /// Right hand side float3x4 to use to compute componentwise division. + /// float3x4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x4 operator / (float3x4 lhs, float3x4 rhs) { return new float3x4 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1, lhs.c2 / rhs.c2, lhs.c3 / rhs.c3); } + + /// Returns the result of a componentwise division operation on a float3x4 matrix and a float value. + /// Left hand side float3x4 to use to compute componentwise division. + /// Right hand side float to use to compute componentwise division. + /// float3x4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x4 operator / (float3x4 lhs, float rhs) { return new float3x4 (lhs.c0 / rhs, lhs.c1 / rhs, lhs.c2 / rhs, lhs.c3 / rhs); } + + /// Returns the result of a componentwise division operation on a float value and a float3x4 matrix. + /// Left hand side float to use to compute componentwise division. + /// Right hand side float3x4 to use to compute componentwise division. + /// float3x4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x4 operator / (float lhs, float3x4 rhs) { return new float3x4 (lhs / rhs.c0, lhs / rhs.c1, lhs / rhs.c2, lhs / rhs.c3); } + + + /// Returns the result of a componentwise modulus operation on two float3x4 matrices. + /// Left hand side float3x4 to use to compute componentwise modulus. + /// Right hand side float3x4 to use to compute componentwise modulus. + /// float3x4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x4 operator % (float3x4 lhs, float3x4 rhs) { return new float3x4 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1, lhs.c2 % rhs.c2, lhs.c3 % rhs.c3); } + + /// Returns the result of a componentwise modulus operation on a float3x4 matrix and a float value. + /// Left hand side float3x4 to use to compute componentwise modulus. + /// Right hand side float to use to compute componentwise modulus. + /// float3x4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x4 operator % (float3x4 lhs, float rhs) { return new float3x4 (lhs.c0 % rhs, lhs.c1 % rhs, lhs.c2 % rhs, lhs.c3 % rhs); } + + /// Returns the result of a componentwise modulus operation on a float value and a float3x4 matrix. + /// Left hand side float to use to compute componentwise modulus. + /// Right hand side float3x4 to use to compute componentwise modulus. + /// float3x4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x4 operator % (float lhs, float3x4 rhs) { return new float3x4 (lhs % rhs.c0, lhs % rhs.c1, lhs % rhs.c2, lhs % rhs.c3); } + + + /// Returns the result of a componentwise increment operation on a float3x4 matrix. + /// Value to use when computing the componentwise increment. + /// float3x4 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x4 operator ++ (float3x4 val) { return new float3x4 (++val.c0, ++val.c1, ++val.c2, ++val.c3); } + + + /// Returns the result of a componentwise decrement operation on a float3x4 matrix. + /// Value to use when computing the componentwise decrement. + /// float3x4 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x4 operator -- (float3x4 val) { return new float3x4 (--val.c0, --val.c1, --val.c2, --val.c3); } + + + /// Returns the result of a componentwise less than operation on two float3x4 matrices. + /// Left hand side float3x4 to use to compute componentwise less than. + /// Right hand side float3x4 to use to compute componentwise less than. + /// bool3x4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator < (float3x4 lhs, float3x4 rhs) { return new bool3x4 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1, lhs.c2 < rhs.c2, lhs.c3 < rhs.c3); } + + /// Returns the result of a componentwise less than operation on a float3x4 matrix and a float value. + /// Left hand side float3x4 to use to compute componentwise less than. + /// Right hand side float to use to compute componentwise less than. + /// bool3x4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator < (float3x4 lhs, float rhs) { return new bool3x4 (lhs.c0 < rhs, lhs.c1 < rhs, lhs.c2 < rhs, lhs.c3 < rhs); } + + /// Returns the result of a componentwise less than operation on a float value and a float3x4 matrix. + /// Left hand side float to use to compute componentwise less than. + /// Right hand side float3x4 to use to compute componentwise less than. + /// bool3x4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator < (float lhs, float3x4 rhs) { return new bool3x4 (lhs < rhs.c0, lhs < rhs.c1, lhs < rhs.c2, lhs < rhs.c3); } + + + /// Returns the result of a componentwise less or equal operation on two float3x4 matrices. + /// Left hand side float3x4 to use to compute componentwise less or equal. + /// Right hand side float3x4 to use to compute componentwise less or equal. + /// bool3x4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator <= (float3x4 lhs, float3x4 rhs) { return new bool3x4 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1, lhs.c2 <= rhs.c2, lhs.c3 <= rhs.c3); } + + /// Returns the result of a componentwise less or equal operation on a float3x4 matrix and a float value. + /// Left hand side float3x4 to use to compute componentwise less or equal. + /// Right hand side float to use to compute componentwise less or equal. + /// bool3x4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator <= (float3x4 lhs, float rhs) { return new bool3x4 (lhs.c0 <= rhs, lhs.c1 <= rhs, lhs.c2 <= rhs, lhs.c3 <= rhs); } + + /// Returns the result of a componentwise less or equal operation on a float value and a float3x4 matrix. + /// Left hand side float to use to compute componentwise less or equal. + /// Right hand side float3x4 to use to compute componentwise less or equal. + /// bool3x4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator <= (float lhs, float3x4 rhs) { return new bool3x4 (lhs <= rhs.c0, lhs <= rhs.c1, lhs <= rhs.c2, lhs <= rhs.c3); } + + + /// Returns the result of a componentwise greater than operation on two float3x4 matrices. + /// Left hand side float3x4 to use to compute componentwise greater than. + /// Right hand side float3x4 to use to compute componentwise greater than. + /// bool3x4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator > (float3x4 lhs, float3x4 rhs) { return new bool3x4 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1, lhs.c2 > rhs.c2, lhs.c3 > rhs.c3); } + + /// Returns the result of a componentwise greater than operation on a float3x4 matrix and a float value. + /// Left hand side float3x4 to use to compute componentwise greater than. + /// Right hand side float to use to compute componentwise greater than. + /// bool3x4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator > (float3x4 lhs, float rhs) { return new bool3x4 (lhs.c0 > rhs, lhs.c1 > rhs, lhs.c2 > rhs, lhs.c3 > rhs); } + + /// Returns the result of a componentwise greater than operation on a float value and a float3x4 matrix. + /// Left hand side float to use to compute componentwise greater than. + /// Right hand side float3x4 to use to compute componentwise greater than. + /// bool3x4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator > (float lhs, float3x4 rhs) { return new bool3x4 (lhs > rhs.c0, lhs > rhs.c1, lhs > rhs.c2, lhs > rhs.c3); } + + + /// Returns the result of a componentwise greater or equal operation on two float3x4 matrices. + /// Left hand side float3x4 to use to compute componentwise greater or equal. + /// Right hand side float3x4 to use to compute componentwise greater or equal. + /// bool3x4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator >= (float3x4 lhs, float3x4 rhs) { return new bool3x4 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1, lhs.c2 >= rhs.c2, lhs.c3 >= rhs.c3); } + + /// Returns the result of a componentwise greater or equal operation on a float3x4 matrix and a float value. + /// Left hand side float3x4 to use to compute componentwise greater or equal. + /// Right hand side float to use to compute componentwise greater or equal. + /// bool3x4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator >= (float3x4 lhs, float rhs) { return new bool3x4 (lhs.c0 >= rhs, lhs.c1 >= rhs, lhs.c2 >= rhs, lhs.c3 >= rhs); } + + /// Returns the result of a componentwise greater or equal operation on a float value and a float3x4 matrix. + /// Left hand side float to use to compute componentwise greater or equal. + /// Right hand side float3x4 to use to compute componentwise greater or equal. + /// bool3x4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator >= (float lhs, float3x4 rhs) { return new bool3x4 (lhs >= rhs.c0, lhs >= rhs.c1, lhs >= rhs.c2, lhs >= rhs.c3); } + + + /// Returns the result of a componentwise unary minus operation on a float3x4 matrix. + /// Value to use when computing the componentwise unary minus. + /// float3x4 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x4 operator - (float3x4 val) { return new float3x4 (-val.c0, -val.c1, -val.c2, -val.c3); } + + + /// Returns the result of a componentwise unary plus operation on a float3x4 matrix. + /// Value to use when computing the componentwise unary plus. + /// float3x4 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x4 operator + (float3x4 val) { return new float3x4 (+val.c0, +val.c1, +val.c2, +val.c3); } + + + /// Returns the result of a componentwise equality operation on two float3x4 matrices. + /// Left hand side float3x4 to use to compute componentwise equality. + /// Right hand side float3x4 to use to compute componentwise equality. + /// bool3x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator == (float3x4 lhs, float3x4 rhs) { return new bool3x4 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2, lhs.c3 == rhs.c3); } + + /// Returns the result of a componentwise equality operation on a float3x4 matrix and a float value. + /// Left hand side float3x4 to use to compute componentwise equality. + /// Right hand side float to use to compute componentwise equality. + /// bool3x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator == (float3x4 lhs, float rhs) { return new bool3x4 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs, lhs.c3 == rhs); } + + /// Returns the result of a componentwise equality operation on a float value and a float3x4 matrix. + /// Left hand side float to use to compute componentwise equality. + /// Right hand side float3x4 to use to compute componentwise equality. + /// bool3x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator == (float lhs, float3x4 rhs) { return new bool3x4 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2, lhs == rhs.c3); } + + + /// Returns the result of a componentwise not equal operation on two float3x4 matrices. + /// Left hand side float3x4 to use to compute componentwise not equal. + /// Right hand side float3x4 to use to compute componentwise not equal. + /// bool3x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator != (float3x4 lhs, float3x4 rhs) { return new bool3x4 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2, lhs.c3 != rhs.c3); } + + /// Returns the result of a componentwise not equal operation on a float3x4 matrix and a float value. + /// Left hand side float3x4 to use to compute componentwise not equal. + /// Right hand side float to use to compute componentwise not equal. + /// bool3x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator != (float3x4 lhs, float rhs) { return new bool3x4 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs, lhs.c3 != rhs); } + + /// Returns the result of a componentwise not equal operation on a float value and a float3x4 matrix. + /// Left hand side float to use to compute componentwise not equal. + /// Right hand side float3x4 to use to compute componentwise not equal. + /// bool3x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator != (float lhs, float3x4 rhs) { return new bool3x4 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2, lhs != rhs.c3); } + + + + /// Returns the float3 element at a specified index. + unsafe public ref float3 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 4) + throw new System.ArgumentException("index must be between[0...3]"); +#endif + fixed (float3x4* array = &this) { return ref ((float3*)array)[index]; } + } + } + + /// Returns true if the float3x4 is equal to a given float3x4, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(float3x4 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2) && c3.Equals(rhs.c3); } + + /// Returns true if the float3x4 is equal to a given float3x4, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is float3x4 converted && Equals(converted); } + + + /// Returns a hash code for the float3x4. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the float3x4. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("float3x4({0}f, {1}f, {2}f, {3}f, {4}f, {5}f, {6}f, {7}f, {8}f, {9}f, {10}f, {11}f)", c0.x, c1.x, c2.x, c3.x, c0.y, c1.y, c2.y, c3.y, c0.z, c1.z, c2.z, c3.z); + } + + /// Returns a string representation of the float3x4 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("float3x4({0}f, {1}f, {2}f, {3}f, {4}f, {5}f, {6}f, {7}f, {8}f, {9}f, {10}f, {11}f)", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c2.x.ToString(format, formatProvider), c3.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c2.y.ToString(format, formatProvider), c3.y.ToString(format, formatProvider), c0.z.ToString(format, formatProvider), c1.z.ToString(format, formatProvider), c2.z.ToString(format, formatProvider), c3.z.ToString(format, formatProvider)); + } + + } + + public static partial class math + { + /// Returns a float3x4 matrix constructed from four float3 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// The matrix column c3 will be set to this value. + /// float3x4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x4 float3x4(float3 c0, float3 c1, float3 c2, float3 c3) { return new float3x4(c0, c1, c2, c3); } + + /// Returns a float3x4 matrix constructed from from 12 float values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 0, column 3 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 1, column 3 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 2, column 2 will be set to this value. + /// The matrix at row 2, column 3 will be set to this value. + /// float3x4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x4 float3x4(float m00, float m01, float m02, float m03, + float m10, float m11, float m12, float m13, + float m20, float m21, float m22, float m23) + { + return new float3x4(m00, m01, m02, m03, + m10, m11, m12, m13, + m20, m21, m22, m23); + } + + /// Returns a float3x4 matrix constructed from a single float value by assigning it to every component. + /// float to convert to float3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x4 float3x4(float v) { return new float3x4(v); } + + /// Returns a float3x4 matrix constructed from a single bool value by converting it to float and assigning it to every component. + /// bool to convert to float3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x4 float3x4(bool v) { return new float3x4(v); } + + /// Return a float3x4 matrix constructed from a bool3x4 matrix by componentwise conversion. + /// bool3x4 to convert to float3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x4 float3x4(bool3x4 v) { return new float3x4(v); } + + /// Returns a float3x4 matrix constructed from a single int value by converting it to float and assigning it to every component. + /// int to convert to float3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x4 float3x4(int v) { return new float3x4(v); } + + /// Return a float3x4 matrix constructed from a int3x4 matrix by componentwise conversion. + /// int3x4 to convert to float3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x4 float3x4(int3x4 v) { return new float3x4(v); } + + /// Returns a float3x4 matrix constructed from a single uint value by converting it to float and assigning it to every component. + /// uint to convert to float3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x4 float3x4(uint v) { return new float3x4(v); } + + /// Return a float3x4 matrix constructed from a uint3x4 matrix by componentwise conversion. + /// uint3x4 to convert to float3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x4 float3x4(uint3x4 v) { return new float3x4(v); } + + /// Returns a float3x4 matrix constructed from a single double value by converting it to float and assigning it to every component. + /// double to convert to float3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x4 float3x4(double v) { return new float3x4(v); } + + /// Return a float3x4 matrix constructed from a double3x4 matrix by componentwise conversion. + /// double3x4 to convert to float3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x4 float3x4(double3x4 v) { return new float3x4(v); } + + /// Return the float4x3 transpose of a float3x4 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x3 transpose(float3x4 v) + { + return float4x3( + v.c0.x, v.c0.y, v.c0.z, + v.c1.x, v.c1.y, v.c1.z, + v.c2.x, v.c2.y, v.c2.z, + v.c3.x, v.c3.y, v.c3.z); + } + + /// Fast matrix inverse for rigid transforms (orthonormal basis and translation) + /// Matrix to invert. + /// The inverted matrix. + public static float3x4 fastinverse(float3x4 m) + { + float3 c0 = m.c0; + float3 c1 = m.c1; + float3 c2 = m.c2; + float3 pos = m.c3; + + float3 r0 = float3(c0.x, c1.x, c2.x); + float3 r1 = float3(c0.y, c1.y, c2.y); + float3 r2 = float3(c0.z, c1.z, c2.z); + + pos = -(r0 * pos.x + r1 * pos.y + r2 * pos.z); + + return float3x4(r0, r1, r2, pos); + } + + /// Returns a uint hash code of a float3x4 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(float3x4 v) + { + return csum(asuint(v.c0) * uint3(0xF9EA92D5u, 0xC2FAFCB9u, 0x616E9CA1u) + + asuint(v.c1) * uint3(0xC5C5394Bu, 0xCAE78587u, 0x7A1541C9u) + + asuint(v.c2) * uint3(0xF83BD927u, 0x6A243BCBu, 0x509B84C9u) + + asuint(v.c3) * uint3(0x91D13847u, 0x52F7230Fu, 0xCF286E83u)) + 0xE121E6ADu; + } + + /// + /// Returns a uint3 vector hash code of a float3x4 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint3 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 hashwide(float3x4 v) + { + return (asuint(v.c0) * uint3(0xC9CA1249u, 0x69B60C81u, 0xE0EB6C25u) + + asuint(v.c1) * uint3(0xF648BEABu, 0x6BDB2B07u, 0xEF63C699u) + + asuint(v.c2) * uint3(0x9001903Fu, 0xA895B9CDu, 0x9D23B201u) + + asuint(v.c3) * uint3(0x4B01D3E1u, 0x7461CA0Du, 0x79725379u)) + 0xD6258E5Bu; + } + + } +} diff --git a/src/Unity.Mathematics/float3x4.gen.cs.meta b/src/Unity.Mathematics/float3x4.gen.cs.meta new file mode 100644 index 00000000..2d90f409 --- /dev/null +++ b/src/Unity.Mathematics/float3x4.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8e85ad7d883b9468da066c1ad9de70d0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/float4.cs b/src/Unity.Mathematics/float4.cs deleted file mode 100644 index 9a3988be..00000000 --- a/src/Unity.Mathematics/float4.cs +++ /dev/null @@ -1,147 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using System.Diagnostics; - -#pragma warning disable 0660, 0661 - -namespace Unity.Mathematics -{ - [DebuggerTypeProxy(typeof(float4.DebuggerProxy))] - [System.Serializable] - public partial struct float4 : IFormattable - { - internal sealed class DebuggerProxy - { - public float x; - public float y; - public float z; - public float w; - - public DebuggerProxy(float4 vec) - { - x = vec.x; - y = vec.y; - z = vec.z; - w = vec.z; - } - } - - public float x; - public float y; - public float z; - public float w; - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public float4(float4 xyzw) - { - this.x = xyzw.x; - this.y = xyzw.y; - this.z = xyzw.z; - this.w = xyzw.w; - } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public float4(float x, float y, float z, float w) - { - this.x = x; - this.y = y; - this.z = z; - this.w = w; - } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public float4(float val) { x = y = z = w = val; } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public float4(float2 xy, float2 zw) - { - this.x = xy.x; - this.y = xy.y; - this.z = zw.x; - this.w = zw.y; - } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public float4(float2 xy, float z, float w) - { - this.x = xy.x; - this.y = xy.y; - this.z = z; - this.w = w; - } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public float4(float x, float2 yz, float w) - { - this.x = x; - this.y = yz.x; - this.z = yz.y; - this.w = w; - } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public float4(float x, float3 yzw) - { - this.x = x; - this.y = yzw.x; - this.z = yzw.y; - this.w = yzw.z; - } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public float4(float x, float y, float2 zw) - { - this.x = x; - this.y = y; - this.z = zw.x; - this.w = zw.y; - } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public float4(float3 xyz, float w) - { - this.x = xyz.x; - this.y = xyz.y; - this.z = xyz.z; - this.w = w; - } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public float4(int val) { x = y = z = w = val; } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public float4(int4 val) - { - x = val.x; - y = val.y; - z = val.z; - w = val.w; - } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public float4(bool4 val) - { - x = val.x ? 1.0f : 0.0f; - y = val.y ? 1.0f : 0.0f; - z = val.z ? 1.0f : 0.0f; - w = val.w ? 1.0f : 0.0f; - } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static implicit operator float4(float d) { return new float4(d); } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static implicit operator float4(int4 d) { return new float4(d.x, d.y, d.z, d.w); } - - public override string ToString() - { - return string.Format("float4({0}f, {1}f, {2}f, {3}f)", x, y, z, w); - } - - public string ToString(string format, IFormatProvider formatProvider) - { - return string.Format("float4({0}f, {1}f, {2}f, {3}f)", x.ToString(format, formatProvider), y.ToString(format, formatProvider), z.ToString(format, formatProvider), w.ToString(format, formatProvider)); - } - } -} - diff --git a/src/Unity.Mathematics/float4.cs.meta b/src/Unity.Mathematics/float4.cs.meta deleted file mode 100644 index bbcd1984..00000000 --- a/src/Unity.Mathematics/float4.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 667ce1d2dbb4e614287bd9c8f4e998fe -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/src/Unity.Mathematics/float4.gen.cs b/src/Unity.Mathematics/float4.gen.cs index 52056f1b..ef5d96c7 100644 --- a/src/Unity.Mathematics/float4.gen.cs +++ b/src/Unity.Mathematics/float4.gen.cs @@ -1,2924 +1,4052 @@ -// GENERATED CODE +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; using System.Runtime.CompilerServices; +using System.Diagnostics; +using Unity.IL2CPP.CompilerServices; + #pragma warning disable 0660, 0661 + namespace Unity.Mathematics { - public partial struct float4 : System.IEquatable + /// A 4 component vector of floats. + [DebuggerTypeProxy(typeof(float4.DebuggerProxy))] + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct float4 : System.IEquatable, IFormattable { + /// x component of the vector. + public float x; + /// y component of the vector. + public float y; + /// z component of the vector. + public float z; + /// w component of the vector. + public float w; + + /// float4 zero value. + public static readonly float4 zero; + + /// Constructs a float4 vector from four float values. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + /// The constructed vector's z component will be set to this value. + /// The constructed vector's w component will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4(float x, float y, float z, float w) + { + this.x = x; + this.y = y; + this.z = z; + this.w = w; + } + + /// Constructs a float4 vector from two float values and a float2 vector. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + /// The constructed vector's zw components will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4(float x, float y, float2 zw) + { + this.x = x; + this.y = y; + this.z = zw.x; + this.w = zw.y; + } + + /// Constructs a float4 vector from a float value, a float2 vector and a float value. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's yz components will be set to this value. + /// The constructed vector's w component will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4(float x, float2 yz, float w) + { + this.x = x; + this.y = yz.x; + this.z = yz.y; + this.w = w; + } + + /// Constructs a float4 vector from a float value and a float3 vector. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's yzw components will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4(float x, float3 yzw) + { + this.x = x; + this.y = yzw.x; + this.z = yzw.y; + this.w = yzw.z; + } + + /// Constructs a float4 vector from a float2 vector and two float values. + /// The constructed vector's xy components will be set to this value. + /// The constructed vector's z component will be set to this value. + /// The constructed vector's w component will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4(float2 xy, float z, float w) + { + this.x = xy.x; + this.y = xy.y; + this.z = z; + this.w = w; + } + + /// Constructs a float4 vector from two float2 vectors. + /// The constructed vector's xy components will be set to this value. + /// The constructed vector's zw components will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4(float2 xy, float2 zw) + { + this.x = xy.x; + this.y = xy.y; + this.z = zw.x; + this.w = zw.y; + } + + /// Constructs a float4 vector from a float3 vector and a float value. + /// The constructed vector's xyz components will be set to this value. + /// The constructed vector's w component will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4(float3 xyz, float w) + { + this.x = xyz.x; + this.y = xyz.y; + this.z = xyz.z; + this.w = w; + } + + /// Constructs a float4 vector from a float4 vector. + /// The constructed vector's xyzw components will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4(float4 xyzw) + { + this.x = xyzw.x; + this.y = xyzw.y; + this.z = xyzw.z; + this.w = xyzw.w; + } + + /// Constructs a float4 vector from a single float value by assigning it to every component. + /// float to convert to float4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4(float v) + { + this.x = v; + this.y = v; + this.z = v; + this.w = v; + } + + /// Constructs a float4 vector from a single bool value by converting it to float and assigning it to every component. + /// bool to convert to float4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4(bool v) + { + this.x = v ? 1.0f : 0.0f; + this.y = v ? 1.0f : 0.0f; + this.z = v ? 1.0f : 0.0f; + this.w = v ? 1.0f : 0.0f; + } + + /// Constructs a float4 vector from a bool4 vector by componentwise conversion. + /// bool4 to convert to float4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4(bool4 v) + { + this.x = v.x ? 1.0f : 0.0f; + this.y = v.y ? 1.0f : 0.0f; + this.z = v.z ? 1.0f : 0.0f; + this.w = v.w ? 1.0f : 0.0f; + } - // mul - [MethodImpl(0x100)] + /// Constructs a float4 vector from a single int value by converting it to float and assigning it to every component. + /// int to convert to float4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4(int v) + { + this.x = v; + this.y = v; + this.z = v; + this.w = v; + } + + /// Constructs a float4 vector from a int4 vector by componentwise conversion. + /// int4 to convert to float4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4(int4 v) + { + this.x = v.x; + this.y = v.y; + this.z = v.z; + this.w = v.w; + } + + /// Constructs a float4 vector from a single uint value by converting it to float and assigning it to every component. + /// uint to convert to float4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4(uint v) + { + this.x = v; + this.y = v; + this.z = v; + this.w = v; + } + + /// Constructs a float4 vector from a uint4 vector by componentwise conversion. + /// uint4 to convert to float4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4(uint4 v) + { + this.x = v.x; + this.y = v.y; + this.z = v.z; + this.w = v.w; + } + + /// Constructs a float4 vector from a single half value by converting it to float and assigning it to every component. + /// half to convert to float4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4(half v) + { + this.x = v; + this.y = v; + this.z = v; + this.w = v; + } + + /// Constructs a float4 vector from a half4 vector by componentwise conversion. + /// half4 to convert to float4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4(half4 v) + { + this.x = v.x; + this.y = v.y; + this.z = v.z; + this.w = v.w; + } + + /// Constructs a float4 vector from a single double value by converting it to float and assigning it to every component. + /// double to convert to float4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4(double v) + { + this.x = (float)v; + this.y = (float)v; + this.z = (float)v; + this.w = (float)v; + } + + /// Constructs a float4 vector from a double4 vector by componentwise conversion. + /// double4 to convert to float4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4(double4 v) + { + this.x = (float)v.x; + this.y = (float)v.y; + this.z = (float)v.z; + this.w = (float)v.w; + } + + + /// Implicitly converts a single float value to a float4 vector by assigning it to every component. + /// float to convert to float4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float4(float v) { return new float4(v); } + + /// Explicitly converts a single bool value to a float4 vector by converting it to float and assigning it to every component. + /// bool to convert to float4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float4(bool v) { return new float4(v); } + + /// Explicitly converts a bool4 vector to a float4 vector by componentwise conversion. + /// bool4 to convert to float4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float4(bool4 v) { return new float4(v); } + + /// Implicitly converts a single int value to a float4 vector by converting it to float and assigning it to every component. + /// int to convert to float4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float4(int v) { return new float4(v); } + + /// Implicitly converts a int4 vector to a float4 vector by componentwise conversion. + /// int4 to convert to float4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float4(int4 v) { return new float4(v); } + + /// Implicitly converts a single uint value to a float4 vector by converting it to float and assigning it to every component. + /// uint to convert to float4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float4(uint v) { return new float4(v); } + + /// Implicitly converts a uint4 vector to a float4 vector by componentwise conversion. + /// uint4 to convert to float4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float4(uint4 v) { return new float4(v); } + + /// Implicitly converts a single half value to a float4 vector by converting it to float and assigning it to every component. + /// half to convert to float4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float4(half v) { return new float4(v); } + + /// Implicitly converts a half4 vector to a float4 vector by componentwise conversion. + /// half4 to convert to float4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float4(half4 v) { return new float4(v); } + + /// Explicitly converts a single double value to a float4 vector by converting it to float and assigning it to every component. + /// double to convert to float4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float4(double v) { return new float4(v); } + + /// Explicitly converts a double4 vector to a float4 vector by componentwise conversion. + /// double4 to convert to float4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float4(double4 v) { return new float4(v); } + + + /// Returns the result of a componentwise multiplication operation on two float4 vectors. + /// Left hand side float4 to use to compute componentwise multiplication. + /// Right hand side float4 to use to compute componentwise multiplication. + /// float4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float4 operator * (float4 lhs, float4 rhs) { return new float4 (lhs.x * rhs.x, lhs.y * rhs.y, lhs.z * rhs.z, lhs.w * rhs.w); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise multiplication operation on a float4 vector and a float value. + /// Left hand side float4 to use to compute componentwise multiplication. + /// Right hand side float to use to compute componentwise multiplication. + /// float4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float4 operator * (float4 lhs, float rhs) { return new float4 (lhs.x * rhs, lhs.y * rhs, lhs.z * rhs, lhs.w * rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise multiplication operation on a float value and a float4 vector. + /// Left hand side float to use to compute componentwise multiplication. + /// Right hand side float4 to use to compute componentwise multiplication. + /// float4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float4 operator * (float lhs, float4 rhs) { return new float4 (lhs * rhs.x, lhs * rhs.y, lhs * rhs.z, lhs * rhs.w); } - // add - [MethodImpl(0x100)] + + /// Returns the result of a componentwise addition operation on two float4 vectors. + /// Left hand side float4 to use to compute componentwise addition. + /// Right hand side float4 to use to compute componentwise addition. + /// float4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float4 operator + (float4 lhs, float4 rhs) { return new float4 (lhs.x + rhs.x, lhs.y + rhs.y, lhs.z + rhs.z, lhs.w + rhs.w); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise addition operation on a float4 vector and a float value. + /// Left hand side float4 to use to compute componentwise addition. + /// Right hand side float to use to compute componentwise addition. + /// float4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float4 operator + (float4 lhs, float rhs) { return new float4 (lhs.x + rhs, lhs.y + rhs, lhs.z + rhs, lhs.w + rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise addition operation on a float value and a float4 vector. + /// Left hand side float to use to compute componentwise addition. + /// Right hand side float4 to use to compute componentwise addition. + /// float4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float4 operator + (float lhs, float4 rhs) { return new float4 (lhs + rhs.x, lhs + rhs.y, lhs + rhs.z, lhs + rhs.w); } - // sub - [MethodImpl(0x100)] + + /// Returns the result of a componentwise subtraction operation on two float4 vectors. + /// Left hand side float4 to use to compute componentwise subtraction. + /// Right hand side float4 to use to compute componentwise subtraction. + /// float4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float4 operator - (float4 lhs, float4 rhs) { return new float4 (lhs.x - rhs.x, lhs.y - rhs.y, lhs.z - rhs.z, lhs.w - rhs.w); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise subtraction operation on a float4 vector and a float value. + /// Left hand side float4 to use to compute componentwise subtraction. + /// Right hand side float to use to compute componentwise subtraction. + /// float4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float4 operator - (float4 lhs, float rhs) { return new float4 (lhs.x - rhs, lhs.y - rhs, lhs.z - rhs, lhs.w - rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise subtraction operation on a float value and a float4 vector. + /// Left hand side float to use to compute componentwise subtraction. + /// Right hand side float4 to use to compute componentwise subtraction. + /// float4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float4 operator - (float lhs, float4 rhs) { return new float4 (lhs - rhs.x, lhs - rhs.y, lhs - rhs.z, lhs - rhs.w); } - // div - [MethodImpl(0x100)] + + /// Returns the result of a componentwise division operation on two float4 vectors. + /// Left hand side float4 to use to compute componentwise division. + /// Right hand side float4 to use to compute componentwise division. + /// float4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float4 operator / (float4 lhs, float4 rhs) { return new float4 (lhs.x / rhs.x, lhs.y / rhs.y, lhs.z / rhs.z, lhs.w / rhs.w); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise division operation on a float4 vector and a float value. + /// Left hand side float4 to use to compute componentwise division. + /// Right hand side float to use to compute componentwise division. + /// float4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float4 operator / (float4 lhs, float rhs) { return new float4 (lhs.x / rhs, lhs.y / rhs, lhs.z / rhs, lhs.w / rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise division operation on a float value and a float4 vector. + /// Left hand side float to use to compute componentwise division. + /// Right hand side float4 to use to compute componentwise division. + /// float4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float4 operator / (float lhs, float4 rhs) { return new float4 (lhs / rhs.x, lhs / rhs.y, lhs / rhs.z, lhs / rhs.w); } - // smaller - [MethodImpl(0x100)] + + /// Returns the result of a componentwise modulus operation on two float4 vectors. + /// Left hand side float4 to use to compute componentwise modulus. + /// Right hand side float4 to use to compute componentwise modulus. + /// float4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 operator % (float4 lhs, float4 rhs) { return new float4 (lhs.x % rhs.x, lhs.y % rhs.y, lhs.z % rhs.z, lhs.w % rhs.w); } + + /// Returns the result of a componentwise modulus operation on a float4 vector and a float value. + /// Left hand side float4 to use to compute componentwise modulus. + /// Right hand side float to use to compute componentwise modulus. + /// float4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 operator % (float4 lhs, float rhs) { return new float4 (lhs.x % rhs, lhs.y % rhs, lhs.z % rhs, lhs.w % rhs); } + + /// Returns the result of a componentwise modulus operation on a float value and a float4 vector. + /// Left hand side float to use to compute componentwise modulus. + /// Right hand side float4 to use to compute componentwise modulus. + /// float4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 operator % (float lhs, float4 rhs) { return new float4 (lhs % rhs.x, lhs % rhs.y, lhs % rhs.z, lhs % rhs.w); } + + + /// Returns the result of a componentwise increment operation on a float4 vector. + /// Value to use when computing the componentwise increment. + /// float4 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 operator ++ (float4 val) { return new float4 (++val.x, ++val.y, ++val.z, ++val.w); } + + + /// Returns the result of a componentwise decrement operation on a float4 vector. + /// Value to use when computing the componentwise decrement. + /// float4 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 operator -- (float4 val) { return new float4 (--val.x, --val.y, --val.z, --val.w); } + + + /// Returns the result of a componentwise less than operation on two float4 vectors. + /// Left hand side float4 to use to compute componentwise less than. + /// Right hand side float4 to use to compute componentwise less than. + /// bool4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator < (float4 lhs, float4 rhs) { return new bool4 (lhs.x < rhs.x, lhs.y < rhs.y, lhs.z < rhs.z, lhs.w < rhs.w); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise less than operation on a float4 vector and a float value. + /// Left hand side float4 to use to compute componentwise less than. + /// Right hand side float to use to compute componentwise less than. + /// bool4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator < (float4 lhs, float rhs) { return new bool4 (lhs.x < rhs, lhs.y < rhs, lhs.z < rhs, lhs.w < rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise less than operation on a float value and a float4 vector. + /// Left hand side float to use to compute componentwise less than. + /// Right hand side float4 to use to compute componentwise less than. + /// bool4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator < (float lhs, float4 rhs) { return new bool4 (lhs < rhs.x, lhs < rhs.y, lhs < rhs.z, lhs < rhs.w); } - [MethodImpl(0x100)] + + + /// Returns the result of a componentwise less or equal operation on two float4 vectors. + /// Left hand side float4 to use to compute componentwise less or equal. + /// Right hand side float4 to use to compute componentwise less or equal. + /// bool4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator <= (float4 lhs, float4 rhs) { return new bool4 (lhs.x <= rhs.x, lhs.y <= rhs.y, lhs.z <= rhs.z, lhs.w <= rhs.w); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise less or equal operation on a float4 vector and a float value. + /// Left hand side float4 to use to compute componentwise less or equal. + /// Right hand side float to use to compute componentwise less or equal. + /// bool4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator <= (float4 lhs, float rhs) { return new bool4 (lhs.x <= rhs, lhs.y <= rhs, lhs.z <= rhs, lhs.w <= rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise less or equal operation on a float value and a float4 vector. + /// Left hand side float to use to compute componentwise less or equal. + /// Right hand side float4 to use to compute componentwise less or equal. + /// bool4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator <= (float lhs, float4 rhs) { return new bool4 (lhs <= rhs.x, lhs <= rhs.y, lhs <= rhs.z, lhs <= rhs.w); } - // greater - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater than operation on two float4 vectors. + /// Left hand side float4 to use to compute componentwise greater than. + /// Right hand side float4 to use to compute componentwise greater than. + /// bool4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator > (float4 lhs, float4 rhs) { return new bool4 (lhs.x > rhs.x, lhs.y > rhs.y, lhs.z > rhs.z, lhs.w > rhs.w); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater than operation on a float4 vector and a float value. + /// Left hand side float4 to use to compute componentwise greater than. + /// Right hand side float to use to compute componentwise greater than. + /// bool4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator > (float4 lhs, float rhs) { return new bool4 (lhs.x > rhs, lhs.y > rhs, lhs.z > rhs, lhs.w > rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater than operation on a float value and a float4 vector. + /// Left hand side float to use to compute componentwise greater than. + /// Right hand side float4 to use to compute componentwise greater than. + /// bool4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator > (float lhs, float4 rhs) { return new bool4 (lhs > rhs.x, lhs > rhs.y, lhs > rhs.z, lhs > rhs.w); } - [MethodImpl(0x100)] + + + /// Returns the result of a componentwise greater or equal operation on two float4 vectors. + /// Left hand side float4 to use to compute componentwise greater or equal. + /// Right hand side float4 to use to compute componentwise greater or equal. + /// bool4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator >= (float4 lhs, float4 rhs) { return new bool4 (lhs.x >= rhs.x, lhs.y >= rhs.y, lhs.z >= rhs.z, lhs.w >= rhs.w); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater or equal operation on a float4 vector and a float value. + /// Left hand side float4 to use to compute componentwise greater or equal. + /// Right hand side float to use to compute componentwise greater or equal. + /// bool4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator >= (float4 lhs, float rhs) { return new bool4 (lhs.x >= rhs, lhs.y >= rhs, lhs.z >= rhs, lhs.w >= rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater or equal operation on a float value and a float4 vector. + /// Left hand side float to use to compute componentwise greater or equal. + /// Right hand side float4 to use to compute componentwise greater or equal. + /// bool4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator >= (float lhs, float4 rhs) { return new bool4 (lhs >= rhs.x, lhs >= rhs.y, lhs >= rhs.z, lhs >= rhs.w); } - // neg - [MethodImpl(0x100)] + + /// Returns the result of a componentwise unary minus operation on a float4 vector. + /// Value to use when computing the componentwise unary minus. + /// float4 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float4 operator - (float4 val) { return new float4 (-val.x, -val.y, -val.z, -val.w); } - // plus - [MethodImpl(0x100)] + + + /// Returns the result of a componentwise unary plus operation on a float4 vector. + /// Value to use when computing the componentwise unary plus. + /// float4 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float4 operator + (float4 val) { return new float4 (+val.x, +val.y, +val.z, +val.w); } - // equal - [MethodImpl(0x100)] + + + /// Returns the result of a componentwise equality operation on two float4 vectors. + /// Left hand side float4 to use to compute componentwise equality. + /// Right hand side float4 to use to compute componentwise equality. + /// bool4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator == (float4 lhs, float4 rhs) { return new bool4 (lhs.x == rhs.x, lhs.y == rhs.y, lhs.z == rhs.z, lhs.w == rhs.w); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise equality operation on a float4 vector and a float value. + /// Left hand side float4 to use to compute componentwise equality. + /// Right hand side float to use to compute componentwise equality. + /// bool4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator == (float4 lhs, float rhs) { return new bool4 (lhs.x == rhs, lhs.y == rhs, lhs.z == rhs, lhs.w == rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise equality operation on a float value and a float4 vector. + /// Left hand side float to use to compute componentwise equality. + /// Right hand side float4 to use to compute componentwise equality. + /// bool4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator == (float lhs, float4 rhs) { return new bool4 (lhs == rhs.x, lhs == rhs.y, lhs == rhs.z, lhs == rhs.w); } - // not equal - [MethodImpl(0x100)] + + /// Returns the result of a componentwise not equal operation on two float4 vectors. + /// Left hand side float4 to use to compute componentwise not equal. + /// Right hand side float4 to use to compute componentwise not equal. + /// bool4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator != (float4 lhs, float4 rhs) { return new bool4 (lhs.x != rhs.x, lhs.y != rhs.y, lhs.z != rhs.z, lhs.w != rhs.w); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise not equal operation on a float4 vector and a float value. + /// Left hand side float4 to use to compute componentwise not equal. + /// Right hand side float to use to compute componentwise not equal. + /// bool4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator != (float4 lhs, float rhs) { return new bool4 (lhs.x != rhs, lhs.y != rhs, lhs.z != rhs, lhs.w != rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise not equal operation on a float value and a float4 vector. + /// Left hand side float to use to compute componentwise not equal. + /// Right hand side float4 to use to compute componentwise not equal. + /// bool4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator != (float lhs, float4 rhs) { return new bool4 (lhs != rhs.x, lhs != rhs.y, lhs != rhs.z, lhs != rhs.w); } - // Equals - [MethodImpl(0x100)] - public bool Equals(float4 rhs) { return x == rhs.x && y == rhs.y && z == rhs.z && w == rhs.w; } - // [int index] - unsafe public float this[int index] - { - get - { -#if ENABLE_UNITY_COLLECTIONS_CHECKS - if ((uint)index >= 4) - throw new System.ArgumentException("index must be between[0...3]"); -#endif - fixed (float4* array = &this) { return ((float*)array)[index]; } - } - set - { -#if ENABLE_UNITY_COLLECTIONS_CHECKS - if ((uint)index >= 4) - throw new System.ArgumentException("index must be between[0...3]"); -#endif - fixed (float4* array = &this) { ((float*)array)[index] = value; } - } - } + + + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xxxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xxxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xxxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, x, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xxxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, x, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xxyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xxyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xxyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, x, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xxyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, x, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xxzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, x, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xxzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, x, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xxzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, x, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xxzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, x, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xxwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, x, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xxwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, x, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xxwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, x, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xxww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, x, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xyxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xyxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xyxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, y, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xyxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, y, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xyyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xyyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xyyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, y, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xyyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, y, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xyzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, y, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xyzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, y, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xyzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, y, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xyzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, y, z, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; y = value.y; z = value.z; w = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xywx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, y, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xywy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, y, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xywz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, y, w, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; y = value.y; w = value.z; z = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xyww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, y, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xzxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, z, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xzxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, z, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xzxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, z, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xzxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, z, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xzyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, z, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xzyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, z, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xzyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, z, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xzyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, z, y, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; z = value.y; y = value.z; w = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xzzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, z, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xzzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, z, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xzzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, z, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xzzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, z, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xzwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, z, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xzwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, z, w, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; z = value.y; w = value.z; y = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xzwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, z, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xzww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, z, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xwxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, w, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xwxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, w, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xwxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, w, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xwxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, w, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xwyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, w, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xwyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, w, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xwyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, w, y, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; w = value.y; y = value.z; z = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xwyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, w, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xwzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, w, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xwzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, w, z, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; w = value.y; z = value.z; y = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xwzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, w, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xwzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, w, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xwwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, w, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xwwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, w, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xwwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, w, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 xwww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(x, w, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yxxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yxxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yxxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, x, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yxxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, x, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yxyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yxyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yxyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, x, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yxyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, x, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yxzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, x, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yxzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, x, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yxzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, x, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yxzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, x, z, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; x = value.y; z = value.z; w = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yxwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, x, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yxwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, x, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yxwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, x, w, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; x = value.y; w = value.z; z = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yxww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, x, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yyxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yyxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yyxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, y, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yyxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, y, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yyyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yyyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yyyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, y, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yyyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, y, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yyzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, y, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yyzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, y, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yyzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, y, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yyzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, y, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yywx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, y, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yywy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, y, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yywz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, y, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yyww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, y, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yzxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, z, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yzxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, z, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yzxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, z, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yzxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, z, x, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; z = value.y; x = value.z; w = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yzyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, z, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yzyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, z, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yzyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, z, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yzyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, z, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yzzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, z, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yzzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, z, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yzzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, z, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yzzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, z, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yzwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, z, w, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; z = value.y; w = value.z; x = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yzwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, z, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yzwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, z, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 yzww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, z, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 ywxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, w, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 ywxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, w, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 ywxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, w, x, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; w = value.y; x = value.z; z = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 ywxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, w, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 ywyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, w, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 ywyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, w, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 ywyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, w, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 ywyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, w, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 ywzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, w, z, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; w = value.y; z = value.z; x = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 ywzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, w, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 ywzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, w, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 ywzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, w, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 ywwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, w, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 ywwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, w, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 ywwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, w, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 ywww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(y, w, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zxxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zxxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zxxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, x, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zxxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, x, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zxyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zxyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zxyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, x, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zxyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, x, y, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; x = value.y; y = value.z; w = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zxzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, x, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zxzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, x, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zxzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, x, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zxzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, x, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zxwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, x, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zxwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, x, w, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; x = value.y; w = value.z; y = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zxwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, x, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zxww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, x, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zyxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zyxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zyxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, y, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zyxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, y, x, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; y = value.y; x = value.z; w = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zyyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zyyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zyyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, y, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zyyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, y, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zyzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, y, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zyzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, y, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zyzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, y, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zyzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, y, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zywx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, y, w, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; y = value.y; w = value.z; x = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zywy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, y, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zywz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, y, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zyww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, y, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zzxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, z, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zzxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, z, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zzxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, z, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zzxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, z, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zzyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, z, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zzyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, z, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zzyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, z, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zzyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, z, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zzzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, z, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zzzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, z, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zzzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, z, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zzzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, z, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zzwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, z, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zzwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, z, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zzwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, z, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zzww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, z, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zwxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, w, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zwxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, w, x, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; w = value.y; x = value.z; y = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zwxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, w, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zwxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, w, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zwyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, w, y, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; w = value.y; y = value.z; x = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zwyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, w, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zwyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, w, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zwyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, w, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zwzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, w, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zwzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, w, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zwzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, w, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zwzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, w, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zwwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, w, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zwwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, w, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zwwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, w, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 zwww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(z, w, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wxxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wxxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wxxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, x, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wxxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, x, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wxyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wxyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wxyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, x, y, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; x = value.y; y = value.z; z = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wxyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, x, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wxzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, x, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wxzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, x, z, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; x = value.y; z = value.z; y = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wxzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, x, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wxzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, x, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wxwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, x, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wxwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, x, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wxwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, x, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wxww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, x, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wyxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wyxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wyxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, y, x, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; y = value.y; x = value.z; z = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wyxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, y, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wyyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wyyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wyyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, y, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wyyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, y, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wyzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, y, z, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; y = value.y; z = value.z; x = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wyzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, y, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wyzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, y, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wyzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, y, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wywx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, y, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wywy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, y, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wywz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, y, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wyww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, y, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wzxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, z, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wzxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, z, x, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; z = value.y; x = value.z; y = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wzxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, z, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wzxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, z, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wzyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, z, y, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; z = value.y; y = value.z; x = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wzyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, z, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wzyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, z, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wzyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, z, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wzzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, z, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wzzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, z, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wzzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, z, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wzzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, z, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wzwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, z, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wzwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, z, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wzwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, z, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wzww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, z, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wwxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, w, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wwxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, w, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wwxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, w, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wwxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, w, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wwyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, w, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wwyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, w, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wwyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, w, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wwyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, w, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wwzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, w, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wwzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, w, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wwzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, w, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wwzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, w, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wwwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, w, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wwwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, w, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wwwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, w, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float4 wwww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float4(w, w, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 xxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 xxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 xxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(x, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 xxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(x, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 xyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 xyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 xyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(x, y, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; y = value.y; z = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 xyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(x, y, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; y = value.y; w = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 xzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(x, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 xzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(x, z, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; z = value.y; y = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 xzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(x, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 xzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(x, z, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; z = value.y; w = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 xwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(x, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 xwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(x, w, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; w = value.y; y = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 xwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(x, w, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; w = value.y; z = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 xww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(x, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 yxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 yxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 yxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(y, x, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; x = value.y; z = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 yxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(y, x, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; x = value.y; w = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 yyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 yyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 yyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(y, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 yyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(y, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 yzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(y, z, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; z = value.y; x = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 yzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(y, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 yzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(y, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 yzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(y, z, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; z = value.y; w = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 ywx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(y, w, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; w = value.y; x = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 ywy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(y, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 ywz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(y, w, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; w = value.y; z = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 yww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(y, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 zxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(z, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 zxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(z, x, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; x = value.y; y = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 zxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(z, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 zxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(z, x, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; x = value.y; w = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 zyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(z, y, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; y = value.y; x = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 zyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(z, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 zyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(z, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 zyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(z, y, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; y = value.y; w = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 zzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(z, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 zzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(z, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 zzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(z, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 zzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(z, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 zwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(z, w, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; w = value.y; x = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 zwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(z, w, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; w = value.y; y = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 zwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(z, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 zww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(z, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 wxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(w, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 wxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(w, x, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; x = value.y; y = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 wxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(w, x, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; x = value.y; z = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 wxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(w, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 wyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(w, y, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; y = value.y; x = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 wyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(w, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 wyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(w, y, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; y = value.y; z = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 wyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(w, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 wzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(w, z, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; z = value.y; x = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 wzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(w, z, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; z = value.y; y = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 wzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(w, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 wzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(w, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 wwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(w, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 wwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(w, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 wwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(w, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float3 www { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float3(w, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float2 xx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float2(x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float2 xy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float2(x, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; y = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float2 xz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float2(x, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; z = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float2 xw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float2(x, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; w = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float2 yx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float2(y, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; x = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float2 yy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float2(y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float2 yz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float2(y, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; z = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float2 yw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float2(y, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; w = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float2 zx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float2(z, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; x = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float2 zy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float2(z, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; y = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float2 zz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float2(z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float2 zw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float2(z, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; w = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float2 wx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float2(w, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; x = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float2 wy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float2(w, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; y = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float2 wz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float2(w, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; z = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public float2 ww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new float2(w, w); } } + + /// Returns the float element at a specified index. + unsafe public float this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 4) + throw new System.ArgumentException("index must be between[0...3]"); +#endif + fixed (float4* array = &this) { return ((float*)array)[index]; } + } + set + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 4) + throw new System.ArgumentException("index must be between[0...3]"); +#endif + fixed (float* array = &x) { array[index] = value; } + } + } + + /// Returns true if the float4 is equal to a given float4, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(float4 rhs) { return x == rhs.x && y == rhs.y && z == rhs.z && w == rhs.w; } + + /// Returns true if the float4 is equal to a given float4, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is float4 converted && Equals(converted); } + + + /// Returns a hash code for the float4. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the float4. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("float4({0}f, {1}f, {2}f, {3}f)", x, y, z, w); + } + + /// Returns a string representation of the float4 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("float4({0}f, {1}f, {2}f, {3}f)", x.ToString(format, formatProvider), y.ToString(format, formatProvider), z.ToString(format, formatProvider), w.ToString(format, formatProvider)); + } + + internal sealed class DebuggerProxy + { + public float x; + public float y; + public float z; + public float w; + public DebuggerProxy(float4 v) + { + x = v.x; + y = v.y; + z = v.z; + w = v.w; + } + } + + } + + public static partial class math + { + /// Returns a float4 vector constructed from four float values. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + /// The constructed vector's z component will be set to this value. + /// The constructed vector's w component will be set to this value. + /// float4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 float4(float x, float y, float z, float w) { return new float4(x, y, z, w); } + + /// Returns a float4 vector constructed from two float values and a float2 vector. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + /// The constructed vector's zw components will be set to this value. + /// float4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 float4(float x, float y, float2 zw) { return new float4(x, y, zw); } + + /// Returns a float4 vector constructed from a float value, a float2 vector and a float value. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's yz components will be set to this value. + /// The constructed vector's w component will be set to this value. + /// float4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 float4(float x, float2 yz, float w) { return new float4(x, yz, w); } + + /// Returns a float4 vector constructed from a float value and a float3 vector. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's yzw components will be set to this value. + /// float4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 float4(float x, float3 yzw) { return new float4(x, yzw); } + + /// Returns a float4 vector constructed from a float2 vector and two float values. + /// The constructed vector's xy components will be set to this value. + /// The constructed vector's z component will be set to this value. + /// The constructed vector's w component will be set to this value. + /// float4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 float4(float2 xy, float z, float w) { return new float4(xy, z, w); } + + /// Returns a float4 vector constructed from two float2 vectors. + /// The constructed vector's xy components will be set to this value. + /// The constructed vector's zw components will be set to this value. + /// float4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 float4(float2 xy, float2 zw) { return new float4(xy, zw); } + + /// Returns a float4 vector constructed from a float3 vector and a float value. + /// The constructed vector's xyz components will be set to this value. + /// The constructed vector's w component will be set to this value. + /// float4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 float4(float3 xyz, float w) { return new float4(xyz, w); } + + /// Returns a float4 vector constructed from a float4 vector. + /// The constructed vector's xyzw components will be set to this value. + /// float4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 float4(float4 xyzw) { return new float4(xyzw); } + + /// Returns a float4 vector constructed from a single float value by assigning it to every component. + /// float to convert to float4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 float4(float v) { return new float4(v); } + + /// Returns a float4 vector constructed from a single bool value by converting it to float and assigning it to every component. + /// bool to convert to float4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 float4(bool v) { return new float4(v); } + + /// Return a float4 vector constructed from a bool4 vector by componentwise conversion. + /// bool4 to convert to float4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 float4(bool4 v) { return new float4(v); } + + /// Returns a float4 vector constructed from a single int value by converting it to float and assigning it to every component. + /// int to convert to float4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 float4(int v) { return new float4(v); } + + /// Return a float4 vector constructed from a int4 vector by componentwise conversion. + /// int4 to convert to float4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 float4(int4 v) { return new float4(v); } + + /// Returns a float4 vector constructed from a single uint value by converting it to float and assigning it to every component. + /// uint to convert to float4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 float4(uint v) { return new float4(v); } + + /// Return a float4 vector constructed from a uint4 vector by componentwise conversion. + /// uint4 to convert to float4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 float4(uint4 v) { return new float4(v); } + + /// Returns a float4 vector constructed from a single half value by converting it to float and assigning it to every component. + /// half to convert to float4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 float4(half v) { return new float4(v); } + + /// Return a float4 vector constructed from a half4 vector by componentwise conversion. + /// half4 to convert to float4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 float4(half4 v) { return new float4(v); } + + /// Returns a float4 vector constructed from a single double value by converting it to float and assigning it to every component. + /// double to convert to float4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 float4(double v) { return new float4(v); } + + /// Return a float4 vector constructed from a double4 vector by componentwise conversion. + /// double4 to convert to float4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 float4(double4 v) { return new float4(v); } + + /// Returns a uint hash code of a float4 vector. + /// Vector value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(float4 v) + { + return csum(asuint(v) * uint4(0xE69626FFu, 0xBD010EEBu, 0x9CEDE1D1u, 0x43BE0B51u)) + 0xAF836EE1u; + } + + /// + /// Returns a uint4 vector hash code of a float4 vector. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Vector value to hash. + /// uint4 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 hashwide(float4 v) + { + return (asuint(v) * uint4(0xB130C137u, 0x54834775u, 0x7C022221u, 0xA2D00EDFu)) + 0xA8977779u; + } + + /// Returns the result of specified shuffling of the components from two float4 vectors into a float value. + /// float4 to use as the left argument of the shuffle operation. + /// float4 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting float. + /// float result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float shuffle(float4 left, float4 right, ShuffleComponent x) + { + return select_shuffle_component(left, right, x); + } + + /// Returns the result of specified shuffling of the components from two float4 vectors into a float2 vector. + /// float4 to use as the left argument of the shuffle operation. + /// float4 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting float2 x component. + /// The ShuffleComponent to use when setting the resulting float2 y component. + /// float2 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 shuffle(float4 left, float4 right, ShuffleComponent x, ShuffleComponent y) + { + return float2( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y)); + } + + /// Returns the result of specified shuffling of the components from two float4 vectors into a float3 vector. + /// float4 to use as the left argument of the shuffle operation. + /// float4 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting float3 x component. + /// The ShuffleComponent to use when setting the resulting float3 y component. + /// The ShuffleComponent to use when setting the resulting float3 z component. + /// float3 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 shuffle(float4 left, float4 right, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z) + { + return float3( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y), + select_shuffle_component(left, right, z)); + } + + /// Returns the result of specified shuffling of the components from two float4 vectors into a float4 vector. + /// float4 to use as the left argument of the shuffle operation. + /// float4 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting float4 x component. + /// The ShuffleComponent to use when setting the resulting float4 y component. + /// The ShuffleComponent to use when setting the resulting float4 z component. + /// The ShuffleComponent to use when setting the resulting float4 w component. + /// float4 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 shuffle(float4 left, float4 right, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z, ShuffleComponent w) + { + return float4( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y), + select_shuffle_component(left, right, z), + select_shuffle_component(left, right, w)); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static float select_shuffle_component(float4 a, float4 b, ShuffleComponent component) + { + switch(component) + { + case ShuffleComponent.LeftX: + return a.x; + case ShuffleComponent.LeftY: + return a.y; + case ShuffleComponent.LeftZ: + return a.z; + case ShuffleComponent.LeftW: + return a.w; + case ShuffleComponent.RightX: + return b.x; + case ShuffleComponent.RightY: + return b.y; + case ShuffleComponent.RightZ: + return b.z; + case ShuffleComponent.RightW: + return b.w; + default: + throw new System.ArgumentException("Invalid shuffle component: " + component); + } + } + } } diff --git a/src/Unity.Mathematics/float4x2.gen.cs b/src/Unity.Mathematics/float4x2.gen.cs new file mode 100644 index 00000000..1b5d6b10 --- /dev/null +++ b/src/Unity.Mathematics/float4x2.gen.cs @@ -0,0 +1,639 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 4x2 matrix of floats. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct float4x2 : System.IEquatable, IFormattable + { + /// Column 0 of the matrix. + public float4 c0; + /// Column 1 of the matrix. + public float4 c1; + + /// float4x2 zero value. + public static readonly float4x2 zero; + + /// Constructs a float4x2 matrix from two float4 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4x2(float4 c0, float4 c1) + { + this.c0 = c0; + this.c1 = c1; + } + + /// Constructs a float4x2 matrix from 8 float values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 3, column 0 will be set to this value. + /// The matrix at row 3, column 1 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4x2(float m00, float m01, + float m10, float m11, + float m20, float m21, + float m30, float m31) + { + this.c0 = new float4(m00, m10, m20, m30); + this.c1 = new float4(m01, m11, m21, m31); + } + + /// Constructs a float4x2 matrix from a single float value by assigning it to every component. + /// float to convert to float4x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4x2(float v) + { + this.c0 = v; + this.c1 = v; + } + + /// Constructs a float4x2 matrix from a single bool value by converting it to float and assigning it to every component. + /// bool to convert to float4x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4x2(bool v) + { + this.c0 = math.select(new float4(0.0f), new float4(1.0f), v); + this.c1 = math.select(new float4(0.0f), new float4(1.0f), v); + } + + /// Constructs a float4x2 matrix from a bool4x2 matrix by componentwise conversion. + /// bool4x2 to convert to float4x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4x2(bool4x2 v) + { + this.c0 = math.select(new float4(0.0f), new float4(1.0f), v.c0); + this.c1 = math.select(new float4(0.0f), new float4(1.0f), v.c1); + } + + /// Constructs a float4x2 matrix from a single int value by converting it to float and assigning it to every component. + /// int to convert to float4x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4x2(int v) + { + this.c0 = v; + this.c1 = v; + } + + /// Constructs a float4x2 matrix from a int4x2 matrix by componentwise conversion. + /// int4x2 to convert to float4x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4x2(int4x2 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + } + + /// Constructs a float4x2 matrix from a single uint value by converting it to float and assigning it to every component. + /// uint to convert to float4x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4x2(uint v) + { + this.c0 = v; + this.c1 = v; + } + + /// Constructs a float4x2 matrix from a uint4x2 matrix by componentwise conversion. + /// uint4x2 to convert to float4x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4x2(uint4x2 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + } + + /// Constructs a float4x2 matrix from a single double value by converting it to float and assigning it to every component. + /// double to convert to float4x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4x2(double v) + { + this.c0 = (float4)v; + this.c1 = (float4)v; + } + + /// Constructs a float4x2 matrix from a double4x2 matrix by componentwise conversion. + /// double4x2 to convert to float4x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4x2(double4x2 v) + { + this.c0 = (float4)v.c0; + this.c1 = (float4)v.c1; + } + + + /// Implicitly converts a single float value to a float4x2 matrix by assigning it to every component. + /// float to convert to float4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float4x2(float v) { return new float4x2(v); } + + /// Explicitly converts a single bool value to a float4x2 matrix by converting it to float and assigning it to every component. + /// bool to convert to float4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float4x2(bool v) { return new float4x2(v); } + + /// Explicitly converts a bool4x2 matrix to a float4x2 matrix by componentwise conversion. + /// bool4x2 to convert to float4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float4x2(bool4x2 v) { return new float4x2(v); } + + /// Implicitly converts a single int value to a float4x2 matrix by converting it to float and assigning it to every component. + /// int to convert to float4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float4x2(int v) { return new float4x2(v); } + + /// Implicitly converts a int4x2 matrix to a float4x2 matrix by componentwise conversion. + /// int4x2 to convert to float4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float4x2(int4x2 v) { return new float4x2(v); } + + /// Implicitly converts a single uint value to a float4x2 matrix by converting it to float and assigning it to every component. + /// uint to convert to float4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float4x2(uint v) { return new float4x2(v); } + + /// Implicitly converts a uint4x2 matrix to a float4x2 matrix by componentwise conversion. + /// uint4x2 to convert to float4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float4x2(uint4x2 v) { return new float4x2(v); } + + /// Explicitly converts a single double value to a float4x2 matrix by converting it to float and assigning it to every component. + /// double to convert to float4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float4x2(double v) { return new float4x2(v); } + + /// Explicitly converts a double4x2 matrix to a float4x2 matrix by componentwise conversion. + /// double4x2 to convert to float4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float4x2(double4x2 v) { return new float4x2(v); } + + + /// Returns the result of a componentwise multiplication operation on two float4x2 matrices. + /// Left hand side float4x2 to use to compute componentwise multiplication. + /// Right hand side float4x2 to use to compute componentwise multiplication. + /// float4x2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x2 operator * (float4x2 lhs, float4x2 rhs) { return new float4x2 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1); } + + /// Returns the result of a componentwise multiplication operation on a float4x2 matrix and a float value. + /// Left hand side float4x2 to use to compute componentwise multiplication. + /// Right hand side float to use to compute componentwise multiplication. + /// float4x2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x2 operator * (float4x2 lhs, float rhs) { return new float4x2 (lhs.c0 * rhs, lhs.c1 * rhs); } + + /// Returns the result of a componentwise multiplication operation on a float value and a float4x2 matrix. + /// Left hand side float to use to compute componentwise multiplication. + /// Right hand side float4x2 to use to compute componentwise multiplication. + /// float4x2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x2 operator * (float lhs, float4x2 rhs) { return new float4x2 (lhs * rhs.c0, lhs * rhs.c1); } + + + /// Returns the result of a componentwise addition operation on two float4x2 matrices. + /// Left hand side float4x2 to use to compute componentwise addition. + /// Right hand side float4x2 to use to compute componentwise addition. + /// float4x2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x2 operator + (float4x2 lhs, float4x2 rhs) { return new float4x2 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1); } + + /// Returns the result of a componentwise addition operation on a float4x2 matrix and a float value. + /// Left hand side float4x2 to use to compute componentwise addition. + /// Right hand side float to use to compute componentwise addition. + /// float4x2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x2 operator + (float4x2 lhs, float rhs) { return new float4x2 (lhs.c0 + rhs, lhs.c1 + rhs); } + + /// Returns the result of a componentwise addition operation on a float value and a float4x2 matrix. + /// Left hand side float to use to compute componentwise addition. + /// Right hand side float4x2 to use to compute componentwise addition. + /// float4x2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x2 operator + (float lhs, float4x2 rhs) { return new float4x2 (lhs + rhs.c0, lhs + rhs.c1); } + + + /// Returns the result of a componentwise subtraction operation on two float4x2 matrices. + /// Left hand side float4x2 to use to compute componentwise subtraction. + /// Right hand side float4x2 to use to compute componentwise subtraction. + /// float4x2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x2 operator - (float4x2 lhs, float4x2 rhs) { return new float4x2 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1); } + + /// Returns the result of a componentwise subtraction operation on a float4x2 matrix and a float value. + /// Left hand side float4x2 to use to compute componentwise subtraction. + /// Right hand side float to use to compute componentwise subtraction. + /// float4x2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x2 operator - (float4x2 lhs, float rhs) { return new float4x2 (lhs.c0 - rhs, lhs.c1 - rhs); } + + /// Returns the result of a componentwise subtraction operation on a float value and a float4x2 matrix. + /// Left hand side float to use to compute componentwise subtraction. + /// Right hand side float4x2 to use to compute componentwise subtraction. + /// float4x2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x2 operator - (float lhs, float4x2 rhs) { return new float4x2 (lhs - rhs.c0, lhs - rhs.c1); } + + + /// Returns the result of a componentwise division operation on two float4x2 matrices. + /// Left hand side float4x2 to use to compute componentwise division. + /// Right hand side float4x2 to use to compute componentwise division. + /// float4x2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x2 operator / (float4x2 lhs, float4x2 rhs) { return new float4x2 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1); } + + /// Returns the result of a componentwise division operation on a float4x2 matrix and a float value. + /// Left hand side float4x2 to use to compute componentwise division. + /// Right hand side float to use to compute componentwise division. + /// float4x2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x2 operator / (float4x2 lhs, float rhs) { return new float4x2 (lhs.c0 / rhs, lhs.c1 / rhs); } + + /// Returns the result of a componentwise division operation on a float value and a float4x2 matrix. + /// Left hand side float to use to compute componentwise division. + /// Right hand side float4x2 to use to compute componentwise division. + /// float4x2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x2 operator / (float lhs, float4x2 rhs) { return new float4x2 (lhs / rhs.c0, lhs / rhs.c1); } + + + /// Returns the result of a componentwise modulus operation on two float4x2 matrices. + /// Left hand side float4x2 to use to compute componentwise modulus. + /// Right hand side float4x2 to use to compute componentwise modulus. + /// float4x2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x2 operator % (float4x2 lhs, float4x2 rhs) { return new float4x2 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1); } + + /// Returns the result of a componentwise modulus operation on a float4x2 matrix and a float value. + /// Left hand side float4x2 to use to compute componentwise modulus. + /// Right hand side float to use to compute componentwise modulus. + /// float4x2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x2 operator % (float4x2 lhs, float rhs) { return new float4x2 (lhs.c0 % rhs, lhs.c1 % rhs); } + + /// Returns the result of a componentwise modulus operation on a float value and a float4x2 matrix. + /// Left hand side float to use to compute componentwise modulus. + /// Right hand side float4x2 to use to compute componentwise modulus. + /// float4x2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x2 operator % (float lhs, float4x2 rhs) { return new float4x2 (lhs % rhs.c0, lhs % rhs.c1); } + + + /// Returns the result of a componentwise increment operation on a float4x2 matrix. + /// Value to use when computing the componentwise increment. + /// float4x2 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x2 operator ++ (float4x2 val) { return new float4x2 (++val.c0, ++val.c1); } + + + /// Returns the result of a componentwise decrement operation on a float4x2 matrix. + /// Value to use when computing the componentwise decrement. + /// float4x2 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x2 operator -- (float4x2 val) { return new float4x2 (--val.c0, --val.c1); } + + + /// Returns the result of a componentwise less than operation on two float4x2 matrices. + /// Left hand side float4x2 to use to compute componentwise less than. + /// Right hand side float4x2 to use to compute componentwise less than. + /// bool4x2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator < (float4x2 lhs, float4x2 rhs) { return new bool4x2 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1); } + + /// Returns the result of a componentwise less than operation on a float4x2 matrix and a float value. + /// Left hand side float4x2 to use to compute componentwise less than. + /// Right hand side float to use to compute componentwise less than. + /// bool4x2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator < (float4x2 lhs, float rhs) { return new bool4x2 (lhs.c0 < rhs, lhs.c1 < rhs); } + + /// Returns the result of a componentwise less than operation on a float value and a float4x2 matrix. + /// Left hand side float to use to compute componentwise less than. + /// Right hand side float4x2 to use to compute componentwise less than. + /// bool4x2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator < (float lhs, float4x2 rhs) { return new bool4x2 (lhs < rhs.c0, lhs < rhs.c1); } + + + /// Returns the result of a componentwise less or equal operation on two float4x2 matrices. + /// Left hand side float4x2 to use to compute componentwise less or equal. + /// Right hand side float4x2 to use to compute componentwise less or equal. + /// bool4x2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator <= (float4x2 lhs, float4x2 rhs) { return new bool4x2 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1); } + + /// Returns the result of a componentwise less or equal operation on a float4x2 matrix and a float value. + /// Left hand side float4x2 to use to compute componentwise less or equal. + /// Right hand side float to use to compute componentwise less or equal. + /// bool4x2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator <= (float4x2 lhs, float rhs) { return new bool4x2 (lhs.c0 <= rhs, lhs.c1 <= rhs); } + + /// Returns the result of a componentwise less or equal operation on a float value and a float4x2 matrix. + /// Left hand side float to use to compute componentwise less or equal. + /// Right hand side float4x2 to use to compute componentwise less or equal. + /// bool4x2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator <= (float lhs, float4x2 rhs) { return new bool4x2 (lhs <= rhs.c0, lhs <= rhs.c1); } + + + /// Returns the result of a componentwise greater than operation on two float4x2 matrices. + /// Left hand side float4x2 to use to compute componentwise greater than. + /// Right hand side float4x2 to use to compute componentwise greater than. + /// bool4x2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator > (float4x2 lhs, float4x2 rhs) { return new bool4x2 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1); } + + /// Returns the result of a componentwise greater than operation on a float4x2 matrix and a float value. + /// Left hand side float4x2 to use to compute componentwise greater than. + /// Right hand side float to use to compute componentwise greater than. + /// bool4x2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator > (float4x2 lhs, float rhs) { return new bool4x2 (lhs.c0 > rhs, lhs.c1 > rhs); } + + /// Returns the result of a componentwise greater than operation on a float value and a float4x2 matrix. + /// Left hand side float to use to compute componentwise greater than. + /// Right hand side float4x2 to use to compute componentwise greater than. + /// bool4x2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator > (float lhs, float4x2 rhs) { return new bool4x2 (lhs > rhs.c0, lhs > rhs.c1); } + + + /// Returns the result of a componentwise greater or equal operation on two float4x2 matrices. + /// Left hand side float4x2 to use to compute componentwise greater or equal. + /// Right hand side float4x2 to use to compute componentwise greater or equal. + /// bool4x2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator >= (float4x2 lhs, float4x2 rhs) { return new bool4x2 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1); } + + /// Returns the result of a componentwise greater or equal operation on a float4x2 matrix and a float value. + /// Left hand side float4x2 to use to compute componentwise greater or equal. + /// Right hand side float to use to compute componentwise greater or equal. + /// bool4x2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator >= (float4x2 lhs, float rhs) { return new bool4x2 (lhs.c0 >= rhs, lhs.c1 >= rhs); } + + /// Returns the result of a componentwise greater or equal operation on a float value and a float4x2 matrix. + /// Left hand side float to use to compute componentwise greater or equal. + /// Right hand side float4x2 to use to compute componentwise greater or equal. + /// bool4x2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator >= (float lhs, float4x2 rhs) { return new bool4x2 (lhs >= rhs.c0, lhs >= rhs.c1); } + + + /// Returns the result of a componentwise unary minus operation on a float4x2 matrix. + /// Value to use when computing the componentwise unary minus. + /// float4x2 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x2 operator - (float4x2 val) { return new float4x2 (-val.c0, -val.c1); } + + + /// Returns the result of a componentwise unary plus operation on a float4x2 matrix. + /// Value to use when computing the componentwise unary plus. + /// float4x2 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x2 operator + (float4x2 val) { return new float4x2 (+val.c0, +val.c1); } + + + /// Returns the result of a componentwise equality operation on two float4x2 matrices. + /// Left hand side float4x2 to use to compute componentwise equality. + /// Right hand side float4x2 to use to compute componentwise equality. + /// bool4x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator == (float4x2 lhs, float4x2 rhs) { return new bool4x2 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1); } + + /// Returns the result of a componentwise equality operation on a float4x2 matrix and a float value. + /// Left hand side float4x2 to use to compute componentwise equality. + /// Right hand side float to use to compute componentwise equality. + /// bool4x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator == (float4x2 lhs, float rhs) { return new bool4x2 (lhs.c0 == rhs, lhs.c1 == rhs); } + + /// Returns the result of a componentwise equality operation on a float value and a float4x2 matrix. + /// Left hand side float to use to compute componentwise equality. + /// Right hand side float4x2 to use to compute componentwise equality. + /// bool4x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator == (float lhs, float4x2 rhs) { return new bool4x2 (lhs == rhs.c0, lhs == rhs.c1); } + + + /// Returns the result of a componentwise not equal operation on two float4x2 matrices. + /// Left hand side float4x2 to use to compute componentwise not equal. + /// Right hand side float4x2 to use to compute componentwise not equal. + /// bool4x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator != (float4x2 lhs, float4x2 rhs) { return new bool4x2 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1); } + + /// Returns the result of a componentwise not equal operation on a float4x2 matrix and a float value. + /// Left hand side float4x2 to use to compute componentwise not equal. + /// Right hand side float to use to compute componentwise not equal. + /// bool4x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator != (float4x2 lhs, float rhs) { return new bool4x2 (lhs.c0 != rhs, lhs.c1 != rhs); } + + /// Returns the result of a componentwise not equal operation on a float value and a float4x2 matrix. + /// Left hand side float to use to compute componentwise not equal. + /// Right hand side float4x2 to use to compute componentwise not equal. + /// bool4x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator != (float lhs, float4x2 rhs) { return new bool4x2 (lhs != rhs.c0, lhs != rhs.c1); } + + + + /// Returns the float4 element at a specified index. + unsafe public ref float4 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 2) + throw new System.ArgumentException("index must be between[0...1]"); +#endif + fixed (float4x2* array = &this) { return ref ((float4*)array)[index]; } + } + } + + /// Returns true if the float4x2 is equal to a given float4x2, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(float4x2 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1); } + + /// Returns true if the float4x2 is equal to a given float4x2, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is float4x2 converted && Equals(converted); } + + + /// Returns a hash code for the float4x2. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the float4x2. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("float4x2({0}f, {1}f, {2}f, {3}f, {4}f, {5}f, {6}f, {7}f)", c0.x, c1.x, c0.y, c1.y, c0.z, c1.z, c0.w, c1.w); + } + + /// Returns a string representation of the float4x2 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("float4x2({0}f, {1}f, {2}f, {3}f, {4}f, {5}f, {6}f, {7}f)", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c0.z.ToString(format, formatProvider), c1.z.ToString(format, formatProvider), c0.w.ToString(format, formatProvider), c1.w.ToString(format, formatProvider)); + } + + } + + public static partial class math + { + /// Returns a float4x2 matrix constructed from two float4 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// float4x2 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x2 float4x2(float4 c0, float4 c1) { return new float4x2(c0, c1); } + + /// Returns a float4x2 matrix constructed from from 8 float values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 3, column 0 will be set to this value. + /// The matrix at row 3, column 1 will be set to this value. + /// float4x2 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x2 float4x2(float m00, float m01, + float m10, float m11, + float m20, float m21, + float m30, float m31) + { + return new float4x2(m00, m01, + m10, m11, + m20, m21, + m30, m31); + } + + /// Returns a float4x2 matrix constructed from a single float value by assigning it to every component. + /// float to convert to float4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x2 float4x2(float v) { return new float4x2(v); } + + /// Returns a float4x2 matrix constructed from a single bool value by converting it to float and assigning it to every component. + /// bool to convert to float4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x2 float4x2(bool v) { return new float4x2(v); } + + /// Return a float4x2 matrix constructed from a bool4x2 matrix by componentwise conversion. + /// bool4x2 to convert to float4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x2 float4x2(bool4x2 v) { return new float4x2(v); } + + /// Returns a float4x2 matrix constructed from a single int value by converting it to float and assigning it to every component. + /// int to convert to float4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x2 float4x2(int v) { return new float4x2(v); } + + /// Return a float4x2 matrix constructed from a int4x2 matrix by componentwise conversion. + /// int4x2 to convert to float4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x2 float4x2(int4x2 v) { return new float4x2(v); } + + /// Returns a float4x2 matrix constructed from a single uint value by converting it to float and assigning it to every component. + /// uint to convert to float4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x2 float4x2(uint v) { return new float4x2(v); } + + /// Return a float4x2 matrix constructed from a uint4x2 matrix by componentwise conversion. + /// uint4x2 to convert to float4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x2 float4x2(uint4x2 v) { return new float4x2(v); } + + /// Returns a float4x2 matrix constructed from a single double value by converting it to float and assigning it to every component. + /// double to convert to float4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x2 float4x2(double v) { return new float4x2(v); } + + /// Return a float4x2 matrix constructed from a double4x2 matrix by componentwise conversion. + /// double4x2 to convert to float4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x2 float4x2(double4x2 v) { return new float4x2(v); } + + /// Return the float2x4 transpose of a float4x2 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x4 transpose(float4x2 v) + { + return float2x4( + v.c0.x, v.c0.y, v.c0.z, v.c0.w, + v.c1.x, v.c1.y, v.c1.z, v.c1.w); + } + + /// Returns a uint hash code of a float4x2 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(float4x2 v) + { + return csum(asuint(v.c0) * uint4(0xAAC3C25Du, 0xD21D0945u, 0x88FCAB2Du, 0x614DA60Du) + + asuint(v.c1) * uint4(0x5BA2C50Bu, 0x8C455ACBu, 0xCD266C89u, 0xF1852A33u)) + 0x77E35E77u; + } + + /// + /// Returns a uint4 vector hash code of a float4x2 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint4 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 hashwide(float4x2 v) + { + return (asuint(v.c0) * uint4(0x863E3729u, 0xE191B035u, 0x68586FAFu, 0xD4DFF6D3u) + + asuint(v.c1) * uint4(0xCB634F4Du, 0x9B13B92Du, 0x4ABF0813u, 0x86068063u)) + 0xD75513F9u; + } + + } +} diff --git a/src/Unity.Mathematics/float4x2.gen.cs.meta b/src/Unity.Mathematics/float4x2.gen.cs.meta new file mode 100644 index 00000000..c65dacf1 --- /dev/null +++ b/src/Unity.Mathematics/float4x2.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2a2cb705f8c4d45e8ba95502e037109b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/float4x3.gen.cs b/src/Unity.Mathematics/float4x3.gen.cs new file mode 100644 index 00000000..da29e56b --- /dev/null +++ b/src/Unity.Mathematics/float4x3.gen.cs @@ -0,0 +1,665 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 4x3 matrix of floats. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct float4x3 : System.IEquatable, IFormattable + { + /// Column 0 of the matrix. + public float4 c0; + /// Column 1 of the matrix. + public float4 c1; + /// Column 2 of the matrix. + public float4 c2; + + /// float4x3 zero value. + public static readonly float4x3 zero; + + /// Constructs a float4x3 matrix from three float4 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4x3(float4 c0, float4 c1, float4 c2) + { + this.c0 = c0; + this.c1 = c1; + this.c2 = c2; + } + + /// Constructs a float4x3 matrix from 12 float values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 2, column 2 will be set to this value. + /// The matrix at row 3, column 0 will be set to this value. + /// The matrix at row 3, column 1 will be set to this value. + /// The matrix at row 3, column 2 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4x3(float m00, float m01, float m02, + float m10, float m11, float m12, + float m20, float m21, float m22, + float m30, float m31, float m32) + { + this.c0 = new float4(m00, m10, m20, m30); + this.c1 = new float4(m01, m11, m21, m31); + this.c2 = new float4(m02, m12, m22, m32); + } + + /// Constructs a float4x3 matrix from a single float value by assigning it to every component. + /// float to convert to float4x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4x3(float v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + } + + /// Constructs a float4x3 matrix from a single bool value by converting it to float and assigning it to every component. + /// bool to convert to float4x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4x3(bool v) + { + this.c0 = math.select(new float4(0.0f), new float4(1.0f), v); + this.c1 = math.select(new float4(0.0f), new float4(1.0f), v); + this.c2 = math.select(new float4(0.0f), new float4(1.0f), v); + } + + /// Constructs a float4x3 matrix from a bool4x3 matrix by componentwise conversion. + /// bool4x3 to convert to float4x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4x3(bool4x3 v) + { + this.c0 = math.select(new float4(0.0f), new float4(1.0f), v.c0); + this.c1 = math.select(new float4(0.0f), new float4(1.0f), v.c1); + this.c2 = math.select(new float4(0.0f), new float4(1.0f), v.c2); + } + + /// Constructs a float4x3 matrix from a single int value by converting it to float and assigning it to every component. + /// int to convert to float4x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4x3(int v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + } + + /// Constructs a float4x3 matrix from a int4x3 matrix by componentwise conversion. + /// int4x3 to convert to float4x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4x3(int4x3 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + this.c2 = v.c2; + } + + /// Constructs a float4x3 matrix from a single uint value by converting it to float and assigning it to every component. + /// uint to convert to float4x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4x3(uint v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + } + + /// Constructs a float4x3 matrix from a uint4x3 matrix by componentwise conversion. + /// uint4x3 to convert to float4x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4x3(uint4x3 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + this.c2 = v.c2; + } + + /// Constructs a float4x3 matrix from a single double value by converting it to float and assigning it to every component. + /// double to convert to float4x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4x3(double v) + { + this.c0 = (float4)v; + this.c1 = (float4)v; + this.c2 = (float4)v; + } + + /// Constructs a float4x3 matrix from a double4x3 matrix by componentwise conversion. + /// double4x3 to convert to float4x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4x3(double4x3 v) + { + this.c0 = (float4)v.c0; + this.c1 = (float4)v.c1; + this.c2 = (float4)v.c2; + } + + + /// Implicitly converts a single float value to a float4x3 matrix by assigning it to every component. + /// float to convert to float4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float4x3(float v) { return new float4x3(v); } + + /// Explicitly converts a single bool value to a float4x3 matrix by converting it to float and assigning it to every component. + /// bool to convert to float4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float4x3(bool v) { return new float4x3(v); } + + /// Explicitly converts a bool4x3 matrix to a float4x3 matrix by componentwise conversion. + /// bool4x3 to convert to float4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float4x3(bool4x3 v) { return new float4x3(v); } + + /// Implicitly converts a single int value to a float4x3 matrix by converting it to float and assigning it to every component. + /// int to convert to float4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float4x3(int v) { return new float4x3(v); } + + /// Implicitly converts a int4x3 matrix to a float4x3 matrix by componentwise conversion. + /// int4x3 to convert to float4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float4x3(int4x3 v) { return new float4x3(v); } + + /// Implicitly converts a single uint value to a float4x3 matrix by converting it to float and assigning it to every component. + /// uint to convert to float4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float4x3(uint v) { return new float4x3(v); } + + /// Implicitly converts a uint4x3 matrix to a float4x3 matrix by componentwise conversion. + /// uint4x3 to convert to float4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float4x3(uint4x3 v) { return new float4x3(v); } + + /// Explicitly converts a single double value to a float4x3 matrix by converting it to float and assigning it to every component. + /// double to convert to float4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float4x3(double v) { return new float4x3(v); } + + /// Explicitly converts a double4x3 matrix to a float4x3 matrix by componentwise conversion. + /// double4x3 to convert to float4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float4x3(double4x3 v) { return new float4x3(v); } + + + /// Returns the result of a componentwise multiplication operation on two float4x3 matrices. + /// Left hand side float4x3 to use to compute componentwise multiplication. + /// Right hand side float4x3 to use to compute componentwise multiplication. + /// float4x3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x3 operator * (float4x3 lhs, float4x3 rhs) { return new float4x3 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1, lhs.c2 * rhs.c2); } + + /// Returns the result of a componentwise multiplication operation on a float4x3 matrix and a float value. + /// Left hand side float4x3 to use to compute componentwise multiplication. + /// Right hand side float to use to compute componentwise multiplication. + /// float4x3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x3 operator * (float4x3 lhs, float rhs) { return new float4x3 (lhs.c0 * rhs, lhs.c1 * rhs, lhs.c2 * rhs); } + + /// Returns the result of a componentwise multiplication operation on a float value and a float4x3 matrix. + /// Left hand side float to use to compute componentwise multiplication. + /// Right hand side float4x3 to use to compute componentwise multiplication. + /// float4x3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x3 operator * (float lhs, float4x3 rhs) { return new float4x3 (lhs * rhs.c0, lhs * rhs.c1, lhs * rhs.c2); } + + + /// Returns the result of a componentwise addition operation on two float4x3 matrices. + /// Left hand side float4x3 to use to compute componentwise addition. + /// Right hand side float4x3 to use to compute componentwise addition. + /// float4x3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x3 operator + (float4x3 lhs, float4x3 rhs) { return new float4x3 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1, lhs.c2 + rhs.c2); } + + /// Returns the result of a componentwise addition operation on a float4x3 matrix and a float value. + /// Left hand side float4x3 to use to compute componentwise addition. + /// Right hand side float to use to compute componentwise addition. + /// float4x3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x3 operator + (float4x3 lhs, float rhs) { return new float4x3 (lhs.c0 + rhs, lhs.c1 + rhs, lhs.c2 + rhs); } + + /// Returns the result of a componentwise addition operation on a float value and a float4x3 matrix. + /// Left hand side float to use to compute componentwise addition. + /// Right hand side float4x3 to use to compute componentwise addition. + /// float4x3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x3 operator + (float lhs, float4x3 rhs) { return new float4x3 (lhs + rhs.c0, lhs + rhs.c1, lhs + rhs.c2); } + + + /// Returns the result of a componentwise subtraction operation on two float4x3 matrices. + /// Left hand side float4x3 to use to compute componentwise subtraction. + /// Right hand side float4x3 to use to compute componentwise subtraction. + /// float4x3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x3 operator - (float4x3 lhs, float4x3 rhs) { return new float4x3 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1, lhs.c2 - rhs.c2); } + + /// Returns the result of a componentwise subtraction operation on a float4x3 matrix and a float value. + /// Left hand side float4x3 to use to compute componentwise subtraction. + /// Right hand side float to use to compute componentwise subtraction. + /// float4x3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x3 operator - (float4x3 lhs, float rhs) { return new float4x3 (lhs.c0 - rhs, lhs.c1 - rhs, lhs.c2 - rhs); } + + /// Returns the result of a componentwise subtraction operation on a float value and a float4x3 matrix. + /// Left hand side float to use to compute componentwise subtraction. + /// Right hand side float4x3 to use to compute componentwise subtraction. + /// float4x3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x3 operator - (float lhs, float4x3 rhs) { return new float4x3 (lhs - rhs.c0, lhs - rhs.c1, lhs - rhs.c2); } + + + /// Returns the result of a componentwise division operation on two float4x3 matrices. + /// Left hand side float4x3 to use to compute componentwise division. + /// Right hand side float4x3 to use to compute componentwise division. + /// float4x3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x3 operator / (float4x3 lhs, float4x3 rhs) { return new float4x3 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1, lhs.c2 / rhs.c2); } + + /// Returns the result of a componentwise division operation on a float4x3 matrix and a float value. + /// Left hand side float4x3 to use to compute componentwise division. + /// Right hand side float to use to compute componentwise division. + /// float4x3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x3 operator / (float4x3 lhs, float rhs) { return new float4x3 (lhs.c0 / rhs, lhs.c1 / rhs, lhs.c2 / rhs); } + + /// Returns the result of a componentwise division operation on a float value and a float4x3 matrix. + /// Left hand side float to use to compute componentwise division. + /// Right hand side float4x3 to use to compute componentwise division. + /// float4x3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x3 operator / (float lhs, float4x3 rhs) { return new float4x3 (lhs / rhs.c0, lhs / rhs.c1, lhs / rhs.c2); } + + + /// Returns the result of a componentwise modulus operation on two float4x3 matrices. + /// Left hand side float4x3 to use to compute componentwise modulus. + /// Right hand side float4x3 to use to compute componentwise modulus. + /// float4x3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x3 operator % (float4x3 lhs, float4x3 rhs) { return new float4x3 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1, lhs.c2 % rhs.c2); } + + /// Returns the result of a componentwise modulus operation on a float4x3 matrix and a float value. + /// Left hand side float4x3 to use to compute componentwise modulus. + /// Right hand side float to use to compute componentwise modulus. + /// float4x3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x3 operator % (float4x3 lhs, float rhs) { return new float4x3 (lhs.c0 % rhs, lhs.c1 % rhs, lhs.c2 % rhs); } + + /// Returns the result of a componentwise modulus operation on a float value and a float4x3 matrix. + /// Left hand side float to use to compute componentwise modulus. + /// Right hand side float4x3 to use to compute componentwise modulus. + /// float4x3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x3 operator % (float lhs, float4x3 rhs) { return new float4x3 (lhs % rhs.c0, lhs % rhs.c1, lhs % rhs.c2); } + + + /// Returns the result of a componentwise increment operation on a float4x3 matrix. + /// Value to use when computing the componentwise increment. + /// float4x3 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x3 operator ++ (float4x3 val) { return new float4x3 (++val.c0, ++val.c1, ++val.c2); } + + + /// Returns the result of a componentwise decrement operation on a float4x3 matrix. + /// Value to use when computing the componentwise decrement. + /// float4x3 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x3 operator -- (float4x3 val) { return new float4x3 (--val.c0, --val.c1, --val.c2); } + + + /// Returns the result of a componentwise less than operation on two float4x3 matrices. + /// Left hand side float4x3 to use to compute componentwise less than. + /// Right hand side float4x3 to use to compute componentwise less than. + /// bool4x3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator < (float4x3 lhs, float4x3 rhs) { return new bool4x3 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1, lhs.c2 < rhs.c2); } + + /// Returns the result of a componentwise less than operation on a float4x3 matrix and a float value. + /// Left hand side float4x3 to use to compute componentwise less than. + /// Right hand side float to use to compute componentwise less than. + /// bool4x3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator < (float4x3 lhs, float rhs) { return new bool4x3 (lhs.c0 < rhs, lhs.c1 < rhs, lhs.c2 < rhs); } + + /// Returns the result of a componentwise less than operation on a float value and a float4x3 matrix. + /// Left hand side float to use to compute componentwise less than. + /// Right hand side float4x3 to use to compute componentwise less than. + /// bool4x3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator < (float lhs, float4x3 rhs) { return new bool4x3 (lhs < rhs.c0, lhs < rhs.c1, lhs < rhs.c2); } + + + /// Returns the result of a componentwise less or equal operation on two float4x3 matrices. + /// Left hand side float4x3 to use to compute componentwise less or equal. + /// Right hand side float4x3 to use to compute componentwise less or equal. + /// bool4x3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator <= (float4x3 lhs, float4x3 rhs) { return new bool4x3 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1, lhs.c2 <= rhs.c2); } + + /// Returns the result of a componentwise less or equal operation on a float4x3 matrix and a float value. + /// Left hand side float4x3 to use to compute componentwise less or equal. + /// Right hand side float to use to compute componentwise less or equal. + /// bool4x3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator <= (float4x3 lhs, float rhs) { return new bool4x3 (lhs.c0 <= rhs, lhs.c1 <= rhs, lhs.c2 <= rhs); } + + /// Returns the result of a componentwise less or equal operation on a float value and a float4x3 matrix. + /// Left hand side float to use to compute componentwise less or equal. + /// Right hand side float4x3 to use to compute componentwise less or equal. + /// bool4x3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator <= (float lhs, float4x3 rhs) { return new bool4x3 (lhs <= rhs.c0, lhs <= rhs.c1, lhs <= rhs.c2); } + + + /// Returns the result of a componentwise greater than operation on two float4x3 matrices. + /// Left hand side float4x3 to use to compute componentwise greater than. + /// Right hand side float4x3 to use to compute componentwise greater than. + /// bool4x3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator > (float4x3 lhs, float4x3 rhs) { return new bool4x3 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1, lhs.c2 > rhs.c2); } + + /// Returns the result of a componentwise greater than operation on a float4x3 matrix and a float value. + /// Left hand side float4x3 to use to compute componentwise greater than. + /// Right hand side float to use to compute componentwise greater than. + /// bool4x3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator > (float4x3 lhs, float rhs) { return new bool4x3 (lhs.c0 > rhs, lhs.c1 > rhs, lhs.c2 > rhs); } + + /// Returns the result of a componentwise greater than operation on a float value and a float4x3 matrix. + /// Left hand side float to use to compute componentwise greater than. + /// Right hand side float4x3 to use to compute componentwise greater than. + /// bool4x3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator > (float lhs, float4x3 rhs) { return new bool4x3 (lhs > rhs.c0, lhs > rhs.c1, lhs > rhs.c2); } + + + /// Returns the result of a componentwise greater or equal operation on two float4x3 matrices. + /// Left hand side float4x3 to use to compute componentwise greater or equal. + /// Right hand side float4x3 to use to compute componentwise greater or equal. + /// bool4x3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator >= (float4x3 lhs, float4x3 rhs) { return new bool4x3 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1, lhs.c2 >= rhs.c2); } + + /// Returns the result of a componentwise greater or equal operation on a float4x3 matrix and a float value. + /// Left hand side float4x3 to use to compute componentwise greater or equal. + /// Right hand side float to use to compute componentwise greater or equal. + /// bool4x3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator >= (float4x3 lhs, float rhs) { return new bool4x3 (lhs.c0 >= rhs, lhs.c1 >= rhs, lhs.c2 >= rhs); } + + /// Returns the result of a componentwise greater or equal operation on a float value and a float4x3 matrix. + /// Left hand side float to use to compute componentwise greater or equal. + /// Right hand side float4x3 to use to compute componentwise greater or equal. + /// bool4x3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator >= (float lhs, float4x3 rhs) { return new bool4x3 (lhs >= rhs.c0, lhs >= rhs.c1, lhs >= rhs.c2); } + + + /// Returns the result of a componentwise unary minus operation on a float4x3 matrix. + /// Value to use when computing the componentwise unary minus. + /// float4x3 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x3 operator - (float4x3 val) { return new float4x3 (-val.c0, -val.c1, -val.c2); } + + + /// Returns the result of a componentwise unary plus operation on a float4x3 matrix. + /// Value to use when computing the componentwise unary plus. + /// float4x3 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x3 operator + (float4x3 val) { return new float4x3 (+val.c0, +val.c1, +val.c2); } + + + /// Returns the result of a componentwise equality operation on two float4x3 matrices. + /// Left hand side float4x3 to use to compute componentwise equality. + /// Right hand side float4x3 to use to compute componentwise equality. + /// bool4x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator == (float4x3 lhs, float4x3 rhs) { return new bool4x3 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2); } + + /// Returns the result of a componentwise equality operation on a float4x3 matrix and a float value. + /// Left hand side float4x3 to use to compute componentwise equality. + /// Right hand side float to use to compute componentwise equality. + /// bool4x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator == (float4x3 lhs, float rhs) { return new bool4x3 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs); } + + /// Returns the result of a componentwise equality operation on a float value and a float4x3 matrix. + /// Left hand side float to use to compute componentwise equality. + /// Right hand side float4x3 to use to compute componentwise equality. + /// bool4x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator == (float lhs, float4x3 rhs) { return new bool4x3 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2); } + + + /// Returns the result of a componentwise not equal operation on two float4x3 matrices. + /// Left hand side float4x3 to use to compute componentwise not equal. + /// Right hand side float4x3 to use to compute componentwise not equal. + /// bool4x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator != (float4x3 lhs, float4x3 rhs) { return new bool4x3 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2); } + + /// Returns the result of a componentwise not equal operation on a float4x3 matrix and a float value. + /// Left hand side float4x3 to use to compute componentwise not equal. + /// Right hand side float to use to compute componentwise not equal. + /// bool4x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator != (float4x3 lhs, float rhs) { return new bool4x3 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs); } + + /// Returns the result of a componentwise not equal operation on a float value and a float4x3 matrix. + /// Left hand side float to use to compute componentwise not equal. + /// Right hand side float4x3 to use to compute componentwise not equal. + /// bool4x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator != (float lhs, float4x3 rhs) { return new bool4x3 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2); } + + + + /// Returns the float4 element at a specified index. + unsafe public ref float4 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 3) + throw new System.ArgumentException("index must be between[0...2]"); +#endif + fixed (float4x3* array = &this) { return ref ((float4*)array)[index]; } + } + } + + /// Returns true if the float4x3 is equal to a given float4x3, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(float4x3 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2); } + + /// Returns true if the float4x3 is equal to a given float4x3, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is float4x3 converted && Equals(converted); } + + + /// Returns a hash code for the float4x3. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the float4x3. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("float4x3({0}f, {1}f, {2}f, {3}f, {4}f, {5}f, {6}f, {7}f, {8}f, {9}f, {10}f, {11}f)", c0.x, c1.x, c2.x, c0.y, c1.y, c2.y, c0.z, c1.z, c2.z, c0.w, c1.w, c2.w); + } + + /// Returns a string representation of the float4x3 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("float4x3({0}f, {1}f, {2}f, {3}f, {4}f, {5}f, {6}f, {7}f, {8}f, {9}f, {10}f, {11}f)", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c2.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c2.y.ToString(format, formatProvider), c0.z.ToString(format, formatProvider), c1.z.ToString(format, formatProvider), c2.z.ToString(format, formatProvider), c0.w.ToString(format, formatProvider), c1.w.ToString(format, formatProvider), c2.w.ToString(format, formatProvider)); + } + + } + + public static partial class math + { + /// Returns a float4x3 matrix constructed from three float4 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// float4x3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x3 float4x3(float4 c0, float4 c1, float4 c2) { return new float4x3(c0, c1, c2); } + + /// Returns a float4x3 matrix constructed from from 12 float values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 2, column 2 will be set to this value. + /// The matrix at row 3, column 0 will be set to this value. + /// The matrix at row 3, column 1 will be set to this value. + /// The matrix at row 3, column 2 will be set to this value. + /// float4x3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x3 float4x3(float m00, float m01, float m02, + float m10, float m11, float m12, + float m20, float m21, float m22, + float m30, float m31, float m32) + { + return new float4x3(m00, m01, m02, + m10, m11, m12, + m20, m21, m22, + m30, m31, m32); + } + + /// Returns a float4x3 matrix constructed from a single float value by assigning it to every component. + /// float to convert to float4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x3 float4x3(float v) { return new float4x3(v); } + + /// Returns a float4x3 matrix constructed from a single bool value by converting it to float and assigning it to every component. + /// bool to convert to float4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x3 float4x3(bool v) { return new float4x3(v); } + + /// Return a float4x3 matrix constructed from a bool4x3 matrix by componentwise conversion. + /// bool4x3 to convert to float4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x3 float4x3(bool4x3 v) { return new float4x3(v); } + + /// Returns a float4x3 matrix constructed from a single int value by converting it to float and assigning it to every component. + /// int to convert to float4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x3 float4x3(int v) { return new float4x3(v); } + + /// Return a float4x3 matrix constructed from a int4x3 matrix by componentwise conversion. + /// int4x3 to convert to float4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x3 float4x3(int4x3 v) { return new float4x3(v); } + + /// Returns a float4x3 matrix constructed from a single uint value by converting it to float and assigning it to every component. + /// uint to convert to float4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x3 float4x3(uint v) { return new float4x3(v); } + + /// Return a float4x3 matrix constructed from a uint4x3 matrix by componentwise conversion. + /// uint4x3 to convert to float4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x3 float4x3(uint4x3 v) { return new float4x3(v); } + + /// Returns a float4x3 matrix constructed from a single double value by converting it to float and assigning it to every component. + /// double to convert to float4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x3 float4x3(double v) { return new float4x3(v); } + + /// Return a float4x3 matrix constructed from a double4x3 matrix by componentwise conversion. + /// double4x3 to convert to float4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x3 float4x3(double4x3 v) { return new float4x3(v); } + + /// Return the float3x4 transpose of a float4x3 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x4 transpose(float4x3 v) + { + return float3x4( + v.c0.x, v.c0.y, v.c0.z, v.c0.w, + v.c1.x, v.c1.y, v.c1.z, v.c1.w, + v.c2.x, v.c2.y, v.c2.z, v.c2.w); + } + + /// Returns a uint hash code of a float4x3 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(float4x3 v) + { + return csum(asuint(v.c0) * uint4(0xC53F4755u, 0x6985C229u, 0xE133B0B3u, 0xC3E0A3B9u) + + asuint(v.c1) * uint4(0xFE31134Fu, 0x712A34D7u, 0x9D77A59Bu, 0x4942CA39u) + + asuint(v.c2) * uint4(0xB40EC62Du, 0x565ED63Fu, 0x93C30C2Bu, 0xDCAF0351u)) + 0x6E050B01u; + } + + /// + /// Returns a uint4 vector hash code of a float4x3 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint4 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 hashwide(float4x3 v) + { + return (asuint(v.c0) * uint4(0x750FDBF5u, 0x7F3DD499u, 0x52EAAEBBu, 0x4599C793u) + + asuint(v.c1) * uint4(0x83B5E729u, 0xC267163Fu, 0x67BC9149u, 0xAD7C5EC1u) + + asuint(v.c2) * uint4(0x822A7D6Du, 0xB492BF15u, 0xD37220E3u, 0x7AA2C2BDu)) + 0xE16BC89Du; + } + + } +} diff --git a/src/Unity.Mathematics/float4x3.gen.cs.meta b/src/Unity.Mathematics/float4x3.gen.cs.meta new file mode 100644 index 00000000..5e79be87 --- /dev/null +++ b/src/Unity.Mathematics/float4x3.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b8e17e5c41b0344afa5389019db2eb9f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/float4x4.gen.cs b/src/Unity.Mathematics/float4x4.gen.cs new file mode 100644 index 00000000..061cc0c5 --- /dev/null +++ b/src/Unity.Mathematics/float4x4.gen.cs @@ -0,0 +1,824 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 4x4 matrix of floats. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct float4x4 : System.IEquatable, IFormattable + { + /// Column 0 of the matrix. + public float4 c0; + /// Column 1 of the matrix. + public float4 c1; + /// Column 2 of the matrix. + public float4 c2; + /// Column 3 of the matrix. + public float4 c3; + + /// float4x4 identity transform. + public static readonly float4x4 identity = new float4x4(1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f); + + /// float4x4 zero value. + public static readonly float4x4 zero; + + /// Constructs a float4x4 matrix from four float4 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// The matrix column c3 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4x4(float4 c0, float4 c1, float4 c2, float4 c3) + { + this.c0 = c0; + this.c1 = c1; + this.c2 = c2; + this.c3 = c3; + } + + /// Constructs a float4x4 matrix from 16 float values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 0, column 3 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 1, column 3 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 2, column 2 will be set to this value. + /// The matrix at row 2, column 3 will be set to this value. + /// The matrix at row 3, column 0 will be set to this value. + /// The matrix at row 3, column 1 will be set to this value. + /// The matrix at row 3, column 2 will be set to this value. + /// The matrix at row 3, column 3 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4x4(float m00, float m01, float m02, float m03, + float m10, float m11, float m12, float m13, + float m20, float m21, float m22, float m23, + float m30, float m31, float m32, float m33) + { + this.c0 = new float4(m00, m10, m20, m30); + this.c1 = new float4(m01, m11, m21, m31); + this.c2 = new float4(m02, m12, m22, m32); + this.c3 = new float4(m03, m13, m23, m33); + } + + /// Constructs a float4x4 matrix from a single float value by assigning it to every component. + /// float to convert to float4x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4x4(float v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + this.c3 = v; + } + + /// Constructs a float4x4 matrix from a single bool value by converting it to float and assigning it to every component. + /// bool to convert to float4x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4x4(bool v) + { + this.c0 = math.select(new float4(0.0f), new float4(1.0f), v); + this.c1 = math.select(new float4(0.0f), new float4(1.0f), v); + this.c2 = math.select(new float4(0.0f), new float4(1.0f), v); + this.c3 = math.select(new float4(0.0f), new float4(1.0f), v); + } + + /// Constructs a float4x4 matrix from a bool4x4 matrix by componentwise conversion. + /// bool4x4 to convert to float4x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4x4(bool4x4 v) + { + this.c0 = math.select(new float4(0.0f), new float4(1.0f), v.c0); + this.c1 = math.select(new float4(0.0f), new float4(1.0f), v.c1); + this.c2 = math.select(new float4(0.0f), new float4(1.0f), v.c2); + this.c3 = math.select(new float4(0.0f), new float4(1.0f), v.c3); + } + + /// Constructs a float4x4 matrix from a single int value by converting it to float and assigning it to every component. + /// int to convert to float4x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4x4(int v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + this.c3 = v; + } + + /// Constructs a float4x4 matrix from a int4x4 matrix by componentwise conversion. + /// int4x4 to convert to float4x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4x4(int4x4 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + this.c2 = v.c2; + this.c3 = v.c3; + } + + /// Constructs a float4x4 matrix from a single uint value by converting it to float and assigning it to every component. + /// uint to convert to float4x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4x4(uint v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + this.c3 = v; + } + + /// Constructs a float4x4 matrix from a uint4x4 matrix by componentwise conversion. + /// uint4x4 to convert to float4x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4x4(uint4x4 v) + { + this.c0 = v.c0; + this.c1 = v.c1; + this.c2 = v.c2; + this.c3 = v.c3; + } + + /// Constructs a float4x4 matrix from a single double value by converting it to float and assigning it to every component. + /// double to convert to float4x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4x4(double v) + { + this.c0 = (float4)v; + this.c1 = (float4)v; + this.c2 = (float4)v; + this.c3 = (float4)v; + } + + /// Constructs a float4x4 matrix from a double4x4 matrix by componentwise conversion. + /// double4x4 to convert to float4x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4x4(double4x4 v) + { + this.c0 = (float4)v.c0; + this.c1 = (float4)v.c1; + this.c2 = (float4)v.c2; + this.c3 = (float4)v.c3; + } + + + /// Implicitly converts a single float value to a float4x4 matrix by assigning it to every component. + /// float to convert to float4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float4x4(float v) { return new float4x4(v); } + + /// Explicitly converts a single bool value to a float4x4 matrix by converting it to float and assigning it to every component. + /// bool to convert to float4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float4x4(bool v) { return new float4x4(v); } + + /// Explicitly converts a bool4x4 matrix to a float4x4 matrix by componentwise conversion. + /// bool4x4 to convert to float4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float4x4(bool4x4 v) { return new float4x4(v); } + + /// Implicitly converts a single int value to a float4x4 matrix by converting it to float and assigning it to every component. + /// int to convert to float4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float4x4(int v) { return new float4x4(v); } + + /// Implicitly converts a int4x4 matrix to a float4x4 matrix by componentwise conversion. + /// int4x4 to convert to float4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float4x4(int4x4 v) { return new float4x4(v); } + + /// Implicitly converts a single uint value to a float4x4 matrix by converting it to float and assigning it to every component. + /// uint to convert to float4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float4x4(uint v) { return new float4x4(v); } + + /// Implicitly converts a uint4x4 matrix to a float4x4 matrix by componentwise conversion. + /// uint4x4 to convert to float4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float4x4(uint4x4 v) { return new float4x4(v); } + + /// Explicitly converts a single double value to a float4x4 matrix by converting it to float and assigning it to every component. + /// double to convert to float4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float4x4(double v) { return new float4x4(v); } + + /// Explicitly converts a double4x4 matrix to a float4x4 matrix by componentwise conversion. + /// double4x4 to convert to float4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator float4x4(double4x4 v) { return new float4x4(v); } + + + /// Returns the result of a componentwise multiplication operation on two float4x4 matrices. + /// Left hand side float4x4 to use to compute componentwise multiplication. + /// Right hand side float4x4 to use to compute componentwise multiplication. + /// float4x4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 operator * (float4x4 lhs, float4x4 rhs) { return new float4x4 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1, lhs.c2 * rhs.c2, lhs.c3 * rhs.c3); } + + /// Returns the result of a componentwise multiplication operation on a float4x4 matrix and a float value. + /// Left hand side float4x4 to use to compute componentwise multiplication. + /// Right hand side float to use to compute componentwise multiplication. + /// float4x4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 operator * (float4x4 lhs, float rhs) { return new float4x4 (lhs.c0 * rhs, lhs.c1 * rhs, lhs.c2 * rhs, lhs.c3 * rhs); } + + /// Returns the result of a componentwise multiplication operation on a float value and a float4x4 matrix. + /// Left hand side float to use to compute componentwise multiplication. + /// Right hand side float4x4 to use to compute componentwise multiplication. + /// float4x4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 operator * (float lhs, float4x4 rhs) { return new float4x4 (lhs * rhs.c0, lhs * rhs.c1, lhs * rhs.c2, lhs * rhs.c3); } + + + /// Returns the result of a componentwise addition operation on two float4x4 matrices. + /// Left hand side float4x4 to use to compute componentwise addition. + /// Right hand side float4x4 to use to compute componentwise addition. + /// float4x4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 operator + (float4x4 lhs, float4x4 rhs) { return new float4x4 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1, lhs.c2 + rhs.c2, lhs.c3 + rhs.c3); } + + /// Returns the result of a componentwise addition operation on a float4x4 matrix and a float value. + /// Left hand side float4x4 to use to compute componentwise addition. + /// Right hand side float to use to compute componentwise addition. + /// float4x4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 operator + (float4x4 lhs, float rhs) { return new float4x4 (lhs.c0 + rhs, lhs.c1 + rhs, lhs.c2 + rhs, lhs.c3 + rhs); } + + /// Returns the result of a componentwise addition operation on a float value and a float4x4 matrix. + /// Left hand side float to use to compute componentwise addition. + /// Right hand side float4x4 to use to compute componentwise addition. + /// float4x4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 operator + (float lhs, float4x4 rhs) { return new float4x4 (lhs + rhs.c0, lhs + rhs.c1, lhs + rhs.c2, lhs + rhs.c3); } + + + /// Returns the result of a componentwise subtraction operation on two float4x4 matrices. + /// Left hand side float4x4 to use to compute componentwise subtraction. + /// Right hand side float4x4 to use to compute componentwise subtraction. + /// float4x4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 operator - (float4x4 lhs, float4x4 rhs) { return new float4x4 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1, lhs.c2 - rhs.c2, lhs.c3 - rhs.c3); } + + /// Returns the result of a componentwise subtraction operation on a float4x4 matrix and a float value. + /// Left hand side float4x4 to use to compute componentwise subtraction. + /// Right hand side float to use to compute componentwise subtraction. + /// float4x4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 operator - (float4x4 lhs, float rhs) { return new float4x4 (lhs.c0 - rhs, lhs.c1 - rhs, lhs.c2 - rhs, lhs.c3 - rhs); } + + /// Returns the result of a componentwise subtraction operation on a float value and a float4x4 matrix. + /// Left hand side float to use to compute componentwise subtraction. + /// Right hand side float4x4 to use to compute componentwise subtraction. + /// float4x4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 operator - (float lhs, float4x4 rhs) { return new float4x4 (lhs - rhs.c0, lhs - rhs.c1, lhs - rhs.c2, lhs - rhs.c3); } + + + /// Returns the result of a componentwise division operation on two float4x4 matrices. + /// Left hand side float4x4 to use to compute componentwise division. + /// Right hand side float4x4 to use to compute componentwise division. + /// float4x4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 operator / (float4x4 lhs, float4x4 rhs) { return new float4x4 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1, lhs.c2 / rhs.c2, lhs.c3 / rhs.c3); } + + /// Returns the result of a componentwise division operation on a float4x4 matrix and a float value. + /// Left hand side float4x4 to use to compute componentwise division. + /// Right hand side float to use to compute componentwise division. + /// float4x4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 operator / (float4x4 lhs, float rhs) { return new float4x4 (lhs.c0 / rhs, lhs.c1 / rhs, lhs.c2 / rhs, lhs.c3 / rhs); } + + /// Returns the result of a componentwise division operation on a float value and a float4x4 matrix. + /// Left hand side float to use to compute componentwise division. + /// Right hand side float4x4 to use to compute componentwise division. + /// float4x4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 operator / (float lhs, float4x4 rhs) { return new float4x4 (lhs / rhs.c0, lhs / rhs.c1, lhs / rhs.c2, lhs / rhs.c3); } + + + /// Returns the result of a componentwise modulus operation on two float4x4 matrices. + /// Left hand side float4x4 to use to compute componentwise modulus. + /// Right hand side float4x4 to use to compute componentwise modulus. + /// float4x4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 operator % (float4x4 lhs, float4x4 rhs) { return new float4x4 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1, lhs.c2 % rhs.c2, lhs.c3 % rhs.c3); } + + /// Returns the result of a componentwise modulus operation on a float4x4 matrix and a float value. + /// Left hand side float4x4 to use to compute componentwise modulus. + /// Right hand side float to use to compute componentwise modulus. + /// float4x4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 operator % (float4x4 lhs, float rhs) { return new float4x4 (lhs.c0 % rhs, lhs.c1 % rhs, lhs.c2 % rhs, lhs.c3 % rhs); } + + /// Returns the result of a componentwise modulus operation on a float value and a float4x4 matrix. + /// Left hand side float to use to compute componentwise modulus. + /// Right hand side float4x4 to use to compute componentwise modulus. + /// float4x4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 operator % (float lhs, float4x4 rhs) { return new float4x4 (lhs % rhs.c0, lhs % rhs.c1, lhs % rhs.c2, lhs % rhs.c3); } + + + /// Returns the result of a componentwise increment operation on a float4x4 matrix. + /// Value to use when computing the componentwise increment. + /// float4x4 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 operator ++ (float4x4 val) { return new float4x4 (++val.c0, ++val.c1, ++val.c2, ++val.c3); } + + + /// Returns the result of a componentwise decrement operation on a float4x4 matrix. + /// Value to use when computing the componentwise decrement. + /// float4x4 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 operator -- (float4x4 val) { return new float4x4 (--val.c0, --val.c1, --val.c2, --val.c3); } + + + /// Returns the result of a componentwise less than operation on two float4x4 matrices. + /// Left hand side float4x4 to use to compute componentwise less than. + /// Right hand side float4x4 to use to compute componentwise less than. + /// bool4x4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator < (float4x4 lhs, float4x4 rhs) { return new bool4x4 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1, lhs.c2 < rhs.c2, lhs.c3 < rhs.c3); } + + /// Returns the result of a componentwise less than operation on a float4x4 matrix and a float value. + /// Left hand side float4x4 to use to compute componentwise less than. + /// Right hand side float to use to compute componentwise less than. + /// bool4x4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator < (float4x4 lhs, float rhs) { return new bool4x4 (lhs.c0 < rhs, lhs.c1 < rhs, lhs.c2 < rhs, lhs.c3 < rhs); } + + /// Returns the result of a componentwise less than operation on a float value and a float4x4 matrix. + /// Left hand side float to use to compute componentwise less than. + /// Right hand side float4x4 to use to compute componentwise less than. + /// bool4x4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator < (float lhs, float4x4 rhs) { return new bool4x4 (lhs < rhs.c0, lhs < rhs.c1, lhs < rhs.c2, lhs < rhs.c3); } + + + /// Returns the result of a componentwise less or equal operation on two float4x4 matrices. + /// Left hand side float4x4 to use to compute componentwise less or equal. + /// Right hand side float4x4 to use to compute componentwise less or equal. + /// bool4x4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator <= (float4x4 lhs, float4x4 rhs) { return new bool4x4 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1, lhs.c2 <= rhs.c2, lhs.c3 <= rhs.c3); } + + /// Returns the result of a componentwise less or equal operation on a float4x4 matrix and a float value. + /// Left hand side float4x4 to use to compute componentwise less or equal. + /// Right hand side float to use to compute componentwise less or equal. + /// bool4x4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator <= (float4x4 lhs, float rhs) { return new bool4x4 (lhs.c0 <= rhs, lhs.c1 <= rhs, lhs.c2 <= rhs, lhs.c3 <= rhs); } + + /// Returns the result of a componentwise less or equal operation on a float value and a float4x4 matrix. + /// Left hand side float to use to compute componentwise less or equal. + /// Right hand side float4x4 to use to compute componentwise less or equal. + /// bool4x4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator <= (float lhs, float4x4 rhs) { return new bool4x4 (lhs <= rhs.c0, lhs <= rhs.c1, lhs <= rhs.c2, lhs <= rhs.c3); } + + + /// Returns the result of a componentwise greater than operation on two float4x4 matrices. + /// Left hand side float4x4 to use to compute componentwise greater than. + /// Right hand side float4x4 to use to compute componentwise greater than. + /// bool4x4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator > (float4x4 lhs, float4x4 rhs) { return new bool4x4 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1, lhs.c2 > rhs.c2, lhs.c3 > rhs.c3); } + + /// Returns the result of a componentwise greater than operation on a float4x4 matrix and a float value. + /// Left hand side float4x4 to use to compute componentwise greater than. + /// Right hand side float to use to compute componentwise greater than. + /// bool4x4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator > (float4x4 lhs, float rhs) { return new bool4x4 (lhs.c0 > rhs, lhs.c1 > rhs, lhs.c2 > rhs, lhs.c3 > rhs); } + + /// Returns the result of a componentwise greater than operation on a float value and a float4x4 matrix. + /// Left hand side float to use to compute componentwise greater than. + /// Right hand side float4x4 to use to compute componentwise greater than. + /// bool4x4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator > (float lhs, float4x4 rhs) { return new bool4x4 (lhs > rhs.c0, lhs > rhs.c1, lhs > rhs.c2, lhs > rhs.c3); } + + + /// Returns the result of a componentwise greater or equal operation on two float4x4 matrices. + /// Left hand side float4x4 to use to compute componentwise greater or equal. + /// Right hand side float4x4 to use to compute componentwise greater or equal. + /// bool4x4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator >= (float4x4 lhs, float4x4 rhs) { return new bool4x4 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1, lhs.c2 >= rhs.c2, lhs.c3 >= rhs.c3); } + + /// Returns the result of a componentwise greater or equal operation on a float4x4 matrix and a float value. + /// Left hand side float4x4 to use to compute componentwise greater or equal. + /// Right hand side float to use to compute componentwise greater or equal. + /// bool4x4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator >= (float4x4 lhs, float rhs) { return new bool4x4 (lhs.c0 >= rhs, lhs.c1 >= rhs, lhs.c2 >= rhs, lhs.c3 >= rhs); } + + /// Returns the result of a componentwise greater or equal operation on a float value and a float4x4 matrix. + /// Left hand side float to use to compute componentwise greater or equal. + /// Right hand side float4x4 to use to compute componentwise greater or equal. + /// bool4x4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator >= (float lhs, float4x4 rhs) { return new bool4x4 (lhs >= rhs.c0, lhs >= rhs.c1, lhs >= rhs.c2, lhs >= rhs.c3); } + + + /// Returns the result of a componentwise unary minus operation on a float4x4 matrix. + /// Value to use when computing the componentwise unary minus. + /// float4x4 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 operator - (float4x4 val) { return new float4x4 (-val.c0, -val.c1, -val.c2, -val.c3); } + + + /// Returns the result of a componentwise unary plus operation on a float4x4 matrix. + /// Value to use when computing the componentwise unary plus. + /// float4x4 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 operator + (float4x4 val) { return new float4x4 (+val.c0, +val.c1, +val.c2, +val.c3); } + + + /// Returns the result of a componentwise equality operation on two float4x4 matrices. + /// Left hand side float4x4 to use to compute componentwise equality. + /// Right hand side float4x4 to use to compute componentwise equality. + /// bool4x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator == (float4x4 lhs, float4x4 rhs) { return new bool4x4 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2, lhs.c3 == rhs.c3); } + + /// Returns the result of a componentwise equality operation on a float4x4 matrix and a float value. + /// Left hand side float4x4 to use to compute componentwise equality. + /// Right hand side float to use to compute componentwise equality. + /// bool4x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator == (float4x4 lhs, float rhs) { return new bool4x4 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs, lhs.c3 == rhs); } + + /// Returns the result of a componentwise equality operation on a float value and a float4x4 matrix. + /// Left hand side float to use to compute componentwise equality. + /// Right hand side float4x4 to use to compute componentwise equality. + /// bool4x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator == (float lhs, float4x4 rhs) { return new bool4x4 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2, lhs == rhs.c3); } + + + /// Returns the result of a componentwise not equal operation on two float4x4 matrices. + /// Left hand side float4x4 to use to compute componentwise not equal. + /// Right hand side float4x4 to use to compute componentwise not equal. + /// bool4x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator != (float4x4 lhs, float4x4 rhs) { return new bool4x4 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2, lhs.c3 != rhs.c3); } + + /// Returns the result of a componentwise not equal operation on a float4x4 matrix and a float value. + /// Left hand side float4x4 to use to compute componentwise not equal. + /// Right hand side float to use to compute componentwise not equal. + /// bool4x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator != (float4x4 lhs, float rhs) { return new bool4x4 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs, lhs.c3 != rhs); } + + /// Returns the result of a componentwise not equal operation on a float value and a float4x4 matrix. + /// Left hand side float to use to compute componentwise not equal. + /// Right hand side float4x4 to use to compute componentwise not equal. + /// bool4x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator != (float lhs, float4x4 rhs) { return new bool4x4 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2, lhs != rhs.c3); } + + + + /// Returns the float4 element at a specified index. + unsafe public ref float4 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 4) + throw new System.ArgumentException("index must be between[0...3]"); +#endif + fixed (float4x4* array = &this) { return ref ((float4*)array)[index]; } + } + } + + /// Returns true if the float4x4 is equal to a given float4x4, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(float4x4 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2) && c3.Equals(rhs.c3); } + + /// Returns true if the float4x4 is equal to a given float4x4, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is float4x4 converted && Equals(converted); } + + + /// Returns a hash code for the float4x4. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the float4x4. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("float4x4({0}f, {1}f, {2}f, {3}f, {4}f, {5}f, {6}f, {7}f, {8}f, {9}f, {10}f, {11}f, {12}f, {13}f, {14}f, {15}f)", c0.x, c1.x, c2.x, c3.x, c0.y, c1.y, c2.y, c3.y, c0.z, c1.z, c2.z, c3.z, c0.w, c1.w, c2.w, c3.w); + } + + /// Returns a string representation of the float4x4 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("float4x4({0}f, {1}f, {2}f, {3}f, {4}f, {5}f, {6}f, {7}f, {8}f, {9}f, {10}f, {11}f, {12}f, {13}f, {14}f, {15}f)", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c2.x.ToString(format, formatProvider), c3.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c2.y.ToString(format, formatProvider), c3.y.ToString(format, formatProvider), c0.z.ToString(format, formatProvider), c1.z.ToString(format, formatProvider), c2.z.ToString(format, formatProvider), c3.z.ToString(format, formatProvider), c0.w.ToString(format, formatProvider), c1.w.ToString(format, formatProvider), c2.w.ToString(format, formatProvider), c3.w.ToString(format, formatProvider)); + } + + } + + public static partial class math + { + /// Returns a float4x4 matrix constructed from four float4 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// The matrix column c3 will be set to this value. + /// float4x4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 float4x4(float4 c0, float4 c1, float4 c2, float4 c3) { return new float4x4(c0, c1, c2, c3); } + + /// Returns a float4x4 matrix constructed from from 16 float values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 0, column 3 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 1, column 3 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 2, column 2 will be set to this value. + /// The matrix at row 2, column 3 will be set to this value. + /// The matrix at row 3, column 0 will be set to this value. + /// The matrix at row 3, column 1 will be set to this value. + /// The matrix at row 3, column 2 will be set to this value. + /// The matrix at row 3, column 3 will be set to this value. + /// float4x4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 float4x4(float m00, float m01, float m02, float m03, + float m10, float m11, float m12, float m13, + float m20, float m21, float m22, float m23, + float m30, float m31, float m32, float m33) + { + return new float4x4(m00, m01, m02, m03, + m10, m11, m12, m13, + m20, m21, m22, m23, + m30, m31, m32, m33); + } + + /// Returns a float4x4 matrix constructed from a single float value by assigning it to every component. + /// float to convert to float4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 float4x4(float v) { return new float4x4(v); } + + /// Returns a float4x4 matrix constructed from a single bool value by converting it to float and assigning it to every component. + /// bool to convert to float4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 float4x4(bool v) { return new float4x4(v); } + + /// Return a float4x4 matrix constructed from a bool4x4 matrix by componentwise conversion. + /// bool4x4 to convert to float4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 float4x4(bool4x4 v) { return new float4x4(v); } + + /// Returns a float4x4 matrix constructed from a single int value by converting it to float and assigning it to every component. + /// int to convert to float4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 float4x4(int v) { return new float4x4(v); } + + /// Return a float4x4 matrix constructed from a int4x4 matrix by componentwise conversion. + /// int4x4 to convert to float4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 float4x4(int4x4 v) { return new float4x4(v); } + + /// Returns a float4x4 matrix constructed from a single uint value by converting it to float and assigning it to every component. + /// uint to convert to float4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 float4x4(uint v) { return new float4x4(v); } + + /// Return a float4x4 matrix constructed from a uint4x4 matrix by componentwise conversion. + /// uint4x4 to convert to float4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 float4x4(uint4x4 v) { return new float4x4(v); } + + /// Returns a float4x4 matrix constructed from a single double value by converting it to float and assigning it to every component. + /// double to convert to float4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 float4x4(double v) { return new float4x4(v); } + + /// Return a float4x4 matrix constructed from a double4x4 matrix by componentwise conversion. + /// double4x4 to convert to float4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 float4x4(double4x4 v) { return new float4x4(v); } + + /// Return the result of rotating a float3 vector by a float4x4 matrix + /// Left hand side matrix argument that specifies the rotation. + /// Right hand side vector argument to be rotated. + /// The rotated vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 rotate(float4x4 a, float3 b) + { + return (a.c0 * b.x + a.c1 * b.y + a.c2 * b.z).xyz; + } + + /// Return the result of transforming a float3 point by a float4x4 matrix + /// Left hand side matrix argument that specifies the transformation. + /// Right hand side point argument to be transformed. + /// The transformed point. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 transform(float4x4 a, float3 b) + { + return (a.c0 * b.x + a.c1 * b.y + a.c2 * b.z + a.c3).xyz; + } + + /// Return the float4x4 transpose of a float4x4 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 transpose(float4x4 v) + { + return float4x4( + v.c0.x, v.c0.y, v.c0.z, v.c0.w, + v.c1.x, v.c1.y, v.c1.z, v.c1.w, + v.c2.x, v.c2.y, v.c2.z, v.c2.w, + v.c3.x, v.c3.y, v.c3.z, v.c3.w); + } + + /// Returns the float4x4 full inverse of a float4x4 matrix. + /// Matrix to invert. + /// The inverted matrix. + public static float4x4 inverse(float4x4 m) + { + float4 c0 = m.c0; + float4 c1 = m.c1; + float4 c2 = m.c2; + float4 c3 = m.c3; + + float4 r0y_r1y_r0x_r1x = movelh(c1, c0); + float4 r0z_r1z_r0w_r1w = movelh(c2, c3); + float4 r2y_r3y_r2x_r3x = movehl(c0, c1); + float4 r2z_r3z_r2w_r3w = movehl(c3, c2); + + float4 r1y_r2y_r1x_r2x = shuffle(c1, c0, ShuffleComponent.LeftY, ShuffleComponent.LeftZ, ShuffleComponent.RightY, ShuffleComponent.RightZ); + float4 r1z_r2z_r1w_r2w = shuffle(c2, c3, ShuffleComponent.LeftY, ShuffleComponent.LeftZ, ShuffleComponent.RightY, ShuffleComponent.RightZ); + float4 r3y_r0y_r3x_r0x = shuffle(c1, c0, ShuffleComponent.LeftW, ShuffleComponent.LeftX, ShuffleComponent.RightW, ShuffleComponent.RightX); + float4 r3z_r0z_r3w_r0w = shuffle(c2, c3, ShuffleComponent.LeftW, ShuffleComponent.LeftX, ShuffleComponent.RightW, ShuffleComponent.RightX); + + float4 r0_wzyx = shuffle(r0z_r1z_r0w_r1w, r0y_r1y_r0x_r1x, ShuffleComponent.LeftZ, ShuffleComponent.LeftX, ShuffleComponent.RightX, ShuffleComponent.RightZ); + float4 r1_wzyx = shuffle(r0z_r1z_r0w_r1w, r0y_r1y_r0x_r1x, ShuffleComponent.LeftW, ShuffleComponent.LeftY, ShuffleComponent.RightY, ShuffleComponent.RightW); + float4 r2_wzyx = shuffle(r2z_r3z_r2w_r3w, r2y_r3y_r2x_r3x, ShuffleComponent.LeftZ, ShuffleComponent.LeftX, ShuffleComponent.RightX, ShuffleComponent.RightZ); + float4 r3_wzyx = shuffle(r2z_r3z_r2w_r3w, r2y_r3y_r2x_r3x, ShuffleComponent.LeftW, ShuffleComponent.LeftY, ShuffleComponent.RightY, ShuffleComponent.RightW); + float4 r0_xyzw = shuffle(r0y_r1y_r0x_r1x, r0z_r1z_r0w_r1w, ShuffleComponent.LeftZ, ShuffleComponent.LeftX, ShuffleComponent.RightX, ShuffleComponent.RightZ); + + // Calculate remaining inner term pairs. inner terms have zw=-xy, so we only have to calculate xy and can pack two pairs per vector. + float4 inner12_23 = r1y_r2y_r1x_r2x * r2z_r3z_r2w_r3w - r1z_r2z_r1w_r2w * r2y_r3y_r2x_r3x; + float4 inner02_13 = r0y_r1y_r0x_r1x * r2z_r3z_r2w_r3w - r0z_r1z_r0w_r1w * r2y_r3y_r2x_r3x; + float4 inner30_01 = r3z_r0z_r3w_r0w * r0y_r1y_r0x_r1x - r3y_r0y_r3x_r0x * r0z_r1z_r0w_r1w; + + // Expand inner terms back to 4 components. zw signs still need to be flipped + float4 inner12 = shuffle(inner12_23, inner12_23, ShuffleComponent.LeftX, ShuffleComponent.LeftZ, ShuffleComponent.RightZ, ShuffleComponent.RightX); + float4 inner23 = shuffle(inner12_23, inner12_23, ShuffleComponent.LeftY, ShuffleComponent.LeftW, ShuffleComponent.RightW, ShuffleComponent.RightY); + + float4 inner02 = shuffle(inner02_13, inner02_13, ShuffleComponent.LeftX, ShuffleComponent.LeftZ, ShuffleComponent.RightZ, ShuffleComponent.RightX); + float4 inner13 = shuffle(inner02_13, inner02_13, ShuffleComponent.LeftY, ShuffleComponent.LeftW, ShuffleComponent.RightW, ShuffleComponent.RightY); + + // Calculate minors + float4 minors0 = r3_wzyx * inner12 - r2_wzyx * inner13 + r1_wzyx * inner23; + + float4 denom = r0_xyzw * minors0; + + // Horizontal sum of denominator. Free sign flip of z and w compensates for missing flip in inner terms. + denom = denom + shuffle(denom, denom, ShuffleComponent.LeftY, ShuffleComponent.LeftX, ShuffleComponent.RightW, ShuffleComponent.RightZ); // x+y x+y z+w z+w + denom = denom - shuffle(denom, denom, ShuffleComponent.LeftZ, ShuffleComponent.LeftZ, ShuffleComponent.RightX, ShuffleComponent.RightX); // x+y-z-w x+y-z-w z+w-x-y z+w-x-y + + float4 rcp_denom_ppnn = float4(1.0f) / denom; + float4x4 res; + res.c0 = minors0 * rcp_denom_ppnn; + + float4 inner30 = shuffle(inner30_01, inner30_01, ShuffleComponent.LeftX, ShuffleComponent.LeftZ, ShuffleComponent.RightZ, ShuffleComponent.RightX); + float4 inner01 = shuffle(inner30_01, inner30_01, ShuffleComponent.LeftY, ShuffleComponent.LeftW, ShuffleComponent.RightW, ShuffleComponent.RightY); + + float4 minors1 = r2_wzyx * inner30 - r0_wzyx * inner23 - r3_wzyx * inner02; + res.c1 = minors1 * rcp_denom_ppnn; + + float4 minors2 = r0_wzyx * inner13 - r1_wzyx * inner30 - r3_wzyx * inner01; + res.c2 = minors2 * rcp_denom_ppnn; + + float4 minors3 = r1_wzyx * inner02 - r0_wzyx * inner12 + r2_wzyx * inner01; + res.c3 = minors3 * rcp_denom_ppnn; + return res; + } + + /// Fast matrix inverse for rigid transforms (orthonormal basis and translation) + /// Matrix to invert. + /// The inverted matrix. + public static float4x4 fastinverse(float4x4 m) + { + float4 c0 = m.c0; + float4 c1 = m.c1; + float4 c2 = m.c2; + float4 pos = m.c3; + + float4 zero = float4(0); + + float4 t0 = unpacklo(c0, c2); + float4 t1 = unpacklo(c1, zero); + float4 t2 = unpackhi(c0, c2); + float4 t3 = unpackhi(c1, zero); + + float4 r0 = unpacklo(t0, t1); + float4 r1 = unpackhi(t0, t1); + float4 r2 = unpacklo(t2, t3); + + pos = -(r0 * pos.x + r1 * pos.y + r2 * pos.z); + pos.w = 1.0f; + + return float4x4(r0, r1, r2, pos); + } + + /// Returns the determinant of a float4x4 matrix. + /// Matrix to use when computing determinant. + /// The determinant of the matrix. + public static float determinant(float4x4 m) + { + float4 c0 = m.c0; + float4 c1 = m.c1; + float4 c2 = m.c2; + float4 c3 = m.c3; + + float m00 = c1.y * (c2.z * c3.w - c2.w * c3.z) - c2.y * (c1.z * c3.w - c1.w * c3.z) + c3.y * (c1.z * c2.w - c1.w * c2.z); + float m01 = c0.y * (c2.z * c3.w - c2.w * c3.z) - c2.y * (c0.z * c3.w - c0.w * c3.z) + c3.y * (c0.z * c2.w - c0.w * c2.z); + float m02 = c0.y * (c1.z * c3.w - c1.w * c3.z) - c1.y * (c0.z * c3.w - c0.w * c3.z) + c3.y * (c0.z * c1.w - c0.w * c1.z); + float m03 = c0.y * (c1.z * c2.w - c1.w * c2.z) - c1.y * (c0.z * c2.w - c0.w * c2.z) + c2.y * (c0.z * c1.w - c0.w * c1.z); + + return c0.x * m00 - c1.x * m01 + c2.x * m02 - c3.x * m03; + } + + /// Returns a uint hash code of a float4x4 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(float4x4 v) + { + return csum(asuint(v.c0) * uint4(0xC4B1493Fu, 0xBA0966D3u, 0xAFBEE253u, 0x5B419C01u) + + asuint(v.c1) * uint4(0x515D90F5u, 0xEC9F68F3u, 0xF9EA92D5u, 0xC2FAFCB9u) + + asuint(v.c2) * uint4(0x616E9CA1u, 0xC5C5394Bu, 0xCAE78587u, 0x7A1541C9u) + + asuint(v.c3) * uint4(0xF83BD927u, 0x6A243BCBu, 0x509B84C9u, 0x91D13847u)) + 0x52F7230Fu; + } + + /// + /// Returns a uint4 vector hash code of a float4x4 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint4 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 hashwide(float4x4 v) + { + return (asuint(v.c0) * uint4(0xCF286E83u, 0xE121E6ADu, 0xC9CA1249u, 0x69B60C81u) + + asuint(v.c1) * uint4(0xE0EB6C25u, 0xF648BEABu, 0x6BDB2B07u, 0xEF63C699u) + + asuint(v.c2) * uint4(0x9001903Fu, 0xA895B9CDu, 0x9D23B201u, 0x4B01D3E1u) + + asuint(v.c3) * uint4(0x7461CA0Du, 0x79725379u, 0xD6258E5Bu, 0xEE390C97u)) + 0x9C8A2F05u; + } + + } +} diff --git a/src/Unity.Mathematics/float4x4.gen.cs.meta b/src/Unity.Mathematics/float4x4.gen.cs.meta new file mode 100644 index 00000000..0b3cfdc8 --- /dev/null +++ b/src/Unity.Mathematics/float4x4.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 53454a4b51c974a438994628ac5767e2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/half.cs b/src/Unity.Mathematics/half.cs index 8bd94d56..0e5a5286 100644 --- a/src/Unity.Mathematics/half.cs +++ b/src/Unity.Mathematics/half.cs @@ -1,83 +1,170 @@ -namespace Unity.Mathematics +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +namespace Unity.Mathematics { - public struct half + /// + /// A half precision float that uses 16 bits instead of 32 bits. + /// + [Il2CppEagerStaticClassConstruction] + [Serializable] + public struct half : System.IEquatable, IFormattable { - private short value; + /// + /// The raw 16 bit value of the half. + /// + public ushort value; + + /// half zero value. + public static readonly half zero = new half(); + + /// + /// The maximum finite half value as a single precision float. + /// + public static float MaxValue { get { return 65504.0f; } } + + /// + /// The minimum finite half value as a single precision float. + /// + public static float MinValue { get { return -65504.0f; } } - public static float MaxValue { get { return 65536.0F; } } - public static float MinValue { get { return -65536.0F; } } + /// + /// The maximum finite half value as a half. + /// + public static half MaxValueAsHalf => new half(MaxValue); - public static implicit operator half(float v) + /// + /// The minimum finite half value as a half. + /// + public static half MinValueAsHalf => new half(MinValue); + + /// Constructs a half value from a half value. + /// The input half value to copy. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public half(half x) { - unchecked - { - v = math.clamp(v, -65536.0f, 65536.0f) * 1.925930e-34f; - int i = IntFloatUnion.ToInt(v); - uint ui = (uint)i; - int h = ((i >> 16) & (int)0xffff8000) | ((int)(ui >> 13)); - half value; - value.value = (short)h; - return value; - } + value = x.value; } - public static implicit operator float(half d) + /// Constructs a half value from a float value. + /// The single precision float value to convert to half. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public half(float v) { - int iv = d.value; - int i = (iv & 0x47fff) << 13; - return IntFloatUnion.ToFloat(i) * 5.192297e+33f; + value = (ushort)math.f32tof16(v); } - } - public struct half2 - { - public half x; - public half y; - - public half2(half x, half y) + /// Constructs a half value from a double value. + /// The double precision float value to convert to half. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public half(double v) { - this.x = x; - this.y = y; + value = (ushort)math.f32tof16((float)v); } - public static implicit operator half2(float2 d) { return new half2(d.x, d.y); } - public static implicit operator float2(half2 d) { return new float2(d.x, d.y); } - } + /// Explicitly converts a float value to a half value. + /// The single precision float value to convert to half. + /// The converted half value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator half(float v) { return new half(v); } + + /// Explicitly converts a double value to a half value. + /// The double precision float value to convert to half. + /// The converted half value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator half(double v) { return new half(v); } + + /// Implicitly converts a half value to a float value. + /// The half value to convert to a single precision float. + /// The converted single precision float value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator float(half d) { return math.f16tof32(d.value); } + + /// Implicitly converts a half value to a double value. + /// The half value to convert to double precision float. + /// The converted double precision float value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator double(half d) { return math.f16tof32(d.value); } - public struct half3 - { - public half x; - public half y; - public half z; - public half3(half x, half y, half z) + /// Returns whether two half values are bitwise equivalent. + /// Left hand side half value to use in comparison. + /// Right hand side half value to use in comparison. + /// True if the two half values are bitwise equivalent, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(half lhs, half rhs) { return lhs.value == rhs.value; } + + /// Returns whether two half values are not bitwise equivalent. + /// Left hand side half value to use in comparison. + /// Right hand side half value to use in comparison. + /// True if the two half values are not bitwise equivalent, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(half lhs, half rhs) { return lhs.value != rhs.value; } + + + /// Returns true if the half is bitwise equivalent to a given half, false otherwise. + /// Right hand side half value to use in comparison. + /// True if the half value is bitwise equivalent to the input, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(half rhs) { return value == rhs.value; } + + /// Returns true if the half is equal to a given half, false otherwise. + /// Right hand side object to use in comparison. + /// True if the object is of type half and is bitwise equivalent, false otherwise. + public override bool Equals(object o) { return o is half converted && Equals(converted); } + + /// Returns a hash code for the half. + /// The computed hash code of the half. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)value; } + + /// Returns a string representation of the half. + /// The string representation of the half. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() { - this.x = x; - this.y = y; - this.z = z; + return math.f16tof32(value).ToString(); } - public static implicit operator half3(float3 d) { return new half3(d.x, d.y, d.z); } - public static implicit operator float3(half3 d) { return new float3(d.x, d.y, d.z); } + /// Returns a string representation of the half using a specified format and culture-specific format information. + /// The format string to use during string formatting. + /// The format provider to use during string formatting. + /// The string representation of the half. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return math.f16tof32(value).ToString(format, formatProvider); + } } - public struct half4 + public static partial class math { - public half x; - public half y; - public half z; - public half w; + /// Returns a half value constructed from a half values. + /// The input half value to copy. + /// The constructed half value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static half half(half x) { return new half(x); } - public half4(half x, half y, half z, half w) - { - this.x = x; - this.y = y; - this.z = z; - this.w = w; - } + /// Returns a half value constructed from a float value. + /// The single precision float value to convert to half. + /// The constructed half value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static half half(float v) { return new half(v); } - public static implicit operator half4(float4 d) { return new half4(d.x, d.y, d.z, d.w); } - public static implicit operator float4(half4 d) { return new float4(d.x, d.y, d.z, d.w); } + /// Returns a half value constructed from a double value. + /// The double precision float value to convert to half. + /// The constructed half value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static half half(double v) { return new half(v); } + /// Returns a uint hash code of a half value. + /// The half value to hash. + /// The computed hash code of the half value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(half v) + { + return v.value * 0x745ED837u + 0x816EFB5Du; + } } } diff --git a/src/Unity.Mathematics/half2.gen.cs b/src/Unity.Mathematics/half2.gen.cs new file mode 100644 index 00000000..78c4fcdd --- /dev/null +++ b/src/Unity.Mathematics/half2.gen.cs @@ -0,0 +1,569 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using System.Diagnostics; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 2 component vector of halfs. + [DebuggerTypeProxy(typeof(half2.DebuggerProxy))] + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct half2 : System.IEquatable, IFormattable + { + /// x component of the vector. + public half x; + /// y component of the vector. + public half y; + + /// half2 zero value. + public static readonly half2 zero; + + /// Constructs a half2 vector from two half values. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public half2(half x, half y) + { + this.x = x; + this.y = y; + } + + /// Constructs a half2 vector from a half2 vector. + /// The constructed vector's xy components will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public half2(half2 xy) + { + this.x = xy.x; + this.y = xy.y; + } + + /// Constructs a half2 vector from a single half value by assigning it to every component. + /// half to convert to half2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public half2(half v) + { + this.x = v; + this.y = v; + } + + /// Constructs a half2 vector from a single float value by converting it to half and assigning it to every component. + /// float to convert to half2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public half2(float v) + { + this.x = (half)v; + this.y = (half)v; + } + + /// Constructs a half2 vector from a float2 vector by componentwise conversion. + /// float2 to convert to half2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public half2(float2 v) + { + this.x = (half)v.x; + this.y = (half)v.y; + } + + /// Constructs a half2 vector from a single double value by converting it to half and assigning it to every component. + /// double to convert to half2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public half2(double v) + { + this.x = (half)v; + this.y = (half)v; + } + + /// Constructs a half2 vector from a double2 vector by componentwise conversion. + /// double2 to convert to half2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public half2(double2 v) + { + this.x = (half)v.x; + this.y = (half)v.y; + } + + + /// Implicitly converts a single half value to a half2 vector by assigning it to every component. + /// half to convert to half2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator half2(half v) { return new half2(v); } + + /// Explicitly converts a single float value to a half2 vector by converting it to half and assigning it to every component. + /// float to convert to half2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator half2(float v) { return new half2(v); } + + /// Explicitly converts a float2 vector to a half2 vector by componentwise conversion. + /// float2 to convert to half2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator half2(float2 v) { return new half2(v); } + + /// Explicitly converts a single double value to a half2 vector by converting it to half and assigning it to every component. + /// double to convert to half2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator half2(double v) { return new half2(v); } + + /// Explicitly converts a double2 vector to a half2 vector by componentwise conversion. + /// double2 to convert to half2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator half2(double2 v) { return new half2(v); } + + + /// Returns the result of a componentwise equality operation on two half2 vectors. + /// Left hand side half2 to use to compute componentwise equality. + /// Right hand side half2 to use to compute componentwise equality. + /// bool2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2 operator == (half2 lhs, half2 rhs) { return new bool2 (lhs.x == rhs.x, lhs.y == rhs.y); } + + /// Returns the result of a componentwise equality operation on a half2 vector and a half value. + /// Left hand side half2 to use to compute componentwise equality. + /// Right hand side half to use to compute componentwise equality. + /// bool2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2 operator == (half2 lhs, half rhs) { return new bool2 (lhs.x == rhs, lhs.y == rhs); } + + /// Returns the result of a componentwise equality operation on a half value and a half2 vector. + /// Left hand side half to use to compute componentwise equality. + /// Right hand side half2 to use to compute componentwise equality. + /// bool2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2 operator == (half lhs, half2 rhs) { return new bool2 (lhs == rhs.x, lhs == rhs.y); } + + + /// Returns the result of a componentwise not equal operation on two half2 vectors. + /// Left hand side half2 to use to compute componentwise not equal. + /// Right hand side half2 to use to compute componentwise not equal. + /// bool2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2 operator != (half2 lhs, half2 rhs) { return new bool2 (lhs.x != rhs.x, lhs.y != rhs.y); } + + /// Returns the result of a componentwise not equal operation on a half2 vector and a half value. + /// Left hand side half2 to use to compute componentwise not equal. + /// Right hand side half to use to compute componentwise not equal. + /// bool2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2 operator != (half2 lhs, half rhs) { return new bool2 (lhs.x != rhs, lhs.y != rhs); } + + /// Returns the result of a componentwise not equal operation on a half value and a half2 vector. + /// Left hand side half to use to compute componentwise not equal. + /// Right hand side half2 to use to compute componentwise not equal. + /// bool2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2 operator != (half lhs, half2 rhs) { return new bool2 (lhs != rhs.x, lhs != rhs.y); } + + + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xxxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, x, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xxxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, x, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xxyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, x, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xxyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, x, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xyxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, y, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xyxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, y, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xyyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, y, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xyyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, y, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yxxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, x, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yxxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, x, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yxyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, x, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yxyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, x, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yyxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, y, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yyxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, y, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yyyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, y, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yyyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, y, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 xxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(x, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 xxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(x, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 xyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(x, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 xyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(x, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 yxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(y, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 yxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(y, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 yyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(y, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 yyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(y, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half2 xx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half2(x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half2 xy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half2(x, y); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { x = value.x; y = value.y; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half2 yx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half2(y, x); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { y = value.x; x = value.y; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half2 yy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half2(y, y); } + } + + + + /// Returns the half element at a specified index. + unsafe public half this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 2) + throw new System.ArgumentException("index must be between[0...1]"); +#endif + fixed (half2* array = &this) { return ((half*)array)[index]; } + } + set + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 2) + throw new System.ArgumentException("index must be between[0...1]"); +#endif + fixed (half* array = &x) { array[index] = value; } + } + } + + /// Returns true if the half2 is equal to a given half2, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(half2 rhs) { return x == rhs.x && y == rhs.y; } + + /// Returns true if the half2 is equal to a given half2, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is half2 converted && Equals(converted); } + + + /// Returns a hash code for the half2. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the half2. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("half2({0}, {1})", x, y); + } + + /// Returns a string representation of the half2 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("half2({0}, {1})", x.ToString(format, formatProvider), y.ToString(format, formatProvider)); + } + + internal sealed class DebuggerProxy + { + public half x; + public half y; + public DebuggerProxy(half2 v) + { + x = v.x; + y = v.y; + } + } + + } + + public static partial class math + { + /// Returns a half2 vector constructed from two half values. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + /// half2 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static half2 half2(half x, half y) { return new half2(x, y); } + + /// Returns a half2 vector constructed from a half2 vector. + /// The constructed vector's xy components will be set to this value. + /// half2 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static half2 half2(half2 xy) { return new half2(xy); } + + /// Returns a half2 vector constructed from a single half value by assigning it to every component. + /// half to convert to half2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static half2 half2(half v) { return new half2(v); } + + /// Returns a half2 vector constructed from a single float value by converting it to half and assigning it to every component. + /// float to convert to half2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static half2 half2(float v) { return new half2(v); } + + /// Return a half2 vector constructed from a float2 vector by componentwise conversion. + /// float2 to convert to half2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static half2 half2(float2 v) { return new half2(v); } + + /// Returns a half2 vector constructed from a single double value by converting it to half and assigning it to every component. + /// double to convert to half2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static half2 half2(double v) { return new half2(v); } + + /// Return a half2 vector constructed from a double2 vector by componentwise conversion. + /// double2 to convert to half2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static half2 half2(double2 v) { return new half2(v); } + + /// Returns a uint hash code of a half2 vector. + /// Vector value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(half2 v) + { + return csum(uint2(v.x.value, v.y.value) * uint2(0x6E624EB7u, 0x7383ED49u)) + 0xDD49C23Bu; + } + + /// + /// Returns a uint2 vector hash code of a half2 vector. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Vector value to hash. + /// uint2 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 hashwide(half2 v) + { + return (uint2(v.x.value, v.y.value) * uint2(0xEBD0D005u, 0x91475DF7u)) + 0x55E84827u; + } + + } +} diff --git a/src/Unity.Mathematics/half2.gen.cs.meta b/src/Unity.Mathematics/half2.gen.cs.meta new file mode 100644 index 00000000..e9af8ddc --- /dev/null +++ b/src/Unity.Mathematics/half2.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 79785f1f327add947b5448161b8ddc4f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/half3.gen.cs b/src/Unity.Mathematics/half3.gen.cs new file mode 100644 index 00000000..2e5e8904 --- /dev/null +++ b/src/Unity.Mathematics/half3.gen.cs @@ -0,0 +1,1439 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using System.Diagnostics; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 3 component vector of halfs. + [DebuggerTypeProxy(typeof(half3.DebuggerProxy))] + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct half3 : System.IEquatable, IFormattable + { + /// x component of the vector. + public half x; + /// y component of the vector. + public half y; + /// z component of the vector. + public half z; + + /// half3 zero value. + public static readonly half3 zero; + + /// Constructs a half3 vector from three half values. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + /// The constructed vector's z component will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public half3(half x, half y, half z) + { + this.x = x; + this.y = y; + this.z = z; + } + + /// Constructs a half3 vector from a half value and a half2 vector. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's yz components will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public half3(half x, half2 yz) + { + this.x = x; + this.y = yz.x; + this.z = yz.y; + } + + /// Constructs a half3 vector from a half2 vector and a half value. + /// The constructed vector's xy components will be set to this value. + /// The constructed vector's z component will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public half3(half2 xy, half z) + { + this.x = xy.x; + this.y = xy.y; + this.z = z; + } + + /// Constructs a half3 vector from a half3 vector. + /// The constructed vector's xyz components will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public half3(half3 xyz) + { + this.x = xyz.x; + this.y = xyz.y; + this.z = xyz.z; + } + + /// Constructs a half3 vector from a single half value by assigning it to every component. + /// half to convert to half3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public half3(half v) + { + this.x = v; + this.y = v; + this.z = v; + } + + /// Constructs a half3 vector from a single float value by converting it to half and assigning it to every component. + /// float to convert to half3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public half3(float v) + { + this.x = (half)v; + this.y = (half)v; + this.z = (half)v; + } + + /// Constructs a half3 vector from a float3 vector by componentwise conversion. + /// float3 to convert to half3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public half3(float3 v) + { + this.x = (half)v.x; + this.y = (half)v.y; + this.z = (half)v.z; + } + + /// Constructs a half3 vector from a single double value by converting it to half and assigning it to every component. + /// double to convert to half3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public half3(double v) + { + this.x = (half)v; + this.y = (half)v; + this.z = (half)v; + } + + /// Constructs a half3 vector from a double3 vector by componentwise conversion. + /// double3 to convert to half3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public half3(double3 v) + { + this.x = (half)v.x; + this.y = (half)v.y; + this.z = (half)v.z; + } + + + /// Implicitly converts a single half value to a half3 vector by assigning it to every component. + /// half to convert to half3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator half3(half v) { return new half3(v); } + + /// Explicitly converts a single float value to a half3 vector by converting it to half and assigning it to every component. + /// float to convert to half3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator half3(float v) { return new half3(v); } + + /// Explicitly converts a float3 vector to a half3 vector by componentwise conversion. + /// float3 to convert to half3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator half3(float3 v) { return new half3(v); } + + /// Explicitly converts a single double value to a half3 vector by converting it to half and assigning it to every component. + /// double to convert to half3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator half3(double v) { return new half3(v); } + + /// Explicitly converts a double3 vector to a half3 vector by componentwise conversion. + /// double3 to convert to half3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator half3(double3 v) { return new half3(v); } + + + /// Returns the result of a componentwise equality operation on two half3 vectors. + /// Left hand side half3 to use to compute componentwise equality. + /// Right hand side half3 to use to compute componentwise equality. + /// bool3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3 operator == (half3 lhs, half3 rhs) { return new bool3 (lhs.x == rhs.x, lhs.y == rhs.y, lhs.z == rhs.z); } + + /// Returns the result of a componentwise equality operation on a half3 vector and a half value. + /// Left hand side half3 to use to compute componentwise equality. + /// Right hand side half to use to compute componentwise equality. + /// bool3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3 operator == (half3 lhs, half rhs) { return new bool3 (lhs.x == rhs, lhs.y == rhs, lhs.z == rhs); } + + /// Returns the result of a componentwise equality operation on a half value and a half3 vector. + /// Left hand side half to use to compute componentwise equality. + /// Right hand side half3 to use to compute componentwise equality. + /// bool3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3 operator == (half lhs, half3 rhs) { return new bool3 (lhs == rhs.x, lhs == rhs.y, lhs == rhs.z); } + + + /// Returns the result of a componentwise not equal operation on two half3 vectors. + /// Left hand side half3 to use to compute componentwise not equal. + /// Right hand side half3 to use to compute componentwise not equal. + /// bool3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3 operator != (half3 lhs, half3 rhs) { return new bool3 (lhs.x != rhs.x, lhs.y != rhs.y, lhs.z != rhs.z); } + + /// Returns the result of a componentwise not equal operation on a half3 vector and a half value. + /// Left hand side half3 to use to compute componentwise not equal. + /// Right hand side half to use to compute componentwise not equal. + /// bool3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3 operator != (half3 lhs, half rhs) { return new bool3 (lhs.x != rhs, lhs.y != rhs, lhs.z != rhs); } + + /// Returns the result of a componentwise not equal operation on a half value and a half3 vector. + /// Left hand side half to use to compute componentwise not equal. + /// Right hand side half3 to use to compute componentwise not equal. + /// bool3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3 operator != (half lhs, half3 rhs) { return new bool3 (lhs != rhs.x, lhs != rhs.y, lhs != rhs.z); } + + + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xxxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, x, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xxxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, x, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xxxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, x, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xxyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, x, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xxyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, x, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xxyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, x, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xxzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, x, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xxzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, x, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xxzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, x, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xyxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, y, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xyxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, y, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xyxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, y, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xyyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, y, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xyyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, y, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xyyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, y, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xyzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, y, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xyzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, y, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xyzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, y, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xzxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, z, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xzxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, z, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xzxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, z, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xzyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, z, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xzyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, z, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xzyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, z, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xzzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, z, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xzzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, z, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xzzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, z, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yxxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, x, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yxxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, x, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yxxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, x, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yxyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, x, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yxyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, x, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yxyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, x, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yxzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, x, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yxzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, x, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yxzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, x, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yyxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, y, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yyxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, y, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yyxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, y, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yyyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, y, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yyyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, y, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yyyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, y, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yyzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, y, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yyzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, y, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yyzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, y, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yzxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, z, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yzxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, z, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yzxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, z, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yzyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, z, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yzyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, z, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yzyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, z, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yzzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, z, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yzzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, z, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yzzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, z, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zxxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, x, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zxxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, x, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zxxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, x, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zxyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, x, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zxyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, x, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zxyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, x, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zxzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, x, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zxzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, x, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zxzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, x, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zyxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, y, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zyxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, y, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zyxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, y, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zyyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, y, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zyyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, y, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zyyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, y, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zyzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, y, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zyzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, y, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zyzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, y, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zzxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, z, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zzxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, z, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zzxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, z, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zzyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, z, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zzyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, z, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zzyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, z, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zzzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, z, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zzzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, z, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zzzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, z, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 xxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(x, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 xxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(x, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 xxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(x, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 xyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(x, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 xyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(x, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 xyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(x, y, z); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { x = value.x; y = value.y; z = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 xzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(x, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 xzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(x, z, y); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { x = value.x; z = value.y; y = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 xzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(x, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 yxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(y, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 yxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(y, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 yxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(y, x, z); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { y = value.x; x = value.y; z = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 yyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(y, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 yyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(y, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 yyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(y, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 yzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(y, z, x); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { y = value.x; z = value.y; x = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 yzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(y, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 yzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(y, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 zxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(z, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 zxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(z, x, y); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { z = value.x; x = value.y; y = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 zxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(z, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 zyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(z, y, x); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { z = value.x; y = value.y; x = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 zyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(z, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 zyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(z, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 zzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(z, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 zzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(z, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 zzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(z, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half2 xx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half2(x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half2 xy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half2(x, y); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { x = value.x; y = value.y; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half2 xz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half2(x, z); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { x = value.x; z = value.y; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half2 yx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half2(y, x); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { y = value.x; x = value.y; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half2 yy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half2(y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half2 yz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half2(y, z); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { y = value.x; z = value.y; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half2 zx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half2(z, x); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { z = value.x; x = value.y; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half2 zy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half2(z, y); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { z = value.x; y = value.y; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half2 zz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half2(z, z); } + } + + + + /// Returns the half element at a specified index. + unsafe public half this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 3) + throw new System.ArgumentException("index must be between[0...2]"); +#endif + fixed (half3* array = &this) { return ((half*)array)[index]; } + } + set + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 3) + throw new System.ArgumentException("index must be between[0...2]"); +#endif + fixed (half* array = &x) { array[index] = value; } + } + } + + /// Returns true if the half3 is equal to a given half3, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(half3 rhs) { return x == rhs.x && y == rhs.y && z == rhs.z; } + + /// Returns true if the half3 is equal to a given half3, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is half3 converted && Equals(converted); } + + + /// Returns a hash code for the half3. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the half3. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("half3({0}, {1}, {2})", x, y, z); + } + + /// Returns a string representation of the half3 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("half3({0}, {1}, {2})", x.ToString(format, formatProvider), y.ToString(format, formatProvider), z.ToString(format, formatProvider)); + } + + internal sealed class DebuggerProxy + { + public half x; + public half y; + public half z; + public DebuggerProxy(half3 v) + { + x = v.x; + y = v.y; + z = v.z; + } + } + + } + + public static partial class math + { + /// Returns a half3 vector constructed from three half values. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + /// The constructed vector's z component will be set to this value. + /// half3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static half3 half3(half x, half y, half z) { return new half3(x, y, z); } + + /// Returns a half3 vector constructed from a half value and a half2 vector. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's yz components will be set to this value. + /// half3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static half3 half3(half x, half2 yz) { return new half3(x, yz); } + + /// Returns a half3 vector constructed from a half2 vector and a half value. + /// The constructed vector's xy components will be set to this value. + /// The constructed vector's z component will be set to this value. + /// half3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static half3 half3(half2 xy, half z) { return new half3(xy, z); } + + /// Returns a half3 vector constructed from a half3 vector. + /// The constructed vector's xyz components will be set to this value. + /// half3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static half3 half3(half3 xyz) { return new half3(xyz); } + + /// Returns a half3 vector constructed from a single half value by assigning it to every component. + /// half to convert to half3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static half3 half3(half v) { return new half3(v); } + + /// Returns a half3 vector constructed from a single float value by converting it to half and assigning it to every component. + /// float to convert to half3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static half3 half3(float v) { return new half3(v); } + + /// Return a half3 vector constructed from a float3 vector by componentwise conversion. + /// float3 to convert to half3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static half3 half3(float3 v) { return new half3(v); } + + /// Returns a half3 vector constructed from a single double value by converting it to half and assigning it to every component. + /// double to convert to half3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static half3 half3(double v) { return new half3(v); } + + /// Return a half3 vector constructed from a double3 vector by componentwise conversion. + /// double3 to convert to half3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static half3 half3(double3 v) { return new half3(v); } + + /// Returns a uint hash code of a half3 vector. + /// Vector value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(half3 v) + { + return csum(uint3(v.x.value, v.y.value, v.z.value) * uint3(0x685835CFu, 0xC3D32AE1u, 0xB966942Fu)) + 0xFE9856B3u; + } + + /// + /// Returns a uint3 vector hash code of a half3 vector. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Vector value to hash. + /// uint3 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 hashwide(half3 v) + { + return (uint3(v.x.value, v.y.value, v.z.value) * uint3(0xFA3A3285u, 0xAD55999Du, 0xDCDD5341u)) + 0x94DDD769u; + } + + } +} diff --git a/src/Unity.Mathematics/half3.gen.cs.meta b/src/Unity.Mathematics/half3.gen.cs.meta new file mode 100644 index 00000000..22fa7646 --- /dev/null +++ b/src/Unity.Mathematics/half3.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d271113f4074d29479af6b04f032a53e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/half4.gen.cs b/src/Unity.Mathematics/half4.gen.cs new file mode 100644 index 00000000..f9786994 --- /dev/null +++ b/src/Unity.Mathematics/half4.gen.cs @@ -0,0 +1,3603 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using System.Diagnostics; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 4 component vector of halfs. + [DebuggerTypeProxy(typeof(half4.DebuggerProxy))] + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct half4 : System.IEquatable, IFormattable + { + /// x component of the vector. + public half x; + /// y component of the vector. + public half y; + /// z component of the vector. + public half z; + /// w component of the vector. + public half w; + + /// half4 zero value. + public static readonly half4 zero; + + /// Constructs a half4 vector from four half values. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + /// The constructed vector's z component will be set to this value. + /// The constructed vector's w component will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public half4(half x, half y, half z, half w) + { + this.x = x; + this.y = y; + this.z = z; + this.w = w; + } + + /// Constructs a half4 vector from two half values and a half2 vector. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + /// The constructed vector's zw components will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public half4(half x, half y, half2 zw) + { + this.x = x; + this.y = y; + this.z = zw.x; + this.w = zw.y; + } + + /// Constructs a half4 vector from a half value, a half2 vector and a half value. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's yz components will be set to this value. + /// The constructed vector's w component will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public half4(half x, half2 yz, half w) + { + this.x = x; + this.y = yz.x; + this.z = yz.y; + this.w = w; + } + + /// Constructs a half4 vector from a half value and a half3 vector. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's yzw components will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public half4(half x, half3 yzw) + { + this.x = x; + this.y = yzw.x; + this.z = yzw.y; + this.w = yzw.z; + } + + /// Constructs a half4 vector from a half2 vector and two half values. + /// The constructed vector's xy components will be set to this value. + /// The constructed vector's z component will be set to this value. + /// The constructed vector's w component will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public half4(half2 xy, half z, half w) + { + this.x = xy.x; + this.y = xy.y; + this.z = z; + this.w = w; + } + + /// Constructs a half4 vector from two half2 vectors. + /// The constructed vector's xy components will be set to this value. + /// The constructed vector's zw components will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public half4(half2 xy, half2 zw) + { + this.x = xy.x; + this.y = xy.y; + this.z = zw.x; + this.w = zw.y; + } + + /// Constructs a half4 vector from a half3 vector and a half value. + /// The constructed vector's xyz components will be set to this value. + /// The constructed vector's w component will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public half4(half3 xyz, half w) + { + this.x = xyz.x; + this.y = xyz.y; + this.z = xyz.z; + this.w = w; + } + + /// Constructs a half4 vector from a half4 vector. + /// The constructed vector's xyzw components will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public half4(half4 xyzw) + { + this.x = xyzw.x; + this.y = xyzw.y; + this.z = xyzw.z; + this.w = xyzw.w; + } + + /// Constructs a half4 vector from a single half value by assigning it to every component. + /// half to convert to half4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public half4(half v) + { + this.x = v; + this.y = v; + this.z = v; + this.w = v; + } + + /// Constructs a half4 vector from a single float value by converting it to half and assigning it to every component. + /// float to convert to half4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public half4(float v) + { + this.x = (half)v; + this.y = (half)v; + this.z = (half)v; + this.w = (half)v; + } + + /// Constructs a half4 vector from a float4 vector by componentwise conversion. + /// float4 to convert to half4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public half4(float4 v) + { + this.x = (half)v.x; + this.y = (half)v.y; + this.z = (half)v.z; + this.w = (half)v.w; + } + + /// Constructs a half4 vector from a single double value by converting it to half and assigning it to every component. + /// double to convert to half4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public half4(double v) + { + this.x = (half)v; + this.y = (half)v; + this.z = (half)v; + this.w = (half)v; + } + + /// Constructs a half4 vector from a double4 vector by componentwise conversion. + /// double4 to convert to half4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public half4(double4 v) + { + this.x = (half)v.x; + this.y = (half)v.y; + this.z = (half)v.z; + this.w = (half)v.w; + } + + + /// Implicitly converts a single half value to a half4 vector by assigning it to every component. + /// half to convert to half4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator half4(half v) { return new half4(v); } + + /// Explicitly converts a single float value to a half4 vector by converting it to half and assigning it to every component. + /// float to convert to half4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator half4(float v) { return new half4(v); } + + /// Explicitly converts a float4 vector to a half4 vector by componentwise conversion. + /// float4 to convert to half4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator half4(float4 v) { return new half4(v); } + + /// Explicitly converts a single double value to a half4 vector by converting it to half and assigning it to every component. + /// double to convert to half4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator half4(double v) { return new half4(v); } + + /// Explicitly converts a double4 vector to a half4 vector by componentwise conversion. + /// double4 to convert to half4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator half4(double4 v) { return new half4(v); } + + + /// Returns the result of a componentwise equality operation on two half4 vectors. + /// Left hand side half4 to use to compute componentwise equality. + /// Right hand side half4 to use to compute componentwise equality. + /// bool4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 operator == (half4 lhs, half4 rhs) { return new bool4 (lhs.x == rhs.x, lhs.y == rhs.y, lhs.z == rhs.z, lhs.w == rhs.w); } + + /// Returns the result of a componentwise equality operation on a half4 vector and a half value. + /// Left hand side half4 to use to compute componentwise equality. + /// Right hand side half to use to compute componentwise equality. + /// bool4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 operator == (half4 lhs, half rhs) { return new bool4 (lhs.x == rhs, lhs.y == rhs, lhs.z == rhs, lhs.w == rhs); } + + /// Returns the result of a componentwise equality operation on a half value and a half4 vector. + /// Left hand side half to use to compute componentwise equality. + /// Right hand side half4 to use to compute componentwise equality. + /// bool4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 operator == (half lhs, half4 rhs) { return new bool4 (lhs == rhs.x, lhs == rhs.y, lhs == rhs.z, lhs == rhs.w); } + + + /// Returns the result of a componentwise not equal operation on two half4 vectors. + /// Left hand side half4 to use to compute componentwise not equal. + /// Right hand side half4 to use to compute componentwise not equal. + /// bool4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 operator != (half4 lhs, half4 rhs) { return new bool4 (lhs.x != rhs.x, lhs.y != rhs.y, lhs.z != rhs.z, lhs.w != rhs.w); } + + /// Returns the result of a componentwise not equal operation on a half4 vector and a half value. + /// Left hand side half4 to use to compute componentwise not equal. + /// Right hand side half to use to compute componentwise not equal. + /// bool4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 operator != (half4 lhs, half rhs) { return new bool4 (lhs.x != rhs, lhs.y != rhs, lhs.z != rhs, lhs.w != rhs); } + + /// Returns the result of a componentwise not equal operation on a half value and a half4 vector. + /// Left hand side half to use to compute componentwise not equal. + /// Right hand side half4 to use to compute componentwise not equal. + /// bool4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 operator != (half lhs, half4 rhs) { return new bool4 (lhs != rhs.x, lhs != rhs.y, lhs != rhs.z, lhs != rhs.w); } + + + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xxxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, x, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xxxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, x, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xxxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, x, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xxxw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, x, x, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xxyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, x, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xxyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, x, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xxyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, x, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xxyw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, x, y, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xxzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, x, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xxzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, x, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xxzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, x, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xxzw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, x, z, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xxwx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, x, w, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xxwy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, x, w, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xxwz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, x, w, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xxww + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, x, w, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xyxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, y, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xyxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, y, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xyxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, y, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xyxw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, y, x, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xyyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, y, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xyyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, y, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xyyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, y, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xyyw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, y, y, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xyzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, y, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xyzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, y, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xyzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, y, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xyzw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, y, z, w); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { x = value.x; y = value.y; z = value.z; w = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xywx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, y, w, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xywy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, y, w, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xywz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, y, w, z); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { x = value.x; y = value.y; w = value.z; z = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xyww + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, y, w, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xzxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, z, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xzxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, z, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xzxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, z, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xzxw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, z, x, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xzyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, z, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xzyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, z, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xzyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, z, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xzyw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, z, y, w); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { x = value.x; z = value.y; y = value.z; w = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xzzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, z, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xzzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, z, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xzzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, z, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xzzw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, z, z, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xzwx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, z, w, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xzwy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, z, w, y); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { x = value.x; z = value.y; w = value.z; y = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xzwz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, z, w, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xzww + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, z, w, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xwxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, w, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xwxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, w, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xwxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, w, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xwxw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, w, x, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xwyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, w, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xwyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, w, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xwyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, w, y, z); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { x = value.x; w = value.y; y = value.z; z = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xwyw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, w, y, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xwzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, w, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xwzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, w, z, y); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { x = value.x; w = value.y; z = value.z; y = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xwzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, w, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xwzw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, w, z, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xwwx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, w, w, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xwwy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, w, w, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xwwz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, w, w, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 xwww + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(x, w, w, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yxxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, x, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yxxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, x, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yxxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, x, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yxxw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, x, x, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yxyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, x, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yxyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, x, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yxyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, x, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yxyw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, x, y, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yxzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, x, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yxzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, x, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yxzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, x, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yxzw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, x, z, w); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { y = value.x; x = value.y; z = value.z; w = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yxwx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, x, w, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yxwy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, x, w, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yxwz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, x, w, z); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { y = value.x; x = value.y; w = value.z; z = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yxww + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, x, w, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yyxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, y, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yyxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, y, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yyxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, y, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yyxw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, y, x, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yyyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, y, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yyyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, y, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yyyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, y, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yyyw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, y, y, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yyzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, y, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yyzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, y, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yyzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, y, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yyzw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, y, z, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yywx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, y, w, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yywy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, y, w, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yywz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, y, w, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yyww + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, y, w, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yzxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, z, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yzxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, z, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yzxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, z, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yzxw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, z, x, w); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { y = value.x; z = value.y; x = value.z; w = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yzyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, z, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yzyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, z, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yzyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, z, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yzyw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, z, y, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yzzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, z, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yzzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, z, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yzzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, z, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yzzw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, z, z, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yzwx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, z, w, x); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { y = value.x; z = value.y; w = value.z; x = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yzwy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, z, w, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yzwz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, z, w, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 yzww + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, z, w, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 ywxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, w, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 ywxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, w, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 ywxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, w, x, z); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { y = value.x; w = value.y; x = value.z; z = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 ywxw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, w, x, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 ywyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, w, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 ywyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, w, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 ywyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, w, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 ywyw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, w, y, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 ywzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, w, z, x); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { y = value.x; w = value.y; z = value.z; x = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 ywzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, w, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 ywzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, w, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 ywzw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, w, z, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 ywwx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, w, w, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 ywwy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, w, w, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 ywwz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, w, w, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 ywww + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(y, w, w, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zxxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, x, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zxxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, x, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zxxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, x, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zxxw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, x, x, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zxyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, x, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zxyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, x, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zxyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, x, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zxyw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, x, y, w); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { z = value.x; x = value.y; y = value.z; w = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zxzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, x, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zxzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, x, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zxzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, x, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zxzw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, x, z, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zxwx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, x, w, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zxwy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, x, w, y); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { z = value.x; x = value.y; w = value.z; y = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zxwz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, x, w, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zxww + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, x, w, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zyxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, y, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zyxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, y, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zyxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, y, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zyxw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, y, x, w); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { z = value.x; y = value.y; x = value.z; w = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zyyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, y, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zyyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, y, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zyyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, y, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zyyw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, y, y, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zyzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, y, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zyzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, y, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zyzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, y, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zyzw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, y, z, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zywx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, y, w, x); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { z = value.x; y = value.y; w = value.z; x = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zywy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, y, w, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zywz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, y, w, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zyww + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, y, w, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zzxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, z, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zzxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, z, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zzxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, z, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zzxw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, z, x, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zzyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, z, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zzyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, z, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zzyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, z, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zzyw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, z, y, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zzzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, z, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zzzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, z, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zzzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, z, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zzzw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, z, z, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zzwx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, z, w, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zzwy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, z, w, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zzwz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, z, w, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zzww + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, z, w, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zwxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, w, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zwxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, w, x, y); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { z = value.x; w = value.y; x = value.z; y = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zwxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, w, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zwxw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, w, x, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zwyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, w, y, x); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { z = value.x; w = value.y; y = value.z; x = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zwyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, w, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zwyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, w, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zwyw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, w, y, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zwzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, w, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zwzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, w, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zwzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, w, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zwzw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, w, z, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zwwx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, w, w, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zwwy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, w, w, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zwwz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, w, w, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 zwww + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(z, w, w, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wxxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, x, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wxxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, x, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wxxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, x, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wxxw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, x, x, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wxyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, x, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wxyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, x, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wxyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, x, y, z); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { w = value.x; x = value.y; y = value.z; z = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wxyw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, x, y, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wxzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, x, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wxzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, x, z, y); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { w = value.x; x = value.y; z = value.z; y = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wxzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, x, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wxzw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, x, z, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wxwx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, x, w, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wxwy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, x, w, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wxwz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, x, w, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wxww + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, x, w, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wyxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, y, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wyxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, y, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wyxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, y, x, z); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { w = value.x; y = value.y; x = value.z; z = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wyxw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, y, x, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wyyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, y, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wyyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, y, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wyyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, y, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wyyw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, y, y, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wyzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, y, z, x); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { w = value.x; y = value.y; z = value.z; x = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wyzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, y, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wyzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, y, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wyzw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, y, z, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wywx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, y, w, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wywy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, y, w, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wywz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, y, w, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wyww + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, y, w, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wzxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, z, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wzxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, z, x, y); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { w = value.x; z = value.y; x = value.z; y = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wzxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, z, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wzxw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, z, x, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wzyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, z, y, x); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { w = value.x; z = value.y; y = value.z; x = value.w; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wzyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, z, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wzyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, z, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wzyw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, z, y, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wzzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, z, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wzzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, z, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wzzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, z, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wzzw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, z, z, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wzwx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, z, w, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wzwy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, z, w, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wzwz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, z, w, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wzww + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, z, w, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wwxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, w, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wwxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, w, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wwxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, w, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wwxw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, w, x, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wwyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, w, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wwyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, w, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wwyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, w, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wwyw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, w, y, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wwzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, w, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wwzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, w, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wwzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, w, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wwzw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, w, z, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wwwx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, w, w, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wwwy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, w, w, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wwwz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, w, w, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half4 wwww + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half4(w, w, w, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 xxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(x, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 xxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(x, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 xxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(x, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 xxw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(x, x, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 xyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(x, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 xyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(x, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 xyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(x, y, z); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { x = value.x; y = value.y; z = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 xyw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(x, y, w); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { x = value.x; y = value.y; w = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 xzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(x, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 xzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(x, z, y); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { x = value.x; z = value.y; y = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 xzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(x, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 xzw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(x, z, w); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { x = value.x; z = value.y; w = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 xwx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(x, w, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 xwy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(x, w, y); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { x = value.x; w = value.y; y = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 xwz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(x, w, z); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { x = value.x; w = value.y; z = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 xww + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(x, w, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 yxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(y, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 yxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(y, x, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 yxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(y, x, z); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { y = value.x; x = value.y; z = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 yxw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(y, x, w); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { y = value.x; x = value.y; w = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 yyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(y, y, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 yyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(y, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 yyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(y, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 yyw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(y, y, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 yzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(y, z, x); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { y = value.x; z = value.y; x = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 yzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(y, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 yzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(y, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 yzw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(y, z, w); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { y = value.x; z = value.y; w = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 ywx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(y, w, x); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { y = value.x; w = value.y; x = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 ywy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(y, w, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 ywz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(y, w, z); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { y = value.x; w = value.y; z = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 yww + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(y, w, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 zxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(z, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 zxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(z, x, y); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { z = value.x; x = value.y; y = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 zxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(z, x, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 zxw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(z, x, w); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { z = value.x; x = value.y; w = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 zyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(z, y, x); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { z = value.x; y = value.y; x = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 zyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(z, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 zyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(z, y, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 zyw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(z, y, w); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { z = value.x; y = value.y; w = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 zzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(z, z, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 zzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(z, z, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 zzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(z, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 zzw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(z, z, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 zwx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(z, w, x); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { z = value.x; w = value.y; x = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 zwy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(z, w, y); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { z = value.x; w = value.y; y = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 zwz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(z, w, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 zww + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(z, w, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 wxx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(w, x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 wxy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(w, x, y); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { w = value.x; x = value.y; y = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 wxz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(w, x, z); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { w = value.x; x = value.y; z = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 wxw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(w, x, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 wyx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(w, y, x); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { w = value.x; y = value.y; x = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 wyy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(w, y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 wyz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(w, y, z); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { w = value.x; y = value.y; z = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 wyw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(w, y, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 wzx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(w, z, x); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { w = value.x; z = value.y; x = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 wzy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(w, z, y); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { w = value.x; z = value.y; y = value.z; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 wzz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(w, z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 wzw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(w, z, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 wwx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(w, w, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 wwy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(w, w, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 wwz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(w, w, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half3 www + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half3(w, w, w); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half2 xx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half2(x, x); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half2 xy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half2(x, y); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { x = value.x; y = value.y; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half2 xz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half2(x, z); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { x = value.x; z = value.y; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half2 xw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half2(x, w); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { x = value.x; w = value.y; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half2 yx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half2(y, x); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { y = value.x; x = value.y; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half2 yy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half2(y, y); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half2 yz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half2(y, z); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { y = value.x; z = value.y; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half2 yw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half2(y, w); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { y = value.x; w = value.y; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half2 zx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half2(z, x); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { z = value.x; x = value.y; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half2 zy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half2(z, y); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { z = value.x; y = value.y; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half2 zz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half2(z, z); } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half2 zw + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half2(z, w); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { z = value.x; w = value.y; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half2 wx + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half2(w, x); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { w = value.x; x = value.y; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half2 wy + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half2(w, y); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { w = value.x; y = value.y; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half2 wz + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half2(w, z); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set { w = value.x; z = value.y; } + } + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public half2 ww + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return new half2(w, w); } + } + + + + /// Returns the half element at a specified index. + unsafe public half this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 4) + throw new System.ArgumentException("index must be between[0...3]"); +#endif + fixed (half4* array = &this) { return ((half*)array)[index]; } + } + set + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 4) + throw new System.ArgumentException("index must be between[0...3]"); +#endif + fixed (half* array = &x) { array[index] = value; } + } + } + + /// Returns true if the half4 is equal to a given half4, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(half4 rhs) { return x == rhs.x && y == rhs.y && z == rhs.z && w == rhs.w; } + + /// Returns true if the half4 is equal to a given half4, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is half4 converted && Equals(converted); } + + + /// Returns a hash code for the half4. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the half4. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("half4({0}, {1}, {2}, {3})", x, y, z, w); + } + + /// Returns a string representation of the half4 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("half4({0}, {1}, {2}, {3})", x.ToString(format, formatProvider), y.ToString(format, formatProvider), z.ToString(format, formatProvider), w.ToString(format, formatProvider)); + } + + internal sealed class DebuggerProxy + { + public half x; + public half y; + public half z; + public half w; + public DebuggerProxy(half4 v) + { + x = v.x; + y = v.y; + z = v.z; + w = v.w; + } + } + + } + + public static partial class math + { + /// Returns a half4 vector constructed from four half values. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + /// The constructed vector's z component will be set to this value. + /// The constructed vector's w component will be set to this value. + /// half4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static half4 half4(half x, half y, half z, half w) { return new half4(x, y, z, w); } + + /// Returns a half4 vector constructed from two half values and a half2 vector. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + /// The constructed vector's zw components will be set to this value. + /// half4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static half4 half4(half x, half y, half2 zw) { return new half4(x, y, zw); } + + /// Returns a half4 vector constructed from a half value, a half2 vector and a half value. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's yz components will be set to this value. + /// The constructed vector's w component will be set to this value. + /// half4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static half4 half4(half x, half2 yz, half w) { return new half4(x, yz, w); } + + /// Returns a half4 vector constructed from a half value and a half3 vector. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's yzw components will be set to this value. + /// half4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static half4 half4(half x, half3 yzw) { return new half4(x, yzw); } + + /// Returns a half4 vector constructed from a half2 vector and two half values. + /// The constructed vector's xy components will be set to this value. + /// The constructed vector's z component will be set to this value. + /// The constructed vector's w component will be set to this value. + /// half4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static half4 half4(half2 xy, half z, half w) { return new half4(xy, z, w); } + + /// Returns a half4 vector constructed from two half2 vectors. + /// The constructed vector's xy components will be set to this value. + /// The constructed vector's zw components will be set to this value. + /// half4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static half4 half4(half2 xy, half2 zw) { return new half4(xy, zw); } + + /// Returns a half4 vector constructed from a half3 vector and a half value. + /// The constructed vector's xyz components will be set to this value. + /// The constructed vector's w component will be set to this value. + /// half4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static half4 half4(half3 xyz, half w) { return new half4(xyz, w); } + + /// Returns a half4 vector constructed from a half4 vector. + /// The constructed vector's xyzw components will be set to this value. + /// half4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static half4 half4(half4 xyzw) { return new half4(xyzw); } + + /// Returns a half4 vector constructed from a single half value by assigning it to every component. + /// half to convert to half4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static half4 half4(half v) { return new half4(v); } + + /// Returns a half4 vector constructed from a single float value by converting it to half and assigning it to every component. + /// float to convert to half4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static half4 half4(float v) { return new half4(v); } + + /// Return a half4 vector constructed from a float4 vector by componentwise conversion. + /// float4 to convert to half4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static half4 half4(float4 v) { return new half4(v); } + + /// Returns a half4 vector constructed from a single double value by converting it to half and assigning it to every component. + /// double to convert to half4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static half4 half4(double v) { return new half4(v); } + + /// Return a half4 vector constructed from a double4 vector by componentwise conversion. + /// double4 to convert to half4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static half4 half4(double4 v) { return new half4(v); } + + /// Returns a uint hash code of a half4 vector. + /// Vector value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(half4 v) + { + return csum(uint4(v.x.value, v.y.value, v.z.value, v.w.value) * uint4(0x745ED837u, 0x9CDC88F5u, 0xFA62D721u, 0x7E4DB1CFu)) + 0x68EEE0F5u; + } + + /// + /// Returns a uint4 vector hash code of a half4 vector. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Vector value to hash. + /// uint4 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 hashwide(half4 v) + { + return (uint4(v.x.value, v.y.value, v.z.value, v.w.value) * uint4(0xBC3B0A59u, 0x816EFB5Du, 0xA24E82B7u, 0x45A22087u)) + 0xFC104C3Bu; + } + + } +} diff --git a/src/Unity.Mathematics/half4.gen.cs.meta b/src/Unity.Mathematics/half4.gen.cs.meta new file mode 100644 index 00000000..81168fb9 --- /dev/null +++ b/src/Unity.Mathematics/half4.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a48ec2283f8d80e4b8d21c071400d3da +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/int2.cs b/src/Unity.Mathematics/int2.cs deleted file mode 100644 index e8fd92c8..00000000 --- a/src/Unity.Mathematics/int2.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Runtime.CompilerServices; -using System.Diagnostics; - -#pragma warning disable 0660, 0661 - -namespace Unity.Mathematics -{ - [DebuggerTypeProxy(typeof(int2.DebuggerProxy))] - [System.Serializable] - public partial struct int2 - { - internal sealed class DebuggerProxy - { - public int x; - public int y; - - public DebuggerProxy(int2 vec) - { - x = vec.x; - y = vec.y; - } - } - - public int x; - public int y; - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public int2(int val) { x = y = val; } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public int2(int x, int y) - { - this.x = x; - this.y = y; - } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public int2(float2 val) - { - x = (int)val.x; - y = (int)val.y; - } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static implicit operator int2(int d) { return new int2(d); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static explicit operator int2(float2 d) { return new int2((int)d.x, (int)d.y); } - - public override string ToString() - { - return string.Format("int2({0}, {1})", x, y); - } - } -} - diff --git a/src/Unity.Mathematics/int2.cs.meta b/src/Unity.Mathematics/int2.cs.meta deleted file mode 100644 index 14973293..00000000 --- a/src/Unity.Mathematics/int2.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: d098ce5f1820db1488e01ddf5d4a05b7 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/src/Unity.Mathematics/int2.gen.cs b/src/Unity.Mathematics/int2.gen.cs index e41b3d1a..f47650db 100644 --- a/src/Unity.Mathematics/int2.gen.cs +++ b/src/Unity.Mathematics/int2.gen.cs @@ -1,379 +1,1043 @@ -// GENERATED CODE +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; using System.Runtime.CompilerServices; +using System.Diagnostics; +using Unity.IL2CPP.CompilerServices; + #pragma warning disable 0660, 0661 + namespace Unity.Mathematics { - public partial struct int2 : System.IEquatable + /// A 2 component vector of ints. + [DebuggerTypeProxy(typeof(int2.DebuggerProxy))] + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct int2 : System.IEquatable, IFormattable { + /// x component of the vector. + public int x; + /// y component of the vector. + public int y; + + /// int2 zero value. + public static readonly int2 zero; + + /// Constructs a int2 vector from two int values. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2(int x, int y) + { + this.x = x; + this.y = y; + } + + /// Constructs a int2 vector from an int2 vector. + /// The constructed vector's xy components will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2(int2 xy) + { + this.x = xy.x; + this.y = xy.y; + } + + /// Constructs a int2 vector from a single int value by assigning it to every component. + /// int to convert to int2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2(int v) + { + this.x = v; + this.y = v; + } + + /// Constructs a int2 vector from a single bool value by converting it to int and assigning it to every component. + /// bool to convert to int2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2(bool v) + { + this.x = v ? 1 : 0; + this.y = v ? 1 : 0; + } + + /// Constructs a int2 vector from a bool2 vector by componentwise conversion. + /// bool2 to convert to int2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2(bool2 v) + { + this.x = v.x ? 1 : 0; + this.y = v.y ? 1 : 0; + } + + /// Constructs a int2 vector from a single uint value by converting it to int and assigning it to every component. + /// uint to convert to int2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2(uint v) + { + this.x = (int)v; + this.y = (int)v; + } + + /// Constructs a int2 vector from a uint2 vector by componentwise conversion. + /// uint2 to convert to int2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2(uint2 v) + { + this.x = (int)v.x; + this.y = (int)v.y; + } - // mul - [MethodImpl(0x100)] + /// Constructs a int2 vector from a single float value by converting it to int and assigning it to every component. + /// float to convert to int2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2(float v) + { + this.x = (int)v; + this.y = (int)v; + } + + /// Constructs a int2 vector from a float2 vector by componentwise conversion. + /// float2 to convert to int2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2(float2 v) + { + this.x = (int)v.x; + this.y = (int)v.y; + } + + /// Constructs a int2 vector from a single double value by converting it to int and assigning it to every component. + /// double to convert to int2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2(double v) + { + this.x = (int)v; + this.y = (int)v; + } + + /// Constructs a int2 vector from a double2 vector by componentwise conversion. + /// double2 to convert to int2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2(double2 v) + { + this.x = (int)v.x; + this.y = (int)v.y; + } + + + /// Implicitly converts a single int value to a int2 vector by assigning it to every component. + /// int to convert to int2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator int2(int v) { return new int2(v); } + + /// Explicitly converts a single bool value to a int2 vector by converting it to int and assigning it to every component. + /// bool to convert to int2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int2(bool v) { return new int2(v); } + + /// Explicitly converts a bool2 vector to a int2 vector by componentwise conversion. + /// bool2 to convert to int2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int2(bool2 v) { return new int2(v); } + + /// Explicitly converts a single uint value to a int2 vector by converting it to int and assigning it to every component. + /// uint to convert to int2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int2(uint v) { return new int2(v); } + + /// Explicitly converts a uint2 vector to a int2 vector by componentwise conversion. + /// uint2 to convert to int2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int2(uint2 v) { return new int2(v); } + + /// Explicitly converts a single float value to a int2 vector by converting it to int and assigning it to every component. + /// float to convert to int2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int2(float v) { return new int2(v); } + + /// Explicitly converts a float2 vector to a int2 vector by componentwise conversion. + /// float2 to convert to int2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int2(float2 v) { return new int2(v); } + + /// Explicitly converts a single double value to a int2 vector by converting it to int and assigning it to every component. + /// double to convert to int2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int2(double v) { return new int2(v); } + + /// Explicitly converts a double2 vector to a int2 vector by componentwise conversion. + /// double2 to convert to int2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int2(double2 v) { return new int2(v); } + + + /// Returns the result of a componentwise multiplication operation on two int2 vectors. + /// Left hand side int2 to use to compute componentwise multiplication. + /// Right hand side int2 to use to compute componentwise multiplication. + /// int2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int2 operator * (int2 lhs, int2 rhs) { return new int2 (lhs.x * rhs.x, lhs.y * rhs.y); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise multiplication operation on an int2 vector and an int value. + /// Left hand side int2 to use to compute componentwise multiplication. + /// Right hand side int to use to compute componentwise multiplication. + /// int2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int2 operator * (int2 lhs, int rhs) { return new int2 (lhs.x * rhs, lhs.y * rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise multiplication operation on an int value and an int2 vector. + /// Left hand side int to use to compute componentwise multiplication. + /// Right hand side int2 to use to compute componentwise multiplication. + /// int2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int2 operator * (int lhs, int2 rhs) { return new int2 (lhs * rhs.x, lhs * rhs.y); } - // add - [MethodImpl(0x100)] + + /// Returns the result of a componentwise addition operation on two int2 vectors. + /// Left hand side int2 to use to compute componentwise addition. + /// Right hand side int2 to use to compute componentwise addition. + /// int2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int2 operator + (int2 lhs, int2 rhs) { return new int2 (lhs.x + rhs.x, lhs.y + rhs.y); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise addition operation on an int2 vector and an int value. + /// Left hand side int2 to use to compute componentwise addition. + /// Right hand side int to use to compute componentwise addition. + /// int2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int2 operator + (int2 lhs, int rhs) { return new int2 (lhs.x + rhs, lhs.y + rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise addition operation on an int value and an int2 vector. + /// Left hand side int to use to compute componentwise addition. + /// Right hand side int2 to use to compute componentwise addition. + /// int2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int2 operator + (int lhs, int2 rhs) { return new int2 (lhs + rhs.x, lhs + rhs.y); } - // sub - [MethodImpl(0x100)] + + /// Returns the result of a componentwise subtraction operation on two int2 vectors. + /// Left hand side int2 to use to compute componentwise subtraction. + /// Right hand side int2 to use to compute componentwise subtraction. + /// int2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int2 operator - (int2 lhs, int2 rhs) { return new int2 (lhs.x - rhs.x, lhs.y - rhs.y); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise subtraction operation on an int2 vector and an int value. + /// Left hand side int2 to use to compute componentwise subtraction. + /// Right hand side int to use to compute componentwise subtraction. + /// int2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int2 operator - (int2 lhs, int rhs) { return new int2 (lhs.x - rhs, lhs.y - rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise subtraction operation on an int value and an int2 vector. + /// Left hand side int to use to compute componentwise subtraction. + /// Right hand side int2 to use to compute componentwise subtraction. + /// int2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int2 operator - (int lhs, int2 rhs) { return new int2 (lhs - rhs.x, lhs - rhs.y); } - // div - [MethodImpl(0x100)] + + /// Returns the result of a componentwise division operation on two int2 vectors. + /// Left hand side int2 to use to compute componentwise division. + /// Right hand side int2 to use to compute componentwise division. + /// int2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int2 operator / (int2 lhs, int2 rhs) { return new int2 (lhs.x / rhs.x, lhs.y / rhs.y); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise division operation on an int2 vector and an int value. + /// Left hand side int2 to use to compute componentwise division. + /// Right hand side int to use to compute componentwise division. + /// int2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int2 operator / (int2 lhs, int rhs) { return new int2 (lhs.x / rhs, lhs.y / rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise division operation on an int value and an int2 vector. + /// Left hand side int to use to compute componentwise division. + /// Right hand side int2 to use to compute componentwise division. + /// int2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int2 operator / (int lhs, int2 rhs) { return new int2 (lhs / rhs.x, lhs / rhs.y); } - // smaller - [MethodImpl(0x100)] + + /// Returns the result of a componentwise modulus operation on two int2 vectors. + /// Left hand side int2 to use to compute componentwise modulus. + /// Right hand side int2 to use to compute componentwise modulus. + /// int2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 operator % (int2 lhs, int2 rhs) { return new int2 (lhs.x % rhs.x, lhs.y % rhs.y); } + + /// Returns the result of a componentwise modulus operation on an int2 vector and an int value. + /// Left hand side int2 to use to compute componentwise modulus. + /// Right hand side int to use to compute componentwise modulus. + /// int2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 operator % (int2 lhs, int rhs) { return new int2 (lhs.x % rhs, lhs.y % rhs); } + + /// Returns the result of a componentwise modulus operation on an int value and an int2 vector. + /// Left hand side int to use to compute componentwise modulus. + /// Right hand side int2 to use to compute componentwise modulus. + /// int2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 operator % (int lhs, int2 rhs) { return new int2 (lhs % rhs.x, lhs % rhs.y); } + + + /// Returns the result of a componentwise increment operation on an int2 vector. + /// Value to use when computing the componentwise increment. + /// int2 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 operator ++ (int2 val) { return new int2 (++val.x, ++val.y); } + + + /// Returns the result of a componentwise decrement operation on an int2 vector. + /// Value to use when computing the componentwise decrement. + /// int2 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 operator -- (int2 val) { return new int2 (--val.x, --val.y); } + + + /// Returns the result of a componentwise less than operation on two int2 vectors. + /// Left hand side int2 to use to compute componentwise less than. + /// Right hand side int2 to use to compute componentwise less than. + /// bool2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator < (int2 lhs, int2 rhs) { return new bool2 (lhs.x < rhs.x, lhs.y < rhs.y); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise less than operation on an int2 vector and an int value. + /// Left hand side int2 to use to compute componentwise less than. + /// Right hand side int to use to compute componentwise less than. + /// bool2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator < (int2 lhs, int rhs) { return new bool2 (lhs.x < rhs, lhs.y < rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise less than operation on an int value and an int2 vector. + /// Left hand side int to use to compute componentwise less than. + /// Right hand side int2 to use to compute componentwise less than. + /// bool2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator < (int lhs, int2 rhs) { return new bool2 (lhs < rhs.x, lhs < rhs.y); } - [MethodImpl(0x100)] + + + /// Returns the result of a componentwise less or equal operation on two int2 vectors. + /// Left hand side int2 to use to compute componentwise less or equal. + /// Right hand side int2 to use to compute componentwise less or equal. + /// bool2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator <= (int2 lhs, int2 rhs) { return new bool2 (lhs.x <= rhs.x, lhs.y <= rhs.y); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise less or equal operation on an int2 vector and an int value. + /// Left hand side int2 to use to compute componentwise less or equal. + /// Right hand side int to use to compute componentwise less or equal. + /// bool2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator <= (int2 lhs, int rhs) { return new bool2 (lhs.x <= rhs, lhs.y <= rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise less or equal operation on an int value and an int2 vector. + /// Left hand side int to use to compute componentwise less or equal. + /// Right hand side int2 to use to compute componentwise less or equal. + /// bool2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator <= (int lhs, int2 rhs) { return new bool2 (lhs <= rhs.x, lhs <= rhs.y); } - // greater - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater than operation on two int2 vectors. + /// Left hand side int2 to use to compute componentwise greater than. + /// Right hand side int2 to use to compute componentwise greater than. + /// bool2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator > (int2 lhs, int2 rhs) { return new bool2 (lhs.x > rhs.x, lhs.y > rhs.y); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater than operation on an int2 vector and an int value. + /// Left hand side int2 to use to compute componentwise greater than. + /// Right hand side int to use to compute componentwise greater than. + /// bool2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator > (int2 lhs, int rhs) { return new bool2 (lhs.x > rhs, lhs.y > rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater than operation on an int value and an int2 vector. + /// Left hand side int to use to compute componentwise greater than. + /// Right hand side int2 to use to compute componentwise greater than. + /// bool2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator > (int lhs, int2 rhs) { return new bool2 (lhs > rhs.x, lhs > rhs.y); } - [MethodImpl(0x100)] + + + /// Returns the result of a componentwise greater or equal operation on two int2 vectors. + /// Left hand side int2 to use to compute componentwise greater or equal. + /// Right hand side int2 to use to compute componentwise greater or equal. + /// bool2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator >= (int2 lhs, int2 rhs) { return new bool2 (lhs.x >= rhs.x, lhs.y >= rhs.y); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater or equal operation on an int2 vector and an int value. + /// Left hand side int2 to use to compute componentwise greater or equal. + /// Right hand side int to use to compute componentwise greater or equal. + /// bool2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator >= (int2 lhs, int rhs) { return new bool2 (lhs.x >= rhs, lhs.y >= rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater or equal operation on an int value and an int2 vector. + /// Left hand side int to use to compute componentwise greater or equal. + /// Right hand side int2 to use to compute componentwise greater or equal. + /// bool2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator >= (int lhs, int2 rhs) { return new bool2 (lhs >= rhs.x, lhs >= rhs.y); } - // neg - [MethodImpl(0x100)] + + /// Returns the result of a componentwise unary minus operation on an int2 vector. + /// Value to use when computing the componentwise unary minus. + /// int2 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int2 operator - (int2 val) { return new int2 (-val.x, -val.y); } - // plus - [MethodImpl(0x100)] + + + /// Returns the result of a componentwise unary plus operation on an int2 vector. + /// Value to use when computing the componentwise unary plus. + /// int2 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int2 operator + (int2 val) { return new int2 (+val.x, +val.y); } - // left shift - [MethodImpl(0x100)] - public static int2 operator << (int2 lhs, int rhs) { return new int2 (lhs.x << rhs, lhs.y << rhs); } - // right shift - [MethodImpl(0x100)] - public static int2 operator >> (int2 lhs, int rhs) { return new int2 (lhs.x >> rhs, lhs.y >> rhs); } - // equal - [MethodImpl(0x100)] + /// Returns the result of a componentwise left shift operation on an int2 vector by a number of bits specified by a single int. + /// The vector to left shift. + /// The number of bits to left shift. + /// The result of the componentwise left shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 operator << (int2 x, int n) { return new int2 (x.x << n, x.y << n); } + + /// Returns the result of a componentwise right shift operation on an int2 vector by a number of bits specified by a single int. + /// The vector to right shift. + /// The number of bits to right shift. + /// The result of the componentwise right shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 operator >> (int2 x, int n) { return new int2 (x.x >> n, x.y >> n); } + + /// Returns the result of a componentwise equality operation on two int2 vectors. + /// Left hand side int2 to use to compute componentwise equality. + /// Right hand side int2 to use to compute componentwise equality. + /// bool2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator == (int2 lhs, int2 rhs) { return new bool2 (lhs.x == rhs.x, lhs.y == rhs.y); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise equality operation on an int2 vector and an int value. + /// Left hand side int2 to use to compute componentwise equality. + /// Right hand side int to use to compute componentwise equality. + /// bool2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator == (int2 lhs, int rhs) { return new bool2 (lhs.x == rhs, lhs.y == rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise equality operation on an int value and an int2 vector. + /// Left hand side int to use to compute componentwise equality. + /// Right hand side int2 to use to compute componentwise equality. + /// bool2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator == (int lhs, int2 rhs) { return new bool2 (lhs == rhs.x, lhs == rhs.y); } - // not equal - [MethodImpl(0x100)] + + /// Returns the result of a componentwise not equal operation on two int2 vectors. + /// Left hand side int2 to use to compute componentwise not equal. + /// Right hand side int2 to use to compute componentwise not equal. + /// bool2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator != (int2 lhs, int2 rhs) { return new bool2 (lhs.x != rhs.x, lhs.y != rhs.y); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise not equal operation on an int2 vector and an int value. + /// Left hand side int2 to use to compute componentwise not equal. + /// Right hand side int to use to compute componentwise not equal. + /// bool2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator != (int2 lhs, int rhs) { return new bool2 (lhs.x != rhs, lhs.y != rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise not equal operation on an int value and an int2 vector. + /// Left hand side int to use to compute componentwise not equal. + /// Right hand side int2 to use to compute componentwise not equal. + /// bool2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator != (int lhs, int2 rhs) { return new bool2 (lhs != rhs.x, lhs != rhs.y); } - // Equals - [MethodImpl(0x100)] - public bool Equals(int2 rhs) { return x == rhs.x && y == rhs.y; } - // [int index] - unsafe public int this[int index] - { - get - { -#if ENABLE_UNITY_COLLECTIONS_CHECKS - if ((uint)index >= 2) - throw new System.ArgumentException("index must be between[0...1]"); -#endif - fixed (int* array = &x) { return array[index]; } - } - set - { -#if ENABLE_UNITY_COLLECTIONS_CHECKS - if ((uint)index >= 2) - throw new System.ArgumentException("index must be between[0...1]"); -#endif - fixed (int* array = &x) { array[index] = value; } - } - } + /// Returns the result of a componentwise bitwise not operation on an int2 vector. + /// Value to use when computing the componentwise bitwise not. + /// int2 result of the componentwise bitwise not. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 operator ~ (int2 val) { return new int2 (~val.x, ~val.y); } - // operator & - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise and operation on two int2 vectors. + /// Left hand side int2 to use to compute componentwise bitwise and. + /// Right hand side int2 to use to compute componentwise bitwise and. + /// int2 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int2 operator & (int2 lhs, int2 rhs) { return new int2 (lhs.x & rhs.x, lhs.y & rhs.y); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise and operation on an int2 vector and an int value. + /// Left hand side int2 to use to compute componentwise bitwise and. + /// Right hand side int to use to compute componentwise bitwise and. + /// int2 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int2 operator & (int2 lhs, int rhs) { return new int2 (lhs.x & rhs, lhs.y & rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise and operation on an int value and an int2 vector. + /// Left hand side int to use to compute componentwise bitwise and. + /// Right hand side int2 to use to compute componentwise bitwise and. + /// int2 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int2 operator & (int lhs, int2 rhs) { return new int2 (lhs & rhs.x, lhs & rhs.y); } - // operator | - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise or operation on two int2 vectors. + /// Left hand side int2 to use to compute componentwise bitwise or. + /// Right hand side int2 to use to compute componentwise bitwise or. + /// int2 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int2 operator | (int2 lhs, int2 rhs) { return new int2 (lhs.x | rhs.x, lhs.y | rhs.y); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise or operation on an int2 vector and an int value. + /// Left hand side int2 to use to compute componentwise bitwise or. + /// Right hand side int to use to compute componentwise bitwise or. + /// int2 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int2 operator | (int2 lhs, int rhs) { return new int2 (lhs.x | rhs, lhs.y | rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise or operation on an int value and an int2 vector. + /// Left hand side int to use to compute componentwise bitwise or. + /// Right hand side int2 to use to compute componentwise bitwise or. + /// int2 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int2 operator | (int lhs, int2 rhs) { return new int2 (lhs | rhs.x, lhs | rhs.y); } - // operator ^ - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise exclusive or operation on two int2 vectors. + /// Left hand side int2 to use to compute componentwise bitwise exclusive or. + /// Right hand side int2 to use to compute componentwise bitwise exclusive or. + /// int2 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int2 operator ^ (int2 lhs, int2 rhs) { return new int2 (lhs.x ^ rhs.x, lhs.y ^ rhs.y); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise exclusive or operation on an int2 vector and an int value. + /// Left hand side int2 to use to compute componentwise bitwise exclusive or. + /// Right hand side int to use to compute componentwise bitwise exclusive or. + /// int2 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int2 operator ^ (int2 lhs, int rhs) { return new int2 (lhs.x ^ rhs, lhs.y ^ rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise exclusive or operation on an int value and an int2 vector. + /// Left hand side int to use to compute componentwise bitwise exclusive or. + /// Right hand side int2 to use to compute componentwise bitwise exclusive or. + /// int2 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int2 operator ^ (int lhs, int2 rhs) { return new int2 (lhs ^ rhs.x, lhs ^ rhs.y); } - // operator ~ - [MethodImpl(0x100)] - public static int2 operator ~ (int2 val) { return new int2 (~val.x, ~val.y); } [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xxxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xxxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xxyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xxyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xyxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xyxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xyyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xyyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yxxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yxxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yxyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yxyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yyxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yyxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yyyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yyyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 xxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 xxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 xyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 xyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 yxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 yxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 yyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 yyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int2 xx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int2(x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int2 xy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int2(x, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; y = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int2 yx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int2(y, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; x = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int2 yy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int2(y, y); } } + + /// Returns the int element at a specified index. + unsafe public int this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 2) + throw new System.ArgumentException("index must be between[0...1]"); +#endif + fixed (int2* array = &this) { return ((int*)array)[index]; } + } + set + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 2) + throw new System.ArgumentException("index must be between[0...1]"); +#endif + fixed (int* array = &x) { array[index] = value; } + } + } + + /// Returns true if the int2 is equal to a given int2, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(int2 rhs) { return x == rhs.x && y == rhs.y; } + + /// Returns true if the int2 is equal to a given int2, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is int2 converted && Equals(converted); } + + + /// Returns a hash code for the int2. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the int2. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("int2({0}, {1})", x, y); + } + + /// Returns a string representation of the int2 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("int2({0}, {1})", x.ToString(format, formatProvider), y.ToString(format, formatProvider)); + } + + internal sealed class DebuggerProxy + { + public int x; + public int y; + public DebuggerProxy(int2 v) + { + x = v.x; + y = v.y; + } + } + + } + + public static partial class math + { + /// Returns a int2 vector constructed from two int values. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + /// int2 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 int2(int x, int y) { return new int2(x, y); } + + /// Returns a int2 vector constructed from an int2 vector. + /// The constructed vector's xy components will be set to this value. + /// int2 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 int2(int2 xy) { return new int2(xy); } + + /// Returns a int2 vector constructed from a single int value by assigning it to every component. + /// int to convert to int2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 int2(int v) { return new int2(v); } + + /// Returns a int2 vector constructed from a single bool value by converting it to int and assigning it to every component. + /// bool to convert to int2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 int2(bool v) { return new int2(v); } + + /// Return a int2 vector constructed from a bool2 vector by componentwise conversion. + /// bool2 to convert to int2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 int2(bool2 v) { return new int2(v); } + + /// Returns a int2 vector constructed from a single uint value by converting it to int and assigning it to every component. + /// uint to convert to int2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 int2(uint v) { return new int2(v); } + + /// Return a int2 vector constructed from a uint2 vector by componentwise conversion. + /// uint2 to convert to int2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 int2(uint2 v) { return new int2(v); } + + /// Returns a int2 vector constructed from a single float value by converting it to int and assigning it to every component. + /// float to convert to int2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 int2(float v) { return new int2(v); } + + /// Return a int2 vector constructed from a float2 vector by componentwise conversion. + /// float2 to convert to int2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 int2(float2 v) { return new int2(v); } + + /// Returns a int2 vector constructed from a single double value by converting it to int and assigning it to every component. + /// double to convert to int2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 int2(double v) { return new int2(v); } + + /// Return a int2 vector constructed from a double2 vector by componentwise conversion. + /// double2 to convert to int2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 int2(double2 v) { return new int2(v); } + + /// Returns a uint hash code of a int2 vector. + /// Vector value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(int2 v) + { + return csum(asuint(v) * uint2(0x83B58237u, 0x833E3E29u)) + 0xA9D919BFu; + } + + /// + /// Returns a uint2 vector hash code of a int2 vector. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Vector value to hash. + /// uint2 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 hashwide(int2 v) + { + return (asuint(v) * uint2(0xC3EC1D97u, 0xB8B208C7u)) + 0x5D3ED947u; + } + + /// Returns the result of specified shuffling of the components from two int2 vectors into an int value. + /// int2 to use as the left argument of the shuffle operation. + /// int2 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting int. + /// int result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int shuffle(int2 left, int2 right, ShuffleComponent x) + { + return select_shuffle_component(left, right, x); + } + + /// Returns the result of specified shuffling of the components from two int2 vectors into an int2 vector. + /// int2 to use as the left argument of the shuffle operation. + /// int2 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting int2 x component. + /// The ShuffleComponent to use when setting the resulting int2 y component. + /// int2 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 shuffle(int2 left, int2 right, ShuffleComponent x, ShuffleComponent y) + { + return int2( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y)); + } + + /// Returns the result of specified shuffling of the components from two int2 vectors into an int3 vector. + /// int2 to use as the left argument of the shuffle operation. + /// int2 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting int3 x component. + /// The ShuffleComponent to use when setting the resulting int3 y component. + /// The ShuffleComponent to use when setting the resulting int3 z component. + /// int3 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 shuffle(int2 left, int2 right, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z) + { + return int3( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y), + select_shuffle_component(left, right, z)); + } + + /// Returns the result of specified shuffling of the components from two int2 vectors into an int4 vector. + /// int2 to use as the left argument of the shuffle operation. + /// int2 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting int4 x component. + /// The ShuffleComponent to use when setting the resulting int4 y component. + /// The ShuffleComponent to use when setting the resulting int4 z component. + /// The ShuffleComponent to use when setting the resulting int4 w component. + /// int4 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 shuffle(int2 left, int2 right, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z, ShuffleComponent w) + { + return int4( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y), + select_shuffle_component(left, right, z), + select_shuffle_component(left, right, w)); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static int select_shuffle_component(int2 a, int2 b, ShuffleComponent component) + { + switch(component) + { + case ShuffleComponent.LeftX: + return a.x; + case ShuffleComponent.LeftY: + return a.y; + case ShuffleComponent.RightX: + return b.x; + case ShuffleComponent.RightY: + return b.y; + default: + throw new System.ArgumentException("Invalid shuffle component: " + component); + } + } + } } diff --git a/src/Unity.Mathematics/int2x2.gen.cs b/src/Unity.Mathematics/int2x2.gen.cs new file mode 100644 index 00000000..f46bc532 --- /dev/null +++ b/src/Unity.Mathematics/int2x2.gen.cs @@ -0,0 +1,729 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 2x2 matrix of ints. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct int2x2 : System.IEquatable, IFormattable + { + /// Column 0 of the matrix. + public int2 c0; + /// Column 1 of the matrix. + public int2 c1; + + /// int2x2 identity transform. + public static readonly int2x2 identity = new int2x2(1, 0, 0, 1); + + /// int2x2 zero value. + public static readonly int2x2 zero; + + /// Constructs a int2x2 matrix from two int2 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2x2(int2 c0, int2 c1) + { + this.c0 = c0; + this.c1 = c1; + } + + /// Constructs a int2x2 matrix from 4 int values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2x2(int m00, int m01, + int m10, int m11) + { + this.c0 = new int2(m00, m10); + this.c1 = new int2(m01, m11); + } + + /// Constructs a int2x2 matrix from a single int value by assigning it to every component. + /// int to convert to int2x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2x2(int v) + { + this.c0 = v; + this.c1 = v; + } + + /// Constructs a int2x2 matrix from a single bool value by converting it to int and assigning it to every component. + /// bool to convert to int2x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2x2(bool v) + { + this.c0 = math.select(new int2(0), new int2(1), v); + this.c1 = math.select(new int2(0), new int2(1), v); + } + + /// Constructs a int2x2 matrix from a bool2x2 matrix by componentwise conversion. + /// bool2x2 to convert to int2x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2x2(bool2x2 v) + { + this.c0 = math.select(new int2(0), new int2(1), v.c0); + this.c1 = math.select(new int2(0), new int2(1), v.c1); + } + + /// Constructs a int2x2 matrix from a single uint value by converting it to int and assigning it to every component. + /// uint to convert to int2x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2x2(uint v) + { + this.c0 = (int2)v; + this.c1 = (int2)v; + } + + /// Constructs a int2x2 matrix from a uint2x2 matrix by componentwise conversion. + /// uint2x2 to convert to int2x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2x2(uint2x2 v) + { + this.c0 = (int2)v.c0; + this.c1 = (int2)v.c1; + } + + /// Constructs a int2x2 matrix from a single float value by converting it to int and assigning it to every component. + /// float to convert to int2x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2x2(float v) + { + this.c0 = (int2)v; + this.c1 = (int2)v; + } + + /// Constructs a int2x2 matrix from a float2x2 matrix by componentwise conversion. + /// float2x2 to convert to int2x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2x2(float2x2 v) + { + this.c0 = (int2)v.c0; + this.c1 = (int2)v.c1; + } + + /// Constructs a int2x2 matrix from a single double value by converting it to int and assigning it to every component. + /// double to convert to int2x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2x2(double v) + { + this.c0 = (int2)v; + this.c1 = (int2)v; + } + + /// Constructs a int2x2 matrix from a double2x2 matrix by componentwise conversion. + /// double2x2 to convert to int2x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2x2(double2x2 v) + { + this.c0 = (int2)v.c0; + this.c1 = (int2)v.c1; + } + + + /// Implicitly converts a single int value to a int2x2 matrix by assigning it to every component. + /// int to convert to int2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator int2x2(int v) { return new int2x2(v); } + + /// Explicitly converts a single bool value to a int2x2 matrix by converting it to int and assigning it to every component. + /// bool to convert to int2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int2x2(bool v) { return new int2x2(v); } + + /// Explicitly converts a bool2x2 matrix to a int2x2 matrix by componentwise conversion. + /// bool2x2 to convert to int2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int2x2(bool2x2 v) { return new int2x2(v); } + + /// Explicitly converts a single uint value to a int2x2 matrix by converting it to int and assigning it to every component. + /// uint to convert to int2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int2x2(uint v) { return new int2x2(v); } + + /// Explicitly converts a uint2x2 matrix to a int2x2 matrix by componentwise conversion. + /// uint2x2 to convert to int2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int2x2(uint2x2 v) { return new int2x2(v); } + + /// Explicitly converts a single float value to a int2x2 matrix by converting it to int and assigning it to every component. + /// float to convert to int2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int2x2(float v) { return new int2x2(v); } + + /// Explicitly converts a float2x2 matrix to a int2x2 matrix by componentwise conversion. + /// float2x2 to convert to int2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int2x2(float2x2 v) { return new int2x2(v); } + + /// Explicitly converts a single double value to a int2x2 matrix by converting it to int and assigning it to every component. + /// double to convert to int2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int2x2(double v) { return new int2x2(v); } + + /// Explicitly converts a double2x2 matrix to a int2x2 matrix by componentwise conversion. + /// double2x2 to convert to int2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int2x2(double2x2 v) { return new int2x2(v); } + + + /// Returns the result of a componentwise multiplication operation on two int2x2 matrices. + /// Left hand side int2x2 to use to compute componentwise multiplication. + /// Right hand side int2x2 to use to compute componentwise multiplication. + /// int2x2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 operator * (int2x2 lhs, int2x2 rhs) { return new int2x2 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1); } + + /// Returns the result of a componentwise multiplication operation on an int2x2 matrix and an int value. + /// Left hand side int2x2 to use to compute componentwise multiplication. + /// Right hand side int to use to compute componentwise multiplication. + /// int2x2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 operator * (int2x2 lhs, int rhs) { return new int2x2 (lhs.c0 * rhs, lhs.c1 * rhs); } + + /// Returns the result of a componentwise multiplication operation on an int value and an int2x2 matrix. + /// Left hand side int to use to compute componentwise multiplication. + /// Right hand side int2x2 to use to compute componentwise multiplication. + /// int2x2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 operator * (int lhs, int2x2 rhs) { return new int2x2 (lhs * rhs.c0, lhs * rhs.c1); } + + + /// Returns the result of a componentwise addition operation on two int2x2 matrices. + /// Left hand side int2x2 to use to compute componentwise addition. + /// Right hand side int2x2 to use to compute componentwise addition. + /// int2x2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 operator + (int2x2 lhs, int2x2 rhs) { return new int2x2 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1); } + + /// Returns the result of a componentwise addition operation on an int2x2 matrix and an int value. + /// Left hand side int2x2 to use to compute componentwise addition. + /// Right hand side int to use to compute componentwise addition. + /// int2x2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 operator + (int2x2 lhs, int rhs) { return new int2x2 (lhs.c0 + rhs, lhs.c1 + rhs); } + + /// Returns the result of a componentwise addition operation on an int value and an int2x2 matrix. + /// Left hand side int to use to compute componentwise addition. + /// Right hand side int2x2 to use to compute componentwise addition. + /// int2x2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 operator + (int lhs, int2x2 rhs) { return new int2x2 (lhs + rhs.c0, lhs + rhs.c1); } + + + /// Returns the result of a componentwise subtraction operation on two int2x2 matrices. + /// Left hand side int2x2 to use to compute componentwise subtraction. + /// Right hand side int2x2 to use to compute componentwise subtraction. + /// int2x2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 operator - (int2x2 lhs, int2x2 rhs) { return new int2x2 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1); } + + /// Returns the result of a componentwise subtraction operation on an int2x2 matrix and an int value. + /// Left hand side int2x2 to use to compute componentwise subtraction. + /// Right hand side int to use to compute componentwise subtraction. + /// int2x2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 operator - (int2x2 lhs, int rhs) { return new int2x2 (lhs.c0 - rhs, lhs.c1 - rhs); } + + /// Returns the result of a componentwise subtraction operation on an int value and an int2x2 matrix. + /// Left hand side int to use to compute componentwise subtraction. + /// Right hand side int2x2 to use to compute componentwise subtraction. + /// int2x2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 operator - (int lhs, int2x2 rhs) { return new int2x2 (lhs - rhs.c0, lhs - rhs.c1); } + + + /// Returns the result of a componentwise division operation on two int2x2 matrices. + /// Left hand side int2x2 to use to compute componentwise division. + /// Right hand side int2x2 to use to compute componentwise division. + /// int2x2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 operator / (int2x2 lhs, int2x2 rhs) { return new int2x2 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1); } + + /// Returns the result of a componentwise division operation on an int2x2 matrix and an int value. + /// Left hand side int2x2 to use to compute componentwise division. + /// Right hand side int to use to compute componentwise division. + /// int2x2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 operator / (int2x2 lhs, int rhs) { return new int2x2 (lhs.c0 / rhs, lhs.c1 / rhs); } + + /// Returns the result of a componentwise division operation on an int value and an int2x2 matrix. + /// Left hand side int to use to compute componentwise division. + /// Right hand side int2x2 to use to compute componentwise division. + /// int2x2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 operator / (int lhs, int2x2 rhs) { return new int2x2 (lhs / rhs.c0, lhs / rhs.c1); } + + + /// Returns the result of a componentwise modulus operation on two int2x2 matrices. + /// Left hand side int2x2 to use to compute componentwise modulus. + /// Right hand side int2x2 to use to compute componentwise modulus. + /// int2x2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 operator % (int2x2 lhs, int2x2 rhs) { return new int2x2 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1); } + + /// Returns the result of a componentwise modulus operation on an int2x2 matrix and an int value. + /// Left hand side int2x2 to use to compute componentwise modulus. + /// Right hand side int to use to compute componentwise modulus. + /// int2x2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 operator % (int2x2 lhs, int rhs) { return new int2x2 (lhs.c0 % rhs, lhs.c1 % rhs); } + + /// Returns the result of a componentwise modulus operation on an int value and an int2x2 matrix. + /// Left hand side int to use to compute componentwise modulus. + /// Right hand side int2x2 to use to compute componentwise modulus. + /// int2x2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 operator % (int lhs, int2x2 rhs) { return new int2x2 (lhs % rhs.c0, lhs % rhs.c1); } + + + /// Returns the result of a componentwise increment operation on an int2x2 matrix. + /// Value to use when computing the componentwise increment. + /// int2x2 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 operator ++ (int2x2 val) { return new int2x2 (++val.c0, ++val.c1); } + + + /// Returns the result of a componentwise decrement operation on an int2x2 matrix. + /// Value to use when computing the componentwise decrement. + /// int2x2 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 operator -- (int2x2 val) { return new int2x2 (--val.c0, --val.c1); } + + + /// Returns the result of a componentwise less than operation on two int2x2 matrices. + /// Left hand side int2x2 to use to compute componentwise less than. + /// Right hand side int2x2 to use to compute componentwise less than. + /// bool2x2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator < (int2x2 lhs, int2x2 rhs) { return new bool2x2 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1); } + + /// Returns the result of a componentwise less than operation on an int2x2 matrix and an int value. + /// Left hand side int2x2 to use to compute componentwise less than. + /// Right hand side int to use to compute componentwise less than. + /// bool2x2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator < (int2x2 lhs, int rhs) { return new bool2x2 (lhs.c0 < rhs, lhs.c1 < rhs); } + + /// Returns the result of a componentwise less than operation on an int value and an int2x2 matrix. + /// Left hand side int to use to compute componentwise less than. + /// Right hand side int2x2 to use to compute componentwise less than. + /// bool2x2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator < (int lhs, int2x2 rhs) { return new bool2x2 (lhs < rhs.c0, lhs < rhs.c1); } + + + /// Returns the result of a componentwise less or equal operation on two int2x2 matrices. + /// Left hand side int2x2 to use to compute componentwise less or equal. + /// Right hand side int2x2 to use to compute componentwise less or equal. + /// bool2x2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator <= (int2x2 lhs, int2x2 rhs) { return new bool2x2 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1); } + + /// Returns the result of a componentwise less or equal operation on an int2x2 matrix and an int value. + /// Left hand side int2x2 to use to compute componentwise less or equal. + /// Right hand side int to use to compute componentwise less or equal. + /// bool2x2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator <= (int2x2 lhs, int rhs) { return new bool2x2 (lhs.c0 <= rhs, lhs.c1 <= rhs); } + + /// Returns the result of a componentwise less or equal operation on an int value and an int2x2 matrix. + /// Left hand side int to use to compute componentwise less or equal. + /// Right hand side int2x2 to use to compute componentwise less or equal. + /// bool2x2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator <= (int lhs, int2x2 rhs) { return new bool2x2 (lhs <= rhs.c0, lhs <= rhs.c1); } + + + /// Returns the result of a componentwise greater than operation on two int2x2 matrices. + /// Left hand side int2x2 to use to compute componentwise greater than. + /// Right hand side int2x2 to use to compute componentwise greater than. + /// bool2x2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator > (int2x2 lhs, int2x2 rhs) { return new bool2x2 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1); } + + /// Returns the result of a componentwise greater than operation on an int2x2 matrix and an int value. + /// Left hand side int2x2 to use to compute componentwise greater than. + /// Right hand side int to use to compute componentwise greater than. + /// bool2x2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator > (int2x2 lhs, int rhs) { return new bool2x2 (lhs.c0 > rhs, lhs.c1 > rhs); } + + /// Returns the result of a componentwise greater than operation on an int value and an int2x2 matrix. + /// Left hand side int to use to compute componentwise greater than. + /// Right hand side int2x2 to use to compute componentwise greater than. + /// bool2x2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator > (int lhs, int2x2 rhs) { return new bool2x2 (lhs > rhs.c0, lhs > rhs.c1); } + + + /// Returns the result of a componentwise greater or equal operation on two int2x2 matrices. + /// Left hand side int2x2 to use to compute componentwise greater or equal. + /// Right hand side int2x2 to use to compute componentwise greater or equal. + /// bool2x2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator >= (int2x2 lhs, int2x2 rhs) { return new bool2x2 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1); } + + /// Returns the result of a componentwise greater or equal operation on an int2x2 matrix and an int value. + /// Left hand side int2x2 to use to compute componentwise greater or equal. + /// Right hand side int to use to compute componentwise greater or equal. + /// bool2x2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator >= (int2x2 lhs, int rhs) { return new bool2x2 (lhs.c0 >= rhs, lhs.c1 >= rhs); } + + /// Returns the result of a componentwise greater or equal operation on an int value and an int2x2 matrix. + /// Left hand side int to use to compute componentwise greater or equal. + /// Right hand side int2x2 to use to compute componentwise greater or equal. + /// bool2x2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator >= (int lhs, int2x2 rhs) { return new bool2x2 (lhs >= rhs.c0, lhs >= rhs.c1); } + + + /// Returns the result of a componentwise unary minus operation on an int2x2 matrix. + /// Value to use when computing the componentwise unary minus. + /// int2x2 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 operator - (int2x2 val) { return new int2x2 (-val.c0, -val.c1); } + + + /// Returns the result of a componentwise unary plus operation on an int2x2 matrix. + /// Value to use when computing the componentwise unary plus. + /// int2x2 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 operator + (int2x2 val) { return new int2x2 (+val.c0, +val.c1); } + + + /// Returns the result of a componentwise left shift operation on an int2x2 matrix by a number of bits specified by a single int. + /// The matrix to left shift. + /// The number of bits to left shift. + /// The result of the componentwise left shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 operator << (int2x2 x, int n) { return new int2x2 (x.c0 << n, x.c1 << n); } + + /// Returns the result of a componentwise right shift operation on an int2x2 matrix by a number of bits specified by a single int. + /// The matrix to right shift. + /// The number of bits to right shift. + /// The result of the componentwise right shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 operator >> (int2x2 x, int n) { return new int2x2 (x.c0 >> n, x.c1 >> n); } + + /// Returns the result of a componentwise equality operation on two int2x2 matrices. + /// Left hand side int2x2 to use to compute componentwise equality. + /// Right hand side int2x2 to use to compute componentwise equality. + /// bool2x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator == (int2x2 lhs, int2x2 rhs) { return new bool2x2 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1); } + + /// Returns the result of a componentwise equality operation on an int2x2 matrix and an int value. + /// Left hand side int2x2 to use to compute componentwise equality. + /// Right hand side int to use to compute componentwise equality. + /// bool2x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator == (int2x2 lhs, int rhs) { return new bool2x2 (lhs.c0 == rhs, lhs.c1 == rhs); } + + /// Returns the result of a componentwise equality operation on an int value and an int2x2 matrix. + /// Left hand side int to use to compute componentwise equality. + /// Right hand side int2x2 to use to compute componentwise equality. + /// bool2x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator == (int lhs, int2x2 rhs) { return new bool2x2 (lhs == rhs.c0, lhs == rhs.c1); } + + + /// Returns the result of a componentwise not equal operation on two int2x2 matrices. + /// Left hand side int2x2 to use to compute componentwise not equal. + /// Right hand side int2x2 to use to compute componentwise not equal. + /// bool2x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator != (int2x2 lhs, int2x2 rhs) { return new bool2x2 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1); } + + /// Returns the result of a componentwise not equal operation on an int2x2 matrix and an int value. + /// Left hand side int2x2 to use to compute componentwise not equal. + /// Right hand side int to use to compute componentwise not equal. + /// bool2x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator != (int2x2 lhs, int rhs) { return new bool2x2 (lhs.c0 != rhs, lhs.c1 != rhs); } + + /// Returns the result of a componentwise not equal operation on an int value and an int2x2 matrix. + /// Left hand side int to use to compute componentwise not equal. + /// Right hand side int2x2 to use to compute componentwise not equal. + /// bool2x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator != (int lhs, int2x2 rhs) { return new bool2x2 (lhs != rhs.c0, lhs != rhs.c1); } + + + /// Returns the result of a componentwise bitwise not operation on an int2x2 matrix. + /// Value to use when computing the componentwise bitwise not. + /// int2x2 result of the componentwise bitwise not. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 operator ~ (int2x2 val) { return new int2x2 (~val.c0, ~val.c1); } + + + /// Returns the result of a componentwise bitwise and operation on two int2x2 matrices. + /// Left hand side int2x2 to use to compute componentwise bitwise and. + /// Right hand side int2x2 to use to compute componentwise bitwise and. + /// int2x2 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 operator & (int2x2 lhs, int2x2 rhs) { return new int2x2 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1); } + + /// Returns the result of a componentwise bitwise and operation on an int2x2 matrix and an int value. + /// Left hand side int2x2 to use to compute componentwise bitwise and. + /// Right hand side int to use to compute componentwise bitwise and. + /// int2x2 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 operator & (int2x2 lhs, int rhs) { return new int2x2 (lhs.c0 & rhs, lhs.c1 & rhs); } + + /// Returns the result of a componentwise bitwise and operation on an int value and an int2x2 matrix. + /// Left hand side int to use to compute componentwise bitwise and. + /// Right hand side int2x2 to use to compute componentwise bitwise and. + /// int2x2 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 operator & (int lhs, int2x2 rhs) { return new int2x2 (lhs & rhs.c0, lhs & rhs.c1); } + + + /// Returns the result of a componentwise bitwise or operation on two int2x2 matrices. + /// Left hand side int2x2 to use to compute componentwise bitwise or. + /// Right hand side int2x2 to use to compute componentwise bitwise or. + /// int2x2 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 operator | (int2x2 lhs, int2x2 rhs) { return new int2x2 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1); } + + /// Returns the result of a componentwise bitwise or operation on an int2x2 matrix and an int value. + /// Left hand side int2x2 to use to compute componentwise bitwise or. + /// Right hand side int to use to compute componentwise bitwise or. + /// int2x2 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 operator | (int2x2 lhs, int rhs) { return new int2x2 (lhs.c0 | rhs, lhs.c1 | rhs); } + + /// Returns the result of a componentwise bitwise or operation on an int value and an int2x2 matrix. + /// Left hand side int to use to compute componentwise bitwise or. + /// Right hand side int2x2 to use to compute componentwise bitwise or. + /// int2x2 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 operator | (int lhs, int2x2 rhs) { return new int2x2 (lhs | rhs.c0, lhs | rhs.c1); } + + + /// Returns the result of a componentwise bitwise exclusive or operation on two int2x2 matrices. + /// Left hand side int2x2 to use to compute componentwise bitwise exclusive or. + /// Right hand side int2x2 to use to compute componentwise bitwise exclusive or. + /// int2x2 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 operator ^ (int2x2 lhs, int2x2 rhs) { return new int2x2 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1); } + + /// Returns the result of a componentwise bitwise exclusive or operation on an int2x2 matrix and an int value. + /// Left hand side int2x2 to use to compute componentwise bitwise exclusive or. + /// Right hand side int to use to compute componentwise bitwise exclusive or. + /// int2x2 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 operator ^ (int2x2 lhs, int rhs) { return new int2x2 (lhs.c0 ^ rhs, lhs.c1 ^ rhs); } + + /// Returns the result of a componentwise bitwise exclusive or operation on an int value and an int2x2 matrix. + /// Left hand side int to use to compute componentwise bitwise exclusive or. + /// Right hand side int2x2 to use to compute componentwise bitwise exclusive or. + /// int2x2 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 operator ^ (int lhs, int2x2 rhs) { return new int2x2 (lhs ^ rhs.c0, lhs ^ rhs.c1); } + + + + /// Returns the int2 element at a specified index. + unsafe public ref int2 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 2) + throw new System.ArgumentException("index must be between[0...1]"); +#endif + fixed (int2x2* array = &this) { return ref ((int2*)array)[index]; } + } + } + + /// Returns true if the int2x2 is equal to a given int2x2, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(int2x2 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1); } + + /// Returns true if the int2x2 is equal to a given int2x2, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is int2x2 converted && Equals(converted); } + + + /// Returns a hash code for the int2x2. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the int2x2. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("int2x2({0}, {1}, {2}, {3})", c0.x, c1.x, c0.y, c1.y); + } + + /// Returns a string representation of the int2x2 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("int2x2({0}, {1}, {2}, {3})", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider)); + } + + } + + public static partial class math + { + /// Returns a int2x2 matrix constructed from two int2 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// int2x2 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 int2x2(int2 c0, int2 c1) { return new int2x2(c0, c1); } + + /// Returns a int2x2 matrix constructed from from 4 int values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// int2x2 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 int2x2(int m00, int m01, + int m10, int m11) + { + return new int2x2(m00, m01, + m10, m11); + } + + /// Returns a int2x2 matrix constructed from a single int value by assigning it to every component. + /// int to convert to int2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 int2x2(int v) { return new int2x2(v); } + + /// Returns a int2x2 matrix constructed from a single bool value by converting it to int and assigning it to every component. + /// bool to convert to int2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 int2x2(bool v) { return new int2x2(v); } + + /// Return a int2x2 matrix constructed from a bool2x2 matrix by componentwise conversion. + /// bool2x2 to convert to int2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 int2x2(bool2x2 v) { return new int2x2(v); } + + /// Returns a int2x2 matrix constructed from a single uint value by converting it to int and assigning it to every component. + /// uint to convert to int2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 int2x2(uint v) { return new int2x2(v); } + + /// Return a int2x2 matrix constructed from a uint2x2 matrix by componentwise conversion. + /// uint2x2 to convert to int2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 int2x2(uint2x2 v) { return new int2x2(v); } + + /// Returns a int2x2 matrix constructed from a single float value by converting it to int and assigning it to every component. + /// float to convert to int2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 int2x2(float v) { return new int2x2(v); } + + /// Return a int2x2 matrix constructed from a float2x2 matrix by componentwise conversion. + /// float2x2 to convert to int2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 int2x2(float2x2 v) { return new int2x2(v); } + + /// Returns a int2x2 matrix constructed from a single double value by converting it to int and assigning it to every component. + /// double to convert to int2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 int2x2(double v) { return new int2x2(v); } + + /// Return a int2x2 matrix constructed from a double2x2 matrix by componentwise conversion. + /// double2x2 to convert to int2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 int2x2(double2x2 v) { return new int2x2(v); } + + /// Return the int2x2 transpose of a int2x2 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 transpose(int2x2 v) + { + return int2x2( + v.c0.x, v.c0.y, + v.c1.x, v.c1.y); + } + + /// Returns the determinant of a int2x2 matrix. + /// Matrix to use when computing determinant. + /// The determinant of the matrix. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int determinant(int2x2 m) + { + int a = m.c0.x; + int b = m.c1.x; + int c = m.c0.y; + int d = m.c1.y; + + return a * d - b * c; + } + + /// Returns a uint hash code of a int2x2 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(int2x2 v) + { + return csum(asuint(v.c0) * uint2(0xE191B035u, 0x68586FAFu) + + asuint(v.c1) * uint2(0xD4DFF6D3u, 0xCB634F4Du)) + 0x9B13B92Du; + } + + /// + /// Returns a uint2 vector hash code of a int2x2 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint2 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 hashwide(int2x2 v) + { + return (asuint(v.c0) * uint2(0x4ABF0813u, 0x86068063u) + + asuint(v.c1) * uint2(0xD75513F9u, 0x5AB3E8CDu)) + 0x676E8407u; + } + + } +} diff --git a/src/Unity.Mathematics/int2x2.gen.cs.meta b/src/Unity.Mathematics/int2x2.gen.cs.meta new file mode 100644 index 00000000..a9650df1 --- /dev/null +++ b/src/Unity.Mathematics/int2x2.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9ee90f66ec9324008b40d056f2a6fd46 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/int2x3.gen.cs b/src/Unity.Mathematics/int2x3.gen.cs new file mode 100644 index 00000000..ec5efe95 --- /dev/null +++ b/src/Unity.Mathematics/int2x3.gen.cs @@ -0,0 +1,734 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 2x3 matrix of ints. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct int2x3 : System.IEquatable, IFormattable + { + /// Column 0 of the matrix. + public int2 c0; + /// Column 1 of the matrix. + public int2 c1; + /// Column 2 of the matrix. + public int2 c2; + + /// int2x3 zero value. + public static readonly int2x3 zero; + + /// Constructs a int2x3 matrix from three int2 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2x3(int2 c0, int2 c1, int2 c2) + { + this.c0 = c0; + this.c1 = c1; + this.c2 = c2; + } + + /// Constructs a int2x3 matrix from 6 int values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2x3(int m00, int m01, int m02, + int m10, int m11, int m12) + { + this.c0 = new int2(m00, m10); + this.c1 = new int2(m01, m11); + this.c2 = new int2(m02, m12); + } + + /// Constructs a int2x3 matrix from a single int value by assigning it to every component. + /// int to convert to int2x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2x3(int v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + } + + /// Constructs a int2x3 matrix from a single bool value by converting it to int and assigning it to every component. + /// bool to convert to int2x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2x3(bool v) + { + this.c0 = math.select(new int2(0), new int2(1), v); + this.c1 = math.select(new int2(0), new int2(1), v); + this.c2 = math.select(new int2(0), new int2(1), v); + } + + /// Constructs a int2x3 matrix from a bool2x3 matrix by componentwise conversion. + /// bool2x3 to convert to int2x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2x3(bool2x3 v) + { + this.c0 = math.select(new int2(0), new int2(1), v.c0); + this.c1 = math.select(new int2(0), new int2(1), v.c1); + this.c2 = math.select(new int2(0), new int2(1), v.c2); + } + + /// Constructs a int2x3 matrix from a single uint value by converting it to int and assigning it to every component. + /// uint to convert to int2x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2x3(uint v) + { + this.c0 = (int2)v; + this.c1 = (int2)v; + this.c2 = (int2)v; + } + + /// Constructs a int2x3 matrix from a uint2x3 matrix by componentwise conversion. + /// uint2x3 to convert to int2x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2x3(uint2x3 v) + { + this.c0 = (int2)v.c0; + this.c1 = (int2)v.c1; + this.c2 = (int2)v.c2; + } + + /// Constructs a int2x3 matrix from a single float value by converting it to int and assigning it to every component. + /// float to convert to int2x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2x3(float v) + { + this.c0 = (int2)v; + this.c1 = (int2)v; + this.c2 = (int2)v; + } + + /// Constructs a int2x3 matrix from a float2x3 matrix by componentwise conversion. + /// float2x3 to convert to int2x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2x3(float2x3 v) + { + this.c0 = (int2)v.c0; + this.c1 = (int2)v.c1; + this.c2 = (int2)v.c2; + } + + /// Constructs a int2x3 matrix from a single double value by converting it to int and assigning it to every component. + /// double to convert to int2x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2x3(double v) + { + this.c0 = (int2)v; + this.c1 = (int2)v; + this.c2 = (int2)v; + } + + /// Constructs a int2x3 matrix from a double2x3 matrix by componentwise conversion. + /// double2x3 to convert to int2x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2x3(double2x3 v) + { + this.c0 = (int2)v.c0; + this.c1 = (int2)v.c1; + this.c2 = (int2)v.c2; + } + + + /// Implicitly converts a single int value to a int2x3 matrix by assigning it to every component. + /// int to convert to int2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator int2x3(int v) { return new int2x3(v); } + + /// Explicitly converts a single bool value to a int2x3 matrix by converting it to int and assigning it to every component. + /// bool to convert to int2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int2x3(bool v) { return new int2x3(v); } + + /// Explicitly converts a bool2x3 matrix to a int2x3 matrix by componentwise conversion. + /// bool2x3 to convert to int2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int2x3(bool2x3 v) { return new int2x3(v); } + + /// Explicitly converts a single uint value to a int2x3 matrix by converting it to int and assigning it to every component. + /// uint to convert to int2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int2x3(uint v) { return new int2x3(v); } + + /// Explicitly converts a uint2x3 matrix to a int2x3 matrix by componentwise conversion. + /// uint2x3 to convert to int2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int2x3(uint2x3 v) { return new int2x3(v); } + + /// Explicitly converts a single float value to a int2x3 matrix by converting it to int and assigning it to every component. + /// float to convert to int2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int2x3(float v) { return new int2x3(v); } + + /// Explicitly converts a float2x3 matrix to a int2x3 matrix by componentwise conversion. + /// float2x3 to convert to int2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int2x3(float2x3 v) { return new int2x3(v); } + + /// Explicitly converts a single double value to a int2x3 matrix by converting it to int and assigning it to every component. + /// double to convert to int2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int2x3(double v) { return new int2x3(v); } + + /// Explicitly converts a double2x3 matrix to a int2x3 matrix by componentwise conversion. + /// double2x3 to convert to int2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int2x3(double2x3 v) { return new int2x3(v); } + + + /// Returns the result of a componentwise multiplication operation on two int2x3 matrices. + /// Left hand side int2x3 to use to compute componentwise multiplication. + /// Right hand side int2x3 to use to compute componentwise multiplication. + /// int2x3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 operator * (int2x3 lhs, int2x3 rhs) { return new int2x3 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1, lhs.c2 * rhs.c2); } + + /// Returns the result of a componentwise multiplication operation on an int2x3 matrix and an int value. + /// Left hand side int2x3 to use to compute componentwise multiplication. + /// Right hand side int to use to compute componentwise multiplication. + /// int2x3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 operator * (int2x3 lhs, int rhs) { return new int2x3 (lhs.c0 * rhs, lhs.c1 * rhs, lhs.c2 * rhs); } + + /// Returns the result of a componentwise multiplication operation on an int value and an int2x3 matrix. + /// Left hand side int to use to compute componentwise multiplication. + /// Right hand side int2x3 to use to compute componentwise multiplication. + /// int2x3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 operator * (int lhs, int2x3 rhs) { return new int2x3 (lhs * rhs.c0, lhs * rhs.c1, lhs * rhs.c2); } + + + /// Returns the result of a componentwise addition operation on two int2x3 matrices. + /// Left hand side int2x3 to use to compute componentwise addition. + /// Right hand side int2x3 to use to compute componentwise addition. + /// int2x3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 operator + (int2x3 lhs, int2x3 rhs) { return new int2x3 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1, lhs.c2 + rhs.c2); } + + /// Returns the result of a componentwise addition operation on an int2x3 matrix and an int value. + /// Left hand side int2x3 to use to compute componentwise addition. + /// Right hand side int to use to compute componentwise addition. + /// int2x3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 operator + (int2x3 lhs, int rhs) { return new int2x3 (lhs.c0 + rhs, lhs.c1 + rhs, lhs.c2 + rhs); } + + /// Returns the result of a componentwise addition operation on an int value and an int2x3 matrix. + /// Left hand side int to use to compute componentwise addition. + /// Right hand side int2x3 to use to compute componentwise addition. + /// int2x3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 operator + (int lhs, int2x3 rhs) { return new int2x3 (lhs + rhs.c0, lhs + rhs.c1, lhs + rhs.c2); } + + + /// Returns the result of a componentwise subtraction operation on two int2x3 matrices. + /// Left hand side int2x3 to use to compute componentwise subtraction. + /// Right hand side int2x3 to use to compute componentwise subtraction. + /// int2x3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 operator - (int2x3 lhs, int2x3 rhs) { return new int2x3 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1, lhs.c2 - rhs.c2); } + + /// Returns the result of a componentwise subtraction operation on an int2x3 matrix and an int value. + /// Left hand side int2x3 to use to compute componentwise subtraction. + /// Right hand side int to use to compute componentwise subtraction. + /// int2x3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 operator - (int2x3 lhs, int rhs) { return new int2x3 (lhs.c0 - rhs, lhs.c1 - rhs, lhs.c2 - rhs); } + + /// Returns the result of a componentwise subtraction operation on an int value and an int2x3 matrix. + /// Left hand side int to use to compute componentwise subtraction. + /// Right hand side int2x3 to use to compute componentwise subtraction. + /// int2x3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 operator - (int lhs, int2x3 rhs) { return new int2x3 (lhs - rhs.c0, lhs - rhs.c1, lhs - rhs.c2); } + + + /// Returns the result of a componentwise division operation on two int2x3 matrices. + /// Left hand side int2x3 to use to compute componentwise division. + /// Right hand side int2x3 to use to compute componentwise division. + /// int2x3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 operator / (int2x3 lhs, int2x3 rhs) { return new int2x3 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1, lhs.c2 / rhs.c2); } + + /// Returns the result of a componentwise division operation on an int2x3 matrix and an int value. + /// Left hand side int2x3 to use to compute componentwise division. + /// Right hand side int to use to compute componentwise division. + /// int2x3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 operator / (int2x3 lhs, int rhs) { return new int2x3 (lhs.c0 / rhs, lhs.c1 / rhs, lhs.c2 / rhs); } + + /// Returns the result of a componentwise division operation on an int value and an int2x3 matrix. + /// Left hand side int to use to compute componentwise division. + /// Right hand side int2x3 to use to compute componentwise division. + /// int2x3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 operator / (int lhs, int2x3 rhs) { return new int2x3 (lhs / rhs.c0, lhs / rhs.c1, lhs / rhs.c2); } + + + /// Returns the result of a componentwise modulus operation on two int2x3 matrices. + /// Left hand side int2x3 to use to compute componentwise modulus. + /// Right hand side int2x3 to use to compute componentwise modulus. + /// int2x3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 operator % (int2x3 lhs, int2x3 rhs) { return new int2x3 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1, lhs.c2 % rhs.c2); } + + /// Returns the result of a componentwise modulus operation on an int2x3 matrix and an int value. + /// Left hand side int2x3 to use to compute componentwise modulus. + /// Right hand side int to use to compute componentwise modulus. + /// int2x3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 operator % (int2x3 lhs, int rhs) { return new int2x3 (lhs.c0 % rhs, lhs.c1 % rhs, lhs.c2 % rhs); } + + /// Returns the result of a componentwise modulus operation on an int value and an int2x3 matrix. + /// Left hand side int to use to compute componentwise modulus. + /// Right hand side int2x3 to use to compute componentwise modulus. + /// int2x3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 operator % (int lhs, int2x3 rhs) { return new int2x3 (lhs % rhs.c0, lhs % rhs.c1, lhs % rhs.c2); } + + + /// Returns the result of a componentwise increment operation on an int2x3 matrix. + /// Value to use when computing the componentwise increment. + /// int2x3 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 operator ++ (int2x3 val) { return new int2x3 (++val.c0, ++val.c1, ++val.c2); } + + + /// Returns the result of a componentwise decrement operation on an int2x3 matrix. + /// Value to use when computing the componentwise decrement. + /// int2x3 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 operator -- (int2x3 val) { return new int2x3 (--val.c0, --val.c1, --val.c2); } + + + /// Returns the result of a componentwise less than operation on two int2x3 matrices. + /// Left hand side int2x3 to use to compute componentwise less than. + /// Right hand side int2x3 to use to compute componentwise less than. + /// bool2x3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator < (int2x3 lhs, int2x3 rhs) { return new bool2x3 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1, lhs.c2 < rhs.c2); } + + /// Returns the result of a componentwise less than operation on an int2x3 matrix and an int value. + /// Left hand side int2x3 to use to compute componentwise less than. + /// Right hand side int to use to compute componentwise less than. + /// bool2x3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator < (int2x3 lhs, int rhs) { return new bool2x3 (lhs.c0 < rhs, lhs.c1 < rhs, lhs.c2 < rhs); } + + /// Returns the result of a componentwise less than operation on an int value and an int2x3 matrix. + /// Left hand side int to use to compute componentwise less than. + /// Right hand side int2x3 to use to compute componentwise less than. + /// bool2x3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator < (int lhs, int2x3 rhs) { return new bool2x3 (lhs < rhs.c0, lhs < rhs.c1, lhs < rhs.c2); } + + + /// Returns the result of a componentwise less or equal operation on two int2x3 matrices. + /// Left hand side int2x3 to use to compute componentwise less or equal. + /// Right hand side int2x3 to use to compute componentwise less or equal. + /// bool2x3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator <= (int2x3 lhs, int2x3 rhs) { return new bool2x3 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1, lhs.c2 <= rhs.c2); } + + /// Returns the result of a componentwise less or equal operation on an int2x3 matrix and an int value. + /// Left hand side int2x3 to use to compute componentwise less or equal. + /// Right hand side int to use to compute componentwise less or equal. + /// bool2x3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator <= (int2x3 lhs, int rhs) { return new bool2x3 (lhs.c0 <= rhs, lhs.c1 <= rhs, lhs.c2 <= rhs); } + + /// Returns the result of a componentwise less or equal operation on an int value and an int2x3 matrix. + /// Left hand side int to use to compute componentwise less or equal. + /// Right hand side int2x3 to use to compute componentwise less or equal. + /// bool2x3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator <= (int lhs, int2x3 rhs) { return new bool2x3 (lhs <= rhs.c0, lhs <= rhs.c1, lhs <= rhs.c2); } + + + /// Returns the result of a componentwise greater than operation on two int2x3 matrices. + /// Left hand side int2x3 to use to compute componentwise greater than. + /// Right hand side int2x3 to use to compute componentwise greater than. + /// bool2x3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator > (int2x3 lhs, int2x3 rhs) { return new bool2x3 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1, lhs.c2 > rhs.c2); } + + /// Returns the result of a componentwise greater than operation on an int2x3 matrix and an int value. + /// Left hand side int2x3 to use to compute componentwise greater than. + /// Right hand side int to use to compute componentwise greater than. + /// bool2x3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator > (int2x3 lhs, int rhs) { return new bool2x3 (lhs.c0 > rhs, lhs.c1 > rhs, lhs.c2 > rhs); } + + /// Returns the result of a componentwise greater than operation on an int value and an int2x3 matrix. + /// Left hand side int to use to compute componentwise greater than. + /// Right hand side int2x3 to use to compute componentwise greater than. + /// bool2x3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator > (int lhs, int2x3 rhs) { return new bool2x3 (lhs > rhs.c0, lhs > rhs.c1, lhs > rhs.c2); } + + + /// Returns the result of a componentwise greater or equal operation on two int2x3 matrices. + /// Left hand side int2x3 to use to compute componentwise greater or equal. + /// Right hand side int2x3 to use to compute componentwise greater or equal. + /// bool2x3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator >= (int2x3 lhs, int2x3 rhs) { return new bool2x3 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1, lhs.c2 >= rhs.c2); } + + /// Returns the result of a componentwise greater or equal operation on an int2x3 matrix and an int value. + /// Left hand side int2x3 to use to compute componentwise greater or equal. + /// Right hand side int to use to compute componentwise greater or equal. + /// bool2x3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator >= (int2x3 lhs, int rhs) { return new bool2x3 (lhs.c0 >= rhs, lhs.c1 >= rhs, lhs.c2 >= rhs); } + + /// Returns the result of a componentwise greater or equal operation on an int value and an int2x3 matrix. + /// Left hand side int to use to compute componentwise greater or equal. + /// Right hand side int2x3 to use to compute componentwise greater or equal. + /// bool2x3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator >= (int lhs, int2x3 rhs) { return new bool2x3 (lhs >= rhs.c0, lhs >= rhs.c1, lhs >= rhs.c2); } + + + /// Returns the result of a componentwise unary minus operation on an int2x3 matrix. + /// Value to use when computing the componentwise unary minus. + /// int2x3 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 operator - (int2x3 val) { return new int2x3 (-val.c0, -val.c1, -val.c2); } + + + /// Returns the result of a componentwise unary plus operation on an int2x3 matrix. + /// Value to use when computing the componentwise unary plus. + /// int2x3 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 operator + (int2x3 val) { return new int2x3 (+val.c0, +val.c1, +val.c2); } + + + /// Returns the result of a componentwise left shift operation on an int2x3 matrix by a number of bits specified by a single int. + /// The matrix to left shift. + /// The number of bits to left shift. + /// The result of the componentwise left shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 operator << (int2x3 x, int n) { return new int2x3 (x.c0 << n, x.c1 << n, x.c2 << n); } + + /// Returns the result of a componentwise right shift operation on an int2x3 matrix by a number of bits specified by a single int. + /// The matrix to right shift. + /// The number of bits to right shift. + /// The result of the componentwise right shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 operator >> (int2x3 x, int n) { return new int2x3 (x.c0 >> n, x.c1 >> n, x.c2 >> n); } + + /// Returns the result of a componentwise equality operation on two int2x3 matrices. + /// Left hand side int2x3 to use to compute componentwise equality. + /// Right hand side int2x3 to use to compute componentwise equality. + /// bool2x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator == (int2x3 lhs, int2x3 rhs) { return new bool2x3 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2); } + + /// Returns the result of a componentwise equality operation on an int2x3 matrix and an int value. + /// Left hand side int2x3 to use to compute componentwise equality. + /// Right hand side int to use to compute componentwise equality. + /// bool2x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator == (int2x3 lhs, int rhs) { return new bool2x3 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs); } + + /// Returns the result of a componentwise equality operation on an int value and an int2x3 matrix. + /// Left hand side int to use to compute componentwise equality. + /// Right hand side int2x3 to use to compute componentwise equality. + /// bool2x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator == (int lhs, int2x3 rhs) { return new bool2x3 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2); } + + + /// Returns the result of a componentwise not equal operation on two int2x3 matrices. + /// Left hand side int2x3 to use to compute componentwise not equal. + /// Right hand side int2x3 to use to compute componentwise not equal. + /// bool2x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator != (int2x3 lhs, int2x3 rhs) { return new bool2x3 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2); } + + /// Returns the result of a componentwise not equal operation on an int2x3 matrix and an int value. + /// Left hand side int2x3 to use to compute componentwise not equal. + /// Right hand side int to use to compute componentwise not equal. + /// bool2x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator != (int2x3 lhs, int rhs) { return new bool2x3 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs); } + + /// Returns the result of a componentwise not equal operation on an int value and an int2x3 matrix. + /// Left hand side int to use to compute componentwise not equal. + /// Right hand side int2x3 to use to compute componentwise not equal. + /// bool2x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator != (int lhs, int2x3 rhs) { return new bool2x3 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2); } + + + /// Returns the result of a componentwise bitwise not operation on an int2x3 matrix. + /// Value to use when computing the componentwise bitwise not. + /// int2x3 result of the componentwise bitwise not. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 operator ~ (int2x3 val) { return new int2x3 (~val.c0, ~val.c1, ~val.c2); } + + + /// Returns the result of a componentwise bitwise and operation on two int2x3 matrices. + /// Left hand side int2x3 to use to compute componentwise bitwise and. + /// Right hand side int2x3 to use to compute componentwise bitwise and. + /// int2x3 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 operator & (int2x3 lhs, int2x3 rhs) { return new int2x3 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1, lhs.c2 & rhs.c2); } + + /// Returns the result of a componentwise bitwise and operation on an int2x3 matrix and an int value. + /// Left hand side int2x3 to use to compute componentwise bitwise and. + /// Right hand side int to use to compute componentwise bitwise and. + /// int2x3 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 operator & (int2x3 lhs, int rhs) { return new int2x3 (lhs.c0 & rhs, lhs.c1 & rhs, lhs.c2 & rhs); } + + /// Returns the result of a componentwise bitwise and operation on an int value and an int2x3 matrix. + /// Left hand side int to use to compute componentwise bitwise and. + /// Right hand side int2x3 to use to compute componentwise bitwise and. + /// int2x3 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 operator & (int lhs, int2x3 rhs) { return new int2x3 (lhs & rhs.c0, lhs & rhs.c1, lhs & rhs.c2); } + + + /// Returns the result of a componentwise bitwise or operation on two int2x3 matrices. + /// Left hand side int2x3 to use to compute componentwise bitwise or. + /// Right hand side int2x3 to use to compute componentwise bitwise or. + /// int2x3 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 operator | (int2x3 lhs, int2x3 rhs) { return new int2x3 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1, lhs.c2 | rhs.c2); } + + /// Returns the result of a componentwise bitwise or operation on an int2x3 matrix and an int value. + /// Left hand side int2x3 to use to compute componentwise bitwise or. + /// Right hand side int to use to compute componentwise bitwise or. + /// int2x3 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 operator | (int2x3 lhs, int rhs) { return new int2x3 (lhs.c0 | rhs, lhs.c1 | rhs, lhs.c2 | rhs); } + + /// Returns the result of a componentwise bitwise or operation on an int value and an int2x3 matrix. + /// Left hand side int to use to compute componentwise bitwise or. + /// Right hand side int2x3 to use to compute componentwise bitwise or. + /// int2x3 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 operator | (int lhs, int2x3 rhs) { return new int2x3 (lhs | rhs.c0, lhs | rhs.c1, lhs | rhs.c2); } + + + /// Returns the result of a componentwise bitwise exclusive or operation on two int2x3 matrices. + /// Left hand side int2x3 to use to compute componentwise bitwise exclusive or. + /// Right hand side int2x3 to use to compute componentwise bitwise exclusive or. + /// int2x3 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 operator ^ (int2x3 lhs, int2x3 rhs) { return new int2x3 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1, lhs.c2 ^ rhs.c2); } + + /// Returns the result of a componentwise bitwise exclusive or operation on an int2x3 matrix and an int value. + /// Left hand side int2x3 to use to compute componentwise bitwise exclusive or. + /// Right hand side int to use to compute componentwise bitwise exclusive or. + /// int2x3 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 operator ^ (int2x3 lhs, int rhs) { return new int2x3 (lhs.c0 ^ rhs, lhs.c1 ^ rhs, lhs.c2 ^ rhs); } + + /// Returns the result of a componentwise bitwise exclusive or operation on an int value and an int2x3 matrix. + /// Left hand side int to use to compute componentwise bitwise exclusive or. + /// Right hand side int2x3 to use to compute componentwise bitwise exclusive or. + /// int2x3 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 operator ^ (int lhs, int2x3 rhs) { return new int2x3 (lhs ^ rhs.c0, lhs ^ rhs.c1, lhs ^ rhs.c2); } + + + + /// Returns the int2 element at a specified index. + unsafe public ref int2 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 3) + throw new System.ArgumentException("index must be between[0...2]"); +#endif + fixed (int2x3* array = &this) { return ref ((int2*)array)[index]; } + } + } + + /// Returns true if the int2x3 is equal to a given int2x3, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(int2x3 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2); } + + /// Returns true if the int2x3 is equal to a given int2x3, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is int2x3 converted && Equals(converted); } + + + /// Returns a hash code for the int2x3. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the int2x3. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("int2x3({0}, {1}, {2}, {3}, {4}, {5})", c0.x, c1.x, c2.x, c0.y, c1.y, c2.y); + } + + /// Returns a string representation of the int2x3 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("int2x3({0}, {1}, {2}, {3}, {4}, {5})", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c2.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c2.y.ToString(format, formatProvider)); + } + + } + + public static partial class math + { + /// Returns a int2x3 matrix constructed from three int2 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// int2x3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 int2x3(int2 c0, int2 c1, int2 c2) { return new int2x3(c0, c1, c2); } + + /// Returns a int2x3 matrix constructed from from 6 int values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// int2x3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 int2x3(int m00, int m01, int m02, + int m10, int m11, int m12) + { + return new int2x3(m00, m01, m02, + m10, m11, m12); + } + + /// Returns a int2x3 matrix constructed from a single int value by assigning it to every component. + /// int to convert to int2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 int2x3(int v) { return new int2x3(v); } + + /// Returns a int2x3 matrix constructed from a single bool value by converting it to int and assigning it to every component. + /// bool to convert to int2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 int2x3(bool v) { return new int2x3(v); } + + /// Return a int2x3 matrix constructed from a bool2x3 matrix by componentwise conversion. + /// bool2x3 to convert to int2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 int2x3(bool2x3 v) { return new int2x3(v); } + + /// Returns a int2x3 matrix constructed from a single uint value by converting it to int and assigning it to every component. + /// uint to convert to int2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 int2x3(uint v) { return new int2x3(v); } + + /// Return a int2x3 matrix constructed from a uint2x3 matrix by componentwise conversion. + /// uint2x3 to convert to int2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 int2x3(uint2x3 v) { return new int2x3(v); } + + /// Returns a int2x3 matrix constructed from a single float value by converting it to int and assigning it to every component. + /// float to convert to int2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 int2x3(float v) { return new int2x3(v); } + + /// Return a int2x3 matrix constructed from a float2x3 matrix by componentwise conversion. + /// float2x3 to convert to int2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 int2x3(float2x3 v) { return new int2x3(v); } + + /// Returns a int2x3 matrix constructed from a single double value by converting it to int and assigning it to every component. + /// double to convert to int2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 int2x3(double v) { return new int2x3(v); } + + /// Return a int2x3 matrix constructed from a double2x3 matrix by componentwise conversion. + /// double2x3 to convert to int2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 int2x3(double2x3 v) { return new int2x3(v); } + + /// Return the int3x2 transpose of a int2x3 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 transpose(int2x3 v) + { + return int3x2( + v.c0.x, v.c0.y, + v.c1.x, v.c1.y, + v.c2.x, v.c2.y); + } + + /// Returns a uint hash code of a int2x3 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(int2x3 v) + { + return csum(asuint(v.c0) * uint2(0xCAE78587u, 0x7A1541C9u) + + asuint(v.c1) * uint2(0xF83BD927u, 0x6A243BCBu) + + asuint(v.c2) * uint2(0x509B84C9u, 0x91D13847u)) + 0x52F7230Fu; + } + + /// + /// Returns a uint2 vector hash code of a int2x3 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint2 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 hashwide(int2x3 v) + { + return (asuint(v.c0) * uint2(0xCF286E83u, 0xE121E6ADu) + + asuint(v.c1) * uint2(0xC9CA1249u, 0x69B60C81u) + + asuint(v.c2) * uint2(0xE0EB6C25u, 0xF648BEABu)) + 0x6BDB2B07u; + } + + } +} diff --git a/src/Unity.Mathematics/int2x3.gen.cs.meta b/src/Unity.Mathematics/int2x3.gen.cs.meta new file mode 100644 index 00000000..e1ae9c21 --- /dev/null +++ b/src/Unity.Mathematics/int2x3.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 34b460e6ab4e94f68b249b11a8f71131 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/int2x4.gen.cs b/src/Unity.Mathematics/int2x4.gen.cs new file mode 100644 index 00000000..dbb1d76f --- /dev/null +++ b/src/Unity.Mathematics/int2x4.gen.cs @@ -0,0 +1,756 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 2x4 matrix of ints. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct int2x4 : System.IEquatable, IFormattable + { + /// Column 0 of the matrix. + public int2 c0; + /// Column 1 of the matrix. + public int2 c1; + /// Column 2 of the matrix. + public int2 c2; + /// Column 3 of the matrix. + public int2 c3; + + /// int2x4 zero value. + public static readonly int2x4 zero; + + /// Constructs a int2x4 matrix from four int2 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// The matrix column c3 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2x4(int2 c0, int2 c1, int2 c2, int2 c3) + { + this.c0 = c0; + this.c1 = c1; + this.c2 = c2; + this.c3 = c3; + } + + /// Constructs a int2x4 matrix from 8 int values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 0, column 3 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 1, column 3 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2x4(int m00, int m01, int m02, int m03, + int m10, int m11, int m12, int m13) + { + this.c0 = new int2(m00, m10); + this.c1 = new int2(m01, m11); + this.c2 = new int2(m02, m12); + this.c3 = new int2(m03, m13); + } + + /// Constructs a int2x4 matrix from a single int value by assigning it to every component. + /// int to convert to int2x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2x4(int v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + this.c3 = v; + } + + /// Constructs a int2x4 matrix from a single bool value by converting it to int and assigning it to every component. + /// bool to convert to int2x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2x4(bool v) + { + this.c0 = math.select(new int2(0), new int2(1), v); + this.c1 = math.select(new int2(0), new int2(1), v); + this.c2 = math.select(new int2(0), new int2(1), v); + this.c3 = math.select(new int2(0), new int2(1), v); + } + + /// Constructs a int2x4 matrix from a bool2x4 matrix by componentwise conversion. + /// bool2x4 to convert to int2x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2x4(bool2x4 v) + { + this.c0 = math.select(new int2(0), new int2(1), v.c0); + this.c1 = math.select(new int2(0), new int2(1), v.c1); + this.c2 = math.select(new int2(0), new int2(1), v.c2); + this.c3 = math.select(new int2(0), new int2(1), v.c3); + } + + /// Constructs a int2x4 matrix from a single uint value by converting it to int and assigning it to every component. + /// uint to convert to int2x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2x4(uint v) + { + this.c0 = (int2)v; + this.c1 = (int2)v; + this.c2 = (int2)v; + this.c3 = (int2)v; + } + + /// Constructs a int2x4 matrix from a uint2x4 matrix by componentwise conversion. + /// uint2x4 to convert to int2x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2x4(uint2x4 v) + { + this.c0 = (int2)v.c0; + this.c1 = (int2)v.c1; + this.c2 = (int2)v.c2; + this.c3 = (int2)v.c3; + } + + /// Constructs a int2x4 matrix from a single float value by converting it to int and assigning it to every component. + /// float to convert to int2x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2x4(float v) + { + this.c0 = (int2)v; + this.c1 = (int2)v; + this.c2 = (int2)v; + this.c3 = (int2)v; + } + + /// Constructs a int2x4 matrix from a float2x4 matrix by componentwise conversion. + /// float2x4 to convert to int2x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2x4(float2x4 v) + { + this.c0 = (int2)v.c0; + this.c1 = (int2)v.c1; + this.c2 = (int2)v.c2; + this.c3 = (int2)v.c3; + } + + /// Constructs a int2x4 matrix from a single double value by converting it to int and assigning it to every component. + /// double to convert to int2x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2x4(double v) + { + this.c0 = (int2)v; + this.c1 = (int2)v; + this.c2 = (int2)v; + this.c3 = (int2)v; + } + + /// Constructs a int2x4 matrix from a double2x4 matrix by componentwise conversion. + /// double2x4 to convert to int2x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2x4(double2x4 v) + { + this.c0 = (int2)v.c0; + this.c1 = (int2)v.c1; + this.c2 = (int2)v.c2; + this.c3 = (int2)v.c3; + } + + + /// Implicitly converts a single int value to a int2x4 matrix by assigning it to every component. + /// int to convert to int2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator int2x4(int v) { return new int2x4(v); } + + /// Explicitly converts a single bool value to a int2x4 matrix by converting it to int and assigning it to every component. + /// bool to convert to int2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int2x4(bool v) { return new int2x4(v); } + + /// Explicitly converts a bool2x4 matrix to a int2x4 matrix by componentwise conversion. + /// bool2x4 to convert to int2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int2x4(bool2x4 v) { return new int2x4(v); } + + /// Explicitly converts a single uint value to a int2x4 matrix by converting it to int and assigning it to every component. + /// uint to convert to int2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int2x4(uint v) { return new int2x4(v); } + + /// Explicitly converts a uint2x4 matrix to a int2x4 matrix by componentwise conversion. + /// uint2x4 to convert to int2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int2x4(uint2x4 v) { return new int2x4(v); } + + /// Explicitly converts a single float value to a int2x4 matrix by converting it to int and assigning it to every component. + /// float to convert to int2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int2x4(float v) { return new int2x4(v); } + + /// Explicitly converts a float2x4 matrix to a int2x4 matrix by componentwise conversion. + /// float2x4 to convert to int2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int2x4(float2x4 v) { return new int2x4(v); } + + /// Explicitly converts a single double value to a int2x4 matrix by converting it to int and assigning it to every component. + /// double to convert to int2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int2x4(double v) { return new int2x4(v); } + + /// Explicitly converts a double2x4 matrix to a int2x4 matrix by componentwise conversion. + /// double2x4 to convert to int2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int2x4(double2x4 v) { return new int2x4(v); } + + + /// Returns the result of a componentwise multiplication operation on two int2x4 matrices. + /// Left hand side int2x4 to use to compute componentwise multiplication. + /// Right hand side int2x4 to use to compute componentwise multiplication. + /// int2x4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 operator * (int2x4 lhs, int2x4 rhs) { return new int2x4 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1, lhs.c2 * rhs.c2, lhs.c3 * rhs.c3); } + + /// Returns the result of a componentwise multiplication operation on an int2x4 matrix and an int value. + /// Left hand side int2x4 to use to compute componentwise multiplication. + /// Right hand side int to use to compute componentwise multiplication. + /// int2x4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 operator * (int2x4 lhs, int rhs) { return new int2x4 (lhs.c0 * rhs, lhs.c1 * rhs, lhs.c2 * rhs, lhs.c3 * rhs); } + + /// Returns the result of a componentwise multiplication operation on an int value and an int2x4 matrix. + /// Left hand side int to use to compute componentwise multiplication. + /// Right hand side int2x4 to use to compute componentwise multiplication. + /// int2x4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 operator * (int lhs, int2x4 rhs) { return new int2x4 (lhs * rhs.c0, lhs * rhs.c1, lhs * rhs.c2, lhs * rhs.c3); } + + + /// Returns the result of a componentwise addition operation on two int2x4 matrices. + /// Left hand side int2x4 to use to compute componentwise addition. + /// Right hand side int2x4 to use to compute componentwise addition. + /// int2x4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 operator + (int2x4 lhs, int2x4 rhs) { return new int2x4 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1, lhs.c2 + rhs.c2, lhs.c3 + rhs.c3); } + + /// Returns the result of a componentwise addition operation on an int2x4 matrix and an int value. + /// Left hand side int2x4 to use to compute componentwise addition. + /// Right hand side int to use to compute componentwise addition. + /// int2x4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 operator + (int2x4 lhs, int rhs) { return new int2x4 (lhs.c0 + rhs, lhs.c1 + rhs, lhs.c2 + rhs, lhs.c3 + rhs); } + + /// Returns the result of a componentwise addition operation on an int value and an int2x4 matrix. + /// Left hand side int to use to compute componentwise addition. + /// Right hand side int2x4 to use to compute componentwise addition. + /// int2x4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 operator + (int lhs, int2x4 rhs) { return new int2x4 (lhs + rhs.c0, lhs + rhs.c1, lhs + rhs.c2, lhs + rhs.c3); } + + + /// Returns the result of a componentwise subtraction operation on two int2x4 matrices. + /// Left hand side int2x4 to use to compute componentwise subtraction. + /// Right hand side int2x4 to use to compute componentwise subtraction. + /// int2x4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 operator - (int2x4 lhs, int2x4 rhs) { return new int2x4 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1, lhs.c2 - rhs.c2, lhs.c3 - rhs.c3); } + + /// Returns the result of a componentwise subtraction operation on an int2x4 matrix and an int value. + /// Left hand side int2x4 to use to compute componentwise subtraction. + /// Right hand side int to use to compute componentwise subtraction. + /// int2x4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 operator - (int2x4 lhs, int rhs) { return new int2x4 (lhs.c0 - rhs, lhs.c1 - rhs, lhs.c2 - rhs, lhs.c3 - rhs); } + + /// Returns the result of a componentwise subtraction operation on an int value and an int2x4 matrix. + /// Left hand side int to use to compute componentwise subtraction. + /// Right hand side int2x4 to use to compute componentwise subtraction. + /// int2x4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 operator - (int lhs, int2x4 rhs) { return new int2x4 (lhs - rhs.c0, lhs - rhs.c1, lhs - rhs.c2, lhs - rhs.c3); } + + + /// Returns the result of a componentwise division operation on two int2x4 matrices. + /// Left hand side int2x4 to use to compute componentwise division. + /// Right hand side int2x4 to use to compute componentwise division. + /// int2x4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 operator / (int2x4 lhs, int2x4 rhs) { return new int2x4 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1, lhs.c2 / rhs.c2, lhs.c3 / rhs.c3); } + + /// Returns the result of a componentwise division operation on an int2x4 matrix and an int value. + /// Left hand side int2x4 to use to compute componentwise division. + /// Right hand side int to use to compute componentwise division. + /// int2x4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 operator / (int2x4 lhs, int rhs) { return new int2x4 (lhs.c0 / rhs, lhs.c1 / rhs, lhs.c2 / rhs, lhs.c3 / rhs); } + + /// Returns the result of a componentwise division operation on an int value and an int2x4 matrix. + /// Left hand side int to use to compute componentwise division. + /// Right hand side int2x4 to use to compute componentwise division. + /// int2x4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 operator / (int lhs, int2x4 rhs) { return new int2x4 (lhs / rhs.c0, lhs / rhs.c1, lhs / rhs.c2, lhs / rhs.c3); } + + + /// Returns the result of a componentwise modulus operation on two int2x4 matrices. + /// Left hand side int2x4 to use to compute componentwise modulus. + /// Right hand side int2x4 to use to compute componentwise modulus. + /// int2x4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 operator % (int2x4 lhs, int2x4 rhs) { return new int2x4 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1, lhs.c2 % rhs.c2, lhs.c3 % rhs.c3); } + + /// Returns the result of a componentwise modulus operation on an int2x4 matrix and an int value. + /// Left hand side int2x4 to use to compute componentwise modulus. + /// Right hand side int to use to compute componentwise modulus. + /// int2x4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 operator % (int2x4 lhs, int rhs) { return new int2x4 (lhs.c0 % rhs, lhs.c1 % rhs, lhs.c2 % rhs, lhs.c3 % rhs); } + + /// Returns the result of a componentwise modulus operation on an int value and an int2x4 matrix. + /// Left hand side int to use to compute componentwise modulus. + /// Right hand side int2x4 to use to compute componentwise modulus. + /// int2x4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 operator % (int lhs, int2x4 rhs) { return new int2x4 (lhs % rhs.c0, lhs % rhs.c1, lhs % rhs.c2, lhs % rhs.c3); } + + + /// Returns the result of a componentwise increment operation on an int2x4 matrix. + /// Value to use when computing the componentwise increment. + /// int2x4 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 operator ++ (int2x4 val) { return new int2x4 (++val.c0, ++val.c1, ++val.c2, ++val.c3); } + + + /// Returns the result of a componentwise decrement operation on an int2x4 matrix. + /// Value to use when computing the componentwise decrement. + /// int2x4 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 operator -- (int2x4 val) { return new int2x4 (--val.c0, --val.c1, --val.c2, --val.c3); } + + + /// Returns the result of a componentwise less than operation on two int2x4 matrices. + /// Left hand side int2x4 to use to compute componentwise less than. + /// Right hand side int2x4 to use to compute componentwise less than. + /// bool2x4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator < (int2x4 lhs, int2x4 rhs) { return new bool2x4 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1, lhs.c2 < rhs.c2, lhs.c3 < rhs.c3); } + + /// Returns the result of a componentwise less than operation on an int2x4 matrix and an int value. + /// Left hand side int2x4 to use to compute componentwise less than. + /// Right hand side int to use to compute componentwise less than. + /// bool2x4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator < (int2x4 lhs, int rhs) { return new bool2x4 (lhs.c0 < rhs, lhs.c1 < rhs, lhs.c2 < rhs, lhs.c3 < rhs); } + + /// Returns the result of a componentwise less than operation on an int value and an int2x4 matrix. + /// Left hand side int to use to compute componentwise less than. + /// Right hand side int2x4 to use to compute componentwise less than. + /// bool2x4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator < (int lhs, int2x4 rhs) { return new bool2x4 (lhs < rhs.c0, lhs < rhs.c1, lhs < rhs.c2, lhs < rhs.c3); } + + + /// Returns the result of a componentwise less or equal operation on two int2x4 matrices. + /// Left hand side int2x4 to use to compute componentwise less or equal. + /// Right hand side int2x4 to use to compute componentwise less or equal. + /// bool2x4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator <= (int2x4 lhs, int2x4 rhs) { return new bool2x4 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1, lhs.c2 <= rhs.c2, lhs.c3 <= rhs.c3); } + + /// Returns the result of a componentwise less or equal operation on an int2x4 matrix and an int value. + /// Left hand side int2x4 to use to compute componentwise less or equal. + /// Right hand side int to use to compute componentwise less or equal. + /// bool2x4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator <= (int2x4 lhs, int rhs) { return new bool2x4 (lhs.c0 <= rhs, lhs.c1 <= rhs, lhs.c2 <= rhs, lhs.c3 <= rhs); } + + /// Returns the result of a componentwise less or equal operation on an int value and an int2x4 matrix. + /// Left hand side int to use to compute componentwise less or equal. + /// Right hand side int2x4 to use to compute componentwise less or equal. + /// bool2x4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator <= (int lhs, int2x4 rhs) { return new bool2x4 (lhs <= rhs.c0, lhs <= rhs.c1, lhs <= rhs.c2, lhs <= rhs.c3); } + + + /// Returns the result of a componentwise greater than operation on two int2x4 matrices. + /// Left hand side int2x4 to use to compute componentwise greater than. + /// Right hand side int2x4 to use to compute componentwise greater than. + /// bool2x4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator > (int2x4 lhs, int2x4 rhs) { return new bool2x4 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1, lhs.c2 > rhs.c2, lhs.c3 > rhs.c3); } + + /// Returns the result of a componentwise greater than operation on an int2x4 matrix and an int value. + /// Left hand side int2x4 to use to compute componentwise greater than. + /// Right hand side int to use to compute componentwise greater than. + /// bool2x4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator > (int2x4 lhs, int rhs) { return new bool2x4 (lhs.c0 > rhs, lhs.c1 > rhs, lhs.c2 > rhs, lhs.c3 > rhs); } + + /// Returns the result of a componentwise greater than operation on an int value and an int2x4 matrix. + /// Left hand side int to use to compute componentwise greater than. + /// Right hand side int2x4 to use to compute componentwise greater than. + /// bool2x4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator > (int lhs, int2x4 rhs) { return new bool2x4 (lhs > rhs.c0, lhs > rhs.c1, lhs > rhs.c2, lhs > rhs.c3); } + + + /// Returns the result of a componentwise greater or equal operation on two int2x4 matrices. + /// Left hand side int2x4 to use to compute componentwise greater or equal. + /// Right hand side int2x4 to use to compute componentwise greater or equal. + /// bool2x4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator >= (int2x4 lhs, int2x4 rhs) { return new bool2x4 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1, lhs.c2 >= rhs.c2, lhs.c3 >= rhs.c3); } + + /// Returns the result of a componentwise greater or equal operation on an int2x4 matrix and an int value. + /// Left hand side int2x4 to use to compute componentwise greater or equal. + /// Right hand side int to use to compute componentwise greater or equal. + /// bool2x4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator >= (int2x4 lhs, int rhs) { return new bool2x4 (lhs.c0 >= rhs, lhs.c1 >= rhs, lhs.c2 >= rhs, lhs.c3 >= rhs); } + + /// Returns the result of a componentwise greater or equal operation on an int value and an int2x4 matrix. + /// Left hand side int to use to compute componentwise greater or equal. + /// Right hand side int2x4 to use to compute componentwise greater or equal. + /// bool2x4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator >= (int lhs, int2x4 rhs) { return new bool2x4 (lhs >= rhs.c0, lhs >= rhs.c1, lhs >= rhs.c2, lhs >= rhs.c3); } + + + /// Returns the result of a componentwise unary minus operation on an int2x4 matrix. + /// Value to use when computing the componentwise unary minus. + /// int2x4 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 operator - (int2x4 val) { return new int2x4 (-val.c0, -val.c1, -val.c2, -val.c3); } + + + /// Returns the result of a componentwise unary plus operation on an int2x4 matrix. + /// Value to use when computing the componentwise unary plus. + /// int2x4 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 operator + (int2x4 val) { return new int2x4 (+val.c0, +val.c1, +val.c2, +val.c3); } + + + /// Returns the result of a componentwise left shift operation on an int2x4 matrix by a number of bits specified by a single int. + /// The matrix to left shift. + /// The number of bits to left shift. + /// The result of the componentwise left shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 operator << (int2x4 x, int n) { return new int2x4 (x.c0 << n, x.c1 << n, x.c2 << n, x.c3 << n); } + + /// Returns the result of a componentwise right shift operation on an int2x4 matrix by a number of bits specified by a single int. + /// The matrix to right shift. + /// The number of bits to right shift. + /// The result of the componentwise right shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 operator >> (int2x4 x, int n) { return new int2x4 (x.c0 >> n, x.c1 >> n, x.c2 >> n, x.c3 >> n); } + + /// Returns the result of a componentwise equality operation on two int2x4 matrices. + /// Left hand side int2x4 to use to compute componentwise equality. + /// Right hand side int2x4 to use to compute componentwise equality. + /// bool2x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator == (int2x4 lhs, int2x4 rhs) { return new bool2x4 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2, lhs.c3 == rhs.c3); } + + /// Returns the result of a componentwise equality operation on an int2x4 matrix and an int value. + /// Left hand side int2x4 to use to compute componentwise equality. + /// Right hand side int to use to compute componentwise equality. + /// bool2x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator == (int2x4 lhs, int rhs) { return new bool2x4 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs, lhs.c3 == rhs); } + + /// Returns the result of a componentwise equality operation on an int value and an int2x4 matrix. + /// Left hand side int to use to compute componentwise equality. + /// Right hand side int2x4 to use to compute componentwise equality. + /// bool2x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator == (int lhs, int2x4 rhs) { return new bool2x4 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2, lhs == rhs.c3); } + + + /// Returns the result of a componentwise not equal operation on two int2x4 matrices. + /// Left hand side int2x4 to use to compute componentwise not equal. + /// Right hand side int2x4 to use to compute componentwise not equal. + /// bool2x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator != (int2x4 lhs, int2x4 rhs) { return new bool2x4 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2, lhs.c3 != rhs.c3); } + + /// Returns the result of a componentwise not equal operation on an int2x4 matrix and an int value. + /// Left hand side int2x4 to use to compute componentwise not equal. + /// Right hand side int to use to compute componentwise not equal. + /// bool2x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator != (int2x4 lhs, int rhs) { return new bool2x4 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs, lhs.c3 != rhs); } + + /// Returns the result of a componentwise not equal operation on an int value and an int2x4 matrix. + /// Left hand side int to use to compute componentwise not equal. + /// Right hand side int2x4 to use to compute componentwise not equal. + /// bool2x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator != (int lhs, int2x4 rhs) { return new bool2x4 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2, lhs != rhs.c3); } + + + /// Returns the result of a componentwise bitwise not operation on an int2x4 matrix. + /// Value to use when computing the componentwise bitwise not. + /// int2x4 result of the componentwise bitwise not. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 operator ~ (int2x4 val) { return new int2x4 (~val.c0, ~val.c1, ~val.c2, ~val.c3); } + + + /// Returns the result of a componentwise bitwise and operation on two int2x4 matrices. + /// Left hand side int2x4 to use to compute componentwise bitwise and. + /// Right hand side int2x4 to use to compute componentwise bitwise and. + /// int2x4 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 operator & (int2x4 lhs, int2x4 rhs) { return new int2x4 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1, lhs.c2 & rhs.c2, lhs.c3 & rhs.c3); } + + /// Returns the result of a componentwise bitwise and operation on an int2x4 matrix and an int value. + /// Left hand side int2x4 to use to compute componentwise bitwise and. + /// Right hand side int to use to compute componentwise bitwise and. + /// int2x4 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 operator & (int2x4 lhs, int rhs) { return new int2x4 (lhs.c0 & rhs, lhs.c1 & rhs, lhs.c2 & rhs, lhs.c3 & rhs); } + + /// Returns the result of a componentwise bitwise and operation on an int value and an int2x4 matrix. + /// Left hand side int to use to compute componentwise bitwise and. + /// Right hand side int2x4 to use to compute componentwise bitwise and. + /// int2x4 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 operator & (int lhs, int2x4 rhs) { return new int2x4 (lhs & rhs.c0, lhs & rhs.c1, lhs & rhs.c2, lhs & rhs.c3); } + + + /// Returns the result of a componentwise bitwise or operation on two int2x4 matrices. + /// Left hand side int2x4 to use to compute componentwise bitwise or. + /// Right hand side int2x4 to use to compute componentwise bitwise or. + /// int2x4 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 operator | (int2x4 lhs, int2x4 rhs) { return new int2x4 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1, lhs.c2 | rhs.c2, lhs.c3 | rhs.c3); } + + /// Returns the result of a componentwise bitwise or operation on an int2x4 matrix and an int value. + /// Left hand side int2x4 to use to compute componentwise bitwise or. + /// Right hand side int to use to compute componentwise bitwise or. + /// int2x4 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 operator | (int2x4 lhs, int rhs) { return new int2x4 (lhs.c0 | rhs, lhs.c1 | rhs, lhs.c2 | rhs, lhs.c3 | rhs); } + + /// Returns the result of a componentwise bitwise or operation on an int value and an int2x4 matrix. + /// Left hand side int to use to compute componentwise bitwise or. + /// Right hand side int2x4 to use to compute componentwise bitwise or. + /// int2x4 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 operator | (int lhs, int2x4 rhs) { return new int2x4 (lhs | rhs.c0, lhs | rhs.c1, lhs | rhs.c2, lhs | rhs.c3); } + + + /// Returns the result of a componentwise bitwise exclusive or operation on two int2x4 matrices. + /// Left hand side int2x4 to use to compute componentwise bitwise exclusive or. + /// Right hand side int2x4 to use to compute componentwise bitwise exclusive or. + /// int2x4 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 operator ^ (int2x4 lhs, int2x4 rhs) { return new int2x4 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1, lhs.c2 ^ rhs.c2, lhs.c3 ^ rhs.c3); } + + /// Returns the result of a componentwise bitwise exclusive or operation on an int2x4 matrix and an int value. + /// Left hand side int2x4 to use to compute componentwise bitwise exclusive or. + /// Right hand side int to use to compute componentwise bitwise exclusive or. + /// int2x4 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 operator ^ (int2x4 lhs, int rhs) { return new int2x4 (lhs.c0 ^ rhs, lhs.c1 ^ rhs, lhs.c2 ^ rhs, lhs.c3 ^ rhs); } + + /// Returns the result of a componentwise bitwise exclusive or operation on an int value and an int2x4 matrix. + /// Left hand side int to use to compute componentwise bitwise exclusive or. + /// Right hand side int2x4 to use to compute componentwise bitwise exclusive or. + /// int2x4 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 operator ^ (int lhs, int2x4 rhs) { return new int2x4 (lhs ^ rhs.c0, lhs ^ rhs.c1, lhs ^ rhs.c2, lhs ^ rhs.c3); } + + + + /// Returns the int2 element at a specified index. + unsafe public ref int2 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 4) + throw new System.ArgumentException("index must be between[0...3]"); +#endif + fixed (int2x4* array = &this) { return ref ((int2*)array)[index]; } + } + } + + /// Returns true if the int2x4 is equal to a given int2x4, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(int2x4 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2) && c3.Equals(rhs.c3); } + + /// Returns true if the int2x4 is equal to a given int2x4, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is int2x4 converted && Equals(converted); } + + + /// Returns a hash code for the int2x4. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the int2x4. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("int2x4({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7})", c0.x, c1.x, c2.x, c3.x, c0.y, c1.y, c2.y, c3.y); + } + + /// Returns a string representation of the int2x4 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("int2x4({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7})", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c2.x.ToString(format, formatProvider), c3.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c2.y.ToString(format, formatProvider), c3.y.ToString(format, formatProvider)); + } + + } + + public static partial class math + { + /// Returns a int2x4 matrix constructed from four int2 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// The matrix column c3 will be set to this value. + /// int2x4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 int2x4(int2 c0, int2 c1, int2 c2, int2 c3) { return new int2x4(c0, c1, c2, c3); } + + /// Returns a int2x4 matrix constructed from from 8 int values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 0, column 3 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 1, column 3 will be set to this value. + /// int2x4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 int2x4(int m00, int m01, int m02, int m03, + int m10, int m11, int m12, int m13) + { + return new int2x4(m00, m01, m02, m03, + m10, m11, m12, m13); + } + + /// Returns a int2x4 matrix constructed from a single int value by assigning it to every component. + /// int to convert to int2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 int2x4(int v) { return new int2x4(v); } + + /// Returns a int2x4 matrix constructed from a single bool value by converting it to int and assigning it to every component. + /// bool to convert to int2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 int2x4(bool v) { return new int2x4(v); } + + /// Return a int2x4 matrix constructed from a bool2x4 matrix by componentwise conversion. + /// bool2x4 to convert to int2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 int2x4(bool2x4 v) { return new int2x4(v); } + + /// Returns a int2x4 matrix constructed from a single uint value by converting it to int and assigning it to every component. + /// uint to convert to int2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 int2x4(uint v) { return new int2x4(v); } + + /// Return a int2x4 matrix constructed from a uint2x4 matrix by componentwise conversion. + /// uint2x4 to convert to int2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 int2x4(uint2x4 v) { return new int2x4(v); } + + /// Returns a int2x4 matrix constructed from a single float value by converting it to int and assigning it to every component. + /// float to convert to int2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 int2x4(float v) { return new int2x4(v); } + + /// Return a int2x4 matrix constructed from a float2x4 matrix by componentwise conversion. + /// float2x4 to convert to int2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 int2x4(float2x4 v) { return new int2x4(v); } + + /// Returns a int2x4 matrix constructed from a single double value by converting it to int and assigning it to every component. + /// double to convert to int2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 int2x4(double v) { return new int2x4(v); } + + /// Return a int2x4 matrix constructed from a double2x4 matrix by componentwise conversion. + /// double2x4 to convert to int2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 int2x4(double2x4 v) { return new int2x4(v); } + + /// Return the int4x2 transpose of a int2x4 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 transpose(int2x4 v) + { + return int4x2( + v.c0.x, v.c0.y, + v.c1.x, v.c1.y, + v.c2.x, v.c2.y, + v.c3.x, v.c3.y); + } + + /// Returns a uint hash code of a int2x4 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(int2x4 v) + { + return csum(asuint(v.c0) * uint2(0x7AA07CD3u, 0xAF642BA9u) + + asuint(v.c1) * uint2(0xA8F2213Bu, 0x9F3FDC37u) + + asuint(v.c2) * uint2(0xAC60D0C3u, 0x9263662Fu) + + asuint(v.c3) * uint2(0xE69626FFu, 0xBD010EEBu)) + 0x9CEDE1D1u; + } + + /// + /// Returns a uint2 vector hash code of a int2x4 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint2 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 hashwide(int2x4 v) + { + return (asuint(v.c0) * uint2(0x43BE0B51u, 0xAF836EE1u) + + asuint(v.c1) * uint2(0xB130C137u, 0x54834775u) + + asuint(v.c2) * uint2(0x7C022221u, 0xA2D00EDFu) + + asuint(v.c3) * uint2(0xA8977779u, 0x9F1C739Bu)) + 0x4B1BD187u; + } + + } +} diff --git a/src/Unity.Mathematics/int2x4.gen.cs.meta b/src/Unity.Mathematics/int2x4.gen.cs.meta new file mode 100644 index 00000000..78608652 --- /dev/null +++ b/src/Unity.Mathematics/int2x4.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 827909947b5c9455fa16a57c0b8c55f7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/int3.cs b/src/Unity.Mathematics/int3.cs deleted file mode 100644 index 70994e30..00000000 --- a/src/Unity.Mathematics/int3.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System.Runtime.CompilerServices; -using System.Diagnostics; - -#pragma warning disable 0660, 0661 - -namespace Unity.Mathematics -{ - [DebuggerTypeProxy(typeof(int3.DebuggerProxy))] - [System.Serializable] - public partial struct int3 - { - internal sealed class DebuggerProxy - { - public int x; - public int y; - public int z; - - public DebuggerProxy(int3 vec) - { - x = vec.x; - y = vec.y; - z = vec.z; - } - } - - public int x; - public int y; - public int z; - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public int3(int val) { x = y = z = val; } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public int3(int x, int y, int z) - { - this.x = x; - this.y = y; - this.z = z; - } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public int3(int2 xy, int z) - { - this.x = xy.x; - this.y = xy.y; - this.z = z; - } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public int3(float3 val) - { - x = (int)val.x; - y = (int)val.y; - z = (int)val.z; - } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static implicit operator int3(int d) { return new int3(d); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static explicit operator int3(float3 d) { return new int3((int)d.x, (int)d.y, (int)d.z); } - - public override string ToString() - { - return string.Format("int3({0}, {1}, {2})", x, y, z); - } - - } -} - diff --git a/src/Unity.Mathematics/int3.cs.meta b/src/Unity.Mathematics/int3.cs.meta deleted file mode 100644 index 911dda21..00000000 --- a/src/Unity.Mathematics/int3.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 61f5b259a67dbb44ea4c7ea6f2792223 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/src/Unity.Mathematics/int3.gen.cs b/src/Unity.Mathematics/int3.gen.cs index 1a22730b..082a91ab 100644 --- a/src/Unity.Mathematics/int3.gen.cs +++ b/src/Unity.Mathematics/int3.gen.cs @@ -1,1111 +1,1921 @@ -// GENERATED CODE +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; using System.Runtime.CompilerServices; +using System.Diagnostics; +using Unity.IL2CPP.CompilerServices; + #pragma warning disable 0660, 0661 + namespace Unity.Mathematics { - public partial struct int3 : System.IEquatable + /// A 3 component vector of ints. + [DebuggerTypeProxy(typeof(int3.DebuggerProxy))] + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct int3 : System.IEquatable, IFormattable { + /// x component of the vector. + public int x; + /// y component of the vector. + public int y; + /// z component of the vector. + public int z; + + /// int3 zero value. + public static readonly int3 zero; + + /// Constructs a int3 vector from three int values. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + /// The constructed vector's z component will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3(int x, int y, int z) + { + this.x = x; + this.y = y; + this.z = z; + } + + /// Constructs a int3 vector from an int value and an int2 vector. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's yz components will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3(int x, int2 yz) + { + this.x = x; + this.y = yz.x; + this.z = yz.y; + } + + /// Constructs a int3 vector from an int2 vector and an int value. + /// The constructed vector's xy components will be set to this value. + /// The constructed vector's z component will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3(int2 xy, int z) + { + this.x = xy.x; + this.y = xy.y; + this.z = z; + } + + /// Constructs a int3 vector from an int3 vector. + /// The constructed vector's xyz components will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3(int3 xyz) + { + this.x = xyz.x; + this.y = xyz.y; + this.z = xyz.z; + } + + /// Constructs a int3 vector from a single int value by assigning it to every component. + /// int to convert to int3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3(int v) + { + this.x = v; + this.y = v; + this.z = v; + } + + /// Constructs a int3 vector from a single bool value by converting it to int and assigning it to every component. + /// bool to convert to int3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3(bool v) + { + this.x = v ? 1 : 0; + this.y = v ? 1 : 0; + this.z = v ? 1 : 0; + } + + /// Constructs a int3 vector from a bool3 vector by componentwise conversion. + /// bool3 to convert to int3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3(bool3 v) + { + this.x = v.x ? 1 : 0; + this.y = v.y ? 1 : 0; + this.z = v.z ? 1 : 0; + } + + /// Constructs a int3 vector from a single uint value by converting it to int and assigning it to every component. + /// uint to convert to int3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3(uint v) + { + this.x = (int)v; + this.y = (int)v; + this.z = (int)v; + } + + /// Constructs a int3 vector from a uint3 vector by componentwise conversion. + /// uint3 to convert to int3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3(uint3 v) + { + this.x = (int)v.x; + this.y = (int)v.y; + this.z = (int)v.z; + } + + /// Constructs a int3 vector from a single float value by converting it to int and assigning it to every component. + /// float to convert to int3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3(float v) + { + this.x = (int)v; + this.y = (int)v; + this.z = (int)v; + } + + /// Constructs a int3 vector from a float3 vector by componentwise conversion. + /// float3 to convert to int3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3(float3 v) + { + this.x = (int)v.x; + this.y = (int)v.y; + this.z = (int)v.z; + } + + /// Constructs a int3 vector from a single double value by converting it to int and assigning it to every component. + /// double to convert to int3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3(double v) + { + this.x = (int)v; + this.y = (int)v; + this.z = (int)v; + } + + /// Constructs a int3 vector from a double3 vector by componentwise conversion. + /// double3 to convert to int3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3(double3 v) + { + this.x = (int)v.x; + this.y = (int)v.y; + this.z = (int)v.z; + } - // mul - [MethodImpl(0x100)] + + /// Implicitly converts a single int value to a int3 vector by assigning it to every component. + /// int to convert to int3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator int3(int v) { return new int3(v); } + + /// Explicitly converts a single bool value to a int3 vector by converting it to int and assigning it to every component. + /// bool to convert to int3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int3(bool v) { return new int3(v); } + + /// Explicitly converts a bool3 vector to a int3 vector by componentwise conversion. + /// bool3 to convert to int3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int3(bool3 v) { return new int3(v); } + + /// Explicitly converts a single uint value to a int3 vector by converting it to int and assigning it to every component. + /// uint to convert to int3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int3(uint v) { return new int3(v); } + + /// Explicitly converts a uint3 vector to a int3 vector by componentwise conversion. + /// uint3 to convert to int3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int3(uint3 v) { return new int3(v); } + + /// Explicitly converts a single float value to a int3 vector by converting it to int and assigning it to every component. + /// float to convert to int3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int3(float v) { return new int3(v); } + + /// Explicitly converts a float3 vector to a int3 vector by componentwise conversion. + /// float3 to convert to int3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int3(float3 v) { return new int3(v); } + + /// Explicitly converts a single double value to a int3 vector by converting it to int and assigning it to every component. + /// double to convert to int3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int3(double v) { return new int3(v); } + + /// Explicitly converts a double3 vector to a int3 vector by componentwise conversion. + /// double3 to convert to int3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int3(double3 v) { return new int3(v); } + + + /// Returns the result of a componentwise multiplication operation on two int3 vectors. + /// Left hand side int3 to use to compute componentwise multiplication. + /// Right hand side int3 to use to compute componentwise multiplication. + /// int3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int3 operator * (int3 lhs, int3 rhs) { return new int3 (lhs.x * rhs.x, lhs.y * rhs.y, lhs.z * rhs.z); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise multiplication operation on an int3 vector and an int value. + /// Left hand side int3 to use to compute componentwise multiplication. + /// Right hand side int to use to compute componentwise multiplication. + /// int3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int3 operator * (int3 lhs, int rhs) { return new int3 (lhs.x * rhs, lhs.y * rhs, lhs.z * rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise multiplication operation on an int value and an int3 vector. + /// Left hand side int to use to compute componentwise multiplication. + /// Right hand side int3 to use to compute componentwise multiplication. + /// int3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int3 operator * (int lhs, int3 rhs) { return new int3 (lhs * rhs.x, lhs * rhs.y, lhs * rhs.z); } - // add - [MethodImpl(0x100)] + + /// Returns the result of a componentwise addition operation on two int3 vectors. + /// Left hand side int3 to use to compute componentwise addition. + /// Right hand side int3 to use to compute componentwise addition. + /// int3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int3 operator + (int3 lhs, int3 rhs) { return new int3 (lhs.x + rhs.x, lhs.y + rhs.y, lhs.z + rhs.z); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise addition operation on an int3 vector and an int value. + /// Left hand side int3 to use to compute componentwise addition. + /// Right hand side int to use to compute componentwise addition. + /// int3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int3 operator + (int3 lhs, int rhs) { return new int3 (lhs.x + rhs, lhs.y + rhs, lhs.z + rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise addition operation on an int value and an int3 vector. + /// Left hand side int to use to compute componentwise addition. + /// Right hand side int3 to use to compute componentwise addition. + /// int3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int3 operator + (int lhs, int3 rhs) { return new int3 (lhs + rhs.x, lhs + rhs.y, lhs + rhs.z); } - // sub - [MethodImpl(0x100)] + + /// Returns the result of a componentwise subtraction operation on two int3 vectors. + /// Left hand side int3 to use to compute componentwise subtraction. + /// Right hand side int3 to use to compute componentwise subtraction. + /// int3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int3 operator - (int3 lhs, int3 rhs) { return new int3 (lhs.x - rhs.x, lhs.y - rhs.y, lhs.z - rhs.z); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise subtraction operation on an int3 vector and an int value. + /// Left hand side int3 to use to compute componentwise subtraction. + /// Right hand side int to use to compute componentwise subtraction. + /// int3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int3 operator - (int3 lhs, int rhs) { return new int3 (lhs.x - rhs, lhs.y - rhs, lhs.z - rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise subtraction operation on an int value and an int3 vector. + /// Left hand side int to use to compute componentwise subtraction. + /// Right hand side int3 to use to compute componentwise subtraction. + /// int3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int3 operator - (int lhs, int3 rhs) { return new int3 (lhs - rhs.x, lhs - rhs.y, lhs - rhs.z); } - // div - [MethodImpl(0x100)] + + /// Returns the result of a componentwise division operation on two int3 vectors. + /// Left hand side int3 to use to compute componentwise division. + /// Right hand side int3 to use to compute componentwise division. + /// int3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int3 operator / (int3 lhs, int3 rhs) { return new int3 (lhs.x / rhs.x, lhs.y / rhs.y, lhs.z / rhs.z); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise division operation on an int3 vector and an int value. + /// Left hand side int3 to use to compute componentwise division. + /// Right hand side int to use to compute componentwise division. + /// int3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int3 operator / (int3 lhs, int rhs) { return new int3 (lhs.x / rhs, lhs.y / rhs, lhs.z / rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise division operation on an int value and an int3 vector. + /// Left hand side int to use to compute componentwise division. + /// Right hand side int3 to use to compute componentwise division. + /// int3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int3 operator / (int lhs, int3 rhs) { return new int3 (lhs / rhs.x, lhs / rhs.y, lhs / rhs.z); } - // smaller - [MethodImpl(0x100)] + + /// Returns the result of a componentwise modulus operation on two int3 vectors. + /// Left hand side int3 to use to compute componentwise modulus. + /// Right hand side int3 to use to compute componentwise modulus. + /// int3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 operator % (int3 lhs, int3 rhs) { return new int3 (lhs.x % rhs.x, lhs.y % rhs.y, lhs.z % rhs.z); } + + /// Returns the result of a componentwise modulus operation on an int3 vector and an int value. + /// Left hand side int3 to use to compute componentwise modulus. + /// Right hand side int to use to compute componentwise modulus. + /// int3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 operator % (int3 lhs, int rhs) { return new int3 (lhs.x % rhs, lhs.y % rhs, lhs.z % rhs); } + + /// Returns the result of a componentwise modulus operation on an int value and an int3 vector. + /// Left hand side int to use to compute componentwise modulus. + /// Right hand side int3 to use to compute componentwise modulus. + /// int3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 operator % (int lhs, int3 rhs) { return new int3 (lhs % rhs.x, lhs % rhs.y, lhs % rhs.z); } + + + /// Returns the result of a componentwise increment operation on an int3 vector. + /// Value to use when computing the componentwise increment. + /// int3 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 operator ++ (int3 val) { return new int3 (++val.x, ++val.y, ++val.z); } + + + /// Returns the result of a componentwise decrement operation on an int3 vector. + /// Value to use when computing the componentwise decrement. + /// int3 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 operator -- (int3 val) { return new int3 (--val.x, --val.y, --val.z); } + + + /// Returns the result of a componentwise less than operation on two int3 vectors. + /// Left hand side int3 to use to compute componentwise less than. + /// Right hand side int3 to use to compute componentwise less than. + /// bool3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator < (int3 lhs, int3 rhs) { return new bool3 (lhs.x < rhs.x, lhs.y < rhs.y, lhs.z < rhs.z); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise less than operation on an int3 vector and an int value. + /// Left hand side int3 to use to compute componentwise less than. + /// Right hand side int to use to compute componentwise less than. + /// bool3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator < (int3 lhs, int rhs) { return new bool3 (lhs.x < rhs, lhs.y < rhs, lhs.z < rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise less than operation on an int value and an int3 vector. + /// Left hand side int to use to compute componentwise less than. + /// Right hand side int3 to use to compute componentwise less than. + /// bool3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator < (int lhs, int3 rhs) { return new bool3 (lhs < rhs.x, lhs < rhs.y, lhs < rhs.z); } - [MethodImpl(0x100)] + + + /// Returns the result of a componentwise less or equal operation on two int3 vectors. + /// Left hand side int3 to use to compute componentwise less or equal. + /// Right hand side int3 to use to compute componentwise less or equal. + /// bool3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator <= (int3 lhs, int3 rhs) { return new bool3 (lhs.x <= rhs.x, lhs.y <= rhs.y, lhs.z <= rhs.z); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise less or equal operation on an int3 vector and an int value. + /// Left hand side int3 to use to compute componentwise less or equal. + /// Right hand side int to use to compute componentwise less or equal. + /// bool3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator <= (int3 lhs, int rhs) { return new bool3 (lhs.x <= rhs, lhs.y <= rhs, lhs.z <= rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise less or equal operation on an int value and an int3 vector. + /// Left hand side int to use to compute componentwise less or equal. + /// Right hand side int3 to use to compute componentwise less or equal. + /// bool3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator <= (int lhs, int3 rhs) { return new bool3 (lhs <= rhs.x, lhs <= rhs.y, lhs <= rhs.z); } - // greater - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater than operation on two int3 vectors. + /// Left hand side int3 to use to compute componentwise greater than. + /// Right hand side int3 to use to compute componentwise greater than. + /// bool3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator > (int3 lhs, int3 rhs) { return new bool3 (lhs.x > rhs.x, lhs.y > rhs.y, lhs.z > rhs.z); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater than operation on an int3 vector and an int value. + /// Left hand side int3 to use to compute componentwise greater than. + /// Right hand side int to use to compute componentwise greater than. + /// bool3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator > (int3 lhs, int rhs) { return new bool3 (lhs.x > rhs, lhs.y > rhs, lhs.z > rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater than operation on an int value and an int3 vector. + /// Left hand side int to use to compute componentwise greater than. + /// Right hand side int3 to use to compute componentwise greater than. + /// bool3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator > (int lhs, int3 rhs) { return new bool3 (lhs > rhs.x, lhs > rhs.y, lhs > rhs.z); } - [MethodImpl(0x100)] + + + /// Returns the result of a componentwise greater or equal operation on two int3 vectors. + /// Left hand side int3 to use to compute componentwise greater or equal. + /// Right hand side int3 to use to compute componentwise greater or equal. + /// bool3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator >= (int3 lhs, int3 rhs) { return new bool3 (lhs.x >= rhs.x, lhs.y >= rhs.y, lhs.z >= rhs.z); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater or equal operation on an int3 vector and an int value. + /// Left hand side int3 to use to compute componentwise greater or equal. + /// Right hand side int to use to compute componentwise greater or equal. + /// bool3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator >= (int3 lhs, int rhs) { return new bool3 (lhs.x >= rhs, lhs.y >= rhs, lhs.z >= rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater or equal operation on an int value and an int3 vector. + /// Left hand side int to use to compute componentwise greater or equal. + /// Right hand side int3 to use to compute componentwise greater or equal. + /// bool3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator >= (int lhs, int3 rhs) { return new bool3 (lhs >= rhs.x, lhs >= rhs.y, lhs >= rhs.z); } - // neg - [MethodImpl(0x100)] + + /// Returns the result of a componentwise unary minus operation on an int3 vector. + /// Value to use when computing the componentwise unary minus. + /// int3 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int3 operator - (int3 val) { return new int3 (-val.x, -val.y, -val.z); } - // plus - [MethodImpl(0x100)] + + + /// Returns the result of a componentwise unary plus operation on an int3 vector. + /// Value to use when computing the componentwise unary plus. + /// int3 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int3 operator + (int3 val) { return new int3 (+val.x, +val.y, +val.z); } - // left shift - [MethodImpl(0x100)] - public static int3 operator << (int3 lhs, int rhs) { return new int3 (lhs.x << rhs, lhs.y << rhs, lhs.z << rhs); } - // right shift - [MethodImpl(0x100)] - public static int3 operator >> (int3 lhs, int rhs) { return new int3 (lhs.x >> rhs, lhs.y >> rhs, lhs.z >> rhs); } - // equal - [MethodImpl(0x100)] + /// Returns the result of a componentwise left shift operation on an int3 vector by a number of bits specified by a single int. + /// The vector to left shift. + /// The number of bits to left shift. + /// The result of the componentwise left shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 operator << (int3 x, int n) { return new int3 (x.x << n, x.y << n, x.z << n); } + + /// Returns the result of a componentwise right shift operation on an int3 vector by a number of bits specified by a single int. + /// The vector to right shift. + /// The number of bits to right shift. + /// The result of the componentwise right shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 operator >> (int3 x, int n) { return new int3 (x.x >> n, x.y >> n, x.z >> n); } + + /// Returns the result of a componentwise equality operation on two int3 vectors. + /// Left hand side int3 to use to compute componentwise equality. + /// Right hand side int3 to use to compute componentwise equality. + /// bool3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator == (int3 lhs, int3 rhs) { return new bool3 (lhs.x == rhs.x, lhs.y == rhs.y, lhs.z == rhs.z); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise equality operation on an int3 vector and an int value. + /// Left hand side int3 to use to compute componentwise equality. + /// Right hand side int to use to compute componentwise equality. + /// bool3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator == (int3 lhs, int rhs) { return new bool3 (lhs.x == rhs, lhs.y == rhs, lhs.z == rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise equality operation on an int value and an int3 vector. + /// Left hand side int to use to compute componentwise equality. + /// Right hand side int3 to use to compute componentwise equality. + /// bool3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator == (int lhs, int3 rhs) { return new bool3 (lhs == rhs.x, lhs == rhs.y, lhs == rhs.z); } - // not equal - [MethodImpl(0x100)] + + /// Returns the result of a componentwise not equal operation on two int3 vectors. + /// Left hand side int3 to use to compute componentwise not equal. + /// Right hand side int3 to use to compute componentwise not equal. + /// bool3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator != (int3 lhs, int3 rhs) { return new bool3 (lhs.x != rhs.x, lhs.y != rhs.y, lhs.z != rhs.z); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise not equal operation on an int3 vector and an int value. + /// Left hand side int3 to use to compute componentwise not equal. + /// Right hand side int to use to compute componentwise not equal. + /// bool3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator != (int3 lhs, int rhs) { return new bool3 (lhs.x != rhs, lhs.y != rhs, lhs.z != rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise not equal operation on an int value and an int3 vector. + /// Left hand side int to use to compute componentwise not equal. + /// Right hand side int3 to use to compute componentwise not equal. + /// bool3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator != (int lhs, int3 rhs) { return new bool3 (lhs != rhs.x, lhs != rhs.y, lhs != rhs.z); } - // Equals - [MethodImpl(0x100)] - public bool Equals(int3 rhs) { return x == rhs.x && y == rhs.y && z == rhs.z; } - // [int index] - unsafe public int this[int index] - { - get - { -#if ENABLE_UNITY_COLLECTIONS_CHECKS - if ((uint)index >= 3) - throw new System.ArgumentException("index must be between[0...2]"); -#endif - fixed (int* array = &x) { return array[index]; } - } - set - { -#if ENABLE_UNITY_COLLECTIONS_CHECKS - if ((uint)index >= 3) - throw new System.ArgumentException("index must be between[0...2]"); -#endif - fixed (int* array = &x) { array[index] = value; } - } - } + /// Returns the result of a componentwise bitwise not operation on an int3 vector. + /// Value to use when computing the componentwise bitwise not. + /// int3 result of the componentwise bitwise not. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 operator ~ (int3 val) { return new int3 (~val.x, ~val.y, ~val.z); } - // operator & - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise and operation on two int3 vectors. + /// Left hand side int3 to use to compute componentwise bitwise and. + /// Right hand side int3 to use to compute componentwise bitwise and. + /// int3 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int3 operator & (int3 lhs, int3 rhs) { return new int3 (lhs.x & rhs.x, lhs.y & rhs.y, lhs.z & rhs.z); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise and operation on an int3 vector and an int value. + /// Left hand side int3 to use to compute componentwise bitwise and. + /// Right hand side int to use to compute componentwise bitwise and. + /// int3 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int3 operator & (int3 lhs, int rhs) { return new int3 (lhs.x & rhs, lhs.y & rhs, lhs.z & rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise and operation on an int value and an int3 vector. + /// Left hand side int to use to compute componentwise bitwise and. + /// Right hand side int3 to use to compute componentwise bitwise and. + /// int3 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int3 operator & (int lhs, int3 rhs) { return new int3 (lhs & rhs.x, lhs & rhs.y, lhs & rhs.z); } - // operator | - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise or operation on two int3 vectors. + /// Left hand side int3 to use to compute componentwise bitwise or. + /// Right hand side int3 to use to compute componentwise bitwise or. + /// int3 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int3 operator | (int3 lhs, int3 rhs) { return new int3 (lhs.x | rhs.x, lhs.y | rhs.y, lhs.z | rhs.z); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise or operation on an int3 vector and an int value. + /// Left hand side int3 to use to compute componentwise bitwise or. + /// Right hand side int to use to compute componentwise bitwise or. + /// int3 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int3 operator | (int3 lhs, int rhs) { return new int3 (lhs.x | rhs, lhs.y | rhs, lhs.z | rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise or operation on an int value and an int3 vector. + /// Left hand side int to use to compute componentwise bitwise or. + /// Right hand side int3 to use to compute componentwise bitwise or. + /// int3 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int3 operator | (int lhs, int3 rhs) { return new int3 (lhs | rhs.x, lhs | rhs.y, lhs | rhs.z); } - // operator ^ - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise exclusive or operation on two int3 vectors. + /// Left hand side int3 to use to compute componentwise bitwise exclusive or. + /// Right hand side int3 to use to compute componentwise bitwise exclusive or. + /// int3 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int3 operator ^ (int3 lhs, int3 rhs) { return new int3 (lhs.x ^ rhs.x, lhs.y ^ rhs.y, lhs.z ^ rhs.z); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise exclusive or operation on an int3 vector and an int value. + /// Left hand side int3 to use to compute componentwise bitwise exclusive or. + /// Right hand side int to use to compute componentwise bitwise exclusive or. + /// int3 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int3 operator ^ (int3 lhs, int rhs) { return new int3 (lhs.x ^ rhs, lhs.y ^ rhs, lhs.z ^ rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise exclusive or operation on an int value and an int3 vector. + /// Left hand side int to use to compute componentwise bitwise exclusive or. + /// Right hand side int3 to use to compute componentwise bitwise exclusive or. + /// int3 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int3 operator ^ (int lhs, int3 rhs) { return new int3 (lhs ^ rhs.x, lhs ^ rhs.y, lhs ^ rhs.z); } - // operator ~ - [MethodImpl(0x100)] - public static int3 operator ~ (int3 val) { return new int3 (~val.x, ~val.y, ~val.z); } [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xxxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xxxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xxxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, x, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xxyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xxyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xxyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, x, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xxzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, x, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xxzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, x, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xxzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, x, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xyxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xyxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xyxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, y, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xyyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xyyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xyyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, y, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xyzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, y, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xyzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, y, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xyzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, y, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xzxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, z, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xzxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, z, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xzxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, z, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xzyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, z, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xzyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, z, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xzyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, z, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xzzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, z, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xzzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, z, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xzzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, z, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yxxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yxxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yxxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, x, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yxyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yxyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yxyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, x, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yxzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, x, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yxzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, x, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yxzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, x, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yyxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yyxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yyxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, y, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yyyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yyyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yyyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, y, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yyzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, y, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yyzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, y, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yyzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, y, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yzxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, z, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yzxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, z, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yzxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, z, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yzyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, z, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yzyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, z, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yzyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, z, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yzzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, z, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yzzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, z, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yzzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, z, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zxxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zxxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zxxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, x, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zxyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zxyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zxyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, x, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zxzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, x, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zxzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, x, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zxzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, x, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zyxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zyxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zyxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, y, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zyyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zyyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zyyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, y, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zyzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, y, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zyzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, y, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zyzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, y, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zzxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, z, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zzxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, z, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zzxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, z, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zzyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, z, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zzyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, z, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zzyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, z, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zzzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, z, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zzzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, z, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zzzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, z, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 xxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 xxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 xxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(x, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 xyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 xyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 xyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(x, y, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; y = value.y; z = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 xzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(x, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 xzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(x, z, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; z = value.y; y = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 xzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(x, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 yxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 yxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 yxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(y, x, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; x = value.y; z = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 yyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 yyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 yyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(y, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 yzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(y, z, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; z = value.y; x = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 yzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(y, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 yzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(y, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 zxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(z, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 zxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(z, x, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; x = value.y; y = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 zxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(z, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 zyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(z, y, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; y = value.y; x = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 zyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(z, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 zyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(z, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 zzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(z, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 zzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(z, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 zzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(z, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int2 xx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int2(x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int2 xy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int2(x, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; y = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int2 xz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int2(x, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; z = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int2 yx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int2(y, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; x = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int2 yy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int2(y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int2 yz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int2(y, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; z = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int2 zx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int2(z, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; x = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int2 zy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int2(z, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; y = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int2 zz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int2(z, z); } } + + /// Returns the int element at a specified index. + unsafe public int this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 3) + throw new System.ArgumentException("index must be between[0...2]"); +#endif + fixed (int3* array = &this) { return ((int*)array)[index]; } + } + set + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 3) + throw new System.ArgumentException("index must be between[0...2]"); +#endif + fixed (int* array = &x) { array[index] = value; } + } + } + + /// Returns true if the int3 is equal to a given int3, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(int3 rhs) { return x == rhs.x && y == rhs.y && z == rhs.z; } + + /// Returns true if the int3 is equal to a given int3, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is int3 converted && Equals(converted); } + + + /// Returns a hash code for the int3. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the int3. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("int3({0}, {1}, {2})", x, y, z); + } + + /// Returns a string representation of the int3 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("int3({0}, {1}, {2})", x.ToString(format, formatProvider), y.ToString(format, formatProvider), z.ToString(format, formatProvider)); + } + + internal sealed class DebuggerProxy + { + public int x; + public int y; + public int z; + public DebuggerProxy(int3 v) + { + x = v.x; + y = v.y; + z = v.z; + } + } + + } + + public static partial class math + { + /// Returns a int3 vector constructed from three int values. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + /// The constructed vector's z component will be set to this value. + /// int3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 int3(int x, int y, int z) { return new int3(x, y, z); } + + /// Returns a int3 vector constructed from an int value and an int2 vector. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's yz components will be set to this value. + /// int3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 int3(int x, int2 yz) { return new int3(x, yz); } + + /// Returns a int3 vector constructed from an int2 vector and an int value. + /// The constructed vector's xy components will be set to this value. + /// The constructed vector's z component will be set to this value. + /// int3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 int3(int2 xy, int z) { return new int3(xy, z); } + + /// Returns a int3 vector constructed from an int3 vector. + /// The constructed vector's xyz components will be set to this value. + /// int3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 int3(int3 xyz) { return new int3(xyz); } + + /// Returns a int3 vector constructed from a single int value by assigning it to every component. + /// int to convert to int3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 int3(int v) { return new int3(v); } + + /// Returns a int3 vector constructed from a single bool value by converting it to int and assigning it to every component. + /// bool to convert to int3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 int3(bool v) { return new int3(v); } + + /// Return a int3 vector constructed from a bool3 vector by componentwise conversion. + /// bool3 to convert to int3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 int3(bool3 v) { return new int3(v); } + + /// Returns a int3 vector constructed from a single uint value by converting it to int and assigning it to every component. + /// uint to convert to int3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 int3(uint v) { return new int3(v); } + + /// Return a int3 vector constructed from a uint3 vector by componentwise conversion. + /// uint3 to convert to int3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 int3(uint3 v) { return new int3(v); } + + /// Returns a int3 vector constructed from a single float value by converting it to int and assigning it to every component. + /// float to convert to int3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 int3(float v) { return new int3(v); } + + /// Return a int3 vector constructed from a float3 vector by componentwise conversion. + /// float3 to convert to int3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 int3(float3 v) { return new int3(v); } + + /// Returns a int3 vector constructed from a single double value by converting it to int and assigning it to every component. + /// double to convert to int3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 int3(double v) { return new int3(v); } + + /// Return a int3 vector constructed from a double3 vector by componentwise conversion. + /// double3 to convert to int3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 int3(double3 v) { return new int3(v); } + + /// Returns a uint hash code of a int3 vector. + /// Vector value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(int3 v) + { + return csum(asuint(v) * uint3(0x4C7F6DD1u, 0x4822A3E9u, 0xAAC3C25Du)) + 0xD21D0945u; + } + + /// + /// Returns a uint3 vector hash code of a int3 vector. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Vector value to hash. + /// uint3 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 hashwide(int3 v) + { + return (asuint(v) * uint3(0x88FCAB2Du, 0x614DA60Du, 0x5BA2C50Bu)) + 0x8C455ACBu; + } + + /// Returns the result of specified shuffling of the components from two int3 vectors into an int value. + /// int3 to use as the left argument of the shuffle operation. + /// int3 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting int. + /// int result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int shuffle(int3 left, int3 right, ShuffleComponent x) + { + return select_shuffle_component(left, right, x); + } + + /// Returns the result of specified shuffling of the components from two int3 vectors into an int2 vector. + /// int3 to use as the left argument of the shuffle operation. + /// int3 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting int2 x component. + /// The ShuffleComponent to use when setting the resulting int2 y component. + /// int2 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 shuffle(int3 left, int3 right, ShuffleComponent x, ShuffleComponent y) + { + return int2( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y)); + } + + /// Returns the result of specified shuffling of the components from two int3 vectors into an int3 vector. + /// int3 to use as the left argument of the shuffle operation. + /// int3 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting int3 x component. + /// The ShuffleComponent to use when setting the resulting int3 y component. + /// The ShuffleComponent to use when setting the resulting int3 z component. + /// int3 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 shuffle(int3 left, int3 right, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z) + { + return int3( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y), + select_shuffle_component(left, right, z)); + } + + /// Returns the result of specified shuffling of the components from two int3 vectors into an int4 vector. + /// int3 to use as the left argument of the shuffle operation. + /// int3 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting int4 x component. + /// The ShuffleComponent to use when setting the resulting int4 y component. + /// The ShuffleComponent to use when setting the resulting int4 z component. + /// The ShuffleComponent to use when setting the resulting int4 w component. + /// int4 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 shuffle(int3 left, int3 right, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z, ShuffleComponent w) + { + return int4( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y), + select_shuffle_component(left, right, z), + select_shuffle_component(left, right, w)); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static int select_shuffle_component(int3 a, int3 b, ShuffleComponent component) + { + switch(component) + { + case ShuffleComponent.LeftX: + return a.x; + case ShuffleComponent.LeftY: + return a.y; + case ShuffleComponent.LeftZ: + return a.z; + case ShuffleComponent.RightX: + return b.x; + case ShuffleComponent.RightY: + return b.y; + case ShuffleComponent.RightZ: + return b.z; + default: + throw new System.ArgumentException("Invalid shuffle component: " + component); + } + } + } } diff --git a/src/Unity.Mathematics/int3x2.gen.cs b/src/Unity.Mathematics/int3x2.gen.cs new file mode 100644 index 00000000..894901bb --- /dev/null +++ b/src/Unity.Mathematics/int3x2.gen.cs @@ -0,0 +1,719 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 3x2 matrix of ints. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct int3x2 : System.IEquatable, IFormattable + { + /// Column 0 of the matrix. + public int3 c0; + /// Column 1 of the matrix. + public int3 c1; + + /// int3x2 zero value. + public static readonly int3x2 zero; + + /// Constructs a int3x2 matrix from two int3 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3x2(int3 c0, int3 c1) + { + this.c0 = c0; + this.c1 = c1; + } + + /// Constructs a int3x2 matrix from 6 int values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3x2(int m00, int m01, + int m10, int m11, + int m20, int m21) + { + this.c0 = new int3(m00, m10, m20); + this.c1 = new int3(m01, m11, m21); + } + + /// Constructs a int3x2 matrix from a single int value by assigning it to every component. + /// int to convert to int3x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3x2(int v) + { + this.c0 = v; + this.c1 = v; + } + + /// Constructs a int3x2 matrix from a single bool value by converting it to int and assigning it to every component. + /// bool to convert to int3x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3x2(bool v) + { + this.c0 = math.select(new int3(0), new int3(1), v); + this.c1 = math.select(new int3(0), new int3(1), v); + } + + /// Constructs a int3x2 matrix from a bool3x2 matrix by componentwise conversion. + /// bool3x2 to convert to int3x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3x2(bool3x2 v) + { + this.c0 = math.select(new int3(0), new int3(1), v.c0); + this.c1 = math.select(new int3(0), new int3(1), v.c1); + } + + /// Constructs a int3x2 matrix from a single uint value by converting it to int and assigning it to every component. + /// uint to convert to int3x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3x2(uint v) + { + this.c0 = (int3)v; + this.c1 = (int3)v; + } + + /// Constructs a int3x2 matrix from a uint3x2 matrix by componentwise conversion. + /// uint3x2 to convert to int3x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3x2(uint3x2 v) + { + this.c0 = (int3)v.c0; + this.c1 = (int3)v.c1; + } + + /// Constructs a int3x2 matrix from a single float value by converting it to int and assigning it to every component. + /// float to convert to int3x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3x2(float v) + { + this.c0 = (int3)v; + this.c1 = (int3)v; + } + + /// Constructs a int3x2 matrix from a float3x2 matrix by componentwise conversion. + /// float3x2 to convert to int3x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3x2(float3x2 v) + { + this.c0 = (int3)v.c0; + this.c1 = (int3)v.c1; + } + + /// Constructs a int3x2 matrix from a single double value by converting it to int and assigning it to every component. + /// double to convert to int3x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3x2(double v) + { + this.c0 = (int3)v; + this.c1 = (int3)v; + } + + /// Constructs a int3x2 matrix from a double3x2 matrix by componentwise conversion. + /// double3x2 to convert to int3x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3x2(double3x2 v) + { + this.c0 = (int3)v.c0; + this.c1 = (int3)v.c1; + } + + + /// Implicitly converts a single int value to a int3x2 matrix by assigning it to every component. + /// int to convert to int3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator int3x2(int v) { return new int3x2(v); } + + /// Explicitly converts a single bool value to a int3x2 matrix by converting it to int and assigning it to every component. + /// bool to convert to int3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int3x2(bool v) { return new int3x2(v); } + + /// Explicitly converts a bool3x2 matrix to a int3x2 matrix by componentwise conversion. + /// bool3x2 to convert to int3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int3x2(bool3x2 v) { return new int3x2(v); } + + /// Explicitly converts a single uint value to a int3x2 matrix by converting it to int and assigning it to every component. + /// uint to convert to int3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int3x2(uint v) { return new int3x2(v); } + + /// Explicitly converts a uint3x2 matrix to a int3x2 matrix by componentwise conversion. + /// uint3x2 to convert to int3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int3x2(uint3x2 v) { return new int3x2(v); } + + /// Explicitly converts a single float value to a int3x2 matrix by converting it to int and assigning it to every component. + /// float to convert to int3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int3x2(float v) { return new int3x2(v); } + + /// Explicitly converts a float3x2 matrix to a int3x2 matrix by componentwise conversion. + /// float3x2 to convert to int3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int3x2(float3x2 v) { return new int3x2(v); } + + /// Explicitly converts a single double value to a int3x2 matrix by converting it to int and assigning it to every component. + /// double to convert to int3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int3x2(double v) { return new int3x2(v); } + + /// Explicitly converts a double3x2 matrix to a int3x2 matrix by componentwise conversion. + /// double3x2 to convert to int3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int3x2(double3x2 v) { return new int3x2(v); } + + + /// Returns the result of a componentwise multiplication operation on two int3x2 matrices. + /// Left hand side int3x2 to use to compute componentwise multiplication. + /// Right hand side int3x2 to use to compute componentwise multiplication. + /// int3x2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 operator * (int3x2 lhs, int3x2 rhs) { return new int3x2 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1); } + + /// Returns the result of a componentwise multiplication operation on an int3x2 matrix and an int value. + /// Left hand side int3x2 to use to compute componentwise multiplication. + /// Right hand side int to use to compute componentwise multiplication. + /// int3x2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 operator * (int3x2 lhs, int rhs) { return new int3x2 (lhs.c0 * rhs, lhs.c1 * rhs); } + + /// Returns the result of a componentwise multiplication operation on an int value and an int3x2 matrix. + /// Left hand side int to use to compute componentwise multiplication. + /// Right hand side int3x2 to use to compute componentwise multiplication. + /// int3x2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 operator * (int lhs, int3x2 rhs) { return new int3x2 (lhs * rhs.c0, lhs * rhs.c1); } + + + /// Returns the result of a componentwise addition operation on two int3x2 matrices. + /// Left hand side int3x2 to use to compute componentwise addition. + /// Right hand side int3x2 to use to compute componentwise addition. + /// int3x2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 operator + (int3x2 lhs, int3x2 rhs) { return new int3x2 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1); } + + /// Returns the result of a componentwise addition operation on an int3x2 matrix and an int value. + /// Left hand side int3x2 to use to compute componentwise addition. + /// Right hand side int to use to compute componentwise addition. + /// int3x2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 operator + (int3x2 lhs, int rhs) { return new int3x2 (lhs.c0 + rhs, lhs.c1 + rhs); } + + /// Returns the result of a componentwise addition operation on an int value and an int3x2 matrix. + /// Left hand side int to use to compute componentwise addition. + /// Right hand side int3x2 to use to compute componentwise addition. + /// int3x2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 operator + (int lhs, int3x2 rhs) { return new int3x2 (lhs + rhs.c0, lhs + rhs.c1); } + + + /// Returns the result of a componentwise subtraction operation on two int3x2 matrices. + /// Left hand side int3x2 to use to compute componentwise subtraction. + /// Right hand side int3x2 to use to compute componentwise subtraction. + /// int3x2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 operator - (int3x2 lhs, int3x2 rhs) { return new int3x2 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1); } + + /// Returns the result of a componentwise subtraction operation on an int3x2 matrix and an int value. + /// Left hand side int3x2 to use to compute componentwise subtraction. + /// Right hand side int to use to compute componentwise subtraction. + /// int3x2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 operator - (int3x2 lhs, int rhs) { return new int3x2 (lhs.c0 - rhs, lhs.c1 - rhs); } + + /// Returns the result of a componentwise subtraction operation on an int value and an int3x2 matrix. + /// Left hand side int to use to compute componentwise subtraction. + /// Right hand side int3x2 to use to compute componentwise subtraction. + /// int3x2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 operator - (int lhs, int3x2 rhs) { return new int3x2 (lhs - rhs.c0, lhs - rhs.c1); } + + + /// Returns the result of a componentwise division operation on two int3x2 matrices. + /// Left hand side int3x2 to use to compute componentwise division. + /// Right hand side int3x2 to use to compute componentwise division. + /// int3x2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 operator / (int3x2 lhs, int3x2 rhs) { return new int3x2 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1); } + + /// Returns the result of a componentwise division operation on an int3x2 matrix and an int value. + /// Left hand side int3x2 to use to compute componentwise division. + /// Right hand side int to use to compute componentwise division. + /// int3x2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 operator / (int3x2 lhs, int rhs) { return new int3x2 (lhs.c0 / rhs, lhs.c1 / rhs); } + + /// Returns the result of a componentwise division operation on an int value and an int3x2 matrix. + /// Left hand side int to use to compute componentwise division. + /// Right hand side int3x2 to use to compute componentwise division. + /// int3x2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 operator / (int lhs, int3x2 rhs) { return new int3x2 (lhs / rhs.c0, lhs / rhs.c1); } + + + /// Returns the result of a componentwise modulus operation on two int3x2 matrices. + /// Left hand side int3x2 to use to compute componentwise modulus. + /// Right hand side int3x2 to use to compute componentwise modulus. + /// int3x2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 operator % (int3x2 lhs, int3x2 rhs) { return new int3x2 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1); } + + /// Returns the result of a componentwise modulus operation on an int3x2 matrix and an int value. + /// Left hand side int3x2 to use to compute componentwise modulus. + /// Right hand side int to use to compute componentwise modulus. + /// int3x2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 operator % (int3x2 lhs, int rhs) { return new int3x2 (lhs.c0 % rhs, lhs.c1 % rhs); } + + /// Returns the result of a componentwise modulus operation on an int value and an int3x2 matrix. + /// Left hand side int to use to compute componentwise modulus. + /// Right hand side int3x2 to use to compute componentwise modulus. + /// int3x2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 operator % (int lhs, int3x2 rhs) { return new int3x2 (lhs % rhs.c0, lhs % rhs.c1); } + + + /// Returns the result of a componentwise increment operation on an int3x2 matrix. + /// Value to use when computing the componentwise increment. + /// int3x2 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 operator ++ (int3x2 val) { return new int3x2 (++val.c0, ++val.c1); } + + + /// Returns the result of a componentwise decrement operation on an int3x2 matrix. + /// Value to use when computing the componentwise decrement. + /// int3x2 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 operator -- (int3x2 val) { return new int3x2 (--val.c0, --val.c1); } + + + /// Returns the result of a componentwise less than operation on two int3x2 matrices. + /// Left hand side int3x2 to use to compute componentwise less than. + /// Right hand side int3x2 to use to compute componentwise less than. + /// bool3x2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator < (int3x2 lhs, int3x2 rhs) { return new bool3x2 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1); } + + /// Returns the result of a componentwise less than operation on an int3x2 matrix and an int value. + /// Left hand side int3x2 to use to compute componentwise less than. + /// Right hand side int to use to compute componentwise less than. + /// bool3x2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator < (int3x2 lhs, int rhs) { return new bool3x2 (lhs.c0 < rhs, lhs.c1 < rhs); } + + /// Returns the result of a componentwise less than operation on an int value and an int3x2 matrix. + /// Left hand side int to use to compute componentwise less than. + /// Right hand side int3x2 to use to compute componentwise less than. + /// bool3x2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator < (int lhs, int3x2 rhs) { return new bool3x2 (lhs < rhs.c0, lhs < rhs.c1); } + + + /// Returns the result of a componentwise less or equal operation on two int3x2 matrices. + /// Left hand side int3x2 to use to compute componentwise less or equal. + /// Right hand side int3x2 to use to compute componentwise less or equal. + /// bool3x2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator <= (int3x2 lhs, int3x2 rhs) { return new bool3x2 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1); } + + /// Returns the result of a componentwise less or equal operation on an int3x2 matrix and an int value. + /// Left hand side int3x2 to use to compute componentwise less or equal. + /// Right hand side int to use to compute componentwise less or equal. + /// bool3x2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator <= (int3x2 lhs, int rhs) { return new bool3x2 (lhs.c0 <= rhs, lhs.c1 <= rhs); } + + /// Returns the result of a componentwise less or equal operation on an int value and an int3x2 matrix. + /// Left hand side int to use to compute componentwise less or equal. + /// Right hand side int3x2 to use to compute componentwise less or equal. + /// bool3x2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator <= (int lhs, int3x2 rhs) { return new bool3x2 (lhs <= rhs.c0, lhs <= rhs.c1); } + + + /// Returns the result of a componentwise greater than operation on two int3x2 matrices. + /// Left hand side int3x2 to use to compute componentwise greater than. + /// Right hand side int3x2 to use to compute componentwise greater than. + /// bool3x2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator > (int3x2 lhs, int3x2 rhs) { return new bool3x2 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1); } + + /// Returns the result of a componentwise greater than operation on an int3x2 matrix and an int value. + /// Left hand side int3x2 to use to compute componentwise greater than. + /// Right hand side int to use to compute componentwise greater than. + /// bool3x2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator > (int3x2 lhs, int rhs) { return new bool3x2 (lhs.c0 > rhs, lhs.c1 > rhs); } + + /// Returns the result of a componentwise greater than operation on an int value and an int3x2 matrix. + /// Left hand side int to use to compute componentwise greater than. + /// Right hand side int3x2 to use to compute componentwise greater than. + /// bool3x2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator > (int lhs, int3x2 rhs) { return new bool3x2 (lhs > rhs.c0, lhs > rhs.c1); } + + + /// Returns the result of a componentwise greater or equal operation on two int3x2 matrices. + /// Left hand side int3x2 to use to compute componentwise greater or equal. + /// Right hand side int3x2 to use to compute componentwise greater or equal. + /// bool3x2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator >= (int3x2 lhs, int3x2 rhs) { return new bool3x2 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1); } + + /// Returns the result of a componentwise greater or equal operation on an int3x2 matrix and an int value. + /// Left hand side int3x2 to use to compute componentwise greater or equal. + /// Right hand side int to use to compute componentwise greater or equal. + /// bool3x2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator >= (int3x2 lhs, int rhs) { return new bool3x2 (lhs.c0 >= rhs, lhs.c1 >= rhs); } + + /// Returns the result of a componentwise greater or equal operation on an int value and an int3x2 matrix. + /// Left hand side int to use to compute componentwise greater or equal. + /// Right hand side int3x2 to use to compute componentwise greater or equal. + /// bool3x2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator >= (int lhs, int3x2 rhs) { return new bool3x2 (lhs >= rhs.c0, lhs >= rhs.c1); } + + + /// Returns the result of a componentwise unary minus operation on an int3x2 matrix. + /// Value to use when computing the componentwise unary minus. + /// int3x2 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 operator - (int3x2 val) { return new int3x2 (-val.c0, -val.c1); } + + + /// Returns the result of a componentwise unary plus operation on an int3x2 matrix. + /// Value to use when computing the componentwise unary plus. + /// int3x2 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 operator + (int3x2 val) { return new int3x2 (+val.c0, +val.c1); } + + + /// Returns the result of a componentwise left shift operation on an int3x2 matrix by a number of bits specified by a single int. + /// The matrix to left shift. + /// The number of bits to left shift. + /// The result of the componentwise left shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 operator << (int3x2 x, int n) { return new int3x2 (x.c0 << n, x.c1 << n); } + + /// Returns the result of a componentwise right shift operation on an int3x2 matrix by a number of bits specified by a single int. + /// The matrix to right shift. + /// The number of bits to right shift. + /// The result of the componentwise right shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 operator >> (int3x2 x, int n) { return new int3x2 (x.c0 >> n, x.c1 >> n); } + + /// Returns the result of a componentwise equality operation on two int3x2 matrices. + /// Left hand side int3x2 to use to compute componentwise equality. + /// Right hand side int3x2 to use to compute componentwise equality. + /// bool3x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator == (int3x2 lhs, int3x2 rhs) { return new bool3x2 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1); } + + /// Returns the result of a componentwise equality operation on an int3x2 matrix and an int value. + /// Left hand side int3x2 to use to compute componentwise equality. + /// Right hand side int to use to compute componentwise equality. + /// bool3x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator == (int3x2 lhs, int rhs) { return new bool3x2 (lhs.c0 == rhs, lhs.c1 == rhs); } + + /// Returns the result of a componentwise equality operation on an int value and an int3x2 matrix. + /// Left hand side int to use to compute componentwise equality. + /// Right hand side int3x2 to use to compute componentwise equality. + /// bool3x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator == (int lhs, int3x2 rhs) { return new bool3x2 (lhs == rhs.c0, lhs == rhs.c1); } + + + /// Returns the result of a componentwise not equal operation on two int3x2 matrices. + /// Left hand side int3x2 to use to compute componentwise not equal. + /// Right hand side int3x2 to use to compute componentwise not equal. + /// bool3x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator != (int3x2 lhs, int3x2 rhs) { return new bool3x2 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1); } + + /// Returns the result of a componentwise not equal operation on an int3x2 matrix and an int value. + /// Left hand side int3x2 to use to compute componentwise not equal. + /// Right hand side int to use to compute componentwise not equal. + /// bool3x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator != (int3x2 lhs, int rhs) { return new bool3x2 (lhs.c0 != rhs, lhs.c1 != rhs); } + + /// Returns the result of a componentwise not equal operation on an int value and an int3x2 matrix. + /// Left hand side int to use to compute componentwise not equal. + /// Right hand side int3x2 to use to compute componentwise not equal. + /// bool3x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator != (int lhs, int3x2 rhs) { return new bool3x2 (lhs != rhs.c0, lhs != rhs.c1); } + + + /// Returns the result of a componentwise bitwise not operation on an int3x2 matrix. + /// Value to use when computing the componentwise bitwise not. + /// int3x2 result of the componentwise bitwise not. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 operator ~ (int3x2 val) { return new int3x2 (~val.c0, ~val.c1); } + + + /// Returns the result of a componentwise bitwise and operation on two int3x2 matrices. + /// Left hand side int3x2 to use to compute componentwise bitwise and. + /// Right hand side int3x2 to use to compute componentwise bitwise and. + /// int3x2 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 operator & (int3x2 lhs, int3x2 rhs) { return new int3x2 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1); } + + /// Returns the result of a componentwise bitwise and operation on an int3x2 matrix and an int value. + /// Left hand side int3x2 to use to compute componentwise bitwise and. + /// Right hand side int to use to compute componentwise bitwise and. + /// int3x2 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 operator & (int3x2 lhs, int rhs) { return new int3x2 (lhs.c0 & rhs, lhs.c1 & rhs); } + + /// Returns the result of a componentwise bitwise and operation on an int value and an int3x2 matrix. + /// Left hand side int to use to compute componentwise bitwise and. + /// Right hand side int3x2 to use to compute componentwise bitwise and. + /// int3x2 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 operator & (int lhs, int3x2 rhs) { return new int3x2 (lhs & rhs.c0, lhs & rhs.c1); } + + + /// Returns the result of a componentwise bitwise or operation on two int3x2 matrices. + /// Left hand side int3x2 to use to compute componentwise bitwise or. + /// Right hand side int3x2 to use to compute componentwise bitwise or. + /// int3x2 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 operator | (int3x2 lhs, int3x2 rhs) { return new int3x2 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1); } + + /// Returns the result of a componentwise bitwise or operation on an int3x2 matrix and an int value. + /// Left hand side int3x2 to use to compute componentwise bitwise or. + /// Right hand side int to use to compute componentwise bitwise or. + /// int3x2 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 operator | (int3x2 lhs, int rhs) { return new int3x2 (lhs.c0 | rhs, lhs.c1 | rhs); } + + /// Returns the result of a componentwise bitwise or operation on an int value and an int3x2 matrix. + /// Left hand side int to use to compute componentwise bitwise or. + /// Right hand side int3x2 to use to compute componentwise bitwise or. + /// int3x2 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 operator | (int lhs, int3x2 rhs) { return new int3x2 (lhs | rhs.c0, lhs | rhs.c1); } + + + /// Returns the result of a componentwise bitwise exclusive or operation on two int3x2 matrices. + /// Left hand side int3x2 to use to compute componentwise bitwise exclusive or. + /// Right hand side int3x2 to use to compute componentwise bitwise exclusive or. + /// int3x2 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 operator ^ (int3x2 lhs, int3x2 rhs) { return new int3x2 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1); } + + /// Returns the result of a componentwise bitwise exclusive or operation on an int3x2 matrix and an int value. + /// Left hand side int3x2 to use to compute componentwise bitwise exclusive or. + /// Right hand side int to use to compute componentwise bitwise exclusive or. + /// int3x2 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 operator ^ (int3x2 lhs, int rhs) { return new int3x2 (lhs.c0 ^ rhs, lhs.c1 ^ rhs); } + + /// Returns the result of a componentwise bitwise exclusive or operation on an int value and an int3x2 matrix. + /// Left hand side int to use to compute componentwise bitwise exclusive or. + /// Right hand side int3x2 to use to compute componentwise bitwise exclusive or. + /// int3x2 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 operator ^ (int lhs, int3x2 rhs) { return new int3x2 (lhs ^ rhs.c0, lhs ^ rhs.c1); } + + + + /// Returns the int3 element at a specified index. + unsafe public ref int3 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 2) + throw new System.ArgumentException("index must be between[0...1]"); +#endif + fixed (int3x2* array = &this) { return ref ((int3*)array)[index]; } + } + } + + /// Returns true if the int3x2 is equal to a given int3x2, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(int3x2 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1); } + + /// Returns true if the int3x2 is equal to a given int3x2, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is int3x2 converted && Equals(converted); } + + + /// Returns a hash code for the int3x2. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the int3x2. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("int3x2({0}, {1}, {2}, {3}, {4}, {5})", c0.x, c1.x, c0.y, c1.y, c0.z, c1.z); + } + + /// Returns a string representation of the int3x2 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("int3x2({0}, {1}, {2}, {3}, {4}, {5})", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c0.z.ToString(format, formatProvider), c1.z.ToString(format, formatProvider)); + } + + } + + public static partial class math + { + /// Returns a int3x2 matrix constructed from two int3 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// int3x2 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 int3x2(int3 c0, int3 c1) { return new int3x2(c0, c1); } + + /// Returns a int3x2 matrix constructed from from 6 int values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// int3x2 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 int3x2(int m00, int m01, + int m10, int m11, + int m20, int m21) + { + return new int3x2(m00, m01, + m10, m11, + m20, m21); + } + + /// Returns a int3x2 matrix constructed from a single int value by assigning it to every component. + /// int to convert to int3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 int3x2(int v) { return new int3x2(v); } + + /// Returns a int3x2 matrix constructed from a single bool value by converting it to int and assigning it to every component. + /// bool to convert to int3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 int3x2(bool v) { return new int3x2(v); } + + /// Return a int3x2 matrix constructed from a bool3x2 matrix by componentwise conversion. + /// bool3x2 to convert to int3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 int3x2(bool3x2 v) { return new int3x2(v); } + + /// Returns a int3x2 matrix constructed from a single uint value by converting it to int and assigning it to every component. + /// uint to convert to int3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 int3x2(uint v) { return new int3x2(v); } + + /// Return a int3x2 matrix constructed from a uint3x2 matrix by componentwise conversion. + /// uint3x2 to convert to int3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 int3x2(uint3x2 v) { return new int3x2(v); } + + /// Returns a int3x2 matrix constructed from a single float value by converting it to int and assigning it to every component. + /// float to convert to int3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 int3x2(float v) { return new int3x2(v); } + + /// Return a int3x2 matrix constructed from a float3x2 matrix by componentwise conversion. + /// float3x2 to convert to int3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 int3x2(float3x2 v) { return new int3x2(v); } + + /// Returns a int3x2 matrix constructed from a single double value by converting it to int and assigning it to every component. + /// double to convert to int3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 int3x2(double v) { return new int3x2(v); } + + /// Return a int3x2 matrix constructed from a double3x2 matrix by componentwise conversion. + /// double3x2 to convert to int3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 int3x2(double3x2 v) { return new int3x2(v); } + + /// Return the int2x3 transpose of a int3x2 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 transpose(int3x2 v) + { + return int2x3( + v.c0.x, v.c0.y, v.c0.z, + v.c1.x, v.c1.y, v.c1.z); + } + + /// Returns a uint hash code of a int3x2 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(int3x2 v) + { + return csum(asuint(v.c0) * uint3(0xDB3DE101u, 0x7B6D1B4Bu, 0x58399E77u) + + asuint(v.c1) * uint3(0x5EAC29C9u, 0xFC6014F9u, 0x6BF6693Fu)) + 0x9D1B1D9Bu; + } + + /// + /// Returns a uint3 vector hash code of a int3x2 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint3 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 hashwide(int3x2 v) + { + return (asuint(v.c0) * uint3(0xF842F5C1u, 0xA47EC335u, 0xA477DF57u) + + asuint(v.c1) * uint3(0xC4B1493Fu, 0xBA0966D3u, 0xAFBEE253u)) + 0x5B419C01u; + } + + } +} diff --git a/src/Unity.Mathematics/int3x2.gen.cs.meta b/src/Unity.Mathematics/int3x2.gen.cs.meta new file mode 100644 index 00000000..0b361416 --- /dev/null +++ b/src/Unity.Mathematics/int3x2.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6ddb7ba42f65c4292afd32dd847c8d3e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/int3x3.gen.cs b/src/Unity.Mathematics/int3x3.gen.cs new file mode 100644 index 00000000..e4c27e5e --- /dev/null +++ b/src/Unity.Mathematics/int3x3.gen.cs @@ -0,0 +1,763 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 3x3 matrix of ints. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct int3x3 : System.IEquatable, IFormattable + { + /// Column 0 of the matrix. + public int3 c0; + /// Column 1 of the matrix. + public int3 c1; + /// Column 2 of the matrix. + public int3 c2; + + /// int3x3 identity transform. + public static readonly int3x3 identity = new int3x3(1, 0, 0, 0, 1, 0, 0, 0, 1); + + /// int3x3 zero value. + public static readonly int3x3 zero; + + /// Constructs a int3x3 matrix from three int3 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3x3(int3 c0, int3 c1, int3 c2) + { + this.c0 = c0; + this.c1 = c1; + this.c2 = c2; + } + + /// Constructs a int3x3 matrix from 9 int values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 2, column 2 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3x3(int m00, int m01, int m02, + int m10, int m11, int m12, + int m20, int m21, int m22) + { + this.c0 = new int3(m00, m10, m20); + this.c1 = new int3(m01, m11, m21); + this.c2 = new int3(m02, m12, m22); + } + + /// Constructs a int3x3 matrix from a single int value by assigning it to every component. + /// int to convert to int3x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3x3(int v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + } + + /// Constructs a int3x3 matrix from a single bool value by converting it to int and assigning it to every component. + /// bool to convert to int3x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3x3(bool v) + { + this.c0 = math.select(new int3(0), new int3(1), v); + this.c1 = math.select(new int3(0), new int3(1), v); + this.c2 = math.select(new int3(0), new int3(1), v); + } + + /// Constructs a int3x3 matrix from a bool3x3 matrix by componentwise conversion. + /// bool3x3 to convert to int3x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3x3(bool3x3 v) + { + this.c0 = math.select(new int3(0), new int3(1), v.c0); + this.c1 = math.select(new int3(0), new int3(1), v.c1); + this.c2 = math.select(new int3(0), new int3(1), v.c2); + } + + /// Constructs a int3x3 matrix from a single uint value by converting it to int and assigning it to every component. + /// uint to convert to int3x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3x3(uint v) + { + this.c0 = (int3)v; + this.c1 = (int3)v; + this.c2 = (int3)v; + } + + /// Constructs a int3x3 matrix from a uint3x3 matrix by componentwise conversion. + /// uint3x3 to convert to int3x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3x3(uint3x3 v) + { + this.c0 = (int3)v.c0; + this.c1 = (int3)v.c1; + this.c2 = (int3)v.c2; + } + + /// Constructs a int3x3 matrix from a single float value by converting it to int and assigning it to every component. + /// float to convert to int3x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3x3(float v) + { + this.c0 = (int3)v; + this.c1 = (int3)v; + this.c2 = (int3)v; + } + + /// Constructs a int3x3 matrix from a float3x3 matrix by componentwise conversion. + /// float3x3 to convert to int3x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3x3(float3x3 v) + { + this.c0 = (int3)v.c0; + this.c1 = (int3)v.c1; + this.c2 = (int3)v.c2; + } + + /// Constructs a int3x3 matrix from a single double value by converting it to int and assigning it to every component. + /// double to convert to int3x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3x3(double v) + { + this.c0 = (int3)v; + this.c1 = (int3)v; + this.c2 = (int3)v; + } + + /// Constructs a int3x3 matrix from a double3x3 matrix by componentwise conversion. + /// double3x3 to convert to int3x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3x3(double3x3 v) + { + this.c0 = (int3)v.c0; + this.c1 = (int3)v.c1; + this.c2 = (int3)v.c2; + } + + + /// Implicitly converts a single int value to a int3x3 matrix by assigning it to every component. + /// int to convert to int3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator int3x3(int v) { return new int3x3(v); } + + /// Explicitly converts a single bool value to a int3x3 matrix by converting it to int and assigning it to every component. + /// bool to convert to int3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int3x3(bool v) { return new int3x3(v); } + + /// Explicitly converts a bool3x3 matrix to a int3x3 matrix by componentwise conversion. + /// bool3x3 to convert to int3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int3x3(bool3x3 v) { return new int3x3(v); } + + /// Explicitly converts a single uint value to a int3x3 matrix by converting it to int and assigning it to every component. + /// uint to convert to int3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int3x3(uint v) { return new int3x3(v); } + + /// Explicitly converts a uint3x3 matrix to a int3x3 matrix by componentwise conversion. + /// uint3x3 to convert to int3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int3x3(uint3x3 v) { return new int3x3(v); } + + /// Explicitly converts a single float value to a int3x3 matrix by converting it to int and assigning it to every component. + /// float to convert to int3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int3x3(float v) { return new int3x3(v); } + + /// Explicitly converts a float3x3 matrix to a int3x3 matrix by componentwise conversion. + /// float3x3 to convert to int3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int3x3(float3x3 v) { return new int3x3(v); } + + /// Explicitly converts a single double value to a int3x3 matrix by converting it to int and assigning it to every component. + /// double to convert to int3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int3x3(double v) { return new int3x3(v); } + + /// Explicitly converts a double3x3 matrix to a int3x3 matrix by componentwise conversion. + /// double3x3 to convert to int3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int3x3(double3x3 v) { return new int3x3(v); } + + + /// Returns the result of a componentwise multiplication operation on two int3x3 matrices. + /// Left hand side int3x3 to use to compute componentwise multiplication. + /// Right hand side int3x3 to use to compute componentwise multiplication. + /// int3x3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 operator * (int3x3 lhs, int3x3 rhs) { return new int3x3 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1, lhs.c2 * rhs.c2); } + + /// Returns the result of a componentwise multiplication operation on an int3x3 matrix and an int value. + /// Left hand side int3x3 to use to compute componentwise multiplication. + /// Right hand side int to use to compute componentwise multiplication. + /// int3x3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 operator * (int3x3 lhs, int rhs) { return new int3x3 (lhs.c0 * rhs, lhs.c1 * rhs, lhs.c2 * rhs); } + + /// Returns the result of a componentwise multiplication operation on an int value and an int3x3 matrix. + /// Left hand side int to use to compute componentwise multiplication. + /// Right hand side int3x3 to use to compute componentwise multiplication. + /// int3x3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 operator * (int lhs, int3x3 rhs) { return new int3x3 (lhs * rhs.c0, lhs * rhs.c1, lhs * rhs.c2); } + + + /// Returns the result of a componentwise addition operation on two int3x3 matrices. + /// Left hand side int3x3 to use to compute componentwise addition. + /// Right hand side int3x3 to use to compute componentwise addition. + /// int3x3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 operator + (int3x3 lhs, int3x3 rhs) { return new int3x3 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1, lhs.c2 + rhs.c2); } + + /// Returns the result of a componentwise addition operation on an int3x3 matrix and an int value. + /// Left hand side int3x3 to use to compute componentwise addition. + /// Right hand side int to use to compute componentwise addition. + /// int3x3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 operator + (int3x3 lhs, int rhs) { return new int3x3 (lhs.c0 + rhs, lhs.c1 + rhs, lhs.c2 + rhs); } + + /// Returns the result of a componentwise addition operation on an int value and an int3x3 matrix. + /// Left hand side int to use to compute componentwise addition. + /// Right hand side int3x3 to use to compute componentwise addition. + /// int3x3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 operator + (int lhs, int3x3 rhs) { return new int3x3 (lhs + rhs.c0, lhs + rhs.c1, lhs + rhs.c2); } + + + /// Returns the result of a componentwise subtraction operation on two int3x3 matrices. + /// Left hand side int3x3 to use to compute componentwise subtraction. + /// Right hand side int3x3 to use to compute componentwise subtraction. + /// int3x3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 operator - (int3x3 lhs, int3x3 rhs) { return new int3x3 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1, lhs.c2 - rhs.c2); } + + /// Returns the result of a componentwise subtraction operation on an int3x3 matrix and an int value. + /// Left hand side int3x3 to use to compute componentwise subtraction. + /// Right hand side int to use to compute componentwise subtraction. + /// int3x3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 operator - (int3x3 lhs, int rhs) { return new int3x3 (lhs.c0 - rhs, lhs.c1 - rhs, lhs.c2 - rhs); } + + /// Returns the result of a componentwise subtraction operation on an int value and an int3x3 matrix. + /// Left hand side int to use to compute componentwise subtraction. + /// Right hand side int3x3 to use to compute componentwise subtraction. + /// int3x3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 operator - (int lhs, int3x3 rhs) { return new int3x3 (lhs - rhs.c0, lhs - rhs.c1, lhs - rhs.c2); } + + + /// Returns the result of a componentwise division operation on two int3x3 matrices. + /// Left hand side int3x3 to use to compute componentwise division. + /// Right hand side int3x3 to use to compute componentwise division. + /// int3x3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 operator / (int3x3 lhs, int3x3 rhs) { return new int3x3 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1, lhs.c2 / rhs.c2); } + + /// Returns the result of a componentwise division operation on an int3x3 matrix and an int value. + /// Left hand side int3x3 to use to compute componentwise division. + /// Right hand side int to use to compute componentwise division. + /// int3x3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 operator / (int3x3 lhs, int rhs) { return new int3x3 (lhs.c0 / rhs, lhs.c1 / rhs, lhs.c2 / rhs); } + + /// Returns the result of a componentwise division operation on an int value and an int3x3 matrix. + /// Left hand side int to use to compute componentwise division. + /// Right hand side int3x3 to use to compute componentwise division. + /// int3x3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 operator / (int lhs, int3x3 rhs) { return new int3x3 (lhs / rhs.c0, lhs / rhs.c1, lhs / rhs.c2); } + + + /// Returns the result of a componentwise modulus operation on two int3x3 matrices. + /// Left hand side int3x3 to use to compute componentwise modulus. + /// Right hand side int3x3 to use to compute componentwise modulus. + /// int3x3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 operator % (int3x3 lhs, int3x3 rhs) { return new int3x3 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1, lhs.c2 % rhs.c2); } + + /// Returns the result of a componentwise modulus operation on an int3x3 matrix and an int value. + /// Left hand side int3x3 to use to compute componentwise modulus. + /// Right hand side int to use to compute componentwise modulus. + /// int3x3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 operator % (int3x3 lhs, int rhs) { return new int3x3 (lhs.c0 % rhs, lhs.c1 % rhs, lhs.c2 % rhs); } + + /// Returns the result of a componentwise modulus operation on an int value and an int3x3 matrix. + /// Left hand side int to use to compute componentwise modulus. + /// Right hand side int3x3 to use to compute componentwise modulus. + /// int3x3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 operator % (int lhs, int3x3 rhs) { return new int3x3 (lhs % rhs.c0, lhs % rhs.c1, lhs % rhs.c2); } + + + /// Returns the result of a componentwise increment operation on an int3x3 matrix. + /// Value to use when computing the componentwise increment. + /// int3x3 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 operator ++ (int3x3 val) { return new int3x3 (++val.c0, ++val.c1, ++val.c2); } + + + /// Returns the result of a componentwise decrement operation on an int3x3 matrix. + /// Value to use when computing the componentwise decrement. + /// int3x3 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 operator -- (int3x3 val) { return new int3x3 (--val.c0, --val.c1, --val.c2); } + + + /// Returns the result of a componentwise less than operation on two int3x3 matrices. + /// Left hand side int3x3 to use to compute componentwise less than. + /// Right hand side int3x3 to use to compute componentwise less than. + /// bool3x3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator < (int3x3 lhs, int3x3 rhs) { return new bool3x3 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1, lhs.c2 < rhs.c2); } + + /// Returns the result of a componentwise less than operation on an int3x3 matrix and an int value. + /// Left hand side int3x3 to use to compute componentwise less than. + /// Right hand side int to use to compute componentwise less than. + /// bool3x3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator < (int3x3 lhs, int rhs) { return new bool3x3 (lhs.c0 < rhs, lhs.c1 < rhs, lhs.c2 < rhs); } + + /// Returns the result of a componentwise less than operation on an int value and an int3x3 matrix. + /// Left hand side int to use to compute componentwise less than. + /// Right hand side int3x3 to use to compute componentwise less than. + /// bool3x3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator < (int lhs, int3x3 rhs) { return new bool3x3 (lhs < rhs.c0, lhs < rhs.c1, lhs < rhs.c2); } + + + /// Returns the result of a componentwise less or equal operation on two int3x3 matrices. + /// Left hand side int3x3 to use to compute componentwise less or equal. + /// Right hand side int3x3 to use to compute componentwise less or equal. + /// bool3x3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator <= (int3x3 lhs, int3x3 rhs) { return new bool3x3 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1, lhs.c2 <= rhs.c2); } + + /// Returns the result of a componentwise less or equal operation on an int3x3 matrix and an int value. + /// Left hand side int3x3 to use to compute componentwise less or equal. + /// Right hand side int to use to compute componentwise less or equal. + /// bool3x3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator <= (int3x3 lhs, int rhs) { return new bool3x3 (lhs.c0 <= rhs, lhs.c1 <= rhs, lhs.c2 <= rhs); } + + /// Returns the result of a componentwise less or equal operation on an int value and an int3x3 matrix. + /// Left hand side int to use to compute componentwise less or equal. + /// Right hand side int3x3 to use to compute componentwise less or equal. + /// bool3x3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator <= (int lhs, int3x3 rhs) { return new bool3x3 (lhs <= rhs.c0, lhs <= rhs.c1, lhs <= rhs.c2); } + + + /// Returns the result of a componentwise greater than operation on two int3x3 matrices. + /// Left hand side int3x3 to use to compute componentwise greater than. + /// Right hand side int3x3 to use to compute componentwise greater than. + /// bool3x3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator > (int3x3 lhs, int3x3 rhs) { return new bool3x3 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1, lhs.c2 > rhs.c2); } + + /// Returns the result of a componentwise greater than operation on an int3x3 matrix and an int value. + /// Left hand side int3x3 to use to compute componentwise greater than. + /// Right hand side int to use to compute componentwise greater than. + /// bool3x3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator > (int3x3 lhs, int rhs) { return new bool3x3 (lhs.c0 > rhs, lhs.c1 > rhs, lhs.c2 > rhs); } + + /// Returns the result of a componentwise greater than operation on an int value and an int3x3 matrix. + /// Left hand side int to use to compute componentwise greater than. + /// Right hand side int3x3 to use to compute componentwise greater than. + /// bool3x3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator > (int lhs, int3x3 rhs) { return new bool3x3 (lhs > rhs.c0, lhs > rhs.c1, lhs > rhs.c2); } + + + /// Returns the result of a componentwise greater or equal operation on two int3x3 matrices. + /// Left hand side int3x3 to use to compute componentwise greater or equal. + /// Right hand side int3x3 to use to compute componentwise greater or equal. + /// bool3x3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator >= (int3x3 lhs, int3x3 rhs) { return new bool3x3 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1, lhs.c2 >= rhs.c2); } + + /// Returns the result of a componentwise greater or equal operation on an int3x3 matrix and an int value. + /// Left hand side int3x3 to use to compute componentwise greater or equal. + /// Right hand side int to use to compute componentwise greater or equal. + /// bool3x3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator >= (int3x3 lhs, int rhs) { return new bool3x3 (lhs.c0 >= rhs, lhs.c1 >= rhs, lhs.c2 >= rhs); } + + /// Returns the result of a componentwise greater or equal operation on an int value and an int3x3 matrix. + /// Left hand side int to use to compute componentwise greater or equal. + /// Right hand side int3x3 to use to compute componentwise greater or equal. + /// bool3x3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator >= (int lhs, int3x3 rhs) { return new bool3x3 (lhs >= rhs.c0, lhs >= rhs.c1, lhs >= rhs.c2); } + + + /// Returns the result of a componentwise unary minus operation on an int3x3 matrix. + /// Value to use when computing the componentwise unary minus. + /// int3x3 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 operator - (int3x3 val) { return new int3x3 (-val.c0, -val.c1, -val.c2); } + + + /// Returns the result of a componentwise unary plus operation on an int3x3 matrix. + /// Value to use when computing the componentwise unary plus. + /// int3x3 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 operator + (int3x3 val) { return new int3x3 (+val.c0, +val.c1, +val.c2); } + + + /// Returns the result of a componentwise left shift operation on an int3x3 matrix by a number of bits specified by a single int. + /// The matrix to left shift. + /// The number of bits to left shift. + /// The result of the componentwise left shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 operator << (int3x3 x, int n) { return new int3x3 (x.c0 << n, x.c1 << n, x.c2 << n); } + + /// Returns the result of a componentwise right shift operation on an int3x3 matrix by a number of bits specified by a single int. + /// The matrix to right shift. + /// The number of bits to right shift. + /// The result of the componentwise right shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 operator >> (int3x3 x, int n) { return new int3x3 (x.c0 >> n, x.c1 >> n, x.c2 >> n); } + + /// Returns the result of a componentwise equality operation on two int3x3 matrices. + /// Left hand side int3x3 to use to compute componentwise equality. + /// Right hand side int3x3 to use to compute componentwise equality. + /// bool3x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator == (int3x3 lhs, int3x3 rhs) { return new bool3x3 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2); } + + /// Returns the result of a componentwise equality operation on an int3x3 matrix and an int value. + /// Left hand side int3x3 to use to compute componentwise equality. + /// Right hand side int to use to compute componentwise equality. + /// bool3x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator == (int3x3 lhs, int rhs) { return new bool3x3 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs); } + + /// Returns the result of a componentwise equality operation on an int value and an int3x3 matrix. + /// Left hand side int to use to compute componentwise equality. + /// Right hand side int3x3 to use to compute componentwise equality. + /// bool3x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator == (int lhs, int3x3 rhs) { return new bool3x3 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2); } + + + /// Returns the result of a componentwise not equal operation on two int3x3 matrices. + /// Left hand side int3x3 to use to compute componentwise not equal. + /// Right hand side int3x3 to use to compute componentwise not equal. + /// bool3x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator != (int3x3 lhs, int3x3 rhs) { return new bool3x3 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2); } + + /// Returns the result of a componentwise not equal operation on an int3x3 matrix and an int value. + /// Left hand side int3x3 to use to compute componentwise not equal. + /// Right hand side int to use to compute componentwise not equal. + /// bool3x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator != (int3x3 lhs, int rhs) { return new bool3x3 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs); } + + /// Returns the result of a componentwise not equal operation on an int value and an int3x3 matrix. + /// Left hand side int to use to compute componentwise not equal. + /// Right hand side int3x3 to use to compute componentwise not equal. + /// bool3x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator != (int lhs, int3x3 rhs) { return new bool3x3 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2); } + + + /// Returns the result of a componentwise bitwise not operation on an int3x3 matrix. + /// Value to use when computing the componentwise bitwise not. + /// int3x3 result of the componentwise bitwise not. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 operator ~ (int3x3 val) { return new int3x3 (~val.c0, ~val.c1, ~val.c2); } + + + /// Returns the result of a componentwise bitwise and operation on two int3x3 matrices. + /// Left hand side int3x3 to use to compute componentwise bitwise and. + /// Right hand side int3x3 to use to compute componentwise bitwise and. + /// int3x3 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 operator & (int3x3 lhs, int3x3 rhs) { return new int3x3 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1, lhs.c2 & rhs.c2); } + + /// Returns the result of a componentwise bitwise and operation on an int3x3 matrix and an int value. + /// Left hand side int3x3 to use to compute componentwise bitwise and. + /// Right hand side int to use to compute componentwise bitwise and. + /// int3x3 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 operator & (int3x3 lhs, int rhs) { return new int3x3 (lhs.c0 & rhs, lhs.c1 & rhs, lhs.c2 & rhs); } + + /// Returns the result of a componentwise bitwise and operation on an int value and an int3x3 matrix. + /// Left hand side int to use to compute componentwise bitwise and. + /// Right hand side int3x3 to use to compute componentwise bitwise and. + /// int3x3 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 operator & (int lhs, int3x3 rhs) { return new int3x3 (lhs & rhs.c0, lhs & rhs.c1, lhs & rhs.c2); } + + + /// Returns the result of a componentwise bitwise or operation on two int3x3 matrices. + /// Left hand side int3x3 to use to compute componentwise bitwise or. + /// Right hand side int3x3 to use to compute componentwise bitwise or. + /// int3x3 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 operator | (int3x3 lhs, int3x3 rhs) { return new int3x3 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1, lhs.c2 | rhs.c2); } + + /// Returns the result of a componentwise bitwise or operation on an int3x3 matrix and an int value. + /// Left hand side int3x3 to use to compute componentwise bitwise or. + /// Right hand side int to use to compute componentwise bitwise or. + /// int3x3 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 operator | (int3x3 lhs, int rhs) { return new int3x3 (lhs.c0 | rhs, lhs.c1 | rhs, lhs.c2 | rhs); } + + /// Returns the result of a componentwise bitwise or operation on an int value and an int3x3 matrix. + /// Left hand side int to use to compute componentwise bitwise or. + /// Right hand side int3x3 to use to compute componentwise bitwise or. + /// int3x3 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 operator | (int lhs, int3x3 rhs) { return new int3x3 (lhs | rhs.c0, lhs | rhs.c1, lhs | rhs.c2); } + + + /// Returns the result of a componentwise bitwise exclusive or operation on two int3x3 matrices. + /// Left hand side int3x3 to use to compute componentwise bitwise exclusive or. + /// Right hand side int3x3 to use to compute componentwise bitwise exclusive or. + /// int3x3 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 operator ^ (int3x3 lhs, int3x3 rhs) { return new int3x3 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1, lhs.c2 ^ rhs.c2); } + + /// Returns the result of a componentwise bitwise exclusive or operation on an int3x3 matrix and an int value. + /// Left hand side int3x3 to use to compute componentwise bitwise exclusive or. + /// Right hand side int to use to compute componentwise bitwise exclusive or. + /// int3x3 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 operator ^ (int3x3 lhs, int rhs) { return new int3x3 (lhs.c0 ^ rhs, lhs.c1 ^ rhs, lhs.c2 ^ rhs); } + + /// Returns the result of a componentwise bitwise exclusive or operation on an int value and an int3x3 matrix. + /// Left hand side int to use to compute componentwise bitwise exclusive or. + /// Right hand side int3x3 to use to compute componentwise bitwise exclusive or. + /// int3x3 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 operator ^ (int lhs, int3x3 rhs) { return new int3x3 (lhs ^ rhs.c0, lhs ^ rhs.c1, lhs ^ rhs.c2); } + + + + /// Returns the int3 element at a specified index. + unsafe public ref int3 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 3) + throw new System.ArgumentException("index must be between[0...2]"); +#endif + fixed (int3x3* array = &this) { return ref ((int3*)array)[index]; } + } + } + + /// Returns true if the int3x3 is equal to a given int3x3, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(int3x3 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2); } + + /// Returns true if the int3x3 is equal to a given int3x3, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is int3x3 converted && Equals(converted); } + + + /// Returns a hash code for the int3x3. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the int3x3. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("int3x3({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8})", c0.x, c1.x, c2.x, c0.y, c1.y, c2.y, c0.z, c1.z, c2.z); + } + + /// Returns a string representation of the int3x3 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("int3x3({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8})", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c2.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c2.y.ToString(format, formatProvider), c0.z.ToString(format, formatProvider), c1.z.ToString(format, formatProvider), c2.z.ToString(format, formatProvider)); + } + + } + + public static partial class math + { + /// Returns a int3x3 matrix constructed from three int3 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// int3x3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 int3x3(int3 c0, int3 c1, int3 c2) { return new int3x3(c0, c1, c2); } + + /// Returns a int3x3 matrix constructed from from 9 int values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 2, column 2 will be set to this value. + /// int3x3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 int3x3(int m00, int m01, int m02, + int m10, int m11, int m12, + int m20, int m21, int m22) + { + return new int3x3(m00, m01, m02, + m10, m11, m12, + m20, m21, m22); + } + + /// Returns a int3x3 matrix constructed from a single int value by assigning it to every component. + /// int to convert to int3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 int3x3(int v) { return new int3x3(v); } + + /// Returns a int3x3 matrix constructed from a single bool value by converting it to int and assigning it to every component. + /// bool to convert to int3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 int3x3(bool v) { return new int3x3(v); } + + /// Return a int3x3 matrix constructed from a bool3x3 matrix by componentwise conversion. + /// bool3x3 to convert to int3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 int3x3(bool3x3 v) { return new int3x3(v); } + + /// Returns a int3x3 matrix constructed from a single uint value by converting it to int and assigning it to every component. + /// uint to convert to int3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 int3x3(uint v) { return new int3x3(v); } + + /// Return a int3x3 matrix constructed from a uint3x3 matrix by componentwise conversion. + /// uint3x3 to convert to int3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 int3x3(uint3x3 v) { return new int3x3(v); } + + /// Returns a int3x3 matrix constructed from a single float value by converting it to int and assigning it to every component. + /// float to convert to int3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 int3x3(float v) { return new int3x3(v); } + + /// Return a int3x3 matrix constructed from a float3x3 matrix by componentwise conversion. + /// float3x3 to convert to int3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 int3x3(float3x3 v) { return new int3x3(v); } + + /// Returns a int3x3 matrix constructed from a single double value by converting it to int and assigning it to every component. + /// double to convert to int3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 int3x3(double v) { return new int3x3(v); } + + /// Return a int3x3 matrix constructed from a double3x3 matrix by componentwise conversion. + /// double3x3 to convert to int3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 int3x3(double3x3 v) { return new int3x3(v); } + + /// Return the int3x3 transpose of a int3x3 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 transpose(int3x3 v) + { + return int3x3( + v.c0.x, v.c0.y, v.c0.z, + v.c1.x, v.c1.y, v.c1.z, + v.c2.x, v.c2.y, v.c2.z); + } + + /// Returns the determinant of a int3x3 matrix. + /// Matrix to use when computing determinant. + /// The determinant of the matrix. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int determinant(int3x3 m) + { + int3 c0 = m.c0; + int3 c1 = m.c1; + int3 c2 = m.c2; + + int m00 = c1.y * c2.z - c1.z * c2.y; + int m01 = c0.y * c2.z - c0.z * c2.y; + int m02 = c0.y * c1.z - c0.z * c1.y; + + return c0.x * m00 - c1.x * m01 + c2.x * m02; + } + + /// Returns a uint hash code of a int3x3 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(int3x3 v) + { + return csum(asuint(v.c0) * uint3(0x93C30C2Bu, 0xDCAF0351u, 0x6E050B01u) + + asuint(v.c1) * uint3(0x750FDBF5u, 0x7F3DD499u, 0x52EAAEBBu) + + asuint(v.c2) * uint3(0x4599C793u, 0x83B5E729u, 0xC267163Fu)) + 0x67BC9149u; + } + + /// + /// Returns a uint3 vector hash code of a int3x3 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint3 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 hashwide(int3x3 v) + { + return (asuint(v.c0) * uint3(0xAD7C5EC1u, 0x822A7D6Du, 0xB492BF15u) + + asuint(v.c1) * uint3(0xD37220E3u, 0x7AA2C2BDu, 0xE16BC89Du) + + asuint(v.c2) * uint3(0x7AA07CD3u, 0xAF642BA9u, 0xA8F2213Bu)) + 0x9F3FDC37u; + } + + } +} diff --git a/src/Unity.Mathematics/int3x3.gen.cs.meta b/src/Unity.Mathematics/int3x3.gen.cs.meta new file mode 100644 index 00000000..c29c0bc2 --- /dev/null +++ b/src/Unity.Mathematics/int3x3.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 217c0fb9c97594ff38dc97fdce4fc117 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/int3x4.gen.cs b/src/Unity.Mathematics/int3x4.gen.cs new file mode 100644 index 00000000..99a96e63 --- /dev/null +++ b/src/Unity.Mathematics/int3x4.gen.cs @@ -0,0 +1,767 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 3x4 matrix of ints. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct int3x4 : System.IEquatable, IFormattable + { + /// Column 0 of the matrix. + public int3 c0; + /// Column 1 of the matrix. + public int3 c1; + /// Column 2 of the matrix. + public int3 c2; + /// Column 3 of the matrix. + public int3 c3; + + /// int3x4 zero value. + public static readonly int3x4 zero; + + /// Constructs a int3x4 matrix from four int3 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// The matrix column c3 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3x4(int3 c0, int3 c1, int3 c2, int3 c3) + { + this.c0 = c0; + this.c1 = c1; + this.c2 = c2; + this.c3 = c3; + } + + /// Constructs a int3x4 matrix from 12 int values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 0, column 3 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 1, column 3 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 2, column 2 will be set to this value. + /// The matrix at row 2, column 3 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3x4(int m00, int m01, int m02, int m03, + int m10, int m11, int m12, int m13, + int m20, int m21, int m22, int m23) + { + this.c0 = new int3(m00, m10, m20); + this.c1 = new int3(m01, m11, m21); + this.c2 = new int3(m02, m12, m22); + this.c3 = new int3(m03, m13, m23); + } + + /// Constructs a int3x4 matrix from a single int value by assigning it to every component. + /// int to convert to int3x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3x4(int v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + this.c3 = v; + } + + /// Constructs a int3x4 matrix from a single bool value by converting it to int and assigning it to every component. + /// bool to convert to int3x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3x4(bool v) + { + this.c0 = math.select(new int3(0), new int3(1), v); + this.c1 = math.select(new int3(0), new int3(1), v); + this.c2 = math.select(new int3(0), new int3(1), v); + this.c3 = math.select(new int3(0), new int3(1), v); + } + + /// Constructs a int3x4 matrix from a bool3x4 matrix by componentwise conversion. + /// bool3x4 to convert to int3x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3x4(bool3x4 v) + { + this.c0 = math.select(new int3(0), new int3(1), v.c0); + this.c1 = math.select(new int3(0), new int3(1), v.c1); + this.c2 = math.select(new int3(0), new int3(1), v.c2); + this.c3 = math.select(new int3(0), new int3(1), v.c3); + } + + /// Constructs a int3x4 matrix from a single uint value by converting it to int and assigning it to every component. + /// uint to convert to int3x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3x4(uint v) + { + this.c0 = (int3)v; + this.c1 = (int3)v; + this.c2 = (int3)v; + this.c3 = (int3)v; + } + + /// Constructs a int3x4 matrix from a uint3x4 matrix by componentwise conversion. + /// uint3x4 to convert to int3x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3x4(uint3x4 v) + { + this.c0 = (int3)v.c0; + this.c1 = (int3)v.c1; + this.c2 = (int3)v.c2; + this.c3 = (int3)v.c3; + } + + /// Constructs a int3x4 matrix from a single float value by converting it to int and assigning it to every component. + /// float to convert to int3x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3x4(float v) + { + this.c0 = (int3)v; + this.c1 = (int3)v; + this.c2 = (int3)v; + this.c3 = (int3)v; + } + + /// Constructs a int3x4 matrix from a float3x4 matrix by componentwise conversion. + /// float3x4 to convert to int3x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3x4(float3x4 v) + { + this.c0 = (int3)v.c0; + this.c1 = (int3)v.c1; + this.c2 = (int3)v.c2; + this.c3 = (int3)v.c3; + } + + /// Constructs a int3x4 matrix from a single double value by converting it to int and assigning it to every component. + /// double to convert to int3x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3x4(double v) + { + this.c0 = (int3)v; + this.c1 = (int3)v; + this.c2 = (int3)v; + this.c3 = (int3)v; + } + + /// Constructs a int3x4 matrix from a double3x4 matrix by componentwise conversion. + /// double3x4 to convert to int3x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3x4(double3x4 v) + { + this.c0 = (int3)v.c0; + this.c1 = (int3)v.c1; + this.c2 = (int3)v.c2; + this.c3 = (int3)v.c3; + } + + + /// Implicitly converts a single int value to a int3x4 matrix by assigning it to every component. + /// int to convert to int3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator int3x4(int v) { return new int3x4(v); } + + /// Explicitly converts a single bool value to a int3x4 matrix by converting it to int and assigning it to every component. + /// bool to convert to int3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int3x4(bool v) { return new int3x4(v); } + + /// Explicitly converts a bool3x4 matrix to a int3x4 matrix by componentwise conversion. + /// bool3x4 to convert to int3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int3x4(bool3x4 v) { return new int3x4(v); } + + /// Explicitly converts a single uint value to a int3x4 matrix by converting it to int and assigning it to every component. + /// uint to convert to int3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int3x4(uint v) { return new int3x4(v); } + + /// Explicitly converts a uint3x4 matrix to a int3x4 matrix by componentwise conversion. + /// uint3x4 to convert to int3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int3x4(uint3x4 v) { return new int3x4(v); } + + /// Explicitly converts a single float value to a int3x4 matrix by converting it to int and assigning it to every component. + /// float to convert to int3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int3x4(float v) { return new int3x4(v); } + + /// Explicitly converts a float3x4 matrix to a int3x4 matrix by componentwise conversion. + /// float3x4 to convert to int3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int3x4(float3x4 v) { return new int3x4(v); } + + /// Explicitly converts a single double value to a int3x4 matrix by converting it to int and assigning it to every component. + /// double to convert to int3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int3x4(double v) { return new int3x4(v); } + + /// Explicitly converts a double3x4 matrix to a int3x4 matrix by componentwise conversion. + /// double3x4 to convert to int3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int3x4(double3x4 v) { return new int3x4(v); } + + + /// Returns the result of a componentwise multiplication operation on two int3x4 matrices. + /// Left hand side int3x4 to use to compute componentwise multiplication. + /// Right hand side int3x4 to use to compute componentwise multiplication. + /// int3x4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 operator * (int3x4 lhs, int3x4 rhs) { return new int3x4 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1, lhs.c2 * rhs.c2, lhs.c3 * rhs.c3); } + + /// Returns the result of a componentwise multiplication operation on an int3x4 matrix and an int value. + /// Left hand side int3x4 to use to compute componentwise multiplication. + /// Right hand side int to use to compute componentwise multiplication. + /// int3x4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 operator * (int3x4 lhs, int rhs) { return new int3x4 (lhs.c0 * rhs, lhs.c1 * rhs, lhs.c2 * rhs, lhs.c3 * rhs); } + + /// Returns the result of a componentwise multiplication operation on an int value and an int3x4 matrix. + /// Left hand side int to use to compute componentwise multiplication. + /// Right hand side int3x4 to use to compute componentwise multiplication. + /// int3x4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 operator * (int lhs, int3x4 rhs) { return new int3x4 (lhs * rhs.c0, lhs * rhs.c1, lhs * rhs.c2, lhs * rhs.c3); } + + + /// Returns the result of a componentwise addition operation on two int3x4 matrices. + /// Left hand side int3x4 to use to compute componentwise addition. + /// Right hand side int3x4 to use to compute componentwise addition. + /// int3x4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 operator + (int3x4 lhs, int3x4 rhs) { return new int3x4 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1, lhs.c2 + rhs.c2, lhs.c3 + rhs.c3); } + + /// Returns the result of a componentwise addition operation on an int3x4 matrix and an int value. + /// Left hand side int3x4 to use to compute componentwise addition. + /// Right hand side int to use to compute componentwise addition. + /// int3x4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 operator + (int3x4 lhs, int rhs) { return new int3x4 (lhs.c0 + rhs, lhs.c1 + rhs, lhs.c2 + rhs, lhs.c3 + rhs); } + + /// Returns the result of a componentwise addition operation on an int value and an int3x4 matrix. + /// Left hand side int to use to compute componentwise addition. + /// Right hand side int3x4 to use to compute componentwise addition. + /// int3x4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 operator + (int lhs, int3x4 rhs) { return new int3x4 (lhs + rhs.c0, lhs + rhs.c1, lhs + rhs.c2, lhs + rhs.c3); } + + + /// Returns the result of a componentwise subtraction operation on two int3x4 matrices. + /// Left hand side int3x4 to use to compute componentwise subtraction. + /// Right hand side int3x4 to use to compute componentwise subtraction. + /// int3x4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 operator - (int3x4 lhs, int3x4 rhs) { return new int3x4 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1, lhs.c2 - rhs.c2, lhs.c3 - rhs.c3); } + + /// Returns the result of a componentwise subtraction operation on an int3x4 matrix and an int value. + /// Left hand side int3x4 to use to compute componentwise subtraction. + /// Right hand side int to use to compute componentwise subtraction. + /// int3x4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 operator - (int3x4 lhs, int rhs) { return new int3x4 (lhs.c0 - rhs, lhs.c1 - rhs, lhs.c2 - rhs, lhs.c3 - rhs); } + + /// Returns the result of a componentwise subtraction operation on an int value and an int3x4 matrix. + /// Left hand side int to use to compute componentwise subtraction. + /// Right hand side int3x4 to use to compute componentwise subtraction. + /// int3x4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 operator - (int lhs, int3x4 rhs) { return new int3x4 (lhs - rhs.c0, lhs - rhs.c1, lhs - rhs.c2, lhs - rhs.c3); } + + + /// Returns the result of a componentwise division operation on two int3x4 matrices. + /// Left hand side int3x4 to use to compute componentwise division. + /// Right hand side int3x4 to use to compute componentwise division. + /// int3x4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 operator / (int3x4 lhs, int3x4 rhs) { return new int3x4 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1, lhs.c2 / rhs.c2, lhs.c3 / rhs.c3); } + + /// Returns the result of a componentwise division operation on an int3x4 matrix and an int value. + /// Left hand side int3x4 to use to compute componentwise division. + /// Right hand side int to use to compute componentwise division. + /// int3x4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 operator / (int3x4 lhs, int rhs) { return new int3x4 (lhs.c0 / rhs, lhs.c1 / rhs, lhs.c2 / rhs, lhs.c3 / rhs); } + + /// Returns the result of a componentwise division operation on an int value and an int3x4 matrix. + /// Left hand side int to use to compute componentwise division. + /// Right hand side int3x4 to use to compute componentwise division. + /// int3x4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 operator / (int lhs, int3x4 rhs) { return new int3x4 (lhs / rhs.c0, lhs / rhs.c1, lhs / rhs.c2, lhs / rhs.c3); } + + + /// Returns the result of a componentwise modulus operation on two int3x4 matrices. + /// Left hand side int3x4 to use to compute componentwise modulus. + /// Right hand side int3x4 to use to compute componentwise modulus. + /// int3x4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 operator % (int3x4 lhs, int3x4 rhs) { return new int3x4 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1, lhs.c2 % rhs.c2, lhs.c3 % rhs.c3); } + + /// Returns the result of a componentwise modulus operation on an int3x4 matrix and an int value. + /// Left hand side int3x4 to use to compute componentwise modulus. + /// Right hand side int to use to compute componentwise modulus. + /// int3x4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 operator % (int3x4 lhs, int rhs) { return new int3x4 (lhs.c0 % rhs, lhs.c1 % rhs, lhs.c2 % rhs, lhs.c3 % rhs); } + + /// Returns the result of a componentwise modulus operation on an int value and an int3x4 matrix. + /// Left hand side int to use to compute componentwise modulus. + /// Right hand side int3x4 to use to compute componentwise modulus. + /// int3x4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 operator % (int lhs, int3x4 rhs) { return new int3x4 (lhs % rhs.c0, lhs % rhs.c1, lhs % rhs.c2, lhs % rhs.c3); } + + + /// Returns the result of a componentwise increment operation on an int3x4 matrix. + /// Value to use when computing the componentwise increment. + /// int3x4 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 operator ++ (int3x4 val) { return new int3x4 (++val.c0, ++val.c1, ++val.c2, ++val.c3); } + + + /// Returns the result of a componentwise decrement operation on an int3x4 matrix. + /// Value to use when computing the componentwise decrement. + /// int3x4 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 operator -- (int3x4 val) { return new int3x4 (--val.c0, --val.c1, --val.c2, --val.c3); } + + + /// Returns the result of a componentwise less than operation on two int3x4 matrices. + /// Left hand side int3x4 to use to compute componentwise less than. + /// Right hand side int3x4 to use to compute componentwise less than. + /// bool3x4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator < (int3x4 lhs, int3x4 rhs) { return new bool3x4 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1, lhs.c2 < rhs.c2, lhs.c3 < rhs.c3); } + + /// Returns the result of a componentwise less than operation on an int3x4 matrix and an int value. + /// Left hand side int3x4 to use to compute componentwise less than. + /// Right hand side int to use to compute componentwise less than. + /// bool3x4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator < (int3x4 lhs, int rhs) { return new bool3x4 (lhs.c0 < rhs, lhs.c1 < rhs, lhs.c2 < rhs, lhs.c3 < rhs); } + + /// Returns the result of a componentwise less than operation on an int value and an int3x4 matrix. + /// Left hand side int to use to compute componentwise less than. + /// Right hand side int3x4 to use to compute componentwise less than. + /// bool3x4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator < (int lhs, int3x4 rhs) { return new bool3x4 (lhs < rhs.c0, lhs < rhs.c1, lhs < rhs.c2, lhs < rhs.c3); } + + + /// Returns the result of a componentwise less or equal operation on two int3x4 matrices. + /// Left hand side int3x4 to use to compute componentwise less or equal. + /// Right hand side int3x4 to use to compute componentwise less or equal. + /// bool3x4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator <= (int3x4 lhs, int3x4 rhs) { return new bool3x4 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1, lhs.c2 <= rhs.c2, lhs.c3 <= rhs.c3); } + + /// Returns the result of a componentwise less or equal operation on an int3x4 matrix and an int value. + /// Left hand side int3x4 to use to compute componentwise less or equal. + /// Right hand side int to use to compute componentwise less or equal. + /// bool3x4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator <= (int3x4 lhs, int rhs) { return new bool3x4 (lhs.c0 <= rhs, lhs.c1 <= rhs, lhs.c2 <= rhs, lhs.c3 <= rhs); } + + /// Returns the result of a componentwise less or equal operation on an int value and an int3x4 matrix. + /// Left hand side int to use to compute componentwise less or equal. + /// Right hand side int3x4 to use to compute componentwise less or equal. + /// bool3x4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator <= (int lhs, int3x4 rhs) { return new bool3x4 (lhs <= rhs.c0, lhs <= rhs.c1, lhs <= rhs.c2, lhs <= rhs.c3); } + + + /// Returns the result of a componentwise greater than operation on two int3x4 matrices. + /// Left hand side int3x4 to use to compute componentwise greater than. + /// Right hand side int3x4 to use to compute componentwise greater than. + /// bool3x4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator > (int3x4 lhs, int3x4 rhs) { return new bool3x4 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1, lhs.c2 > rhs.c2, lhs.c3 > rhs.c3); } + + /// Returns the result of a componentwise greater than operation on an int3x4 matrix and an int value. + /// Left hand side int3x4 to use to compute componentwise greater than. + /// Right hand side int to use to compute componentwise greater than. + /// bool3x4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator > (int3x4 lhs, int rhs) { return new bool3x4 (lhs.c0 > rhs, lhs.c1 > rhs, lhs.c2 > rhs, lhs.c3 > rhs); } + + /// Returns the result of a componentwise greater than operation on an int value and an int3x4 matrix. + /// Left hand side int to use to compute componentwise greater than. + /// Right hand side int3x4 to use to compute componentwise greater than. + /// bool3x4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator > (int lhs, int3x4 rhs) { return new bool3x4 (lhs > rhs.c0, lhs > rhs.c1, lhs > rhs.c2, lhs > rhs.c3); } + + + /// Returns the result of a componentwise greater or equal operation on two int3x4 matrices. + /// Left hand side int3x4 to use to compute componentwise greater or equal. + /// Right hand side int3x4 to use to compute componentwise greater or equal. + /// bool3x4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator >= (int3x4 lhs, int3x4 rhs) { return new bool3x4 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1, lhs.c2 >= rhs.c2, lhs.c3 >= rhs.c3); } + + /// Returns the result of a componentwise greater or equal operation on an int3x4 matrix and an int value. + /// Left hand side int3x4 to use to compute componentwise greater or equal. + /// Right hand side int to use to compute componentwise greater or equal. + /// bool3x4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator >= (int3x4 lhs, int rhs) { return new bool3x4 (lhs.c0 >= rhs, lhs.c1 >= rhs, lhs.c2 >= rhs, lhs.c3 >= rhs); } + + /// Returns the result of a componentwise greater or equal operation on an int value and an int3x4 matrix. + /// Left hand side int to use to compute componentwise greater or equal. + /// Right hand side int3x4 to use to compute componentwise greater or equal. + /// bool3x4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator >= (int lhs, int3x4 rhs) { return new bool3x4 (lhs >= rhs.c0, lhs >= rhs.c1, lhs >= rhs.c2, lhs >= rhs.c3); } + + + /// Returns the result of a componentwise unary minus operation on an int3x4 matrix. + /// Value to use when computing the componentwise unary minus. + /// int3x4 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 operator - (int3x4 val) { return new int3x4 (-val.c0, -val.c1, -val.c2, -val.c3); } + + + /// Returns the result of a componentwise unary plus operation on an int3x4 matrix. + /// Value to use when computing the componentwise unary plus. + /// int3x4 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 operator + (int3x4 val) { return new int3x4 (+val.c0, +val.c1, +val.c2, +val.c3); } + + + /// Returns the result of a componentwise left shift operation on an int3x4 matrix by a number of bits specified by a single int. + /// The matrix to left shift. + /// The number of bits to left shift. + /// The result of the componentwise left shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 operator << (int3x4 x, int n) { return new int3x4 (x.c0 << n, x.c1 << n, x.c2 << n, x.c3 << n); } + + /// Returns the result of a componentwise right shift operation on an int3x4 matrix by a number of bits specified by a single int. + /// The matrix to right shift. + /// The number of bits to right shift. + /// The result of the componentwise right shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 operator >> (int3x4 x, int n) { return new int3x4 (x.c0 >> n, x.c1 >> n, x.c2 >> n, x.c3 >> n); } + + /// Returns the result of a componentwise equality operation on two int3x4 matrices. + /// Left hand side int3x4 to use to compute componentwise equality. + /// Right hand side int3x4 to use to compute componentwise equality. + /// bool3x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator == (int3x4 lhs, int3x4 rhs) { return new bool3x4 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2, lhs.c3 == rhs.c3); } + + /// Returns the result of a componentwise equality operation on an int3x4 matrix and an int value. + /// Left hand side int3x4 to use to compute componentwise equality. + /// Right hand side int to use to compute componentwise equality. + /// bool3x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator == (int3x4 lhs, int rhs) { return new bool3x4 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs, lhs.c3 == rhs); } + + /// Returns the result of a componentwise equality operation on an int value and an int3x4 matrix. + /// Left hand side int to use to compute componentwise equality. + /// Right hand side int3x4 to use to compute componentwise equality. + /// bool3x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator == (int lhs, int3x4 rhs) { return new bool3x4 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2, lhs == rhs.c3); } + + + /// Returns the result of a componentwise not equal operation on two int3x4 matrices. + /// Left hand side int3x4 to use to compute componentwise not equal. + /// Right hand side int3x4 to use to compute componentwise not equal. + /// bool3x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator != (int3x4 lhs, int3x4 rhs) { return new bool3x4 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2, lhs.c3 != rhs.c3); } + + /// Returns the result of a componentwise not equal operation on an int3x4 matrix and an int value. + /// Left hand side int3x4 to use to compute componentwise not equal. + /// Right hand side int to use to compute componentwise not equal. + /// bool3x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator != (int3x4 lhs, int rhs) { return new bool3x4 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs, lhs.c3 != rhs); } + + /// Returns the result of a componentwise not equal operation on an int value and an int3x4 matrix. + /// Left hand side int to use to compute componentwise not equal. + /// Right hand side int3x4 to use to compute componentwise not equal. + /// bool3x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator != (int lhs, int3x4 rhs) { return new bool3x4 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2, lhs != rhs.c3); } + + + /// Returns the result of a componentwise bitwise not operation on an int3x4 matrix. + /// Value to use when computing the componentwise bitwise not. + /// int3x4 result of the componentwise bitwise not. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 operator ~ (int3x4 val) { return new int3x4 (~val.c0, ~val.c1, ~val.c2, ~val.c3); } + + + /// Returns the result of a componentwise bitwise and operation on two int3x4 matrices. + /// Left hand side int3x4 to use to compute componentwise bitwise and. + /// Right hand side int3x4 to use to compute componentwise bitwise and. + /// int3x4 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 operator & (int3x4 lhs, int3x4 rhs) { return new int3x4 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1, lhs.c2 & rhs.c2, lhs.c3 & rhs.c3); } + + /// Returns the result of a componentwise bitwise and operation on an int3x4 matrix and an int value. + /// Left hand side int3x4 to use to compute componentwise bitwise and. + /// Right hand side int to use to compute componentwise bitwise and. + /// int3x4 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 operator & (int3x4 lhs, int rhs) { return new int3x4 (lhs.c0 & rhs, lhs.c1 & rhs, lhs.c2 & rhs, lhs.c3 & rhs); } + + /// Returns the result of a componentwise bitwise and operation on an int value and an int3x4 matrix. + /// Left hand side int to use to compute componentwise bitwise and. + /// Right hand side int3x4 to use to compute componentwise bitwise and. + /// int3x4 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 operator & (int lhs, int3x4 rhs) { return new int3x4 (lhs & rhs.c0, lhs & rhs.c1, lhs & rhs.c2, lhs & rhs.c3); } + + + /// Returns the result of a componentwise bitwise or operation on two int3x4 matrices. + /// Left hand side int3x4 to use to compute componentwise bitwise or. + /// Right hand side int3x4 to use to compute componentwise bitwise or. + /// int3x4 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 operator | (int3x4 lhs, int3x4 rhs) { return new int3x4 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1, lhs.c2 | rhs.c2, lhs.c3 | rhs.c3); } + + /// Returns the result of a componentwise bitwise or operation on an int3x4 matrix and an int value. + /// Left hand side int3x4 to use to compute componentwise bitwise or. + /// Right hand side int to use to compute componentwise bitwise or. + /// int3x4 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 operator | (int3x4 lhs, int rhs) { return new int3x4 (lhs.c0 | rhs, lhs.c1 | rhs, lhs.c2 | rhs, lhs.c3 | rhs); } + + /// Returns the result of a componentwise bitwise or operation on an int value and an int3x4 matrix. + /// Left hand side int to use to compute componentwise bitwise or. + /// Right hand side int3x4 to use to compute componentwise bitwise or. + /// int3x4 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 operator | (int lhs, int3x4 rhs) { return new int3x4 (lhs | rhs.c0, lhs | rhs.c1, lhs | rhs.c2, lhs | rhs.c3); } + + + /// Returns the result of a componentwise bitwise exclusive or operation on two int3x4 matrices. + /// Left hand side int3x4 to use to compute componentwise bitwise exclusive or. + /// Right hand side int3x4 to use to compute componentwise bitwise exclusive or. + /// int3x4 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 operator ^ (int3x4 lhs, int3x4 rhs) { return new int3x4 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1, lhs.c2 ^ rhs.c2, lhs.c3 ^ rhs.c3); } + + /// Returns the result of a componentwise bitwise exclusive or operation on an int3x4 matrix and an int value. + /// Left hand side int3x4 to use to compute componentwise bitwise exclusive or. + /// Right hand side int to use to compute componentwise bitwise exclusive or. + /// int3x4 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 operator ^ (int3x4 lhs, int rhs) { return new int3x4 (lhs.c0 ^ rhs, lhs.c1 ^ rhs, lhs.c2 ^ rhs, lhs.c3 ^ rhs); } + + /// Returns the result of a componentwise bitwise exclusive or operation on an int value and an int3x4 matrix. + /// Left hand side int to use to compute componentwise bitwise exclusive or. + /// Right hand side int3x4 to use to compute componentwise bitwise exclusive or. + /// int3x4 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 operator ^ (int lhs, int3x4 rhs) { return new int3x4 (lhs ^ rhs.c0, lhs ^ rhs.c1, lhs ^ rhs.c2, lhs ^ rhs.c3); } + + + + /// Returns the int3 element at a specified index. + unsafe public ref int3 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 4) + throw new System.ArgumentException("index must be between[0...3]"); +#endif + fixed (int3x4* array = &this) { return ref ((int3*)array)[index]; } + } + } + + /// Returns true if the int3x4 is equal to a given int3x4, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(int3x4 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2) && c3.Equals(rhs.c3); } + + /// Returns true if the int3x4 is equal to a given int3x4, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is int3x4 converted && Equals(converted); } + + + /// Returns a hash code for the int3x4. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the int3x4. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("int3x4({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11})", c0.x, c1.x, c2.x, c3.x, c0.y, c1.y, c2.y, c3.y, c0.z, c1.z, c2.z, c3.z); + } + + /// Returns a string representation of the int3x4 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("int3x4({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11})", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c2.x.ToString(format, formatProvider), c3.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c2.y.ToString(format, formatProvider), c3.y.ToString(format, formatProvider), c0.z.ToString(format, formatProvider), c1.z.ToString(format, formatProvider), c2.z.ToString(format, formatProvider), c3.z.ToString(format, formatProvider)); + } + + } + + public static partial class math + { + /// Returns a int3x4 matrix constructed from four int3 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// The matrix column c3 will be set to this value. + /// int3x4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 int3x4(int3 c0, int3 c1, int3 c2, int3 c3) { return new int3x4(c0, c1, c2, c3); } + + /// Returns a int3x4 matrix constructed from from 12 int values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 0, column 3 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 1, column 3 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 2, column 2 will be set to this value. + /// The matrix at row 2, column 3 will be set to this value. + /// int3x4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 int3x4(int m00, int m01, int m02, int m03, + int m10, int m11, int m12, int m13, + int m20, int m21, int m22, int m23) + { + return new int3x4(m00, m01, m02, m03, + m10, m11, m12, m13, + m20, m21, m22, m23); + } + + /// Returns a int3x4 matrix constructed from a single int value by assigning it to every component. + /// int to convert to int3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 int3x4(int v) { return new int3x4(v); } + + /// Returns a int3x4 matrix constructed from a single bool value by converting it to int and assigning it to every component. + /// bool to convert to int3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 int3x4(bool v) { return new int3x4(v); } + + /// Return a int3x4 matrix constructed from a bool3x4 matrix by componentwise conversion. + /// bool3x4 to convert to int3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 int3x4(bool3x4 v) { return new int3x4(v); } + + /// Returns a int3x4 matrix constructed from a single uint value by converting it to int and assigning it to every component. + /// uint to convert to int3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 int3x4(uint v) { return new int3x4(v); } + + /// Return a int3x4 matrix constructed from a uint3x4 matrix by componentwise conversion. + /// uint3x4 to convert to int3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 int3x4(uint3x4 v) { return new int3x4(v); } + + /// Returns a int3x4 matrix constructed from a single float value by converting it to int and assigning it to every component. + /// float to convert to int3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 int3x4(float v) { return new int3x4(v); } + + /// Return a int3x4 matrix constructed from a float3x4 matrix by componentwise conversion. + /// float3x4 to convert to int3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 int3x4(float3x4 v) { return new int3x4(v); } + + /// Returns a int3x4 matrix constructed from a single double value by converting it to int and assigning it to every component. + /// double to convert to int3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 int3x4(double v) { return new int3x4(v); } + + /// Return a int3x4 matrix constructed from a double3x4 matrix by componentwise conversion. + /// double3x4 to convert to int3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 int3x4(double3x4 v) { return new int3x4(v); } + + /// Return the int4x3 transpose of a int3x4 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 transpose(int3x4 v) + { + return int4x3( + v.c0.x, v.c0.y, v.c0.z, + v.c1.x, v.c1.y, v.c1.z, + v.c2.x, v.c2.y, v.c2.z, + v.c3.x, v.c3.y, v.c3.z); + } + + /// Returns a uint hash code of a int3x4 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(int3x4 v) + { + return csum(asuint(v.c0) * uint3(0x5AB3E8CDu, 0x676E8407u, 0xB36DE767u) + + asuint(v.c1) * uint3(0x6FCA387Du, 0xAF0F3103u, 0xE4A056C7u) + + asuint(v.c2) * uint3(0x841D8225u, 0xC9393C7Du, 0xD42EAFA3u) + + asuint(v.c3) * uint3(0xD9AFD06Du, 0x97A65421u, 0x7809205Fu)) + 0x9C9F0823u; + } + + /// + /// Returns a uint3 vector hash code of a int3x4 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint3 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 hashwide(int3x4 v) + { + return (asuint(v.c0) * uint3(0x5A9CA13Bu, 0xAFCDD5EFu, 0xA88D187Du) + + asuint(v.c1) * uint3(0xCF6EBA1Du, 0x9D88E5A1u, 0xEADF0775u) + + asuint(v.c2) * uint3(0x747A9D7Bu, 0x4111F799u, 0xB5F05AF1u) + + asuint(v.c3) * uint3(0xFD80290Bu, 0x8B65ADB7u, 0xDFF4F563u)) + 0x7069770Du; + } + + } +} diff --git a/src/Unity.Mathematics/int3x4.gen.cs.meta b/src/Unity.Mathematics/int3x4.gen.cs.meta new file mode 100644 index 00000000..2a14dc2a --- /dev/null +++ b/src/Unity.Mathematics/int3x4.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 67f00d3260d3e46778497ed1e2b93c92 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/int4.cs b/src/Unity.Mathematics/int4.cs deleted file mode 100644 index e25100ea..00000000 --- a/src/Unity.Mathematics/int4.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System.Runtime.CompilerServices; -using System.Diagnostics; - -#pragma warning disable 0660, 0661 - -namespace Unity.Mathematics -{ - [DebuggerTypeProxy(typeof(int4.DebuggerProxy))] - [System.Serializable] - public partial struct int4 - { - internal sealed class DebuggerProxy - { - public int x; - public int y; - public int z; - public int w; - - public DebuggerProxy(int4 vec) - { - x = vec.x; - y = vec.y; - z = vec.z; - w = vec.z; - } - } - - public int x; - public int y; - public int z; - public int w; - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public int4(int x, int y, int z, int w) - { - this.x = x; - this.y = y; - this.z = z; - this.w = w; - } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public int4(int val) { x = y = z = w = val; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public int4(int3 xyz, int w) { this.x = xyz.x; this.y = xyz.y; this.z = xyz.z; this.w = w; } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public int4(float4 val) { x = (int)val.x; y = (int)val.y; z = (int)val.z; w = (int)val.w; } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static implicit operator int4(int d) { return new int4(d); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static explicit operator int4(float4 d) { return new int4((int)d.x, (int)d.y, (int)d.z, (int)d.w); } - - public override string ToString() - { - return string.Format("int4({0}, {1}, {2}, {3})", x, y, z, w); - } - } -} - diff --git a/src/Unity.Mathematics/int4.cs.meta b/src/Unity.Mathematics/int4.cs.meta deleted file mode 100644 index f4df5bd1..00000000 --- a/src/Unity.Mathematics/int4.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: ce36a7dd0945ab1459463d53ab8f27b7 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/src/Unity.Mathematics/int4.gen.cs b/src/Unity.Mathematics/int4.gen.cs index e7052933..495d2f93 100644 --- a/src/Unity.Mathematics/int4.gen.cs +++ b/src/Unity.Mathematics/int4.gen.cs @@ -1,2959 +1,4093 @@ -// GENERATED CODE +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; using System.Runtime.CompilerServices; +using System.Diagnostics; +using Unity.IL2CPP.CompilerServices; + #pragma warning disable 0660, 0661 + namespace Unity.Mathematics { - public partial struct int4 : System.IEquatable + /// A 4 component vector of ints. + [DebuggerTypeProxy(typeof(int4.DebuggerProxy))] + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct int4 : System.IEquatable, IFormattable { + /// x component of the vector. + public int x; + /// y component of the vector. + public int y; + /// z component of the vector. + public int z; + /// w component of the vector. + public int w; + + /// int4 zero value. + public static readonly int4 zero; + + /// Constructs a int4 vector from four int values. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + /// The constructed vector's z component will be set to this value. + /// The constructed vector's w component will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4(int x, int y, int z, int w) + { + this.x = x; + this.y = y; + this.z = z; + this.w = w; + } + + /// Constructs a int4 vector from two int values and an int2 vector. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + /// The constructed vector's zw components will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4(int x, int y, int2 zw) + { + this.x = x; + this.y = y; + this.z = zw.x; + this.w = zw.y; + } + + /// Constructs a int4 vector from an int value, an int2 vector and an int value. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's yz components will be set to this value. + /// The constructed vector's w component will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4(int x, int2 yz, int w) + { + this.x = x; + this.y = yz.x; + this.z = yz.y; + this.w = w; + } + + /// Constructs a int4 vector from an int value and an int3 vector. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's yzw components will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4(int x, int3 yzw) + { + this.x = x; + this.y = yzw.x; + this.z = yzw.y; + this.w = yzw.z; + } + + /// Constructs a int4 vector from an int2 vector and two int values. + /// The constructed vector's xy components will be set to this value. + /// The constructed vector's z component will be set to this value. + /// The constructed vector's w component will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4(int2 xy, int z, int w) + { + this.x = xy.x; + this.y = xy.y; + this.z = z; + this.w = w; + } + + /// Constructs a int4 vector from two int2 vectors. + /// The constructed vector's xy components will be set to this value. + /// The constructed vector's zw components will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4(int2 xy, int2 zw) + { + this.x = xy.x; + this.y = xy.y; + this.z = zw.x; + this.w = zw.y; + } + + /// Constructs a int4 vector from an int3 vector and an int value. + /// The constructed vector's xyz components will be set to this value. + /// The constructed vector's w component will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4(int3 xyz, int w) + { + this.x = xyz.x; + this.y = xyz.y; + this.z = xyz.z; + this.w = w; + } - // mul - [MethodImpl(0x100)] + /// Constructs a int4 vector from an int4 vector. + /// The constructed vector's xyzw components will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4(int4 xyzw) + { + this.x = xyzw.x; + this.y = xyzw.y; + this.z = xyzw.z; + this.w = xyzw.w; + } + + /// Constructs a int4 vector from a single int value by assigning it to every component. + /// int to convert to int4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4(int v) + { + this.x = v; + this.y = v; + this.z = v; + this.w = v; + } + + /// Constructs a int4 vector from a single bool value by converting it to int and assigning it to every component. + /// bool to convert to int4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4(bool v) + { + this.x = v ? 1 : 0; + this.y = v ? 1 : 0; + this.z = v ? 1 : 0; + this.w = v ? 1 : 0; + } + + /// Constructs a int4 vector from a bool4 vector by componentwise conversion. + /// bool4 to convert to int4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4(bool4 v) + { + this.x = v.x ? 1 : 0; + this.y = v.y ? 1 : 0; + this.z = v.z ? 1 : 0; + this.w = v.w ? 1 : 0; + } + + /// Constructs a int4 vector from a single uint value by converting it to int and assigning it to every component. + /// uint to convert to int4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4(uint v) + { + this.x = (int)v; + this.y = (int)v; + this.z = (int)v; + this.w = (int)v; + } + + /// Constructs a int4 vector from a uint4 vector by componentwise conversion. + /// uint4 to convert to int4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4(uint4 v) + { + this.x = (int)v.x; + this.y = (int)v.y; + this.z = (int)v.z; + this.w = (int)v.w; + } + + /// Constructs a int4 vector from a single float value by converting it to int and assigning it to every component. + /// float to convert to int4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4(float v) + { + this.x = (int)v; + this.y = (int)v; + this.z = (int)v; + this.w = (int)v; + } + + /// Constructs a int4 vector from a float4 vector by componentwise conversion. + /// float4 to convert to int4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4(float4 v) + { + this.x = (int)v.x; + this.y = (int)v.y; + this.z = (int)v.z; + this.w = (int)v.w; + } + + /// Constructs a int4 vector from a single double value by converting it to int and assigning it to every component. + /// double to convert to int4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4(double v) + { + this.x = (int)v; + this.y = (int)v; + this.z = (int)v; + this.w = (int)v; + } + + /// Constructs a int4 vector from a double4 vector by componentwise conversion. + /// double4 to convert to int4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4(double4 v) + { + this.x = (int)v.x; + this.y = (int)v.y; + this.z = (int)v.z; + this.w = (int)v.w; + } + + + /// Implicitly converts a single int value to a int4 vector by assigning it to every component. + /// int to convert to int4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator int4(int v) { return new int4(v); } + + /// Explicitly converts a single bool value to a int4 vector by converting it to int and assigning it to every component. + /// bool to convert to int4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int4(bool v) { return new int4(v); } + + /// Explicitly converts a bool4 vector to a int4 vector by componentwise conversion. + /// bool4 to convert to int4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int4(bool4 v) { return new int4(v); } + + /// Explicitly converts a single uint value to a int4 vector by converting it to int and assigning it to every component. + /// uint to convert to int4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int4(uint v) { return new int4(v); } + + /// Explicitly converts a uint4 vector to a int4 vector by componentwise conversion. + /// uint4 to convert to int4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int4(uint4 v) { return new int4(v); } + + /// Explicitly converts a single float value to a int4 vector by converting it to int and assigning it to every component. + /// float to convert to int4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int4(float v) { return new int4(v); } + + /// Explicitly converts a float4 vector to a int4 vector by componentwise conversion. + /// float4 to convert to int4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int4(float4 v) { return new int4(v); } + + /// Explicitly converts a single double value to a int4 vector by converting it to int and assigning it to every component. + /// double to convert to int4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int4(double v) { return new int4(v); } + + /// Explicitly converts a double4 vector to a int4 vector by componentwise conversion. + /// double4 to convert to int4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int4(double4 v) { return new int4(v); } + + + /// Returns the result of a componentwise multiplication operation on two int4 vectors. + /// Left hand side int4 to use to compute componentwise multiplication. + /// Right hand side int4 to use to compute componentwise multiplication. + /// int4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int4 operator * (int4 lhs, int4 rhs) { return new int4 (lhs.x * rhs.x, lhs.y * rhs.y, lhs.z * rhs.z, lhs.w * rhs.w); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise multiplication operation on an int4 vector and an int value. + /// Left hand side int4 to use to compute componentwise multiplication. + /// Right hand side int to use to compute componentwise multiplication. + /// int4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int4 operator * (int4 lhs, int rhs) { return new int4 (lhs.x * rhs, lhs.y * rhs, lhs.z * rhs, lhs.w * rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise multiplication operation on an int value and an int4 vector. + /// Left hand side int to use to compute componentwise multiplication. + /// Right hand side int4 to use to compute componentwise multiplication. + /// int4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int4 operator * (int lhs, int4 rhs) { return new int4 (lhs * rhs.x, lhs * rhs.y, lhs * rhs.z, lhs * rhs.w); } - // add - [MethodImpl(0x100)] + + /// Returns the result of a componentwise addition operation on two int4 vectors. + /// Left hand side int4 to use to compute componentwise addition. + /// Right hand side int4 to use to compute componentwise addition. + /// int4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int4 operator + (int4 lhs, int4 rhs) { return new int4 (lhs.x + rhs.x, lhs.y + rhs.y, lhs.z + rhs.z, lhs.w + rhs.w); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise addition operation on an int4 vector and an int value. + /// Left hand side int4 to use to compute componentwise addition. + /// Right hand side int to use to compute componentwise addition. + /// int4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int4 operator + (int4 lhs, int rhs) { return new int4 (lhs.x + rhs, lhs.y + rhs, lhs.z + rhs, lhs.w + rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise addition operation on an int value and an int4 vector. + /// Left hand side int to use to compute componentwise addition. + /// Right hand side int4 to use to compute componentwise addition. + /// int4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int4 operator + (int lhs, int4 rhs) { return new int4 (lhs + rhs.x, lhs + rhs.y, lhs + rhs.z, lhs + rhs.w); } - // sub - [MethodImpl(0x100)] + + /// Returns the result of a componentwise subtraction operation on two int4 vectors. + /// Left hand side int4 to use to compute componentwise subtraction. + /// Right hand side int4 to use to compute componentwise subtraction. + /// int4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int4 operator - (int4 lhs, int4 rhs) { return new int4 (lhs.x - rhs.x, lhs.y - rhs.y, lhs.z - rhs.z, lhs.w - rhs.w); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise subtraction operation on an int4 vector and an int value. + /// Left hand side int4 to use to compute componentwise subtraction. + /// Right hand side int to use to compute componentwise subtraction. + /// int4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int4 operator - (int4 lhs, int rhs) { return new int4 (lhs.x - rhs, lhs.y - rhs, lhs.z - rhs, lhs.w - rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise subtraction operation on an int value and an int4 vector. + /// Left hand side int to use to compute componentwise subtraction. + /// Right hand side int4 to use to compute componentwise subtraction. + /// int4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int4 operator - (int lhs, int4 rhs) { return new int4 (lhs - rhs.x, lhs - rhs.y, lhs - rhs.z, lhs - rhs.w); } - // div - [MethodImpl(0x100)] + + /// Returns the result of a componentwise division operation on two int4 vectors. + /// Left hand side int4 to use to compute componentwise division. + /// Right hand side int4 to use to compute componentwise division. + /// int4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int4 operator / (int4 lhs, int4 rhs) { return new int4 (lhs.x / rhs.x, lhs.y / rhs.y, lhs.z / rhs.z, lhs.w / rhs.w); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise division operation on an int4 vector and an int value. + /// Left hand side int4 to use to compute componentwise division. + /// Right hand side int to use to compute componentwise division. + /// int4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int4 operator / (int4 lhs, int rhs) { return new int4 (lhs.x / rhs, lhs.y / rhs, lhs.z / rhs, lhs.w / rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise division operation on an int value and an int4 vector. + /// Left hand side int to use to compute componentwise division. + /// Right hand side int4 to use to compute componentwise division. + /// int4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int4 operator / (int lhs, int4 rhs) { return new int4 (lhs / rhs.x, lhs / rhs.y, lhs / rhs.z, lhs / rhs.w); } - // smaller - [MethodImpl(0x100)] + + /// Returns the result of a componentwise modulus operation on two int4 vectors. + /// Left hand side int4 to use to compute componentwise modulus. + /// Right hand side int4 to use to compute componentwise modulus. + /// int4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 operator % (int4 lhs, int4 rhs) { return new int4 (lhs.x % rhs.x, lhs.y % rhs.y, lhs.z % rhs.z, lhs.w % rhs.w); } + + /// Returns the result of a componentwise modulus operation on an int4 vector and an int value. + /// Left hand side int4 to use to compute componentwise modulus. + /// Right hand side int to use to compute componentwise modulus. + /// int4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 operator % (int4 lhs, int rhs) { return new int4 (lhs.x % rhs, lhs.y % rhs, lhs.z % rhs, lhs.w % rhs); } + + /// Returns the result of a componentwise modulus operation on an int value and an int4 vector. + /// Left hand side int to use to compute componentwise modulus. + /// Right hand side int4 to use to compute componentwise modulus. + /// int4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 operator % (int lhs, int4 rhs) { return new int4 (lhs % rhs.x, lhs % rhs.y, lhs % rhs.z, lhs % rhs.w); } + + + /// Returns the result of a componentwise increment operation on an int4 vector. + /// Value to use when computing the componentwise increment. + /// int4 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 operator ++ (int4 val) { return new int4 (++val.x, ++val.y, ++val.z, ++val.w); } + + + /// Returns the result of a componentwise decrement operation on an int4 vector. + /// Value to use when computing the componentwise decrement. + /// int4 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 operator -- (int4 val) { return new int4 (--val.x, --val.y, --val.z, --val.w); } + + + /// Returns the result of a componentwise less than operation on two int4 vectors. + /// Left hand side int4 to use to compute componentwise less than. + /// Right hand side int4 to use to compute componentwise less than. + /// bool4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator < (int4 lhs, int4 rhs) { return new bool4 (lhs.x < rhs.x, lhs.y < rhs.y, lhs.z < rhs.z, lhs.w < rhs.w); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise less than operation on an int4 vector and an int value. + /// Left hand side int4 to use to compute componentwise less than. + /// Right hand side int to use to compute componentwise less than. + /// bool4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator < (int4 lhs, int rhs) { return new bool4 (lhs.x < rhs, lhs.y < rhs, lhs.z < rhs, lhs.w < rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise less than operation on an int value and an int4 vector. + /// Left hand side int to use to compute componentwise less than. + /// Right hand side int4 to use to compute componentwise less than. + /// bool4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator < (int lhs, int4 rhs) { return new bool4 (lhs < rhs.x, lhs < rhs.y, lhs < rhs.z, lhs < rhs.w); } - [MethodImpl(0x100)] + + + /// Returns the result of a componentwise less or equal operation on two int4 vectors. + /// Left hand side int4 to use to compute componentwise less or equal. + /// Right hand side int4 to use to compute componentwise less or equal. + /// bool4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator <= (int4 lhs, int4 rhs) { return new bool4 (lhs.x <= rhs.x, lhs.y <= rhs.y, lhs.z <= rhs.z, lhs.w <= rhs.w); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise less or equal operation on an int4 vector and an int value. + /// Left hand side int4 to use to compute componentwise less or equal. + /// Right hand side int to use to compute componentwise less or equal. + /// bool4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator <= (int4 lhs, int rhs) { return new bool4 (lhs.x <= rhs, lhs.y <= rhs, lhs.z <= rhs, lhs.w <= rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise less or equal operation on an int value and an int4 vector. + /// Left hand side int to use to compute componentwise less or equal. + /// Right hand side int4 to use to compute componentwise less or equal. + /// bool4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator <= (int lhs, int4 rhs) { return new bool4 (lhs <= rhs.x, lhs <= rhs.y, lhs <= rhs.z, lhs <= rhs.w); } - // greater - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater than operation on two int4 vectors. + /// Left hand side int4 to use to compute componentwise greater than. + /// Right hand side int4 to use to compute componentwise greater than. + /// bool4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator > (int4 lhs, int4 rhs) { return new bool4 (lhs.x > rhs.x, lhs.y > rhs.y, lhs.z > rhs.z, lhs.w > rhs.w); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater than operation on an int4 vector and an int value. + /// Left hand side int4 to use to compute componentwise greater than. + /// Right hand side int to use to compute componentwise greater than. + /// bool4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator > (int4 lhs, int rhs) { return new bool4 (lhs.x > rhs, lhs.y > rhs, lhs.z > rhs, lhs.w > rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater than operation on an int value and an int4 vector. + /// Left hand side int to use to compute componentwise greater than. + /// Right hand side int4 to use to compute componentwise greater than. + /// bool4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator > (int lhs, int4 rhs) { return new bool4 (lhs > rhs.x, lhs > rhs.y, lhs > rhs.z, lhs > rhs.w); } - [MethodImpl(0x100)] + + + /// Returns the result of a componentwise greater or equal operation on two int4 vectors. + /// Left hand side int4 to use to compute componentwise greater or equal. + /// Right hand side int4 to use to compute componentwise greater or equal. + /// bool4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator >= (int4 lhs, int4 rhs) { return new bool4 (lhs.x >= rhs.x, lhs.y >= rhs.y, lhs.z >= rhs.z, lhs.w >= rhs.w); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater or equal operation on an int4 vector and an int value. + /// Left hand side int4 to use to compute componentwise greater or equal. + /// Right hand side int to use to compute componentwise greater or equal. + /// bool4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator >= (int4 lhs, int rhs) { return new bool4 (lhs.x >= rhs, lhs.y >= rhs, lhs.z >= rhs, lhs.w >= rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater or equal operation on an int value and an int4 vector. + /// Left hand side int to use to compute componentwise greater or equal. + /// Right hand side int4 to use to compute componentwise greater or equal. + /// bool4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator >= (int lhs, int4 rhs) { return new bool4 (lhs >= rhs.x, lhs >= rhs.y, lhs >= rhs.z, lhs >= rhs.w); } - // neg - [MethodImpl(0x100)] + + /// Returns the result of a componentwise unary minus operation on an int4 vector. + /// Value to use when computing the componentwise unary minus. + /// int4 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int4 operator - (int4 val) { return new int4 (-val.x, -val.y, -val.z, -val.w); } - // plus - [MethodImpl(0x100)] + + + /// Returns the result of a componentwise unary plus operation on an int4 vector. + /// Value to use when computing the componentwise unary plus. + /// int4 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int4 operator + (int4 val) { return new int4 (+val.x, +val.y, +val.z, +val.w); } - // left shift - [MethodImpl(0x100)] - public static int4 operator << (int4 lhs, int rhs) { return new int4 (lhs.x << rhs, lhs.y << rhs, lhs.z << rhs, lhs.w << rhs); } - // right shift - [MethodImpl(0x100)] - public static int4 operator >> (int4 lhs, int rhs) { return new int4 (lhs.x >> rhs, lhs.y >> rhs, lhs.z >> rhs, lhs.w >> rhs); } - // equal - [MethodImpl(0x100)] + /// Returns the result of a componentwise left shift operation on an int4 vector by a number of bits specified by a single int. + /// The vector to left shift. + /// The number of bits to left shift. + /// The result of the componentwise left shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 operator << (int4 x, int n) { return new int4 (x.x << n, x.y << n, x.z << n, x.w << n); } + + /// Returns the result of a componentwise right shift operation on an int4 vector by a number of bits specified by a single int. + /// The vector to right shift. + /// The number of bits to right shift. + /// The result of the componentwise right shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 operator >> (int4 x, int n) { return new int4 (x.x >> n, x.y >> n, x.z >> n, x.w >> n); } + + /// Returns the result of a componentwise equality operation on two int4 vectors. + /// Left hand side int4 to use to compute componentwise equality. + /// Right hand side int4 to use to compute componentwise equality. + /// bool4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator == (int4 lhs, int4 rhs) { return new bool4 (lhs.x == rhs.x, lhs.y == rhs.y, lhs.z == rhs.z, lhs.w == rhs.w); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise equality operation on an int4 vector and an int value. + /// Left hand side int4 to use to compute componentwise equality. + /// Right hand side int to use to compute componentwise equality. + /// bool4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator == (int4 lhs, int rhs) { return new bool4 (lhs.x == rhs, lhs.y == rhs, lhs.z == rhs, lhs.w == rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise equality operation on an int value and an int4 vector. + /// Left hand side int to use to compute componentwise equality. + /// Right hand side int4 to use to compute componentwise equality. + /// bool4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator == (int lhs, int4 rhs) { return new bool4 (lhs == rhs.x, lhs == rhs.y, lhs == rhs.z, lhs == rhs.w); } - // not equal - [MethodImpl(0x100)] + + /// Returns the result of a componentwise not equal operation on two int4 vectors. + /// Left hand side int4 to use to compute componentwise not equal. + /// Right hand side int4 to use to compute componentwise not equal. + /// bool4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator != (int4 lhs, int4 rhs) { return new bool4 (lhs.x != rhs.x, lhs.y != rhs.y, lhs.z != rhs.z, lhs.w != rhs.w); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise not equal operation on an int4 vector and an int value. + /// Left hand side int4 to use to compute componentwise not equal. + /// Right hand side int to use to compute componentwise not equal. + /// bool4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator != (int4 lhs, int rhs) { return new bool4 (lhs.x != rhs, lhs.y != rhs, lhs.z != rhs, lhs.w != rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise not equal operation on an int value and an int4 vector. + /// Left hand side int to use to compute componentwise not equal. + /// Right hand side int4 to use to compute componentwise not equal. + /// bool4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator != (int lhs, int4 rhs) { return new bool4 (lhs != rhs.x, lhs != rhs.y, lhs != rhs.z, lhs != rhs.w); } - // Equals - [MethodImpl(0x100)] - public bool Equals(int4 rhs) { return x == rhs.x && y == rhs.y && z == rhs.z && w == rhs.w; } - // [int index] - unsafe public int this[int index] - { - get - { -#if ENABLE_UNITY_COLLECTIONS_CHECKS - if ((uint)index >= 4) - throw new System.ArgumentException("index must be between[0...3]"); -#endif - fixed (int* array = &x) { return array[index]; } - } - set - { -#if ENABLE_UNITY_COLLECTIONS_CHECKS - if ((uint)index >= 4) - throw new System.ArgumentException("index must be between[0...3]"); -#endif - fixed (int* array = &x) { array[index] = value; } - } - } + /// Returns the result of a componentwise bitwise not operation on an int4 vector. + /// Value to use when computing the componentwise bitwise not. + /// int4 result of the componentwise bitwise not. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 operator ~ (int4 val) { return new int4 (~val.x, ~val.y, ~val.z, ~val.w); } - // operator & - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise and operation on two int4 vectors. + /// Left hand side int4 to use to compute componentwise bitwise and. + /// Right hand side int4 to use to compute componentwise bitwise and. + /// int4 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int4 operator & (int4 lhs, int4 rhs) { return new int4 (lhs.x & rhs.x, lhs.y & rhs.y, lhs.z & rhs.z, lhs.w & rhs.w); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise and operation on an int4 vector and an int value. + /// Left hand side int4 to use to compute componentwise bitwise and. + /// Right hand side int to use to compute componentwise bitwise and. + /// int4 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int4 operator & (int4 lhs, int rhs) { return new int4 (lhs.x & rhs, lhs.y & rhs, lhs.z & rhs, lhs.w & rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise and operation on an int value and an int4 vector. + /// Left hand side int to use to compute componentwise bitwise and. + /// Right hand side int4 to use to compute componentwise bitwise and. + /// int4 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int4 operator & (int lhs, int4 rhs) { return new int4 (lhs & rhs.x, lhs & rhs.y, lhs & rhs.z, lhs & rhs.w); } - // operator | - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise or operation on two int4 vectors. + /// Left hand side int4 to use to compute componentwise bitwise or. + /// Right hand side int4 to use to compute componentwise bitwise or. + /// int4 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int4 operator | (int4 lhs, int4 rhs) { return new int4 (lhs.x | rhs.x, lhs.y | rhs.y, lhs.z | rhs.z, lhs.w | rhs.w); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise or operation on an int4 vector and an int value. + /// Left hand side int4 to use to compute componentwise bitwise or. + /// Right hand side int to use to compute componentwise bitwise or. + /// int4 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int4 operator | (int4 lhs, int rhs) { return new int4 (lhs.x | rhs, lhs.y | rhs, lhs.z | rhs, lhs.w | rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise or operation on an int value and an int4 vector. + /// Left hand side int to use to compute componentwise bitwise or. + /// Right hand side int4 to use to compute componentwise bitwise or. + /// int4 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int4 operator | (int lhs, int4 rhs) { return new int4 (lhs | rhs.x, lhs | rhs.y, lhs | rhs.z, lhs | rhs.w); } - // operator ^ - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise exclusive or operation on two int4 vectors. + /// Left hand side int4 to use to compute componentwise bitwise exclusive or. + /// Right hand side int4 to use to compute componentwise bitwise exclusive or. + /// int4 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int4 operator ^ (int4 lhs, int4 rhs) { return new int4 (lhs.x ^ rhs.x, lhs.y ^ rhs.y, lhs.z ^ rhs.z, lhs.w ^ rhs.w); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise exclusive or operation on an int4 vector and an int value. + /// Left hand side int4 to use to compute componentwise bitwise exclusive or. + /// Right hand side int to use to compute componentwise bitwise exclusive or. + /// int4 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int4 operator ^ (int4 lhs, int rhs) { return new int4 (lhs.x ^ rhs, lhs.y ^ rhs, lhs.z ^ rhs, lhs.w ^ rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise exclusive or operation on an int value and an int4 vector. + /// Left hand side int to use to compute componentwise bitwise exclusive or. + /// Right hand side int4 to use to compute componentwise bitwise exclusive or. + /// int4 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int4 operator ^ (int lhs, int4 rhs) { return new int4 (lhs ^ rhs.x, lhs ^ rhs.y, lhs ^ rhs.z, lhs ^ rhs.w); } - // operator ~ - [MethodImpl(0x100)] - public static int4 operator ~ (int4 val) { return new int4 (~val.x, ~val.y, ~val.z, ~val.w); } [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xxxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xxxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xxxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, x, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xxxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, x, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xxyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xxyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xxyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, x, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xxyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, x, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xxzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, x, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xxzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, x, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xxzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, x, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xxzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, x, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xxwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, x, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xxwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, x, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xxwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, x, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xxww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, x, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xyxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xyxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xyxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, y, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xyxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, y, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xyyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xyyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xyyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, y, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xyyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, y, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xyzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, y, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xyzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, y, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xyzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, y, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xyzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, y, z, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; y = value.y; z = value.z; w = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xywx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, y, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xywy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, y, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xywz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, y, w, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; y = value.y; w = value.z; z = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xyww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, y, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xzxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, z, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xzxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, z, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xzxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, z, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xzxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, z, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xzyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, z, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xzyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, z, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xzyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, z, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xzyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, z, y, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; z = value.y; y = value.z; w = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xzzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, z, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xzzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, z, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xzzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, z, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xzzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, z, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xzwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, z, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xzwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, z, w, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; z = value.y; w = value.z; y = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xzwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, z, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xzww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, z, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xwxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, w, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xwxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, w, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xwxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, w, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xwxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, w, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xwyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, w, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xwyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, w, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xwyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, w, y, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; w = value.y; y = value.z; z = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xwyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, w, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xwzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, w, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xwzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, w, z, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; w = value.y; z = value.z; y = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xwzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, w, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xwzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, w, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xwwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, w, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xwwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, w, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xwwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, w, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 xwww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(x, w, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yxxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yxxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yxxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, x, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yxxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, x, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yxyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yxyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yxyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, x, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yxyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, x, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yxzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, x, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yxzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, x, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yxzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, x, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yxzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, x, z, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; x = value.y; z = value.z; w = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yxwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, x, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yxwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, x, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yxwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, x, w, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; x = value.y; w = value.z; z = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yxww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, x, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yyxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yyxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yyxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, y, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yyxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, y, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yyyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yyyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yyyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, y, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yyyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, y, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yyzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, y, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yyzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, y, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yyzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, y, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yyzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, y, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yywx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, y, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yywy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, y, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yywz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, y, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yyww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, y, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yzxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, z, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yzxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, z, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yzxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, z, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yzxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, z, x, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; z = value.y; x = value.z; w = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yzyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, z, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yzyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, z, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yzyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, z, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yzyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, z, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yzzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, z, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yzzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, z, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yzzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, z, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yzzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, z, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yzwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, z, w, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; z = value.y; w = value.z; x = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yzwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, z, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yzwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, z, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 yzww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, z, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 ywxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, w, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 ywxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, w, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 ywxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, w, x, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; w = value.y; x = value.z; z = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 ywxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, w, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 ywyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, w, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 ywyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, w, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 ywyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, w, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 ywyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, w, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 ywzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, w, z, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; w = value.y; z = value.z; x = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 ywzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, w, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 ywzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, w, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 ywzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, w, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 ywwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, w, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 ywwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, w, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 ywwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, w, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 ywww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(y, w, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zxxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zxxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zxxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, x, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zxxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, x, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zxyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zxyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zxyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, x, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zxyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, x, y, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; x = value.y; y = value.z; w = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zxzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, x, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zxzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, x, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zxzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, x, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zxzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, x, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zxwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, x, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zxwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, x, w, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; x = value.y; w = value.z; y = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zxwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, x, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zxww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, x, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zyxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zyxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zyxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, y, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zyxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, y, x, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; y = value.y; x = value.z; w = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zyyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zyyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zyyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, y, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zyyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, y, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zyzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, y, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zyzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, y, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zyzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, y, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zyzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, y, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zywx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, y, w, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; y = value.y; w = value.z; x = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zywy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, y, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zywz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, y, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zyww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, y, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zzxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, z, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zzxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, z, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zzxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, z, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zzxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, z, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zzyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, z, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zzyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, z, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zzyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, z, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zzyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, z, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zzzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, z, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zzzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, z, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zzzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, z, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zzzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, z, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zzwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, z, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zzwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, z, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zzwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, z, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zzww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, z, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zwxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, w, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zwxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, w, x, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; w = value.y; x = value.z; y = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zwxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, w, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zwxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, w, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zwyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, w, y, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; w = value.y; y = value.z; x = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zwyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, w, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zwyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, w, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zwyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, w, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zwzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, w, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zwzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, w, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zwzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, w, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zwzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, w, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zwwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, w, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zwwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, w, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zwwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, w, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 zwww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(z, w, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wxxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wxxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wxxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, x, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wxxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, x, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wxyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wxyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wxyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, x, y, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; x = value.y; y = value.z; z = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wxyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, x, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wxzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, x, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wxzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, x, z, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; x = value.y; z = value.z; y = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wxzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, x, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wxzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, x, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wxwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, x, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wxwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, x, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wxwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, x, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wxww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, x, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wyxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wyxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wyxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, y, x, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; y = value.y; x = value.z; z = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wyxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, y, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wyyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wyyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wyyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, y, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wyyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, y, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wyzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, y, z, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; y = value.y; z = value.z; x = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wyzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, y, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wyzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, y, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wyzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, y, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wywx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, y, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wywy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, y, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wywz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, y, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wyww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, y, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wzxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, z, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wzxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, z, x, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; z = value.y; x = value.z; y = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wzxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, z, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wzxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, z, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wzyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, z, y, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; z = value.y; y = value.z; x = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wzyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, z, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wzyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, z, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wzyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, z, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wzzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, z, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wzzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, z, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wzzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, z, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wzzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, z, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wzwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, z, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wzwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, z, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wzwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, z, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wzww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, z, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wwxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, w, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wwxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, w, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wwxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, w, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wwxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, w, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wwyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, w, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wwyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, w, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wwyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, w, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wwyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, w, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wwzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, w, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wwzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, w, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wwzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, w, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wwzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, w, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wwwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, w, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wwwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, w, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wwwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, w, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int4 wwww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int4(w, w, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 xxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 xxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 xxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(x, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 xxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(x, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 xyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 xyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 xyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(x, y, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; y = value.y; z = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 xyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(x, y, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; y = value.y; w = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 xzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(x, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 xzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(x, z, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; z = value.y; y = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 xzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(x, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 xzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(x, z, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; z = value.y; w = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 xwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(x, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 xwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(x, w, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; w = value.y; y = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 xwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(x, w, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; w = value.y; z = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 xww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(x, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 yxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 yxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 yxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(y, x, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; x = value.y; z = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 yxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(y, x, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; x = value.y; w = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 yyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 yyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 yyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(y, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 yyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(y, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 yzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(y, z, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; z = value.y; x = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 yzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(y, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 yzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(y, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 yzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(y, z, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; z = value.y; w = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 ywx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(y, w, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; w = value.y; x = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 ywy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(y, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 ywz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(y, w, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; w = value.y; z = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 yww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(y, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 zxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(z, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 zxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(z, x, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; x = value.y; y = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 zxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(z, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 zxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(z, x, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; x = value.y; w = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 zyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(z, y, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; y = value.y; x = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 zyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(z, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 zyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(z, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 zyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(z, y, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; y = value.y; w = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 zzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(z, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 zzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(z, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 zzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(z, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 zzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(z, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 zwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(z, w, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; w = value.y; x = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 zwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(z, w, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; w = value.y; y = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 zwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(z, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 zww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(z, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 wxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(w, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 wxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(w, x, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; x = value.y; y = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 wxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(w, x, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; x = value.y; z = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 wxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(w, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 wyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(w, y, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; y = value.y; x = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 wyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(w, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 wyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(w, y, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; y = value.y; z = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 wyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(w, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 wzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(w, z, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; z = value.y; x = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 wzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(w, z, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; z = value.y; y = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 wzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(w, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 wzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(w, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 wwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(w, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 wwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(w, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 wwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(w, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int3 www { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int3(w, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int2 xx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int2(x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int2 xy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int2(x, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; y = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int2 xz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int2(x, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; z = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int2 xw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int2(x, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; w = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int2 yx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int2(y, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; x = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int2 yy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int2(y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int2 yz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int2(y, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; z = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int2 yw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int2(y, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; w = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int2 zx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int2(z, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; x = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int2 zy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int2(z, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; y = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int2 zz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int2(z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int2 zw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int2(z, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; w = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int2 wx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int2(w, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; x = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int2 wy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int2(w, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; y = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int2 wz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int2(w, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; z = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public int2 ww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new int2(w, w); } } + + /// Returns the int element at a specified index. + unsafe public int this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 4) + throw new System.ArgumentException("index must be between[0...3]"); +#endif + fixed (int4* array = &this) { return ((int*)array)[index]; } + } + set + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 4) + throw new System.ArgumentException("index must be between[0...3]"); +#endif + fixed (int* array = &x) { array[index] = value; } + } + } + + /// Returns true if the int4 is equal to a given int4, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(int4 rhs) { return x == rhs.x && y == rhs.y && z == rhs.z && w == rhs.w; } + + /// Returns true if the int4 is equal to a given int4, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is int4 converted && Equals(converted); } + + + /// Returns a hash code for the int4. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the int4. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("int4({0}, {1}, {2}, {3})", x, y, z, w); + } + + /// Returns a string representation of the int4 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("int4({0}, {1}, {2}, {3})", x.ToString(format, formatProvider), y.ToString(format, formatProvider), z.ToString(format, formatProvider), w.ToString(format, formatProvider)); + } + + internal sealed class DebuggerProxy + { + public int x; + public int y; + public int z; + public int w; + public DebuggerProxy(int4 v) + { + x = v.x; + y = v.y; + z = v.z; + w = v.w; + } + } + + } + + public static partial class math + { + /// Returns a int4 vector constructed from four int values. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + /// The constructed vector's z component will be set to this value. + /// The constructed vector's w component will be set to this value. + /// int4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 int4(int x, int y, int z, int w) { return new int4(x, y, z, w); } + + /// Returns a int4 vector constructed from two int values and an int2 vector. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + /// The constructed vector's zw components will be set to this value. + /// int4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 int4(int x, int y, int2 zw) { return new int4(x, y, zw); } + + /// Returns a int4 vector constructed from an int value, an int2 vector and an int value. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's yz components will be set to this value. + /// The constructed vector's w component will be set to this value. + /// int4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 int4(int x, int2 yz, int w) { return new int4(x, yz, w); } + + /// Returns a int4 vector constructed from an int value and an int3 vector. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's yzw components will be set to this value. + /// int4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 int4(int x, int3 yzw) { return new int4(x, yzw); } + + /// Returns a int4 vector constructed from an int2 vector and two int values. + /// The constructed vector's xy components will be set to this value. + /// The constructed vector's z component will be set to this value. + /// The constructed vector's w component will be set to this value. + /// int4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 int4(int2 xy, int z, int w) { return new int4(xy, z, w); } + + /// Returns a int4 vector constructed from two int2 vectors. + /// The constructed vector's xy components will be set to this value. + /// The constructed vector's zw components will be set to this value. + /// int4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 int4(int2 xy, int2 zw) { return new int4(xy, zw); } + + /// Returns a int4 vector constructed from an int3 vector and an int value. + /// The constructed vector's xyz components will be set to this value. + /// The constructed vector's w component will be set to this value. + /// int4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 int4(int3 xyz, int w) { return new int4(xyz, w); } + + /// Returns a int4 vector constructed from an int4 vector. + /// The constructed vector's xyzw components will be set to this value. + /// int4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 int4(int4 xyzw) { return new int4(xyzw); } + + /// Returns a int4 vector constructed from a single int value by assigning it to every component. + /// int to convert to int4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 int4(int v) { return new int4(v); } + + /// Returns a int4 vector constructed from a single bool value by converting it to int and assigning it to every component. + /// bool to convert to int4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 int4(bool v) { return new int4(v); } + + /// Return a int4 vector constructed from a bool4 vector by componentwise conversion. + /// bool4 to convert to int4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 int4(bool4 v) { return new int4(v); } + + /// Returns a int4 vector constructed from a single uint value by converting it to int and assigning it to every component. + /// uint to convert to int4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 int4(uint v) { return new int4(v); } + + /// Return a int4 vector constructed from a uint4 vector by componentwise conversion. + /// uint4 to convert to int4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 int4(uint4 v) { return new int4(v); } + + /// Returns a int4 vector constructed from a single float value by converting it to int and assigning it to every component. + /// float to convert to int4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 int4(float v) { return new int4(v); } + + /// Return a int4 vector constructed from a float4 vector by componentwise conversion. + /// float4 to convert to int4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 int4(float4 v) { return new int4(v); } + + /// Returns a int4 vector constructed from a single double value by converting it to int and assigning it to every component. + /// double to convert to int4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 int4(double v) { return new int4(v); } + + /// Return a int4 vector constructed from a double4 vector by componentwise conversion. + /// double4 to convert to int4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 int4(double4 v) { return new int4(v); } + + /// Returns a uint hash code of a int4 vector. + /// Vector value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(int4 v) + { + return csum(asuint(v) * uint4(0x6E050B01u, 0x750FDBF5u, 0x7F3DD499u, 0x52EAAEBBu)) + 0x4599C793u; + } + + /// + /// Returns a uint4 vector hash code of a int4 vector. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Vector value to hash. + /// uint4 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 hashwide(int4 v) + { + return (asuint(v) * uint4(0x83B5E729u, 0xC267163Fu, 0x67BC9149u, 0xAD7C5EC1u)) + 0x822A7D6Du; + } + + /// Returns the result of specified shuffling of the components from two int4 vectors into an int value. + /// int4 to use as the left argument of the shuffle operation. + /// int4 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting int. + /// int result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int shuffle(int4 left, int4 right, ShuffleComponent x) + { + return select_shuffle_component(left, right, x); + } + + /// Returns the result of specified shuffling of the components from two int4 vectors into an int2 vector. + /// int4 to use as the left argument of the shuffle operation. + /// int4 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting int2 x component. + /// The ShuffleComponent to use when setting the resulting int2 y component. + /// int2 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 shuffle(int4 left, int4 right, ShuffleComponent x, ShuffleComponent y) + { + return int2( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y)); + } + + /// Returns the result of specified shuffling of the components from two int4 vectors into an int3 vector. + /// int4 to use as the left argument of the shuffle operation. + /// int4 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting int3 x component. + /// The ShuffleComponent to use when setting the resulting int3 y component. + /// The ShuffleComponent to use when setting the resulting int3 z component. + /// int3 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 shuffle(int4 left, int4 right, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z) + { + return int3( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y), + select_shuffle_component(left, right, z)); + } + + /// Returns the result of specified shuffling of the components from two int4 vectors into an int4 vector. + /// int4 to use as the left argument of the shuffle operation. + /// int4 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting int4 x component. + /// The ShuffleComponent to use when setting the resulting int4 y component. + /// The ShuffleComponent to use when setting the resulting int4 z component. + /// The ShuffleComponent to use when setting the resulting int4 w component. + /// int4 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 shuffle(int4 left, int4 right, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z, ShuffleComponent w) + { + return int4( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y), + select_shuffle_component(left, right, z), + select_shuffle_component(left, right, w)); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static int select_shuffle_component(int4 a, int4 b, ShuffleComponent component) + { + switch(component) + { + case ShuffleComponent.LeftX: + return a.x; + case ShuffleComponent.LeftY: + return a.y; + case ShuffleComponent.LeftZ: + return a.z; + case ShuffleComponent.LeftW: + return a.w; + case ShuffleComponent.RightX: + return b.x; + case ShuffleComponent.RightY: + return b.y; + case ShuffleComponent.RightZ: + return b.z; + case ShuffleComponent.RightW: + return b.w; + default: + throw new System.ArgumentException("Invalid shuffle component: " + component); + } + } + } } diff --git a/src/Unity.Mathematics/int4x2.gen.cs b/src/Unity.Mathematics/int4x2.gen.cs new file mode 100644 index 00000000..c1766a77 --- /dev/null +++ b/src/Unity.Mathematics/int4x2.gen.cs @@ -0,0 +1,726 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 4x2 matrix of ints. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct int4x2 : System.IEquatable, IFormattable + { + /// Column 0 of the matrix. + public int4 c0; + /// Column 1 of the matrix. + public int4 c1; + + /// int4x2 zero value. + public static readonly int4x2 zero; + + /// Constructs a int4x2 matrix from two int4 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4x2(int4 c0, int4 c1) + { + this.c0 = c0; + this.c1 = c1; + } + + /// Constructs a int4x2 matrix from 8 int values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 3, column 0 will be set to this value. + /// The matrix at row 3, column 1 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4x2(int m00, int m01, + int m10, int m11, + int m20, int m21, + int m30, int m31) + { + this.c0 = new int4(m00, m10, m20, m30); + this.c1 = new int4(m01, m11, m21, m31); + } + + /// Constructs a int4x2 matrix from a single int value by assigning it to every component. + /// int to convert to int4x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4x2(int v) + { + this.c0 = v; + this.c1 = v; + } + + /// Constructs a int4x2 matrix from a single bool value by converting it to int and assigning it to every component. + /// bool to convert to int4x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4x2(bool v) + { + this.c0 = math.select(new int4(0), new int4(1), v); + this.c1 = math.select(new int4(0), new int4(1), v); + } + + /// Constructs a int4x2 matrix from a bool4x2 matrix by componentwise conversion. + /// bool4x2 to convert to int4x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4x2(bool4x2 v) + { + this.c0 = math.select(new int4(0), new int4(1), v.c0); + this.c1 = math.select(new int4(0), new int4(1), v.c1); + } + + /// Constructs a int4x2 matrix from a single uint value by converting it to int and assigning it to every component. + /// uint to convert to int4x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4x2(uint v) + { + this.c0 = (int4)v; + this.c1 = (int4)v; + } + + /// Constructs a int4x2 matrix from a uint4x2 matrix by componentwise conversion. + /// uint4x2 to convert to int4x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4x2(uint4x2 v) + { + this.c0 = (int4)v.c0; + this.c1 = (int4)v.c1; + } + + /// Constructs a int4x2 matrix from a single float value by converting it to int and assigning it to every component. + /// float to convert to int4x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4x2(float v) + { + this.c0 = (int4)v; + this.c1 = (int4)v; + } + + /// Constructs a int4x2 matrix from a float4x2 matrix by componentwise conversion. + /// float4x2 to convert to int4x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4x2(float4x2 v) + { + this.c0 = (int4)v.c0; + this.c1 = (int4)v.c1; + } + + /// Constructs a int4x2 matrix from a single double value by converting it to int and assigning it to every component. + /// double to convert to int4x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4x2(double v) + { + this.c0 = (int4)v; + this.c1 = (int4)v; + } + + /// Constructs a int4x2 matrix from a double4x2 matrix by componentwise conversion. + /// double4x2 to convert to int4x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4x2(double4x2 v) + { + this.c0 = (int4)v.c0; + this.c1 = (int4)v.c1; + } + + + /// Implicitly converts a single int value to a int4x2 matrix by assigning it to every component. + /// int to convert to int4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator int4x2(int v) { return new int4x2(v); } + + /// Explicitly converts a single bool value to a int4x2 matrix by converting it to int and assigning it to every component. + /// bool to convert to int4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int4x2(bool v) { return new int4x2(v); } + + /// Explicitly converts a bool4x2 matrix to a int4x2 matrix by componentwise conversion. + /// bool4x2 to convert to int4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int4x2(bool4x2 v) { return new int4x2(v); } + + /// Explicitly converts a single uint value to a int4x2 matrix by converting it to int and assigning it to every component. + /// uint to convert to int4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int4x2(uint v) { return new int4x2(v); } + + /// Explicitly converts a uint4x2 matrix to a int4x2 matrix by componentwise conversion. + /// uint4x2 to convert to int4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int4x2(uint4x2 v) { return new int4x2(v); } + + /// Explicitly converts a single float value to a int4x2 matrix by converting it to int and assigning it to every component. + /// float to convert to int4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int4x2(float v) { return new int4x2(v); } + + /// Explicitly converts a float4x2 matrix to a int4x2 matrix by componentwise conversion. + /// float4x2 to convert to int4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int4x2(float4x2 v) { return new int4x2(v); } + + /// Explicitly converts a single double value to a int4x2 matrix by converting it to int and assigning it to every component. + /// double to convert to int4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int4x2(double v) { return new int4x2(v); } + + /// Explicitly converts a double4x2 matrix to a int4x2 matrix by componentwise conversion. + /// double4x2 to convert to int4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int4x2(double4x2 v) { return new int4x2(v); } + + + /// Returns the result of a componentwise multiplication operation on two int4x2 matrices. + /// Left hand side int4x2 to use to compute componentwise multiplication. + /// Right hand side int4x2 to use to compute componentwise multiplication. + /// int4x2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 operator * (int4x2 lhs, int4x2 rhs) { return new int4x2 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1); } + + /// Returns the result of a componentwise multiplication operation on an int4x2 matrix and an int value. + /// Left hand side int4x2 to use to compute componentwise multiplication. + /// Right hand side int to use to compute componentwise multiplication. + /// int4x2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 operator * (int4x2 lhs, int rhs) { return new int4x2 (lhs.c0 * rhs, lhs.c1 * rhs); } + + /// Returns the result of a componentwise multiplication operation on an int value and an int4x2 matrix. + /// Left hand side int to use to compute componentwise multiplication. + /// Right hand side int4x2 to use to compute componentwise multiplication. + /// int4x2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 operator * (int lhs, int4x2 rhs) { return new int4x2 (lhs * rhs.c0, lhs * rhs.c1); } + + + /// Returns the result of a componentwise addition operation on two int4x2 matrices. + /// Left hand side int4x2 to use to compute componentwise addition. + /// Right hand side int4x2 to use to compute componentwise addition. + /// int4x2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 operator + (int4x2 lhs, int4x2 rhs) { return new int4x2 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1); } + + /// Returns the result of a componentwise addition operation on an int4x2 matrix and an int value. + /// Left hand side int4x2 to use to compute componentwise addition. + /// Right hand side int to use to compute componentwise addition. + /// int4x2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 operator + (int4x2 lhs, int rhs) { return new int4x2 (lhs.c0 + rhs, lhs.c1 + rhs); } + + /// Returns the result of a componentwise addition operation on an int value and an int4x2 matrix. + /// Left hand side int to use to compute componentwise addition. + /// Right hand side int4x2 to use to compute componentwise addition. + /// int4x2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 operator + (int lhs, int4x2 rhs) { return new int4x2 (lhs + rhs.c0, lhs + rhs.c1); } + + + /// Returns the result of a componentwise subtraction operation on two int4x2 matrices. + /// Left hand side int4x2 to use to compute componentwise subtraction. + /// Right hand side int4x2 to use to compute componentwise subtraction. + /// int4x2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 operator - (int4x2 lhs, int4x2 rhs) { return new int4x2 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1); } + + /// Returns the result of a componentwise subtraction operation on an int4x2 matrix and an int value. + /// Left hand side int4x2 to use to compute componentwise subtraction. + /// Right hand side int to use to compute componentwise subtraction. + /// int4x2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 operator - (int4x2 lhs, int rhs) { return new int4x2 (lhs.c0 - rhs, lhs.c1 - rhs); } + + /// Returns the result of a componentwise subtraction operation on an int value and an int4x2 matrix. + /// Left hand side int to use to compute componentwise subtraction. + /// Right hand side int4x2 to use to compute componentwise subtraction. + /// int4x2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 operator - (int lhs, int4x2 rhs) { return new int4x2 (lhs - rhs.c0, lhs - rhs.c1); } + + + /// Returns the result of a componentwise division operation on two int4x2 matrices. + /// Left hand side int4x2 to use to compute componentwise division. + /// Right hand side int4x2 to use to compute componentwise division. + /// int4x2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 operator / (int4x2 lhs, int4x2 rhs) { return new int4x2 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1); } + + /// Returns the result of a componentwise division operation on an int4x2 matrix and an int value. + /// Left hand side int4x2 to use to compute componentwise division. + /// Right hand side int to use to compute componentwise division. + /// int4x2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 operator / (int4x2 lhs, int rhs) { return new int4x2 (lhs.c0 / rhs, lhs.c1 / rhs); } + + /// Returns the result of a componentwise division operation on an int value and an int4x2 matrix. + /// Left hand side int to use to compute componentwise division. + /// Right hand side int4x2 to use to compute componentwise division. + /// int4x2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 operator / (int lhs, int4x2 rhs) { return new int4x2 (lhs / rhs.c0, lhs / rhs.c1); } + + + /// Returns the result of a componentwise modulus operation on two int4x2 matrices. + /// Left hand side int4x2 to use to compute componentwise modulus. + /// Right hand side int4x2 to use to compute componentwise modulus. + /// int4x2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 operator % (int4x2 lhs, int4x2 rhs) { return new int4x2 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1); } + + /// Returns the result of a componentwise modulus operation on an int4x2 matrix and an int value. + /// Left hand side int4x2 to use to compute componentwise modulus. + /// Right hand side int to use to compute componentwise modulus. + /// int4x2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 operator % (int4x2 lhs, int rhs) { return new int4x2 (lhs.c0 % rhs, lhs.c1 % rhs); } + + /// Returns the result of a componentwise modulus operation on an int value and an int4x2 matrix. + /// Left hand side int to use to compute componentwise modulus. + /// Right hand side int4x2 to use to compute componentwise modulus. + /// int4x2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 operator % (int lhs, int4x2 rhs) { return new int4x2 (lhs % rhs.c0, lhs % rhs.c1); } + + + /// Returns the result of a componentwise increment operation on an int4x2 matrix. + /// Value to use when computing the componentwise increment. + /// int4x2 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 operator ++ (int4x2 val) { return new int4x2 (++val.c0, ++val.c1); } + + + /// Returns the result of a componentwise decrement operation on an int4x2 matrix. + /// Value to use when computing the componentwise decrement. + /// int4x2 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 operator -- (int4x2 val) { return new int4x2 (--val.c0, --val.c1); } + + + /// Returns the result of a componentwise less than operation on two int4x2 matrices. + /// Left hand side int4x2 to use to compute componentwise less than. + /// Right hand side int4x2 to use to compute componentwise less than. + /// bool4x2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator < (int4x2 lhs, int4x2 rhs) { return new bool4x2 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1); } + + /// Returns the result of a componentwise less than operation on an int4x2 matrix and an int value. + /// Left hand side int4x2 to use to compute componentwise less than. + /// Right hand side int to use to compute componentwise less than. + /// bool4x2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator < (int4x2 lhs, int rhs) { return new bool4x2 (lhs.c0 < rhs, lhs.c1 < rhs); } + + /// Returns the result of a componentwise less than operation on an int value and an int4x2 matrix. + /// Left hand side int to use to compute componentwise less than. + /// Right hand side int4x2 to use to compute componentwise less than. + /// bool4x2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator < (int lhs, int4x2 rhs) { return new bool4x2 (lhs < rhs.c0, lhs < rhs.c1); } + + + /// Returns the result of a componentwise less or equal operation on two int4x2 matrices. + /// Left hand side int4x2 to use to compute componentwise less or equal. + /// Right hand side int4x2 to use to compute componentwise less or equal. + /// bool4x2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator <= (int4x2 lhs, int4x2 rhs) { return new bool4x2 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1); } + + /// Returns the result of a componentwise less or equal operation on an int4x2 matrix and an int value. + /// Left hand side int4x2 to use to compute componentwise less or equal. + /// Right hand side int to use to compute componentwise less or equal. + /// bool4x2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator <= (int4x2 lhs, int rhs) { return new bool4x2 (lhs.c0 <= rhs, lhs.c1 <= rhs); } + + /// Returns the result of a componentwise less or equal operation on an int value and an int4x2 matrix. + /// Left hand side int to use to compute componentwise less or equal. + /// Right hand side int4x2 to use to compute componentwise less or equal. + /// bool4x2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator <= (int lhs, int4x2 rhs) { return new bool4x2 (lhs <= rhs.c0, lhs <= rhs.c1); } + + + /// Returns the result of a componentwise greater than operation on two int4x2 matrices. + /// Left hand side int4x2 to use to compute componentwise greater than. + /// Right hand side int4x2 to use to compute componentwise greater than. + /// bool4x2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator > (int4x2 lhs, int4x2 rhs) { return new bool4x2 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1); } + + /// Returns the result of a componentwise greater than operation on an int4x2 matrix and an int value. + /// Left hand side int4x2 to use to compute componentwise greater than. + /// Right hand side int to use to compute componentwise greater than. + /// bool4x2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator > (int4x2 lhs, int rhs) { return new bool4x2 (lhs.c0 > rhs, lhs.c1 > rhs); } + + /// Returns the result of a componentwise greater than operation on an int value and an int4x2 matrix. + /// Left hand side int to use to compute componentwise greater than. + /// Right hand side int4x2 to use to compute componentwise greater than. + /// bool4x2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator > (int lhs, int4x2 rhs) { return new bool4x2 (lhs > rhs.c0, lhs > rhs.c1); } + + + /// Returns the result of a componentwise greater or equal operation on two int4x2 matrices. + /// Left hand side int4x2 to use to compute componentwise greater or equal. + /// Right hand side int4x2 to use to compute componentwise greater or equal. + /// bool4x2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator >= (int4x2 lhs, int4x2 rhs) { return new bool4x2 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1); } + + /// Returns the result of a componentwise greater or equal operation on an int4x2 matrix and an int value. + /// Left hand side int4x2 to use to compute componentwise greater or equal. + /// Right hand side int to use to compute componentwise greater or equal. + /// bool4x2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator >= (int4x2 lhs, int rhs) { return new bool4x2 (lhs.c0 >= rhs, lhs.c1 >= rhs); } + + /// Returns the result of a componentwise greater or equal operation on an int value and an int4x2 matrix. + /// Left hand side int to use to compute componentwise greater or equal. + /// Right hand side int4x2 to use to compute componentwise greater or equal. + /// bool4x2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator >= (int lhs, int4x2 rhs) { return new bool4x2 (lhs >= rhs.c0, lhs >= rhs.c1); } + + + /// Returns the result of a componentwise unary minus operation on an int4x2 matrix. + /// Value to use when computing the componentwise unary minus. + /// int4x2 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 operator - (int4x2 val) { return new int4x2 (-val.c0, -val.c1); } + + + /// Returns the result of a componentwise unary plus operation on an int4x2 matrix. + /// Value to use when computing the componentwise unary plus. + /// int4x2 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 operator + (int4x2 val) { return new int4x2 (+val.c0, +val.c1); } + + + /// Returns the result of a componentwise left shift operation on an int4x2 matrix by a number of bits specified by a single int. + /// The matrix to left shift. + /// The number of bits to left shift. + /// The result of the componentwise left shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 operator << (int4x2 x, int n) { return new int4x2 (x.c0 << n, x.c1 << n); } + + /// Returns the result of a componentwise right shift operation on an int4x2 matrix by a number of bits specified by a single int. + /// The matrix to right shift. + /// The number of bits to right shift. + /// The result of the componentwise right shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 operator >> (int4x2 x, int n) { return new int4x2 (x.c0 >> n, x.c1 >> n); } + + /// Returns the result of a componentwise equality operation on two int4x2 matrices. + /// Left hand side int4x2 to use to compute componentwise equality. + /// Right hand side int4x2 to use to compute componentwise equality. + /// bool4x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator == (int4x2 lhs, int4x2 rhs) { return new bool4x2 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1); } + + /// Returns the result of a componentwise equality operation on an int4x2 matrix and an int value. + /// Left hand side int4x2 to use to compute componentwise equality. + /// Right hand side int to use to compute componentwise equality. + /// bool4x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator == (int4x2 lhs, int rhs) { return new bool4x2 (lhs.c0 == rhs, lhs.c1 == rhs); } + + /// Returns the result of a componentwise equality operation on an int value and an int4x2 matrix. + /// Left hand side int to use to compute componentwise equality. + /// Right hand side int4x2 to use to compute componentwise equality. + /// bool4x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator == (int lhs, int4x2 rhs) { return new bool4x2 (lhs == rhs.c0, lhs == rhs.c1); } + + + /// Returns the result of a componentwise not equal operation on two int4x2 matrices. + /// Left hand side int4x2 to use to compute componentwise not equal. + /// Right hand side int4x2 to use to compute componentwise not equal. + /// bool4x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator != (int4x2 lhs, int4x2 rhs) { return new bool4x2 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1); } + + /// Returns the result of a componentwise not equal operation on an int4x2 matrix and an int value. + /// Left hand side int4x2 to use to compute componentwise not equal. + /// Right hand side int to use to compute componentwise not equal. + /// bool4x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator != (int4x2 lhs, int rhs) { return new bool4x2 (lhs.c0 != rhs, lhs.c1 != rhs); } + + /// Returns the result of a componentwise not equal operation on an int value and an int4x2 matrix. + /// Left hand side int to use to compute componentwise not equal. + /// Right hand side int4x2 to use to compute componentwise not equal. + /// bool4x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator != (int lhs, int4x2 rhs) { return new bool4x2 (lhs != rhs.c0, lhs != rhs.c1); } + + + /// Returns the result of a componentwise bitwise not operation on an int4x2 matrix. + /// Value to use when computing the componentwise bitwise not. + /// int4x2 result of the componentwise bitwise not. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 operator ~ (int4x2 val) { return new int4x2 (~val.c0, ~val.c1); } + + + /// Returns the result of a componentwise bitwise and operation on two int4x2 matrices. + /// Left hand side int4x2 to use to compute componentwise bitwise and. + /// Right hand side int4x2 to use to compute componentwise bitwise and. + /// int4x2 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 operator & (int4x2 lhs, int4x2 rhs) { return new int4x2 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1); } + + /// Returns the result of a componentwise bitwise and operation on an int4x2 matrix and an int value. + /// Left hand side int4x2 to use to compute componentwise bitwise and. + /// Right hand side int to use to compute componentwise bitwise and. + /// int4x2 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 operator & (int4x2 lhs, int rhs) { return new int4x2 (lhs.c0 & rhs, lhs.c1 & rhs); } + + /// Returns the result of a componentwise bitwise and operation on an int value and an int4x2 matrix. + /// Left hand side int to use to compute componentwise bitwise and. + /// Right hand side int4x2 to use to compute componentwise bitwise and. + /// int4x2 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 operator & (int lhs, int4x2 rhs) { return new int4x2 (lhs & rhs.c0, lhs & rhs.c1); } + + + /// Returns the result of a componentwise bitwise or operation on two int4x2 matrices. + /// Left hand side int4x2 to use to compute componentwise bitwise or. + /// Right hand side int4x2 to use to compute componentwise bitwise or. + /// int4x2 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 operator | (int4x2 lhs, int4x2 rhs) { return new int4x2 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1); } + + /// Returns the result of a componentwise bitwise or operation on an int4x2 matrix and an int value. + /// Left hand side int4x2 to use to compute componentwise bitwise or. + /// Right hand side int to use to compute componentwise bitwise or. + /// int4x2 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 operator | (int4x2 lhs, int rhs) { return new int4x2 (lhs.c0 | rhs, lhs.c1 | rhs); } + + /// Returns the result of a componentwise bitwise or operation on an int value and an int4x2 matrix. + /// Left hand side int to use to compute componentwise bitwise or. + /// Right hand side int4x2 to use to compute componentwise bitwise or. + /// int4x2 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 operator | (int lhs, int4x2 rhs) { return new int4x2 (lhs | rhs.c0, lhs | rhs.c1); } + + + /// Returns the result of a componentwise bitwise exclusive or operation on two int4x2 matrices. + /// Left hand side int4x2 to use to compute componentwise bitwise exclusive or. + /// Right hand side int4x2 to use to compute componentwise bitwise exclusive or. + /// int4x2 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 operator ^ (int4x2 lhs, int4x2 rhs) { return new int4x2 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1); } + + /// Returns the result of a componentwise bitwise exclusive or operation on an int4x2 matrix and an int value. + /// Left hand side int4x2 to use to compute componentwise bitwise exclusive or. + /// Right hand side int to use to compute componentwise bitwise exclusive or. + /// int4x2 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 operator ^ (int4x2 lhs, int rhs) { return new int4x2 (lhs.c0 ^ rhs, lhs.c1 ^ rhs); } + + /// Returns the result of a componentwise bitwise exclusive or operation on an int value and an int4x2 matrix. + /// Left hand side int to use to compute componentwise bitwise exclusive or. + /// Right hand side int4x2 to use to compute componentwise bitwise exclusive or. + /// int4x2 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 operator ^ (int lhs, int4x2 rhs) { return new int4x2 (lhs ^ rhs.c0, lhs ^ rhs.c1); } + + + + /// Returns the int4 element at a specified index. + unsafe public ref int4 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 2) + throw new System.ArgumentException("index must be between[0...1]"); +#endif + fixed (int4x2* array = &this) { return ref ((int4*)array)[index]; } + } + } + + /// Returns true if the int4x2 is equal to a given int4x2, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(int4x2 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1); } + + /// Returns true if the int4x2 is equal to a given int4x2, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is int4x2 converted && Equals(converted); } + + + /// Returns a hash code for the int4x2. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the int4x2. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("int4x2({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7})", c0.x, c1.x, c0.y, c1.y, c0.z, c1.z, c0.w, c1.w); + } + + /// Returns a string representation of the int4x2 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("int4x2({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7})", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c0.z.ToString(format, formatProvider), c1.z.ToString(format, formatProvider), c0.w.ToString(format, formatProvider), c1.w.ToString(format, formatProvider)); + } + + } + + public static partial class math + { + /// Returns a int4x2 matrix constructed from two int4 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// int4x2 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 int4x2(int4 c0, int4 c1) { return new int4x2(c0, c1); } + + /// Returns a int4x2 matrix constructed from from 8 int values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 3, column 0 will be set to this value. + /// The matrix at row 3, column 1 will be set to this value. + /// int4x2 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 int4x2(int m00, int m01, + int m10, int m11, + int m20, int m21, + int m30, int m31) + { + return new int4x2(m00, m01, + m10, m11, + m20, m21, + m30, m31); + } + + /// Returns a int4x2 matrix constructed from a single int value by assigning it to every component. + /// int to convert to int4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 int4x2(int v) { return new int4x2(v); } + + /// Returns a int4x2 matrix constructed from a single bool value by converting it to int and assigning it to every component. + /// bool to convert to int4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 int4x2(bool v) { return new int4x2(v); } + + /// Return a int4x2 matrix constructed from a bool4x2 matrix by componentwise conversion. + /// bool4x2 to convert to int4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 int4x2(bool4x2 v) { return new int4x2(v); } + + /// Returns a int4x2 matrix constructed from a single uint value by converting it to int and assigning it to every component. + /// uint to convert to int4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 int4x2(uint v) { return new int4x2(v); } + + /// Return a int4x2 matrix constructed from a uint4x2 matrix by componentwise conversion. + /// uint4x2 to convert to int4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 int4x2(uint4x2 v) { return new int4x2(v); } + + /// Returns a int4x2 matrix constructed from a single float value by converting it to int and assigning it to every component. + /// float to convert to int4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 int4x2(float v) { return new int4x2(v); } + + /// Return a int4x2 matrix constructed from a float4x2 matrix by componentwise conversion. + /// float4x2 to convert to int4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 int4x2(float4x2 v) { return new int4x2(v); } + + /// Returns a int4x2 matrix constructed from a single double value by converting it to int and assigning it to every component. + /// double to convert to int4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 int4x2(double v) { return new int4x2(v); } + + /// Return a int4x2 matrix constructed from a double4x2 matrix by componentwise conversion. + /// double4x2 to convert to int4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 int4x2(double4x2 v) { return new int4x2(v); } + + /// Return the int2x4 transpose of a int4x2 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 transpose(int4x2 v) + { + return int2x4( + v.c0.x, v.c0.y, v.c0.z, v.c0.w, + v.c1.x, v.c1.y, v.c1.z, v.c1.w); + } + + /// Returns a uint hash code of a int4x2 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(int4x2 v) + { + return csum(asuint(v.c0) * uint4(0xFAAF07DDu, 0x625C45BDu, 0xC9F27FCBu, 0x6D2523B1u) + + asuint(v.c1) * uint4(0x6E2BF6A9u, 0xCC74B3B7u, 0x83B58237u, 0x833E3E29u)) + 0xA9D919BFu; + } + + /// + /// Returns a uint4 vector hash code of a int4x2 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint4 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 hashwide(int4x2 v) + { + return (asuint(v.c0) * uint4(0xC3EC1D97u, 0xB8B208C7u, 0x5D3ED947u, 0x4473BBB1u) + + asuint(v.c1) * uint4(0xCBA11D5Fu, 0x685835CFu, 0xC3D32AE1u, 0xB966942Fu)) + 0xFE9856B3u; + } + + } +} diff --git a/src/Unity.Mathematics/int4x2.gen.cs.meta b/src/Unity.Mathematics/int4x2.gen.cs.meta new file mode 100644 index 00000000..e974efe5 --- /dev/null +++ b/src/Unity.Mathematics/int4x2.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ca7cf71984bec4b9081416653621d6df +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/int4x3.gen.cs b/src/Unity.Mathematics/int4x3.gen.cs new file mode 100644 index 00000000..c6a8e38c --- /dev/null +++ b/src/Unity.Mathematics/int4x3.gen.cs @@ -0,0 +1,752 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 4x3 matrix of ints. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct int4x3 : System.IEquatable, IFormattable + { + /// Column 0 of the matrix. + public int4 c0; + /// Column 1 of the matrix. + public int4 c1; + /// Column 2 of the matrix. + public int4 c2; + + /// int4x3 zero value. + public static readonly int4x3 zero; + + /// Constructs a int4x3 matrix from three int4 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4x3(int4 c0, int4 c1, int4 c2) + { + this.c0 = c0; + this.c1 = c1; + this.c2 = c2; + } + + /// Constructs a int4x3 matrix from 12 int values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 2, column 2 will be set to this value. + /// The matrix at row 3, column 0 will be set to this value. + /// The matrix at row 3, column 1 will be set to this value. + /// The matrix at row 3, column 2 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4x3(int m00, int m01, int m02, + int m10, int m11, int m12, + int m20, int m21, int m22, + int m30, int m31, int m32) + { + this.c0 = new int4(m00, m10, m20, m30); + this.c1 = new int4(m01, m11, m21, m31); + this.c2 = new int4(m02, m12, m22, m32); + } + + /// Constructs a int4x3 matrix from a single int value by assigning it to every component. + /// int to convert to int4x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4x3(int v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + } + + /// Constructs a int4x3 matrix from a single bool value by converting it to int and assigning it to every component. + /// bool to convert to int4x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4x3(bool v) + { + this.c0 = math.select(new int4(0), new int4(1), v); + this.c1 = math.select(new int4(0), new int4(1), v); + this.c2 = math.select(new int4(0), new int4(1), v); + } + + /// Constructs a int4x3 matrix from a bool4x3 matrix by componentwise conversion. + /// bool4x3 to convert to int4x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4x3(bool4x3 v) + { + this.c0 = math.select(new int4(0), new int4(1), v.c0); + this.c1 = math.select(new int4(0), new int4(1), v.c1); + this.c2 = math.select(new int4(0), new int4(1), v.c2); + } + + /// Constructs a int4x3 matrix from a single uint value by converting it to int and assigning it to every component. + /// uint to convert to int4x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4x3(uint v) + { + this.c0 = (int4)v; + this.c1 = (int4)v; + this.c2 = (int4)v; + } + + /// Constructs a int4x3 matrix from a uint4x3 matrix by componentwise conversion. + /// uint4x3 to convert to int4x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4x3(uint4x3 v) + { + this.c0 = (int4)v.c0; + this.c1 = (int4)v.c1; + this.c2 = (int4)v.c2; + } + + /// Constructs a int4x3 matrix from a single float value by converting it to int and assigning it to every component. + /// float to convert to int4x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4x3(float v) + { + this.c0 = (int4)v; + this.c1 = (int4)v; + this.c2 = (int4)v; + } + + /// Constructs a int4x3 matrix from a float4x3 matrix by componentwise conversion. + /// float4x3 to convert to int4x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4x3(float4x3 v) + { + this.c0 = (int4)v.c0; + this.c1 = (int4)v.c1; + this.c2 = (int4)v.c2; + } + + /// Constructs a int4x3 matrix from a single double value by converting it to int and assigning it to every component. + /// double to convert to int4x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4x3(double v) + { + this.c0 = (int4)v; + this.c1 = (int4)v; + this.c2 = (int4)v; + } + + /// Constructs a int4x3 matrix from a double4x3 matrix by componentwise conversion. + /// double4x3 to convert to int4x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4x3(double4x3 v) + { + this.c0 = (int4)v.c0; + this.c1 = (int4)v.c1; + this.c2 = (int4)v.c2; + } + + + /// Implicitly converts a single int value to a int4x3 matrix by assigning it to every component. + /// int to convert to int4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator int4x3(int v) { return new int4x3(v); } + + /// Explicitly converts a single bool value to a int4x3 matrix by converting it to int and assigning it to every component. + /// bool to convert to int4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int4x3(bool v) { return new int4x3(v); } + + /// Explicitly converts a bool4x3 matrix to a int4x3 matrix by componentwise conversion. + /// bool4x3 to convert to int4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int4x3(bool4x3 v) { return new int4x3(v); } + + /// Explicitly converts a single uint value to a int4x3 matrix by converting it to int and assigning it to every component. + /// uint to convert to int4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int4x3(uint v) { return new int4x3(v); } + + /// Explicitly converts a uint4x3 matrix to a int4x3 matrix by componentwise conversion. + /// uint4x3 to convert to int4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int4x3(uint4x3 v) { return new int4x3(v); } + + /// Explicitly converts a single float value to a int4x3 matrix by converting it to int and assigning it to every component. + /// float to convert to int4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int4x3(float v) { return new int4x3(v); } + + /// Explicitly converts a float4x3 matrix to a int4x3 matrix by componentwise conversion. + /// float4x3 to convert to int4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int4x3(float4x3 v) { return new int4x3(v); } + + /// Explicitly converts a single double value to a int4x3 matrix by converting it to int and assigning it to every component. + /// double to convert to int4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int4x3(double v) { return new int4x3(v); } + + /// Explicitly converts a double4x3 matrix to a int4x3 matrix by componentwise conversion. + /// double4x3 to convert to int4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int4x3(double4x3 v) { return new int4x3(v); } + + + /// Returns the result of a componentwise multiplication operation on two int4x3 matrices. + /// Left hand side int4x3 to use to compute componentwise multiplication. + /// Right hand side int4x3 to use to compute componentwise multiplication. + /// int4x3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 operator * (int4x3 lhs, int4x3 rhs) { return new int4x3 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1, lhs.c2 * rhs.c2); } + + /// Returns the result of a componentwise multiplication operation on an int4x3 matrix and an int value. + /// Left hand side int4x3 to use to compute componentwise multiplication. + /// Right hand side int to use to compute componentwise multiplication. + /// int4x3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 operator * (int4x3 lhs, int rhs) { return new int4x3 (lhs.c0 * rhs, lhs.c1 * rhs, lhs.c2 * rhs); } + + /// Returns the result of a componentwise multiplication operation on an int value and an int4x3 matrix. + /// Left hand side int to use to compute componentwise multiplication. + /// Right hand side int4x3 to use to compute componentwise multiplication. + /// int4x3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 operator * (int lhs, int4x3 rhs) { return new int4x3 (lhs * rhs.c0, lhs * rhs.c1, lhs * rhs.c2); } + + + /// Returns the result of a componentwise addition operation on two int4x3 matrices. + /// Left hand side int4x3 to use to compute componentwise addition. + /// Right hand side int4x3 to use to compute componentwise addition. + /// int4x3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 operator + (int4x3 lhs, int4x3 rhs) { return new int4x3 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1, lhs.c2 + rhs.c2); } + + /// Returns the result of a componentwise addition operation on an int4x3 matrix and an int value. + /// Left hand side int4x3 to use to compute componentwise addition. + /// Right hand side int to use to compute componentwise addition. + /// int4x3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 operator + (int4x3 lhs, int rhs) { return new int4x3 (lhs.c0 + rhs, lhs.c1 + rhs, lhs.c2 + rhs); } + + /// Returns the result of a componentwise addition operation on an int value and an int4x3 matrix. + /// Left hand side int to use to compute componentwise addition. + /// Right hand side int4x3 to use to compute componentwise addition. + /// int4x3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 operator + (int lhs, int4x3 rhs) { return new int4x3 (lhs + rhs.c0, lhs + rhs.c1, lhs + rhs.c2); } + + + /// Returns the result of a componentwise subtraction operation on two int4x3 matrices. + /// Left hand side int4x3 to use to compute componentwise subtraction. + /// Right hand side int4x3 to use to compute componentwise subtraction. + /// int4x3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 operator - (int4x3 lhs, int4x3 rhs) { return new int4x3 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1, lhs.c2 - rhs.c2); } + + /// Returns the result of a componentwise subtraction operation on an int4x3 matrix and an int value. + /// Left hand side int4x3 to use to compute componentwise subtraction. + /// Right hand side int to use to compute componentwise subtraction. + /// int4x3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 operator - (int4x3 lhs, int rhs) { return new int4x3 (lhs.c0 - rhs, lhs.c1 - rhs, lhs.c2 - rhs); } + + /// Returns the result of a componentwise subtraction operation on an int value and an int4x3 matrix. + /// Left hand side int to use to compute componentwise subtraction. + /// Right hand side int4x3 to use to compute componentwise subtraction. + /// int4x3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 operator - (int lhs, int4x3 rhs) { return new int4x3 (lhs - rhs.c0, lhs - rhs.c1, lhs - rhs.c2); } + + + /// Returns the result of a componentwise division operation on two int4x3 matrices. + /// Left hand side int4x3 to use to compute componentwise division. + /// Right hand side int4x3 to use to compute componentwise division. + /// int4x3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 operator / (int4x3 lhs, int4x3 rhs) { return new int4x3 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1, lhs.c2 / rhs.c2); } + + /// Returns the result of a componentwise division operation on an int4x3 matrix and an int value. + /// Left hand side int4x3 to use to compute componentwise division. + /// Right hand side int to use to compute componentwise division. + /// int4x3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 operator / (int4x3 lhs, int rhs) { return new int4x3 (lhs.c0 / rhs, lhs.c1 / rhs, lhs.c2 / rhs); } + + /// Returns the result of a componentwise division operation on an int value and an int4x3 matrix. + /// Left hand side int to use to compute componentwise division. + /// Right hand side int4x3 to use to compute componentwise division. + /// int4x3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 operator / (int lhs, int4x3 rhs) { return new int4x3 (lhs / rhs.c0, lhs / rhs.c1, lhs / rhs.c2); } + + + /// Returns the result of a componentwise modulus operation on two int4x3 matrices. + /// Left hand side int4x3 to use to compute componentwise modulus. + /// Right hand side int4x3 to use to compute componentwise modulus. + /// int4x3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 operator % (int4x3 lhs, int4x3 rhs) { return new int4x3 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1, lhs.c2 % rhs.c2); } + + /// Returns the result of a componentwise modulus operation on an int4x3 matrix and an int value. + /// Left hand side int4x3 to use to compute componentwise modulus. + /// Right hand side int to use to compute componentwise modulus. + /// int4x3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 operator % (int4x3 lhs, int rhs) { return new int4x3 (lhs.c0 % rhs, lhs.c1 % rhs, lhs.c2 % rhs); } + + /// Returns the result of a componentwise modulus operation on an int value and an int4x3 matrix. + /// Left hand side int to use to compute componentwise modulus. + /// Right hand side int4x3 to use to compute componentwise modulus. + /// int4x3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 operator % (int lhs, int4x3 rhs) { return new int4x3 (lhs % rhs.c0, lhs % rhs.c1, lhs % rhs.c2); } + + + /// Returns the result of a componentwise increment operation on an int4x3 matrix. + /// Value to use when computing the componentwise increment. + /// int4x3 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 operator ++ (int4x3 val) { return new int4x3 (++val.c0, ++val.c1, ++val.c2); } + + + /// Returns the result of a componentwise decrement operation on an int4x3 matrix. + /// Value to use when computing the componentwise decrement. + /// int4x3 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 operator -- (int4x3 val) { return new int4x3 (--val.c0, --val.c1, --val.c2); } + + + /// Returns the result of a componentwise less than operation on two int4x3 matrices. + /// Left hand side int4x3 to use to compute componentwise less than. + /// Right hand side int4x3 to use to compute componentwise less than. + /// bool4x3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator < (int4x3 lhs, int4x3 rhs) { return new bool4x3 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1, lhs.c2 < rhs.c2); } + + /// Returns the result of a componentwise less than operation on an int4x3 matrix and an int value. + /// Left hand side int4x3 to use to compute componentwise less than. + /// Right hand side int to use to compute componentwise less than. + /// bool4x3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator < (int4x3 lhs, int rhs) { return new bool4x3 (lhs.c0 < rhs, lhs.c1 < rhs, lhs.c2 < rhs); } + + /// Returns the result of a componentwise less than operation on an int value and an int4x3 matrix. + /// Left hand side int to use to compute componentwise less than. + /// Right hand side int4x3 to use to compute componentwise less than. + /// bool4x3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator < (int lhs, int4x3 rhs) { return new bool4x3 (lhs < rhs.c0, lhs < rhs.c1, lhs < rhs.c2); } + + + /// Returns the result of a componentwise less or equal operation on two int4x3 matrices. + /// Left hand side int4x3 to use to compute componentwise less or equal. + /// Right hand side int4x3 to use to compute componentwise less or equal. + /// bool4x3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator <= (int4x3 lhs, int4x3 rhs) { return new bool4x3 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1, lhs.c2 <= rhs.c2); } + + /// Returns the result of a componentwise less or equal operation on an int4x3 matrix and an int value. + /// Left hand side int4x3 to use to compute componentwise less or equal. + /// Right hand side int to use to compute componentwise less or equal. + /// bool4x3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator <= (int4x3 lhs, int rhs) { return new bool4x3 (lhs.c0 <= rhs, lhs.c1 <= rhs, lhs.c2 <= rhs); } + + /// Returns the result of a componentwise less or equal operation on an int value and an int4x3 matrix. + /// Left hand side int to use to compute componentwise less or equal. + /// Right hand side int4x3 to use to compute componentwise less or equal. + /// bool4x3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator <= (int lhs, int4x3 rhs) { return new bool4x3 (lhs <= rhs.c0, lhs <= rhs.c1, lhs <= rhs.c2); } + + + /// Returns the result of a componentwise greater than operation on two int4x3 matrices. + /// Left hand side int4x3 to use to compute componentwise greater than. + /// Right hand side int4x3 to use to compute componentwise greater than. + /// bool4x3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator > (int4x3 lhs, int4x3 rhs) { return new bool4x3 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1, lhs.c2 > rhs.c2); } + + /// Returns the result of a componentwise greater than operation on an int4x3 matrix and an int value. + /// Left hand side int4x3 to use to compute componentwise greater than. + /// Right hand side int to use to compute componentwise greater than. + /// bool4x3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator > (int4x3 lhs, int rhs) { return new bool4x3 (lhs.c0 > rhs, lhs.c1 > rhs, lhs.c2 > rhs); } + + /// Returns the result of a componentwise greater than operation on an int value and an int4x3 matrix. + /// Left hand side int to use to compute componentwise greater than. + /// Right hand side int4x3 to use to compute componentwise greater than. + /// bool4x3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator > (int lhs, int4x3 rhs) { return new bool4x3 (lhs > rhs.c0, lhs > rhs.c1, lhs > rhs.c2); } + + + /// Returns the result of a componentwise greater or equal operation on two int4x3 matrices. + /// Left hand side int4x3 to use to compute componentwise greater or equal. + /// Right hand side int4x3 to use to compute componentwise greater or equal. + /// bool4x3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator >= (int4x3 lhs, int4x3 rhs) { return new bool4x3 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1, lhs.c2 >= rhs.c2); } + + /// Returns the result of a componentwise greater or equal operation on an int4x3 matrix and an int value. + /// Left hand side int4x3 to use to compute componentwise greater or equal. + /// Right hand side int to use to compute componentwise greater or equal. + /// bool4x3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator >= (int4x3 lhs, int rhs) { return new bool4x3 (lhs.c0 >= rhs, lhs.c1 >= rhs, lhs.c2 >= rhs); } + + /// Returns the result of a componentwise greater or equal operation on an int value and an int4x3 matrix. + /// Left hand side int to use to compute componentwise greater or equal. + /// Right hand side int4x3 to use to compute componentwise greater or equal. + /// bool4x3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator >= (int lhs, int4x3 rhs) { return new bool4x3 (lhs >= rhs.c0, lhs >= rhs.c1, lhs >= rhs.c2); } + + + /// Returns the result of a componentwise unary minus operation on an int4x3 matrix. + /// Value to use when computing the componentwise unary minus. + /// int4x3 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 operator - (int4x3 val) { return new int4x3 (-val.c0, -val.c1, -val.c2); } + + + /// Returns the result of a componentwise unary plus operation on an int4x3 matrix. + /// Value to use when computing the componentwise unary plus. + /// int4x3 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 operator + (int4x3 val) { return new int4x3 (+val.c0, +val.c1, +val.c2); } + + + /// Returns the result of a componentwise left shift operation on an int4x3 matrix by a number of bits specified by a single int. + /// The matrix to left shift. + /// The number of bits to left shift. + /// The result of the componentwise left shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 operator << (int4x3 x, int n) { return new int4x3 (x.c0 << n, x.c1 << n, x.c2 << n); } + + /// Returns the result of a componentwise right shift operation on an int4x3 matrix by a number of bits specified by a single int. + /// The matrix to right shift. + /// The number of bits to right shift. + /// The result of the componentwise right shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 operator >> (int4x3 x, int n) { return new int4x3 (x.c0 >> n, x.c1 >> n, x.c2 >> n); } + + /// Returns the result of a componentwise equality operation on two int4x3 matrices. + /// Left hand side int4x3 to use to compute componentwise equality. + /// Right hand side int4x3 to use to compute componentwise equality. + /// bool4x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator == (int4x3 lhs, int4x3 rhs) { return new bool4x3 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2); } + + /// Returns the result of a componentwise equality operation on an int4x3 matrix and an int value. + /// Left hand side int4x3 to use to compute componentwise equality. + /// Right hand side int to use to compute componentwise equality. + /// bool4x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator == (int4x3 lhs, int rhs) { return new bool4x3 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs); } + + /// Returns the result of a componentwise equality operation on an int value and an int4x3 matrix. + /// Left hand side int to use to compute componentwise equality. + /// Right hand side int4x3 to use to compute componentwise equality. + /// bool4x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator == (int lhs, int4x3 rhs) { return new bool4x3 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2); } + + + /// Returns the result of a componentwise not equal operation on two int4x3 matrices. + /// Left hand side int4x3 to use to compute componentwise not equal. + /// Right hand side int4x3 to use to compute componentwise not equal. + /// bool4x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator != (int4x3 lhs, int4x3 rhs) { return new bool4x3 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2); } + + /// Returns the result of a componentwise not equal operation on an int4x3 matrix and an int value. + /// Left hand side int4x3 to use to compute componentwise not equal. + /// Right hand side int to use to compute componentwise not equal. + /// bool4x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator != (int4x3 lhs, int rhs) { return new bool4x3 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs); } + + /// Returns the result of a componentwise not equal operation on an int value and an int4x3 matrix. + /// Left hand side int to use to compute componentwise not equal. + /// Right hand side int4x3 to use to compute componentwise not equal. + /// bool4x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator != (int lhs, int4x3 rhs) { return new bool4x3 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2); } + + + /// Returns the result of a componentwise bitwise not operation on an int4x3 matrix. + /// Value to use when computing the componentwise bitwise not. + /// int4x3 result of the componentwise bitwise not. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 operator ~ (int4x3 val) { return new int4x3 (~val.c0, ~val.c1, ~val.c2); } + + + /// Returns the result of a componentwise bitwise and operation on two int4x3 matrices. + /// Left hand side int4x3 to use to compute componentwise bitwise and. + /// Right hand side int4x3 to use to compute componentwise bitwise and. + /// int4x3 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 operator & (int4x3 lhs, int4x3 rhs) { return new int4x3 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1, lhs.c2 & rhs.c2); } + + /// Returns the result of a componentwise bitwise and operation on an int4x3 matrix and an int value. + /// Left hand side int4x3 to use to compute componentwise bitwise and. + /// Right hand side int to use to compute componentwise bitwise and. + /// int4x3 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 operator & (int4x3 lhs, int rhs) { return new int4x3 (lhs.c0 & rhs, lhs.c1 & rhs, lhs.c2 & rhs); } + + /// Returns the result of a componentwise bitwise and operation on an int value and an int4x3 matrix. + /// Left hand side int to use to compute componentwise bitwise and. + /// Right hand side int4x3 to use to compute componentwise bitwise and. + /// int4x3 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 operator & (int lhs, int4x3 rhs) { return new int4x3 (lhs & rhs.c0, lhs & rhs.c1, lhs & rhs.c2); } + + + /// Returns the result of a componentwise bitwise or operation on two int4x3 matrices. + /// Left hand side int4x3 to use to compute componentwise bitwise or. + /// Right hand side int4x3 to use to compute componentwise bitwise or. + /// int4x3 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 operator | (int4x3 lhs, int4x3 rhs) { return new int4x3 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1, lhs.c2 | rhs.c2); } + + /// Returns the result of a componentwise bitwise or operation on an int4x3 matrix and an int value. + /// Left hand side int4x3 to use to compute componentwise bitwise or. + /// Right hand side int to use to compute componentwise bitwise or. + /// int4x3 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 operator | (int4x3 lhs, int rhs) { return new int4x3 (lhs.c0 | rhs, lhs.c1 | rhs, lhs.c2 | rhs); } + + /// Returns the result of a componentwise bitwise or operation on an int value and an int4x3 matrix. + /// Left hand side int to use to compute componentwise bitwise or. + /// Right hand side int4x3 to use to compute componentwise bitwise or. + /// int4x3 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 operator | (int lhs, int4x3 rhs) { return new int4x3 (lhs | rhs.c0, lhs | rhs.c1, lhs | rhs.c2); } + + + /// Returns the result of a componentwise bitwise exclusive or operation on two int4x3 matrices. + /// Left hand side int4x3 to use to compute componentwise bitwise exclusive or. + /// Right hand side int4x3 to use to compute componentwise bitwise exclusive or. + /// int4x3 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 operator ^ (int4x3 lhs, int4x3 rhs) { return new int4x3 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1, lhs.c2 ^ rhs.c2); } + + /// Returns the result of a componentwise bitwise exclusive or operation on an int4x3 matrix and an int value. + /// Left hand side int4x3 to use to compute componentwise bitwise exclusive or. + /// Right hand side int to use to compute componentwise bitwise exclusive or. + /// int4x3 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 operator ^ (int4x3 lhs, int rhs) { return new int4x3 (lhs.c0 ^ rhs, lhs.c1 ^ rhs, lhs.c2 ^ rhs); } + + /// Returns the result of a componentwise bitwise exclusive or operation on an int value and an int4x3 matrix. + /// Left hand side int to use to compute componentwise bitwise exclusive or. + /// Right hand side int4x3 to use to compute componentwise bitwise exclusive or. + /// int4x3 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 operator ^ (int lhs, int4x3 rhs) { return new int4x3 (lhs ^ rhs.c0, lhs ^ rhs.c1, lhs ^ rhs.c2); } + + + + /// Returns the int4 element at a specified index. + unsafe public ref int4 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 3) + throw new System.ArgumentException("index must be between[0...2]"); +#endif + fixed (int4x3* array = &this) { return ref ((int4*)array)[index]; } + } + } + + /// Returns true if the int4x3 is equal to a given int4x3, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(int4x3 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2); } + + /// Returns true if the int4x3 is equal to a given int4x3, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is int4x3 converted && Equals(converted); } + + + /// Returns a hash code for the int4x3. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the int4x3. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("int4x3({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11})", c0.x, c1.x, c2.x, c0.y, c1.y, c2.y, c0.z, c1.z, c2.z, c0.w, c1.w, c2.w); + } + + /// Returns a string representation of the int4x3 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("int4x3({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11})", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c2.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c2.y.ToString(format, formatProvider), c0.z.ToString(format, formatProvider), c1.z.ToString(format, formatProvider), c2.z.ToString(format, formatProvider), c0.w.ToString(format, formatProvider), c1.w.ToString(format, formatProvider), c2.w.ToString(format, formatProvider)); + } + + } + + public static partial class math + { + /// Returns a int4x3 matrix constructed from three int4 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// int4x3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 int4x3(int4 c0, int4 c1, int4 c2) { return new int4x3(c0, c1, c2); } + + /// Returns a int4x3 matrix constructed from from 12 int values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 2, column 2 will be set to this value. + /// The matrix at row 3, column 0 will be set to this value. + /// The matrix at row 3, column 1 will be set to this value. + /// The matrix at row 3, column 2 will be set to this value. + /// int4x3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 int4x3(int m00, int m01, int m02, + int m10, int m11, int m12, + int m20, int m21, int m22, + int m30, int m31, int m32) + { + return new int4x3(m00, m01, m02, + m10, m11, m12, + m20, m21, m22, + m30, m31, m32); + } + + /// Returns a int4x3 matrix constructed from a single int value by assigning it to every component. + /// int to convert to int4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 int4x3(int v) { return new int4x3(v); } + + /// Returns a int4x3 matrix constructed from a single bool value by converting it to int and assigning it to every component. + /// bool to convert to int4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 int4x3(bool v) { return new int4x3(v); } + + /// Return a int4x3 matrix constructed from a bool4x3 matrix by componentwise conversion. + /// bool4x3 to convert to int4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 int4x3(bool4x3 v) { return new int4x3(v); } + + /// Returns a int4x3 matrix constructed from a single uint value by converting it to int and assigning it to every component. + /// uint to convert to int4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 int4x3(uint v) { return new int4x3(v); } + + /// Return a int4x3 matrix constructed from a uint4x3 matrix by componentwise conversion. + /// uint4x3 to convert to int4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 int4x3(uint4x3 v) { return new int4x3(v); } + + /// Returns a int4x3 matrix constructed from a single float value by converting it to int and assigning it to every component. + /// float to convert to int4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 int4x3(float v) { return new int4x3(v); } + + /// Return a int4x3 matrix constructed from a float4x3 matrix by componentwise conversion. + /// float4x3 to convert to int4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 int4x3(float4x3 v) { return new int4x3(v); } + + /// Returns a int4x3 matrix constructed from a single double value by converting it to int and assigning it to every component. + /// double to convert to int4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 int4x3(double v) { return new int4x3(v); } + + /// Return a int4x3 matrix constructed from a double4x3 matrix by componentwise conversion. + /// double4x3 to convert to int4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 int4x3(double4x3 v) { return new int4x3(v); } + + /// Return the int3x4 transpose of a int4x3 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 transpose(int4x3 v) + { + return int3x4( + v.c0.x, v.c0.y, v.c0.z, v.c0.w, + v.c1.x, v.c1.y, v.c1.z, v.c1.w, + v.c2.x, v.c2.y, v.c2.z, v.c2.w); + } + + /// Returns a uint hash code of a int4x3 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(int4x3 v) + { + return csum(asuint(v.c0) * uint4(0x69B60C81u, 0xE0EB6C25u, 0xF648BEABu, 0x6BDB2B07u) + + asuint(v.c1) * uint4(0xEF63C699u, 0x9001903Fu, 0xA895B9CDu, 0x9D23B201u) + + asuint(v.c2) * uint4(0x4B01D3E1u, 0x7461CA0Du, 0x79725379u, 0xD6258E5Bu)) + 0xEE390C97u; + } + + /// + /// Returns a uint4 vector hash code of a int4x3 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint4 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 hashwide(int4x3 v) + { + return (asuint(v.c0) * uint4(0x9C8A2F05u, 0x4DDC6509u, 0x7CF083CBu, 0x5C4D6CEDu) + + asuint(v.c1) * uint4(0xF9137117u, 0xE857DCE1u, 0xF62213C5u, 0x9CDAA959u) + + asuint(v.c2) * uint4(0xAA269ABFu, 0xD54BA36Fu, 0xFD0847B9u, 0x8189A683u)) + 0xB139D651u; + } + + } +} diff --git a/src/Unity.Mathematics/int4x3.gen.cs.meta b/src/Unity.Mathematics/int4x3.gen.cs.meta new file mode 100644 index 00000000..f6d07ecb --- /dev/null +++ b/src/Unity.Mathematics/int4x3.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 625f7c407b9c1474bbfcb1c17db16571 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/int4x4.gen.cs b/src/Unity.Mathematics/int4x4.gen.cs new file mode 100644 index 00000000..7d0d38a9 --- /dev/null +++ b/src/Unity.Mathematics/int4x4.gen.cs @@ -0,0 +1,799 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 4x4 matrix of ints. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct int4x4 : System.IEquatable, IFormattable + { + /// Column 0 of the matrix. + public int4 c0; + /// Column 1 of the matrix. + public int4 c1; + /// Column 2 of the matrix. + public int4 c2; + /// Column 3 of the matrix. + public int4 c3; + + /// int4x4 identity transform. + public static readonly int4x4 identity = new int4x4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); + + /// int4x4 zero value. + public static readonly int4x4 zero; + + /// Constructs a int4x4 matrix from four int4 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// The matrix column c3 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4x4(int4 c0, int4 c1, int4 c2, int4 c3) + { + this.c0 = c0; + this.c1 = c1; + this.c2 = c2; + this.c3 = c3; + } + + /// Constructs a int4x4 matrix from 16 int values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 0, column 3 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 1, column 3 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 2, column 2 will be set to this value. + /// The matrix at row 2, column 3 will be set to this value. + /// The matrix at row 3, column 0 will be set to this value. + /// The matrix at row 3, column 1 will be set to this value. + /// The matrix at row 3, column 2 will be set to this value. + /// The matrix at row 3, column 3 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4x4(int m00, int m01, int m02, int m03, + int m10, int m11, int m12, int m13, + int m20, int m21, int m22, int m23, + int m30, int m31, int m32, int m33) + { + this.c0 = new int4(m00, m10, m20, m30); + this.c1 = new int4(m01, m11, m21, m31); + this.c2 = new int4(m02, m12, m22, m32); + this.c3 = new int4(m03, m13, m23, m33); + } + + /// Constructs a int4x4 matrix from a single int value by assigning it to every component. + /// int to convert to int4x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4x4(int v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + this.c3 = v; + } + + /// Constructs a int4x4 matrix from a single bool value by converting it to int and assigning it to every component. + /// bool to convert to int4x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4x4(bool v) + { + this.c0 = math.select(new int4(0), new int4(1), v); + this.c1 = math.select(new int4(0), new int4(1), v); + this.c2 = math.select(new int4(0), new int4(1), v); + this.c3 = math.select(new int4(0), new int4(1), v); + } + + /// Constructs a int4x4 matrix from a bool4x4 matrix by componentwise conversion. + /// bool4x4 to convert to int4x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4x4(bool4x4 v) + { + this.c0 = math.select(new int4(0), new int4(1), v.c0); + this.c1 = math.select(new int4(0), new int4(1), v.c1); + this.c2 = math.select(new int4(0), new int4(1), v.c2); + this.c3 = math.select(new int4(0), new int4(1), v.c3); + } + + /// Constructs a int4x4 matrix from a single uint value by converting it to int and assigning it to every component. + /// uint to convert to int4x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4x4(uint v) + { + this.c0 = (int4)v; + this.c1 = (int4)v; + this.c2 = (int4)v; + this.c3 = (int4)v; + } + + /// Constructs a int4x4 matrix from a uint4x4 matrix by componentwise conversion. + /// uint4x4 to convert to int4x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4x4(uint4x4 v) + { + this.c0 = (int4)v.c0; + this.c1 = (int4)v.c1; + this.c2 = (int4)v.c2; + this.c3 = (int4)v.c3; + } + + /// Constructs a int4x4 matrix from a single float value by converting it to int and assigning it to every component. + /// float to convert to int4x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4x4(float v) + { + this.c0 = (int4)v; + this.c1 = (int4)v; + this.c2 = (int4)v; + this.c3 = (int4)v; + } + + /// Constructs a int4x4 matrix from a float4x4 matrix by componentwise conversion. + /// float4x4 to convert to int4x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4x4(float4x4 v) + { + this.c0 = (int4)v.c0; + this.c1 = (int4)v.c1; + this.c2 = (int4)v.c2; + this.c3 = (int4)v.c3; + } + + /// Constructs a int4x4 matrix from a single double value by converting it to int and assigning it to every component. + /// double to convert to int4x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4x4(double v) + { + this.c0 = (int4)v; + this.c1 = (int4)v; + this.c2 = (int4)v; + this.c3 = (int4)v; + } + + /// Constructs a int4x4 matrix from a double4x4 matrix by componentwise conversion. + /// double4x4 to convert to int4x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4x4(double4x4 v) + { + this.c0 = (int4)v.c0; + this.c1 = (int4)v.c1; + this.c2 = (int4)v.c2; + this.c3 = (int4)v.c3; + } + + + /// Implicitly converts a single int value to a int4x4 matrix by assigning it to every component. + /// int to convert to int4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator int4x4(int v) { return new int4x4(v); } + + /// Explicitly converts a single bool value to a int4x4 matrix by converting it to int and assigning it to every component. + /// bool to convert to int4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int4x4(bool v) { return new int4x4(v); } + + /// Explicitly converts a bool4x4 matrix to a int4x4 matrix by componentwise conversion. + /// bool4x4 to convert to int4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int4x4(bool4x4 v) { return new int4x4(v); } + + /// Explicitly converts a single uint value to a int4x4 matrix by converting it to int and assigning it to every component. + /// uint to convert to int4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int4x4(uint v) { return new int4x4(v); } + + /// Explicitly converts a uint4x4 matrix to a int4x4 matrix by componentwise conversion. + /// uint4x4 to convert to int4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int4x4(uint4x4 v) { return new int4x4(v); } + + /// Explicitly converts a single float value to a int4x4 matrix by converting it to int and assigning it to every component. + /// float to convert to int4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int4x4(float v) { return new int4x4(v); } + + /// Explicitly converts a float4x4 matrix to a int4x4 matrix by componentwise conversion. + /// float4x4 to convert to int4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int4x4(float4x4 v) { return new int4x4(v); } + + /// Explicitly converts a single double value to a int4x4 matrix by converting it to int and assigning it to every component. + /// double to convert to int4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int4x4(double v) { return new int4x4(v); } + + /// Explicitly converts a double4x4 matrix to a int4x4 matrix by componentwise conversion. + /// double4x4 to convert to int4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator int4x4(double4x4 v) { return new int4x4(v); } + + + /// Returns the result of a componentwise multiplication operation on two int4x4 matrices. + /// Left hand side int4x4 to use to compute componentwise multiplication. + /// Right hand side int4x4 to use to compute componentwise multiplication. + /// int4x4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 operator * (int4x4 lhs, int4x4 rhs) { return new int4x4 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1, lhs.c2 * rhs.c2, lhs.c3 * rhs.c3); } + + /// Returns the result of a componentwise multiplication operation on an int4x4 matrix and an int value. + /// Left hand side int4x4 to use to compute componentwise multiplication. + /// Right hand side int to use to compute componentwise multiplication. + /// int4x4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 operator * (int4x4 lhs, int rhs) { return new int4x4 (lhs.c0 * rhs, lhs.c1 * rhs, lhs.c2 * rhs, lhs.c3 * rhs); } + + /// Returns the result of a componentwise multiplication operation on an int value and an int4x4 matrix. + /// Left hand side int to use to compute componentwise multiplication. + /// Right hand side int4x4 to use to compute componentwise multiplication. + /// int4x4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 operator * (int lhs, int4x4 rhs) { return new int4x4 (lhs * rhs.c0, lhs * rhs.c1, lhs * rhs.c2, lhs * rhs.c3); } + + + /// Returns the result of a componentwise addition operation on two int4x4 matrices. + /// Left hand side int4x4 to use to compute componentwise addition. + /// Right hand side int4x4 to use to compute componentwise addition. + /// int4x4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 operator + (int4x4 lhs, int4x4 rhs) { return new int4x4 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1, lhs.c2 + rhs.c2, lhs.c3 + rhs.c3); } + + /// Returns the result of a componentwise addition operation on an int4x4 matrix and an int value. + /// Left hand side int4x4 to use to compute componentwise addition. + /// Right hand side int to use to compute componentwise addition. + /// int4x4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 operator + (int4x4 lhs, int rhs) { return new int4x4 (lhs.c0 + rhs, lhs.c1 + rhs, lhs.c2 + rhs, lhs.c3 + rhs); } + + /// Returns the result of a componentwise addition operation on an int value and an int4x4 matrix. + /// Left hand side int to use to compute componentwise addition. + /// Right hand side int4x4 to use to compute componentwise addition. + /// int4x4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 operator + (int lhs, int4x4 rhs) { return new int4x4 (lhs + rhs.c0, lhs + rhs.c1, lhs + rhs.c2, lhs + rhs.c3); } + + + /// Returns the result of a componentwise subtraction operation on two int4x4 matrices. + /// Left hand side int4x4 to use to compute componentwise subtraction. + /// Right hand side int4x4 to use to compute componentwise subtraction. + /// int4x4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 operator - (int4x4 lhs, int4x4 rhs) { return new int4x4 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1, lhs.c2 - rhs.c2, lhs.c3 - rhs.c3); } + + /// Returns the result of a componentwise subtraction operation on an int4x4 matrix and an int value. + /// Left hand side int4x4 to use to compute componentwise subtraction. + /// Right hand side int to use to compute componentwise subtraction. + /// int4x4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 operator - (int4x4 lhs, int rhs) { return new int4x4 (lhs.c0 - rhs, lhs.c1 - rhs, lhs.c2 - rhs, lhs.c3 - rhs); } + + /// Returns the result of a componentwise subtraction operation on an int value and an int4x4 matrix. + /// Left hand side int to use to compute componentwise subtraction. + /// Right hand side int4x4 to use to compute componentwise subtraction. + /// int4x4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 operator - (int lhs, int4x4 rhs) { return new int4x4 (lhs - rhs.c0, lhs - rhs.c1, lhs - rhs.c2, lhs - rhs.c3); } + + + /// Returns the result of a componentwise division operation on two int4x4 matrices. + /// Left hand side int4x4 to use to compute componentwise division. + /// Right hand side int4x4 to use to compute componentwise division. + /// int4x4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 operator / (int4x4 lhs, int4x4 rhs) { return new int4x4 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1, lhs.c2 / rhs.c2, lhs.c3 / rhs.c3); } + + /// Returns the result of a componentwise division operation on an int4x4 matrix and an int value. + /// Left hand side int4x4 to use to compute componentwise division. + /// Right hand side int to use to compute componentwise division. + /// int4x4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 operator / (int4x4 lhs, int rhs) { return new int4x4 (lhs.c0 / rhs, lhs.c1 / rhs, lhs.c2 / rhs, lhs.c3 / rhs); } + + /// Returns the result of a componentwise division operation on an int value and an int4x4 matrix. + /// Left hand side int to use to compute componentwise division. + /// Right hand side int4x4 to use to compute componentwise division. + /// int4x4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 operator / (int lhs, int4x4 rhs) { return new int4x4 (lhs / rhs.c0, lhs / rhs.c1, lhs / rhs.c2, lhs / rhs.c3); } + + + /// Returns the result of a componentwise modulus operation on two int4x4 matrices. + /// Left hand side int4x4 to use to compute componentwise modulus. + /// Right hand side int4x4 to use to compute componentwise modulus. + /// int4x4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 operator % (int4x4 lhs, int4x4 rhs) { return new int4x4 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1, lhs.c2 % rhs.c2, lhs.c3 % rhs.c3); } + + /// Returns the result of a componentwise modulus operation on an int4x4 matrix and an int value. + /// Left hand side int4x4 to use to compute componentwise modulus. + /// Right hand side int to use to compute componentwise modulus. + /// int4x4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 operator % (int4x4 lhs, int rhs) { return new int4x4 (lhs.c0 % rhs, lhs.c1 % rhs, lhs.c2 % rhs, lhs.c3 % rhs); } + + /// Returns the result of a componentwise modulus operation on an int value and an int4x4 matrix. + /// Left hand side int to use to compute componentwise modulus. + /// Right hand side int4x4 to use to compute componentwise modulus. + /// int4x4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 operator % (int lhs, int4x4 rhs) { return new int4x4 (lhs % rhs.c0, lhs % rhs.c1, lhs % rhs.c2, lhs % rhs.c3); } + + + /// Returns the result of a componentwise increment operation on an int4x4 matrix. + /// Value to use when computing the componentwise increment. + /// int4x4 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 operator ++ (int4x4 val) { return new int4x4 (++val.c0, ++val.c1, ++val.c2, ++val.c3); } + + + /// Returns the result of a componentwise decrement operation on an int4x4 matrix. + /// Value to use when computing the componentwise decrement. + /// int4x4 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 operator -- (int4x4 val) { return new int4x4 (--val.c0, --val.c1, --val.c2, --val.c3); } + + + /// Returns the result of a componentwise less than operation on two int4x4 matrices. + /// Left hand side int4x4 to use to compute componentwise less than. + /// Right hand side int4x4 to use to compute componentwise less than. + /// bool4x4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator < (int4x4 lhs, int4x4 rhs) { return new bool4x4 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1, lhs.c2 < rhs.c2, lhs.c3 < rhs.c3); } + + /// Returns the result of a componentwise less than operation on an int4x4 matrix and an int value. + /// Left hand side int4x4 to use to compute componentwise less than. + /// Right hand side int to use to compute componentwise less than. + /// bool4x4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator < (int4x4 lhs, int rhs) { return new bool4x4 (lhs.c0 < rhs, lhs.c1 < rhs, lhs.c2 < rhs, lhs.c3 < rhs); } + + /// Returns the result of a componentwise less than operation on an int value and an int4x4 matrix. + /// Left hand side int to use to compute componentwise less than. + /// Right hand side int4x4 to use to compute componentwise less than. + /// bool4x4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator < (int lhs, int4x4 rhs) { return new bool4x4 (lhs < rhs.c0, lhs < rhs.c1, lhs < rhs.c2, lhs < rhs.c3); } + + + /// Returns the result of a componentwise less or equal operation on two int4x4 matrices. + /// Left hand side int4x4 to use to compute componentwise less or equal. + /// Right hand side int4x4 to use to compute componentwise less or equal. + /// bool4x4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator <= (int4x4 lhs, int4x4 rhs) { return new bool4x4 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1, lhs.c2 <= rhs.c2, lhs.c3 <= rhs.c3); } + + /// Returns the result of a componentwise less or equal operation on an int4x4 matrix and an int value. + /// Left hand side int4x4 to use to compute componentwise less or equal. + /// Right hand side int to use to compute componentwise less or equal. + /// bool4x4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator <= (int4x4 lhs, int rhs) { return new bool4x4 (lhs.c0 <= rhs, lhs.c1 <= rhs, lhs.c2 <= rhs, lhs.c3 <= rhs); } + + /// Returns the result of a componentwise less or equal operation on an int value and an int4x4 matrix. + /// Left hand side int to use to compute componentwise less or equal. + /// Right hand side int4x4 to use to compute componentwise less or equal. + /// bool4x4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator <= (int lhs, int4x4 rhs) { return new bool4x4 (lhs <= rhs.c0, lhs <= rhs.c1, lhs <= rhs.c2, lhs <= rhs.c3); } + + + /// Returns the result of a componentwise greater than operation on two int4x4 matrices. + /// Left hand side int4x4 to use to compute componentwise greater than. + /// Right hand side int4x4 to use to compute componentwise greater than. + /// bool4x4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator > (int4x4 lhs, int4x4 rhs) { return new bool4x4 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1, lhs.c2 > rhs.c2, lhs.c3 > rhs.c3); } + + /// Returns the result of a componentwise greater than operation on an int4x4 matrix and an int value. + /// Left hand side int4x4 to use to compute componentwise greater than. + /// Right hand side int to use to compute componentwise greater than. + /// bool4x4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator > (int4x4 lhs, int rhs) { return new bool4x4 (lhs.c0 > rhs, lhs.c1 > rhs, lhs.c2 > rhs, lhs.c3 > rhs); } + + /// Returns the result of a componentwise greater than operation on an int value and an int4x4 matrix. + /// Left hand side int to use to compute componentwise greater than. + /// Right hand side int4x4 to use to compute componentwise greater than. + /// bool4x4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator > (int lhs, int4x4 rhs) { return new bool4x4 (lhs > rhs.c0, lhs > rhs.c1, lhs > rhs.c2, lhs > rhs.c3); } + + + /// Returns the result of a componentwise greater or equal operation on two int4x4 matrices. + /// Left hand side int4x4 to use to compute componentwise greater or equal. + /// Right hand side int4x4 to use to compute componentwise greater or equal. + /// bool4x4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator >= (int4x4 lhs, int4x4 rhs) { return new bool4x4 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1, lhs.c2 >= rhs.c2, lhs.c3 >= rhs.c3); } + + /// Returns the result of a componentwise greater or equal operation on an int4x4 matrix and an int value. + /// Left hand side int4x4 to use to compute componentwise greater or equal. + /// Right hand side int to use to compute componentwise greater or equal. + /// bool4x4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator >= (int4x4 lhs, int rhs) { return new bool4x4 (lhs.c0 >= rhs, lhs.c1 >= rhs, lhs.c2 >= rhs, lhs.c3 >= rhs); } + + /// Returns the result of a componentwise greater or equal operation on an int value and an int4x4 matrix. + /// Left hand side int to use to compute componentwise greater or equal. + /// Right hand side int4x4 to use to compute componentwise greater or equal. + /// bool4x4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator >= (int lhs, int4x4 rhs) { return new bool4x4 (lhs >= rhs.c0, lhs >= rhs.c1, lhs >= rhs.c2, lhs >= rhs.c3); } + + + /// Returns the result of a componentwise unary minus operation on an int4x4 matrix. + /// Value to use when computing the componentwise unary minus. + /// int4x4 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 operator - (int4x4 val) { return new int4x4 (-val.c0, -val.c1, -val.c2, -val.c3); } + + + /// Returns the result of a componentwise unary plus operation on an int4x4 matrix. + /// Value to use when computing the componentwise unary plus. + /// int4x4 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 operator + (int4x4 val) { return new int4x4 (+val.c0, +val.c1, +val.c2, +val.c3); } + + + /// Returns the result of a componentwise left shift operation on an int4x4 matrix by a number of bits specified by a single int. + /// The matrix to left shift. + /// The number of bits to left shift. + /// The result of the componentwise left shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 operator << (int4x4 x, int n) { return new int4x4 (x.c0 << n, x.c1 << n, x.c2 << n, x.c3 << n); } + + /// Returns the result of a componentwise right shift operation on an int4x4 matrix by a number of bits specified by a single int. + /// The matrix to right shift. + /// The number of bits to right shift. + /// The result of the componentwise right shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 operator >> (int4x4 x, int n) { return new int4x4 (x.c0 >> n, x.c1 >> n, x.c2 >> n, x.c3 >> n); } + + /// Returns the result of a componentwise equality operation on two int4x4 matrices. + /// Left hand side int4x4 to use to compute componentwise equality. + /// Right hand side int4x4 to use to compute componentwise equality. + /// bool4x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator == (int4x4 lhs, int4x4 rhs) { return new bool4x4 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2, lhs.c3 == rhs.c3); } + + /// Returns the result of a componentwise equality operation on an int4x4 matrix and an int value. + /// Left hand side int4x4 to use to compute componentwise equality. + /// Right hand side int to use to compute componentwise equality. + /// bool4x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator == (int4x4 lhs, int rhs) { return new bool4x4 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs, lhs.c3 == rhs); } + + /// Returns the result of a componentwise equality operation on an int value and an int4x4 matrix. + /// Left hand side int to use to compute componentwise equality. + /// Right hand side int4x4 to use to compute componentwise equality. + /// bool4x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator == (int lhs, int4x4 rhs) { return new bool4x4 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2, lhs == rhs.c3); } + + + /// Returns the result of a componentwise not equal operation on two int4x4 matrices. + /// Left hand side int4x4 to use to compute componentwise not equal. + /// Right hand side int4x4 to use to compute componentwise not equal. + /// bool4x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator != (int4x4 lhs, int4x4 rhs) { return new bool4x4 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2, lhs.c3 != rhs.c3); } + + /// Returns the result of a componentwise not equal operation on an int4x4 matrix and an int value. + /// Left hand side int4x4 to use to compute componentwise not equal. + /// Right hand side int to use to compute componentwise not equal. + /// bool4x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator != (int4x4 lhs, int rhs) { return new bool4x4 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs, lhs.c3 != rhs); } + + /// Returns the result of a componentwise not equal operation on an int value and an int4x4 matrix. + /// Left hand side int to use to compute componentwise not equal. + /// Right hand side int4x4 to use to compute componentwise not equal. + /// bool4x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator != (int lhs, int4x4 rhs) { return new bool4x4 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2, lhs != rhs.c3); } + + + /// Returns the result of a componentwise bitwise not operation on an int4x4 matrix. + /// Value to use when computing the componentwise bitwise not. + /// int4x4 result of the componentwise bitwise not. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 operator ~ (int4x4 val) { return new int4x4 (~val.c0, ~val.c1, ~val.c2, ~val.c3); } + + + /// Returns the result of a componentwise bitwise and operation on two int4x4 matrices. + /// Left hand side int4x4 to use to compute componentwise bitwise and. + /// Right hand side int4x4 to use to compute componentwise bitwise and. + /// int4x4 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 operator & (int4x4 lhs, int4x4 rhs) { return new int4x4 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1, lhs.c2 & rhs.c2, lhs.c3 & rhs.c3); } + + /// Returns the result of a componentwise bitwise and operation on an int4x4 matrix and an int value. + /// Left hand side int4x4 to use to compute componentwise bitwise and. + /// Right hand side int to use to compute componentwise bitwise and. + /// int4x4 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 operator & (int4x4 lhs, int rhs) { return new int4x4 (lhs.c0 & rhs, lhs.c1 & rhs, lhs.c2 & rhs, lhs.c3 & rhs); } + + /// Returns the result of a componentwise bitwise and operation on an int value and an int4x4 matrix. + /// Left hand side int to use to compute componentwise bitwise and. + /// Right hand side int4x4 to use to compute componentwise bitwise and. + /// int4x4 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 operator & (int lhs, int4x4 rhs) { return new int4x4 (lhs & rhs.c0, lhs & rhs.c1, lhs & rhs.c2, lhs & rhs.c3); } + + + /// Returns the result of a componentwise bitwise or operation on two int4x4 matrices. + /// Left hand side int4x4 to use to compute componentwise bitwise or. + /// Right hand side int4x4 to use to compute componentwise bitwise or. + /// int4x4 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 operator | (int4x4 lhs, int4x4 rhs) { return new int4x4 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1, lhs.c2 | rhs.c2, lhs.c3 | rhs.c3); } + + /// Returns the result of a componentwise bitwise or operation on an int4x4 matrix and an int value. + /// Left hand side int4x4 to use to compute componentwise bitwise or. + /// Right hand side int to use to compute componentwise bitwise or. + /// int4x4 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 operator | (int4x4 lhs, int rhs) { return new int4x4 (lhs.c0 | rhs, lhs.c1 | rhs, lhs.c2 | rhs, lhs.c3 | rhs); } + + /// Returns the result of a componentwise bitwise or operation on an int value and an int4x4 matrix. + /// Left hand side int to use to compute componentwise bitwise or. + /// Right hand side int4x4 to use to compute componentwise bitwise or. + /// int4x4 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 operator | (int lhs, int4x4 rhs) { return new int4x4 (lhs | rhs.c0, lhs | rhs.c1, lhs | rhs.c2, lhs | rhs.c3); } + + + /// Returns the result of a componentwise bitwise exclusive or operation on two int4x4 matrices. + /// Left hand side int4x4 to use to compute componentwise bitwise exclusive or. + /// Right hand side int4x4 to use to compute componentwise bitwise exclusive or. + /// int4x4 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 operator ^ (int4x4 lhs, int4x4 rhs) { return new int4x4 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1, lhs.c2 ^ rhs.c2, lhs.c3 ^ rhs.c3); } + + /// Returns the result of a componentwise bitwise exclusive or operation on an int4x4 matrix and an int value. + /// Left hand side int4x4 to use to compute componentwise bitwise exclusive or. + /// Right hand side int to use to compute componentwise bitwise exclusive or. + /// int4x4 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 operator ^ (int4x4 lhs, int rhs) { return new int4x4 (lhs.c0 ^ rhs, lhs.c1 ^ rhs, lhs.c2 ^ rhs, lhs.c3 ^ rhs); } + + /// Returns the result of a componentwise bitwise exclusive or operation on an int value and an int4x4 matrix. + /// Left hand side int to use to compute componentwise bitwise exclusive or. + /// Right hand side int4x4 to use to compute componentwise bitwise exclusive or. + /// int4x4 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 operator ^ (int lhs, int4x4 rhs) { return new int4x4 (lhs ^ rhs.c0, lhs ^ rhs.c1, lhs ^ rhs.c2, lhs ^ rhs.c3); } + + + + /// Returns the int4 element at a specified index. + unsafe public ref int4 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 4) + throw new System.ArgumentException("index must be between[0...3]"); +#endif + fixed (int4x4* array = &this) { return ref ((int4*)array)[index]; } + } + } + + /// Returns true if the int4x4 is equal to a given int4x4, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(int4x4 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2) && c3.Equals(rhs.c3); } + + /// Returns true if the int4x4 is equal to a given int4x4, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is int4x4 converted && Equals(converted); } + + + /// Returns a hash code for the int4x4. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the int4x4. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("int4x4({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11}, {12}, {13}, {14}, {15})", c0.x, c1.x, c2.x, c3.x, c0.y, c1.y, c2.y, c3.y, c0.z, c1.z, c2.z, c3.z, c0.w, c1.w, c2.w, c3.w); + } + + /// Returns a string representation of the int4x4 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("int4x4({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11}, {12}, {13}, {14}, {15})", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c2.x.ToString(format, formatProvider), c3.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c2.y.ToString(format, formatProvider), c3.y.ToString(format, formatProvider), c0.z.ToString(format, formatProvider), c1.z.ToString(format, formatProvider), c2.z.ToString(format, formatProvider), c3.z.ToString(format, formatProvider), c0.w.ToString(format, formatProvider), c1.w.ToString(format, formatProvider), c2.w.ToString(format, formatProvider), c3.w.ToString(format, formatProvider)); + } + + } + + public static partial class math + { + /// Returns a int4x4 matrix constructed from four int4 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// The matrix column c3 will be set to this value. + /// int4x4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 int4x4(int4 c0, int4 c1, int4 c2, int4 c3) { return new int4x4(c0, c1, c2, c3); } + + /// Returns a int4x4 matrix constructed from from 16 int values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 0, column 3 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 1, column 3 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 2, column 2 will be set to this value. + /// The matrix at row 2, column 3 will be set to this value. + /// The matrix at row 3, column 0 will be set to this value. + /// The matrix at row 3, column 1 will be set to this value. + /// The matrix at row 3, column 2 will be set to this value. + /// The matrix at row 3, column 3 will be set to this value. + /// int4x4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 int4x4(int m00, int m01, int m02, int m03, + int m10, int m11, int m12, int m13, + int m20, int m21, int m22, int m23, + int m30, int m31, int m32, int m33) + { + return new int4x4(m00, m01, m02, m03, + m10, m11, m12, m13, + m20, m21, m22, m23, + m30, m31, m32, m33); + } + + /// Returns a int4x4 matrix constructed from a single int value by assigning it to every component. + /// int to convert to int4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 int4x4(int v) { return new int4x4(v); } + + /// Returns a int4x4 matrix constructed from a single bool value by converting it to int and assigning it to every component. + /// bool to convert to int4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 int4x4(bool v) { return new int4x4(v); } + + /// Return a int4x4 matrix constructed from a bool4x4 matrix by componentwise conversion. + /// bool4x4 to convert to int4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 int4x4(bool4x4 v) { return new int4x4(v); } + + /// Returns a int4x4 matrix constructed from a single uint value by converting it to int and assigning it to every component. + /// uint to convert to int4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 int4x4(uint v) { return new int4x4(v); } + + /// Return a int4x4 matrix constructed from a uint4x4 matrix by componentwise conversion. + /// uint4x4 to convert to int4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 int4x4(uint4x4 v) { return new int4x4(v); } + + /// Returns a int4x4 matrix constructed from a single float value by converting it to int and assigning it to every component. + /// float to convert to int4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 int4x4(float v) { return new int4x4(v); } + + /// Return a int4x4 matrix constructed from a float4x4 matrix by componentwise conversion. + /// float4x4 to convert to int4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 int4x4(float4x4 v) { return new int4x4(v); } + + /// Returns a int4x4 matrix constructed from a single double value by converting it to int and assigning it to every component. + /// double to convert to int4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 int4x4(double v) { return new int4x4(v); } + + /// Return a int4x4 matrix constructed from a double4x4 matrix by componentwise conversion. + /// double4x4 to convert to int4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 int4x4(double4x4 v) { return new int4x4(v); } + + /// Return the int4x4 transpose of a int4x4 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 transpose(int4x4 v) + { + return int4x4( + v.c0.x, v.c0.y, v.c0.z, v.c0.w, + v.c1.x, v.c1.y, v.c1.z, v.c1.w, + v.c2.x, v.c2.y, v.c2.z, v.c2.w, + v.c3.x, v.c3.y, v.c3.z, v.c3.w); + } + + /// Returns the determinant of a int4x4 matrix. + /// Matrix to use when computing determinant. + /// The determinant of the matrix. + public static int determinant(int4x4 m) + { + int4 c0 = m.c0; + int4 c1 = m.c1; + int4 c2 = m.c2; + int4 c3 = m.c3; + + int m00 = c1.y * (c2.z * c3.w - c2.w * c3.z) - c2.y * (c1.z * c3.w - c1.w * c3.z) + c3.y * (c1.z * c2.w - c1.w * c2.z); + int m01 = c0.y * (c2.z * c3.w - c2.w * c3.z) - c2.y * (c0.z * c3.w - c0.w * c3.z) + c3.y * (c0.z * c2.w - c0.w * c2.z); + int m02 = c0.y * (c1.z * c3.w - c1.w * c3.z) - c1.y * (c0.z * c3.w - c0.w * c3.z) + c3.y * (c0.z * c1.w - c0.w * c1.z); + int m03 = c0.y * (c1.z * c2.w - c1.w * c2.z) - c1.y * (c0.z * c2.w - c0.w * c2.z) + c2.y * (c0.z * c1.w - c0.w * c1.z); + + return c0.x * m00 - c1.x * m01 + c2.x * m02 - c3.x * m03; + } + + /// Returns a uint hash code of a int4x4 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(int4x4 v) + { + return csum(asuint(v.c0) * uint4(0x5D1B165Bu, 0x87096CD7u, 0x4C7F6DD1u, 0x4822A3E9u) + + asuint(v.c1) * uint4(0xAAC3C25Du, 0xD21D0945u, 0x88FCAB2Du, 0x614DA60Du) + + asuint(v.c2) * uint4(0x5BA2C50Bu, 0x8C455ACBu, 0xCD266C89u, 0xF1852A33u) + + asuint(v.c3) * uint4(0x77E35E77u, 0x863E3729u, 0xE191B035u, 0x68586FAFu)) + 0xD4DFF6D3u; + } + + /// + /// Returns a uint4 vector hash code of a int4x4 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint4 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 hashwide(int4x4 v) + { + return (asuint(v.c0) * uint4(0xCB634F4Du, 0x9B13B92Du, 0x4ABF0813u, 0x86068063u) + + asuint(v.c1) * uint4(0xD75513F9u, 0x5AB3E8CDu, 0x676E8407u, 0xB36DE767u) + + asuint(v.c2) * uint4(0x6FCA387Du, 0xAF0F3103u, 0xE4A056C7u, 0x841D8225u) + + asuint(v.c3) * uint4(0xC9393C7Du, 0xD42EAFA3u, 0xD9AFD06Du, 0x97A65421u)) + 0x7809205Fu; + } + + } +} diff --git a/src/Unity.Mathematics/int4x4.gen.cs.meta b/src/Unity.Mathematics/int4x4.gen.cs.meta new file mode 100644 index 00000000..25bcfbf3 --- /dev/null +++ b/src/Unity.Mathematics/int4x4.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4d606f419b22349e1a0d1d639bdfac05 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/math.cs b/src/Unity.Mathematics/math.cs index 651bf0c6..b17d04fe 100644 --- a/src/Unity.Mathematics/math.cs +++ b/src/Unity.Mathematics/math.cs @@ -1,505 +1,7261 @@ -// * TODO: Validate -1 vs 1 behaviour in math lib. eg < returns 0 / -1 -// Check if all operators act accordingly -// * Also int3 etc bool casts? should they exist? -// * Should we allow float4 value = 5; it is convenient and how it is in hlsl but maybe not the right fit in C#? - using System; +using System.Runtime.InteropServices; using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; namespace Unity.Mathematics { + /// + /// A static class to contain various math functions and constants. + /// + [Il2CppEagerStaticClassConstruction] public static partial class math { - // min - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float min(float a, float b) { return float.IsNaN(b) || a < b ? a : b; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float2 min(float2 a, float2 b) { return new float2(min(a.x, b.x), min(a.y, b.y)); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float3 min(float3 a, float3 b) { return new float3(min(a.x, b.x), min(a.y, b.y), min(a.z, b.z)); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float4 min(float4 a, float4 b) { return new float4(min(a.x, b.x), min(a.y, b.y), min(a.z, b.z), min(a.w, b.w)); } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static int min(int a, int b) { return a < b ? a : b; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static int2 min(int2 a, int2 b) { return new int2(min(a.x, b.x), min(a.y, b.y)); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static int3 min(int3 a, int3 b) { return new int3(min(a.x, b.x), min(a.y, b.y), min(a.z, b.z)); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static int4 min(int4 a, int4 b) { return new int4(min(a.x, b.x), min(a.y, b.y), min(a.z, b.z), min(a.w, b.w)); } - - // max - [MethodImpl((MethodImplOptions) 0x100)] // agressive inline - public static float max(float a, float b) { return float.IsNaN(b) || a > b ? a : b; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float2 max(float2 a, float2 b) { return new float2(max(a.x, b.x), max(a.y, b.y)); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float3 max(float3 a, float3 b) { return new float3(max(a.x, b.x), max(a.y, b.y), max(a.z, b.z)); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float4 max(float4 a, float4 b) { return new float4(max(a.x, b.x), max(a.y, b.y), max(a.z, b.z), max(a.w, b.w)); } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static int max(int a, int b) { return a > b ? a : b; } // Use Math.Max as it is handling properly NaN - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static int2 max(int2 a, int2 b) { return new int2(max(a.x, b.x), max(a.y, b.y)); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static int3 max(int3 a, int3 b) { return new int3(max(a.x, b.x), max(a.y, b.y), max(a.z, b.z)); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static int4 max(int4 a, int4 b) { return new int4(max(a.x, b.x), max(a.y, b.y), max(a.z, b.z), max(a.w, b.w)); } - - // lerp - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float lerp(float a, float b, float w) { return a + w * (b - a); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float2 lerp(float2 a, float2 b, float w) { return a + w * (b - a); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float3 lerp(float3 a, float3 b, float w) { return a + w * (b - a); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float4 lerp(float4 a, float4 b, float w) { return a + w * (b - a); } - - // mad - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float mad(float a, float b, float c) { return a * b + c; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float2 mad(float2 a, float2 b, float2 c) { return a * b + c; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float3 mad(float3 a, float3 b, float3 c) { return a * b + c; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float4 mad(float4 a, float4 b, float4 c) { return a * b + c; } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static int mad(int a, int b, int c) { return a * b + c; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static int2 mad(int2 a, int2 b, int2 c) { return a * b + c; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static int3 mad(int3 a, int3 b, int3 c) { return a * b + c; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static int4 mad(int4 a, int4 b, int4 c) { return a * b + c; } - - // TODO: madint version???? - - - // clamp - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float clamp(float x, float a, float b) { return max(a, min(b, x)); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float2 clamp(float2 x, float2 a, float2 b) { return max(a, min(b, x)); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float3 clamp(float3 x, float3 a, float3 b) { return max(a, min(b, x)); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float4 clamp(float4 x, float4 a, float4 b) { return max(a, min(b, x)); } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static int clamp(int x, int a, int b) { return max(a, min(b, x)); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static int2 clamp(int2 x, int2 a, int2 b) { return max(a, min(b, x)); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static int3 clamp(int3 x, int3 a, int3 b) { return max(a, min(b, x)); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static int4 clamp(int4 x, int4 a, int4 b) { return max(a, min(b, x)); } - - // saturate - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float saturate(float x) { return clamp(x, 0.0F, 1.0F); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float2 saturate(float2 x) { return clamp(x, new float2(0.0F), new float2(1.0F)); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float3 saturate(float3 x) { return clamp(x, new float3(0.0F), new float3(1.0F)); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float4 saturate(float4 x) { return clamp(x, new float4(0.0F), new float4(1.0F)); } - - // abs - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float abs(float a) { return max(-a, a); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static int abs(int a) { return max(-a, a); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float2 abs(float2 a) { return max(-a, a); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float3 abs(float3 a) { return max(-a, a); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float4 abs(float4 a) { return max(-a, a); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static int2 abs(int2 a) { return max(-a, a); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static int3 abs(int3 a) { return max(-a, a); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static int4 abs(int4 a) { return max(-a, a); } - - // dot - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float dot(float pt1, float pt2) { return pt1 * pt2; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float dot(float2 pt1, float2 pt2) { return pt1.x * pt2.x + pt1.y * pt2.y; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float dot(float3 pt1, float3 pt2) { return pt1.x * pt2.x + pt1.y * pt2.y + pt1.z * pt2.z; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float dot(float4 pt1, float4 pt2) { return pt1.x * pt2.x + pt1.y * pt2.y + pt1.z * pt2.z + pt1.w * pt2.w; } - - // tan - public static float tan(float value) { return (float)System.Math.Tan(value); } - public static float2 tan(float2 value) { return new float2(tan(value.x), tan(value.y)); } - public static float3 tan(float3 value) { return new float3(tan(value.x), tan(value.y), tan(value.z)); } - public static float4 tan(float4 value) { return new float4(tan(value.x), tan(value.y), tan(value.z), tan(value.w)); } - - // atan - public static float atan(float value) { return (float)System.Math.Atan(value); } - public static float2 atan(float2 value) { return new float2(atan(value.x), atan(value.y)); } - public static float3 atan(float3 value) { return new float3(atan(value.x), atan(value.y), atan(value.z)); } - public static float4 atan(float4 value) { return new float4(atan(value.x), atan(value.y), atan(value.z), atan(value.w)); } - - // atan2 - public static float atan2(float pt1, float pt2) { return (float)System.Math.Atan2(pt1, pt2); } - public static float2 atan2(float2 pt1, float2 pt2) { return new float2(atan2(pt1.x, pt2.x), atan2(pt1.y, pt2.y)); } - public static float3 atan2(float3 pt1, float3 pt2) { return new float3(atan2(pt1.x, pt2.x), atan2(pt1.y, pt2.y), atan2(pt1.z, pt2.z)); } - public static float4 atan2(float4 pt1, float4 pt2) { return new float4(atan2(pt1.x, pt2.x), atan2(pt1.y, pt2.y), atan2(pt1.z, pt2.z), atan2(pt1.w, pt2.w)); } - - // cos - public static float cos(float a) { return (float)System.Math.Cos((float)a); } - public static float2 cos(float2 a) { return new float2(cos(a.x), cos(a.y)); } - public static float3 cos(float3 a) { return new float3(cos(a.x), cos(a.y), cos(a.z)); } - public static float4 cos(float4 a) { return new float4(cos(a.x), cos(a.y), cos(a.z), cos(a.w)); } - - // acos - public static float acos(float a) { return (float)System.Math.Acos((float)a); } - public static float2 acos(float2 a) { return new float2(acos(a.x), acos(a.y)); } - public static float3 acos(float3 a) { return new float3(acos(a.x), acos(a.y), acos(a.z)); } - public static float4 acos(float4 a) { return new float4(acos(a.x), acos(a.y), acos(a.z), acos(a.w)); } - - // sin - public static float sin(float a) { return (float)System.Math.Sin((float)a); } - public static float2 sin(float2 a) { return new float2(sin(a.x), sin(a.y)); } - public static float3 sin(float3 a) { return new float3(sin(a.x), sin(a.y), sin(a.z)); } - public static float4 sin(float4 a) { return new float4(sin(a.x), sin(a.y), sin(a.z), sin(a.w)); } - - // asin - public static float asin(float a) { return (float)System.Math.Asin((float)a); } - public static float2 asin(float2 a) { return new float2(asin(a.x), asin(a.y)); } - public static float3 asin(float3 a) { return new float3(asin(a.x), asin(a.y), asin(a.z)); } - public static float4 asin(float4 a) { return new float4(asin(a.x), asin(a.y), asin(a.z), asin(a.w)); } - - // floor - public static float floor(float a) { return (float)System.Math.Floor((float)a); } - public static float2 floor(float2 a) { return new float2(floor(a.x), floor(a.y)); } - public static float3 floor(float3 a) { return new float3(floor(a.x), floor(a.y), floor(a.z)); } - public static float4 floor(float4 a) { return new float4(floor(a.x), floor(a.y), floor(a.z), floor(a.w)); } - - // ceil - public static float ceil(float a) { return (float)System.Math.Ceiling((float)a); } - public static float2 ceil(float2 a) { return new float2(ceil(a.x), ceil(a.y)); } - public static float3 ceil(float3 a) { return new float3(ceil(a.x), ceil(a.y), ceil(a.z)); } - public static float4 ceil(float4 a) { return new float4(ceil(a.x), ceil(a.y), ceil(a.z), ceil(a.w)); } - - // round - public static float round(float a) { return (float)System.Math.Round((float)a); } - public static float2 round(float2 a) { return new float2(round(a.x), round(a.y)); } - public static float3 round(float3 a) { return new float3(round(a.x), round(a.y), round(a.z)); } - public static float4 round(float4 a) { return new float4(round(a.x), round(a.y), round(a.z), round(a.w)); } - - // frac - public static float frac(float a) { return a - floor(a); } - public static float2 frac(float2 a) { return a - floor(a); } - public static float3 frac(float3 a) { return a - floor(a); } - public static float4 frac(float4 a) { return a - floor(a); } - - // rcp - public static float rcp(float a) { return 1f / a; } - public static float2 rcp(float2 a) { return 1f / a; } - public static float3 rcp(float3 a) { return 1f / a; } - public static float4 rcp(float4 a) { return 1f / a; } - - // sign - public static float sign(float f) { return f == 0f ? 0f : (f > 0f ? 1f : 0.0f) - (f < 0f ? 1.0f : 0.0f); } - public static float2 sign(float2 f) { return new float2(sign(f.x), sign(f.y)); } - public static float3 sign(float3 f) { return new float3(sign(f.x), sign(f.y), sign(f.z)); } - public static float4 sign(float4 f) { return new float4(sign(f.x), sign(f.y), sign(f.z), sign(f.w)); } - - // mix - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float mix(float a, float b, float x) { return x * (b - a) + a; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float2 mix(float2 a, float2 b, float2 x) { return x * (b - a) + a; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float3 mix(float3 a, float3 b, float3 x) { return x * (b - a) + a; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float4 mix(float4 a, float4 b, float4 x) { return x * (b - a) + a; } - - // pow - public static float pow(float a, float b) { return (float)System.Math.Pow((float)a, (float)b); } - public static float2 pow(float2 a, float2 b) { return new float2(pow(a.x, b.x), pow(a.y, b.y)); } - public static float3 pow(float3 a, float3 b) { return new float3(pow(a.x, b.x), pow(a.y, b.y), pow(a.z, b.z)); } - public static float4 pow(float4 a, float4 b) { return new float4(pow(a.x, b.x), pow(a.y, b.y), pow(a.z, b.z), pow(a.w, b.w)); } - - // powr - assumes sign of a is 0 or greater - public static float powr(float a, float b) { return pow(a, b); } - public static float2 powr(float2 a, float2 b) { return pow(a, b); } - public static float3 powr(float3 a, float3 b) { return pow(a, b); } - public static float4 powr(float4 a, float4 b) { return pow(a, b); } - - // exp - public static float exp(float x) { return (float)System.Math.Exp((float)x); } - public static float2 exp(float2 a) { return new float2(exp(a.x), exp(a.y)); } - public static float3 exp(float3 a) { return new float3(exp(a.x), exp(a.y), exp(a.z)); } - public static float4 exp(float4 a) { return new float4(exp(a.x), exp(a.y), exp(a.z), exp(a.w)); } + /// Extrinsic rotation order. Specifies in which order rotations around the principal axes (x, y and z) are to be applied. + public enum RotationOrder : byte + { + /// Extrinsic rotation around the x axis, then around the y axis and finally around the z axis. + XYZ, + /// Extrinsic rotation around the x axis, then around the z axis and finally around the y axis. + XZY, + /// Extrinsic rotation around the y axis, then around the x axis and finally around the z axis. + YXZ, + /// Extrinsic rotation around the y axis, then around the z axis and finally around the x axis. + YZX, + /// Extrinsic rotation around the z axis, then around the x axis and finally around the y axis. + ZXY, + /// Extrinsic rotation around the z axis, then around the y axis and finally around the x axis. + ZYX, + /// Unity default rotation order. Extrinsic Rotation around the z axis, then around the x axis and finally around the y axis. + Default = ZXY + }; - // log - public static float log(float x) { return (float)System.Math.Log((float)x); } - public static float2 log(float2 a) { return new float2(log(a.x), log(a.y)); } - public static float3 log(float3 a) { return new float3(log(a.x), log(a.y), log(a.z)); } - public static float4 log(float4 a) { return new float4(log(a.x), log(a.y), log(a.z), log(a.w)); } + /// Specifies a shuffle component. + public enum ShuffleComponent : byte + { + /// Specified the x component of the left vector. + LeftX, + /// Specified the y component of the left vector. + LeftY, + /// Specified the z component of the left vector. + LeftZ, + /// Specified the w component of the left vector. + LeftW, - // log10 - public static float log10(float x) { return (float)System.Math.Log10((float)x); } - public static float2 log10(float2 a) { return new float2(log10(a.x), log10(a.y)); } - public static float3 log10(float3 a) { return new float3(log10(a.x), log10(a.y), log10(a.z)); } - public static float4 log10(float4 a) { return new float4(log10(a.x), log10(a.y), log10(a.z), log10(a.w)); } - - // mod - public static float mod(float a, float b) { return a % b; } - public static float2 mod(float2 a, float2 b) { return new float2(a.x % b.x, a.y % b.y); } - public static float3 mod(float3 a, float3 b) { return new float3(a.x % b.x, a.y % b.y, a.z % b.z); } - public static float4 mod(float4 a, float4 b) { return new float4(a.x % b.x, a.y % b.y, a.z % b.z, a.w % b.w); } - - // sqrt - public static float sqrt(float a) { return (float)System.Math.Sqrt((float)a); } - public static float2 sqrt(float2 a) { return new float2(sqrt(a.x), sqrt(a.y)); } - public static float3 sqrt(float3 a) { return new float3(sqrt(a.x), sqrt(a.y), sqrt(a.z)); } - public static float4 sqrt(float4 a) { return new float4(sqrt(a.x), sqrt(a.y), sqrt(a.z), sqrt(a.w)); } - - // rsqrt - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float rsqrt(float a) { return 1.0F / sqrt(a); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float2 rsqrt(float2 a) { return 1.0f / sqrt(a); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float3 rsqrt(float3 a) { return 1.0f / sqrt(a); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float4 rsqrt(float4 a) { return 1.0f / sqrt(a); } - - // normalize - public static float2 normalize(float2 v) { return rsqrt(dot(v, v)) * v; } - public static float3 normalize(float3 v) { return rsqrt(dot(v, v)) * v; } - public static float4 normalize(float4 v) { return rsqrt(dot(v, v)) * v; } - - // length - public static float length(float v) { return abs(v); } - public static float length(float2 v) { return sqrt(dot(v, v)); } - public static float length(float3 v) { return sqrt(dot(v, v)); } - public static float length(float4 v) { return sqrt(dot(v, v)); } - - // length squared - public static float lengthSquared(float v) { return v*v; } - public static float lengthSquared(float2 v) { return dot(v, v); } - public static float lengthSquared(float3 v) { return dot(v, v); } - public static float lengthSquared(float4 v) { return dot(v, v); } - - // distance - public static float distance(float pt1, float pt2) { return length(pt2 - pt1); } - public static float distance(float2 pt1, float2 pt2) { return length(pt2 - pt1); } - public static float distance(float3 pt1, float3 pt2) { return length(pt2 - pt1); } - public static float distance(float4 pt1, float4 pt2) { return length(pt2 - pt1); } - - // cross - public static float3 cross(float3 p0, float3 p1) { return (p0 * p1.yzx - p0.yzx * p1).yzx; } - - public static float smoothstep(float a, float b, float x) - { - var t = saturate((x - a) / (b - a)); - return t * t * (3.0F - (2.0F * t)); - } - - public static float2 smoothstep(float2 a, float2 b, float2 x) - { - var t = saturate((x - a) / (b - a)); - return t * t * (3.0F - (2.0F * t)); - } - - public static float3 smoothstep(float3 a, float3 b, float3 x) - { - var t = saturate((x - a) / (b - a)); - return t * t * (3.0F - (2.0F * t)); - } - - public static float4 smoothstep(float4 a, float4 b, float4 x) - { - var t = saturate((x - a) / (b - a)); - return t * t * (3.0F - (2.0F * t)); - } - - // any - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool any(bool a) { return a; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool any(bool2 a) { return a.x || a.y; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool any(bool3 a) { return a.x || a.y || a.z; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool any(bool4 a) { return a.x || a.y || a.z || a.w; } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool any(int a) { return a != 0; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool any(int2 a) { return a.x != 0 || a.y != 0; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool any(int3 a) { return a.x != 0 || a.y != 0 || a.z != 0; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool any(int4 a) { return a.x != 0 || a.y != 0 || a.z != 0 || a.w != 0; } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool any(float a) { return a != 0.0F; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool any(float2 a) { return a.x != 0.0F || a.y != 0.0F; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool any(float3 a) { return a.x != 0.0F || a.y != 0.0F || a.z != 0.0F; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool any(float4 a) { return a.x != 0.0F || a.y != 0.0F || a.z != 0.0F || a.w != 0.0F; } - - // all - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool all(bool a) { return a; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool all(bool2 a) { return a.x && a.y; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool all(bool3 a) { return a.x && a.y && a.z; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool all(bool4 a) { return a.x && a.y && a.z && a.w; } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool all(int a) { return a != 0; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool all(int2 a) { return a.x != 0 && a.y != 0; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool all(int3 a) { return a.x != 0 && a.y != 0 && a.z != 0; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool all(int4 a) { return a.x != 0 && a.y != 0 && a.z != 0 && a.w != 0; } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool all(float a) { return a != 0.0F; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool all(float2 a) { return a.x != 0.0F && a.y != 0.0F; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool all(float3 a) { return a.x != 0.0F && a.y != 0.0F && a.z != 0.0F; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool all(float4 a) { return a.x != 0.0F && a.y != 0.0F && a.z != 0.0F && a.w != 0.0F; } - - // Select - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static int select(int a, int b, bool c) { return c ? b : a; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static int2 select(int2 a, int2 b, bool c) { return c ? b : a; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static int3 select(int3 a, int3 b, bool c) { return c ? b : a; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static int4 select(int4 a, int4 b, bool c) { return c ? b : a; } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static int2 select(int2 a, int2 b, bool2 c) { return new int2(c.x ? b.x : a.x, c.y ? b.y : a.y); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static int3 select(int3 a, int3 b, bool3 c) { return new int3(c.x ? b.x : a.x, c.y ? b.y : a.y, c.z ? b.z : a.z); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static int4 select(int4 a, int4 b, bool4 c) { return new int4(c.x ? b.x : a.x, c.y ? a.y : b.y, c.z ? b.z : a.z, c.w ? b.w : a.w); } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float select(float a, float b, bool c) { return c ? b : a; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float2 select(float2 a, float2 b, bool c) { return c ? b : a; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float3 select(float3 a, float3 b, bool c) { return c ? b : a; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float4 select(float4 a, float4 b, bool c) { return c ? b : a; } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float2 select(float2 a, float2 b, bool2 c) { return new float2(c.x ? b.x : a.x, c.y ? b.y : a.y); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float3 select(float3 a, float3 b, bool3 c) { return new float3(c.x ? b.x : a.x, c.y ? b.y : a.y, c.z ? b.z : a.z); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float4 select(float4 a, float4 b, bool4 c) { return new float4(c.x ? b.x : a.x, c.y ? b.y : a.y, c.z ? b.z : a.z, c.w ? b.w : a.w); } - - //Step - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float step(float a, float b) { return select(0.0f, 1.0f, a >= b); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float2 step(float2 a, float2 b) { return select(0.0f, 1.0f, a >= b); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float3 step(float3 a, float3 b) { return select(0.0f, 1.0f, a >= b); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float4 step(float4 a, float4 b) { return select(0.0f, 1.0f, a >= b); } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float reflect(float i, float n) { return i - 2f * n * dot(i, n); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float2 reflect(float2 i, float2 n) { return i - 2f * n * dot(i, n); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float3 reflect(float3 i, float3 n) { return i - 2f * n * dot(i, n); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float4 reflect(float4 i, float4 n) { return i - 2f * n * dot(i, n); } + /// Specified the x component of the right vector. + RightX, + /// Specified the y component of the right vector. + RightY, + /// Specified the z component of the right vector. + RightZ, + /// Specified the w component of the right vector. + RightW + }; + /// The mathematical constant e also known as Euler's number. Approximately 2.72. This is a f64/double precision constant. + public const double E_DBL = 2.71828182845904523536; - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static void sincos(float x, out float s, out float c) { s = sin(x); c = cos(x); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static void sincos(float2 x, out float2 s, out float2 c) { s = sin(x); c = cos(x); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static void sincos(float3 x, out float3 s, out float3 c) { s = sin(x); c = cos(x); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static void sincos(float4 x, out float4 s, out float4 c) { s = sin(x); c = cos(x); } + /// The base 2 logarithm of e. Approximately 1.44. This is a f64/double precision constant. + public const double LOG2E_DBL = 1.44269504088896340736; + + /// The base 10 logarithm of e. Approximately 0.43. This is a f64/double precision constant. + public const double LOG10E_DBL = 0.434294481903251827651; + + /// The natural logarithm of 2. Approximately 0.69. This is a f64/double precision constant. + public const double LN2_DBL = 0.693147180559945309417; + + /// The natural logarithm of 10. Approximately 2.30. This is a f64/double precision constant. + public const double LN10_DBL = 2.30258509299404568402; + + /// The mathematical constant pi. Approximately 3.14. This is a f64/double precision constant. + public const double PI_DBL = 3.14159265358979323846; + + /// + /// The mathematical constant (2 * pi). Approximately 6.28. This is a f64/double precision constant. Also known as . + /// + public const double PI2_DBL = PI_DBL * 2.0; + + /// + /// The mathematical constant (pi / 2). Approximately 1.57. This is a f64/double precision constant. + /// + public const double PIHALF_DBL = PI_DBL * 0.5; + + /// + /// The mathematical constant tau. Approximately 6.28. This is a f64/double precision constant. Also known as . + /// + public const double TAU_DBL = PI2_DBL; + + /// + /// The conversion constant used to convert radians to degrees. Multiply the radian value by this constant to get degrees. + /// + /// Multiplying by this constant is equivalent to using . + public const double TODEGREES_DBL = 57.29577951308232; + + /// + /// The conversion constant used to convert degrees to radians. Multiply the degree value by this constant to get radians. + /// + /// Multiplying by this constant is equivalent to using . + public const double TORADIANS_DBL = 0.017453292519943296; + + /// The square root 2. Approximately 1.41. This is a f64/double precision constant. + public const double SQRT2_DBL = 1.41421356237309504880; + + /// + /// The difference between 1.0 and the next representable f64/double precision number. + /// + /// Beware: + /// This value is different from System.Double.Epsilon, which is the smallest, positive, denormalized f64/double. + /// + public const double EPSILON_DBL = 2.22044604925031308085e-16; + + /// + /// Double precision constant for positive infinity. + /// + public const double INFINITY_DBL = Double.PositiveInfinity; + + /// + /// Double precision constant for Not a Number. + /// + /// NAN_DBL is considered unordered, which means all comparisons involving it are false except for not equal (operator !=). + /// As a consequence, NAN_DBL == NAN_DBL is false but NAN_DBL != NAN_DBL is true. + /// + /// Additionally, there are multiple bit representations for Not a Number, so if you must test if your value + /// is NAN_DBL, use isnan(). + /// + public const double NAN_DBL = Double.NaN; + + /// The smallest positive normal number representable in a float. + public const float FLT_MIN_NORMAL = 1.175494351e-38F; + + /// The smallest positive normal number representable in a double. This is a f64/double precision constant. + public const double DBL_MIN_NORMAL = 2.2250738585072014e-308; + + /// The mathematical constant e also known as Euler's number. Approximately 2.72. + public const float E = (float)E_DBL; + + /// The base 2 logarithm of e. Approximately 1.44. + public const float LOG2E = (float)LOG2E_DBL; + + /// The base 10 logarithm of e. Approximately 0.43. + public const float LOG10E = (float)LOG10E_DBL; + + /// The natural logarithm of 2. Approximately 0.69. + public const float LN2 = (float)LN2_DBL; + + /// The natural logarithm of 10. Approximately 2.30. + public const float LN10 = (float)LN10_DBL; + + /// The mathematical constant pi. Approximately 3.14. + public const float PI = (float)PI_DBL; + + /// + /// The mathematical constant (2 * pi). Approximately 6.28. Also known as . + /// + public const float PI2 = (float)PI2_DBL; + + /// + /// The mathematical constant (pi / 2). Approximately 1.57. + /// + public const float PIHALF = (float)PIHALF_DBL; + + /// + /// The mathematical constant tau. Approximately 6.28. Also known as . + /// + public const float TAU = (float)PI2_DBL; + + /// + /// The conversion constant used to convert radians to degrees. Multiply the radian value by this constant to get degrees. + /// + /// Multiplying by this constant is equivalent to using . + public const float TODEGREES = (float)TODEGREES_DBL; + + /// + /// The conversion constant used to convert degrees to radians. Multiply the degree value by this constant to get radians. + /// + /// Multiplying by this constant is equivalent to using . + public const float TORADIANS = (float)TORADIANS_DBL; + + /// The square root 2. Approximately 1.41. + public const float SQRT2 = (float)SQRT2_DBL; + + /// + /// The difference between 1.0f and the next representable f32/single precision number. + /// + /// Beware: + /// This value is different from System.Single.Epsilon, which is the smallest, positive, denormalized f32/single. + /// + public const float EPSILON = 1.1920928955078125e-7f; + + /// + /// Single precision constant for positive infinity. + /// + public const float INFINITY = Single.PositiveInfinity; + + /// + /// Single precision constant for Not a Number. + /// + /// NAN is considered unordered, which means all comparisons involving it are false except for not equal (operator !=). + /// As a consequence, NAN == NAN is false but NAN != NAN is true. + /// + /// Additionally, there are multiple bit representations for Not a Number, so if you must test if your value + /// is NAN, use isnan(). + /// + public const float NAN = Single.NaN; + + /// Returns the bit pattern of a uint as an int. + /// The uint bits to copy. + /// The int with the same bit pattern as the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int asint(uint x) + { + unsafe + { + return *(int*)&x; + } + } + + /// Returns the bit pattern of a uint2 as an int2. + /// The uint2 bits to copy. + /// The int2 with the same bit pattern as the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 asint(uint2 x) + { + unsafe + { + return *(int2*)&x; + } + } + + /// Returns the bit pattern of a uint3 as an int3. + /// The uint3 bits to copy. + /// The int3 with the same bit pattern as the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 asint(uint3 x) + { + unsafe + { + return *(int3*)&x; + } + } + + /// Returns the bit pattern of a uint4 as an int4. + /// The uint4 bits to copy. + /// The int4 with the same bit pattern as the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 asint(uint4 x) + { + unsafe + { + return *(int4*)&x; + } + } + + /// Returns the bit pattern of a float as an int. + /// The float bits to copy. + /// The int with the same bit pattern as the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int asint(float x) + { + unsafe + { + return *(int*)&x; + } + } + + /// Returns the bit pattern of a float2 as an int2. + /// The float2 bits to copy. + /// The int2 with the same bit pattern as the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 asint(float2 x) + { + unsafe + { + return *(int2*)&x; + } + } + + /// Returns the bit pattern of a float3 as an int3. + /// The float3 bits to copy. + /// The int3 with the same bit pattern as the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 asint(float3 x) + { + unsafe + { + return *(int3*)&x; + } + } + + /// Returns the bit pattern of a float4 as an int4. + /// The float4 bits to copy. + /// The int4 with the same bit pattern as the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 asint(float4 x) + { + unsafe + { + return *(int4*)&x; + } + } + + /// Returns the bit pattern of an int as a uint. + /// The int bits to copy. + /// The uint with the same bit pattern as the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint asuint(int x) { return (uint)x; } + + /// Returns the bit pattern of an int2 as a uint2. + /// The int2 bits to copy. + /// The uint2 with the same bit pattern as the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 asuint(int2 x) + { + unsafe + { + return *(uint2*)&x; + } + } + + /// Returns the bit pattern of an int3 as a uint3. + /// The int3 bits to copy. + /// The uint3 with the same bit pattern as the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 asuint(int3 x) + { + unsafe + { + return *(uint3*)&x; + } + } + + /// Returns the bit pattern of an int4 as a uint4. + /// The int4 bits to copy. + /// The uint4 with the same bit pattern as the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 asuint(int4 x) + { + unsafe + { + return *(uint4*)&x; + } + } + + /// Returns the bit pattern of a float as a uint. + /// The float bits to copy. + /// The uint with the same bit pattern as the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint asuint(float x) + { + unsafe + { + return *(uint*)&x; + } + } + + /// Returns the bit pattern of a float2 as a uint2. + /// The float2 bits to copy. + /// The uint2 with the same bit pattern as the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 asuint(float2 x) + { + unsafe + { + return *(uint2*)&x; + } + } + + /// Returns the bit pattern of a float3 as a uint3. + /// The float3 bits to copy. + /// The uint3 with the same bit pattern as the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 asuint(float3 x) + { + unsafe + { + return *(uint3*)&x; + } + } + + /// Returns the bit pattern of a float4 as a uint4. + /// The float4 bits to copy. + /// The uint4 with the same bit pattern as the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 asuint(float4 x) + { + unsafe + { + return *(uint4*)&x; + } + } + + /// Returns the bit pattern of a ulong as a long. + /// The ulong bits to copy. + /// The long with the same bit pattern as the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static long aslong(ulong x) { return (long)x; } + + /// Returns the bit pattern of a double as a long. + /// The double bits to copy. + /// The long with the same bit pattern as the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static long aslong(double x) + { + unsafe + { + return *(long*)&x; + } + } + + /// Returns the bit pattern of a long as a ulong. + /// The long bits to copy. + /// The ulong with the same bit pattern as the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ulong asulong(long x) { return (ulong)x; } + + /// Returns the bit pattern of a double as a ulong. + /// The double bits to copy. + /// The ulong with the same bit pattern as the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ulong asulong(double x) + { + unsafe + { + return *(ulong*)&x; + } + } + + /// Returns the bit pattern of an int as a float. + /// The int bits to copy. + /// The float with the same bit pattern as the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float asfloat(int x) + { + unsafe + { + return *(float*)&x; + } + } + + /// Returns the bit pattern of an int2 as a float2. + /// The int2 bits to copy. + /// The float2 with the same bit pattern as the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 asfloat(int2 x) + { + unsafe + { + return *(float2*)&x; + } + } + + /// Returns the bit pattern of an int3 as a float3. + /// The int3 bits to copy. + /// The float3 with the same bit pattern as the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 asfloat(int3 x) + { + unsafe + { + return *(float3*)&x; + } + } + + /// Returns the bit pattern of an int4 as a float4. + /// The int4 bits to copy. + /// The float4 with the same bit pattern as the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 asfloat(int4 x) + { + unsafe + { + return *(float4*)&x; + } + } + + /// Returns the bit pattern of a uint as a float. + /// The uint bits to copy. + /// The float with the same bit pattern as the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float asfloat(uint x) + { + unsafe + { + return *(float*)&x; + } + } + + /// Returns the bit pattern of a uint2 as a float2. + /// The uint2 bits to copy. + /// The float2 with the same bit pattern as the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 asfloat(uint2 x) + { + unsafe + { + return *(float2*)&x; + } + } + + /// Returns the bit pattern of a uint3 as a float3. + /// The uint3 bits to copy. + /// The float3 with the same bit pattern as the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 asfloat(uint3 x) + { + unsafe + { + return *(float3*)&x; + } + } + + /// Returns the bit pattern of a uint4 as a float4. + /// The uint4 bits to copy. + /// The float4 with the same bit pattern as the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 asfloat(uint4 x) + { + unsafe + { + return *(float4*)&x; + } + } + + /// + /// Returns a bitmask representation of a bool4. Storing one 1 bit per component + /// in LSB order, from lower to higher bits (so 4 bits in total). + /// The component x is stored at bit 0, + /// The component y is stored at bit 1, + /// The component z is stored at bit 2, + /// The component w is stored at bit 3 + /// The bool4(x = true, y = true, z = false, w = true) would produce the value 1011 = 0xB + /// + /// The input bool4 to calculate the bitmask for + /// A bitmask representation of the bool4, in LSB order + public static int bitmask(bool4 value) + { + int mask = 0; + if (value.x) mask |= 0x01; + if (value.y) mask |= 0x02; + if (value.z) mask |= 0x04; + if (value.w) mask |= 0x08; + return mask; + } + + /// Returns the bit pattern of a long as a double. + /// The long bits to copy. + /// The double with the same bit pattern as the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double asdouble(long x) + { + unsafe + { + return *(double*)&x; + } + } + + /// Returns the bit pattern of a ulong as a double. + /// The ulong bits to copy. + /// The double with the same bit pattern as the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double asdouble(ulong x) + { + unsafe + { + return *(double*)&x; + } + } + + /// Returns true if the input float is a finite floating point value, false otherwise. + /// The float value to test. + /// True if the float is finite, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool isfinite(float x) { return abs(x) < float.PositiveInfinity; } + + /// Returns a bool2 indicating for each component of a float2 whether it is a finite floating point value. + /// The float2 value to test. + /// A bool2 where it is true in a component if that component is finite, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2 isfinite(float2 x) { return abs(x) < float.PositiveInfinity; } + + /// Returns a bool3 indicating for each component of a float3 whether it is a finite floating point value. + /// The float3 value to test. + /// A bool3 where it is true in a component if that component is finite, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3 isfinite(float3 x) { return abs(x) < float.PositiveInfinity; } + + /// Returns a bool4 indicating for each component of a float4 whether it is a finite floating point value. + /// The float4 value to test. + /// A bool4 where it is true in a component if that component is finite, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 isfinite(float4 x) { return abs(x) < float.PositiveInfinity; } + + + /// Returns true if the input double is a finite floating point value, false otherwise. + /// The double value to test. + /// True if the double is finite, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool isfinite(double x) { return abs(x) < double.PositiveInfinity; } + + /// Returns a bool2 indicating for each component of a double2 whether it is a finite floating point value. + /// The double2 value to test. + /// A bool2 where it is true in a component if that component is finite, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2 isfinite(double2 x) { return abs(x) < double.PositiveInfinity; } + + /// Returns a bool3 indicating for each component of a double3 whether it is a finite floating point value. + /// The double3 value to test. + /// A bool3 where it is true in a component if that component is finite, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3 isfinite(double3 x) { return abs(x) < double.PositiveInfinity; } + + /// Returns a bool4 indicating for each component of a double4 whether it is a finite floating point value. + /// The double4 value to test. + /// A bool4 where it is true in a component if that component is finite, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 isfinite(double4 x) { return abs(x) < double.PositiveInfinity; } + + + /// Returns true if the input float is an infinite floating point value, false otherwise. + /// Input value. + /// True if the input was an infinite value; false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool isinf(float x) { return abs(x) == float.PositiveInfinity; } + + /// Returns a bool2 indicating for each component of a float2 whether it is an infinite floating point value. + /// Input value. + /// True if the component was an infinite value; false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2 isinf(float2 x) { return abs(x) == float.PositiveInfinity; } + + /// Returns a bool3 indicating for each component of a float3 whether it is an infinite floating point value. + /// Input value. + /// True if the component was an infinite value; false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3 isinf(float3 x) { return abs(x) == float.PositiveInfinity; } + + /// Returns a bool4 indicating for each component of a float4 whether it is an infinite floating point value. + /// Input value. + /// True if the component was an infinite value; false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 isinf(float4 x) { return abs(x) == float.PositiveInfinity; } + + /// Returns true if the input double is an infinite floating point value, false otherwise. + /// Input value. + /// True if the input was an infinite value; false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool isinf(double x) { return abs(x) == double.PositiveInfinity; } + + /// Returns a bool2 indicating for each component of a double2 whether it is an infinite floating point value. + /// Input value. + /// True if the component was an infinite value; false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2 isinf(double2 x) { return abs(x) == double.PositiveInfinity; } + + /// Returns a bool3 indicating for each component of a double3 whether it is an infinite floating point value. + /// Input value. + /// True if the component was an infinite value; false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3 isinf(double3 x) { return abs(x) == double.PositiveInfinity; } + + /// Returns a bool4 indicating for each component of a double4 whether it is an infinite floating point value. + /// Input value. + /// True if the component was an infinite value; false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 isinf(double4 x) { return abs(x) == double.PositiveInfinity; } + + + /// Returns true if the input float is a NaN (not a number) floating point value, false otherwise. + /// + /// NaN has several representations and may vary across architectures. Use this function to check if you have a NaN. + /// + /// Input value. + /// True if the value was NaN; false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool isnan(float x) { return (asuint(x) & 0x7FFFFFFF) > 0x7F800000; } + + /// Returns a bool2 indicating for each component of a float2 whether it is a NaN (not a number) floating point value. + /// + /// NaN has several representations and may vary across architectures. Use this function to check if you have a NaN. + /// + /// Input value. + /// True if the component was NaN; false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2 isnan(float2 x) { return (asuint(x) & 0x7FFFFFFF) > 0x7F800000; } + + /// Returns a bool3 indicating for each component of a float3 whether it is a NaN (not a number) floating point value. + /// + /// NaN has several representations and may vary across architectures. Use this function to check if you have a NaN. + /// + /// Input value. + /// True if the component was NaN; false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3 isnan(float3 x) { return (asuint(x) & 0x7FFFFFFF) > 0x7F800000; } + + /// Returns a bool4 indicating for each component of a float4 whether it is a NaN (not a number) floating point value. + /// + /// NaN has several representations and may vary across architectures. Use this function to check if you have a NaN. + /// + /// Input value. + /// True if the component was NaN; false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 isnan(float4 x) { return (asuint(x) & 0x7FFFFFFF) > 0x7F800000; } + + + /// Returns true if the input double is a NaN (not a number) floating point value, false otherwise. + /// + /// NaN has several representations and may vary across architectures. Use this function to check if you have a NaN. + /// + /// Input value. + /// True if the value was NaN; false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool isnan(double x) { return (asulong(x) & 0x7FFFFFFFFFFFFFFF) > 0x7FF0000000000000; } + + /// Returns a bool2 indicating for each component of a double2 whether it is a NaN (not a number) floating point value. + /// + /// NaN has several representations and may vary across architectures. Use this function to check if you have a NaN. + /// + /// Input value. + /// True if the component was NaN; false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2 isnan(double2 x) { + return bool2((asulong(x.x) & 0x7FFFFFFFFFFFFFFF) > 0x7FF0000000000000, + (asulong(x.y) & 0x7FFFFFFFFFFFFFFF) > 0x7FF0000000000000); + } + + /// Returns a bool3 indicating for each component of a double3 whether it is a NaN (not a number) floating point value. + /// + /// NaN has several representations and may vary across architectures. Use this function to check if you have a NaN. + /// + /// Input value. + /// True if the component was NaN; false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3 isnan(double3 x) + { + return bool3((asulong(x.x) & 0x7FFFFFFFFFFFFFFF) > 0x7FF0000000000000, + (asulong(x.y) & 0x7FFFFFFFFFFFFFFF) > 0x7FF0000000000000, + (asulong(x.z) & 0x7FFFFFFFFFFFFFFF) > 0x7FF0000000000000); + } + + /// Returns a bool4 indicating for each component of a double4 whether it is a NaN (not a number) floating point value. + /// + /// NaN has several representations and may vary across architectures. Use this function to check if you have a NaN. + /// + /// Input value. + /// True if the component was NaN; false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 isnan(double4 x) + { + return bool4((asulong(x.x) & 0x7FFFFFFFFFFFFFFF) > 0x7FF0000000000000, + (asulong(x.y) & 0x7FFFFFFFFFFFFFFF) > 0x7FF0000000000000, + (asulong(x.z) & 0x7FFFFFFFFFFFFFFF) > 0x7FF0000000000000, + (asulong(x.w) & 0x7FFFFFFFFFFFFFFF) > 0x7FF0000000000000); + } + + /// + /// Checks if the input is a power of two. + /// + /// If x is less than or equal to zero, then this function returns false. + /// Integer input. + /// bool where true indicates that input was a power of two. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool ispow2(int x) + { + return x > 0 && ((x & (x - 1)) == 0); + } + + /// + /// Checks if each component of the input is a power of two. + /// + /// If a component of x is less than or equal to zero, then this function returns false in that component. + /// int2 input + /// bool2 where true in a component indicates the same component in the input was a power of two. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2 ispow2(int2 x) + { + return new bool2(ispow2(x.x), ispow2(x.y)); + } + + /// + /// Checks if each component of the input is a power of two. + /// + /// If a component of x is less than or equal to zero, then this function returns false in that component. + /// int3 input + /// bool3 where true in a component indicates the same component in the input was a power of two. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3 ispow2(int3 x) + { + return new bool3(ispow2(x.x), ispow2(x.y), ispow2(x.z)); + } + + /// + /// Checks if each component of the input is a power of two. + /// + /// If a component of x is less than or equal to zero, then this function returns false in that component. + /// int4 input + /// bool4 where true in a component indicates the same component in the input was a power of two. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 ispow2(int4 x) + { + return new bool4(ispow2(x.x), ispow2(x.y), ispow2(x.z), ispow2(x.w)); + } + + /// + /// Checks if the input is a power of two. + /// + /// If x is less than or equal to zero, then this function returns false. + /// Unsigned integer input. + /// bool where true indicates that input was a power of two. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool ispow2(uint x) + { + return x > 0 && ((x & (x - 1)) == 0); + } + + /// + /// Checks if each component of the input is a power of two. + /// + /// If a component of x is less than or equal to zero, then this function returns false in that component. + /// uint2 input + /// bool2 where true in a component indicates the same component in the input was a power of two. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2 ispow2(uint2 x) + { + return new bool2(ispow2(x.x), ispow2(x.y)); + } + + /// + /// Checks if each component of the input is a power of two. + /// + /// If a component of x is less than or equal to zero, then this function returns false in that component. + /// uint3 input + /// bool3 where true in a component indicates the same component in the input was a power of two. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3 ispow2(uint3 x) + { + return new bool3(ispow2(x.x), ispow2(x.y), ispow2(x.z)); + } + + /// + /// Checks if each component of the input is a power of two. + /// + /// If a component of x is less than or equal to zero, then this function returns false in that component. + /// uint4 input + /// bool4 where true in a component indicates the same component in the input was a power of two. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4 ispow2(uint4 x) + { + return new bool4(ispow2(x.x), ispow2(x.y), ispow2(x.z), ispow2(x.w)); + } + + /// Returns the minimum of two int values. + /// The first input value. + /// The second input value. + /// The minimum of the two input values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int min(int x, int y) { return x < y ? x : y; } + + /// Returns the componentwise minimum of two int2 vectors. + /// The first input value. + /// The second input value. + /// The componentwise minimum of the two input values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 min(int2 x, int2 y) { return new int2(min(x.x, y.x), min(x.y, y.y)); } + + /// Returns the componentwise minimum of two int3 vectors. + /// The first input value. + /// The second input value. + /// The componentwise minimum of the two input values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 min(int3 x, int3 y) { return new int3(min(x.x, y.x), min(x.y, y.y), min(x.z, y.z)); } + + /// Returns the componentwise minimum of two int4 vectors. + /// The first input value. + /// The second input value. + /// The componentwise minimum of the two input values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 min(int4 x, int4 y) { return new int4(min(x.x, y.x), min(x.y, y.y), min(x.z, y.z), min(x.w, y.w)); } + + + /// Returns the minimum of two uint values. + /// The first input value. + /// The second input value. + /// The minimum of the two input values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint min(uint x, uint y) { return x < y ? x : y; } + + /// Returns the componentwise minimum of two uint2 vectors. + /// The first input value. + /// The second input value. + /// The componentwise minimum of the two input values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 min(uint2 x, uint2 y) { return new uint2(min(x.x, y.x), min(x.y, y.y)); } + + /// Returns the componentwise minimum of two uint3 vectors. + /// The first input value. + /// The second input value. + /// The componentwise minimum of the two input values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 min(uint3 x, uint3 y) { return new uint3(min(x.x, y.x), min(x.y, y.y), min(x.z, y.z)); } + + /// Returns the componentwise minimum of two uint4 vectors. + /// The first input value. + /// The second input value. + /// The componentwise minimum of the two input values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 min(uint4 x, uint4 y) { return new uint4(min(x.x, y.x), min(x.y, y.y), min(x.z, y.z), min(x.w, y.w)); } + + + /// Returns the minimum of two long values. + /// The first input value. + /// The second input value. + /// The minimum of the two input values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static long min(long x, long y) { return x < y ? x : y; } + + + /// Returns the minimum of two ulong values. + /// The first input value. + /// The second input value. + /// The minimum of the two input values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ulong min(ulong x, ulong y) { return x < y ? x : y; } + + + /// Returns the minimum of two float values. + /// The first input value. + /// The second input value. + /// The minimum of the two input values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float min(float x, float y) { return float.IsNaN(y) || x < y ? x : y; } + + /// Returns the componentwise minimum of two float2 vectors. + /// The first input value. + /// The second input value. + /// The componentwise minimum of the two input values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 min(float2 x, float2 y) { return new float2(min(x.x, y.x), min(x.y, y.y)); } + + /// Returns the componentwise minimum of two float3 vectors. + /// The first input value. + /// The second input value. + /// The componentwise minimum of the two input values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 min(float3 x, float3 y) { return new float3(min(x.x, y.x), min(x.y, y.y), min(x.z, y.z)); } + + /// Returns the componentwise minimum of two float4 vectors. + /// The first input value. + /// The second input value. + /// The componentwise minimum of the two input values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 min(float4 x, float4 y) { return new float4(min(x.x, y.x), min(x.y, y.y), min(x.z, y.z), min(x.w, y.w)); } + + + /// Returns the minimum of two double values. + /// The first input value. + /// The second input value. + /// The minimum of the two input values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double min(double x, double y) { return double.IsNaN(y) || x < y ? x : y; } + + /// Returns the componentwise minimum of two double2 vectors. + /// The first input value. + /// The second input value. + /// The componentwise minimum of the two input values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 min(double2 x, double2 y) { return new double2(min(x.x, y.x), min(x.y, y.y)); } + + /// Returns the componentwise minimum of two double3 vectors. + /// The first input value. + /// The second input value. + /// The componentwise minimum of the two input values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 min(double3 x, double3 y) { return new double3(min(x.x, y.x), min(x.y, y.y), min(x.z, y.z)); } + + /// Returns the componentwise minimum of two double4 vectors. + /// The first input value. + /// The second input value. + /// The componentwise minimum of the two input values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 min(double4 x, double4 y) { return new double4(min(x.x, y.x), min(x.y, y.y), min(x.z, y.z), min(x.w, y.w)); } + + + /// Returns the maximum of two int values. + /// The first input value. + /// The second input value. + /// The maximum of the two input values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int max(int x, int y) { return x > y ? x : y; } + + /// Returns the componentwise maximum of two int2 vectors. + /// The first input value. + /// The second input value. + /// The componentwise maximum of the two input values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 max(int2 x, int2 y) { return new int2(max(x.x, y.x), max(x.y, y.y)); } + + /// Returns the componentwise maximum of two int3 vectors. + /// The first input value. + /// The second input value. + /// The componentwise maximum of the two input values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 max(int3 x, int3 y) { return new int3(max(x.x, y.x), max(x.y, y.y), max(x.z, y.z)); } + + /// Returns the componentwise maximum of two int4 vectors. + /// The first input value. + /// The second input value. + /// The componentwise maximum of the two input values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 max(int4 x, int4 y) { return new int4(max(x.x, y.x), max(x.y, y.y), max(x.z, y.z), max(x.w, y.w)); } + + + /// Returns the maximum of two uint values. + /// The first input value. + /// The second input value. + /// The maximum of the two input values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint max(uint x, uint y) { return x > y ? x : y; } + + /// Returns the componentwise maximum of two uint2 vectors. + /// The first input value. + /// The second input value. + /// The componentwise maximum of the two input values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 max(uint2 x, uint2 y) { return new uint2(max(x.x, y.x), max(x.y, y.y)); } + + /// Returns the componentwise maximum of two uint3 vectors. + /// The first input value. + /// The second input value. + /// The componentwise maximum of the two input values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 max(uint3 x, uint3 y) { return new uint3(max(x.x, y.x), max(x.y, y.y), max(x.z, y.z)); } + + /// Returns the componentwise maximum of two uint4 vectors. + /// The first input value. + /// The second input value. + /// The componentwise maximum of the two input values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 max(uint4 x, uint4 y) { return new uint4(max(x.x, y.x), max(x.y, y.y), max(x.z, y.z), max(x.w, y.w)); } + + + /// Returns the maximum of two long values. + /// The first input value. + /// The second input value. + /// The maximum of the two input values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static long max(long x, long y) { return x > y ? x : y; } + + + /// Returns the maximum of two ulong values. + /// The first input value. + /// The second input value. + /// The maximum of the two input values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ulong max(ulong x, ulong y) { return x > y ? x : y; } + + + /// Returns the maximum of two float values. + /// The first input value. + /// The second input value. + /// The maximum of the two input values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float max(float x, float y) { return float.IsNaN(y) || x > y ? x : y; } + + /// Returns the componentwise maximum of two float2 vectors. + /// The first input value. + /// The second input value. + /// The componentwise maximum of the two input values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 max(float2 x, float2 y) { return new float2(max(x.x, y.x), max(x.y, y.y)); } + + /// Returns the componentwise maximum of two float3 vectors. + /// The first input value. + /// The second input value. + /// The componentwise maximum of the two input values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 max(float3 x, float3 y) { return new float3(max(x.x, y.x), max(x.y, y.y), max(x.z, y.z)); } + + /// Returns the componentwise maximum of two float4 vectors. + /// The first input value. + /// The second input value. + /// The componentwise maximum of the two input values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 max(float4 x, float4 y) { return new float4(max(x.x, y.x), max(x.y, y.y), max(x.z, y.z), max(x.w, y.w)); } + + + /// Returns the maximum of two double values. + /// The first input value. + /// The second input value. + /// The maximum of the two input values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double max(double x, double y) { return double.IsNaN(y) || x > y ? x : y; } + + /// Returns the componentwise maximum of two double2 vectors. + /// The first input value. + /// The second input value. + /// The componentwise maximum of the two input values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 max(double2 x, double2 y) { return new double2(max(x.x, y.x), max(x.y, y.y)); } + + /// Returns the componentwise maximum of two double3 vectors. + /// The first input value. + /// The second input value. + /// The componentwise maximum of the two input values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 max(double3 x, double3 y) { return new double3(max(x.x, y.x), max(x.y, y.y), max(x.z, y.z)); } + + /// Returns the componentwise maximum of two double4 vectors. + /// The first input value. + /// The second input value. + /// The componentwise maximum of the two input values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 max(double4 x, double4 y) { return new double4(max(x.x, y.x), max(x.y, y.y), max(x.z, y.z), max(x.w, y.w)); } + + + /// Returns the result of linearly interpolating from start to end using the interpolation parameter t. + /// + /// If the interpolation parameter is not in the range [0, 1], then this function extrapolates. + /// + /// The start point, corresponding to the interpolation parameter value of 0. + /// The end point, corresponding to the interpolation parameter value of 1. + /// The interpolation parameter. May be a value outside the interval [0, 1]. + /// The interpolation from start to end. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float lerp(float start, float end, float t) { return start + t * (end - start); } + + /// Returns the result of a componentwise linear interpolating from x to y using the interpolation parameter t. + /// + /// If the interpolation parameter is not in the range [0, 1], then this function extrapolates. + /// + /// The start point, corresponding to the interpolation parameter value of 0. + /// The end point, corresponding to the interpolation parameter value of 1. + /// The interpolation parameter. May be a value outside the interval [0, 1]. + /// The componentwise interpolation from x to y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 lerp(float2 start, float2 end, float t) { return start + t * (end - start); } + + /// Returns the result of a componentwise linear interpolating from x to y using the interpolation parameter t. + /// + /// If the interpolation parameter is not in the range [0, 1], then this function extrapolates. + /// + /// The start point, corresponding to the interpolation parameter value of 0. + /// The end point, corresponding to the interpolation parameter value of 1. + /// The interpolation parameter. May be a value outside the interval [0, 1]. + /// The componentwise interpolation from x to y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 lerp(float3 start, float3 end, float t) { return start + t * (end - start); } + + /// Returns the result of a componentwise linear interpolating from x to y using the interpolation parameter t. + /// + /// If the interpolation parameter is not in the range [0, 1], then this function extrapolates. + /// + /// The start point, corresponding to the interpolation parameter value of 0. + /// The end point, corresponding to the interpolation parameter value of 1. + /// The interpolation parameter. May be a value outside the interval [0, 1]. + /// The componentwise interpolation from x to y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 lerp(float4 start, float4 end, float t) { return start + t * (end - start); } + + + /// Returns the result of a componentwise linear interpolating from x to y using the corresponding components of the interpolation parameter t. + /// + /// If the interpolation parameter is not in the range [0, 1], then this function extrapolates. + /// + /// The start point, corresponding to the interpolation parameter value of 0. + /// The end point, corresponding to the interpolation parameter value of 1. + /// The interpolation parameter. May be a value outside the interval [0, 1]. + /// The componentwise interpolation from x to y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 lerp(float2 start, float2 end, float2 t) { return start + t * (end - start); } + + /// Returns the result of a componentwise linear interpolating from x to y using the corresponding components of the interpolation parameter t. + /// + /// If the interpolation parameter is not in the range [0, 1], then this function extrapolates. + /// + /// The start point, corresponding to the interpolation parameter value of 0. + /// The end point, corresponding to the interpolation parameter value of 1. + /// The interpolation parameter. May be a value outside the interval [0, 1]. + /// The componentwise interpolation from x to y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 lerp(float3 start, float3 end, float3 t) { return start + t * (end - start); } + + /// Returns the result of a componentwise linear interpolating from x to y using the corresponding components of the interpolation parameter t. + /// + /// If the interpolation parameter is not in the range [0, 1], then this function extrapolates. + /// + /// The start point, corresponding to the interpolation parameter value of 0. + /// The end point, corresponding to the interpolation parameter value of 1. + /// The interpolation parameter. May be a value outside the interval [0, 1]. + /// The componentwise interpolation from x to y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 lerp(float4 start, float4 end, float4 t) { return start + t * (end - start); } + + + /// Returns the result of linearly interpolating from x to y using the interpolation parameter t. + /// + /// If the interpolation parameter is not in the range [0, 1], then this function extrapolates. + /// + /// The start point, corresponding to the interpolation parameter value of 0. + /// The end point, corresponding to the interpolation parameter value of 1. + /// The interpolation parameter. May be a value outside the interval [0, 1]. + /// The interpolation from x to y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double lerp(double start, double end, double t) { return start + t * (end - start); } + + /// Returns the result of a componentwise linear interpolating from x to y using the interpolation parameter t. + /// + /// If the interpolation parameter is not in the range [0, 1], then this function extrapolates. + /// + /// The start point, corresponding to the interpolation parameter value of 0. + /// The end point, corresponding to the interpolation parameter value of 1. + /// The interpolation parameter. May be a value outside the interval [0, 1]. + /// The componentwise interpolation from x to y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 lerp(double2 start, double2 end, double t) { return start + t * (end - start); } + + /// Returns the result of a componentwise linear interpolating from x to y using the interpolation parameter t. + /// + /// If the interpolation parameter is not in the range [0, 1], then this function extrapolates. + /// + /// The start point, corresponding to the interpolation parameter value of 0. + /// The end point, corresponding to the interpolation parameter value of 1. + /// The interpolation parameter. May be a value outside the interval [0, 1]. + /// The componentwise interpolation from x to y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 lerp(double3 start, double3 end, double t) { return start + t * (end - start); } + + /// Returns the result of a componentwise linear interpolating from x to y using the interpolation parameter t. + /// + /// If the interpolation parameter is not in the range [0, 1], then this function extrapolates. + /// + /// The start point, corresponding to the interpolation parameter value of 0. + /// The end point, corresponding to the interpolation parameter value of 1. + /// The interpolation parameter. May be a value outside the interval [0, 1]. + /// The componentwise interpolation from x to y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 lerp(double4 start, double4 end, double t) { return start + t * (end - start); } + + + /// Returns the result of a componentwise linear interpolating from x to y using the corresponding components of the interpolation parameter t. + /// + /// If the interpolation parameter is not in the range [0, 1], then this function extrapolates. + /// + /// The start point, corresponding to the interpolation parameter value of 0. + /// The end point, corresponding to the interpolation parameter value of 1. + /// The interpolation parameter. May be a value outside the interval [0, 1]. + /// The componentwise interpolation from x to y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 lerp(double2 start, double2 end, double2 t) { return start + t * (end - start); } + + /// Returns the result of a componentwise linear interpolating from x to y using the corresponding components of the interpolation parameter t. + /// + /// If the interpolation parameter is not in the range [0, 1], then this function extrapolates. + /// + /// The start point, corresponding to the interpolation parameter value of 0. + /// The end point, corresponding to the interpolation parameter value of 1. + /// The interpolation parameter. May be a value outside the interval [0, 1]. + /// The componentwise interpolation from x to y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 lerp(double3 start, double3 end, double3 t) { return start + t * (end - start); } + + /// Returns the result of a componentwise linear interpolating from x to y using the corresponding components of the interpolation parameter t. + /// + /// If the interpolation parameter is not in the range [0, 1], then this function extrapolates. + /// + /// The start point, corresponding to the interpolation parameter value of 0. + /// The end point, corresponding to the interpolation parameter value of 1. + /// The interpolation parameter. May be a value outside the interval [0, 1]. + /// The componentwise interpolation from x to y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 lerp(double4 start, double4 end, double4 t) { return start + t * (end - start); } + + + /// Returns the result of normalizing a floating point value x to a range [a, b]. The opposite of lerp. Equivalent to (x - a) / (b - a). + /// The start point of the range. + /// The end point of the range. + /// The value to normalize to the range. + /// The interpolation parameter of x with respect to the input range [a, b]. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float unlerp(float start, float end, float x) { return (x - start) / (end - start); } + + /// Returns the componentwise result of normalizing a floating point value x to a range [a, b]. The opposite of lerp. Equivalent to (x - a) / (b - a). + /// The start point of the range. + /// The end point of the range. + /// The value to normalize to the range. + /// The componentwise interpolation parameter of x with respect to the input range [a, b]. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 unlerp(float2 start, float2 end, float2 x) { return (x - start) / (end - start); } + + /// Returns the componentwise result of normalizing a floating point value x to a range [a, b]. The opposite of lerp. Equivalent to (x - a) / (b - a). + /// The start point of the range. + /// The end point of the range. + /// The value to normalize to the range. + /// The componentwise interpolation parameter of x with respect to the input range [a, b]. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 unlerp(float3 start, float3 end, float3 x) { return (x - start) / (end - start); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool4 lessThan(float4 x, float4 y) { return x < y; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool3 lessThan(float3 x, float3 y) { return x < y; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool2 lessThan(float2 x, float2 y) { return x < y; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool1 lessThan(float x, float y) { return x < y; } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool4 lessThanEqual(float4 x, float4 y) { return x <= y; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool3 lessThanEqual(float3 x, float3 y) { return x <= y; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool2 lessThanEqual(float2 x, float2 y) { return x <= y; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool1 lessThanEqual(float x, float y) { return x <= y; } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool4 greaterThan(float4 x, float4 y) { return x > y; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool3 greaterThan(float3 x, float3 y) { return x > y; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool2 greaterThan(float2 x, float2 y) { return x > y; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool1 greaterThan(float x, float y) { return x > y; } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool4 greaterThanEqual(float4 x, float4 y) { return x >= y; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool3 greaterThanEqual(float3 x, float3 y) { return x >= y; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool2 greaterThanEqual(float2 x, float2 y) { return x >= y; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool1 greaterThanEqual(float x, float y) { return x >= y; } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool4 equal(float4 x, float4 y) { return x == y; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool3 equal(float3 x, float3 y) { return x == y; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool2 equal(float2 x, float2 y) { return x == y; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool1 equal(float x, float y) { return x == y; } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool4 notEqual(float4 x, float4 y) { return x != y; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool3 notEqual(float3 x, float3 y) { return x != y; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool2 notEqual(float2 x, float2 y) { return x != y; } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static bool1 notEqual(float x, float y) { return x != y; } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float3 up() { return new float3(0.0f,1.0f,0.0f); } + /// Returns the componentwise result of normalizing a floating point value x to a range [a, b]. The opposite of lerp. Equivalent to (x - a) / (b - a). + /// The start point of the range. + /// The end point of the range. + /// The value to normalize to the range. + /// The componentwise interpolation parameter of x with respect to the input range [a, b]. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 unlerp(float4 start, float4 end, float4 x) { return (x - start) / (end - start); } + + + /// Returns the result of normalizing a floating point value x to a range [a, b]. The opposite of lerp. Equivalent to (x - a) / (b - a). + /// The start point of the range. + /// The end point of the range. + /// The value to normalize to the range. + /// The interpolation parameter of x with respect to the input range [a, b]. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double unlerp(double start, double end, double x) { return (x - start) / (end - start); } + + /// Returns the componentwise result of normalizing a floating point value x to a range [a, b]. The opposite of lerp. Equivalent to (x - a) / (b - a). + /// The start point of the range. + /// The end point of the range. + /// The value to normalize to the range. + /// The componentwise interpolation parameter of x with respect to the input range [a, b]. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 unlerp(double2 start, double2 end, double2 x) { return (x - start) / (end - start); } + + /// Returns the componentwise result of normalizing a floating point value x to a range [a, b]. The opposite of lerp. Equivalent to (x - a) / (b - a). + /// The start point of the range. + /// The end point of the range. + /// The value to normalize to the range. + /// The componentwise interpolation parameter of x with respect to the input range [a, b]. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 unlerp(double3 start, double3 end, double3 x) { return (x - start) / (end - start); } + + /// Returns the componentwise result of normalizing a floating point value x to a range [a, b]. The opposite of lerp. Equivalent to (x - a) / (b - a). + /// The start point of the range. + /// The end point of the range. + /// The value to normalize to the range. + /// The componentwise interpolation parameter of x with respect to the input range [a, b]. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 unlerp(double4 start, double4 end, double4 x) { return (x - start) / (end - start); } + + + /// Returns the result of a non-clamping linear remapping of a value x from source range [srcStart, srcEnd] to the destination range [dstStart, dstEnd]. + /// The start point of the source range [srcStart, srcEnd]. + /// The end point of the source range [srcStart, srcEnd]. + /// The start point of the destination range [dstStart, dstEnd]. + /// The end point of the destination range [dstStart, dstEnd]. + /// The value to remap from the source to destination range. + /// The remap of input x from the source range to the destination range. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float remap(float srcStart, float srcEnd, float dstStart, float dstEnd, float x) { return lerp(dstStart, dstEnd, unlerp(srcStart, srcEnd, x)); } + + /// Returns the componentwise result of a non-clamping linear remapping of a value x from source range [srcStart, srcEnd] to the destination range [dstStart, dstEnd]. + /// The start point of the source range [srcStart, srcEnd]. + /// The end point of the source range [srcStart, srcEnd]. + /// The start point of the destination range [dstStart, dstEnd]. + /// The end point of the destination range [dstStart, dstEnd]. + /// The value to remap from the source to destination range. + /// The componentwise remap of input x from the source range to the destination range. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 remap(float2 srcStart, float2 srcEnd, float2 dstStart, float2 dstEnd, float2 x) { return lerp(dstStart, dstEnd, unlerp(srcStart, srcEnd, x)); } + + /// Returns the componentwise result of a non-clamping linear remapping of a value x from source range [srcStart, srcEnd] to the destination range [dstStart, dstEnd]. + /// The start point of the source range [srcStart, srcEnd]. + /// The end point of the source range [srcStart, srcEnd]. + /// The start point of the destination range [dstStart, dstEnd]. + /// The end point of the destination range [dstStart, dstEnd]. + /// The value to remap from the source to destination range. + /// The componentwise remap of input x from the source range to the destination range. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 remap(float3 srcStart, float3 srcEnd, float3 dstStart, float3 dstEnd, float3 x) { return lerp(dstStart, dstEnd, unlerp(srcStart, srcEnd, x)); } + + /// Returns the componentwise result of a non-clamping linear remapping of a value x from source range [srcStart, srcEnd] to the destination range [dstStart, dstEnd]. + /// The start point of the source range [srcStart, srcEnd]. + /// The end point of the source range [srcStart, srcEnd]. + /// The start point of the destination range [dstStart, dstEnd]. + /// The end point of the destination range [dstStart, dstEnd]. + /// The value to remap from the source to destination range. + /// The componentwise remap of input x from the source range to the destination range. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 remap(float4 srcStart, float4 srcEnd, float4 dstStart, float4 dstEnd, float4 x) { return lerp(dstStart, dstEnd, unlerp(srcStart, srcEnd, x)); } + + + /// Returns the result of a non-clamping linear remapping of a value x from source range [srcStart, srcEnd] to the destination range [dstStart, dstEnd]. + /// The start point of the source range [srcStart, srcEnd]. + /// The end point of the source range [srcStart, srcEnd]. + /// The start point of the destination range [dstStart, dstEnd]. + /// The end point of the destination range [dstStart, dstEnd]. + /// The value to remap from the source to destination range. + /// The remap of input x from the source range to the destination range. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double remap(double srcStart, double srcEnd, double dstStart, double dstEnd, double x) { return lerp(dstStart, dstEnd, unlerp(srcStart, srcEnd, x)); } + + /// Returns the componentwise result of a non-clamping linear remapping of a value x from source range [srcStart, srcEnd] to the destination range [dstStart, dstEnd]. + /// The start point of the source range [srcStart, srcEnd]. + /// The end point of the source range [srcStart, srcEnd]. + /// The start point of the destination range [dstStart, dstEnd]. + /// The end point of the destination range [dstStart, dstEnd]. + /// The value to remap from the source to destination range. + /// The componentwise remap of input x from the source range to the destination range. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 remap(double2 srcStart, double2 srcEnd, double2 dstStart, double2 dstEnd, double2 x) { return lerp(dstStart, dstEnd, unlerp(srcStart, srcEnd, x)); } + + /// Returns the componentwise result of a non-clamping linear remapping of a value x from source range [srcStart, srcEnd] to the destination range [dstStart, dstEnd]. + /// The start point of the source range [srcStart, srcEnd]. + /// The end point of the source range [srcStart, srcEnd]. + /// The start point of the destination range [dstStart, dstEnd]. + /// The end point of the destination range [dstStart, dstEnd]. + /// The value to remap from the source to destination range. + /// The componentwise remap of input x from the source range to the destination range. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 remap(double3 srcStart, double3 srcEnd, double3 dstStart, double3 dstEnd, double3 x) { return lerp(dstStart, dstEnd, unlerp(srcStart, srcEnd, x)); } + + /// Returns the componentwise result of a non-clamping linear remapping of a value x from source range [srcStart, srcEnd] to the destination range [dstStart, dstEnd]. + /// The start point of the source range [srcStart, srcEnd]. + /// The end point of the source range [srcStart, srcEnd]. + /// The start point of the destination range [dstStart, dstEnd]. + /// The end point of the destination range [dstStart, dstEnd]. + /// The value to remap from the source to destination range. + /// The componentwise remap of input x from the source range to the destination range. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 remap(double4 srcStart, double4 srcEnd, double4 dstStart, double4 dstEnd, double4 x) { return lerp(dstStart, dstEnd, unlerp(srcStart, srcEnd, x)); } + + + /// Returns the result of a multiply-add operation (a * b + c) on 3 int values. + /// First value to multiply. + /// Second value to multiply. + /// Third value to add to the product of a and b. + /// The multiply-add of the inputs. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int mad(int mulA, int mulB, int addC) { return mulA * mulB + addC; } + + /// Returns the result of a componentwise multiply-add operation (a * b + c) on 3 int2 vectors. + /// First value to multiply. + /// Second value to multiply. + /// Third value to add to the product of a and b. + /// The componentwise multiply-add of the inputs. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 mad(int2 mulA, int2 mulB, int2 addC) { return mulA * mulB + addC; } + + /// Returns the result of a componentwise multiply-add operation (a * b + c) on 3 int3 vectors. + /// First value to multiply. + /// Second value to multiply. + /// Third value to add to the product of a and b. + /// The componentwise multiply-add of the inputs. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 mad(int3 mulA, int3 mulB, int3 addC) { return mulA * mulB + addC; } + + /// Returns the result of a componentwise multiply-add operation (a * b + c) on 3 int4 vectors. + /// First value to multiply. + /// Second value to multiply. + /// Third value to add to the product of a and b. + /// The componentwise multiply-add of the inputs. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 mad(int4 mulA, int4 mulB, int4 addC) { return mulA * mulB + addC; } + + + /// Returns the result of a multiply-add operation (a * b + c) on 3 uint values. + /// First value to multiply. + /// Second value to multiply. + /// Third value to add to the product of a and b. + /// The multiply-add of the inputs. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint mad(uint mulA, uint mulB, uint addC) { return mulA * mulB + addC; } + + /// Returns the result of a componentwise multiply-add operation (a * b + c) on 3 uint2 vectors. + /// First value to multiply. + /// Second value to multiply. + /// Third value to add to the product of a and b. + /// The componentwise multiply-add of the inputs. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 mad(uint2 mulA, uint2 mulB, uint2 addC) { return mulA * mulB + addC; } + + /// Returns the result of a componentwise multiply-add operation (a * b + c) on 3 uint3 vectors. + /// First value to multiply. + /// Second value to multiply. + /// Third value to add to the product of a and b. + /// The componentwise multiply-add of the inputs. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 mad(uint3 mulA, uint3 mulB, uint3 addC) { return mulA * mulB + addC; } + + /// Returns the result of a componentwise multiply-add operation (a * b + c) on 3 uint4 vectors. + /// First value to multiply. + /// Second value to multiply. + /// Third value to add to the product of a and b. + /// The componentwise multiply-add of the inputs. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 mad(uint4 mulA, uint4 mulB, uint4 addC) { return mulA * mulB + addC; } + + + /// Returns the result of a multiply-add operation (a * b + c) on 3 long values. + /// First value to multiply. + /// Second value to multiply. + /// Third value to add to the product of a and b. + /// The multiply-add of the inputs. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static long mad(long mulA, long mulB, long addC) { return mulA * mulB + addC; } + + + /// Returns the result of a multiply-add operation (a * b + c) on 3 ulong values. + /// First value to multiply. + /// Second value to multiply. + /// Third value to add to the product of a and b. + /// The multiply-add of the inputs. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ulong mad(ulong mulA, ulong mulB, ulong addC) { return mulA * mulB + addC; } + + + /// Returns the result of a multiply-add operation (a * b + c) on 3 float values. + /// + /// When Burst compiled with fast math enabled on some architectures, this could be converted to a fused multiply add (FMA). + /// FMA is more accurate due to rounding once at the end of the computation rather than twice that is required when + /// this computation is not fused. + /// + /// First value to multiply. + /// Second value to multiply. + /// Third value to add to the product of a and b. + /// The multiply-add of the inputs. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float mad(float mulA, float mulB, float addC) { return mulA * mulB + addC; } + + /// Returns the result of a componentwise multiply-add operation (a * b + c) on 3 float2 vectors. + /// + /// When Burst compiled with fast math enabled on some architectures, this could be converted to a fused multiply add (FMA). + /// FMA is more accurate due to rounding once at the end of the computation rather than twice that is required when + /// this computation is not fused. + /// + /// First value to multiply. + /// Second value to multiply. + /// Third value to add to the product of a and b. + /// The componentwise multiply-add of the inputs. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 mad(float2 mulA, float2 mulB, float2 addC) { return mulA * mulB + addC; } + + /// Returns the result of a componentwise multiply-add operation (a * b + c) on 3 float3 vectors. + /// + /// When Burst compiled with fast math enabled on some architectures, this could be converted to a fused multiply add (FMA). + /// FMA is more accurate due to rounding once at the end of the computation rather than twice that is required when + /// this computation is not fused. + /// + /// First value to multiply. + /// Second value to multiply. + /// Third value to add to the product of a and b. + /// The componentwise multiply-add of the inputs. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 mad(float3 mulA, float3 mulB, float3 addC) { return mulA * mulB + addC; } + + /// Returns the result of a componentwise multiply-add operation (a * b + c) on 3 float4 vectors. + /// + /// When Burst compiled with fast math enabled on some architectures, this could be converted to a fused multiply add (FMA). + /// FMA is more accurate due to rounding once at the end of the computation rather than twice that is required when + /// this computation is not fused. + /// + /// First value to multiply. + /// Second value to multiply. + /// Third value to add to the product of a and b. + /// The componentwise multiply-add of the inputs. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 mad(float4 mulA, float4 mulB, float4 addC) { return mulA * mulB + addC; } + + + /// Returns the result of a multiply-add operation (a * b + c) on 3 double values. + /// + /// When Burst compiled with fast math enabled on some architectures, this could be converted to a fused multiply add (FMA). + /// FMA is more accurate due to rounding once at the end of the computation rather than twice that is required when + /// this computation is not fused. + /// + /// First value to multiply. + /// Second value to multiply. + /// Third value to add to the product of a and b. + /// The multiply-add of the inputs. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double mad(double mulA, double mulB, double addC) { return mulA * mulB + addC; } + + /// Returns the result of a componentwise multiply-add operation (a * b + c) on 3 double2 vectors. + /// + /// When Burst compiled with fast math enabled on some architectures, this could be converted to a fused multiply add (FMA). + /// FMA is more accurate due to rounding once at the end of the computation rather than twice that is required when + /// this computation is not fused. + /// + /// First value to multiply. + /// Second value to multiply. + /// Third value to add to the product of a and b. + /// The componentwise multiply-add of the inputs. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 mad(double2 mulA, double2 mulB, double2 addC) { return mulA * mulB + addC; } + + /// Returns the result of a componentwise multiply-add operation (a * b + c) on 3 double3 vectors. + /// + /// When Burst compiled with fast math enabled on some architectures, this could be converted to a fused multiply add (FMA). + /// FMA is more accurate due to rounding once at the end of the computation rather than twice that is required when + /// this computation is not fused. + /// + /// First value to multiply. + /// Second value to multiply. + /// Third value to add to the product of a and b. + /// The componentwise multiply-add of the inputs. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 mad(double3 mulA, double3 mulB, double3 addC) { return mulA * mulB + addC; } + + /// Returns the result of a componentwise multiply-add operation (a * b + c) on 3 double4 vectors. + /// + /// When Burst compiled with fast math enabled on some architectures, this could be converted to a fused multiply add (FMA). + /// FMA is more accurate due to rounding once at the end of the computation rather than twice that is required when + /// this computation is not fused. + /// + /// First value to multiply. + /// Second value to multiply. + /// Third value to add to the product of a and b. + /// The componentwise multiply-add of the inputs. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 mad(double4 mulA, double4 mulB, double4 addC) { return mulA * mulB + addC; } + + + /// Returns the result of clamping the value valueToClamp into the interval (inclusive) [lowerBound, upperBound], where valueToClamp, lowerBound and upperBound are int values. + /// Input value to be clamped. + /// Lower bound of the interval. + /// Upper bound of the interval. + /// The clamping of the input valueToClamp into the interval (inclusive) [lowerBound, upperBound]. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int clamp(int valueToClamp, int lowerBound, int upperBound) { return max(lowerBound, min(upperBound, valueToClamp)); } + + /// Returns the result of a componentwise clamping of the int2 x into the interval [a, b], where a and b are int2 vectors. + /// Input value to be clamped. + /// Lower bound of the interval. + /// Upper bound of the interval. + /// The componentwise clamping of the input valueToClamp into the interval (inclusive) [lowerBound, upperBound]. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 clamp(int2 valueToClamp, int2 lowerBound, int2 upperBound) { return max(lowerBound, min(upperBound, valueToClamp)); } + + /// Returns the result of a componentwise clamping of the int3 x into the interval [a, b], where x, a and b are int3 vectors. + /// Input value to be clamped. + /// Lower bound of the interval. + /// Upper bound of the interval. + /// The componentwise clamping of the input valueToClamp into the interval (inclusive) [lowerBound, upperBound]. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 clamp(int3 valueToClamp, int3 lowerBound, int3 upperBound) { return max(lowerBound, min(upperBound, valueToClamp)); } + + /// Returns the result of a componentwise clamping of the value valueToClamp into the interval (inclusive) [lowerBound, upperBound], where valueToClamp, lowerBound and upperBound are int4 vectors. + /// Input value to be clamped. + /// Lower bound of the interval. + /// Upper bound of the interval. + /// The componentwise clamping of the input valueToClamp into the interval (inclusive) [lowerBound, upperBound]. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 clamp(int4 valueToClamp, int4 lowerBound, int4 upperBound) { return max(lowerBound, min(upperBound, valueToClamp)); } + + + /// Returns the result of clamping the value valueToClamp into the interval (inclusive) [lowerBound, upperBound], where valueToClamp, lowerBound and upperBound are uint values. + /// Input value to be clamped. + /// Lower bound of the interval. + /// Upper bound of the interval. + /// The clamping of the input valueToClamp into the interval (inclusive) [lowerBound, upperBound]. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint clamp(uint valueToClamp, uint lowerBound, uint upperBound) { return max(lowerBound, min(upperBound, valueToClamp)); } + + /// Returns the result of a componentwise clamping of the value valueToClamp into the interval (inclusive) [lowerBound, upperBound], where valueToClamp, lowerBound and upperBound are uint2 vectors. + /// Input value to be clamped. + /// Lower bound of the interval. + /// Upper bound of the interval. + /// The componentwise clamping of the input valueToClamp into the interval (inclusive) [lowerBound, upperBound]. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 clamp(uint2 valueToClamp, uint2 lowerBound, uint2 upperBound) { return max(lowerBound, min(upperBound, valueToClamp)); } + + /// Returns the result of a componentwise clamping of the value valueToClamp into the interval (inclusive) [lowerBound, upperBound], where valueToClamp, lowerBound and upperBound are uint3 vectors. + /// Input value to be clamped. + /// Lower bound of the interval. + /// Upper bound of the interval. + /// The componentwise clamping of the input valueToClamp into the interval (inclusive) [lowerBound, upperBound]. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 clamp(uint3 valueToClamp, uint3 lowerBound, uint3 upperBound) { return max(lowerBound, min(upperBound, valueToClamp)); } + + /// Returns the result of a componentwise clamping of the value valueToClamp into the interval (inclusive) [lowerBound, upperBound], where valueToClamp, lowerBound and upperBound are uint4 vectors. + /// Input value to be clamped. + /// Lower bound of the interval. + /// Upper bound of the interval. + /// The componentwise clamping of the input valueToClamp into the interval (inclusive) [lowerBound, upperBound]. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 clamp(uint4 valueToClamp, uint4 lowerBound, uint4 upperBound) { return max(lowerBound, min(upperBound, valueToClamp)); } + + + /// Returns the result of clamping the value valueToClamp into the interval (inclusive) [lowerBound, upperBound], where valueToClamp, lowerBound and upperBound are long values. + /// Input value to be clamped. + /// Lower bound of the interval. + /// Upper bound of the interval. + /// The clamping of the input valueToClamp into the interval (inclusive) [lowerBound, upperBound]. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static long clamp(long valueToClamp, long lowerBound, long upperBound) { return max(lowerBound, min(upperBound, valueToClamp)); } + + /// Returns the result of clamping the value valueToClamp into the interval (inclusive) [lowerBound, upperBound], where valueToClamp, lowerBound and upperBound are ulong values. + /// Input value to be clamped. + /// Lower bound of the interval. + /// Upper bound of the interval. + /// The clamping of the input valueToClamp into the interval (inclusive) [lowerBound, upperBound]. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ulong clamp(ulong valueToClamp, ulong lowerBound, ulong upperBound) { return max(lowerBound, min(upperBound, valueToClamp)); } + + + /// Returns the result of clamping the value valueToClamp into the interval (inclusive) [lowerBound, upperBound], where valueToClamp, lowerBound and upperBound are float values. + /// Input value to be clamped. + /// Lower bound of the interval. + /// Upper bound of the interval. + /// The clamping of the input valueToClamp into the interval (inclusive) [lowerBound, upperBound]. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float clamp(float valueToClamp, float lowerBound, float upperBound) { return max(lowerBound, min(upperBound, valueToClamp)); } + + /// Returns the result of a componentwise clamping of the value valueToClamp into the interval (inclusive) [lowerBound, upperBound], where valueToClamp, lowerBound and upperBound are float2 vectors. + /// Input value to be clamped. + /// Lower bound of the interval. + /// Upper bound of the interval. + /// The componentwise clamping of the input valueToClamp into the interval (inclusive) [lowerBound, upperBound]. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 clamp(float2 valueToClamp, float2 lowerBound, float2 upperBound) { return max(lowerBound, min(upperBound, valueToClamp)); } + + /// Returns the result of a componentwise clamping of the value valueToClamp into the interval (inclusive) [lowerBound, upperBound], where valueToClamp, lowerBound and upperBound are float3 vectors. + /// Input value to be clamped. + /// Lower bound of the interval. + /// Upper bound of the interval. + /// The componentwise clamping of the input valueToClamp into the interval (inclusive) [lowerBound, upperBound]. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 clamp(float3 valueToClamp, float3 lowerBound, float3 upperBound) { return max(lowerBound, min(upperBound, valueToClamp)); } + + /// Returns the result of a componentwise clamping of the value valueToClamp into the interval (inclusive) [lowerBound, upperBound], where valueToClamp, lowerBound and upperBound are float4 vectors. + /// Input value to be clamped. + /// Lower bound of the interval. + /// Upper bound of the interval. + /// The componentwise clamping of the input valueToClamp into the interval (inclusive) [lowerBound, upperBound]. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 clamp(float4 valueToClamp, float4 lowerBound, float4 upperBound) { return max(lowerBound, min(upperBound, valueToClamp)); } + + + /// Returns the result of clamping the value valueToClamp into the interval (inclusive) [lowerBound, upperBound], where valueToClamp, lowerBound and upperBound are double values. + /// Input value to be clamped. + /// Lower bound of the interval. + /// Upper bound of the interval. + /// The clamping of the input valueToClamp into the interval (inclusive) [lowerBound, upperBound]. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double clamp(double valueToClamp, double lowerBound, double upperBound) { return max(lowerBound, min(upperBound, valueToClamp)); } + + /// Returns the result of a componentwise clamping of the value valueToClamp into the interval (inclusive) [lowerBound, upperBound], where valueToClamp, lowerBound and upperBound are double2 vectors. + /// Input value to be clamped. + /// Lower bound of the interval. + /// Upper bound of the interval. + /// The componentwise clamping of the input valueToClamp into the interval (inclusive) [lowerBound, upperBound]. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 clamp(double2 valueToClamp, double2 lowerBound, double2 upperBound) { return max(lowerBound, min(upperBound, valueToClamp)); } + + /// Returns the result of a componentwise clamping of the value valueToClamp into the interval (inclusive) [lowerBound, upperBound], where valueToClamp, lowerBound and upperBound are double3 vectors. + /// Input value to be clamped. + /// Lower bound of the interval. + /// Upper bound of the interval. + /// The componentwise clamping of the input valueToClamp into the interval (inclusive) [lowerBound, upperBound]. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 clamp(double3 valueToClamp, double3 lowerBound, double3 upperBound) { return max(lowerBound, min(upperBound, valueToClamp)); } + + /// Returns the result of a componentwise clamping of the value valueToClamp into the interval (inclusive) [lowerBound, upperBound], where valueToClamp, lowerBound and upperBound are double4 vectors. + /// Input value to be clamped. + /// Lower bound of the interval. + /// Upper bound of the interval. + /// The componentwise clamping of the input valueToClamp into the interval (inclusive) [lowerBound, upperBound]. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 clamp(double4 valueToClamp, double4 lowerBound, double4 upperBound) { return max(lowerBound, min(upperBound, valueToClamp)); } + + + /// Returns the result of clamping the float value x into the interval [0, 1]. + /// Input value. + /// The clamping of the input into the interval [0, 1]. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float saturate(float x) { return clamp(x, 0.0f, 1.0f); } + + /// Returns the result of a componentwise clamping of the float2 vector x into the interval [0, 1]. + /// Input value. + /// The componentwise clamping of the input into the interval [0, 1]. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 saturate(float2 x) { return clamp(x, new float2(0.0f), new float2(1.0f)); } + + /// Returns the result of a componentwise clamping of the float3 vector x into the interval [0, 1]. + /// Input value. + /// The componentwise clamping of the input into the interval [0, 1]. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 saturate(float3 x) { return clamp(x, new float3(0.0f), new float3(1.0f)); } + + /// Returns the result of a componentwise clamping of the float4 vector x into the interval [0, 1]. + /// Input value. + /// The componentwise clamping of the input into the interval [0, 1]. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 saturate(float4 x) { return clamp(x, new float4(0.0f), new float4(1.0f)); } + + + /// Returns the result of clamping the double value x into the interval [0, 1]. + /// Input value. + /// The clamping of the input into the interval [0, 1]. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double saturate(double x) { return clamp(x, 0.0, 1.0); } + + /// Returns the result of a componentwise clamping of the double2 vector x into the interval [0, 1]. + /// Input value. + /// The componentwise clamping of the input into the interval [0, 1]. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 saturate(double2 x) { return clamp(x, new double2(0.0), new double2(1.0)); } + + /// Returns the result of a componentwise clamping of the double3 vector x into the interval [0, 1]. + /// Input value. + /// The componentwise clamping of the input into the interval [0, 1]. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 saturate(double3 x) { return clamp(x, new double3(0.0), new double3(1.0)); } + + /// Returns the result of a componentwise clamping of the double4 vector x into the interval [0, 1]. + /// Input value. + /// The componentwise clamping of the input into the interval [0, 1]. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 saturate(double4 x) { return clamp(x, new double4(0.0), new double4(1.0)); } + + + /// Returns the absolute value of a int value. + /// Input value. + /// The absolute value of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int abs(int x) { return max(-x, x); } + + /// Returns the componentwise absolute value of a int2 vector. + /// Input value. + /// The componentwise absolute value of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 abs(int2 x) { return max(-x, x); } + + /// Returns the componentwise absolute value of a int3 vector. + /// Input value. + /// The componentwise absolute value of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 abs(int3 x) { return max(-x, x); } + + /// Returns the componentwise absolute value of a int4 vector. + /// Input value. + /// The componentwise absolute value of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 abs(int4 x) { return max(-x, x); } + + /// Returns the absolute value of a long value. + /// Input value. + /// The absolute value of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static long abs(long x) { return max(-x, x); } + + + /// Returns the absolute value of a float value. + /// Input value. + /// The absolute value of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float abs(float x) { return asfloat(asuint(x) & 0x7FFFFFFF); } + + /// Returns the componentwise absolute value of a float2 vector. + /// Input value. + /// The componentwise absolute value of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 abs(float2 x) { return asfloat(asuint(x) & 0x7FFFFFFF); } + + /// Returns the componentwise absolute value of a float3 vector. + /// Input value. + /// The componentwise absolute value of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 abs(float3 x) { return asfloat(asuint(x) & 0x7FFFFFFF); } + + /// Returns the componentwise absolute value of a float4 vector. + /// Input value. + /// The componentwise absolute value of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 abs(float4 x) { return asfloat(asuint(x) & 0x7FFFFFFF); } + + + /// Returns the absolute value of a double value. + /// Input value. + /// The absolute value of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double abs(double x) { return asdouble(asulong(x) & 0x7FFFFFFFFFFFFFFF); } + + /// Returns the componentwise absolute value of a double2 vector. + /// Input value. + /// The componentwise absolute value of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 abs(double2 x) { return double2(asdouble(asulong(x.x) & 0x7FFFFFFFFFFFFFFF), asdouble(asulong(x.y) & 0x7FFFFFFFFFFFFFFF)); } + + /// Returns the componentwise absolute value of a double3 vector. + /// Input value. + /// The componentwise absolute value of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 abs(double3 x) { return double3(asdouble(asulong(x.x) & 0x7FFFFFFFFFFFFFFF), asdouble(asulong(x.y) & 0x7FFFFFFFFFFFFFFF), asdouble(asulong(x.z) & 0x7FFFFFFFFFFFFFFF)); } + + /// Returns the componentwise absolute value of a double4 vector. + /// Input value. + /// The componentwise absolute value of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 abs(double4 x) { return double4(asdouble(asulong(x.x) & 0x7FFFFFFFFFFFFFFF), asdouble(asulong(x.y) & 0x7FFFFFFFFFFFFFFF), asdouble(asulong(x.z) & 0x7FFFFFFFFFFFFFFF), asdouble(asulong(x.w) & 0x7FFFFFFFFFFFFFFF)); } + + + /// Returns the dot product of two int values. Equivalent to multiplication. + /// The first value. + /// The second value. + /// The dot product of two values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int dot(int x, int y) { return x * y; } + + /// Returns the dot product of two int2 vectors. + /// The first vector. + /// The second vector. + /// The dot product of two vectors. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int dot(int2 x, int2 y) { return x.x * y.x + x.y * y.y; } + + /// Returns the dot product of two int3 vectors. + /// The first vector. + /// The second vector. + /// The dot product of two vectors. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int dot(int3 x, int3 y) { return x.x * y.x + x.y * y.y + x.z * y.z; } + + /// Returns the dot product of two int4 vectors. + /// The first vector. + /// The second vector. + /// The dot product of two vectors. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int dot(int4 x, int4 y) { return x.x * y.x + x.y * y.y + x.z * y.z + x.w * y.w; } + + + /// Returns the dot product of two uint values. Equivalent to multiplication. + /// The first value. + /// The second value. + /// The dot product of two values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint dot(uint x, uint y) { return x * y; } + + /// Returns the dot product of two uint2 vectors. + /// The first vector. + /// The second vector. + /// The dot product of two vectors. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint dot(uint2 x, uint2 y) { return x.x * y.x + x.y * y.y; } + + /// Returns the dot product of two uint3 vectors. + /// The first vector. + /// The second vector. + /// The dot product of two vectors. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint dot(uint3 x, uint3 y) { return x.x * y.x + x.y * y.y + x.z * y.z; } + + /// Returns the dot product of two uint4 vectors. + /// The first vector. + /// The second vector. + /// The dot product of two vectors. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint dot(uint4 x, uint4 y) { return x.x * y.x + x.y * y.y + x.z * y.z + x.w * y.w; } + + + /// Returns the dot product of two float values. Equivalent to multiplication. + /// The first value. + /// The second value. + /// The dot product of two values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float dot(float x, float y) { return x * y; } + + /// Returns the dot product of two float2 vectors. + /// The first vector. + /// The second vector. + /// The dot product of two vectors. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float dot(float2 x, float2 y) { return x.x * y.x + x.y * y.y; } + + /// Returns the dot product of two float3 vectors. + /// The first vector. + /// The second vector. + /// The dot product of two vectors. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float dot(float3 x, float3 y) { return x.x * y.x + x.y * y.y + x.z * y.z; } + + /// Returns the dot product of two float4 vectors. + /// The first vector. + /// The second vector. + /// The dot product of two vectors. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float dot(float4 x, float4 y) { return x.x * y.x + x.y * y.y + x.z * y.z + x.w * y.w; } + + + /// Returns the dot product of two double values. Equivalent to multiplication. + /// The first value. + /// The second value. + /// The dot product of two values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double dot(double x, double y) { return x * y; } + + /// Returns the dot product of two double2 vectors. + /// The first vector. + /// The second vector. + /// The dot product of two vectors. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double dot(double2 x, double2 y) { return x.x * y.x + x.y * y.y; } + + /// Returns the dot product of two double3 vectors. + /// The first vector. + /// The second vector. + /// The dot product of two vectors. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double dot(double3 x, double3 y) { return x.x * y.x + x.y * y.y + x.z * y.z; } + + /// Returns the dot product of two double4 vectors. + /// The first vector. + /// The second vector. + /// The dot product of two vectors. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double dot(double4 x, double4 y) { return x.x * y.x + x.y * y.y + x.z * y.z + x.w * y.w; } + + + /// Returns the tangent of a float value. + /// Input value. + /// The tangent of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float tan(float x) { return (float)System.Math.Tan(x); } + + /// Returns the componentwise tangent of a float2 vector. + /// Input value. + /// The componentwise tangent of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 tan(float2 x) { return new float2(tan(x.x), tan(x.y)); } + + /// Returns the componentwise tangent of a float3 vector. + /// Input value. + /// The componentwise tangent of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 tan(float3 x) { return new float3(tan(x.x), tan(x.y), tan(x.z)); } + + /// Returns the componentwise tangent of a float4 vector. + /// Input value. + /// The componentwise tangent of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 tan(float4 x) { return new float4(tan(x.x), tan(x.y), tan(x.z), tan(x.w)); } + + + /// Returns the tangent of a double value. + /// Input value. + /// The tangent of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double tan(double x) { return System.Math.Tan(x); } + + /// Returns the componentwise tangent of a double2 vector. + /// Input value. + /// The componentwise tangent of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 tan(double2 x) { return new double2(tan(x.x), tan(x.y)); } + + /// Returns the componentwise tangent of a double3 vector. + /// Input value. + /// The componentwise tangent of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 tan(double3 x) { return new double3(tan(x.x), tan(x.y), tan(x.z)); } + + /// Returns the componentwise tangent of a double4 vector. + /// Input value. + /// The componentwise tangent of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 tan(double4 x) { return new double4(tan(x.x), tan(x.y), tan(x.z), tan(x.w)); } + + + /// Returns the hyperbolic tangent of a float value. + /// Input value. + /// The hyperbolic tangent of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float tanh(float x) { return (float)System.Math.Tanh(x); } + + /// Returns the componentwise hyperbolic tangent of a float2 vector. + /// Input value. + /// The componentwise hyperbolic tangent of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 tanh(float2 x) { return new float2(tanh(x.x), tanh(x.y)); } + + /// Returns the componentwise hyperbolic tangent of a float3 vector. + /// Input value. + /// The componentwise hyperbolic tangent of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 tanh(float3 x) { return new float3(tanh(x.x), tanh(x.y), tanh(x.z)); } + + /// Returns the componentwise hyperbolic tangent of a float4 vector. + /// Input value. + /// The componentwise hyperbolic tangent of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 tanh(float4 x) { return new float4(tanh(x.x), tanh(x.y), tanh(x.z), tanh(x.w)); } + + + /// Returns the hyperbolic tangent of a double value. + /// Input value. + /// The hyperbolic tangent of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double tanh(double x) { return System.Math.Tanh(x); } + + /// Returns the componentwise hyperbolic tangent of a double2 vector. + /// Input value. + /// The componentwise hyperbolic tangent of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 tanh(double2 x) { return new double2(tanh(x.x), tanh(x.y)); } + + /// Returns the componentwise hyperbolic tangent of a double3 vector. + /// Input value. + /// The componentwise hyperbolic tangent of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 tanh(double3 x) { return new double3(tanh(x.x), tanh(x.y), tanh(x.z)); } + + /// Returns the componentwise hyperbolic tangent of a double4 vector. + /// Input value. + /// The componentwise hyperbolic tangent of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 tanh(double4 x) { return new double4(tanh(x.x), tanh(x.y), tanh(x.z), tanh(x.w)); } + + + /// Returns the arctangent of a float value. + /// A tangent value, usually the ratio y/x on the unit circle. + /// The arctangent of the input, in radians. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float atan(float x) { return (float)System.Math.Atan(x); } + + /// Returns the componentwise arctangent of a float2 vector. + /// A tangent value, usually the ratio y/x on the unit circle. + /// The componentwise arctangent of the input, in radians. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 atan(float2 x) { return new float2(atan(x.x), atan(x.y)); } + + /// Returns the componentwise arctangent of a float3 vector. + /// A tangent value, usually the ratio y/x on the unit circle. + /// The componentwise arctangent of the input, in radians. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 atan(float3 x) { return new float3(atan(x.x), atan(x.y), atan(x.z)); } + + /// Returns the componentwise arctangent of a float4 vector. + /// A tangent value, usually the ratio y/x on the unit circle. + /// The componentwise arctangent of the input, in radians. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 atan(float4 x) { return new float4(atan(x.x), atan(x.y), atan(x.z), atan(x.w)); } + + + /// Returns the arctangent of a double value. + /// A tangent value, usually the ratio y/x on the unit circle. + /// The arctangent of the input, in radians. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double atan(double x) { return System.Math.Atan(x); } + + /// Returns the componentwise arctangent of a double2 vector. + /// A tangent value, usually the ratio y/x on the unit circle. + /// The componentwise arctangent of the input, in radians. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 atan(double2 x) { return new double2(atan(x.x), atan(x.y)); } + + /// Returns the componentwise arctangent of a double3 vector. + /// A tangent value, usually the ratio y/x on the unit circle. + /// The componentwise arctangent of the input, in radians. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 atan(double3 x) { return new double3(atan(x.x), atan(x.y), atan(x.z)); } + + /// Returns the componentwise arctangent of a double4 vector. + /// A tangent value, usually the ratio y/x on the unit circle. + /// The componentwise arctangent of the input, in radians. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 atan(double4 x) { return new double4(atan(x.x), atan(x.y), atan(x.z), atan(x.w)); } + + + /// Returns the 2-argument arctangent of a pair of float values. + /// Numerator of the ratio y/x, usually the y component on the unit circle. + /// Denominator of the ratio y/x, usually the x component on the unit circle. + /// The arctangent of the ratio y/x, in radians. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float atan2(float y, float x) { return (float)System.Math.Atan2(y, x); } + + /// Returns the componentwise 2-argument arctangent of a pair of floats2 vectors. + /// Numerator of the ratio y/x, usually the y component on the unit circle. + /// Denominator of the ratio y/x, usually the x component on the unit circle. + /// The componentwise arctangent of the ratio y/x, in radians. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 atan2(float2 y, float2 x) { return new float2(atan2(y.x, x.x), atan2(y.y, x.y)); } + + /// Returns the componentwise 2-argument arctangent of a pair of floats3 vectors. + /// Numerator of the ratio y/x, usually the y component on the unit circle. + /// Denominator of the ratio y/x, usually the x component on the unit circle. + /// The componentwise arctangent of the ratio y/x, in radians. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 atan2(float3 y, float3 x) { return new float3(atan2(y.x, x.x), atan2(y.y, x.y), atan2(y.z, x.z)); } + + /// Returns the componentwise 2-argument arctangent of a pair of floats4 vectors. + /// Numerator of the ratio y/x, usually the y component on the unit circle. + /// Denominator of the ratio y/x, usually the x component on the unit circle. + /// The componentwise arctangent of the ratio y/x, in radians. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 atan2(float4 y, float4 x) { return new float4(atan2(y.x, x.x), atan2(y.y, x.y), atan2(y.z, x.z), atan2(y.w, x.w)); } + + + /// Returns the 2-argument arctangent of a pair of double values. + /// Numerator of the ratio y/x, usually the y component on the unit circle. + /// Denominator of the ratio y/x, usually the x component on the unit circle. + /// The arctangent of the ratio y/x, in radians. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double atan2(double y, double x) { return System.Math.Atan2(y, x); } + + /// Returns the 2-argument arctangent of a pair of double2 vectors. + /// Numerator of the ratio y/x, usually the y component on the unit circle. + /// Denominator of the ratio y/x, usually the x component on the unit circle. + /// The componentwise arctangent of the ratio y/x, in radians. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 atan2(double2 y, double2 x) { return new double2(atan2(y.x, x.x), atan2(y.y, x.y)); } + + /// Returns the 2-argument arctangent of a pair of double3 vectors. + /// Numerator of the ratio y/x, usually the y component on the unit circle. + /// Denominator of the ratio y/x, usually the x component on the unit circle. + /// The componentwise arctangent of the ratio y/x, in radians. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 atan2(double3 y, double3 x) { return new double3(atan2(y.x, x.x), atan2(y.y, x.y), atan2(y.z, x.z)); } + + /// Returns the 2-argument arctangent of a pair of double4 vectors. + /// Numerator of the ratio y/x, usually the y component on the unit circle. + /// Denominator of the ratio y/x, usually the x component on the unit circle. + /// The componentwise arctangent of the ratio y/x, in radians. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 atan2(double4 y, double4 x) { return new double4(atan2(y.x, x.x), atan2(y.y, x.y), atan2(y.z, x.z), atan2(y.w, x.w)); } + + + /// Returns the cosine of a float value. + /// Input value. + /// The cosine cosine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float cos(float x) { return (float)System.Math.Cos(x); } + + /// Returns the componentwise cosine of a float2 vector. + /// Input value. + /// The componentwise cosine cosine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 cos(float2 x) { return new float2(cos(x.x), cos(x.y)); } + + /// Returns the componentwise cosine of a float3 vector. + /// Input value. + /// The componentwise cosine cosine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 cos(float3 x) { return new float3(cos(x.x), cos(x.y), cos(x.z)); } + + /// Returns the componentwise cosine of a float4 vector. + /// Input value. + /// The componentwise cosine cosine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 cos(float4 x) { return new float4(cos(x.x), cos(x.y), cos(x.z), cos(x.w)); } + + + /// Returns the cosine of a double value. + /// Input value. + /// The cosine cosine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double cos(double x) { return System.Math.Cos(x); } + + /// Returns the componentwise cosine of a double2 vector. + /// Input value. + /// The componentwise cosine cosine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 cos(double2 x) { return new double2(cos(x.x), cos(x.y)); } + + /// Returns the componentwise cosine of a double3 vector. + /// Input value. + /// The componentwise cosine cosine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 cos(double3 x) { return new double3(cos(x.x), cos(x.y), cos(x.z)); } + + /// Returns the componentwise cosine of a double4 vector. + /// Input value. + /// The componentwise cosine cosine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 cos(double4 x) { return new double4(cos(x.x), cos(x.y), cos(x.z), cos(x.w)); } + + + /// Returns the hyperbolic cosine of a float value. + /// Input value. + /// The hyperbolic cosine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float cosh(float x) { return (float)System.Math.Cosh(x); } + + /// Returns the componentwise hyperbolic cosine of a float2 vector. + /// Input value. + /// The componentwise hyperbolic cosine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 cosh(float2 x) { return new float2(cosh(x.x), cosh(x.y)); } + + /// Returns the componentwise hyperbolic cosine of a float3 vector. + /// Input value. + /// The componentwise hyperbolic cosine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 cosh(float3 x) { return new float3(cosh(x.x), cosh(x.y), cosh(x.z)); } + + /// Returns the componentwise hyperbolic cosine of a float4 vector. + /// Input value. + /// The componentwise hyperbolic cosine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 cosh(float4 x) { return new float4(cosh(x.x), cosh(x.y), cosh(x.z), cosh(x.w)); } + + + /// Returns the hyperbolic cosine of a double value. + /// Input value. + /// The hyperbolic cosine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double cosh(double x) { return System.Math.Cosh(x); } + + /// Returns the componentwise hyperbolic cosine of a double2 vector. + /// Input value. + /// The componentwise hyperbolic cosine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 cosh(double2 x) { return new double2(cosh(x.x), cosh(x.y)); } + + /// Returns the componentwise hyperbolic cosine of a double3 vector. + /// Input value. + /// The componentwise hyperbolic cosine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 cosh(double3 x) { return new double3(cosh(x.x), cosh(x.y), cosh(x.z)); } + + /// Returns the componentwise hyperbolic cosine of a double4 vector. + /// Input value. + /// The componentwise hyperbolic cosine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 cosh(double4 x) { return new double4(cosh(x.x), cosh(x.y), cosh(x.z), cosh(x.w)); } + + + /// Returns the arccosine of a float value. + /// Input value. + /// The arccosine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float acos(float x) { return (float)System.Math.Acos((float)x); } + + /// Returns the componentwise arccosine of a float2 vector. + /// Input value. + /// The componentwise arccosine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 acos(float2 x) { return new float2(acos(x.x), acos(x.y)); } + + /// Returns the componentwise arccosine of a float3 vector. + /// Input value. + /// The componentwise arccosine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 acos(float3 x) { return new float3(acos(x.x), acos(x.y), acos(x.z)); } + + /// Returns the componentwise arccosine of a float4 vector. + /// Input value. + /// The componentwise arccosine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 acos(float4 x) { return new float4(acos(x.x), acos(x.y), acos(x.z), acos(x.w)); } + + + /// Returns the arccosine of a double value. + /// Input value. + /// The arccosine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double acos(double x) { return System.Math.Acos(x); } + + /// Returns the componentwise arccosine of a double2 vector. + /// Input value. + /// The componentwise arccosine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 acos(double2 x) { return new double2(acos(x.x), acos(x.y)); } + + /// Returns the componentwise arccosine of a double3 vector. + /// Input value. + /// The componentwise arccosine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 acos(double3 x) { return new double3(acos(x.x), acos(x.y), acos(x.z)); } + + /// Returns the componentwise arccosine of a double4 vector. + /// Input value. + /// The componentwise arccosine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 acos(double4 x) { return new double4(acos(x.x), acos(x.y), acos(x.z), acos(x.w)); } + + + /// Returns the sine of a float value. + /// Input value. + /// The sine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float sin(float x) { return (float)System.Math.Sin((float)x); } + + /// Returns the componentwise sine of a float2 vector. + /// Input value. + /// The componentwise sine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 sin(float2 x) { return new float2(sin(x.x), sin(x.y)); } + + /// Returns the componentwise sine of a float3 vector. + /// Input value. + /// The componentwise sine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 sin(float3 x) { return new float3(sin(x.x), sin(x.y), sin(x.z)); } + + /// Returns the componentwise sine of a float4 vector. + /// Input value. + /// The componentwise sine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 sin(float4 x) { return new float4(sin(x.x), sin(x.y), sin(x.z), sin(x.w)); } + + + /// Returns the sine of a double value. + /// Input value. + /// The sine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double sin(double x) { return System.Math.Sin(x); } + + /// Returns the componentwise sine of a double2 vector. + /// Input value. + /// The componentwise sine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 sin(double2 x) { return new double2(sin(x.x), sin(x.y)); } + + /// Returns the componentwise sine of a double3 vector. + /// Input value. + /// The componentwise sine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 sin(double3 x) { return new double3(sin(x.x), sin(x.y), sin(x.z)); } + + /// Returns the componentwise sine of a double4 vector. + /// Input value. + /// The componentwise sine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 sin(double4 x) { return new double4(sin(x.x), sin(x.y), sin(x.z), sin(x.w)); } + + + /// Returns the hyperbolic sine of a float value. + /// Input value. + /// The hyperbolic sine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float sinh(float x) { return (float)System.Math.Sinh((float)x); } + + /// Returns the componentwise hyperbolic sine of a float2 vector. + /// Input value. + /// The componentwise hyperbolic sine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 sinh(float2 x) { return new float2(sinh(x.x), sinh(x.y)); } + + /// Returns the componentwise hyperbolic sine of a float3 vector. + /// Input value. + /// The componentwise hyperbolic sine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 sinh(float3 x) { return new float3(sinh(x.x), sinh(x.y), sinh(x.z)); } + + /// Returns the componentwise hyperbolic sine of a float4 vector. + /// Input value. + /// The componentwise hyperbolic sine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 sinh(float4 x) { return new float4(sinh(x.x), sinh(x.y), sinh(x.z), sinh(x.w)); } + + + /// Returns the hyperbolic sine of a double value. + /// Input value. + /// The hyperbolic sine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double sinh(double x) { return System.Math.Sinh(x); } + + /// Returns the componentwise hyperbolic sine of a double2 vector. + /// Input value. + /// The componentwise hyperbolic sine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 sinh(double2 x) { return new double2(sinh(x.x), sinh(x.y)); } + + /// Returns the componentwise hyperbolic sine of a double3 vector. + /// Input value. + /// The componentwise hyperbolic sine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 sinh(double3 x) { return new double3(sinh(x.x), sinh(x.y), sinh(x.z)); } + + /// Returns the componentwise hyperbolic sine of a double4 vector. + /// Input value. + /// The componentwise hyperbolic sine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 sinh(double4 x) { return new double4(sinh(x.x), sinh(x.y), sinh(x.z), sinh(x.w)); } + + + /// Returns the arcsine of a float value. + /// Input value. + /// The arcsine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float asin(float x) { return (float)System.Math.Asin((float)x); } + + /// Returns the componentwise arcsine of a float2 vector. + /// Input value. + /// The componentwise arcsine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 asin(float2 x) { return new float2(asin(x.x), asin(x.y)); } + + /// Returns the componentwise arcsine of a float3 vector. + /// Input value. + /// The componentwise arcsine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 asin(float3 x) { return new float3(asin(x.x), asin(x.y), asin(x.z)); } + + /// Returns the componentwise arcsine of a float4 vector. + /// Input value. + /// The componentwise arcsine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 asin(float4 x) { return new float4(asin(x.x), asin(x.y), asin(x.z), asin(x.w)); } + + + /// Returns the arcsine of a double value. + /// Input value. + /// The arcsine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double asin(double x) { return System.Math.Asin(x); } + + /// Returns the componentwise arcsine of a double2 vector. + /// Input value. + /// The componentwise arcsine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 asin(double2 x) { return new double2(asin(x.x), asin(x.y)); } + + /// Returns the componentwise arcsine of a double3 vector. + /// Input value. + /// The componentwise arcsine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 asin(double3 x) { return new double3(asin(x.x), asin(x.y), asin(x.z)); } + + /// Returns the componentwise arcsine of a double4 vector. + /// Input value. + /// The componentwise arcsine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 asin(double4 x) { return new double4(asin(x.x), asin(x.y), asin(x.z), asin(x.w)); } + + + /// Returns the result of rounding a float value down to the nearest integral value less or equal to the original value. + /// Input value. + /// The round down to nearest integral value of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float floor(float x) { return (float)System.Math.Floor((float)x); } + + /// Returns the result of rounding each component of a float2 vector value down to the nearest value less or equal to the original value. + /// Input value. + /// The componentwise round down to nearest integral value of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 floor(float2 x) { return new float2(floor(x.x), floor(x.y)); } + + /// Returns the result of rounding each component of a float3 vector value down to the nearest value less or equal to the original value. + /// Input value. + /// The componentwise round down to nearest integral value of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 floor(float3 x) { return new float3(floor(x.x), floor(x.y), floor(x.z)); } + + /// Returns the result of rounding each component of a float4 vector value down to the nearest value less or equal to the original value. + /// Input value. + /// The componentwise round down to nearest integral value of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 floor(float4 x) { return new float4(floor(x.x), floor(x.y), floor(x.z), floor(x.w)); } + + + /// Returns the result of rounding a double value down to the nearest integral value less or equal to the original value. + /// Input value. + /// The round down to nearest integral value of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double floor(double x) { return System.Math.Floor(x); } + + /// Returns the result of rounding each component of a double2 vector value down to the nearest value less or equal to the original value. + /// Input value. + /// The componentwise round down to nearest integral value of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 floor(double2 x) { return new double2(floor(x.x), floor(x.y)); } + + /// Returns the result of rounding each component of a double3 vector value down to the nearest value less or equal to the original value. + /// Input value. + /// The componentwise round down to nearest integral value of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 floor(double3 x) { return new double3(floor(x.x), floor(x.y), floor(x.z)); } + + /// Returns the result of rounding each component of a double4 vector value down to the nearest value less or equal to the original value. + /// Input value. + /// The componentwise round down to nearest integral value of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 floor(double4 x) { return new double4(floor(x.x), floor(x.y), floor(x.z), floor(x.w)); } + + + /// Returns the result of rounding a float value up to the nearest integral value greater or equal to the original value. + /// Input value. + /// The round up to nearest integral value of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float ceil(float x) { return (float)System.Math.Ceiling((float)x); } + + /// Returns the result of rounding each component of a float2 vector value up to the nearest value greater or equal to the original value. + /// Input value. + /// The componentwise round up to nearest integral value of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 ceil(float2 x) { return new float2(ceil(x.x), ceil(x.y)); } + + /// Returns the result of rounding each component of a float3 vector value up to the nearest value greater or equal to the original value. + /// Input value. + /// The componentwise round up to nearest integral value of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 ceil(float3 x) { return new float3(ceil(x.x), ceil(x.y), ceil(x.z)); } + + /// Returns the result of rounding each component of a float4 vector value up to the nearest value greater or equal to the original value. + /// Input value. + /// The componentwise round up to nearest integral value of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 ceil(float4 x) { return new float4(ceil(x.x), ceil(x.y), ceil(x.z), ceil(x.w)); } + + + /// Returns the result of rounding a double value up to the nearest greater integral value greater or equal to the original value. + /// Input value. + /// The round up to nearest integral value of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double ceil(double x) { return System.Math.Ceiling(x); } + + /// Returns the result of rounding each component of a double2 vector value up to the nearest integral value greater or equal to the original value. + /// Input value. + /// The componentwise round up to nearest integral value of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 ceil(double2 x) { return new double2(ceil(x.x), ceil(x.y)); } + + /// Returns the result of rounding each component of a double3 vector value up to the nearest integral value greater or equal to the original value.. + /// Input value. + /// The componentwise round up to nearest integral value of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 ceil(double3 x) { return new double3(ceil(x.x), ceil(x.y), ceil(x.z)); } + + /// Returns the result of rounding each component of a double4 vector value up to the nearest integral value greater or equal to the original value. + /// Input value. + /// The componentwise round up to nearest integral value of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 ceil(double4 x) { return new double4(ceil(x.x), ceil(x.y), ceil(x.z), ceil(x.w)); } + + + /// Returns the result of rounding a float value to the nearest integral value. + /// Input value. + /// The round to nearest integral value of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float round(float x) { return (float)System.Math.Round((float)x); } + + /// Returns the result of rounding each component of a float2 vector value to the nearest integral value. + /// Input value. + /// The componentwise round to nearest integral value of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 round(float2 x) { return new float2(round(x.x), round(x.y)); } + + /// Returns the result of rounding each component of a float3 vector value to the nearest integral value. + /// Input value. + /// The componentwise round to nearest integral value of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 round(float3 x) { return new float3(round(x.x), round(x.y), round(x.z)); } + + /// Returns the result of rounding each component of a float4 vector value to the nearest integral value. + /// Input value. + /// The componentwise round to nearest integral value of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 round(float4 x) { return new float4(round(x.x), round(x.y), round(x.z), round(x.w)); } + + + /// Returns the result of rounding a double value to the nearest integral value. + /// Input value. + /// The round to nearest integral value of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double round(double x) { return System.Math.Round(x); } + + /// Returns the result of rounding each component of a double2 vector value to the nearest integral value. + /// Input value. + /// The componentwise round to nearest integral value of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 round(double2 x) { return new double2(round(x.x), round(x.y)); } + + /// Returns the result of rounding each component of a double3 vector value to the nearest integral value. + /// Input value. + /// The componentwise round to nearest integral value of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 round(double3 x) { return new double3(round(x.x), round(x.y), round(x.z)); } + + /// Returns the result of rounding each component of a double4 vector value to the nearest integral value. + /// Input value. + /// The componentwise round to nearest integral value of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 round(double4 x) { return new double4(round(x.x), round(x.y), round(x.z), round(x.w)); } + + + /// Returns the result of truncating a float value to an integral float value. + /// Input value. + /// The truncation of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float trunc(float x) { return (float)System.Math.Truncate((float)x); } + + /// Returns the result of a componentwise truncation of a float2 value to an integral float2 value. + /// Input value. + /// The componentwise truncation of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 trunc(float2 x) { return new float2(trunc(x.x), trunc(x.y)); } + + /// Returns the result of a componentwise truncation of a float3 value to an integral float3 value. + /// Input value. + /// The componentwise truncation of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 trunc(float3 x) { return new float3(trunc(x.x), trunc(x.y), trunc(x.z)); } + + /// Returns the result of a componentwise truncation of a float4 value to an integral float4 value. + /// Input value. + /// The componentwise truncation of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 trunc(float4 x) { return new float4(trunc(x.x), trunc(x.y), trunc(x.z), trunc(x.w)); } + + + /// Returns the result of truncating a double value to an integral double value. + /// Input value. + /// The truncation of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double trunc(double x) { return System.Math.Truncate(x); } + + /// Returns the result of a componentwise truncation of a double2 value to an integral double2 value. + /// Input value. + /// The componentwise truncation of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 trunc(double2 x) { return new double2(trunc(x.x), trunc(x.y)); } + + /// Returns the result of a componentwise truncation of a double3 value to an integral double3 value. + /// Input value. + /// The componentwise truncation of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 trunc(double3 x) { return new double3(trunc(x.x), trunc(x.y), trunc(x.z)); } + + /// Returns the result of a componentwise truncation of a double4 value to an integral double4 value. + /// Input value. + /// The componentwise truncation of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 trunc(double4 x) { return new double4(trunc(x.x), trunc(x.y), trunc(x.z), trunc(x.w)); } + + + /// Returns the fractional part of a float value. + /// Input value. + /// The fractional part of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float frac(float x) { return x - floor(x); } + + /// Returns the componentwise fractional parts of a float2 vector. + /// Input value. + /// The componentwise fractional part of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 frac(float2 x) { return x - floor(x); } + + /// Returns the componentwise fractional parts of a float3 vector. + /// Input value. + /// The componentwise fractional part of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 frac(float3 x) { return x - floor(x); } + + /// Returns the componentwise fractional parts of a float4 vector. + /// Input value. + /// The componentwise fractional part of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 frac(float4 x) { return x - floor(x); } + + + /// Returns the fractional part of a double value. + /// Input value. + /// The fractional part of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double frac(double x) { return x - floor(x); } + + /// Returns the componentwise fractional parts of a double2 vector. + /// Input value. + /// The componentwise fractional part of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 frac(double2 x) { return x - floor(x); } + + /// Returns the componentwise fractional parts of a double3 vector. + /// Input value. + /// The componentwise fractional part of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 frac(double3 x) { return x - floor(x); } + + /// Returns the componentwise fractional parts of a double4 vector. + /// Input value. + /// The componentwise fractional part of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 frac(double4 x) { return x - floor(x); } + + + /// Returns the reciprocal a float value. + /// Input value. + /// The reciprocal of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float rcp(float x) { return 1.0f / x; } + + /// Returns the componentwise reciprocal a float2 vector. + /// Input value. + /// The componentwise reciprocal of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 rcp(float2 x) { return 1.0f / x; } + + /// Returns the componentwise reciprocal a float3 vector. + /// Input value. + /// The componentwise reciprocal of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 rcp(float3 x) { return 1.0f / x; } + + /// Returns the componentwise reciprocal a float4 vector. + /// Input value. + /// The componentwise reciprocal of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 rcp(float4 x) { return 1.0f / x; } + + + /// Returns the reciprocal a double value. + /// Input value. + /// The reciprocal of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double rcp(double x) { return 1.0 / x; } + + /// Returns the componentwise reciprocal a double2 vector. + /// Input value. + /// The componentwise reciprocal of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 rcp(double2 x) { return 1.0 / x; } + + /// Returns the componentwise reciprocal a double3 vector. + /// Input value. + /// The componentwise reciprocal of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 rcp(double3 x) { return 1.0 / x; } + + /// Returns the componentwise reciprocal a double4 vector. + /// Input value. + /// The componentwise reciprocal of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 rcp(double4 x) { return 1.0 / x; } + + /// Returns the sign of a int value. -1 if it is less than zero, 0 if it is zero and 1 if it greater than zero. + /// Input value. + /// The sign of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int sign(int x) { return (x > 0 ? 1 : 0) - (x < 0 ? 1 : 0); } + + /// Returns the componentwise sign of a int2 value. 1 for positive components, 0 for zero components and -1 for negative components. + /// Input value. + /// The componentwise sign of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 sign(int2 x) { return new int2(sign(x.x), sign(x.y)); } + + /// Returns the componentwise sign of a int3 value. 1 for positive components, 0 for zero components and -1 for negative components. + /// Input value. + /// The componentwise sign of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 sign(int3 x) { return new int3(sign(x.x), sign(x.y), sign(x.z)); } + + /// Returns the componentwise sign of a int4 value. 1 for positive components, 0 for zero components and -1 for negative components. + /// Input value. + /// The componentwise sign of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 sign(int4 x) { return new int4(sign(x.x), sign(x.y), sign(x.z), sign(x.w)); } + + /// Returns the sign of a float value. -1.0f if it is less than zero, 0.0f if it is zero and 1.0f if it greater than zero. + /// Input value. + /// The sign of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float sign(float x) { return (x > 0.0f ? 1.0f : 0.0f) - (x < 0.0f ? 1.0f : 0.0f); } + + /// Returns the componentwise sign of a float2 value. 1.0f for positive components, 0.0f for zero components and -1.0f for negative components. + /// Input value. + /// The componentwise sign of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 sign(float2 x) { return new float2(sign(x.x), sign(x.y)); } + + /// Returns the componentwise sign of a float3 value. 1.0f for positive components, 0.0f for zero components and -1.0f for negative components. + /// Input value. + /// The componentwise sign of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 sign(float3 x) { return new float3(sign(x.x), sign(x.y), sign(x.z)); } + + /// Returns the componentwise sign of a float4 value. 1.0f for positive components, 0.0f for zero components and -1.0f for negative components. + /// Input value. + /// The componentwise sign of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 sign(float4 x) { return new float4(sign(x.x), sign(x.y), sign(x.z), sign(x.w)); } + + + /// Returns the sign of a double value. -1.0 if it is less than zero, 0.0 if it is zero and 1.0 if it greater than zero. + /// Input value. + /// The sign of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double sign(double x) { return x == 0 ? 0 : (x > 0.0 ? 1.0 : 0.0) - (x < 0.0 ? 1.0 : 0.0); } + + /// Returns the componentwise sign of a double2 value. 1.0 for positive components, 0.0 for zero components and -1.0 for negative components. + /// Input value. + /// The componentwise sign of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 sign(double2 x) { return new double2(sign(x.x), sign(x.y)); } + + /// Returns the componentwise sign of a double3 value. 1.0 for positive components, 0.0 for zero components and -1.0 for negative components. + /// Input value. + /// The componentwise sign of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 sign(double3 x) { return new double3(sign(x.x), sign(x.y), sign(x.z)); } + + /// Returns the componentwise sign of a double4 value. 1.0 for positive components, 0.0 for zero components and -1.0 for negative components. + /// Input value. + /// The componentwise sign of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 sign(double4 x) { return new double4(sign(x.x), sign(x.y), sign(x.z), sign(x.w)); } + + + /// Returns x raised to the power y. + /// The exponent base. + /// The exponent power. + /// The result of raising x to the power y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float pow(float x, float y) { return (float)System.Math.Pow((float)x, (float)y); } + + /// Returns the componentwise result of raising x to the power y. + /// The exponent base. + /// The exponent power. + /// The componentwise result of raising x to the power y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 pow(float2 x, float2 y) { return new float2(pow(x.x, y.x), pow(x.y, y.y)); } + + /// Returns the componentwise result of raising x to the power y. + /// The exponent base. + /// The exponent power. + /// The componentwise result of raising x to the power y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 pow(float3 x, float3 y) { return new float3(pow(x.x, y.x), pow(x.y, y.y), pow(x.z, y.z)); } + + /// Returns the componentwise result of raising x to the power y. + /// The exponent base. + /// The exponent power. + /// The componentwise result of raising x to the power y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 pow(float4 x, float4 y) { return new float4(pow(x.x, y.x), pow(x.y, y.y), pow(x.z, y.z), pow(x.w, y.w)); } + + + /// Returns x raised to the power y. + /// The exponent base. + /// The exponent power. + /// The result of raising x to the power y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double pow(double x, double y) { return System.Math.Pow(x, y); } + + /// Returns the componentwise result of raising x to the power y. + /// The exponent base. + /// The exponent power. + /// The componentwise result of raising x to the power y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 pow(double2 x, double2 y) { return new double2(pow(x.x, y.x), pow(x.y, y.y)); } + + /// Returns the componentwise result of raising x to the power y. + /// The exponent base. + /// The exponent power. + /// The componentwise result of raising x to the power y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 pow(double3 x, double3 y) { return new double3(pow(x.x, y.x), pow(x.y, y.y), pow(x.z, y.z)); } + + /// Returns the componentwise result of raising x to the power y. + /// The exponent base. + /// The exponent power. + /// The componentwise result of raising x to the power y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 pow(double4 x, double4 y) { return new double4(pow(x.x, y.x), pow(x.y, y.y), pow(x.z, y.z), pow(x.w, y.w)); } + + + /// Returns the base-e exponential of x. + /// Input value. + /// The base-e exponential of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float exp(float x) { return (float)System.Math.Exp((float)x); } + + /// Returns the componentwise base-e exponential of x. + /// Input value. + /// The componentwise base-e exponential of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 exp(float2 x) { return new float2(exp(x.x), exp(x.y)); } + + /// Returns the componentwise base-e exponential of x. + /// Input value. + /// The componentwise base-e exponential of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 exp(float3 x) { return new float3(exp(x.x), exp(x.y), exp(x.z)); } + + /// Returns the componentwise base-e exponential of x. + /// Input value. + /// The componentwise base-e exponential of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 exp(float4 x) { return new float4(exp(x.x), exp(x.y), exp(x.z), exp(x.w)); } + + + /// Returns the base-e exponential of x. + /// Input value. + /// The base-e exponential of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double exp(double x) { return System.Math.Exp(x); } + + /// Returns the componentwise base-e exponential of x. + /// Input value. + /// The componentwise base-e exponential of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 exp(double2 x) { return new double2(exp(x.x), exp(x.y)); } + + /// Returns the componentwise base-e exponential of x. + /// Input value. + /// The componentwise base-e exponential of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 exp(double3 x) { return new double3(exp(x.x), exp(x.y), exp(x.z)); } + + /// Returns the componentwise base-e exponential of x. + /// Input value. + /// The componentwise base-e exponential of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 exp(double4 x) { return new double4(exp(x.x), exp(x.y), exp(x.z), exp(x.w)); } + + + /// Returns the base-2 exponential of x. + /// Input value. + /// The base-2 exponential of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float exp2(float x) { return (float)System.Math.Exp((float)x * 0.69314718f); } + + /// Returns the componentwise base-2 exponential of x. + /// Input value. + /// The componentwise base-2 exponential of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 exp2(float2 x) { return new float2(exp2(x.x), exp2(x.y)); } + + /// Returns the componentwise base-2 exponential of x. + /// Input value. + /// The componentwise base-2 exponential of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 exp2(float3 x) { return new float3(exp2(x.x), exp2(x.y), exp2(x.z)); } + + /// Returns the componentwise base-2 exponential of x. + /// Input value. + /// The componentwise base-2 exponential of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 exp2(float4 x) { return new float4(exp2(x.x), exp2(x.y), exp2(x.z), exp2(x.w)); } + + + /// Returns the base-2 exponential of x. + /// Input value. + /// The base-2 exponential of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double exp2(double x) { return System.Math.Exp(x * 0.693147180559945309); } + + /// Returns the componentwise base-2 exponential of x. + /// Input value. + /// The componentwise base-2 exponential of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 exp2(double2 x) { return new double2(exp2(x.x), exp2(x.y)); } + + /// Returns the componentwise base-2 exponential of x. + /// Input value. + /// The componentwise base-2 exponential of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 exp2(double3 x) { return new double3(exp2(x.x), exp2(x.y), exp2(x.z)); } + + /// Returns the componentwise base-2 exponential of x. + /// Input value. + /// The componentwise base-2 exponential of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 exp2(double4 x) { return new double4(exp2(x.x), exp2(x.y), exp2(x.z), exp2(x.w)); } + + + /// Returns the base-10 exponential of x. + /// Input value. + /// The base-10 exponential of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float exp10(float x) { return (float)System.Math.Exp((float)x * 2.30258509f); } + + /// Returns the componentwise base-10 exponential of x. + /// Input value. + /// The componentwise base-10 exponential of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 exp10(float2 x) { return new float2(exp10(x.x), exp10(x.y)); } + + /// Returns the componentwise base-10 exponential of x. + /// Input value. + /// The componentwise base-10 exponential of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 exp10(float3 x) { return new float3(exp10(x.x), exp10(x.y), exp10(x.z)); } + + /// Returns the componentwise base-10 exponential of x. + /// Input value. + /// The componentwise base-10 exponential of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 exp10(float4 x) { return new float4(exp10(x.x), exp10(x.y), exp10(x.z), exp10(x.w)); } + + + /// Returns the base-10 exponential of x. + /// Input value. + /// The base-10 exponential of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double exp10(double x) { return System.Math.Exp(x * 2.302585092994045684); } + + /// Returns the componentwise base-10 exponential of x. + /// Input value. + /// The componentwise base-10 exponential of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 exp10(double2 x) { return new double2(exp10(x.x), exp10(x.y)); } + + /// Returns the componentwise base-10 exponential of x. + /// Input value. + /// The componentwise base-10 exponential of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 exp10(double3 x) { return new double3(exp10(x.x), exp10(x.y), exp10(x.z)); } + + /// Returns the componentwise base-10 exponential of x. + /// Input value. + /// The componentwise base-10 exponential of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 exp10(double4 x) { return new double4(exp10(x.x), exp10(x.y), exp10(x.z), exp10(x.w)); } + + + /// Returns the natural logarithm of a float value. + /// Input value. + /// The natural logarithm of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float log(float x) { return (float)System.Math.Log((float)x); } + + /// Returns the componentwise natural logarithm of a float2 vector. + /// Input value. + /// The componentwise natural logarithm of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 log(float2 x) { return new float2(log(x.x), log(x.y)); } + + /// Returns the componentwise natural logarithm of a float3 vector. + /// Input value. + /// The componentwise natural logarithm of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 log(float3 x) { return new float3(log(x.x), log(x.y), log(x.z)); } + + /// Returns the componentwise natural logarithm of a float4 vector. + /// Input value. + /// The componentwise natural logarithm of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 log(float4 x) { return new float4(log(x.x), log(x.y), log(x.z), log(x.w)); } + + + /// Returns the natural logarithm of a double value. + /// Input value. + /// The natural logarithm of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double log(double x) { return System.Math.Log(x); } + + /// Returns the componentwise natural logarithm of a double2 vector. + /// Input value. + /// The componentwise natural logarithm of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 log(double2 x) { return new double2(log(x.x), log(x.y)); } + + /// Returns the componentwise natural logarithm of a double3 vector. + /// Input value. + /// The componentwise natural logarithm of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 log(double3 x) { return new double3(log(x.x), log(x.y), log(x.z)); } + + /// Returns the componentwise natural logarithm of a double4 vector. + /// Input value. + /// The componentwise natural logarithm of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 log(double4 x) { return new double4(log(x.x), log(x.y), log(x.z), log(x.w)); } + + + /// Returns the base-2 logarithm of a float value. + /// Input value. + /// The base-2 logarithm of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float log2(float x) { return (float)System.Math.Log((float)x, 2.0f); } + + /// Returns the componentwise base-2 logarithm of a float2 vector. + /// Input value. + /// The componentwise base-2 logarithm of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 log2(float2 x) { return new float2(log2(x.x), log2(x.y)); } + + /// Returns the componentwise base-2 logarithm of a float3 vector. + /// Input value. + /// The componentwise base-2 logarithm of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 log2(float3 x) { return new float3(log2(x.x), log2(x.y), log2(x.z)); } + + /// Returns the componentwise base-2 logarithm of a float4 vector. + /// Input value. + /// The componentwise base-2 logarithm of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 log2(float4 x) { return new float4(log2(x.x), log2(x.y), log2(x.z), log2(x.w)); } + + + /// Returns the base-2 logarithm of a double value. + /// Input value. + /// The base-2 logarithm of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double log2(double x) { return System.Math.Log(x, 2.0); } + + /// Returns the componentwise base-2 logarithm of a double2 vector. + /// Input value. + /// The componentwise base-2 logarithm of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 log2(double2 x) { return new double2(log2(x.x), log2(x.y)); } + + /// Returns the componentwise base-2 logarithm of a double3 vector. + /// Input value. + /// The componentwise base-2 logarithm of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 log2(double3 x) { return new double3(log2(x.x), log2(x.y), log2(x.z)); } + + /// Returns the componentwise base-2 logarithm of a double4 vector. + /// Input value. + /// The componentwise base-2 logarithm of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 log2(double4 x) { return new double4(log2(x.x), log2(x.y), log2(x.z), log2(x.w)); } + + /// Returns the base-10 logarithm of a float value. + /// Input value. + /// The base-10 logarithm of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float log10(float x) { return (float)System.Math.Log10((float)x); } + + /// Returns the componentwise base-10 logarithm of a float2 vector. + /// Input value. + /// The componentwise base-10 logarithm of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 log10(float2 x) { return new float2(log10(x.x), log10(x.y)); } + + /// Returns the componentwise base-10 logarithm of a float3 vector. + /// Input value. + /// The componentwise base-10 logarithm of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 log10(float3 x) { return new float3(log10(x.x), log10(x.y), log10(x.z)); } + + /// Returns the componentwise base-10 logarithm of a float4 vector. + /// Input value. + /// The componentwise base-10 logarithm of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 log10(float4 x) { return new float4(log10(x.x), log10(x.y), log10(x.z), log10(x.w)); } + + + /// Returns the base-10 logarithm of a double value. + /// Input value. + /// The base-10 logarithm of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double log10(double x) { return System.Math.Log10(x); } + + /// Returns the componentwise base-10 logarithm of a double2 vector. + /// Input value. + /// The componentwise base-10 logarithm of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 log10(double2 x) { return new double2(log10(x.x), log10(x.y)); } + + /// Returns the componentwise base-10 logarithm of a double3 vector. + /// Input value. + /// The componentwise base-10 logarithm of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 log10(double3 x) { return new double3(log10(x.x), log10(x.y), log10(x.z)); } + + /// Returns the componentwise base-10 logarithm of a double4 vector. + /// Input value. + /// The componentwise base-10 logarithm of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 log10(double4 x) { return new double4(log10(x.x), log10(x.y), log10(x.z), log10(x.w)); } + + + /// Returns the floating point remainder of x/y. + /// The dividend in x/y. + /// The divisor in x/y. + /// The remainder of x/y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float fmod(float x, float y) { return x % y; } + + /// Returns the componentwise floating point remainder of x/y. + /// The dividend in x/y. + /// The divisor in x/y. + /// The componentwise remainder of x/y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 fmod(float2 x, float2 y) { return new float2(x.x % y.x, x.y % y.y); } + + /// Returns the componentwise floating point remainder of x/y. + /// The dividend in x/y. + /// The divisor in x/y. + /// The componentwise remainder of x/y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 fmod(float3 x, float3 y) { return new float3(x.x % y.x, x.y % y.y, x.z % y.z); } + + /// Returns the componentwise floating point remainder of x/y. + /// The dividend in x/y. + /// The divisor in x/y. + /// The componentwise remainder of x/y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 fmod(float4 x, float4 y) { return new float4(x.x % y.x, x.y % y.y, x.z % y.z, x.w % y.w); } + + + /// Returns the double precision floating point remainder of x/y. + /// The dividend in x/y. + /// The divisor in x/y. + /// The remainder of x/y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double fmod(double x, double y) { return x % y; } + + /// Returns the componentwise double precision floating point remainder of x/y. + /// The dividend in x/y. + /// The divisor in x/y. + /// The componentwise remainder of x/y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 fmod(double2 x, double2 y) { return new double2(x.x % y.x, x.y % y.y); } + + /// Returns the componentwise double precision floating point remainder of x/y. + /// The dividend in x/y. + /// The divisor in x/y. + /// The componentwise remainder of x/y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 fmod(double3 x, double3 y) { return new double3(x.x % y.x, x.y % y.y, x.z % y.z); } + + /// Returns the componentwise double precision floating point remainder of x/y. + /// The dividend in x/y. + /// The divisor in x/y. + /// The componentwise remainder of x/y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 fmod(double4 x, double4 y) { return new double4(x.x % y.x, x.y % y.y, x.z % y.z, x.w % y.w); } + + + /// Splits a float value into an integral part i and a fractional part that gets returned. Both parts take the sign of the input. + /// Value to split into integral and fractional part. + /// Output value containing integral part of x. + /// The fractional part of x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float modf(float x, out float i) { i = trunc(x); return x - i; } + + /// + /// Performs a componentwise split of a float2 vector into an integral part i and a fractional part that gets returned. + /// Both parts take the sign of the corresponding input component. + /// + /// Value to split into integral and fractional part. + /// Output value containing integral part of x. + /// The componentwise fractional part of x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 modf(float2 x, out float2 i) { i = trunc(x); return x - i; } + + /// + /// Performs a componentwise split of a float3 vector into an integral part i and a fractional part that gets returned. + /// Both parts take the sign of the corresponding input component. + /// + /// Value to split into integral and fractional part. + /// Output value containing integral part of x. + /// The componentwise fractional part of x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 modf(float3 x, out float3 i) { i = trunc(x); return x - i; } + + /// + /// Performs a componentwise split of a float4 vector into an integral part i and a fractional part that gets returned. + /// Both parts take the sign of the corresponding input component. + /// + /// Value to split into integral and fractional part. + /// Output value containing integral part of x. + /// The componentwise fractional part of x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 modf(float4 x, out float4 i) { i = trunc(x); return x - i; } + + + /// Splits a double value into an integral part i and a fractional part that gets returned. Both parts take the sign of the input. + /// Value to split into integral and fractional part. + /// Output value containing integral part of x. + /// The fractional part of x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double modf(double x, out double i) { i = trunc(x); return x - i; } + + /// + /// Performs a componentwise split of a double2 vector into an integral part i and a fractional part that gets returned. + /// Both parts take the sign of the corresponding input component. + /// + /// Value to split into integral and fractional part. + /// Output value containing integral part of x. + /// The componentwise fractional part of x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 modf(double2 x, out double2 i) { i = trunc(x); return x - i; } + + /// + /// Performs a componentwise split of a double3 vector into an integral part i and a fractional part that gets returned. + /// Both parts take the sign of the corresponding input component. + /// + /// Value to split into integral and fractional part. + /// Output value containing integral part of x. + /// The componentwise fractional part of x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 modf(double3 x, out double3 i) { i = trunc(x); return x - i; } + + /// + /// Performs a componentwise split of a double4 vector into an integral part i and a fractional part that gets returned. + /// Both parts take the sign of the corresponding input component. + /// + /// Value to split into integral and fractional part. + /// Output value containing integral part of x. + /// The componentwise fractional part of x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 modf(double4 x, out double4 i) { i = trunc(x); return x - i; } + + + /// Returns the square root of a float value. + /// Value to use when computing square root. + /// The square root. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float sqrt(float x) { return (float)System.Math.Sqrt((float)x); } + + /// Returns the componentwise square root of a float2 vector. + /// Value to use when computing square root. + /// The componentwise square root. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 sqrt(float2 x) { return new float2(sqrt(x.x), sqrt(x.y)); } + + /// Returns the componentwise square root of a float3 vector. + /// Value to use when computing square root. + /// The componentwise square root. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 sqrt(float3 x) { return new float3(sqrt(x.x), sqrt(x.y), sqrt(x.z)); } + + /// Returns the componentwise square root of a float4 vector. + /// Value to use when computing square root. + /// The componentwise square root. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 sqrt(float4 x) { return new float4(sqrt(x.x), sqrt(x.y), sqrt(x.z), sqrt(x.w)); } + + + /// Returns the square root of a double value. + /// Value to use when computing square root. + /// The square root. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double sqrt(double x) { return System.Math.Sqrt(x); } + + /// Returns the componentwise square root of a double2 vector. + /// Value to use when computing square root. + /// The componentwise square root. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 sqrt(double2 x) { return new double2(sqrt(x.x), sqrt(x.y)); } + + /// Returns the componentwise square root of a double3 vector. + /// Value to use when computing square root. + /// The componentwise square root. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 sqrt(double3 x) { return new double3(sqrt(x.x), sqrt(x.y), sqrt(x.z)); } + + /// Returns the componentwise square root of a double4 vector. + /// Value to use when computing square root. + /// The componentwise square root. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 sqrt(double4 x) { return new double4(sqrt(x.x), sqrt(x.y), sqrt(x.z), sqrt(x.w)); } + + + /// Returns the reciprocal square root of a float value. + /// Value to use when computing reciprocal square root. + /// The reciprocal square root. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float rsqrt(float x) { return 1.0f / sqrt(x); } + + /// Returns the componentwise reciprocal square root of a float2 vector. + /// Value to use when computing reciprocal square root. + /// The componentwise reciprocal square root. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 rsqrt(float2 x) { return 1.0f / sqrt(x); } + + /// Returns the componentwise reciprocal square root of a float3 vector. + /// Value to use when computing reciprocal square root. + /// The componentwise reciprocal square root. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 rsqrt(float3 x) { return 1.0f / sqrt(x); } + + /// Returns the componentwise reciprocal square root of a float4 vector + /// Value to use when computing reciprocal square root. + /// The componentwise reciprocal square root. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 rsqrt(float4 x) { return 1.0f / sqrt(x); } + + + /// Returns the reciprocal square root of a double value. + /// Value to use when computing reciprocal square root. + /// The reciprocal square root. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double rsqrt(double x) { return 1.0 / sqrt(x); } + + /// Returns the componentwise reciprocal square root of a double2 vector. + /// Value to use when computing reciprocal square root. + /// The componentwise reciprocal square root. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 rsqrt(double2 x) { return 1.0 / sqrt(x); } + + /// Returns the componentwise reciprocal square root of a double3 vector. + /// Value to use when computing reciprocal square root. + /// The componentwise reciprocal square root. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 rsqrt(double3 x) { return 1.0 / sqrt(x); } + + /// Returns the componentwise reciprocal square root of a double4 vector. + /// Value to use when computing reciprocal square root. + /// The componentwise reciprocal square root. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 rsqrt(double4 x) { return 1.0 / sqrt(x); } + + + /// Returns a normalized version of the float2 vector x by scaling it by 1 / length(x). + /// Vector to normalize. + /// The normalized vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 normalize(float2 x) { return rsqrt(dot(x, x)) * x; } + + /// Returns a normalized version of the float3 vector x by scaling it by 1 / length(x). + /// Vector to normalize. + /// The normalized vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 normalize(float3 x) { return rsqrt(dot(x, x)) * x; } + + /// Returns a normalized version of the float4 vector x by scaling it by 1 / length(x). + /// Vector to normalize. + /// The normalized vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 normalize(float4 x) { return rsqrt(dot(x, x)) * x; } + + + /// Returns a normalized version of the double2 vector x by scaling it by 1 / length(x). + /// Vector to normalize. + /// The normalized vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 normalize(double2 x) { return rsqrt(dot(x, x)) * x; } + + /// Returns a normalized version of the double3 vector x by scaling it by 1 / length(x). + /// Vector to normalize. + /// The normalized vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 normalize(double3 x) { return rsqrt(dot(x, x)) * x; } + + /// Returns a normalized version of the double4 vector x by scaling it by 1 / length(x). + /// Vector to normalize. + /// The normalized vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 normalize(double4 x) { return rsqrt(dot(x, x)) * x; } + + + /// + /// Returns a safe normalized version of the float2 vector x by scaling it by 1 / length(x). + /// Returns the given default value when 1 / length(x) does not produce a finite number. + /// + /// Vector to normalize. + /// Vector to return if normalized vector is not finite. + /// The normalized vector or the default value if the normalized vector is not finite. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + static public float2 normalizesafe(float2 x, float2 defaultvalue = new float2()) + { + float len = math.dot(x, x); + return math.select(defaultvalue, x * math.rsqrt(len), len > FLT_MIN_NORMAL); + } + + /// + /// Returns a safe normalized version of the float3 vector x by scaling it by 1 / length(x). + /// Returns the given default value when 1 / length(x) does not produce a finite number. + /// + /// Vector to normalize. + /// Vector to return if normalized vector is not finite. + /// The normalized vector or the default value if the normalized vector is not finite. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + static public float3 normalizesafe(float3 x, float3 defaultvalue = new float3()) + { + float len = math.dot(x, x); + return math.select(defaultvalue, x * math.rsqrt(len), len > FLT_MIN_NORMAL); + } + + /// + /// Returns a safe normalized version of the float4 vector x by scaling it by 1 / length(x). + /// Returns the given default value when 1 / length(x) does not produce a finite number. + /// + /// Vector to normalize. + /// Vector to return if normalized vector is not finite. + /// The normalized vector or the default value if the normalized vector is not finite. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + static public float4 normalizesafe(float4 x, float4 defaultvalue = new float4()) + { + float len = math.dot(x, x); + return math.select(defaultvalue, x * math.rsqrt(len), len > FLT_MIN_NORMAL); + } + + + /// + /// Returns a safe normalized version of the double4 vector x by scaling it by 1 / length(x). + /// Returns the given default value when 1 / length(x) does not produce a finite number. + /// + /// Vector to normalize. + /// Vector to return if normalized vector is not finite. + /// The normalized vector or the default value if the normalized vector is not finite. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + static public double2 normalizesafe(double2 x, double2 defaultvalue = new double2()) + { + double len = math.dot(x, x); + return math.select(defaultvalue, x * math.rsqrt(len), len > FLT_MIN_NORMAL); + } + + /// + /// Returns a safe normalized version of the double4 vector x by scaling it by 1 / length(x). + /// Returns the given default value when 1 / length(x) does not produce a finite number. + /// + /// Vector to normalize. + /// Vector to return if normalized vector is not finite. + /// The normalized vector or the default value if the normalized vector is not finite. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + static public double3 normalizesafe(double3 x, double3 defaultvalue = new double3()) + { + double len = math.dot(x, x); + return math.select(defaultvalue, x * math.rsqrt(len), len > FLT_MIN_NORMAL); + } + + /// + /// Returns a safe normalized version of the double4 vector x by scaling it by 1 / length(x). + /// Returns the given default value when 1 / length(x) does not produce a finite number. + /// + /// Vector to normalize. + /// Vector to return if normalized vector is not finite. + /// The normalized vector or the default value if the normalized vector is not finite. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + static public double4 normalizesafe(double4 x, double4 defaultvalue = new double4()) + { + double len = math.dot(x, x); + return math.select(defaultvalue, x * math.rsqrt(len), len > FLT_MIN_NORMAL); + } + + + /// Returns the length of a float value. Equivalent to the absolute value. + /// Value to use when computing length. + /// Length of x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float length(float x) { return abs(x); } + + /// Returns the length of a float2 vector. + /// Vector to use when computing length. + /// Length of vector x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float length(float2 x) { return sqrt(dot(x, x)); } + + /// Returns the length of a float3 vector. + /// Vector to use when computing length. + /// Length of vector x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float length(float3 x) { return sqrt(dot(x, x)); } + + /// Returns the length of a float4 vector. + /// Vector to use when computing length. + /// Length of vector x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float length(float4 x) { return sqrt(dot(x, x)); } + + + /// Returns the length of a double value. Equivalent to the absolute value. + /// Value to use when computing squared length. + /// Squared length of x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double length(double x) { return abs(x); } + + /// Returns the length of a double2 vector. + /// Vector to use when computing squared length. + /// Squared length of vector x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double length(double2 x) { return sqrt(dot(x, x)); } + + /// Returns the length of a double3 vector. + /// Vector to use when computing squared length. + /// Squared length of vector x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double length(double3 x) { return sqrt(dot(x, x)); } + + /// Returns the length of a double4 vector. + /// Vector to use when computing squared length. + /// Squared length of vector x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double length(double4 x) { return sqrt(dot(x, x)); } + + + /// Returns the squared length of a float value. Equivalent to squaring the value. + /// Value to use when computing squared length. + /// Squared length of x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float lengthsq(float x) { return x*x; } + + /// Returns the squared length of a float2 vector. + /// Vector to use when computing squared length. + /// Squared length of vector x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float lengthsq(float2 x) { return dot(x, x); } + + /// Returns the squared length of a float3 vector. + /// Vector to use when computing squared length. + /// Squared length of vector x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float lengthsq(float3 x) { return dot(x, x); } + + /// Returns the squared length of a float4 vector. + /// Vector to use when computing squared length. + /// Squared length of vector x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float lengthsq(float4 x) { return dot(x, x); } + + + /// Returns the squared length of a double value. Equivalent to squaring the value. + /// Value to use when computing squared length. + /// Squared length of x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double lengthsq(double x) { return x * x; } + + /// Returns the squared length of a double2 vector. + /// Vector to use when computing squared length. + /// Squared length of vector x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double lengthsq(double2 x) { return dot(x, x); } + + /// Returns the squared length of a double3 vector. + /// Vector to use when computing squared length. + /// Squared length of vector x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double lengthsq(double3 x) { return dot(x, x); } + + /// Returns the squared length of a double4 vector. + /// Vector to use when computing squared length. + /// Squared length of vector x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double lengthsq(double4 x) { return dot(x, x); } + + + /// Returns the distance between two float values. + /// First value to use in distance computation. + /// Second value to use in distance computation. + /// The distance between x and y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float distance(float x, float y) { return abs(y - x); } + + /// Returns the distance between two float2 vectors. + /// First vector to use in distance computation. + /// Second vector to use in distance computation. + /// The distance between x and y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float distance(float2 x, float2 y) { return length(y - x); } + + /// Returns the distance between two float3 vectors. + /// First vector to use in distance computation. + /// Second vector to use in distance computation. + /// The distance between x and y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float distance(float3 x, float3 y) { return length(y - x); } + + /// Returns the distance between two float4 vectors. + /// First vector to use in distance computation. + /// Second vector to use in distance computation. + /// The distance between x and y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float distance(float4 x, float4 y) { return length(y - x); } + + + /// Returns the distance between two double values. + /// First value to use in distance computation. + /// Second value to use in distance computation. + /// The distance between x and y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double distance(double x, double y) { return abs(y - x); } + + /// Returns the distance between two double2 vectors. + /// First vector to use in distance computation. + /// Second vector to use in distance computation. + /// The distance between x and y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double distance(double2 x, double2 y) { return length(y - x); } + + /// Returns the distance between two double3 vectors. + /// First vector to use in distance computation. + /// Second vector to use in distance computation. + /// The distance between x and y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double distance(double3 x, double3 y) { return length(y - x); } + + /// Returns the distance between two double4 vectors. + /// First vector to use in distance computation. + /// Second vector to use in distance computation. + /// The distance between x and y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double distance(double4 x, double4 y) { return length(y - x); } + + + /// Returns the squared distance between two float values. + /// First value to use in distance computation. + /// Second value to use in distance computation. + /// The squared distance between x and y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float distancesq(float x, float y) { return (y - x) * (y - x); } + + /// Returns the squared distance between two float2 vectors. + /// First vector to use in distance computation. + /// Second vector to use in distance computation. + /// The squared distance between x and y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float distancesq(float2 x, float2 y) { return lengthsq(y - x); } + + /// Returns the squared distance between two float3 vectors. + /// First vector to use in distance computation. + /// Second vector to use in distance computation. + /// The squared distance between x and y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float distancesq(float3 x, float3 y) { return lengthsq(y - x); } + + /// Returns the squared distance between two float4 vectors. + /// First vector to use in distance computation. + /// Second vector to use in distance computation. + /// The squared distance between x and y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float distancesq(float4 x, float4 y) { return lengthsq(y - x); } + + + /// Returns the squared distance between two double values. + /// First value to use in distance computation. + /// Second value to use in distance computation. + /// The squared distance between x and y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double distancesq(double x, double y) { return (y - x) * (y - x); } + + /// Returns the squared distance between two double2 vectors. + /// First vector to use in distance computation. + /// Second vector to use in distance computation. + /// The squared distance between x and y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double distancesq(double2 x, double2 y) { return lengthsq(y - x); } + + /// Returns the squared distance between two double3 vectors. + /// First vector to use in distance computation. + /// Second vector to use in distance computation. + /// The squared distance between x and y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double distancesq(double3 x, double3 y) { return lengthsq(y - x); } + + /// Returns the squared distance between two double4 vectors. + /// First vector to use in distance computation. + /// Second vector to use in distance computation. + /// The squared distance between x and y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double distancesq(double4 x, double4 y) { return lengthsq(y - x); } + + + /// Returns the cross product of two float3 vectors. + /// First vector to use in cross product. + /// Second vector to use in cross product. + /// The cross product of x and y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 cross(float3 x, float3 y) { return (x * y.yzx - x.yzx * y).yzx; } + + /// Returns the cross product of two double3 vectors. + /// First vector to use in cross product. + /// Second vector to use in cross product. + /// The cross product of x and y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 cross(double3 x, double3 y) { return (x * y.yzx - x.yzx * y).yzx; } + + + /// Returns a smooth Hermite interpolation between 0.0f and 1.0f when x is in the interval (inclusive) [xMin, xMax]. + /// The minimum range of the x parameter. + /// The maximum range of the x parameter. + /// The value to be interpolated. + /// Returns a value camped to the range [0, 1]. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float smoothstep(float xMin, float xMax, float x) + { + var t = saturate((x - xMin) / (xMax - xMin)); + return t * t * (3.0f - (2.0f * t)); + } + + /// Returns a componentwise smooth Hermite interpolation between 0.0f and 1.0f when x is in the interval (inclusive) [xMin, xMax]. + /// The minimum range of the x parameter. + /// The maximum range of the x parameter. + /// The value to be interpolated. + /// Returns component values camped to the range [0, 1]. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 smoothstep(float2 xMin, float2 xMax, float2 x) + { + var t = saturate((x - xMin) / (xMax - xMin)); + return t * t * (3.0f - (2.0f * t)); + } + + /// Returns a componentwise smooth Hermite interpolation between 0.0f and 1.0f when x is in the interval (inclusive) [xMin, xMax]. + /// The minimum range of the x parameter. + /// The maximum range of the x parameter. + /// The value to be interpolated. + /// Returns component values camped to the range [0, 1]. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 smoothstep(float3 xMin, float3 xMax, float3 x) + { + var t = saturate((x - xMin) / (xMax - xMin)); + return t * t * (3.0f - (2.0f * t)); + } + + /// Returns a componentwise smooth Hermite interpolation between 0.0f and 1.0f when x is in the interval (inclusive) [xMin, xMax]. + /// The minimum range of the x parameter. + /// The maximum range of the x parameter. + /// The value to be interpolated. + /// Returns component values camped to the range [0, 1]. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 smoothstep(float4 xMin, float4 xMax, float4 x) + { + var t = saturate((x - xMin) / (xMax - xMin)); + return t * t * (3.0f - (2.0f * t)); + } + + + /// Returns a smooth Hermite interpolation between 0.0 and 1.0 when x is in the interval (inclusive) [xMin, xMax]. + /// The minimum range of the x parameter. + /// The maximum range of the x parameter. + /// The value to be interpolated. + /// Returns a value camped to the range [0, 1]. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double smoothstep(double xMin, double xMax, double x) + { + var t = saturate((x - xMin) / (xMax - xMin)); + return t * t * (3.0 - (2.0 * t)); + } + + /// Returns a componentwise smooth Hermite interpolation between 0.0 and 1.0 when x is in the interval (inclusive) [xMin, xMax]. + /// The minimum range of the x parameter. + /// The maximum range of the x parameter. + /// The value to be interpolated. + /// Returns component values camped to the range [0, 1]. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 smoothstep(double2 xMin, double2 xMax, double2 x) + { + var t = saturate((x - xMin) / (xMax - xMin)); + return t * t * (3.0 - (2.0 * t)); + } + + /// Returns a componentwise smooth Hermite interpolation between 0.0 and 1.0 when x is in the interval (inclusive) [xMin, xMax]. + /// The minimum range of the x parameter. + /// The maximum range of the x parameter. + /// The value to be interpolated. + /// Returns component values camped to the range [0, 1]. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 smoothstep(double3 xMin, double3 xMax, double3 x) + { + var t = saturate((x - xMin) / (xMax - xMin)); + return t * t * (3.0 - (2.0 * t)); + } + + /// Returns a componentwise smooth Hermite interpolation between 0.0 and 1.0 when x is in the interval (inclusive) [xMin, xMax]. + /// The minimum range of the x parameter. + /// The maximum range of the x parameter. + /// The value to be interpolated. + /// Returns component values camped to the range [0, 1]. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 smoothstep(double4 xMin, double4 xMax, double4 x) + { + var t = saturate((x - xMin) / (xMax - xMin)); + return t * t * (3.0 - (2.0 * t)); + } + + + /// Returns true if any component of the input bool2 vector is true, false otherwise. + /// Vector of values to compare. + /// True if any the components of x are true, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool any(bool2 x) { return x.x || x.y; } + + /// Returns true if any component of the input bool3 vector is true, false otherwise. + /// Vector of values to compare. + /// True if any the components of x are true, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool any(bool3 x) { return x.x || x.y || x.z; } + + /// Returns true if any components of the input bool4 vector is true, false otherwise. + /// Vector of values to compare. + /// True if any the components of x are true, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool any(bool4 x) { return x.x || x.y || x.z || x.w; } + + + /// Returns true if any component of the input int2 vector is non-zero, false otherwise. + /// Vector of values to compare. + /// True if any the components of x are non-zero, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool any(int2 x) { return x.x != 0 || x.y != 0; } + + /// Returns true if any component of the input int3 vector is non-zero, false otherwise. + /// Vector of values to compare. + /// True if any the components of x are non-zero, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool any(int3 x) { return x.x != 0 || x.y != 0 || x.z != 0; } + + /// Returns true if any components of the input int4 vector is non-zero, false otherwise. + /// Vector of values to compare. + /// True if any the components of x are non-zero, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool any(int4 x) { return x.x != 0 || x.y != 0 || x.z != 0 || x.w != 0; } + + + /// Returns true if any component of the input uint2 vector is non-zero, false otherwise. + /// Vector of values to compare. + /// True if any the components of x are non-zero, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool any(uint2 x) { return x.x != 0 || x.y != 0; } + + /// Returns true if any component of the input uint3 vector is non-zero, false otherwise. + /// Vector of values to compare. + /// True if any the components of x are non-zero, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool any(uint3 x) { return x.x != 0 || x.y != 0 || x.z != 0; } + + /// Returns true if any components of the input uint4 vector is non-zero, false otherwise. + /// Vector of values to compare. + /// True if any the components of x are non-zero, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool any(uint4 x) { return x.x != 0 || x.y != 0 || x.z != 0 || x.w != 0; } + + + /// Returns true if any component of the input float2 vector is non-zero, false otherwise. + /// Vector of values to compare. + /// True if any the components of x are non-zero, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool any(float2 x) { return x.x != 0.0f || x.y != 0.0f; } + + /// Returns true if any component of the input float3 vector is non-zero, false otherwise. + /// Vector of values to compare. + /// True if any the components of x are non-zero, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool any(float3 x) { return x.x != 0.0f || x.y != 0.0f || x.z != 0.0f; } + + /// Returns true if any component of the input float4 vector is non-zero, false otherwise. + /// Vector of values to compare. + /// True if any the components of x are non-zero, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool any(float4 x) { return x.x != 0.0f || x.y != 0.0f || x.z != 0.0f || x.w != 0.0f; } + + + /// Returns true if any component of the input double2 vector is non-zero, false otherwise. + /// Vector of values to compare. + /// True if any the components of x are non-zero, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool any(double2 x) { return x.x != 0.0 || x.y != 0.0; } + + /// Returns true if any component of the input double3 vector is non-zero, false otherwise. + /// Vector of values to compare. + /// True if any the components of x are non-zero, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool any(double3 x) { return x.x != 0.0 || x.y != 0.0 || x.z != 0.0; } + + /// Returns true if any component of the input double4 vector is non-zero, false otherwise. + /// Vector of values to compare. + /// True if any the components of x are non-zero, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool any(double4 x) { return x.x != 0.0 || x.y != 0.0 || x.z != 0.0 || x.w != 0.0; } + + + /// Returns true if all components of the input bool2 vector are true, false otherwise. + /// Vector of values to compare. + /// True if all the components of x are true, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool all(bool2 x) { return x.x && x.y; } + + /// Returns true if all components of the input bool3 vector are true, false otherwise. + /// Vector of values to compare. + /// True if all the components of x are true, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool all(bool3 x) { return x.x && x.y && x.z; } + + /// Returns true if all components of the input bool4 vector are true, false otherwise. + /// Vector of values to compare. + /// True if all the components of x are true, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool all(bool4 x) { return x.x && x.y && x.z && x.w; } + + + /// Returns true if all components of the input int2 vector are non-zero, false otherwise. + /// Vector of values to compare. + /// True if all the components of x are non-zero, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool all(int2 x) { return x.x != 0 && x.y != 0; } + + /// Returns true if all components of the input int3 vector are non-zero, false otherwise. + /// Vector of values to compare. + /// True if all the components of x are non-zero, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool all(int3 x) { return x.x != 0 && x.y != 0 && x.z != 0; } + + /// Returns true if all components of the input int4 vector are non-zero, false otherwise. + /// Vector of values to compare. + /// True if all the components of x are non-zero, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool all(int4 x) { return x.x != 0 && x.y != 0 && x.z != 0 && x.w != 0; } + + + /// Returns true if all components of the input uint2 vector are non-zero, false otherwise. + /// Vector of values to compare. + /// True if all the components of x are non-zero, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool all(uint2 x) { return x.x != 0 && x.y != 0; } + + /// Returns true if all components of the input uint3 vector are non-zero, false otherwise. + /// Vector of values to compare. + /// True if all the components of x are non-zero, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool all(uint3 x) { return x.x != 0 && x.y != 0 && x.z != 0; } + + /// Returns true if all components of the input uint4 vector are non-zero, false otherwise. + /// Vector of values to compare. + /// True if all the components of x are non-zero, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool all(uint4 x) { return x.x != 0 && x.y != 0 && x.z != 0 && x.w != 0; } + + + /// Returns true if all components of the input float2 vector are non-zero, false otherwise. + /// Vector of values to compare. + /// True if all the components of x are non-zero, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool all(float2 x) { return x.x != 0.0f && x.y != 0.0f; } + + /// Returns true if all components of the input float3 vector are non-zero, false otherwise. + /// Vector of values to compare. + /// True if all the components of x are non-zero, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool all(float3 x) { return x.x != 0.0f && x.y != 0.0f && x.z != 0.0f; } + + /// Returns true if all components of the input float4 vector are non-zero, false otherwise. + /// Vector of values to compare. + /// True if all the components of x are non-zero, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool all(float4 x) { return x.x != 0.0f && x.y != 0.0f && x.z != 0.0f && x.w != 0.0f; } + + + /// Returns true if all components of the input double2 vector are non-zero, false otherwise. + /// Vector of values to compare. + /// True if all the components of x are non-zero, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool all(double2 x) { return x.x != 0.0 && x.y != 0.0; } + + /// Returns true if all components of the input double3 vector are non-zero, false otherwise. + /// Vector of values to compare. + /// True if all the components of x are non-zero, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool all(double3 x) { return x.x != 0.0 && x.y != 0.0 && x.z != 0.0; } + + /// Returns true if all components of the input double4 vector are non-zero, false otherwise. + /// Vector of values to compare. + /// True if all the components of x are non-zero, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool all(double4 x) { return x.x != 0.0 && x.y != 0.0 && x.z != 0.0 && x.w != 0.0; } + + + /// Returns trueValue if test is true, falseValue otherwise. + /// Value to use if test is false. + /// Value to use if test is true. + /// Bool value to choose between falseValue and trueValue. + /// The selection between falseValue and trueValue according to bool test. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int select(int falseValue, int trueValue, bool test) { return test ? trueValue : falseValue; } + + /// Returns trueValue if test is true, falseValue otherwise. + /// Value to use if test is false. + /// Value to use if test is true. + /// Bool value to choose between falseValue and trueValue. + /// The selection between falseValue and trueValue according to bool test. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 select(int2 falseValue, int2 trueValue, bool test) { return test ? trueValue : falseValue; } + + /// Returns trueValue if test is true, falseValue otherwise. + /// Value to use if test is false. + /// Value to use if test is true. + /// Bool value to choose between falseValue and trueValue. + /// The selection between falseValue and trueValue according to bool test. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 select(int3 falseValue, int3 trueValue, bool test) { return test ? trueValue : falseValue; } + + /// Returns trueValue if test is true, falseValue otherwise. + /// Value to use if test is false. + /// Value to use if test is true. + /// Bool value to choose between falseValue and trueValue. + /// The selection between falseValue and trueValue according to bool test. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 select(int4 falseValue, int4 trueValue, bool test) { return test ? trueValue : falseValue; } + + + /// + /// Returns a componentwise selection between two double4 vectors falseValue and trueValue based on a bool4 selection mask test. + /// Per component, the component from trueValue is selected when test is true, otherwise the component from falseValue is selected. + /// + /// Values to use if test is false. + /// Values to use if test is true. + /// Selection mask to choose between falseValue and trueValue. + /// The componentwise selection between falseValue and trueValue according to selection mask test. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 select(int2 falseValue, int2 trueValue, bool2 test) { return new int2(test.x ? trueValue.x : falseValue.x, test.y ? trueValue.y : falseValue.y); } + + /// + /// Returns a componentwise selection between two double4 vectors falseValue and trueValue based on a bool4 selection mask test. + /// Per component, the component from trueValue is selected when test is true, otherwise the component from falseValue is selected. + /// + /// Values to use if test is false. + /// Values to use if test is true. + /// Selection mask to choose between falseValue and trueValue. + /// The componentwise selection between falseValue and trueValue according to selection mask test. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 select(int3 falseValue, int3 trueValue, bool3 test) { return new int3(test.x ? trueValue.x : falseValue.x, test.y ? trueValue.y : falseValue.y, test.z ? trueValue.z : falseValue.z); } + + /// + /// Returns a componentwise selection between two double4 vectors falseValue and trueValue based on a bool4 selection mask test. + /// Per component, the component from trueValue is selected when test is true, otherwise the component from falseValue is selected. + /// + /// Values to use if test is false. + /// Values to use if test is true. + /// Selection mask to choose between falseValue and trueValue. + /// The componentwise selection between falseValue and trueValue according to selection mask test. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 select(int4 falseValue, int4 trueValue, bool4 test) { return new int4(test.x ? trueValue.x : falseValue.x, test.y ? trueValue.y : falseValue.y, test.z ? trueValue.z : falseValue.z, test.w ? trueValue.w : falseValue.w); } + + + /// Returns trueValue if test is true, falseValue otherwise. + /// Value to use if test is false. + /// Value to use if test is true. + /// Bool value to choose between falseValue and trueValue. + /// The selection between falseValue and trueValue according to bool test. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint select(uint falseValue, uint trueValue, bool test) { return test ? trueValue : falseValue; } + + /// Returns trueValue if test is true, falseValue otherwise. + /// Value to use if test is false. + /// Value to use if test is true. + /// Bool value to choose between falseValue and trueValue. + /// The selection between falseValue and trueValue according to bool test. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 select(uint2 falseValue, uint2 trueValue, bool test) { return test ? trueValue : falseValue; } + + /// Returns trueValue if test is true, falseValue otherwise. + /// Value to use if test is false. + /// Value to use if test is true. + /// Bool value to choose between falseValue and trueValue. + /// The selection between falseValue and trueValue according to bool test. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 select(uint3 falseValue, uint3 trueValue, bool test) { return test ? trueValue : falseValue; } + + /// Returns trueValue if test is true, falseValue otherwise. + /// Value to use if test is false. + /// Value to use if test is true. + /// Bool value to choose between falseValue and trueValue. + /// The selection between falseValue and trueValue according to bool test. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 select(uint4 falseValue, uint4 trueValue, bool test) { return test ? trueValue : falseValue; } + + + /// + /// Returns a componentwise selection between two double4 vectors falseValue and trueValue based on a bool4 selection mask test. + /// Per component, the component from trueValue is selected when test is true, otherwise the component from falseValue is selected. + /// + /// Values to use if test is false. + /// Values to use if test is true. + /// Selection mask to choose between falseValue and trueValue. + /// The componentwise selection between falseValue and trueValue according to selection mask test. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 select(uint2 falseValue, uint2 trueValue, bool2 test) { return new uint2(test.x ? trueValue.x : falseValue.x, test.y ? trueValue.y : falseValue.y); } + + /// + /// Returns a componentwise selection between two double4 vectors falseValue and trueValue based on a bool4 selection mask test. + /// Per component, the component from trueValue is selected when test is true, otherwise the component from falseValue is selected. + /// + /// Values to use if test is false. + /// Values to use if test is true. + /// Selection mask to choose between falseValue and trueValue. + /// The componentwise selection between falseValue and trueValue according to selection mask test. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 select(uint3 falseValue, uint3 trueValue, bool3 test) { return new uint3(test.x ? trueValue.x : falseValue.x, test.y ? trueValue.y : falseValue.y, test.z ? trueValue.z : falseValue.z); } + + /// + /// Returns a componentwise selection between two double4 vectors falseValue and trueValue based on a bool4 selection mask test. + /// Per component, the component from trueValue is selected when test is true, otherwise the component from falseValue is selected. + /// + /// Values to use if test is false. + /// Values to use if test is true. + /// Selection mask to choose between falseValue and trueValue. + /// The componentwise selection between falseValue and trueValue according to selection mask test. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 select(uint4 falseValue, uint4 trueValue, bool4 test) { return new uint4(test.x ? trueValue.x : falseValue.x, test.y ? trueValue.y : falseValue.y, test.z ? trueValue.z : falseValue.z, test.w ? trueValue.w : falseValue.w); } + + + /// Returns trueValue if test is true, falseValue otherwise. + /// Value to use if test is false. + /// Value to use if test is true. + /// Bool value to choose between falseValue and trueValue. + /// The selection between falseValue and trueValue according to bool test. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static long select(long falseValue, long trueValue, bool test) { return test ? trueValue : falseValue; } + + /// Returns trueValue if test is true, falseValue otherwise. + /// Value to use if test is false. + /// Value to use if test is true. + /// Bool value to choose between falseValue and trueValue. + /// The selection between falseValue and trueValue according to bool test. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ulong select(ulong falseValue, ulong trueValue, bool test) { return test ? trueValue : falseValue; } + + + /// Returns trueValue if test is true, falseValue otherwise. + /// Value to use if test is false. + /// Value to use if test is true. + /// Bool value to choose between falseValue and trueValue. + /// The selection between falseValue and trueValue according to bool test. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float select(float falseValue, float trueValue, bool test) { return test ? trueValue : falseValue; } + + /// Returns trueValue if test is true, falseValue otherwise. + /// Value to use if test is false. + /// Value to use if test is true. + /// Bool value to choose between falseValue and trueValue. + /// The selection between falseValue and trueValue according to bool test. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 select(float2 falseValue, float2 trueValue, bool test) { return test ? trueValue : falseValue; } + + /// Returns trueValue if test is true, falseValue otherwise. + /// Value to use if test is false. + /// Value to use if test is true. + /// Bool value to choose between falseValue and trueValue. + /// The selection between falseValue and trueValue according to bool test. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 select(float3 falseValue, float3 trueValue, bool test) { return test ? trueValue : falseValue; } + + /// Returns trueValue if test is true, falseValue otherwise. + /// Value to use if test is false. + /// Value to use if test is true. + /// Bool value to choose between falseValue and trueValue. + /// The selection between falseValue and trueValue according to bool test. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 select(float4 falseValue, float4 trueValue, bool test) { return test ? trueValue : falseValue; } + + + /// + /// Returns a componentwise selection between two double4 vectors falseValue and trueValue based on a bool4 selection mask test. + /// Per component, the component from trueValue is selected when test is true, otherwise the component from falseValue is selected. + /// + /// Values to use if test is false. + /// Values to use if test is true. + /// Selection mask to choose between falseValue and trueValue. + /// The componentwise selection between falseValue and trueValue according to selection mask test. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 select(float2 falseValue, float2 trueValue, bool2 test) { return new float2(test.x ? trueValue.x : falseValue.x, test.y ? trueValue.y : falseValue.y); } + + /// + /// Returns a componentwise selection between two double4 vectors falseValue and trueValue based on a bool4 selection mask test. + /// Per component, the component from trueValue is selected when test is true, otherwise the component from falseValue is selected. + /// + /// Values to use if test is false. + /// Values to use if test is true. + /// Selection mask to choose between falseValue and trueValue. + /// The componentwise selection between falseValue and trueValue according to selection mask test. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 select(float3 falseValue, float3 trueValue, bool3 test) { return new float3(test.x ? trueValue.x : falseValue.x, test.y ? trueValue.y : falseValue.y, test.z ? trueValue.z : falseValue.z); } + + /// + /// Returns a componentwise selection between two double4 vectors falseValue and trueValue based on a bool4 selection mask test. + /// Per component, the component from trueValue is selected when test is true, otherwise the component from falseValue is selected. + /// + /// Values to use if test is false. + /// Values to use if test is true. + /// Selection mask to choose between falseValue and trueValue. + /// The componentwise selection between falseValue and trueValue according to selection mask test. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 select(float4 falseValue, float4 trueValue, bool4 test) { return new float4(test.x ? trueValue.x : falseValue.x, test.y ? trueValue.y : falseValue.y, test.z ? trueValue.z : falseValue.z, test.w ? trueValue.w : falseValue.w); } + + + /// Returns trueValue if test is true, falseValue otherwise. + /// Value to use if test is false. + /// Value to use if test is true. + /// Bool value to choose between falseValue and trueValue. + /// The selection between falseValue and trueValue according to bool test. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double select(double falseValue, double trueValue, bool test) { return test ? trueValue : falseValue; } + + /// Returns trueValue if test is true, falseValue otherwise. + /// Value to use if test is false. + /// Value to use if test is true. + /// Bool value to choose between falseValue and trueValue. + /// The selection between falseValue and trueValue according to bool test. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 select(double2 falseValue, double2 trueValue, bool test) { return test ? trueValue : falseValue; } + + /// Returns trueValue if test is true, falseValue otherwise. + /// Value to use if test is false. + /// Value to use if test is true. + /// Bool value to choose between falseValue and trueValue. + /// The selection between falseValue and trueValue according to bool test. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 select(double3 falseValue, double3 trueValue, bool test) { return test ? trueValue : falseValue; } + + /// Returns trueValue if test is true, falseValue otherwise. + /// Value to use if test is false. + /// Value to use if test is true. + /// Bool value to choose between falseValue and trueValue. + /// The selection between falseValue and trueValue according to bool test. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 select(double4 falseValue, double4 trueValue, bool test) { return test ? trueValue : falseValue; } + + /// + /// Returns a componentwise selection between two double4 vectors falseValue and trueValue based on a bool4 selection mask test. + /// Per component, the component from trueValue is selected when test is true, otherwise the component from falseValue is selected. + /// + /// Values to use if test is false. + /// Values to use if test is true. + /// Selection mask to choose between falseValue and trueValue. + /// The componentwise selection between falseValue and trueValue according to selection mask test. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 select(double2 falseValue, double2 trueValue, bool2 test) { return new double2(test.x ? trueValue.x : falseValue.x, test.y ? trueValue.y : falseValue.y); } + + /// + /// Returns a componentwise selection between two double4 vectors falseValue and trueValue based on a bool4 selection mask test. + /// Per component, the component from trueValue is selected when test is true, otherwise the component from falseValue is selected. + /// + /// Values to use if test is false. + /// Values to use if test is true. + /// Selection mask to choose between falseValue and trueValue. + /// The componentwise selection between falseValue and trueValue according to selection mask test. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 select(double3 falseValue, double3 trueValue, bool3 test) { return new double3(test.x ? trueValue.x : falseValue.x, test.y ? trueValue.y : falseValue.y, test.z ? trueValue.z : falseValue.z); } + + /// + /// Returns a componentwise selection between two double4 vectors falseValue and trueValue based on a bool4 selection mask test. + /// Per component, the component from trueValue is selected when test is true, otherwise the component from falseValue is selected. + /// + /// Values to use if test is false. + /// Values to use if test is true. + /// Selection mask to choose between falseValue and trueValue. + /// The componentwise selection between falseValue and trueValue according to selection mask test. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 select(double4 falseValue, double4 trueValue, bool4 test) { return new double4(test.x ? trueValue.x : falseValue.x, test.y ? trueValue.y : falseValue.y, test.z ? trueValue.z : falseValue.z, test.w ? trueValue.w : falseValue.w); } + + + /// Returns the result of a step function where the result is 1.0f when x >= threshold and 0.0f otherwise. + /// Value to be used as a threshold for returning 1. + /// Value to compare against threshold. + /// 1 if the comparison x >= threshold is true, otherwise 0. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float step(float threshold, float x) { return select(0.0f, 1.0f, x >= threshold); } + + /// Returns the result of a componentwise step function where each component is 1.0f when x >= threshold and 0.0f otherwise. + /// Vector of values to be used as a threshold for returning 1. + /// Vector of values to compare against threshold. + /// 1 if the componentwise comparison x >= threshold is true, otherwise 0. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 step(float2 threshold, float2 x) { return select(float2(0.0f), float2(1.0f), x >= threshold); } + + /// Returns the result of a componentwise step function where each component is 1.0f when x >= threshold and 0.0f otherwise. + /// Vector of values to be used as a threshold for returning 1. + /// Vector of values to compare against threshold. + /// 1 if the componentwise comparison x >= threshold is true, otherwise 0. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 step(float3 threshold, float3 x) { return select(float3(0.0f), float3(1.0f), x >= threshold); } + + /// Returns the result of a componentwise step function where each component is 1.0f when x >= threshold and 0.0f otherwise. + /// Vector of values to be used as a threshold for returning 1. + /// Vector of values to compare against threshold. + /// 1 if the componentwise comparison x >= threshold is true, otherwise 0. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 step(float4 threshold, float4 x) { return select(float4(0.0f), float4(1.0f), x >= threshold); } + + + /// Returns the result of a step function where the result is 1.0f when x >= threshold and 0.0f otherwise. + /// Values to be used as a threshold for returning 1. + /// Value to compare against threshold. + /// 1 if the comparison x >= threshold is true, otherwise 0. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double step(double threshold, double x) { return select(0.0, 1.0, x >= threshold); } + + /// Returns the result of a componentwise step function where each component is 1.0f when x >= threshold and 0.0f otherwise. + /// Vector of values to be used as a threshold for returning 1. + /// Vector of values to compare against threshold. + /// 1 if the componentwise comparison x >= threshold is true, otherwise 0. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 step(double2 threshold, double2 x) { return select(double2(0.0), double2(1.0), x >= threshold); } + + /// Returns the result of a componentwise step function where each component is 1.0f when x >= threshold and 0.0f otherwise. + /// Vector of values to be used as a threshold for returning 1. + /// Vector of values to compare against threshold. + /// 1 if the componentwise comparison x >= threshold is true, otherwise 0. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 step(double3 threshold, double3 x) { return select(double3(0.0), double3(1.0), x >= threshold); } + + /// Returns the result of a componentwise step function where each component is 1.0f when x >= threshold and 0.0f otherwise. + /// Vector of values to be used as a threshold for returning 1. + /// Vector of values to compare against threshold. + /// 1 if the componentwise comparison x >= threshold is true, otherwise 0. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 step(double4 threshold, double4 x) { return select(double4(0.0), double4(1.0), x >= threshold); } + + + /// Given an incident vector i and a normal vector n, returns the reflection vector r = i - 2.0f * dot(i, n) * n. + /// Incident vector. + /// Normal vector. + /// Reflection vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 reflect(float2 i, float2 n) { return i - 2f * n * dot(i, n); } + + /// Given an incident vector i and a normal vector n, returns the reflection vector r = i - 2.0f * dot(i, n) * n. + /// Incident vector. + /// Normal vector. + /// Reflection vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 reflect(float3 i, float3 n) { return i - 2f * n * dot(i, n); } + + /// Given an incident vector i and a normal vector n, returns the reflection vector r = i - 2.0f * dot(i, n) * n. + /// Incident vector. + /// Normal vector. + /// Reflection vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 reflect(float4 i, float4 n) { return i - 2f * n * dot(i, n); } + + + /// Given an incident vector i and a normal vector n, returns the reflection vector r = i - 2.0 * dot(i, n) * n. + /// Incident vector. + /// Normal vector. + /// Reflection vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 reflect(double2 i, double2 n) { return i - 2 * n * dot(i, n); } + + /// Given an incident vector i and a normal vector n, returns the reflection vector r = i - 2.0 * dot(i, n) * n. + /// Incident vector. + /// Normal vector. + /// Reflection vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 reflect(double3 i, double3 n) { return i - 2 * n * dot(i, n); } + + /// Given an incident vector i and a normal vector n, returns the reflection vector r = i - 2.0 * dot(i, n) * n. + /// Incident vector. + /// Normal vector. + /// Reflection vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 reflect(double4 i, double4 n) { return i - 2 * n * dot(i, n); } + + + /// Returns the refraction vector given the incident vector i, the normal vector n and the refraction index. + /// Incident vector. + /// Normal vector. + /// Index of refraction. + /// Refraction vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 refract(float2 i, float2 n, float indexOfRefraction) + { + float ni = dot(n, i); + float k = 1.0f - indexOfRefraction * indexOfRefraction * (1.0f - ni * ni); + return select(0.0f, indexOfRefraction * i - (indexOfRefraction * ni + sqrt(k)) * n, k >= 0); + } + + /// Returns the refraction vector given the incident vector i, the normal vector n and the refraction index. + /// Incident vector. + /// Normal vector. + /// Index of refraction. + /// Refraction vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 refract(float3 i, float3 n, float indexOfRefraction) + { + float ni = dot(n, i); + float k = 1.0f - indexOfRefraction * indexOfRefraction * (1.0f - ni * ni); + return select(0.0f, indexOfRefraction * i - (indexOfRefraction * ni + sqrt(k)) * n, k >= 0); + } + + /// Returns the refraction vector given the incident vector i, the normal vector n and the refraction index. + /// Incident vector. + /// Normal vector. + /// Index of refraction. + /// Refraction vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 refract(float4 i, float4 n, float indexOfRefraction) + { + float ni = dot(n, i); + float k = 1.0f - indexOfRefraction * indexOfRefraction * (1.0f - ni * ni); + return select(0.0f, indexOfRefraction * i - (indexOfRefraction * ni + sqrt(k)) * n, k >= 0); + } + + + /// Returns the refraction vector given the incident vector i, the normal vector n and the refraction index. + /// Incident vector. + /// Normal vector. + /// Index of refraction. + /// Refraction vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 refract(double2 i, double2 n, double indexOfRefraction) + { + double ni = dot(n, i); + double k = 1.0 - indexOfRefraction * indexOfRefraction * (1.0 - ni * ni); + return select(0.0f, indexOfRefraction * i - (indexOfRefraction * ni + sqrt(k)) * n, k >= 0); + } + + /// Returns the refraction vector given the incident vector i, the normal vector n and the refraction index. + /// Incident vector. + /// Normal vector. + /// Index of refraction. + /// Refraction vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 refract(double3 i, double3 n, double indexOfRefraction) + { + double ni = dot(n, i); + double k = 1.0 - indexOfRefraction * indexOfRefraction * (1.0 - ni * ni); + return select(0.0f, indexOfRefraction * i - (indexOfRefraction * ni + sqrt(k)) * n, k >= 0); + } + + /// Returns the refraction vector given the incident vector i, the normal vector n and the refraction index. + /// Incident vector. + /// Normal vector. + /// Index of refraction. + /// Refraction vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 refract(double4 i, double4 n, double indexOfRefraction) + { + double ni = dot(n, i); + double k = 1.0 - indexOfRefraction * indexOfRefraction * (1.0 - ni * ni); + return select(0.0f, indexOfRefraction * i - (indexOfRefraction * ni + sqrt(k)) * n, k >= 0); + } + + /// + /// Compute vector projection of a onto b. + /// + /// + /// Some finite vectors a and b could generate a non-finite result. This is most likely when a's components + /// are very large (close to Single.MaxValue) or when b's components are very small (close to FLT_MIN_NORMAL). + /// In these cases, you can call + /// which will use a given default value if the result is not finite. + /// + /// Vector to project. + /// Non-zero vector to project onto. + /// Vector projection of a onto b. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 project(float2 a, float2 ontoB) + { + return (dot(a, ontoB) / dot(ontoB, ontoB)) * ontoB; + } + + /// + /// Compute vector projection of a onto b. + /// + /// + /// Some finite vectors a and b could generate a non-finite result. This is most likely when a's components + /// are very large (close to Single.MaxValue) or when b's components are very small (close to FLT_MIN_NORMAL). + /// In these cases, you can call + /// which will use a given default value if the result is not finite. + /// + /// Vector to project. + /// Non-zero vector to project onto. + /// Vector projection of a onto b. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 project(float3 a, float3 ontoB) + { + return (dot(a, ontoB) / dot(ontoB, ontoB)) * ontoB; + } + + /// + /// Compute vector projection of a onto b. + /// + /// + /// Some finite vectors a and b could generate a non-finite result. This is most likely when a's components + /// are very large (close to Single.MaxValue) or when b's components are very small (close to FLT_MIN_NORMAL). + /// In these cases, you can call + /// which will use a given default value if the result is not finite. + /// + /// Vector to project. + /// Non-zero vector to project onto. + /// Vector projection of a onto b. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 project(float4 a, float4 ontoB) + { + return (dot(a, ontoB) / dot(ontoB, ontoB)) * ontoB; + } + + /// + /// Compute vector projection of a onto b. If result is not finite, then return the default value instead. + /// + /// + /// This function performs extra checks to see if the result of projecting a onto b is finite. If you know that + /// your inputs will generate a finite result or you don't care if the result is finite, then you can call + /// instead which is faster than this + /// function. + /// + /// Vector to project. + /// Non-zero vector to project onto. + /// Default value to return if projection is not finite. + /// Vector projection of a onto b or the default value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 projectsafe(float2 a, float2 ontoB, float2 defaultValue = new float2()) + { + var proj = project(a, ontoB); + + return select(defaultValue, proj, all(isfinite(proj))); + } + + /// + /// Compute vector projection of a onto b. If result is not finite, then return the default value instead. + /// + /// + /// This function performs extra checks to see if the result of projecting a onto b is finite. If you know that + /// your inputs will generate a finite result or you don't care if the result is finite, then you can call + /// instead which is faster than this + /// function. + /// + /// Vector to project. + /// Non-zero vector to project onto. + /// Default value to return if projection is not finite. + /// Vector projection of a onto b or the default value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 projectsafe(float3 a, float3 ontoB, float3 defaultValue = new float3()) + { + var proj = project(a, ontoB); + + return select(defaultValue, proj, all(isfinite(proj))); + } + + /// + /// Compute vector projection of a onto b. If result is not finite, then return the default value instead. + /// + /// + /// This function performs extra checks to see if the result of projecting a onto b is finite. If you know that + /// your inputs will generate a finite result or you don't care if the result is finite, then you can call + /// instead which is faster than this + /// function. + /// + /// Vector to project. + /// Non-zero vector to project onto. + /// Default value to return if projection is not finite. + /// Vector projection of a onto b or the default value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 projectsafe(float4 a, float4 ontoB, float4 defaultValue = new float4()) + { + var proj = project(a, ontoB); + + return select(defaultValue, proj, all(isfinite(proj))); + } + + /// + /// Compute vector projection of a onto b. + /// + /// + /// Some finite vectors a and b could generate a non-finite result. This is most likely when a's components + /// are very large (close to Double.MaxValue) or when b's components are very small (close to DBL_MIN_NORMAL). + /// In these cases, you can call + /// which will use a given default value if the result is not finite. + /// + /// Vector to project. + /// Non-zero vector to project onto. + /// Vector projection of a onto b. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 project(double2 a, double2 ontoB) + { + return (dot(a, ontoB) / dot(ontoB, ontoB)) * ontoB; + } + + /// + /// Compute vector projection of a onto b. + /// + /// + /// Some finite vectors a and b could generate a non-finite result. This is most likely when a's components + /// are very large (close to Double.MaxValue) or when b's components are very small (close to DBL_MIN_NORMAL). + /// In these cases, you can call + /// which will use a given default value if the result is not finite. + /// + /// Vector to project. + /// Non-zero vector to project onto. + /// Vector projection of a onto b. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 project(double3 a, double3 ontoB) + { + return (dot(a, ontoB) / dot(ontoB, ontoB)) * ontoB; + } + + /// + /// Compute vector projection of a onto b. + /// + /// + /// Some finite vectors a and b could generate a non-finite result. This is most likely when a's components + /// are very large (close to Double.MaxValue) or when b's components are very small (close to DBL_MIN_NORMAL). + /// In these cases, you can call + /// which will use a given default value if the result is not finite. + /// + /// Vector to project. + /// Non-zero vector to project onto. + /// Vector projection of a onto b. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 project(double4 a, double4 ontoB) + { + return (dot(a, ontoB) / dot(ontoB, ontoB)) * ontoB; + } + + /// + /// Compute vector projection of a onto b. If result is not finite, then return the default value instead. + /// + /// + /// This function performs extra checks to see if the result of projecting a onto b is finite. If you know that + /// your inputs will generate a finite result or you don't care if the result is finite, then you can call + /// instead which is faster than this + /// function. + /// + /// Vector to project. + /// Non-zero vector to project onto. + /// Default value to return if projection is not finite. + /// Vector projection of a onto b or the default value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 projectsafe(double2 a, double2 ontoB, double2 defaultValue = new double2()) + { + var proj = project(a, ontoB); + + return select(defaultValue, proj, all(isfinite(proj))); + } + + /// + /// Compute vector projection of a onto b. If result is not finite, then return the default value instead. + /// + /// + /// This function performs extra checks to see if the result of projecting a onto b is finite. If you know that + /// your inputs will generate a finite result or you don't care if the result is finite, then you can call + /// instead which is faster than this + /// function. + /// + /// Vector to project. + /// Non-zero vector to project onto. + /// Default value to return if projection is not finite. + /// Vector projection of a onto b or the default value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 projectsafe(double3 a, double3 ontoB, double3 defaultValue = new double3()) + { + var proj = project(a, ontoB); + + return select(defaultValue, proj, all(isfinite(proj))); + } + + /// + /// Compute vector projection of a onto b. If result is not finite, then return the default value instead. + /// + /// + /// This function performs extra checks to see if the result of projecting a onto b is finite. If you know that + /// your inputs will generate a finite result or you don't care if the result is finite, then you can call + /// instead which is faster than this + /// function. + /// + /// Vector to project. + /// Non-zero vector to project onto. + /// Default value to return if projection is not finite. + /// Vector projection of a onto b or the default value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 projectsafe(double4 a, double4 ontoB, double4 defaultValue = new double4()) + { + var proj = project(a, ontoB); + + return select(defaultValue, proj, all(isfinite(proj))); + } + + /// Conditionally flips a vector n if two vectors i and ng are pointing in the same direction. Returns n if dot(i, ng) < 0, -n otherwise. + /// Vector to conditionally flip. + /// First vector in direction comparison. + /// Second vector in direction comparison. + /// -n if i and ng point in the same direction; otherwise return n unchanged. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 faceforward(float2 n, float2 i, float2 ng) { return select(n, -n, dot(ng, i) >= 0.0f); } + + /// Conditionally flips a vector n if two vectors i and ng are pointing in the same direction. Returns n if dot(i, ng) < 0, -n otherwise. + /// Vector to conditionally flip. + /// First vector in direction comparison. + /// Second vector in direction comparison. + /// -n if i and ng point in the same direction; otherwise return n unchanged. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 faceforward(float3 n, float3 i, float3 ng) { return select(n, -n, dot(ng, i) >= 0.0f); } + + /// Conditionally flips a vector n if two vectors i and ng are pointing in the same direction. Returns n if dot(i, ng) < 0, -n otherwise. + /// Vector to conditionally flip. + /// First vector in direction comparison. + /// Second vector in direction comparison. + /// -n if i and ng point in the same direction; otherwise return n unchanged. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 faceforward(float4 n, float4 i, float4 ng) { return select(n, -n, dot(ng, i) >= 0.0f); } + + + /// Conditionally flips a vector n if two vectors i and ng are pointing in the same direction. Returns n if dot(i, ng) < 0, -n otherwise. + /// Vector to conditionally flip. + /// First vector in direction comparison. + /// Second vector in direction comparison. + /// -n if i and ng point in the same direction; otherwise return n unchanged. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 faceforward(double2 n, double2 i, double2 ng) { return select(n, -n, dot(ng, i) >= 0.0f); } + + /// Conditionally flips a vector n if two vectors i and ng are pointing in the same direction. Returns n if dot(i, ng) < 0, -n otherwise. + /// Vector to conditionally flip. + /// First vector in direction comparison. + /// Second vector in direction comparison. + /// -n if i and ng point in the same direction; otherwise return n unchanged. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 faceforward(double3 n, double3 i, double3 ng) { return select(n, -n, dot(ng, i) >= 0.0f); } + + /// Conditionally flips a vector n if two vectors i and ng are pointing in the same direction. Returns n if dot(i, ng) < 0, -n otherwise. + /// Vector to conditionally flip. + /// First vector in direction comparison. + /// Second vector in direction comparison. + /// -n if i and ng point in the same direction; otherwise return n unchanged. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 faceforward(double4 n, double4 i, double4 ng) { return select(n, -n, dot(ng, i) >= 0.0f); } + + + /// Returns the sine and cosine of the input float value x through the out parameters s and c. + /// When Burst compiled, his method is faster than calling sin() and cos() separately. + /// Input angle in radians. + /// Output sine of the input. + /// Output cosine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void sincos(float x, out float s, out float c) { s = sin(x); c = cos(x); } + + /// Returns the componentwise sine and cosine of the input float2 vector x through the out parameters s and c. + /// When Burst compiled, his method is faster than calling sin() and cos() separately. + /// Input vector containing angles in radians. + /// Output vector containing the componentwise sine of the input. + /// Output vector containing the componentwise cosine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void sincos(float2 x, out float2 s, out float2 c) { s = sin(x); c = cos(x); } + + /// Returns the componentwise sine and cosine of the input float3 vector x through the out parameters s and c. + /// When Burst compiled, his method is faster than calling sin() and cos() separately. + /// Input vector containing angles in radians. + /// Output vector containing the componentwise sine of the input. + /// Output vector containing the componentwise cosine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void sincos(float3 x, out float3 s, out float3 c) { s = sin(x); c = cos(x); } + + /// Returns the componentwise sine and cosine of the input float4 vector x through the out parameters s and c. + /// When Burst compiled, his method is faster than calling sin() and cos() separately. + /// Input vector containing angles in radians. + /// Output vector containing the componentwise sine of the input. + /// Output vector containing the componentwise cosine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void sincos(float4 x, out float4 s, out float4 c) { s = sin(x); c = cos(x); } + + + /// Returns the sine and cosine of the input double value x through the out parameters s and c. + /// When Burst compiled, his method is faster than calling sin() and cos() separately. + /// Input angle in radians. + /// Output sine of the input. + /// Output cosine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void sincos(double x, out double s, out double c) { s = sin(x); c = cos(x); } + + /// Returns the componentwise sine and cosine of the input double2 vector x through the out parameters s and c. + /// When Burst compiled, his method is faster than calling sin() and cos() separately. + /// Input vector containing angles in radians. + /// Output vector containing the componentwise sine of the input. + /// Output vector containing the componentwise cosine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void sincos(double2 x, out double2 s, out double2 c) { s = sin(x); c = cos(x); } + + /// Returns the componentwise sine and cosine of the input double3 vector x through the out parameters s and c. + /// When Burst compiled, his method is faster than calling sin() and cos() separately. + /// Input vector containing angles in radians. + /// Output vector containing the componentwise sine of the input. + /// Output vector containing the componentwise cosine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void sincos(double3 x, out double3 s, out double3 c) { s = sin(x); c = cos(x); } + + /// Returns the componentwise sine and cosine of the input double4 vector x through the out parameters s and c. + /// When Burst compiled, his method is faster than calling sin() and cos() separately. + /// Input vector containing angles in radians. + /// Output vector containing the componentwise sine of the input. + /// Output vector containing the componentwise cosine of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void sincos(double4 x, out double4 s, out double4 c) { s = sin(x); c = cos(x); } + + + /// Returns number of 1-bits in the binary representation of an int value. Also known as the Hamming weight, popcnt on x86, and vcnt on ARM. + /// int value in which to count bits set to 1. + /// Number of bits set to 1 within x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int countbits(int x) { return countbits((uint)x); } + + /// Returns component-wise number of 1-bits in the binary representation of an int2 vector. Also known as the Hamming weight, popcnt on x86, and vcnt on ARM. + /// int2 value in which to count bits for each component. + /// int2 containing number of bits set to 1 within each component of x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 countbits(int2 x) { return countbits((uint2)x); } + + /// Returns component-wise number of 1-bits in the binary representation of an int3 vector. Also known as the Hamming weight, popcnt on x86, and vcnt on ARM. + /// Number in which to count bits. + /// int3 containing number of bits set to 1 within each component of x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 countbits(int3 x) { return countbits((uint3)x); } + + /// Returns component-wise number of 1-bits in the binary representation of an int4 vector. Also known as the Hamming weight, popcnt on x86, and vcnt on ARM. + /// Number in which to count bits. + /// int4 containing number of bits set to 1 within each component of x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 countbits(int4 x) { return countbits((uint4)x); } + + + /// Returns number of 1-bits in the binary representation of a uint value. Also known as the Hamming weight, popcnt on x86, and vcnt on ARM. + /// Number in which to count bits. + /// Number of bits set to 1 within x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int countbits(uint x) + { + x = x - ((x >> 1) & 0x55555555); + x = (x & 0x33333333) + ((x >> 2) & 0x33333333); + return (int)((((x + (x >> 4)) & 0x0F0F0F0F) * 0x01010101) >> 24); + } + + /// Returns component-wise number of 1-bits in the binary representation of a uint2 vector. Also known as the Hamming weight, popcnt on x86, and vcnt on ARM. + /// Number in which to count bits. + /// int2 containing number of bits set to 1 within each component of x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 countbits(uint2 x) + { + x = x - ((x >> 1) & 0x55555555); + x = (x & 0x33333333) + ((x >> 2) & 0x33333333); + return int2((((x + (x >> 4)) & 0x0F0F0F0F) * 0x01010101) >> 24); + } + + /// Returns component-wise number of 1-bits in the binary representation of a uint3 vector. Also known as the Hamming weight, popcnt on x86, and vcnt on ARM. + /// Number in which to count bits. + /// int3 containing number of bits set to 1 within each component of x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 countbits(uint3 x) + { + x = x - ((x >> 1) & 0x55555555); + x = (x & 0x33333333) + ((x >> 2) & 0x33333333); + return int3((((x + (x >> 4)) & 0x0F0F0F0F) * 0x01010101) >> 24); + } + + /// Returns component-wise number of 1-bits in the binary representation of a uint4 vector. Also known as the Hamming weight, popcnt on x86, and vcnt on ARM. + /// Number in which to count bits. + /// int4 containing number of bits set to 1 within each component of x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 countbits(uint4 x) + { + x = x - ((x >> 1) & 0x55555555); + x = (x & 0x33333333) + ((x >> 2) & 0x33333333); + return int4((((x + (x >> 4)) & 0x0F0F0F0F) * 0x01010101) >> 24); + } + + /// Returns number of 1-bits in the binary representation of a ulong value. Also known as the Hamming weight, popcnt on x86, and vcnt on ARM. + /// Number in which to count bits. + /// Number of bits set to 1 within x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int countbits(ulong x) + { + x = x - ((x >> 1) & 0x5555555555555555); + x = (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333); + return (int)((((x + (x >> 4)) & 0x0F0F0F0F0F0F0F0F) * 0x0101010101010101) >> 56); + } + + /// Returns number of 1-bits in the binary representation of a long value. Also known as the Hamming weight, popcnt on x86, and vcnt on ARM. + /// Number in which to count bits. + /// Number of bits set to 1 within x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int countbits(long x) { return countbits((ulong)x); } + + + /// Returns the componentwise number of leading zeros in the binary representations of an int vector. + /// Input value. + /// The number of leading zeros of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int lzcnt(int x) { return lzcnt((uint)x); } + + /// Returns the componentwise number of leading zeros in the binary representations of an int2 vector. + /// Input value. + /// The componentwise number of leading zeros of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 lzcnt(int2 x) { return int2(lzcnt(x.x), lzcnt(x.y)); } + + /// Returns the componentwise number of leading zeros in the binary representations of an int3 vector. + /// Input value. + /// The componentwise number of leading zeros of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 lzcnt(int3 x) { return int3(lzcnt(x.x), lzcnt(x.y), lzcnt(x.z)); } + + /// Returns the componentwise number of leading zeros in the binary representations of an int4 vector. + /// Input value. + /// The componentwise number of leading zeros of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 lzcnt(int4 x) { return int4(lzcnt(x.x), lzcnt(x.y), lzcnt(x.z), lzcnt(x.w)); } + + + /// Returns number of leading zeros in the binary representations of a uint value. + /// Input value. + /// The number of leading zeros of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int lzcnt(uint x) + { + if (x == 0) + return 32; + LongDoubleUnion u; + u.doubleValue = 0.0; + u.longValue = 0x4330000000000000L + x; + u.doubleValue -= 4503599627370496.0; + return 0x41E - (int)(u.longValue >> 52); + } + + /// Returns the componentwise number of leading zeros in the binary representations of a uint2 vector. + /// Input value. + /// The componentwise number of leading zeros of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 lzcnt(uint2 x) { return int2(lzcnt(x.x), lzcnt(x.y)); } + + /// Returns the componentwise number of leading zeros in the binary representations of a uint3 vector. + /// Input value. + /// The componentwise number of leading zeros of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 lzcnt(uint3 x) { return int3(lzcnt(x.x), lzcnt(x.y), lzcnt(x.z)); } + + /// Returns the componentwise number of leading zeros in the binary representations of a uint4 vector. + /// Input value. + /// The componentwise number of leading zeros of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 lzcnt(uint4 x) { return int4(lzcnt(x.x), lzcnt(x.y), lzcnt(x.z), lzcnt(x.w)); } + + + /// Returns number of leading zeros in the binary representations of a long value. + /// Input value. + /// The number of leading zeros of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int lzcnt(long x) { return lzcnt((ulong)x); } + + + /// Returns number of leading zeros in the binary representations of a ulong value. + /// Input value. + /// The number of leading zeros of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int lzcnt(ulong x) + { + if (x == 0) + return 64; + + uint xh = (uint)(x >> 32); + uint bits = xh != 0 ? xh : (uint)x; + int offset = xh != 0 ? 0x41E : 0x43E; + + LongDoubleUnion u; + u.doubleValue = 0.0; + u.longValue = 0x4330000000000000L + bits; + u.doubleValue -= 4503599627370496.0; + return offset - (int)(u.longValue >> 52); + } + + /// + /// Computes the trailing zero count in the binary representation of the input value. + /// + /// + /// Assuming that the least significant bit is on the right, the integer value 4 has a binary representation + /// 0100 and the trailing zero count is two. The integer value 1 has a binary representation 0001 and the + /// trailing zero count is zero. + /// + /// Input to use when computing the trailing zero count. + /// Returns the trailing zero count of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int tzcnt(int x) { return tzcnt((uint)x); } + + /// + /// Computes the component-wise trailing zero count in the binary representation of the input value. + /// + /// + /// Assuming that the least significant bit is on the right, the integer value 4 has a binary representation + /// 0100 and the trailing zero count is two. The integer value 1 has a binary representation 0001 and the + /// trailing zero count is zero. + /// + /// Input to use when computing the trailing zero count. + /// Returns the component-wise trailing zero count of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 tzcnt(int2 x) { return int2(tzcnt(x.x), tzcnt(x.y)); } + + /// + /// Computes the component-wise trailing zero count in the binary representation of the input value. + /// + /// + /// Assuming that the least significant bit is on the right, the integer value 4 has a binary representation + /// 0100 and the trailing zero count is two. The integer value 1 has a binary representation 0001 and the + /// trailing zero count is zero. + /// + /// Input to use when computing the trailing zero count. + /// Returns the component-wise trailing zero count of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 tzcnt(int3 x) { return int3(tzcnt(x.x), tzcnt(x.y), tzcnt(x.z)); } + + /// + /// Computes the component-wise trailing zero count in the binary representation of the input value. + /// + /// + /// Assuming that the least significant bit is on the right, the integer value 4 has a binary representation + /// 0100 and the trailing zero count is two. The integer value 1 has a binary representation 0001 and the + /// trailing zero count is zero. + /// + /// Input to use when computing the trailing zero count. + /// Returns the component-wise trailing zero count of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 tzcnt(int4 x) { return int4(tzcnt(x.x), tzcnt(x.y), tzcnt(x.z), tzcnt(x.w)); } + + + /// + /// Computes the trailing zero count in the binary representation of the input value. + /// + /// + /// Assuming that the least significant bit is on the right, the integer value 4 has a binary representation + /// 0100 and the trailing zero count is two. The integer value 1 has a binary representation 0001 and the + /// trailing zero count is zero. + /// + /// Input to use when computing the trailing zero count. + /// Returns the trailing zero count of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int tzcnt(uint x) + { + if (x == 0) + return 32; + + x &= (uint)-x; + LongDoubleUnion u; + u.doubleValue = 0.0; + u.longValue = 0x4330000000000000L + x; + u.doubleValue -= 4503599627370496.0; + return (int)(u.longValue >> 52) - 0x3FF; + } + + /// + /// Computes the component-wise trailing zero count in the binary representation of the input value. + /// + /// + /// Assuming that the least significant bit is on the right, the integer value 4 has a binary representation + /// 0100 and the trailing zero count is two. The integer value 1 has a binary representation 0001 and the + /// trailing zero count is zero. + /// + /// Input to use when computing the trailing zero count. + /// Returns the component-wise trailing zero count of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 tzcnt(uint2 x) { return int2(tzcnt(x.x), tzcnt(x.y)); } + + /// + /// Computes the component-wise trailing zero count in the binary representation of the input value. + /// + /// + /// Assuming that the least significant bit is on the right, the integer value 4 has a binary representation + /// 0100 and the trailing zero count is two. The integer value 1 has a binary representation 0001 and the + /// trailing zero count is zero. + /// + /// Input to use when computing the trailing zero count. + /// Returns the component-wise trailing zero count of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 tzcnt(uint3 x) { return int3(tzcnt(x.x), tzcnt(x.y), tzcnt(x.z)); } + + /// + /// Computes the component-wise trailing zero count in the binary representation of the input value. + /// + /// + /// Assuming that the least significant bit is on the right, the integer value 4 has a binary representation + /// 0100 and the trailing zero count is two. The integer value 1 has a binary representation 0001 and the + /// trailing zero count is zero. + /// + /// Input to use when computing the trailing zero count. + /// Returns the component-wise trailing zero count of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 tzcnt(uint4 x) { return int4(tzcnt(x.x), tzcnt(x.y), tzcnt(x.z), tzcnt(x.w)); } + + /// + /// Computes the trailing zero count in the binary representation of the input value. + /// + /// + /// Assuming that the least significant bit is on the right, the integer value 4 has a binary representation + /// 0100 and the trailing zero count is two. The integer value 1 has a binary representation 0001 and the + /// trailing zero count is zero. + /// + /// Input to use when computing the trailing zero count. + /// Returns the trailing zero count of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int tzcnt(long x) { return tzcnt((ulong)x); } + + /// + /// Computes the trailing zero count in the binary representation of the input value. + /// + /// + /// Assuming that the least significant bit is on the right, the integer value 4 has a binary representation + /// 0100 and the trailing zero count is two. The integer value 1 has a binary representation 0001 and the + /// trailing zero count is zero. + /// + /// Input to use when computing the trailing zero count. + /// Returns the trailing zero count of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int tzcnt(ulong x) + { + if (x == 0) + return 64; + + x = x & (ulong)-(long)x; + uint xl = (uint)x; + + uint bits = xl != 0 ? xl : (uint)(x >> 32); + int offset = xl != 0 ? 0x3FF : 0x3DF; + + LongDoubleUnion u; + u.doubleValue = 0.0; + u.longValue = 0x4330000000000000L + bits; + u.doubleValue -= 4503599627370496.0; + return (int)(u.longValue >> 52) - offset; + } + + + + /// Returns the result of performing a reversal of the bit pattern of an int value. + /// Value to reverse. + /// Value with reversed bits. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int reversebits(int x) { return (int)reversebits((uint)x); } + + /// Returns the result of performing a componentwise reversal of the bit pattern of an int2 vector. + /// Value to reverse. + /// Value with componentwise reversed bits. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 reversebits(int2 x) { return (int2)reversebits((uint2)x); } + + /// Returns the result of performing a componentwise reversal of the bit pattern of an int3 vector. + /// Value to reverse. + /// Value with componentwise reversed bits. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 reversebits(int3 x) { return (int3)reversebits((uint3)x); } + + /// Returns the result of performing a componentwise reversal of the bit pattern of an int4 vector. + /// Value to reverse. + /// Value with componentwise reversed bits. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 reversebits(int4 x) { return (int4)reversebits((uint4)x); } + + + /// Returns the result of performing a reversal of the bit pattern of a uint value. + /// Value to reverse. + /// Value with reversed bits. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint reversebits(uint x) { + x = ((x >> 1) & 0x55555555) | ((x & 0x55555555) << 1); + x = ((x >> 2) & 0x33333333) | ((x & 0x33333333) << 2); + x = ((x >> 4) & 0x0F0F0F0F) | ((x & 0x0F0F0F0F) << 4); + x = ((x >> 8) & 0x00FF00FF) | ((x & 0x00FF00FF) << 8); + return (x >> 16) | (x << 16); + } + + /// Returns the result of performing a componentwise reversal of the bit pattern of an uint2 vector. + /// Value to reverse. + /// Value with componentwise reversed bits. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 reversebits(uint2 x) + { + x = ((x >> 1) & 0x55555555) | ((x & 0x55555555) << 1); + x = ((x >> 2) & 0x33333333) | ((x & 0x33333333) << 2); + x = ((x >> 4) & 0x0F0F0F0F) | ((x & 0x0F0F0F0F) << 4); + x = ((x >> 8) & 0x00FF00FF) | ((x & 0x00FF00FF) << 8); + return (x >> 16) | (x << 16); + } + + /// Returns the result of performing a componentwise reversal of the bit pattern of an uint3 vector. + /// Value to reverse. + /// Value with componentwise reversed bits. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 reversebits(uint3 x) + { + x = ((x >> 1) & 0x55555555) | ((x & 0x55555555) << 1); + x = ((x >> 2) & 0x33333333) | ((x & 0x33333333) << 2); + x = ((x >> 4) & 0x0F0F0F0F) | ((x & 0x0F0F0F0F) << 4); + x = ((x >> 8) & 0x00FF00FF) | ((x & 0x00FF00FF) << 8); + return (x >> 16) | (x << 16); + } + + /// Returns the result of performing a componentwise reversal of the bit pattern of an uint4 vector. + /// Value to reverse. + /// Value with componentwise reversed bits. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 reversebits(uint4 x) + { + x = ((x >> 1) & 0x55555555) | ((x & 0x55555555) << 1); + x = ((x >> 2) & 0x33333333) | ((x & 0x33333333) << 2); + x = ((x >> 4) & 0x0F0F0F0F) | ((x & 0x0F0F0F0F) << 4); + x = ((x >> 8) & 0x00FF00FF) | ((x & 0x00FF00FF) << 8); + return (x >> 16) | (x << 16); + } + + + /// Returns the result of performing a reversal of the bit pattern of a long value. + /// Value to reverse. + /// Value with reversed bits. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static long reversebits(long x) { return (long)reversebits((ulong)x); } + + + /// Returns the result of performing a reversal of the bit pattern of a ulong value. + /// Value to reverse. + /// Value with reversed bits. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ulong reversebits(ulong x) + { + x = ((x >> 1) & 0x5555555555555555ul) | ((x & 0x5555555555555555ul) << 1); + x = ((x >> 2) & 0x3333333333333333ul) | ((x & 0x3333333333333333ul) << 2); + x = ((x >> 4) & 0x0F0F0F0F0F0F0F0Ful) | ((x & 0x0F0F0F0F0F0F0F0Ful) << 4); + x = ((x >> 8) & 0x00FF00FF00FF00FFul) | ((x & 0x00FF00FF00FF00FFul) << 8); + x = ((x >> 16) & 0x0000FFFF0000FFFFul) | ((x & 0x0000FFFF0000FFFFul) << 16); + return (x >> 32) | (x << 32); + } + + + /// Returns the result of rotating the bits of an int left by bits n. + /// Value to rotate. + /// Number of bits to rotate. + /// The rotated value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int rol(int x, int n) { return (int)rol((uint)x, n); } + + /// Returns the componentwise result of rotating the bits of an int2 left by bits n. + /// Value to rotate. + /// Number of bits to rotate. + /// The componentwise rotated value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 rol(int2 x, int n) { return (int2)rol((uint2)x, n); } + + /// Returns the componentwise result of rotating the bits of an int3 left by bits n. + /// Value to rotate. + /// Number of bits to rotate. + /// The componentwise rotated value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 rol(int3 x, int n) { return (int3)rol((uint3)x, n); } + + /// Returns the componentwise result of rotating the bits of an int4 left by bits n. + /// Value to rotate. + /// Number of bits to rotate. + /// The componentwise rotated value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 rol(int4 x, int n) { return (int4)rol((uint4)x, n); } + + + /// Returns the result of rotating the bits of a uint left by bits n. + /// Value to rotate. + /// Number of bits to rotate. + /// The rotated value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint rol(uint x, int n) { return (x << n) | (x >> (32 - n)); } + + /// Returns the componentwise result of rotating the bits of a uint2 left by bits n. + /// Value to rotate. + /// Number of bits to rotate. + /// The componentwise rotated value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 rol(uint2 x, int n) { return (x << n) | (x >> (32 - n)); } + + /// Returns the componentwise result of rotating the bits of a uint3 left by bits n. + /// Value to rotate. + /// Number of bits to rotate. + /// The componentwise rotated value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 rol(uint3 x, int n) { return (x << n) | (x >> (32 - n)); } + + /// Returns the componentwise result of rotating the bits of a uint4 left by bits n. + /// Value to rotate. + /// Number of bits to rotate. + /// The componentwise rotated value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 rol(uint4 x, int n) { return (x << n) | (x >> (32 - n)); } + + + /// Returns the result of rotating the bits of a long left by bits n. + /// Value to rotate. + /// Number of bits to rotate. + /// The rotated value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static long rol(long x, int n) { return (long)rol((ulong)x, n); } + + + /// Returns the result of rotating the bits of a ulong left by bits n. + /// Value to rotate. + /// Number of bits to rotate. + /// The rotated value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ulong rol(ulong x, int n) { return (x << n) | (x >> (64 - n)); } + + + /// Returns the result of rotating the bits of an int right by bits n. + /// Value to rotate. + /// Number of bits to rotate. + /// The rotated value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int ror(int x, int n) { return (int)ror((uint)x, n); } + + /// Returns the componentwise result of rotating the bits of an int2 right by bits n. + /// Value to rotate. + /// Number of bits to rotate. + /// The componentwise rotated value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 ror(int2 x, int n) { return (int2)ror((uint2)x, n); } + + /// Returns the componentwise result of rotating the bits of an int3 right by bits n. + /// Value to rotate. + /// Number of bits to rotate. + /// The componentwise rotated value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 ror(int3 x, int n) { return (int3)ror((uint3)x, n); } + + /// Returns the componentwise result of rotating the bits of an int4 right by bits n. + /// Value to rotate. + /// Number of bits to rotate. + /// The componentwise rotated value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 ror(int4 x, int n) { return (int4)ror((uint4)x, n); } + + + /// Returns the result of rotating the bits of a uint right by bits n. + /// Value to rotate. + /// Number of bits to rotate. + /// The rotated value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint ror(uint x, int n) { return (x >> n) | (x << (32 - n)); } + + /// Returns the componentwise result of rotating the bits of a uint2 right by bits n. + /// Value to rotate. + /// Number of bits to rotate. + /// The componentwise rotated value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 ror(uint2 x, int n) { return (x >> n) | (x << (32 - n)); } + + /// Returns the componentwise result of rotating the bits of a uint3 right by bits n. + /// Value to rotate. + /// Number of bits to rotate. + /// The componentwise rotated value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 ror(uint3 x, int n) { return (x >> n) | (x << (32 - n)); } + + /// Returns the componentwise result of rotating the bits of a uint4 right by bits n. + /// Value to rotate. + /// Number of bits to rotate. + /// The componentwise rotated value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 ror(uint4 x, int n) { return (x >> n) | (x << (32 - n)); } + + + /// Returns the result of rotating the bits of a long right by bits n. + /// Value to rotate. + /// Number of bits to rotate. + /// The rotated value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static long ror(long x, int n) { return (long)ror((ulong)x, n); } + + + /// Returns the result of rotating the bits of a ulong right by bits n. + /// Value to rotate. + /// Number of bits to rotate. + /// The rotated value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ulong ror(ulong x, int n) { return (x >> n) | (x << (64 - n)); } + + + /// Returns the smallest power of two greater than or equal to the input. + /// Also known as nextpow2. + /// Input value. + /// The smallest power of two greater than or equal to the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int ceilpow2(int x) + { + x -= 1; + x |= x >> 1; + x |= x >> 2; + x |= x >> 4; + x |= x >> 8; + x |= x >> 16; + return x + 1; + } + + /// Returns the result of a componentwise calculation of the smallest power of two greater than or equal to the input. + /// Also known as nextpow2. + /// Input value. + /// The componentwise smallest power of two greater than or equal to the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 ceilpow2(int2 x) + { + x -= 1; + x |= x >> 1; + x |= x >> 2; + x |= x >> 4; + x |= x >> 8; + x |= x >> 16; + return x + 1; + } + + /// Returns the result of a componentwise calculation of the smallest power of two greater than or equal to the input. + /// Also known as nextpow2. + /// Input value. + /// The componentwise smallest power of two greater than or equal to the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 ceilpow2(int3 x) + { + x -= 1; + x |= x >> 1; + x |= x >> 2; + x |= x >> 4; + x |= x >> 8; + x |= x >> 16; + return x + 1; + } + + /// Returns the result of a componentwise calculation of the smallest power of two greater than or equal to the input. + /// Also known as nextpow2. + /// Input value. + /// The componentwise smallest power of two greater than or equal to the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 ceilpow2(int4 x) + { + x -= 1; + x |= x >> 1; + x |= x >> 2; + x |= x >> 4; + x |= x >> 8; + x |= x >> 16; + return x + 1; + } + + + /// Returns the smallest power of two greater than or equal to the input. + /// Also known as nextpow2. + /// Input value. + /// The smallest power of two greater than or equal to the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint ceilpow2(uint x) + { + x -= 1; + x |= x >> 1; + x |= x >> 2; + x |= x >> 4; + x |= x >> 8; + x |= x >> 16; + return x + 1; + } + + /// Returns the result of a componentwise calculation of the smallest power of two greater than or equal to the input. + /// Also known as nextpow2. + /// Input value. + /// The componentwise smallest power of two greater than or equal to the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 ceilpow2(uint2 x) + { + x -= 1; + x |= x >> 1; + x |= x >> 2; + x |= x >> 4; + x |= x >> 8; + x |= x >> 16; + return x + 1; + } + + /// Returns the result of a componentwise calculation of the smallest power of two greater than or equal to the input. + /// Also known as nextpow2. + /// Input value. + /// The componentwise smallest power of two greater than or equal to the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 ceilpow2(uint3 x) + { + x -= 1; + x |= x >> 1; + x |= x >> 2; + x |= x >> 4; + x |= x >> 8; + x |= x >> 16; + return x + 1; + } + + /// Returns the result of a componentwise calculation of the smallest power of two greater than or equal to the input. + /// Also known as nextpow2. + /// Input value. + /// The componentwise smallest power of two greater than or equal to the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 ceilpow2(uint4 x) + { + x -= 1; + x |= x >> 1; + x |= x >> 2; + x |= x >> 4; + x |= x >> 8; + x |= x >> 16; + return x + 1; + } + + + /// Returns the smallest power of two greater than or equal to the input. + /// Also known as nextpow2. + /// Input value. + /// The smallest power of two greater than or equal to the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static long ceilpow2(long x) + { + x -= 1; + x |= x >> 1; + x |= x >> 2; + x |= x >> 4; + x |= x >> 8; + x |= x >> 16; + x |= x >> 32; + return x + 1; + } + + + /// Returns the smallest power of two greater than or equal to the input. + /// Also known as nextpow2. + /// Input value. + /// The smallest power of two greater than or equal to the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ulong ceilpow2(ulong x) + { + x -= 1; + x |= x >> 1; + x |= x >> 2; + x |= x >> 4; + x |= x >> 8; + x |= x >> 16; + x |= x >> 32; + return x + 1; + } + + /// + /// Computes the ceiling of the base-2 logarithm of x. + /// + /// + /// x must be greater than 0, otherwise the result is undefined. + /// + /// Integer to be used as input. + /// Ceiling of the base-2 logarithm of x, as an integer. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int ceillog2(int x) + { + return 32 - lzcnt((uint)x - 1); + } + + /// + /// Computes the componentwise ceiling of the base-2 logarithm of x. + /// + /// + /// Components of x must be greater than 0, otherwise the result for that component is undefined. + /// + /// int2 to be used as input. + /// Componentwise ceiling of the base-2 logarithm of x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 ceillog2(int2 x) + { + return new int2(ceillog2(x.x), ceillog2(x.y)); + } + + /// + /// Computes the componentwise ceiling of the base-2 logarithm of x. + /// + /// + /// Components of x must be greater than 0, otherwise the result for that component is undefined. + /// + /// int3 to be used as input. + /// Componentwise ceiling of the base-2 logarithm of x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 ceillog2(int3 x) + { + return new int3(ceillog2(x.x), ceillog2(x.y), ceillog2(x.z)); + } + + /// + /// Computes the componentwise ceiling of the base-2 logarithm of x. + /// + /// + /// Components of x must be greater than 0, otherwise the result for that component is undefined. + /// + /// int4 to be used as input. + /// Componentwise ceiling of the base-2 logarithm of x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 ceillog2(int4 x) + { + return new int4(ceillog2(x.x), ceillog2(x.y), ceillog2(x.z), ceillog2(x.w)); + } + + /// + /// Computes the ceiling of the base-2 logarithm of x. + /// + /// + /// x must be greater than 0, otherwise the result is undefined. + /// + /// Unsigned integer to be used as input. + /// Ceiling of the base-2 logarithm of x, as an integer. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int ceillog2(uint x) + { + return 32 - lzcnt(x - 1); + } + + /// + /// Computes the componentwise ceiling of the base-2 logarithm of x. + /// + /// + /// Components of x must be greater than 0, otherwise the result for that component is undefined. + /// + /// uint2 to be used as input. + /// Componentwise ceiling of the base-2 logarithm of x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 ceillog2(uint2 x) + { + return new int2(ceillog2(x.x), ceillog2(x.y)); + } + + /// + /// Computes the componentwise ceiling of the base-2 logarithm of x. + /// + /// + /// Components of x must be greater than 0, otherwise the result for that component is undefined. + /// + /// uint3 to be used as input. + /// Componentwise ceiling of the base-2 logarithm of x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 ceillog2(uint3 x) + { + return new int3(ceillog2(x.x), ceillog2(x.y), ceillog2(x.z)); + } + + /// + /// Computes the componentwise ceiling of the base-2 logarithm of x. + /// + /// + /// Components of x must be greater than 0, otherwise the result for that component is undefined. + /// + /// uint4 to be used as input. + /// Componentwise ceiling of the base-2 logarithm of x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 ceillog2(uint4 x) + { + return new int4(ceillog2(x.x), ceillog2(x.y), ceillog2(x.z), ceillog2(x.w)); + } + + /// + /// Computes the floor of the base-2 logarithm of x. + /// + /// x must be greater than zero, otherwise the result is undefined. + /// Integer to be used as input. + /// Floor of base-2 logarithm of x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int floorlog2(int x) + { + return 31 - lzcnt((uint)x); + } + + /// + /// Computes the componentwise floor of the base-2 logarithm of x. + /// + /// Components of x must be greater than zero, otherwise the result of the component is undefined. + /// int2 to be used as input. + /// Componentwise floor of base-2 logarithm of x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 floorlog2(int2 x) + { + return new int2(floorlog2(x.x), floorlog2(x.y)); + } + + /// + /// Computes the componentwise floor of the base-2 logarithm of x. + /// + /// Components of x must be greater than zero, otherwise the result of the component is undefined. + /// int3 to be used as input. + /// Componentwise floor of base-2 logarithm of x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 floorlog2(int3 x) + { + return new int3(floorlog2(x.x), floorlog2(x.y), floorlog2(x.z)); + } + + /// + /// Computes the componentwise floor of the base-2 logarithm of x. + /// + /// Components of x must be greater than zero, otherwise the result of the component is undefined. + /// int4 to be used as input. + /// Componentwise floor of base-2 logarithm of x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 floorlog2(int4 x) + { + return new int4(floorlog2(x.x), floorlog2(x.y), floorlog2(x.z), floorlog2(x.w)); + } + + /// + /// Computes the floor of the base-2 logarithm of x. + /// + /// x must be greater than zero, otherwise the result is undefined. + /// Unsigned integer to be used as input. + /// Floor of base-2 logarithm of x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int floorlog2(uint x) + { + return 31 - lzcnt(x); + } + + /// + /// Computes the componentwise floor of the base-2 logarithm of x. + /// + /// Components of x must be greater than zero, otherwise the result of the component is undefined. + /// uint2 to be used as input. + /// Componentwise floor of base-2 logarithm of x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 floorlog2(uint2 x) + { + return new int2(floorlog2(x.x), floorlog2(x.y)); + } + + /// + /// Computes the componentwise floor of the base-2 logarithm of x. + /// + /// Components of x must be greater than zero, otherwise the result of the component is undefined. + /// uint3 to be used as input. + /// Componentwise floor of base-2 logarithm of x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 floorlog2(uint3 x) + { + return new int3(floorlog2(x.x), floorlog2(x.y), floorlog2(x.z)); + } + + /// + /// Computes the componentwise floor of the base-2 logarithm of x. + /// + /// Components of x must be greater than zero, otherwise the result of the component is undefined. + /// uint4 to be used as input. + /// Componentwise floor of base-2 logarithm of x. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 floorlog2(uint4 x) + { + return new int4(floorlog2(x.x), floorlog2(x.y), floorlog2(x.z), floorlog2(x.w)); + } + + /// Returns the result of converting a float value from degrees to radians. + /// Angle in degrees. + /// Angle converted to radians. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float radians(float x) { return x * TORADIANS; } + + /// Returns the result of a componentwise conversion of a float2 vector from degrees to radians. + /// Vector containing angles in degrees. + /// Vector containing angles converted to radians. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 radians(float2 x) { return x * TORADIANS; } + + /// Returns the result of a componentwise conversion of a float3 vector from degrees to radians. + /// Vector containing angles in degrees. + /// Vector containing angles converted to radians. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 radians(float3 x) { return x * TORADIANS; } + + /// Returns the result of a componentwise conversion of a float4 vector from degrees to radians. + /// Vector containing angles in degrees. + /// Vector containing angles converted to radians. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 radians(float4 x) { return x * TORADIANS; } + + + /// Returns the result of converting a float value from degrees to radians. + /// Angle in degrees. + /// Angle converted to radians. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double radians(double x) { return x * TORADIANS_DBL; } + + /// Returns the result of a componentwise conversion of a float2 vector from degrees to radians. + /// Vector containing angles in degrees. + /// Vector containing angles converted to radians. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 radians(double2 x) { return x * TORADIANS_DBL; } + + /// Returns the result of a componentwise conversion of a float3 vector from degrees to radians. + /// Vector containing angles in degrees. + /// Vector containing angles converted to radians. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 radians(double3 x) { return x * TORADIANS_DBL; } + + /// Returns the result of a componentwise conversion of a float4 vector from degrees to radians. + /// Vector containing angles in degrees. + /// Vector containing angles converted to radians. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 radians(double4 x) { return x * TORADIANS_DBL; } + + + /// Returns the result of converting a double value from radians to degrees. + /// Angle in radians. + /// Angle converted to degrees. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float degrees(float x) { return x * TODEGREES; } + + /// Returns the result of a componentwise conversion of a double2 vector from radians to degrees. + /// Vector containing angles in radians. + /// Vector containing angles converted to degrees. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 degrees(float2 x) { return x * TODEGREES; } + + /// Returns the result of a componentwise conversion of a double3 vector from radians to degrees. + /// Vector containing angles in radians. + /// Vector containing angles converted to degrees. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 degrees(float3 x) { return x * TODEGREES; } + + /// Returns the result of a componentwise conversion of a double4 vector from radians to degrees. + /// Vector containing angles in radians. + /// Vector containing angles converted to degrees. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 degrees(float4 x) { return x * TODEGREES; } + + + /// Returns the result of converting a double value from radians to degrees. + /// Angle in radians. + /// Angle converted to degrees. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double degrees(double x) { return x * TODEGREES_DBL; } + + /// Returns the result of a componentwise conversion of a double2 vector from radians to degrees. + /// Vector containing angles in radians. + /// Vector containing angles converted to degrees. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 degrees(double2 x) { return x * TODEGREES_DBL; } + + /// Returns the result of a componentwise conversion of a double3 vector from radians to degrees. + /// Vector containing angles in radians. + /// Vector containing values converted to degrees. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 degrees(double3 x) { return x * TODEGREES_DBL; } + + /// Returns the result of a componentwise conversion of a double4 vector from radians to degrees. + /// Vector containing angles in radians. + /// Vector containing angles converted to degrees. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 degrees(double4 x) { return x * TODEGREES_DBL; } + + + /// Returns the minimum component of an int2 vector. + /// The vector to use when computing the minimum component. + /// The value of the minimum component of the vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int cmin(int2 x) { return min(x.x, x.y); } + + /// Returns the minimum component of an int3 vector. + /// The vector to use when computing the minimum component. + /// The value of the minimum component of the vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int cmin(int3 x) { return min(min(x.x, x.y), x.z); } + + /// Returns the minimum component of an int4 vector. + /// The vector to use when computing the minimum component. + /// The value of the minimum component of the vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int cmin(int4 x) { return min(min(x.x, x.y), min(x.z, x.w)); } + + + /// Returns the minimum component of a uint2 vector. + /// The vector to use when computing the minimum component. + /// The value of the minimum component of the vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint cmin(uint2 x) { return min(x.x, x.y); } + + /// Returns the minimum component of a uint3 vector. + /// The vector to use when computing the minimum component. + /// The value of the minimum component of the vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint cmin(uint3 x) { return min(min(x.x, x.y), x.z); } + + /// Returns the minimum component of a uint4 vector. + /// The vector to use when computing the minimum component. + /// The value of the minimum component of the vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint cmin(uint4 x) { return min(min(x.x, x.y), min(x.z, x.w)); } + + + /// Returns the minimum component of a float2 vector. + /// The vector to use when computing the minimum component. + /// The value of the minimum component of the vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float cmin(float2 x) { return min(x.x, x.y); } + + /// Returns the minimum component of a float3 vector. + /// The vector to use when computing the minimum component. + /// The value of the minimum component of the vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float cmin(float3 x) { return min(min(x.x, x.y), x.z); } + + /// Returns the minimum component of a float4 vector. + /// The vector to use when computing the minimum component. + /// The value of the minimum component of the vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float cmin(float4 x) { return min(min(x.x, x.y), min(x.z, x.w)); } + + + /// Returns the minimum component of a double2 vector. + /// The vector to use when computing the minimum component. + /// The value of the minimum component of the vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double cmin(double2 x) { return min(x.x, x.y); } + + /// Returns the minimum component of a double3 vector. + /// The vector to use when computing the minimum component. + /// The value of the minimum component of the vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double cmin(double3 x) { return min(min(x.x, x.y), x.z); } + + /// Returns the minimum component of a double4 vector. + /// The vector to use when computing the minimum component. + /// The value of the minimum component of the vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double cmin(double4 x) { return min(min(x.x, x.y), min(x.z, x.w)); } + + + /// Returns the maximum component of an int2 vector. + /// The vector to use when computing the maximum component. + /// The value of the maximum component of the vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int cmax(int2 x) { return max(x.x, x.y); } + + /// Returns the maximum component of an int3 vector. + /// The vector to use when computing the maximum component. + /// The value of the maximum component of the vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int cmax(int3 x) { return max(max(x.x, x.y), x.z); } + + /// Returns the maximum component of an int4 vector. + /// The vector to use when computing the maximum component. + /// The value of the maximum component of the vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int cmax(int4 x) { return max(max(x.x, x.y), max(x.z, x.w)); } + + + /// Returns the maximum component of a uint2 vector. + /// The vector to use when computing the maximum component. + /// The value of the maximum component of the vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint cmax(uint2 x) { return max(x.x, x.y); } + + /// Returns the maximum component of a uint3 vector. + /// The vector to use when computing the maximum component. + /// The value of the maximum component of the vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint cmax(uint3 x) { return max(max(x.x, x.y), x.z); } + + /// Returns the maximum component of a uint4 vector. + /// The vector to use when computing the maximum component. + /// The value of the maximum component of the vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint cmax(uint4 x) { return max(max(x.x, x.y), max(x.z, x.w)); } + + + /// Returns the maximum component of a float2 vector. + /// The vector to use when computing the maximum component. + /// The value of the maximum component of the vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float cmax(float2 x) { return max(x.x, x.y); } + + /// Returns the maximum component of a float3 vector. + /// The vector to use when computing the maximum component. + /// The value of the maximum component of the vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float cmax(float3 x) { return max(max(x.x, x.y), x.z); } + + /// Returns the maximum component of a float4 vector. + /// The vector to use when computing the maximum component. + /// The value of the maximum component of the vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float cmax(float4 x) { return max(max(x.x, x.y), max(x.z, x.w)); } + + + /// Returns the maximum component of a double2 vector. + /// The vector to use when computing the maximum component. + /// The value of the maximum component of the vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double cmax(double2 x) { return max(x.x, x.y); } + + /// Returns the maximum component of a double3 vector. + /// The vector to use when computing the maximum component. + /// The value of the maximum component of the vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double cmax(double3 x) { return max(max(x.x, x.y), x.z); } + + /// Returns the maximum component of a double4 vector. + /// The vector to use when computing the maximum component. + /// The value of the maximum component of the vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double cmax(double4 x) { return max(max(x.x, x.y), max(x.z, x.w)); } + + + /// Returns the horizontal sum of components of an int2 vector. + /// The vector to use when computing the horizontal sum. + /// The horizontal sum of of components of the vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int csum(int2 x) { return x.x + x.y; } + + /// Returns the horizontal sum of components of an int3 vector. + /// The vector to use when computing the horizontal sum. + /// The horizontal sum of of components of the vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int csum(int3 x) { return x.x + x.y + x.z; } + + /// Returns the horizontal sum of components of an int4 vector. + /// The vector to use when computing the horizontal sum. + /// The horizontal sum of of components of the vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int csum(int4 x) { return x.x + x.y + x.z + x.w; } + + + /// Returns the horizontal sum of components of a uint2 vector. + /// The vector to use when computing the horizontal sum. + /// The horizontal sum of of components of the vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint csum(uint2 x) { return x.x + x.y; } + + /// Returns the horizontal sum of components of a uint3 vector. + /// The vector to use when computing the horizontal sum. + /// The horizontal sum of of components of the vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint csum(uint3 x) { return x.x + x.y + x.z; } + + /// Returns the horizontal sum of components of a uint4 vector. + /// The vector to use when computing the horizontal sum. + /// The horizontal sum of of components of the vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint csum(uint4 x) { return x.x + x.y + x.z + x.w; } + + + /// Returns the horizontal sum of components of a float2 vector. + /// The vector to use when computing the horizontal sum. + /// The horizontal sum of of components of the vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float csum(float2 x) { return x.x + x.y; } + + /// Returns the horizontal sum of components of a float3 vector. + /// The vector to use when computing the horizontal sum. + /// The horizontal sum of of components of the vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float csum(float3 x) { return x.x + x.y + x.z; } + + /// Returns the horizontal sum of components of a float4 vector. + /// The vector to use when computing the horizontal sum. + /// The horizontal sum of of components of the vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float csum(float4 x) { return (x.x + x.y) + (x.z + x.w); } + + + /// Returns the horizontal sum of components of a double2 vector. + /// The vector to use when computing the horizontal sum. + /// The horizontal sum of of components of the vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double csum(double2 x) { return x.x + x.y; } + + /// Returns the horizontal sum of components of a double3 vector. + /// The vector to use when computing the horizontal sum. + /// The horizontal sum of of components of the vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double csum(double3 x) { return x.x + x.y + x.z; } + + /// Returns the horizontal sum of components of a double4 vector. + /// The vector to use when computing the horizontal sum. + /// The horizontal sum of of components of the vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double csum(double4 x) { return (x.x + x.y) + (x.z + x.w); } + + /// + /// Computes the square (x * x) of the input argument x. + /// + /// Value to square. + /// Returns the square of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float square(float x) + { + return x * x; + } + + /// + /// Computes the component-wise square (x * x) of the input argument x. + /// + /// Value to square. + /// Returns the square of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 square(float2 x) + { + return x * x; + } + + /// + /// Computes the component-wise square (x * x) of the input argument x. + /// + /// Value to square. + /// Returns the square of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 square(float3 x) + { + return x * x; + } + + /// + /// Computes the component-wise square (x * x) of the input argument x. + /// + /// Value to square. + /// Returns the square of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 square(float4 x) + { + return x * x; + } + + /// + /// Computes the square (x * x) of the input argument x. + /// + /// Value to square. + /// Returns the square of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double square(double x) + { + return x * x; + } + + /// + /// Computes the component-wise square (x * x) of the input argument x. + /// + /// Value to square. + /// Returns the square of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 square(double2 x) + { + return x * x; + } + + /// + /// Computes the component-wise square (x * x) of the input argument x. + /// + /// Value to square. + /// Returns the square of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 square(double3 x) + { + return x * x; + } + + /// + /// Computes the component-wise square (x * x) of the input argument x. + /// + /// Value to square. + /// Returns the square of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 square(double4 x) + { + return x * x; + } + + /// + /// Computes the square (x * x) of the input argument x. + /// + /// + /// Due to integer overflow, it's not always guaranteed that square(x) is positive. For example, square(46341) + /// will return -2147479015. + /// + /// Value to square. + /// Returns the square of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int square(int x) + { + return x * x; + } + + /// + /// Computes the component-wise square (x * x) of the input argument x. + /// + /// + /// Due to integer overflow, it's not always guaranteed that square(x) is positive. For example, square(new int2(46341)) + /// will return new int2(-2147479015). + /// + /// Value to square. + /// Returns the square of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 square(int2 x) + { + return x * x; + } + + /// + /// Computes the component-wise square (x * x) of the input argument x. + /// + /// + /// Due to integer overflow, it's not always guaranteed that square(x) is positive. For example, square(new int3(46341)) + /// will return new int3(-2147479015). + /// + /// Value to square. + /// Returns the square of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 square(int3 x) + { + return x * x; + } + + /// + /// Computes the component-wise square (x * x) of the input argument x. + /// + /// + /// Due to integer overflow, it's not always guaranteed that square(x) is positive. For example, square(new int4(46341)) + /// will return new int4(-2147479015). + /// + /// Value to square. + /// Returns the square of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 square(int4 x) + { + return x * x; + } + + /// + /// Computes the square (x * x) of the input argument x. + /// + /// + /// Due to integer overflow, it's not always guaranteed that square(x) >= x. For example, square(4294967295u) + /// will return 1u. + /// + /// Value to square. + /// Returns the square of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint square(uint x) + { + return x * x; + } + + /// + /// Computes the component-wise square (x * x) of the input argument x. + /// + /// + /// Due to integer overflow, it's not always guaranteed that square(x) >= x. For example, square(new uint2(4294967295u)) + /// will return new uint2(1u). + /// + /// Value to square. + /// Returns the square of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 square(uint2 x) + { + return x * x; + } + + /// + /// Computes the component-wise square (x * x) of the input argument x. + /// + /// + /// Due to integer overflow, it's not always guaranteed that square(x) >= x. For example, square(new uint3(4294967295u)) + /// will return new uint3(1u). + /// + /// Value to square. + /// Returns the square of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 square(uint3 x) + { + return x * x; + } + + /// + /// Computes the component-wise square (x * x) of the input argument x. + /// + /// + /// Due to integer overflow, it's not always guaranteed that square(x) >= x. For example, square(new uint4(4294967295u)) + /// will return new uint4(1u). + /// + /// Value to square. + /// Returns the square of the input. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 square(uint4 x) + { + return x * x; + } + + /// + /// Packs components with an enabled mask to the left. + /// + /// + /// This function is also known as left packing. The effect of this function is to filter out components that + /// are not enabled and leave an output buffer tightly packed with only the enabled components. A common use + /// case is if you perform intersection tests on arrays of data in structure of arrays (SoA) form and need to + /// produce an output array of the things that intersected. + /// + /// Pointer to packed output array where enabled components should be stored to. + /// Index into output array where first enabled component should be stored to. + /// The value to to compress. + /// Mask indicating which components are enabled. + /// Index to element after the last one stored. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe int compress(int* output, int index, int4 val, bool4 mask) + { + if (mask.x) + output[index++] = val.x; + if (mask.y) + output[index++] = val.y; + if (mask.z) + output[index++] = val.z; + if (mask.w) + output[index++] = val.w; + + return index; + } + + /// + /// Packs components with an enabled mask to the left. + /// + /// + /// This function is also known as left packing. The effect of this function is to filter out components that + /// are not enabled and leave an output buffer tightly packed with only the enabled components. A common use + /// case is if you perform intersection tests on arrays of data in structure of arrays (SoA) form and need to + /// produce an output array of the things that intersected. + /// + /// Pointer to packed output array where enabled components should be stored to. + /// Index into output array where first enabled component should be stored to. + /// The value to to compress. + /// Mask indicating which components are enabled. + /// Index to element after the last one stored. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe int compress(uint* output, int index, uint4 val, bool4 mask) + { + return compress((int*)output, index, *(int4*)&val, mask); + } + + /// + /// Packs components with an enabled mask to the left. + /// + /// + /// This function is also known as left packing. The effect of this function is to filter out components that + /// are not enabled and leave an output buffer tightly packed with only the enabled components. A common use + /// case is if you perform intersection tests on arrays of data in structure of arrays (SoA) form and need to + /// produce an output array of the things that intersected. + /// + /// Pointer to packed output array where enabled components should be stored to. + /// Index into output array where first enabled component should be stored to. + /// The value to to compress. + /// Mask indicating which components are enabled. + /// Index to element after the last one stored. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe int compress(float* output, int index, float4 val, bool4 mask) + { + return compress((int*)output, index, *(int4*)&val, mask); + } + + /// Returns the floating point representation of a half-precision floating point value. + /// The half precision float. + /// The single precision float representation of the half precision float. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float f16tof32(uint x) + { + const uint shifted_exp = (0x7c00 << 13); + uint uf = (x & 0x7fff) << 13; + uint e = uf & shifted_exp; + uf += (127 - 15) << 23; + uf += select(0, (128u - 16u) << 23, e == shifted_exp); + uf = select(uf, asuint(asfloat(uf + (1 << 23)) - 6.10351563e-05f), e == 0); + uf |= (x & 0x8000) << 16; + return asfloat(uf); + } + + /// Returns the floating point representation of a half-precision floating point vector. + /// The half precision float vector. + /// The single precision float vector representation of the half precision float vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 f16tof32(uint2 x) + { + const uint shifted_exp = (0x7c00 << 13); + uint2 uf = (x & 0x7fff) << 13; + uint2 e = uf & shifted_exp; + uf += (127 - 15) << 23; + uf += select(0, (128u - 16u) << 23, e == shifted_exp); + uf = select(uf, asuint(asfloat(uf + (1 << 23)) - 6.10351563e-05f), e == 0); + uf |= (x & 0x8000) << 16; + return asfloat(uf); + } + + /// Returns the floating point representation of a half-precision floating point vector. + /// The half precision float vector. + /// The single precision float vector representation of the half precision float vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 f16tof32(uint3 x) + { + const uint shifted_exp = (0x7c00 << 13); + uint3 uf = (x & 0x7fff) << 13; + uint3 e = uf & shifted_exp; + uf += (127 - 15) << 23; + uf += select(0, (128u - 16u) << 23, e == shifted_exp); + uf = select(uf, asuint(asfloat(uf + (1 << 23)) - 6.10351563e-05f), e == 0); + uf |= (x & 0x8000) << 16; + return asfloat(uf); + } + + /// Returns the floating point representation of a half-precision floating point vector. + /// The half precision float vector. + /// The single precision float vector representation of the half precision float vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 f16tof32(uint4 x) + { + const uint shifted_exp = (0x7c00 << 13); + uint4 uf = (x & 0x7fff) << 13; + uint4 e = uf & shifted_exp; + uf += (127 - 15) << 23; + uf += select(0, (128u - 16u) << 23, e == shifted_exp); + uf = select(uf, asuint(asfloat(uf + (1 << 23)) - 6.10351563e-05f), e == 0); + uf |= (x & 0x8000) << 16; + return asfloat(uf); + } + + /// Returns the result converting a float value to its nearest half-precision floating point representation. + /// The single precision float. + /// The half precision float representation of the single precision float. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint f32tof16(float x) + { + const int infinity_32 = 255 << 23; + const uint msk = 0x7FFFF000u; + + uint ux = asuint(x); + uint uux = ux & msk; + uint h = (uint)(asuint(min(asfloat(uux) * 1.92592994e-34f, 260042752.0f)) + 0x1000) >> 13; // Clamp to signed infinity if overflowed + h = select(h, select(0x7c00u, 0x7e00u, (int)uux > infinity_32), (int)uux >= infinity_32); // NaN->qNaN and Inf->Inf + return h | (ux & ~msk) >> 16; + } + + /// Returns the result of a componentwise conversion of a float2 vector to its nearest half-precision floating point representation. + /// The single precision float vector. + /// The half precision float vector representation of the single precision float vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 f32tof16(float2 x) + { + const int infinity_32 = 255 << 23; + const uint msk = 0x7FFFF000u; + + uint2 ux = asuint(x); + uint2 uux = ux & msk; + uint2 h = (uint2)(asint(min(asfloat(uux) * 1.92592994e-34f, 260042752.0f)) + 0x1000) >> 13; // Clamp to signed infinity if overflowed + h = select(h, select(0x7c00u, 0x7e00u, (int2)uux > infinity_32), (int2)uux >= infinity_32); // NaN->qNaN and Inf->Inf + return h | (ux & ~msk) >> 16; + } + + /// Returns the result of a componentwise conversion of a float3 vector to its nearest half-precision floating point representation. + /// The single precision float vector. + /// The half precision float vector representation of the single precision float vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 f32tof16(float3 x) + { + const int infinity_32 = 255 << 23; + const uint msk = 0x7FFFF000u; + + uint3 ux = asuint(x); + uint3 uux = ux & msk; + uint3 h = (uint3)(asint(min(asfloat(uux) * 1.92592994e-34f, 260042752.0f)) + 0x1000) >> 13; // Clamp to signed infinity if overflowed + h = select(h, select(0x7c00u, 0x7e00u, (int3)uux > infinity_32), (int3)uux >= infinity_32); // NaN->qNaN and Inf->Inf + return h | (ux & ~msk) >> 16; + } + + /// Returns the result of a componentwise conversion of a float4 vector to its nearest half-precision floating point representation. + /// The single precision float vector. + /// The half precision float vector representation of the single precision float vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 f32tof16(float4 x) + { + const int infinity_32 = 255 << 23; + const uint msk = 0x7FFFF000u; + + uint4 ux = asuint(x); + uint4 uux = ux & msk; + uint4 h = (uint4)(asint(min(asfloat(uux) * 1.92592994e-34f, 260042752.0f)) + 0x1000) >> 13; // Clamp to signed infinity if overflowed + h = select(h, select(0x7c00u, 0x7e00u, (int4)uux > infinity_32), (int4)uux >= infinity_32); // NaN->qNaN and Inf->Inf + return h | (ux & ~msk) >> 16; + } + + /// + /// Generate an orthonormal basis given a single unit length normal vector. + /// + /// + /// This implementation is from "Building an Orthonormal Basis, Revisited" + /// https://graphics.pixar.com/library/OrthonormalB/paper.pdf + /// + /// Unit length normal vector. + /// Output unit length vector, orthogonal to normal vector. + /// Output unit length vector, orthogonal to normal vector and basis1. + public static void orthonormal_basis(float3 normal, out float3 basis1, out float3 basis2) + { + var sign = normal.z >= 0.0f ? 1.0f : -1.0f; + var a = -1.0f / (sign + normal.z); + var b = normal.x * normal.y * a; + basis1.x = 1.0f + sign * normal.x * normal.x * a; + basis1.y = sign * b; + basis1.z = -sign * normal.x; + basis2.x = b; + basis2.y = sign + normal.y * normal.y * a; + basis2.z = -normal.y; + } + + /// + /// Generate an orthonormal basis given a single unit length normal vector. + /// + /// + /// This implementation is from "Building an Orthonormal Basis, Revisited" + /// https://graphics.pixar.com/library/OrthonormalB/paper.pdf + /// + /// Unit length normal vector. + /// Output unit length vector, orthogonal to normal vector. + /// Output unit length vector, orthogonal to normal vector and basis1. + public static void orthonormal_basis(double3 normal, out double3 basis1, out double3 basis2) + { + var sign = normal.z >= 0.0 ? 1.0 : -1.0; + var a = -1.0 / (sign + normal.z); + var b = normal.x * normal.y * a; + basis1.x = 1.0 + sign * normal.x * normal.x * a; + basis1.y = sign * b; + basis1.z = -sign * normal.x; + basis2.x = b; + basis2.y = sign + normal.y * normal.y * a; + basis2.z = -normal.y; + } + + /// Change the sign of x based on the most significant bit of y [msb(y) ? -x : x]. + /// The single precision float to change the sign. + /// The single precision float used to test the most significant bit. + /// Returns x with changed sign based on y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float chgsign(float x, float y) + { + return asfloat(asuint(x) ^ (asuint(y) & 0x80000000)); + } + + /// Change the sign of components of x based on the most significant bit of components of y [msb(y) ? -x : x]. + /// The single precision float vector to change the sign. + /// The single precision float vector used to test the most significant bit. + /// Returns vector x with changed sign based on vector y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 chgsign(float2 x, float2 y) + { + return asfloat(asuint(x) ^ (asuint(y) & 0x80000000)); + } + + /// Change the sign of components of x based on the most significant bit of components of y [msb(y) ? -x : x]. + /// The single precision float vector to change the sign. + /// The single precision float vector used to test the most significant bit. + /// Returns vector x with changed sign based on vector y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 chgsign(float3 x, float3 y) + { + return asfloat(asuint(x) ^ (asuint(y) & 0x80000000)); + } + + /// Change the sign of components of x based on the most significant bit of components of y [msb(y) ? -x : x]. + /// The single precision float vector to change the sign. + /// The single precision float vector used to test the most significant bit. + /// Returns vector x with changed sign based on vector y. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 chgsign(float4 x, float4 y) + { + return asfloat(asuint(x) ^ (asuint(y) & 0x80000000)); + } + + /// + /// Read 32 bits of data in little endian format. + /// + /// Memory address to read from. + /// 32 bits in little endian format. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static unsafe uint read32_little_endian(void* pBuffer) + { + byte* ptr = (byte*)pBuffer; + return (uint)ptr[0] | ((uint)ptr[1] << 8) | ((uint)ptr[2] << 16) | ((uint)ptr[3] << 24); + } + + private static unsafe uint hash_with_unaligned_loads(void* pBuffer, int numBytes, uint seed) + { + unchecked + { + const uint Prime1 = 2654435761; + const uint Prime2 = 2246822519; + const uint Prime3 = 3266489917; + const uint Prime4 = 668265263; + const uint Prime5 = 374761393; + + uint4* p = (uint4*)pBuffer; + uint hash = seed + Prime5; + if (numBytes >= 16) + { + uint4 state = new uint4(Prime1 + Prime2, Prime2, 0, (uint)-Prime1) + seed; + + int count = numBytes >> 4; + for (int i = 0; i < count; ++i) + { + state += *p++ * Prime2; + state = (state << 13) | (state >> 19); + state *= Prime1; + } + + hash = rol(state.x, 1) + rol(state.y, 7) + rol(state.z, 12) + rol(state.w, 18); + } + + hash += (uint)numBytes; + + uint* puint = (uint*)p; + for (int i = 0; i < ((numBytes >> 2) & 3); ++i) + { + hash += *puint++ * Prime3; + hash = rol(hash, 17) * Prime4; + } + + byte* pbyte = (byte*)puint; + for (int i = 0; i < ((numBytes) & 3); ++i) + { + hash += (*pbyte++) * Prime5; + hash = rol(hash, 11) * Prime1; + } + + hash ^= hash >> 15; + hash *= Prime2; + hash ^= hash >> 13; + hash *= Prime3; + hash ^= hash >> 16; + + return hash; + } + } + + private static unsafe uint hash_without_unaligned_loads(void* pBuffer, int numBytes, uint seed) + { + unchecked + { + const uint Prime1 = 2654435761; + const uint Prime2 = 2246822519; + const uint Prime3 = 3266489917; + const uint Prime4 = 668265263; + const uint Prime5 = 374761393; + + byte* p = (byte*)pBuffer; + uint hash = seed + Prime5; + if (numBytes >= 16) + { + uint4 state = new uint4(Prime1 + Prime2, Prime2, 0, (uint)-Prime1) + seed; + + int count = numBytes >> 4; + for (int i = 0; i < count; ++i) + { + var data = new uint4(read32_little_endian(p), read32_little_endian(p + 4), read32_little_endian(p + 8), read32_little_endian(p + 12)); + state += data * Prime2; + state = rol(state, 13); + state *= Prime1; + p += 16; + } + + hash = rol(state.x, 1) + rol(state.y, 7) + rol(state.z, 12) + rol(state.w, 18); + } + + hash += (uint)numBytes; + + for (int i = 0; i < ((numBytes >> 2) & 3); ++i) + { + hash += read32_little_endian(p) * Prime3; + hash = rol(hash, 17) * Prime4; + p += 4; + } + + for (int i = 0; i < ((numBytes) & 3); ++i) + { + hash += (*p++) * Prime5; + hash = rol(hash, 11) * Prime1; + } + + hash ^= hash >> 15; + hash *= Prime2; + hash ^= hash >> 13; + hash *= Prime3; + hash ^= hash >> 16; + + return hash; + } + } + + /// Returns a uint hash from a block of memory using the xxhash32 algorithm. Can only be used in an unsafe context. + /// A pointer to the beginning of the data. + /// Number of bytes to hash. + /// Starting seed value. + /// The 32 bit hash of the input data buffer. + public static unsafe uint hash(void* pBuffer, int numBytes, uint seed = 0) + { +#if !UNITY_64 && UNITY_ANDROID + return hash_without_unaligned_loads(pBuffer, numBytes, seed); +#else + return hash_with_unaligned_loads(pBuffer, numBytes, seed); +#endif + } + + /// + /// Unity's up axis (0, 1, 0). + /// + /// Matches [https://docs.unity3d.com/ScriptReference/Vector3-up.html](https://docs.unity3d.com/ScriptReference/Vector3-up.html) + /// The up axis. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 up() { return new float3(0.0f, 1.0f, 0.0f); } // for compatibility + + /// + /// Unity's down axis (0, -1, 0). + /// + /// Matches [https://docs.unity3d.com/ScriptReference/Vector3-down.html](https://docs.unity3d.com/ScriptReference/Vector3-down.html) + /// The down axis. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 down() { return new float3(0.0f, -1.0f, 0.0f); } + + /// + /// Unity's forward axis (0, 0, 1). + /// + /// Matches [https://docs.unity3d.com/ScriptReference/Vector3-forward.html](https://docs.unity3d.com/ScriptReference/Vector3-forward.html) + /// The forward axis. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 forward() { return new float3(0.0f, 0.0f, 1.0f); } + + /// + /// Unity's back axis (0, 0, -1). + /// + /// Matches [https://docs.unity3d.com/ScriptReference/Vector3-back.html](https://docs.unity3d.com/ScriptReference/Vector3-back.html) + /// The back axis. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 back() { return new float3(0.0f, 0.0f, -1.0f); } + + /// + /// Unity's left axis (-1, 0, 0). + /// + /// Matches [https://docs.unity3d.com/ScriptReference/Vector3-left.html](https://docs.unity3d.com/ScriptReference/Vector3-left.html) + /// The left axis. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 left() { return new float3(-1.0f, 0.0f, 0.0f); } + + /// + /// Unity's right axis (1, 0, 0). + /// + /// Matches [https://docs.unity3d.com/ScriptReference/Vector3-right.html](https://docs.unity3d.com/ScriptReference/Vector3-right.html) + /// The right axis. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 right() { return new float3(1.0f, 0.0f, 0.0f); } + + /// + /// Returns the Euler angle representation of the quaternion following the XYZ rotation order. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// The quaternion to convert to Euler angles. + /// The Euler angle representation of the quaternion in XYZ order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 EulerXYZ(quaternion q) + { + const float epsilon = 1e-6f; + const float cutoff = (1f - 2f * epsilon) * (1f - 2f * epsilon); + + // prepare the data + var qv = q.value; + var d1 = qv * qv.wwww * float4(2f); //xw, yw, zw, ww + var d2 = qv * qv.yzxw * float4(2f); //xy, yz, zx, ww + var d3 = qv * qv; + var euler = Unity.Mathematics.float3.zero; + + var y1 = d2.z - d1.y; + if (y1 * y1 < cutoff) + { + var x1 = d2.y + d1.x; + var x2 = d3.z + d3.w - d3.y - d3.x; + var z1 = d2.x + d1.z; + var z2 = d3.x + d3.w - d3.y - d3.z; + euler = float3(atan2(x1, x2), -asin(y1), atan2(z1, z2)); + } + else //xzx + { + y1 = clamp(y1, -1f, 1f); + var abcd = float4(d2.z, d1.y, d2.x, d1.z); + var x1 = 2f * (abcd.x * abcd.w + abcd.y * abcd.z); //2(ad+bc) + var x2 = csum(abcd * abcd * float4(-1f, 1f, -1f, 1f)); + euler = float3(atan2(x1, x2), -asin(y1), 0f); + } + + return euler; + } + + /// + /// Returns the Euler angle representation of the quaternion following the XZY rotation order. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// The quaternion to convert to Euler angles. + /// The Euler angle representation of the quaternion in XZY order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 EulerXZY(quaternion q) + { + const float epsilon = 1e-6f; + const float cutoff = (1f - 2f * epsilon) * (1f - 2f * epsilon); + + // prepare the data + var qv = q.value; + var d1 = qv * qv.wwww * float4(2f); //xw, yw, zw, ww + var d2 = qv * qv.yzxw * float4(2f); //xy, yz, zx, ww + var d3 = qv * qv; + var euler = Unity.Mathematics.float3.zero; + + var y1 = d2.x + d1.z; + if (y1 * y1 < cutoff) + { + var x1 = -d2.y + d1.x; + var x2 = d3.y + d3.w - d3.z - d3.x; + var z1 = -d2.z + d1.y; + var z2 = d3.x + d3.w - d3.y - d3.z; + euler = float3(atan2(x1, x2), asin(y1), atan2(z1, z2)); + } + else //xyx + { + y1 = clamp(y1, -1f, 1f); + var abcd = float4(d2.x, d1.z, d2.z, d1.y); + var x1 = 2f * (abcd.x * abcd.w + abcd.y * abcd.z); //2(ad+bc) + var x2 = csum(abcd * abcd * float4(-1f, 1f, -1f, 1f)); + euler = float3(atan2(x1, x2), asin(y1), 0f); + } + + return euler.xzy; + } + + /// + /// Returns the Euler angle representation of the quaternion following the YXZ rotation order. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// The quaternion to convert to Euler angles. + /// The Euler angle representation of the quaternion in YXZ order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 EulerYXZ(quaternion q) + { + const float epsilon = 1e-6f; + const float cutoff = (1f - 2f * epsilon) * (1f - 2f * epsilon); + + // prepare the data + var qv = q.value; + var d1 = qv * qv.wwww * float4(2f); //xw, yw, zw, ww + var d2 = qv * qv.yzxw * float4(2f); //xy, yz, zx, ww + var d3 = qv * qv; + var euler = Unity.Mathematics.float3.zero; + + var y1 = d2.y + d1.x; + if (y1 * y1 < cutoff) + { + var x1 = -d2.z + d1.y; + var x2 = d3.z + d3.w - d3.x - d3.y; + var z1 = -d2.x + d1.z; + var z2 = d3.y + d3.w - d3.z - d3.x; + euler = float3(atan2(x1, x2), asin(y1), atan2(z1, z2)); + } + else //yzy + { + y1 = clamp(y1, -1f, 1f); + var abcd = float4(d2.x, d1.z, d2.y, d1.x); + var x1 = 2f * (abcd.x * abcd.w + abcd.y * abcd.z); //2(ad+bc) + var x2 = csum(abcd * abcd * float4(-1f, 1f, -1f, 1f)); + euler = float3(atan2(x1, x2), asin(y1), 0f); + } + + return euler.yxz; + } + + /// + /// Returns the Euler angle representation of the quaternion following the YZX rotation order. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// The quaternion to convert to Euler angles. + /// The Euler angle representation of the quaternion in YZX order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 EulerYZX(quaternion q) + { + const float epsilon = 1e-6f; + const float cutoff = (1f - 2f * epsilon) * (1f - 2f * epsilon); + + // prepare the data + var qv = q.value; + var d1 = qv * qv.wwww * float4(2f); //xw, yw, zw, ww + var d2 = qv * qv.yzxw * float4(2f); //xy, yz, zx, ww + var d3 = qv * qv; + var euler = Unity.Mathematics.float3.zero; + + var y1 = d2.x - d1.z; + if (y1 * y1 < cutoff) + { + var x1 = d2.z + d1.y; + var x2 = d3.x + d3.w - d3.z - d3.y; + var z1 = d2.y + d1.x; + var z2 = d3.y + d3.w - d3.x - d3.z; + euler = float3(atan2(x1, x2), -asin(y1), atan2(z1, z2)); + } + else //yxy + { + y1 = clamp(y1, -1f, 1f); + var abcd = float4(d2.x, d1.z, d2.y, d1.x); + var x1 = 2f * (abcd.x * abcd.w + abcd.y * abcd.z); //2(ad+bc) + var x2 = csum(abcd * abcd * float4(-1f, 1f, -1f, 1f)); + euler = float3(atan2(x1, x2), -asin(y1), 0f); + } + + return euler.zxy; + } + + /// + /// Returns the Euler angle representation of the quaternion following the ZXY rotation order. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// The quaternion to convert to Euler angles. + /// The Euler angle representation of the quaternion in ZXY order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 EulerZXY(quaternion q) + { + const float epsilon = 1e-6f; + const float cutoff = (1f - 2f * epsilon) * (1f - 2f * epsilon); + + // prepare the data + var qv = q.value; + var d1 = qv * qv.wwww * float4(2f); //xw, yw, zw, ww + var d2 = qv * qv.yzxw * float4(2f); //xy, yz, zx, ww + var d3 = qv * qv; + var euler = Unity.Mathematics.float3.zero; + + var y1 = d2.y - d1.x; + if (y1 * y1 < cutoff) + { + var x1 = d2.x + d1.z; + var x2 = d3.y + d3.w - d3.x - d3.z; + var z1 = d2.z + d1.y; + var z2 = d3.z + d3.w - d3.x - d3.y; + euler = float3(atan2(x1, x2), -asin(y1), atan2(z1, z2)); + } + else //zxz + { + y1 = clamp(y1, -1f, 1f); + var abcd = float4(d2.z, d1.y, d2.y, d1.x); + var x1 = 2f * (abcd.x * abcd.w + abcd.y * abcd.z); //2(ad+bc) + var x2 = csum(abcd * abcd * float4(-1f, 1f, -1f, 1f)); + euler = float3(atan2(x1, x2), -asin(y1), 0f); + } + + return euler.yzx; + } + + /// + /// Returns the Euler angle representation of the quaternion following the ZYX rotation order. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// The quaternion to convert to Euler angles. + /// The Euler angle representation of the quaternion in ZYX order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 EulerZYX(quaternion q) + { + const float epsilon = 1e-6f; + const float cutoff = (1f - 2f * epsilon) * (1f - 2f * epsilon); + + var qv = q.value; + var d1 = qv * qv.wwww * float4(2f); //xw, yw, zw, ww + var d2 = qv * qv.yzxw * float4(2f); //xy, yz, zx, ww + var d3 = qv * qv; + var euler = Unity.Mathematics.float3.zero; + + var y1 = d2.z + d1.y; + if (y1 * y1 < cutoff) + { + var x1 = -d2.x + d1.z; + var x2 = d3.x + d3.w - d3.y - d3.z; + var z1 = -d2.y + d1.x; + var z2 = d3.z + d3.w - d3.y - d3.x; + euler = float3(atan2(x1, x2), asin(y1), atan2(z1, z2)); + } + else //zxz + { + y1 = clamp(y1, -1f, 1f); + var abcd = float4(d2.z, d1.y, d2.y, d1.x); + var x1 = 2f * (abcd.x * abcd.w + abcd.y * abcd.z); //2(ad+bc) + var x2 = csum(abcd * abcd * float4(-1f, 1f, -1f, 1f)); + euler = float3(atan2(x1, x2), asin(y1), 0f); + } + + return euler.zyx; + } + + /// + /// Returns the Euler angle representation of the quaternion. The returned angles depend on the specified order to apply the + /// three rotations around the principal axes. All rotation angles are in radians and clockwise when looking along the + /// rotation axis towards the origin. + /// When the rotation order is known at compile time, to get the best performance you should use the specific + /// Euler rotation constructors such as EulerZXY(...). + /// + /// The quaternion to convert to Euler angles. + /// The order in which the rotations are applied. + /// The Euler angle representation of the quaternion in the specified order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 Euler(quaternion q, math.RotationOrder order = math.RotationOrder.Default) + { + switch (order) + { + case math.RotationOrder.XYZ: + return EulerXYZ(q); + case math.RotationOrder.XZY: + return EulerXZY(q); + case math.RotationOrder.YXZ: + return EulerYXZ(q); + case math.RotationOrder.YZX: + return EulerYZX(q); + case math.RotationOrder.ZXY: + return EulerZXY(q); + case math.RotationOrder.ZYX: + return EulerZYX(q); + default: + return Unity.Mathematics.float3.zero; + } + } + + /// + /// Matrix columns multiplied by scale components + /// m.c0.x * s.x | m.c1.x * s.y | m.c2.x * s.z + /// m.c0.y * s.x | m.c1.y * s.y | m.c2.y * s.z + /// m.c0.z * s.x | m.c1.z * s.y | m.c2.z * s.z + /// + /// Matrix to scale. + /// Scaling coefficients for each column. + /// The scaled matrix. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 mulScale(float3x3 m, float3 s) => new float3x3(m.c0 * s.x, m.c1 * s.y, m.c2 * s.z); + + /// + /// Matrix rows multiplied by scale components + /// m.c0.x * s.x | m.c1.x * s.x | m.c2.x * s.x + /// m.c0.y * s.y | m.c1.y * s.y | m.c2.y * s.y + /// m.c0.z * s.z | m.c1.z * s.z | m.c2.z * s.z + /// + /// Scaling coefficients for each row. + /// Matrix to scale. + /// The scaled matrix. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 scaleMul(float3 s, float3x3 m) => new float3x3(m.c0 * s, m.c1 * s, m.c2 * s); + + // Internal + + // SSE shuffles + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static float4 unpacklo(float4 a, float4 b) + { + return shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.RightX, ShuffleComponent.LeftY, ShuffleComponent.RightY); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static double4 unpacklo(double4 a, double4 b) + { + return shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.RightX, ShuffleComponent.LeftY, ShuffleComponent.RightY); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static float4 unpackhi(float4 a, float4 b) + { + return shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.RightZ, ShuffleComponent.LeftW, ShuffleComponent.RightW); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static double4 unpackhi(double4 a, double4 b) + { + return shuffle(a, b, ShuffleComponent.LeftZ, ShuffleComponent.RightZ, ShuffleComponent.LeftW, ShuffleComponent.RightW); + } + + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static float4 movelh(float4 a, float4 b) + { + return shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.LeftY, ShuffleComponent.RightX, ShuffleComponent.RightY); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static double4 movelh(double4 a, double4 b) + { + return shuffle(a, b, ShuffleComponent.LeftX, ShuffleComponent.LeftY, ShuffleComponent.RightX, ShuffleComponent.RightY); + } + + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static float4 movehl(float4 a, float4 b) + { + return shuffle(b, a, ShuffleComponent.LeftZ, ShuffleComponent.LeftW, ShuffleComponent.RightZ, ShuffleComponent.RightW); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static double4 movehl(double4 a, double4 b) + { + return shuffle(b, a, ShuffleComponent.LeftZ, ShuffleComponent.LeftW, ShuffleComponent.RightZ, ShuffleComponent.RightW); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static uint fold_to_uint(double x) // utility for double hashing + { + LongDoubleUnion u; + u.longValue = 0; + u.doubleValue = x; + return (uint)(u.longValue >> 32) ^ (uint)u.longValue; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static uint2 fold_to_uint(double2 x) { return uint2(fold_to_uint(x.x), fold_to_uint(x.y)); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static uint3 fold_to_uint(double3 x) { return uint3(fold_to_uint(x.x), fold_to_uint(x.y), fold_to_uint(x.z)); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static uint4 fold_to_uint(double4 x) { return uint4(fold_to_uint(x.x), fold_to_uint(x.y), fold_to_uint(x.z), fold_to_uint(x.w)); } + + [StructLayout(LayoutKind.Explicit)] + internal struct LongDoubleUnion + { + [FieldOffset(0)] + public long longValue; + [FieldOffset(0)] + public double doubleValue; + } } } diff --git a/src/Unity.Mathematics/math_unity_conversion.cs b/src/Unity.Mathematics/math_unity_conversion.cs index cd849b4f..a51051f5 100644 --- a/src/Unity.Mathematics/math_unity_conversion.cs +++ b/src/Unity.Mathematics/math_unity_conversion.cs @@ -1,4 +1,5 @@ -using UnityEngine; +#if !UNITY_DOTSPLAYER +using UnityEngine; #pragma warning disable 0660, 0661 @@ -6,30 +7,87 @@ namespace Unity.Mathematics { public partial struct float2 { - public static implicit operator Vector2(float2 d) { return new Vector2(d.x, d.y); } - public static implicit operator float2(Vector2 d) { return new float2(d.x, d.y); } + /// + /// Converts a float2 to Vector2. + /// + /// float2 to convert. + /// The converted Vector2. + public static implicit operator Vector2(float2 v) { return new Vector2(v.x, v.y); } + + /// + /// Converts a Vector2 to float2. + /// + /// Vector2 to convert. + /// The converted float2. + public static implicit operator float2(Vector2 v) { return new float2(v.x, v.y); } } - + public partial struct float3 { - public static implicit operator Vector3(float3 d) { return new Vector3(d.x, d.y, d.z); } - public static implicit operator float3(Vector3 d) { return new float3(d.x, d.y, d.z); } + /// + /// Converts a float3 to Vector3. + /// + /// float3 to convert. + /// The converted Vector3. + public static implicit operator Vector3(float3 v) { return new Vector3(v.x, v.y, v.z); } + + /// + /// Converts a Vector3 to float3. + /// + /// Vector3 to convert. + /// The converted float3. + public static implicit operator float3(Vector3 v) { return new float3(v.x, v.y, v.z); } } public partial struct float4 { - public static implicit operator float4(Vector4 d) { return new float4(d.x, d.y, d.z, d.w); } - public static implicit operator Vector4(float4 d) { return new Vector4(d.x, d.y, d.z, d.w); } + /// + /// Converts a Vector4 to float4. + /// + /// Vector4 to convert. + /// The converted float4. + public static implicit operator float4(Vector4 v) { return new float4(v.x, v.y, v.z, v.w); } + + /// + /// Converts a float4 to Vector4. + /// + /// float4 to convert. + /// The converted Vector4. + public static implicit operator Vector4(float4 v) { return new Vector4(v.x, v.y, v.z, v.w); } } public partial struct quaternion { - public static implicit operator Quaternion(quaternion d) { return new Quaternion(d.value.x, d.value.y, d.value.z, d.value.w); } - public static implicit operator quaternion(Quaternion d) { return new quaternion(d.x, d.y, d.z, d.w); } + /// + /// Converts a quaternion to Quaternion. + /// + /// quaternion to convert. + /// The converted Quaternion. + public static implicit operator Quaternion(quaternion q) { return new Quaternion(q.value.x, q.value.y, q.value.z, q.value.w); } + + /// + /// Converts a Quaternion to quaternion. + /// + /// Quaternion to convert. + /// The converted quaternion. + public static implicit operator quaternion(Quaternion q) { return new quaternion(q.x, q.y, q.z, q.w); } } - + public partial struct float4x4 { + /// + /// Converts a Matrix4x4 to float4x4. + /// + /// Matrix4x4 to convert. + /// The converted float4x4. public static implicit operator float4x4(Matrix4x4 m) { return new float4x4(m.GetColumn(0), m.GetColumn(1), m.GetColumn(2), m.GetColumn(3)); } + + /// + /// Converts a float4x4 to Matrix4x4. + /// + /// float4x4 to convert. + /// The converted Matrix4x4. + public static implicit operator Matrix4x4(float4x4 m) { return new Matrix4x4(m.c0, m.c1, m.c2, m.c3); } } } +#endif diff --git a/src/Unity.Mathematics/mathexperimental.cs b/src/Unity.Mathematics/mathexperimental.cs deleted file mode 100644 index c3adc49f..00000000 --- a/src/Unity.Mathematics/mathexperimental.cs +++ /dev/null @@ -1,38 +0,0 @@ -namespace Unity.Mathematics.Experimental -{ - public static partial class math_experimental - { - //@TODO hack - static float4 epsilon4f { get { return new float4(0.00001f); } } - static float3 epsilon3f { get { return new float3(0.00001f); } } - static float2 epsilon2f { get { return new float2(0.00001f); } } - - public const float epsilon = 0.00001f; - - //@TODO: Test len > epsilon4f... it is weird. compare to hlsl beahviour... - // discuss if we want this function at all??? - static public float4 normalizeSafe(float4 v, float4 defaultValue = new float4()) - { - float len = math.dot(v, v); - return math.select(defaultValue, v * math.rsqrt(len), len > epsilon4f); - } - - //@TODO: Merge back into one function with default values... Causes compiler error right now... - static public float3 normalizeSafe(float3 v, float3 defaultValue) - { - float len = math.dot(v, v); - return math.select(defaultValue, v * math.rsqrt(len), len > epsilon3f); - } - static public float3 normalizeSafe(float3 v) - { - float len = math.dot(v, v); - return math.select(new float3(), v * math.rsqrt(len), len > epsilon3f); - } - - static public float2 normalizeSafe(float2 v, float2 defaultValue = new float2()) - { - float len = math.dot(v, v); - return math.select(defaultValue, v * math.rsqrt(len), len > epsilon2f); - } - } -} diff --git a/src/Unity.Mathematics/mathexperimental.cs.meta b/src/Unity.Mathematics/mathexperimental.cs.meta deleted file mode 100644 index 64fa05cf..00000000 --- a/src/Unity.Mathematics/mathexperimental.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: dc4d15dcc0785c141879edbb165398ae -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/src/Unity.Mathematics/mathextended.cs b/src/Unity.Mathematics/mathextended.cs deleted file mode 100644 index 13bc405a..00000000 --- a/src/Unity.Mathematics/mathextended.cs +++ /dev/null @@ -1,184 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace Unity.Mathematics -{ - public static partial class math - { - public const float epsilon_normal = 1e-30f; - - - [MethodImpl((MethodImplOptions)0x100)] - public static int bool_to_int(bool value) { return value ? 1 : 0; } - - [MethodImpl((MethodImplOptions)0x100)] - public static int bool_to_mask(bool value) { return value ? -1 : 0; } - - public static int count_bits(int i) - { - i = i - ((i >> 1) & 0x55555555); - i = (i & 0x33333333) + ((i >> 2) & 0x33333333); - return (((i + (i >> 4)) & 0x0F0F0F0F) * 0x01010101) >> 24; - } - - /// - /// Returns the smallest power of two that is greater than or equal to the given integer - /// - /// - /// - public static int ceil_pow2(int i) - { - i -= 1; - i |= i >> 1; - i |= i >> 2; - i |= i >> 4; - i |= i >> 8; - i |= i >> 16; - return i + 1; - } - - // Packs components with an enabled mask (LSB) to the left - // The value of components after the last packed component are undefined. - // Returns the number of enabled mask bits. (0 ... 4) - public static unsafe int compress(int* output, int index, int4 val, bool4 mask) - { - if (mask.x) - output[index++] = val.x; - if (mask.y) - output[index++] = val.y; - if (mask.z) - output[index++] = val.z; - if (mask.w) - output[index++] = val.w; - - return index; - } - - // radians (convert from degrees to radians) - [MethodImpl((MethodImplOptions)0x100)] - public static float radians(float degrees) { return degrees * 0.0174532925f; } - [MethodImpl((MethodImplOptions)0x100)] - public static float2 radians(float2 degrees) { return degrees * 0.0174532925f; } - [MethodImpl((MethodImplOptions)0x100)] - public static float3 radians(float3 degrees) { return degrees * 0.0174532925f; } - [MethodImpl((MethodImplOptions)0x100)] - public static float4 radians(float4 degrees) { return degrees * 0.0174532925f; } - - // radians (convert from radians to degrees) - [MethodImpl((MethodImplOptions)0x100)] - public static float degrees(float radians) { return radians * 57.295779513f; } - [MethodImpl((MethodImplOptions)0x100)] - public static float2 degrees(float2 radians) { return radians * 57.295779513f; } - [MethodImpl((MethodImplOptions)0x100)] - public static float3 degrees(float3 radians) { return radians * 57.295779513f; } - [MethodImpl((MethodImplOptions)0x100)] - public static float4 degrees(float4 radians) { return radians * 57.295779513f; } - - - // cmin - returns the smallest component of the vector - [MethodImpl((MethodImplOptions)0x100)] - public static float cmin(float a) { return a; } - [MethodImpl((MethodImplOptions)0x100)] - public static float cmin(float2 a) { return min(a.x, a.y); } - [MethodImpl((MethodImplOptions)0x100)] - public static float cmin(float3 a) { return min(min(a.x, a.y), a.z); } - [MethodImpl((MethodImplOptions)0x100)] - public static float cmin(float4 a) { return min(min(min(a.x, a.y), a.z), a.w); } - - [MethodImpl((MethodImplOptions)0x100)] - public static int cmin(int a) { return a; } - [MethodImpl((MethodImplOptions)0x100)] - public static int cmin(int2 a) { return min(a.x, a.y); } - [MethodImpl((MethodImplOptions)0x100)] - public static int cmin(int3 a) { return min(min(a.x, a.y), a.z); } - [MethodImpl((MethodImplOptions)0x100)] - public static int cmin(int4 a) { return min(min(min(a.x, a.y), a.z), a.w); } - - // cmax - returns the largest component of the vector - [MethodImpl((MethodImplOptions)0x100)] - public static float cmax(float a) { return a; } - [MethodImpl((MethodImplOptions)0x100)] - public static float cmax(float2 a) { return max(a.x, a.y); } - [MethodImpl((MethodImplOptions)0x100)] - public static float cmax(float3 a) { return max(max(a.x, a.y), a.z); } - [MethodImpl((MethodImplOptions)0x100)] - public static float cmax(float4 a) { return max(max(max(a.x, a.y), a.z), a.w); } - - [MethodImpl((MethodImplOptions)0x100)] - public static int cmax(int a) { return a; } - [MethodImpl((MethodImplOptions)0x100)] - public static int cmax(int2 a) { return max(a.x, a.y); } - [MethodImpl((MethodImplOptions)0x100)] - public static int cmax(int3 a) { return max(max(a.x, a.y), a.z); } - [MethodImpl((MethodImplOptions)0x100)] - public static int cmax(int4 a) { return max(max(max(a.x, a.y), a.z), a.w); } - - // csum - sums all components of the vector - [MethodImpl((MethodImplOptions)0x100)] - public static float csum(float a) { return a; } - [MethodImpl((MethodImplOptions)0x100)] - public static float csum(float2 a) { return a.x + a.y; } - [MethodImpl((MethodImplOptions)0x100)] - public static float csum(float3 a) { return a.x + a.y + a.z; } - [MethodImpl((MethodImplOptions)0x100)] - public static float csum(float4 a) { return a.x + a.y + a.z + a.w; } - - [MethodImpl((MethodImplOptions)0x100)] - public static int csum(int a) { return a; } - [MethodImpl((MethodImplOptions)0x100)] - public static int csum(int2 a) { return a.x + a.y; } - [MethodImpl((MethodImplOptions)0x100)] - public static int csum(int3 a) { return a.x + a.y + a.z; } - [MethodImpl((MethodImplOptions)0x100)] - public static int csum(int4 a) { return a.x + a.y + a.z + a.w; } - - // A numeric optimization fence. - // prevents the compiler from optimizing operators. - // Some algorithms are written in specific ways to get more precision. - // For example: https://en.wikipedia.org/wiki/Kahan_summation_algorithm - // this gives the programmer a tool to prevent specific optimization. - // example: - // var c = math.nfence(a + b) * c; - [MethodImpl((MethodImplOptions)0x100)] - public static float nfence(float value) { return value; } - [MethodImpl((MethodImplOptions)0x100)] - public static float2 nfence(float2 value) { return value; } - [MethodImpl((MethodImplOptions)0x100)] - public static float3 nfence(float3 value) { return value; } - [MethodImpl((MethodImplOptions)0x100)] - public static float4 nfence(float4 value) { return value; } - - // fract - [MethodImpl((MethodImplOptions)0x100)] - public static float fract(float a) { return a - floor(a); } - [MethodImpl((MethodImplOptions)0x100)] - public static float2 fract(float2 a) { return a - floor(a); } - [MethodImpl((MethodImplOptions)0x100)] - public static float3 fract(float3 a) { return a - floor(a); } - [MethodImpl((MethodImplOptions)0x100)] - public static float4 fract(float4 a) { return a - floor(a); } - -#if false - - //@TODO: Complete all versions of this also, this implementation doesn't actaully do msb(y) ? -x : x... - - // changesign: change sign - // return value: msb(y) ? -x : x - public static float4 chgsign(float4 val, float sign) { return new float4(chgsign(val.x, sign), chgsign(val.y, sign), chgsign(val.z, sign), chgsign(val.w, sign)); } - public static float4 chgsign(float4 val, float4 sign) { return new float4(chgsign(val.x, sign.x), chgsign(val.y, sign.y), chgsign(val.z, sign.z), chgsign(val.w, sign.w)); } - public static float chgsign(float val, float sign) { return sign >= 0.0F ? val : -val; } - - // sign: change sign - // return value: Returns -1 if x is less than zero; 0 if x equals zero; and 1 if x is greater than zero. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool msb(float val) { return (IntFloatUnion.ToInt(val) & 0x80000000) != 0; } - - // copysign: copys the sign bit from sign to val - // return value: msb(sign) ? abs(val) : -abs(val) - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static float4 copysign(float4 val, float sign) { return sign < 0.0F ? -val : val; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static float4 copysign(float4 val, float4 sign) { return new float4(sign.x < 0.0F ? -val.x : val.x, sign.y < 0.0F ? -val.y : val.y, sign.z < 0.0F ? -val.z : val.z, sign.w < 0.0F ? -val.w : val.w); } - -#endif - } -} diff --git a/src/Unity.Mathematics/mathextended.cs.meta b/src/Unity.Mathematics/mathextended.cs.meta deleted file mode 100644 index feb4605e..00000000 --- a/src/Unity.Mathematics/mathextended.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 38503c16601f8364aa7fee281734c7af -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/src/Unity.Mathematics/mathquat.cs b/src/Unity.Mathematics/mathquat.cs deleted file mode 100644 index 8aecca71..00000000 --- a/src/Unity.Mathematics/mathquat.cs +++ /dev/null @@ -1,221 +0,0 @@ -using System; -using Unity.Mathematics.Experimental; - -namespace Unity.Mathematics -{ - [Serializable] - public partial struct quaternion - { - public float4 value; - - public quaternion(float x, float y, float z, float w) { value.x = x; value.y = y; value.z = z; value.w = w; } - public quaternion(float4 value) { this.value = value; } - - public static quaternion identity { get { return new quaternion(0.0F, 0.0F, 0.0F, 1.0F); } } - - } - - public static partial class math - { - public static quaternion normalize(quaternion q) - { - float4 value = q.value; - float len = math.dot(value, value); - - // note we use float4 comparison here because this gives us -1 / 0 which is necessary for select. - //return select(quatIdentity(), q*rsqrt(len), len > float4(epsilon_normal())); - value = math.select(quaternion.identity.value, value * math.rsqrt(len), len > math.epsilon_normal); - - return new quaternion(value); - } - - public static quaternion mul(quaternion lhs, quaternion rhs) - { - return new quaternion( - lhs.value.w* rhs.value.x + lhs.value.x* rhs.value.w + lhs.value.y* rhs.value.z - lhs.value.z* rhs.value.y, - lhs.value.w* rhs.value.y + lhs.value.y* rhs.value.w + lhs.value.z* rhs.value.x - lhs.value.x* rhs.value.z, - lhs.value.w* rhs.value.z + lhs.value.z* rhs.value.w + lhs.value.x* rhs.value.y - lhs.value.y* rhs.value.x, - lhs.value.w* rhs.value.w - lhs.value.x* rhs.value.x - lhs.value.y* rhs.value.y - lhs.value.z* rhs.value.z); - } - - public static float3 mul(quaternion rotation, float3 position) - { - float x = rotation.value.x * 2F; - float y = rotation.value.y * 2F; - float z = rotation.value.z * 2F; - float xx = rotation.value.x * x; - float yy = rotation.value.y * y; - float zz = rotation.value.z * z; - float xy = rotation.value.x * y; - float xz = rotation.value.x * z; - float yz = rotation.value.y * z; - float wx = rotation.value.w * x; - float wy = rotation.value.w * y; - float wz = rotation.value.w * z; - - float3 res; - res.x = (1F - (yy + zz)) * position.x + (xy - wz) * position.y + (xz + wy) * position.z; - res.y = (xy + wz) * position.x + (1F - (xx + zz)) * position.y + (yz - wx) * position.z; - res.z = (xz - wy) * position.x + (yz + wx) * position.y + (1F - (xx + yy)) * position.z; - return res; - } - - // get unit quaternion from rotation matrix - // u, v, w must be ortho-normal. - public static quaternion matrixToQuat(float3 u, float3 v, float3 w) - { - float4 q; - if (u.x >= 0f) - { - float t = v.y + w.z; - if (t >= 0f) - q = new float4(v.z - w.y, w.x - u.z, u.y - v.x, 1f + u.x + t); - else - q = new float4(1f + u.x - t, u.y + v.x, w.x + u.z, v.z - w.y); - } - else - { - float t = v.y - w.z; - if (t >= 0f) - q = new float4(u.y + v.x, 1f - u.x + t, v.z + w.y, w.x - u.z); - else - q = new float4(w.x + u.z, v.z + w.y, 1f - u.x - t, u.y - v.x); - } - return normalize(new quaternion(q)); - } - - public static float3x3 quatToMatrix(quaternion q) - { - q = math.normalize(q); - - // Precalculate coordinate products - float x = q.value.x * 2.0F; - float y = q.value.y * 2.0F; - float z = q.value.z * 2.0F; - float xx = q.value.x * x; - float yy = q.value.y * y; - float zz = q.value.z * z; - float xy = q.value.x * y; - float xz = q.value.x * z; - float yz = q.value.y * z; - float wx = q.value.w * x; - float wy = q.value.w * y; - float wz = q.value.w * z; - - // Calculate 3x3 matrix from orthonormal basis - var m = new float3x3 - { - m0 = new float3(1.0f - (yy + zz), xy + wz, xz - wy), - m1 = new float3(xy - wz, 1.0f - (xx + zz), yz + wx), - m2 = new float3(xz + wy, yz - wx, 1.0f - (xx + yy)) - }; - return m; - } - - public static float4x4 rottrans(quaternion q, float3 t) - { - var m3x3 = quatToMatrix(q); - var m = new float4x4 - { - m0 = new float4(m3x3.m0, 0.0f), - m1 = new float4(m3x3.m1, 0.0f), - m2 = new float4(m3x3.m2, 0.0f), - m3 = new float4(t, 1.0f) - }; - return m; - } - - public static quaternion axisAngle(float3 axis, float angle) - { - float3 axisUnit = math.normalize(axis); - float sina = math.sin(0.5f * angle); - float cosa = math.cos(0.5f * angle); - return new quaternion { value = new float4( axisUnit.x * sina, axisUnit.y * sina, axisUnit.z * sina, cosa ) }; - } - - //@TODO: Seperated x, y, z - public static quaternion euler(float3 eulerInDegrees) - { - throw new System.NotImplementedException(); - } - - //@TODO: Decide on saturate for t (old math lib did it...) - - public static quaternion slerp(quaternion lhs, quaternion rhs, float t) - { - throw new System.NotImplementedException(); - } - - public static quaternion lerp(quaternion lhs, quaternion rhs, float t) - { - throw new System.NotImplementedException(); - // var res = math.normalize(lhs.value + t * (math.chgsign(rhs.value, math.dot(lhs.value, rhs.value)) - rhs.value)); - // return new quaternion(res); - } - - public static float3 forward(quaternion q) - { - return mul(q, new float3(0, 0, 1)); - } - - public static float3 up(quaternion q) - { - return mul(q, new float3(0, 1, 0)); - } - - public static quaternion lookRotationToQuaternion(float3 direction, float3 up) - { - var vector = math_experimental.normalizeSafe(direction); - var vector2 = cross(up, vector); - var vector3 = cross(vector,vector2); - var m00 = vector2.x; - var m01 = vector2.y; - var m02 = vector2.z; - var m10 = vector3.x; - var m11 = vector3.y; - var m12 = vector3.z; - var m20 = vector.x; - var m21 = vector.y; - var m22 = vector.z; - var num8 = (m00 + m11) + m22; - float4 q; - if (num8 > 0.0) - { - var num = sqrt(num8 + 1.0f); - q.w = num * 0.5f; - num = 0.5f / num; - q.x = (m12 - m21) * num; - q.y = (m20 - m02) * num; - q.z = (m01 - m10) * num; - return new quaternion(q); - } - if ((m00 >= m11) && (m00 >= m22)) - { - var num7 = sqrt(((1.0f + m00) - m11) - m22); - var num4 = 0.5f / num7; - q.x = 0.5f * num7; - q.y = (m01 + m10) * num4; - q.z = (m02 + m20) * num4; - q.w = (m12 - m21) * num4; - return new quaternion(q); - } - if (m11 > m22) - { - var num6 = sqrt(((1.0f + m11) - m00) - m22); - var num3 = 0.5f / num6; - q.x = (m10 + m01) * num3; - q.y = 0.5f * num6; - q.z = (m21 + m12) * num3; - q.w = (m20 - m02) * num3; - return new quaternion(q); - } - var num5 = sqrt(((1.0f + m22) - m00) - m11); - var num2 = 0.5f / num5; - q.x = (m20 + m02) * num2; - q.y = (m21 + m12) * num2; - q.z = 0.5f * num5; - q.w = (m01 - m10) * num2; - return new quaternion(q); - } - } -} diff --git a/src/Unity.Mathematics/mathquat.cs.meta b/src/Unity.Mathematics/mathquat.cs.meta deleted file mode 100644 index e32d2669..00000000 --- a/src/Unity.Mathematics/mathquat.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 4eb76c7d3686c1b49a009e0807c303bc -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/src/Unity.Mathematics/matrix.cs b/src/Unity.Mathematics/matrix.cs index 1caf99eb..449c7e36 100644 --- a/src/Unity.Mathematics/matrix.cs +++ b/src/Unity.Mathematics/matrix.cs @@ -1,226 +1,1115 @@ -namespace Unity.Mathematics +using System.Runtime.CompilerServices; +using static Unity.Mathematics.math; + +namespace Unity.Mathematics { - public partial struct float4x4 + public partial struct float2x2 { - public float4 m0; - public float4 m1; - public float4 m2; - public float4 m3; - - public float4x4(float4 m0, float4 m1, float4 m2, float4 m3) + /// + /// Computes a float2x2 matrix representing a counter-clockwise rotation by an angle in radians. + /// + /// + /// A positive rotation angle will produce a counter-clockwise rotation and a negative rotation angle will + /// produce a clockwise rotation. + /// + /// Rotation angle in radians. + /// Returns the 2x2 rotation matrix. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x2 Rotate(float angle) { - this.m0 = m0; - this.m1 = m1; - this.m2 = m2; - this.m3 = m3; + float s, c; + sincos(angle, out s, out c); + return float2x2(c, -s, + s, c); } - public float4x4(float m00, float m01, float m02, float m03, - float m10, float m11, float m12, float m13, - float m20, float m21, float m22, float m23, - float m30, float m31, float m32, float m33) + /// Returns a float2x2 matrix representing a uniform scaling of both axes by s. + /// The scaling factor. + /// The float2x2 matrix representing uniform scale by s. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x2 Scale(float s) { - this.m0 = new float4(m00, m01, m02, m03); - this.m1 = new float4(m10, m11, m12, m13); - this.m2 = new float4(m20, m21, m22, m23); - this.m3 = new float4(m30, m31, m32, m33); + return float2x2(s, 0.0f, + 0.0f, s); } - public static float4x4 operator *(float4x4 mat, float s) + /// Returns a float2x2 matrix representing a non-uniform axis scaling by x and y. + /// The x-axis scaling factor. + /// The y-axis scaling factor. + /// The float2x2 matrix representing a non-uniform scale. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x2 Scale(float x, float y) { - return new float4x4(mat.m0 * s, mat.m1 * s, mat.m2 * s, mat.m3 * s); + return float2x2(x, 0.0f, + 0.0f, y); } - public static float4x4 identity => new float4x4 + /// Returns a float2x2 matrix representing a non-uniform axis scaling by the components of the float2 vector v. + /// The float2 containing the x and y axis scaling factors. + /// The float2x2 matrix representing a non-uniform scale. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x2 Scale(float2 v) { - m0 = new float4(1.0f, 0.0f, 0.0f, 0.0f), - m1 = new float4(0.0f, 1.0f, 0.0f, 0.0f), - m2 = new float4(0.0f, 0.0f, 1.0f, 0.0f), - m3 = new float4(0.0f, 0.0f, 0.0f, 1.0f) - }; + return Scale(v.x, v.y); + } } - public partial struct float2x2 + public partial struct float3x3 { - public float2 m0; - public float2 m1; + /// + /// Constructs a float3x3 from the upper left 3x3 of a float4x4. + /// + /// to extract a float3x3 from. + public float3x3(float4x4 f4x4) + { + c0 = f4x4.c0.xyz; + c1 = f4x4.c1.xyz; + c2 = f4x4.c2.xyz; + } - public float2x2(float2 m0, float2 m1) + /// Constructs a float3x3 matrix from a unit quaternion. + /// The quaternion rotation. + public float3x3(quaternion q) { - this.m0 = m0; - this.m1 = m1; + float4 v = q.value; + float4 v2 = v + v; + + uint3 npn = uint3(0x80000000, 0x00000000, 0x80000000); + uint3 nnp = uint3(0x80000000, 0x80000000, 0x00000000); + uint3 pnn = uint3(0x00000000, 0x80000000, 0x80000000); + c0 = v2.y * asfloat(asuint(v.yxw) ^ npn) - v2.z * asfloat(asuint(v.zwx) ^ pnn) + float3(1, 0, 0); + c1 = v2.z * asfloat(asuint(v.wzy) ^ nnp) - v2.x * asfloat(asuint(v.yxw) ^ npn) + float3(0, 1, 0); + c2 = v2.x * asfloat(asuint(v.zwx) ^ pnn) - v2.y * asfloat(asuint(v.wzy) ^ nnp) + float3(0, 0, 1); } - public float2x2(float m00, float m01, - float m10, float m11) + /// + /// Returns a float3x3 matrix representing a rotation around a unit axis by an angle in radians. + /// The rotation direction is clockwise when looking along the rotation axis towards the origin. + /// + /// The rotation axis. + /// The angle of rotation in radians. + /// The float3x3 matrix representing the rotation around an axis. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 AxisAngle(float3 axis, float angle) { - this.m0 = new float2(m00, m01); - this.m1 = new float2(m10, m11); + float sina, cosa; + math.sincos(angle, out sina, out cosa); + + float3 u = axis; + float3 u_yzx = u.yzx; + float3 u_zxy = u.zxy; + float3 u_inv_cosa = u - u * cosa; // u * (1.0f - cosa); + float4 t = float4(u * sina, cosa); + + uint3 ppn = uint3(0x00000000, 0x00000000, 0x80000000); + uint3 npp = uint3(0x80000000, 0x00000000, 0x00000000); + uint3 pnp = uint3(0x00000000, 0x80000000, 0x00000000); + + return float3x3( + u.x * u_inv_cosa + asfloat(asuint(t.wzy) ^ ppn), + u.y * u_inv_cosa + asfloat(asuint(t.zwx) ^ npp), + u.z * u_inv_cosa + asfloat(asuint(t.yxw) ^ pnp) + ); + /* + return float3x3( + cosa + u.x * u.x * (1.0f - cosa), u.y * u.x * (1.0f - cosa) - u.z * sina, u.z * u.x * (1.0f - cosa) + u.y * sina, + u.x * u.y * (1.0f - cosa) + u.z * sina, cosa + u.y * u.y * (1.0f - cosa), u.y * u.z * (1.0f - cosa) - u.x * sina, + u.x * u.z * (1.0f - cosa) - u.y * sina, u.y * u.z * (1.0f - cosa) + u.x * sina, cosa + u.z * u.z * (1.0f - cosa) + ); + */ } - public static float2x2 operator *(float2x2 mat, float s) + /// + /// Returns a float3x3 rotation matrix constructed by first performing a rotation around the x-axis, then the y-axis and finally the z-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// A float3 vector containing the rotation angles around the x-, y- and z-axis measures in radians. + /// The float3x3 rotation matrix representing the rotation by Euler angles in x-y-z order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 EulerXYZ(float3 xyz) { - return new float2x2(mat.m0 * s, mat.m1 * s); + // return mul(rotateZ(xyz.z), mul(rotateY(xyz.y), rotateX(xyz.x))); + float3 s, c; + sincos(xyz, out s, out c); + return float3x3( + c.y * c.z, c.z * s.x * s.y - c.x * s.z, c.x * c.z * s.y + s.x * s.z, + c.y * s.z, c.x * c.z + s.x * s.y * s.z, c.x * s.y * s.z - c.z * s.x, + -s.y, c.y * s.x, c.x * c.y + ); } - } - public partial struct float3x3 - { - public float3 m0; - public float3 m1; - public float3 m2; + /// + /// Returns a float3x3 rotation matrix constructed by first performing a rotation around the x-axis, then the z-axis and finally the y-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// A float3 vector containing the rotation angles around the x-, y- and z-axis measures in radians. + /// The float3x3 rotation matrix representing the rotation by Euler angles in x-z-y order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 EulerXZY(float3 xyz) + { + // return mul(rotateY(xyz.y), mul(rotateZ(xyz.z), rotateX(xyz.x))); } + float3 s, c; + sincos(xyz, out s, out c); + return float3x3( + c.y * c.z, s.x * s.y - c.x * c.y * s.z, c.x * s.y + c.y * s.x * s.z, + s.z, c.x * c.z, -c.z * s.x, + -c.z * s.y, c.y * s.x + c.x * s.y * s.z, c.x * c.y - s.x * s.y * s.z + ); + } + + /// + /// Returns a float3x3 rotation matrix constructed by first performing a rotation around the y-axis, then the x-axis and finally the z-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// A float3 vector containing the rotation angles around the x-, y- and z-axis measures in radians. + /// The float3x3 rotation matrix representing the rotation by Euler angles in y-x-z order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 EulerYXZ(float3 xyz) + { + // return mul(rotateZ(xyz.z), mul(rotateX(xyz.x), rotateY(xyz.y))); + float3 s, c; + sincos(xyz, out s, out c); + return float3x3( + c.y * c.z - s.x * s.y * s.z, -c.x * s.z, c.z * s.y + c.y * s.x * s.z, + c.z * s.x * s.y + c.y * s.z, c.x * c.z, s.y * s.z - c.y * c.z * s.x, + -c.x * s.y, s.x, c.x * c.y + ); + } - public float3x3(float3 m0, float3 m1, float3 m2) + /// + /// Returns a float3x3 rotation matrix constructed by first performing a rotation around the y-axis, then the z-axis and finally the x-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// A float3 vector containing the rotation angles around the x-, y- and z-axis measures in radians. + /// The float3x3 rotation matrix representing the rotation by Euler angles in y-z-x order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 EulerYZX(float3 xyz) { - this.m0 = m0; - this.m1 = m1; - this.m2 = m2; + // return mul(rotateX(xyz.x), mul(rotateZ(xyz.z), rotateY(xyz.y))); + float3 s, c; + sincos(xyz, out s, out c); + return float3x3( + c.y * c.z, -s.z, c.z * s.y, + s.x * s.y + c.x * c.y * s.z, c.x * c.z, c.x * s.y * s.z - c.y * s.x, + c.y * s.x * s.z - c.x * s.y, c.z * s.x, c.x * c.y + s.x * s.y * s.z + ); } - public float3x3(float m00, float m01, float m02, - float m10, float m11, float m12, - float m20, float m21, float m22) + /// + /// Returns a float3x3 rotation matrix constructed by first performing a rotation around the z-axis, then the x-axis and finally the y-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// This is the default order rotation order in Unity. + /// + /// A float3 vector containing the rotation angles around the x-, y- and z-axis measures in radians. + /// The float3x3 rotation matrix representing the rotation by Euler angles in z-x-y order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 EulerZXY(float3 xyz) { - this.m0 = new float3(m00, m01, m02); - this.m1 = new float3(m10, m11, m12); - this.m2 = new float3(m20, m21, m22); + // return mul(rotateY(xyz.y), mul(rotateX(xyz.x), rotateZ(xyz.z))); + float3 s, c; + sincos(xyz, out s, out c); + return float3x3( + c.y * c.z + s.x * s.y * s.z, c.z * s.x * s.y - c.y * s.z, c.x * s.y, + c.x * s.z, c.x * c.z, -s.x, + c.y * s.x * s.z - c.z * s.y, c.y * c.z * s.x + s.y * s.z, c.x * c.y + ); } - public static float3x3 operator *(float3x3 mat, float s) + /// + /// Returns a float3x3 rotation matrix constructed by first performing a rotation around the z-axis, then the y-axis and finally the x-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// A float3 vector containing the rotation angles around the x-, y- and z-axis measures in radians. + /// The float3x3 rotation matrix representing the rotation by Euler angles in z-y-x order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 EulerZYX(float3 xyz) { - return new float3x3(mat.m0 * s, mat.m1 * s, mat.m2 * s); + // return mul(rotateX(xyz.x), mul(rotateY(xyz.y), rotateZ(xyz.z))); + float3 s, c; + sincos(xyz, out s, out c); + return float3x3( + c.y * c.z, -c.y * s.z, s.y, + c.z * s.x * s.y + c.x * s.z, c.x * c.z - s.x * s.y * s.z, -c.y * s.x, + s.x * s.z - c.x * c.z * s.y, c.z * s.x + c.x * s.y * s.z, c.x * c.y + ); } + + /// + /// Returns a float3x3 rotation matrix constructed by first performing a rotation around the x-axis, then the y-axis and finally the z-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// The rotation angle around the x-axis in radians. + /// The rotation angle around the y-axis in radians. + /// The rotation angle around the z-axis in radians. + /// The float3x3 rotation matrix representing the rotation by Euler angles in x-y-z order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 EulerXYZ(float x, float y, float z) { return EulerXYZ(float3(x, y, z)); } + + /// + /// Returns a float3x3 rotation matrix constructed by first performing a rotation around the x-axis, then the z-axis and finally the y-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// The rotation angle around the x-axis in radians. + /// The rotation angle around the y-axis in radians. + /// The rotation angle around the z-axis in radians. + /// The float3x3 rotation matrix representing the rotation by Euler angles in x-z-y order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 EulerXZY(float x, float y, float z) { return EulerXZY(float3(x, y, z)); } + + /// + /// Returns a float3x3 rotation matrix constructed by first performing a rotation around the y-axis, then the x-axis and finally the z-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// The rotation angle around the x-axis in radians. + /// The rotation angle around the y-axis in radians. + /// The rotation angle around the z-axis in radians. + /// The float3x3 rotation matrix representing the rotation by Euler angles in y-x-z order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 EulerYXZ(float x, float y, float z) { return EulerYXZ(float3(x, y, z)); } + + /// + /// Returns a float3x3 rotation matrix constructed by first performing a rotation around the y-axis, then the z-axis and finally the x-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// The rotation angle around the x-axis in radians. + /// The rotation angle around the y-axis in radians. + /// The rotation angle around the z-axis in radians. + /// The float3x3 rotation matrix representing the rotation by Euler angles in y-z-x order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 EulerYZX(float x, float y, float z) { return EulerYZX(float3(x, y, z)); } + + /// + /// Returns a float3x3 rotation matrix constructed by first performing a rotation around the z-axis, then the x-axis and finally the y-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// This is the default order rotation order in Unity. + /// + /// The rotation angle around the x-axis in radians. + /// The rotation angle around the y-axis in radians. + /// The rotation angle around the z-axis in radians. + /// The float3x3 rotation matrix representing the rotation by Euler angles in z-x-y order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 EulerZXY(float x, float y, float z) { return EulerZXY(float3(x, y, z)); } + + /// + /// Returns a float3x3 rotation matrix constructed by first performing a rotation around the z-axis, then the y-axis and finally the x-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// The rotation angle around the x-axis in radians. + /// The rotation angle around the y-axis in radians. + /// The rotation angle around the z-axis in radians. + /// The float3x3 rotation matrix representing the rotation by Euler angles in z-y-x order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 EulerZYX(float x, float y, float z) { return EulerZYX(float3(x, y, z)); } + + /// + /// Returns a float3x3 rotation matrix constructed by first performing 3 rotations around the principal axes in a given order. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// When the rotation order is known at compile time, it is recommended for performance reasons to use specific + /// Euler rotation constructors such as EulerZXY(...). + /// + /// A float3 vector containing the rotation angles around the x-, y- and z-axis measures in radians. + /// The order in which the rotations are applied. + /// The float3x3 rotation matrix representing the rotation by Euler angles in the given order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 Euler(float3 xyz, RotationOrder order = RotationOrder.Default) + { + switch (order) + { + case RotationOrder.XYZ: + return EulerXYZ(xyz); + case RotationOrder.XZY: + return EulerXZY(xyz); + case RotationOrder.YXZ: + return EulerYXZ(xyz); + case RotationOrder.YZX: + return EulerYZX(xyz); + case RotationOrder.ZXY: + return EulerZXY(xyz); + case RotationOrder.ZYX: + return EulerZYX(xyz); + default: + return float3x3.identity; + } + } + + /// + /// Returns a float3x3 rotation matrix constructed by first performing 3 rotations around the principal axes in a given order. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// When the rotation order is known at compile time, it is recommended for performance reasons to use specific + /// Euler rotation constructors such as EulerZXY(...). + /// + /// The rotation angle around the x-axis in radians. + /// The rotation angle around the y-axis in radians. + /// The rotation angle around the z-axis in radians. + /// The order in which the rotations are applied. + /// The float3x3 rotation matrix representing the rotation by Euler angles in the given order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 Euler(float x, float y, float z, RotationOrder order = RotationOrder.Default) + { + return Euler(float3(x, y, z), order); + } + + /// Returns a float3x3 matrix that rotates around the x-axis by a given number of radians. + /// The clockwise rotation angle when looking along the x-axis towards the origin in radians. + /// The float3x3 rotation matrix representing a rotation around the x-axis. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 RotateX(float angle) + { + // {{1, 0, 0}, {0, c_0, -s_0}, {0, s_0, c_0}} + float s, c; + sincos(angle, out s, out c); + return float3x3(1.0f, 0.0f, 0.0f, + 0.0f, c, -s, + 0.0f, s, c); + } + + /// Returns a float3x3 matrix that rotates around the y-axis by a given number of radians. + /// The clockwise rotation angle when looking along the y-axis towards the origin in radians. + /// The float3x3 rotation matrix representing a rotation around the y-axis. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 RotateY(float angle) + { + // {{c_1, 0, s_1}, {0, 1, 0}, {-s_1, 0, c_1}} + float s, c; + sincos(angle, out s, out c); + return float3x3(c, 0.0f, s, + 0.0f, 1.0f, 0.0f, + -s, 0.0f, c); + } + + /// Returns a float3x3 matrix that rotates around the z-axis by a given number of radians. + /// The clockwise rotation angle when looking along the z-axis towards the origin in radians. + /// The float3x3 rotation matrix representing a rotation around the z-axis. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 RotateZ(float angle) + { + // {{c_2, -s_2, 0}, {s_2, c_2, 0}, {0, 0, 1}} + float s, c; + sincos(angle, out s, out c); + return float3x3(c, -s, 0.0f, + s, c, 0.0f, + 0.0f, 0.0f, 1.0f); + } + + /// Returns a float3x3 matrix representing a uniform scaling of all axes by s. + /// The uniform scaling factor. + /// The float3x3 matrix representing a uniform scale. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 Scale(float s) + { + return float3x3(s, 0.0f, 0.0f, + 0.0f, s, 0.0f, + 0.0f, 0.0f, s); + } + + /// Returns a float3x3 matrix representing a non-uniform axis scaling by x, y and z. + /// The x-axis scaling factor. + /// The y-axis scaling factor. + /// The z-axis scaling factor. + /// The float3x3 rotation matrix representing a non-uniform scale. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 Scale(float x, float y, float z) + { + return float3x3(x, 0.0f, 0.0f, + 0.0f, y, 0.0f, + 0.0f, 0.0f, z); + } + + /// Returns a float3x3 matrix representing a non-uniform axis scaling by the components of the float3 vector v. + /// The vector containing non-uniform scaling factors. + /// The float3x3 rotation matrix representing a non-uniform scale. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 Scale(float3 v) + { + return Scale(v.x, v.y, v.z); + } + + /// + /// Returns a float3x3 view rotation matrix given a unit length forward vector and a unit length up vector. + /// The two input vectors are assumed to be unit length and not collinear. + /// If these assumptions are not met use float3x3.LookRotationSafe instead. + /// + /// The forward vector to align the center of view with. + /// The up vector to point top of view toward. + /// The float3x3 view rotation matrix. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 LookRotation(float3 forward, float3 up) + { + float3 t = normalize(cross(up, forward)); + return float3x3(t, cross(forward, t), forward); + } + + /// + /// Returns a float3x3 view rotation matrix given a forward vector and an up vector. + /// The two input vectors are not assumed to be unit length. + /// If the magnitude of either of the vectors is so extreme that the calculation cannot be carried out reliably or the vectors are collinear, + /// the identity will be returned instead. + /// + /// The forward vector to align the center of view with. + /// The up vector to point top of view toward. + /// The float3x3 view rotation matrix or the identity matrix. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 LookRotationSafe(float3 forward, float3 up) + { + float forwardLengthSq = dot(forward, forward); + float upLengthSq = dot(up, up); + + forward *= rsqrt(forwardLengthSq); + up *= rsqrt(upLengthSq); + + float3 t = cross(up, forward); + float tLengthSq = dot(t, t); + t *= rsqrt(tLengthSq); + + float mn = min(min(forwardLengthSq, upLengthSq), tLengthSq); + float mx = max(max(forwardLengthSq, upLengthSq), tLengthSq); + + bool accept = mn > 1e-35f && mx < 1e35f && isfinite(forwardLengthSq) && isfinite(upLengthSq) && isfinite(tLengthSq); + return float3x3( + select(float3(1,0,0), t, accept), + select(float3(0,1,0), cross(forward, t), accept), + select(float3(0,0,1), forward, accept)); + } + + /// + /// Converts a float4x4 to a float3x3. + /// + /// The float4x4 to convert to a float3x3. + /// The float3x3 constructed from the upper left 3x3 of the input float4x4 matrix. + public static explicit operator float3x3(float4x4 f4x4) => new float3x3(f4x4); } - partial class math + public partial struct float4x4 { - public static float4 mul(float4x4 x, float4 v) + /// Constructs a float4x4 from a float3x3 rotation matrix and a float3 translation vector. + /// The float3x3 rotation matrix. + /// The translation vector. + public float4x4(float3x3 rotation, float3 translation) { - return mad(x.m0, v.x, x.m1 * v.y) + mad(x.m2, v.z, x.m3 * v.w); + c0 = float4(rotation.c0, 0.0f); + c1 = float4(rotation.c1, 0.0f); + c2 = float4(rotation.c2, 0.0f); + c3 = float4(translation, 1.0f); } - public static float4x4 mul(float4x4 a, float4x4 b) + /// Constructs a float4x4 from a quaternion and a float3 translation vector. + /// The quaternion rotation. + /// The translation vector. + public float4x4(quaternion rotation, float3 translation) { - return new float4x4(mul(a, b.m0), mul(a, b.m1), mul(a, b.m2), mul(a, b.m3)); + float3x3 rot = float3x3(rotation); + c0 = float4(rot.c0, 0.0f); + c1 = float4(rot.c1, 0.0f); + c2 = float4(rot.c2, 0.0f); + c3 = float4(translation, 1.0f); } - public static float2 mul(float2x2 x, float2 v) + /// Constructs a float4x4 from a RigidTransform. + /// The RigidTransform. + public float4x4(RigidTransform transform) { - return mad(x.m0, v.x, x.m1 * v.y); + float3x3 rot = float3x3(transform.rot); + c0 = float4(rot.c0, 0.0f); + c1 = float4(rot.c1, 0.0f); + c2 = float4(rot.c2, 0.0f); + c3 = float4(transform.pos, 1.0f); } - public static float2x2 mul(float2x2 a, float2x2 b) + /// + /// Returns a float4x4 matrix representing a rotation around a unit axis by an angle in radians. + /// The rotation direction is clockwise when looking along the rotation axis towards the origin. + /// + /// The axis of rotation. + /// The angle of rotation in radians. + /// The float4x4 matrix representing the rotation about an axis. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 AxisAngle(float3 axis, float angle) { - return new float2x2(mul(a, b.m0), mul(a, b.m1)); + float sina, cosa; + math.sincos(angle, out sina, out cosa); + + float4 u = float4(axis, 0.0f); + float4 u_yzx = u.yzxx; + float4 u_zxy = u.zxyx; + float4 u_inv_cosa = u - u * cosa; // u * (1.0f - cosa); + float4 t = float4(u.xyz * sina, cosa); + + uint4 ppnp = uint4(0x00000000, 0x00000000, 0x80000000, 0x00000000); + uint4 nppp = uint4(0x80000000, 0x00000000, 0x00000000, 0x00000000); + uint4 pnpp = uint4(0x00000000, 0x80000000, 0x00000000, 0x00000000); + uint4 mask = uint4(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000); + + return float4x4( + u.x * u_inv_cosa + asfloat((asuint(t.wzyx) ^ ppnp) & mask), + u.y * u_inv_cosa + asfloat((asuint(t.zwxx) ^ nppp) & mask), + u.z * u_inv_cosa + asfloat((asuint(t.yxwx) ^ pnpp) & mask), + float4(0.0f, 0.0f, 0.0f, 1.0f) + ); + } - public static float3 mul(float3x3 x, float3 v) + /// + /// Returns a float4x4 rotation matrix constructed by first performing a rotation around the x-axis, then the y-axis and finally the z-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// A float3 vector containing the rotation angles around the x-, y- and z-axis measures in radians. + /// The float4x4 rotation matrix of the Euler angle rotation in x-y-z order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 EulerXYZ(float3 xyz) { - return mad(x.m2, v.z, mad(x.m0, v.x, x.m1 * v.y)); + // return mul(rotateZ(xyz.z), mul(rotateY(xyz.y), rotateX(xyz.x))); + float3 s, c; + sincos(xyz, out s, out c); + return float4x4( + c.y * c.z, c.z * s.x * s.y - c.x * s.z, c.x * c.z * s.y + s.x * s.z, 0.0f, + c.y * s.z, c.x * c.z + s.x * s.y * s.z, c.x * s.y * s.z - c.z * s.x, 0.0f, + -s.y, c.y * s.x, c.x * c.y, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + ); } - public static float3x3 mul(float3x3 a, float3x3 b) + /// + /// Returns a float4x4 rotation matrix constructed by first performing a rotation around the x-axis, then the z-axis and finally the y-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// A float3 vector containing the rotation angles around the x-, y- and z-axis measures in radians. + /// The float4x4 rotation matrix of the Euler angle rotation in x-z-y order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 EulerXZY(float3 xyz) { - return new float3x3(mul(a, b.m0), mul(a, b.m1), mul(a, b.m2)); + // return mul(rotateY(xyz.y), mul(rotateZ(xyz.z), rotateX(xyz.x))); } + float3 s, c; + sincos(xyz, out s, out c); + return float4x4( + c.y * c.z, s.x * s.y - c.x * c.y * s.z, c.x * s.y + c.y * s.x * s.z, 0.0f, + s.z, c.x * c.z, -c.z * s.x, 0.0f, + -c.z * s.y, c.y * s.x + c.x * s.y * s.z, c.x * c.y - s.x * s.y * s.z, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + ); } - public static float3x3 orthogonalize(float3x3 i) + /// + /// Returns a float4x4 rotation matrix constructed by first performing a rotation around the y-axis, then the x-axis and finally the z-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// A float3 vector containing the rotation angles around the x-, y- and z-axis measures in radians. + /// The float4x4 rotation matrix of the Euler angle rotation in y-x-z order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 EulerYXZ(float3 xyz) { - float3x3 o; + // return mul(rotateZ(xyz.z), mul(rotateX(xyz.x), rotateY(xyz.y))); + float3 s, c; + sincos(xyz, out s, out c); + return float4x4( + c.y * c.z - s.x * s.y * s.z, -c.x * s.z, c.z * s.y + c.y * s.x * s.z, 0.0f, + c.z * s.x * s.y + c.y * s.z, c.x * c.z, s.y * s.z - c.y * c.z * s.x, 0.0f, + -c.x * s.y, s.x, c.x * c.y, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + ); + } - float3 u = i.m0; - float3 v = i.m1 - i.m0 * math.dot(i.m1, i.m0); + /// + /// Returns a float4x4 rotation matrix constructed by first performing a rotation around the y-axis, then the z-axis and finally the x-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// A float3 vector containing the rotation angles around the x-, y- and z-axis measures in radians. + /// The float4x4 rotation matrix of the Euler angle rotation in y-z-x order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 EulerYZX(float3 xyz) + { + // return mul(rotateX(xyz.x), mul(rotateZ(xyz.z), rotateY(xyz.y))); + float3 s, c; + sincos(xyz, out s, out c); + return float4x4( + c.y * c.z, -s.z, c.z * s.y, 0.0f, + s.x * s.y + c.x * c.y * s.z, c.x * c.z, c.x * s.y * s.z - c.y * s.x, 0.0f, + c.y * s.x * s.z - c.x * s.y, c.z * s.x, c.x * c.y + s.x * s.y * s.z, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + ); + } - float lenU = math.length(u); - float lenV = math.length(v); + /// + /// Returns a float4x4 rotation matrix constructed by first performing a rotation around the z-axis, then the x-axis and finally the y-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// This is the default order rotation order in Unity. + /// + /// A float3 vector containing the rotation angles around the x-, y- and z-axis measures in radians. + /// The float4x4 rotation matrix of the Euler angle rotation in z-x-y order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 EulerZXY(float3 xyz) + { + // return mul(rotateY(xyz.y), mul(rotateX(xyz.x), rotateZ(xyz.z))); + float3 s, c; + sincos(xyz, out s, out c); + return float4x4( + c.y * c.z + s.x * s.y * s.z, c.z * s.x * s.y - c.y * s.z, c.x * s.y, 0.0f, + c.x * s.z, c.x * c.z, -s.x, 0.0f, + c.y * s.x * s.z - c.z * s.y, c.y * c.z * s.x + s.y * s.z, c.x * c.y, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + ); + } - bool c = lenU > epsilon_normal && lenV > epsilon_normal; + /// + /// Returns a float4x4 rotation matrix constructed by first performing a rotation around the z-axis, then the y-axis and finally the x-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// A float3 vector containing the rotation angles around the x-, y- and z-axis measures in radians. + /// The float4x4 rotation matrix of the Euler angle rotation in z-y-x order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 EulerZYX(float3 xyz) + { + // return mul(rotateX(xyz.x), mul(rotateY(xyz.y), rotateZ(xyz.z))); + float3 s, c; + sincos(xyz, out s, out c); + return float4x4( + c.y * c.z, -c.y * s.z, s.y, 0.0f, + c.z * s.x * s.y + c.x * s.z, c.x * c.z - s.x * s.y * s.z, -c.y * s.x, 0.0f, + s.x * s.z - c.x * c.z * s.y, c.z * s.x + c.x * s.y * s.z, c.x * c.y, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + ); + } - o.m0 = math.select(new float3(1, 0, 0), u / lenU, c); - o.m1 = math.select(new float3(0, 1, 0), v / lenV, c); - o.m2 = math.cross(o.m0, o.m1); + /// + /// Returns a float4x4 rotation matrix constructed by first performing a rotation around the x-axis, then the y-axis and finally the z-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// The rotation angle around the x-axis in radians. + /// The rotation angle around the y-axis in radians. + /// The rotation angle around the z-axis in radians. + /// The float4x4 rotation matrix of the Euler angle rotation in x-y-z order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 EulerXYZ(float x, float y, float z) { return EulerXYZ(float3(x, y, z)); } - return o; + /// + /// Returns a float4x4 rotation matrix constructed by first performing a rotation around the x-axis, then the z-axis and finally the y-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// The rotation angle around the x-axis in radians. + /// The rotation angle around the y-axis in radians. + /// The rotation angle around the z-axis in radians. + /// The float4x4 rotation matrix of the Euler angle rotation in x-z-y order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 EulerXZY(float x, float y, float z) { return EulerXZY(float3(x, y, z)); } + + /// + /// Returns a float4x4 rotation matrix constructed by first performing a rotation around the y-axis, then the x-axis and finally the z-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// The rotation angle around the x-axis in radians. + /// The rotation angle around the y-axis in radians. + /// The rotation angle around the z-axis in radians. + /// The float4x4 rotation matrix of the Euler angle rotation in y-x-z order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 EulerYXZ(float x, float y, float z) { return EulerYXZ(float3(x, y, z)); } + + /// + /// Returns a float4x4 rotation matrix constructed by first performing a rotation around the y-axis, then the z-axis and finally the x-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// The rotation angle around the x-axis in radians. + /// The rotation angle around the y-axis in radians. + /// The rotation angle around the z-axis in radians. + /// The float4x4 rotation matrix of the Euler angle rotation in y-z-x order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 EulerYZX(float x, float y, float z) { return EulerYZX(float3(x, y, z)); } + + /// + /// Returns a float4x4 rotation matrix constructed by first performing a rotation around the z-axis, then the x-axis and finally the y-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// This is the default order rotation order in Unity. + /// + /// The rotation angle around the x-axis in radians. + /// The rotation angle around the y-axis in radians. + /// The rotation angle around the z-axis in radians. + /// The float4x4 rotation matrix of the Euler angle rotation in z-x-y order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 EulerZXY(float x, float y, float z) { return EulerZXY(float3(x, y, z)); } + + /// + /// Returns a float4x4 rotation matrix constructed by first performing a rotation around the z-axis, then the y-axis and finally the x-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// The rotation angle around the x-axis in radians. + /// The rotation angle around the y-axis in radians. + /// The rotation angle around the z-axis in radians. + /// The float4x4 rotation matrix of the Euler angle rotation in z-y-x order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 EulerZYX(float x, float y, float z) { return EulerZYX(float3(x, y, z)); } + + /// + /// Returns a float4x4 constructed by first performing 3 rotations around the principal axes in a given order. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// When the rotation order is known at compile time, it is recommended for performance reasons to use specific + /// Euler rotation constructors such as EulerZXY(...). + /// + /// A float3 vector containing the rotation angles around the x-, y- and z-axis measures in radians. + /// The order in which the rotations are applied. + /// The float4x4 rotation matrix of the Euler angle rotation in given order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 Euler(float3 xyz, RotationOrder order = RotationOrder.Default) + { + switch (order) + { + case RotationOrder.XYZ: + return EulerXYZ(xyz); + case RotationOrder.XZY: + return EulerXZY(xyz); + case RotationOrder.YXZ: + return EulerYXZ(xyz); + case RotationOrder.YZX: + return EulerYZX(xyz); + case RotationOrder.ZXY: + return EulerZXY(xyz); + case RotationOrder.ZYX: + return EulerZYX(xyz); + default: + return float4x4.identity; + } } - public static float2x2 transpose(float2x2 i) { return new float2x2(i.m0.x, i.m1.x, i.m0.y, i.m1.y); } - public static float3x3 transpose(float3x3 i) { return new float3x3(i.m0.x, i.m1.x, i.m2.x, i.m0.y, i.m1.y, i.m2.y, i.m0.z, i.m1.z, i.m2.z); } - public static float4x4 transpose(float4x4 i) { return new float4x4(i.m0.x, i.m1.x, i.m2.x, i.m3.x, i.m0.y, i.m1.y, i.m2.y, i.m3.y, i.m0.z, i.m1.z, i.m2.z, i.m3.z, i.m0.w, i.m1.w, i.m2.w, i.m3.w); } - - public static float4x4 scale(float3 vector) + /// + /// Returns a float4x4 rotation matrix constructed by first performing 3 rotations around the principal axes in a given order. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// When the rotation order is known at compile time, it is recommended for performance reasons to use specific + /// Euler rotation constructors such as EulerZXY(...). + /// + /// The rotation angle around the x-axis in radians. + /// The rotation angle around the y-axis in radians. + /// The rotation angle around the z-axis in radians. + /// The order in which the rotations are applied. + /// The float4x4 rotation matrix of the Euler angle rotation in given order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 Euler(float x, float y, float z, RotationOrder order = RotationOrder.Default) { - float4x4 matrix4x4 = new float4x4(); - matrix4x4.m0 = new float4(vector.x,0.0f,0.0f,0.0f); - matrix4x4.m1 = new float4(0.0f,vector.y,0.0f,0.0f); - matrix4x4.m2 = new float4(0.0f,0.0f,vector.z,0.0f); - matrix4x4.m3 = new float4(0.0f, 0.0f, 0.0f, 1.0f); - return matrix4x4; + return Euler(float3(x, y, z), order); } - public static float4x4 translate(float3 vector) + /// Returns a float4x4 matrix that rotates around the x-axis by a given number of radians. + /// The clockwise rotation angle when looking along the x-axis towards the origin in radians. + /// The float4x4 rotation matrix that rotates around the x-axis. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 RotateX(float angle) { - float4x4 matrix4x4 = new float4x4(); - matrix4x4.m0 = new float4(1.0f, 0.0f, 0.0f, 0.0f); - matrix4x4.m1 = new float4(0.0f, 1.0f, 0.0f, 0.0f); - matrix4x4.m2 = new float4(0.0f, 0.0f, 1.0f, 0.0f); - matrix4x4.m3 = new float4(vector.x, vector.y, vector.z, 1.0f); - return matrix4x4; - } + // {{1, 0, 0}, {0, c_0, -s_0}, {0, s_0, c_0}} + float s, c; + sincos(angle, out s, out c); + return float4x4(1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, c, -s, 0.0f, + 0.0f, s, c, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); - const float epsilon = 0.000001F; + } - public static float3x3 identity3 + /// Returns a float4x4 matrix that rotates around the y-axis by a given number of radians. + /// The clockwise rotation angle when looking along the y-axis towards the origin in radians. + /// The float4x4 rotation matrix that rotates around the y-axis. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 RotateY(float angle) { - get { return new float3x3(new float3(1, 0, 0), new float3(0, 1, 0), new float3(0, 0, 1)); } + // {{c_1, 0, s_1}, {0, 1, 0}, {-s_1, 0, c_1}} + float s, c; + sincos(angle, out s, out c); + return float4x4(c, 0.0f, s, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + -s, 0.0f, c, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + } - public static float4x4 identity4 + + /// Returns a float4x4 matrix that rotates around the z-axis by a given number of radians. + /// The clockwise rotation angle when looking along the z-axis towards the origin in radians. + /// The float4x4 rotation matrix that rotates around the z-axis. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 RotateZ(float angle) { - get { return new float4x4(new float4(1, 0, 0, 0), new float4(0, 1, 0, 0), new float4(0, 0, 1, 0), new float4(0, 0, 0, 1)); } + // {{c_2, -s_2, 0}, {s_2, c_2, 0}, {0, 0, 1}} + float s, c; + sincos(angle, out s, out c); + return float4x4(c, -s, 0.0f, 0.0f, + s, c, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + } - public static float4x4 lookRotationToMatrix(float3 position, float3 forward, float3 up) + /// Returns a float4x4 scale matrix given 3 axis scales. + /// The uniform scaling factor. + /// The float4x4 matrix that represents a uniform scale. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 Scale(float s) { - float3x3 rot = lookRotationToMatrix(forward, up); + return float4x4(s, 0.0f, 0.0f, 0.0f, + 0.0f, s, 0.0f, 0.0f, + 0.0f, 0.0f, s, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + } - float4x4 matrix; - matrix.m0 = new float4(rot.m0, 0.0F); - matrix.m1 = new float4(rot.m1, 0.0F); - matrix.m2 = new float4(rot.m2, 0.0F); - matrix.m3 = new float4(position, 1.0F); + /// Returns a float4x4 scale matrix given a float3 vector containing the 3 axis scales. + /// The x-axis scaling factor. + /// The y-axis scaling factor. + /// The z-axis scaling factor. + /// The float4x4 matrix that represents a non-uniform scale. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 Scale(float x, float y, float z) + { + return float4x4(x, 0.0f, 0.0f, 0.0f, + 0.0f, y, 0.0f, 0.0f, + 0.0f, 0.0f, z, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + } + /// Returns a float4x4 scale matrix given a float3 vector containing the 3 axis scales. + /// The vector containing scale factors for each axis. + /// The float4x4 matrix that represents a non-uniform scale. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 Scale(float3 scales) + { + return Scale(scales.x, scales.y, scales.z); + } + + /// Returns a float4x4 translation matrix given a float3 translation vector. + /// The translation vector. + /// The float4x4 translation matrix. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 Translate(float3 vector) + { + return float4x4(float4(1.0f, 0.0f, 0.0f, 0.0f), + float4(0.0f, 1.0f, 0.0f, 0.0f), + float4(0.0f, 0.0f, 1.0f, 0.0f), + float4(vector.x, vector.y, vector.z, 1.0f)); + } + + /// + /// Returns a float4x4 view matrix given an eye position, a target point and a unit length up vector. + /// The up vector is assumed to be unit length, the eye and target points are assumed to be distinct and + /// the vector between them is assumes to be collinear with the up vector. + /// If these assumptions are not met use float4x4.LookRotationSafe instead. + /// + /// The eye position. + /// The view target position. + /// The eye up direction. + /// The float4x4 view matrix. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 LookAt(float3 eye, float3 target, float3 up) + { + float3x3 rot = float3x3.LookRotation(normalize(target - eye), up); + + float4x4 matrix; + matrix.c0 = float4(rot.c0, 0.0F); + matrix.c1 = float4(rot.c1, 0.0F); + matrix.c2 = float4(rot.c2, 0.0F); + matrix.c3 = float4(eye, 1.0F); return matrix; } - public static float3x3 lookRotationToMatrix(float3 forward, float3 up) + /// + /// Returns a float4x4 centered orthographic projection matrix. + /// + /// The width of the view volume. + /// The height of the view volume. + /// The distance to the near plane. + /// The distance to the far plane. + /// The float4x4 centered orthographic projection matrix. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 Ortho(float width, float height, float near, float far) + { + float rcpdx = 1.0f / width; + float rcpdy = 1.0f / height; + float rcpdz = 1.0f / (far - near); + + return float4x4( + 2.0f * rcpdx, 0.0f, 0.0f, 0.0f, + 0.0f, 2.0f * rcpdy, 0.0f, 0.0f, + 0.0f, 0.0f, -2.0f * rcpdz, -(far + near) * rcpdz, + 0.0f, 0.0f, 0.0f, 1.0f + ); + } + + /// + /// Returns a float4x4 off-center orthographic projection matrix. + /// + /// The minimum x-coordinate of the view volume. + /// The maximum x-coordinate of the view volume. + /// The minimum y-coordinate of the view volume. + /// The minimum y-coordinate of the view volume. + /// The distance to the near plane. + /// The distance to the far plane. + /// The float4x4 off-center orthographic projection matrix. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 OrthoOffCenter(float left, float right, float bottom, float top, float near, float far) + { + float rcpdx = 1.0f / (right - left); + float rcpdy = 1.0f / (top - bottom); + float rcpdz = 1.0f / (far - near); + + return float4x4( + 2.0f * rcpdx, 0.0f, 0.0f, -(right + left) * rcpdx, + 0.0f, 2.0f * rcpdy, 0.0f, -(top + bottom) * rcpdy, + 0.0f, 0.0f, -2.0f * rcpdz, -(far + near) * rcpdz, + 0.0f, 0.0f, 0.0f, 1.0f + ); + } + + /// + /// Returns a float4x4 perspective projection matrix based on field of view. + /// + /// Vertical Field of view in radians. + /// X:Y aspect ratio. + /// Distance to near plane. Must be greater than zero. + /// Distance to far plane. Must be greater than zero. + /// The float4x4 perspective projection matrix. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 PerspectiveFov(float verticalFov, float aspect, float near, float far) + { + float cotangent = 1.0f / tan(verticalFov * 0.5f); + float rcpdz = 1.0f / (near - far); + + return float4x4( + cotangent / aspect, 0.0f, 0.0f, 0.0f, + 0.0f, cotangent, 0.0f, 0.0f, + 0.0f, 0.0f, (far + near) * rcpdz, 2.0f * near * far * rcpdz, + 0.0f, 0.0f, -1.0f, 0.0f + ); + } + + /// + /// Returns a float4x4 off-center perspective projection matrix. + /// + /// The x-coordinate of the left side of the clipping frustum at the near plane. + /// The x-coordinate of the right side of the clipping frustum at the near plane. + /// The y-coordinate of the bottom side of the clipping frustum at the near plane. + /// The y-coordinate of the top side of the clipping frustum at the near plane. + /// Distance to the near plane. Must be greater than zero. + /// Distance to the far plane. Must be greater than zero. + /// The float4x4 off-center perspective projection matrix. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 PerspectiveOffCenter(float left, float right, float bottom, float top, float near, float far) { - float3 z = forward; - // compute u0 - float mag = math.length(z); - if (mag < epsilon) - return identity3; - z /= mag; + float rcpdz = 1.0f / (near - far); + float rcpWidth = 1.0f / (right - left); + float rcpHeight = 1.0f / (top - bottom); - float3 x = math.cross(up, z); - mag = math.length(x); - if (mag < epsilon) - return identity3; - x /= mag; + return float4x4( + 2.0f * near * rcpWidth, 0.0f, (left + right) * rcpWidth, 0.0f, + 0.0f, 2.0f * near * rcpHeight, (bottom + top) * rcpHeight, 0.0f, + 0.0f, 0.0f, (far + near) * rcpdz, 2.0f * near * far * rcpdz, + 0.0f, 0.0f, -1.0f, 0.0f + ); + } - float3 y = math.cross(z, x); - float yLength = math.length(y); - if (yLength < 0.9F || yLength > 1.1F) - return identity3; + /// + /// Returns a float4x4 matrix representing a combined scale-, rotation- and translation transform. + /// Equivalent to mul(translationTransform, mul(rotationTransform, scaleTransform)). + /// + /// The translation vector. + /// The quaternion rotation. + /// The scaling factors of each axis. + /// The float4x4 matrix representing the translation, rotation, and scale by the inputs. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 TRS(float3 translation, quaternion rotation, float3 scale) + { + float3x3 r = float3x3(rotation); + return float4x4( float4(r.c0 * scale.x, 0.0f), + float4(r.c1 * scale.y, 0.0f), + float4(r.c2 * scale.z, 0.0f), + float4(translation, 1.0f)); + } + } - return new float3x3(x, y, z); + partial class math + { + /// + /// Extracts a float3x3 from the upper left 3x3 of a float4x4. + /// + /// to extract a float3x3 from. + /// Upper left 3x3 matrix as float3x3. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 float3x3(float4x4 f4x4) + { + return new float3x3(f4x4); } - /* @TODO: - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float determinant(float2x2 x) { throw new System.NotImplementedException(); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float determinant(float3x3 x) { throw new System.NotImplementedException(); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static float determinant(float4x4 x) { throw new System.NotImplementedException(); } - */ + /// Returns a float3x3 matrix constructed from a quaternion. + /// The quaternion representing a rotation. + /// The float3x3 constructed from a quaternion. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 float3x3(quaternion rotation) + { + return new float3x3(rotation); + } + + /// Returns a float4x4 constructed from a float3x3 rotation matrix and a float3 translation vector. + /// The float3x3 rotation matrix. + /// The translation vector. + /// The float4x4 constructed from a rotation and translation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 float4x4(float3x3 rotation, float3 translation) + { + return new float4x4(rotation, translation); + } + + /// Returns a float4x4 constructed from a quaternion and a float3 translation vector. + /// The quaternion rotation. + /// The translation vector. + /// The float4x4 constructed from a rotation and translation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 float4x4(quaternion rotation, float3 translation) + { + return new float4x4(rotation, translation); + } + + /// Returns a float4x4 constructed from a RigidTransform. + /// The rigid transformation. + /// The float4x4 constructed from a RigidTransform. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 float4x4(RigidTransform transform) + { + return new float4x4(transform); + } + + /// Returns an orthonormalized version of a float3x3 matrix. + /// The float3x3 to be orthonormalized. + /// The orthonormalized float3x3 matrix. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 orthonormalize(float3x3 i) + { + float3x3 o; + + float3 u = i.c0; + float3 v = i.c1 - i.c0 * math.dot(i.c1, i.c0); + + float lenU = math.length(u); + float lenV = math.length(v); + + bool c = lenU > 1e-30f && lenV > 1e-30f; + + o.c0 = math.select(float3(1, 0, 0), u / lenU, c); + o.c1 = math.select(float3(0, 1, 0), v / lenV, c); + o.c2 = math.cross(o.c0, o.c1); + + return o; + } + + /// + /// Computes the pseudoinverse of a matrix. + /// + /// Matrix to invert. + /// The pseudoinverse of m. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 pseudoinverse(float3x3 m) + { + float scaleSq = 0.333333f * (math.lengthsq(m.c0) + math.lengthsq(m.c1) + math.lengthsq(m.c2)); + if (scaleSq < svd.k_EpsilonNormal) + return Mathematics.float3x3.zero; + + float3 scaleInv = math.rsqrt(scaleSq); + float3x3 ms = mulScale(m, scaleInv); + if (!adjInverse(ms, out float3x3 i, svd.k_EpsilonDeterminant)) + { + i = svd.svdInverse(ms); + } + + return mulScale(i, scaleInv); + } } } diff --git a/src/Unity.Mathematics/matrix.gen.cs b/src/Unity.Mathematics/matrix.gen.cs new file mode 100644 index 00000000..2dce88fe --- /dev/null +++ b/src/Unity.Mathematics/matrix.gen.cs @@ -0,0 +1,2409 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; + +namespace Unity.Mathematics +{ + partial class math + { + /// Returns the float value result of a matrix multiplication between a float value and a float value. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float mul(float a, float b) + { + return a * b; + } + + /// Returns the float value result of a matrix multiplication between a float2 row vector and a float2 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float mul(float2 a, float2 b) + { + return a.x * b.x + a.y * b.y; + } + + /// Returns the float2 row vector result of a matrix multiplication between a float2 row vector and a float2x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 mul(float2 a, float2x2 b) + { + return float2( + a.x * b.c0.x + a.y * b.c0.y, + a.x * b.c1.x + a.y * b.c1.y); + } + + /// Returns the float3 row vector result of a matrix multiplication between a float2 row vector and a float2x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 mul(float2 a, float2x3 b) + { + return float3( + a.x * b.c0.x + a.y * b.c0.y, + a.x * b.c1.x + a.y * b.c1.y, + a.x * b.c2.x + a.y * b.c2.y); + } + + /// Returns the float4 row vector result of a matrix multiplication between a float2 row vector and a float2x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 mul(float2 a, float2x4 b) + { + return float4( + a.x * b.c0.x + a.y * b.c0.y, + a.x * b.c1.x + a.y * b.c1.y, + a.x * b.c2.x + a.y * b.c2.y, + a.x * b.c3.x + a.y * b.c3.y); + } + + /// Returns the float value result of a matrix multiplication between a float3 row vector and a float3 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float mul(float3 a, float3 b) + { + return a.x * b.x + a.y * b.y + a.z * b.z; + } + + /// Returns the float2 row vector result of a matrix multiplication between a float3 row vector and a float3x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 mul(float3 a, float3x2 b) + { + return float2( + a.x * b.c0.x + a.y * b.c0.y + a.z * b.c0.z, + a.x * b.c1.x + a.y * b.c1.y + a.z * b.c1.z); + } + + /// Returns the float3 row vector result of a matrix multiplication between a float3 row vector and a float3x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 mul(float3 a, float3x3 b) + { + return float3( + a.x * b.c0.x + a.y * b.c0.y + a.z * b.c0.z, + a.x * b.c1.x + a.y * b.c1.y + a.z * b.c1.z, + a.x * b.c2.x + a.y * b.c2.y + a.z * b.c2.z); + } + + /// Returns the float4 row vector result of a matrix multiplication between a float3 row vector and a float3x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 mul(float3 a, float3x4 b) + { + return float4( + a.x * b.c0.x + a.y * b.c0.y + a.z * b.c0.z, + a.x * b.c1.x + a.y * b.c1.y + a.z * b.c1.z, + a.x * b.c2.x + a.y * b.c2.y + a.z * b.c2.z, + a.x * b.c3.x + a.y * b.c3.y + a.z * b.c3.z); + } + + /// Returns the float value result of a matrix multiplication between a float4 row vector and a float4 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float mul(float4 a, float4 b) + { + return a.x * b.x + a.y * b.y + a.z * b.z + a.w * b.w; + } + + /// Returns the float2 row vector result of a matrix multiplication between a float4 row vector and a float4x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 mul(float4 a, float4x2 b) + { + return float2( + a.x * b.c0.x + a.y * b.c0.y + a.z * b.c0.z + a.w * b.c0.w, + a.x * b.c1.x + a.y * b.c1.y + a.z * b.c1.z + a.w * b.c1.w); + } + + /// Returns the float3 row vector result of a matrix multiplication between a float4 row vector and a float4x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 mul(float4 a, float4x3 b) + { + return float3( + a.x * b.c0.x + a.y * b.c0.y + a.z * b.c0.z + a.w * b.c0.w, + a.x * b.c1.x + a.y * b.c1.y + a.z * b.c1.z + a.w * b.c1.w, + a.x * b.c2.x + a.y * b.c2.y + a.z * b.c2.z + a.w * b.c2.w); + } + + /// Returns the float4 row vector result of a matrix multiplication between a float4 row vector and a float4x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 mul(float4 a, float4x4 b) + { + return float4( + a.x * b.c0.x + a.y * b.c0.y + a.z * b.c0.z + a.w * b.c0.w, + a.x * b.c1.x + a.y * b.c1.y + a.z * b.c1.z + a.w * b.c1.w, + a.x * b.c2.x + a.y * b.c2.y + a.z * b.c2.z + a.w * b.c2.w, + a.x * b.c3.x + a.y * b.c3.y + a.z * b.c3.z + a.w * b.c3.w); + } + + /// Returns the float2 column vector result of a matrix multiplication between a float2x2 matrix and a float2 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 mul(float2x2 a, float2 b) + { + return a.c0 * b.x + a.c1 * b.y; + } + + /// Returns the float2x2 matrix result of a matrix multiplication between a float2x2 matrix and a float2x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x2 mul(float2x2 a, float2x2 b) + { + return float2x2( + a.c0 * b.c0.x + a.c1 * b.c0.y, + a.c0 * b.c1.x + a.c1 * b.c1.y); + } + + /// Returns the float2x3 matrix result of a matrix multiplication between a float2x2 matrix and a float2x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x3 mul(float2x2 a, float2x3 b) + { + return float2x3( + a.c0 * b.c0.x + a.c1 * b.c0.y, + a.c0 * b.c1.x + a.c1 * b.c1.y, + a.c0 * b.c2.x + a.c1 * b.c2.y); + } + + /// Returns the float2x4 matrix result of a matrix multiplication between a float2x2 matrix and a float2x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x4 mul(float2x2 a, float2x4 b) + { + return float2x4( + a.c0 * b.c0.x + a.c1 * b.c0.y, + a.c0 * b.c1.x + a.c1 * b.c1.y, + a.c0 * b.c2.x + a.c1 * b.c2.y, + a.c0 * b.c3.x + a.c1 * b.c3.y); + } + + /// Returns the float2 column vector result of a matrix multiplication between a float2x3 matrix and a float3 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 mul(float2x3 a, float3 b) + { + return a.c0 * b.x + a.c1 * b.y + a.c2 * b.z; + } + + /// Returns the float2x2 matrix result of a matrix multiplication between a float2x3 matrix and a float3x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x2 mul(float2x3 a, float3x2 b) + { + return float2x2( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z); + } + + /// Returns the float2x3 matrix result of a matrix multiplication between a float2x3 matrix and a float3x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x3 mul(float2x3 a, float3x3 b) + { + return float2x3( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z); + } + + /// Returns the float2x4 matrix result of a matrix multiplication between a float2x3 matrix and a float3x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x4 mul(float2x3 a, float3x4 b) + { + return float2x4( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z, + a.c0 * b.c3.x + a.c1 * b.c3.y + a.c2 * b.c3.z); + } + + /// Returns the float2 column vector result of a matrix multiplication between a float2x4 matrix and a float4 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2 mul(float2x4 a, float4 b) + { + return a.c0 * b.x + a.c1 * b.y + a.c2 * b.z + a.c3 * b.w; + } + + /// Returns the float2x2 matrix result of a matrix multiplication between a float2x4 matrix and a float4x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x2 mul(float2x4 a, float4x2 b) + { + return float2x2( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z + a.c3 * b.c0.w, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z + a.c3 * b.c1.w); + } + + /// Returns the float2x3 matrix result of a matrix multiplication between a float2x4 matrix and a float4x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x3 mul(float2x4 a, float4x3 b) + { + return float2x3( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z + a.c3 * b.c0.w, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z + a.c3 * b.c1.w, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z + a.c3 * b.c2.w); + } + + /// Returns the float2x4 matrix result of a matrix multiplication between a float2x4 matrix and a float4x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float2x4 mul(float2x4 a, float4x4 b) + { + return float2x4( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z + a.c3 * b.c0.w, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z + a.c3 * b.c1.w, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z + a.c3 * b.c2.w, + a.c0 * b.c3.x + a.c1 * b.c3.y + a.c2 * b.c3.z + a.c3 * b.c3.w); + } + + /// Returns the float3 column vector result of a matrix multiplication between a float3x2 matrix and a float2 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 mul(float3x2 a, float2 b) + { + return a.c0 * b.x + a.c1 * b.y; + } + + /// Returns the float3x2 matrix result of a matrix multiplication between a float3x2 matrix and a float2x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x2 mul(float3x2 a, float2x2 b) + { + return float3x2( + a.c0 * b.c0.x + a.c1 * b.c0.y, + a.c0 * b.c1.x + a.c1 * b.c1.y); + } + + /// Returns the float3x3 matrix result of a matrix multiplication between a float3x2 matrix and a float2x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 mul(float3x2 a, float2x3 b) + { + return float3x3( + a.c0 * b.c0.x + a.c1 * b.c0.y, + a.c0 * b.c1.x + a.c1 * b.c1.y, + a.c0 * b.c2.x + a.c1 * b.c2.y); + } + + /// Returns the float3x4 matrix result of a matrix multiplication between a float3x2 matrix and a float2x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x4 mul(float3x2 a, float2x4 b) + { + return float3x4( + a.c0 * b.c0.x + a.c1 * b.c0.y, + a.c0 * b.c1.x + a.c1 * b.c1.y, + a.c0 * b.c2.x + a.c1 * b.c2.y, + a.c0 * b.c3.x + a.c1 * b.c3.y); + } + + /// Returns the float3 column vector result of a matrix multiplication between a float3x3 matrix and a float3 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 mul(float3x3 a, float3 b) + { + return a.c0 * b.x + a.c1 * b.y + a.c2 * b.z; + } + + /// Returns the float3x2 matrix result of a matrix multiplication between a float3x3 matrix and a float3x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x2 mul(float3x3 a, float3x2 b) + { + return float3x2( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z); + } + + /// Returns the float3x3 matrix result of a matrix multiplication between a float3x3 matrix and a float3x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 mul(float3x3 a, float3x3 b) + { + return float3x3( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z); + } + + /// Returns the float3x4 matrix result of a matrix multiplication between a float3x3 matrix and a float3x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x4 mul(float3x3 a, float3x4 b) + { + return float3x4( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z, + a.c0 * b.c3.x + a.c1 * b.c3.y + a.c2 * b.c3.z); + } + + /// Returns the float3 column vector result of a matrix multiplication between a float3x4 matrix and a float4 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 mul(float3x4 a, float4 b) + { + return a.c0 * b.x + a.c1 * b.y + a.c2 * b.z + a.c3 * b.w; + } + + /// Returns the float3x2 matrix result of a matrix multiplication between a float3x4 matrix and a float4x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x2 mul(float3x4 a, float4x2 b) + { + return float3x2( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z + a.c3 * b.c0.w, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z + a.c3 * b.c1.w); + } + + /// Returns the float3x3 matrix result of a matrix multiplication between a float3x4 matrix and a float4x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 mul(float3x4 a, float4x3 b) + { + return float3x3( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z + a.c3 * b.c0.w, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z + a.c3 * b.c1.w, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z + a.c3 * b.c2.w); + } + + /// Returns the float3x4 matrix result of a matrix multiplication between a float3x4 matrix and a float4x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x4 mul(float3x4 a, float4x4 b) + { + return float3x4( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z + a.c3 * b.c0.w, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z + a.c3 * b.c1.w, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z + a.c3 * b.c2.w, + a.c0 * b.c3.x + a.c1 * b.c3.y + a.c2 * b.c3.z + a.c3 * b.c3.w); + } + + /// Returns the float4 column vector result of a matrix multiplication between a float4x2 matrix and a float2 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 mul(float4x2 a, float2 b) + { + return a.c0 * b.x + a.c1 * b.y; + } + + /// Returns the float4x2 matrix result of a matrix multiplication between a float4x2 matrix and a float2x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x2 mul(float4x2 a, float2x2 b) + { + return float4x2( + a.c0 * b.c0.x + a.c1 * b.c0.y, + a.c0 * b.c1.x + a.c1 * b.c1.y); + } + + /// Returns the float4x3 matrix result of a matrix multiplication between a float4x2 matrix and a float2x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x3 mul(float4x2 a, float2x3 b) + { + return float4x3( + a.c0 * b.c0.x + a.c1 * b.c0.y, + a.c0 * b.c1.x + a.c1 * b.c1.y, + a.c0 * b.c2.x + a.c1 * b.c2.y); + } + + /// Returns the float4x4 matrix result of a matrix multiplication between a float4x2 matrix and a float2x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 mul(float4x2 a, float2x4 b) + { + return float4x4( + a.c0 * b.c0.x + a.c1 * b.c0.y, + a.c0 * b.c1.x + a.c1 * b.c1.y, + a.c0 * b.c2.x + a.c1 * b.c2.y, + a.c0 * b.c3.x + a.c1 * b.c3.y); + } + + /// Returns the float4 column vector result of a matrix multiplication between a float4x3 matrix and a float3 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 mul(float4x3 a, float3 b) + { + return a.c0 * b.x + a.c1 * b.y + a.c2 * b.z; + } + + /// Returns the float4x2 matrix result of a matrix multiplication between a float4x3 matrix and a float3x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x2 mul(float4x3 a, float3x2 b) + { + return float4x2( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z); + } + + /// Returns the float4x3 matrix result of a matrix multiplication between a float4x3 matrix and a float3x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x3 mul(float4x3 a, float3x3 b) + { + return float4x3( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z); + } + + /// Returns the float4x4 matrix result of a matrix multiplication between a float4x3 matrix and a float3x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 mul(float4x3 a, float3x4 b) + { + return float4x4( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z, + a.c0 * b.c3.x + a.c1 * b.c3.y + a.c2 * b.c3.z); + } + + /// Returns the float4 column vector result of a matrix multiplication between a float4x4 matrix and a float4 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 mul(float4x4 a, float4 b) + { + return a.c0 * b.x + a.c1 * b.y + a.c2 * b.z + a.c3 * b.w; + } + + /// Returns the float4x2 matrix result of a matrix multiplication between a float4x4 matrix and a float4x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x2 mul(float4x4 a, float4x2 b) + { + return float4x2( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z + a.c3 * b.c0.w, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z + a.c3 * b.c1.w); + } + + /// Returns the float4x3 matrix result of a matrix multiplication between a float4x4 matrix and a float4x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x3 mul(float4x4 a, float4x3 b) + { + return float4x3( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z + a.c3 * b.c0.w, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z + a.c3 * b.c1.w, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z + a.c3 * b.c2.w); + } + + /// Returns the float4x4 matrix result of a matrix multiplication between a float4x4 matrix and a float4x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 mul(float4x4 a, float4x4 b) + { + return float4x4( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z + a.c3 * b.c0.w, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z + a.c3 * b.c1.w, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z + a.c3 * b.c2.w, + a.c0 * b.c3.x + a.c1 * b.c3.y + a.c2 * b.c3.z + a.c3 * b.c3.w); + } + + /// Returns the double value result of a matrix multiplication between a double value and a double value. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double mul(double a, double b) + { + return a * b; + } + + /// Returns the double value result of a matrix multiplication between a double2 row vector and a double2 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double mul(double2 a, double2 b) + { + return a.x * b.x + a.y * b.y; + } + + /// Returns the double2 row vector result of a matrix multiplication between a double2 row vector and a double2x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 mul(double2 a, double2x2 b) + { + return double2( + a.x * b.c0.x + a.y * b.c0.y, + a.x * b.c1.x + a.y * b.c1.y); + } + + /// Returns the double3 row vector result of a matrix multiplication between a double2 row vector and a double2x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 mul(double2 a, double2x3 b) + { + return double3( + a.x * b.c0.x + a.y * b.c0.y, + a.x * b.c1.x + a.y * b.c1.y, + a.x * b.c2.x + a.y * b.c2.y); + } + + /// Returns the double4 row vector result of a matrix multiplication between a double2 row vector and a double2x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 mul(double2 a, double2x4 b) + { + return double4( + a.x * b.c0.x + a.y * b.c0.y, + a.x * b.c1.x + a.y * b.c1.y, + a.x * b.c2.x + a.y * b.c2.y, + a.x * b.c3.x + a.y * b.c3.y); + } + + /// Returns the double value result of a matrix multiplication between a double3 row vector and a double3 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double mul(double3 a, double3 b) + { + return a.x * b.x + a.y * b.y + a.z * b.z; + } + + /// Returns the double2 row vector result of a matrix multiplication between a double3 row vector and a double3x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 mul(double3 a, double3x2 b) + { + return double2( + a.x * b.c0.x + a.y * b.c0.y + a.z * b.c0.z, + a.x * b.c1.x + a.y * b.c1.y + a.z * b.c1.z); + } + + /// Returns the double3 row vector result of a matrix multiplication between a double3 row vector and a double3x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 mul(double3 a, double3x3 b) + { + return double3( + a.x * b.c0.x + a.y * b.c0.y + a.z * b.c0.z, + a.x * b.c1.x + a.y * b.c1.y + a.z * b.c1.z, + a.x * b.c2.x + a.y * b.c2.y + a.z * b.c2.z); + } + + /// Returns the double4 row vector result of a matrix multiplication between a double3 row vector and a double3x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 mul(double3 a, double3x4 b) + { + return double4( + a.x * b.c0.x + a.y * b.c0.y + a.z * b.c0.z, + a.x * b.c1.x + a.y * b.c1.y + a.z * b.c1.z, + a.x * b.c2.x + a.y * b.c2.y + a.z * b.c2.z, + a.x * b.c3.x + a.y * b.c3.y + a.z * b.c3.z); + } + + /// Returns the double value result of a matrix multiplication between a double4 row vector and a double4 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double mul(double4 a, double4 b) + { + return a.x * b.x + a.y * b.y + a.z * b.z + a.w * b.w; + } + + /// Returns the double2 row vector result of a matrix multiplication between a double4 row vector and a double4x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 mul(double4 a, double4x2 b) + { + return double2( + a.x * b.c0.x + a.y * b.c0.y + a.z * b.c0.z + a.w * b.c0.w, + a.x * b.c1.x + a.y * b.c1.y + a.z * b.c1.z + a.w * b.c1.w); + } + + /// Returns the double3 row vector result of a matrix multiplication between a double4 row vector and a double4x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 mul(double4 a, double4x3 b) + { + return double3( + a.x * b.c0.x + a.y * b.c0.y + a.z * b.c0.z + a.w * b.c0.w, + a.x * b.c1.x + a.y * b.c1.y + a.z * b.c1.z + a.w * b.c1.w, + a.x * b.c2.x + a.y * b.c2.y + a.z * b.c2.z + a.w * b.c2.w); + } + + /// Returns the double4 row vector result of a matrix multiplication between a double4 row vector and a double4x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 mul(double4 a, double4x4 b) + { + return double4( + a.x * b.c0.x + a.y * b.c0.y + a.z * b.c0.z + a.w * b.c0.w, + a.x * b.c1.x + a.y * b.c1.y + a.z * b.c1.z + a.w * b.c1.w, + a.x * b.c2.x + a.y * b.c2.y + a.z * b.c2.z + a.w * b.c2.w, + a.x * b.c3.x + a.y * b.c3.y + a.z * b.c3.z + a.w * b.c3.w); + } + + /// Returns the double2 column vector result of a matrix multiplication between a double2x2 matrix and a double2 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 mul(double2x2 a, double2 b) + { + return a.c0 * b.x + a.c1 * b.y; + } + + /// Returns the double2x2 matrix result of a matrix multiplication between a double2x2 matrix and a double2x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x2 mul(double2x2 a, double2x2 b) + { + return double2x2( + a.c0 * b.c0.x + a.c1 * b.c0.y, + a.c0 * b.c1.x + a.c1 * b.c1.y); + } + + /// Returns the double2x3 matrix result of a matrix multiplication between a double2x2 matrix and a double2x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x3 mul(double2x2 a, double2x3 b) + { + return double2x3( + a.c0 * b.c0.x + a.c1 * b.c0.y, + a.c0 * b.c1.x + a.c1 * b.c1.y, + a.c0 * b.c2.x + a.c1 * b.c2.y); + } + + /// Returns the double2x4 matrix result of a matrix multiplication between a double2x2 matrix and a double2x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x4 mul(double2x2 a, double2x4 b) + { + return double2x4( + a.c0 * b.c0.x + a.c1 * b.c0.y, + a.c0 * b.c1.x + a.c1 * b.c1.y, + a.c0 * b.c2.x + a.c1 * b.c2.y, + a.c0 * b.c3.x + a.c1 * b.c3.y); + } + + /// Returns the double2 column vector result of a matrix multiplication between a double2x3 matrix and a double3 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 mul(double2x3 a, double3 b) + { + return a.c0 * b.x + a.c1 * b.y + a.c2 * b.z; + } + + /// Returns the double2x2 matrix result of a matrix multiplication between a double2x3 matrix and a double3x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x2 mul(double2x3 a, double3x2 b) + { + return double2x2( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z); + } + + /// Returns the double2x3 matrix result of a matrix multiplication between a double2x3 matrix and a double3x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x3 mul(double2x3 a, double3x3 b) + { + return double2x3( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z); + } + + /// Returns the double2x4 matrix result of a matrix multiplication between a double2x3 matrix and a double3x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x4 mul(double2x3 a, double3x4 b) + { + return double2x4( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z, + a.c0 * b.c3.x + a.c1 * b.c3.y + a.c2 * b.c3.z); + } + + /// Returns the double2 column vector result of a matrix multiplication between a double2x4 matrix and a double4 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2 mul(double2x4 a, double4 b) + { + return a.c0 * b.x + a.c1 * b.y + a.c2 * b.z + a.c3 * b.w; + } + + /// Returns the double2x2 matrix result of a matrix multiplication between a double2x4 matrix and a double4x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x2 mul(double2x4 a, double4x2 b) + { + return double2x2( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z + a.c3 * b.c0.w, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z + a.c3 * b.c1.w); + } + + /// Returns the double2x3 matrix result of a matrix multiplication between a double2x4 matrix and a double4x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x3 mul(double2x4 a, double4x3 b) + { + return double2x3( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z + a.c3 * b.c0.w, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z + a.c3 * b.c1.w, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z + a.c3 * b.c2.w); + } + + /// Returns the double2x4 matrix result of a matrix multiplication between a double2x4 matrix and a double4x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double2x4 mul(double2x4 a, double4x4 b) + { + return double2x4( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z + a.c3 * b.c0.w, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z + a.c3 * b.c1.w, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z + a.c3 * b.c2.w, + a.c0 * b.c3.x + a.c1 * b.c3.y + a.c2 * b.c3.z + a.c3 * b.c3.w); + } + + /// Returns the double3 column vector result of a matrix multiplication between a double3x2 matrix and a double2 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 mul(double3x2 a, double2 b) + { + return a.c0 * b.x + a.c1 * b.y; + } + + /// Returns the double3x2 matrix result of a matrix multiplication between a double3x2 matrix and a double2x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x2 mul(double3x2 a, double2x2 b) + { + return double3x2( + a.c0 * b.c0.x + a.c1 * b.c0.y, + a.c0 * b.c1.x + a.c1 * b.c1.y); + } + + /// Returns the double3x3 matrix result of a matrix multiplication between a double3x2 matrix and a double2x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x3 mul(double3x2 a, double2x3 b) + { + return double3x3( + a.c0 * b.c0.x + a.c1 * b.c0.y, + a.c0 * b.c1.x + a.c1 * b.c1.y, + a.c0 * b.c2.x + a.c1 * b.c2.y); + } + + /// Returns the double3x4 matrix result of a matrix multiplication between a double3x2 matrix and a double2x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x4 mul(double3x2 a, double2x4 b) + { + return double3x4( + a.c0 * b.c0.x + a.c1 * b.c0.y, + a.c0 * b.c1.x + a.c1 * b.c1.y, + a.c0 * b.c2.x + a.c1 * b.c2.y, + a.c0 * b.c3.x + a.c1 * b.c3.y); + } + + /// Returns the double3 column vector result of a matrix multiplication between a double3x3 matrix and a double3 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 mul(double3x3 a, double3 b) + { + return a.c0 * b.x + a.c1 * b.y + a.c2 * b.z; + } + + /// Returns the double3x2 matrix result of a matrix multiplication between a double3x3 matrix and a double3x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x2 mul(double3x3 a, double3x2 b) + { + return double3x2( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z); + } + + /// Returns the double3x3 matrix result of a matrix multiplication between a double3x3 matrix and a double3x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x3 mul(double3x3 a, double3x3 b) + { + return double3x3( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z); + } + + /// Returns the double3x4 matrix result of a matrix multiplication between a double3x3 matrix and a double3x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x4 mul(double3x3 a, double3x4 b) + { + return double3x4( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z, + a.c0 * b.c3.x + a.c1 * b.c3.y + a.c2 * b.c3.z); + } + + /// Returns the double3 column vector result of a matrix multiplication between a double3x4 matrix and a double4 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3 mul(double3x4 a, double4 b) + { + return a.c0 * b.x + a.c1 * b.y + a.c2 * b.z + a.c3 * b.w; + } + + /// Returns the double3x2 matrix result of a matrix multiplication between a double3x4 matrix and a double4x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x2 mul(double3x4 a, double4x2 b) + { + return double3x2( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z + a.c3 * b.c0.w, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z + a.c3 * b.c1.w); + } + + /// Returns the double3x3 matrix result of a matrix multiplication between a double3x4 matrix and a double4x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x3 mul(double3x4 a, double4x3 b) + { + return double3x3( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z + a.c3 * b.c0.w, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z + a.c3 * b.c1.w, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z + a.c3 * b.c2.w); + } + + /// Returns the double3x4 matrix result of a matrix multiplication between a double3x4 matrix and a double4x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double3x4 mul(double3x4 a, double4x4 b) + { + return double3x4( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z + a.c3 * b.c0.w, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z + a.c3 * b.c1.w, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z + a.c3 * b.c2.w, + a.c0 * b.c3.x + a.c1 * b.c3.y + a.c2 * b.c3.z + a.c3 * b.c3.w); + } + + /// Returns the double4 column vector result of a matrix multiplication between a double4x2 matrix and a double2 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 mul(double4x2 a, double2 b) + { + return a.c0 * b.x + a.c1 * b.y; + } + + /// Returns the double4x2 matrix result of a matrix multiplication between a double4x2 matrix and a double2x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x2 mul(double4x2 a, double2x2 b) + { + return double4x2( + a.c0 * b.c0.x + a.c1 * b.c0.y, + a.c0 * b.c1.x + a.c1 * b.c1.y); + } + + /// Returns the double4x3 matrix result of a matrix multiplication between a double4x2 matrix and a double2x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x3 mul(double4x2 a, double2x3 b) + { + return double4x3( + a.c0 * b.c0.x + a.c1 * b.c0.y, + a.c0 * b.c1.x + a.c1 * b.c1.y, + a.c0 * b.c2.x + a.c1 * b.c2.y); + } + + /// Returns the double4x4 matrix result of a matrix multiplication between a double4x2 matrix and a double2x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x4 mul(double4x2 a, double2x4 b) + { + return double4x4( + a.c0 * b.c0.x + a.c1 * b.c0.y, + a.c0 * b.c1.x + a.c1 * b.c1.y, + a.c0 * b.c2.x + a.c1 * b.c2.y, + a.c0 * b.c3.x + a.c1 * b.c3.y); + } + + /// Returns the double4 column vector result of a matrix multiplication between a double4x3 matrix and a double3 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 mul(double4x3 a, double3 b) + { + return a.c0 * b.x + a.c1 * b.y + a.c2 * b.z; + } + + /// Returns the double4x2 matrix result of a matrix multiplication between a double4x3 matrix and a double3x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x2 mul(double4x3 a, double3x2 b) + { + return double4x2( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z); + } + + /// Returns the double4x3 matrix result of a matrix multiplication between a double4x3 matrix and a double3x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x3 mul(double4x3 a, double3x3 b) + { + return double4x3( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z); + } + + /// Returns the double4x4 matrix result of a matrix multiplication between a double4x3 matrix and a double3x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x4 mul(double4x3 a, double3x4 b) + { + return double4x4( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z, + a.c0 * b.c3.x + a.c1 * b.c3.y + a.c2 * b.c3.z); + } + + /// Returns the double4 column vector result of a matrix multiplication between a double4x4 matrix and a double4 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4 mul(double4x4 a, double4 b) + { + return a.c0 * b.x + a.c1 * b.y + a.c2 * b.z + a.c3 * b.w; + } + + /// Returns the double4x2 matrix result of a matrix multiplication between a double4x4 matrix and a double4x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x2 mul(double4x4 a, double4x2 b) + { + return double4x2( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z + a.c3 * b.c0.w, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z + a.c3 * b.c1.w); + } + + /// Returns the double4x3 matrix result of a matrix multiplication between a double4x4 matrix and a double4x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x3 mul(double4x4 a, double4x3 b) + { + return double4x3( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z + a.c3 * b.c0.w, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z + a.c3 * b.c1.w, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z + a.c3 * b.c2.w); + } + + /// Returns the double4x4 matrix result of a matrix multiplication between a double4x4 matrix and a double4x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double4x4 mul(double4x4 a, double4x4 b) + { + return double4x4( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z + a.c3 * b.c0.w, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z + a.c3 * b.c1.w, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z + a.c3 * b.c2.w, + a.c0 * b.c3.x + a.c1 * b.c3.y + a.c2 * b.c3.z + a.c3 * b.c3.w); + } + + /// Returns the int value result of a matrix multiplication between an int value and an int value. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int mul(int a, int b) + { + return a * b; + } + + /// Returns the int value result of a matrix multiplication between an int2 row vector and an int2 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int mul(int2 a, int2 b) + { + return a.x * b.x + a.y * b.y; + } + + /// Returns the int2 row vector result of a matrix multiplication between an int2 row vector and an int2x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 mul(int2 a, int2x2 b) + { + return int2( + a.x * b.c0.x + a.y * b.c0.y, + a.x * b.c1.x + a.y * b.c1.y); + } + + /// Returns the int3 row vector result of a matrix multiplication between an int2 row vector and an int2x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 mul(int2 a, int2x3 b) + { + return int3( + a.x * b.c0.x + a.y * b.c0.y, + a.x * b.c1.x + a.y * b.c1.y, + a.x * b.c2.x + a.y * b.c2.y); + } + + /// Returns the int4 row vector result of a matrix multiplication between an int2 row vector and an int2x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 mul(int2 a, int2x4 b) + { + return int4( + a.x * b.c0.x + a.y * b.c0.y, + a.x * b.c1.x + a.y * b.c1.y, + a.x * b.c2.x + a.y * b.c2.y, + a.x * b.c3.x + a.y * b.c3.y); + } + + /// Returns the int value result of a matrix multiplication between an int3 row vector and an int3 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int mul(int3 a, int3 b) + { + return a.x * b.x + a.y * b.y + a.z * b.z; + } + + /// Returns the int2 row vector result of a matrix multiplication between an int3 row vector and an int3x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 mul(int3 a, int3x2 b) + { + return int2( + a.x * b.c0.x + a.y * b.c0.y + a.z * b.c0.z, + a.x * b.c1.x + a.y * b.c1.y + a.z * b.c1.z); + } + + /// Returns the int3 row vector result of a matrix multiplication between an int3 row vector and an int3x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 mul(int3 a, int3x3 b) + { + return int3( + a.x * b.c0.x + a.y * b.c0.y + a.z * b.c0.z, + a.x * b.c1.x + a.y * b.c1.y + a.z * b.c1.z, + a.x * b.c2.x + a.y * b.c2.y + a.z * b.c2.z); + } + + /// Returns the int4 row vector result of a matrix multiplication between an int3 row vector and an int3x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 mul(int3 a, int3x4 b) + { + return int4( + a.x * b.c0.x + a.y * b.c0.y + a.z * b.c0.z, + a.x * b.c1.x + a.y * b.c1.y + a.z * b.c1.z, + a.x * b.c2.x + a.y * b.c2.y + a.z * b.c2.z, + a.x * b.c3.x + a.y * b.c3.y + a.z * b.c3.z); + } + + /// Returns the int value result of a matrix multiplication between an int4 row vector and an int4 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int mul(int4 a, int4 b) + { + return a.x * b.x + a.y * b.y + a.z * b.z + a.w * b.w; + } + + /// Returns the int2 row vector result of a matrix multiplication between an int4 row vector and an int4x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 mul(int4 a, int4x2 b) + { + return int2( + a.x * b.c0.x + a.y * b.c0.y + a.z * b.c0.z + a.w * b.c0.w, + a.x * b.c1.x + a.y * b.c1.y + a.z * b.c1.z + a.w * b.c1.w); + } + + /// Returns the int3 row vector result of a matrix multiplication between an int4 row vector and an int4x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 mul(int4 a, int4x3 b) + { + return int3( + a.x * b.c0.x + a.y * b.c0.y + a.z * b.c0.z + a.w * b.c0.w, + a.x * b.c1.x + a.y * b.c1.y + a.z * b.c1.z + a.w * b.c1.w, + a.x * b.c2.x + a.y * b.c2.y + a.z * b.c2.z + a.w * b.c2.w); + } + + /// Returns the int4 row vector result of a matrix multiplication between an int4 row vector and an int4x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 mul(int4 a, int4x4 b) + { + return int4( + a.x * b.c0.x + a.y * b.c0.y + a.z * b.c0.z + a.w * b.c0.w, + a.x * b.c1.x + a.y * b.c1.y + a.z * b.c1.z + a.w * b.c1.w, + a.x * b.c2.x + a.y * b.c2.y + a.z * b.c2.z + a.w * b.c2.w, + a.x * b.c3.x + a.y * b.c3.y + a.z * b.c3.z + a.w * b.c3.w); + } + + /// Returns the int2 column vector result of a matrix multiplication between an int2x2 matrix and an int2 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 mul(int2x2 a, int2 b) + { + return a.c0 * b.x + a.c1 * b.y; + } + + /// Returns the int2x2 matrix result of a matrix multiplication between an int2x2 matrix and an int2x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 mul(int2x2 a, int2x2 b) + { + return int2x2( + a.c0 * b.c0.x + a.c1 * b.c0.y, + a.c0 * b.c1.x + a.c1 * b.c1.y); + } + + /// Returns the int2x3 matrix result of a matrix multiplication between an int2x2 matrix and an int2x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 mul(int2x2 a, int2x3 b) + { + return int2x3( + a.c0 * b.c0.x + a.c1 * b.c0.y, + a.c0 * b.c1.x + a.c1 * b.c1.y, + a.c0 * b.c2.x + a.c1 * b.c2.y); + } + + /// Returns the int2x4 matrix result of a matrix multiplication between an int2x2 matrix and an int2x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 mul(int2x2 a, int2x4 b) + { + return int2x4( + a.c0 * b.c0.x + a.c1 * b.c0.y, + a.c0 * b.c1.x + a.c1 * b.c1.y, + a.c0 * b.c2.x + a.c1 * b.c2.y, + a.c0 * b.c3.x + a.c1 * b.c3.y); + } + + /// Returns the int2 column vector result of a matrix multiplication between an int2x3 matrix and an int3 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 mul(int2x3 a, int3 b) + { + return a.c0 * b.x + a.c1 * b.y + a.c2 * b.z; + } + + /// Returns the int2x2 matrix result of a matrix multiplication between an int2x3 matrix and an int3x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 mul(int2x3 a, int3x2 b) + { + return int2x2( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z); + } + + /// Returns the int2x3 matrix result of a matrix multiplication between an int2x3 matrix and an int3x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 mul(int2x3 a, int3x3 b) + { + return int2x3( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z); + } + + /// Returns the int2x4 matrix result of a matrix multiplication between an int2x3 matrix and an int3x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 mul(int2x3 a, int3x4 b) + { + return int2x4( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z, + a.c0 * b.c3.x + a.c1 * b.c3.y + a.c2 * b.c3.z); + } + + /// Returns the int2 column vector result of a matrix multiplication between an int2x4 matrix and an int4 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 mul(int2x4 a, int4 b) + { + return a.c0 * b.x + a.c1 * b.y + a.c2 * b.z + a.c3 * b.w; + } + + /// Returns the int2x2 matrix result of a matrix multiplication between an int2x4 matrix and an int4x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x2 mul(int2x4 a, int4x2 b) + { + return int2x2( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z + a.c3 * b.c0.w, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z + a.c3 * b.c1.w); + } + + /// Returns the int2x3 matrix result of a matrix multiplication between an int2x4 matrix and an int4x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x3 mul(int2x4 a, int4x3 b) + { + return int2x3( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z + a.c3 * b.c0.w, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z + a.c3 * b.c1.w, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z + a.c3 * b.c2.w); + } + + /// Returns the int2x4 matrix result of a matrix multiplication between an int2x4 matrix and an int4x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2x4 mul(int2x4 a, int4x4 b) + { + return int2x4( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z + a.c3 * b.c0.w, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z + a.c3 * b.c1.w, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z + a.c3 * b.c2.w, + a.c0 * b.c3.x + a.c1 * b.c3.y + a.c2 * b.c3.z + a.c3 * b.c3.w); + } + + /// Returns the int3 column vector result of a matrix multiplication between an int3x2 matrix and an int2 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 mul(int3x2 a, int2 b) + { + return a.c0 * b.x + a.c1 * b.y; + } + + /// Returns the int3x2 matrix result of a matrix multiplication between an int3x2 matrix and an int2x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 mul(int3x2 a, int2x2 b) + { + return int3x2( + a.c0 * b.c0.x + a.c1 * b.c0.y, + a.c0 * b.c1.x + a.c1 * b.c1.y); + } + + /// Returns the int3x3 matrix result of a matrix multiplication between an int3x2 matrix and an int2x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 mul(int3x2 a, int2x3 b) + { + return int3x3( + a.c0 * b.c0.x + a.c1 * b.c0.y, + a.c0 * b.c1.x + a.c1 * b.c1.y, + a.c0 * b.c2.x + a.c1 * b.c2.y); + } + + /// Returns the int3x4 matrix result of a matrix multiplication between an int3x2 matrix and an int2x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 mul(int3x2 a, int2x4 b) + { + return int3x4( + a.c0 * b.c0.x + a.c1 * b.c0.y, + a.c0 * b.c1.x + a.c1 * b.c1.y, + a.c0 * b.c2.x + a.c1 * b.c2.y, + a.c0 * b.c3.x + a.c1 * b.c3.y); + } + + /// Returns the int3 column vector result of a matrix multiplication between an int3x3 matrix and an int3 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 mul(int3x3 a, int3 b) + { + return a.c0 * b.x + a.c1 * b.y + a.c2 * b.z; + } + + /// Returns the int3x2 matrix result of a matrix multiplication between an int3x3 matrix and an int3x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 mul(int3x3 a, int3x2 b) + { + return int3x2( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z); + } + + /// Returns the int3x3 matrix result of a matrix multiplication between an int3x3 matrix and an int3x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 mul(int3x3 a, int3x3 b) + { + return int3x3( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z); + } + + /// Returns the int3x4 matrix result of a matrix multiplication between an int3x3 matrix and an int3x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 mul(int3x3 a, int3x4 b) + { + return int3x4( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z, + a.c0 * b.c3.x + a.c1 * b.c3.y + a.c2 * b.c3.z); + } + + /// Returns the int3 column vector result of a matrix multiplication between an int3x4 matrix and an int4 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 mul(int3x4 a, int4 b) + { + return a.c0 * b.x + a.c1 * b.y + a.c2 * b.z + a.c3 * b.w; + } + + /// Returns the int3x2 matrix result of a matrix multiplication between an int3x4 matrix and an int4x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x2 mul(int3x4 a, int4x2 b) + { + return int3x2( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z + a.c3 * b.c0.w, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z + a.c3 * b.c1.w); + } + + /// Returns the int3x3 matrix result of a matrix multiplication between an int3x4 matrix and an int4x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x3 mul(int3x4 a, int4x3 b) + { + return int3x3( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z + a.c3 * b.c0.w, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z + a.c3 * b.c1.w, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z + a.c3 * b.c2.w); + } + + /// Returns the int3x4 matrix result of a matrix multiplication between an int3x4 matrix and an int4x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3x4 mul(int3x4 a, int4x4 b) + { + return int3x4( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z + a.c3 * b.c0.w, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z + a.c3 * b.c1.w, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z + a.c3 * b.c2.w, + a.c0 * b.c3.x + a.c1 * b.c3.y + a.c2 * b.c3.z + a.c3 * b.c3.w); + } + + /// Returns the int4 column vector result of a matrix multiplication between an int4x2 matrix and an int2 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 mul(int4x2 a, int2 b) + { + return a.c0 * b.x + a.c1 * b.y; + } + + /// Returns the int4x2 matrix result of a matrix multiplication between an int4x2 matrix and an int2x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 mul(int4x2 a, int2x2 b) + { + return int4x2( + a.c0 * b.c0.x + a.c1 * b.c0.y, + a.c0 * b.c1.x + a.c1 * b.c1.y); + } + + /// Returns the int4x3 matrix result of a matrix multiplication between an int4x2 matrix and an int2x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 mul(int4x2 a, int2x3 b) + { + return int4x3( + a.c0 * b.c0.x + a.c1 * b.c0.y, + a.c0 * b.c1.x + a.c1 * b.c1.y, + a.c0 * b.c2.x + a.c1 * b.c2.y); + } + + /// Returns the int4x4 matrix result of a matrix multiplication between an int4x2 matrix and an int2x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 mul(int4x2 a, int2x4 b) + { + return int4x4( + a.c0 * b.c0.x + a.c1 * b.c0.y, + a.c0 * b.c1.x + a.c1 * b.c1.y, + a.c0 * b.c2.x + a.c1 * b.c2.y, + a.c0 * b.c3.x + a.c1 * b.c3.y); + } + + /// Returns the int4 column vector result of a matrix multiplication between an int4x3 matrix and an int3 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 mul(int4x3 a, int3 b) + { + return a.c0 * b.x + a.c1 * b.y + a.c2 * b.z; + } + + /// Returns the int4x2 matrix result of a matrix multiplication between an int4x3 matrix and an int3x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 mul(int4x3 a, int3x2 b) + { + return int4x2( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z); + } + + /// Returns the int4x3 matrix result of a matrix multiplication between an int4x3 matrix and an int3x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 mul(int4x3 a, int3x3 b) + { + return int4x3( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z); + } + + /// Returns the int4x4 matrix result of a matrix multiplication between an int4x3 matrix and an int3x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 mul(int4x3 a, int3x4 b) + { + return int4x4( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z, + a.c0 * b.c3.x + a.c1 * b.c3.y + a.c2 * b.c3.z); + } + + /// Returns the int4 column vector result of a matrix multiplication between an int4x4 matrix and an int4 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 mul(int4x4 a, int4 b) + { + return a.c0 * b.x + a.c1 * b.y + a.c2 * b.z + a.c3 * b.w; + } + + /// Returns the int4x2 matrix result of a matrix multiplication between an int4x4 matrix and an int4x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x2 mul(int4x4 a, int4x2 b) + { + return int4x2( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z + a.c3 * b.c0.w, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z + a.c3 * b.c1.w); + } + + /// Returns the int4x3 matrix result of a matrix multiplication between an int4x4 matrix and an int4x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x3 mul(int4x4 a, int4x3 b) + { + return int4x3( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z + a.c3 * b.c0.w, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z + a.c3 * b.c1.w, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z + a.c3 * b.c2.w); + } + + /// Returns the int4x4 matrix result of a matrix multiplication between an int4x4 matrix and an int4x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4x4 mul(int4x4 a, int4x4 b) + { + return int4x4( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z + a.c3 * b.c0.w, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z + a.c3 * b.c1.w, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z + a.c3 * b.c2.w, + a.c0 * b.c3.x + a.c1 * b.c3.y + a.c2 * b.c3.z + a.c3 * b.c3.w); + } + + /// Returns the uint value result of a matrix multiplication between a uint value and a uint value. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint mul(uint a, uint b) + { + return a * b; + } + + /// Returns the uint value result of a matrix multiplication between a uint2 row vector and a uint2 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint mul(uint2 a, uint2 b) + { + return a.x * b.x + a.y * b.y; + } + + /// Returns the uint2 row vector result of a matrix multiplication between a uint2 row vector and a uint2x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 mul(uint2 a, uint2x2 b) + { + return uint2( + a.x * b.c0.x + a.y * b.c0.y, + a.x * b.c1.x + a.y * b.c1.y); + } + + /// Returns the uint3 row vector result of a matrix multiplication between a uint2 row vector and a uint2x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 mul(uint2 a, uint2x3 b) + { + return uint3( + a.x * b.c0.x + a.y * b.c0.y, + a.x * b.c1.x + a.y * b.c1.y, + a.x * b.c2.x + a.y * b.c2.y); + } + + /// Returns the uint4 row vector result of a matrix multiplication between a uint2 row vector and a uint2x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 mul(uint2 a, uint2x4 b) + { + return uint4( + a.x * b.c0.x + a.y * b.c0.y, + a.x * b.c1.x + a.y * b.c1.y, + a.x * b.c2.x + a.y * b.c2.y, + a.x * b.c3.x + a.y * b.c3.y); + } + + /// Returns the uint value result of a matrix multiplication between a uint3 row vector and a uint3 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint mul(uint3 a, uint3 b) + { + return a.x * b.x + a.y * b.y + a.z * b.z; + } + + /// Returns the uint2 row vector result of a matrix multiplication between a uint3 row vector and a uint3x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 mul(uint3 a, uint3x2 b) + { + return uint2( + a.x * b.c0.x + a.y * b.c0.y + a.z * b.c0.z, + a.x * b.c1.x + a.y * b.c1.y + a.z * b.c1.z); + } + + /// Returns the uint3 row vector result of a matrix multiplication between a uint3 row vector and a uint3x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 mul(uint3 a, uint3x3 b) + { + return uint3( + a.x * b.c0.x + a.y * b.c0.y + a.z * b.c0.z, + a.x * b.c1.x + a.y * b.c1.y + a.z * b.c1.z, + a.x * b.c2.x + a.y * b.c2.y + a.z * b.c2.z); + } + + /// Returns the uint4 row vector result of a matrix multiplication between a uint3 row vector and a uint3x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 mul(uint3 a, uint3x4 b) + { + return uint4( + a.x * b.c0.x + a.y * b.c0.y + a.z * b.c0.z, + a.x * b.c1.x + a.y * b.c1.y + a.z * b.c1.z, + a.x * b.c2.x + a.y * b.c2.y + a.z * b.c2.z, + a.x * b.c3.x + a.y * b.c3.y + a.z * b.c3.z); + } + + /// Returns the uint value result of a matrix multiplication between a uint4 row vector and a uint4 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint mul(uint4 a, uint4 b) + { + return a.x * b.x + a.y * b.y + a.z * b.z + a.w * b.w; + } + + /// Returns the uint2 row vector result of a matrix multiplication between a uint4 row vector and a uint4x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 mul(uint4 a, uint4x2 b) + { + return uint2( + a.x * b.c0.x + a.y * b.c0.y + a.z * b.c0.z + a.w * b.c0.w, + a.x * b.c1.x + a.y * b.c1.y + a.z * b.c1.z + a.w * b.c1.w); + } + + /// Returns the uint3 row vector result of a matrix multiplication between a uint4 row vector and a uint4x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 mul(uint4 a, uint4x3 b) + { + return uint3( + a.x * b.c0.x + a.y * b.c0.y + a.z * b.c0.z + a.w * b.c0.w, + a.x * b.c1.x + a.y * b.c1.y + a.z * b.c1.z + a.w * b.c1.w, + a.x * b.c2.x + a.y * b.c2.y + a.z * b.c2.z + a.w * b.c2.w); + } + + /// Returns the uint4 row vector result of a matrix multiplication between a uint4 row vector and a uint4x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 mul(uint4 a, uint4x4 b) + { + return uint4( + a.x * b.c0.x + a.y * b.c0.y + a.z * b.c0.z + a.w * b.c0.w, + a.x * b.c1.x + a.y * b.c1.y + a.z * b.c1.z + a.w * b.c1.w, + a.x * b.c2.x + a.y * b.c2.y + a.z * b.c2.z + a.w * b.c2.w, + a.x * b.c3.x + a.y * b.c3.y + a.z * b.c3.z + a.w * b.c3.w); + } + + /// Returns the uint2 column vector result of a matrix multiplication between a uint2x2 matrix and a uint2 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 mul(uint2x2 a, uint2 b) + { + return a.c0 * b.x + a.c1 * b.y; + } + + /// Returns the uint2x2 matrix result of a matrix multiplication between a uint2x2 matrix and a uint2x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 mul(uint2x2 a, uint2x2 b) + { + return uint2x2( + a.c0 * b.c0.x + a.c1 * b.c0.y, + a.c0 * b.c1.x + a.c1 * b.c1.y); + } + + /// Returns the uint2x3 matrix result of a matrix multiplication between a uint2x2 matrix and a uint2x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 mul(uint2x2 a, uint2x3 b) + { + return uint2x3( + a.c0 * b.c0.x + a.c1 * b.c0.y, + a.c0 * b.c1.x + a.c1 * b.c1.y, + a.c0 * b.c2.x + a.c1 * b.c2.y); + } + + /// Returns the uint2x4 matrix result of a matrix multiplication between a uint2x2 matrix and a uint2x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 mul(uint2x2 a, uint2x4 b) + { + return uint2x4( + a.c0 * b.c0.x + a.c1 * b.c0.y, + a.c0 * b.c1.x + a.c1 * b.c1.y, + a.c0 * b.c2.x + a.c1 * b.c2.y, + a.c0 * b.c3.x + a.c1 * b.c3.y); + } + + /// Returns the uint2 column vector result of a matrix multiplication between a uint2x3 matrix and a uint3 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 mul(uint2x3 a, uint3 b) + { + return a.c0 * b.x + a.c1 * b.y + a.c2 * b.z; + } + + /// Returns the uint2x2 matrix result of a matrix multiplication between a uint2x3 matrix and a uint3x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 mul(uint2x3 a, uint3x2 b) + { + return uint2x2( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z); + } + + /// Returns the uint2x3 matrix result of a matrix multiplication between a uint2x3 matrix and a uint3x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 mul(uint2x3 a, uint3x3 b) + { + return uint2x3( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z); + } + + /// Returns the uint2x4 matrix result of a matrix multiplication between a uint2x3 matrix and a uint3x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 mul(uint2x3 a, uint3x4 b) + { + return uint2x4( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z, + a.c0 * b.c3.x + a.c1 * b.c3.y + a.c2 * b.c3.z); + } + + /// Returns the uint2 column vector result of a matrix multiplication between a uint2x4 matrix and a uint4 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 mul(uint2x4 a, uint4 b) + { + return a.c0 * b.x + a.c1 * b.y + a.c2 * b.z + a.c3 * b.w; + } + + /// Returns the uint2x2 matrix result of a matrix multiplication between a uint2x4 matrix and a uint4x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 mul(uint2x4 a, uint4x2 b) + { + return uint2x2( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z + a.c3 * b.c0.w, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z + a.c3 * b.c1.w); + } + + /// Returns the uint2x3 matrix result of a matrix multiplication between a uint2x4 matrix and a uint4x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 mul(uint2x4 a, uint4x3 b) + { + return uint2x3( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z + a.c3 * b.c0.w, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z + a.c3 * b.c1.w, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z + a.c3 * b.c2.w); + } + + /// Returns the uint2x4 matrix result of a matrix multiplication between a uint2x4 matrix and a uint4x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 mul(uint2x4 a, uint4x4 b) + { + return uint2x4( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z + a.c3 * b.c0.w, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z + a.c3 * b.c1.w, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z + a.c3 * b.c2.w, + a.c0 * b.c3.x + a.c1 * b.c3.y + a.c2 * b.c3.z + a.c3 * b.c3.w); + } + + /// Returns the uint3 column vector result of a matrix multiplication between a uint3x2 matrix and a uint2 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 mul(uint3x2 a, uint2 b) + { + return a.c0 * b.x + a.c1 * b.y; + } + + /// Returns the uint3x2 matrix result of a matrix multiplication between a uint3x2 matrix and a uint2x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 mul(uint3x2 a, uint2x2 b) + { + return uint3x2( + a.c0 * b.c0.x + a.c1 * b.c0.y, + a.c0 * b.c1.x + a.c1 * b.c1.y); + } + + /// Returns the uint3x3 matrix result of a matrix multiplication between a uint3x2 matrix and a uint2x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 mul(uint3x2 a, uint2x3 b) + { + return uint3x3( + a.c0 * b.c0.x + a.c1 * b.c0.y, + a.c0 * b.c1.x + a.c1 * b.c1.y, + a.c0 * b.c2.x + a.c1 * b.c2.y); + } + + /// Returns the uint3x4 matrix result of a matrix multiplication between a uint3x2 matrix and a uint2x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 mul(uint3x2 a, uint2x4 b) + { + return uint3x4( + a.c0 * b.c0.x + a.c1 * b.c0.y, + a.c0 * b.c1.x + a.c1 * b.c1.y, + a.c0 * b.c2.x + a.c1 * b.c2.y, + a.c0 * b.c3.x + a.c1 * b.c3.y); + } + + /// Returns the uint3 column vector result of a matrix multiplication between a uint3x3 matrix and a uint3 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 mul(uint3x3 a, uint3 b) + { + return a.c0 * b.x + a.c1 * b.y + a.c2 * b.z; + } + + /// Returns the uint3x2 matrix result of a matrix multiplication between a uint3x3 matrix and a uint3x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 mul(uint3x3 a, uint3x2 b) + { + return uint3x2( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z); + } + + /// Returns the uint3x3 matrix result of a matrix multiplication between a uint3x3 matrix and a uint3x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 mul(uint3x3 a, uint3x3 b) + { + return uint3x3( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z); + } + + /// Returns the uint3x4 matrix result of a matrix multiplication between a uint3x3 matrix and a uint3x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 mul(uint3x3 a, uint3x4 b) + { + return uint3x4( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z, + a.c0 * b.c3.x + a.c1 * b.c3.y + a.c2 * b.c3.z); + } + + /// Returns the uint3 column vector result of a matrix multiplication between a uint3x4 matrix and a uint4 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 mul(uint3x4 a, uint4 b) + { + return a.c0 * b.x + a.c1 * b.y + a.c2 * b.z + a.c3 * b.w; + } + + /// Returns the uint3x2 matrix result of a matrix multiplication between a uint3x4 matrix and a uint4x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 mul(uint3x4 a, uint4x2 b) + { + return uint3x2( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z + a.c3 * b.c0.w, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z + a.c3 * b.c1.w); + } + + /// Returns the uint3x3 matrix result of a matrix multiplication between a uint3x4 matrix and a uint4x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 mul(uint3x4 a, uint4x3 b) + { + return uint3x3( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z + a.c3 * b.c0.w, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z + a.c3 * b.c1.w, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z + a.c3 * b.c2.w); + } + + /// Returns the uint3x4 matrix result of a matrix multiplication between a uint3x4 matrix and a uint4x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 mul(uint3x4 a, uint4x4 b) + { + return uint3x4( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z + a.c3 * b.c0.w, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z + a.c3 * b.c1.w, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z + a.c3 * b.c2.w, + a.c0 * b.c3.x + a.c1 * b.c3.y + a.c2 * b.c3.z + a.c3 * b.c3.w); + } + + /// Returns the uint4 column vector result of a matrix multiplication between a uint4x2 matrix and a uint2 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 mul(uint4x2 a, uint2 b) + { + return a.c0 * b.x + a.c1 * b.y; + } + + /// Returns the uint4x2 matrix result of a matrix multiplication between a uint4x2 matrix and a uint2x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 mul(uint4x2 a, uint2x2 b) + { + return uint4x2( + a.c0 * b.c0.x + a.c1 * b.c0.y, + a.c0 * b.c1.x + a.c1 * b.c1.y); + } + + /// Returns the uint4x3 matrix result of a matrix multiplication between a uint4x2 matrix and a uint2x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 mul(uint4x2 a, uint2x3 b) + { + return uint4x3( + a.c0 * b.c0.x + a.c1 * b.c0.y, + a.c0 * b.c1.x + a.c1 * b.c1.y, + a.c0 * b.c2.x + a.c1 * b.c2.y); + } + + /// Returns the uint4x4 matrix result of a matrix multiplication between a uint4x2 matrix and a uint2x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 mul(uint4x2 a, uint2x4 b) + { + return uint4x4( + a.c0 * b.c0.x + a.c1 * b.c0.y, + a.c0 * b.c1.x + a.c1 * b.c1.y, + a.c0 * b.c2.x + a.c1 * b.c2.y, + a.c0 * b.c3.x + a.c1 * b.c3.y); + } + + /// Returns the uint4 column vector result of a matrix multiplication between a uint4x3 matrix and a uint3 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 mul(uint4x3 a, uint3 b) + { + return a.c0 * b.x + a.c1 * b.y + a.c2 * b.z; + } + + /// Returns the uint4x2 matrix result of a matrix multiplication between a uint4x3 matrix and a uint3x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 mul(uint4x3 a, uint3x2 b) + { + return uint4x2( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z); + } + + /// Returns the uint4x3 matrix result of a matrix multiplication between a uint4x3 matrix and a uint3x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 mul(uint4x3 a, uint3x3 b) + { + return uint4x3( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z); + } + + /// Returns the uint4x4 matrix result of a matrix multiplication between a uint4x3 matrix and a uint3x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 mul(uint4x3 a, uint3x4 b) + { + return uint4x4( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z, + a.c0 * b.c3.x + a.c1 * b.c3.y + a.c2 * b.c3.z); + } + + /// Returns the uint4 column vector result of a matrix multiplication between a uint4x4 matrix and a uint4 column vector. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 mul(uint4x4 a, uint4 b) + { + return a.c0 * b.x + a.c1 * b.y + a.c2 * b.z + a.c3 * b.w; + } + + /// Returns the uint4x2 matrix result of a matrix multiplication between a uint4x4 matrix and a uint4x2 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 mul(uint4x4 a, uint4x2 b) + { + return uint4x2( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z + a.c3 * b.c0.w, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z + a.c3 * b.c1.w); + } + + /// Returns the uint4x3 matrix result of a matrix multiplication between a uint4x4 matrix and a uint4x3 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 mul(uint4x4 a, uint4x3 b) + { + return uint4x3( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z + a.c3 * b.c0.w, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z + a.c3 * b.c1.w, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z + a.c3 * b.c2.w); + } + + /// Returns the uint4x4 matrix result of a matrix multiplication between a uint4x4 matrix and a uint4x4 matrix. + /// Left hand side argument of the matrix multiply. + /// Right hand side argument of the matrix multiply. + /// The computed matrix multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 mul(uint4x4 a, uint4x4 b) + { + return uint4x4( + a.c0 * b.c0.x + a.c1 * b.c0.y + a.c2 * b.c0.z + a.c3 * b.c0.w, + a.c0 * b.c1.x + a.c1 * b.c1.y + a.c2 * b.c1.z + a.c3 * b.c1.w, + a.c0 * b.c2.x + a.c1 * b.c2.y + a.c2 * b.c2.z + a.c3 * b.c2.w, + a.c0 * b.c3.x + a.c1 * b.c3.y + a.c2 * b.c3.z + a.c3 * b.c3.w); + } + + } +} diff --git a/src/Unity.Mathematics/matrix.gen.cs.meta b/src/Unity.Mathematics/matrix.gen.cs.meta new file mode 100644 index 00000000..4ad76a13 --- /dev/null +++ b/src/Unity.Mathematics/matrix.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d1064bad8f85342fd912d0d27f279601 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/quaternion.cs b/src/Unity.Mathematics/quaternion.cs new file mode 100644 index 00000000..b013fd24 --- /dev/null +++ b/src/Unity.Mathematics/quaternion.cs @@ -0,0 +1,788 @@ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; +using static Unity.Mathematics.math; + +namespace Unity.Mathematics +{ + /// + /// A quaternion type for representing rotations. + /// + [Il2CppEagerStaticClassConstruction] + [Serializable] + public partial struct quaternion : System.IEquatable, IFormattable + { + /// + /// The quaternion component values. + /// + public float4 value; + + /// A quaternion representing the identity transform. + public static readonly quaternion identity = new quaternion(0.0f, 0.0f, 0.0f, 1.0f); + + /// Constructs a quaternion from four float values. + /// The quaternion x component. + /// The quaternion y component. + /// The quaternion z component. + /// The quaternion w component. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public quaternion(float x, float y, float z, float w) { value.x = x; value.y = y; value.z = z; value.w = w; } + + /// Constructs a quaternion from float4 vector. + /// The quaternion xyzw component values. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public quaternion(float4 value) { this.value = value; } + + /// Implicitly converts a float4 vector to a quaternion. + /// The quaternion xyzw component values. + /// The quaternion constructed from a float4 vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator quaternion(float4 v) { return new quaternion(v); } + + /// Constructs a unit quaternion from a float3x3 rotation matrix. The matrix must be orthonormal. + /// The float3x3 orthonormal rotation matrix. + public quaternion(float3x3 m) + { + float3 u = m.c0; + float3 v = m.c1; + float3 w = m.c2; + + uint u_sign = (asuint(u.x) & 0x80000000); + float t = v.y + asfloat(asuint(w.z) ^ u_sign); + uint4 u_mask = uint4((int)u_sign >> 31); + uint4 t_mask = uint4(asint(t) >> 31); + + float tr = 1.0f + abs(u.x); + + uint4 sign_flips = uint4(0x00000000, 0x80000000, 0x80000000, 0x80000000) ^ (u_mask & uint4(0x00000000, 0x80000000, 0x00000000, 0x80000000)) ^ (t_mask & uint4(0x80000000, 0x80000000, 0x80000000, 0x00000000)); + + value = float4(tr, u.y, w.x, v.z) + asfloat(asuint(float4(t, v.x, u.z, w.y)) ^ sign_flips); // +---, +++-, ++-+, +-++ + + value = asfloat((asuint(value) & ~u_mask) | (asuint(value.zwxy) & u_mask)); + value = asfloat((asuint(value.wzyx) & ~t_mask) | (asuint(value) & t_mask)); + value = normalize(value); + } + + /// Constructs a unit quaternion from an orthonormal float4x4 matrix. + /// The float4x4 orthonormal rotation matrix. + public quaternion(float4x4 m) + { + float4 u = m.c0; + float4 v = m.c1; + float4 w = m.c2; + + uint u_sign = (asuint(u.x) & 0x80000000); + float t = v.y + asfloat(asuint(w.z) ^ u_sign); + uint4 u_mask = uint4((int)u_sign >> 31); + uint4 t_mask = uint4(asint(t) >> 31); + + float tr = 1.0f + abs(u.x); + + uint4 sign_flips = uint4(0x00000000, 0x80000000, 0x80000000, 0x80000000) ^ (u_mask & uint4(0x00000000, 0x80000000, 0x00000000, 0x80000000)) ^ (t_mask & uint4(0x80000000, 0x80000000, 0x80000000, 0x00000000)); + + value = float4(tr, u.y, w.x, v.z) + asfloat(asuint(float4(t, v.x, u.z, w.y)) ^ sign_flips); // +---, +++-, ++-+, +-++ + + value = asfloat((asuint(value) & ~u_mask) | (asuint(value.zwxy) & u_mask)); + value = asfloat((asuint(value.wzyx) & ~t_mask) | (asuint(value) & t_mask)); + + value = normalize(value); + } + + /// + /// Returns a quaternion representing a rotation around a unit axis by an angle in radians. + /// The rotation direction is clockwise when looking along the rotation axis towards the origin. + /// + /// The axis of rotation. + /// The angle of rotation in radians. + /// The quaternion representing a rotation around an axis. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static quaternion AxisAngle(float3 axis, float angle) + { + float sina, cosa; + math.sincos(0.5f * angle, out sina, out cosa); + return quaternion(float4(axis * sina, cosa)); + } + + /// + /// Returns a quaternion constructed by first performing a rotation around the x-axis, then the y-axis and finally the z-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// A float3 vector containing the rotation angles around the x-, y- and z-axis measures in radians. + /// The quaternion representing the Euler angle rotation in x-y-z order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static quaternion EulerXYZ(float3 xyz) + { + // return mul(rotateZ(xyz.z), mul(rotateY(xyz.y), rotateX(xyz.x))); + float3 s, c; + sincos(0.5f * xyz, out s, out c); + return quaternion( + // s.x * c.y * c.z - s.y * s.z * c.x, + // s.y * c.x * c.z + s.x * s.z * c.y, + // s.z * c.x * c.y - s.x * s.y * c.z, + // c.x * c.y * c.z + s.y * s.z * s.x + float4(s.xyz, c.x) * c.yxxy * c.zzyz + s.yxxy * s.zzyz * float4(c.xyz, s.x) * float4(-1.0f, 1.0f, -1.0f, 1.0f) + ); + } + + /// + /// Returns a quaternion constructed by first performing a rotation around the x-axis, then the z-axis and finally the y-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// A float3 vector containing the rotation angles around the x-, y- and z-axis measures in radians. + /// The quaternion representing the Euler angle rotation in x-z-y order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static quaternion EulerXZY(float3 xyz) + { + // return mul(rotateY(xyz.y), mul(rotateZ(xyz.z), rotateX(xyz.x))); + float3 s, c; + sincos(0.5f * xyz, out s, out c); + return quaternion( + // s.x * c.y * c.z + s.y * s.z * c.x, + // s.y * c.x * c.z + s.x * s.z * c.y, + // s.z * c.x * c.y - s.x * s.y * c.z, + // c.x * c.y * c.z - s.y * s.z * s.x + float4(s.xyz, c.x) * c.yxxy * c.zzyz + s.yxxy * s.zzyz * float4(c.xyz, s.x) * float4(1.0f, 1.0f, -1.0f, -1.0f) + ); + } + + /// + /// Returns a quaternion constructed by first performing a rotation around the y-axis, then the x-axis and finally the z-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// A float3 vector containing the rotation angles around the x-, y- and z-axis measures in radians. + /// The quaternion representing the Euler angle rotation in y-x-z order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static quaternion EulerYXZ(float3 xyz) + { + // return mul(rotateZ(xyz.z), mul(rotateX(xyz.x), rotateY(xyz.y))); + float3 s, c; + sincos(0.5f * xyz, out s, out c); + return quaternion( + // s.x * c.y * c.z - s.y * s.z * c.x, + // s.y * c.x * c.z + s.x * s.z * c.y, + // s.z * c.x * c.y + s.x * s.y * c.z, + // c.x * c.y * c.z - s.y * s.z * s.x + float4(s.xyz, c.x) * c.yxxy * c.zzyz + s.yxxy * s.zzyz * float4(c.xyz, s.x) * float4(-1.0f, 1.0f, 1.0f, -1.0f) + ); + } + + /// + /// Returns a quaternion constructed by first performing a rotation around the y-axis, then the z-axis and finally the x-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// A float3 vector containing the rotation angles around the x-, y- and z-axis measures in radians. + /// The quaternion representing the Euler angle rotation in y-z-x order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static quaternion EulerYZX(float3 xyz) + { + // return mul(rotateX(xyz.x), mul(rotateZ(xyz.z), rotateY(xyz.y))); + float3 s, c; + sincos(0.5f * xyz, out s, out c); + return quaternion( + // s.x * c.y * c.z - s.y * s.z * c.x, + // s.y * c.x * c.z - s.x * s.z * c.y, + // s.z * c.x * c.y + s.x * s.y * c.z, + // c.x * c.y * c.z + s.y * s.z * s.x + float4(s.xyz, c.x) * c.yxxy * c.zzyz + s.yxxy * s.zzyz * float4(c.xyz, s.x) * float4(-1.0f, -1.0f, 1.0f, 1.0f) + ); + } + + /// + /// Returns a quaternion constructed by first performing a rotation around the z-axis, then the x-axis and finally the y-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// This is the default order rotation order in Unity. + /// + /// A float3 vector containing the rotation angles around the x-, y- and z-axis measures in radians. + /// The quaternion representing the Euler angle rotation in z-x-y order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static quaternion EulerZXY(float3 xyz) + { + // return mul(rotateY(xyz.y), mul(rotateX(xyz.x), rotateZ(xyz.z))); + float3 s, c; + sincos(0.5f * xyz, out s, out c); + return quaternion( + // s.x * c.y * c.z + s.y * s.z * c.x, + // s.y * c.x * c.z - s.x * s.z * c.y, + // s.z * c.x * c.y - s.x * s.y * c.z, + // c.x * c.y * c.z + s.y * s.z * s.x + float4(s.xyz, c.x) * c.yxxy * c.zzyz + s.yxxy * s.zzyz * float4(c.xyz, s.x) * float4(1.0f, -1.0f, -1.0f, 1.0f) + ); + } + + /// + /// Returns a quaternion constructed by first performing a rotation around the z-axis, then the y-axis and finally the x-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// A float3 vector containing the rotation angles around the x-, y- and z-axis measures in radians. + /// The quaternion representing the Euler angle rotation in z-y-x order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static quaternion EulerZYX(float3 xyz) + { + // return mul(rotateX(xyz.x), mul(rotateY(xyz.y), rotateZ(xyz.z))); + float3 s, c; + sincos(0.5f * xyz, out s, out c); + return quaternion( + // s.x * c.y * c.z + s.y * s.z * c.x, + // s.y * c.x * c.z - s.x * s.z * c.y, + // s.z * c.x * c.y + s.x * s.y * c.z, + // c.x * c.y * c.z - s.y * s.x * s.z + float4(s.xyz, c.x) * c.yxxy * c.zzyz + s.yxxy * s.zzyz * float4(c.xyz, s.x) * float4(1.0f, -1.0f, 1.0f, -1.0f) + ); + } + + /// + /// Returns a quaternion constructed by first performing a rotation around the x-axis, then the y-axis and finally the z-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// The rotation angle around the x-axis in radians. + /// The rotation angle around the y-axis in radians. + /// The rotation angle around the z-axis in radians. + /// The quaternion representing the Euler angle rotation in x-y-z order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static quaternion EulerXYZ(float x, float y, float z) { return EulerXYZ(float3(x, y, z)); } + + /// + /// Returns a quaternion constructed by first performing a rotation around the x-axis, then the z-axis and finally the y-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// The rotation angle around the x-axis in radians. + /// The rotation angle around the y-axis in radians. + /// The rotation angle around the z-axis in radians. + /// The quaternion representing the Euler angle rotation in x-z-y order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static quaternion EulerXZY(float x, float y, float z) { return EulerXZY(float3(x, y, z)); } + + /// + /// Returns a quaternion constructed by first performing a rotation around the y-axis, then the x-axis and finally the z-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// The rotation angle around the x-axis in radians. + /// The rotation angle around the y-axis in radians. + /// The rotation angle around the z-axis in radians. + /// The quaternion representing the Euler angle rotation in y-x-z order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static quaternion EulerYXZ(float x, float y, float z) { return EulerYXZ(float3(x, y, z)); } + + /// + /// Returns a quaternion constructed by first performing a rotation around the y-axis, then the z-axis and finally the x-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// The rotation angle around the x-axis in radians. + /// The rotation angle around the y-axis in radians. + /// The rotation angle around the z-axis in radians. + /// The quaternion representing the Euler angle rotation in y-z-x order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static quaternion EulerYZX(float x, float y, float z) { return EulerYZX(float3(x, y, z)); } + + /// + /// Returns a quaternion constructed by first performing a rotation around the z-axis, then the x-axis and finally the y-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// This is the default order rotation order in Unity. + /// + /// The rotation angle around the x-axis in radians. + /// The rotation angle around the y-axis in radians. + /// The rotation angle around the z-axis in radians. + /// The quaternion representing the Euler angle rotation in z-x-y order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static quaternion EulerZXY(float x, float y, float z) { return EulerZXY(float3(x, y, z)); } + + /// + /// Returns a quaternion constructed by first performing a rotation around the z-axis, then the y-axis and finally the x-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// The rotation angle around the x-axis in radians. + /// The rotation angle around the y-axis in radians. + /// The rotation angle around the z-axis in radians. + /// The quaternion representing the Euler angle rotation in z-y-x order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static quaternion EulerZYX(float x, float y, float z) { return EulerZYX(float3(x, y, z)); } + + /// + /// Returns a quaternion constructed by first performing 3 rotations around the principal axes in a given order. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// When the rotation order is known at compile time, it is recommended for performance reasons to use specific + /// Euler rotation constructors such as EulerZXY(...). + /// + /// A float3 vector containing the rotation angles around the x-, y- and z-axis measures in radians. + /// The order in which the rotations are applied. + /// The quaternion representing the Euler angle rotation in the specified order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static quaternion Euler(float3 xyz, RotationOrder order = RotationOrder.ZXY) + { + switch (order) + { + case RotationOrder.XYZ: + return EulerXYZ(xyz); + case RotationOrder.XZY: + return EulerXZY(xyz); + case RotationOrder.YXZ: + return EulerYXZ(xyz); + case RotationOrder.YZX: + return EulerYZX(xyz); + case RotationOrder.ZXY: + return EulerZXY(xyz); + case RotationOrder.ZYX: + return EulerZYX(xyz); + default: + return quaternion.identity; + } + } + + /// + /// Returns a quaternion constructed by first performing 3 rotations around the principal axes in a given order. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// When the rotation order is known at compile time, it is recommended for performance reasons to use specific + /// Euler rotation constructors such as EulerZXY(...). + /// + /// The rotation angle around the x-axis in radians. + /// The rotation angle around the y-axis in radians. + /// The rotation angle around the z-axis in radians. + /// The order in which the rotations are applied. + /// The quaternion representing the Euler angle rotation in the specified order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static quaternion Euler(float x, float y, float z, RotationOrder order = RotationOrder.Default) + { + return Euler(float3(x, y, z), order); + } + + /// Returns a quaternion that rotates around the x-axis by a given number of radians. + /// The clockwise rotation angle when looking along the x-axis towards the origin in radians. + /// The quaternion representing a rotation around the x-axis. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static quaternion RotateX(float angle) + { + float sina, cosa; + math.sincos(0.5f * angle, out sina, out cosa); + return quaternion(sina, 0.0f, 0.0f, cosa); + } + + /// Returns a quaternion that rotates around the y-axis by a given number of radians. + /// The clockwise rotation angle when looking along the y-axis towards the origin in radians. + /// The quaternion representing a rotation around the y-axis. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static quaternion RotateY(float angle) + { + float sina, cosa; + math.sincos(0.5f * angle, out sina, out cosa); + return quaternion(0.0f, sina, 0.0f, cosa); + } + + /// Returns a quaternion that rotates around the z-axis by a given number of radians. + /// The clockwise rotation angle when looking along the z-axis towards the origin in radians. + /// The quaternion representing a rotation around the z-axis. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static quaternion RotateZ(float angle) + { + float sina, cosa; + math.sincos(0.5f * angle, out sina, out cosa); + return quaternion(0.0f, 0.0f, sina, cosa); + } + + /// + /// Returns a quaternion view rotation given a unit length forward vector and a unit length up vector. + /// The two input vectors are assumed to be unit length and not collinear. + /// If these assumptions are not met use float3x3.LookRotationSafe instead. + /// + /// The view forward direction. + /// The view up direction. + /// The quaternion view rotation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static quaternion LookRotation(float3 forward, float3 up) + { + float3 t = normalize(cross(up, forward)); + return quaternion(float3x3(t, cross(forward, t), forward)); + } + + /// + /// Returns a quaternion view rotation given a forward vector and an up vector. + /// The two input vectors are not assumed to be unit length. + /// If the magnitude of either of the vectors is so extreme that the calculation cannot be carried out reliably or the vectors are collinear, + /// the identity will be returned instead. + /// + /// The view forward direction. + /// The view up direction. + /// The quaternion view rotation or the identity quaternion. + public static quaternion LookRotationSafe(float3 forward, float3 up) + { + float forwardLengthSq = dot(forward, forward); + float upLengthSq = dot(up, up); + + forward *= rsqrt(forwardLengthSq); + up *= rsqrt(upLengthSq); + + float3 t = cross(up, forward); + float tLengthSq = dot(t, t); + t *= rsqrt(tLengthSq); + + float mn = min(min(forwardLengthSq, upLengthSq), tLengthSq); + float mx = max(max(forwardLengthSq, upLengthSq), tLengthSq); + + bool accept = mn > 1e-35f && mx < 1e35f && isfinite(forwardLengthSq) && isfinite(upLengthSq) && isfinite(tLengthSq); + return quaternion(select(float4(0.0f, 0.0f, 0.0f, 1.0f), quaternion(float3x3(t, cross(forward, t),forward)).value, accept)); + } + + /// Returns true if the quaternion is equal to a given quaternion, false otherwise. + /// The quaternion to compare with. + /// True if the quaternion is equal to the input, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(quaternion x) { return value.x == x.value.x && value.y == x.value.y && value.z == x.value.z && value.w == x.value.w; } + + /// Returns whether true if the quaternion is equal to a given quaternion, false otherwise. + /// The object to compare with. + /// True if the quaternion is equal to the input, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override bool Equals(object x) { return x is quaternion converted && Equals(converted); } + + /// Returns a hash code for the quaternion. + /// The hash code of the quaternion. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + /// Returns a string representation of the quaternion. + /// The string representation of the quaternion. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("quaternion({0}f, {1}f, {2}f, {3}f)", value.x, value.y, value.z, value.w); + } + + /// Returns a string representation of the quaternion using a specified format and culture-specific format information. + /// The format string. + /// The format provider to use during string formatting. + /// The formatted string representation of the quaternion. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("quaternion({0}f, {1}f, {2}f, {3}f)", value.x.ToString(format, formatProvider), value.y.ToString(format, formatProvider), value.z.ToString(format, formatProvider), value.w.ToString(format, formatProvider)); + } + } + + public static partial class math + { + /// Returns a quaternion constructed from four float values. + /// The x component of the quaternion. + /// The y component of the quaternion. + /// The z component of the quaternion. + /// The w component of the quaternion. + /// The quaternion constructed from individual components. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static quaternion quaternion(float x, float y, float z, float w) { return new quaternion(x, y, z, w); } + + /// Returns a quaternion constructed from a float4 vector. + /// The float4 containing the components of the quaternion. + /// The quaternion constructed from a float4. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static quaternion quaternion(float4 value) { return new quaternion(value); } + + /// Returns a unit quaternion constructed from a float3x3 rotation matrix. The matrix must be orthonormal. + /// The float3x3 rotation matrix. + /// The quaternion constructed from a float3x3 matrix. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static quaternion quaternion(float3x3 m) { return new quaternion(m); } + + /// Returns a unit quaternion constructed from a float4x4 matrix. The matrix must be orthonormal. + /// The float4x4 matrix (must be orthonormal). + /// The quaternion constructed from a float4x4 matrix. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static quaternion quaternion(float4x4 m) { return new quaternion(m); } + + /// Returns the conjugate of a quaternion value. + /// The quaternion to conjugate. + /// The conjugate of the input quaternion. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static quaternion conjugate(quaternion q) + { + return quaternion(q.value * float4(-1.0f, -1.0f, -1.0f, 1.0f)); + } + + /// Returns the inverse of a quaternion value. + /// The quaternion to invert. + /// The quaternion inverse of the input quaternion. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static quaternion inverse(quaternion q) + { + float4 x = q.value; + return quaternion(rcp(dot(x, x)) * x * float4(-1.0f, -1.0f, -1.0f, 1.0f)); + } + + /// Returns the dot product of two quaternions. + /// The first quaternion. + /// The second quaternion. + /// The dot product of two quaternions. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float dot(quaternion a, quaternion b) + { + return dot(a.value, b.value); + } + + /// Returns the length of a quaternion. + /// The input quaternion. + /// The length of the input quaternion. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float length(quaternion q) + { + return sqrt(dot(q.value, q.value)); + } + + /// Returns the squared length of a quaternion. + /// The input quaternion. + /// The length squared of the input quaternion. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float lengthsq(quaternion q) + { + return dot(q.value, q.value); + } + + /// Returns a normalized version of a quaternion q by scaling it by 1 / length(q). + /// The quaternion to normalize. + /// The normalized quaternion. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static quaternion normalize(quaternion q) + { + float4 x = q.value; + return quaternion(rsqrt(dot(x, x)) * x); + } + + /// + /// Returns a safe normalized version of the q by scaling it by 1 / length(q). + /// Returns the identity when 1 / length(q) does not produce a finite number. + /// + /// The quaternion to normalize. + /// The normalized quaternion or the identity quaternion. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static quaternion normalizesafe(quaternion q) + { + float4 x = q.value; + float len = math.dot(x, x); + return quaternion(math.select(Mathematics.quaternion.identity.value, x * math.rsqrt(len), len > FLT_MIN_NORMAL)); + } + + /// + /// Returns a safe normalized version of the q by scaling it by 1 / length(q). + /// Returns the given default value when 1 / length(q) does not produce a finite number. + /// + /// The quaternion to normalize. + /// The default value. + /// The normalized quaternion or the default value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static quaternion normalizesafe(quaternion q, quaternion defaultvalue) + { + float4 x = q.value; + float len = math.dot(x, x); + return quaternion(math.select(defaultvalue.value, x * math.rsqrt(len), len > FLT_MIN_NORMAL)); + } + + /// Returns the natural exponent of a quaternion. Assumes w is zero. + /// The quaternion with w component equal to zero. + /// The natural exponent of the input quaternion. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static quaternion unitexp(quaternion q) + { + float v_rcp_len = rsqrt(dot(q.value.xyz, q.value.xyz)); + float v_len = rcp(v_rcp_len); + float sin_v_len, cos_v_len; + sincos(v_len, out sin_v_len, out cos_v_len); + return quaternion(float4(q.value.xyz * v_rcp_len * sin_v_len, cos_v_len)); + } + + /// Returns the natural exponent of a quaternion. + /// The quaternion. + /// The natural exponent of the input quaternion. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static quaternion exp(quaternion q) + { + float v_rcp_len = rsqrt(dot(q.value.xyz, q.value.xyz)); + float v_len = rcp(v_rcp_len); + float sin_v_len, cos_v_len; + sincos(v_len, out sin_v_len, out cos_v_len); + return quaternion(float4(q.value.xyz * v_rcp_len * sin_v_len, cos_v_len) * exp(q.value.w)); + } + + /// Returns the natural logarithm of a unit length quaternion. + /// The unit length quaternion. + /// The natural logarithm of the unit length quaternion. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static quaternion unitlog(quaternion q) + { + float w = clamp(q.value.w, -1.0f, 1.0f); + float s = acos(w) * rsqrt(1.0f - w*w); + return quaternion(float4(q.value.xyz * s, 0.0f)); + } + + /// Returns the natural logarithm of a quaternion. + /// The quaternion. + /// The natural logarithm of the input quaternion. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static quaternion log(quaternion q) + { + float v_len_sq = dot(q.value.xyz, q.value.xyz); + float q_len_sq = v_len_sq + q.value.w*q.value.w; + + float s = acos(clamp(q.value.w * rsqrt(q_len_sq), -1.0f, 1.0f)) * rsqrt(v_len_sq); + return quaternion(float4(q.value.xyz * s, 0.5f * log(q_len_sq))); + } + + /// Returns the result of transforming the quaternion b by the quaternion a. + /// The quaternion on the left. + /// The quaternion on the right. + /// The result of transforming quaternion b by the quaternion a. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static quaternion mul(quaternion a, quaternion b) + { + return quaternion(a.value.wwww * b.value + (a.value.xyzx * b.value.wwwx + a.value.yzxy * b.value.zxyy) * float4(1.0f, 1.0f, 1.0f, -1.0f) - a.value.zxyz * b.value.yzxz); + } + + /// Returns the result of transforming a vector by a quaternion. + /// The quaternion transformation. + /// The vector to transform. + /// The transformation of vector v by quaternion q. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 mul(quaternion q, float3 v) + { + float3 t = 2 * cross(q.value.xyz, v); + return v + q.value.w * t + cross(q.value.xyz, t); + } + + /// Returns the result of rotating a vector by a unit quaternion. + /// The quaternion rotation. + /// The vector to rotate. + /// The rotation of vector v by quaternion q. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 rotate(quaternion q, float3 v) + { + float3 t = 2 * cross(q.value.xyz, v); + return v + q.value.w * t + cross(q.value.xyz, t); + } + + /// Returns the result of a normalized linear interpolation between two quaternions q1 and a2 using an interpolation parameter t. + /// + /// Prefer to use this over slerp() when you know the distance between q1 and q2 is small. This can be much + /// higher performance due to avoiding trigonometric function evaluations that occur in slerp(). + /// + /// The first quaternion. + /// The second quaternion. + /// The interpolation parameter. + /// The normalized linear interpolation of two quaternions. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static quaternion nlerp(quaternion q1, quaternion q2, float t) + { + return normalize(q1.value + t * (chgsign(q2.value, dot(q1, q2)) - q1.value)); + } + + /// Returns the result of a spherical interpolation between two quaternions q1 and a2 using an interpolation parameter t. + /// The first quaternion. + /// The second quaternion. + /// The interpolation parameter. + /// The spherical linear interpolation of two quaternions. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static quaternion slerp(quaternion q1, quaternion q2, float t) + { + float dt = dot(q1, q2); + if (dt < 0.0f) + { + dt = -dt; + q2.value = -q2.value; + } + + if (dt < 0.9995f) + { + float angle = acos(dt); + float s = rsqrt(1.0f - dt * dt); // 1.0f / sin(angle) + float w1 = sin(angle * (1.0f - t)) * s; + float w2 = sin(angle * t) * s; + return quaternion(q1.value * w1 + q2.value * w2); + } + else + { + // if the angle is small, use linear interpolation + return nlerp(q1, q2, t); + } + } + + /// Returns the angle in radians between two unit quaternions. + /// The first quaternion. + /// The second quaternion. + /// The angle between two unit quaternions. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float angle(quaternion q1, quaternion q2) + { + float diff = asin(length(normalize(mul(conjugate(q1), q2)).value.xyz)); + return diff + diff; + } + + /// + /// Extracts the rotation from a matrix. + /// + /// This method supports any type of rotation matrix: if the matrix has a non uniform scale you should use this method. + /// Matrix to extract rotation from + /// Extracted rotation + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static quaternion rotation(float3x3 m) + { + float det = math.determinant(m); + if (math.abs(1f - det) < svd.k_EpsilonDeterminant) + return math.quaternion(m); + + if (math.abs(det) > svd.k_EpsilonDeterminant) + { + float3x3 tmp = mulScale(m, math.rsqrt(math.float3(math.lengthsq(m.c0), math.lengthsq(m.c1), math.lengthsq(m.c2)))); + if (math.abs(1f - math.determinant(tmp)) < svd.k_EpsilonDeterminant) + return math.quaternion(tmp); + } + + return svd.svdRotation(m); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + static float3x3 adj(float3x3 m, out float det) + { + float3x3 adjT; + adjT.c0 = math.cross(m.c1, m.c2); + adjT.c1 = math.cross(m.c2, m.c0); + adjT.c2 = math.cross(m.c0, m.c1); + det = math.dot(m.c0, adjT.c0); + + return math.transpose(adjT); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + static bool adjInverse(float3x3 m, out float3x3 i, float epsilon = svd.k_EpsilonNormal) + { + i = adj(m, out float det); + bool c = math.abs(det) > epsilon; + float3 detInv = math.select(math.float3(1f), math.rcp(det), c); + i = scaleMul(detInv, i); + return c; + } + + /// Returns a uint hash code of a quaternion. + /// The quaternion to hash. + /// The hash code for the input quaternion. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(quaternion q) + { + return hash(q.value); + } + + /// + /// Returns a uint4 vector hash code of a quaternion. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// The quaternion to hash. + /// The uint4 vector hash code of the input quaternion. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 hashwide(quaternion q) + { + return hashwide(q.value); + } + + /// + /// Transforms the forward vector by a quaternion. + /// + /// The quaternion transformation. + /// The forward vector transformed by the input quaternion. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 forward(quaternion q) { return mul(q, float3(0, 0, 1)); } // for compatibility + } +} diff --git a/src/Unity.Mathematics/quaternion.cs.meta b/src/Unity.Mathematics/quaternion.cs.meta new file mode 100644 index 00000000..2f32afaf --- /dev/null +++ b/src/Unity.Mathematics/quaternion.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a8481bb868ae344e9b4a5551a11483d3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/random.cs b/src/Unity.Mathematics/random.cs new file mode 100644 index 00000000..a6c77d5c --- /dev/null +++ b/src/Unity.Mathematics/random.cs @@ -0,0 +1,741 @@ +using System; +using System.Runtime.CompilerServices; +using static Unity.Mathematics.math; +using System.Diagnostics; +using Unity.IL2CPP.CompilerServices; + +namespace Unity.Mathematics +{ + /// + /// Random Number Generator based on xorshift. + /// Designed for minimal state (32bits) to be easily embeddable into components. + /// Core functionality is integer multiplication free to improve vectorization + /// on less capable SIMD instruction sets. + /// + [Il2CppEagerStaticClassConstruction] + [Serializable] + public partial struct Random + { + /// + /// The random number generator state. It should not be zero. + /// + public uint state; + + /// + /// Constructs a Random instance with a given seed value. The seed must be non-zero. + /// + /// The seed to initialize with. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public Random(uint seed) + { + state = seed; + CheckInitState(); + NextState(); + } + + /// + /// Constructs a instance with an index that gets hashed. The index must not be uint.MaxValue. + /// + /// + /// Use this function when you expect to create several Random instances in a loop. + /// + /// + /// + /// for (uint i = 0; i < 4096; ++i) + /// { + /// Random rand = Random.CreateFromIndex(i); + /// + /// // Random numbers drawn from loop iteration j will be very different + /// // from every other loop iteration k. + /// rand.NextUInt(); + /// } + /// + /// + /// An index that will be hashed for Random creation. Must not be uint.MaxValue. + /// created from an index. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Random CreateFromIndex(uint index) + { + CheckIndexForHash(index); + + // Wang hash will hash 61 to zero but we want uint.MaxValue to hash to zero. To make this happen + // we must offset by 62. + return new Random(WangHash(index + 62u)); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static uint WangHash(uint n) + { + // https://gist.github.com/badboy/6267743#hash-function-construction-principles + // Wang hash: this has the property that none of the outputs will + // collide with each other, which is important for the purposes of + // seeding a random number generator. This was verified empirically + // by checking all 2^32 uints. + n = (n ^ 61u) ^ (n >> 16); + n *= 9u; + n = n ^ (n >> 4); + n *= 0x27d4eb2du; + n = n ^ (n >> 15); + + return n; + } + + /// + /// Initialized the state of the Random instance with a given seed value. The seed must be non-zero. + /// + /// The seed to initialize with. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void InitState(uint seed = 0x6E624EB7u) + { + state = seed; + NextState(); + } + + /// Returns a uniformly random bool value. + /// A uniformly random boolean value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool NextBool() + { + return (NextState() & 1) == 1; + } + + /// Returns a uniformly random bool2 value. + /// A uniformly random bool2 value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool2 NextBool2() + { + uint v = NextState(); + return (uint2(v) & uint2(1, 2)) == 0; + } + + /// Returns a uniformly random bool3 value. + /// A uniformly random bool3 value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool3 NextBool3() + { + uint v = NextState(); + return (uint3(v) & uint3(1, 2, 4)) == 0; + } + + /// Returns a uniformly random bool4 value. + /// A uniformly random bool4 value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool4 NextBool4() + { + uint v = NextState(); + return (uint4(v) & uint4(1, 2, 4, 8)) == 0; + } + + + /// Returns a uniformly random int value in the interval [-2147483647, 2147483647]. + /// A uniformly random integer value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int NextInt() + { + return (int)NextState() ^ -2147483648; + } + + /// Returns a uniformly random int2 value with all components in the interval [-2147483647, 2147483647]. + /// A uniformly random int2 value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2 NextInt2() + { + return int2((int)NextState(), (int)NextState()) ^ -2147483648; + } + + /// Returns a uniformly random int3 value with all components in the interval [-2147483647, 2147483647]. + /// A uniformly random int3 value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3 NextInt3() + { + return int3((int)NextState(), (int)NextState(), (int)NextState()) ^ -2147483648; + } + + /// Returns a uniformly random int4 value with all components in the interval [-2147483647, 2147483647]. + /// A uniformly random int4 value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4 NextInt4() + { + return int4((int)NextState(), (int)NextState(), (int)NextState(), (int)NextState()) ^ -2147483648; + } + + /// Returns a uniformly random int value in the interval [0, max). + /// The maximum value to generate, exclusive. + /// A uniformly random int value in the range [0, max). + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int NextInt(int max) + { + CheckNextIntMax(max); + return (int)((NextState() * (ulong)max) >> 32); + } + + /// Returns a uniformly random int2 value with all components in the interval [0, max). + /// The componentwise maximum value to generate, exclusive. + /// A uniformly random int2 value with all components in the range [0, max). + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2 NextInt2(int2 max) + { + CheckNextIntMax(max.x); + CheckNextIntMax(max.y); + return int2((int)(NextState() * (ulong)max.x >> 32), + (int)(NextState() * (ulong)max.y >> 32)); + } + + /// Returns a uniformly random int3 value with all components in the interval [0, max). + /// The componentwise maximum value to generate, exclusive. + /// A uniformly random int3 value with all components in the range [0, max). + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3 NextInt3(int3 max) + { + CheckNextIntMax(max.x); + CheckNextIntMax(max.y); + CheckNextIntMax(max.z); + return int3((int)(NextState() * (ulong)max.x >> 32), + (int)(NextState() * (ulong)max.y >> 32), + (int)(NextState() * (ulong)max.z >> 32)); + } + + /// Returns a uniformly random int4 value with all components in the interval [0, max). + /// The componentwise maximum value to generate, exclusive. + /// A uniformly random int4 value with all components in the range [0, max). + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4 NextInt4(int4 max) + { + CheckNextIntMax(max.x); + CheckNextIntMax(max.y); + CheckNextIntMax(max.z); + CheckNextIntMax(max.w); + return int4((int)(NextState() * (ulong)max.x >> 32), + (int)(NextState() * (ulong)max.y >> 32), + (int)(NextState() * (ulong)max.z >> 32), + (int)(NextState() * (ulong)max.w >> 32)); + } + + /// Returns a uniformly random int value in the interval [min, max). + /// The minimum value to generate, inclusive. + /// The maximum value to generate, exclusive. + /// A uniformly random integer between [min, max). + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int NextInt(int min, int max) + { + CheckNextIntMinMax(min, max); + uint range = (uint)(max - min); + return (int)(NextState() * (ulong)range >> 32) + min; + } + + /// Returns a uniformly random int2 value with all components in the interval [min, max). + /// The componentwise minimum value to generate, inclusive. + /// The componentwise maximum value to generate, exclusive. + /// A uniformly random int2 between [min, max). + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int2 NextInt2(int2 min, int2 max) + { + CheckNextIntMinMax(min.x, max.x); + CheckNextIntMinMax(min.y, max.y); + uint2 range = (uint2)(max - min); + return int2((int)(NextState() * (ulong)range.x >> 32), + (int)(NextState() * (ulong)range.y >> 32)) + min; + } + + /// Returns a uniformly random int3 value with all components in the interval [min, max). + /// The componentwise minimum value to generate, inclusive. + /// The componentwise maximum value to generate, exclusive. + /// A uniformly random int3 between [min, max). + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int3 NextInt3(int3 min, int3 max) + { + CheckNextIntMinMax(min.x, max.x); + CheckNextIntMinMax(min.y, max.y); + CheckNextIntMinMax(min.z, max.z); + uint3 range = (uint3)(max - min); + return int3((int)(NextState() * (ulong)range.x >> 32), + (int)(NextState() * (ulong)range.y >> 32), + (int)(NextState() * (ulong)range.z >> 32)) + min; + } + + /// Returns a uniformly random int4 value with all components in the interval [min, max). + /// The componentwise minimum value to generate, inclusive. + /// The componentwise maximum value to generate, exclusive. + /// A uniformly random int4 between [min, max). + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int4 NextInt4(int4 min, int4 max) + { + CheckNextIntMinMax(min.x, max.x); + CheckNextIntMinMax(min.y, max.y); + CheckNextIntMinMax(min.z, max.z); + CheckNextIntMinMax(min.w, max.w); + uint4 range = (uint4)(max - min); + return int4((int)(NextState() * (ulong)range.x >> 32), + (int)(NextState() * (ulong)range.y >> 32), + (int)(NextState() * (ulong)range.z >> 32), + (int)(NextState() * (ulong)range.w >> 32)) + min; + } + + /// Returns a uniformly random uint value in the interval [0, 4294967294]. + /// A uniformly random unsigned integer. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint NextUInt() + { + return NextState() - 1u; + } + + /// Returns a uniformly random uint2 value with all components in the interval [0, 4294967294]. + /// A uniformly random uint2. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2 NextUInt2() + { + return uint2(NextState(), NextState()) - 1u; + } + + /// Returns a uniformly random uint3 value with all components in the interval [0, 4294967294]. + /// A uniformly random uint3. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3 NextUInt3() + { + return uint3(NextState(), NextState(), NextState()) - 1u; + } + + /// Returns a uniformly random uint4 value with all components in the interval [0, 4294967294]. + /// A uniformly random uint4. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4 NextUInt4() + { + return uint4(NextState(), NextState(), NextState(), NextState()) - 1u; + } + + + /// Returns a uniformly random uint value in the interval [0, max). + /// The maximum value to generate, exclusive. + /// A uniformly random unsigned integer in the range [0, max). + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint NextUInt(uint max) + { + return (uint)((NextState() * (ulong)max) >> 32); + } + + /// Returns a uniformly random uint2 value with all components in the interval [0, max). + /// The componentwise maximum value to generate, exclusive. + /// A uniformly random uint2 in the range [0, max). + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2 NextUInt2(uint2 max) + { + return uint2( (uint)(NextState() * (ulong)max.x >> 32), + (uint)(NextState() * (ulong)max.y >> 32)); + } + + /// Returns a uniformly random uint3 value with all components in the interval [0, max). + /// The componentwise maximum value to generate, exclusive. + /// A uniformly random uint3 in the range [0, max). + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3 NextUInt3(uint3 max) + { + return uint3( (uint)(NextState() * (ulong)max.x >> 32), + (uint)(NextState() * (ulong)max.y >> 32), + (uint)(NextState() * (ulong)max.z >> 32)); + } + + /// Returns a uniformly random uint4 value with all components in the interval [0, max). + /// The componentwise maximum value to generate, exclusive. + /// A uniformly random uint4 in the range [0, max). + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4 NextUInt4(uint4 max) + { + return uint4( (uint)(NextState() * (ulong)max.x >> 32), + (uint)(NextState() * (ulong)max.y >> 32), + (uint)(NextState() * (ulong)max.z >> 32), + (uint)(NextState() * (ulong)max.w >> 32)); + } + + /// Returns a uniformly random uint value in the interval [min, max). + /// The minimum value to generate, inclusive. + /// The maximum value to generate, exclusive. + /// A uniformly random unsigned integer in the range [min, max). + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint NextUInt(uint min, uint max) + { + CheckNextUIntMinMax(min, max); + uint range = max - min; + return (uint)(NextState() * (ulong)range >> 32) + min; + } + + /// Returns a uniformly random uint2 value with all components in the interval [min, max). + /// The componentwise minimum value to generate, inclusive. + /// The componentwise maximum value to generate, exclusive. + /// A uniformly random uint2 in the range [min, max). + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2 NextUInt2(uint2 min, uint2 max) + { + CheckNextUIntMinMax(min.x, max.x); + CheckNextUIntMinMax(min.y, max.y); + uint2 range = max - min; + return uint2((uint)(NextState() * (ulong)range.x >> 32), + (uint)(NextState() * (ulong)range.y >> 32)) + min; + } + + /// Returns a uniformly random uint3 value with all components in the interval [min, max). + /// The componentwise minimum value to generate, inclusive. + /// The componentwise maximum value to generate, exclusive. + /// A uniformly random uint3 in the range [min, max). + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3 NextUInt3(uint3 min, uint3 max) + { + CheckNextUIntMinMax(min.x, max.x); + CheckNextUIntMinMax(min.y, max.y); + CheckNextUIntMinMax(min.z, max.z); + uint3 range = max - min; + return uint3((uint)(NextState() * (ulong)range.x >> 32), + (uint)(NextState() * (ulong)range.y >> 32), + (uint)(NextState() * (ulong)range.z >> 32)) + min; + } + + /// Returns a uniformly random uint4 value with all components in the interval [min, max). + /// The componentwise minimum value to generate, inclusive. + /// The componentwise maximum value to generate, exclusive. + /// A uniformly random uint4 in the range [min, max). + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4 NextUInt4(uint4 min, uint4 max) + { + CheckNextUIntMinMax(min.x, max.x); + CheckNextUIntMinMax(min.y, max.y); + CheckNextUIntMinMax(min.z, max.z); + CheckNextUIntMinMax(min.w, max.w); + uint4 range = (uint4)(max - min); + return uint4((uint)(NextState() * (ulong)range.x >> 32), + (uint)(NextState() * (ulong)range.y >> 32), + (uint)(NextState() * (ulong)range.z >> 32), + (uint)(NextState() * (ulong)range.w >> 32)) + min; + } + + /// Returns a uniformly random float value in the interval [0, 1). + /// A uniformly random float value in the range [0, 1). + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float NextFloat() + { + return asfloat(0x3f800000 | (NextState() >> 9)) - 1.0f; + } + + /// Returns a uniformly random float2 value with all components in the interval [0, 1). + /// A uniformly random float2 value in the range [0, 1). + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2 NextFloat2() + { + return asfloat(0x3f800000 | (uint2(NextState(), NextState()) >> 9)) - 1.0f; + } + + /// Returns a uniformly random float3 value with all components in the interval [0, 1). + /// A uniformly random float3 value in the range [0, 1). + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3 NextFloat3() + { + return asfloat(0x3f800000 | (uint3(NextState(), NextState(), NextState()) >> 9)) - 1.0f; + } + + /// Returns a uniformly random float4 value with all components in the interval [0, 1). + /// A uniformly random float4 value in the range [0, 1). + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4 NextFloat4() + { + return asfloat(0x3f800000 | (uint4(NextState(), NextState(), NextState(), NextState()) >> 9)) - 1.0f; + } + + + /// Returns a uniformly random float value in the interval [0, max). + /// The maximum value to generate, exclusive. + /// A uniformly random float value in the range [0, max). + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float NextFloat(float max) { return NextFloat() * max; } + + /// Returns a uniformly random float2 value with all components in the interval [0, max). + /// The componentwise maximum value to generate, exclusive. + /// A uniformly random float2 value in the range [0, max). + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2 NextFloat2(float2 max) { return NextFloat2() * max; } + + /// Returns a uniformly random float3 value with all components in the interval [0, max). + /// The componentwise maximum value to generate, exclusive. + /// A uniformly random float3 value in the range [0, max). + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3 NextFloat3(float3 max) { return NextFloat3() * max; } + + /// Returns a uniformly random float4 value with all components in the interval [0, max). + /// The componentwise maximum value to generate, exclusive. + /// A uniformly random float4 value in the range [0, max). + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4 NextFloat4(float4 max) { return NextFloat4() * max; } + + + /// Returns a uniformly random float value in the interval [min, max). + /// The minimum value to generate, inclusive. + /// The maximum value to generate, exclusive. + /// A uniformly random float value in the range [min, max). + /// The result is computed as `NextFloat() * (max - min) + min`, so floating-point rounding can in rare cases return a value equal to `max` rather than strictly less than it. Clamp the result if you require a value strictly less than `max`. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float NextFloat(float min, float max) { return NextFloat() * (max - min) + min; } + + /// Returns a uniformly random float2 value with all components in the interval [min, max). + /// The componentwise minimum value to generate, inclusive. + /// The componentwise maximum value to generate, exclusive. + /// A uniformly random float2 value in the range [min, max). + /// Each component is computed as `NextFloat() * (max - min) + min`, so floating-point rounding can in rare cases return a component equal to the corresponding component of `max` rather than strictly less than it. Clamp the result if you require components strictly less than `max`. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2 NextFloat2(float2 min, float2 max) { return NextFloat2() * (max - min) + min; } + + /// Returns a uniformly random float3 value with all components in the interval [min, max). + /// The componentwise minimum value to generate, inclusive. + /// The componentwise maximum value to generate, exclusive. + /// A uniformly random float3 value in the range [min, max). + /// Each component is computed as `NextFloat() * (max - min) + min`, so floating-point rounding can in rare cases return a component equal to the corresponding component of `max` rather than strictly less than it. Clamp the result if you require components strictly less than `max`. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3 NextFloat3(float3 min, float3 max) { return NextFloat3() * (max - min) + min; } + + /// Returns a uniformly random float4 value with all components in the interval [min, max). + /// The componentwise minimum value to generate, inclusive. + /// The componentwise maximum value to generate, exclusive. + /// A uniformly random float4 value in the range [min, max). + /// Each component is computed as `NextFloat() * (max - min) + min`, so floating-point rounding can in rare cases return a component equal to the corresponding component of `max` rather than strictly less than it. Clamp the result if you require components strictly less than `max`. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float4 NextFloat4(float4 min, float4 max) { return NextFloat4() * (max - min) + min; } + + + + /// Returns a uniformly random double value in the interval [0, 1). + /// A uniformly random double value in the range [0, 1). + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double NextDouble() + { + ulong sx = ((ulong)NextState() << 20) ^ NextState(); + return asdouble(0x3ff0000000000000 | sx) - 1.0; + } + + /// Returns a uniformly random double2 value with all components in the interval [0, 1). + /// A uniformly random double2 value in the range [0, 1). + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2 NextDouble2() + { + ulong sx = ((ulong)NextState() << 20) ^ NextState(); + ulong sy = ((ulong)NextState() << 20) ^ NextState(); + return double2(asdouble(0x3ff0000000000000 | sx), + asdouble(0x3ff0000000000000 | sy)) - 1.0; + } + + /// Returns a uniformly random double3 value with all components in the interval [0, 1). + /// A uniformly random double3 value in the range [0, 1). + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3 NextDouble3() + { + ulong sx = ((ulong)NextState() << 20) ^ NextState(); + ulong sy = ((ulong)NextState() << 20) ^ NextState(); + ulong sz = ((ulong)NextState() << 20) ^ NextState(); + return double3(asdouble(0x3ff0000000000000 | sx), + asdouble(0x3ff0000000000000 | sy), + asdouble(0x3ff0000000000000 | sz)) - 1.0; + } + + /// Returns a uniformly random double4 value with all components in the interval [0, 1). + /// A uniformly random double4 value in the range [0, 1). + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4 NextDouble4() + { + ulong sx = ((ulong)NextState() << 20) ^ NextState(); + ulong sy = ((ulong)NextState() << 20) ^ NextState(); + ulong sz = ((ulong)NextState() << 20) ^ NextState(); + ulong sw = ((ulong)NextState() << 20) ^ NextState(); + return double4(asdouble(0x3ff0000000000000 | sx), + asdouble(0x3ff0000000000000 | sy), + asdouble(0x3ff0000000000000 | sz), + asdouble(0x3ff0000000000000 | sw)) - 1.0; + } + + + /// Returns a uniformly random double value in the interval [0, max). + /// The maximum value to generate, exclusive. + /// A uniformly random double value in the range [0, max). + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double NextDouble(double max) { return NextDouble() * max; } + + /// Returns a uniformly random double2 value with all components in the interval [0, max). + /// The componentwise maximum value to generate, exclusive. + /// A uniformly random double2 value in the range [0, max). + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2 NextDouble2(double2 max) { return NextDouble2() * max; } + + /// Returns a uniformly random double3 value with all components in the interval [0, max). + /// The componentwise maximum value to generate, exclusive. + /// A uniformly random double3 value in the range [0, max). + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3 NextDouble3(double3 max) { return NextDouble3() * max; } + + /// Returns a uniformly random double4 value with all components in the interval [0, max). + /// The componentwise maximum value to generate, exclusive. + /// A uniformly random double4 value in the range [0, max). + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4 NextDouble4(double4 max) { return NextDouble4() * max; } + + + /// Returns a uniformly random double value in the interval [min, max). + /// The minimum value to generate, inclusive. + /// The maximum value to generate, exclusive. + /// A uniformly random double value in the range [min, max). + /// The result is computed as `NextDouble() * (max - min) + min`, so floating-point rounding can in rare cases return a value equal to `max` rather than strictly less than it. Clamp the result if you require a value strictly less than `max`. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double NextDouble(double min, double max) { return NextDouble() * (max - min) + min; } + + /// Returns a uniformly random double2 value with all components in the interval [min, max). + /// The componentwise minimum value to generate, inclusive. + /// The componentwise maximum value to generate, exclusive. + /// A uniformly random double2 value in the range [min, max). + /// Each component is computed as `NextDouble() * (max - min) + min`, so floating-point rounding can in rare cases return a component equal to the corresponding component of `max` rather than strictly less than it. Clamp the result if you require components strictly less than `max`. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2 NextDouble2(double2 min, double2 max) { return NextDouble2() * (max - min) + min; } + + /// Returns a uniformly random double3 value with all components in the interval [min, max). + /// The componentwise minimum value to generate, inclusive. + /// The componentwise maximum value to generate, exclusive. + /// A uniformly random double3 value in the range [min, max). + /// Each component is computed as `NextDouble() * (max - min) + min`, so floating-point rounding can in rare cases return a component equal to the corresponding component of `max` rather than strictly less than it. Clamp the result if you require components strictly less than `max`. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3 NextDouble3(double3 min, double3 max) { return NextDouble3() * (max - min) + min; } + + /// Returns a uniformly random double4 value with all components in the interval [min, max). + /// The componentwise minimum value to generate, inclusive. + /// The componentwise maximum value to generate, exclusive. + /// A uniformly random double4 value in the range [min, max). + /// Each component is computed as `NextDouble() * (max - min) + min`, so floating-point rounding can in rare cases return a component equal to the corresponding component of `max` rather than strictly less than it. Clamp the result if you require components strictly less than `max`. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double4 NextDouble4(double4 min, double4 max) { return NextDouble4() * (max - min) + min; } + + /// Returns a unit length float2 vector representing a uniformly random 2D direction. + /// A uniformly random unit length float2 vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float2 NextFloat2Direction() + { + float angle = NextFloat() * PI * 2.0f; + float s, c; + sincos(angle, out s, out c); + return float2(c, s); + } + + /// Returns a unit length double2 vector representing a uniformly random 2D direction. + /// A uniformly random unit length double2 vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double2 NextDouble2Direction() + { + double angle = NextDouble() * PI_DBL * 2.0; + double s, c; + sincos(angle, out s, out c); + return double2(c, s); + } + + /// Returns a unit length float3 vector representing a uniformly random 3D direction. + /// A uniformly random unit length float3 vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3 NextFloat3Direction() + { + float2 rnd = NextFloat2(); + float z = rnd.x * 2.0f - 1.0f; + float r = sqrt(max(1.0f - z * z, 0.0f)); + float angle = rnd.y * PI * 2.0f; + float s, c; + sincos(angle, out s, out c); + return float3(c*r, s*r, z); + } + + /// Returns a unit length double3 vector representing a uniformly random 3D direction. + /// A uniformly random unit length double3 vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public double3 NextDouble3Direction() + { + double2 rnd = NextDouble2(); + double z = rnd.x * 2.0 - 1.0; + double r = sqrt(max(1.0 - z * z, 0.0)); + double angle = rnd.y * PI_DBL * 2.0; + double s, c; + sincos(angle, out s, out c); + return double3(c * r, s * r, z); + } + + /// Returns a unit length quaternion representing a uniformly 3D rotation. + /// A uniformly random unit length quaternion. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public quaternion NextQuaternionRotation() + { + float3 rnd = NextFloat3(float3(2.0f * PI, 2.0f * PI, 1.0f)); + float u1 = rnd.z; + float2 theta_rho = rnd.xy; + + float i = sqrt(1.0f - u1); + float j = sqrt(u1); + + float2 sin_theta_rho; + float2 cos_theta_rho; + sincos(theta_rho, out sin_theta_rho, out cos_theta_rho); + + quaternion q = quaternion(i * sin_theta_rho.x, i * cos_theta_rho.x, j * sin_theta_rho.y, j * cos_theta_rho.y); + return quaternion(select(q.value, -q.value, q.value.w < 0.0f)); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private uint NextState() + { + CheckState(); + uint t = state; + state ^= state << 13; + state ^= state >> 17; + state ^= state << 5; + return t; + } + + [Conditional("ENABLE_UNITY_COLLECTIONS_CHECKS")] + private void CheckInitState() + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if (state == 0) + throw new System.ArgumentException("Seed must be non-zero"); +#endif + } + + [Conditional("ENABLE_UNITY_COLLECTIONS_CHECKS")] + static void CheckIndexForHash(uint index) + { + if (index == uint.MaxValue) + throw new System.ArgumentException("Index must not be uint.MaxValue"); + } + + [Conditional("ENABLE_UNITY_COLLECTIONS_CHECKS")] + private void CheckState() + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if(state == 0) + throw new System.ArgumentException("Invalid state 0. Random object has not been properly initialized"); +#endif + } + + [Conditional("ENABLE_UNITY_COLLECTIONS_CHECKS")] + private void CheckNextIntMax(int max) + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if (max < 0) + throw new System.ArgumentException("max must be positive"); +#endif + } + + [Conditional("ENABLE_UNITY_COLLECTIONS_CHECKS")] + private void CheckNextIntMinMax(int min, int max) + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if (min > max) + throw new System.ArgumentException("min must be less than or equal to max"); +#endif + } + + [Conditional("ENABLE_UNITY_COLLECTIONS_CHECKS")] + private void CheckNextUIntMinMax(uint min, uint max) + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if (min > max) + throw new System.ArgumentException("min must be less than or equal to max"); +#endif + } + + } +} diff --git a/src/Unity.Mathematics/random.cs.meta b/src/Unity.Mathematics/random.cs.meta new file mode 100644 index 00000000..9c9463bc --- /dev/null +++ b/src/Unity.Mathematics/random.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 897d0bd3ae806496b8724cb68e7d18c4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/rigid_transform.cs b/src/Unity.Mathematics/rigid_transform.cs new file mode 100644 index 00000000..0fbec1ef --- /dev/null +++ b/src/Unity.Mathematics/rigid_transform.cs @@ -0,0 +1,415 @@ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; +using static Unity.Mathematics.math; + +namespace Unity.Mathematics +{ + /// + /// A rigid transformation type. + /// + [Il2CppEagerStaticClassConstruction] + [Serializable] + public struct RigidTransform + { + /// + /// The rotation part of the rigid transformation. + /// + public quaternion rot; + + /// + /// The translation part of the rigid transformation. + /// + public float3 pos; + + /// A RigidTransform representing the identity transform. + public static readonly RigidTransform identity = new RigidTransform(new quaternion(0.0f, 0.0f, 0.0f, 1.0f), new float3(0.0f, 0.0f, 0.0f)); + + /// Constructs a RigidTransform from a rotation represented by a unit quaternion and a translation represented by a float3 vector. + /// The quaternion rotation. + /// The translation vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public RigidTransform(quaternion rotation, float3 translation) + { + this.rot = rotation; + this.pos = translation; + } + + /// Constructs a RigidTransform from a rotation represented by a float3x3 matrix and a translation represented by a float3 vector. + /// The float3x3 rotation matrix. + /// The translation vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public RigidTransform(float3x3 rotation, float3 translation) + { + this.rot = new quaternion(rotation); + this.pos = translation; + } + + /// Constructs a RigidTransform from a float4x4. Assumes the matrix is orthonormal. + /// The float4x4 transformation matrix, must be orthonormal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public RigidTransform(float4x4 transform) + { + this.rot = new quaternion(transform); + this.pos = transform.c3.xyz; + } + + + /// + /// Returns a RigidTransform representing a rotation around a unit axis by an angle in radians. + /// The rotation direction is clockwise when looking along the rotation axis towards the origin. + /// + /// The axis of rotation. + /// The rotation angle in radians. + /// The RigidTransform from a rotation axis and angle of rotation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RigidTransform AxisAngle(float3 axis, float angle) { return new RigidTransform(quaternion.AxisAngle(axis, angle), float3.zero); } + + /// + /// Returns a RigidTransform constructed by first performing a rotation around the x-axis, then the y-axis and finally the z-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// A float3 vector containing the rotation angles around the x-, y- and z-axis measures in radians. + /// The RigidTransform of the Euler angle transformation in x-y-z order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RigidTransform EulerXYZ(float3 xyz) { return new RigidTransform(quaternion.EulerXYZ(xyz), float3.zero); } + + /// + /// Returns a RigidTransform constructed by first performing a rotation around the x-axis, then the z-axis and finally the y-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// A float3 vector containing the rotation angles around the x-, y- and z-axis measures in radians. + /// The RigidTransform of the Euler angle transformation in x-z-y order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RigidTransform EulerXZY(float3 xyz) { return new RigidTransform(quaternion.EulerXZY(xyz), float3.zero); } + + /// + /// Returns a RigidTransform constructed by first performing a rotation around the y-axis, then the x-axis and finally the z-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// A float3 vector containing the rotation angles around the x-, y- and z-axis measures in radians. + /// The RigidTransform of the Euler angle transformation in y-x-z order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RigidTransform EulerYXZ(float3 xyz) { return new RigidTransform(quaternion.EulerYXZ(xyz), float3.zero); } + + /// + /// Returns a RigidTransform constructed by first performing a rotation around the y-axis, then the z-axis and finally the x-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// A float3 vector containing the rotation angles around the x-, y- and z-axis measures in radians. + /// The RigidTransform of the Euler angle transformation in y-z-x order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RigidTransform EulerYZX(float3 xyz) { return new RigidTransform(quaternion.EulerYZX(xyz), float3.zero); } + + + /// + /// Returns a RigidTransform constructed by first performing a rotation around the z-axis, then the x-axis and finally the y-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// This is the default order rotation order in Unity. + /// + /// A float3 vector containing the rotation angles around the x-, y- and z-axis measures in radians. + /// The RigidTransform of the Euler angle transformation in z-x-y order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RigidTransform EulerZXY(float3 xyz) { return new RigidTransform(quaternion.EulerZXY(xyz), float3.zero); } + + /// + /// Returns a RigidTransform constructed by first performing a rotation around the z-axis, then the y-axis and finally the x-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// A float3 vector containing the rotation angles around the x-, y- and z-axis measures in radians. + /// The RigidTransform of the Euler angle transformation in z-y-x order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RigidTransform EulerZYX(float3 xyz) { return new RigidTransform(quaternion.EulerZYX(xyz), float3.zero); } + + /// + /// Returns a RigidTransform constructed by first performing a rotation around the x-axis, then the y-axis and finally the z-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// The rotation angle around the x-axis in radians. + /// The rotation angle around the y-axis in radians. + /// The rotation angle around the z-axis in radians. + /// The RigidTransform of the Euler angle transformation in x-y-z order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RigidTransform EulerXYZ(float x, float y, float z) { return EulerXYZ(float3(x, y, z)); } + + /// + /// Returns a RigidTransform constructed by first performing a rotation around the x-axis, then the z-axis and finally the y-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// The rotation angle around the x-axis in radians. + /// The rotation angle around the y-axis in radians. + /// The rotation angle around the z-axis in radians. + /// The RigidTransform of the Euler angle transformation in x-z-y order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RigidTransform EulerXZY(float x, float y, float z) { return EulerXZY(float3(x, y, z)); } + + /// + /// Returns a RigidTransform constructed by first performing a rotation around the y-axis, then the x-axis and finally the z-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// The rotation angle around the x-axis in radians. + /// The rotation angle around the y-axis in radians. + /// The rotation angle around the z-axis in radians. + /// The RigidTransform of the Euler angle transformation in y-x-z order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RigidTransform EulerYXZ(float x, float y, float z) { return EulerYXZ(float3(x, y, z)); } + + /// + /// Returns a RigidTransform constructed by first performing a rotation around the y-axis, then the z-axis and finally the x-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// The rotation angle around the x-axis in radians. + /// The rotation angle around the y-axis in radians. + /// The rotation angle around the z-axis in radians. + /// The RigidTransform of the Euler angle transformation in y-z-x order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RigidTransform EulerYZX(float x, float y, float z) { return EulerYZX(float3(x, y, z)); } + + /// + /// Returns a RigidTransform constructed by first performing a rotation around the z-axis, then the x-axis and finally the y-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// This is the default order rotation order in Unity. + /// + /// The rotation angle around the x-axis in radians. + /// The rotation angle around the y-axis in radians. + /// The rotation angle around the z-axis in radians. + /// The RigidTransform of the Euler angle transformation in z-x-y order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RigidTransform EulerZXY(float x, float y, float z) { return EulerZXY(float3(x, y, z)); } + + /// + /// Returns a RigidTransform constructed by first performing a rotation around the z-axis, then the y-axis and finally the x-axis. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// + /// The rotation angle around the x-axis in radians. + /// The rotation angle around the y-axis in radians. + /// The rotation angle around the z-axis in radians. + /// The RigidTransform of the Euler angle transformation in z-y-x order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RigidTransform EulerZYX(float x, float y, float z) { return EulerZYX(float3(x, y, z)); } + + /// + /// Returns a RigidTransform constructed by first performing 3 rotations around the principal axes in a given order. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// When the rotation order is known at compile time, it is recommended for performance reasons to use specific + /// Euler rotation constructors such as EulerZXY(...). + /// + /// A float3 vector containing the rotation angles around the x-, y- and z-axis measures in radians. + /// The order in which the rotations are applied. + /// The RigidTransform of the Euler angle transformation in the given rotation order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RigidTransform Euler(float3 xyz, RotationOrder order = RotationOrder.ZXY) + { + switch (order) + { + case RotationOrder.XYZ: + return EulerXYZ(xyz); + case RotationOrder.XZY: + return EulerXZY(xyz); + case RotationOrder.YXZ: + return EulerYXZ(xyz); + case RotationOrder.YZX: + return EulerYZX(xyz); + case RotationOrder.ZXY: + return EulerZXY(xyz); + case RotationOrder.ZYX: + return EulerZYX(xyz); + default: + return RigidTransform.identity; + } + } + + /// + /// Returns a RigidTransform constructed by first performing 3 rotations around the principal axes in a given order. + /// All rotation angles are in radians and clockwise when looking along the rotation axis towards the origin. + /// When the rotation order is known at compile time, it is recommended for performance reasons to use specific + /// Euler rotation constructors such as EulerZXY(...). + /// + /// The rotation angle around the x-axis in radians. + /// The rotation angle around the y-axis in radians. + /// The rotation angle around the z-axis in radians. + /// The order in which the rotations are applied. + /// The RigidTransform of the Euler angle transformation in the given rotation order. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RigidTransform Euler(float x, float y, float z, RotationOrder order = RotationOrder.Default) + { + return Euler(float3(x, y, z), order); + } + + /// Returns a RigidTransform that rotates around the x-axis by a given number of radians. + /// The clockwise rotation angle when looking along the x-axis towards the origin in radians. + /// The RigidTransform of rotating around the x-axis by the given angle. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RigidTransform RotateX(float angle) + { + return new RigidTransform(quaternion.RotateX(angle), float3.zero); + } + + /// Returns a RigidTransform that rotates around the y-axis by a given number of radians. + /// The clockwise rotation angle when looking along the y-axis towards the origin in radians. + /// The RigidTransform of rotating around the y-axis by the given angle. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RigidTransform RotateY(float angle) + { + return new RigidTransform(quaternion.RotateY(angle), float3.zero); + } + + /// Returns a RigidTransform that rotates around the z-axis by a given number of radians. + /// The clockwise rotation angle when looking along the z-axis towards the origin in radians. + /// The RigidTransform of rotating around the z-axis by the given angle. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RigidTransform RotateZ(float angle) + { + return new RigidTransform(quaternion.RotateZ(angle), float3.zero); + } + + /// Returns a RigidTransform that translates by an amount specified by a float3 vector. + /// The translation vector. + /// The RigidTransform that translates by the given translation vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RigidTransform Translate(float3 vector) + { + return new RigidTransform(quaternion.identity, vector); + } + + + /// Returns true if the RigidTransform is equal to a given RigidTransform, false otherwise. + /// The RigidTransform to compare with. + /// True if the RigidTransform is equal to the input, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(RigidTransform x) { return rot.Equals(x.rot) && pos.Equals(x.pos); } + + /// Returns true if the RigidTransform is equal to a given RigidTransform, false otherwise. + /// The object to compare with. + /// True if the RigidTransform is equal to the input, false otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override bool Equals(object x) { return x is RigidTransform converted && Equals(converted); } + + /// Returns a hash code for the RigidTransform. + /// The hash code of the RigidTransform. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + /// Returns a string representation of the RigidTransform. + /// The string representation of the RigidTransform. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("RigidTransform(({0}f, {1}f, {2}f, {3}f), ({4}f, {5}f, {6}f))", + rot.value.x, rot.value.y, rot.value.z, rot.value.w, pos.x, pos.y, pos.z); + } + + /// Returns a string representation of the RigidTransform using a specified format and culture-specific format information. + /// The format string. + /// The format provider to use during formatting. + /// The formatted string representation of the RigidTransform. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("float4x4(({0}f, {1}f, {2}f, {3}f), ({4}f, {5}f, {6}f))", + rot.value.x.ToString(format, formatProvider), + rot.value.y.ToString(format, formatProvider), + rot.value.z.ToString(format, formatProvider), + rot.value.w.ToString(format, formatProvider), + pos.x.ToString(format, formatProvider), + pos.y.ToString(format, formatProvider), + pos.z.ToString(format, formatProvider)); + } + } + + public static partial class math + { + /// Returns a RigidTransform constructed from a rotation represented by a unit quaternion and a translation represented by a float3 vector. + /// The quaternion rotation. + /// The translation vector. + /// The RigidTransform of the given rotation quaternion and translation vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RigidTransform RigidTransform(quaternion rot, float3 pos) { return new RigidTransform(rot, pos); } + + /// Returns a RigidTransform constructed from a rotation represented by a float3x3 rotation matrix and a translation represented by a float3 vector. + /// The float3x3 rotation matrix. + /// The translation vector. + /// The RigidTransform of the given rotation matrix and translation vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RigidTransform RigidTransform(float3x3 rotation, float3 translation) { return new RigidTransform(rotation, translation); } + + /// Returns a RigidTransform constructed from a rotation represented by a float3x3 matrix and a translation represented by a float3 vector. + /// The float4x4 transformation matrix. + /// The RigidTransform of the given float4x4 transformation matrix. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RigidTransform RigidTransform(float4x4 transform) { return new RigidTransform(transform); } + + /// Returns the inverse of a RigidTransform. + /// The RigidTransform to invert. + /// The inverse RigidTransform. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RigidTransform inverse(RigidTransform t) + { + quaternion invRotation = inverse(t.rot); + float3 invTranslation = mul(invRotation, -t.pos); + return new RigidTransform(invRotation, invTranslation); + } + + /// Returns the result of transforming the RigidTransform b by the RigidTransform a. + /// The RigidTransform on the left. + /// The RigidTransform on the right. + /// The RigidTransform of a transforming b. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static RigidTransform mul(RigidTransform a, RigidTransform b) + { + return new RigidTransform(mul(a.rot, b.rot), mul(a.rot, b.pos) + a.pos); + } + + /// Returns the result of transforming a float4 homogeneous coordinate by a RigidTransform. + /// The RigidTransform. + /// The position to be transformed. + /// The transformed position. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4 mul(RigidTransform a, float4 pos) + { + return float4(mul(a.rot, pos.xyz) + a.pos * pos.w, pos.w); + } + + /// Returns the result of rotating a float3 vector by a RigidTransform. + /// The RigidTransform. + /// The direction vector to rotate. + /// The rotated direction vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 rotate(RigidTransform a, float3 dir) + { + return mul(a.rot, dir); + } + + /// Returns the result of transforming a float3 point by a RigidTransform. + /// The RigidTransform. + /// The position to transform. + /// The transformed position. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 transform(RigidTransform a, float3 pos) + { + return mul(a.rot, pos) + a.pos; + } + + /// Returns a uint hash code of a RigidTransform. + /// The RigidTransform to hash. + /// The hash code of the input RigidTransform + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(RigidTransform t) + { + return hash(t.rot) + 0xC5C5394Bu * hash(t.pos); + } + + /// + /// Returns a uint4 vector hash code of a RigidTransform. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// The RigidTransform to hash. + /// The uint4 wide hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 hashwide(RigidTransform t) + { + return hashwide(t.rot) + 0xC5C5394Bu * hashwide(t.pos).xyzz; + } + } +} diff --git a/src/Unity.Mathematics/rigid_transform.cs.meta b/src/Unity.Mathematics/rigid_transform.cs.meta new file mode 100644 index 00000000..fd25cb98 --- /dev/null +++ b/src/Unity.Mathematics/rigid_transform.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 790a4c601e5714c18971af51ef3cbe71 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/svd.cs b/src/Unity.Mathematics/svd.cs new file mode 100644 index 00000000..d57e748a --- /dev/null +++ b/src/Unity.Mathematics/svd.cs @@ -0,0 +1,170 @@ +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +namespace Unity.Mathematics +{ + // SVD algorithm as described in: + // Computing the singular value decomposition of 3x3 matrices with minimal branching and elementary floating point operations, + // A.McAdams, A.Selle, R.Tamstorf, J.Teran and E.Sifakis, University of Wisconsin - Madison technical report TR1690, May 2011 + [Il2CppEagerStaticClassConstruction] + static public class svd + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + static void condSwap(bool c, ref float x, ref float y) + { + var tmp = x; + x = math.select(x, y, c); + y = math.select(y, tmp, c); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + static void condNegSwap(bool c, ref float3 x, ref float3 y) + { + var tmp = -x; + x = math.select(x, y, c); + y = math.select(y, tmp, c); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + static quaternion condNegSwapQuat(bool c, quaternion q, float4 mask) + { + const float halfSqrt2 = 0.707106781186548f; + return math.mul(q, math.select(quaternion.identity.value, mask * halfSqrt2, c)); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + static void sortSingularValues(ref float3x3 b, ref quaternion v) + { + var l0 = math.lengthsq(b.c0); + var l1 = math.lengthsq(b.c1); + var l2 = math.lengthsq(b.c2); + + var c = l0 < l1; + condNegSwap(c, ref b.c0, ref b.c1); + v = condNegSwapQuat(c, v, math.float4(0f, 0f, 1f, 1f)); + condSwap(c, ref l0, ref l1); + + c = l0 < l2; + condNegSwap(c, ref b.c0, ref b.c2); + v = condNegSwapQuat(c, v, math.float4(0f, -1f, 0f, 1f)); + condSwap(c, ref l0, ref l2); + + c = l1 < l2; + condNegSwap(c, ref b.c1, ref b.c2); + v = condNegSwapQuat(c, v, math.float4(1f, 0f, 0f, 1f)); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + static quaternion approxGivensQuat(float3 pq, float4 mask) + { + const float c8 = 0.923879532511287f; // cos(pi/8) + const float s8 = 0.38268343236509f; // sin(pi/8) + const float g = 5.82842712474619f; // 3 + 2 * sqrt(2) + + var ch = 2f * (pq.x - pq.y); // approx cos(a/2) + var sh = pq.z; // approx sin(a/2) + var r = math.select(math.float4(s8, s8, s8, c8), math.float4(sh, sh, sh, ch), g * sh * sh < ch * ch) * mask; + return math.normalize(r); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + static quaternion qrGivensQuat(float2 pq, float4 mask) + { + var l = math.sqrt(pq.x * pq.x + pq.y * pq.y); + var sh = math.select(0f, pq.y, l > k_EpsilonNormalSqrt); + var ch = math.abs(pq.x) + math.max(l, k_EpsilonNormalSqrt); + condSwap(pq.x < 0f, ref sh, ref ch); + + return math.normalize(math.float4(sh, sh, sh, ch) * mask); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + static quaternion givensQRFactorization(float3x3 b, out float3x3 r) + { + var u = qrGivensQuat(math.float2(b.c0.x, b.c0.y), math.float4(0f, 0f, 1f, 1f)); + var qmt = math.float3x3(math.conjugate(u)); + r = math.mul(qmt, b); + + var q = qrGivensQuat(math.float2(r.c0.x, r.c0.z), math.float4(0f, -1f, 0f, 1f)); + u = math.mul(u, q); + qmt = math.float3x3(math.conjugate(q)); + r = math.mul(qmt, r); + + q = qrGivensQuat(math.float2(r.c1.y, r.c1.z), math.float4(1f, 0f, 0f, 1f)); + u = math.mul(u, q); + qmt = math.float3x3(math.conjugate(q)); + r = math.mul(qmt, r); + + return u; + } + + static quaternion jacobiIteration(ref float3x3 s, int iterations = 5) + { + float3x3 qm; + quaternion q; + quaternion v = quaternion.identity; + + for (int i = 0; i < iterations; ++i) + { + q = approxGivensQuat(math.float3(s.c0.x, s.c1.y, s.c0.y), math.float4(0f, 0f, 1f, 1f)); + v = math.mul(v, q); + qm = math.float3x3(q); + s = math.mul(math.mul(math.transpose(qm), s), qm); + + q = approxGivensQuat(math.float3(s.c1.y, s.c2.z, s.c1.z), math.float4(1f, 0f, 0f, 1f)); + v = math.mul(v, q); + qm = math.float3x3(q); + s = math.mul(math.mul(math.transpose(qm), s), qm); + + q = approxGivensQuat(math.float3(s.c2.z, s.c0.x, s.c2.x), math.float4(0f, 1f, 0f, 1f)); + v = math.mul(v, q); + qm = math.float3x3(q); + s = math.mul(math.mul(math.transpose(qm), s), qm); + } + + return v; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + static float3 singularValuesDecomposition(float3x3 a, out quaternion u, out quaternion v) + { + u = quaternion.identity; + v = quaternion.identity; + + var s = math.mul(math.transpose(a), a); + v = jacobiIteration(ref s); + var b = math.float3x3(v); + b = math.mul(a, b); + sortSingularValues(ref b, ref v); + u = givensQRFactorization(b, out var e); + + return math.float3(e.c0.x, e.c1.y, e.c2.z); + } + + public const float k_EpsilonDeterminant = 1e-6f; + public const float k_EpsilonRCP = 1e-9f; + public const float k_EpsilonNormalSqrt = 1e-15f; + public const float k_EpsilonNormal = 1e-30f; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + static float3 rcpsafe(float3 x, float epsilon = k_EpsilonRCP) => + math.select(math.rcp(x), float3.zero, math.abs(x) < epsilon); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3x3 svdInverse(float3x3 a) + { + var e = singularValuesDecomposition(a, out var u, out var v); + var um = math.float3x3(u); + var vm = math.float3x3(v); + + return math.mul(vm, math.scaleMul(rcpsafe(e, k_EpsilonDeterminant), math.transpose(um))); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static quaternion svdRotation(float3x3 a) + { + singularValuesDecomposition(a, out var u, out var v); + return math.mul(u, math.conjugate(v)); + } + } +} \ No newline at end of file diff --git a/src/Unity.Mathematics/svd.cs.meta b/src/Unity.Mathematics/svd.cs.meta new file mode 100644 index 00000000..e7924355 --- /dev/null +++ b/src/Unity.Mathematics/svd.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bc4f01dc4f3d8489f85ca8dff8563871 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/uint2.cs b/src/Unity.Mathematics/uint2.cs deleted file mode 100644 index d2bfaa01..00000000 --- a/src/Unity.Mathematics/uint2.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System.Runtime.CompilerServices; -using System.Diagnostics; - -#pragma warning disable 0660, 0661 - -namespace Unity.Mathematics -{ - [DebuggerTypeProxy(typeof(uint2.DebuggerProxy))] - [System.Serializable] - public partial struct uint2 - { - internal sealed class DebuggerProxy - { - public uint x; - public uint y; - - public DebuggerProxy(uint2 vec) - { - x = vec.x; - y = vec.y; - } - } - - public uint x; - public uint y; - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public uint2(uint val) { x = y = val; } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public uint2(uint x, uint y) - { - this.x = x; - this.y = y; - } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public uint2(int2 val) - { - x = (uint)val.x; - y = (uint)val.y; - } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public uint2(float2 val) - { - x = (uint)val.x; - y = (uint)val.y; - } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static implicit operator uint2(uint d) { return new uint2(d); } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static explicit operator uint2(float2 d) { return new uint2(d); } - - public override string ToString() - { - return string.Format("uint2({0}, {1})", x, y); - } - } -} - diff --git a/src/Unity.Mathematics/uint2.cs.meta b/src/Unity.Mathematics/uint2.cs.meta deleted file mode 100644 index 25f85f36..00000000 --- a/src/Unity.Mathematics/uint2.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: f8085eb8eb34e2d46a38741c4ccda63a -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/src/Unity.Mathematics/uint2.gen.cs b/src/Unity.Mathematics/uint2.gen.cs index b15a6e50..92234f6c 100644 --- a/src/Unity.Mathematics/uint2.gen.cs +++ b/src/Unity.Mathematics/uint2.gen.cs @@ -1,373 +1,1043 @@ -// GENERATED CODE +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; using System.Runtime.CompilerServices; +using System.Diagnostics; +using Unity.IL2CPP.CompilerServices; + #pragma warning disable 0660, 0661 + namespace Unity.Mathematics { - public partial struct uint2 : System.IEquatable + /// A 2 component vector of uints. + [DebuggerTypeProxy(typeof(uint2.DebuggerProxy))] + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct uint2 : System.IEquatable, IFormattable { + /// x component of the vector. + public uint x; + /// y component of the vector. + public uint y; + + /// uint2 zero value. + public static readonly uint2 zero; + + /// Constructs a uint2 vector from two uint values. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2(uint x, uint y) + { + this.x = x; + this.y = y; + } + + /// Constructs a uint2 vector from a uint2 vector. + /// The constructed vector's xy components will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2(uint2 xy) + { + this.x = xy.x; + this.y = xy.y; + } + + /// Constructs a uint2 vector from a single uint value by assigning it to every component. + /// uint to convert to uint2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2(uint v) + { + this.x = v; + this.y = v; + } + + /// Constructs a uint2 vector from a single bool value by converting it to uint and assigning it to every component. + /// bool to convert to uint2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2(bool v) + { + this.x = v ? 1u : 0u; + this.y = v ? 1u : 0u; + } + + /// Constructs a uint2 vector from a bool2 vector by componentwise conversion. + /// bool2 to convert to uint2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2(bool2 v) + { + this.x = v.x ? 1u : 0u; + this.y = v.y ? 1u : 0u; + } + + /// Constructs a uint2 vector from a single int value by converting it to uint and assigning it to every component. + /// int to convert to uint2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2(int v) + { + this.x = (uint)v; + this.y = (uint)v; + } + + /// Constructs a uint2 vector from a int2 vector by componentwise conversion. + /// int2 to convert to uint2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2(int2 v) + { + this.x = (uint)v.x; + this.y = (uint)v.y; + } - // mul - [MethodImpl(0x100)] + /// Constructs a uint2 vector from a single float value by converting it to uint and assigning it to every component. + /// float to convert to uint2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2(float v) + { + this.x = (uint)v; + this.y = (uint)v; + } + + /// Constructs a uint2 vector from a float2 vector by componentwise conversion. + /// float2 to convert to uint2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2(float2 v) + { + this.x = (uint)v.x; + this.y = (uint)v.y; + } + + /// Constructs a uint2 vector from a single double value by converting it to uint and assigning it to every component. + /// double to convert to uint2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2(double v) + { + this.x = (uint)v; + this.y = (uint)v; + } + + /// Constructs a uint2 vector from a double2 vector by componentwise conversion. + /// double2 to convert to uint2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2(double2 v) + { + this.x = (uint)v.x; + this.y = (uint)v.y; + } + + + /// Implicitly converts a single uint value to a uint2 vector by assigning it to every component. + /// uint to convert to uint2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator uint2(uint v) { return new uint2(v); } + + /// Explicitly converts a single bool value to a uint2 vector by converting it to uint and assigning it to every component. + /// bool to convert to uint2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint2(bool v) { return new uint2(v); } + + /// Explicitly converts a bool2 vector to a uint2 vector by componentwise conversion. + /// bool2 to convert to uint2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint2(bool2 v) { return new uint2(v); } + + /// Explicitly converts a single int value to a uint2 vector by converting it to uint and assigning it to every component. + /// int to convert to uint2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint2(int v) { return new uint2(v); } + + /// Explicitly converts a int2 vector to a uint2 vector by componentwise conversion. + /// int2 to convert to uint2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint2(int2 v) { return new uint2(v); } + + /// Explicitly converts a single float value to a uint2 vector by converting it to uint and assigning it to every component. + /// float to convert to uint2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint2(float v) { return new uint2(v); } + + /// Explicitly converts a float2 vector to a uint2 vector by componentwise conversion. + /// float2 to convert to uint2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint2(float2 v) { return new uint2(v); } + + /// Explicitly converts a single double value to a uint2 vector by converting it to uint and assigning it to every component. + /// double to convert to uint2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint2(double v) { return new uint2(v); } + + /// Explicitly converts a double2 vector to a uint2 vector by componentwise conversion. + /// double2 to convert to uint2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint2(double2 v) { return new uint2(v); } + + + /// Returns the result of a componentwise multiplication operation on two uint2 vectors. + /// Left hand side uint2 to use to compute componentwise multiplication. + /// Right hand side uint2 to use to compute componentwise multiplication. + /// uint2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint2 operator * (uint2 lhs, uint2 rhs) { return new uint2 (lhs.x * rhs.x, lhs.y * rhs.y); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise multiplication operation on a uint2 vector and a uint value. + /// Left hand side uint2 to use to compute componentwise multiplication. + /// Right hand side uint to use to compute componentwise multiplication. + /// uint2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint2 operator * (uint2 lhs, uint rhs) { return new uint2 (lhs.x * rhs, lhs.y * rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise multiplication operation on a uint value and a uint2 vector. + /// Left hand side uint to use to compute componentwise multiplication. + /// Right hand side uint2 to use to compute componentwise multiplication. + /// uint2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint2 operator * (uint lhs, uint2 rhs) { return new uint2 (lhs * rhs.x, lhs * rhs.y); } - // add - [MethodImpl(0x100)] + + /// Returns the result of a componentwise addition operation on two uint2 vectors. + /// Left hand side uint2 to use to compute componentwise addition. + /// Right hand side uint2 to use to compute componentwise addition. + /// uint2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint2 operator + (uint2 lhs, uint2 rhs) { return new uint2 (lhs.x + rhs.x, lhs.y + rhs.y); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise addition operation on a uint2 vector and a uint value. + /// Left hand side uint2 to use to compute componentwise addition. + /// Right hand side uint to use to compute componentwise addition. + /// uint2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint2 operator + (uint2 lhs, uint rhs) { return new uint2 (lhs.x + rhs, lhs.y + rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise addition operation on a uint value and a uint2 vector. + /// Left hand side uint to use to compute componentwise addition. + /// Right hand side uint2 to use to compute componentwise addition. + /// uint2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint2 operator + (uint lhs, uint2 rhs) { return new uint2 (lhs + rhs.x, lhs + rhs.y); } - // sub - [MethodImpl(0x100)] + + /// Returns the result of a componentwise subtraction operation on two uint2 vectors. + /// Left hand side uint2 to use to compute componentwise subtraction. + /// Right hand side uint2 to use to compute componentwise subtraction. + /// uint2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint2 operator - (uint2 lhs, uint2 rhs) { return new uint2 (lhs.x - rhs.x, lhs.y - rhs.y); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise subtraction operation on a uint2 vector and a uint value. + /// Left hand side uint2 to use to compute componentwise subtraction. + /// Right hand side uint to use to compute componentwise subtraction. + /// uint2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint2 operator - (uint2 lhs, uint rhs) { return new uint2 (lhs.x - rhs, lhs.y - rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise subtraction operation on a uint value and a uint2 vector. + /// Left hand side uint to use to compute componentwise subtraction. + /// Right hand side uint2 to use to compute componentwise subtraction. + /// uint2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint2 operator - (uint lhs, uint2 rhs) { return new uint2 (lhs - rhs.x, lhs - rhs.y); } - // div - [MethodImpl(0x100)] + + /// Returns the result of a componentwise division operation on two uint2 vectors. + /// Left hand side uint2 to use to compute componentwise division. + /// Right hand side uint2 to use to compute componentwise division. + /// uint2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint2 operator / (uint2 lhs, uint2 rhs) { return new uint2 (lhs.x / rhs.x, lhs.y / rhs.y); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise division operation on a uint2 vector and a uint value. + /// Left hand side uint2 to use to compute componentwise division. + /// Right hand side uint to use to compute componentwise division. + /// uint2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint2 operator / (uint2 lhs, uint rhs) { return new uint2 (lhs.x / rhs, lhs.y / rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise division operation on a uint value and a uint2 vector. + /// Left hand side uint to use to compute componentwise division. + /// Right hand side uint2 to use to compute componentwise division. + /// uint2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint2 operator / (uint lhs, uint2 rhs) { return new uint2 (lhs / rhs.x, lhs / rhs.y); } - // smaller - [MethodImpl(0x100)] + + /// Returns the result of a componentwise modulus operation on two uint2 vectors. + /// Left hand side uint2 to use to compute componentwise modulus. + /// Right hand side uint2 to use to compute componentwise modulus. + /// uint2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 operator % (uint2 lhs, uint2 rhs) { return new uint2 (lhs.x % rhs.x, lhs.y % rhs.y); } + + /// Returns the result of a componentwise modulus operation on a uint2 vector and a uint value. + /// Left hand side uint2 to use to compute componentwise modulus. + /// Right hand side uint to use to compute componentwise modulus. + /// uint2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 operator % (uint2 lhs, uint rhs) { return new uint2 (lhs.x % rhs, lhs.y % rhs); } + + /// Returns the result of a componentwise modulus operation on a uint value and a uint2 vector. + /// Left hand side uint to use to compute componentwise modulus. + /// Right hand side uint2 to use to compute componentwise modulus. + /// uint2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 operator % (uint lhs, uint2 rhs) { return new uint2 (lhs % rhs.x, lhs % rhs.y); } + + + /// Returns the result of a componentwise increment operation on a uint2 vector. + /// Value to use when computing the componentwise increment. + /// uint2 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 operator ++ (uint2 val) { return new uint2 (++val.x, ++val.y); } + + + /// Returns the result of a componentwise decrement operation on a uint2 vector. + /// Value to use when computing the componentwise decrement. + /// uint2 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 operator -- (uint2 val) { return new uint2 (--val.x, --val.y); } + + + /// Returns the result of a componentwise less than operation on two uint2 vectors. + /// Left hand side uint2 to use to compute componentwise less than. + /// Right hand side uint2 to use to compute componentwise less than. + /// bool2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator < (uint2 lhs, uint2 rhs) { return new bool2 (lhs.x < rhs.x, lhs.y < rhs.y); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise less than operation on a uint2 vector and a uint value. + /// Left hand side uint2 to use to compute componentwise less than. + /// Right hand side uint to use to compute componentwise less than. + /// bool2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator < (uint2 lhs, uint rhs) { return new bool2 (lhs.x < rhs, lhs.y < rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise less than operation on a uint value and a uint2 vector. + /// Left hand side uint to use to compute componentwise less than. + /// Right hand side uint2 to use to compute componentwise less than. + /// bool2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator < (uint lhs, uint2 rhs) { return new bool2 (lhs < rhs.x, lhs < rhs.y); } - [MethodImpl(0x100)] + + + /// Returns the result of a componentwise less or equal operation on two uint2 vectors. + /// Left hand side uint2 to use to compute componentwise less or equal. + /// Right hand side uint2 to use to compute componentwise less or equal. + /// bool2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator <= (uint2 lhs, uint2 rhs) { return new bool2 (lhs.x <= rhs.x, lhs.y <= rhs.y); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise less or equal operation on a uint2 vector and a uint value. + /// Left hand side uint2 to use to compute componentwise less or equal. + /// Right hand side uint to use to compute componentwise less or equal. + /// bool2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator <= (uint2 lhs, uint rhs) { return new bool2 (lhs.x <= rhs, lhs.y <= rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise less or equal operation on a uint value and a uint2 vector. + /// Left hand side uint to use to compute componentwise less or equal. + /// Right hand side uint2 to use to compute componentwise less or equal. + /// bool2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator <= (uint lhs, uint2 rhs) { return new bool2 (lhs <= rhs.x, lhs <= rhs.y); } - // greater - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater than operation on two uint2 vectors. + /// Left hand side uint2 to use to compute componentwise greater than. + /// Right hand side uint2 to use to compute componentwise greater than. + /// bool2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator > (uint2 lhs, uint2 rhs) { return new bool2 (lhs.x > rhs.x, lhs.y > rhs.y); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater than operation on a uint2 vector and a uint value. + /// Left hand side uint2 to use to compute componentwise greater than. + /// Right hand side uint to use to compute componentwise greater than. + /// bool2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator > (uint2 lhs, uint rhs) { return new bool2 (lhs.x > rhs, lhs.y > rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater than operation on a uint value and a uint2 vector. + /// Left hand side uint to use to compute componentwise greater than. + /// Right hand side uint2 to use to compute componentwise greater than. + /// bool2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator > (uint lhs, uint2 rhs) { return new bool2 (lhs > rhs.x, lhs > rhs.y); } - [MethodImpl(0x100)] + + + /// Returns the result of a componentwise greater or equal operation on two uint2 vectors. + /// Left hand side uint2 to use to compute componentwise greater or equal. + /// Right hand side uint2 to use to compute componentwise greater or equal. + /// bool2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator >= (uint2 lhs, uint2 rhs) { return new bool2 (lhs.x >= rhs.x, lhs.y >= rhs.y); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater or equal operation on a uint2 vector and a uint value. + /// Left hand side uint2 to use to compute componentwise greater or equal. + /// Right hand side uint to use to compute componentwise greater or equal. + /// bool2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator >= (uint2 lhs, uint rhs) { return new bool2 (lhs.x >= rhs, lhs.y >= rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater or equal operation on a uint value and a uint2 vector. + /// Left hand side uint to use to compute componentwise greater or equal. + /// Right hand side uint2 to use to compute componentwise greater or equal. + /// bool2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator >= (uint lhs, uint2 rhs) { return new bool2 (lhs >= rhs.x, lhs >= rhs.y); } - // left shift - [MethodImpl(0x100)] - public static uint2 operator << (uint2 lhs, int rhs) { return new uint2 (lhs.x << rhs, lhs.y << rhs); } - // right shift - [MethodImpl(0x100)] - public static uint2 operator >> (uint2 lhs, int rhs) { return new uint2 (lhs.x >> rhs, lhs.y >> rhs); } + /// Returns the result of a componentwise unary minus operation on a uint2 vector. + /// Value to use when computing the componentwise unary minus. + /// uint2 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 operator - (uint2 val) { return new uint2 ((uint)-val.x, (uint)-val.y); } + + + /// Returns the result of a componentwise unary plus operation on a uint2 vector. + /// Value to use when computing the componentwise unary plus. + /// uint2 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 operator + (uint2 val) { return new uint2 (+val.x, +val.y); } + - // equal - [MethodImpl(0x100)] + /// Returns the result of a componentwise left shift operation on a uint2 vector by a number of bits specified by a single int. + /// The vector to left shift. + /// The number of bits to left shift. + /// The result of the componentwise left shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 operator << (uint2 x, int n) { return new uint2 (x.x << n, x.y << n); } + + /// Returns the result of a componentwise right shift operation on a uint2 vector by a number of bits specified by a single int. + /// The vector to right shift. + /// The number of bits to right shift. + /// The result of the componentwise right shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 operator >> (uint2 x, int n) { return new uint2 (x.x >> n, x.y >> n); } + + /// Returns the result of a componentwise equality operation on two uint2 vectors. + /// Left hand side uint2 to use to compute componentwise equality. + /// Right hand side uint2 to use to compute componentwise equality. + /// bool2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator == (uint2 lhs, uint2 rhs) { return new bool2 (lhs.x == rhs.x, lhs.y == rhs.y); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise equality operation on a uint2 vector and a uint value. + /// Left hand side uint2 to use to compute componentwise equality. + /// Right hand side uint to use to compute componentwise equality. + /// bool2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator == (uint2 lhs, uint rhs) { return new bool2 (lhs.x == rhs, lhs.y == rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise equality operation on a uint value and a uint2 vector. + /// Left hand side uint to use to compute componentwise equality. + /// Right hand side uint2 to use to compute componentwise equality. + /// bool2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator == (uint lhs, uint2 rhs) { return new bool2 (lhs == rhs.x, lhs == rhs.y); } - // not equal - [MethodImpl(0x100)] + + /// Returns the result of a componentwise not equal operation on two uint2 vectors. + /// Left hand side uint2 to use to compute componentwise not equal. + /// Right hand side uint2 to use to compute componentwise not equal. + /// bool2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator != (uint2 lhs, uint2 rhs) { return new bool2 (lhs.x != rhs.x, lhs.y != rhs.y); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise not equal operation on a uint2 vector and a uint value. + /// Left hand side uint2 to use to compute componentwise not equal. + /// Right hand side uint to use to compute componentwise not equal. + /// bool2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator != (uint2 lhs, uint rhs) { return new bool2 (lhs.x != rhs, lhs.y != rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise not equal operation on a uint value and a uint2 vector. + /// Left hand side uint to use to compute componentwise not equal. + /// Right hand side uint2 to use to compute componentwise not equal. + /// bool2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool2 operator != (uint lhs, uint2 rhs) { return new bool2 (lhs != rhs.x, lhs != rhs.y); } - // Equals - [MethodImpl(0x100)] - public bool Equals(uint2 rhs) { return x == rhs.x && y == rhs.y; } - // [int index] - unsafe public uint this[int index] - { - get - { -#if ENABLE_UNITY_COLLECTIONS_CHECKS - if ((uint)index >= 2) - throw new System.ArgumentException("index must be between[0...1]"); -#endif - fixed (uint* array = &x) { return array[index]; } - } - set - { -#if ENABLE_UNITY_COLLECTIONS_CHECKS - if ((uint)index >= 2) - throw new System.ArgumentException("index must be between[0...1]"); -#endif - fixed (uint* array = &x) { array[index] = value; } - } - } + /// Returns the result of a componentwise bitwise not operation on a uint2 vector. + /// Value to use when computing the componentwise bitwise not. + /// uint2 result of the componentwise bitwise not. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 operator ~ (uint2 val) { return new uint2 (~val.x, ~val.y); } + - // operator & - [MethodImpl(0x100)] + /// Returns the result of a componentwise bitwise and operation on two uint2 vectors. + /// Left hand side uint2 to use to compute componentwise bitwise and. + /// Right hand side uint2 to use to compute componentwise bitwise and. + /// uint2 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint2 operator & (uint2 lhs, uint2 rhs) { return new uint2 (lhs.x & rhs.x, lhs.y & rhs.y); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise and operation on a uint2 vector and a uint value. + /// Left hand side uint2 to use to compute componentwise bitwise and. + /// Right hand side uint to use to compute componentwise bitwise and. + /// uint2 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint2 operator & (uint2 lhs, uint rhs) { return new uint2 (lhs.x & rhs, lhs.y & rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise and operation on a uint value and a uint2 vector. + /// Left hand side uint to use to compute componentwise bitwise and. + /// Right hand side uint2 to use to compute componentwise bitwise and. + /// uint2 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint2 operator & (uint lhs, uint2 rhs) { return new uint2 (lhs & rhs.x, lhs & rhs.y); } - // operator | - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise or operation on two uint2 vectors. + /// Left hand side uint2 to use to compute componentwise bitwise or. + /// Right hand side uint2 to use to compute componentwise bitwise or. + /// uint2 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint2 operator | (uint2 lhs, uint2 rhs) { return new uint2 (lhs.x | rhs.x, lhs.y | rhs.y); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise or operation on a uint2 vector and a uint value. + /// Left hand side uint2 to use to compute componentwise bitwise or. + /// Right hand side uint to use to compute componentwise bitwise or. + /// uint2 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint2 operator | (uint2 lhs, uint rhs) { return new uint2 (lhs.x | rhs, lhs.y | rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise or operation on a uint value and a uint2 vector. + /// Left hand side uint to use to compute componentwise bitwise or. + /// Right hand side uint2 to use to compute componentwise bitwise or. + /// uint2 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint2 operator | (uint lhs, uint2 rhs) { return new uint2 (lhs | rhs.x, lhs | rhs.y); } - // operator ^ - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise exclusive or operation on two uint2 vectors. + /// Left hand side uint2 to use to compute componentwise bitwise exclusive or. + /// Right hand side uint2 to use to compute componentwise bitwise exclusive or. + /// uint2 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint2 operator ^ (uint2 lhs, uint2 rhs) { return new uint2 (lhs.x ^ rhs.x, lhs.y ^ rhs.y); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise exclusive or operation on a uint2 vector and a uint value. + /// Left hand side uint2 to use to compute componentwise bitwise exclusive or. + /// Right hand side uint to use to compute componentwise bitwise exclusive or. + /// uint2 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint2 operator ^ (uint2 lhs, uint rhs) { return new uint2 (lhs.x ^ rhs, lhs.y ^ rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise exclusive or operation on a uint value and a uint2 vector. + /// Left hand side uint to use to compute componentwise bitwise exclusive or. + /// Right hand side uint2 to use to compute componentwise bitwise exclusive or. + /// uint2 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint2 operator ^ (uint lhs, uint2 rhs) { return new uint2 (lhs ^ rhs.x, lhs ^ rhs.y); } - // operator ~ - [MethodImpl(0x100)] - public static uint2 operator ~ (uint2 val) { return new uint2 (~val.x, ~val.y); } [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xxxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xxxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xxyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xxyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xyxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xyxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xyyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xyyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yxxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yxxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yxyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yxyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yyxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yyxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yyyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yyyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 xxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 xxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 xyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 xyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 yxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 yxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 yyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 yyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint2 xx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint2(x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint2 xy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint2(x, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; y = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint2 yx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint2(y, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; x = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint2 yy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint2(y, y); } } + + /// Returns the uint element at a specified index. + unsafe public uint this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 2) + throw new System.ArgumentException("index must be between[0...1]"); +#endif + fixed (uint2* array = &this) { return ((uint*)array)[index]; } + } + set + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 2) + throw new System.ArgumentException("index must be between[0...1]"); +#endif + fixed (uint* array = &x) { array[index] = value; } + } + } + + /// Returns true if the uint2 is equal to a given uint2, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(uint2 rhs) { return x == rhs.x && y == rhs.y; } + + /// Returns true if the uint2 is equal to a given uint2, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is uint2 converted && Equals(converted); } + + + /// Returns a hash code for the uint2. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the uint2. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("uint2({0}, {1})", x, y); + } + + /// Returns a string representation of the uint2 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("uint2({0}, {1})", x.ToString(format, formatProvider), y.ToString(format, formatProvider)); + } + + internal sealed class DebuggerProxy + { + public uint x; + public uint y; + public DebuggerProxy(uint2 v) + { + x = v.x; + y = v.y; + } + } + + } + + public static partial class math + { + /// Returns a uint2 vector constructed from two uint values. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + /// uint2 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 uint2(uint x, uint y) { return new uint2(x, y); } + + /// Returns a uint2 vector constructed from a uint2 vector. + /// The constructed vector's xy components will be set to this value. + /// uint2 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 uint2(uint2 xy) { return new uint2(xy); } + + /// Returns a uint2 vector constructed from a single uint value by assigning it to every component. + /// uint to convert to uint2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 uint2(uint v) { return new uint2(v); } + + /// Returns a uint2 vector constructed from a single bool value by converting it to uint and assigning it to every component. + /// bool to convert to uint2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 uint2(bool v) { return new uint2(v); } + + /// Return a uint2 vector constructed from a bool2 vector by componentwise conversion. + /// bool2 to convert to uint2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 uint2(bool2 v) { return new uint2(v); } + + /// Returns a uint2 vector constructed from a single int value by converting it to uint and assigning it to every component. + /// int to convert to uint2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 uint2(int v) { return new uint2(v); } + + /// Return a uint2 vector constructed from a int2 vector by componentwise conversion. + /// int2 to convert to uint2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 uint2(int2 v) { return new uint2(v); } + + /// Returns a uint2 vector constructed from a single float value by converting it to uint and assigning it to every component. + /// float to convert to uint2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 uint2(float v) { return new uint2(v); } + + /// Return a uint2 vector constructed from a float2 vector by componentwise conversion. + /// float2 to convert to uint2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 uint2(float2 v) { return new uint2(v); } + + /// Returns a uint2 vector constructed from a single double value by converting it to uint and assigning it to every component. + /// double to convert to uint2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 uint2(double v) { return new uint2(v); } + + /// Return a uint2 vector constructed from a double2 vector by componentwise conversion. + /// double2 to convert to uint2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 uint2(double2 v) { return new uint2(v); } + + /// Returns a uint hash code of a uint2 vector. + /// Vector value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(uint2 v) + { + return csum(v * uint2(0x4473BBB1u, 0xCBA11D5Fu)) + 0x685835CFu; + } + + /// + /// Returns a uint2 vector hash code of a uint2 vector. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Vector value to hash. + /// uint2 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 hashwide(uint2 v) + { + return (v * uint2(0xC3D32AE1u, 0xB966942Fu)) + 0xFE9856B3u; + } + + /// Returns the result of specified shuffling of the components from two uint2 vectors into a uint value. + /// uint2 to use as the left argument of the shuffle operation. + /// uint2 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting uint. + /// uint result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint shuffle(uint2 left, uint2 right, ShuffleComponent x) + { + return select_shuffle_component(left, right, x); + } + + /// Returns the result of specified shuffling of the components from two uint2 vectors into a uint2 vector. + /// uint2 to use as the left argument of the shuffle operation. + /// uint2 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting uint2 x component. + /// The ShuffleComponent to use when setting the resulting uint2 y component. + /// uint2 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 shuffle(uint2 left, uint2 right, ShuffleComponent x, ShuffleComponent y) + { + return uint2( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y)); + } + + /// Returns the result of specified shuffling of the components from two uint2 vectors into a uint3 vector. + /// uint2 to use as the left argument of the shuffle operation. + /// uint2 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting uint3 x component. + /// The ShuffleComponent to use when setting the resulting uint3 y component. + /// The ShuffleComponent to use when setting the resulting uint3 z component. + /// uint3 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 shuffle(uint2 left, uint2 right, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z) + { + return uint3( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y), + select_shuffle_component(left, right, z)); + } + + /// Returns the result of specified shuffling of the components from two uint2 vectors into a uint4 vector. + /// uint2 to use as the left argument of the shuffle operation. + /// uint2 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting uint4 x component. + /// The ShuffleComponent to use when setting the resulting uint4 y component. + /// The ShuffleComponent to use when setting the resulting uint4 z component. + /// The ShuffleComponent to use when setting the resulting uint4 w component. + /// uint4 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 shuffle(uint2 left, uint2 right, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z, ShuffleComponent w) + { + return uint4( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y), + select_shuffle_component(left, right, z), + select_shuffle_component(left, right, w)); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static uint select_shuffle_component(uint2 a, uint2 b, ShuffleComponent component) + { + switch(component) + { + case ShuffleComponent.LeftX: + return a.x; + case ShuffleComponent.LeftY: + return a.y; + case ShuffleComponent.RightX: + return b.x; + case ShuffleComponent.RightY: + return b.y; + default: + throw new System.ArgumentException("Invalid shuffle component: " + component); + } + } + } } diff --git a/src/Unity.Mathematics/uint2x2.gen.cs b/src/Unity.Mathematics/uint2x2.gen.cs new file mode 100644 index 00000000..8f2a4666 --- /dev/null +++ b/src/Unity.Mathematics/uint2x2.gen.cs @@ -0,0 +1,715 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 2x2 matrix of uints. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct uint2x2 : System.IEquatable, IFormattable + { + /// Column 0 of the matrix. + public uint2 c0; + /// Column 1 of the matrix. + public uint2 c1; + + /// uint2x2 identity transform. + public static readonly uint2x2 identity = new uint2x2(1u, 0u, 0u, 1u); + + /// uint2x2 zero value. + public static readonly uint2x2 zero; + + /// Constructs a uint2x2 matrix from two uint2 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2x2(uint2 c0, uint2 c1) + { + this.c0 = c0; + this.c1 = c1; + } + + /// Constructs a uint2x2 matrix from 4 uint values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2x2(uint m00, uint m01, + uint m10, uint m11) + { + this.c0 = new uint2(m00, m10); + this.c1 = new uint2(m01, m11); + } + + /// Constructs a uint2x2 matrix from a single uint value by assigning it to every component. + /// uint to convert to uint2x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2x2(uint v) + { + this.c0 = v; + this.c1 = v; + } + + /// Constructs a uint2x2 matrix from a single bool value by converting it to uint and assigning it to every component. + /// bool to convert to uint2x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2x2(bool v) + { + this.c0 = math.select(new uint2(0u), new uint2(1u), v); + this.c1 = math.select(new uint2(0u), new uint2(1u), v); + } + + /// Constructs a uint2x2 matrix from a bool2x2 matrix by componentwise conversion. + /// bool2x2 to convert to uint2x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2x2(bool2x2 v) + { + this.c0 = math.select(new uint2(0u), new uint2(1u), v.c0); + this.c1 = math.select(new uint2(0u), new uint2(1u), v.c1); + } + + /// Constructs a uint2x2 matrix from a single int value by converting it to uint and assigning it to every component. + /// int to convert to uint2x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2x2(int v) + { + this.c0 = (uint2)v; + this.c1 = (uint2)v; + } + + /// Constructs a uint2x2 matrix from a int2x2 matrix by componentwise conversion. + /// int2x2 to convert to uint2x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2x2(int2x2 v) + { + this.c0 = (uint2)v.c0; + this.c1 = (uint2)v.c1; + } + + /// Constructs a uint2x2 matrix from a single float value by converting it to uint and assigning it to every component. + /// float to convert to uint2x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2x2(float v) + { + this.c0 = (uint2)v; + this.c1 = (uint2)v; + } + + /// Constructs a uint2x2 matrix from a float2x2 matrix by componentwise conversion. + /// float2x2 to convert to uint2x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2x2(float2x2 v) + { + this.c0 = (uint2)v.c0; + this.c1 = (uint2)v.c1; + } + + /// Constructs a uint2x2 matrix from a single double value by converting it to uint and assigning it to every component. + /// double to convert to uint2x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2x2(double v) + { + this.c0 = (uint2)v; + this.c1 = (uint2)v; + } + + /// Constructs a uint2x2 matrix from a double2x2 matrix by componentwise conversion. + /// double2x2 to convert to uint2x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2x2(double2x2 v) + { + this.c0 = (uint2)v.c0; + this.c1 = (uint2)v.c1; + } + + + /// Implicitly converts a single uint value to a uint2x2 matrix by assigning it to every component. + /// uint to convert to uint2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator uint2x2(uint v) { return new uint2x2(v); } + + /// Explicitly converts a single bool value to a uint2x2 matrix by converting it to uint and assigning it to every component. + /// bool to convert to uint2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint2x2(bool v) { return new uint2x2(v); } + + /// Explicitly converts a bool2x2 matrix to a uint2x2 matrix by componentwise conversion. + /// bool2x2 to convert to uint2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint2x2(bool2x2 v) { return new uint2x2(v); } + + /// Explicitly converts a single int value to a uint2x2 matrix by converting it to uint and assigning it to every component. + /// int to convert to uint2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint2x2(int v) { return new uint2x2(v); } + + /// Explicitly converts a int2x2 matrix to a uint2x2 matrix by componentwise conversion. + /// int2x2 to convert to uint2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint2x2(int2x2 v) { return new uint2x2(v); } + + /// Explicitly converts a single float value to a uint2x2 matrix by converting it to uint and assigning it to every component. + /// float to convert to uint2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint2x2(float v) { return new uint2x2(v); } + + /// Explicitly converts a float2x2 matrix to a uint2x2 matrix by componentwise conversion. + /// float2x2 to convert to uint2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint2x2(float2x2 v) { return new uint2x2(v); } + + /// Explicitly converts a single double value to a uint2x2 matrix by converting it to uint and assigning it to every component. + /// double to convert to uint2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint2x2(double v) { return new uint2x2(v); } + + /// Explicitly converts a double2x2 matrix to a uint2x2 matrix by componentwise conversion. + /// double2x2 to convert to uint2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint2x2(double2x2 v) { return new uint2x2(v); } + + + /// Returns the result of a componentwise multiplication operation on two uint2x2 matrices. + /// Left hand side uint2x2 to use to compute componentwise multiplication. + /// Right hand side uint2x2 to use to compute componentwise multiplication. + /// uint2x2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 operator * (uint2x2 lhs, uint2x2 rhs) { return new uint2x2 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1); } + + /// Returns the result of a componentwise multiplication operation on a uint2x2 matrix and a uint value. + /// Left hand side uint2x2 to use to compute componentwise multiplication. + /// Right hand side uint to use to compute componentwise multiplication. + /// uint2x2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 operator * (uint2x2 lhs, uint rhs) { return new uint2x2 (lhs.c0 * rhs, lhs.c1 * rhs); } + + /// Returns the result of a componentwise multiplication operation on a uint value and a uint2x2 matrix. + /// Left hand side uint to use to compute componentwise multiplication. + /// Right hand side uint2x2 to use to compute componentwise multiplication. + /// uint2x2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 operator * (uint lhs, uint2x2 rhs) { return new uint2x2 (lhs * rhs.c0, lhs * rhs.c1); } + + + /// Returns the result of a componentwise addition operation on two uint2x2 matrices. + /// Left hand side uint2x2 to use to compute componentwise addition. + /// Right hand side uint2x2 to use to compute componentwise addition. + /// uint2x2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 operator + (uint2x2 lhs, uint2x2 rhs) { return new uint2x2 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1); } + + /// Returns the result of a componentwise addition operation on a uint2x2 matrix and a uint value. + /// Left hand side uint2x2 to use to compute componentwise addition. + /// Right hand side uint to use to compute componentwise addition. + /// uint2x2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 operator + (uint2x2 lhs, uint rhs) { return new uint2x2 (lhs.c0 + rhs, lhs.c1 + rhs); } + + /// Returns the result of a componentwise addition operation on a uint value and a uint2x2 matrix. + /// Left hand side uint to use to compute componentwise addition. + /// Right hand side uint2x2 to use to compute componentwise addition. + /// uint2x2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 operator + (uint lhs, uint2x2 rhs) { return new uint2x2 (lhs + rhs.c0, lhs + rhs.c1); } + + + /// Returns the result of a componentwise subtraction operation on two uint2x2 matrices. + /// Left hand side uint2x2 to use to compute componentwise subtraction. + /// Right hand side uint2x2 to use to compute componentwise subtraction. + /// uint2x2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 operator - (uint2x2 lhs, uint2x2 rhs) { return new uint2x2 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1); } + + /// Returns the result of a componentwise subtraction operation on a uint2x2 matrix and a uint value. + /// Left hand side uint2x2 to use to compute componentwise subtraction. + /// Right hand side uint to use to compute componentwise subtraction. + /// uint2x2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 operator - (uint2x2 lhs, uint rhs) { return new uint2x2 (lhs.c0 - rhs, lhs.c1 - rhs); } + + /// Returns the result of a componentwise subtraction operation on a uint value and a uint2x2 matrix. + /// Left hand side uint to use to compute componentwise subtraction. + /// Right hand side uint2x2 to use to compute componentwise subtraction. + /// uint2x2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 operator - (uint lhs, uint2x2 rhs) { return new uint2x2 (lhs - rhs.c0, lhs - rhs.c1); } + + + /// Returns the result of a componentwise division operation on two uint2x2 matrices. + /// Left hand side uint2x2 to use to compute componentwise division. + /// Right hand side uint2x2 to use to compute componentwise division. + /// uint2x2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 operator / (uint2x2 lhs, uint2x2 rhs) { return new uint2x2 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1); } + + /// Returns the result of a componentwise division operation on a uint2x2 matrix and a uint value. + /// Left hand side uint2x2 to use to compute componentwise division. + /// Right hand side uint to use to compute componentwise division. + /// uint2x2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 operator / (uint2x2 lhs, uint rhs) { return new uint2x2 (lhs.c0 / rhs, lhs.c1 / rhs); } + + /// Returns the result of a componentwise division operation on a uint value and a uint2x2 matrix. + /// Left hand side uint to use to compute componentwise division. + /// Right hand side uint2x2 to use to compute componentwise division. + /// uint2x2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 operator / (uint lhs, uint2x2 rhs) { return new uint2x2 (lhs / rhs.c0, lhs / rhs.c1); } + + + /// Returns the result of a componentwise modulus operation on two uint2x2 matrices. + /// Left hand side uint2x2 to use to compute componentwise modulus. + /// Right hand side uint2x2 to use to compute componentwise modulus. + /// uint2x2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 operator % (uint2x2 lhs, uint2x2 rhs) { return new uint2x2 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1); } + + /// Returns the result of a componentwise modulus operation on a uint2x2 matrix and a uint value. + /// Left hand side uint2x2 to use to compute componentwise modulus. + /// Right hand side uint to use to compute componentwise modulus. + /// uint2x2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 operator % (uint2x2 lhs, uint rhs) { return new uint2x2 (lhs.c0 % rhs, lhs.c1 % rhs); } + + /// Returns the result of a componentwise modulus operation on a uint value and a uint2x2 matrix. + /// Left hand side uint to use to compute componentwise modulus. + /// Right hand side uint2x2 to use to compute componentwise modulus. + /// uint2x2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 operator % (uint lhs, uint2x2 rhs) { return new uint2x2 (lhs % rhs.c0, lhs % rhs.c1); } + + + /// Returns the result of a componentwise increment operation on a uint2x2 matrix. + /// Value to use when computing the componentwise increment. + /// uint2x2 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 operator ++ (uint2x2 val) { return new uint2x2 (++val.c0, ++val.c1); } + + + /// Returns the result of a componentwise decrement operation on a uint2x2 matrix. + /// Value to use when computing the componentwise decrement. + /// uint2x2 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 operator -- (uint2x2 val) { return new uint2x2 (--val.c0, --val.c1); } + + + /// Returns the result of a componentwise less than operation on two uint2x2 matrices. + /// Left hand side uint2x2 to use to compute componentwise less than. + /// Right hand side uint2x2 to use to compute componentwise less than. + /// bool2x2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator < (uint2x2 lhs, uint2x2 rhs) { return new bool2x2 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1); } + + /// Returns the result of a componentwise less than operation on a uint2x2 matrix and a uint value. + /// Left hand side uint2x2 to use to compute componentwise less than. + /// Right hand side uint to use to compute componentwise less than. + /// bool2x2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator < (uint2x2 lhs, uint rhs) { return new bool2x2 (lhs.c0 < rhs, lhs.c1 < rhs); } + + /// Returns the result of a componentwise less than operation on a uint value and a uint2x2 matrix. + /// Left hand side uint to use to compute componentwise less than. + /// Right hand side uint2x2 to use to compute componentwise less than. + /// bool2x2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator < (uint lhs, uint2x2 rhs) { return new bool2x2 (lhs < rhs.c0, lhs < rhs.c1); } + + + /// Returns the result of a componentwise less or equal operation on two uint2x2 matrices. + /// Left hand side uint2x2 to use to compute componentwise less or equal. + /// Right hand side uint2x2 to use to compute componentwise less or equal. + /// bool2x2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator <= (uint2x2 lhs, uint2x2 rhs) { return new bool2x2 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1); } + + /// Returns the result of a componentwise less or equal operation on a uint2x2 matrix and a uint value. + /// Left hand side uint2x2 to use to compute componentwise less or equal. + /// Right hand side uint to use to compute componentwise less or equal. + /// bool2x2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator <= (uint2x2 lhs, uint rhs) { return new bool2x2 (lhs.c0 <= rhs, lhs.c1 <= rhs); } + + /// Returns the result of a componentwise less or equal operation on a uint value and a uint2x2 matrix. + /// Left hand side uint to use to compute componentwise less or equal. + /// Right hand side uint2x2 to use to compute componentwise less or equal. + /// bool2x2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator <= (uint lhs, uint2x2 rhs) { return new bool2x2 (lhs <= rhs.c0, lhs <= rhs.c1); } + + + /// Returns the result of a componentwise greater than operation on two uint2x2 matrices. + /// Left hand side uint2x2 to use to compute componentwise greater than. + /// Right hand side uint2x2 to use to compute componentwise greater than. + /// bool2x2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator > (uint2x2 lhs, uint2x2 rhs) { return new bool2x2 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1); } + + /// Returns the result of a componentwise greater than operation on a uint2x2 matrix and a uint value. + /// Left hand side uint2x2 to use to compute componentwise greater than. + /// Right hand side uint to use to compute componentwise greater than. + /// bool2x2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator > (uint2x2 lhs, uint rhs) { return new bool2x2 (lhs.c0 > rhs, lhs.c1 > rhs); } + + /// Returns the result of a componentwise greater than operation on a uint value and a uint2x2 matrix. + /// Left hand side uint to use to compute componentwise greater than. + /// Right hand side uint2x2 to use to compute componentwise greater than. + /// bool2x2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator > (uint lhs, uint2x2 rhs) { return new bool2x2 (lhs > rhs.c0, lhs > rhs.c1); } + + + /// Returns the result of a componentwise greater or equal operation on two uint2x2 matrices. + /// Left hand side uint2x2 to use to compute componentwise greater or equal. + /// Right hand side uint2x2 to use to compute componentwise greater or equal. + /// bool2x2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator >= (uint2x2 lhs, uint2x2 rhs) { return new bool2x2 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1); } + + /// Returns the result of a componentwise greater or equal operation on a uint2x2 matrix and a uint value. + /// Left hand side uint2x2 to use to compute componentwise greater or equal. + /// Right hand side uint to use to compute componentwise greater or equal. + /// bool2x2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator >= (uint2x2 lhs, uint rhs) { return new bool2x2 (lhs.c0 >= rhs, lhs.c1 >= rhs); } + + /// Returns the result of a componentwise greater or equal operation on a uint value and a uint2x2 matrix. + /// Left hand side uint to use to compute componentwise greater or equal. + /// Right hand side uint2x2 to use to compute componentwise greater or equal. + /// bool2x2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator >= (uint lhs, uint2x2 rhs) { return new bool2x2 (lhs >= rhs.c0, lhs >= rhs.c1); } + + + /// Returns the result of a componentwise unary minus operation on a uint2x2 matrix. + /// Value to use when computing the componentwise unary minus. + /// uint2x2 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 operator - (uint2x2 val) { return new uint2x2 (-val.c0, -val.c1); } + + + /// Returns the result of a componentwise unary plus operation on a uint2x2 matrix. + /// Value to use when computing the componentwise unary plus. + /// uint2x2 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 operator + (uint2x2 val) { return new uint2x2 (+val.c0, +val.c1); } + + + /// Returns the result of a componentwise left shift operation on a uint2x2 matrix by a number of bits specified by a single int. + /// The matrix to left shift. + /// The number of bits to left shift. + /// The result of the componentwise left shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 operator << (uint2x2 x, int n) { return new uint2x2 (x.c0 << n, x.c1 << n); } + + /// Returns the result of a componentwise right shift operation on a uint2x2 matrix by a number of bits specified by a single int. + /// The matrix to right shift. + /// The number of bits to right shift. + /// The result of the componentwise right shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 operator >> (uint2x2 x, int n) { return new uint2x2 (x.c0 >> n, x.c1 >> n); } + + /// Returns the result of a componentwise equality operation on two uint2x2 matrices. + /// Left hand side uint2x2 to use to compute componentwise equality. + /// Right hand side uint2x2 to use to compute componentwise equality. + /// bool2x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator == (uint2x2 lhs, uint2x2 rhs) { return new bool2x2 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1); } + + /// Returns the result of a componentwise equality operation on a uint2x2 matrix and a uint value. + /// Left hand side uint2x2 to use to compute componentwise equality. + /// Right hand side uint to use to compute componentwise equality. + /// bool2x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator == (uint2x2 lhs, uint rhs) { return new bool2x2 (lhs.c0 == rhs, lhs.c1 == rhs); } + + /// Returns the result of a componentwise equality operation on a uint value and a uint2x2 matrix. + /// Left hand side uint to use to compute componentwise equality. + /// Right hand side uint2x2 to use to compute componentwise equality. + /// bool2x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator == (uint lhs, uint2x2 rhs) { return new bool2x2 (lhs == rhs.c0, lhs == rhs.c1); } + + + /// Returns the result of a componentwise not equal operation on two uint2x2 matrices. + /// Left hand side uint2x2 to use to compute componentwise not equal. + /// Right hand side uint2x2 to use to compute componentwise not equal. + /// bool2x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator != (uint2x2 lhs, uint2x2 rhs) { return new bool2x2 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1); } + + /// Returns the result of a componentwise not equal operation on a uint2x2 matrix and a uint value. + /// Left hand side uint2x2 to use to compute componentwise not equal. + /// Right hand side uint to use to compute componentwise not equal. + /// bool2x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator != (uint2x2 lhs, uint rhs) { return new bool2x2 (lhs.c0 != rhs, lhs.c1 != rhs); } + + /// Returns the result of a componentwise not equal operation on a uint value and a uint2x2 matrix. + /// Left hand side uint to use to compute componentwise not equal. + /// Right hand side uint2x2 to use to compute componentwise not equal. + /// bool2x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x2 operator != (uint lhs, uint2x2 rhs) { return new bool2x2 (lhs != rhs.c0, lhs != rhs.c1); } + + + /// Returns the result of a componentwise bitwise not operation on a uint2x2 matrix. + /// Value to use when computing the componentwise bitwise not. + /// uint2x2 result of the componentwise bitwise not. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 operator ~ (uint2x2 val) { return new uint2x2 (~val.c0, ~val.c1); } + + + /// Returns the result of a componentwise bitwise and operation on two uint2x2 matrices. + /// Left hand side uint2x2 to use to compute componentwise bitwise and. + /// Right hand side uint2x2 to use to compute componentwise bitwise and. + /// uint2x2 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 operator & (uint2x2 lhs, uint2x2 rhs) { return new uint2x2 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1); } + + /// Returns the result of a componentwise bitwise and operation on a uint2x2 matrix and a uint value. + /// Left hand side uint2x2 to use to compute componentwise bitwise and. + /// Right hand side uint to use to compute componentwise bitwise and. + /// uint2x2 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 operator & (uint2x2 lhs, uint rhs) { return new uint2x2 (lhs.c0 & rhs, lhs.c1 & rhs); } + + /// Returns the result of a componentwise bitwise and operation on a uint value and a uint2x2 matrix. + /// Left hand side uint to use to compute componentwise bitwise and. + /// Right hand side uint2x2 to use to compute componentwise bitwise and. + /// uint2x2 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 operator & (uint lhs, uint2x2 rhs) { return new uint2x2 (lhs & rhs.c0, lhs & rhs.c1); } + + + /// Returns the result of a componentwise bitwise or operation on two uint2x2 matrices. + /// Left hand side uint2x2 to use to compute componentwise bitwise or. + /// Right hand side uint2x2 to use to compute componentwise bitwise or. + /// uint2x2 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 operator | (uint2x2 lhs, uint2x2 rhs) { return new uint2x2 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1); } + + /// Returns the result of a componentwise bitwise or operation on a uint2x2 matrix and a uint value. + /// Left hand side uint2x2 to use to compute componentwise bitwise or. + /// Right hand side uint to use to compute componentwise bitwise or. + /// uint2x2 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 operator | (uint2x2 lhs, uint rhs) { return new uint2x2 (lhs.c0 | rhs, lhs.c1 | rhs); } + + /// Returns the result of a componentwise bitwise or operation on a uint value and a uint2x2 matrix. + /// Left hand side uint to use to compute componentwise bitwise or. + /// Right hand side uint2x2 to use to compute componentwise bitwise or. + /// uint2x2 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 operator | (uint lhs, uint2x2 rhs) { return new uint2x2 (lhs | rhs.c0, lhs | rhs.c1); } + + + /// Returns the result of a componentwise bitwise exclusive or operation on two uint2x2 matrices. + /// Left hand side uint2x2 to use to compute componentwise bitwise exclusive or. + /// Right hand side uint2x2 to use to compute componentwise bitwise exclusive or. + /// uint2x2 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 operator ^ (uint2x2 lhs, uint2x2 rhs) { return new uint2x2 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1); } + + /// Returns the result of a componentwise bitwise exclusive or operation on a uint2x2 matrix and a uint value. + /// Left hand side uint2x2 to use to compute componentwise bitwise exclusive or. + /// Right hand side uint to use to compute componentwise bitwise exclusive or. + /// uint2x2 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 operator ^ (uint2x2 lhs, uint rhs) { return new uint2x2 (lhs.c0 ^ rhs, lhs.c1 ^ rhs); } + + /// Returns the result of a componentwise bitwise exclusive or operation on a uint value and a uint2x2 matrix. + /// Left hand side uint to use to compute componentwise bitwise exclusive or. + /// Right hand side uint2x2 to use to compute componentwise bitwise exclusive or. + /// uint2x2 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 operator ^ (uint lhs, uint2x2 rhs) { return new uint2x2 (lhs ^ rhs.c0, lhs ^ rhs.c1); } + + + + /// Returns the uint2 element at a specified index. + unsafe public ref uint2 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 2) + throw new System.ArgumentException("index must be between[0...1]"); +#endif + fixed (uint2x2* array = &this) { return ref ((uint2*)array)[index]; } + } + } + + /// Returns true if the uint2x2 is equal to a given uint2x2, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(uint2x2 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1); } + + /// Returns true if the uint2x2 is equal to a given uint2x2, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is uint2x2 converted && Equals(converted); } + + + /// Returns a hash code for the uint2x2. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the uint2x2. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("uint2x2({0}, {1}, {2}, {3})", c0.x, c1.x, c0.y, c1.y); + } + + /// Returns a string representation of the uint2x2 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("uint2x2({0}, {1}, {2}, {3})", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider)); + } + + } + + public static partial class math + { + /// Returns a uint2x2 matrix constructed from two uint2 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// uint2x2 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 uint2x2(uint2 c0, uint2 c1) { return new uint2x2(c0, c1); } + + /// Returns a uint2x2 matrix constructed from from 4 uint values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// uint2x2 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 uint2x2(uint m00, uint m01, + uint m10, uint m11) + { + return new uint2x2(m00, m01, + m10, m11); + } + + /// Returns a uint2x2 matrix constructed from a single uint value by assigning it to every component. + /// uint to convert to uint2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 uint2x2(uint v) { return new uint2x2(v); } + + /// Returns a uint2x2 matrix constructed from a single bool value by converting it to uint and assigning it to every component. + /// bool to convert to uint2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 uint2x2(bool v) { return new uint2x2(v); } + + /// Return a uint2x2 matrix constructed from a bool2x2 matrix by componentwise conversion. + /// bool2x2 to convert to uint2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 uint2x2(bool2x2 v) { return new uint2x2(v); } + + /// Returns a uint2x2 matrix constructed from a single int value by converting it to uint and assigning it to every component. + /// int to convert to uint2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 uint2x2(int v) { return new uint2x2(v); } + + /// Return a uint2x2 matrix constructed from a int2x2 matrix by componentwise conversion. + /// int2x2 to convert to uint2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 uint2x2(int2x2 v) { return new uint2x2(v); } + + /// Returns a uint2x2 matrix constructed from a single float value by converting it to uint and assigning it to every component. + /// float to convert to uint2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 uint2x2(float v) { return new uint2x2(v); } + + /// Return a uint2x2 matrix constructed from a float2x2 matrix by componentwise conversion. + /// float2x2 to convert to uint2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 uint2x2(float2x2 v) { return new uint2x2(v); } + + /// Returns a uint2x2 matrix constructed from a single double value by converting it to uint and assigning it to every component. + /// double to convert to uint2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 uint2x2(double v) { return new uint2x2(v); } + + /// Return a uint2x2 matrix constructed from a double2x2 matrix by componentwise conversion. + /// double2x2 to convert to uint2x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 uint2x2(double2x2 v) { return new uint2x2(v); } + + /// Return the uint2x2 transpose of a uint2x2 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x2 transpose(uint2x2 v) + { + return uint2x2( + v.c0.x, v.c0.y, + v.c1.x, v.c1.y); + } + + /// Returns a uint hash code of a uint2x2 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(uint2x2 v) + { + return csum(v.c0 * uint2(0xB36DE767u, 0x6FCA387Du) + + v.c1 * uint2(0xAF0F3103u, 0xE4A056C7u)) + 0x841D8225u; + } + + /// + /// Returns a uint2 vector hash code of a uint2x2 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint2 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 hashwide(uint2x2 v) + { + return (v.c0 * uint2(0xC9393C7Du, 0xD42EAFA3u) + + v.c1 * uint2(0xD9AFD06Du, 0x97A65421u)) + 0x7809205Fu; + } + + } +} diff --git a/src/Unity.Mathematics/uint2x2.gen.cs.meta b/src/Unity.Mathematics/uint2x2.gen.cs.meta new file mode 100644 index 00000000..2fb0e2ce --- /dev/null +++ b/src/Unity.Mathematics/uint2x2.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 93a63257a84804542ad359995ba0c1b1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/uint2x3.gen.cs b/src/Unity.Mathematics/uint2x3.gen.cs new file mode 100644 index 00000000..8d576265 --- /dev/null +++ b/src/Unity.Mathematics/uint2x3.gen.cs @@ -0,0 +1,734 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 2x3 matrix of uints. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct uint2x3 : System.IEquatable, IFormattable + { + /// Column 0 of the matrix. + public uint2 c0; + /// Column 1 of the matrix. + public uint2 c1; + /// Column 2 of the matrix. + public uint2 c2; + + /// uint2x3 zero value. + public static readonly uint2x3 zero; + + /// Constructs a uint2x3 matrix from three uint2 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2x3(uint2 c0, uint2 c1, uint2 c2) + { + this.c0 = c0; + this.c1 = c1; + this.c2 = c2; + } + + /// Constructs a uint2x3 matrix from 6 uint values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2x3(uint m00, uint m01, uint m02, + uint m10, uint m11, uint m12) + { + this.c0 = new uint2(m00, m10); + this.c1 = new uint2(m01, m11); + this.c2 = new uint2(m02, m12); + } + + /// Constructs a uint2x3 matrix from a single uint value by assigning it to every component. + /// uint to convert to uint2x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2x3(uint v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + } + + /// Constructs a uint2x3 matrix from a single bool value by converting it to uint and assigning it to every component. + /// bool to convert to uint2x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2x3(bool v) + { + this.c0 = math.select(new uint2(0u), new uint2(1u), v); + this.c1 = math.select(new uint2(0u), new uint2(1u), v); + this.c2 = math.select(new uint2(0u), new uint2(1u), v); + } + + /// Constructs a uint2x3 matrix from a bool2x3 matrix by componentwise conversion. + /// bool2x3 to convert to uint2x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2x3(bool2x3 v) + { + this.c0 = math.select(new uint2(0u), new uint2(1u), v.c0); + this.c1 = math.select(new uint2(0u), new uint2(1u), v.c1); + this.c2 = math.select(new uint2(0u), new uint2(1u), v.c2); + } + + /// Constructs a uint2x3 matrix from a single int value by converting it to uint and assigning it to every component. + /// int to convert to uint2x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2x3(int v) + { + this.c0 = (uint2)v; + this.c1 = (uint2)v; + this.c2 = (uint2)v; + } + + /// Constructs a uint2x3 matrix from a int2x3 matrix by componentwise conversion. + /// int2x3 to convert to uint2x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2x3(int2x3 v) + { + this.c0 = (uint2)v.c0; + this.c1 = (uint2)v.c1; + this.c2 = (uint2)v.c2; + } + + /// Constructs a uint2x3 matrix from a single float value by converting it to uint and assigning it to every component. + /// float to convert to uint2x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2x3(float v) + { + this.c0 = (uint2)v; + this.c1 = (uint2)v; + this.c2 = (uint2)v; + } + + /// Constructs a uint2x3 matrix from a float2x3 matrix by componentwise conversion. + /// float2x3 to convert to uint2x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2x3(float2x3 v) + { + this.c0 = (uint2)v.c0; + this.c1 = (uint2)v.c1; + this.c2 = (uint2)v.c2; + } + + /// Constructs a uint2x3 matrix from a single double value by converting it to uint and assigning it to every component. + /// double to convert to uint2x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2x3(double v) + { + this.c0 = (uint2)v; + this.c1 = (uint2)v; + this.c2 = (uint2)v; + } + + /// Constructs a uint2x3 matrix from a double2x3 matrix by componentwise conversion. + /// double2x3 to convert to uint2x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2x3(double2x3 v) + { + this.c0 = (uint2)v.c0; + this.c1 = (uint2)v.c1; + this.c2 = (uint2)v.c2; + } + + + /// Implicitly converts a single uint value to a uint2x3 matrix by assigning it to every component. + /// uint to convert to uint2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator uint2x3(uint v) { return new uint2x3(v); } + + /// Explicitly converts a single bool value to a uint2x3 matrix by converting it to uint and assigning it to every component. + /// bool to convert to uint2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint2x3(bool v) { return new uint2x3(v); } + + /// Explicitly converts a bool2x3 matrix to a uint2x3 matrix by componentwise conversion. + /// bool2x3 to convert to uint2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint2x3(bool2x3 v) { return new uint2x3(v); } + + /// Explicitly converts a single int value to a uint2x3 matrix by converting it to uint and assigning it to every component. + /// int to convert to uint2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint2x3(int v) { return new uint2x3(v); } + + /// Explicitly converts a int2x3 matrix to a uint2x3 matrix by componentwise conversion. + /// int2x3 to convert to uint2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint2x3(int2x3 v) { return new uint2x3(v); } + + /// Explicitly converts a single float value to a uint2x3 matrix by converting it to uint and assigning it to every component. + /// float to convert to uint2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint2x3(float v) { return new uint2x3(v); } + + /// Explicitly converts a float2x3 matrix to a uint2x3 matrix by componentwise conversion. + /// float2x3 to convert to uint2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint2x3(float2x3 v) { return new uint2x3(v); } + + /// Explicitly converts a single double value to a uint2x3 matrix by converting it to uint and assigning it to every component. + /// double to convert to uint2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint2x3(double v) { return new uint2x3(v); } + + /// Explicitly converts a double2x3 matrix to a uint2x3 matrix by componentwise conversion. + /// double2x3 to convert to uint2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint2x3(double2x3 v) { return new uint2x3(v); } + + + /// Returns the result of a componentwise multiplication operation on two uint2x3 matrices. + /// Left hand side uint2x3 to use to compute componentwise multiplication. + /// Right hand side uint2x3 to use to compute componentwise multiplication. + /// uint2x3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 operator * (uint2x3 lhs, uint2x3 rhs) { return new uint2x3 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1, lhs.c2 * rhs.c2); } + + /// Returns the result of a componentwise multiplication operation on a uint2x3 matrix and a uint value. + /// Left hand side uint2x3 to use to compute componentwise multiplication. + /// Right hand side uint to use to compute componentwise multiplication. + /// uint2x3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 operator * (uint2x3 lhs, uint rhs) { return new uint2x3 (lhs.c0 * rhs, lhs.c1 * rhs, lhs.c2 * rhs); } + + /// Returns the result of a componentwise multiplication operation on a uint value and a uint2x3 matrix. + /// Left hand side uint to use to compute componentwise multiplication. + /// Right hand side uint2x3 to use to compute componentwise multiplication. + /// uint2x3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 operator * (uint lhs, uint2x3 rhs) { return new uint2x3 (lhs * rhs.c0, lhs * rhs.c1, lhs * rhs.c2); } + + + /// Returns the result of a componentwise addition operation on two uint2x3 matrices. + /// Left hand side uint2x3 to use to compute componentwise addition. + /// Right hand side uint2x3 to use to compute componentwise addition. + /// uint2x3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 operator + (uint2x3 lhs, uint2x3 rhs) { return new uint2x3 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1, lhs.c2 + rhs.c2); } + + /// Returns the result of a componentwise addition operation on a uint2x3 matrix and a uint value. + /// Left hand side uint2x3 to use to compute componentwise addition. + /// Right hand side uint to use to compute componentwise addition. + /// uint2x3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 operator + (uint2x3 lhs, uint rhs) { return new uint2x3 (lhs.c0 + rhs, lhs.c1 + rhs, lhs.c2 + rhs); } + + /// Returns the result of a componentwise addition operation on a uint value and a uint2x3 matrix. + /// Left hand side uint to use to compute componentwise addition. + /// Right hand side uint2x3 to use to compute componentwise addition. + /// uint2x3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 operator + (uint lhs, uint2x3 rhs) { return new uint2x3 (lhs + rhs.c0, lhs + rhs.c1, lhs + rhs.c2); } + + + /// Returns the result of a componentwise subtraction operation on two uint2x3 matrices. + /// Left hand side uint2x3 to use to compute componentwise subtraction. + /// Right hand side uint2x3 to use to compute componentwise subtraction. + /// uint2x3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 operator - (uint2x3 lhs, uint2x3 rhs) { return new uint2x3 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1, lhs.c2 - rhs.c2); } + + /// Returns the result of a componentwise subtraction operation on a uint2x3 matrix and a uint value. + /// Left hand side uint2x3 to use to compute componentwise subtraction. + /// Right hand side uint to use to compute componentwise subtraction. + /// uint2x3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 operator - (uint2x3 lhs, uint rhs) { return new uint2x3 (lhs.c0 - rhs, lhs.c1 - rhs, lhs.c2 - rhs); } + + /// Returns the result of a componentwise subtraction operation on a uint value and a uint2x3 matrix. + /// Left hand side uint to use to compute componentwise subtraction. + /// Right hand side uint2x3 to use to compute componentwise subtraction. + /// uint2x3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 operator - (uint lhs, uint2x3 rhs) { return new uint2x3 (lhs - rhs.c0, lhs - rhs.c1, lhs - rhs.c2); } + + + /// Returns the result of a componentwise division operation on two uint2x3 matrices. + /// Left hand side uint2x3 to use to compute componentwise division. + /// Right hand side uint2x3 to use to compute componentwise division. + /// uint2x3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 operator / (uint2x3 lhs, uint2x3 rhs) { return new uint2x3 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1, lhs.c2 / rhs.c2); } + + /// Returns the result of a componentwise division operation on a uint2x3 matrix and a uint value. + /// Left hand side uint2x3 to use to compute componentwise division. + /// Right hand side uint to use to compute componentwise division. + /// uint2x3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 operator / (uint2x3 lhs, uint rhs) { return new uint2x3 (lhs.c0 / rhs, lhs.c1 / rhs, lhs.c2 / rhs); } + + /// Returns the result of a componentwise division operation on a uint value and a uint2x3 matrix. + /// Left hand side uint to use to compute componentwise division. + /// Right hand side uint2x3 to use to compute componentwise division. + /// uint2x3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 operator / (uint lhs, uint2x3 rhs) { return new uint2x3 (lhs / rhs.c0, lhs / rhs.c1, lhs / rhs.c2); } + + + /// Returns the result of a componentwise modulus operation on two uint2x3 matrices. + /// Left hand side uint2x3 to use to compute componentwise modulus. + /// Right hand side uint2x3 to use to compute componentwise modulus. + /// uint2x3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 operator % (uint2x3 lhs, uint2x3 rhs) { return new uint2x3 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1, lhs.c2 % rhs.c2); } + + /// Returns the result of a componentwise modulus operation on a uint2x3 matrix and a uint value. + /// Left hand side uint2x3 to use to compute componentwise modulus. + /// Right hand side uint to use to compute componentwise modulus. + /// uint2x3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 operator % (uint2x3 lhs, uint rhs) { return new uint2x3 (lhs.c0 % rhs, lhs.c1 % rhs, lhs.c2 % rhs); } + + /// Returns the result of a componentwise modulus operation on a uint value and a uint2x3 matrix. + /// Left hand side uint to use to compute componentwise modulus. + /// Right hand side uint2x3 to use to compute componentwise modulus. + /// uint2x3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 operator % (uint lhs, uint2x3 rhs) { return new uint2x3 (lhs % rhs.c0, lhs % rhs.c1, lhs % rhs.c2); } + + + /// Returns the result of a componentwise increment operation on a uint2x3 matrix. + /// Value to use when computing the componentwise increment. + /// uint2x3 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 operator ++ (uint2x3 val) { return new uint2x3 (++val.c0, ++val.c1, ++val.c2); } + + + /// Returns the result of a componentwise decrement operation on a uint2x3 matrix. + /// Value to use when computing the componentwise decrement. + /// uint2x3 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 operator -- (uint2x3 val) { return new uint2x3 (--val.c0, --val.c1, --val.c2); } + + + /// Returns the result of a componentwise less than operation on two uint2x3 matrices. + /// Left hand side uint2x3 to use to compute componentwise less than. + /// Right hand side uint2x3 to use to compute componentwise less than. + /// bool2x3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator < (uint2x3 lhs, uint2x3 rhs) { return new bool2x3 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1, lhs.c2 < rhs.c2); } + + /// Returns the result of a componentwise less than operation on a uint2x3 matrix and a uint value. + /// Left hand side uint2x3 to use to compute componentwise less than. + /// Right hand side uint to use to compute componentwise less than. + /// bool2x3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator < (uint2x3 lhs, uint rhs) { return new bool2x3 (lhs.c0 < rhs, lhs.c1 < rhs, lhs.c2 < rhs); } + + /// Returns the result of a componentwise less than operation on a uint value and a uint2x3 matrix. + /// Left hand side uint to use to compute componentwise less than. + /// Right hand side uint2x3 to use to compute componentwise less than. + /// bool2x3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator < (uint lhs, uint2x3 rhs) { return new bool2x3 (lhs < rhs.c0, lhs < rhs.c1, lhs < rhs.c2); } + + + /// Returns the result of a componentwise less or equal operation on two uint2x3 matrices. + /// Left hand side uint2x3 to use to compute componentwise less or equal. + /// Right hand side uint2x3 to use to compute componentwise less or equal. + /// bool2x3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator <= (uint2x3 lhs, uint2x3 rhs) { return new bool2x3 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1, lhs.c2 <= rhs.c2); } + + /// Returns the result of a componentwise less or equal operation on a uint2x3 matrix and a uint value. + /// Left hand side uint2x3 to use to compute componentwise less or equal. + /// Right hand side uint to use to compute componentwise less or equal. + /// bool2x3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator <= (uint2x3 lhs, uint rhs) { return new bool2x3 (lhs.c0 <= rhs, lhs.c1 <= rhs, lhs.c2 <= rhs); } + + /// Returns the result of a componentwise less or equal operation on a uint value and a uint2x3 matrix. + /// Left hand side uint to use to compute componentwise less or equal. + /// Right hand side uint2x3 to use to compute componentwise less or equal. + /// bool2x3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator <= (uint lhs, uint2x3 rhs) { return new bool2x3 (lhs <= rhs.c0, lhs <= rhs.c1, lhs <= rhs.c2); } + + + /// Returns the result of a componentwise greater than operation on two uint2x3 matrices. + /// Left hand side uint2x3 to use to compute componentwise greater than. + /// Right hand side uint2x3 to use to compute componentwise greater than. + /// bool2x3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator > (uint2x3 lhs, uint2x3 rhs) { return new bool2x3 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1, lhs.c2 > rhs.c2); } + + /// Returns the result of a componentwise greater than operation on a uint2x3 matrix and a uint value. + /// Left hand side uint2x3 to use to compute componentwise greater than. + /// Right hand side uint to use to compute componentwise greater than. + /// bool2x3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator > (uint2x3 lhs, uint rhs) { return new bool2x3 (lhs.c0 > rhs, lhs.c1 > rhs, lhs.c2 > rhs); } + + /// Returns the result of a componentwise greater than operation on a uint value and a uint2x3 matrix. + /// Left hand side uint to use to compute componentwise greater than. + /// Right hand side uint2x3 to use to compute componentwise greater than. + /// bool2x3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator > (uint lhs, uint2x3 rhs) { return new bool2x3 (lhs > rhs.c0, lhs > rhs.c1, lhs > rhs.c2); } + + + /// Returns the result of a componentwise greater or equal operation on two uint2x3 matrices. + /// Left hand side uint2x3 to use to compute componentwise greater or equal. + /// Right hand side uint2x3 to use to compute componentwise greater or equal. + /// bool2x3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator >= (uint2x3 lhs, uint2x3 rhs) { return new bool2x3 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1, lhs.c2 >= rhs.c2); } + + /// Returns the result of a componentwise greater or equal operation on a uint2x3 matrix and a uint value. + /// Left hand side uint2x3 to use to compute componentwise greater or equal. + /// Right hand side uint to use to compute componentwise greater or equal. + /// bool2x3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator >= (uint2x3 lhs, uint rhs) { return new bool2x3 (lhs.c0 >= rhs, lhs.c1 >= rhs, lhs.c2 >= rhs); } + + /// Returns the result of a componentwise greater or equal operation on a uint value and a uint2x3 matrix. + /// Left hand side uint to use to compute componentwise greater or equal. + /// Right hand side uint2x3 to use to compute componentwise greater or equal. + /// bool2x3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator >= (uint lhs, uint2x3 rhs) { return new bool2x3 (lhs >= rhs.c0, lhs >= rhs.c1, lhs >= rhs.c2); } + + + /// Returns the result of a componentwise unary minus operation on a uint2x3 matrix. + /// Value to use when computing the componentwise unary minus. + /// uint2x3 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 operator - (uint2x3 val) { return new uint2x3 (-val.c0, -val.c1, -val.c2); } + + + /// Returns the result of a componentwise unary plus operation on a uint2x3 matrix. + /// Value to use when computing the componentwise unary plus. + /// uint2x3 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 operator + (uint2x3 val) { return new uint2x3 (+val.c0, +val.c1, +val.c2); } + + + /// Returns the result of a componentwise left shift operation on a uint2x3 matrix by a number of bits specified by a single int. + /// The matrix to left shift. + /// The number of bits to left shift. + /// The result of the componentwise left shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 operator << (uint2x3 x, int n) { return new uint2x3 (x.c0 << n, x.c1 << n, x.c2 << n); } + + /// Returns the result of a componentwise right shift operation on a uint2x3 matrix by a number of bits specified by a single int. + /// The matrix to right shift. + /// The number of bits to right shift. + /// The result of the componentwise right shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 operator >> (uint2x3 x, int n) { return new uint2x3 (x.c0 >> n, x.c1 >> n, x.c2 >> n); } + + /// Returns the result of a componentwise equality operation on two uint2x3 matrices. + /// Left hand side uint2x3 to use to compute componentwise equality. + /// Right hand side uint2x3 to use to compute componentwise equality. + /// bool2x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator == (uint2x3 lhs, uint2x3 rhs) { return new bool2x3 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2); } + + /// Returns the result of a componentwise equality operation on a uint2x3 matrix and a uint value. + /// Left hand side uint2x3 to use to compute componentwise equality. + /// Right hand side uint to use to compute componentwise equality. + /// bool2x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator == (uint2x3 lhs, uint rhs) { return new bool2x3 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs); } + + /// Returns the result of a componentwise equality operation on a uint value and a uint2x3 matrix. + /// Left hand side uint to use to compute componentwise equality. + /// Right hand side uint2x3 to use to compute componentwise equality. + /// bool2x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator == (uint lhs, uint2x3 rhs) { return new bool2x3 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2); } + + + /// Returns the result of a componentwise not equal operation on two uint2x3 matrices. + /// Left hand side uint2x3 to use to compute componentwise not equal. + /// Right hand side uint2x3 to use to compute componentwise not equal. + /// bool2x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator != (uint2x3 lhs, uint2x3 rhs) { return new bool2x3 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2); } + + /// Returns the result of a componentwise not equal operation on a uint2x3 matrix and a uint value. + /// Left hand side uint2x3 to use to compute componentwise not equal. + /// Right hand side uint to use to compute componentwise not equal. + /// bool2x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator != (uint2x3 lhs, uint rhs) { return new bool2x3 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs); } + + /// Returns the result of a componentwise not equal operation on a uint value and a uint2x3 matrix. + /// Left hand side uint to use to compute componentwise not equal. + /// Right hand side uint2x3 to use to compute componentwise not equal. + /// bool2x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x3 operator != (uint lhs, uint2x3 rhs) { return new bool2x3 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2); } + + + /// Returns the result of a componentwise bitwise not operation on a uint2x3 matrix. + /// Value to use when computing the componentwise bitwise not. + /// uint2x3 result of the componentwise bitwise not. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 operator ~ (uint2x3 val) { return new uint2x3 (~val.c0, ~val.c1, ~val.c2); } + + + /// Returns the result of a componentwise bitwise and operation on two uint2x3 matrices. + /// Left hand side uint2x3 to use to compute componentwise bitwise and. + /// Right hand side uint2x3 to use to compute componentwise bitwise and. + /// uint2x3 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 operator & (uint2x3 lhs, uint2x3 rhs) { return new uint2x3 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1, lhs.c2 & rhs.c2); } + + /// Returns the result of a componentwise bitwise and operation on a uint2x3 matrix and a uint value. + /// Left hand side uint2x3 to use to compute componentwise bitwise and. + /// Right hand side uint to use to compute componentwise bitwise and. + /// uint2x3 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 operator & (uint2x3 lhs, uint rhs) { return new uint2x3 (lhs.c0 & rhs, lhs.c1 & rhs, lhs.c2 & rhs); } + + /// Returns the result of a componentwise bitwise and operation on a uint value and a uint2x3 matrix. + /// Left hand side uint to use to compute componentwise bitwise and. + /// Right hand side uint2x3 to use to compute componentwise bitwise and. + /// uint2x3 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 operator & (uint lhs, uint2x3 rhs) { return new uint2x3 (lhs & rhs.c0, lhs & rhs.c1, lhs & rhs.c2); } + + + /// Returns the result of a componentwise bitwise or operation on two uint2x3 matrices. + /// Left hand side uint2x3 to use to compute componentwise bitwise or. + /// Right hand side uint2x3 to use to compute componentwise bitwise or. + /// uint2x3 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 operator | (uint2x3 lhs, uint2x3 rhs) { return new uint2x3 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1, lhs.c2 | rhs.c2); } + + /// Returns the result of a componentwise bitwise or operation on a uint2x3 matrix and a uint value. + /// Left hand side uint2x3 to use to compute componentwise bitwise or. + /// Right hand side uint to use to compute componentwise bitwise or. + /// uint2x3 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 operator | (uint2x3 lhs, uint rhs) { return new uint2x3 (lhs.c0 | rhs, lhs.c1 | rhs, lhs.c2 | rhs); } + + /// Returns the result of a componentwise bitwise or operation on a uint value and a uint2x3 matrix. + /// Left hand side uint to use to compute componentwise bitwise or. + /// Right hand side uint2x3 to use to compute componentwise bitwise or. + /// uint2x3 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 operator | (uint lhs, uint2x3 rhs) { return new uint2x3 (lhs | rhs.c0, lhs | rhs.c1, lhs | rhs.c2); } + + + /// Returns the result of a componentwise bitwise exclusive or operation on two uint2x3 matrices. + /// Left hand side uint2x3 to use to compute componentwise bitwise exclusive or. + /// Right hand side uint2x3 to use to compute componentwise bitwise exclusive or. + /// uint2x3 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 operator ^ (uint2x3 lhs, uint2x3 rhs) { return new uint2x3 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1, lhs.c2 ^ rhs.c2); } + + /// Returns the result of a componentwise bitwise exclusive or operation on a uint2x3 matrix and a uint value. + /// Left hand side uint2x3 to use to compute componentwise bitwise exclusive or. + /// Right hand side uint to use to compute componentwise bitwise exclusive or. + /// uint2x3 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 operator ^ (uint2x3 lhs, uint rhs) { return new uint2x3 (lhs.c0 ^ rhs, lhs.c1 ^ rhs, lhs.c2 ^ rhs); } + + /// Returns the result of a componentwise bitwise exclusive or operation on a uint value and a uint2x3 matrix. + /// Left hand side uint to use to compute componentwise bitwise exclusive or. + /// Right hand side uint2x3 to use to compute componentwise bitwise exclusive or. + /// uint2x3 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 operator ^ (uint lhs, uint2x3 rhs) { return new uint2x3 (lhs ^ rhs.c0, lhs ^ rhs.c1, lhs ^ rhs.c2); } + + + + /// Returns the uint2 element at a specified index. + unsafe public ref uint2 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 3) + throw new System.ArgumentException("index must be between[0...2]"); +#endif + fixed (uint2x3* array = &this) { return ref ((uint2*)array)[index]; } + } + } + + /// Returns true if the uint2x3 is equal to a given uint2x3, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(uint2x3 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2); } + + /// Returns true if the uint2x3 is equal to a given uint2x3, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is uint2x3 converted && Equals(converted); } + + + /// Returns a hash code for the uint2x3. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the uint2x3. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("uint2x3({0}, {1}, {2}, {3}, {4}, {5})", c0.x, c1.x, c2.x, c0.y, c1.y, c2.y); + } + + /// Returns a string representation of the uint2x3 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("uint2x3({0}, {1}, {2}, {3}, {4}, {5})", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c2.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c2.y.ToString(format, formatProvider)); + } + + } + + public static partial class math + { + /// Returns a uint2x3 matrix constructed from three uint2 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// uint2x3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 uint2x3(uint2 c0, uint2 c1, uint2 c2) { return new uint2x3(c0, c1, c2); } + + /// Returns a uint2x3 matrix constructed from from 6 uint values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// uint2x3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 uint2x3(uint m00, uint m01, uint m02, + uint m10, uint m11, uint m12) + { + return new uint2x3(m00, m01, m02, + m10, m11, m12); + } + + /// Returns a uint2x3 matrix constructed from a single uint value by assigning it to every component. + /// uint to convert to uint2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 uint2x3(uint v) { return new uint2x3(v); } + + /// Returns a uint2x3 matrix constructed from a single bool value by converting it to uint and assigning it to every component. + /// bool to convert to uint2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 uint2x3(bool v) { return new uint2x3(v); } + + /// Return a uint2x3 matrix constructed from a bool2x3 matrix by componentwise conversion. + /// bool2x3 to convert to uint2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 uint2x3(bool2x3 v) { return new uint2x3(v); } + + /// Returns a uint2x3 matrix constructed from a single int value by converting it to uint and assigning it to every component. + /// int to convert to uint2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 uint2x3(int v) { return new uint2x3(v); } + + /// Return a uint2x3 matrix constructed from a int2x3 matrix by componentwise conversion. + /// int2x3 to convert to uint2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 uint2x3(int2x3 v) { return new uint2x3(v); } + + /// Returns a uint2x3 matrix constructed from a single float value by converting it to uint and assigning it to every component. + /// float to convert to uint2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 uint2x3(float v) { return new uint2x3(v); } + + /// Return a uint2x3 matrix constructed from a float2x3 matrix by componentwise conversion. + /// float2x3 to convert to uint2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 uint2x3(float2x3 v) { return new uint2x3(v); } + + /// Returns a uint2x3 matrix constructed from a single double value by converting it to uint and assigning it to every component. + /// double to convert to uint2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 uint2x3(double v) { return new uint2x3(v); } + + /// Return a uint2x3 matrix constructed from a double2x3 matrix by componentwise conversion. + /// double2x3 to convert to uint2x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 uint2x3(double2x3 v) { return new uint2x3(v); } + + /// Return the uint3x2 transpose of a uint2x3 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 transpose(uint2x3 v) + { + return uint3x2( + v.c0.x, v.c0.y, + v.c1.x, v.c1.y, + v.c2.x, v.c2.y); + } + + /// Returns a uint hash code of a uint2x3 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(uint2x3 v) + { + return csum(v.c0 * uint2(0xEF63C699u, 0x9001903Fu) + + v.c1 * uint2(0xA895B9CDu, 0x9D23B201u) + + v.c2 * uint2(0x4B01D3E1u, 0x7461CA0Du)) + 0x79725379u; + } + + /// + /// Returns a uint2 vector hash code of a uint2x3 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint2 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 hashwide(uint2x3 v) + { + return (v.c0 * uint2(0xD6258E5Bu, 0xEE390C97u) + + v.c1 * uint2(0x9C8A2F05u, 0x4DDC6509u) + + v.c2 * uint2(0x7CF083CBu, 0x5C4D6CEDu)) + 0xF9137117u; + } + + } +} diff --git a/src/Unity.Mathematics/uint2x3.gen.cs.meta b/src/Unity.Mathematics/uint2x3.gen.cs.meta new file mode 100644 index 00000000..33e817bc --- /dev/null +++ b/src/Unity.Mathematics/uint2x3.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5b7bf1463aaa942d98a29d05b88ebd4e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/uint2x4.gen.cs b/src/Unity.Mathematics/uint2x4.gen.cs new file mode 100644 index 00000000..362e69a8 --- /dev/null +++ b/src/Unity.Mathematics/uint2x4.gen.cs @@ -0,0 +1,756 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 2x4 matrix of uints. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct uint2x4 : System.IEquatable, IFormattable + { + /// Column 0 of the matrix. + public uint2 c0; + /// Column 1 of the matrix. + public uint2 c1; + /// Column 2 of the matrix. + public uint2 c2; + /// Column 3 of the matrix. + public uint2 c3; + + /// uint2x4 zero value. + public static readonly uint2x4 zero; + + /// Constructs a uint2x4 matrix from four uint2 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// The matrix column c3 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2x4(uint2 c0, uint2 c1, uint2 c2, uint2 c3) + { + this.c0 = c0; + this.c1 = c1; + this.c2 = c2; + this.c3 = c3; + } + + /// Constructs a uint2x4 matrix from 8 uint values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 0, column 3 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 1, column 3 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2x4(uint m00, uint m01, uint m02, uint m03, + uint m10, uint m11, uint m12, uint m13) + { + this.c0 = new uint2(m00, m10); + this.c1 = new uint2(m01, m11); + this.c2 = new uint2(m02, m12); + this.c3 = new uint2(m03, m13); + } + + /// Constructs a uint2x4 matrix from a single uint value by assigning it to every component. + /// uint to convert to uint2x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2x4(uint v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + this.c3 = v; + } + + /// Constructs a uint2x4 matrix from a single bool value by converting it to uint and assigning it to every component. + /// bool to convert to uint2x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2x4(bool v) + { + this.c0 = math.select(new uint2(0u), new uint2(1u), v); + this.c1 = math.select(new uint2(0u), new uint2(1u), v); + this.c2 = math.select(new uint2(0u), new uint2(1u), v); + this.c3 = math.select(new uint2(0u), new uint2(1u), v); + } + + /// Constructs a uint2x4 matrix from a bool2x4 matrix by componentwise conversion. + /// bool2x4 to convert to uint2x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2x4(bool2x4 v) + { + this.c0 = math.select(new uint2(0u), new uint2(1u), v.c0); + this.c1 = math.select(new uint2(0u), new uint2(1u), v.c1); + this.c2 = math.select(new uint2(0u), new uint2(1u), v.c2); + this.c3 = math.select(new uint2(0u), new uint2(1u), v.c3); + } + + /// Constructs a uint2x4 matrix from a single int value by converting it to uint and assigning it to every component. + /// int to convert to uint2x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2x4(int v) + { + this.c0 = (uint2)v; + this.c1 = (uint2)v; + this.c2 = (uint2)v; + this.c3 = (uint2)v; + } + + /// Constructs a uint2x4 matrix from a int2x4 matrix by componentwise conversion. + /// int2x4 to convert to uint2x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2x4(int2x4 v) + { + this.c0 = (uint2)v.c0; + this.c1 = (uint2)v.c1; + this.c2 = (uint2)v.c2; + this.c3 = (uint2)v.c3; + } + + /// Constructs a uint2x4 matrix from a single float value by converting it to uint and assigning it to every component. + /// float to convert to uint2x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2x4(float v) + { + this.c0 = (uint2)v; + this.c1 = (uint2)v; + this.c2 = (uint2)v; + this.c3 = (uint2)v; + } + + /// Constructs a uint2x4 matrix from a float2x4 matrix by componentwise conversion. + /// float2x4 to convert to uint2x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2x4(float2x4 v) + { + this.c0 = (uint2)v.c0; + this.c1 = (uint2)v.c1; + this.c2 = (uint2)v.c2; + this.c3 = (uint2)v.c3; + } + + /// Constructs a uint2x4 matrix from a single double value by converting it to uint and assigning it to every component. + /// double to convert to uint2x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2x4(double v) + { + this.c0 = (uint2)v; + this.c1 = (uint2)v; + this.c2 = (uint2)v; + this.c3 = (uint2)v; + } + + /// Constructs a uint2x4 matrix from a double2x4 matrix by componentwise conversion. + /// double2x4 to convert to uint2x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint2x4(double2x4 v) + { + this.c0 = (uint2)v.c0; + this.c1 = (uint2)v.c1; + this.c2 = (uint2)v.c2; + this.c3 = (uint2)v.c3; + } + + + /// Implicitly converts a single uint value to a uint2x4 matrix by assigning it to every component. + /// uint to convert to uint2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator uint2x4(uint v) { return new uint2x4(v); } + + /// Explicitly converts a single bool value to a uint2x4 matrix by converting it to uint and assigning it to every component. + /// bool to convert to uint2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint2x4(bool v) { return new uint2x4(v); } + + /// Explicitly converts a bool2x4 matrix to a uint2x4 matrix by componentwise conversion. + /// bool2x4 to convert to uint2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint2x4(bool2x4 v) { return new uint2x4(v); } + + /// Explicitly converts a single int value to a uint2x4 matrix by converting it to uint and assigning it to every component. + /// int to convert to uint2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint2x4(int v) { return new uint2x4(v); } + + /// Explicitly converts a int2x4 matrix to a uint2x4 matrix by componentwise conversion. + /// int2x4 to convert to uint2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint2x4(int2x4 v) { return new uint2x4(v); } + + /// Explicitly converts a single float value to a uint2x4 matrix by converting it to uint and assigning it to every component. + /// float to convert to uint2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint2x4(float v) { return new uint2x4(v); } + + /// Explicitly converts a float2x4 matrix to a uint2x4 matrix by componentwise conversion. + /// float2x4 to convert to uint2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint2x4(float2x4 v) { return new uint2x4(v); } + + /// Explicitly converts a single double value to a uint2x4 matrix by converting it to uint and assigning it to every component. + /// double to convert to uint2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint2x4(double v) { return new uint2x4(v); } + + /// Explicitly converts a double2x4 matrix to a uint2x4 matrix by componentwise conversion. + /// double2x4 to convert to uint2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint2x4(double2x4 v) { return new uint2x4(v); } + + + /// Returns the result of a componentwise multiplication operation on two uint2x4 matrices. + /// Left hand side uint2x4 to use to compute componentwise multiplication. + /// Right hand side uint2x4 to use to compute componentwise multiplication. + /// uint2x4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 operator * (uint2x4 lhs, uint2x4 rhs) { return new uint2x4 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1, lhs.c2 * rhs.c2, lhs.c3 * rhs.c3); } + + /// Returns the result of a componentwise multiplication operation on a uint2x4 matrix and a uint value. + /// Left hand side uint2x4 to use to compute componentwise multiplication. + /// Right hand side uint to use to compute componentwise multiplication. + /// uint2x4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 operator * (uint2x4 lhs, uint rhs) { return new uint2x4 (lhs.c0 * rhs, lhs.c1 * rhs, lhs.c2 * rhs, lhs.c3 * rhs); } + + /// Returns the result of a componentwise multiplication operation on a uint value and a uint2x4 matrix. + /// Left hand side uint to use to compute componentwise multiplication. + /// Right hand side uint2x4 to use to compute componentwise multiplication. + /// uint2x4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 operator * (uint lhs, uint2x4 rhs) { return new uint2x4 (lhs * rhs.c0, lhs * rhs.c1, lhs * rhs.c2, lhs * rhs.c3); } + + + /// Returns the result of a componentwise addition operation on two uint2x4 matrices. + /// Left hand side uint2x4 to use to compute componentwise addition. + /// Right hand side uint2x4 to use to compute componentwise addition. + /// uint2x4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 operator + (uint2x4 lhs, uint2x4 rhs) { return new uint2x4 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1, lhs.c2 + rhs.c2, lhs.c3 + rhs.c3); } + + /// Returns the result of a componentwise addition operation on a uint2x4 matrix and a uint value. + /// Left hand side uint2x4 to use to compute componentwise addition. + /// Right hand side uint to use to compute componentwise addition. + /// uint2x4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 operator + (uint2x4 lhs, uint rhs) { return new uint2x4 (lhs.c0 + rhs, lhs.c1 + rhs, lhs.c2 + rhs, lhs.c3 + rhs); } + + /// Returns the result of a componentwise addition operation on a uint value and a uint2x4 matrix. + /// Left hand side uint to use to compute componentwise addition. + /// Right hand side uint2x4 to use to compute componentwise addition. + /// uint2x4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 operator + (uint lhs, uint2x4 rhs) { return new uint2x4 (lhs + rhs.c0, lhs + rhs.c1, lhs + rhs.c2, lhs + rhs.c3); } + + + /// Returns the result of a componentwise subtraction operation on two uint2x4 matrices. + /// Left hand side uint2x4 to use to compute componentwise subtraction. + /// Right hand side uint2x4 to use to compute componentwise subtraction. + /// uint2x4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 operator - (uint2x4 lhs, uint2x4 rhs) { return new uint2x4 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1, lhs.c2 - rhs.c2, lhs.c3 - rhs.c3); } + + /// Returns the result of a componentwise subtraction operation on a uint2x4 matrix and a uint value. + /// Left hand side uint2x4 to use to compute componentwise subtraction. + /// Right hand side uint to use to compute componentwise subtraction. + /// uint2x4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 operator - (uint2x4 lhs, uint rhs) { return new uint2x4 (lhs.c0 - rhs, lhs.c1 - rhs, lhs.c2 - rhs, lhs.c3 - rhs); } + + /// Returns the result of a componentwise subtraction operation on a uint value and a uint2x4 matrix. + /// Left hand side uint to use to compute componentwise subtraction. + /// Right hand side uint2x4 to use to compute componentwise subtraction. + /// uint2x4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 operator - (uint lhs, uint2x4 rhs) { return new uint2x4 (lhs - rhs.c0, lhs - rhs.c1, lhs - rhs.c2, lhs - rhs.c3); } + + + /// Returns the result of a componentwise division operation on two uint2x4 matrices. + /// Left hand side uint2x4 to use to compute componentwise division. + /// Right hand side uint2x4 to use to compute componentwise division. + /// uint2x4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 operator / (uint2x4 lhs, uint2x4 rhs) { return new uint2x4 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1, lhs.c2 / rhs.c2, lhs.c3 / rhs.c3); } + + /// Returns the result of a componentwise division operation on a uint2x4 matrix and a uint value. + /// Left hand side uint2x4 to use to compute componentwise division. + /// Right hand side uint to use to compute componentwise division. + /// uint2x4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 operator / (uint2x4 lhs, uint rhs) { return new uint2x4 (lhs.c0 / rhs, lhs.c1 / rhs, lhs.c2 / rhs, lhs.c3 / rhs); } + + /// Returns the result of a componentwise division operation on a uint value and a uint2x4 matrix. + /// Left hand side uint to use to compute componentwise division. + /// Right hand side uint2x4 to use to compute componentwise division. + /// uint2x4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 operator / (uint lhs, uint2x4 rhs) { return new uint2x4 (lhs / rhs.c0, lhs / rhs.c1, lhs / rhs.c2, lhs / rhs.c3); } + + + /// Returns the result of a componentwise modulus operation on two uint2x4 matrices. + /// Left hand side uint2x4 to use to compute componentwise modulus. + /// Right hand side uint2x4 to use to compute componentwise modulus. + /// uint2x4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 operator % (uint2x4 lhs, uint2x4 rhs) { return new uint2x4 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1, lhs.c2 % rhs.c2, lhs.c3 % rhs.c3); } + + /// Returns the result of a componentwise modulus operation on a uint2x4 matrix and a uint value. + /// Left hand side uint2x4 to use to compute componentwise modulus. + /// Right hand side uint to use to compute componentwise modulus. + /// uint2x4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 operator % (uint2x4 lhs, uint rhs) { return new uint2x4 (lhs.c0 % rhs, lhs.c1 % rhs, lhs.c2 % rhs, lhs.c3 % rhs); } + + /// Returns the result of a componentwise modulus operation on a uint value and a uint2x4 matrix. + /// Left hand side uint to use to compute componentwise modulus. + /// Right hand side uint2x4 to use to compute componentwise modulus. + /// uint2x4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 operator % (uint lhs, uint2x4 rhs) { return new uint2x4 (lhs % rhs.c0, lhs % rhs.c1, lhs % rhs.c2, lhs % rhs.c3); } + + + /// Returns the result of a componentwise increment operation on a uint2x4 matrix. + /// Value to use when computing the componentwise increment. + /// uint2x4 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 operator ++ (uint2x4 val) { return new uint2x4 (++val.c0, ++val.c1, ++val.c2, ++val.c3); } + + + /// Returns the result of a componentwise decrement operation on a uint2x4 matrix. + /// Value to use when computing the componentwise decrement. + /// uint2x4 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 operator -- (uint2x4 val) { return new uint2x4 (--val.c0, --val.c1, --val.c2, --val.c3); } + + + /// Returns the result of a componentwise less than operation on two uint2x4 matrices. + /// Left hand side uint2x4 to use to compute componentwise less than. + /// Right hand side uint2x4 to use to compute componentwise less than. + /// bool2x4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator < (uint2x4 lhs, uint2x4 rhs) { return new bool2x4 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1, lhs.c2 < rhs.c2, lhs.c3 < rhs.c3); } + + /// Returns the result of a componentwise less than operation on a uint2x4 matrix and a uint value. + /// Left hand side uint2x4 to use to compute componentwise less than. + /// Right hand side uint to use to compute componentwise less than. + /// bool2x4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator < (uint2x4 lhs, uint rhs) { return new bool2x4 (lhs.c0 < rhs, lhs.c1 < rhs, lhs.c2 < rhs, lhs.c3 < rhs); } + + /// Returns the result of a componentwise less than operation on a uint value and a uint2x4 matrix. + /// Left hand side uint to use to compute componentwise less than. + /// Right hand side uint2x4 to use to compute componentwise less than. + /// bool2x4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator < (uint lhs, uint2x4 rhs) { return new bool2x4 (lhs < rhs.c0, lhs < rhs.c1, lhs < rhs.c2, lhs < rhs.c3); } + + + /// Returns the result of a componentwise less or equal operation on two uint2x4 matrices. + /// Left hand side uint2x4 to use to compute componentwise less or equal. + /// Right hand side uint2x4 to use to compute componentwise less or equal. + /// bool2x4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator <= (uint2x4 lhs, uint2x4 rhs) { return new bool2x4 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1, lhs.c2 <= rhs.c2, lhs.c3 <= rhs.c3); } + + /// Returns the result of a componentwise less or equal operation on a uint2x4 matrix and a uint value. + /// Left hand side uint2x4 to use to compute componentwise less or equal. + /// Right hand side uint to use to compute componentwise less or equal. + /// bool2x4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator <= (uint2x4 lhs, uint rhs) { return new bool2x4 (lhs.c0 <= rhs, lhs.c1 <= rhs, lhs.c2 <= rhs, lhs.c3 <= rhs); } + + /// Returns the result of a componentwise less or equal operation on a uint value and a uint2x4 matrix. + /// Left hand side uint to use to compute componentwise less or equal. + /// Right hand side uint2x4 to use to compute componentwise less or equal. + /// bool2x4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator <= (uint lhs, uint2x4 rhs) { return new bool2x4 (lhs <= rhs.c0, lhs <= rhs.c1, lhs <= rhs.c2, lhs <= rhs.c3); } + + + /// Returns the result of a componentwise greater than operation on two uint2x4 matrices. + /// Left hand side uint2x4 to use to compute componentwise greater than. + /// Right hand side uint2x4 to use to compute componentwise greater than. + /// bool2x4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator > (uint2x4 lhs, uint2x4 rhs) { return new bool2x4 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1, lhs.c2 > rhs.c2, lhs.c3 > rhs.c3); } + + /// Returns the result of a componentwise greater than operation on a uint2x4 matrix and a uint value. + /// Left hand side uint2x4 to use to compute componentwise greater than. + /// Right hand side uint to use to compute componentwise greater than. + /// bool2x4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator > (uint2x4 lhs, uint rhs) { return new bool2x4 (lhs.c0 > rhs, lhs.c1 > rhs, lhs.c2 > rhs, lhs.c3 > rhs); } + + /// Returns the result of a componentwise greater than operation on a uint value and a uint2x4 matrix. + /// Left hand side uint to use to compute componentwise greater than. + /// Right hand side uint2x4 to use to compute componentwise greater than. + /// bool2x4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator > (uint lhs, uint2x4 rhs) { return new bool2x4 (lhs > rhs.c0, lhs > rhs.c1, lhs > rhs.c2, lhs > rhs.c3); } + + + /// Returns the result of a componentwise greater or equal operation on two uint2x4 matrices. + /// Left hand side uint2x4 to use to compute componentwise greater or equal. + /// Right hand side uint2x4 to use to compute componentwise greater or equal. + /// bool2x4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator >= (uint2x4 lhs, uint2x4 rhs) { return new bool2x4 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1, lhs.c2 >= rhs.c2, lhs.c3 >= rhs.c3); } + + /// Returns the result of a componentwise greater or equal operation on a uint2x4 matrix and a uint value. + /// Left hand side uint2x4 to use to compute componentwise greater or equal. + /// Right hand side uint to use to compute componentwise greater or equal. + /// bool2x4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator >= (uint2x4 lhs, uint rhs) { return new bool2x4 (lhs.c0 >= rhs, lhs.c1 >= rhs, lhs.c2 >= rhs, lhs.c3 >= rhs); } + + /// Returns the result of a componentwise greater or equal operation on a uint value and a uint2x4 matrix. + /// Left hand side uint to use to compute componentwise greater or equal. + /// Right hand side uint2x4 to use to compute componentwise greater or equal. + /// bool2x4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator >= (uint lhs, uint2x4 rhs) { return new bool2x4 (lhs >= rhs.c0, lhs >= rhs.c1, lhs >= rhs.c2, lhs >= rhs.c3); } + + + /// Returns the result of a componentwise unary minus operation on a uint2x4 matrix. + /// Value to use when computing the componentwise unary minus. + /// uint2x4 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 operator - (uint2x4 val) { return new uint2x4 (-val.c0, -val.c1, -val.c2, -val.c3); } + + + /// Returns the result of a componentwise unary plus operation on a uint2x4 matrix. + /// Value to use when computing the componentwise unary plus. + /// uint2x4 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 operator + (uint2x4 val) { return new uint2x4 (+val.c0, +val.c1, +val.c2, +val.c3); } + + + /// Returns the result of a componentwise left shift operation on a uint2x4 matrix by a number of bits specified by a single int. + /// The matrix to left shift. + /// The number of bits to left shift. + /// The result of the componentwise left shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 operator << (uint2x4 x, int n) { return new uint2x4 (x.c0 << n, x.c1 << n, x.c2 << n, x.c3 << n); } + + /// Returns the result of a componentwise right shift operation on a uint2x4 matrix by a number of bits specified by a single int. + /// The matrix to right shift. + /// The number of bits to right shift. + /// The result of the componentwise right shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 operator >> (uint2x4 x, int n) { return new uint2x4 (x.c0 >> n, x.c1 >> n, x.c2 >> n, x.c3 >> n); } + + /// Returns the result of a componentwise equality operation on two uint2x4 matrices. + /// Left hand side uint2x4 to use to compute componentwise equality. + /// Right hand side uint2x4 to use to compute componentwise equality. + /// bool2x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator == (uint2x4 lhs, uint2x4 rhs) { return new bool2x4 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2, lhs.c3 == rhs.c3); } + + /// Returns the result of a componentwise equality operation on a uint2x4 matrix and a uint value. + /// Left hand side uint2x4 to use to compute componentwise equality. + /// Right hand side uint to use to compute componentwise equality. + /// bool2x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator == (uint2x4 lhs, uint rhs) { return new bool2x4 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs, lhs.c3 == rhs); } + + /// Returns the result of a componentwise equality operation on a uint value and a uint2x4 matrix. + /// Left hand side uint to use to compute componentwise equality. + /// Right hand side uint2x4 to use to compute componentwise equality. + /// bool2x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator == (uint lhs, uint2x4 rhs) { return new bool2x4 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2, lhs == rhs.c3); } + + + /// Returns the result of a componentwise not equal operation on two uint2x4 matrices. + /// Left hand side uint2x4 to use to compute componentwise not equal. + /// Right hand side uint2x4 to use to compute componentwise not equal. + /// bool2x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator != (uint2x4 lhs, uint2x4 rhs) { return new bool2x4 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2, lhs.c3 != rhs.c3); } + + /// Returns the result of a componentwise not equal operation on a uint2x4 matrix and a uint value. + /// Left hand side uint2x4 to use to compute componentwise not equal. + /// Right hand side uint to use to compute componentwise not equal. + /// bool2x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator != (uint2x4 lhs, uint rhs) { return new bool2x4 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs, lhs.c3 != rhs); } + + /// Returns the result of a componentwise not equal operation on a uint value and a uint2x4 matrix. + /// Left hand side uint to use to compute componentwise not equal. + /// Right hand side uint2x4 to use to compute componentwise not equal. + /// bool2x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool2x4 operator != (uint lhs, uint2x4 rhs) { return new bool2x4 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2, lhs != rhs.c3); } + + + /// Returns the result of a componentwise bitwise not operation on a uint2x4 matrix. + /// Value to use when computing the componentwise bitwise not. + /// uint2x4 result of the componentwise bitwise not. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 operator ~ (uint2x4 val) { return new uint2x4 (~val.c0, ~val.c1, ~val.c2, ~val.c3); } + + + /// Returns the result of a componentwise bitwise and operation on two uint2x4 matrices. + /// Left hand side uint2x4 to use to compute componentwise bitwise and. + /// Right hand side uint2x4 to use to compute componentwise bitwise and. + /// uint2x4 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 operator & (uint2x4 lhs, uint2x4 rhs) { return new uint2x4 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1, lhs.c2 & rhs.c2, lhs.c3 & rhs.c3); } + + /// Returns the result of a componentwise bitwise and operation on a uint2x4 matrix and a uint value. + /// Left hand side uint2x4 to use to compute componentwise bitwise and. + /// Right hand side uint to use to compute componentwise bitwise and. + /// uint2x4 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 operator & (uint2x4 lhs, uint rhs) { return new uint2x4 (lhs.c0 & rhs, lhs.c1 & rhs, lhs.c2 & rhs, lhs.c3 & rhs); } + + /// Returns the result of a componentwise bitwise and operation on a uint value and a uint2x4 matrix. + /// Left hand side uint to use to compute componentwise bitwise and. + /// Right hand side uint2x4 to use to compute componentwise bitwise and. + /// uint2x4 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 operator & (uint lhs, uint2x4 rhs) { return new uint2x4 (lhs & rhs.c0, lhs & rhs.c1, lhs & rhs.c2, lhs & rhs.c3); } + + + /// Returns the result of a componentwise bitwise or operation on two uint2x4 matrices. + /// Left hand side uint2x4 to use to compute componentwise bitwise or. + /// Right hand side uint2x4 to use to compute componentwise bitwise or. + /// uint2x4 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 operator | (uint2x4 lhs, uint2x4 rhs) { return new uint2x4 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1, lhs.c2 | rhs.c2, lhs.c3 | rhs.c3); } + + /// Returns the result of a componentwise bitwise or operation on a uint2x4 matrix and a uint value. + /// Left hand side uint2x4 to use to compute componentwise bitwise or. + /// Right hand side uint to use to compute componentwise bitwise or. + /// uint2x4 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 operator | (uint2x4 lhs, uint rhs) { return new uint2x4 (lhs.c0 | rhs, lhs.c1 | rhs, lhs.c2 | rhs, lhs.c3 | rhs); } + + /// Returns the result of a componentwise bitwise or operation on a uint value and a uint2x4 matrix. + /// Left hand side uint to use to compute componentwise bitwise or. + /// Right hand side uint2x4 to use to compute componentwise bitwise or. + /// uint2x4 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 operator | (uint lhs, uint2x4 rhs) { return new uint2x4 (lhs | rhs.c0, lhs | rhs.c1, lhs | rhs.c2, lhs | rhs.c3); } + + + /// Returns the result of a componentwise bitwise exclusive or operation on two uint2x4 matrices. + /// Left hand side uint2x4 to use to compute componentwise bitwise exclusive or. + /// Right hand side uint2x4 to use to compute componentwise bitwise exclusive or. + /// uint2x4 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 operator ^ (uint2x4 lhs, uint2x4 rhs) { return new uint2x4 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1, lhs.c2 ^ rhs.c2, lhs.c3 ^ rhs.c3); } + + /// Returns the result of a componentwise bitwise exclusive or operation on a uint2x4 matrix and a uint value. + /// Left hand side uint2x4 to use to compute componentwise bitwise exclusive or. + /// Right hand side uint to use to compute componentwise bitwise exclusive or. + /// uint2x4 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 operator ^ (uint2x4 lhs, uint rhs) { return new uint2x4 (lhs.c0 ^ rhs, lhs.c1 ^ rhs, lhs.c2 ^ rhs, lhs.c3 ^ rhs); } + + /// Returns the result of a componentwise bitwise exclusive or operation on a uint value and a uint2x4 matrix. + /// Left hand side uint to use to compute componentwise bitwise exclusive or. + /// Right hand side uint2x4 to use to compute componentwise bitwise exclusive or. + /// uint2x4 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 operator ^ (uint lhs, uint2x4 rhs) { return new uint2x4 (lhs ^ rhs.c0, lhs ^ rhs.c1, lhs ^ rhs.c2, lhs ^ rhs.c3); } + + + + /// Returns the uint2 element at a specified index. + unsafe public ref uint2 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 4) + throw new System.ArgumentException("index must be between[0...3]"); +#endif + fixed (uint2x4* array = &this) { return ref ((uint2*)array)[index]; } + } + } + + /// Returns true if the uint2x4 is equal to a given uint2x4, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(uint2x4 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2) && c3.Equals(rhs.c3); } + + /// Returns true if the uint2x4 is equal to a given uint2x4, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is uint2x4 converted && Equals(converted); } + + + /// Returns a hash code for the uint2x4. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the uint2x4. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("uint2x4({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7})", c0.x, c1.x, c2.x, c3.x, c0.y, c1.y, c2.y, c3.y); + } + + /// Returns a string representation of the uint2x4 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("uint2x4({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7})", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c2.x.ToString(format, formatProvider), c3.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c2.y.ToString(format, formatProvider), c3.y.ToString(format, formatProvider)); + } + + } + + public static partial class math + { + /// Returns a uint2x4 matrix constructed from four uint2 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// The matrix column c3 will be set to this value. + /// uint2x4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 uint2x4(uint2 c0, uint2 c1, uint2 c2, uint2 c3) { return new uint2x4(c0, c1, c2, c3); } + + /// Returns a uint2x4 matrix constructed from from 8 uint values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 0, column 3 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 1, column 3 will be set to this value. + /// uint2x4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 uint2x4(uint m00, uint m01, uint m02, uint m03, + uint m10, uint m11, uint m12, uint m13) + { + return new uint2x4(m00, m01, m02, m03, + m10, m11, m12, m13); + } + + /// Returns a uint2x4 matrix constructed from a single uint value by assigning it to every component. + /// uint to convert to uint2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 uint2x4(uint v) { return new uint2x4(v); } + + /// Returns a uint2x4 matrix constructed from a single bool value by converting it to uint and assigning it to every component. + /// bool to convert to uint2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 uint2x4(bool v) { return new uint2x4(v); } + + /// Return a uint2x4 matrix constructed from a bool2x4 matrix by componentwise conversion. + /// bool2x4 to convert to uint2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 uint2x4(bool2x4 v) { return new uint2x4(v); } + + /// Returns a uint2x4 matrix constructed from a single int value by converting it to uint and assigning it to every component. + /// int to convert to uint2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 uint2x4(int v) { return new uint2x4(v); } + + /// Return a uint2x4 matrix constructed from a int2x4 matrix by componentwise conversion. + /// int2x4 to convert to uint2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 uint2x4(int2x4 v) { return new uint2x4(v); } + + /// Returns a uint2x4 matrix constructed from a single float value by converting it to uint and assigning it to every component. + /// float to convert to uint2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 uint2x4(float v) { return new uint2x4(v); } + + /// Return a uint2x4 matrix constructed from a float2x4 matrix by componentwise conversion. + /// float2x4 to convert to uint2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 uint2x4(float2x4 v) { return new uint2x4(v); } + + /// Returns a uint2x4 matrix constructed from a single double value by converting it to uint and assigning it to every component. + /// double to convert to uint2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 uint2x4(double v) { return new uint2x4(v); } + + /// Return a uint2x4 matrix constructed from a double2x4 matrix by componentwise conversion. + /// double2x4 to convert to uint2x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 uint2x4(double2x4 v) { return new uint2x4(v); } + + /// Return the uint4x2 transpose of a uint2x4 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 transpose(uint2x4 v) + { + return uint4x2( + v.c0.x, v.c0.y, + v.c1.x, v.c1.y, + v.c2.x, v.c2.y, + v.c3.x, v.c3.y); + } + + /// Returns a uint hash code of a uint2x4 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(uint2x4 v) + { + return csum(v.c0 * uint2(0x9DF50593u, 0xF18EEB85u) + + v.c1 * uint2(0x9E19BFC3u, 0x8196B06Fu) + + v.c2 * uint2(0xD24EFA19u, 0x7D8048BBu) + + v.c3 * uint2(0x713BD06Fu, 0x753AD6ADu)) + 0xD19764C7u; + } + + /// + /// Returns a uint2 vector hash code of a uint2x4 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint2 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 hashwide(uint2x4 v) + { + return (v.c0 * uint2(0xB5D0BF63u, 0xF9102C5Fu) + + v.c1 * uint2(0x9881FB9Fu, 0x56A1530Du) + + v.c2 * uint2(0x804B722Du, 0x738E50E5u) + + v.c3 * uint2(0x4FC93C25u, 0xCD0445A5u)) + 0xD2B90D9Bu; + } + + } +} diff --git a/src/Unity.Mathematics/uint2x4.gen.cs.meta b/src/Unity.Mathematics/uint2x4.gen.cs.meta new file mode 100644 index 00000000..058ceff3 --- /dev/null +++ b/src/Unity.Mathematics/uint2x4.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6acdbd744899541e28c4f19a9398b2b7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/uint3.cs b/src/Unity.Mathematics/uint3.cs deleted file mode 100644 index 7a7c42c1..00000000 --- a/src/Unity.Mathematics/uint3.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System.Runtime.CompilerServices; -using System.Diagnostics; - -#pragma warning disable 0660, 0661 - -namespace Unity.Mathematics -{ - [DebuggerTypeProxy(typeof(uint3.DebuggerProxy))] - [System.Serializable] - public partial struct uint3 - { - internal sealed class DebuggerProxy - { - public uint x; - public uint y; - public uint z; - - public DebuggerProxy(uint3 vec) - { - x = vec.x; - y = vec.y; - z = vec.z; - } - } - - public uint x; - public uint y; - public uint z; - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public uint3(uint val) { x = y = z = val; } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public uint3(uint x, uint y, uint z) - { - this.x = x; - this.y = y; - this.z = z; - } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public uint3(uint2 xy, uint z) - { - this.x = xy.x; - this.y = xy.y; - this.z = z; - } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public uint3(float3 val) - { - x = (uint)val.x; - y = (uint)val.y; - z = (uint)val.z; - } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static implicit operator uint3(uint d) { return new uint3(d); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static explicit operator uint3(float3 d) { return new uint3(d); } - - public override string ToString() - { - return string.Format("uint3({0}, {1}, {2})", x, y, z); - } - - } -} - diff --git a/src/Unity.Mathematics/uint3.cs.meta b/src/Unity.Mathematics/uint3.cs.meta deleted file mode 100644 index b0cc6045..00000000 --- a/src/Unity.Mathematics/uint3.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 6077b0fa17b14b44f8380684aade16bb -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/src/Unity.Mathematics/uint3.gen.cs b/src/Unity.Mathematics/uint3.gen.cs index 6cbe73e3..95df67b8 100644 --- a/src/Unity.Mathematics/uint3.gen.cs +++ b/src/Unity.Mathematics/uint3.gen.cs @@ -1,1105 +1,1921 @@ -// GENERATED CODE +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; using System.Runtime.CompilerServices; +using System.Diagnostics; +using Unity.IL2CPP.CompilerServices; + #pragma warning disable 0660, 0661 + namespace Unity.Mathematics { - public partial struct uint3 : System.IEquatable + /// A 3 component vector of uints. + [DebuggerTypeProxy(typeof(uint3.DebuggerProxy))] + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct uint3 : System.IEquatable, IFormattable { + /// x component of the vector. + public uint x; + /// y component of the vector. + public uint y; + /// z component of the vector. + public uint z; + + /// uint3 zero value. + public static readonly uint3 zero; + + /// Constructs a uint3 vector from three uint values. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + /// The constructed vector's z component will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3(uint x, uint y, uint z) + { + this.x = x; + this.y = y; + this.z = z; + } + + /// Constructs a uint3 vector from a uint value and a uint2 vector. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's yz components will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3(uint x, uint2 yz) + { + this.x = x; + this.y = yz.x; + this.z = yz.y; + } + + /// Constructs a uint3 vector from a uint2 vector and a uint value. + /// The constructed vector's xy components will be set to this value. + /// The constructed vector's z component will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3(uint2 xy, uint z) + { + this.x = xy.x; + this.y = xy.y; + this.z = z; + } + + /// Constructs a uint3 vector from a uint3 vector. + /// The constructed vector's xyz components will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3(uint3 xyz) + { + this.x = xyz.x; + this.y = xyz.y; + this.z = xyz.z; + } + + /// Constructs a uint3 vector from a single uint value by assigning it to every component. + /// uint to convert to uint3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3(uint v) + { + this.x = v; + this.y = v; + this.z = v; + } + + /// Constructs a uint3 vector from a single bool value by converting it to uint and assigning it to every component. + /// bool to convert to uint3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3(bool v) + { + this.x = v ? 1u : 0u; + this.y = v ? 1u : 0u; + this.z = v ? 1u : 0u; + } + + /// Constructs a uint3 vector from a bool3 vector by componentwise conversion. + /// bool3 to convert to uint3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3(bool3 v) + { + this.x = v.x ? 1u : 0u; + this.y = v.y ? 1u : 0u; + this.z = v.z ? 1u : 0u; + } + + /// Constructs a uint3 vector from a single int value by converting it to uint and assigning it to every component. + /// int to convert to uint3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3(int v) + { + this.x = (uint)v; + this.y = (uint)v; + this.z = (uint)v; + } + + /// Constructs a uint3 vector from a int3 vector by componentwise conversion. + /// int3 to convert to uint3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3(int3 v) + { + this.x = (uint)v.x; + this.y = (uint)v.y; + this.z = (uint)v.z; + } + + /// Constructs a uint3 vector from a single float value by converting it to uint and assigning it to every component. + /// float to convert to uint3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3(float v) + { + this.x = (uint)v; + this.y = (uint)v; + this.z = (uint)v; + } + + /// Constructs a uint3 vector from a float3 vector by componentwise conversion. + /// float3 to convert to uint3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3(float3 v) + { + this.x = (uint)v.x; + this.y = (uint)v.y; + this.z = (uint)v.z; + } + + /// Constructs a uint3 vector from a single double value by converting it to uint and assigning it to every component. + /// double to convert to uint3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3(double v) + { + this.x = (uint)v; + this.y = (uint)v; + this.z = (uint)v; + } + + /// Constructs a uint3 vector from a double3 vector by componentwise conversion. + /// double3 to convert to uint3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3(double3 v) + { + this.x = (uint)v.x; + this.y = (uint)v.y; + this.z = (uint)v.z; + } + - // mul - [MethodImpl(0x100)] + /// Implicitly converts a single uint value to a uint3 vector by assigning it to every component. + /// uint to convert to uint3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator uint3(uint v) { return new uint3(v); } + + /// Explicitly converts a single bool value to a uint3 vector by converting it to uint and assigning it to every component. + /// bool to convert to uint3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint3(bool v) { return new uint3(v); } + + /// Explicitly converts a bool3 vector to a uint3 vector by componentwise conversion. + /// bool3 to convert to uint3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint3(bool3 v) { return new uint3(v); } + + /// Explicitly converts a single int value to a uint3 vector by converting it to uint and assigning it to every component. + /// int to convert to uint3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint3(int v) { return new uint3(v); } + + /// Explicitly converts a int3 vector to a uint3 vector by componentwise conversion. + /// int3 to convert to uint3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint3(int3 v) { return new uint3(v); } + + /// Explicitly converts a single float value to a uint3 vector by converting it to uint and assigning it to every component. + /// float to convert to uint3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint3(float v) { return new uint3(v); } + + /// Explicitly converts a float3 vector to a uint3 vector by componentwise conversion. + /// float3 to convert to uint3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint3(float3 v) { return new uint3(v); } + + /// Explicitly converts a single double value to a uint3 vector by converting it to uint and assigning it to every component. + /// double to convert to uint3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint3(double v) { return new uint3(v); } + + /// Explicitly converts a double3 vector to a uint3 vector by componentwise conversion. + /// double3 to convert to uint3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint3(double3 v) { return new uint3(v); } + + + /// Returns the result of a componentwise multiplication operation on two uint3 vectors. + /// Left hand side uint3 to use to compute componentwise multiplication. + /// Right hand side uint3 to use to compute componentwise multiplication. + /// uint3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint3 operator * (uint3 lhs, uint3 rhs) { return new uint3 (lhs.x * rhs.x, lhs.y * rhs.y, lhs.z * rhs.z); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise multiplication operation on a uint3 vector and a uint value. + /// Left hand side uint3 to use to compute componentwise multiplication. + /// Right hand side uint to use to compute componentwise multiplication. + /// uint3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint3 operator * (uint3 lhs, uint rhs) { return new uint3 (lhs.x * rhs, lhs.y * rhs, lhs.z * rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise multiplication operation on a uint value and a uint3 vector. + /// Left hand side uint to use to compute componentwise multiplication. + /// Right hand side uint3 to use to compute componentwise multiplication. + /// uint3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint3 operator * (uint lhs, uint3 rhs) { return new uint3 (lhs * rhs.x, lhs * rhs.y, lhs * rhs.z); } - // add - [MethodImpl(0x100)] + + /// Returns the result of a componentwise addition operation on two uint3 vectors. + /// Left hand side uint3 to use to compute componentwise addition. + /// Right hand side uint3 to use to compute componentwise addition. + /// uint3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint3 operator + (uint3 lhs, uint3 rhs) { return new uint3 (lhs.x + rhs.x, lhs.y + rhs.y, lhs.z + rhs.z); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise addition operation on a uint3 vector and a uint value. + /// Left hand side uint3 to use to compute componentwise addition. + /// Right hand side uint to use to compute componentwise addition. + /// uint3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint3 operator + (uint3 lhs, uint rhs) { return new uint3 (lhs.x + rhs, lhs.y + rhs, lhs.z + rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise addition operation on a uint value and a uint3 vector. + /// Left hand side uint to use to compute componentwise addition. + /// Right hand side uint3 to use to compute componentwise addition. + /// uint3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint3 operator + (uint lhs, uint3 rhs) { return new uint3 (lhs + rhs.x, lhs + rhs.y, lhs + rhs.z); } - // sub - [MethodImpl(0x100)] + + /// Returns the result of a componentwise subtraction operation on two uint3 vectors. + /// Left hand side uint3 to use to compute componentwise subtraction. + /// Right hand side uint3 to use to compute componentwise subtraction. + /// uint3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint3 operator - (uint3 lhs, uint3 rhs) { return new uint3 (lhs.x - rhs.x, lhs.y - rhs.y, lhs.z - rhs.z); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise subtraction operation on a uint3 vector and a uint value. + /// Left hand side uint3 to use to compute componentwise subtraction. + /// Right hand side uint to use to compute componentwise subtraction. + /// uint3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint3 operator - (uint3 lhs, uint rhs) { return new uint3 (lhs.x - rhs, lhs.y - rhs, lhs.z - rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise subtraction operation on a uint value and a uint3 vector. + /// Left hand side uint to use to compute componentwise subtraction. + /// Right hand side uint3 to use to compute componentwise subtraction. + /// uint3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint3 operator - (uint lhs, uint3 rhs) { return new uint3 (lhs - rhs.x, lhs - rhs.y, lhs - rhs.z); } - // div - [MethodImpl(0x100)] + + /// Returns the result of a componentwise division operation on two uint3 vectors. + /// Left hand side uint3 to use to compute componentwise division. + /// Right hand side uint3 to use to compute componentwise division. + /// uint3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint3 operator / (uint3 lhs, uint3 rhs) { return new uint3 (lhs.x / rhs.x, lhs.y / rhs.y, lhs.z / rhs.z); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise division operation on a uint3 vector and a uint value. + /// Left hand side uint3 to use to compute componentwise division. + /// Right hand side uint to use to compute componentwise division. + /// uint3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint3 operator / (uint3 lhs, uint rhs) { return new uint3 (lhs.x / rhs, lhs.y / rhs, lhs.z / rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise division operation on a uint value and a uint3 vector. + /// Left hand side uint to use to compute componentwise division. + /// Right hand side uint3 to use to compute componentwise division. + /// uint3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint3 operator / (uint lhs, uint3 rhs) { return new uint3 (lhs / rhs.x, lhs / rhs.y, lhs / rhs.z); } - // smaller - [MethodImpl(0x100)] + + /// Returns the result of a componentwise modulus operation on two uint3 vectors. + /// Left hand side uint3 to use to compute componentwise modulus. + /// Right hand side uint3 to use to compute componentwise modulus. + /// uint3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 operator % (uint3 lhs, uint3 rhs) { return new uint3 (lhs.x % rhs.x, lhs.y % rhs.y, lhs.z % rhs.z); } + + /// Returns the result of a componentwise modulus operation on a uint3 vector and a uint value. + /// Left hand side uint3 to use to compute componentwise modulus. + /// Right hand side uint to use to compute componentwise modulus. + /// uint3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 operator % (uint3 lhs, uint rhs) { return new uint3 (lhs.x % rhs, lhs.y % rhs, lhs.z % rhs); } + + /// Returns the result of a componentwise modulus operation on a uint value and a uint3 vector. + /// Left hand side uint to use to compute componentwise modulus. + /// Right hand side uint3 to use to compute componentwise modulus. + /// uint3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 operator % (uint lhs, uint3 rhs) { return new uint3 (lhs % rhs.x, lhs % rhs.y, lhs % rhs.z); } + + + /// Returns the result of a componentwise increment operation on a uint3 vector. + /// Value to use when computing the componentwise increment. + /// uint3 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 operator ++ (uint3 val) { return new uint3 (++val.x, ++val.y, ++val.z); } + + + /// Returns the result of a componentwise decrement operation on a uint3 vector. + /// Value to use when computing the componentwise decrement. + /// uint3 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 operator -- (uint3 val) { return new uint3 (--val.x, --val.y, --val.z); } + + + /// Returns the result of a componentwise less than operation on two uint3 vectors. + /// Left hand side uint3 to use to compute componentwise less than. + /// Right hand side uint3 to use to compute componentwise less than. + /// bool3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator < (uint3 lhs, uint3 rhs) { return new bool3 (lhs.x < rhs.x, lhs.y < rhs.y, lhs.z < rhs.z); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise less than operation on a uint3 vector and a uint value. + /// Left hand side uint3 to use to compute componentwise less than. + /// Right hand side uint to use to compute componentwise less than. + /// bool3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator < (uint3 lhs, uint rhs) { return new bool3 (lhs.x < rhs, lhs.y < rhs, lhs.z < rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise less than operation on a uint value and a uint3 vector. + /// Left hand side uint to use to compute componentwise less than. + /// Right hand side uint3 to use to compute componentwise less than. + /// bool3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator < (uint lhs, uint3 rhs) { return new bool3 (lhs < rhs.x, lhs < rhs.y, lhs < rhs.z); } - [MethodImpl(0x100)] + + + /// Returns the result of a componentwise less or equal operation on two uint3 vectors. + /// Left hand side uint3 to use to compute componentwise less or equal. + /// Right hand side uint3 to use to compute componentwise less or equal. + /// bool3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator <= (uint3 lhs, uint3 rhs) { return new bool3 (lhs.x <= rhs.x, lhs.y <= rhs.y, lhs.z <= rhs.z); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise less or equal operation on a uint3 vector and a uint value. + /// Left hand side uint3 to use to compute componentwise less or equal. + /// Right hand side uint to use to compute componentwise less or equal. + /// bool3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator <= (uint3 lhs, uint rhs) { return new bool3 (lhs.x <= rhs, lhs.y <= rhs, lhs.z <= rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise less or equal operation on a uint value and a uint3 vector. + /// Left hand side uint to use to compute componentwise less or equal. + /// Right hand side uint3 to use to compute componentwise less or equal. + /// bool3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator <= (uint lhs, uint3 rhs) { return new bool3 (lhs <= rhs.x, lhs <= rhs.y, lhs <= rhs.z); } - // greater - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater than operation on two uint3 vectors. + /// Left hand side uint3 to use to compute componentwise greater than. + /// Right hand side uint3 to use to compute componentwise greater than. + /// bool3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator > (uint3 lhs, uint3 rhs) { return new bool3 (lhs.x > rhs.x, lhs.y > rhs.y, lhs.z > rhs.z); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater than operation on a uint3 vector and a uint value. + /// Left hand side uint3 to use to compute componentwise greater than. + /// Right hand side uint to use to compute componentwise greater than. + /// bool3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator > (uint3 lhs, uint rhs) { return new bool3 (lhs.x > rhs, lhs.y > rhs, lhs.z > rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater than operation on a uint value and a uint3 vector. + /// Left hand side uint to use to compute componentwise greater than. + /// Right hand side uint3 to use to compute componentwise greater than. + /// bool3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator > (uint lhs, uint3 rhs) { return new bool3 (lhs > rhs.x, lhs > rhs.y, lhs > rhs.z); } - [MethodImpl(0x100)] + + + /// Returns the result of a componentwise greater or equal operation on two uint3 vectors. + /// Left hand side uint3 to use to compute componentwise greater or equal. + /// Right hand side uint3 to use to compute componentwise greater or equal. + /// bool3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator >= (uint3 lhs, uint3 rhs) { return new bool3 (lhs.x >= rhs.x, lhs.y >= rhs.y, lhs.z >= rhs.z); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater or equal operation on a uint3 vector and a uint value. + /// Left hand side uint3 to use to compute componentwise greater or equal. + /// Right hand side uint to use to compute componentwise greater or equal. + /// bool3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator >= (uint3 lhs, uint rhs) { return new bool3 (lhs.x >= rhs, lhs.y >= rhs, lhs.z >= rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater or equal operation on a uint value and a uint3 vector. + /// Left hand side uint to use to compute componentwise greater or equal. + /// Right hand side uint3 to use to compute componentwise greater or equal. + /// bool3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator >= (uint lhs, uint3 rhs) { return new bool3 (lhs >= rhs.x, lhs >= rhs.y, lhs >= rhs.z); } - // left shift - [MethodImpl(0x100)] - public static uint3 operator << (uint3 lhs, int rhs) { return new uint3 (lhs.x << rhs, lhs.y << rhs, lhs.z << rhs); } - // right shift - [MethodImpl(0x100)] - public static uint3 operator >> (uint3 lhs, int rhs) { return new uint3 (lhs.x >> rhs, lhs.y >> rhs, lhs.z >> rhs); } + /// Returns the result of a componentwise unary minus operation on a uint3 vector. + /// Value to use when computing the componentwise unary minus. + /// uint3 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 operator - (uint3 val) { return new uint3 ((uint)-val.x, (uint)-val.y, (uint)-val.z); } - // equal - [MethodImpl(0x100)] + + /// Returns the result of a componentwise unary plus operation on a uint3 vector. + /// Value to use when computing the componentwise unary plus. + /// uint3 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 operator + (uint3 val) { return new uint3 (+val.x, +val.y, +val.z); } + + + /// Returns the result of a componentwise left shift operation on a uint3 vector by a number of bits specified by a single int. + /// The vector to left shift. + /// The number of bits to left shift. + /// The result of the componentwise left shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 operator << (uint3 x, int n) { return new uint3 (x.x << n, x.y << n, x.z << n); } + + /// Returns the result of a componentwise right shift operation on a uint3 vector by a number of bits specified by a single int. + /// The vector to right shift. + /// The number of bits to right shift. + /// The result of the componentwise right shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 operator >> (uint3 x, int n) { return new uint3 (x.x >> n, x.y >> n, x.z >> n); } + + /// Returns the result of a componentwise equality operation on two uint3 vectors. + /// Left hand side uint3 to use to compute componentwise equality. + /// Right hand side uint3 to use to compute componentwise equality. + /// bool3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator == (uint3 lhs, uint3 rhs) { return new bool3 (lhs.x == rhs.x, lhs.y == rhs.y, lhs.z == rhs.z); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise equality operation on a uint3 vector and a uint value. + /// Left hand side uint3 to use to compute componentwise equality. + /// Right hand side uint to use to compute componentwise equality. + /// bool3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator == (uint3 lhs, uint rhs) { return new bool3 (lhs.x == rhs, lhs.y == rhs, lhs.z == rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise equality operation on a uint value and a uint3 vector. + /// Left hand side uint to use to compute componentwise equality. + /// Right hand side uint3 to use to compute componentwise equality. + /// bool3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator == (uint lhs, uint3 rhs) { return new bool3 (lhs == rhs.x, lhs == rhs.y, lhs == rhs.z); } - // not equal - [MethodImpl(0x100)] + + /// Returns the result of a componentwise not equal operation on two uint3 vectors. + /// Left hand side uint3 to use to compute componentwise not equal. + /// Right hand side uint3 to use to compute componentwise not equal. + /// bool3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator != (uint3 lhs, uint3 rhs) { return new bool3 (lhs.x != rhs.x, lhs.y != rhs.y, lhs.z != rhs.z); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise not equal operation on a uint3 vector and a uint value. + /// Left hand side uint3 to use to compute componentwise not equal. + /// Right hand side uint to use to compute componentwise not equal. + /// bool3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator != (uint3 lhs, uint rhs) { return new bool3 (lhs.x != rhs, lhs.y != rhs, lhs.z != rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise not equal operation on a uint value and a uint3 vector. + /// Left hand side uint to use to compute componentwise not equal. + /// Right hand side uint3 to use to compute componentwise not equal. + /// bool3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool3 operator != (uint lhs, uint3 rhs) { return new bool3 (lhs != rhs.x, lhs != rhs.y, lhs != rhs.z); } - // Equals - [MethodImpl(0x100)] - public bool Equals(uint3 rhs) { return x == rhs.x && y == rhs.y && z == rhs.z; } - // [int index] - unsafe public uint this[int index] - { - get - { -#if ENABLE_UNITY_COLLECTIONS_CHECKS - if ((uint)index >= 3) - throw new System.ArgumentException("index must be between[0...2]"); -#endif - fixed (uint* array = &x) { return array[index]; } - } - set - { -#if ENABLE_UNITY_COLLECTIONS_CHECKS - if ((uint)index >= 3) - throw new System.ArgumentException("index must be between[0...2]"); -#endif - fixed (uint* array = &x) { array[index] = value; } - } - } + /// Returns the result of a componentwise bitwise not operation on a uint3 vector. + /// Value to use when computing the componentwise bitwise not. + /// uint3 result of the componentwise bitwise not. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 operator ~ (uint3 val) { return new uint3 (~val.x, ~val.y, ~val.z); } + - // operator & - [MethodImpl(0x100)] + /// Returns the result of a componentwise bitwise and operation on two uint3 vectors. + /// Left hand side uint3 to use to compute componentwise bitwise and. + /// Right hand side uint3 to use to compute componentwise bitwise and. + /// uint3 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint3 operator & (uint3 lhs, uint3 rhs) { return new uint3 (lhs.x & rhs.x, lhs.y & rhs.y, lhs.z & rhs.z); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise and operation on a uint3 vector and a uint value. + /// Left hand side uint3 to use to compute componentwise bitwise and. + /// Right hand side uint to use to compute componentwise bitwise and. + /// uint3 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint3 operator & (uint3 lhs, uint rhs) { return new uint3 (lhs.x & rhs, lhs.y & rhs, lhs.z & rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise and operation on a uint value and a uint3 vector. + /// Left hand side uint to use to compute componentwise bitwise and. + /// Right hand side uint3 to use to compute componentwise bitwise and. + /// uint3 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint3 operator & (uint lhs, uint3 rhs) { return new uint3 (lhs & rhs.x, lhs & rhs.y, lhs & rhs.z); } - // operator | - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise or operation on two uint3 vectors. + /// Left hand side uint3 to use to compute componentwise bitwise or. + /// Right hand side uint3 to use to compute componentwise bitwise or. + /// uint3 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint3 operator | (uint3 lhs, uint3 rhs) { return new uint3 (lhs.x | rhs.x, lhs.y | rhs.y, lhs.z | rhs.z); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise or operation on a uint3 vector and a uint value. + /// Left hand side uint3 to use to compute componentwise bitwise or. + /// Right hand side uint to use to compute componentwise bitwise or. + /// uint3 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint3 operator | (uint3 lhs, uint rhs) { return new uint3 (lhs.x | rhs, lhs.y | rhs, lhs.z | rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise or operation on a uint value and a uint3 vector. + /// Left hand side uint to use to compute componentwise bitwise or. + /// Right hand side uint3 to use to compute componentwise bitwise or. + /// uint3 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint3 operator | (uint lhs, uint3 rhs) { return new uint3 (lhs | rhs.x, lhs | rhs.y, lhs | rhs.z); } - // operator ^ - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise exclusive or operation on two uint3 vectors. + /// Left hand side uint3 to use to compute componentwise bitwise exclusive or. + /// Right hand side uint3 to use to compute componentwise bitwise exclusive or. + /// uint3 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint3 operator ^ (uint3 lhs, uint3 rhs) { return new uint3 (lhs.x ^ rhs.x, lhs.y ^ rhs.y, lhs.z ^ rhs.z); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise exclusive or operation on a uint3 vector and a uint value. + /// Left hand side uint3 to use to compute componentwise bitwise exclusive or. + /// Right hand side uint to use to compute componentwise bitwise exclusive or. + /// uint3 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint3 operator ^ (uint3 lhs, uint rhs) { return new uint3 (lhs.x ^ rhs, lhs.y ^ rhs, lhs.z ^ rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise exclusive or operation on a uint value and a uint3 vector. + /// Left hand side uint to use to compute componentwise bitwise exclusive or. + /// Right hand side uint3 to use to compute componentwise bitwise exclusive or. + /// uint3 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint3 operator ^ (uint lhs, uint3 rhs) { return new uint3 (lhs ^ rhs.x, lhs ^ rhs.y, lhs ^ rhs.z); } - // operator ~ - [MethodImpl(0x100)] - public static uint3 operator ~ (uint3 val) { return new uint3 (~val.x, ~val.y, ~val.z); } [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xxxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xxxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xxxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, x, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xxyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xxyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xxyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, x, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xxzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, x, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xxzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, x, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xxzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, x, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xyxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xyxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xyxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, y, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xyyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xyyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xyyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, y, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xyzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, y, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xyzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, y, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xyzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, y, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xzxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, z, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xzxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, z, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xzxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, z, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xzyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, z, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xzyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, z, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xzyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, z, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xzzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, z, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xzzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, z, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xzzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, z, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yxxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yxxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yxxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, x, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yxyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yxyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yxyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, x, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yxzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, x, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yxzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, x, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yxzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, x, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yyxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yyxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yyxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, y, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yyyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yyyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yyyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, y, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yyzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, y, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yyzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, y, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yyzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, y, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yzxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, z, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yzxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, z, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yzxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, z, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yzyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, z, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yzyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, z, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yzyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, z, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yzzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, z, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yzzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, z, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yzzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, z, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zxxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zxxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zxxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, x, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zxyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zxyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zxyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, x, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zxzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, x, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zxzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, x, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zxzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, x, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zyxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zyxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zyxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, y, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zyyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zyyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zyyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, y, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zyzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, y, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zyzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, y, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zyzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, y, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zzxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, z, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zzxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, z, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zzxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, z, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zzyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, z, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zzyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, z, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zzyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, z, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zzzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, z, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zzzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, z, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zzzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, z, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 xxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 xxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 xxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(x, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 xyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 xyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 xyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(x, y, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; y = value.y; z = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 xzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(x, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 xzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(x, z, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; z = value.y; y = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 xzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(x, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 yxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 yxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 yxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(y, x, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; x = value.y; z = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 yyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 yyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 yyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(y, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 yzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(y, z, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; z = value.y; x = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 yzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(y, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 yzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(y, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 zxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(z, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 zxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(z, x, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; x = value.y; y = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 zxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(z, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 zyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(z, y, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; y = value.y; x = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 zyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(z, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 zyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(z, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 zzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(z, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 zzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(z, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 zzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(z, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint2 xx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint2(x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint2 xy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint2(x, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; y = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint2 xz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint2(x, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; z = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint2 yx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint2(y, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; x = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint2 yy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint2(y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint2 yz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint2(y, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; z = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint2 zx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint2(z, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; x = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint2 zy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint2(z, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; y = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint2 zz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint2(z, z); } } + + /// Returns the uint element at a specified index. + unsafe public uint this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 3) + throw new System.ArgumentException("index must be between[0...2]"); +#endif + fixed (uint3* array = &this) { return ((uint*)array)[index]; } + } + set + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 3) + throw new System.ArgumentException("index must be between[0...2]"); +#endif + fixed (uint* array = &x) { array[index] = value; } + } + } + + /// Returns true if the uint3 is equal to a given uint3, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(uint3 rhs) { return x == rhs.x && y == rhs.y && z == rhs.z; } + + /// Returns true if the uint3 is equal to a given uint3, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is uint3 converted && Equals(converted); } + + + /// Returns a hash code for the uint3. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the uint3. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("uint3({0}, {1}, {2})", x, y, z); + } + + /// Returns a string representation of the uint3 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("uint3({0}, {1}, {2})", x.ToString(format, formatProvider), y.ToString(format, formatProvider), z.ToString(format, formatProvider)); + } + + internal sealed class DebuggerProxy + { + public uint x; + public uint y; + public uint z; + public DebuggerProxy(uint3 v) + { + x = v.x; + y = v.y; + z = v.z; + } + } + + } + + public static partial class math + { + /// Returns a uint3 vector constructed from three uint values. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + /// The constructed vector's z component will be set to this value. + /// uint3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 uint3(uint x, uint y, uint z) { return new uint3(x, y, z); } + + /// Returns a uint3 vector constructed from a uint value and a uint2 vector. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's yz components will be set to this value. + /// uint3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 uint3(uint x, uint2 yz) { return new uint3(x, yz); } + + /// Returns a uint3 vector constructed from a uint2 vector and a uint value. + /// The constructed vector's xy components will be set to this value. + /// The constructed vector's z component will be set to this value. + /// uint3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 uint3(uint2 xy, uint z) { return new uint3(xy, z); } + + /// Returns a uint3 vector constructed from a uint3 vector. + /// The constructed vector's xyz components will be set to this value. + /// uint3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 uint3(uint3 xyz) { return new uint3(xyz); } + + /// Returns a uint3 vector constructed from a single uint value by assigning it to every component. + /// uint to convert to uint3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 uint3(uint v) { return new uint3(v); } + + /// Returns a uint3 vector constructed from a single bool value by converting it to uint and assigning it to every component. + /// bool to convert to uint3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 uint3(bool v) { return new uint3(v); } + + /// Return a uint3 vector constructed from a bool3 vector by componentwise conversion. + /// bool3 to convert to uint3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 uint3(bool3 v) { return new uint3(v); } + + /// Returns a uint3 vector constructed from a single int value by converting it to uint and assigning it to every component. + /// int to convert to uint3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 uint3(int v) { return new uint3(v); } + + /// Return a uint3 vector constructed from a int3 vector by componentwise conversion. + /// int3 to convert to uint3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 uint3(int3 v) { return new uint3(v); } + + /// Returns a uint3 vector constructed from a single float value by converting it to uint and assigning it to every component. + /// float to convert to uint3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 uint3(float v) { return new uint3(v); } + + /// Return a uint3 vector constructed from a float3 vector by componentwise conversion. + /// float3 to convert to uint3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 uint3(float3 v) { return new uint3(v); } + + /// Returns a uint3 vector constructed from a single double value by converting it to uint and assigning it to every component. + /// double to convert to uint3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 uint3(double v) { return new uint3(v); } + + /// Return a uint3 vector constructed from a double3 vector by componentwise conversion. + /// double3 to convert to uint3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 uint3(double3 v) { return new uint3(v); } + + /// Returns a uint hash code of a uint3 vector. + /// Vector value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(uint3 v) + { + return csum(v * uint3(0xCD266C89u, 0xF1852A33u, 0x77E35E77u)) + 0x863E3729u; + } + + /// + /// Returns a uint3 vector hash code of a uint3 vector. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Vector value to hash. + /// uint3 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 hashwide(uint3 v) + { + return (v * uint3(0xE191B035u, 0x68586FAFu, 0xD4DFF6D3u)) + 0xCB634F4Du; + } + + /// Returns the result of specified shuffling of the components from two uint3 vectors into a uint value. + /// uint3 to use as the left argument of the shuffle operation. + /// uint3 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting uint. + /// uint result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint shuffle(uint3 left, uint3 right, ShuffleComponent x) + { + return select_shuffle_component(left, right, x); + } + + /// Returns the result of specified shuffling of the components from two uint3 vectors into a uint2 vector. + /// uint3 to use as the left argument of the shuffle operation. + /// uint3 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting uint2 x component. + /// The ShuffleComponent to use when setting the resulting uint2 y component. + /// uint2 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 shuffle(uint3 left, uint3 right, ShuffleComponent x, ShuffleComponent y) + { + return uint2( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y)); + } + + /// Returns the result of specified shuffling of the components from two uint3 vectors into a uint3 vector. + /// uint3 to use as the left argument of the shuffle operation. + /// uint3 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting uint3 x component. + /// The ShuffleComponent to use when setting the resulting uint3 y component. + /// The ShuffleComponent to use when setting the resulting uint3 z component. + /// uint3 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 shuffle(uint3 left, uint3 right, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z) + { + return uint3( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y), + select_shuffle_component(left, right, z)); + } + + /// Returns the result of specified shuffling of the components from two uint3 vectors into a uint4 vector. + /// uint3 to use as the left argument of the shuffle operation. + /// uint3 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting uint4 x component. + /// The ShuffleComponent to use when setting the resulting uint4 y component. + /// The ShuffleComponent to use when setting the resulting uint4 z component. + /// The ShuffleComponent to use when setting the resulting uint4 w component. + /// uint4 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 shuffle(uint3 left, uint3 right, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z, ShuffleComponent w) + { + return uint4( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y), + select_shuffle_component(left, right, z), + select_shuffle_component(left, right, w)); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static uint select_shuffle_component(uint3 a, uint3 b, ShuffleComponent component) + { + switch(component) + { + case ShuffleComponent.LeftX: + return a.x; + case ShuffleComponent.LeftY: + return a.y; + case ShuffleComponent.LeftZ: + return a.z; + case ShuffleComponent.RightX: + return b.x; + case ShuffleComponent.RightY: + return b.y; + case ShuffleComponent.RightZ: + return b.z; + default: + throw new System.ArgumentException("Invalid shuffle component: " + component); + } + } + } } diff --git a/src/Unity.Mathematics/uint3x2.gen.cs b/src/Unity.Mathematics/uint3x2.gen.cs new file mode 100644 index 00000000..15ac238a --- /dev/null +++ b/src/Unity.Mathematics/uint3x2.gen.cs @@ -0,0 +1,719 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 3x2 matrix of uints. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct uint3x2 : System.IEquatable, IFormattable + { + /// Column 0 of the matrix. + public uint3 c0; + /// Column 1 of the matrix. + public uint3 c1; + + /// uint3x2 zero value. + public static readonly uint3x2 zero; + + /// Constructs a uint3x2 matrix from two uint3 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3x2(uint3 c0, uint3 c1) + { + this.c0 = c0; + this.c1 = c1; + } + + /// Constructs a uint3x2 matrix from 6 uint values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3x2(uint m00, uint m01, + uint m10, uint m11, + uint m20, uint m21) + { + this.c0 = new uint3(m00, m10, m20); + this.c1 = new uint3(m01, m11, m21); + } + + /// Constructs a uint3x2 matrix from a single uint value by assigning it to every component. + /// uint to convert to uint3x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3x2(uint v) + { + this.c0 = v; + this.c1 = v; + } + + /// Constructs a uint3x2 matrix from a single bool value by converting it to uint and assigning it to every component. + /// bool to convert to uint3x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3x2(bool v) + { + this.c0 = math.select(new uint3(0u), new uint3(1u), v); + this.c1 = math.select(new uint3(0u), new uint3(1u), v); + } + + /// Constructs a uint3x2 matrix from a bool3x2 matrix by componentwise conversion. + /// bool3x2 to convert to uint3x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3x2(bool3x2 v) + { + this.c0 = math.select(new uint3(0u), new uint3(1u), v.c0); + this.c1 = math.select(new uint3(0u), new uint3(1u), v.c1); + } + + /// Constructs a uint3x2 matrix from a single int value by converting it to uint and assigning it to every component. + /// int to convert to uint3x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3x2(int v) + { + this.c0 = (uint3)v; + this.c1 = (uint3)v; + } + + /// Constructs a uint3x2 matrix from a int3x2 matrix by componentwise conversion. + /// int3x2 to convert to uint3x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3x2(int3x2 v) + { + this.c0 = (uint3)v.c0; + this.c1 = (uint3)v.c1; + } + + /// Constructs a uint3x2 matrix from a single float value by converting it to uint and assigning it to every component. + /// float to convert to uint3x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3x2(float v) + { + this.c0 = (uint3)v; + this.c1 = (uint3)v; + } + + /// Constructs a uint3x2 matrix from a float3x2 matrix by componentwise conversion. + /// float3x2 to convert to uint3x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3x2(float3x2 v) + { + this.c0 = (uint3)v.c0; + this.c1 = (uint3)v.c1; + } + + /// Constructs a uint3x2 matrix from a single double value by converting it to uint and assigning it to every component. + /// double to convert to uint3x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3x2(double v) + { + this.c0 = (uint3)v; + this.c1 = (uint3)v; + } + + /// Constructs a uint3x2 matrix from a double3x2 matrix by componentwise conversion. + /// double3x2 to convert to uint3x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3x2(double3x2 v) + { + this.c0 = (uint3)v.c0; + this.c1 = (uint3)v.c1; + } + + + /// Implicitly converts a single uint value to a uint3x2 matrix by assigning it to every component. + /// uint to convert to uint3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator uint3x2(uint v) { return new uint3x2(v); } + + /// Explicitly converts a single bool value to a uint3x2 matrix by converting it to uint and assigning it to every component. + /// bool to convert to uint3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint3x2(bool v) { return new uint3x2(v); } + + /// Explicitly converts a bool3x2 matrix to a uint3x2 matrix by componentwise conversion. + /// bool3x2 to convert to uint3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint3x2(bool3x2 v) { return new uint3x2(v); } + + /// Explicitly converts a single int value to a uint3x2 matrix by converting it to uint and assigning it to every component. + /// int to convert to uint3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint3x2(int v) { return new uint3x2(v); } + + /// Explicitly converts a int3x2 matrix to a uint3x2 matrix by componentwise conversion. + /// int3x2 to convert to uint3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint3x2(int3x2 v) { return new uint3x2(v); } + + /// Explicitly converts a single float value to a uint3x2 matrix by converting it to uint and assigning it to every component. + /// float to convert to uint3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint3x2(float v) { return new uint3x2(v); } + + /// Explicitly converts a float3x2 matrix to a uint3x2 matrix by componentwise conversion. + /// float3x2 to convert to uint3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint3x2(float3x2 v) { return new uint3x2(v); } + + /// Explicitly converts a single double value to a uint3x2 matrix by converting it to uint and assigning it to every component. + /// double to convert to uint3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint3x2(double v) { return new uint3x2(v); } + + /// Explicitly converts a double3x2 matrix to a uint3x2 matrix by componentwise conversion. + /// double3x2 to convert to uint3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint3x2(double3x2 v) { return new uint3x2(v); } + + + /// Returns the result of a componentwise multiplication operation on two uint3x2 matrices. + /// Left hand side uint3x2 to use to compute componentwise multiplication. + /// Right hand side uint3x2 to use to compute componentwise multiplication. + /// uint3x2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 operator * (uint3x2 lhs, uint3x2 rhs) { return new uint3x2 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1); } + + /// Returns the result of a componentwise multiplication operation on a uint3x2 matrix and a uint value. + /// Left hand side uint3x2 to use to compute componentwise multiplication. + /// Right hand side uint to use to compute componentwise multiplication. + /// uint3x2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 operator * (uint3x2 lhs, uint rhs) { return new uint3x2 (lhs.c0 * rhs, lhs.c1 * rhs); } + + /// Returns the result of a componentwise multiplication operation on a uint value and a uint3x2 matrix. + /// Left hand side uint to use to compute componentwise multiplication. + /// Right hand side uint3x2 to use to compute componentwise multiplication. + /// uint3x2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 operator * (uint lhs, uint3x2 rhs) { return new uint3x2 (lhs * rhs.c0, lhs * rhs.c1); } + + + /// Returns the result of a componentwise addition operation on two uint3x2 matrices. + /// Left hand side uint3x2 to use to compute componentwise addition. + /// Right hand side uint3x2 to use to compute componentwise addition. + /// uint3x2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 operator + (uint3x2 lhs, uint3x2 rhs) { return new uint3x2 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1); } + + /// Returns the result of a componentwise addition operation on a uint3x2 matrix and a uint value. + /// Left hand side uint3x2 to use to compute componentwise addition. + /// Right hand side uint to use to compute componentwise addition. + /// uint3x2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 operator + (uint3x2 lhs, uint rhs) { return new uint3x2 (lhs.c0 + rhs, lhs.c1 + rhs); } + + /// Returns the result of a componentwise addition operation on a uint value and a uint3x2 matrix. + /// Left hand side uint to use to compute componentwise addition. + /// Right hand side uint3x2 to use to compute componentwise addition. + /// uint3x2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 operator + (uint lhs, uint3x2 rhs) { return new uint3x2 (lhs + rhs.c0, lhs + rhs.c1); } + + + /// Returns the result of a componentwise subtraction operation on two uint3x2 matrices. + /// Left hand side uint3x2 to use to compute componentwise subtraction. + /// Right hand side uint3x2 to use to compute componentwise subtraction. + /// uint3x2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 operator - (uint3x2 lhs, uint3x2 rhs) { return new uint3x2 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1); } + + /// Returns the result of a componentwise subtraction operation on a uint3x2 matrix and a uint value. + /// Left hand side uint3x2 to use to compute componentwise subtraction. + /// Right hand side uint to use to compute componentwise subtraction. + /// uint3x2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 operator - (uint3x2 lhs, uint rhs) { return new uint3x2 (lhs.c0 - rhs, lhs.c1 - rhs); } + + /// Returns the result of a componentwise subtraction operation on a uint value and a uint3x2 matrix. + /// Left hand side uint to use to compute componentwise subtraction. + /// Right hand side uint3x2 to use to compute componentwise subtraction. + /// uint3x2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 operator - (uint lhs, uint3x2 rhs) { return new uint3x2 (lhs - rhs.c0, lhs - rhs.c1); } + + + /// Returns the result of a componentwise division operation on two uint3x2 matrices. + /// Left hand side uint3x2 to use to compute componentwise division. + /// Right hand side uint3x2 to use to compute componentwise division. + /// uint3x2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 operator / (uint3x2 lhs, uint3x2 rhs) { return new uint3x2 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1); } + + /// Returns the result of a componentwise division operation on a uint3x2 matrix and a uint value. + /// Left hand side uint3x2 to use to compute componentwise division. + /// Right hand side uint to use to compute componentwise division. + /// uint3x2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 operator / (uint3x2 lhs, uint rhs) { return new uint3x2 (lhs.c0 / rhs, lhs.c1 / rhs); } + + /// Returns the result of a componentwise division operation on a uint value and a uint3x2 matrix. + /// Left hand side uint to use to compute componentwise division. + /// Right hand side uint3x2 to use to compute componentwise division. + /// uint3x2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 operator / (uint lhs, uint3x2 rhs) { return new uint3x2 (lhs / rhs.c0, lhs / rhs.c1); } + + + /// Returns the result of a componentwise modulus operation on two uint3x2 matrices. + /// Left hand side uint3x2 to use to compute componentwise modulus. + /// Right hand side uint3x2 to use to compute componentwise modulus. + /// uint3x2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 operator % (uint3x2 lhs, uint3x2 rhs) { return new uint3x2 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1); } + + /// Returns the result of a componentwise modulus operation on a uint3x2 matrix and a uint value. + /// Left hand side uint3x2 to use to compute componentwise modulus. + /// Right hand side uint to use to compute componentwise modulus. + /// uint3x2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 operator % (uint3x2 lhs, uint rhs) { return new uint3x2 (lhs.c0 % rhs, lhs.c1 % rhs); } + + /// Returns the result of a componentwise modulus operation on a uint value and a uint3x2 matrix. + /// Left hand side uint to use to compute componentwise modulus. + /// Right hand side uint3x2 to use to compute componentwise modulus. + /// uint3x2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 operator % (uint lhs, uint3x2 rhs) { return new uint3x2 (lhs % rhs.c0, lhs % rhs.c1); } + + + /// Returns the result of a componentwise increment operation on a uint3x2 matrix. + /// Value to use when computing the componentwise increment. + /// uint3x2 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 operator ++ (uint3x2 val) { return new uint3x2 (++val.c0, ++val.c1); } + + + /// Returns the result of a componentwise decrement operation on a uint3x2 matrix. + /// Value to use when computing the componentwise decrement. + /// uint3x2 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 operator -- (uint3x2 val) { return new uint3x2 (--val.c0, --val.c1); } + + + /// Returns the result of a componentwise less than operation on two uint3x2 matrices. + /// Left hand side uint3x2 to use to compute componentwise less than. + /// Right hand side uint3x2 to use to compute componentwise less than. + /// bool3x2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator < (uint3x2 lhs, uint3x2 rhs) { return new bool3x2 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1); } + + /// Returns the result of a componentwise less than operation on a uint3x2 matrix and a uint value. + /// Left hand side uint3x2 to use to compute componentwise less than. + /// Right hand side uint to use to compute componentwise less than. + /// bool3x2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator < (uint3x2 lhs, uint rhs) { return new bool3x2 (lhs.c0 < rhs, lhs.c1 < rhs); } + + /// Returns the result of a componentwise less than operation on a uint value and a uint3x2 matrix. + /// Left hand side uint to use to compute componentwise less than. + /// Right hand side uint3x2 to use to compute componentwise less than. + /// bool3x2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator < (uint lhs, uint3x2 rhs) { return new bool3x2 (lhs < rhs.c0, lhs < rhs.c1); } + + + /// Returns the result of a componentwise less or equal operation on two uint3x2 matrices. + /// Left hand side uint3x2 to use to compute componentwise less or equal. + /// Right hand side uint3x2 to use to compute componentwise less or equal. + /// bool3x2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator <= (uint3x2 lhs, uint3x2 rhs) { return new bool3x2 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1); } + + /// Returns the result of a componentwise less or equal operation on a uint3x2 matrix and a uint value. + /// Left hand side uint3x2 to use to compute componentwise less or equal. + /// Right hand side uint to use to compute componentwise less or equal. + /// bool3x2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator <= (uint3x2 lhs, uint rhs) { return new bool3x2 (lhs.c0 <= rhs, lhs.c1 <= rhs); } + + /// Returns the result of a componentwise less or equal operation on a uint value and a uint3x2 matrix. + /// Left hand side uint to use to compute componentwise less or equal. + /// Right hand side uint3x2 to use to compute componentwise less or equal. + /// bool3x2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator <= (uint lhs, uint3x2 rhs) { return new bool3x2 (lhs <= rhs.c0, lhs <= rhs.c1); } + + + /// Returns the result of a componentwise greater than operation on two uint3x2 matrices. + /// Left hand side uint3x2 to use to compute componentwise greater than. + /// Right hand side uint3x2 to use to compute componentwise greater than. + /// bool3x2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator > (uint3x2 lhs, uint3x2 rhs) { return new bool3x2 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1); } + + /// Returns the result of a componentwise greater than operation on a uint3x2 matrix and a uint value. + /// Left hand side uint3x2 to use to compute componentwise greater than. + /// Right hand side uint to use to compute componentwise greater than. + /// bool3x2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator > (uint3x2 lhs, uint rhs) { return new bool3x2 (lhs.c0 > rhs, lhs.c1 > rhs); } + + /// Returns the result of a componentwise greater than operation on a uint value and a uint3x2 matrix. + /// Left hand side uint to use to compute componentwise greater than. + /// Right hand side uint3x2 to use to compute componentwise greater than. + /// bool3x2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator > (uint lhs, uint3x2 rhs) { return new bool3x2 (lhs > rhs.c0, lhs > rhs.c1); } + + + /// Returns the result of a componentwise greater or equal operation on two uint3x2 matrices. + /// Left hand side uint3x2 to use to compute componentwise greater or equal. + /// Right hand side uint3x2 to use to compute componentwise greater or equal. + /// bool3x2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator >= (uint3x2 lhs, uint3x2 rhs) { return new bool3x2 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1); } + + /// Returns the result of a componentwise greater or equal operation on a uint3x2 matrix and a uint value. + /// Left hand side uint3x2 to use to compute componentwise greater or equal. + /// Right hand side uint to use to compute componentwise greater or equal. + /// bool3x2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator >= (uint3x2 lhs, uint rhs) { return new bool3x2 (lhs.c0 >= rhs, lhs.c1 >= rhs); } + + /// Returns the result of a componentwise greater or equal operation on a uint value and a uint3x2 matrix. + /// Left hand side uint to use to compute componentwise greater or equal. + /// Right hand side uint3x2 to use to compute componentwise greater or equal. + /// bool3x2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator >= (uint lhs, uint3x2 rhs) { return new bool3x2 (lhs >= rhs.c0, lhs >= rhs.c1); } + + + /// Returns the result of a componentwise unary minus operation on a uint3x2 matrix. + /// Value to use when computing the componentwise unary minus. + /// uint3x2 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 operator - (uint3x2 val) { return new uint3x2 (-val.c0, -val.c1); } + + + /// Returns the result of a componentwise unary plus operation on a uint3x2 matrix. + /// Value to use when computing the componentwise unary plus. + /// uint3x2 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 operator + (uint3x2 val) { return new uint3x2 (+val.c0, +val.c1); } + + + /// Returns the result of a componentwise left shift operation on a uint3x2 matrix by a number of bits specified by a single int. + /// The matrix to left shift. + /// The number of bits to left shift. + /// The result of the componentwise left shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 operator << (uint3x2 x, int n) { return new uint3x2 (x.c0 << n, x.c1 << n); } + + /// Returns the result of a componentwise right shift operation on a uint3x2 matrix by a number of bits specified by a single int. + /// The matrix to right shift. + /// The number of bits to right shift. + /// The result of the componentwise right shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 operator >> (uint3x2 x, int n) { return new uint3x2 (x.c0 >> n, x.c1 >> n); } + + /// Returns the result of a componentwise equality operation on two uint3x2 matrices. + /// Left hand side uint3x2 to use to compute componentwise equality. + /// Right hand side uint3x2 to use to compute componentwise equality. + /// bool3x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator == (uint3x2 lhs, uint3x2 rhs) { return new bool3x2 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1); } + + /// Returns the result of a componentwise equality operation on a uint3x2 matrix and a uint value. + /// Left hand side uint3x2 to use to compute componentwise equality. + /// Right hand side uint to use to compute componentwise equality. + /// bool3x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator == (uint3x2 lhs, uint rhs) { return new bool3x2 (lhs.c0 == rhs, lhs.c1 == rhs); } + + /// Returns the result of a componentwise equality operation on a uint value and a uint3x2 matrix. + /// Left hand side uint to use to compute componentwise equality. + /// Right hand side uint3x2 to use to compute componentwise equality. + /// bool3x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator == (uint lhs, uint3x2 rhs) { return new bool3x2 (lhs == rhs.c0, lhs == rhs.c1); } + + + /// Returns the result of a componentwise not equal operation on two uint3x2 matrices. + /// Left hand side uint3x2 to use to compute componentwise not equal. + /// Right hand side uint3x2 to use to compute componentwise not equal. + /// bool3x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator != (uint3x2 lhs, uint3x2 rhs) { return new bool3x2 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1); } + + /// Returns the result of a componentwise not equal operation on a uint3x2 matrix and a uint value. + /// Left hand side uint3x2 to use to compute componentwise not equal. + /// Right hand side uint to use to compute componentwise not equal. + /// bool3x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator != (uint3x2 lhs, uint rhs) { return new bool3x2 (lhs.c0 != rhs, lhs.c1 != rhs); } + + /// Returns the result of a componentwise not equal operation on a uint value and a uint3x2 matrix. + /// Left hand side uint to use to compute componentwise not equal. + /// Right hand side uint3x2 to use to compute componentwise not equal. + /// bool3x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x2 operator != (uint lhs, uint3x2 rhs) { return new bool3x2 (lhs != rhs.c0, lhs != rhs.c1); } + + + /// Returns the result of a componentwise bitwise not operation on a uint3x2 matrix. + /// Value to use when computing the componentwise bitwise not. + /// uint3x2 result of the componentwise bitwise not. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 operator ~ (uint3x2 val) { return new uint3x2 (~val.c0, ~val.c1); } + + + /// Returns the result of a componentwise bitwise and operation on two uint3x2 matrices. + /// Left hand side uint3x2 to use to compute componentwise bitwise and. + /// Right hand side uint3x2 to use to compute componentwise bitwise and. + /// uint3x2 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 operator & (uint3x2 lhs, uint3x2 rhs) { return new uint3x2 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1); } + + /// Returns the result of a componentwise bitwise and operation on a uint3x2 matrix and a uint value. + /// Left hand side uint3x2 to use to compute componentwise bitwise and. + /// Right hand side uint to use to compute componentwise bitwise and. + /// uint3x2 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 operator & (uint3x2 lhs, uint rhs) { return new uint3x2 (lhs.c0 & rhs, lhs.c1 & rhs); } + + /// Returns the result of a componentwise bitwise and operation on a uint value and a uint3x2 matrix. + /// Left hand side uint to use to compute componentwise bitwise and. + /// Right hand side uint3x2 to use to compute componentwise bitwise and. + /// uint3x2 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 operator & (uint lhs, uint3x2 rhs) { return new uint3x2 (lhs & rhs.c0, lhs & rhs.c1); } + + + /// Returns the result of a componentwise bitwise or operation on two uint3x2 matrices. + /// Left hand side uint3x2 to use to compute componentwise bitwise or. + /// Right hand side uint3x2 to use to compute componentwise bitwise or. + /// uint3x2 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 operator | (uint3x2 lhs, uint3x2 rhs) { return new uint3x2 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1); } + + /// Returns the result of a componentwise bitwise or operation on a uint3x2 matrix and a uint value. + /// Left hand side uint3x2 to use to compute componentwise bitwise or. + /// Right hand side uint to use to compute componentwise bitwise or. + /// uint3x2 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 operator | (uint3x2 lhs, uint rhs) { return new uint3x2 (lhs.c0 | rhs, lhs.c1 | rhs); } + + /// Returns the result of a componentwise bitwise or operation on a uint value and a uint3x2 matrix. + /// Left hand side uint to use to compute componentwise bitwise or. + /// Right hand side uint3x2 to use to compute componentwise bitwise or. + /// uint3x2 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 operator | (uint lhs, uint3x2 rhs) { return new uint3x2 (lhs | rhs.c0, lhs | rhs.c1); } + + + /// Returns the result of a componentwise bitwise exclusive or operation on two uint3x2 matrices. + /// Left hand side uint3x2 to use to compute componentwise bitwise exclusive or. + /// Right hand side uint3x2 to use to compute componentwise bitwise exclusive or. + /// uint3x2 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 operator ^ (uint3x2 lhs, uint3x2 rhs) { return new uint3x2 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1); } + + /// Returns the result of a componentwise bitwise exclusive or operation on a uint3x2 matrix and a uint value. + /// Left hand side uint3x2 to use to compute componentwise bitwise exclusive or. + /// Right hand side uint to use to compute componentwise bitwise exclusive or. + /// uint3x2 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 operator ^ (uint3x2 lhs, uint rhs) { return new uint3x2 (lhs.c0 ^ rhs, lhs.c1 ^ rhs); } + + /// Returns the result of a componentwise bitwise exclusive or operation on a uint value and a uint3x2 matrix. + /// Left hand side uint to use to compute componentwise bitwise exclusive or. + /// Right hand side uint3x2 to use to compute componentwise bitwise exclusive or. + /// uint3x2 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 operator ^ (uint lhs, uint3x2 rhs) { return new uint3x2 (lhs ^ rhs.c0, lhs ^ rhs.c1); } + + + + /// Returns the uint3 element at a specified index. + unsafe public ref uint3 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 2) + throw new System.ArgumentException("index must be between[0...1]"); +#endif + fixed (uint3x2* array = &this) { return ref ((uint3*)array)[index]; } + } + } + + /// Returns true if the uint3x2 is equal to a given uint3x2, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(uint3x2 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1); } + + /// Returns true if the uint3x2 is equal to a given uint3x2, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is uint3x2 converted && Equals(converted); } + + + /// Returns a hash code for the uint3x2. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the uint3x2. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("uint3x2({0}, {1}, {2}, {3}, {4}, {5})", c0.x, c1.x, c0.y, c1.y, c0.z, c1.z); + } + + /// Returns a string representation of the uint3x2 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("uint3x2({0}, {1}, {2}, {3}, {4}, {5})", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c0.z.ToString(format, formatProvider), c1.z.ToString(format, formatProvider)); + } + + } + + public static partial class math + { + /// Returns a uint3x2 matrix constructed from two uint3 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// uint3x2 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 uint3x2(uint3 c0, uint3 c1) { return new uint3x2(c0, c1); } + + /// Returns a uint3x2 matrix constructed from from 6 uint values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// uint3x2 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 uint3x2(uint m00, uint m01, + uint m10, uint m11, + uint m20, uint m21) + { + return new uint3x2(m00, m01, + m10, m11, + m20, m21); + } + + /// Returns a uint3x2 matrix constructed from a single uint value by assigning it to every component. + /// uint to convert to uint3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 uint3x2(uint v) { return new uint3x2(v); } + + /// Returns a uint3x2 matrix constructed from a single bool value by converting it to uint and assigning it to every component. + /// bool to convert to uint3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 uint3x2(bool v) { return new uint3x2(v); } + + /// Return a uint3x2 matrix constructed from a bool3x2 matrix by componentwise conversion. + /// bool3x2 to convert to uint3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 uint3x2(bool3x2 v) { return new uint3x2(v); } + + /// Returns a uint3x2 matrix constructed from a single int value by converting it to uint and assigning it to every component. + /// int to convert to uint3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 uint3x2(int v) { return new uint3x2(v); } + + /// Return a uint3x2 matrix constructed from a int3x2 matrix by componentwise conversion. + /// int3x2 to convert to uint3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 uint3x2(int3x2 v) { return new uint3x2(v); } + + /// Returns a uint3x2 matrix constructed from a single float value by converting it to uint and assigning it to every component. + /// float to convert to uint3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 uint3x2(float v) { return new uint3x2(v); } + + /// Return a uint3x2 matrix constructed from a float3x2 matrix by componentwise conversion. + /// float3x2 to convert to uint3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 uint3x2(float3x2 v) { return new uint3x2(v); } + + /// Returns a uint3x2 matrix constructed from a single double value by converting it to uint and assigning it to every component. + /// double to convert to uint3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 uint3x2(double v) { return new uint3x2(v); } + + /// Return a uint3x2 matrix constructed from a double3x2 matrix by componentwise conversion. + /// double3x2 to convert to uint3x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x2 uint3x2(double3x2 v) { return new uint3x2(v); } + + /// Return the uint2x3 transpose of a uint3x2 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x3 transpose(uint3x2 v) + { + return uint2x3( + v.c0.x, v.c0.y, v.c0.z, + v.c1.x, v.c1.y, v.c1.z); + } + + /// Returns a uint hash code of a uint3x2 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(uint3x2 v) + { + return csum(v.c0 * uint3(0x515D90F5u, 0xEC9F68F3u, 0xF9EA92D5u) + + v.c1 * uint3(0xC2FAFCB9u, 0x616E9CA1u, 0xC5C5394Bu)) + 0xCAE78587u; + } + + /// + /// Returns a uint3 vector hash code of a uint3x2 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint3 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 hashwide(uint3x2 v) + { + return (v.c0 * uint3(0x7A1541C9u, 0xF83BD927u, 0x6A243BCBu) + + v.c1 * uint3(0x509B84C9u, 0x91D13847u, 0x52F7230Fu)) + 0xCF286E83u; + } + + } +} diff --git a/src/Unity.Mathematics/uint3x2.gen.cs.meta b/src/Unity.Mathematics/uint3x2.gen.cs.meta new file mode 100644 index 00000000..5edd82cf --- /dev/null +++ b/src/Unity.Mathematics/uint3x2.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7b284ac5d8ece4e8cbadac0249c18c4c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/uint3x3.gen.cs b/src/Unity.Mathematics/uint3x3.gen.cs new file mode 100644 index 00000000..57f9f1de --- /dev/null +++ b/src/Unity.Mathematics/uint3x3.gen.cs @@ -0,0 +1,746 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 3x3 matrix of uints. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct uint3x3 : System.IEquatable, IFormattable + { + /// Column 0 of the matrix. + public uint3 c0; + /// Column 1 of the matrix. + public uint3 c1; + /// Column 2 of the matrix. + public uint3 c2; + + /// uint3x3 identity transform. + public static readonly uint3x3 identity = new uint3x3(1u, 0u, 0u, 0u, 1u, 0u, 0u, 0u, 1u); + + /// uint3x3 zero value. + public static readonly uint3x3 zero; + + /// Constructs a uint3x3 matrix from three uint3 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3x3(uint3 c0, uint3 c1, uint3 c2) + { + this.c0 = c0; + this.c1 = c1; + this.c2 = c2; + } + + /// Constructs a uint3x3 matrix from 9 uint values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 2, column 2 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3x3(uint m00, uint m01, uint m02, + uint m10, uint m11, uint m12, + uint m20, uint m21, uint m22) + { + this.c0 = new uint3(m00, m10, m20); + this.c1 = new uint3(m01, m11, m21); + this.c2 = new uint3(m02, m12, m22); + } + + /// Constructs a uint3x3 matrix from a single uint value by assigning it to every component. + /// uint to convert to uint3x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3x3(uint v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + } + + /// Constructs a uint3x3 matrix from a single bool value by converting it to uint and assigning it to every component. + /// bool to convert to uint3x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3x3(bool v) + { + this.c0 = math.select(new uint3(0u), new uint3(1u), v); + this.c1 = math.select(new uint3(0u), new uint3(1u), v); + this.c2 = math.select(new uint3(0u), new uint3(1u), v); + } + + /// Constructs a uint3x3 matrix from a bool3x3 matrix by componentwise conversion. + /// bool3x3 to convert to uint3x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3x3(bool3x3 v) + { + this.c0 = math.select(new uint3(0u), new uint3(1u), v.c0); + this.c1 = math.select(new uint3(0u), new uint3(1u), v.c1); + this.c2 = math.select(new uint3(0u), new uint3(1u), v.c2); + } + + /// Constructs a uint3x3 matrix from a single int value by converting it to uint and assigning it to every component. + /// int to convert to uint3x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3x3(int v) + { + this.c0 = (uint3)v; + this.c1 = (uint3)v; + this.c2 = (uint3)v; + } + + /// Constructs a uint3x3 matrix from a int3x3 matrix by componentwise conversion. + /// int3x3 to convert to uint3x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3x3(int3x3 v) + { + this.c0 = (uint3)v.c0; + this.c1 = (uint3)v.c1; + this.c2 = (uint3)v.c2; + } + + /// Constructs a uint3x3 matrix from a single float value by converting it to uint and assigning it to every component. + /// float to convert to uint3x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3x3(float v) + { + this.c0 = (uint3)v; + this.c1 = (uint3)v; + this.c2 = (uint3)v; + } + + /// Constructs a uint3x3 matrix from a float3x3 matrix by componentwise conversion. + /// float3x3 to convert to uint3x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3x3(float3x3 v) + { + this.c0 = (uint3)v.c0; + this.c1 = (uint3)v.c1; + this.c2 = (uint3)v.c2; + } + + /// Constructs a uint3x3 matrix from a single double value by converting it to uint and assigning it to every component. + /// double to convert to uint3x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3x3(double v) + { + this.c0 = (uint3)v; + this.c1 = (uint3)v; + this.c2 = (uint3)v; + } + + /// Constructs a uint3x3 matrix from a double3x3 matrix by componentwise conversion. + /// double3x3 to convert to uint3x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3x3(double3x3 v) + { + this.c0 = (uint3)v.c0; + this.c1 = (uint3)v.c1; + this.c2 = (uint3)v.c2; + } + + + /// Implicitly converts a single uint value to a uint3x3 matrix by assigning it to every component. + /// uint to convert to uint3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator uint3x3(uint v) { return new uint3x3(v); } + + /// Explicitly converts a single bool value to a uint3x3 matrix by converting it to uint and assigning it to every component. + /// bool to convert to uint3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint3x3(bool v) { return new uint3x3(v); } + + /// Explicitly converts a bool3x3 matrix to a uint3x3 matrix by componentwise conversion. + /// bool3x3 to convert to uint3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint3x3(bool3x3 v) { return new uint3x3(v); } + + /// Explicitly converts a single int value to a uint3x3 matrix by converting it to uint and assigning it to every component. + /// int to convert to uint3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint3x3(int v) { return new uint3x3(v); } + + /// Explicitly converts a int3x3 matrix to a uint3x3 matrix by componentwise conversion. + /// int3x3 to convert to uint3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint3x3(int3x3 v) { return new uint3x3(v); } + + /// Explicitly converts a single float value to a uint3x3 matrix by converting it to uint and assigning it to every component. + /// float to convert to uint3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint3x3(float v) { return new uint3x3(v); } + + /// Explicitly converts a float3x3 matrix to a uint3x3 matrix by componentwise conversion. + /// float3x3 to convert to uint3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint3x3(float3x3 v) { return new uint3x3(v); } + + /// Explicitly converts a single double value to a uint3x3 matrix by converting it to uint and assigning it to every component. + /// double to convert to uint3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint3x3(double v) { return new uint3x3(v); } + + /// Explicitly converts a double3x3 matrix to a uint3x3 matrix by componentwise conversion. + /// double3x3 to convert to uint3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint3x3(double3x3 v) { return new uint3x3(v); } + + + /// Returns the result of a componentwise multiplication operation on two uint3x3 matrices. + /// Left hand side uint3x3 to use to compute componentwise multiplication. + /// Right hand side uint3x3 to use to compute componentwise multiplication. + /// uint3x3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 operator * (uint3x3 lhs, uint3x3 rhs) { return new uint3x3 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1, lhs.c2 * rhs.c2); } + + /// Returns the result of a componentwise multiplication operation on a uint3x3 matrix and a uint value. + /// Left hand side uint3x3 to use to compute componentwise multiplication. + /// Right hand side uint to use to compute componentwise multiplication. + /// uint3x3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 operator * (uint3x3 lhs, uint rhs) { return new uint3x3 (lhs.c0 * rhs, lhs.c1 * rhs, lhs.c2 * rhs); } + + /// Returns the result of a componentwise multiplication operation on a uint value and a uint3x3 matrix. + /// Left hand side uint to use to compute componentwise multiplication. + /// Right hand side uint3x3 to use to compute componentwise multiplication. + /// uint3x3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 operator * (uint lhs, uint3x3 rhs) { return new uint3x3 (lhs * rhs.c0, lhs * rhs.c1, lhs * rhs.c2); } + + + /// Returns the result of a componentwise addition operation on two uint3x3 matrices. + /// Left hand side uint3x3 to use to compute componentwise addition. + /// Right hand side uint3x3 to use to compute componentwise addition. + /// uint3x3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 operator + (uint3x3 lhs, uint3x3 rhs) { return new uint3x3 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1, lhs.c2 + rhs.c2); } + + /// Returns the result of a componentwise addition operation on a uint3x3 matrix and a uint value. + /// Left hand side uint3x3 to use to compute componentwise addition. + /// Right hand side uint to use to compute componentwise addition. + /// uint3x3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 operator + (uint3x3 lhs, uint rhs) { return new uint3x3 (lhs.c0 + rhs, lhs.c1 + rhs, lhs.c2 + rhs); } + + /// Returns the result of a componentwise addition operation on a uint value and a uint3x3 matrix. + /// Left hand side uint to use to compute componentwise addition. + /// Right hand side uint3x3 to use to compute componentwise addition. + /// uint3x3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 operator + (uint lhs, uint3x3 rhs) { return new uint3x3 (lhs + rhs.c0, lhs + rhs.c1, lhs + rhs.c2); } + + + /// Returns the result of a componentwise subtraction operation on two uint3x3 matrices. + /// Left hand side uint3x3 to use to compute componentwise subtraction. + /// Right hand side uint3x3 to use to compute componentwise subtraction. + /// uint3x3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 operator - (uint3x3 lhs, uint3x3 rhs) { return new uint3x3 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1, lhs.c2 - rhs.c2); } + + /// Returns the result of a componentwise subtraction operation on a uint3x3 matrix and a uint value. + /// Left hand side uint3x3 to use to compute componentwise subtraction. + /// Right hand side uint to use to compute componentwise subtraction. + /// uint3x3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 operator - (uint3x3 lhs, uint rhs) { return new uint3x3 (lhs.c0 - rhs, lhs.c1 - rhs, lhs.c2 - rhs); } + + /// Returns the result of a componentwise subtraction operation on a uint value and a uint3x3 matrix. + /// Left hand side uint to use to compute componentwise subtraction. + /// Right hand side uint3x3 to use to compute componentwise subtraction. + /// uint3x3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 operator - (uint lhs, uint3x3 rhs) { return new uint3x3 (lhs - rhs.c0, lhs - rhs.c1, lhs - rhs.c2); } + + + /// Returns the result of a componentwise division operation on two uint3x3 matrices. + /// Left hand side uint3x3 to use to compute componentwise division. + /// Right hand side uint3x3 to use to compute componentwise division. + /// uint3x3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 operator / (uint3x3 lhs, uint3x3 rhs) { return new uint3x3 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1, lhs.c2 / rhs.c2); } + + /// Returns the result of a componentwise division operation on a uint3x3 matrix and a uint value. + /// Left hand side uint3x3 to use to compute componentwise division. + /// Right hand side uint to use to compute componentwise division. + /// uint3x3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 operator / (uint3x3 lhs, uint rhs) { return new uint3x3 (lhs.c0 / rhs, lhs.c1 / rhs, lhs.c2 / rhs); } + + /// Returns the result of a componentwise division operation on a uint value and a uint3x3 matrix. + /// Left hand side uint to use to compute componentwise division. + /// Right hand side uint3x3 to use to compute componentwise division. + /// uint3x3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 operator / (uint lhs, uint3x3 rhs) { return new uint3x3 (lhs / rhs.c0, lhs / rhs.c1, lhs / rhs.c2); } + + + /// Returns the result of a componentwise modulus operation on two uint3x3 matrices. + /// Left hand side uint3x3 to use to compute componentwise modulus. + /// Right hand side uint3x3 to use to compute componentwise modulus. + /// uint3x3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 operator % (uint3x3 lhs, uint3x3 rhs) { return new uint3x3 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1, lhs.c2 % rhs.c2); } + + /// Returns the result of a componentwise modulus operation on a uint3x3 matrix and a uint value. + /// Left hand side uint3x3 to use to compute componentwise modulus. + /// Right hand side uint to use to compute componentwise modulus. + /// uint3x3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 operator % (uint3x3 lhs, uint rhs) { return new uint3x3 (lhs.c0 % rhs, lhs.c1 % rhs, lhs.c2 % rhs); } + + /// Returns the result of a componentwise modulus operation on a uint value and a uint3x3 matrix. + /// Left hand side uint to use to compute componentwise modulus. + /// Right hand side uint3x3 to use to compute componentwise modulus. + /// uint3x3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 operator % (uint lhs, uint3x3 rhs) { return new uint3x3 (lhs % rhs.c0, lhs % rhs.c1, lhs % rhs.c2); } + + + /// Returns the result of a componentwise increment operation on a uint3x3 matrix. + /// Value to use when computing the componentwise increment. + /// uint3x3 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 operator ++ (uint3x3 val) { return new uint3x3 (++val.c0, ++val.c1, ++val.c2); } + + + /// Returns the result of a componentwise decrement operation on a uint3x3 matrix. + /// Value to use when computing the componentwise decrement. + /// uint3x3 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 operator -- (uint3x3 val) { return new uint3x3 (--val.c0, --val.c1, --val.c2); } + + + /// Returns the result of a componentwise less than operation on two uint3x3 matrices. + /// Left hand side uint3x3 to use to compute componentwise less than. + /// Right hand side uint3x3 to use to compute componentwise less than. + /// bool3x3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator < (uint3x3 lhs, uint3x3 rhs) { return new bool3x3 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1, lhs.c2 < rhs.c2); } + + /// Returns the result of a componentwise less than operation on a uint3x3 matrix and a uint value. + /// Left hand side uint3x3 to use to compute componentwise less than. + /// Right hand side uint to use to compute componentwise less than. + /// bool3x3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator < (uint3x3 lhs, uint rhs) { return new bool3x3 (lhs.c0 < rhs, lhs.c1 < rhs, lhs.c2 < rhs); } + + /// Returns the result of a componentwise less than operation on a uint value and a uint3x3 matrix. + /// Left hand side uint to use to compute componentwise less than. + /// Right hand side uint3x3 to use to compute componentwise less than. + /// bool3x3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator < (uint lhs, uint3x3 rhs) { return new bool3x3 (lhs < rhs.c0, lhs < rhs.c1, lhs < rhs.c2); } + + + /// Returns the result of a componentwise less or equal operation on two uint3x3 matrices. + /// Left hand side uint3x3 to use to compute componentwise less or equal. + /// Right hand side uint3x3 to use to compute componentwise less or equal. + /// bool3x3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator <= (uint3x3 lhs, uint3x3 rhs) { return new bool3x3 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1, lhs.c2 <= rhs.c2); } + + /// Returns the result of a componentwise less or equal operation on a uint3x3 matrix and a uint value. + /// Left hand side uint3x3 to use to compute componentwise less or equal. + /// Right hand side uint to use to compute componentwise less or equal. + /// bool3x3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator <= (uint3x3 lhs, uint rhs) { return new bool3x3 (lhs.c0 <= rhs, lhs.c1 <= rhs, lhs.c2 <= rhs); } + + /// Returns the result of a componentwise less or equal operation on a uint value and a uint3x3 matrix. + /// Left hand side uint to use to compute componentwise less or equal. + /// Right hand side uint3x3 to use to compute componentwise less or equal. + /// bool3x3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator <= (uint lhs, uint3x3 rhs) { return new bool3x3 (lhs <= rhs.c0, lhs <= rhs.c1, lhs <= rhs.c2); } + + + /// Returns the result of a componentwise greater than operation on two uint3x3 matrices. + /// Left hand side uint3x3 to use to compute componentwise greater than. + /// Right hand side uint3x3 to use to compute componentwise greater than. + /// bool3x3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator > (uint3x3 lhs, uint3x3 rhs) { return new bool3x3 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1, lhs.c2 > rhs.c2); } + + /// Returns the result of a componentwise greater than operation on a uint3x3 matrix and a uint value. + /// Left hand side uint3x3 to use to compute componentwise greater than. + /// Right hand side uint to use to compute componentwise greater than. + /// bool3x3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator > (uint3x3 lhs, uint rhs) { return new bool3x3 (lhs.c0 > rhs, lhs.c1 > rhs, lhs.c2 > rhs); } + + /// Returns the result of a componentwise greater than operation on a uint value and a uint3x3 matrix. + /// Left hand side uint to use to compute componentwise greater than. + /// Right hand side uint3x3 to use to compute componentwise greater than. + /// bool3x3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator > (uint lhs, uint3x3 rhs) { return new bool3x3 (lhs > rhs.c0, lhs > rhs.c1, lhs > rhs.c2); } + + + /// Returns the result of a componentwise greater or equal operation on two uint3x3 matrices. + /// Left hand side uint3x3 to use to compute componentwise greater or equal. + /// Right hand side uint3x3 to use to compute componentwise greater or equal. + /// bool3x3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator >= (uint3x3 lhs, uint3x3 rhs) { return new bool3x3 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1, lhs.c2 >= rhs.c2); } + + /// Returns the result of a componentwise greater or equal operation on a uint3x3 matrix and a uint value. + /// Left hand side uint3x3 to use to compute componentwise greater or equal. + /// Right hand side uint to use to compute componentwise greater or equal. + /// bool3x3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator >= (uint3x3 lhs, uint rhs) { return new bool3x3 (lhs.c0 >= rhs, lhs.c1 >= rhs, lhs.c2 >= rhs); } + + /// Returns the result of a componentwise greater or equal operation on a uint value and a uint3x3 matrix. + /// Left hand side uint to use to compute componentwise greater or equal. + /// Right hand side uint3x3 to use to compute componentwise greater or equal. + /// bool3x3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator >= (uint lhs, uint3x3 rhs) { return new bool3x3 (lhs >= rhs.c0, lhs >= rhs.c1, lhs >= rhs.c2); } + + + /// Returns the result of a componentwise unary minus operation on a uint3x3 matrix. + /// Value to use when computing the componentwise unary minus. + /// uint3x3 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 operator - (uint3x3 val) { return new uint3x3 (-val.c0, -val.c1, -val.c2); } + + + /// Returns the result of a componentwise unary plus operation on a uint3x3 matrix. + /// Value to use when computing the componentwise unary plus. + /// uint3x3 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 operator + (uint3x3 val) { return new uint3x3 (+val.c0, +val.c1, +val.c2); } + + + /// Returns the result of a componentwise left shift operation on a uint3x3 matrix by a number of bits specified by a single int. + /// The matrix to left shift. + /// The number of bits to left shift. + /// The result of the componentwise left shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 operator << (uint3x3 x, int n) { return new uint3x3 (x.c0 << n, x.c1 << n, x.c2 << n); } + + /// Returns the result of a componentwise right shift operation on a uint3x3 matrix by a number of bits specified by a single int. + /// The matrix to right shift. + /// The number of bits to right shift. + /// The result of the componentwise right shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 operator >> (uint3x3 x, int n) { return new uint3x3 (x.c0 >> n, x.c1 >> n, x.c2 >> n); } + + /// Returns the result of a componentwise equality operation on two uint3x3 matrices. + /// Left hand side uint3x3 to use to compute componentwise equality. + /// Right hand side uint3x3 to use to compute componentwise equality. + /// bool3x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator == (uint3x3 lhs, uint3x3 rhs) { return new bool3x3 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2); } + + /// Returns the result of a componentwise equality operation on a uint3x3 matrix and a uint value. + /// Left hand side uint3x3 to use to compute componentwise equality. + /// Right hand side uint to use to compute componentwise equality. + /// bool3x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator == (uint3x3 lhs, uint rhs) { return new bool3x3 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs); } + + /// Returns the result of a componentwise equality operation on a uint value and a uint3x3 matrix. + /// Left hand side uint to use to compute componentwise equality. + /// Right hand side uint3x3 to use to compute componentwise equality. + /// bool3x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator == (uint lhs, uint3x3 rhs) { return new bool3x3 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2); } + + + /// Returns the result of a componentwise not equal operation on two uint3x3 matrices. + /// Left hand side uint3x3 to use to compute componentwise not equal. + /// Right hand side uint3x3 to use to compute componentwise not equal. + /// bool3x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator != (uint3x3 lhs, uint3x3 rhs) { return new bool3x3 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2); } + + /// Returns the result of a componentwise not equal operation on a uint3x3 matrix and a uint value. + /// Left hand side uint3x3 to use to compute componentwise not equal. + /// Right hand side uint to use to compute componentwise not equal. + /// bool3x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator != (uint3x3 lhs, uint rhs) { return new bool3x3 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs); } + + /// Returns the result of a componentwise not equal operation on a uint value and a uint3x3 matrix. + /// Left hand side uint to use to compute componentwise not equal. + /// Right hand side uint3x3 to use to compute componentwise not equal. + /// bool3x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x3 operator != (uint lhs, uint3x3 rhs) { return new bool3x3 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2); } + + + /// Returns the result of a componentwise bitwise not operation on a uint3x3 matrix. + /// Value to use when computing the componentwise bitwise not. + /// uint3x3 result of the componentwise bitwise not. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 operator ~ (uint3x3 val) { return new uint3x3 (~val.c0, ~val.c1, ~val.c2); } + + + /// Returns the result of a componentwise bitwise and operation on two uint3x3 matrices. + /// Left hand side uint3x3 to use to compute componentwise bitwise and. + /// Right hand side uint3x3 to use to compute componentwise bitwise and. + /// uint3x3 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 operator & (uint3x3 lhs, uint3x3 rhs) { return new uint3x3 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1, lhs.c2 & rhs.c2); } + + /// Returns the result of a componentwise bitwise and operation on a uint3x3 matrix and a uint value. + /// Left hand side uint3x3 to use to compute componentwise bitwise and. + /// Right hand side uint to use to compute componentwise bitwise and. + /// uint3x3 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 operator & (uint3x3 lhs, uint rhs) { return new uint3x3 (lhs.c0 & rhs, lhs.c1 & rhs, lhs.c2 & rhs); } + + /// Returns the result of a componentwise bitwise and operation on a uint value and a uint3x3 matrix. + /// Left hand side uint to use to compute componentwise bitwise and. + /// Right hand side uint3x3 to use to compute componentwise bitwise and. + /// uint3x3 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 operator & (uint lhs, uint3x3 rhs) { return new uint3x3 (lhs & rhs.c0, lhs & rhs.c1, lhs & rhs.c2); } + + + /// Returns the result of a componentwise bitwise or operation on two uint3x3 matrices. + /// Left hand side uint3x3 to use to compute componentwise bitwise or. + /// Right hand side uint3x3 to use to compute componentwise bitwise or. + /// uint3x3 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 operator | (uint3x3 lhs, uint3x3 rhs) { return new uint3x3 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1, lhs.c2 | rhs.c2); } + + /// Returns the result of a componentwise bitwise or operation on a uint3x3 matrix and a uint value. + /// Left hand side uint3x3 to use to compute componentwise bitwise or. + /// Right hand side uint to use to compute componentwise bitwise or. + /// uint3x3 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 operator | (uint3x3 lhs, uint rhs) { return new uint3x3 (lhs.c0 | rhs, lhs.c1 | rhs, lhs.c2 | rhs); } + + /// Returns the result of a componentwise bitwise or operation on a uint value and a uint3x3 matrix. + /// Left hand side uint to use to compute componentwise bitwise or. + /// Right hand side uint3x3 to use to compute componentwise bitwise or. + /// uint3x3 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 operator | (uint lhs, uint3x3 rhs) { return new uint3x3 (lhs | rhs.c0, lhs | rhs.c1, lhs | rhs.c2); } + + + /// Returns the result of a componentwise bitwise exclusive or operation on two uint3x3 matrices. + /// Left hand side uint3x3 to use to compute componentwise bitwise exclusive or. + /// Right hand side uint3x3 to use to compute componentwise bitwise exclusive or. + /// uint3x3 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 operator ^ (uint3x3 lhs, uint3x3 rhs) { return new uint3x3 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1, lhs.c2 ^ rhs.c2); } + + /// Returns the result of a componentwise bitwise exclusive or operation on a uint3x3 matrix and a uint value. + /// Left hand side uint3x3 to use to compute componentwise bitwise exclusive or. + /// Right hand side uint to use to compute componentwise bitwise exclusive or. + /// uint3x3 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 operator ^ (uint3x3 lhs, uint rhs) { return new uint3x3 (lhs.c0 ^ rhs, lhs.c1 ^ rhs, lhs.c2 ^ rhs); } + + /// Returns the result of a componentwise bitwise exclusive or operation on a uint value and a uint3x3 matrix. + /// Left hand side uint to use to compute componentwise bitwise exclusive or. + /// Right hand side uint3x3 to use to compute componentwise bitwise exclusive or. + /// uint3x3 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 operator ^ (uint lhs, uint3x3 rhs) { return new uint3x3 (lhs ^ rhs.c0, lhs ^ rhs.c1, lhs ^ rhs.c2); } + + + + /// Returns the uint3 element at a specified index. + unsafe public ref uint3 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 3) + throw new System.ArgumentException("index must be between[0...2]"); +#endif + fixed (uint3x3* array = &this) { return ref ((uint3*)array)[index]; } + } + } + + /// Returns true if the uint3x3 is equal to a given uint3x3, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(uint3x3 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2); } + + /// Returns true if the uint3x3 is equal to a given uint3x3, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is uint3x3 converted && Equals(converted); } + + + /// Returns a hash code for the uint3x3. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the uint3x3. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("uint3x3({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8})", c0.x, c1.x, c2.x, c0.y, c1.y, c2.y, c0.z, c1.z, c2.z); + } + + /// Returns a string representation of the uint3x3 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("uint3x3({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8})", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c2.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c2.y.ToString(format, formatProvider), c0.z.ToString(format, formatProvider), c1.z.ToString(format, formatProvider), c2.z.ToString(format, formatProvider)); + } + + } + + public static partial class math + { + /// Returns a uint3x3 matrix constructed from three uint3 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// uint3x3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 uint3x3(uint3 c0, uint3 c1, uint3 c2) { return new uint3x3(c0, c1, c2); } + + /// Returns a uint3x3 matrix constructed from from 9 uint values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 2, column 2 will be set to this value. + /// uint3x3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 uint3x3(uint m00, uint m01, uint m02, + uint m10, uint m11, uint m12, + uint m20, uint m21, uint m22) + { + return new uint3x3(m00, m01, m02, + m10, m11, m12, + m20, m21, m22); + } + + /// Returns a uint3x3 matrix constructed from a single uint value by assigning it to every component. + /// uint to convert to uint3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 uint3x3(uint v) { return new uint3x3(v); } + + /// Returns a uint3x3 matrix constructed from a single bool value by converting it to uint and assigning it to every component. + /// bool to convert to uint3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 uint3x3(bool v) { return new uint3x3(v); } + + /// Return a uint3x3 matrix constructed from a bool3x3 matrix by componentwise conversion. + /// bool3x3 to convert to uint3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 uint3x3(bool3x3 v) { return new uint3x3(v); } + + /// Returns a uint3x3 matrix constructed from a single int value by converting it to uint and assigning it to every component. + /// int to convert to uint3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 uint3x3(int v) { return new uint3x3(v); } + + /// Return a uint3x3 matrix constructed from a int3x3 matrix by componentwise conversion. + /// int3x3 to convert to uint3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 uint3x3(int3x3 v) { return new uint3x3(v); } + + /// Returns a uint3x3 matrix constructed from a single float value by converting it to uint and assigning it to every component. + /// float to convert to uint3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 uint3x3(float v) { return new uint3x3(v); } + + /// Return a uint3x3 matrix constructed from a float3x3 matrix by componentwise conversion. + /// float3x3 to convert to uint3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 uint3x3(float3x3 v) { return new uint3x3(v); } + + /// Returns a uint3x3 matrix constructed from a single double value by converting it to uint and assigning it to every component. + /// double to convert to uint3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 uint3x3(double v) { return new uint3x3(v); } + + /// Return a uint3x3 matrix constructed from a double3x3 matrix by componentwise conversion. + /// double3x3 to convert to uint3x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 uint3x3(double3x3 v) { return new uint3x3(v); } + + /// Return the uint3x3 transpose of a uint3x3 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x3 transpose(uint3x3 v) + { + return uint3x3( + v.c0.x, v.c0.y, v.c0.z, + v.c1.x, v.c1.y, v.c1.z, + v.c2.x, v.c2.y, v.c2.z); + } + + /// Returns a uint hash code of a uint3x3 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(uint3x3 v) + { + return csum(v.c0 * uint3(0xAC60D0C3u, 0x9263662Fu, 0xE69626FFu) + + v.c1 * uint3(0xBD010EEBu, 0x9CEDE1D1u, 0x43BE0B51u) + + v.c2 * uint3(0xAF836EE1u, 0xB130C137u, 0x54834775u)) + 0x7C022221u; + } + + /// + /// Returns a uint3 vector hash code of a uint3x3 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint3 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 hashwide(uint3x3 v) + { + return (v.c0 * uint3(0xA2D00EDFu, 0xA8977779u, 0x9F1C739Bu) + + v.c1 * uint3(0x4B1BD187u, 0x9DF50593u, 0xF18EEB85u) + + v.c2 * uint3(0x9E19BFC3u, 0x8196B06Fu, 0xD24EFA19u)) + 0x7D8048BBu; + } + + } +} diff --git a/src/Unity.Mathematics/uint3x3.gen.cs.meta b/src/Unity.Mathematics/uint3x3.gen.cs.meta new file mode 100644 index 00000000..a6e8de23 --- /dev/null +++ b/src/Unity.Mathematics/uint3x3.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c1262616ca00349c28426545d8525266 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/uint3x4.gen.cs b/src/Unity.Mathematics/uint3x4.gen.cs new file mode 100644 index 00000000..51bca3b8 --- /dev/null +++ b/src/Unity.Mathematics/uint3x4.gen.cs @@ -0,0 +1,767 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 3x4 matrix of uints. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct uint3x4 : System.IEquatable, IFormattable + { + /// Column 0 of the matrix. + public uint3 c0; + /// Column 1 of the matrix. + public uint3 c1; + /// Column 2 of the matrix. + public uint3 c2; + /// Column 3 of the matrix. + public uint3 c3; + + /// uint3x4 zero value. + public static readonly uint3x4 zero; + + /// Constructs a uint3x4 matrix from four uint3 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// The matrix column c3 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3x4(uint3 c0, uint3 c1, uint3 c2, uint3 c3) + { + this.c0 = c0; + this.c1 = c1; + this.c2 = c2; + this.c3 = c3; + } + + /// Constructs a uint3x4 matrix from 12 uint values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 0, column 3 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 1, column 3 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 2, column 2 will be set to this value. + /// The matrix at row 2, column 3 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3x4(uint m00, uint m01, uint m02, uint m03, + uint m10, uint m11, uint m12, uint m13, + uint m20, uint m21, uint m22, uint m23) + { + this.c0 = new uint3(m00, m10, m20); + this.c1 = new uint3(m01, m11, m21); + this.c2 = new uint3(m02, m12, m22); + this.c3 = new uint3(m03, m13, m23); + } + + /// Constructs a uint3x4 matrix from a single uint value by assigning it to every component. + /// uint to convert to uint3x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3x4(uint v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + this.c3 = v; + } + + /// Constructs a uint3x4 matrix from a single bool value by converting it to uint and assigning it to every component. + /// bool to convert to uint3x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3x4(bool v) + { + this.c0 = math.select(new uint3(0u), new uint3(1u), v); + this.c1 = math.select(new uint3(0u), new uint3(1u), v); + this.c2 = math.select(new uint3(0u), new uint3(1u), v); + this.c3 = math.select(new uint3(0u), new uint3(1u), v); + } + + /// Constructs a uint3x4 matrix from a bool3x4 matrix by componentwise conversion. + /// bool3x4 to convert to uint3x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3x4(bool3x4 v) + { + this.c0 = math.select(new uint3(0u), new uint3(1u), v.c0); + this.c1 = math.select(new uint3(0u), new uint3(1u), v.c1); + this.c2 = math.select(new uint3(0u), new uint3(1u), v.c2); + this.c3 = math.select(new uint3(0u), new uint3(1u), v.c3); + } + + /// Constructs a uint3x4 matrix from a single int value by converting it to uint and assigning it to every component. + /// int to convert to uint3x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3x4(int v) + { + this.c0 = (uint3)v; + this.c1 = (uint3)v; + this.c2 = (uint3)v; + this.c3 = (uint3)v; + } + + /// Constructs a uint3x4 matrix from a int3x4 matrix by componentwise conversion. + /// int3x4 to convert to uint3x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3x4(int3x4 v) + { + this.c0 = (uint3)v.c0; + this.c1 = (uint3)v.c1; + this.c2 = (uint3)v.c2; + this.c3 = (uint3)v.c3; + } + + /// Constructs a uint3x4 matrix from a single float value by converting it to uint and assigning it to every component. + /// float to convert to uint3x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3x4(float v) + { + this.c0 = (uint3)v; + this.c1 = (uint3)v; + this.c2 = (uint3)v; + this.c3 = (uint3)v; + } + + /// Constructs a uint3x4 matrix from a float3x4 matrix by componentwise conversion. + /// float3x4 to convert to uint3x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3x4(float3x4 v) + { + this.c0 = (uint3)v.c0; + this.c1 = (uint3)v.c1; + this.c2 = (uint3)v.c2; + this.c3 = (uint3)v.c3; + } + + /// Constructs a uint3x4 matrix from a single double value by converting it to uint and assigning it to every component. + /// double to convert to uint3x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3x4(double v) + { + this.c0 = (uint3)v; + this.c1 = (uint3)v; + this.c2 = (uint3)v; + this.c3 = (uint3)v; + } + + /// Constructs a uint3x4 matrix from a double3x4 matrix by componentwise conversion. + /// double3x4 to convert to uint3x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint3x4(double3x4 v) + { + this.c0 = (uint3)v.c0; + this.c1 = (uint3)v.c1; + this.c2 = (uint3)v.c2; + this.c3 = (uint3)v.c3; + } + + + /// Implicitly converts a single uint value to a uint3x4 matrix by assigning it to every component. + /// uint to convert to uint3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator uint3x4(uint v) { return new uint3x4(v); } + + /// Explicitly converts a single bool value to a uint3x4 matrix by converting it to uint and assigning it to every component. + /// bool to convert to uint3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint3x4(bool v) { return new uint3x4(v); } + + /// Explicitly converts a bool3x4 matrix to a uint3x4 matrix by componentwise conversion. + /// bool3x4 to convert to uint3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint3x4(bool3x4 v) { return new uint3x4(v); } + + /// Explicitly converts a single int value to a uint3x4 matrix by converting it to uint and assigning it to every component. + /// int to convert to uint3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint3x4(int v) { return new uint3x4(v); } + + /// Explicitly converts a int3x4 matrix to a uint3x4 matrix by componentwise conversion. + /// int3x4 to convert to uint3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint3x4(int3x4 v) { return new uint3x4(v); } + + /// Explicitly converts a single float value to a uint3x4 matrix by converting it to uint and assigning it to every component. + /// float to convert to uint3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint3x4(float v) { return new uint3x4(v); } + + /// Explicitly converts a float3x4 matrix to a uint3x4 matrix by componentwise conversion. + /// float3x4 to convert to uint3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint3x4(float3x4 v) { return new uint3x4(v); } + + /// Explicitly converts a single double value to a uint3x4 matrix by converting it to uint and assigning it to every component. + /// double to convert to uint3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint3x4(double v) { return new uint3x4(v); } + + /// Explicitly converts a double3x4 matrix to a uint3x4 matrix by componentwise conversion. + /// double3x4 to convert to uint3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint3x4(double3x4 v) { return new uint3x4(v); } + + + /// Returns the result of a componentwise multiplication operation on two uint3x4 matrices. + /// Left hand side uint3x4 to use to compute componentwise multiplication. + /// Right hand side uint3x4 to use to compute componentwise multiplication. + /// uint3x4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 operator * (uint3x4 lhs, uint3x4 rhs) { return new uint3x4 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1, lhs.c2 * rhs.c2, lhs.c3 * rhs.c3); } + + /// Returns the result of a componentwise multiplication operation on a uint3x4 matrix and a uint value. + /// Left hand side uint3x4 to use to compute componentwise multiplication. + /// Right hand side uint to use to compute componentwise multiplication. + /// uint3x4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 operator * (uint3x4 lhs, uint rhs) { return new uint3x4 (lhs.c0 * rhs, lhs.c1 * rhs, lhs.c2 * rhs, lhs.c3 * rhs); } + + /// Returns the result of a componentwise multiplication operation on a uint value and a uint3x4 matrix. + /// Left hand side uint to use to compute componentwise multiplication. + /// Right hand side uint3x4 to use to compute componentwise multiplication. + /// uint3x4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 operator * (uint lhs, uint3x4 rhs) { return new uint3x4 (lhs * rhs.c0, lhs * rhs.c1, lhs * rhs.c2, lhs * rhs.c3); } + + + /// Returns the result of a componentwise addition operation on two uint3x4 matrices. + /// Left hand side uint3x4 to use to compute componentwise addition. + /// Right hand side uint3x4 to use to compute componentwise addition. + /// uint3x4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 operator + (uint3x4 lhs, uint3x4 rhs) { return new uint3x4 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1, lhs.c2 + rhs.c2, lhs.c3 + rhs.c3); } + + /// Returns the result of a componentwise addition operation on a uint3x4 matrix and a uint value. + /// Left hand side uint3x4 to use to compute componentwise addition. + /// Right hand side uint to use to compute componentwise addition. + /// uint3x4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 operator + (uint3x4 lhs, uint rhs) { return new uint3x4 (lhs.c0 + rhs, lhs.c1 + rhs, lhs.c2 + rhs, lhs.c3 + rhs); } + + /// Returns the result of a componentwise addition operation on a uint value and a uint3x4 matrix. + /// Left hand side uint to use to compute componentwise addition. + /// Right hand side uint3x4 to use to compute componentwise addition. + /// uint3x4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 operator + (uint lhs, uint3x4 rhs) { return new uint3x4 (lhs + rhs.c0, lhs + rhs.c1, lhs + rhs.c2, lhs + rhs.c3); } + + + /// Returns the result of a componentwise subtraction operation on two uint3x4 matrices. + /// Left hand side uint3x4 to use to compute componentwise subtraction. + /// Right hand side uint3x4 to use to compute componentwise subtraction. + /// uint3x4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 operator - (uint3x4 lhs, uint3x4 rhs) { return new uint3x4 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1, lhs.c2 - rhs.c2, lhs.c3 - rhs.c3); } + + /// Returns the result of a componentwise subtraction operation on a uint3x4 matrix and a uint value. + /// Left hand side uint3x4 to use to compute componentwise subtraction. + /// Right hand side uint to use to compute componentwise subtraction. + /// uint3x4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 operator - (uint3x4 lhs, uint rhs) { return new uint3x4 (lhs.c0 - rhs, lhs.c1 - rhs, lhs.c2 - rhs, lhs.c3 - rhs); } + + /// Returns the result of a componentwise subtraction operation on a uint value and a uint3x4 matrix. + /// Left hand side uint to use to compute componentwise subtraction. + /// Right hand side uint3x4 to use to compute componentwise subtraction. + /// uint3x4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 operator - (uint lhs, uint3x4 rhs) { return new uint3x4 (lhs - rhs.c0, lhs - rhs.c1, lhs - rhs.c2, lhs - rhs.c3); } + + + /// Returns the result of a componentwise division operation on two uint3x4 matrices. + /// Left hand side uint3x4 to use to compute componentwise division. + /// Right hand side uint3x4 to use to compute componentwise division. + /// uint3x4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 operator / (uint3x4 lhs, uint3x4 rhs) { return new uint3x4 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1, lhs.c2 / rhs.c2, lhs.c3 / rhs.c3); } + + /// Returns the result of a componentwise division operation on a uint3x4 matrix and a uint value. + /// Left hand side uint3x4 to use to compute componentwise division. + /// Right hand side uint to use to compute componentwise division. + /// uint3x4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 operator / (uint3x4 lhs, uint rhs) { return new uint3x4 (lhs.c0 / rhs, lhs.c1 / rhs, lhs.c2 / rhs, lhs.c3 / rhs); } + + /// Returns the result of a componentwise division operation on a uint value and a uint3x4 matrix. + /// Left hand side uint to use to compute componentwise division. + /// Right hand side uint3x4 to use to compute componentwise division. + /// uint3x4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 operator / (uint lhs, uint3x4 rhs) { return new uint3x4 (lhs / rhs.c0, lhs / rhs.c1, lhs / rhs.c2, lhs / rhs.c3); } + + + /// Returns the result of a componentwise modulus operation on two uint3x4 matrices. + /// Left hand side uint3x4 to use to compute componentwise modulus. + /// Right hand side uint3x4 to use to compute componentwise modulus. + /// uint3x4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 operator % (uint3x4 lhs, uint3x4 rhs) { return new uint3x4 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1, lhs.c2 % rhs.c2, lhs.c3 % rhs.c3); } + + /// Returns the result of a componentwise modulus operation on a uint3x4 matrix and a uint value. + /// Left hand side uint3x4 to use to compute componentwise modulus. + /// Right hand side uint to use to compute componentwise modulus. + /// uint3x4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 operator % (uint3x4 lhs, uint rhs) { return new uint3x4 (lhs.c0 % rhs, lhs.c1 % rhs, lhs.c2 % rhs, lhs.c3 % rhs); } + + /// Returns the result of a componentwise modulus operation on a uint value and a uint3x4 matrix. + /// Left hand side uint to use to compute componentwise modulus. + /// Right hand side uint3x4 to use to compute componentwise modulus. + /// uint3x4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 operator % (uint lhs, uint3x4 rhs) { return new uint3x4 (lhs % rhs.c0, lhs % rhs.c1, lhs % rhs.c2, lhs % rhs.c3); } + + + /// Returns the result of a componentwise increment operation on a uint3x4 matrix. + /// Value to use when computing the componentwise increment. + /// uint3x4 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 operator ++ (uint3x4 val) { return new uint3x4 (++val.c0, ++val.c1, ++val.c2, ++val.c3); } + + + /// Returns the result of a componentwise decrement operation on a uint3x4 matrix. + /// Value to use when computing the componentwise decrement. + /// uint3x4 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 operator -- (uint3x4 val) { return new uint3x4 (--val.c0, --val.c1, --val.c2, --val.c3); } + + + /// Returns the result of a componentwise less than operation on two uint3x4 matrices. + /// Left hand side uint3x4 to use to compute componentwise less than. + /// Right hand side uint3x4 to use to compute componentwise less than. + /// bool3x4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator < (uint3x4 lhs, uint3x4 rhs) { return new bool3x4 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1, lhs.c2 < rhs.c2, lhs.c3 < rhs.c3); } + + /// Returns the result of a componentwise less than operation on a uint3x4 matrix and a uint value. + /// Left hand side uint3x4 to use to compute componentwise less than. + /// Right hand side uint to use to compute componentwise less than. + /// bool3x4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator < (uint3x4 lhs, uint rhs) { return new bool3x4 (lhs.c0 < rhs, lhs.c1 < rhs, lhs.c2 < rhs, lhs.c3 < rhs); } + + /// Returns the result of a componentwise less than operation on a uint value and a uint3x4 matrix. + /// Left hand side uint to use to compute componentwise less than. + /// Right hand side uint3x4 to use to compute componentwise less than. + /// bool3x4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator < (uint lhs, uint3x4 rhs) { return new bool3x4 (lhs < rhs.c0, lhs < rhs.c1, lhs < rhs.c2, lhs < rhs.c3); } + + + /// Returns the result of a componentwise less or equal operation on two uint3x4 matrices. + /// Left hand side uint3x4 to use to compute componentwise less or equal. + /// Right hand side uint3x4 to use to compute componentwise less or equal. + /// bool3x4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator <= (uint3x4 lhs, uint3x4 rhs) { return new bool3x4 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1, lhs.c2 <= rhs.c2, lhs.c3 <= rhs.c3); } + + /// Returns the result of a componentwise less or equal operation on a uint3x4 matrix and a uint value. + /// Left hand side uint3x4 to use to compute componentwise less or equal. + /// Right hand side uint to use to compute componentwise less or equal. + /// bool3x4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator <= (uint3x4 lhs, uint rhs) { return new bool3x4 (lhs.c0 <= rhs, lhs.c1 <= rhs, lhs.c2 <= rhs, lhs.c3 <= rhs); } + + /// Returns the result of a componentwise less or equal operation on a uint value and a uint3x4 matrix. + /// Left hand side uint to use to compute componentwise less or equal. + /// Right hand side uint3x4 to use to compute componentwise less or equal. + /// bool3x4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator <= (uint lhs, uint3x4 rhs) { return new bool3x4 (lhs <= rhs.c0, lhs <= rhs.c1, lhs <= rhs.c2, lhs <= rhs.c3); } + + + /// Returns the result of a componentwise greater than operation on two uint3x4 matrices. + /// Left hand side uint3x4 to use to compute componentwise greater than. + /// Right hand side uint3x4 to use to compute componentwise greater than. + /// bool3x4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator > (uint3x4 lhs, uint3x4 rhs) { return new bool3x4 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1, lhs.c2 > rhs.c2, lhs.c3 > rhs.c3); } + + /// Returns the result of a componentwise greater than operation on a uint3x4 matrix and a uint value. + /// Left hand side uint3x4 to use to compute componentwise greater than. + /// Right hand side uint to use to compute componentwise greater than. + /// bool3x4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator > (uint3x4 lhs, uint rhs) { return new bool3x4 (lhs.c0 > rhs, lhs.c1 > rhs, lhs.c2 > rhs, lhs.c3 > rhs); } + + /// Returns the result of a componentwise greater than operation on a uint value and a uint3x4 matrix. + /// Left hand side uint to use to compute componentwise greater than. + /// Right hand side uint3x4 to use to compute componentwise greater than. + /// bool3x4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator > (uint lhs, uint3x4 rhs) { return new bool3x4 (lhs > rhs.c0, lhs > rhs.c1, lhs > rhs.c2, lhs > rhs.c3); } + + + /// Returns the result of a componentwise greater or equal operation on two uint3x4 matrices. + /// Left hand side uint3x4 to use to compute componentwise greater or equal. + /// Right hand side uint3x4 to use to compute componentwise greater or equal. + /// bool3x4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator >= (uint3x4 lhs, uint3x4 rhs) { return new bool3x4 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1, lhs.c2 >= rhs.c2, lhs.c3 >= rhs.c3); } + + /// Returns the result of a componentwise greater or equal operation on a uint3x4 matrix and a uint value. + /// Left hand side uint3x4 to use to compute componentwise greater or equal. + /// Right hand side uint to use to compute componentwise greater or equal. + /// bool3x4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator >= (uint3x4 lhs, uint rhs) { return new bool3x4 (lhs.c0 >= rhs, lhs.c1 >= rhs, lhs.c2 >= rhs, lhs.c3 >= rhs); } + + /// Returns the result of a componentwise greater or equal operation on a uint value and a uint3x4 matrix. + /// Left hand side uint to use to compute componentwise greater or equal. + /// Right hand side uint3x4 to use to compute componentwise greater or equal. + /// bool3x4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator >= (uint lhs, uint3x4 rhs) { return new bool3x4 (lhs >= rhs.c0, lhs >= rhs.c1, lhs >= rhs.c2, lhs >= rhs.c3); } + + + /// Returns the result of a componentwise unary minus operation on a uint3x4 matrix. + /// Value to use when computing the componentwise unary minus. + /// uint3x4 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 operator - (uint3x4 val) { return new uint3x4 (-val.c0, -val.c1, -val.c2, -val.c3); } + + + /// Returns the result of a componentwise unary plus operation on a uint3x4 matrix. + /// Value to use when computing the componentwise unary plus. + /// uint3x4 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 operator + (uint3x4 val) { return new uint3x4 (+val.c0, +val.c1, +val.c2, +val.c3); } + + + /// Returns the result of a componentwise left shift operation on a uint3x4 matrix by a number of bits specified by a single int. + /// The matrix to left shift. + /// The number of bits to left shift. + /// The result of the componentwise left shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 operator << (uint3x4 x, int n) { return new uint3x4 (x.c0 << n, x.c1 << n, x.c2 << n, x.c3 << n); } + + /// Returns the result of a componentwise right shift operation on a uint3x4 matrix by a number of bits specified by a single int. + /// The matrix to right shift. + /// The number of bits to right shift. + /// The result of the componentwise right shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 operator >> (uint3x4 x, int n) { return new uint3x4 (x.c0 >> n, x.c1 >> n, x.c2 >> n, x.c3 >> n); } + + /// Returns the result of a componentwise equality operation on two uint3x4 matrices. + /// Left hand side uint3x4 to use to compute componentwise equality. + /// Right hand side uint3x4 to use to compute componentwise equality. + /// bool3x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator == (uint3x4 lhs, uint3x4 rhs) { return new bool3x4 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2, lhs.c3 == rhs.c3); } + + /// Returns the result of a componentwise equality operation on a uint3x4 matrix and a uint value. + /// Left hand side uint3x4 to use to compute componentwise equality. + /// Right hand side uint to use to compute componentwise equality. + /// bool3x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator == (uint3x4 lhs, uint rhs) { return new bool3x4 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs, lhs.c3 == rhs); } + + /// Returns the result of a componentwise equality operation on a uint value and a uint3x4 matrix. + /// Left hand side uint to use to compute componentwise equality. + /// Right hand side uint3x4 to use to compute componentwise equality. + /// bool3x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator == (uint lhs, uint3x4 rhs) { return new bool3x4 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2, lhs == rhs.c3); } + + + /// Returns the result of a componentwise not equal operation on two uint3x4 matrices. + /// Left hand side uint3x4 to use to compute componentwise not equal. + /// Right hand side uint3x4 to use to compute componentwise not equal. + /// bool3x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator != (uint3x4 lhs, uint3x4 rhs) { return new bool3x4 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2, lhs.c3 != rhs.c3); } + + /// Returns the result of a componentwise not equal operation on a uint3x4 matrix and a uint value. + /// Left hand side uint3x4 to use to compute componentwise not equal. + /// Right hand side uint to use to compute componentwise not equal. + /// bool3x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator != (uint3x4 lhs, uint rhs) { return new bool3x4 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs, lhs.c3 != rhs); } + + /// Returns the result of a componentwise not equal operation on a uint value and a uint3x4 matrix. + /// Left hand side uint to use to compute componentwise not equal. + /// Right hand side uint3x4 to use to compute componentwise not equal. + /// bool3x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool3x4 operator != (uint lhs, uint3x4 rhs) { return new bool3x4 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2, lhs != rhs.c3); } + + + /// Returns the result of a componentwise bitwise not operation on a uint3x4 matrix. + /// Value to use when computing the componentwise bitwise not. + /// uint3x4 result of the componentwise bitwise not. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 operator ~ (uint3x4 val) { return new uint3x4 (~val.c0, ~val.c1, ~val.c2, ~val.c3); } + + + /// Returns the result of a componentwise bitwise and operation on two uint3x4 matrices. + /// Left hand side uint3x4 to use to compute componentwise bitwise and. + /// Right hand side uint3x4 to use to compute componentwise bitwise and. + /// uint3x4 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 operator & (uint3x4 lhs, uint3x4 rhs) { return new uint3x4 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1, lhs.c2 & rhs.c2, lhs.c3 & rhs.c3); } + + /// Returns the result of a componentwise bitwise and operation on a uint3x4 matrix and a uint value. + /// Left hand side uint3x4 to use to compute componentwise bitwise and. + /// Right hand side uint to use to compute componentwise bitwise and. + /// uint3x4 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 operator & (uint3x4 lhs, uint rhs) { return new uint3x4 (lhs.c0 & rhs, lhs.c1 & rhs, lhs.c2 & rhs, lhs.c3 & rhs); } + + /// Returns the result of a componentwise bitwise and operation on a uint value and a uint3x4 matrix. + /// Left hand side uint to use to compute componentwise bitwise and. + /// Right hand side uint3x4 to use to compute componentwise bitwise and. + /// uint3x4 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 operator & (uint lhs, uint3x4 rhs) { return new uint3x4 (lhs & rhs.c0, lhs & rhs.c1, lhs & rhs.c2, lhs & rhs.c3); } + + + /// Returns the result of a componentwise bitwise or operation on two uint3x4 matrices. + /// Left hand side uint3x4 to use to compute componentwise bitwise or. + /// Right hand side uint3x4 to use to compute componentwise bitwise or. + /// uint3x4 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 operator | (uint3x4 lhs, uint3x4 rhs) { return new uint3x4 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1, lhs.c2 | rhs.c2, lhs.c3 | rhs.c3); } + + /// Returns the result of a componentwise bitwise or operation on a uint3x4 matrix and a uint value. + /// Left hand side uint3x4 to use to compute componentwise bitwise or. + /// Right hand side uint to use to compute componentwise bitwise or. + /// uint3x4 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 operator | (uint3x4 lhs, uint rhs) { return new uint3x4 (lhs.c0 | rhs, lhs.c1 | rhs, lhs.c2 | rhs, lhs.c3 | rhs); } + + /// Returns the result of a componentwise bitwise or operation on a uint value and a uint3x4 matrix. + /// Left hand side uint to use to compute componentwise bitwise or. + /// Right hand side uint3x4 to use to compute componentwise bitwise or. + /// uint3x4 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 operator | (uint lhs, uint3x4 rhs) { return new uint3x4 (lhs | rhs.c0, lhs | rhs.c1, lhs | rhs.c2, lhs | rhs.c3); } + + + /// Returns the result of a componentwise bitwise exclusive or operation on two uint3x4 matrices. + /// Left hand side uint3x4 to use to compute componentwise bitwise exclusive or. + /// Right hand side uint3x4 to use to compute componentwise bitwise exclusive or. + /// uint3x4 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 operator ^ (uint3x4 lhs, uint3x4 rhs) { return new uint3x4 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1, lhs.c2 ^ rhs.c2, lhs.c3 ^ rhs.c3); } + + /// Returns the result of a componentwise bitwise exclusive or operation on a uint3x4 matrix and a uint value. + /// Left hand side uint3x4 to use to compute componentwise bitwise exclusive or. + /// Right hand side uint to use to compute componentwise bitwise exclusive or. + /// uint3x4 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 operator ^ (uint3x4 lhs, uint rhs) { return new uint3x4 (lhs.c0 ^ rhs, lhs.c1 ^ rhs, lhs.c2 ^ rhs, lhs.c3 ^ rhs); } + + /// Returns the result of a componentwise bitwise exclusive or operation on a uint value and a uint3x4 matrix. + /// Left hand side uint to use to compute componentwise bitwise exclusive or. + /// Right hand side uint3x4 to use to compute componentwise bitwise exclusive or. + /// uint3x4 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 operator ^ (uint lhs, uint3x4 rhs) { return new uint3x4 (lhs ^ rhs.c0, lhs ^ rhs.c1, lhs ^ rhs.c2, lhs ^ rhs.c3); } + + + + /// Returns the uint3 element at a specified index. + unsafe public ref uint3 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 4) + throw new System.ArgumentException("index must be between[0...3]"); +#endif + fixed (uint3x4* array = &this) { return ref ((uint3*)array)[index]; } + } + } + + /// Returns true if the uint3x4 is equal to a given uint3x4, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(uint3x4 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2) && c3.Equals(rhs.c3); } + + /// Returns true if the uint3x4 is equal to a given uint3x4, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is uint3x4 converted && Equals(converted); } + + + /// Returns a hash code for the uint3x4. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the uint3x4. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("uint3x4({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11})", c0.x, c1.x, c2.x, c3.x, c0.y, c1.y, c2.y, c3.y, c0.z, c1.z, c2.z, c3.z); + } + + /// Returns a string representation of the uint3x4 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("uint3x4({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11})", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c2.x.ToString(format, formatProvider), c3.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c2.y.ToString(format, formatProvider), c3.y.ToString(format, formatProvider), c0.z.ToString(format, formatProvider), c1.z.ToString(format, formatProvider), c2.z.ToString(format, formatProvider), c3.z.ToString(format, formatProvider)); + } + + } + + public static partial class math + { + /// Returns a uint3x4 matrix constructed from four uint3 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// The matrix column c3 will be set to this value. + /// uint3x4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 uint3x4(uint3 c0, uint3 c1, uint3 c2, uint3 c3) { return new uint3x4(c0, c1, c2, c3); } + + /// Returns a uint3x4 matrix constructed from from 12 uint values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 0, column 3 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 1, column 3 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 2, column 2 will be set to this value. + /// The matrix at row 2, column 3 will be set to this value. + /// uint3x4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 uint3x4(uint m00, uint m01, uint m02, uint m03, + uint m10, uint m11, uint m12, uint m13, + uint m20, uint m21, uint m22, uint m23) + { + return new uint3x4(m00, m01, m02, m03, + m10, m11, m12, m13, + m20, m21, m22, m23); + } + + /// Returns a uint3x4 matrix constructed from a single uint value by assigning it to every component. + /// uint to convert to uint3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 uint3x4(uint v) { return new uint3x4(v); } + + /// Returns a uint3x4 matrix constructed from a single bool value by converting it to uint and assigning it to every component. + /// bool to convert to uint3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 uint3x4(bool v) { return new uint3x4(v); } + + /// Return a uint3x4 matrix constructed from a bool3x4 matrix by componentwise conversion. + /// bool3x4 to convert to uint3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 uint3x4(bool3x4 v) { return new uint3x4(v); } + + /// Returns a uint3x4 matrix constructed from a single int value by converting it to uint and assigning it to every component. + /// int to convert to uint3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 uint3x4(int v) { return new uint3x4(v); } + + /// Return a uint3x4 matrix constructed from a int3x4 matrix by componentwise conversion. + /// int3x4 to convert to uint3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 uint3x4(int3x4 v) { return new uint3x4(v); } + + /// Returns a uint3x4 matrix constructed from a single float value by converting it to uint and assigning it to every component. + /// float to convert to uint3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 uint3x4(float v) { return new uint3x4(v); } + + /// Return a uint3x4 matrix constructed from a float3x4 matrix by componentwise conversion. + /// float3x4 to convert to uint3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 uint3x4(float3x4 v) { return new uint3x4(v); } + + /// Returns a uint3x4 matrix constructed from a single double value by converting it to uint and assigning it to every component. + /// double to convert to uint3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 uint3x4(double v) { return new uint3x4(v); } + + /// Return a uint3x4 matrix constructed from a double3x4 matrix by componentwise conversion. + /// double3x4 to convert to uint3x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 uint3x4(double3x4 v) { return new uint3x4(v); } + + /// Return the uint4x3 transpose of a uint3x4 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 transpose(uint3x4 v) + { + return uint4x3( + v.c0.x, v.c0.y, v.c0.z, + v.c1.x, v.c1.y, v.c1.z, + v.c2.x, v.c2.y, v.c2.z, + v.c3.x, v.c3.y, v.c3.z); + } + + /// Returns a uint hash code of a uint3x4 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(uint3x4 v) + { + return csum(v.c0 * uint3(0xD1224537u, 0xE99ED6F3u, 0x48125549u) + + v.c1 * uint3(0xEEE2123Bu, 0xE3AD9FE5u, 0xCE1CF8BFu) + + v.c2 * uint3(0x7BE39F3Bu, 0xFAB9913Fu, 0xB4501269u) + + v.c3 * uint3(0xE04B89FDu, 0xDB3DE101u, 0x7B6D1B4Bu)) + 0x58399E77u; + } + + /// + /// Returns a uint3 vector hash code of a uint3x4 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint3 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 hashwide(uint3x4 v) + { + return (v.c0 * uint3(0x5EAC29C9u, 0xFC6014F9u, 0x6BF6693Fu) + + v.c1 * uint3(0x9D1B1D9Bu, 0xF842F5C1u, 0xA47EC335u) + + v.c2 * uint3(0xA477DF57u, 0xC4B1493Fu, 0xBA0966D3u) + + v.c3 * uint3(0xAFBEE253u, 0x5B419C01u, 0x515D90F5u)) + 0xEC9F68F3u; + } + + } +} diff --git a/src/Unity.Mathematics/uint3x4.gen.cs.meta b/src/Unity.Mathematics/uint3x4.gen.cs.meta new file mode 100644 index 00000000..e331fbd5 --- /dev/null +++ b/src/Unity.Mathematics/uint3x4.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b26cb334c782240eb950a56e23e0378c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/uint4.cs b/src/Unity.Mathematics/uint4.cs deleted file mode 100644 index a0fc0c40..00000000 --- a/src/Unity.Mathematics/uint4.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System.Runtime.CompilerServices; -using System.Diagnostics; - -#pragma warning disable 0660, 0661 - -namespace Unity.Mathematics -{ - [DebuggerTypeProxy(typeof(uint4.DebuggerProxy))] - [System.Serializable] - public partial struct uint4 - { - internal sealed class DebuggerProxy - { - public uint x; - public uint y; - public uint z; - public uint w; - - public DebuggerProxy(uint4 vec) - { - x = vec.x; - y = vec.y; - z = vec.z; - w = vec.z; - } - } - - public uint x; - public uint y; - public uint z; - public uint w; - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public uint4(uint x, uint y, uint z, uint w) - { - this.x = x; - this.y = y; - this.z = z; - this.w = w; - } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public uint4(uint val) { x = y = z = w = val; } - - // FIXME - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public uint4(uint3 xyz, uint w) { this.x = xyz.x; this.y = xyz.y; this.z = xyz.z; this.w = w; } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public uint4(int4 val) { x = (uint)val.x; y = (uint)val.y; z = (uint)val.z; w = (uint)val.w; } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public uint4(float4 val) { x = (uint)val.x; y = (uint)val.y; z = (uint)val.z; w = (uint)val.w; } - - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static implicit operator uint4(uint d) { return new uint4(d); } - [MethodImpl((MethodImplOptions)0x100)] // agressive inline - public static explicit operator uint4(float4 d) { return new uint4((uint)d.x, (uint)d.y, (uint)d.z, (uint)d.w); } - - public override string ToString() - { - return string.Format("uint4({0}, {1}, {2}, {3})", x, y, z, w); - } - } -} - diff --git a/src/Unity.Mathematics/uint4.cs.meta b/src/Unity.Mathematics/uint4.cs.meta deleted file mode 100644 index f90d368b..00000000 --- a/src/Unity.Mathematics/uint4.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: dc2ddaf072a45be4f810d79812b90cbb -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/src/Unity.Mathematics/uint4.gen.cs b/src/Unity.Mathematics/uint4.gen.cs index 082d34bb..cffed4fc 100644 --- a/src/Unity.Mathematics/uint4.gen.cs +++ b/src/Unity.Mathematics/uint4.gen.cs @@ -1,2953 +1,4093 @@ -// GENERATED CODE +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; using System.Runtime.CompilerServices; +using System.Diagnostics; +using Unity.IL2CPP.CompilerServices; + #pragma warning disable 0660, 0661 + namespace Unity.Mathematics { - public partial struct uint4 : System.IEquatable + /// A 4 component vector of uints. + [DebuggerTypeProxy(typeof(uint4.DebuggerProxy))] + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct uint4 : System.IEquatable, IFormattable { + /// x component of the vector. + public uint x; + /// y component of the vector. + public uint y; + /// z component of the vector. + public uint z; + /// w component of the vector. + public uint w; + + /// uint4 zero value. + public static readonly uint4 zero; + + /// Constructs a uint4 vector from four uint values. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + /// The constructed vector's z component will be set to this value. + /// The constructed vector's w component will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4(uint x, uint y, uint z, uint w) + { + this.x = x; + this.y = y; + this.z = z; + this.w = w; + } + + /// Constructs a uint4 vector from two uint values and a uint2 vector. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + /// The constructed vector's zw components will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4(uint x, uint y, uint2 zw) + { + this.x = x; + this.y = y; + this.z = zw.x; + this.w = zw.y; + } + + /// Constructs a uint4 vector from a uint value, a uint2 vector and a uint value. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's yz components will be set to this value. + /// The constructed vector's w component will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4(uint x, uint2 yz, uint w) + { + this.x = x; + this.y = yz.x; + this.z = yz.y; + this.w = w; + } + + /// Constructs a uint4 vector from a uint value and a uint3 vector. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's yzw components will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4(uint x, uint3 yzw) + { + this.x = x; + this.y = yzw.x; + this.z = yzw.y; + this.w = yzw.z; + } + + /// Constructs a uint4 vector from a uint2 vector and two uint values. + /// The constructed vector's xy components will be set to this value. + /// The constructed vector's z component will be set to this value. + /// The constructed vector's w component will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4(uint2 xy, uint z, uint w) + { + this.x = xy.x; + this.y = xy.y; + this.z = z; + this.w = w; + } + + /// Constructs a uint4 vector from two uint2 vectors. + /// The constructed vector's xy components will be set to this value. + /// The constructed vector's zw components will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4(uint2 xy, uint2 zw) + { + this.x = xy.x; + this.y = xy.y; + this.z = zw.x; + this.w = zw.y; + } + + /// Constructs a uint4 vector from a uint3 vector and a uint value. + /// The constructed vector's xyz components will be set to this value. + /// The constructed vector's w component will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4(uint3 xyz, uint w) + { + this.x = xyz.x; + this.y = xyz.y; + this.z = xyz.z; + this.w = w; + } - // mul - [MethodImpl(0x100)] + /// Constructs a uint4 vector from a uint4 vector. + /// The constructed vector's xyzw components will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4(uint4 xyzw) + { + this.x = xyzw.x; + this.y = xyzw.y; + this.z = xyzw.z; + this.w = xyzw.w; + } + + /// Constructs a uint4 vector from a single uint value by assigning it to every component. + /// uint to convert to uint4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4(uint v) + { + this.x = v; + this.y = v; + this.z = v; + this.w = v; + } + + /// Constructs a uint4 vector from a single bool value by converting it to uint and assigning it to every component. + /// bool to convert to uint4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4(bool v) + { + this.x = v ? 1u : 0u; + this.y = v ? 1u : 0u; + this.z = v ? 1u : 0u; + this.w = v ? 1u : 0u; + } + + /// Constructs a uint4 vector from a bool4 vector by componentwise conversion. + /// bool4 to convert to uint4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4(bool4 v) + { + this.x = v.x ? 1u : 0u; + this.y = v.y ? 1u : 0u; + this.z = v.z ? 1u : 0u; + this.w = v.w ? 1u : 0u; + } + + /// Constructs a uint4 vector from a single int value by converting it to uint and assigning it to every component. + /// int to convert to uint4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4(int v) + { + this.x = (uint)v; + this.y = (uint)v; + this.z = (uint)v; + this.w = (uint)v; + } + + /// Constructs a uint4 vector from a int4 vector by componentwise conversion. + /// int4 to convert to uint4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4(int4 v) + { + this.x = (uint)v.x; + this.y = (uint)v.y; + this.z = (uint)v.z; + this.w = (uint)v.w; + } + + /// Constructs a uint4 vector from a single float value by converting it to uint and assigning it to every component. + /// float to convert to uint4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4(float v) + { + this.x = (uint)v; + this.y = (uint)v; + this.z = (uint)v; + this.w = (uint)v; + } + + /// Constructs a uint4 vector from a float4 vector by componentwise conversion. + /// float4 to convert to uint4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4(float4 v) + { + this.x = (uint)v.x; + this.y = (uint)v.y; + this.z = (uint)v.z; + this.w = (uint)v.w; + } + + /// Constructs a uint4 vector from a single double value by converting it to uint and assigning it to every component. + /// double to convert to uint4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4(double v) + { + this.x = (uint)v; + this.y = (uint)v; + this.z = (uint)v; + this.w = (uint)v; + } + + /// Constructs a uint4 vector from a double4 vector by componentwise conversion. + /// double4 to convert to uint4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4(double4 v) + { + this.x = (uint)v.x; + this.y = (uint)v.y; + this.z = (uint)v.z; + this.w = (uint)v.w; + } + + + /// Implicitly converts a single uint value to a uint4 vector by assigning it to every component. + /// uint to convert to uint4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator uint4(uint v) { return new uint4(v); } + + /// Explicitly converts a single bool value to a uint4 vector by converting it to uint and assigning it to every component. + /// bool to convert to uint4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint4(bool v) { return new uint4(v); } + + /// Explicitly converts a bool4 vector to a uint4 vector by componentwise conversion. + /// bool4 to convert to uint4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint4(bool4 v) { return new uint4(v); } + + /// Explicitly converts a single int value to a uint4 vector by converting it to uint and assigning it to every component. + /// int to convert to uint4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint4(int v) { return new uint4(v); } + + /// Explicitly converts a int4 vector to a uint4 vector by componentwise conversion. + /// int4 to convert to uint4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint4(int4 v) { return new uint4(v); } + + /// Explicitly converts a single float value to a uint4 vector by converting it to uint and assigning it to every component. + /// float to convert to uint4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint4(float v) { return new uint4(v); } + + /// Explicitly converts a float4 vector to a uint4 vector by componentwise conversion. + /// float4 to convert to uint4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint4(float4 v) { return new uint4(v); } + + /// Explicitly converts a single double value to a uint4 vector by converting it to uint and assigning it to every component. + /// double to convert to uint4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint4(double v) { return new uint4(v); } + + /// Explicitly converts a double4 vector to a uint4 vector by componentwise conversion. + /// double4 to convert to uint4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint4(double4 v) { return new uint4(v); } + + + /// Returns the result of a componentwise multiplication operation on two uint4 vectors. + /// Left hand side uint4 to use to compute componentwise multiplication. + /// Right hand side uint4 to use to compute componentwise multiplication. + /// uint4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint4 operator * (uint4 lhs, uint4 rhs) { return new uint4 (lhs.x * rhs.x, lhs.y * rhs.y, lhs.z * rhs.z, lhs.w * rhs.w); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise multiplication operation on a uint4 vector and a uint value. + /// Left hand side uint4 to use to compute componentwise multiplication. + /// Right hand side uint to use to compute componentwise multiplication. + /// uint4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint4 operator * (uint4 lhs, uint rhs) { return new uint4 (lhs.x * rhs, lhs.y * rhs, lhs.z * rhs, lhs.w * rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise multiplication operation on a uint value and a uint4 vector. + /// Left hand side uint to use to compute componentwise multiplication. + /// Right hand side uint4 to use to compute componentwise multiplication. + /// uint4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint4 operator * (uint lhs, uint4 rhs) { return new uint4 (lhs * rhs.x, lhs * rhs.y, lhs * rhs.z, lhs * rhs.w); } - // add - [MethodImpl(0x100)] + + /// Returns the result of a componentwise addition operation on two uint4 vectors. + /// Left hand side uint4 to use to compute componentwise addition. + /// Right hand side uint4 to use to compute componentwise addition. + /// uint4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint4 operator + (uint4 lhs, uint4 rhs) { return new uint4 (lhs.x + rhs.x, lhs.y + rhs.y, lhs.z + rhs.z, lhs.w + rhs.w); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise addition operation on a uint4 vector and a uint value. + /// Left hand side uint4 to use to compute componentwise addition. + /// Right hand side uint to use to compute componentwise addition. + /// uint4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint4 operator + (uint4 lhs, uint rhs) { return new uint4 (lhs.x + rhs, lhs.y + rhs, lhs.z + rhs, lhs.w + rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise addition operation on a uint value and a uint4 vector. + /// Left hand side uint to use to compute componentwise addition. + /// Right hand side uint4 to use to compute componentwise addition. + /// uint4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint4 operator + (uint lhs, uint4 rhs) { return new uint4 (lhs + rhs.x, lhs + rhs.y, lhs + rhs.z, lhs + rhs.w); } - // sub - [MethodImpl(0x100)] + + /// Returns the result of a componentwise subtraction operation on two uint4 vectors. + /// Left hand side uint4 to use to compute componentwise subtraction. + /// Right hand side uint4 to use to compute componentwise subtraction. + /// uint4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint4 operator - (uint4 lhs, uint4 rhs) { return new uint4 (lhs.x - rhs.x, lhs.y - rhs.y, lhs.z - rhs.z, lhs.w - rhs.w); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise subtraction operation on a uint4 vector and a uint value. + /// Left hand side uint4 to use to compute componentwise subtraction. + /// Right hand side uint to use to compute componentwise subtraction. + /// uint4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint4 operator - (uint4 lhs, uint rhs) { return new uint4 (lhs.x - rhs, lhs.y - rhs, lhs.z - rhs, lhs.w - rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise subtraction operation on a uint value and a uint4 vector. + /// Left hand side uint to use to compute componentwise subtraction. + /// Right hand side uint4 to use to compute componentwise subtraction. + /// uint4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint4 operator - (uint lhs, uint4 rhs) { return new uint4 (lhs - rhs.x, lhs - rhs.y, lhs - rhs.z, lhs - rhs.w); } - // div - [MethodImpl(0x100)] + + /// Returns the result of a componentwise division operation on two uint4 vectors. + /// Left hand side uint4 to use to compute componentwise division. + /// Right hand side uint4 to use to compute componentwise division. + /// uint4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint4 operator / (uint4 lhs, uint4 rhs) { return new uint4 (lhs.x / rhs.x, lhs.y / rhs.y, lhs.z / rhs.z, lhs.w / rhs.w); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise division operation on a uint4 vector and a uint value. + /// Left hand side uint4 to use to compute componentwise division. + /// Right hand side uint to use to compute componentwise division. + /// uint4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint4 operator / (uint4 lhs, uint rhs) { return new uint4 (lhs.x / rhs, lhs.y / rhs, lhs.z / rhs, lhs.w / rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise division operation on a uint value and a uint4 vector. + /// Left hand side uint to use to compute componentwise division. + /// Right hand side uint4 to use to compute componentwise division. + /// uint4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint4 operator / (uint lhs, uint4 rhs) { return new uint4 (lhs / rhs.x, lhs / rhs.y, lhs / rhs.z, lhs / rhs.w); } - // smaller - [MethodImpl(0x100)] + + /// Returns the result of a componentwise modulus operation on two uint4 vectors. + /// Left hand side uint4 to use to compute componentwise modulus. + /// Right hand side uint4 to use to compute componentwise modulus. + /// uint4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 operator % (uint4 lhs, uint4 rhs) { return new uint4 (lhs.x % rhs.x, lhs.y % rhs.y, lhs.z % rhs.z, lhs.w % rhs.w); } + + /// Returns the result of a componentwise modulus operation on a uint4 vector and a uint value. + /// Left hand side uint4 to use to compute componentwise modulus. + /// Right hand side uint to use to compute componentwise modulus. + /// uint4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 operator % (uint4 lhs, uint rhs) { return new uint4 (lhs.x % rhs, lhs.y % rhs, lhs.z % rhs, lhs.w % rhs); } + + /// Returns the result of a componentwise modulus operation on a uint value and a uint4 vector. + /// Left hand side uint to use to compute componentwise modulus. + /// Right hand side uint4 to use to compute componentwise modulus. + /// uint4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 operator % (uint lhs, uint4 rhs) { return new uint4 (lhs % rhs.x, lhs % rhs.y, lhs % rhs.z, lhs % rhs.w); } + + + /// Returns the result of a componentwise increment operation on a uint4 vector. + /// Value to use when computing the componentwise increment. + /// uint4 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 operator ++ (uint4 val) { return new uint4 (++val.x, ++val.y, ++val.z, ++val.w); } + + + /// Returns the result of a componentwise decrement operation on a uint4 vector. + /// Value to use when computing the componentwise decrement. + /// uint4 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 operator -- (uint4 val) { return new uint4 (--val.x, --val.y, --val.z, --val.w); } + + + /// Returns the result of a componentwise less than operation on two uint4 vectors. + /// Left hand side uint4 to use to compute componentwise less than. + /// Right hand side uint4 to use to compute componentwise less than. + /// bool4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator < (uint4 lhs, uint4 rhs) { return new bool4 (lhs.x < rhs.x, lhs.y < rhs.y, lhs.z < rhs.z, lhs.w < rhs.w); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise less than operation on a uint4 vector and a uint value. + /// Left hand side uint4 to use to compute componentwise less than. + /// Right hand side uint to use to compute componentwise less than. + /// bool4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator < (uint4 lhs, uint rhs) { return new bool4 (lhs.x < rhs, lhs.y < rhs, lhs.z < rhs, lhs.w < rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise less than operation on a uint value and a uint4 vector. + /// Left hand side uint to use to compute componentwise less than. + /// Right hand side uint4 to use to compute componentwise less than. + /// bool4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator < (uint lhs, uint4 rhs) { return new bool4 (lhs < rhs.x, lhs < rhs.y, lhs < rhs.z, lhs < rhs.w); } - [MethodImpl(0x100)] + + + /// Returns the result of a componentwise less or equal operation on two uint4 vectors. + /// Left hand side uint4 to use to compute componentwise less or equal. + /// Right hand side uint4 to use to compute componentwise less or equal. + /// bool4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator <= (uint4 lhs, uint4 rhs) { return new bool4 (lhs.x <= rhs.x, lhs.y <= rhs.y, lhs.z <= rhs.z, lhs.w <= rhs.w); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise less or equal operation on a uint4 vector and a uint value. + /// Left hand side uint4 to use to compute componentwise less or equal. + /// Right hand side uint to use to compute componentwise less or equal. + /// bool4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator <= (uint4 lhs, uint rhs) { return new bool4 (lhs.x <= rhs, lhs.y <= rhs, lhs.z <= rhs, lhs.w <= rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise less or equal operation on a uint value and a uint4 vector. + /// Left hand side uint to use to compute componentwise less or equal. + /// Right hand side uint4 to use to compute componentwise less or equal. + /// bool4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator <= (uint lhs, uint4 rhs) { return new bool4 (lhs <= rhs.x, lhs <= rhs.y, lhs <= rhs.z, lhs <= rhs.w); } - // greater - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater than operation on two uint4 vectors. + /// Left hand side uint4 to use to compute componentwise greater than. + /// Right hand side uint4 to use to compute componentwise greater than. + /// bool4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator > (uint4 lhs, uint4 rhs) { return new bool4 (lhs.x > rhs.x, lhs.y > rhs.y, lhs.z > rhs.z, lhs.w > rhs.w); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater than operation on a uint4 vector and a uint value. + /// Left hand side uint4 to use to compute componentwise greater than. + /// Right hand side uint to use to compute componentwise greater than. + /// bool4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator > (uint4 lhs, uint rhs) { return new bool4 (lhs.x > rhs, lhs.y > rhs, lhs.z > rhs, lhs.w > rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater than operation on a uint value and a uint4 vector. + /// Left hand side uint to use to compute componentwise greater than. + /// Right hand side uint4 to use to compute componentwise greater than. + /// bool4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator > (uint lhs, uint4 rhs) { return new bool4 (lhs > rhs.x, lhs > rhs.y, lhs > rhs.z, lhs > rhs.w); } - [MethodImpl(0x100)] + + + /// Returns the result of a componentwise greater or equal operation on two uint4 vectors. + /// Left hand side uint4 to use to compute componentwise greater or equal. + /// Right hand side uint4 to use to compute componentwise greater or equal. + /// bool4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator >= (uint4 lhs, uint4 rhs) { return new bool4 (lhs.x >= rhs.x, lhs.y >= rhs.y, lhs.z >= rhs.z, lhs.w >= rhs.w); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater or equal operation on a uint4 vector and a uint value. + /// Left hand side uint4 to use to compute componentwise greater or equal. + /// Right hand side uint to use to compute componentwise greater or equal. + /// bool4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator >= (uint4 lhs, uint rhs) { return new bool4 (lhs.x >= rhs, lhs.y >= rhs, lhs.z >= rhs, lhs.w >= rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise greater or equal operation on a uint value and a uint4 vector. + /// Left hand side uint to use to compute componentwise greater or equal. + /// Right hand side uint4 to use to compute componentwise greater or equal. + /// bool4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator >= (uint lhs, uint4 rhs) { return new bool4 (lhs >= rhs.x, lhs >= rhs.y, lhs >= rhs.z, lhs >= rhs.w); } - // left shift - [MethodImpl(0x100)] - public static uint4 operator << (uint4 lhs, int rhs) { return new uint4 (lhs.x << rhs, lhs.y << rhs, lhs.z << rhs, lhs.w << rhs); } - // right shift - [MethodImpl(0x100)] - public static uint4 operator >> (uint4 lhs, int rhs) { return new uint4 (lhs.x >> rhs, lhs.y >> rhs, lhs.z >> rhs, lhs.w >> rhs); } + /// Returns the result of a componentwise unary minus operation on a uint4 vector. + /// Value to use when computing the componentwise unary minus. + /// uint4 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 operator - (uint4 val) { return new uint4 ((uint)-val.x, (uint)-val.y, (uint)-val.z, (uint)-val.w); } + + + /// Returns the result of a componentwise unary plus operation on a uint4 vector. + /// Value to use when computing the componentwise unary plus. + /// uint4 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 operator + (uint4 val) { return new uint4 (+val.x, +val.y, +val.z, +val.w); } - // equal - [MethodImpl(0x100)] + + /// Returns the result of a componentwise left shift operation on a uint4 vector by a number of bits specified by a single int. + /// The vector to left shift. + /// The number of bits to left shift. + /// The result of the componentwise left shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 operator << (uint4 x, int n) { return new uint4 (x.x << n, x.y << n, x.z << n, x.w << n); } + + /// Returns the result of a componentwise right shift operation on a uint4 vector by a number of bits specified by a single int. + /// The vector to right shift. + /// The number of bits to right shift. + /// The result of the componentwise right shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 operator >> (uint4 x, int n) { return new uint4 (x.x >> n, x.y >> n, x.z >> n, x.w >> n); } + + /// Returns the result of a componentwise equality operation on two uint4 vectors. + /// Left hand side uint4 to use to compute componentwise equality. + /// Right hand side uint4 to use to compute componentwise equality. + /// bool4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator == (uint4 lhs, uint4 rhs) { return new bool4 (lhs.x == rhs.x, lhs.y == rhs.y, lhs.z == rhs.z, lhs.w == rhs.w); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise equality operation on a uint4 vector and a uint value. + /// Left hand side uint4 to use to compute componentwise equality. + /// Right hand side uint to use to compute componentwise equality. + /// bool4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator == (uint4 lhs, uint rhs) { return new bool4 (lhs.x == rhs, lhs.y == rhs, lhs.z == rhs, lhs.w == rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise equality operation on a uint value and a uint4 vector. + /// Left hand side uint to use to compute componentwise equality. + /// Right hand side uint4 to use to compute componentwise equality. + /// bool4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator == (uint lhs, uint4 rhs) { return new bool4 (lhs == rhs.x, lhs == rhs.y, lhs == rhs.z, lhs == rhs.w); } - // not equal - [MethodImpl(0x100)] + + /// Returns the result of a componentwise not equal operation on two uint4 vectors. + /// Left hand side uint4 to use to compute componentwise not equal. + /// Right hand side uint4 to use to compute componentwise not equal. + /// bool4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator != (uint4 lhs, uint4 rhs) { return new bool4 (lhs.x != rhs.x, lhs.y != rhs.y, lhs.z != rhs.z, lhs.w != rhs.w); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise not equal operation on a uint4 vector and a uint value. + /// Left hand side uint4 to use to compute componentwise not equal. + /// Right hand side uint to use to compute componentwise not equal. + /// bool4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator != (uint4 lhs, uint rhs) { return new bool4 (lhs.x != rhs, lhs.y != rhs, lhs.z != rhs, lhs.w != rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise not equal operation on a uint value and a uint4 vector. + /// Left hand side uint to use to compute componentwise not equal. + /// Right hand side uint4 to use to compute componentwise not equal. + /// bool4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool4 operator != (uint lhs, uint4 rhs) { return new bool4 (lhs != rhs.x, lhs != rhs.y, lhs != rhs.z, lhs != rhs.w); } - // Equals - [MethodImpl(0x100)] - public bool Equals(uint4 rhs) { return x == rhs.x && y == rhs.y && z == rhs.z && w == rhs.w; } - // [int index] - unsafe public uint this[int index] - { - get - { -#if ENABLE_UNITY_COLLECTIONS_CHECKS - if ((uint)index >= 4) - throw new System.ArgumentException("index must be between[0...3]"); -#endif - fixed (uint* array = &x) { return array[index]; } - } - set - { -#if ENABLE_UNITY_COLLECTIONS_CHECKS - if ((uint)index >= 4) - throw new System.ArgumentException("index must be between[0...3]"); -#endif - fixed (uint* array = &x) { array[index] = value; } - } - } + /// Returns the result of a componentwise bitwise not operation on a uint4 vector. + /// Value to use when computing the componentwise bitwise not. + /// uint4 result of the componentwise bitwise not. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 operator ~ (uint4 val) { return new uint4 (~val.x, ~val.y, ~val.z, ~val.w); } - // operator & - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise and operation on two uint4 vectors. + /// Left hand side uint4 to use to compute componentwise bitwise and. + /// Right hand side uint4 to use to compute componentwise bitwise and. + /// uint4 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint4 operator & (uint4 lhs, uint4 rhs) { return new uint4 (lhs.x & rhs.x, lhs.y & rhs.y, lhs.z & rhs.z, lhs.w & rhs.w); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise and operation on a uint4 vector and a uint value. + /// Left hand side uint4 to use to compute componentwise bitwise and. + /// Right hand side uint to use to compute componentwise bitwise and. + /// uint4 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint4 operator & (uint4 lhs, uint rhs) { return new uint4 (lhs.x & rhs, lhs.y & rhs, lhs.z & rhs, lhs.w & rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise and operation on a uint value and a uint4 vector. + /// Left hand side uint to use to compute componentwise bitwise and. + /// Right hand side uint4 to use to compute componentwise bitwise and. + /// uint4 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint4 operator & (uint lhs, uint4 rhs) { return new uint4 (lhs & rhs.x, lhs & rhs.y, lhs & rhs.z, lhs & rhs.w); } - // operator | - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise or operation on two uint4 vectors. + /// Left hand side uint4 to use to compute componentwise bitwise or. + /// Right hand side uint4 to use to compute componentwise bitwise or. + /// uint4 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint4 operator | (uint4 lhs, uint4 rhs) { return new uint4 (lhs.x | rhs.x, lhs.y | rhs.y, lhs.z | rhs.z, lhs.w | rhs.w); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise or operation on a uint4 vector and a uint value. + /// Left hand side uint4 to use to compute componentwise bitwise or. + /// Right hand side uint to use to compute componentwise bitwise or. + /// uint4 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint4 operator | (uint4 lhs, uint rhs) { return new uint4 (lhs.x | rhs, lhs.y | rhs, lhs.z | rhs, lhs.w | rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise or operation on a uint value and a uint4 vector. + /// Left hand side uint to use to compute componentwise bitwise or. + /// Right hand side uint4 to use to compute componentwise bitwise or. + /// uint4 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint4 operator | (uint lhs, uint4 rhs) { return new uint4 (lhs | rhs.x, lhs | rhs.y, lhs | rhs.z, lhs | rhs.w); } - // operator ^ - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise exclusive or operation on two uint4 vectors. + /// Left hand side uint4 to use to compute componentwise bitwise exclusive or. + /// Right hand side uint4 to use to compute componentwise bitwise exclusive or. + /// uint4 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint4 operator ^ (uint4 lhs, uint4 rhs) { return new uint4 (lhs.x ^ rhs.x, lhs.y ^ rhs.y, lhs.z ^ rhs.z, lhs.w ^ rhs.w); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise exclusive or operation on a uint4 vector and a uint value. + /// Left hand side uint4 to use to compute componentwise bitwise exclusive or. + /// Right hand side uint to use to compute componentwise bitwise exclusive or. + /// uint4 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint4 operator ^ (uint4 lhs, uint rhs) { return new uint4 (lhs.x ^ rhs, lhs.y ^ rhs, lhs.z ^ rhs, lhs.w ^ rhs); } - [MethodImpl(0x100)] + + /// Returns the result of a componentwise bitwise exclusive or operation on a uint value and a uint4 vector. + /// Left hand side uint to use to compute componentwise bitwise exclusive or. + /// Right hand side uint4 to use to compute componentwise bitwise exclusive or. + /// uint4 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint4 operator ^ (uint lhs, uint4 rhs) { return new uint4 (lhs ^ rhs.x, lhs ^ rhs.y, lhs ^ rhs.z, lhs ^ rhs.w); } - // operator ~ - [MethodImpl(0x100)] - public static uint4 operator ~ (uint4 val) { return new uint4 (~val.x, ~val.y, ~val.z, ~val.w); } [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + + + + /// Swizzles the vector. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xxxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xxxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xxxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, x, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xxxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, x, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xxyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xxyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xxyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, x, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xxyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, x, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xxzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, x, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xxzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, x, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xxzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, x, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xxzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, x, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xxwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, x, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xxwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, x, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xxwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, x, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xxww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, x, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xyxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xyxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xyxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, y, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xyxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, y, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xyyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xyyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xyyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, y, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xyyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, y, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xyzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, y, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xyzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, y, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xyzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, y, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xyzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, y, z, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; y = value.y; z = value.z; w = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xywx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, y, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xywy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, y, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xywz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, y, w, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; y = value.y; w = value.z; z = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xyww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, y, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xzxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, z, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xzxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, z, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xzxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, z, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xzxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, z, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xzyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, z, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xzyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, z, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xzyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, z, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xzyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, z, y, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; z = value.y; y = value.z; w = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xzzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, z, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xzzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, z, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xzzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, z, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xzzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, z, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xzwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, z, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xzwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, z, w, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; z = value.y; w = value.z; y = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xzwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, z, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xzww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, z, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xwxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, w, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xwxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, w, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xwxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, w, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xwxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, w, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xwyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, w, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xwyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, w, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xwyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, w, y, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; w = value.y; y = value.z; z = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xwyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, w, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xwzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, w, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xwzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, w, z, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; w = value.y; z = value.z; y = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xwzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, w, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xwzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, w, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xwwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, w, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xwwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, w, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xwwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, w, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 xwww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(x, w, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yxxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yxxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yxxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, x, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yxxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, x, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yxyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yxyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yxyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, x, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yxyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, x, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yxzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, x, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yxzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, x, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yxzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, x, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yxzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, x, z, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; x = value.y; z = value.z; w = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yxwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, x, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yxwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, x, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yxwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, x, w, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; x = value.y; w = value.z; z = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yxww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, x, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yyxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yyxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yyxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, y, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yyxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, y, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yyyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yyyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yyyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, y, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yyyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, y, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yyzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, y, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yyzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, y, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yyzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, y, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yyzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, y, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yywx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, y, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yywy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, y, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yywz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, y, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yyww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, y, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yzxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, z, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yzxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, z, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yzxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, z, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yzxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, z, x, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; z = value.y; x = value.z; w = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yzyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, z, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yzyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, z, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yzyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, z, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yzyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, z, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yzzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, z, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yzzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, z, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yzzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, z, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yzzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, z, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yzwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, z, w, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; z = value.y; w = value.z; x = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yzwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, z, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yzwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, z, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 yzww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, z, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 ywxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, w, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 ywxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, w, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 ywxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, w, x, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; w = value.y; x = value.z; z = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 ywxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, w, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 ywyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, w, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 ywyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, w, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 ywyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, w, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 ywyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, w, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 ywzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, w, z, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; w = value.y; z = value.z; x = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 ywzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, w, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 ywzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, w, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 ywzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, w, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 ywwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, w, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 ywwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, w, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 ywwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, w, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 ywww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(y, w, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zxxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zxxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zxxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, x, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zxxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, x, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zxyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zxyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zxyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, x, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zxyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, x, y, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; x = value.y; y = value.z; w = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zxzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, x, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zxzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, x, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zxzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, x, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zxzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, x, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zxwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, x, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zxwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, x, w, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; x = value.y; w = value.z; y = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zxwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, x, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zxww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, x, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zyxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zyxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zyxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, y, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zyxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, y, x, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; y = value.y; x = value.z; w = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zyyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zyyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zyyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, y, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zyyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, y, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zyzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, y, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zyzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, y, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zyzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, y, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zyzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, y, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zywx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, y, w, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; y = value.y; w = value.z; x = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zywy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, y, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zywz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, y, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zyww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, y, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zzxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, z, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zzxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, z, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zzxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, z, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zzxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, z, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zzyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, z, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zzyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, z, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zzyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, z, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zzyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, z, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zzzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, z, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zzzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, z, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zzzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, z, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zzzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, z, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zzwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, z, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zzwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, z, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zzwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, z, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zzww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, z, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zwxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, w, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zwxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, w, x, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; w = value.y; x = value.z; y = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zwxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, w, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zwxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, w, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zwyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, w, y, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; w = value.y; y = value.z; x = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zwyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, w, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zwyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, w, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zwyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, w, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zwzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, w, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zwzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, w, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zwzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, w, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zwzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, w, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zwwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, w, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zwwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, w, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zwwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, w, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 zwww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(z, w, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wxxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wxxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wxxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, x, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wxxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, x, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wxyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wxyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wxyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, x, y, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; x = value.y; y = value.z; z = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wxyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, x, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wxzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, x, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wxzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, x, z, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; x = value.y; z = value.z; y = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wxzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, x, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wxzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, x, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wxwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, x, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wxwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, x, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wxwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, x, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wxww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, x, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wyxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wyxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wyxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, y, x, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; y = value.y; x = value.z; z = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wyxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, y, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wyyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wyyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wyyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, y, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wyyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, y, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wyzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, y, z, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; y = value.y; z = value.z; x = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wyzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, y, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wyzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, y, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wyzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, y, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wywx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, y, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wywy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, y, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wywz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, y, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wyww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, y, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wzxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, z, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wzxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, z, x, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; z = value.y; x = value.z; y = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wzxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, z, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wzxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, z, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wzyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, z, y, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; z = value.y; y = value.z; x = value.w; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wzyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, z, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wzyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, z, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wzyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, z, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wzzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, z, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wzzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, z, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wzzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, z, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wzzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, z, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wzwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, z, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wzwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, z, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wzwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, z, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wzww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, z, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wwxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, w, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wwxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, w, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wwxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, w, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wwxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, w, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wwyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, w, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wwyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, w, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wwyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, w, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wwyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, w, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wwzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, w, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wwzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, w, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wwzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, w, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wwzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, w, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wwwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, w, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wwwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, w, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wwwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, w, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint4 wwww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint4(w, w, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 xxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(x, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 xxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(x, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 xxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(x, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 xxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(x, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 xyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(x, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 xyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(x, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 xyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(x, y, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; y = value.y; z = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 xyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(x, y, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; y = value.y; w = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 xzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(x, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 xzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(x, z, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; z = value.y; y = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 xzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(x, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 xzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(x, z, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; z = value.y; w = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 xwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(x, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 xwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(x, w, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; w = value.y; y = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 xwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(x, w, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; w = value.y; z = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 xww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(x, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 yxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(y, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 yxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(y, x, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 yxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(y, x, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; x = value.y; z = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 yxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(y, x, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; x = value.y; w = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 yyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(y, y, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 yyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(y, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 yyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(y, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 yyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(y, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 yzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(y, z, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; z = value.y; x = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 yzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(y, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 yzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(y, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 yzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(y, z, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; z = value.y; w = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 ywx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(y, w, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; w = value.y; x = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 ywy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(y, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 ywz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(y, w, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; w = value.y; z = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 yww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(y, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 zxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(z, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 zxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(z, x, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; x = value.y; y = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 zxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(z, x, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 zxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(z, x, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; x = value.y; w = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 zyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(z, y, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; y = value.y; x = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 zyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(z, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 zyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(z, y, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 zyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(z, y, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; y = value.y; w = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 zzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(z, z, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 zzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(z, z, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 zzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(z, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 zzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(z, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 zwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(z, w, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; w = value.y; x = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 zwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(z, w, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; w = value.y; y = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 zwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(z, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 zww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(z, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 wxx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(w, x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 wxy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(w, x, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; x = value.y; y = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 wxz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(w, x, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; x = value.y; z = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 wxw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(w, x, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 wyx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(w, y, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; y = value.y; x = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 wyy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(w, y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 wyz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(w, y, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; y = value.y; z = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 wyw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(w, y, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 wzx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(w, z, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; z = value.y; x = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 wzy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(w, z, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; z = value.y; y = value.z; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 wzz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(w, z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 wzw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(w, z, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 wwx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(w, w, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 wwy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(w, w, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 wwz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(w, w, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint3 www { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint3(w, w, w); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint2 xx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint2(x, x); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint2 xy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint2(x, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; y = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint2 xz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint2(x, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; z = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint2 xw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint2(x, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { x = value.x; w = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint2 yx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint2(y, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; x = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint2 yy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint2(y, y); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint2 yz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint2(y, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; z = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint2 yw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint2(y, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { y = value.x; w = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint2 zx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint2(z, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; x = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint2 zy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint2(z, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; y = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint2 zz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint2(z, z); } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint2 zw { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint2(z, w); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { z = value.x; w = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint2 wx { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint2(w, x); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; x = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint2 wy { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint2(w, y); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; y = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint2 wz { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint2(w, z); } - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] set { w = value.x; z = value.y; } } + /// Swizzles the vector. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public uint2 ww { - [MethodImpl(0x100)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return new uint2(w, w); } } + + /// Returns the uint element at a specified index. + unsafe public uint this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 4) + throw new System.ArgumentException("index must be between[0...3]"); +#endif + fixed (uint4* array = &this) { return ((uint*)array)[index]; } + } + set + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 4) + throw new System.ArgumentException("index must be between[0...3]"); +#endif + fixed (uint* array = &x) { array[index] = value; } + } + } + + /// Returns true if the uint4 is equal to a given uint4, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(uint4 rhs) { return x == rhs.x && y == rhs.y && z == rhs.z && w == rhs.w; } + + /// Returns true if the uint4 is equal to a given uint4, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is uint4 converted && Equals(converted); } + + + /// Returns a hash code for the uint4. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the uint4. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("uint4({0}, {1}, {2}, {3})", x, y, z, w); + } + + /// Returns a string representation of the uint4 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("uint4({0}, {1}, {2}, {3})", x.ToString(format, formatProvider), y.ToString(format, formatProvider), z.ToString(format, formatProvider), w.ToString(format, formatProvider)); + } + + internal sealed class DebuggerProxy + { + public uint x; + public uint y; + public uint z; + public uint w; + public DebuggerProxy(uint4 v) + { + x = v.x; + y = v.y; + z = v.z; + w = v.w; + } + } + + } + + public static partial class math + { + /// Returns a uint4 vector constructed from four uint values. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + /// The constructed vector's z component will be set to this value. + /// The constructed vector's w component will be set to this value. + /// uint4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 uint4(uint x, uint y, uint z, uint w) { return new uint4(x, y, z, w); } + + /// Returns a uint4 vector constructed from two uint values and a uint2 vector. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's y component will be set to this value. + /// The constructed vector's zw components will be set to this value. + /// uint4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 uint4(uint x, uint y, uint2 zw) { return new uint4(x, y, zw); } + + /// Returns a uint4 vector constructed from a uint value, a uint2 vector and a uint value. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's yz components will be set to this value. + /// The constructed vector's w component will be set to this value. + /// uint4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 uint4(uint x, uint2 yz, uint w) { return new uint4(x, yz, w); } + + /// Returns a uint4 vector constructed from a uint value and a uint3 vector. + /// The constructed vector's x component will be set to this value. + /// The constructed vector's yzw components will be set to this value. + /// uint4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 uint4(uint x, uint3 yzw) { return new uint4(x, yzw); } + + /// Returns a uint4 vector constructed from a uint2 vector and two uint values. + /// The constructed vector's xy components will be set to this value. + /// The constructed vector's z component will be set to this value. + /// The constructed vector's w component will be set to this value. + /// uint4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 uint4(uint2 xy, uint z, uint w) { return new uint4(xy, z, w); } + + /// Returns a uint4 vector constructed from two uint2 vectors. + /// The constructed vector's xy components will be set to this value. + /// The constructed vector's zw components will be set to this value. + /// uint4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 uint4(uint2 xy, uint2 zw) { return new uint4(xy, zw); } + + /// Returns a uint4 vector constructed from a uint3 vector and a uint value. + /// The constructed vector's xyz components will be set to this value. + /// The constructed vector's w component will be set to this value. + /// uint4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 uint4(uint3 xyz, uint w) { return new uint4(xyz, w); } + + /// Returns a uint4 vector constructed from a uint4 vector. + /// The constructed vector's xyzw components will be set to this value. + /// uint4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 uint4(uint4 xyzw) { return new uint4(xyzw); } + + /// Returns a uint4 vector constructed from a single uint value by assigning it to every component. + /// uint to convert to uint4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 uint4(uint v) { return new uint4(v); } + + /// Returns a uint4 vector constructed from a single bool value by converting it to uint and assigning it to every component. + /// bool to convert to uint4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 uint4(bool v) { return new uint4(v); } + + /// Return a uint4 vector constructed from a bool4 vector by componentwise conversion. + /// bool4 to convert to uint4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 uint4(bool4 v) { return new uint4(v); } + + /// Returns a uint4 vector constructed from a single int value by converting it to uint and assigning it to every component. + /// int to convert to uint4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 uint4(int v) { return new uint4(v); } + + /// Return a uint4 vector constructed from a int4 vector by componentwise conversion. + /// int4 to convert to uint4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 uint4(int4 v) { return new uint4(v); } + + /// Returns a uint4 vector constructed from a single float value by converting it to uint and assigning it to every component. + /// float to convert to uint4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 uint4(float v) { return new uint4(v); } + + /// Return a uint4 vector constructed from a float4 vector by componentwise conversion. + /// float4 to convert to uint4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 uint4(float4 v) { return new uint4(v); } + + /// Returns a uint4 vector constructed from a single double value by converting it to uint and assigning it to every component. + /// double to convert to uint4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 uint4(double v) { return new uint4(v); } + + /// Return a uint4 vector constructed from a double4 vector by componentwise conversion. + /// double4 to convert to uint4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 uint4(double4 v) { return new uint4(v); } + + /// Returns a uint hash code of a uint4 vector. + /// Vector value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(uint4 v) + { + return csum(v * uint4(0xB492BF15u, 0xD37220E3u, 0x7AA2C2BDu, 0xE16BC89Du)) + 0x7AA07CD3u; + } + + /// + /// Returns a uint4 vector hash code of a uint4 vector. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Vector value to hash. + /// uint4 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 hashwide(uint4 v) + { + return (v * uint4(0xAF642BA9u, 0xA8F2213Bu, 0x9F3FDC37u, 0xAC60D0C3u)) + 0x9263662Fu; + } + + /// Returns the result of specified shuffling of the components from two uint4 vectors into a uint value. + /// uint4 to use as the left argument of the shuffle operation. + /// uint4 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting uint. + /// uint result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint shuffle(uint4 left, uint4 right, ShuffleComponent x) + { + return select_shuffle_component(left, right, x); + } + + /// Returns the result of specified shuffling of the components from two uint4 vectors into a uint2 vector. + /// uint4 to use as the left argument of the shuffle operation. + /// uint4 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting uint2 x component. + /// The ShuffleComponent to use when setting the resulting uint2 y component. + /// uint2 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2 shuffle(uint4 left, uint4 right, ShuffleComponent x, ShuffleComponent y) + { + return uint2( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y)); + } + + /// Returns the result of specified shuffling of the components from two uint4 vectors into a uint3 vector. + /// uint4 to use as the left argument of the shuffle operation. + /// uint4 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting uint3 x component. + /// The ShuffleComponent to use when setting the resulting uint3 y component. + /// The ShuffleComponent to use when setting the resulting uint3 z component. + /// uint3 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3 shuffle(uint4 left, uint4 right, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z) + { + return uint3( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y), + select_shuffle_component(left, right, z)); + } + + /// Returns the result of specified shuffling of the components from two uint4 vectors into a uint4 vector. + /// uint4 to use as the left argument of the shuffle operation. + /// uint4 to use as the right argument of the shuffle operation. + /// The ShuffleComponent to use when setting the resulting uint4 x component. + /// The ShuffleComponent to use when setting the resulting uint4 y component. + /// The ShuffleComponent to use when setting the resulting uint4 z component. + /// The ShuffleComponent to use when setting the resulting uint4 w component. + /// uint4 result of the shuffle operation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 shuffle(uint4 left, uint4 right, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z, ShuffleComponent w) + { + return uint4( + select_shuffle_component(left, right, x), + select_shuffle_component(left, right, y), + select_shuffle_component(left, right, z), + select_shuffle_component(left, right, w)); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static uint select_shuffle_component(uint4 a, uint4 b, ShuffleComponent component) + { + switch(component) + { + case ShuffleComponent.LeftX: + return a.x; + case ShuffleComponent.LeftY: + return a.y; + case ShuffleComponent.LeftZ: + return a.z; + case ShuffleComponent.LeftW: + return a.w; + case ShuffleComponent.RightX: + return b.x; + case ShuffleComponent.RightY: + return b.y; + case ShuffleComponent.RightZ: + return b.z; + case ShuffleComponent.RightW: + return b.w; + default: + throw new System.ArgumentException("Invalid shuffle component: " + component); + } + } + } } diff --git a/src/Unity.Mathematics/uint4x2.gen.cs b/src/Unity.Mathematics/uint4x2.gen.cs new file mode 100644 index 00000000..29cbd505 --- /dev/null +++ b/src/Unity.Mathematics/uint4x2.gen.cs @@ -0,0 +1,726 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 4x2 matrix of uints. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct uint4x2 : System.IEquatable, IFormattable + { + /// Column 0 of the matrix. + public uint4 c0; + /// Column 1 of the matrix. + public uint4 c1; + + /// uint4x2 zero value. + public static readonly uint4x2 zero; + + /// Constructs a uint4x2 matrix from two uint4 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4x2(uint4 c0, uint4 c1) + { + this.c0 = c0; + this.c1 = c1; + } + + /// Constructs a uint4x2 matrix from 8 uint values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 3, column 0 will be set to this value. + /// The matrix at row 3, column 1 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4x2(uint m00, uint m01, + uint m10, uint m11, + uint m20, uint m21, + uint m30, uint m31) + { + this.c0 = new uint4(m00, m10, m20, m30); + this.c1 = new uint4(m01, m11, m21, m31); + } + + /// Constructs a uint4x2 matrix from a single uint value by assigning it to every component. + /// uint to convert to uint4x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4x2(uint v) + { + this.c0 = v; + this.c1 = v; + } + + /// Constructs a uint4x2 matrix from a single bool value by converting it to uint and assigning it to every component. + /// bool to convert to uint4x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4x2(bool v) + { + this.c0 = math.select(new uint4(0u), new uint4(1u), v); + this.c1 = math.select(new uint4(0u), new uint4(1u), v); + } + + /// Constructs a uint4x2 matrix from a bool4x2 matrix by componentwise conversion. + /// bool4x2 to convert to uint4x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4x2(bool4x2 v) + { + this.c0 = math.select(new uint4(0u), new uint4(1u), v.c0); + this.c1 = math.select(new uint4(0u), new uint4(1u), v.c1); + } + + /// Constructs a uint4x2 matrix from a single int value by converting it to uint and assigning it to every component. + /// int to convert to uint4x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4x2(int v) + { + this.c0 = (uint4)v; + this.c1 = (uint4)v; + } + + /// Constructs a uint4x2 matrix from a int4x2 matrix by componentwise conversion. + /// int4x2 to convert to uint4x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4x2(int4x2 v) + { + this.c0 = (uint4)v.c0; + this.c1 = (uint4)v.c1; + } + + /// Constructs a uint4x2 matrix from a single float value by converting it to uint and assigning it to every component. + /// float to convert to uint4x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4x2(float v) + { + this.c0 = (uint4)v; + this.c1 = (uint4)v; + } + + /// Constructs a uint4x2 matrix from a float4x2 matrix by componentwise conversion. + /// float4x2 to convert to uint4x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4x2(float4x2 v) + { + this.c0 = (uint4)v.c0; + this.c1 = (uint4)v.c1; + } + + /// Constructs a uint4x2 matrix from a single double value by converting it to uint and assigning it to every component. + /// double to convert to uint4x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4x2(double v) + { + this.c0 = (uint4)v; + this.c1 = (uint4)v; + } + + /// Constructs a uint4x2 matrix from a double4x2 matrix by componentwise conversion. + /// double4x2 to convert to uint4x2 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4x2(double4x2 v) + { + this.c0 = (uint4)v.c0; + this.c1 = (uint4)v.c1; + } + + + /// Implicitly converts a single uint value to a uint4x2 matrix by assigning it to every component. + /// uint to convert to uint4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator uint4x2(uint v) { return new uint4x2(v); } + + /// Explicitly converts a single bool value to a uint4x2 matrix by converting it to uint and assigning it to every component. + /// bool to convert to uint4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint4x2(bool v) { return new uint4x2(v); } + + /// Explicitly converts a bool4x2 matrix to a uint4x2 matrix by componentwise conversion. + /// bool4x2 to convert to uint4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint4x2(bool4x2 v) { return new uint4x2(v); } + + /// Explicitly converts a single int value to a uint4x2 matrix by converting it to uint and assigning it to every component. + /// int to convert to uint4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint4x2(int v) { return new uint4x2(v); } + + /// Explicitly converts a int4x2 matrix to a uint4x2 matrix by componentwise conversion. + /// int4x2 to convert to uint4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint4x2(int4x2 v) { return new uint4x2(v); } + + /// Explicitly converts a single float value to a uint4x2 matrix by converting it to uint and assigning it to every component. + /// float to convert to uint4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint4x2(float v) { return new uint4x2(v); } + + /// Explicitly converts a float4x2 matrix to a uint4x2 matrix by componentwise conversion. + /// float4x2 to convert to uint4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint4x2(float4x2 v) { return new uint4x2(v); } + + /// Explicitly converts a single double value to a uint4x2 matrix by converting it to uint and assigning it to every component. + /// double to convert to uint4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint4x2(double v) { return new uint4x2(v); } + + /// Explicitly converts a double4x2 matrix to a uint4x2 matrix by componentwise conversion. + /// double4x2 to convert to uint4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint4x2(double4x2 v) { return new uint4x2(v); } + + + /// Returns the result of a componentwise multiplication operation on two uint4x2 matrices. + /// Left hand side uint4x2 to use to compute componentwise multiplication. + /// Right hand side uint4x2 to use to compute componentwise multiplication. + /// uint4x2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 operator * (uint4x2 lhs, uint4x2 rhs) { return new uint4x2 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1); } + + /// Returns the result of a componentwise multiplication operation on a uint4x2 matrix and a uint value. + /// Left hand side uint4x2 to use to compute componentwise multiplication. + /// Right hand side uint to use to compute componentwise multiplication. + /// uint4x2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 operator * (uint4x2 lhs, uint rhs) { return new uint4x2 (lhs.c0 * rhs, lhs.c1 * rhs); } + + /// Returns the result of a componentwise multiplication operation on a uint value and a uint4x2 matrix. + /// Left hand side uint to use to compute componentwise multiplication. + /// Right hand side uint4x2 to use to compute componentwise multiplication. + /// uint4x2 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 operator * (uint lhs, uint4x2 rhs) { return new uint4x2 (lhs * rhs.c0, lhs * rhs.c1); } + + + /// Returns the result of a componentwise addition operation on two uint4x2 matrices. + /// Left hand side uint4x2 to use to compute componentwise addition. + /// Right hand side uint4x2 to use to compute componentwise addition. + /// uint4x2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 operator + (uint4x2 lhs, uint4x2 rhs) { return new uint4x2 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1); } + + /// Returns the result of a componentwise addition operation on a uint4x2 matrix and a uint value. + /// Left hand side uint4x2 to use to compute componentwise addition. + /// Right hand side uint to use to compute componentwise addition. + /// uint4x2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 operator + (uint4x2 lhs, uint rhs) { return new uint4x2 (lhs.c0 + rhs, lhs.c1 + rhs); } + + /// Returns the result of a componentwise addition operation on a uint value and a uint4x2 matrix. + /// Left hand side uint to use to compute componentwise addition. + /// Right hand side uint4x2 to use to compute componentwise addition. + /// uint4x2 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 operator + (uint lhs, uint4x2 rhs) { return new uint4x2 (lhs + rhs.c0, lhs + rhs.c1); } + + + /// Returns the result of a componentwise subtraction operation on two uint4x2 matrices. + /// Left hand side uint4x2 to use to compute componentwise subtraction. + /// Right hand side uint4x2 to use to compute componentwise subtraction. + /// uint4x2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 operator - (uint4x2 lhs, uint4x2 rhs) { return new uint4x2 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1); } + + /// Returns the result of a componentwise subtraction operation on a uint4x2 matrix and a uint value. + /// Left hand side uint4x2 to use to compute componentwise subtraction. + /// Right hand side uint to use to compute componentwise subtraction. + /// uint4x2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 operator - (uint4x2 lhs, uint rhs) { return new uint4x2 (lhs.c0 - rhs, lhs.c1 - rhs); } + + /// Returns the result of a componentwise subtraction operation on a uint value and a uint4x2 matrix. + /// Left hand side uint to use to compute componentwise subtraction. + /// Right hand side uint4x2 to use to compute componentwise subtraction. + /// uint4x2 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 operator - (uint lhs, uint4x2 rhs) { return new uint4x2 (lhs - rhs.c0, lhs - rhs.c1); } + + + /// Returns the result of a componentwise division operation on two uint4x2 matrices. + /// Left hand side uint4x2 to use to compute componentwise division. + /// Right hand side uint4x2 to use to compute componentwise division. + /// uint4x2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 operator / (uint4x2 lhs, uint4x2 rhs) { return new uint4x2 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1); } + + /// Returns the result of a componentwise division operation on a uint4x2 matrix and a uint value. + /// Left hand side uint4x2 to use to compute componentwise division. + /// Right hand side uint to use to compute componentwise division. + /// uint4x2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 operator / (uint4x2 lhs, uint rhs) { return new uint4x2 (lhs.c0 / rhs, lhs.c1 / rhs); } + + /// Returns the result of a componentwise division operation on a uint value and a uint4x2 matrix. + /// Left hand side uint to use to compute componentwise division. + /// Right hand side uint4x2 to use to compute componentwise division. + /// uint4x2 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 operator / (uint lhs, uint4x2 rhs) { return new uint4x2 (lhs / rhs.c0, lhs / rhs.c1); } + + + /// Returns the result of a componentwise modulus operation on two uint4x2 matrices. + /// Left hand side uint4x2 to use to compute componentwise modulus. + /// Right hand side uint4x2 to use to compute componentwise modulus. + /// uint4x2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 operator % (uint4x2 lhs, uint4x2 rhs) { return new uint4x2 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1); } + + /// Returns the result of a componentwise modulus operation on a uint4x2 matrix and a uint value. + /// Left hand side uint4x2 to use to compute componentwise modulus. + /// Right hand side uint to use to compute componentwise modulus. + /// uint4x2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 operator % (uint4x2 lhs, uint rhs) { return new uint4x2 (lhs.c0 % rhs, lhs.c1 % rhs); } + + /// Returns the result of a componentwise modulus operation on a uint value and a uint4x2 matrix. + /// Left hand side uint to use to compute componentwise modulus. + /// Right hand side uint4x2 to use to compute componentwise modulus. + /// uint4x2 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 operator % (uint lhs, uint4x2 rhs) { return new uint4x2 (lhs % rhs.c0, lhs % rhs.c1); } + + + /// Returns the result of a componentwise increment operation on a uint4x2 matrix. + /// Value to use when computing the componentwise increment. + /// uint4x2 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 operator ++ (uint4x2 val) { return new uint4x2 (++val.c0, ++val.c1); } + + + /// Returns the result of a componentwise decrement operation on a uint4x2 matrix. + /// Value to use when computing the componentwise decrement. + /// uint4x2 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 operator -- (uint4x2 val) { return new uint4x2 (--val.c0, --val.c1); } + + + /// Returns the result of a componentwise less than operation on two uint4x2 matrices. + /// Left hand side uint4x2 to use to compute componentwise less than. + /// Right hand side uint4x2 to use to compute componentwise less than. + /// bool4x2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator < (uint4x2 lhs, uint4x2 rhs) { return new bool4x2 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1); } + + /// Returns the result of a componentwise less than operation on a uint4x2 matrix and a uint value. + /// Left hand side uint4x2 to use to compute componentwise less than. + /// Right hand side uint to use to compute componentwise less than. + /// bool4x2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator < (uint4x2 lhs, uint rhs) { return new bool4x2 (lhs.c0 < rhs, lhs.c1 < rhs); } + + /// Returns the result of a componentwise less than operation on a uint value and a uint4x2 matrix. + /// Left hand side uint to use to compute componentwise less than. + /// Right hand side uint4x2 to use to compute componentwise less than. + /// bool4x2 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator < (uint lhs, uint4x2 rhs) { return new bool4x2 (lhs < rhs.c0, lhs < rhs.c1); } + + + /// Returns the result of a componentwise less or equal operation on two uint4x2 matrices. + /// Left hand side uint4x2 to use to compute componentwise less or equal. + /// Right hand side uint4x2 to use to compute componentwise less or equal. + /// bool4x2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator <= (uint4x2 lhs, uint4x2 rhs) { return new bool4x2 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1); } + + /// Returns the result of a componentwise less or equal operation on a uint4x2 matrix and a uint value. + /// Left hand side uint4x2 to use to compute componentwise less or equal. + /// Right hand side uint to use to compute componentwise less or equal. + /// bool4x2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator <= (uint4x2 lhs, uint rhs) { return new bool4x2 (lhs.c0 <= rhs, lhs.c1 <= rhs); } + + /// Returns the result of a componentwise less or equal operation on a uint value and a uint4x2 matrix. + /// Left hand side uint to use to compute componentwise less or equal. + /// Right hand side uint4x2 to use to compute componentwise less or equal. + /// bool4x2 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator <= (uint lhs, uint4x2 rhs) { return new bool4x2 (lhs <= rhs.c0, lhs <= rhs.c1); } + + + /// Returns the result of a componentwise greater than operation on two uint4x2 matrices. + /// Left hand side uint4x2 to use to compute componentwise greater than. + /// Right hand side uint4x2 to use to compute componentwise greater than. + /// bool4x2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator > (uint4x2 lhs, uint4x2 rhs) { return new bool4x2 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1); } + + /// Returns the result of a componentwise greater than operation on a uint4x2 matrix and a uint value. + /// Left hand side uint4x2 to use to compute componentwise greater than. + /// Right hand side uint to use to compute componentwise greater than. + /// bool4x2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator > (uint4x2 lhs, uint rhs) { return new bool4x2 (lhs.c0 > rhs, lhs.c1 > rhs); } + + /// Returns the result of a componentwise greater than operation on a uint value and a uint4x2 matrix. + /// Left hand side uint to use to compute componentwise greater than. + /// Right hand side uint4x2 to use to compute componentwise greater than. + /// bool4x2 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator > (uint lhs, uint4x2 rhs) { return new bool4x2 (lhs > rhs.c0, lhs > rhs.c1); } + + + /// Returns the result of a componentwise greater or equal operation on two uint4x2 matrices. + /// Left hand side uint4x2 to use to compute componentwise greater or equal. + /// Right hand side uint4x2 to use to compute componentwise greater or equal. + /// bool4x2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator >= (uint4x2 lhs, uint4x2 rhs) { return new bool4x2 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1); } + + /// Returns the result of a componentwise greater or equal operation on a uint4x2 matrix and a uint value. + /// Left hand side uint4x2 to use to compute componentwise greater or equal. + /// Right hand side uint to use to compute componentwise greater or equal. + /// bool4x2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator >= (uint4x2 lhs, uint rhs) { return new bool4x2 (lhs.c0 >= rhs, lhs.c1 >= rhs); } + + /// Returns the result of a componentwise greater or equal operation on a uint value and a uint4x2 matrix. + /// Left hand side uint to use to compute componentwise greater or equal. + /// Right hand side uint4x2 to use to compute componentwise greater or equal. + /// bool4x2 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator >= (uint lhs, uint4x2 rhs) { return new bool4x2 (lhs >= rhs.c0, lhs >= rhs.c1); } + + + /// Returns the result of a componentwise unary minus operation on a uint4x2 matrix. + /// Value to use when computing the componentwise unary minus. + /// uint4x2 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 operator - (uint4x2 val) { return new uint4x2 (-val.c0, -val.c1); } + + + /// Returns the result of a componentwise unary plus operation on a uint4x2 matrix. + /// Value to use when computing the componentwise unary plus. + /// uint4x2 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 operator + (uint4x2 val) { return new uint4x2 (+val.c0, +val.c1); } + + + /// Returns the result of a componentwise left shift operation on a uint4x2 matrix by a number of bits specified by a single int. + /// The matrix to left shift. + /// The number of bits to left shift. + /// The result of the componentwise left shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 operator << (uint4x2 x, int n) { return new uint4x2 (x.c0 << n, x.c1 << n); } + + /// Returns the result of a componentwise right shift operation on a uint4x2 matrix by a number of bits specified by a single int. + /// The matrix to right shift. + /// The number of bits to right shift. + /// The result of the componentwise right shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 operator >> (uint4x2 x, int n) { return new uint4x2 (x.c0 >> n, x.c1 >> n); } + + /// Returns the result of a componentwise equality operation on two uint4x2 matrices. + /// Left hand side uint4x2 to use to compute componentwise equality. + /// Right hand side uint4x2 to use to compute componentwise equality. + /// bool4x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator == (uint4x2 lhs, uint4x2 rhs) { return new bool4x2 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1); } + + /// Returns the result of a componentwise equality operation on a uint4x2 matrix and a uint value. + /// Left hand side uint4x2 to use to compute componentwise equality. + /// Right hand side uint to use to compute componentwise equality. + /// bool4x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator == (uint4x2 lhs, uint rhs) { return new bool4x2 (lhs.c0 == rhs, lhs.c1 == rhs); } + + /// Returns the result of a componentwise equality operation on a uint value and a uint4x2 matrix. + /// Left hand side uint to use to compute componentwise equality. + /// Right hand side uint4x2 to use to compute componentwise equality. + /// bool4x2 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator == (uint lhs, uint4x2 rhs) { return new bool4x2 (lhs == rhs.c0, lhs == rhs.c1); } + + + /// Returns the result of a componentwise not equal operation on two uint4x2 matrices. + /// Left hand side uint4x2 to use to compute componentwise not equal. + /// Right hand side uint4x2 to use to compute componentwise not equal. + /// bool4x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator != (uint4x2 lhs, uint4x2 rhs) { return new bool4x2 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1); } + + /// Returns the result of a componentwise not equal operation on a uint4x2 matrix and a uint value. + /// Left hand side uint4x2 to use to compute componentwise not equal. + /// Right hand side uint to use to compute componentwise not equal. + /// bool4x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator != (uint4x2 lhs, uint rhs) { return new bool4x2 (lhs.c0 != rhs, lhs.c1 != rhs); } + + /// Returns the result of a componentwise not equal operation on a uint value and a uint4x2 matrix. + /// Left hand side uint to use to compute componentwise not equal. + /// Right hand side uint4x2 to use to compute componentwise not equal. + /// bool4x2 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x2 operator != (uint lhs, uint4x2 rhs) { return new bool4x2 (lhs != rhs.c0, lhs != rhs.c1); } + + + /// Returns the result of a componentwise bitwise not operation on a uint4x2 matrix. + /// Value to use when computing the componentwise bitwise not. + /// uint4x2 result of the componentwise bitwise not. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 operator ~ (uint4x2 val) { return new uint4x2 (~val.c0, ~val.c1); } + + + /// Returns the result of a componentwise bitwise and operation on two uint4x2 matrices. + /// Left hand side uint4x2 to use to compute componentwise bitwise and. + /// Right hand side uint4x2 to use to compute componentwise bitwise and. + /// uint4x2 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 operator & (uint4x2 lhs, uint4x2 rhs) { return new uint4x2 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1); } + + /// Returns the result of a componentwise bitwise and operation on a uint4x2 matrix and a uint value. + /// Left hand side uint4x2 to use to compute componentwise bitwise and. + /// Right hand side uint to use to compute componentwise bitwise and. + /// uint4x2 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 operator & (uint4x2 lhs, uint rhs) { return new uint4x2 (lhs.c0 & rhs, lhs.c1 & rhs); } + + /// Returns the result of a componentwise bitwise and operation on a uint value and a uint4x2 matrix. + /// Left hand side uint to use to compute componentwise bitwise and. + /// Right hand side uint4x2 to use to compute componentwise bitwise and. + /// uint4x2 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 operator & (uint lhs, uint4x2 rhs) { return new uint4x2 (lhs & rhs.c0, lhs & rhs.c1); } + + + /// Returns the result of a componentwise bitwise or operation on two uint4x2 matrices. + /// Left hand side uint4x2 to use to compute componentwise bitwise or. + /// Right hand side uint4x2 to use to compute componentwise bitwise or. + /// uint4x2 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 operator | (uint4x2 lhs, uint4x2 rhs) { return new uint4x2 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1); } + + /// Returns the result of a componentwise bitwise or operation on a uint4x2 matrix and a uint value. + /// Left hand side uint4x2 to use to compute componentwise bitwise or. + /// Right hand side uint to use to compute componentwise bitwise or. + /// uint4x2 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 operator | (uint4x2 lhs, uint rhs) { return new uint4x2 (lhs.c0 | rhs, lhs.c1 | rhs); } + + /// Returns the result of a componentwise bitwise or operation on a uint value and a uint4x2 matrix. + /// Left hand side uint to use to compute componentwise bitwise or. + /// Right hand side uint4x2 to use to compute componentwise bitwise or. + /// uint4x2 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 operator | (uint lhs, uint4x2 rhs) { return new uint4x2 (lhs | rhs.c0, lhs | rhs.c1); } + + + /// Returns the result of a componentwise bitwise exclusive or operation on two uint4x2 matrices. + /// Left hand side uint4x2 to use to compute componentwise bitwise exclusive or. + /// Right hand side uint4x2 to use to compute componentwise bitwise exclusive or. + /// uint4x2 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 operator ^ (uint4x2 lhs, uint4x2 rhs) { return new uint4x2 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1); } + + /// Returns the result of a componentwise bitwise exclusive or operation on a uint4x2 matrix and a uint value. + /// Left hand side uint4x2 to use to compute componentwise bitwise exclusive or. + /// Right hand side uint to use to compute componentwise bitwise exclusive or. + /// uint4x2 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 operator ^ (uint4x2 lhs, uint rhs) { return new uint4x2 (lhs.c0 ^ rhs, lhs.c1 ^ rhs); } + + /// Returns the result of a componentwise bitwise exclusive or operation on a uint value and a uint4x2 matrix. + /// Left hand side uint to use to compute componentwise bitwise exclusive or. + /// Right hand side uint4x2 to use to compute componentwise bitwise exclusive or. + /// uint4x2 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 operator ^ (uint lhs, uint4x2 rhs) { return new uint4x2 (lhs ^ rhs.c0, lhs ^ rhs.c1); } + + + + /// Returns the uint4 element at a specified index. + unsafe public ref uint4 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 2) + throw new System.ArgumentException("index must be between[0...1]"); +#endif + fixed (uint4x2* array = &this) { return ref ((uint4*)array)[index]; } + } + } + + /// Returns true if the uint4x2 is equal to a given uint4x2, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(uint4x2 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1); } + + /// Returns true if the uint4x2 is equal to a given uint4x2, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is uint4x2 converted && Equals(converted); } + + + /// Returns a hash code for the uint4x2. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the uint4x2. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("uint4x2({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7})", c0.x, c1.x, c0.y, c1.y, c0.z, c1.z, c0.w, c1.w); + } + + /// Returns a string representation of the uint4x2 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("uint4x2({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7})", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c0.z.ToString(format, formatProvider), c1.z.ToString(format, formatProvider), c0.w.ToString(format, formatProvider), c1.w.ToString(format, formatProvider)); + } + + } + + public static partial class math + { + /// Returns a uint4x2 matrix constructed from two uint4 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// uint4x2 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 uint4x2(uint4 c0, uint4 c1) { return new uint4x2(c0, c1); } + + /// Returns a uint4x2 matrix constructed from from 8 uint values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 3, column 0 will be set to this value. + /// The matrix at row 3, column 1 will be set to this value. + /// uint4x2 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 uint4x2(uint m00, uint m01, + uint m10, uint m11, + uint m20, uint m21, + uint m30, uint m31) + { + return new uint4x2(m00, m01, + m10, m11, + m20, m21, + m30, m31); + } + + /// Returns a uint4x2 matrix constructed from a single uint value by assigning it to every component. + /// uint to convert to uint4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 uint4x2(uint v) { return new uint4x2(v); } + + /// Returns a uint4x2 matrix constructed from a single bool value by converting it to uint and assigning it to every component. + /// bool to convert to uint4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 uint4x2(bool v) { return new uint4x2(v); } + + /// Return a uint4x2 matrix constructed from a bool4x2 matrix by componentwise conversion. + /// bool4x2 to convert to uint4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 uint4x2(bool4x2 v) { return new uint4x2(v); } + + /// Returns a uint4x2 matrix constructed from a single int value by converting it to uint and assigning it to every component. + /// int to convert to uint4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 uint4x2(int v) { return new uint4x2(v); } + + /// Return a uint4x2 matrix constructed from a int4x2 matrix by componentwise conversion. + /// int4x2 to convert to uint4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 uint4x2(int4x2 v) { return new uint4x2(v); } + + /// Returns a uint4x2 matrix constructed from a single float value by converting it to uint and assigning it to every component. + /// float to convert to uint4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 uint4x2(float v) { return new uint4x2(v); } + + /// Return a uint4x2 matrix constructed from a float4x2 matrix by componentwise conversion. + /// float4x2 to convert to uint4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 uint4x2(float4x2 v) { return new uint4x2(v); } + + /// Returns a uint4x2 matrix constructed from a single double value by converting it to uint and assigning it to every component. + /// double to convert to uint4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 uint4x2(double v) { return new uint4x2(v); } + + /// Return a uint4x2 matrix constructed from a double4x2 matrix by componentwise conversion. + /// double4x2 to convert to uint4x2 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x2 uint4x2(double4x2 v) { return new uint4x2(v); } + + /// Return the uint2x4 transpose of a uint4x2 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint2x4 transpose(uint4x2 v) + { + return uint2x4( + v.c0.x, v.c0.y, v.c0.z, v.c0.w, + v.c1.x, v.c1.y, v.c1.z, v.c1.w); + } + + /// Returns a uint hash code of a uint4x2 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(uint4x2 v) + { + return csum(v.c0 * uint4(0xFA3A3285u, 0xAD55999Du, 0xDCDD5341u, 0x94DDD769u) + + v.c1 * uint4(0xA1E92D39u, 0x4583C801u, 0x9536A0F5u, 0xAF816615u)) + 0x9AF8D62Du; + } + + /// + /// Returns a uint4 vector hash code of a uint4x2 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint4 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 hashwide(uint4x2 v) + { + return (v.c0 * uint4(0xE3600729u, 0x5F17300Du, 0x670D6809u, 0x7AF32C49u) + + v.c1 * uint4(0xAE131389u, 0x5D1B165Bu, 0x87096CD7u, 0x4C7F6DD1u)) + 0x4822A3E9u; + } + + } +} diff --git a/src/Unity.Mathematics/uint4x2.gen.cs.meta b/src/Unity.Mathematics/uint4x2.gen.cs.meta new file mode 100644 index 00000000..ede20772 --- /dev/null +++ b/src/Unity.Mathematics/uint4x2.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 793eda612f42a4089bcfd0be1ece0a6d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/uint4x3.gen.cs b/src/Unity.Mathematics/uint4x3.gen.cs new file mode 100644 index 00000000..0eede77d --- /dev/null +++ b/src/Unity.Mathematics/uint4x3.gen.cs @@ -0,0 +1,752 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 4x3 matrix of uints. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct uint4x3 : System.IEquatable, IFormattable + { + /// Column 0 of the matrix. + public uint4 c0; + /// Column 1 of the matrix. + public uint4 c1; + /// Column 2 of the matrix. + public uint4 c2; + + /// uint4x3 zero value. + public static readonly uint4x3 zero; + + /// Constructs a uint4x3 matrix from three uint4 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4x3(uint4 c0, uint4 c1, uint4 c2) + { + this.c0 = c0; + this.c1 = c1; + this.c2 = c2; + } + + /// Constructs a uint4x3 matrix from 12 uint values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 2, column 2 will be set to this value. + /// The matrix at row 3, column 0 will be set to this value. + /// The matrix at row 3, column 1 will be set to this value. + /// The matrix at row 3, column 2 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4x3(uint m00, uint m01, uint m02, + uint m10, uint m11, uint m12, + uint m20, uint m21, uint m22, + uint m30, uint m31, uint m32) + { + this.c0 = new uint4(m00, m10, m20, m30); + this.c1 = new uint4(m01, m11, m21, m31); + this.c2 = new uint4(m02, m12, m22, m32); + } + + /// Constructs a uint4x3 matrix from a single uint value by assigning it to every component. + /// uint to convert to uint4x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4x3(uint v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + } + + /// Constructs a uint4x3 matrix from a single bool value by converting it to uint and assigning it to every component. + /// bool to convert to uint4x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4x3(bool v) + { + this.c0 = math.select(new uint4(0u), new uint4(1u), v); + this.c1 = math.select(new uint4(0u), new uint4(1u), v); + this.c2 = math.select(new uint4(0u), new uint4(1u), v); + } + + /// Constructs a uint4x3 matrix from a bool4x3 matrix by componentwise conversion. + /// bool4x3 to convert to uint4x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4x3(bool4x3 v) + { + this.c0 = math.select(new uint4(0u), new uint4(1u), v.c0); + this.c1 = math.select(new uint4(0u), new uint4(1u), v.c1); + this.c2 = math.select(new uint4(0u), new uint4(1u), v.c2); + } + + /// Constructs a uint4x3 matrix from a single int value by converting it to uint and assigning it to every component. + /// int to convert to uint4x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4x3(int v) + { + this.c0 = (uint4)v; + this.c1 = (uint4)v; + this.c2 = (uint4)v; + } + + /// Constructs a uint4x3 matrix from a int4x3 matrix by componentwise conversion. + /// int4x3 to convert to uint4x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4x3(int4x3 v) + { + this.c0 = (uint4)v.c0; + this.c1 = (uint4)v.c1; + this.c2 = (uint4)v.c2; + } + + /// Constructs a uint4x3 matrix from a single float value by converting it to uint and assigning it to every component. + /// float to convert to uint4x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4x3(float v) + { + this.c0 = (uint4)v; + this.c1 = (uint4)v; + this.c2 = (uint4)v; + } + + /// Constructs a uint4x3 matrix from a float4x3 matrix by componentwise conversion. + /// float4x3 to convert to uint4x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4x3(float4x3 v) + { + this.c0 = (uint4)v.c0; + this.c1 = (uint4)v.c1; + this.c2 = (uint4)v.c2; + } + + /// Constructs a uint4x3 matrix from a single double value by converting it to uint and assigning it to every component. + /// double to convert to uint4x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4x3(double v) + { + this.c0 = (uint4)v; + this.c1 = (uint4)v; + this.c2 = (uint4)v; + } + + /// Constructs a uint4x3 matrix from a double4x3 matrix by componentwise conversion. + /// double4x3 to convert to uint4x3 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4x3(double4x3 v) + { + this.c0 = (uint4)v.c0; + this.c1 = (uint4)v.c1; + this.c2 = (uint4)v.c2; + } + + + /// Implicitly converts a single uint value to a uint4x3 matrix by assigning it to every component. + /// uint to convert to uint4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator uint4x3(uint v) { return new uint4x3(v); } + + /// Explicitly converts a single bool value to a uint4x3 matrix by converting it to uint and assigning it to every component. + /// bool to convert to uint4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint4x3(bool v) { return new uint4x3(v); } + + /// Explicitly converts a bool4x3 matrix to a uint4x3 matrix by componentwise conversion. + /// bool4x3 to convert to uint4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint4x3(bool4x3 v) { return new uint4x3(v); } + + /// Explicitly converts a single int value to a uint4x3 matrix by converting it to uint and assigning it to every component. + /// int to convert to uint4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint4x3(int v) { return new uint4x3(v); } + + /// Explicitly converts a int4x3 matrix to a uint4x3 matrix by componentwise conversion. + /// int4x3 to convert to uint4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint4x3(int4x3 v) { return new uint4x3(v); } + + /// Explicitly converts a single float value to a uint4x3 matrix by converting it to uint and assigning it to every component. + /// float to convert to uint4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint4x3(float v) { return new uint4x3(v); } + + /// Explicitly converts a float4x3 matrix to a uint4x3 matrix by componentwise conversion. + /// float4x3 to convert to uint4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint4x3(float4x3 v) { return new uint4x3(v); } + + /// Explicitly converts a single double value to a uint4x3 matrix by converting it to uint and assigning it to every component. + /// double to convert to uint4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint4x3(double v) { return new uint4x3(v); } + + /// Explicitly converts a double4x3 matrix to a uint4x3 matrix by componentwise conversion. + /// double4x3 to convert to uint4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint4x3(double4x3 v) { return new uint4x3(v); } + + + /// Returns the result of a componentwise multiplication operation on two uint4x3 matrices. + /// Left hand side uint4x3 to use to compute componentwise multiplication. + /// Right hand side uint4x3 to use to compute componentwise multiplication. + /// uint4x3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 operator * (uint4x3 lhs, uint4x3 rhs) { return new uint4x3 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1, lhs.c2 * rhs.c2); } + + /// Returns the result of a componentwise multiplication operation on a uint4x3 matrix and a uint value. + /// Left hand side uint4x3 to use to compute componentwise multiplication. + /// Right hand side uint to use to compute componentwise multiplication. + /// uint4x3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 operator * (uint4x3 lhs, uint rhs) { return new uint4x3 (lhs.c0 * rhs, lhs.c1 * rhs, lhs.c2 * rhs); } + + /// Returns the result of a componentwise multiplication operation on a uint value and a uint4x3 matrix. + /// Left hand side uint to use to compute componentwise multiplication. + /// Right hand side uint4x3 to use to compute componentwise multiplication. + /// uint4x3 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 operator * (uint lhs, uint4x3 rhs) { return new uint4x3 (lhs * rhs.c0, lhs * rhs.c1, lhs * rhs.c2); } + + + /// Returns the result of a componentwise addition operation on two uint4x3 matrices. + /// Left hand side uint4x3 to use to compute componentwise addition. + /// Right hand side uint4x3 to use to compute componentwise addition. + /// uint4x3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 operator + (uint4x3 lhs, uint4x3 rhs) { return new uint4x3 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1, lhs.c2 + rhs.c2); } + + /// Returns the result of a componentwise addition operation on a uint4x3 matrix and a uint value. + /// Left hand side uint4x3 to use to compute componentwise addition. + /// Right hand side uint to use to compute componentwise addition. + /// uint4x3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 operator + (uint4x3 lhs, uint rhs) { return new uint4x3 (lhs.c0 + rhs, lhs.c1 + rhs, lhs.c2 + rhs); } + + /// Returns the result of a componentwise addition operation on a uint value and a uint4x3 matrix. + /// Left hand side uint to use to compute componentwise addition. + /// Right hand side uint4x3 to use to compute componentwise addition. + /// uint4x3 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 operator + (uint lhs, uint4x3 rhs) { return new uint4x3 (lhs + rhs.c0, lhs + rhs.c1, lhs + rhs.c2); } + + + /// Returns the result of a componentwise subtraction operation on two uint4x3 matrices. + /// Left hand side uint4x3 to use to compute componentwise subtraction. + /// Right hand side uint4x3 to use to compute componentwise subtraction. + /// uint4x3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 operator - (uint4x3 lhs, uint4x3 rhs) { return new uint4x3 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1, lhs.c2 - rhs.c2); } + + /// Returns the result of a componentwise subtraction operation on a uint4x3 matrix and a uint value. + /// Left hand side uint4x3 to use to compute componentwise subtraction. + /// Right hand side uint to use to compute componentwise subtraction. + /// uint4x3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 operator - (uint4x3 lhs, uint rhs) { return new uint4x3 (lhs.c0 - rhs, lhs.c1 - rhs, lhs.c2 - rhs); } + + /// Returns the result of a componentwise subtraction operation on a uint value and a uint4x3 matrix. + /// Left hand side uint to use to compute componentwise subtraction. + /// Right hand side uint4x3 to use to compute componentwise subtraction. + /// uint4x3 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 operator - (uint lhs, uint4x3 rhs) { return new uint4x3 (lhs - rhs.c0, lhs - rhs.c1, lhs - rhs.c2); } + + + /// Returns the result of a componentwise division operation on two uint4x3 matrices. + /// Left hand side uint4x3 to use to compute componentwise division. + /// Right hand side uint4x3 to use to compute componentwise division. + /// uint4x3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 operator / (uint4x3 lhs, uint4x3 rhs) { return new uint4x3 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1, lhs.c2 / rhs.c2); } + + /// Returns the result of a componentwise division operation on a uint4x3 matrix and a uint value. + /// Left hand side uint4x3 to use to compute componentwise division. + /// Right hand side uint to use to compute componentwise division. + /// uint4x3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 operator / (uint4x3 lhs, uint rhs) { return new uint4x3 (lhs.c0 / rhs, lhs.c1 / rhs, lhs.c2 / rhs); } + + /// Returns the result of a componentwise division operation on a uint value and a uint4x3 matrix. + /// Left hand side uint to use to compute componentwise division. + /// Right hand side uint4x3 to use to compute componentwise division. + /// uint4x3 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 operator / (uint lhs, uint4x3 rhs) { return new uint4x3 (lhs / rhs.c0, lhs / rhs.c1, lhs / rhs.c2); } + + + /// Returns the result of a componentwise modulus operation on two uint4x3 matrices. + /// Left hand side uint4x3 to use to compute componentwise modulus. + /// Right hand side uint4x3 to use to compute componentwise modulus. + /// uint4x3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 operator % (uint4x3 lhs, uint4x3 rhs) { return new uint4x3 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1, lhs.c2 % rhs.c2); } + + /// Returns the result of a componentwise modulus operation on a uint4x3 matrix and a uint value. + /// Left hand side uint4x3 to use to compute componentwise modulus. + /// Right hand side uint to use to compute componentwise modulus. + /// uint4x3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 operator % (uint4x3 lhs, uint rhs) { return new uint4x3 (lhs.c0 % rhs, lhs.c1 % rhs, lhs.c2 % rhs); } + + /// Returns the result of a componentwise modulus operation on a uint value and a uint4x3 matrix. + /// Left hand side uint to use to compute componentwise modulus. + /// Right hand side uint4x3 to use to compute componentwise modulus. + /// uint4x3 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 operator % (uint lhs, uint4x3 rhs) { return new uint4x3 (lhs % rhs.c0, lhs % rhs.c1, lhs % rhs.c2); } + + + /// Returns the result of a componentwise increment operation on a uint4x3 matrix. + /// Value to use when computing the componentwise increment. + /// uint4x3 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 operator ++ (uint4x3 val) { return new uint4x3 (++val.c0, ++val.c1, ++val.c2); } + + + /// Returns the result of a componentwise decrement operation on a uint4x3 matrix. + /// Value to use when computing the componentwise decrement. + /// uint4x3 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 operator -- (uint4x3 val) { return new uint4x3 (--val.c0, --val.c1, --val.c2); } + + + /// Returns the result of a componentwise less than operation on two uint4x3 matrices. + /// Left hand side uint4x3 to use to compute componentwise less than. + /// Right hand side uint4x3 to use to compute componentwise less than. + /// bool4x3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator < (uint4x3 lhs, uint4x3 rhs) { return new bool4x3 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1, lhs.c2 < rhs.c2); } + + /// Returns the result of a componentwise less than operation on a uint4x3 matrix and a uint value. + /// Left hand side uint4x3 to use to compute componentwise less than. + /// Right hand side uint to use to compute componentwise less than. + /// bool4x3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator < (uint4x3 lhs, uint rhs) { return new bool4x3 (lhs.c0 < rhs, lhs.c1 < rhs, lhs.c2 < rhs); } + + /// Returns the result of a componentwise less than operation on a uint value and a uint4x3 matrix. + /// Left hand side uint to use to compute componentwise less than. + /// Right hand side uint4x3 to use to compute componentwise less than. + /// bool4x3 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator < (uint lhs, uint4x3 rhs) { return new bool4x3 (lhs < rhs.c0, lhs < rhs.c1, lhs < rhs.c2); } + + + /// Returns the result of a componentwise less or equal operation on two uint4x3 matrices. + /// Left hand side uint4x3 to use to compute componentwise less or equal. + /// Right hand side uint4x3 to use to compute componentwise less or equal. + /// bool4x3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator <= (uint4x3 lhs, uint4x3 rhs) { return new bool4x3 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1, lhs.c2 <= rhs.c2); } + + /// Returns the result of a componentwise less or equal operation on a uint4x3 matrix and a uint value. + /// Left hand side uint4x3 to use to compute componentwise less or equal. + /// Right hand side uint to use to compute componentwise less or equal. + /// bool4x3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator <= (uint4x3 lhs, uint rhs) { return new bool4x3 (lhs.c0 <= rhs, lhs.c1 <= rhs, lhs.c2 <= rhs); } + + /// Returns the result of a componentwise less or equal operation on a uint value and a uint4x3 matrix. + /// Left hand side uint to use to compute componentwise less or equal. + /// Right hand side uint4x3 to use to compute componentwise less or equal. + /// bool4x3 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator <= (uint lhs, uint4x3 rhs) { return new bool4x3 (lhs <= rhs.c0, lhs <= rhs.c1, lhs <= rhs.c2); } + + + /// Returns the result of a componentwise greater than operation on two uint4x3 matrices. + /// Left hand side uint4x3 to use to compute componentwise greater than. + /// Right hand side uint4x3 to use to compute componentwise greater than. + /// bool4x3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator > (uint4x3 lhs, uint4x3 rhs) { return new bool4x3 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1, lhs.c2 > rhs.c2); } + + /// Returns the result of a componentwise greater than operation on a uint4x3 matrix and a uint value. + /// Left hand side uint4x3 to use to compute componentwise greater than. + /// Right hand side uint to use to compute componentwise greater than. + /// bool4x3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator > (uint4x3 lhs, uint rhs) { return new bool4x3 (lhs.c0 > rhs, lhs.c1 > rhs, lhs.c2 > rhs); } + + /// Returns the result of a componentwise greater than operation on a uint value and a uint4x3 matrix. + /// Left hand side uint to use to compute componentwise greater than. + /// Right hand side uint4x3 to use to compute componentwise greater than. + /// bool4x3 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator > (uint lhs, uint4x3 rhs) { return new bool4x3 (lhs > rhs.c0, lhs > rhs.c1, lhs > rhs.c2); } + + + /// Returns the result of a componentwise greater or equal operation on two uint4x3 matrices. + /// Left hand side uint4x3 to use to compute componentwise greater or equal. + /// Right hand side uint4x3 to use to compute componentwise greater or equal. + /// bool4x3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator >= (uint4x3 lhs, uint4x3 rhs) { return new bool4x3 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1, lhs.c2 >= rhs.c2); } + + /// Returns the result of a componentwise greater or equal operation on a uint4x3 matrix and a uint value. + /// Left hand side uint4x3 to use to compute componentwise greater or equal. + /// Right hand side uint to use to compute componentwise greater or equal. + /// bool4x3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator >= (uint4x3 lhs, uint rhs) { return new bool4x3 (lhs.c0 >= rhs, lhs.c1 >= rhs, lhs.c2 >= rhs); } + + /// Returns the result of a componentwise greater or equal operation on a uint value and a uint4x3 matrix. + /// Left hand side uint to use to compute componentwise greater or equal. + /// Right hand side uint4x3 to use to compute componentwise greater or equal. + /// bool4x3 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator >= (uint lhs, uint4x3 rhs) { return new bool4x3 (lhs >= rhs.c0, lhs >= rhs.c1, lhs >= rhs.c2); } + + + /// Returns the result of a componentwise unary minus operation on a uint4x3 matrix. + /// Value to use when computing the componentwise unary minus. + /// uint4x3 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 operator - (uint4x3 val) { return new uint4x3 (-val.c0, -val.c1, -val.c2); } + + + /// Returns the result of a componentwise unary plus operation on a uint4x3 matrix. + /// Value to use when computing the componentwise unary plus. + /// uint4x3 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 operator + (uint4x3 val) { return new uint4x3 (+val.c0, +val.c1, +val.c2); } + + + /// Returns the result of a componentwise left shift operation on a uint4x3 matrix by a number of bits specified by a single int. + /// The matrix to left shift. + /// The number of bits to left shift. + /// The result of the componentwise left shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 operator << (uint4x3 x, int n) { return new uint4x3 (x.c0 << n, x.c1 << n, x.c2 << n); } + + /// Returns the result of a componentwise right shift operation on a uint4x3 matrix by a number of bits specified by a single int. + /// The matrix to right shift. + /// The number of bits to right shift. + /// The result of the componentwise right shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 operator >> (uint4x3 x, int n) { return new uint4x3 (x.c0 >> n, x.c1 >> n, x.c2 >> n); } + + /// Returns the result of a componentwise equality operation on two uint4x3 matrices. + /// Left hand side uint4x3 to use to compute componentwise equality. + /// Right hand side uint4x3 to use to compute componentwise equality. + /// bool4x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator == (uint4x3 lhs, uint4x3 rhs) { return new bool4x3 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2); } + + /// Returns the result of a componentwise equality operation on a uint4x3 matrix and a uint value. + /// Left hand side uint4x3 to use to compute componentwise equality. + /// Right hand side uint to use to compute componentwise equality. + /// bool4x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator == (uint4x3 lhs, uint rhs) { return new bool4x3 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs); } + + /// Returns the result of a componentwise equality operation on a uint value and a uint4x3 matrix. + /// Left hand side uint to use to compute componentwise equality. + /// Right hand side uint4x3 to use to compute componentwise equality. + /// bool4x3 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator == (uint lhs, uint4x3 rhs) { return new bool4x3 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2); } + + + /// Returns the result of a componentwise not equal operation on two uint4x3 matrices. + /// Left hand side uint4x3 to use to compute componentwise not equal. + /// Right hand side uint4x3 to use to compute componentwise not equal. + /// bool4x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator != (uint4x3 lhs, uint4x3 rhs) { return new bool4x3 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2); } + + /// Returns the result of a componentwise not equal operation on a uint4x3 matrix and a uint value. + /// Left hand side uint4x3 to use to compute componentwise not equal. + /// Right hand side uint to use to compute componentwise not equal. + /// bool4x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator != (uint4x3 lhs, uint rhs) { return new bool4x3 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs); } + + /// Returns the result of a componentwise not equal operation on a uint value and a uint4x3 matrix. + /// Left hand side uint to use to compute componentwise not equal. + /// Right hand side uint4x3 to use to compute componentwise not equal. + /// bool4x3 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x3 operator != (uint lhs, uint4x3 rhs) { return new bool4x3 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2); } + + + /// Returns the result of a componentwise bitwise not operation on a uint4x3 matrix. + /// Value to use when computing the componentwise bitwise not. + /// uint4x3 result of the componentwise bitwise not. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 operator ~ (uint4x3 val) { return new uint4x3 (~val.c0, ~val.c1, ~val.c2); } + + + /// Returns the result of a componentwise bitwise and operation on two uint4x3 matrices. + /// Left hand side uint4x3 to use to compute componentwise bitwise and. + /// Right hand side uint4x3 to use to compute componentwise bitwise and. + /// uint4x3 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 operator & (uint4x3 lhs, uint4x3 rhs) { return new uint4x3 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1, lhs.c2 & rhs.c2); } + + /// Returns the result of a componentwise bitwise and operation on a uint4x3 matrix and a uint value. + /// Left hand side uint4x3 to use to compute componentwise bitwise and. + /// Right hand side uint to use to compute componentwise bitwise and. + /// uint4x3 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 operator & (uint4x3 lhs, uint rhs) { return new uint4x3 (lhs.c0 & rhs, lhs.c1 & rhs, lhs.c2 & rhs); } + + /// Returns the result of a componentwise bitwise and operation on a uint value and a uint4x3 matrix. + /// Left hand side uint to use to compute componentwise bitwise and. + /// Right hand side uint4x3 to use to compute componentwise bitwise and. + /// uint4x3 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 operator & (uint lhs, uint4x3 rhs) { return new uint4x3 (lhs & rhs.c0, lhs & rhs.c1, lhs & rhs.c2); } + + + /// Returns the result of a componentwise bitwise or operation on two uint4x3 matrices. + /// Left hand side uint4x3 to use to compute componentwise bitwise or. + /// Right hand side uint4x3 to use to compute componentwise bitwise or. + /// uint4x3 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 operator | (uint4x3 lhs, uint4x3 rhs) { return new uint4x3 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1, lhs.c2 | rhs.c2); } + + /// Returns the result of a componentwise bitwise or operation on a uint4x3 matrix and a uint value. + /// Left hand side uint4x3 to use to compute componentwise bitwise or. + /// Right hand side uint to use to compute componentwise bitwise or. + /// uint4x3 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 operator | (uint4x3 lhs, uint rhs) { return new uint4x3 (lhs.c0 | rhs, lhs.c1 | rhs, lhs.c2 | rhs); } + + /// Returns the result of a componentwise bitwise or operation on a uint value and a uint4x3 matrix. + /// Left hand side uint to use to compute componentwise bitwise or. + /// Right hand side uint4x3 to use to compute componentwise bitwise or. + /// uint4x3 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 operator | (uint lhs, uint4x3 rhs) { return new uint4x3 (lhs | rhs.c0, lhs | rhs.c1, lhs | rhs.c2); } + + + /// Returns the result of a componentwise bitwise exclusive or operation on two uint4x3 matrices. + /// Left hand side uint4x3 to use to compute componentwise bitwise exclusive or. + /// Right hand side uint4x3 to use to compute componentwise bitwise exclusive or. + /// uint4x3 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 operator ^ (uint4x3 lhs, uint4x3 rhs) { return new uint4x3 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1, lhs.c2 ^ rhs.c2); } + + /// Returns the result of a componentwise bitwise exclusive or operation on a uint4x3 matrix and a uint value. + /// Left hand side uint4x3 to use to compute componentwise bitwise exclusive or. + /// Right hand side uint to use to compute componentwise bitwise exclusive or. + /// uint4x3 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 operator ^ (uint4x3 lhs, uint rhs) { return new uint4x3 (lhs.c0 ^ rhs, lhs.c1 ^ rhs, lhs.c2 ^ rhs); } + + /// Returns the result of a componentwise bitwise exclusive or operation on a uint value and a uint4x3 matrix. + /// Left hand side uint to use to compute componentwise bitwise exclusive or. + /// Right hand side uint4x3 to use to compute componentwise bitwise exclusive or. + /// uint4x3 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 operator ^ (uint lhs, uint4x3 rhs) { return new uint4x3 (lhs ^ rhs.c0, lhs ^ rhs.c1, lhs ^ rhs.c2); } + + + + /// Returns the uint4 element at a specified index. + unsafe public ref uint4 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 3) + throw new System.ArgumentException("index must be between[0...2]"); +#endif + fixed (uint4x3* array = &this) { return ref ((uint4*)array)[index]; } + } + } + + /// Returns true if the uint4x3 is equal to a given uint4x3, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(uint4x3 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2); } + + /// Returns true if the uint4x3 is equal to a given uint4x3, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is uint4x3 converted && Equals(converted); } + + + /// Returns a hash code for the uint4x3. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the uint4x3. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("uint4x3({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11})", c0.x, c1.x, c2.x, c0.y, c1.y, c2.y, c0.z, c1.z, c2.z, c0.w, c1.w, c2.w); + } + + /// Returns a string representation of the uint4x3 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("uint4x3({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11})", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c2.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c2.y.ToString(format, formatProvider), c0.z.ToString(format, formatProvider), c1.z.ToString(format, formatProvider), c2.z.ToString(format, formatProvider), c0.w.ToString(format, formatProvider), c1.w.ToString(format, formatProvider), c2.w.ToString(format, formatProvider)); + } + + } + + public static partial class math + { + /// Returns a uint4x3 matrix constructed from three uint4 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// uint4x3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 uint4x3(uint4 c0, uint4 c1, uint4 c2) { return new uint4x3(c0, c1, c2); } + + /// Returns a uint4x3 matrix constructed from from 12 uint values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 2, column 2 will be set to this value. + /// The matrix at row 3, column 0 will be set to this value. + /// The matrix at row 3, column 1 will be set to this value. + /// The matrix at row 3, column 2 will be set to this value. + /// uint4x3 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 uint4x3(uint m00, uint m01, uint m02, + uint m10, uint m11, uint m12, + uint m20, uint m21, uint m22, + uint m30, uint m31, uint m32) + { + return new uint4x3(m00, m01, m02, + m10, m11, m12, + m20, m21, m22, + m30, m31, m32); + } + + /// Returns a uint4x3 matrix constructed from a single uint value by assigning it to every component. + /// uint to convert to uint4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 uint4x3(uint v) { return new uint4x3(v); } + + /// Returns a uint4x3 matrix constructed from a single bool value by converting it to uint and assigning it to every component. + /// bool to convert to uint4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 uint4x3(bool v) { return new uint4x3(v); } + + /// Return a uint4x3 matrix constructed from a bool4x3 matrix by componentwise conversion. + /// bool4x3 to convert to uint4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 uint4x3(bool4x3 v) { return new uint4x3(v); } + + /// Returns a uint4x3 matrix constructed from a single int value by converting it to uint and assigning it to every component. + /// int to convert to uint4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 uint4x3(int v) { return new uint4x3(v); } + + /// Return a uint4x3 matrix constructed from a int4x3 matrix by componentwise conversion. + /// int4x3 to convert to uint4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 uint4x3(int4x3 v) { return new uint4x3(v); } + + /// Returns a uint4x3 matrix constructed from a single float value by converting it to uint and assigning it to every component. + /// float to convert to uint4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 uint4x3(float v) { return new uint4x3(v); } + + /// Return a uint4x3 matrix constructed from a float4x3 matrix by componentwise conversion. + /// float4x3 to convert to uint4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 uint4x3(float4x3 v) { return new uint4x3(v); } + + /// Returns a uint4x3 matrix constructed from a single double value by converting it to uint and assigning it to every component. + /// double to convert to uint4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 uint4x3(double v) { return new uint4x3(v); } + + /// Return a uint4x3 matrix constructed from a double4x3 matrix by componentwise conversion. + /// double4x3 to convert to uint4x3 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x3 uint4x3(double4x3 v) { return new uint4x3(v); } + + /// Return the uint3x4 transpose of a uint4x3 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint3x4 transpose(uint4x3 v) + { + return uint3x4( + v.c0.x, v.c0.y, v.c0.z, v.c0.w, + v.c1.x, v.c1.y, v.c1.z, v.c1.w, + v.c2.x, v.c2.y, v.c2.z, v.c2.w); + } + + /// Returns a uint hash code of a uint4x3 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(uint4x3 v) + { + return csum(v.c0 * uint4(0xE7579997u, 0xEF7D56C7u, 0x66F38F0Bu, 0x624256A3u) + + v.c1 * uint4(0x5292ADE1u, 0xD2E590E5u, 0xF25BE857u, 0x9BC17CE7u) + + v.c2 * uint4(0xC8B86851u, 0x64095221u, 0xADF428FFu, 0xA3977109u)) + 0x745ED837u; + } + + /// + /// Returns a uint4 vector hash code of a uint4x3 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint4 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 hashwide(uint4x3 v) + { + return (v.c0 * uint4(0x9CDC88F5u, 0xFA62D721u, 0x7E4DB1CFu, 0x68EEE0F5u) + + v.c1 * uint4(0xBC3B0A59u, 0x816EFB5Du, 0xA24E82B7u, 0x45A22087u) + + v.c2 * uint4(0xFC104C3Bu, 0x5FFF6B19u, 0x5E6CBF3Bu, 0xB546F2A5u)) + 0xBBCF63E7u; + } + + } +} diff --git a/src/Unity.Mathematics/uint4x3.gen.cs.meta b/src/Unity.Mathematics/uint4x3.gen.cs.meta new file mode 100644 index 00000000..2f3698df --- /dev/null +++ b/src/Unity.Mathematics/uint4x3.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8178bb4bab5354260979dd1f191c22ca +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Unity.Mathematics/uint4x4.gen.cs b/src/Unity.Mathematics/uint4x4.gen.cs new file mode 100644 index 00000000..566373b8 --- /dev/null +++ b/src/Unity.Mathematics/uint4x4.gen.cs @@ -0,0 +1,781 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen. +// +//------------------------------------------------------------------------------ +using System; +using System.Runtime.CompilerServices; +using Unity.IL2CPP.CompilerServices; + +#pragma warning disable 0660, 0661 + +namespace Unity.Mathematics +{ + /// A 4x4 matrix of uints. + [System.Serializable] + [Il2CppEagerStaticClassConstruction] + public partial struct uint4x4 : System.IEquatable, IFormattable + { + /// Column 0 of the matrix. + public uint4 c0; + /// Column 1 of the matrix. + public uint4 c1; + /// Column 2 of the matrix. + public uint4 c2; + /// Column 3 of the matrix. + public uint4 c3; + + /// uint4x4 identity transform. + public static readonly uint4x4 identity = new uint4x4(1u, 0u, 0u, 0u, 0u, 1u, 0u, 0u, 0u, 0u, 1u, 0u, 0u, 0u, 0u, 1u); + + /// uint4x4 zero value. + public static readonly uint4x4 zero; + + /// Constructs a uint4x4 matrix from four uint4 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// The matrix column c3 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4x4(uint4 c0, uint4 c1, uint4 c2, uint4 c3) + { + this.c0 = c0; + this.c1 = c1; + this.c2 = c2; + this.c3 = c3; + } + + /// Constructs a uint4x4 matrix from 16 uint values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 0, column 3 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 1, column 3 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 2, column 2 will be set to this value. + /// The matrix at row 2, column 3 will be set to this value. + /// The matrix at row 3, column 0 will be set to this value. + /// The matrix at row 3, column 1 will be set to this value. + /// The matrix at row 3, column 2 will be set to this value. + /// The matrix at row 3, column 3 will be set to this value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4x4(uint m00, uint m01, uint m02, uint m03, + uint m10, uint m11, uint m12, uint m13, + uint m20, uint m21, uint m22, uint m23, + uint m30, uint m31, uint m32, uint m33) + { + this.c0 = new uint4(m00, m10, m20, m30); + this.c1 = new uint4(m01, m11, m21, m31); + this.c2 = new uint4(m02, m12, m22, m32); + this.c3 = new uint4(m03, m13, m23, m33); + } + + /// Constructs a uint4x4 matrix from a single uint value by assigning it to every component. + /// uint to convert to uint4x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4x4(uint v) + { + this.c0 = v; + this.c1 = v; + this.c2 = v; + this.c3 = v; + } + + /// Constructs a uint4x4 matrix from a single bool value by converting it to uint and assigning it to every component. + /// bool to convert to uint4x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4x4(bool v) + { + this.c0 = math.select(new uint4(0u), new uint4(1u), v); + this.c1 = math.select(new uint4(0u), new uint4(1u), v); + this.c2 = math.select(new uint4(0u), new uint4(1u), v); + this.c3 = math.select(new uint4(0u), new uint4(1u), v); + } + + /// Constructs a uint4x4 matrix from a bool4x4 matrix by componentwise conversion. + /// bool4x4 to convert to uint4x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4x4(bool4x4 v) + { + this.c0 = math.select(new uint4(0u), new uint4(1u), v.c0); + this.c1 = math.select(new uint4(0u), new uint4(1u), v.c1); + this.c2 = math.select(new uint4(0u), new uint4(1u), v.c2); + this.c3 = math.select(new uint4(0u), new uint4(1u), v.c3); + } + + /// Constructs a uint4x4 matrix from a single int value by converting it to uint and assigning it to every component. + /// int to convert to uint4x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4x4(int v) + { + this.c0 = (uint4)v; + this.c1 = (uint4)v; + this.c2 = (uint4)v; + this.c3 = (uint4)v; + } + + /// Constructs a uint4x4 matrix from a int4x4 matrix by componentwise conversion. + /// int4x4 to convert to uint4x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4x4(int4x4 v) + { + this.c0 = (uint4)v.c0; + this.c1 = (uint4)v.c1; + this.c2 = (uint4)v.c2; + this.c3 = (uint4)v.c3; + } + + /// Constructs a uint4x4 matrix from a single float value by converting it to uint and assigning it to every component. + /// float to convert to uint4x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4x4(float v) + { + this.c0 = (uint4)v; + this.c1 = (uint4)v; + this.c2 = (uint4)v; + this.c3 = (uint4)v; + } + + /// Constructs a uint4x4 matrix from a float4x4 matrix by componentwise conversion. + /// float4x4 to convert to uint4x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4x4(float4x4 v) + { + this.c0 = (uint4)v.c0; + this.c1 = (uint4)v.c1; + this.c2 = (uint4)v.c2; + this.c3 = (uint4)v.c3; + } + + /// Constructs a uint4x4 matrix from a single double value by converting it to uint and assigning it to every component. + /// double to convert to uint4x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4x4(double v) + { + this.c0 = (uint4)v; + this.c1 = (uint4)v; + this.c2 = (uint4)v; + this.c3 = (uint4)v; + } + + /// Constructs a uint4x4 matrix from a double4x4 matrix by componentwise conversion. + /// double4x4 to convert to uint4x4 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public uint4x4(double4x4 v) + { + this.c0 = (uint4)v.c0; + this.c1 = (uint4)v.c1; + this.c2 = (uint4)v.c2; + this.c3 = (uint4)v.c3; + } + + + /// Implicitly converts a single uint value to a uint4x4 matrix by assigning it to every component. + /// uint to convert to uint4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator uint4x4(uint v) { return new uint4x4(v); } + + /// Explicitly converts a single bool value to a uint4x4 matrix by converting it to uint and assigning it to every component. + /// bool to convert to uint4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint4x4(bool v) { return new uint4x4(v); } + + /// Explicitly converts a bool4x4 matrix to a uint4x4 matrix by componentwise conversion. + /// bool4x4 to convert to uint4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint4x4(bool4x4 v) { return new uint4x4(v); } + + /// Explicitly converts a single int value to a uint4x4 matrix by converting it to uint and assigning it to every component. + /// int to convert to uint4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint4x4(int v) { return new uint4x4(v); } + + /// Explicitly converts a int4x4 matrix to a uint4x4 matrix by componentwise conversion. + /// int4x4 to convert to uint4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint4x4(int4x4 v) { return new uint4x4(v); } + + /// Explicitly converts a single float value to a uint4x4 matrix by converting it to uint and assigning it to every component. + /// float to convert to uint4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint4x4(float v) { return new uint4x4(v); } + + /// Explicitly converts a float4x4 matrix to a uint4x4 matrix by componentwise conversion. + /// float4x4 to convert to uint4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint4x4(float4x4 v) { return new uint4x4(v); } + + /// Explicitly converts a single double value to a uint4x4 matrix by converting it to uint and assigning it to every component. + /// double to convert to uint4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint4x4(double v) { return new uint4x4(v); } + + /// Explicitly converts a double4x4 matrix to a uint4x4 matrix by componentwise conversion. + /// double4x4 to convert to uint4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static explicit operator uint4x4(double4x4 v) { return new uint4x4(v); } + + + /// Returns the result of a componentwise multiplication operation on two uint4x4 matrices. + /// Left hand side uint4x4 to use to compute componentwise multiplication. + /// Right hand side uint4x4 to use to compute componentwise multiplication. + /// uint4x4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 operator * (uint4x4 lhs, uint4x4 rhs) { return new uint4x4 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1, lhs.c2 * rhs.c2, lhs.c3 * rhs.c3); } + + /// Returns the result of a componentwise multiplication operation on a uint4x4 matrix and a uint value. + /// Left hand side uint4x4 to use to compute componentwise multiplication. + /// Right hand side uint to use to compute componentwise multiplication. + /// uint4x4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 operator * (uint4x4 lhs, uint rhs) { return new uint4x4 (lhs.c0 * rhs, lhs.c1 * rhs, lhs.c2 * rhs, lhs.c3 * rhs); } + + /// Returns the result of a componentwise multiplication operation on a uint value and a uint4x4 matrix. + /// Left hand side uint to use to compute componentwise multiplication. + /// Right hand side uint4x4 to use to compute componentwise multiplication. + /// uint4x4 result of the componentwise multiplication. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 operator * (uint lhs, uint4x4 rhs) { return new uint4x4 (lhs * rhs.c0, lhs * rhs.c1, lhs * rhs.c2, lhs * rhs.c3); } + + + /// Returns the result of a componentwise addition operation on two uint4x4 matrices. + /// Left hand side uint4x4 to use to compute componentwise addition. + /// Right hand side uint4x4 to use to compute componentwise addition. + /// uint4x4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 operator + (uint4x4 lhs, uint4x4 rhs) { return new uint4x4 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1, lhs.c2 + rhs.c2, lhs.c3 + rhs.c3); } + + /// Returns the result of a componentwise addition operation on a uint4x4 matrix and a uint value. + /// Left hand side uint4x4 to use to compute componentwise addition. + /// Right hand side uint to use to compute componentwise addition. + /// uint4x4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 operator + (uint4x4 lhs, uint rhs) { return new uint4x4 (lhs.c0 + rhs, lhs.c1 + rhs, lhs.c2 + rhs, lhs.c3 + rhs); } + + /// Returns the result of a componentwise addition operation on a uint value and a uint4x4 matrix. + /// Left hand side uint to use to compute componentwise addition. + /// Right hand side uint4x4 to use to compute componentwise addition. + /// uint4x4 result of the componentwise addition. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 operator + (uint lhs, uint4x4 rhs) { return new uint4x4 (lhs + rhs.c0, lhs + rhs.c1, lhs + rhs.c2, lhs + rhs.c3); } + + + /// Returns the result of a componentwise subtraction operation on two uint4x4 matrices. + /// Left hand side uint4x4 to use to compute componentwise subtraction. + /// Right hand side uint4x4 to use to compute componentwise subtraction. + /// uint4x4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 operator - (uint4x4 lhs, uint4x4 rhs) { return new uint4x4 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1, lhs.c2 - rhs.c2, lhs.c3 - rhs.c3); } + + /// Returns the result of a componentwise subtraction operation on a uint4x4 matrix and a uint value. + /// Left hand side uint4x4 to use to compute componentwise subtraction. + /// Right hand side uint to use to compute componentwise subtraction. + /// uint4x4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 operator - (uint4x4 lhs, uint rhs) { return new uint4x4 (lhs.c0 - rhs, lhs.c1 - rhs, lhs.c2 - rhs, lhs.c3 - rhs); } + + /// Returns the result of a componentwise subtraction operation on a uint value and a uint4x4 matrix. + /// Left hand side uint to use to compute componentwise subtraction. + /// Right hand side uint4x4 to use to compute componentwise subtraction. + /// uint4x4 result of the componentwise subtraction. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 operator - (uint lhs, uint4x4 rhs) { return new uint4x4 (lhs - rhs.c0, lhs - rhs.c1, lhs - rhs.c2, lhs - rhs.c3); } + + + /// Returns the result of a componentwise division operation on two uint4x4 matrices. + /// Left hand side uint4x4 to use to compute componentwise division. + /// Right hand side uint4x4 to use to compute componentwise division. + /// uint4x4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 operator / (uint4x4 lhs, uint4x4 rhs) { return new uint4x4 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1, lhs.c2 / rhs.c2, lhs.c3 / rhs.c3); } + + /// Returns the result of a componentwise division operation on a uint4x4 matrix and a uint value. + /// Left hand side uint4x4 to use to compute componentwise division. + /// Right hand side uint to use to compute componentwise division. + /// uint4x4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 operator / (uint4x4 lhs, uint rhs) { return new uint4x4 (lhs.c0 / rhs, lhs.c1 / rhs, lhs.c2 / rhs, lhs.c3 / rhs); } + + /// Returns the result of a componentwise division operation on a uint value and a uint4x4 matrix. + /// Left hand side uint to use to compute componentwise division. + /// Right hand side uint4x4 to use to compute componentwise division. + /// uint4x4 result of the componentwise division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 operator / (uint lhs, uint4x4 rhs) { return new uint4x4 (lhs / rhs.c0, lhs / rhs.c1, lhs / rhs.c2, lhs / rhs.c3); } + + + /// Returns the result of a componentwise modulus operation on two uint4x4 matrices. + /// Left hand side uint4x4 to use to compute componentwise modulus. + /// Right hand side uint4x4 to use to compute componentwise modulus. + /// uint4x4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 operator % (uint4x4 lhs, uint4x4 rhs) { return new uint4x4 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1, lhs.c2 % rhs.c2, lhs.c3 % rhs.c3); } + + /// Returns the result of a componentwise modulus operation on a uint4x4 matrix and a uint value. + /// Left hand side uint4x4 to use to compute componentwise modulus. + /// Right hand side uint to use to compute componentwise modulus. + /// uint4x4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 operator % (uint4x4 lhs, uint rhs) { return new uint4x4 (lhs.c0 % rhs, lhs.c1 % rhs, lhs.c2 % rhs, lhs.c3 % rhs); } + + /// Returns the result of a componentwise modulus operation on a uint value and a uint4x4 matrix. + /// Left hand side uint to use to compute componentwise modulus. + /// Right hand side uint4x4 to use to compute componentwise modulus. + /// uint4x4 result of the componentwise modulus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 operator % (uint lhs, uint4x4 rhs) { return new uint4x4 (lhs % rhs.c0, lhs % rhs.c1, lhs % rhs.c2, lhs % rhs.c3); } + + + /// Returns the result of a componentwise increment operation on a uint4x4 matrix. + /// Value to use when computing the componentwise increment. + /// uint4x4 result of the componentwise increment. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 operator ++ (uint4x4 val) { return new uint4x4 (++val.c0, ++val.c1, ++val.c2, ++val.c3); } + + + /// Returns the result of a componentwise decrement operation on a uint4x4 matrix. + /// Value to use when computing the componentwise decrement. + /// uint4x4 result of the componentwise decrement. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 operator -- (uint4x4 val) { return new uint4x4 (--val.c0, --val.c1, --val.c2, --val.c3); } + + + /// Returns the result of a componentwise less than operation on two uint4x4 matrices. + /// Left hand side uint4x4 to use to compute componentwise less than. + /// Right hand side uint4x4 to use to compute componentwise less than. + /// bool4x4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator < (uint4x4 lhs, uint4x4 rhs) { return new bool4x4 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1, lhs.c2 < rhs.c2, lhs.c3 < rhs.c3); } + + /// Returns the result of a componentwise less than operation on a uint4x4 matrix and a uint value. + /// Left hand side uint4x4 to use to compute componentwise less than. + /// Right hand side uint to use to compute componentwise less than. + /// bool4x4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator < (uint4x4 lhs, uint rhs) { return new bool4x4 (lhs.c0 < rhs, lhs.c1 < rhs, lhs.c2 < rhs, lhs.c3 < rhs); } + + /// Returns the result of a componentwise less than operation on a uint value and a uint4x4 matrix. + /// Left hand side uint to use to compute componentwise less than. + /// Right hand side uint4x4 to use to compute componentwise less than. + /// bool4x4 result of the componentwise less than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator < (uint lhs, uint4x4 rhs) { return new bool4x4 (lhs < rhs.c0, lhs < rhs.c1, lhs < rhs.c2, lhs < rhs.c3); } + + + /// Returns the result of a componentwise less or equal operation on two uint4x4 matrices. + /// Left hand side uint4x4 to use to compute componentwise less or equal. + /// Right hand side uint4x4 to use to compute componentwise less or equal. + /// bool4x4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator <= (uint4x4 lhs, uint4x4 rhs) { return new bool4x4 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1, lhs.c2 <= rhs.c2, lhs.c3 <= rhs.c3); } + + /// Returns the result of a componentwise less or equal operation on a uint4x4 matrix and a uint value. + /// Left hand side uint4x4 to use to compute componentwise less or equal. + /// Right hand side uint to use to compute componentwise less or equal. + /// bool4x4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator <= (uint4x4 lhs, uint rhs) { return new bool4x4 (lhs.c0 <= rhs, lhs.c1 <= rhs, lhs.c2 <= rhs, lhs.c3 <= rhs); } + + /// Returns the result of a componentwise less or equal operation on a uint value and a uint4x4 matrix. + /// Left hand side uint to use to compute componentwise less or equal. + /// Right hand side uint4x4 to use to compute componentwise less or equal. + /// bool4x4 result of the componentwise less or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator <= (uint lhs, uint4x4 rhs) { return new bool4x4 (lhs <= rhs.c0, lhs <= rhs.c1, lhs <= rhs.c2, lhs <= rhs.c3); } + + + /// Returns the result of a componentwise greater than operation on two uint4x4 matrices. + /// Left hand side uint4x4 to use to compute componentwise greater than. + /// Right hand side uint4x4 to use to compute componentwise greater than. + /// bool4x4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator > (uint4x4 lhs, uint4x4 rhs) { return new bool4x4 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1, lhs.c2 > rhs.c2, lhs.c3 > rhs.c3); } + + /// Returns the result of a componentwise greater than operation on a uint4x4 matrix and a uint value. + /// Left hand side uint4x4 to use to compute componentwise greater than. + /// Right hand side uint to use to compute componentwise greater than. + /// bool4x4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator > (uint4x4 lhs, uint rhs) { return new bool4x4 (lhs.c0 > rhs, lhs.c1 > rhs, lhs.c2 > rhs, lhs.c3 > rhs); } + + /// Returns the result of a componentwise greater than operation on a uint value and a uint4x4 matrix. + /// Left hand side uint to use to compute componentwise greater than. + /// Right hand side uint4x4 to use to compute componentwise greater than. + /// bool4x4 result of the componentwise greater than. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator > (uint lhs, uint4x4 rhs) { return new bool4x4 (lhs > rhs.c0, lhs > rhs.c1, lhs > rhs.c2, lhs > rhs.c3); } + + + /// Returns the result of a componentwise greater or equal operation on two uint4x4 matrices. + /// Left hand side uint4x4 to use to compute componentwise greater or equal. + /// Right hand side uint4x4 to use to compute componentwise greater or equal. + /// bool4x4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator >= (uint4x4 lhs, uint4x4 rhs) { return new bool4x4 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1, lhs.c2 >= rhs.c2, lhs.c3 >= rhs.c3); } + + /// Returns the result of a componentwise greater or equal operation on a uint4x4 matrix and a uint value. + /// Left hand side uint4x4 to use to compute componentwise greater or equal. + /// Right hand side uint to use to compute componentwise greater or equal. + /// bool4x4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator >= (uint4x4 lhs, uint rhs) { return new bool4x4 (lhs.c0 >= rhs, lhs.c1 >= rhs, lhs.c2 >= rhs, lhs.c3 >= rhs); } + + /// Returns the result of a componentwise greater or equal operation on a uint value and a uint4x4 matrix. + /// Left hand side uint to use to compute componentwise greater or equal. + /// Right hand side uint4x4 to use to compute componentwise greater or equal. + /// bool4x4 result of the componentwise greater or equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator >= (uint lhs, uint4x4 rhs) { return new bool4x4 (lhs >= rhs.c0, lhs >= rhs.c1, lhs >= rhs.c2, lhs >= rhs.c3); } + + + /// Returns the result of a componentwise unary minus operation on a uint4x4 matrix. + /// Value to use when computing the componentwise unary minus. + /// uint4x4 result of the componentwise unary minus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 operator - (uint4x4 val) { return new uint4x4 (-val.c0, -val.c1, -val.c2, -val.c3); } + + + /// Returns the result of a componentwise unary plus operation on a uint4x4 matrix. + /// Value to use when computing the componentwise unary plus. + /// uint4x4 result of the componentwise unary plus. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 operator + (uint4x4 val) { return new uint4x4 (+val.c0, +val.c1, +val.c2, +val.c3); } + + + /// Returns the result of a componentwise left shift operation on a uint4x4 matrix by a number of bits specified by a single int. + /// The matrix to left shift. + /// The number of bits to left shift. + /// The result of the componentwise left shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 operator << (uint4x4 x, int n) { return new uint4x4 (x.c0 << n, x.c1 << n, x.c2 << n, x.c3 << n); } + + /// Returns the result of a componentwise right shift operation on a uint4x4 matrix by a number of bits specified by a single int. + /// The matrix to right shift. + /// The number of bits to right shift. + /// The result of the componentwise right shift. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 operator >> (uint4x4 x, int n) { return new uint4x4 (x.c0 >> n, x.c1 >> n, x.c2 >> n, x.c3 >> n); } + + /// Returns the result of a componentwise equality operation on two uint4x4 matrices. + /// Left hand side uint4x4 to use to compute componentwise equality. + /// Right hand side uint4x4 to use to compute componentwise equality. + /// bool4x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator == (uint4x4 lhs, uint4x4 rhs) { return new bool4x4 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2, lhs.c3 == rhs.c3); } + + /// Returns the result of a componentwise equality operation on a uint4x4 matrix and a uint value. + /// Left hand side uint4x4 to use to compute componentwise equality. + /// Right hand side uint to use to compute componentwise equality. + /// bool4x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator == (uint4x4 lhs, uint rhs) { return new bool4x4 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs, lhs.c3 == rhs); } + + /// Returns the result of a componentwise equality operation on a uint value and a uint4x4 matrix. + /// Left hand side uint to use to compute componentwise equality. + /// Right hand side uint4x4 to use to compute componentwise equality. + /// bool4x4 result of the componentwise equality. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator == (uint lhs, uint4x4 rhs) { return new bool4x4 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2, lhs == rhs.c3); } + + + /// Returns the result of a componentwise not equal operation on two uint4x4 matrices. + /// Left hand side uint4x4 to use to compute componentwise not equal. + /// Right hand side uint4x4 to use to compute componentwise not equal. + /// bool4x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator != (uint4x4 lhs, uint4x4 rhs) { return new bool4x4 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2, lhs.c3 != rhs.c3); } + + /// Returns the result of a componentwise not equal operation on a uint4x4 matrix and a uint value. + /// Left hand side uint4x4 to use to compute componentwise not equal. + /// Right hand side uint to use to compute componentwise not equal. + /// bool4x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator != (uint4x4 lhs, uint rhs) { return new bool4x4 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs, lhs.c3 != rhs); } + + /// Returns the result of a componentwise not equal operation on a uint value and a uint4x4 matrix. + /// Left hand side uint to use to compute componentwise not equal. + /// Right hand side uint4x4 to use to compute componentwise not equal. + /// bool4x4 result of the componentwise not equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool4x4 operator != (uint lhs, uint4x4 rhs) { return new bool4x4 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2, lhs != rhs.c3); } + + + /// Returns the result of a componentwise bitwise not operation on a uint4x4 matrix. + /// Value to use when computing the componentwise bitwise not. + /// uint4x4 result of the componentwise bitwise not. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 operator ~ (uint4x4 val) { return new uint4x4 (~val.c0, ~val.c1, ~val.c2, ~val.c3); } + + + /// Returns the result of a componentwise bitwise and operation on two uint4x4 matrices. + /// Left hand side uint4x4 to use to compute componentwise bitwise and. + /// Right hand side uint4x4 to use to compute componentwise bitwise and. + /// uint4x4 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 operator & (uint4x4 lhs, uint4x4 rhs) { return new uint4x4 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1, lhs.c2 & rhs.c2, lhs.c3 & rhs.c3); } + + /// Returns the result of a componentwise bitwise and operation on a uint4x4 matrix and a uint value. + /// Left hand side uint4x4 to use to compute componentwise bitwise and. + /// Right hand side uint to use to compute componentwise bitwise and. + /// uint4x4 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 operator & (uint4x4 lhs, uint rhs) { return new uint4x4 (lhs.c0 & rhs, lhs.c1 & rhs, lhs.c2 & rhs, lhs.c3 & rhs); } + + /// Returns the result of a componentwise bitwise and operation on a uint value and a uint4x4 matrix. + /// Left hand side uint to use to compute componentwise bitwise and. + /// Right hand side uint4x4 to use to compute componentwise bitwise and. + /// uint4x4 result of the componentwise bitwise and. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 operator & (uint lhs, uint4x4 rhs) { return new uint4x4 (lhs & rhs.c0, lhs & rhs.c1, lhs & rhs.c2, lhs & rhs.c3); } + + + /// Returns the result of a componentwise bitwise or operation on two uint4x4 matrices. + /// Left hand side uint4x4 to use to compute componentwise bitwise or. + /// Right hand side uint4x4 to use to compute componentwise bitwise or. + /// uint4x4 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 operator | (uint4x4 lhs, uint4x4 rhs) { return new uint4x4 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1, lhs.c2 | rhs.c2, lhs.c3 | rhs.c3); } + + /// Returns the result of a componentwise bitwise or operation on a uint4x4 matrix and a uint value. + /// Left hand side uint4x4 to use to compute componentwise bitwise or. + /// Right hand side uint to use to compute componentwise bitwise or. + /// uint4x4 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 operator | (uint4x4 lhs, uint rhs) { return new uint4x4 (lhs.c0 | rhs, lhs.c1 | rhs, lhs.c2 | rhs, lhs.c3 | rhs); } + + /// Returns the result of a componentwise bitwise or operation on a uint value and a uint4x4 matrix. + /// Left hand side uint to use to compute componentwise bitwise or. + /// Right hand side uint4x4 to use to compute componentwise bitwise or. + /// uint4x4 result of the componentwise bitwise or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 operator | (uint lhs, uint4x4 rhs) { return new uint4x4 (lhs | rhs.c0, lhs | rhs.c1, lhs | rhs.c2, lhs | rhs.c3); } + + + /// Returns the result of a componentwise bitwise exclusive or operation on two uint4x4 matrices. + /// Left hand side uint4x4 to use to compute componentwise bitwise exclusive or. + /// Right hand side uint4x4 to use to compute componentwise bitwise exclusive or. + /// uint4x4 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 operator ^ (uint4x4 lhs, uint4x4 rhs) { return new uint4x4 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1, lhs.c2 ^ rhs.c2, lhs.c3 ^ rhs.c3); } + + /// Returns the result of a componentwise bitwise exclusive or operation on a uint4x4 matrix and a uint value. + /// Left hand side uint4x4 to use to compute componentwise bitwise exclusive or. + /// Right hand side uint to use to compute componentwise bitwise exclusive or. + /// uint4x4 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 operator ^ (uint4x4 lhs, uint rhs) { return new uint4x4 (lhs.c0 ^ rhs, lhs.c1 ^ rhs, lhs.c2 ^ rhs, lhs.c3 ^ rhs); } + + /// Returns the result of a componentwise bitwise exclusive or operation on a uint value and a uint4x4 matrix. + /// Left hand side uint to use to compute componentwise bitwise exclusive or. + /// Right hand side uint4x4 to use to compute componentwise bitwise exclusive or. + /// uint4x4 result of the componentwise bitwise exclusive or. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 operator ^ (uint lhs, uint4x4 rhs) { return new uint4x4 (lhs ^ rhs.c0, lhs ^ rhs.c1, lhs ^ rhs.c2, lhs ^ rhs.c3); } + + + + /// Returns the uint4 element at a specified index. + unsafe public ref uint4 this[int index] + { + get + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + if ((uint)index >= 4) + throw new System.ArgumentException("index must be between[0...3]"); +#endif + fixed (uint4x4* array = &this) { return ref ((uint4*)array)[index]; } + } + } + + /// Returns true if the uint4x4 is equal to a given uint4x4, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(uint4x4 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2) && c3.Equals(rhs.c3); } + + /// Returns true if the uint4x4 is equal to a given uint4x4, false otherwise. + /// Right hand side argument to compare equality with. + /// The result of the equality comparison. + public override bool Equals(object o) { return o is uint4x4 converted && Equals(converted); } + + + /// Returns a hash code for the uint4x4. + /// The computed hash code. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() { return (int)math.hash(this); } + + + /// Returns a string representation of the uint4x4. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("uint4x4({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11}, {12}, {13}, {14}, {15})", c0.x, c1.x, c2.x, c3.x, c0.y, c1.y, c2.y, c3.y, c0.z, c1.z, c2.z, c3.z, c0.w, c1.w, c2.w, c3.w); + } + + /// Returns a string representation of the uint4x4 using a specified format and culture-specific format information. + /// Format string to use during string formatting. + /// Format provider to use during string formatting. + /// String representation of the value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public string ToString(string format, IFormatProvider formatProvider) + { + return string.Format("uint4x4({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11}, {12}, {13}, {14}, {15})", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c2.x.ToString(format, formatProvider), c3.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c2.y.ToString(format, formatProvider), c3.y.ToString(format, formatProvider), c0.z.ToString(format, formatProvider), c1.z.ToString(format, formatProvider), c2.z.ToString(format, formatProvider), c3.z.ToString(format, formatProvider), c0.w.ToString(format, formatProvider), c1.w.ToString(format, formatProvider), c2.w.ToString(format, formatProvider), c3.w.ToString(format, formatProvider)); + } + + } + + public static partial class math + { + /// Returns a uint4x4 matrix constructed from four uint4 vectors. + /// The matrix column c0 will be set to this value. + /// The matrix column c1 will be set to this value. + /// The matrix column c2 will be set to this value. + /// The matrix column c3 will be set to this value. + /// uint4x4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 uint4x4(uint4 c0, uint4 c1, uint4 c2, uint4 c3) { return new uint4x4(c0, c1, c2, c3); } + + /// Returns a uint4x4 matrix constructed from from 16 uint values given in row-major order. + /// The matrix at row 0, column 0 will be set to this value. + /// The matrix at row 0, column 1 will be set to this value. + /// The matrix at row 0, column 2 will be set to this value. + /// The matrix at row 0, column 3 will be set to this value. + /// The matrix at row 1, column 0 will be set to this value. + /// The matrix at row 1, column 1 will be set to this value. + /// The matrix at row 1, column 2 will be set to this value. + /// The matrix at row 1, column 3 will be set to this value. + /// The matrix at row 2, column 0 will be set to this value. + /// The matrix at row 2, column 1 will be set to this value. + /// The matrix at row 2, column 2 will be set to this value. + /// The matrix at row 2, column 3 will be set to this value. + /// The matrix at row 3, column 0 will be set to this value. + /// The matrix at row 3, column 1 will be set to this value. + /// The matrix at row 3, column 2 will be set to this value. + /// The matrix at row 3, column 3 will be set to this value. + /// uint4x4 constructed from arguments. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 uint4x4(uint m00, uint m01, uint m02, uint m03, + uint m10, uint m11, uint m12, uint m13, + uint m20, uint m21, uint m22, uint m23, + uint m30, uint m31, uint m32, uint m33) + { + return new uint4x4(m00, m01, m02, m03, + m10, m11, m12, m13, + m20, m21, m22, m23, + m30, m31, m32, m33); + } + + /// Returns a uint4x4 matrix constructed from a single uint value by assigning it to every component. + /// uint to convert to uint4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 uint4x4(uint v) { return new uint4x4(v); } + + /// Returns a uint4x4 matrix constructed from a single bool value by converting it to uint and assigning it to every component. + /// bool to convert to uint4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 uint4x4(bool v) { return new uint4x4(v); } + + /// Return a uint4x4 matrix constructed from a bool4x4 matrix by componentwise conversion. + /// bool4x4 to convert to uint4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 uint4x4(bool4x4 v) { return new uint4x4(v); } + + /// Returns a uint4x4 matrix constructed from a single int value by converting it to uint and assigning it to every component. + /// int to convert to uint4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 uint4x4(int v) { return new uint4x4(v); } + + /// Return a uint4x4 matrix constructed from a int4x4 matrix by componentwise conversion. + /// int4x4 to convert to uint4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 uint4x4(int4x4 v) { return new uint4x4(v); } + + /// Returns a uint4x4 matrix constructed from a single float value by converting it to uint and assigning it to every component. + /// float to convert to uint4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 uint4x4(float v) { return new uint4x4(v); } + + /// Return a uint4x4 matrix constructed from a float4x4 matrix by componentwise conversion. + /// float4x4 to convert to uint4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 uint4x4(float4x4 v) { return new uint4x4(v); } + + /// Returns a uint4x4 matrix constructed from a single double value by converting it to uint and assigning it to every component. + /// double to convert to uint4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 uint4x4(double v) { return new uint4x4(v); } + + /// Return a uint4x4 matrix constructed from a double4x4 matrix by componentwise conversion. + /// double4x4 to convert to uint4x4 + /// Converted value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 uint4x4(double4x4 v) { return new uint4x4(v); } + + /// Return the uint4x4 transpose of a uint4x4 matrix. + /// Value to transpose. + /// Transposed value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4x4 transpose(uint4x4 v) + { + return uint4x4( + v.c0.x, v.c0.y, v.c0.z, v.c0.w, + v.c1.x, v.c1.y, v.c1.z, v.c1.w, + v.c2.x, v.c2.y, v.c2.z, v.c2.w, + v.c3.x, v.c3.y, v.c3.z, v.c3.w); + } + + /// Returns a uint hash code of a uint4x4 matrix. + /// Matrix value to hash. + /// uint hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint hash(uint4x4 v) + { + return csum(v.c0 * uint4(0x9C9F0823u, 0x5A9CA13Bu, 0xAFCDD5EFu, 0xA88D187Du) + + v.c1 * uint4(0xCF6EBA1Du, 0x9D88E5A1u, 0xEADF0775u, 0x747A9D7Bu) + + v.c2 * uint4(0x4111F799u, 0xB5F05AF1u, 0xFD80290Bu, 0x8B65ADB7u) + + v.c3 * uint4(0xDFF4F563u, 0x7069770Du, 0xD1224537u, 0xE99ED6F3u)) + 0x48125549u; + } + + /// + /// Returns a uint4 vector hash code of a uint4x4 matrix. + /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash + /// that are only reduced to a narrow uint hash at the very end instead of at every step. + /// + /// Matrix value to hash. + /// uint4 hash of the argument. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint4 hashwide(uint4x4 v) + { + return (v.c0 * uint4(0xEEE2123Bu, 0xE3AD9FE5u, 0xCE1CF8BFu, 0x7BE39F3Bu) + + v.c1 * uint4(0xFAB9913Fu, 0xB4501269u, 0xE04B89FDu, 0xDB3DE101u) + + v.c2 * uint4(0x7B6D1B4Bu, 0x58399E77u, 0x5EAC29C9u, 0xFC6014F9u) + + v.c3 * uint4(0x6BF6693Fu, 0x9D1B1D9Bu, 0xF842F5C1u, 0xA47EC335u)) + 0xA477DF57u; + } + + } +} diff --git a/src/Unity.Mathematics/uint4x4.gen.cs.meta b/src/Unity.Mathematics/uint4x4.gen.cs.meta new file mode 100644 index 00000000..87a47233 --- /dev/null +++ b/src/Unity.Mathematics/uint4x4.gen.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1878454c2f73547909bfcea105ffd941 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/ValidationExceptions.json b/src/ValidationExceptions.json new file mode 100644 index 00000000..3406ed9e --- /dev/null +++ b/src/ValidationExceptions.json @@ -0,0 +1,10 @@ +{ + "ErrorExceptions": [ + { + "ValidationTest": "Package Unity Version Validation", + "ExceptionMessage": "The Unity version requirement is more strict than in the previous version of the package. Increment the minor version of the package to leave patch versions available for previous version. Read more about this error and potential solutions at https://docs.unity3d.com/Packages/com.unity.package-validation-suite@latest/index.html?preview=1&subfolder=/manual/package_unity_version_validation_error.html#the-unity-version-requirement-is-more-strict-than-in-the-previous-version-of-the-package", + "PackageVersion": "1.3.2" + } + ], + "WarningExceptions": [] +} \ No newline at end of file diff --git a/src/Documentation/mathematics.md.meta b/src/ValidationExceptions.json.meta old mode 100755 new mode 100644 similarity index 75% rename from src/Documentation/mathematics.md.meta rename to src/ValidationExceptions.json.meta index d14c6c20..e0483f02 --- a/src/Documentation/mathematics.md.meta +++ b/src/ValidationExceptions.json.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 01ad59e9f33e547b4a150ec586362fb8 +guid: 5ed727127196a4ecc90e24e2cd7af338 TextScriptImporter: externalObjects: {} userData: diff --git a/src/package.json b/src/package.json index db664785..9944d6fe 100755 --- a/src/package.json +++ b/src/package.json @@ -1,10 +1,12 @@ { - "category": "Unity", - "description": "Unity's C# SIMD math library providing vector types and math functions with a shader like syntax. This package is still in experimental phase.", + "name": "com.unity.mathematics", + "displayName": "Mathematics", + "version": "1.3.2", + "unity": "2021.3", + "description": "Unity's C# SIMD math library providing vector types and math functions with a shader like syntax.", "keywords": [ "unity" ], - "name": "com.unity.mathematics", - "unity": "2018.1", - "version": "0.0.1-preview.1" + "dependencies": { + } }